wargerm 0.3.8 → 0.3.11

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.
@@ -5,10 +5,11 @@ export interface IOptionProps extends OptionProps {
5
5
  export interface ISelect extends SelectProps<any> {
6
6
  request?: () => Promise<any>;
7
7
  valueEnum?: Record<string, any>;
8
+ params?: Record<string, any>;
8
9
  onLoad?: (options: Record<string, any>[]) => void;
9
10
  }
10
11
  export declare type IWSelectComponent = React.FC<ISelect> & {
11
12
  Option?: React.FC<IOptionProps>;
12
13
  };
13
- declare let Index: IWSelectComponent;
14
- export default Index;
14
+ declare const _default: React.NamedExoticComponent<ISelect>;
15
+ export default _default;
package/dist/index.esm.js CHANGED
@@ -649,7 +649,7 @@ function FrameBox(_ref) {
649
649
  }), children);
650
650
  }
651
651
 
652
- var _excluded$2 = ["request", "valueEnum", "onLoad", "children"],
652
+ var _excluded$2 = ["request", "valueEnum", "onLoad", "children", "params"],
653
653
  _excluded2 = ["children"];
654
654
 
655
655
  var WSelect = function WSelect(props) {
@@ -657,6 +657,7 @@ var WSelect = function WSelect(props) {
657
657
  valueEnum = props.valueEnum,
658
658
  onLoad = props.onLoad,
659
659
  children = props.children,
660
+ params = props.params,
660
661
  extraProps = _objectWithoutProperties(props, _excluded$2);
661
662
 
662
663
  var _useState = useState([]),
@@ -737,7 +738,7 @@ var WSelect = function WSelect(props) {
737
738
 
738
739
  onLoad && onLoad(options);
739
740
  setValueEnumList(valueEnumNode);
740
- }, [JSON.stringify(resList), request]);
741
+ }, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
741
742
  return /*#__PURE__*/React.createElement(_Select, _objectSpread2({}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
742
743
  };
743
744
 
@@ -752,6 +753,7 @@ var Option = function Option(props) {
752
753
 
753
754
  var Index$4 = WSelect;
754
755
  Index$4.Option = Option;
756
+ var Select = /*#__PURE__*/React.memo(Index$4);
755
757
 
756
758
  //! moment.js
757
759
  //! version : 2.29.1
@@ -6437,7 +6439,9 @@ var WDatePicker$1 = function WDatePicker(props) {
6437
6439
  defaultValue: momentValue(defaultValue),
6438
6440
  value: momentValue(value),
6439
6441
  onChange: function onChange(v) {
6440
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(v, momentValue(v).format(format || 'YYYY-MM-DD'));
6442
+ var _momentValue;
6443
+
6444
+ (_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, (_momentValue = momentValue(v)) === null || _momentValue === void 0 ? void 0 : _momentValue.format(format || 'YYYY-MM-DD'))) || '';
6441
6445
  }
6442
6446
  }, extraProps)) // </ConfigProvider>
6443
6447
 
@@ -6460,7 +6464,9 @@ var RangePicker$1 = function RangePicker(props) {
6460
6464
  defaultValue: momentValue(defaultValue),
6461
6465
  value: momentValue(value),
6462
6466
  onChange: function onChange(v) {
6463
- _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, momentValue(v).format(format || 'YYYY-MM-DD'));
6467
+ var _momentValue2;
6468
+
6469
+ (_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, (_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'))) || '';
6464
6470
  }
6465
6471
  }, extraProps)) // </ConfigProvider>
6466
6472
 
@@ -6779,7 +6785,7 @@ var WForm = function WForm(props, ref) {
6779
6785
  name: c.dataIndex,
6780
6786
  label: c.title,
6781
6787
  labelCol: labelCol
6782
- }), /*#__PURE__*/React.createElement(Index$4, _objectSpread2(_objectSpread2({
6788
+ }), /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
6783
6789
  placeholder: "\u8BF7\u9009\u62E9",
6784
6790
  disabled: disabled,
6785
6791
  onLoad: function onLoad(opt) {
@@ -7279,7 +7285,7 @@ var WForm = function WForm(props, ref) {
7279
7285
  name: c.dataIndex,
7280
7286
  label: c.title,
7281
7287
  labelCol: labelCol
7282
- }), /*#__PURE__*/React.createElement(Index$4, _objectSpread2(_objectSpread2({
7288
+ }), /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
7283
7289
  placeholder: "\u8BF7\u9009\u62E9",
7284
7290
  disabled: disabled,
7285
7291
  onLoad: function onLoad(opt) {
@@ -7784,11 +7790,15 @@ var WForm = function WForm(props, ref) {
7784
7790
  };
7785
7791
 
7786
7792
  var handleRest = function handleRest() {
7793
+ var _form$resetFields;
7794
+
7787
7795
  onReset && onReset();
7788
- form.resetFields();
7796
+ form === null || form === void 0 ? void 0 : (_form$resetFields = form.resetFields) === null || _form$resetFields === void 0 ? void 0 : _form$resetFields.call(form);
7789
7797
  };
7790
7798
 
7791
7799
  var setFieldsValue = function setFieldsValue(record) {
7800
+ var _form$setFieldsValue;
7801
+
7792
7802
  var setFieldsValues = _objectSpread2({}, record);
7793
7803
 
7794
7804
  filterFormColumns.forEach(function (c) {
@@ -7803,7 +7813,7 @@ var WForm = function WForm(props, ref) {
7803
7813
  return false;
7804
7814
  }
7805
7815
  });
7806
- form.setFieldsValue(setFieldsValues);
7816
+ form === null || form === void 0 ? void 0 : (_form$setFieldsValue = form.setFieldsValue) === null || _form$setFieldsValue === void 0 ? void 0 : _form$setFieldsValue.call(form, setFieldsValues);
7807
7817
  };
7808
7818
 
7809
7819
  useImperativeHandle(ref, function () {
@@ -10786,4 +10796,4 @@ var WebsocketHeart = /*#__PURE__*/_createClass(function WebsocketHeart(_ref) {
10786
10796
  this.heartCheck = null;
10787
10797
  });
10788
10798
 
10789
- export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, WCascader as Cascader, Index$3 as Checkbox, Index$8 as CountUp, Index$1 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, Index$7 as Number, NumericInput, Index$2 as Radio, Index$4 as Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$6 as TreeSelect, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
10799
+ export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, WCascader as Cascader, Index$3 as Checkbox, Index$8 as CountUp, Index$1 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Modal$1 as ModalTips, Index$7 as Number, NumericInput, Index$2 as Radio, Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$6 as TreeSelect, Index$5 as WDatePicker, WForm$1 as WForm, WebsocketHeart };
package/dist/index.js CHANGED
@@ -683,7 +683,7 @@ function FrameBox(_ref) {
683
683
  }), children);
684
684
  }
685
685
 
686
- var _excluded$2 = ["request", "valueEnum", "onLoad", "children"],
686
+ var _excluded$2 = ["request", "valueEnum", "onLoad", "children", "params"],
687
687
  _excluded2 = ["children"];
688
688
 
689
689
  var WSelect = function WSelect(props) {
@@ -691,6 +691,7 @@ var WSelect = function WSelect(props) {
691
691
  valueEnum = props.valueEnum,
692
692
  onLoad = props.onLoad,
693
693
  children = props.children,
694
+ params = props.params,
694
695
  extraProps = _objectWithoutProperties(props, _excluded$2);
695
696
 
696
697
  var _useState = React.useState([]),
@@ -771,7 +772,7 @@ var WSelect = function WSelect(props) {
771
772
 
772
773
  onLoad && onLoad(options);
773
774
  setValueEnumList(valueEnumNode);
774
- }, [JSON.stringify(resList), request]);
775
+ }, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
775
776
  return /*#__PURE__*/React__default['default'].createElement(_Select__default['default'], _objectSpread2({}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
776
777
  };
777
778
 
@@ -786,6 +787,7 @@ var Option = function Option(props) {
786
787
 
787
788
  var Index$4 = WSelect;
788
789
  Index$4.Option = Option;
790
+ var Select = /*#__PURE__*/React__default['default'].memo(Index$4);
789
791
 
790
792
  //! moment.js
791
793
  //! version : 2.29.1
@@ -6471,7 +6473,9 @@ var WDatePicker$1 = function WDatePicker(props) {
6471
6473
  defaultValue: momentValue(defaultValue),
6472
6474
  value: momentValue(value),
6473
6475
  onChange: function onChange(v) {
6474
- _onChange === null || _onChange === void 0 ? void 0 : _onChange(v, momentValue(v).format(format || 'YYYY-MM-DD'));
6476
+ var _momentValue;
6477
+
6478
+ (_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, (_momentValue = momentValue(v)) === null || _momentValue === void 0 ? void 0 : _momentValue.format(format || 'YYYY-MM-DD'))) || '';
6475
6479
  }
6476
6480
  }, extraProps)) // </ConfigProvider>
6477
6481
 
@@ -6494,7 +6498,9 @@ var RangePicker$1 = function RangePicker(props) {
6494
6498
  defaultValue: momentValue(defaultValue),
6495
6499
  value: momentValue(value),
6496
6500
  onChange: function onChange(v) {
6497
- _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, momentValue(v).format(format || 'YYYY-MM-DD'));
6501
+ var _momentValue2;
6502
+
6503
+ (_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, (_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'))) || '';
6498
6504
  }
6499
6505
  }, extraProps)) // </ConfigProvider>
6500
6506
 
@@ -6813,7 +6819,7 @@ var WForm = function WForm(props, ref) {
6813
6819
  name: c.dataIndex,
6814
6820
  label: c.title,
6815
6821
  labelCol: labelCol
6816
- }), /*#__PURE__*/React__default['default'].createElement(Index$4, _objectSpread2(_objectSpread2({
6822
+ }), /*#__PURE__*/React__default['default'].createElement(Select, _objectSpread2(_objectSpread2({
6817
6823
  placeholder: "\u8BF7\u9009\u62E9",
6818
6824
  disabled: disabled,
6819
6825
  onLoad: function onLoad(opt) {
@@ -7313,7 +7319,7 @@ var WForm = function WForm(props, ref) {
7313
7319
  name: c.dataIndex,
7314
7320
  label: c.title,
7315
7321
  labelCol: labelCol
7316
- }), /*#__PURE__*/React__default['default'].createElement(Index$4, _objectSpread2(_objectSpread2({
7322
+ }), /*#__PURE__*/React__default['default'].createElement(Select, _objectSpread2(_objectSpread2({
7317
7323
  placeholder: "\u8BF7\u9009\u62E9",
7318
7324
  disabled: disabled,
7319
7325
  onLoad: function onLoad(opt) {
@@ -7818,11 +7824,15 @@ var WForm = function WForm(props, ref) {
7818
7824
  };
7819
7825
 
7820
7826
  var handleRest = function handleRest() {
7827
+ var _form$resetFields;
7828
+
7821
7829
  onReset && onReset();
7822
- form.resetFields();
7830
+ form === null || form === void 0 ? void 0 : (_form$resetFields = form.resetFields) === null || _form$resetFields === void 0 ? void 0 : _form$resetFields.call(form);
7823
7831
  };
7824
7832
 
7825
7833
  var setFieldsValue = function setFieldsValue(record) {
7834
+ var _form$setFieldsValue;
7835
+
7826
7836
  var setFieldsValues = _objectSpread2({}, record);
7827
7837
 
7828
7838
  filterFormColumns.forEach(function (c) {
@@ -7837,7 +7847,7 @@ var WForm = function WForm(props, ref) {
7837
7847
  return false;
7838
7848
  }
7839
7849
  });
7840
- form.setFieldsValue(setFieldsValues);
7850
+ form === null || form === void 0 ? void 0 : (_form$setFieldsValue = form.setFieldsValue) === null || _form$setFieldsValue === void 0 ? void 0 : _form$setFieldsValue.call(form, setFieldsValues);
7841
7851
  };
7842
7852
 
7843
7853
  React.useImperativeHandle(ref, function () {
@@ -10837,7 +10847,7 @@ exports.ModalTips = Modal$1;
10837
10847
  exports.Number = Index$7;
10838
10848
  exports.NumericInput = NumericInput;
10839
10849
  exports.Radio = Index$2;
10840
- exports.Select = Index$4;
10850
+ exports.Select = Select;
10841
10851
  exports.Swiper = Index$a;
10842
10852
  exports.Switch = WSwitch;
10843
10853
  exports.TabelCard = index$1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.8",
4
+ "version": "0.3.11",
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
+ }