wargerm 0.3.11 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 = {};
@@ -6423,6 +6413,8 @@ var momentValue = function momentValue(value) {
6423
6413
  if (value) {
6424
6414
  return hooks(value);
6425
6415
  }
6416
+
6417
+ return value;
6426
6418
  };
6427
6419
 
6428
6420
  var WDatePicker$1 = function WDatePicker(props) {
@@ -6432,20 +6424,15 @@ var WDatePicker$1 = function WDatePicker(props) {
6432
6424
  _onChange = props.onChange,
6433
6425
  extraProps = _objectWithoutProperties(props, _excluded$3);
6434
6426
 
6435
- return (
6436
- /*#__PURE__*/
6437
- // <ConfigProvider locale={zhCN}>
6438
- React.createElement(_DatePicker, _objectSpread2({
6439
- defaultValue: momentValue(defaultValue),
6440
- value: momentValue(value),
6441
- onChange: function onChange(v) {
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'))) || '';
6445
- }
6446
- }, 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;
6447
6432
 
6448
- );
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));
6449
6436
  };
6450
6437
 
6451
6438
  WDatePicker$1.defaultProps = {};
@@ -6457,20 +6444,15 @@ var RangePicker$1 = function RangePicker(props) {
6457
6444
  _onChange2 = props.onChange,
6458
6445
  extraProps = _objectWithoutProperties(props, _excluded2$1);
6459
6446
 
6460
- return (
6461
- /*#__PURE__*/
6462
- // <ConfigProvider locale={zhCN}>
6463
- React.createElement(_DatePicker.RangePicker, _objectSpread2({
6464
- defaultValue: momentValue(defaultValue),
6465
- value: momentValue(value),
6466
- onChange: function onChange(v) {
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'))) || '';
6470
- }
6471
- }, extraProps)) // </ConfigProvider>
6447
+ return /*#__PURE__*/React.createElement(_DatePicker.RangePicker, _objectSpread2({
6448
+ defaultValue: defaultValue ? [momentValue(defaultValue[0]), momentValue(defaultValue[1])] : undefined,
6449
+ value: [momentValue(value[0]), momentValue(value[1])],
6450
+ onChange: function onChange(v) {
6451
+ var _momentValue4, _momentValue5, _momentValue6, _momentValue7;
6472
6452
 
6473
- );
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));
6474
6456
  };
6475
6457
 
6476
6458
  RangePicker$1.defaultProps = {};
@@ -7757,30 +7739,42 @@ var WForm = function WForm(props, ref) {
7757
7739
 
7758
7740
  if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
7759
7741
  if (c.valueType === 'date' && searchForm[c.dataIndex]) {
7760
- 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');
7761
7745
  }
7762
7746
 
7763
7747
  if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
7764
- 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');
7765
7751
  }
7766
7752
 
7767
7753
  if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
7768
- 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');
7769
7757
  }
7770
7758
 
7771
7759
  if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
7772
- 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');
7773
7763
  }
7774
7764
 
7775
7765
  if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
7776
7766
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7777
- 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');
7778
7770
  });
7779
7771
  }
7780
7772
 
7781
7773
  if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
7782
7774
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7783
- 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');
7784
7778
  });
7785
7779
  }
7786
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 = {};
@@ -6457,6 +6447,8 @@ var momentValue = function momentValue(value) {
6457
6447
  if (value) {
6458
6448
  return hooks(value);
6459
6449
  }
6450
+
6451
+ return value;
6460
6452
  };
6461
6453
 
6462
6454
  var WDatePicker$1 = function WDatePicker(props) {
@@ -6466,20 +6458,15 @@ var WDatePicker$1 = function WDatePicker(props) {
6466
6458
  _onChange = props.onChange,
6467
6459
  extraProps = _objectWithoutProperties(props, _excluded$3);
6468
6460
 
6469
- return (
6470
- /*#__PURE__*/
6471
- // <ConfigProvider locale={zhCN}>
6472
- React__default['default'].createElement(_DatePicker__default['default'], _objectSpread2({
6473
- defaultValue: momentValue(defaultValue),
6474
- value: momentValue(value),
6475
- onChange: function onChange(v) {
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'))) || '';
6479
- }
6480
- }, 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;
6481
6466
 
6482
- );
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));
6483
6470
  };
6484
6471
 
6485
6472
  WDatePicker$1.defaultProps = {};
@@ -6491,20 +6478,15 @@ var RangePicker$1 = function RangePicker(props) {
6491
6478
  _onChange2 = props.onChange,
6492
6479
  extraProps = _objectWithoutProperties(props, _excluded2$1);
6493
6480
 
6494
- return (
6495
- /*#__PURE__*/
6496
- // <ConfigProvider locale={zhCN}>
6497
- React__default['default'].createElement(_DatePicker__default['default'].RangePicker, _objectSpread2({
6498
- defaultValue: momentValue(defaultValue),
6499
- value: momentValue(value),
6500
- onChange: function onChange(v) {
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'))) || '';
6504
- }
6505
- }, 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: [momentValue(value[0]), momentValue(value[1])],
6484
+ onChange: function onChange(v) {
6485
+ var _momentValue4, _momentValue5, _momentValue6, _momentValue7;
6506
6486
 
6507
- );
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));
6508
6490
  };
6509
6491
 
6510
6492
  RangePicker$1.defaultProps = {};
@@ -7791,30 +7773,42 @@ var WForm = function WForm(props, ref) {
7791
7773
 
7792
7774
  if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear', 'dateRange', 'dateTimeRange'].includes(c.valueType)) {
7793
7775
  if (c.valueType === 'date' && searchForm[c.dataIndex]) {
7794
- 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');
7795
7779
  }
7796
7780
 
7797
7781
  if (c.valueType === 'dateTime' && searchForm[c.dataIndex]) {
7798
- 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');
7799
7785
  }
7800
7786
 
7801
7787
  if (c.valueType === 'dateMonth' && searchForm[c.dataIndex]) {
7802
- 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');
7803
7791
  }
7804
7792
 
7805
7793
  if (c.valueType === 'dateYear' && searchForm[c.dataIndex]) {
7806
- 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');
7807
7797
  }
7808
7798
 
7809
7799
  if (c.valueType === 'dateRange' && searchForm[c.dataIndex]) {
7810
7800
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7811
- 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');
7812
7804
  });
7813
7805
  }
7814
7806
 
7815
7807
  if (c.valueType === 'dateTimeRange' && searchForm[c.dataIndex]) {
7816
7808
  searchForm[c.dataIndex] = searchForm[c.dataIndex].map(function (item) {
7817
- 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');
7818
7812
  });
7819
7813
  }
7820
7814
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.11",
4
+ "version": "0.3.12",
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
+ }