wargerm 0.2.2 → 0.2.6

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.
@@ -1,6 +1,10 @@
1
- import { FC } from 'react';
2
- import { InputProps } from 'antd/lib/input';
1
+ import React from 'react';
2
+ import { InputProps, TextAreaProps } from 'antd/lib/input';
3
3
  export interface IInputProps extends InputProps {
4
4
  }
5
- declare const WInput: FC<IInputProps>;
6
- export default WInput;
5
+ export declare type IndexComponent = React.FC<IInputProps> & {
6
+ TextArea: React.FC<TextAreaProps>;
7
+ Button: React.FC<any>;
8
+ };
9
+ declare const Index: IndexComponent;
10
+ export default Index;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { InputNumberProps } from 'antd/lib/input-number';
3
+ export interface IInputNumberProps extends InputNumberProps {
4
+ }
5
+ declare const WInputNumber: FC<IInputNumberProps>;
6
+ export default WInputNumber;
@@ -12,7 +12,7 @@ export interface ColumnProps {
12
12
  search?: {
13
13
  transform?: (value: any) => Record<string, any>;
14
14
  };
15
- valueType?: 'text' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'image';
15
+ valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'image';
16
16
  valueEnum?: Record<string, any>;
17
17
  options?: Record<string, any>[];
18
18
  fieldProps?: Record<string, any>;
@@ -48,6 +48,7 @@ export interface WFormProps extends FormProps {
48
48
  style?: React.CSSProperties;
49
49
  columns: ColumnProps[];
50
50
  disabled?: boolean;
51
+ disabledHideInSearch?: boolean;
51
52
  onSubmit?: (params: Record<string, any>) => void;
52
53
  onReset?: () => void;
53
54
  formRef?: MutableRefObject<FormInstance>;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import './styles/index.less';
2
2
  export { default as Button } from './components/Button';
3
3
  export { default as IconFont } from './components/IconFont';
4
4
  export { default as Input } from './components/Input';
5
+ export { default as InputNumber } from './components/InputNumber';
5
6
  export { default as Table } from './components/Table';
6
7
  export { default as Checkbox } from './components/Checkbox';
7
8
  export { default as Radio } from './components/Radio';
package/dist/index.esm.js CHANGED
@@ -8,6 +8,8 @@ import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from
8
8
  import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, EditOutlined, EyeOutlined, ExclamationCircleOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
11
+ import 'antd/es/input-number/style';
12
+ import _InputNumber from 'antd/es/input-number';
11
13
  import 'antd/es/pagination/style';
12
14
  import _Pagination from 'antd/es/pagination';
13
15
  import 'antd/es/row/style';
@@ -489,8 +491,18 @@ var WInput = function WInput(props) {
489
491
  return /*#__PURE__*/React.createElement(_Input, _objectSpread2({}, extraProps));
490
492
  };
491
493
 
494
+ var Index = WInput;
495
+ Index.TextArea = _Input.TextArea;
492
496
  WInput.defaultProps = {};
493
497
 
498
+ var WInputNumber = function WInputNumber(props) {
499
+ var extraProps = _extends({}, props);
500
+
501
+ return /*#__PURE__*/React.createElement(_InputNumber, _objectSpread2({}, extraProps));
502
+ };
503
+
504
+ WInputNumber.defaultProps = {};
505
+
494
506
  var _excluded$1 = ["request", "valueEnum", "onLoad", "children"],
495
507
  _excluded2 = ["children"];
496
508
 
@@ -586,8 +598,8 @@ var Option = function Option(props) {
586
598
  return /*#__PURE__*/React.createElement(_Select.Option, _objectSpread2({}, extraProps), children);
587
599
  };
588
600
 
589
- var Index = WSelect;
590
- Index.Option = Option;
601
+ var Index$1 = WSelect;
602
+ Index$1.Option = Option;
591
603
 
592
604
  var WDatePicker = function WDatePicker(props) {
593
605
  var extraProps = _extends({}, props);
@@ -614,8 +626,8 @@ var RangePicker = function RangePicker(props) {
614
626
  };
615
627
 
616
628
  RangePicker.defaultProps = {};
617
- var Index$1 = WDatePicker;
618
- Index$1.RangePicker = RangePicker;
629
+ var Index$2 = WDatePicker;
630
+ Index$2.RangePicker = RangePicker;
619
631
 
620
632
  var WSwitch = function WSwitch(props) {
621
633
  var extraProps = _extends({}, props);
@@ -631,9 +643,9 @@ var WRadio = function WRadio(props) {
631
643
  return /*#__PURE__*/React.createElement(_Radio, _objectSpread2({}, extraProps));
632
644
  };
633
645
 
634
- var Index$2 = WRadio;
635
- Index$2.Group = _Radio.Group;
636
- Index$2.Button = _Radio.Button;
646
+ var Index$3 = WRadio;
647
+ Index$3.Group = _Radio.Group;
648
+ Index$3.Button = _Radio.Button;
637
649
  WRadio.defaultProps = {};
638
650
 
639
651
  var WCheckbox = function WCheckbox(props) {
@@ -643,8 +655,8 @@ var WCheckbox = function WCheckbox(props) {
643
655
  };
644
656
 
645
657
  WCheckbox.defaultProps = {};
646
- var Index$3 = WCheckbox;
647
- Index$3.Group = _Checkbox.Group;
658
+ var Index$4 = WCheckbox;
659
+ Index$4.Group = _Checkbox.Group;
648
660
 
649
661
  function formatNumber(value) {
650
662
  value += '';
@@ -803,8 +815,8 @@ var TreeSelect = function TreeSelect(_ref) {
803
815
  }, props), !props.children ? renderTree(treeData) : props.children);
804
816
  };
805
817
 
806
- var Index$4 = TreeSelect;
807
- Index$4.TreeNode = _TreeSelect.TreeNode;
818
+ var Index$5 = TreeSelect;
819
+ Index$5.TreeNode = _TreeSelect.TreeNode;
808
820
 
809
821
  /*
810
822
  * @Author: lijin
@@ -6575,7 +6587,7 @@ function FrameBox(_ref) {
6575
6587
  }
6576
6588
 
6577
6589
  var _excluded$4 = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection"];
6578
- var RangePicker$1 = Index$1.RangePicker;
6590
+ var RangePicker$1 = Index$2.RangePicker;
6579
6591
  function Table(_ref) {
6580
6592
  var _classnames2;
6581
6593
 
@@ -6713,7 +6725,7 @@ function Table(_ref) {
6713
6725
  name: c.dataIndex,
6714
6726
  label: c.title,
6715
6727
  labelCol: labelCol
6716
- }), /*#__PURE__*/React.createElement(Index, _objectSpread2(_objectSpread2({
6728
+ }), /*#__PURE__*/React.createElement(Index$1, _objectSpread2(_objectSpread2({
6717
6729
  placeholder: "\u8BF7\u9009\u62E9",
6718
6730
  onLoad: function onLoad(opt) {
6719
6731
  setColumnsFields(function (preColumnsFields) {
@@ -6749,7 +6761,7 @@ function Table(_ref) {
6749
6761
  name: c.dataIndex,
6750
6762
  label: c.title,
6751
6763
  labelCol: _labelCol
6752
- }), /*#__PURE__*/React.createElement(Index$4, _objectSpread2(_objectSpread2({
6764
+ }), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
6753
6765
  placeholder: "\u8BF7\u9009\u62E9",
6754
6766
  onLoad: function onLoad(opt) {}
6755
6767
  }, c.fieldProps), _extraProps))));
@@ -6798,7 +6810,7 @@ function Table(_ref) {
6798
6810
  name: c.dataIndex,
6799
6811
  label: c.title,
6800
6812
  labelCol: _labelCol2
6801
- }), /*#__PURE__*/React.createElement(Index$1, _objectSpread2(_objectSpread2(_objectSpread2({
6813
+ }), /*#__PURE__*/React.createElement(Index$2, _objectSpread2(_objectSpread2(_objectSpread2({
6802
6814
  placeholder: "\u8BF7\u8F93\u5165"
6803
6815
  }, picker), showTime), c.fieldProps))));
6804
6816
  } else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
@@ -6871,7 +6883,7 @@ function Table(_ref) {
6871
6883
  name: c.dataIndex,
6872
6884
  label: c.title,
6873
6885
  labelCol: _labelCol4
6874
- }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2({
6886
+ }), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
6875
6887
  options: options
6876
6888
  }, c.fieldProps))));
6877
6889
  } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
@@ -6921,7 +6933,7 @@ function Table(_ref) {
6921
6933
  name: c.dataIndex,
6922
6934
  label: c.title,
6923
6935
  labelCol: _labelCol5
6924
- }), /*#__PURE__*/React.createElement(Index$2.Group, _objectSpread2(_objectSpread2({}, radioButtonProps), {}, {
6936
+ }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({}, radioButtonProps), {}, {
6925
6937
  options: _options
6926
6938
  }, c.fieldProps))));
6927
6939
  } else if (c.valueType === 'switch') {
@@ -7011,7 +7023,7 @@ function Table(_ref) {
7011
7023
  name: c.dataIndex,
7012
7024
  label: c.title,
7013
7025
  labelCol: _labelCol8
7014
- }), /*#__PURE__*/React.createElement(WInput, _objectSpread2({
7026
+ }), /*#__PURE__*/React.createElement(Index, _objectSpread2({
7015
7027
  placeholder: "\u8BF7\u8F93\u5165"
7016
7028
  }, c.fieldProps))));
7017
7029
  }
@@ -7151,7 +7163,7 @@ function Table(_ref) {
7151
7163
  flex: '0 1 auto'
7152
7164
  },
7153
7165
  className: "td"
7154
- }, /*#__PURE__*/React.createElement(Index$3, {
7166
+ }, /*#__PURE__*/React.createElement(Index$4, {
7155
7167
  checked: (_ref2 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref2 === void 0 ? void 0 : _ref2.includes(key),
7156
7168
  onClick: function onClick(e) {
7157
7169
  return e.stopPropagation();
@@ -7189,7 +7201,7 @@ function Table(_ref) {
7189
7201
  flex: '0 1 auto'
7190
7202
  },
7191
7203
  className: "td"
7192
- }, /*#__PURE__*/React.createElement(Index$2, {
7204
+ }, /*#__PURE__*/React.createElement(Index$3, {
7193
7205
  checked: (_ref3 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref3 === void 0 ? void 0 : _ref3.includes(key),
7194
7206
  onClick: function onClick(e) {
7195
7207
  return e.stopPropagation();
@@ -7475,7 +7487,7 @@ function Table(_ref) {
7475
7487
  flex: '0 1 auto'
7476
7488
  },
7477
7489
  className: "td"
7478
- }, /*#__PURE__*/React.createElement(Index$3, {
7490
+ }, /*#__PURE__*/React.createElement(Index$4, {
7479
7491
  checked: dataSource.every(function (record) {
7480
7492
  return selectedRowKeys.includes(typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey]);
7481
7493
  }),
@@ -7520,8 +7532,8 @@ Table.defaultProps = {
7520
7532
  rowKey: 'key'
7521
7533
  };
7522
7534
 
7523
- var _excluded$5 = ["columns", "className", "style", "search", "disabled", "onSubmit", "onReset"];
7524
- var RangePicker$2 = Index$1.RangePicker;
7535
+ var _excluded$5 = ["columns", "className", "style", "search", "disabled", "disabledHideInSearch", "onSubmit", "onReset"];
7536
+ var RangePicker$2 = Index$2.RangePicker;
7525
7537
 
7526
7538
  var WForm = function WForm(props, ref) {
7527
7539
  var columns = props.columns,
@@ -7529,6 +7541,7 @@ var WForm = function WForm(props, ref) {
7529
7541
  style = props.style,
7530
7542
  search = props.search,
7531
7543
  disabled = props.disabled,
7544
+ disabledHideInSearch = props.disabledHideInSearch,
7532
7545
  onSubmit = props.onSubmit,
7533
7546
  onReset = props.onReset,
7534
7547
  extraProps = _objectWithoutProperties(props, _excluded$5);
@@ -7548,7 +7561,7 @@ var WForm = function WForm(props, ref) {
7548
7561
  setColumnsFields = _useState4[1];
7549
7562
 
7550
7563
  var filterFormColumns = columns.filter(function (c) {
7551
- return !c.hideInSearch;
7564
+ return !c.hideInSearch || disabledHideInSearch;
7552
7565
  }).sort(function (a, b) {
7553
7566
  return (b.order || 0) - (a.order || 0);
7554
7567
  });
@@ -7597,7 +7610,7 @@ var WForm = function WForm(props, ref) {
7597
7610
  name: c.dataIndex,
7598
7611
  label: c.title,
7599
7612
  labelCol: labelCol
7600
- }), /*#__PURE__*/React.createElement(Index, _objectSpread2(_objectSpread2({
7613
+ }), /*#__PURE__*/React.createElement(Index$1, _objectSpread2(_objectSpread2({
7601
7614
  placeholder: "\u8BF7\u9009\u62E9",
7602
7615
  disabled: disabled,
7603
7616
  onLoad: function onLoad(opt) {
@@ -7634,7 +7647,7 @@ var WForm = function WForm(props, ref) {
7634
7647
  name: c.dataIndex,
7635
7648
  label: c.title,
7636
7649
  labelCol: _labelCol
7637
- }), /*#__PURE__*/React.createElement(Index$4, _objectSpread2(_objectSpread2({
7650
+ }), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
7638
7651
  disabled: disabled,
7639
7652
  placeholder: "\u8BF7\u9009\u62E9",
7640
7653
  onLoad: function onLoad(opt) {}
@@ -7684,7 +7697,7 @@ var WForm = function WForm(props, ref) {
7684
7697
  name: c.dataIndex,
7685
7698
  label: c.title,
7686
7699
  labelCol: _labelCol2
7687
- }), /*#__PURE__*/React.createElement(Index$1, _objectSpread2(_objectSpread2(_objectSpread2({
7700
+ }), /*#__PURE__*/React.createElement(Index$2, _objectSpread2(_objectSpread2(_objectSpread2({
7688
7701
  disabled: disabled,
7689
7702
  placeholder: "\u8BF7\u8F93\u5165"
7690
7703
  }, picker), showTime), c.fieldProps))));
@@ -7764,7 +7777,7 @@ var WForm = function WForm(props, ref) {
7764
7777
  name: c.dataIndex,
7765
7778
  label: c.title,
7766
7779
  labelCol: _labelCol4
7767
- }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2({
7780
+ }), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
7768
7781
  disabled: disabled,
7769
7782
  options: options
7770
7783
  }, c.fieldProps))));
@@ -7819,7 +7832,7 @@ var WForm = function WForm(props, ref) {
7819
7832
  name: c.dataIndex,
7820
7833
  label: c.title,
7821
7834
  labelCol: _labelCol5
7822
- }), /*#__PURE__*/React.createElement(Index$2.Group, _objectSpread2(_objectSpread2({
7835
+ }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
7823
7836
  disabled: disabled
7824
7837
  }, radioButtonProps), {}, {
7825
7838
  options: _options
@@ -7919,7 +7932,7 @@ var WForm = function WForm(props, ref) {
7919
7932
  label: c.title,
7920
7933
  labelCol: _labelCol8
7921
7934
  }), baseitem)) : null;
7922
- } else {
7935
+ } else if (c.valueType === 'textarea') {
7923
7936
  var _labelCol9 = {};
7924
7937
 
7925
7938
  if (search && search.labelWidth) {
@@ -7941,7 +7954,60 @@ var WForm = function WForm(props, ref) {
7941
7954
  name: c.dataIndex,
7942
7955
  label: c.title,
7943
7956
  labelCol: _labelCol9
7944
- }), /*#__PURE__*/React.createElement(WInput, _objectSpread2({
7957
+ }), /*#__PURE__*/React.createElement(Index.TextArea, _objectSpread2({
7958
+ rows: 4,
7959
+ disabled: disabled,
7960
+ placeholder: "\u8BF7\u8F93\u5165"
7961
+ }, c.fieldProps))));
7962
+ } else if (c.valueType === 'inputNumber') {
7963
+ var _labelCol10 = {};
7964
+
7965
+ if (search && search.labelWidth) {
7966
+ _labelCol10.style = {
7967
+ width: search.labelWidth
7968
+ };
7969
+ }
7970
+
7971
+ return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
7972
+ style: {
7973
+ paddingLeft: '12px',
7974
+ paddingRight: '12px'
7975
+ }
7976
+ }, colProps), {}, {
7977
+ key: c.dataIndex
7978
+ }), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
7979
+ initialValue: c.initialValue
7980
+ }, c.formItemProps), {}, {
7981
+ name: c.dataIndex,
7982
+ label: c.title,
7983
+ labelCol: _labelCol10
7984
+ }), /*#__PURE__*/React.createElement(WInputNumber, _objectSpread2({
7985
+ disabled: disabled,
7986
+ placeholder: "\u8BF7\u8F93\u5165"
7987
+ }, c.fieldProps))));
7988
+ } else {
7989
+ var _labelCol11 = {};
7990
+
7991
+ if (search && search.labelWidth) {
7992
+ _labelCol11.style = {
7993
+ width: search.labelWidth
7994
+ };
7995
+ }
7996
+
7997
+ return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
7998
+ style: {
7999
+ paddingLeft: '12px',
8000
+ paddingRight: '12px'
8001
+ }
8002
+ }, colProps), {}, {
8003
+ key: c.dataIndex
8004
+ }), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
8005
+ initialValue: c.initialValue
8006
+ }, c.formItemProps), {}, {
8007
+ name: c.dataIndex,
8008
+ label: c.title,
8009
+ labelCol: _labelCol11
8010
+ }), /*#__PURE__*/React.createElement(Index, _objectSpread2({
7945
8011
  disabled: disabled,
7946
8012
  placeholder: "\u8BF7\u8F93\u5165"
7947
8013
  }, c.fieldProps))));
@@ -8207,7 +8273,7 @@ Number.defaultProps = {
8207
8273
  height: 40
8208
8274
  };
8209
8275
 
8210
- var Index$5 = function Index(props) {
8276
+ var Index$6 = function Index(props) {
8211
8277
  var count = props.count,
8212
8278
  width = props.width,
8213
8279
  height = props.height,
@@ -8246,7 +8312,7 @@ var Index$5 = function Index(props) {
8246
8312
 
8247
8313
  var _excluded$7 = ["duration"];
8248
8314
 
8249
- var Index$6 = function Index(props) {
8315
+ var Index$7 = function Index(props) {
8250
8316
  var _props$duration = props.duration,
8251
8317
  duration = _props$duration === void 0 ? 2.75 : _props$duration,
8252
8318
  extraProps = _objectWithoutProperties(props, _excluded$7);
@@ -8255,7 +8321,7 @@ var Index$6 = function Index(props) {
8255
8321
  }, extraProps));
8256
8322
  };
8257
8323
 
8258
- Index$6.defaultProps = {};
8324
+ Index$7.defaultProps = {};
8259
8325
 
8260
8326
  var _excluded$8 = ["list", "render", "partSize"];
8261
8327
  var autoScrollInterval = null;
@@ -8333,7 +8399,7 @@ function AutoScroll(props) {
8333
8399
  }));
8334
8400
  }
8335
8401
 
8336
- var Index$7 = function Index(_ref) {
8402
+ var Index$8 = function Index(_ref) {
8337
8403
  var list = _ref.list,
8338
8404
  render = _ref.render,
8339
8405
  _ref$partSize = _ref.partSize,
@@ -8419,7 +8485,7 @@ var _excluded$9 = ["data", "onClick", "renderItem"];
8419
8485
 
8420
8486
  SwiperCore.use([Pagination, Navigation]);
8421
8487
 
8422
- var Index$8 = function Index(props) {
8488
+ var Index$9 = function Index(props) {
8423
8489
  var data = props.data,
8424
8490
  _onClick = props.onClick,
8425
8491
  renderItem = props.renderItem,
@@ -8452,7 +8518,7 @@ var Index$8 = function Index(props) {
8452
8518
  }));
8453
8519
  };
8454
8520
 
8455
- Index$8.defaultProps = {};
8521
+ Index$9.defaultProps = {};
8456
8522
 
8457
8523
  function _extends$1() {
8458
8524
  _extends$1 = Object.assign || function (target) {
@@ -9061,7 +9127,7 @@ function itemRender(route, params, routes, paths) {
9061
9127
  }, route.breadcrumbName);
9062
9128
  }
9063
9129
 
9064
- var Index$9 = function Index(_ref) {
9130
+ var Index$a = function Index(_ref) {
9065
9131
  var routes = _ref.routes,
9066
9132
  className = _ref.className,
9067
9133
  props = _objectWithoutProperties(_ref, _excluded$a);
@@ -9076,7 +9142,7 @@ var Index$9 = function Index(_ref) {
9076
9142
 
9077
9143
  var _excluded$b = ["title", "className", "headerTail", "headerCenter"];
9078
9144
 
9079
- var Index$a = function Index(_ref) {
9145
+ var Index$b = function Index(_ref) {
9080
9146
  var _classNames;
9081
9147
 
9082
9148
  var title = _ref.title,
@@ -9103,7 +9169,7 @@ var Index$a = function Index(_ref) {
9103
9169
  }, props.children))));
9104
9170
  };
9105
9171
 
9106
- Index$a.defaultProps = {};
9172
+ Index$b.defaultProps = {};
9107
9173
 
9108
9174
  var controlShow = function controlShow(f1, f2, value, timer) {
9109
9175
  f1(value);
@@ -9392,17 +9458,10 @@ var ModalForm = function ModalForm(props, ref) {
9392
9458
  }
9393
9459
  };
9394
9460
 
9395
- var done = function done() {
9396
- setVisible(false);
9397
- };
9398
-
9399
9461
  useImperativeHandle(ref, function () {
9400
9462
  return {
9401
9463
  formRef: formRef,
9402
- onSubmit: onSubmit,
9403
- done: done // resetFields,
9404
- // setFieldsValue,
9405
-
9464
+ onSubmit: onSubmit
9406
9465
  };
9407
9466
  });
9408
9467
 
@@ -9442,20 +9501,20 @@ var ModalForm = function ModalForm(props, ref) {
9442
9501
  res = {};
9443
9502
 
9444
9503
  if (!submitMethod) {
9445
- _context2.next = 6;
9504
+ _context2.next = 7;
9446
9505
  break;
9447
9506
  }
9448
9507
 
9449
9508
  _context2.next = 5;
9450
9509
  return submitMethod(values, function () {
9451
- setConfirmLoading(false);
9452
9510
  setVisible(false);
9453
9511
  });
9454
9512
 
9455
9513
  case 5:
9456
9514
  res = _context2.sent;
9515
+ setConfirmLoading(false);
9457
9516
 
9458
- case 6:
9517
+ case 7:
9459
9518
  case "end":
9460
9519
  return _context2.stop();
9461
9520
  }
@@ -9487,6 +9546,7 @@ var ModalForm = function ModalForm(props, ref) {
9487
9546
  ref: formRef,
9488
9547
  disabled: disabled,
9489
9548
  onSubmit: onSubmit,
9549
+ disabledHideInSearch: true,
9490
9550
  search: search,
9491
9551
  columns: columns
9492
9552
  }));
@@ -9520,11 +9580,6 @@ var TabelCard = function TabelCard(props, ref) {
9520
9580
  modalFormConfig = _useState4[0],
9521
9581
  setModalFormConfig = _useState4[1];
9522
9582
 
9523
- var _useState5 = useState({}),
9524
- _useState6 = _slicedToArray(_useState5, 2),
9525
- submitValues = _useState6[0],
9526
- setSubmitValues = _useState6[1];
9527
-
9528
9583
  useImperativeHandle(ref, function () {
9529
9584
  return {};
9530
9585
  });
@@ -9547,7 +9602,7 @@ var TabelCard = function TabelCard(props, ref) {
9547
9602
  type: '编辑',
9548
9603
  record: record,
9549
9604
  modalOnOk: function () {
9550
- var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) {
9605
+ var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values, loading) {
9551
9606
  return regeneratorRuntime.wrap(function _callee$(_context) {
9552
9607
  while (1) {
9553
9608
  switch (_context.prev = _context.next) {
@@ -9561,8 +9616,9 @@ var TabelCard = function TabelCard(props, ref) {
9561
9616
  return item.actionMethod(values, function () {
9562
9617
  var _actionRef$current;
9563
9618
 
9619
+ loading();
9564
9620
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.reload();
9565
- });
9621
+ }, record);
9566
9622
 
9567
9623
  case 3:
9568
9624
  case "end":
@@ -9572,7 +9628,7 @@ var TabelCard = function TabelCard(props, ref) {
9572
9628
  }, _callee);
9573
9629
  }));
9574
9630
 
9575
- function modalOnOk(_x) {
9631
+ function modalOnOk(_x, _x2) {
9576
9632
  return _modalOnOk.apply(this, arguments);
9577
9633
  }
9578
9634
 
@@ -9708,7 +9764,7 @@ var TabelCard = function TabelCard(props, ref) {
9708
9764
  type: '新增',
9709
9765
  record: {},
9710
9766
  modalOnOk: function () {
9711
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values) {
9767
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
9712
9768
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
9713
9769
  while (1) {
9714
9770
  switch (_context5.prev = _context5.next) {
@@ -9722,7 +9778,8 @@ var TabelCard = function TabelCard(props, ref) {
9722
9778
  return item.actionMethod(values, function () {
9723
9779
  var _actionRef$current4;
9724
9780
 
9725
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9781
+ loading();
9782
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9726
9783
  });
9727
9784
 
9728
9785
  case 3:
@@ -9733,7 +9790,7 @@ var TabelCard = function TabelCard(props, ref) {
9733
9790
  }, _callee5);
9734
9791
  }));
9735
9792
 
9736
- function modalOnOk(_x2) {
9793
+ function modalOnOk(_x3, _x4) {
9737
9794
  return _modalOnOk3.apply(this, arguments);
9738
9795
  }
9739
9796
 
@@ -9754,7 +9811,7 @@ var TabelCard = function TabelCard(props, ref) {
9754
9811
  });
9755
9812
  }
9756
9813
  });
9757
- }, [submitValues, actionRef]);
9814
+ }, [actionRef]);
9758
9815
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
9759
9816
  ref: formRef,
9760
9817
  title: modalFormConfig.type || '新增',
@@ -9769,17 +9826,14 @@ var TabelCard = function TabelCard(props, ref) {
9769
9826
  switch (_context6.prev = _context6.next) {
9770
9827
  case 0:
9771
9828
  if (!modalFormConfig.modalOnOk) {
9772
- _context6.next = 4;
9829
+ _context6.next = 3;
9773
9830
  break;
9774
9831
  }
9775
9832
 
9776
9833
  _context6.next = 3;
9777
- return modalFormConfig.modalOnOk(values);
9834
+ return modalFormConfig.modalOnOk(values, loading);
9778
9835
 
9779
9836
  case 3:
9780
- loading();
9781
-
9782
- case 4:
9783
9837
  case "end":
9784
9838
  return _context6.stop();
9785
9839
  }
@@ -9787,7 +9841,7 @@ var TabelCard = function TabelCard(props, ref) {
9787
9841
  }, _callee6);
9788
9842
  }));
9789
9843
 
9790
- function submitMethod(_x3, _x4) {
9844
+ function submitMethod(_x5, _x6) {
9791
9845
  return _submitMethod.apply(this, arguments);
9792
9846
  }
9793
9847
 
@@ -9805,14 +9859,14 @@ var TabelCard = function TabelCard(props, ref) {
9805
9859
  options: false,
9806
9860
  toolBarRender: false,
9807
9861
  request: request,
9808
- columns: [].concat(_toConsumableArray(columns || []), [{
9862
+ columns: tableAction && (tableAction === null || tableAction === void 0 ? void 0 : tableAction.length) > 0 ? [].concat(_toConsumableArray(columns || []), [{
9809
9863
  title: '操作',
9810
9864
  dataIndex: 'option',
9811
9865
  valueType: 'option',
9812
9866
  render: function render(_, record, index) {
9813
9867
  return tableActionDom(record, index);
9814
9868
  }
9815
- }]),
9869
+ }]) : columns || [],
9816
9870
  search: {
9817
9871
  labelWidth: 'auto',
9818
9872
  optionRender: function optionRender(searchConfig, formProps, dom) {
@@ -9827,4 +9881,4 @@ var TabelCard = function TabelCard(props, ref) {
9827
9881
 
9828
9882
  var index$1 = /*#__PURE__*/React.forwardRef(TabelCard);
9829
9883
 
9830
- export { Index$7 as AutoScroll, Index$9 as Breadcrumb, WButton as Button, Index$a as Card, Index$3 as Checkbox, Index$6 as CountUp, Index$1 as DatePicker, index as IconFont, WInput as Input, Modal, ModalForm$1 as ModalForm, Index$5 as Number, NumericInput, Index$2 as Radio, Index as Select, Index$8 as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$4 as TreeSelect, WForm$1 as WForm };
9884
+ export { Index$8 as AutoScroll, Index$a as Breadcrumb, WButton as Button, Index$b as Card, Index$4 as Checkbox, Index$7 as CountUp, Index$2 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Index$6 as Number, NumericInput, Index$3 as Radio, Index$1 as Select, Index$9 as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$5 as TreeSelect, WForm$1 as WForm };
package/dist/index.js CHANGED
@@ -12,6 +12,8 @@ var React = require('react');
12
12
  var icons = require('@ant-design/icons');
13
13
  require('antd/es/input/style');
14
14
  var _Input = require('antd/es/input');
15
+ require('antd/es/input-number/style');
16
+ var _InputNumber = require('antd/es/input-number');
15
17
  require('antd/es/pagination/style');
16
18
  var _Pagination = require('antd/es/pagination');
17
19
  require('antd/es/row/style');
@@ -55,6 +57,7 @@ var _Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(_Dropdown);
55
57
  var _Menu__default = /*#__PURE__*/_interopDefaultLegacy(_Menu);
56
58
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
57
59
  var _Input__default = /*#__PURE__*/_interopDefaultLegacy(_Input);
60
+ var _InputNumber__default = /*#__PURE__*/_interopDefaultLegacy(_InputNumber);
58
61
  var _Pagination__default = /*#__PURE__*/_interopDefaultLegacy(_Pagination);
59
62
  var _Row__default = /*#__PURE__*/_interopDefaultLegacy(_Row);
60
63
  var _Spin__default = /*#__PURE__*/_interopDefaultLegacy(_Spin);
@@ -521,8 +524,18 @@ var WInput = function WInput(props) {
521
524
  return /*#__PURE__*/React__default['default'].createElement(_Input__default['default'], _objectSpread2({}, extraProps));
522
525
  };
523
526
 
527
+ var Index = WInput;
528
+ Index.TextArea = _Input__default['default'].TextArea;
524
529
  WInput.defaultProps = {};
525
530
 
531
+ var WInputNumber = function WInputNumber(props) {
532
+ var extraProps = _extends({}, props);
533
+
534
+ return /*#__PURE__*/React__default['default'].createElement(_InputNumber__default['default'], _objectSpread2({}, extraProps));
535
+ };
536
+
537
+ WInputNumber.defaultProps = {};
538
+
526
539
  var _excluded$1 = ["request", "valueEnum", "onLoad", "children"],
527
540
  _excluded2 = ["children"];
528
541
 
@@ -618,8 +631,8 @@ var Option = function Option(props) {
618
631
  return /*#__PURE__*/React__default['default'].createElement(_Select__default['default'].Option, _objectSpread2({}, extraProps), children);
619
632
  };
620
633
 
621
- var Index = WSelect;
622
- Index.Option = Option;
634
+ var Index$1 = WSelect;
635
+ Index$1.Option = Option;
623
636
 
624
637
  var WDatePicker = function WDatePicker(props) {
625
638
  var extraProps = _extends({}, props);
@@ -646,8 +659,8 @@ var RangePicker = function RangePicker(props) {
646
659
  };
647
660
 
648
661
  RangePicker.defaultProps = {};
649
- var Index$1 = WDatePicker;
650
- Index$1.RangePicker = RangePicker;
662
+ var Index$2 = WDatePicker;
663
+ Index$2.RangePicker = RangePicker;
651
664
 
652
665
  var WSwitch = function WSwitch(props) {
653
666
  var extraProps = _extends({}, props);
@@ -663,9 +676,9 @@ var WRadio = function WRadio(props) {
663
676
  return /*#__PURE__*/React__default['default'].createElement(_Radio__default['default'], _objectSpread2({}, extraProps));
664
677
  };
665
678
 
666
- var Index$2 = WRadio;
667
- Index$2.Group = _Radio__default['default'].Group;
668
- Index$2.Button = _Radio__default['default'].Button;
679
+ var Index$3 = WRadio;
680
+ Index$3.Group = _Radio__default['default'].Group;
681
+ Index$3.Button = _Radio__default['default'].Button;
669
682
  WRadio.defaultProps = {};
670
683
 
671
684
  var WCheckbox = function WCheckbox(props) {
@@ -675,8 +688,8 @@ var WCheckbox = function WCheckbox(props) {
675
688
  };
676
689
 
677
690
  WCheckbox.defaultProps = {};
678
- var Index$3 = WCheckbox;
679
- Index$3.Group = _Checkbox__default['default'].Group;
691
+ var Index$4 = WCheckbox;
692
+ Index$4.Group = _Checkbox__default['default'].Group;
680
693
 
681
694
  function formatNumber(value) {
682
695
  value += '';
@@ -835,8 +848,8 @@ var TreeSelect = function TreeSelect(_ref) {
835
848
  }, props), !props.children ? renderTree(treeData) : props.children);
836
849
  };
837
850
 
838
- var Index$4 = TreeSelect;
839
- Index$4.TreeNode = _TreeSelect__default['default'].TreeNode;
851
+ var Index$5 = TreeSelect;
852
+ Index$5.TreeNode = _TreeSelect__default['default'].TreeNode;
840
853
 
841
854
  /*
842
855
  * @Author: lijin
@@ -6607,7 +6620,7 @@ function FrameBox(_ref) {
6607
6620
  }
6608
6621
 
6609
6622
  var _excluded$4 = ["columns", "dataSource", "request", "onLoad", "params", "onSubmit", "rowKey", "onRow", "className", "rowClassName", "rowSelection", "style", "tbodyStyle", "thStyle", "border", "scroll", "pagination", "search", "frameBoxTable", "frameBoxDirection"];
6610
- var RangePicker$1 = Index$1.RangePicker;
6623
+ var RangePicker$1 = Index$2.RangePicker;
6611
6624
  function Table(_ref) {
6612
6625
  var _classnames2;
6613
6626
 
@@ -6745,7 +6758,7 @@ function Table(_ref) {
6745
6758
  name: c.dataIndex,
6746
6759
  label: c.title,
6747
6760
  labelCol: labelCol
6748
- }), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2(_objectSpread2({
6761
+ }), /*#__PURE__*/React__default['default'].createElement(Index$1, _objectSpread2(_objectSpread2({
6749
6762
  placeholder: "\u8BF7\u9009\u62E9",
6750
6763
  onLoad: function onLoad(opt) {
6751
6764
  setColumnsFields(function (preColumnsFields) {
@@ -6781,7 +6794,7 @@ function Table(_ref) {
6781
6794
  name: c.dataIndex,
6782
6795
  label: c.title,
6783
6796
  labelCol: _labelCol
6784
- }), /*#__PURE__*/React__default['default'].createElement(Index$4, _objectSpread2(_objectSpread2({
6797
+ }), /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2(_objectSpread2({
6785
6798
  placeholder: "\u8BF7\u9009\u62E9",
6786
6799
  onLoad: function onLoad(opt) {}
6787
6800
  }, c.fieldProps), _extraProps))));
@@ -6830,7 +6843,7 @@ function Table(_ref) {
6830
6843
  name: c.dataIndex,
6831
6844
  label: c.title,
6832
6845
  labelCol: _labelCol2
6833
- }), /*#__PURE__*/React__default['default'].createElement(Index$1, _objectSpread2(_objectSpread2(_objectSpread2({
6846
+ }), /*#__PURE__*/React__default['default'].createElement(Index$2, _objectSpread2(_objectSpread2(_objectSpread2({
6834
6847
  placeholder: "\u8BF7\u8F93\u5165"
6835
6848
  }, picker), showTime), c.fieldProps))));
6836
6849
  } else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
@@ -6903,7 +6916,7 @@ function Table(_ref) {
6903
6916
  name: c.dataIndex,
6904
6917
  label: c.title,
6905
6918
  labelCol: _labelCol4
6906
- }), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2({
6919
+ }), /*#__PURE__*/React__default['default'].createElement(Index$4.Group, _objectSpread2({
6907
6920
  options: options
6908
6921
  }, c.fieldProps))));
6909
6922
  } else if (c.valueType === 'radio' || c.valueType === 'radioButton') {
@@ -6953,7 +6966,7 @@ function Table(_ref) {
6953
6966
  name: c.dataIndex,
6954
6967
  label: c.title,
6955
6968
  labelCol: _labelCol5
6956
- }), /*#__PURE__*/React__default['default'].createElement(Index$2.Group, _objectSpread2(_objectSpread2({}, radioButtonProps), {}, {
6969
+ }), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2(_objectSpread2({}, radioButtonProps), {}, {
6957
6970
  options: _options
6958
6971
  }, c.fieldProps))));
6959
6972
  } else if (c.valueType === 'switch') {
@@ -7043,7 +7056,7 @@ function Table(_ref) {
7043
7056
  name: c.dataIndex,
7044
7057
  label: c.title,
7045
7058
  labelCol: _labelCol8
7046
- }), /*#__PURE__*/React__default['default'].createElement(WInput, _objectSpread2({
7059
+ }), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2({
7047
7060
  placeholder: "\u8BF7\u8F93\u5165"
7048
7061
  }, c.fieldProps))));
7049
7062
  }
@@ -7183,7 +7196,7 @@ function Table(_ref) {
7183
7196
  flex: '0 1 auto'
7184
7197
  },
7185
7198
  className: "td"
7186
- }, /*#__PURE__*/React__default['default'].createElement(Index$3, {
7199
+ }, /*#__PURE__*/React__default['default'].createElement(Index$4, {
7187
7200
  checked: (_ref2 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref2 === void 0 ? void 0 : _ref2.includes(key),
7188
7201
  onClick: function onClick(e) {
7189
7202
  return e.stopPropagation();
@@ -7221,7 +7234,7 @@ function Table(_ref) {
7221
7234
  flex: '0 1 auto'
7222
7235
  },
7223
7236
  className: "td"
7224
- }, /*#__PURE__*/React__default['default'].createElement(Index$2, {
7237
+ }, /*#__PURE__*/React__default['default'].createElement(Index$3, {
7225
7238
  checked: (_ref3 = [].concat(_toConsumableArray((rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []), _toConsumableArray(selectedRowKeys))) === null || _ref3 === void 0 ? void 0 : _ref3.includes(key),
7226
7239
  onClick: function onClick(e) {
7227
7240
  return e.stopPropagation();
@@ -7507,7 +7520,7 @@ function Table(_ref) {
7507
7520
  flex: '0 1 auto'
7508
7521
  },
7509
7522
  className: "td"
7510
- }, /*#__PURE__*/React__default['default'].createElement(Index$3, {
7523
+ }, /*#__PURE__*/React__default['default'].createElement(Index$4, {
7511
7524
  checked: dataSource.every(function (record) {
7512
7525
  return selectedRowKeys.includes(typeof rowKey === 'function' ? record[rowKey(record)] : record[rowKey]);
7513
7526
  }),
@@ -7552,8 +7565,8 @@ Table.defaultProps = {
7552
7565
  rowKey: 'key'
7553
7566
  };
7554
7567
 
7555
- var _excluded$5 = ["columns", "className", "style", "search", "disabled", "onSubmit", "onReset"];
7556
- var RangePicker$2 = Index$1.RangePicker;
7568
+ var _excluded$5 = ["columns", "className", "style", "search", "disabled", "disabledHideInSearch", "onSubmit", "onReset"];
7569
+ var RangePicker$2 = Index$2.RangePicker;
7557
7570
 
7558
7571
  var WForm = function WForm(props, ref) {
7559
7572
  var columns = props.columns,
@@ -7561,6 +7574,7 @@ var WForm = function WForm(props, ref) {
7561
7574
  style = props.style,
7562
7575
  search = props.search,
7563
7576
  disabled = props.disabled,
7577
+ disabledHideInSearch = props.disabledHideInSearch,
7564
7578
  onSubmit = props.onSubmit,
7565
7579
  onReset = props.onReset,
7566
7580
  extraProps = _objectWithoutProperties(props, _excluded$5);
@@ -7580,7 +7594,7 @@ var WForm = function WForm(props, ref) {
7580
7594
  setColumnsFields = _useState4[1];
7581
7595
 
7582
7596
  var filterFormColumns = columns.filter(function (c) {
7583
- return !c.hideInSearch;
7597
+ return !c.hideInSearch || disabledHideInSearch;
7584
7598
  }).sort(function (a, b) {
7585
7599
  return (b.order || 0) - (a.order || 0);
7586
7600
  });
@@ -7629,7 +7643,7 @@ var WForm = function WForm(props, ref) {
7629
7643
  name: c.dataIndex,
7630
7644
  label: c.title,
7631
7645
  labelCol: labelCol
7632
- }), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2(_objectSpread2({
7646
+ }), /*#__PURE__*/React__default['default'].createElement(Index$1, _objectSpread2(_objectSpread2({
7633
7647
  placeholder: "\u8BF7\u9009\u62E9",
7634
7648
  disabled: disabled,
7635
7649
  onLoad: function onLoad(opt) {
@@ -7666,7 +7680,7 @@ var WForm = function WForm(props, ref) {
7666
7680
  name: c.dataIndex,
7667
7681
  label: c.title,
7668
7682
  labelCol: _labelCol
7669
- }), /*#__PURE__*/React__default['default'].createElement(Index$4, _objectSpread2(_objectSpread2({
7683
+ }), /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2(_objectSpread2({
7670
7684
  disabled: disabled,
7671
7685
  placeholder: "\u8BF7\u9009\u62E9",
7672
7686
  onLoad: function onLoad(opt) {}
@@ -7716,7 +7730,7 @@ var WForm = function WForm(props, ref) {
7716
7730
  name: c.dataIndex,
7717
7731
  label: c.title,
7718
7732
  labelCol: _labelCol2
7719
- }), /*#__PURE__*/React__default['default'].createElement(Index$1, _objectSpread2(_objectSpread2(_objectSpread2({
7733
+ }), /*#__PURE__*/React__default['default'].createElement(Index$2, _objectSpread2(_objectSpread2(_objectSpread2({
7720
7734
  disabled: disabled,
7721
7735
  placeholder: "\u8BF7\u8F93\u5165"
7722
7736
  }, picker), showTime), c.fieldProps))));
@@ -7796,7 +7810,7 @@ var WForm = function WForm(props, ref) {
7796
7810
  name: c.dataIndex,
7797
7811
  label: c.title,
7798
7812
  labelCol: _labelCol4
7799
- }), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2({
7813
+ }), /*#__PURE__*/React__default['default'].createElement(Index$4.Group, _objectSpread2({
7800
7814
  disabled: disabled,
7801
7815
  options: options
7802
7816
  }, c.fieldProps))));
@@ -7851,7 +7865,7 @@ var WForm = function WForm(props, ref) {
7851
7865
  name: c.dataIndex,
7852
7866
  label: c.title,
7853
7867
  labelCol: _labelCol5
7854
- }), /*#__PURE__*/React__default['default'].createElement(Index$2.Group, _objectSpread2(_objectSpread2({
7868
+ }), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2(_objectSpread2({
7855
7869
  disabled: disabled
7856
7870
  }, radioButtonProps), {}, {
7857
7871
  options: _options
@@ -7951,7 +7965,7 @@ var WForm = function WForm(props, ref) {
7951
7965
  label: c.title,
7952
7966
  labelCol: _labelCol8
7953
7967
  }), baseitem)) : null;
7954
- } else {
7968
+ } else if (c.valueType === 'textarea') {
7955
7969
  var _labelCol9 = {};
7956
7970
 
7957
7971
  if (search && search.labelWidth) {
@@ -7973,7 +7987,60 @@ var WForm = function WForm(props, ref) {
7973
7987
  name: c.dataIndex,
7974
7988
  label: c.title,
7975
7989
  labelCol: _labelCol9
7976
- }), /*#__PURE__*/React__default['default'].createElement(WInput, _objectSpread2({
7990
+ }), /*#__PURE__*/React__default['default'].createElement(Index.TextArea, _objectSpread2({
7991
+ rows: 4,
7992
+ disabled: disabled,
7993
+ placeholder: "\u8BF7\u8F93\u5165"
7994
+ }, c.fieldProps))));
7995
+ } else if (c.valueType === 'inputNumber') {
7996
+ var _labelCol10 = {};
7997
+
7998
+ if (search && search.labelWidth) {
7999
+ _labelCol10.style = {
8000
+ width: search.labelWidth
8001
+ };
8002
+ }
8003
+
8004
+ return /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
8005
+ style: {
8006
+ paddingLeft: '12px',
8007
+ paddingRight: '12px'
8008
+ }
8009
+ }, colProps), {}, {
8010
+ key: c.dataIndex
8011
+ }), /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread2(_objectSpread2({
8012
+ initialValue: c.initialValue
8013
+ }, c.formItemProps), {}, {
8014
+ name: c.dataIndex,
8015
+ label: c.title,
8016
+ labelCol: _labelCol10
8017
+ }), /*#__PURE__*/React__default['default'].createElement(WInputNumber, _objectSpread2({
8018
+ disabled: disabled,
8019
+ placeholder: "\u8BF7\u8F93\u5165"
8020
+ }, c.fieldProps))));
8021
+ } else {
8022
+ var _labelCol11 = {};
8023
+
8024
+ if (search && search.labelWidth) {
8025
+ _labelCol11.style = {
8026
+ width: search.labelWidth
8027
+ };
8028
+ }
8029
+
8030
+ return /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
8031
+ style: {
8032
+ paddingLeft: '12px',
8033
+ paddingRight: '12px'
8034
+ }
8035
+ }, colProps), {}, {
8036
+ key: c.dataIndex
8037
+ }), /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread2(_objectSpread2({
8038
+ initialValue: c.initialValue
8039
+ }, c.formItemProps), {}, {
8040
+ name: c.dataIndex,
8041
+ label: c.title,
8042
+ labelCol: _labelCol11
8043
+ }), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2({
7977
8044
  disabled: disabled,
7978
8045
  placeholder: "\u8BF7\u8F93\u5165"
7979
8046
  }, c.fieldProps))));
@@ -8239,7 +8306,7 @@ Number.defaultProps = {
8239
8306
  height: 40
8240
8307
  };
8241
8308
 
8242
- var Index$5 = function Index(props) {
8309
+ var Index$6 = function Index(props) {
8243
8310
  var count = props.count,
8244
8311
  width = props.width,
8245
8312
  height = props.height,
@@ -8278,7 +8345,7 @@ var Index$5 = function Index(props) {
8278
8345
 
8279
8346
  var _excluded$7 = ["duration"];
8280
8347
 
8281
- var Index$6 = function Index(props) {
8348
+ var Index$7 = function Index(props) {
8282
8349
  var _props$duration = props.duration,
8283
8350
  duration = _props$duration === void 0 ? 2.75 : _props$duration,
8284
8351
  extraProps = _objectWithoutProperties(props, _excluded$7);
@@ -8287,7 +8354,7 @@ var Index$6 = function Index(props) {
8287
8354
  }, extraProps));
8288
8355
  };
8289
8356
 
8290
- Index$6.defaultProps = {};
8357
+ Index$7.defaultProps = {};
8291
8358
 
8292
8359
  var _excluded$8 = ["list", "render", "partSize"];
8293
8360
  var autoScrollInterval = null;
@@ -8365,7 +8432,7 @@ function AutoScroll(props) {
8365
8432
  }));
8366
8433
  }
8367
8434
 
8368
- var Index$7 = function Index(_ref) {
8435
+ var Index$8 = function Index(_ref) {
8369
8436
  var list = _ref.list,
8370
8437
  render = _ref.render,
8371
8438
  _ref$partSize = _ref.partSize,
@@ -8451,7 +8518,7 @@ var _excluded$9 = ["data", "onClick", "renderItem"];
8451
8518
 
8452
8519
  SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation]);
8453
8520
 
8454
- var Index$8 = function Index(props) {
8521
+ var Index$9 = function Index(props) {
8455
8522
  var data = props.data,
8456
8523
  _onClick = props.onClick,
8457
8524
  renderItem = props.renderItem,
@@ -8484,7 +8551,7 @@ var Index$8 = function Index(props) {
8484
8551
  }));
8485
8552
  };
8486
8553
 
8487
- Index$8.defaultProps = {};
8554
+ Index$9.defaultProps = {};
8488
8555
 
8489
8556
  function _extends$1() {
8490
8557
  _extends$1 = Object.assign || function (target) {
@@ -9093,7 +9160,7 @@ function itemRender(route, params, routes, paths) {
9093
9160
  }, route.breadcrumbName);
9094
9161
  }
9095
9162
 
9096
- var Index$9 = function Index(_ref) {
9163
+ var Index$a = function Index(_ref) {
9097
9164
  var routes = _ref.routes,
9098
9165
  className = _ref.className,
9099
9166
  props = _objectWithoutProperties(_ref, _excluded$a);
@@ -9108,7 +9175,7 @@ var Index$9 = function Index(_ref) {
9108
9175
 
9109
9176
  var _excluded$b = ["title", "className", "headerTail", "headerCenter"];
9110
9177
 
9111
- var Index$a = function Index(_ref) {
9178
+ var Index$b = function Index(_ref) {
9112
9179
  var _classNames;
9113
9180
 
9114
9181
  var title = _ref.title,
@@ -9135,7 +9202,7 @@ var Index$a = function Index(_ref) {
9135
9202
  }, props.children))));
9136
9203
  };
9137
9204
 
9138
- Index$a.defaultProps = {};
9205
+ Index$b.defaultProps = {};
9139
9206
 
9140
9207
  var controlShow = function controlShow(f1, f2, value, timer) {
9141
9208
  f1(value);
@@ -9424,17 +9491,10 @@ var ModalForm = function ModalForm(props, ref) {
9424
9491
  }
9425
9492
  };
9426
9493
 
9427
- var done = function done() {
9428
- setVisible(false);
9429
- };
9430
-
9431
9494
  React.useImperativeHandle(ref, function () {
9432
9495
  return {
9433
9496
  formRef: formRef,
9434
- onSubmit: onSubmit,
9435
- done: done // resetFields,
9436
- // setFieldsValue,
9437
-
9497
+ onSubmit: onSubmit
9438
9498
  };
9439
9499
  });
9440
9500
 
@@ -9474,20 +9534,20 @@ var ModalForm = function ModalForm(props, ref) {
9474
9534
  res = {};
9475
9535
 
9476
9536
  if (!submitMethod) {
9477
- _context2.next = 6;
9537
+ _context2.next = 7;
9478
9538
  break;
9479
9539
  }
9480
9540
 
9481
9541
  _context2.next = 5;
9482
9542
  return submitMethod(values, function () {
9483
- setConfirmLoading(false);
9484
9543
  setVisible(false);
9485
9544
  });
9486
9545
 
9487
9546
  case 5:
9488
9547
  res = _context2.sent;
9548
+ setConfirmLoading(false);
9489
9549
 
9490
- case 6:
9550
+ case 7:
9491
9551
  case "end":
9492
9552
  return _context2.stop();
9493
9553
  }
@@ -9519,6 +9579,7 @@ var ModalForm = function ModalForm(props, ref) {
9519
9579
  ref: formRef,
9520
9580
  disabled: disabled,
9521
9581
  onSubmit: onSubmit,
9582
+ disabledHideInSearch: true,
9522
9583
  search: search,
9523
9584
  columns: columns
9524
9585
  }));
@@ -9552,11 +9613,6 @@ var TabelCard = function TabelCard(props, ref) {
9552
9613
  modalFormConfig = _useState4[0],
9553
9614
  setModalFormConfig = _useState4[1];
9554
9615
 
9555
- var _useState5 = React.useState({}),
9556
- _useState6 = _slicedToArray(_useState5, 2),
9557
- submitValues = _useState6[0],
9558
- setSubmitValues = _useState6[1];
9559
-
9560
9616
  React.useImperativeHandle(ref, function () {
9561
9617
  return {};
9562
9618
  });
@@ -9579,7 +9635,7 @@ var TabelCard = function TabelCard(props, ref) {
9579
9635
  type: '编辑',
9580
9636
  record: record,
9581
9637
  modalOnOk: function () {
9582
- var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) {
9638
+ var _modalOnOk = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values, loading) {
9583
9639
  return regeneratorRuntime.wrap(function _callee$(_context) {
9584
9640
  while (1) {
9585
9641
  switch (_context.prev = _context.next) {
@@ -9593,8 +9649,9 @@ var TabelCard = function TabelCard(props, ref) {
9593
9649
  return item.actionMethod(values, function () {
9594
9650
  var _actionRef$current;
9595
9651
 
9652
+ loading();
9596
9653
  actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.reload();
9597
- });
9654
+ }, record);
9598
9655
 
9599
9656
  case 3:
9600
9657
  case "end":
@@ -9604,7 +9661,7 @@ var TabelCard = function TabelCard(props, ref) {
9604
9661
  }, _callee);
9605
9662
  }));
9606
9663
 
9607
- function modalOnOk(_x) {
9664
+ function modalOnOk(_x, _x2) {
9608
9665
  return _modalOnOk.apply(this, arguments);
9609
9666
  }
9610
9667
 
@@ -9740,7 +9797,7 @@ var TabelCard = function TabelCard(props, ref) {
9740
9797
  type: '新增',
9741
9798
  record: {},
9742
9799
  modalOnOk: function () {
9743
- var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values) {
9800
+ var _modalOnOk3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(values, loading) {
9744
9801
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
9745
9802
  while (1) {
9746
9803
  switch (_context5.prev = _context5.next) {
@@ -9754,7 +9811,8 @@ var TabelCard = function TabelCard(props, ref) {
9754
9811
  return item.actionMethod(values, function () {
9755
9812
  var _actionRef$current4;
9756
9813
 
9757
- return actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9814
+ loading();
9815
+ actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : _actionRef$current4.reload();
9758
9816
  });
9759
9817
 
9760
9818
  case 3:
@@ -9765,7 +9823,7 @@ var TabelCard = function TabelCard(props, ref) {
9765
9823
  }, _callee5);
9766
9824
  }));
9767
9825
 
9768
- function modalOnOk(_x2) {
9826
+ function modalOnOk(_x3, _x4) {
9769
9827
  return _modalOnOk3.apply(this, arguments);
9770
9828
  }
9771
9829
 
@@ -9786,7 +9844,7 @@ var TabelCard = function TabelCard(props, ref) {
9786
9844
  });
9787
9845
  }
9788
9846
  });
9789
- }, [submitValues, actionRef]);
9847
+ }, [actionRef]);
9790
9848
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
9791
9849
  ref: formRef,
9792
9850
  title: modalFormConfig.type || '新增',
@@ -9801,17 +9859,14 @@ var TabelCard = function TabelCard(props, ref) {
9801
9859
  switch (_context6.prev = _context6.next) {
9802
9860
  case 0:
9803
9861
  if (!modalFormConfig.modalOnOk) {
9804
- _context6.next = 4;
9862
+ _context6.next = 3;
9805
9863
  break;
9806
9864
  }
9807
9865
 
9808
9866
  _context6.next = 3;
9809
- return modalFormConfig.modalOnOk(values);
9867
+ return modalFormConfig.modalOnOk(values, loading);
9810
9868
 
9811
9869
  case 3:
9812
- loading();
9813
-
9814
- case 4:
9815
9870
  case "end":
9816
9871
  return _context6.stop();
9817
9872
  }
@@ -9819,7 +9874,7 @@ var TabelCard = function TabelCard(props, ref) {
9819
9874
  }, _callee6);
9820
9875
  }));
9821
9876
 
9822
- function submitMethod(_x3, _x4) {
9877
+ function submitMethod(_x5, _x6) {
9823
9878
  return _submitMethod.apply(this, arguments);
9824
9879
  }
9825
9880
 
@@ -9837,14 +9892,14 @@ var TabelCard = function TabelCard(props, ref) {
9837
9892
  options: false,
9838
9893
  toolBarRender: false,
9839
9894
  request: request,
9840
- columns: [].concat(_toConsumableArray(columns || []), [{
9895
+ columns: tableAction && (tableAction === null || tableAction === void 0 ? void 0 : tableAction.length) > 0 ? [].concat(_toConsumableArray(columns || []), [{
9841
9896
  title: '操作',
9842
9897
  dataIndex: 'option',
9843
9898
  valueType: 'option',
9844
9899
  render: function render(_, record, index) {
9845
9900
  return tableActionDom(record, index);
9846
9901
  }
9847
- }]),
9902
+ }]) : columns || [],
9848
9903
  search: {
9849
9904
  labelWidth: 'auto',
9850
9905
  optionRender: function optionRender(searchConfig, formProps, dom) {
@@ -9859,24 +9914,25 @@ var TabelCard = function TabelCard(props, ref) {
9859
9914
 
9860
9915
  var index$1 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
9861
9916
 
9862
- exports.AutoScroll = Index$7;
9863
- exports.Breadcrumb = Index$9;
9917
+ exports.AutoScroll = Index$8;
9918
+ exports.Breadcrumb = Index$a;
9864
9919
  exports.Button = WButton;
9865
- exports.Card = Index$a;
9866
- exports.Checkbox = Index$3;
9867
- exports.CountUp = Index$6;
9868
- exports.DatePicker = Index$1;
9920
+ exports.Card = Index$b;
9921
+ exports.Checkbox = Index$4;
9922
+ exports.CountUp = Index$7;
9923
+ exports.DatePicker = Index$2;
9869
9924
  exports.IconFont = index;
9870
- exports.Input = WInput;
9925
+ exports.Input = Index;
9926
+ exports.InputNumber = WInputNumber;
9871
9927
  exports.Modal = Modal;
9872
9928
  exports.ModalForm = ModalForm$1;
9873
- exports.Number = Index$5;
9929
+ exports.Number = Index$6;
9874
9930
  exports.NumericInput = NumericInput;
9875
- exports.Radio = Index$2;
9876
- exports.Select = Index;
9877
- exports.Swiper = Index$8;
9931
+ exports.Radio = Index$3;
9932
+ exports.Select = Index$1;
9933
+ exports.Swiper = Index$9;
9878
9934
  exports.Switch = WSwitch;
9879
9935
  exports.TabelCard = index$1;
9880
9936
  exports.Table = Table;
9881
- exports.TreeSelect = Index$4;
9937
+ exports.TreeSelect = Index$5;
9882
9938
  exports.WForm = WForm$1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.2.2",
4
+ "version": "0.2.6",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",
@@ -76,4 +76,4 @@
76
76
  "react": "^16.12.0",
77
77
  "yorkie": "^2.0.0"
78
78
  }
79
- }
79
+ }