wargerm 0.3.10 → 0.3.13

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,6 +5,7 @@ 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> & {
package/dist/index.esm.js CHANGED
@@ -496,12 +496,7 @@ WInputNumber.defaultProps = {};
496
496
  var WDatePicker = function WDatePicker(props) {
497
497
  var extraProps = _extends({}, props);
498
498
 
499
- return (
500
- /*#__PURE__*/
501
- // <ConfigProvider locale={zhCN}>
502
- React.createElement(_DatePicker, _objectSpread2({}, extraProps)) // </ConfigProvider>
503
-
504
- );
499
+ return /*#__PURE__*/React.createElement(_DatePicker, _objectSpread2({}, extraProps));
505
500
  };
506
501
 
507
502
  WDatePicker.defaultProps = {};
@@ -509,12 +504,7 @@ WDatePicker.defaultProps = {};
509
504
  var RangePicker = function RangePicker(props) {
510
505
  var extraProps = _extends({}, props);
511
506
 
512
- return (
513
- /*#__PURE__*/
514
- // <ConfigProvider locale={zhCN}>
515
- React.createElement(_DatePicker.RangePicker, _objectSpread2({}, extraProps)) // </ConfigProvider>
516
-
517
- );
507
+ return /*#__PURE__*/React.createElement(_DatePicker.RangePicker, _objectSpread2({}, extraProps));
518
508
  };
519
509
 
520
510
  RangePicker.defaultProps = {};
@@ -649,7 +639,7 @@ function FrameBox(_ref) {
649
639
  }), children);
650
640
  }
651
641
 
652
- var _excluded$2 = ["request", "valueEnum", "onLoad", "children"],
642
+ var _excluded$2 = ["request", "valueEnum", "onLoad", "children", "params"],
653
643
  _excluded2 = ["children"];
654
644
 
655
645
  var WSelect = function WSelect(props) {
@@ -657,6 +647,7 @@ var WSelect = function WSelect(props) {
657
647
  valueEnum = props.valueEnum,
658
648
  onLoad = props.onLoad,
659
649
  children = props.children,
650
+ params = props.params,
660
651
  extraProps = _objectWithoutProperties(props, _excluded$2);
661
652
 
662
653
  var _useState = useState([]),
@@ -737,7 +728,7 @@ var WSelect = function WSelect(props) {
737
728
 
738
729
  onLoad && onLoad(options);
739
730
  setValueEnumList(valueEnumNode);
740
- }, [JSON.stringify(resList), JSON.stringify(request)]);
731
+ }, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
741
732
  return /*#__PURE__*/React.createElement(_Select, _objectSpread2({}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
742
733
  };
743
734
 
@@ -6422,6 +6413,8 @@ var momentValue = function momentValue(value) {
6422
6413
  if (value) {
6423
6414
  return hooks(value);
6424
6415
  }
6416
+
6417
+ return value;
6425
6418
  };
6426
6419
 
6427
6420
  var WDatePicker$1 = function WDatePicker(props) {
@@ -6431,20 +6424,15 @@ var WDatePicker$1 = function WDatePicker(props) {
6431
6424
  _onChange = props.onChange,
6432
6425
  extraProps = _objectWithoutProperties(props, _excluded$3);
6433
6426
 
6434
- return (
6435
- /*#__PURE__*/
6436
- // <ConfigProvider locale={zhCN}>
6437
- React.createElement(_DatePicker, _objectSpread2({
6438
- defaultValue: momentValue(defaultValue),
6439
- value: momentValue(value),
6440
- onChange: function onChange(v) {
6441
- var _momentValue;
6442
-
6443
- (_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, (_momentValue = momentValue(v)) === null || _momentValue === void 0 ? void 0 : _momentValue.format(format || 'YYYY-MM-DD'))) || '';
6444
- }
6445
- }, extraProps)) // </ConfigProvider>
6427
+ return /*#__PURE__*/React.createElement(_DatePicker, _objectSpread2({
6428
+ defaultValue: momentValue(defaultValue),
6429
+ value: momentValue(value),
6430
+ onChange: function onChange(v) {
6431
+ var _momentValue2, _momentValue3;
6446
6432
 
6447
- );
6433
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange((_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'), (_momentValue3 = momentValue(v)) === null || _momentValue3 === void 0 ? void 0 : _momentValue3.format(format || 'YYYY-MM-DD'));
6434
+ }
6435
+ }, extraProps));
6448
6436
  };
6449
6437
 
6450
6438
  WDatePicker$1.defaultProps = {};
@@ -6456,20 +6444,15 @@ var RangePicker$1 = function RangePicker(props) {
6456
6444
  _onChange2 = props.onChange,
6457
6445
  extraProps = _objectWithoutProperties(props, _excluded2$1);
6458
6446
 
6459
- return (
6460
- /*#__PURE__*/
6461
- // <ConfigProvider locale={zhCN}>
6462
- React.createElement(_DatePicker.RangePicker, _objectSpread2({
6463
- defaultValue: momentValue(defaultValue),
6464
- value: momentValue(value),
6465
- onChange: function onChange(v) {
6466
- var _momentValue2;
6467
-
6468
- (_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, (_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'))) || '';
6469
- }
6470
- }, extraProps)) // </ConfigProvider>
6447
+ return /*#__PURE__*/React.createElement(_DatePicker.RangePicker, _objectSpread2({
6448
+ defaultValue: defaultValue ? [momentValue(defaultValue[0]), momentValue(defaultValue[1])] : undefined,
6449
+ value: value ? [momentValue(value[0]), momentValue(value[1])] : undefined,
6450
+ onChange: function onChange(v) {
6451
+ var _momentValue4, _momentValue5, _momentValue6, _momentValue7;
6471
6452
 
6472
- );
6453
+ _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2([((_momentValue4 = momentValue(v[0])) === null || _momentValue4 === void 0 ? void 0 : _momentValue4.format(format || 'YYYY-MM-DD')) || '', ((_momentValue5 = momentValue(v[1])) === null || _momentValue5 === void 0 ? void 0 : _momentValue5.format(format || 'YYYY-MM-DD')) || ''], [((_momentValue6 = momentValue(v[0])) === null || _momentValue6 === void 0 ? void 0 : _momentValue6.format(format || 'YYYY-MM-DD')) || '', ((_momentValue7 = momentValue(v[1])) === null || _momentValue7 === void 0 ? void 0 : _momentValue7.format(format || 'YYYY-MM-DD')) || '']);
6454
+ }
6455
+ }, extraProps));
6473
6456
  };
6474
6457
 
6475
6458
  RangePicker$1.defaultProps = {};
@@ -7756,30 +7739,42 @@ var WForm = function WForm(props, ref) {
7756
7739
 
7757
7740
  if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
7758
7741
  if (c.valueType === 'date' && searchForm[c.dataIndex]) {
7759
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM-DD');
7742
+ var _c$fieldProps;
7743
+
7744
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps = c.fieldProps) === null || _c$fieldProps === void 0 ? void 0 : _c$fieldProps.format) || 'YYYY-MM-DD');
7760
7745
  }
7761
7746
 
7762
7747
  if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
7763
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM-DD HH:mm:ss');
7748
+ var _c$fieldProps2;
7749
+
7750
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps2 = c.fieldProps) === null || _c$fieldProps2 === void 0 ? void 0 : _c$fieldProps2.format) || 'YYYY-MM-DD HH:mm:ss');
7764
7751
  }
7765
7752
 
7766
7753
  if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
7767
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM');
7754
+ var _c$fieldProps3;
7755
+
7756
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps3 = c.fieldProps) === null || _c$fieldProps3 === void 0 ? void 0 : _c$fieldProps3.format) || 'YYYY-MM');
7768
7757
  }
7769
7758
 
7770
7759
  if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
7771
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY');
7760
+ var _c$fieldProps4;
7761
+
7762
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps4 = c.fieldProps) === null || _c$fieldProps4 === void 0 ? void 0 : _c$fieldProps4.format) || 'YYYY');
7772
7763
  }
7773
7764
 
7774
7765
  if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
7775
7766
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7776
- return item && searchForm[c.dataIndex] && hooks(item).format('YYYY-MM-DD');
7767
+ var _c$fieldProps5;
7768
+
7769
+ return item && searchForm[c.dataIndex] && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps5 = c.fieldProps) === null || _c$fieldProps5 === void 0 ? void 0 : _c$fieldProps5.format) || 'YYYY-MM-DD');
7777
7770
  });
7778
7771
  }
7779
7772
 
7780
7773
  if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
7781
7774
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7782
- return item && hooks(item).format('YYYY-MM-DD HH:mm:ss');
7775
+ var _c$fieldProps6;
7776
+
7777
+ return item && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps6 = c.fieldProps) === null || _c$fieldProps6 === void 0 ? void 0 : _c$fieldProps6.format) || 'YYYY-MM-DD HH:mm:ss');
7783
7778
  });
7784
7779
  }
7785
7780
  }
package/dist/index.js CHANGED
@@ -530,12 +530,7 @@ WInputNumber.defaultProps = {};
530
530
  var WDatePicker = function WDatePicker(props) {
531
531
  var extraProps = _extends({}, props);
532
532
 
533
- return (
534
- /*#__PURE__*/
535
- // <ConfigProvider locale={zhCN}>
536
- React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({}, extraProps)) // </ConfigProvider>
537
-
538
- );
533
+ return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({}, extraProps));
539
534
  };
540
535
 
541
536
  WDatePicker.defaultProps = {};
@@ -543,12 +538,7 @@ WDatePicker.defaultProps = {};
543
538
  var RangePicker = function RangePicker(props) {
544
539
  var extraProps = _extends({}, props);
545
540
 
546
- return (
547
- /*#__PURE__*/
548
- // <ConfigProvider locale={zhCN}>
549
- React__default['default'].createElement(_DatePicker__default['default'].RangePicker, _objectSpread2({}, extraProps)) // </ConfigProvider>
550
-
551
- );
541
+ return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'].RangePicker, _objectSpread2({}, extraProps));
552
542
  };
553
543
 
554
544
  RangePicker.defaultProps = {};
@@ -683,7 +673,7 @@ function FrameBox(_ref) {
683
673
  }), children);
684
674
  }
685
675
 
686
- var _excluded$2 = ["request", "valueEnum", "onLoad", "children"],
676
+ var _excluded$2 = ["request", "valueEnum", "onLoad", "children", "params"],
687
677
  _excluded2 = ["children"];
688
678
 
689
679
  var WSelect = function WSelect(props) {
@@ -691,6 +681,7 @@ var WSelect = function WSelect(props) {
691
681
  valueEnum = props.valueEnum,
692
682
  onLoad = props.onLoad,
693
683
  children = props.children,
684
+ params = props.params,
694
685
  extraProps = _objectWithoutProperties(props, _excluded$2);
695
686
 
696
687
  var _useState = React.useState([]),
@@ -771,7 +762,7 @@ var WSelect = function WSelect(props) {
771
762
 
772
763
  onLoad && onLoad(options);
773
764
  setValueEnumList(valueEnumNode);
774
- }, [JSON.stringify(resList), JSON.stringify(request)]);
765
+ }, [JSON.stringify(resList), JSON.stringify(request), JSON.stringify(params || {})]);
775
766
  return /*#__PURE__*/React__default['default'].createElement(_Select__default['default'], _objectSpread2({}, extraProps), request ? childrenNode : valueEnum ? valueEnumList : children);
776
767
  };
777
768
 
@@ -6456,6 +6447,8 @@ var momentValue = function momentValue(value) {
6456
6447
  if (value) {
6457
6448
  return hooks(value);
6458
6449
  }
6450
+
6451
+ return value;
6459
6452
  };
6460
6453
 
6461
6454
  var WDatePicker$1 = function WDatePicker(props) {
@@ -6465,20 +6458,15 @@ var WDatePicker$1 = function WDatePicker(props) {
6465
6458
  _onChange = props.onChange,
6466
6459
  extraProps = _objectWithoutProperties(props, _excluded$3);
6467
6460
 
6468
- return (
6469
- /*#__PURE__*/
6470
- // <ConfigProvider locale={zhCN}>
6471
- React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({
6472
- defaultValue: momentValue(defaultValue),
6473
- value: momentValue(value),
6474
- onChange: function onChange(v) {
6475
- var _momentValue;
6476
-
6477
- (_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, (_momentValue = momentValue(v)) === null || _momentValue === void 0 ? void 0 : _momentValue.format(format || 'YYYY-MM-DD'))) || '';
6478
- }
6479
- }, extraProps)) // </ConfigProvider>
6461
+ return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({
6462
+ defaultValue: momentValue(defaultValue),
6463
+ value: momentValue(value),
6464
+ onChange: function onChange(v) {
6465
+ var _momentValue2, _momentValue3;
6480
6466
 
6481
- );
6467
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange((_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'), (_momentValue3 = momentValue(v)) === null || _momentValue3 === void 0 ? void 0 : _momentValue3.format(format || 'YYYY-MM-DD'));
6468
+ }
6469
+ }, extraProps));
6482
6470
  };
6483
6471
 
6484
6472
  WDatePicker$1.defaultProps = {};
@@ -6490,20 +6478,15 @@ var RangePicker$1 = function RangePicker(props) {
6490
6478
  _onChange2 = props.onChange,
6491
6479
  extraProps = _objectWithoutProperties(props, _excluded2$1);
6492
6480
 
6493
- return (
6494
- /*#__PURE__*/
6495
- // <ConfigProvider locale={zhCN}>
6496
- React__default['default'].createElement(_DatePicker__default['default'].RangePicker, _objectSpread2({
6497
- defaultValue: momentValue(defaultValue),
6498
- value: momentValue(value),
6499
- onChange: function onChange(v) {
6500
- var _momentValue2;
6501
-
6502
- (_onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2(v, (_momentValue2 = momentValue(v)) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.format(format || 'YYYY-MM-DD'))) || '';
6503
- }
6504
- }, extraProps)) // </ConfigProvider>
6481
+ return /*#__PURE__*/React__default['default'].createElement(_DatePicker__default['default'].RangePicker, _objectSpread2({
6482
+ defaultValue: defaultValue ? [momentValue(defaultValue[0]), momentValue(defaultValue[1])] : undefined,
6483
+ value: value ? [momentValue(value[0]), momentValue(value[1])] : undefined,
6484
+ onChange: function onChange(v) {
6485
+ var _momentValue4, _momentValue5, _momentValue6, _momentValue7;
6505
6486
 
6506
- );
6487
+ _onChange2 === null || _onChange2 === void 0 ? void 0 : _onChange2([((_momentValue4 = momentValue(v[0])) === null || _momentValue4 === void 0 ? void 0 : _momentValue4.format(format || 'YYYY-MM-DD')) || '', ((_momentValue5 = momentValue(v[1])) === null || _momentValue5 === void 0 ? void 0 : _momentValue5.format(format || 'YYYY-MM-DD')) || ''], [((_momentValue6 = momentValue(v[0])) === null || _momentValue6 === void 0 ? void 0 : _momentValue6.format(format || 'YYYY-MM-DD')) || '', ((_momentValue7 = momentValue(v[1])) === null || _momentValue7 === void 0 ? void 0 : _momentValue7.format(format || 'YYYY-MM-DD')) || '']);
6488
+ }
6489
+ }, extraProps));
6507
6490
  };
6508
6491
 
6509
6492
  RangePicker$1.defaultProps = {};
@@ -7790,30 +7773,42 @@ var WForm = function WForm(props, ref) {
7790
7773
 
7791
7774
  if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
7792
7775
  if (c.valueType === 'date' && searchForm[c.dataIndex]) {
7793
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM-DD');
7776
+ var _c$fieldProps;
7777
+
7778
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps = c.fieldProps) === null || _c$fieldProps === void 0 ? void 0 : _c$fieldProps.format) || 'YYYY-MM-DD');
7794
7779
  }
7795
7780
 
7796
7781
  if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
7797
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM-DD HH:mm:ss');
7782
+ var _c$fieldProps2;
7783
+
7784
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps2 = c.fieldProps) === null || _c$fieldProps2 === void 0 ? void 0 : _c$fieldProps2.format) || 'YYYY-MM-DD HH:mm:ss');
7798
7785
  }
7799
7786
 
7800
7787
  if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
7801
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY-MM');
7788
+ var _c$fieldProps3;
7789
+
7790
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps3 = c.fieldProps) === null || _c$fieldProps3 === void 0 ? void 0 : _c$fieldProps3.format) || 'YYYY-MM');
7802
7791
  }
7803
7792
 
7804
7793
  if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
7805
- searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format('YYYY');
7794
+ var _c$fieldProps4;
7795
+
7796
+ searchForm[c.dataIndex] = searchForm[c.dataIndex] && hooks(searchForm[c.dataIndex]).format((c === null || c === void 0 ? void 0 : (_c$fieldProps4 = c.fieldProps) === null || _c$fieldProps4 === void 0 ? void 0 : _c$fieldProps4.format) || 'YYYY');
7806
7797
  }
7807
7798
 
7808
7799
  if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
7809
7800
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7810
- return item && searchForm[c.dataIndex] && hooks(item).format('YYYY-MM-DD');
7801
+ var _c$fieldProps5;
7802
+
7803
+ return item && searchForm[c.dataIndex] && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps5 = c.fieldProps) === null || _c$fieldProps5 === void 0 ? void 0 : _c$fieldProps5.format) || 'YYYY-MM-DD');
7811
7804
  });
7812
7805
  }
7813
7806
 
7814
7807
  if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
7815
7808
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7816
- return item && hooks(item).format('YYYY-MM-DD HH:mm:ss');
7809
+ var _c$fieldProps6;
7810
+
7811
+ return item && hooks(item).format((c === null || c === void 0 ? void 0 : (_c$fieldProps6 = c.fieldProps) === null || _c$fieldProps6 === void 0 ? void 0 : _c$fieldProps6.format) || 'YYYY-MM-DD HH:mm:ss');
7817
7812
  });
7818
7813
  }
7819
7814
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.10",
4
+ "version": "0.3.13",
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
+ }