wargerm 0.2.21 → 0.2.25

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
@@ -4,7 +4,7 @@ import 'antd/es/dropdown/style';
4
4
  import _Dropdown from 'antd/es/dropdown';
5
5
  import 'antd/es/menu/style';
6
6
  import _Menu from 'antd/es/menu';
7
- import React, { useState, useEffect, useMemo, useImperativeHandle, useRef } from 'react';
7
+ import React, { useState, useEffect, useMemo, useImperativeHandle, useRef, createContext, useContext, createElement, useLayoutEffect } from 'react';
8
8
  import { createFromIconfontCN, SearchOutlined, ReloadOutlined, CloseCircleOutlined, PlusOutlined, ExclamationCircleOutlined, MoreOutlined, EyeOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons';
9
9
  import 'antd/es/input/style';
10
10
  import _Input from 'antd/es/input';
@@ -36,6 +36,8 @@ import _Checkbox from 'antd/es/checkbox';
36
36
  import 'antd/es/tree-select/style';
37
37
  import _TreeSelect from 'antd/es/tree-select';
38
38
  import uniqBy from 'lodash/uniqBy';
39
+ import 'antd/es/cascader/style';
40
+ import _Cascader from 'antd/es/cascader';
39
41
  import CountUp from 'react-countup';
40
42
  import { Swiper, SwiperSlide } from 'swiper/react';
41
43
  import SwiperCore, { Pagination, Navigation, Autoplay } from 'swiper';
@@ -44,6 +46,9 @@ import _Breadcrumb from 'antd/es/breadcrumb';
44
46
  import ReactDOM from 'react-dom';
45
47
  import 'antd/es/modal/style';
46
48
  import _Modal from 'antd/es/modal';
49
+ import 'antd/es/config-provider/style';
50
+ import 'antd/es/config-provider';
51
+ import 'antd/es/locale/zh_CN';
47
52
  import ProTable, { TableDropdown } from '@ant-design/pro-table';
48
53
 
49
54
  function ownKeys(object, enumerableOnly) {
@@ -7129,11 +7134,18 @@ function Table(_ref) {
7129
7134
  flex: c.width ? '0 1 auto' : '1',
7130
7135
  overflow: 'hidden'
7131
7136
  }
7137
+ }, /*#__PURE__*/React.createElement("div", {
7138
+ style: {
7139
+ width: '100%',
7140
+ whiteSpace: 'nowrap',
7141
+ overflow: 'hidden',
7142
+ textOverflow: 'ellipsis'
7143
+ }
7132
7144
  }, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data = columnsFields[c.dataIndex].find(function (item) {
7133
7145
  return item.value == record[c.dataIndex];
7134
- })) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex]));
7146
+ })) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex])));
7135
7147
  } else {
7136
- var _columnsFields$c$data2;
7148
+ var _columnsFields$c$data2, _columnsFields$c$data3;
7137
7149
 
7138
7150
  return /*#__PURE__*/React.createElement("div", {
7139
7151
  key: c.dataIndex,
@@ -7144,9 +7156,18 @@ function Table(_ref) {
7144
7156
  overflow: 'hidden'
7145
7157
  },
7146
7158
  title: record[c.dataIndex]
7159
+ }, c.ellipsis ? /*#__PURE__*/React.createElement("div", {
7160
+ style: {
7161
+ width: '100%',
7162
+ whiteSpace: 'nowrap',
7163
+ overflow: 'hidden',
7164
+ textOverflow: 'ellipsis'
7165
+ }
7147
7166
  }, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data2 = columnsFields[c.dataIndex].find(function (item) {
7148
7167
  return item.value == record[c.dataIndex];
7149
- })) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]);
7168
+ })) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex]) : c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data3 = columnsFields[c.dataIndex].find(function (item) {
7169
+ return item.value == record[c.dataIndex];
7170
+ })) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label : record[c.dataIndex]);
7150
7171
  }
7151
7172
  }
7152
7173
  });
@@ -7595,7 +7616,60 @@ RangePicker$2.defaultProps = {};
7595
7616
  var Index$6 = WDatePicker$1;
7596
7617
  Index$6.RangePicker = RangePicker$2;
7597
7618
 
7598
- var _excluded$6 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "onFormChange", "onSubmit", "onReset"];
7619
+ var _excluded$6 = ["request", "options", "onLoad", "value", "onChange"];
7620
+
7621
+ var WCascader = function WCascader(props) {
7622
+ var request = props.request,
7623
+ options = props.options,
7624
+ onLoad = props.onLoad,
7625
+ value = props.value,
7626
+ _onChange = props.onChange,
7627
+ extraProps = _objectWithoutProperties(props, _excluded$6);
7628
+
7629
+ var _useState = useState(null),
7630
+ _useState2 = _slicedToArray(_useState, 2),
7631
+ resList = _useState2[0],
7632
+ setResList = _useState2[1];
7633
+
7634
+ useEffect(function () {
7635
+ _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
7636
+ var res;
7637
+ return regeneratorRuntime.wrap(function _callee$(_context) {
7638
+ while (1) {
7639
+ switch (_context.prev = _context.next) {
7640
+ case 0:
7641
+ if (!request) {
7642
+ _context.next = 6;
7643
+ break;
7644
+ }
7645
+
7646
+ _context.next = 3;
7647
+ return request();
7648
+
7649
+ case 3:
7650
+ res = _context.sent;
7651
+ setResList(res);
7652
+ onLoad && onLoad(res);
7653
+
7654
+ case 6:
7655
+ case "end":
7656
+ return _context.stop();
7657
+ }
7658
+ }
7659
+ }, _callee);
7660
+ }))();
7661
+ }, [JSON.stringify(resList)]);
7662
+ return /*#__PURE__*/React.createElement(_Cascader, _objectSpread2({
7663
+ value: typeof value === 'string' ? [value] : value,
7664
+ onChange: function onChange(v, options) {
7665
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(v, options);
7666
+ },
7667
+ placeholder: "\u8BF7\u9009\u62E9",
7668
+ options: request ? resList : options
7669
+ }, extraProps));
7670
+ };
7671
+
7672
+ var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "onFormChange", "onSubmit", "onReset"];
7599
7673
  var RangePicker$3 = Index$6.RangePicker;
7600
7674
 
7601
7675
  var WForm = function WForm(props, ref) {
@@ -7609,7 +7683,7 @@ var WForm = function WForm(props, ref) {
7609
7683
  onFormChange = props.onFormChange,
7610
7684
  onSubmit = props.onSubmit,
7611
7685
  onReset = props.onReset,
7612
- extraProps = _objectWithoutProperties(props, _excluded$6);
7686
+ extraProps = _objectWithoutProperties(props, _excluded$7);
7613
7687
 
7614
7688
  var _Form$useForm = _Form.useForm(),
7615
7689
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -7695,7 +7769,7 @@ var WForm = function WForm(props, ref) {
7695
7769
  });
7696
7770
  }
7697
7771
  }, c.fieldProps), _extraProps))));
7698
- } else if (c.valueType == 'treeSelect') {
7772
+ } else if (c.valueType == 'cascader') {
7699
7773
  var _extraProps2 = {};
7700
7774
 
7701
7775
  if (c.request) {
@@ -7723,16 +7797,53 @@ var WForm = function WForm(props, ref) {
7723
7797
  name: c.dataIndex,
7724
7798
  label: c.title,
7725
7799
  labelCol: _labelCol
7800
+ }), /*#__PURE__*/React.createElement(WCascader, _objectSpread2(_objectSpread2({
7801
+ placeholder: "\u8BF7\u9009\u62E9",
7802
+ disabled: disabled,
7803
+ onLoad: function onLoad(opt) {
7804
+ setColumnsFields(function (preColumnsFields) {
7805
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
7806
+ });
7807
+ }
7808
+ }, c.fieldProps), _extraProps2))));
7809
+ } else if (c.valueType == 'treeSelect') {
7810
+ var _extraProps3 = {};
7811
+
7812
+ if (c.request) {
7813
+ _extraProps3.request = c.request;
7814
+ }
7815
+
7816
+ var _labelCol2 = {};
7817
+
7818
+ if (search && search.labelWidth) {
7819
+ _labelCol2.style = {
7820
+ width: search.labelWidth
7821
+ };
7822
+ }
7823
+
7824
+ return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
7825
+ style: {
7826
+ paddingLeft: '12px',
7827
+ paddingRight: '12px'
7828
+ }
7829
+ }, colProps), {}, {
7830
+ key: c.dataIndex
7831
+ }), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
7832
+ initialValue: c.initialValue
7833
+ }, c.formItemProps), {}, {
7834
+ name: c.dataIndex,
7835
+ label: c.title,
7836
+ labelCol: _labelCol2
7726
7837
  }), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
7727
7838
  disabled: disabled,
7728
7839
  placeholder: "\u8BF7\u9009\u62E9",
7729
7840
  onLoad: function onLoad(opt) {}
7730
- }, c.fieldProps), _extraProps2))));
7841
+ }, c.fieldProps), _extraProps3))));
7731
7842
  } else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
7732
- var _labelCol2 = {};
7843
+ var _labelCol3 = {};
7733
7844
 
7734
7845
  if (search && search.labelWidth) {
7735
- _labelCol2.style = {
7846
+ _labelCol3.style = {
7736
7847
  width: search.labelWidth
7737
7848
  };
7738
7849
  }
@@ -7772,16 +7883,16 @@ var WForm = function WForm(props, ref) {
7772
7883
  }, c.formItemProps), {}, {
7773
7884
  name: c.dataIndex,
7774
7885
  label: c.title,
7775
- labelCol: _labelCol2
7886
+ labelCol: _labelCol3
7776
7887
  }), /*#__PURE__*/React.createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
7777
7888
  disabled: disabled,
7778
7889
  placeholder: "\u8BF7\u8F93\u5165"
7779
7890
  }, picker), showTime), c.fieldProps))));
7780
7891
  } else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
7781
- var _labelCol3 = {};
7892
+ var _labelCol4 = {};
7782
7893
 
7783
7894
  if (search && search.labelWidth) {
7784
- _labelCol3.style = {
7895
+ _labelCol4.style = {
7785
7896
  width: search.labelWidth
7786
7897
  };
7787
7898
  }
@@ -7808,7 +7919,7 @@ var WForm = function WForm(props, ref) {
7808
7919
  }, c.formItemProps), {}, {
7809
7920
  name: c.dataIndex,
7810
7921
  label: c.title,
7811
- labelCol: _labelCol3
7922
+ labelCol: _labelCol4
7812
7923
  }), /*#__PURE__*/React.createElement(RangePicker$3, _objectSpread2(_objectSpread2({
7813
7924
  disabled: disabled
7814
7925
  }, _showTime), c.fieldProps))));
@@ -7835,10 +7946,10 @@ var WForm = function WForm(props, ref) {
7835
7946
  setColumnsFields(function (preColumnsFields) {
7836
7947
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
7837
7948
  });
7838
- var _labelCol4 = {};
7949
+ var _labelCol5 = {};
7839
7950
 
7840
7951
  if (search && search.labelWidth) {
7841
- _labelCol4.style = {
7952
+ _labelCol5.style = {
7842
7953
  width: search.labelWidth
7843
7954
  };
7844
7955
  }
@@ -7855,7 +7966,7 @@ var WForm = function WForm(props, ref) {
7855
7966
  }, c.formItemProps), {}, {
7856
7967
  name: c.dataIndex,
7857
7968
  label: c.title,
7858
- labelCol: _labelCol4
7969
+ labelCol: _labelCol5
7859
7970
  }), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
7860
7971
  disabled: disabled,
7861
7972
  options: options
@@ -7884,10 +7995,10 @@ var WForm = function WForm(props, ref) {
7884
7995
  setColumnsFields(function (preColumnsFields) {
7885
7996
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
7886
7997
  });
7887
- var _labelCol5 = {};
7998
+ var _labelCol6 = {};
7888
7999
 
7889
8000
  if (search && search.labelWidth) {
7890
- _labelCol5.style = {
8001
+ _labelCol6.style = {
7891
8002
  width: search.labelWidth
7892
8003
  };
7893
8004
  }
@@ -7913,7 +8024,7 @@ var WForm = function WForm(props, ref) {
7913
8024
  }, c.formItemProps), {}, {
7914
8025
  name: c.dataIndex,
7915
8026
  label: c.title,
7916
- labelCol: _labelCol5
8027
+ labelCol: _labelCol6
7917
8028
  }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
7918
8029
  disabled: disabled
7919
8030
  }, radioButtonProps), {}, {
@@ -7933,10 +8044,10 @@ var WForm = function WForm(props, ref) {
7933
8044
  }
7934
8045
  }
7935
8046
 
7936
- var _labelCol6 = {};
8047
+ var _labelCol7 = {};
7937
8048
 
7938
8049
  if (search && search.labelWidth) {
7939
- _labelCol6.style = {
8050
+ _labelCol7.style = {
7940
8051
  width: search.labelWidth
7941
8052
  };
7942
8053
  } // if (columnsFieldsRef.current) {
@@ -7960,15 +8071,15 @@ var WForm = function WForm(props, ref) {
7960
8071
  }, c.formItemProps), {}, {
7961
8072
  name: c.dataIndex,
7962
8073
  label: c.title,
7963
- labelCol: _labelCol6
8074
+ labelCol: _labelCol7
7964
8075
  }), /*#__PURE__*/React.createElement(WSwitch, _objectSpread2({
7965
8076
  disabled: disabled
7966
8077
  }, c.fieldProps))));
7967
8078
  } else if (c.valueType === 'digit') {
7968
- var _labelCol7 = {};
8079
+ var _labelCol8 = {};
7969
8080
 
7970
8081
  if (search && search.labelWidth) {
7971
- _labelCol7.style = {
8082
+ _labelCol8.style = {
7972
8083
  width: search.labelWidth
7973
8084
  };
7974
8085
  }
@@ -7985,16 +8096,16 @@ var WForm = function WForm(props, ref) {
7985
8096
  }, c.formItemProps), {}, {
7986
8097
  name: c.dataIndex,
7987
8098
  label: c.title,
7988
- labelCol: _labelCol7
8099
+ labelCol: _labelCol8
7989
8100
  }), /*#__PURE__*/React.createElement(NumericInput, _objectSpread2({
7990
8101
  disabled: disabled,
7991
8102
  placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
7992
8103
  }, c.fieldProps))));
7993
8104
  } else if (c.renderFormItem) {
7994
- var _labelCol8 = {};
8105
+ var _labelCol9 = {};
7995
8106
 
7996
8107
  if (search && search.labelWidth) {
7997
- _labelCol8.style = {
8108
+ _labelCol9.style = {
7998
8109
  width: search.labelWidth
7999
8110
  };
8000
8111
  }
@@ -8017,13 +8128,13 @@ var WForm = function WForm(props, ref) {
8017
8128
  }, c.formItemProps), {}, {
8018
8129
  name: c.dataIndex,
8019
8130
  label: c.title,
8020
- labelCol: _labelCol8
8131
+ labelCol: _labelCol9
8021
8132
  }), baseitem)) : null;
8022
8133
  } else if (c.valueType === 'textarea') {
8023
- var _labelCol9 = {};
8134
+ var _labelCol10 = {};
8024
8135
 
8025
8136
  if (search && search.labelWidth) {
8026
- _labelCol9.style = {
8137
+ _labelCol10.style = {
8027
8138
  width: search.labelWidth
8028
8139
  };
8029
8140
  }
@@ -8040,17 +8151,17 @@ var WForm = function WForm(props, ref) {
8040
8151
  }, c.formItemProps), {}, {
8041
8152
  name: c.dataIndex,
8042
8153
  label: c.title,
8043
- labelCol: _labelCol9
8154
+ labelCol: _labelCol10
8044
8155
  }), /*#__PURE__*/React.createElement(Index.TextArea, _objectSpread2({
8045
8156
  rows: 4,
8046
8157
  disabled: disabled,
8047
8158
  placeholder: "\u8BF7\u8F93\u5165"
8048
8159
  }, c.fieldProps))));
8049
8160
  } else if (c.valueType === 'inputNumber') {
8050
- var _labelCol10 = {};
8161
+ var _labelCol11 = {};
8051
8162
 
8052
8163
  if (search && search.labelWidth) {
8053
- _labelCol10.style = {
8164
+ _labelCol11.style = {
8054
8165
  width: search.labelWidth
8055
8166
  };
8056
8167
  }
@@ -8067,16 +8178,16 @@ var WForm = function WForm(props, ref) {
8067
8178
  }, c.formItemProps), {}, {
8068
8179
  name: c.dataIndex,
8069
8180
  label: c.title,
8070
- labelCol: _labelCol10
8181
+ labelCol: _labelCol11
8071
8182
  }), /*#__PURE__*/React.createElement(WInputNumber, _objectSpread2({
8072
8183
  disabled: disabled,
8073
8184
  placeholder: "\u8BF7\u8F93\u5165"
8074
8185
  }, c.fieldProps))));
8075
8186
  } else {
8076
- var _labelCol11 = {};
8187
+ var _labelCol12 = {};
8077
8188
 
8078
8189
  if (search && search.labelWidth) {
8079
- _labelCol11.style = {
8190
+ _labelCol12.style = {
8080
8191
  width: search.labelWidth
8081
8192
  };
8082
8193
  }
@@ -8093,7 +8204,7 @@ var WForm = function WForm(props, ref) {
8093
8204
  }, c.formItemProps), {}, {
8094
8205
  name: c.dataIndex,
8095
8206
  label: c.title,
8096
- labelCol: _labelCol11
8207
+ labelCol: _labelCol12
8097
8208
  }), /*#__PURE__*/React.createElement(Index, _objectSpread2({
8098
8209
  disabled: disabled,
8099
8210
  placeholder: "\u8BF7\u8F93\u5165"
@@ -8117,12 +8228,12 @@ var WForm = function WForm(props, ref) {
8117
8228
  }
8118
8229
 
8119
8230
  if (c.valueType == 'select') {
8120
- var _extraProps3 = {};
8231
+ var _extraProps4 = {};
8121
8232
 
8122
8233
  if (c.request) {
8123
- _extraProps3.request = c.request;
8234
+ _extraProps4.request = c.request;
8124
8235
  } else if (c.valueEnum) {
8125
- _extraProps3.valueEnum = c.valueEnum;
8236
+ _extraProps4.valueEnum = c.valueEnum;
8126
8237
  }
8127
8238
 
8128
8239
  var labelCol = {};
@@ -8157,18 +8268,55 @@ var WForm = function WForm(props, ref) {
8157
8268
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
8158
8269
  });
8159
8270
  }
8160
- }, c.fieldProps), _extraProps3))));
8271
+ }, c.fieldProps), _extraProps4))));
8272
+ } else if (c.valueType == 'cascader') {
8273
+ var _extraProps5 = {};
8274
+
8275
+ if (c.request) {
8276
+ _extraProps5.request = c.request;
8277
+ }
8278
+
8279
+ var _labelCol13 = {};
8280
+
8281
+ if (search && search.labelWidth) {
8282
+ _labelCol13.style = {
8283
+ width: search.labelWidth
8284
+ };
8285
+ }
8286
+
8287
+ return /*#__PURE__*/React.createElement(_Col, _objectSpread2(_objectSpread2({
8288
+ style: {
8289
+ paddingLeft: '12px',
8290
+ paddingRight: '12px'
8291
+ }
8292
+ }, colProps), {}, {
8293
+ key: c.dataIndex
8294
+ }), /*#__PURE__*/React.createElement(_Form.Item, _objectSpread2(_objectSpread2({
8295
+ initialValue: c.initialValue
8296
+ }, c.formItemProps), {}, {
8297
+ name: c.dataIndex,
8298
+ label: c.title,
8299
+ labelCol: _labelCol13
8300
+ }), /*#__PURE__*/React.createElement(WCascader, _objectSpread2(_objectSpread2({
8301
+ placeholder: "\u8BF7\u9009\u62E9",
8302
+ disabled: disabled,
8303
+ onLoad: function onLoad(opt) {
8304
+ setColumnsFields(function (preColumnsFields) {
8305
+ return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
8306
+ });
8307
+ }
8308
+ }, c.fieldProps), _extraProps5))));
8161
8309
  } else if (c.valueType == 'treeSelect') {
8162
- var _extraProps4 = {};
8310
+ var _extraProps6 = {};
8163
8311
 
8164
8312
  if (c.request) {
8165
- _extraProps4.request = c.request;
8313
+ _extraProps6.request = c.request;
8166
8314
  }
8167
8315
 
8168
- var _labelCol12 = {};
8316
+ var _labelCol14 = {};
8169
8317
 
8170
8318
  if (search && search.labelWidth) {
8171
- _labelCol12.style = {
8319
+ _labelCol14.style = {
8172
8320
  width: search.labelWidth
8173
8321
  };
8174
8322
  }
@@ -8185,17 +8333,17 @@ var WForm = function WForm(props, ref) {
8185
8333
  }, c.formItemProps), {}, {
8186
8334
  name: c.dataIndex,
8187
8335
  label: c.title,
8188
- labelCol: _labelCol12
8336
+ labelCol: _labelCol14
8189
8337
  }), /*#__PURE__*/React.createElement(Index$5, _objectSpread2(_objectSpread2({
8190
8338
  disabled: disabled,
8191
8339
  placeholder: "\u8BF7\u9009\u62E9",
8192
8340
  onLoad: function onLoad(opt) {}
8193
- }, c.fieldProps), _extraProps4))));
8341
+ }, c.fieldProps), _extraProps6))));
8194
8342
  } else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
8195
- var _labelCol13 = {};
8343
+ var _labelCol15 = {};
8196
8344
 
8197
8345
  if (search && search.labelWidth) {
8198
- _labelCol13.style = {
8346
+ _labelCol15.style = {
8199
8347
  width: search.labelWidth
8200
8348
  };
8201
8349
  }
@@ -8235,16 +8383,16 @@ var WForm = function WForm(props, ref) {
8235
8383
  }, c.formItemProps), {}, {
8236
8384
  name: c.dataIndex,
8237
8385
  label: c.title,
8238
- labelCol: _labelCol13
8386
+ labelCol: _labelCol15
8239
8387
  }), /*#__PURE__*/React.createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
8240
8388
  disabled: disabled,
8241
8389
  placeholder: "\u8BF7\u8F93\u5165"
8242
8390
  }, picker), showTime), c.fieldProps))));
8243
8391
  } else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
8244
- var _labelCol14 = {};
8392
+ var _labelCol16 = {};
8245
8393
 
8246
8394
  if (search && search.labelWidth) {
8247
- _labelCol14.style = {
8395
+ _labelCol16.style = {
8248
8396
  width: search.labelWidth
8249
8397
  };
8250
8398
  }
@@ -8271,7 +8419,7 @@ var WForm = function WForm(props, ref) {
8271
8419
  }, c.formItemProps), {}, {
8272
8420
  name: c.dataIndex,
8273
8421
  label: c.title,
8274
- labelCol: _labelCol14
8422
+ labelCol: _labelCol16
8275
8423
  }), /*#__PURE__*/React.createElement(RangePicker$3, _objectSpread2(_objectSpread2({
8276
8424
  disabled: disabled
8277
8425
  }, _showTime2), c.fieldProps))));
@@ -8298,10 +8446,10 @@ var WForm = function WForm(props, ref) {
8298
8446
  setColumnsFields(function (preColumnsFields) {
8299
8447
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
8300
8448
  });
8301
- var _labelCol15 = {};
8449
+ var _labelCol17 = {};
8302
8450
 
8303
8451
  if (search && search.labelWidth) {
8304
- _labelCol15.style = {
8452
+ _labelCol17.style = {
8305
8453
  width: search.labelWidth
8306
8454
  };
8307
8455
  }
@@ -8318,7 +8466,7 @@ var WForm = function WForm(props, ref) {
8318
8466
  }, c.formItemProps), {}, {
8319
8467
  name: c.dataIndex,
8320
8468
  label: c.title,
8321
- labelCol: _labelCol15
8469
+ labelCol: _labelCol17
8322
8470
  }), /*#__PURE__*/React.createElement(Index$4.Group, _objectSpread2({
8323
8471
  disabled: disabled,
8324
8472
  options: options
@@ -8347,10 +8495,10 @@ var WForm = function WForm(props, ref) {
8347
8495
  setColumnsFields(function (preColumnsFields) {
8348
8496
  return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options3));
8349
8497
  });
8350
- var _labelCol16 = {};
8498
+ var _labelCol18 = {};
8351
8499
 
8352
8500
  if (search && search.labelWidth) {
8353
- _labelCol16.style = {
8501
+ _labelCol18.style = {
8354
8502
  width: search.labelWidth
8355
8503
  };
8356
8504
  }
@@ -8376,7 +8524,7 @@ var WForm = function WForm(props, ref) {
8376
8524
  }, c.formItemProps), {}, {
8377
8525
  name: c.dataIndex,
8378
8526
  label: c.title,
8379
- labelCol: _labelCol16
8527
+ labelCol: _labelCol18
8380
8528
  }), /*#__PURE__*/React.createElement(Index$3.Group, _objectSpread2(_objectSpread2({
8381
8529
  disabled: disabled
8382
8530
  }, radioButtonProps), {}, {
@@ -8396,10 +8544,10 @@ var WForm = function WForm(props, ref) {
8396
8544
  }
8397
8545
  }
8398
8546
 
8399
- var _labelCol17 = {};
8547
+ var _labelCol19 = {};
8400
8548
 
8401
8549
  if (search && search.labelWidth) {
8402
- _labelCol17.style = {
8550
+ _labelCol19.style = {
8403
8551
  width: search.labelWidth
8404
8552
  };
8405
8553
  } // if (columnsFieldsRef.current) {
@@ -8423,15 +8571,15 @@ var WForm = function WForm(props, ref) {
8423
8571
  }, c.formItemProps), {}, {
8424
8572
  name: c.dataIndex,
8425
8573
  label: c.title,
8426
- labelCol: _labelCol17
8574
+ labelCol: _labelCol19
8427
8575
  }), /*#__PURE__*/React.createElement(WSwitch, _objectSpread2({
8428
8576
  disabled: disabled
8429
8577
  }, c.fieldProps))));
8430
8578
  } else if (c.valueType === 'digit') {
8431
- var _labelCol18 = {};
8579
+ var _labelCol20 = {};
8432
8580
 
8433
8581
  if (search && search.labelWidth) {
8434
- _labelCol18.style = {
8582
+ _labelCol20.style = {
8435
8583
  width: search.labelWidth
8436
8584
  };
8437
8585
  }
@@ -8448,16 +8596,16 @@ var WForm = function WForm(props, ref) {
8448
8596
  }, c.formItemProps), {}, {
8449
8597
  name: c.dataIndex,
8450
8598
  label: c.title,
8451
- labelCol: _labelCol18
8599
+ labelCol: _labelCol20
8452
8600
  }), /*#__PURE__*/React.createElement(NumericInput, _objectSpread2({
8453
8601
  disabled: disabled,
8454
8602
  placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
8455
8603
  }, c.fieldProps))));
8456
8604
  } else if (c.renderFormItem) {
8457
- var _labelCol19 = {};
8605
+ var _labelCol21 = {};
8458
8606
 
8459
8607
  if (search && search.labelWidth) {
8460
- _labelCol19.style = {
8608
+ _labelCol21.style = {
8461
8609
  width: search.labelWidth
8462
8610
  };
8463
8611
  }
@@ -8480,13 +8628,13 @@ var WForm = function WForm(props, ref) {
8480
8628
  }, c.formItemProps), {}, {
8481
8629
  name: c.dataIndex,
8482
8630
  label: c.title,
8483
- labelCol: _labelCol19
8631
+ labelCol: _labelCol21
8484
8632
  }), baseitem)) : null;
8485
8633
  } else if (c.valueType === 'textarea') {
8486
- var _labelCol20 = {};
8634
+ var _labelCol22 = {};
8487
8635
 
8488
8636
  if (search && search.labelWidth) {
8489
- _labelCol20.style = {
8637
+ _labelCol22.style = {
8490
8638
  width: search.labelWidth
8491
8639
  };
8492
8640
  }
@@ -8503,17 +8651,17 @@ var WForm = function WForm(props, ref) {
8503
8651
  }, c.formItemProps), {}, {
8504
8652
  name: c.dataIndex,
8505
8653
  label: c.title,
8506
- labelCol: _labelCol20
8654
+ labelCol: _labelCol22
8507
8655
  }), /*#__PURE__*/React.createElement(Index.TextArea, _objectSpread2({
8508
8656
  rows: 4,
8509
8657
  disabled: disabled,
8510
8658
  placeholder: "\u8BF7\u8F93\u5165"
8511
8659
  }, c.fieldProps))));
8512
8660
  } else if (c.valueType === 'inputNumber') {
8513
- var _labelCol21 = {};
8661
+ var _labelCol23 = {};
8514
8662
 
8515
8663
  if (search && search.labelWidth) {
8516
- _labelCol21.style = {
8664
+ _labelCol23.style = {
8517
8665
  width: search.labelWidth
8518
8666
  };
8519
8667
  }
@@ -8530,16 +8678,16 @@ var WForm = function WForm(props, ref) {
8530
8678
  }, c.formItemProps), {}, {
8531
8679
  name: c.dataIndex,
8532
8680
  label: c.title,
8533
- labelCol: _labelCol21
8681
+ labelCol: _labelCol23
8534
8682
  }), /*#__PURE__*/React.createElement(WInputNumber, _objectSpread2({
8535
8683
  disabled: disabled,
8536
8684
  placeholder: "\u8BF7\u8F93\u5165"
8537
8685
  }, c.fieldProps))));
8538
8686
  } else {
8539
- var _labelCol22 = {};
8687
+ var _labelCol24 = {};
8540
8688
 
8541
8689
  if (search && search.labelWidth) {
8542
- _labelCol22.style = {
8690
+ _labelCol24.style = {
8543
8691
  width: search.labelWidth
8544
8692
  };
8545
8693
  }
@@ -8556,7 +8704,7 @@ var WForm = function WForm(props, ref) {
8556
8704
  }, c.formItemProps), {}, {
8557
8705
  name: c.dataIndex,
8558
8706
  label: c.title,
8559
- labelCol: _labelCol22
8707
+ labelCol: _labelCol24
8560
8708
  }), /*#__PURE__*/React.createElement(Index, _objectSpread2({
8561
8709
  disabled: disabled,
8562
8710
  placeholder: "\u8BF7\u8F93\u5165"
@@ -8699,8 +8847,8 @@ var WForm = function WForm(props, ref) {
8699
8847
 
8700
8848
  var WForm$1 = /*#__PURE__*/React.forwardRef(WForm);
8701
8849
 
8702
- var _excluded$7 = ["height", "width", "count", "style", "numberStyle"],
8703
- _excluded2$2 = ["count", "width", "height", "marginRight"];
8850
+ var _excluded$8 = ["height", "width", "count", "style", "numberStyle"],
8851
+ _excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
8704
8852
 
8705
8853
  var Number = function Number(_ref) {
8706
8854
  var height = _ref.height,
@@ -8709,7 +8857,7 @@ var Number = function Number(_ref) {
8709
8857
  count = _ref$count === void 0 ? 0 : _ref$count,
8710
8858
  style = _ref.style,
8711
8859
  numberStyle = _ref.numberStyle,
8712
- props = _objectWithoutProperties(_ref, _excluded$7);
8860
+ props = _objectWithoutProperties(_ref, _excluded$8);
8713
8861
 
8714
8862
  // 上次的值
8715
8863
  var _useState = useState(0),
@@ -8831,6 +8979,8 @@ Number.defaultProps = {
8831
8979
 
8832
8980
  var Index$7 = function Index(props) {
8833
8981
  var count = props.count,
8982
+ _props$numberCount = props.numberCount,
8983
+ numberCount = _props$numberCount === void 0 ? 5 : _props$numberCount,
8834
8984
  width = props.width,
8835
8985
  height = props.height,
8836
8986
  _props$marginRight = props.marginRight,
@@ -8844,6 +8994,11 @@ var Index$7 = function Index(props) {
8844
8994
 
8845
8995
  useEffect(function () {
8846
8996
  var countArray = count.toString().split('');
8997
+
8998
+ if (numberCount > countArray.length) {
8999
+ countArray = [].concat(_toConsumableArray(Array(numberCount - countArray.length).fill(0)), _toConsumableArray(countArray));
9000
+ }
9001
+
8847
9002
  setNumberList(countArray.map(function (num) {
8848
9003
  return +num;
8849
9004
  }));
@@ -8866,12 +9021,12 @@ var Index$7 = function Index(props) {
8866
9021
  }));
8867
9022
  };
8868
9023
 
8869
- var _excluded$8 = ["duration"];
9024
+ var _excluded$9 = ["duration"];
8870
9025
 
8871
9026
  var Index$8 = function Index(props) {
8872
9027
  var _props$duration = props.duration,
8873
9028
  duration = _props$duration === void 0 ? 2.75 : _props$duration,
8874
- extraProps = _objectWithoutProperties(props, _excluded$8);
9029
+ extraProps = _objectWithoutProperties(props, _excluded$9);
8875
9030
  return /*#__PURE__*/React.createElement(CountUp, _objectSpread2({
8876
9031
  duration: duration
8877
9032
  }, extraProps));
@@ -8879,7 +9034,7 @@ var Index$8 = function Index(props) {
8879
9034
 
8880
9035
  Index$8.defaultProps = {};
8881
9036
 
8882
- var _excluded$9 = ["list", "render", "partSize"];
9037
+ var _excluded$a = ["list", "render", "partSize"];
8883
9038
 
8884
9039
  function AutoScroll(props) {
8885
9040
  var inner1 = useRef();
@@ -8963,7 +9118,7 @@ var Index$9 = function Index(_ref) {
8963
9118
  render = _ref.render,
8964
9119
  _ref$partSize = _ref.partSize,
8965
9120
  partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
8966
- otherProps = _objectWithoutProperties(_ref, _excluded$9);
9121
+ otherProps = _objectWithoutProperties(_ref, _excluded$a);
8967
9122
 
8968
9123
  {
8969
9124
  var _useState = useState([]),
@@ -9040,28 +9195,42 @@ var Index$9 = function Index(_ref) {
9040
9195
  }
9041
9196
  };
9042
9197
 
9043
- var _excluded$a = ["data", "onClick", "renderItem"];
9198
+ var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
9044
9199
 
9045
9200
  SwiperCore.use([Pagination, Navigation, Autoplay]);
9046
9201
 
9047
9202
  var Index$a = function Index(props) {
9048
9203
  var data = props.data,
9049
9204
  _onClick = props.onClick,
9205
+ _props$slidesPerView = props.slidesPerView,
9206
+ slidesPerView = _props$slidesPerView === void 0 ? 4 : _props$slidesPerView,
9207
+ rowKey = props.rowKey,
9208
+ onSwiperChange = props.onSwiperChange,
9050
9209
  renderItem = props.renderItem,
9051
- extraProps = _objectWithoutProperties(props, _excluded$a);
9210
+ extraProps = _objectWithoutProperties(props, _excluded$b);
9052
9211
 
9053
- return /*#__PURE__*/React.createElement(Swiper, _objectSpread2({
9054
- onClick: function onClick(swiper, event) {
9055
- if (swiper.clickedIndex - 4 > data.length) {
9056
- swiper.slideNext();
9057
- } else {
9058
- swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
9059
- }
9212
+ var _useState = useState(null),
9213
+ _useState2 = _slicedToArray(_useState, 2),
9214
+ controlledSwiper = _useState2[0],
9215
+ setControlledSwiper = _useState2[1];
9060
9216
 
9061
- _onClick && _onClick(swiper, event);
9217
+ return /*#__PURE__*/React.createElement(Swiper, _objectSpread2({
9218
+ onSwiper: function onSwiper(swiper) {
9219
+ return setControlledSwiper(swiper);
9220
+ },
9221
+ // onClick={(swiper, event) => {
9222
+ // if (swiper.clickedIndex - 4 > data.length) {
9223
+ // swiper.slideNext();
9224
+ // } else {
9225
+ // swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
9226
+ // }
9227
+ // onClick && onClick(swiper, event);
9228
+ // }}
9229
+ onSlideChange: function onSlideChange(swiper) {
9230
+ onSwiperChange && onSwiperChange(swiper.realIndex, data[swiper.realIndex]);
9062
9231
  },
9063
9232
  className: "mySwiper",
9064
- slidesPerView: 4,
9233
+ slidesPerView: slidesPerView,
9065
9234
  spaceBetween: 30,
9066
9235
  loop: true,
9067
9236
  loopFillGroupWithBlank: true,
@@ -9069,10 +9238,26 @@ var Index$a = function Index(props) {
9069
9238
  navigation: true
9070
9239
  }, extraProps), data.map(function (item, index) {
9071
9240
  return /*#__PURE__*/React.createElement(SwiperSlide, {
9072
- key: index
9241
+ key: rowKey ? item[rowKey] : index
9073
9242
  }, function (_ref) {
9074
9243
  var isActive = _ref.isActive;
9075
- return renderItem(item, index, isActive);
9244
+ return /*#__PURE__*/React.createElement("div", {
9245
+ style: {
9246
+ width: '100%',
9247
+ height: '100%'
9248
+ },
9249
+ onClick: function onClick(event) {
9250
+ if (controlledSwiper) {
9251
+ if (controlledSwiper.clickedIndex - slidesPerView > data.length) {
9252
+ controlledSwiper.slideNext();
9253
+ } else {
9254
+ controlledSwiper.clickedIndex && controlledSwiper.slideTo(controlledSwiper.clickedIndex);
9255
+ }
9256
+
9257
+ _onClick && _onClick(controlledSwiper, event);
9258
+ }
9259
+ }
9260
+ }, renderItem(item, index, isActive));
9076
9261
  });
9077
9262
  }));
9078
9263
  };
@@ -9673,7 +9858,7 @@ function createBrowserHistory(props) {
9673
9858
  return history;
9674
9859
  }
9675
9860
 
9676
- var _excluded$b = ["routes", "className"];
9861
+ var _excluded$c = ["routes", "className"];
9677
9862
  var history = createBrowserHistory();
9678
9863
 
9679
9864
  function itemRender(route, params, routes, paths) {
@@ -9691,7 +9876,7 @@ function itemRender(route, params, routes, paths) {
9691
9876
  var Index$b = function Index(_ref) {
9692
9877
  var routes = _ref.routes,
9693
9878
  className = _ref.className,
9694
- props = _objectWithoutProperties(_ref, _excluded$b);
9879
+ props = _objectWithoutProperties(_ref, _excluded$c);
9695
9880
 
9696
9881
  return /*#__PURE__*/React.createElement(_Breadcrumb, _objectSpread2({
9697
9882
  className: className || 'default',
@@ -9701,7 +9886,7 @@ var Index$b = function Index(_ref) {
9701
9886
  }, props));
9702
9887
  };
9703
9888
 
9704
- var _excluded$c = ["title", "className", "headerTail", "headerCenter"];
9889
+ var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
9705
9890
 
9706
9891
  var Index$c = function Index(_ref) {
9707
9892
  var _classNames;
@@ -9711,7 +9896,7 @@ var Index$c = function Index(_ref) {
9711
9896
  className = _ref$className === void 0 ? 'default' : _ref$className,
9712
9897
  headerTail = _ref.headerTail,
9713
9898
  headerCenter = _ref.headerCenter,
9714
- props = _objectWithoutProperties(_ref, _excluded$c);
9899
+ props = _objectWithoutProperties(_ref, _excluded$d);
9715
9900
 
9716
9901
  return /*#__PURE__*/React.createElement("div", _objectSpread2({
9717
9902
  className: classnames((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
@@ -9788,7 +9973,7 @@ function DialogModel(props) {
9788
9973
  height: '100%',
9789
9974
  position: 'relative'
9790
9975
  }
9791
- }, ' ', props.children, ' '))), /*#__PURE__*/React.createElement("div", {
9976
+ }, props.children))), /*#__PURE__*/React.createElement("div", {
9792
9977
  className: 'mask',
9793
9978
  onClick: function onClick() {
9794
9979
  return onClose && onClose();
@@ -9818,7 +10003,7 @@ function DialogModel(props) {
9818
10003
  return renderChildren;
9819
10004
  }
9820
10005
 
9821
- var _excluded$d = ["visible"];
10006
+ var _excluded$e = ["visible"];
9822
10007
 
9823
10008
  var Modal = /*#__PURE__*/function (_React$PureComponent) {
9824
10009
  _inherits(Modal, _React$PureComponent);
@@ -9907,7 +10092,9 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
9907
10092
  style: style
9908
10093
  }, this.renderTop(), /*#__PURE__*/React.createElement("div", {
9909
10094
  className: "model-content"
9910
- }, this.renderContent()), this.renderFooter());
10095
+ }, /*#__PURE__*/React.createElement("div", {
10096
+ className: "model-content-in"
10097
+ }, this.renderContent())), this.renderFooter());
9911
10098
  }
9912
10099
  }]);
9913
10100
 
@@ -9950,7 +10137,7 @@ Modal.show = function (config) {
9950
10137
  manager.setShow = setShow;
9951
10138
 
9952
10139
  var visible = props.visible,
9953
- trueProps = _objectWithoutProperties(props, _excluded$d);
10140
+ trueProps = _objectWithoutProperties(props, _excluded$e);
9954
10141
 
9955
10142
  useEffect(function () {
9956
10143
  manager.mounted = true;
@@ -9974,7 +10161,7 @@ Modal.hidden = function () {
9974
10161
  ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
9975
10162
  };
9976
10163
 
9977
- var _excluded$e = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
10164
+ var _excluded$f = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
9978
10165
 
9979
10166
  var ModalForm = function ModalForm(props, ref) {
9980
10167
  var columns = props.columns,
@@ -9988,7 +10175,7 @@ var ModalForm = function ModalForm(props, ref) {
9988
10175
  title = props.title,
9989
10176
  record = props.record,
9990
10177
  onFormChange = props.onFormChange,
9991
- extraProps = _objectWithoutProperties(props, _excluded$e);
10178
+ extraProps = _objectWithoutProperties(props, _excluded$f);
9992
10179
 
9993
10180
  var formRef = useRef(null);
9994
10181
 
@@ -10119,7 +10306,748 @@ var ModalForm = function ModalForm(props, ref) {
10119
10306
 
10120
10307
  var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
10121
10308
 
10122
- var _excluded$f = ["columns", "extraColumns", "request", "modalFormSearch", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig"],
10309
+ function _defineProperty$1(obj, key, value) {
10310
+ if (key in obj) {
10311
+ Object.defineProperty(obj, key, {
10312
+ value: value,
10313
+ enumerable: true,
10314
+ configurable: true,
10315
+ writable: true
10316
+ });
10317
+ } else {
10318
+ obj[key] = value;
10319
+ }
10320
+
10321
+ return obj;
10322
+ }
10323
+
10324
+ function ownKeys$1(object, enumerableOnly) {
10325
+ var keys = Object.keys(object);
10326
+
10327
+ if (Object.getOwnPropertySymbols) {
10328
+ var symbols = Object.getOwnPropertySymbols(object);
10329
+
10330
+ if (enumerableOnly) {
10331
+ symbols = symbols.filter(function (sym) {
10332
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
10333
+ });
10334
+ }
10335
+
10336
+ keys.push.apply(keys, symbols);
10337
+ }
10338
+
10339
+ return keys;
10340
+ }
10341
+
10342
+ function _objectSpread2$1(target) {
10343
+ for (var i = 1; i < arguments.length; i++) {
10344
+ var source = arguments[i] != null ? arguments[i] : {};
10345
+
10346
+ if (i % 2) {
10347
+ ownKeys$1(Object(source), true).forEach(function (key) {
10348
+ _defineProperty$1(target, key, source[key]);
10349
+ });
10350
+ } else if (Object.getOwnPropertyDescriptors) {
10351
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
10352
+ } else {
10353
+ ownKeys$1(Object(source)).forEach(function (key) {
10354
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
10355
+ });
10356
+ }
10357
+ }
10358
+
10359
+ return target;
10360
+ }
10361
+
10362
+ function _arrayLikeToArray$1(arr, len) {
10363
+ if (len == null || len > arr.length) len = arr.length;
10364
+
10365
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
10366
+ arr2[i] = arr[i];
10367
+ }
10368
+
10369
+ return arr2;
10370
+ }
10371
+
10372
+ function _unsupportedIterableToArray$1(o, minLen) {
10373
+ if (!o) return;
10374
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
10375
+ var n = Object.prototype.toString.call(o).slice(8, -1);
10376
+ if (n === "Object" && o.constructor) n = o.constructor.name;
10377
+ if (n === "Map" || n === "Set") return Array.from(o);
10378
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
10379
+ }
10380
+
10381
+ function _createForOfIteratorHelper$1(o, allowArrayLike) {
10382
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
10383
+
10384
+ if (!it) {
10385
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
10386
+ if (it) o = it;
10387
+ var i = 0;
10388
+
10389
+ var F = function F() {};
10390
+
10391
+ return {
10392
+ s: F,
10393
+ n: function n() {
10394
+ if (i >= o.length) return {
10395
+ done: true
10396
+ };
10397
+ return {
10398
+ done: false,
10399
+ value: o[i++]
10400
+ };
10401
+ },
10402
+ e: function e(_e) {
10403
+ throw _e;
10404
+ },
10405
+ f: F
10406
+ };
10407
+ }
10408
+
10409
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10410
+ }
10411
+
10412
+ var normalCompletion = true,
10413
+ didErr = false,
10414
+ err;
10415
+ return {
10416
+ s: function s() {
10417
+ it = it.call(o);
10418
+ },
10419
+ n: function n() {
10420
+ var step = it.next();
10421
+ normalCompletion = step.done;
10422
+ return step;
10423
+ },
10424
+ e: function e(_e2) {
10425
+ didErr = true;
10426
+ err = _e2;
10427
+ },
10428
+ f: function f() {
10429
+ try {
10430
+ if (!normalCompletion && it["return"] != null) it["return"]();
10431
+ } finally {
10432
+ if (didErr) throw err;
10433
+ }
10434
+ }
10435
+ };
10436
+ }
10437
+
10438
+ /*! *****************************************************************************
10439
+ Copyright (c) Microsoft Corporation.
10440
+
10441
+ Permission to use, copy, modify, and/or distribute this software for any
10442
+ purpose with or without fee is hereby granted.
10443
+
10444
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10445
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10446
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10447
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10448
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
10449
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
10450
+ PERFORMANCE OF THIS SOFTWARE.
10451
+ ***************************************************************************** */
10452
+
10453
+ function __awaiter(thisArg, _arguments, P, generator) {
10454
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10455
+ return new (P || (P = Promise))(function (resolve, reject) {
10456
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10457
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10458
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10459
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10460
+ });
10461
+ }
10462
+
10463
+ function __generator(thisArg, body) {
10464
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
10465
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
10466
+ function verb(n) { return function (v) { return step([n, v]); }; }
10467
+ function step(op) {
10468
+ if (f) throw new TypeError("Generator is already executing.");
10469
+ while (_) try {
10470
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
10471
+ if (y = 0, t) op = [op[0] & 2, t.value];
10472
+ switch (op[0]) {
10473
+ case 0: case 1: t = op; break;
10474
+ case 4: _.label++; return { value: op[1], done: false };
10475
+ case 5: _.label++; y = op[1]; op = [0]; continue;
10476
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
10477
+ default:
10478
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
10479
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
10480
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
10481
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
10482
+ if (t[2]) _.ops.pop();
10483
+ _.trys.pop(); continue;
10484
+ }
10485
+ op = body.call(thisArg, _);
10486
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
10487
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
10488
+ }
10489
+ }
10490
+
10491
+ var noop = function () { };
10492
+ // Using noop() as the undefined value as undefined can possibly be replaced
10493
+ // by something else. Prettier ignore and extra parentheses are necessary here
10494
+ // to ensure that tsc doesn't remove the __NOINLINE__ comment.
10495
+ // prettier-ignore
10496
+ var UNDEFINED = ( /*#__NOINLINE__*/noop());
10497
+ var OBJECT = Object;
10498
+ var isUndefined$1 = function (v) { return v === UNDEFINED; };
10499
+ var isFunction$1 = function (v) { return typeof v == 'function'; };
10500
+ var mergeObjects = function (a, b) { return OBJECT.assign({}, a, b); };
10501
+ var STR_UNDEFINED = 'undefined';
10502
+ var hasWindow = function () { return typeof window != STR_UNDEFINED; };
10503
+ var hasDocument = function () { return typeof document != STR_UNDEFINED; };
10504
+
10505
+ // use WeakMap to store the object->key mapping
10506
+ // so the objects can be garbage collected.
10507
+ // WeakMap uses a hashtable under the hood, so the lookup
10508
+ // complexity is almost O(1).
10509
+ var table = new WeakMap();
10510
+ // counter of the key
10511
+ var counter = 0;
10512
+ // A stable hash implementation that supports:
10513
+ // - Fast and ensures unique hash properties
10514
+ // - Handles unserializable values
10515
+ // - Handles object key ordering
10516
+ // - Generates short results
10517
+ //
10518
+ // This is not a serialization function, and the result is not guaranteed to be
10519
+ // parsible.
10520
+ var stableHash = function (arg) {
10521
+ var type = typeof arg;
10522
+ var constructor = arg && arg.constructor;
10523
+ var isDate = constructor == Date;
10524
+ var result;
10525
+ var index;
10526
+ if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {
10527
+ // Object/function, not null/date/regexp. Use WeakMap to store the id first.
10528
+ // If it's already hashed, directly return the result.
10529
+ result = table.get(arg);
10530
+ if (result)
10531
+ return result;
10532
+ // Store the hash first for circular reference detection before entering the
10533
+ // recursive `stableHash` calls.
10534
+ // For other objects like set and map, we use this id directly as the hash.
10535
+ result = ++counter + '~';
10536
+ table.set(arg, result);
10537
+ if (constructor == Array) {
10538
+ // Array.
10539
+ result = '@';
10540
+ for (index = 0; index < arg.length; index++) {
10541
+ result += stableHash(arg[index]) + ',';
10542
+ }
10543
+ table.set(arg, result);
10544
+ }
10545
+ if (constructor == OBJECT) {
10546
+ // Object, sort keys.
10547
+ result = '#';
10548
+ var keys = OBJECT.keys(arg).sort();
10549
+ while (!isUndefined$1((index = keys.pop()))) {
10550
+ if (!isUndefined$1(arg[index])) {
10551
+ result += index + ':' + stableHash(arg[index]) + ',';
10552
+ }
10553
+ }
10554
+ table.set(arg, result);
10555
+ }
10556
+ }
10557
+ else {
10558
+ result = isDate
10559
+ ? arg.toJSON()
10560
+ : type == 'symbol'
10561
+ ? arg.toString()
10562
+ : type == 'string'
10563
+ ? JSON.stringify(arg)
10564
+ : '' + arg;
10565
+ }
10566
+ return result;
10567
+ };
10568
+
10569
+ /**
10570
+ * Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
10571
+ * it's not reliable to detect if the browser is currently online or offline
10572
+ * based on `navigator.onLine`.
10573
+ * As a work around, we always assume it's online on first load, and change
10574
+ * the status upon `online` or `offline` events.
10575
+ */
10576
+ var online = true;
10577
+ var isOnline = function () { return online; };
10578
+ var hasWin = hasWindow();
10579
+ var hasDoc = hasDocument();
10580
+ // For node and React Native, `add/removeEventListener` doesn't exist on window.
10581
+ var onWindowEvent = hasWin && window.addEventListener
10582
+ ? window.addEventListener.bind(window)
10583
+ : noop;
10584
+ var onDocumentEvent = hasDoc ? document.addEventListener.bind(document) : noop;
10585
+ var offWindowEvent = hasWin && window.removeEventListener
10586
+ ? window.removeEventListener.bind(window)
10587
+ : noop;
10588
+ var offDocumentEvent = hasDoc
10589
+ ? document.removeEventListener.bind(document)
10590
+ : noop;
10591
+ var isVisible = function () {
10592
+ var visibilityState = hasDoc && document.visibilityState;
10593
+ if (!isUndefined$1(visibilityState)) {
10594
+ return visibilityState !== 'hidden';
10595
+ }
10596
+ return true;
10597
+ };
10598
+ var initFocus = function (cb) {
10599
+ // focus revalidate
10600
+ onDocumentEvent('visibilitychange', cb);
10601
+ onWindowEvent('focus', cb);
10602
+ return function () {
10603
+ offDocumentEvent('visibilitychange', cb);
10604
+ offWindowEvent('focus', cb);
10605
+ };
10606
+ };
10607
+ var initReconnect = function (cb) {
10608
+ // revalidate on reconnected
10609
+ var onOnline = function () {
10610
+ online = true;
10611
+ cb();
10612
+ };
10613
+ // nothing to revalidate, just update the status
10614
+ var onOffline = function () {
10615
+ online = false;
10616
+ };
10617
+ onWindowEvent('online', onOnline);
10618
+ onWindowEvent('offline', onOffline);
10619
+ return function () {
10620
+ offWindowEvent('online', onOnline);
10621
+ offWindowEvent('offline', onOffline);
10622
+ };
10623
+ };
10624
+ var preset = {
10625
+ isOnline: isOnline,
10626
+ isVisible: isVisible
10627
+ };
10628
+ var defaultConfigOptions = {
10629
+ initFocus: initFocus,
10630
+ initReconnect: initReconnect
10631
+ };
10632
+
10633
+ var IS_SERVER = !hasWindow() || 'Deno' in window;
10634
+ // React currently throws a warning when using useLayoutEffect on the server.
10635
+ // To get around it, we can conditionally useEffect on the server (no-op) and
10636
+ // useLayoutEffect in the browser.
10637
+ var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
10638
+ // This assignment is to extend the Navigator type to use effectiveType.
10639
+ var navigatorConnection = typeof navigator !== 'undefined' &&
10640
+ navigator.connection;
10641
+ // Adjust the config based on slow connection status (<= 70Kbps).
10642
+ var slowConnection = !IS_SERVER &&
10643
+ navigatorConnection &&
10644
+ (['slow-2g', '2g'].includes(navigatorConnection.effectiveType) ||
10645
+ navigatorConnection.saveData);
10646
+
10647
+ var serialize = function (key) {
10648
+ if (isFunction$1(key)) {
10649
+ try {
10650
+ key = key();
10651
+ }
10652
+ catch (err) {
10653
+ // dependencies not ready
10654
+ key = '';
10655
+ }
10656
+ }
10657
+ var args = [].concat(key);
10658
+ // If key is not falsy, or not an empty array, hash it.
10659
+ key =
10660
+ typeof key == 'string'
10661
+ ? key
10662
+ : (Array.isArray(key)
10663
+ ? key.length
10664
+ : key)
10665
+ ? stableHash(key)
10666
+ : '';
10667
+ var errorKey = key ? '$err$' + key : '';
10668
+ var isValidatingKey = key ? '$req$' + key : '';
10669
+ return [key, args, errorKey, isValidatingKey];
10670
+ };
10671
+
10672
+ // Global state used to deduplicate requests and store listeners
10673
+ var SWRGlobalState = new WeakMap();
10674
+
10675
+ var FOCUS_EVENT = 0;
10676
+ var RECONNECT_EVENT = 1;
10677
+ var MUTATE_EVENT = 2;
10678
+
10679
+ var broadcastState = function (cache, key, data, error, isValidating, revalidate) {
10680
+ var _a = SWRGlobalState.get(cache), EVENT_REVALIDATORS = _a[0], STATE_UPDATERS = _a[1], CONCURRENT_PROMISES = _a[4], CONCURRENT_PROMISES_TS = _a[5];
10681
+ var revalidators = EVENT_REVALIDATORS[key];
10682
+ var updaters = STATE_UPDATERS[key] || [];
10683
+ // Always update states of all hooks.
10684
+ for (var i = 0; i < updaters.length; ++i) {
10685
+ updaters[i](data, error, isValidating);
10686
+ }
10687
+ // If we also need to revalidate, only do it for the first hook.
10688
+ if (revalidate) {
10689
+ // Invalidate the key by deleting the concurrent request markers so new
10690
+ // requests will not be deduped.
10691
+ delete CONCURRENT_PROMISES[key];
10692
+ delete CONCURRENT_PROMISES_TS[key];
10693
+ if (revalidators && revalidators[0]) {
10694
+ return revalidators[0](MUTATE_EVENT).then(function () {
10695
+ return cache.get(key);
10696
+ });
10697
+ }
10698
+ }
10699
+ return cache.get(key);
10700
+ };
10701
+
10702
+ // Global timestamp.
10703
+ var __timestamp = 0;
10704
+ var getTimestamp = function () { return ++__timestamp; };
10705
+
10706
+ var internalMutate = function () {
10707
+ var args = [];
10708
+ for (var _i = 0; _i < arguments.length; _i++) {
10709
+ args[_i] = arguments[_i];
10710
+ }
10711
+ return __awaiter(void 0, void 0, void 0, function () {
10712
+ var cache, _key, revalidate, _data, _a, key, keyErr, _b, MUTATION_TS, MUTATION_END_TS, data, error, beforeMutationTs, res;
10713
+ return __generator(this, function (_c) {
10714
+ switch (_c.label) {
10715
+ case 0:
10716
+ cache = args[0], _key = args[1];
10717
+ revalidate = args[3] !== false;
10718
+ _data = args[2];
10719
+ _a = serialize(_key), key = _a[0], keyErr = _a[2];
10720
+ if (!key)
10721
+ return [2 /*return*/];
10722
+ _b = SWRGlobalState.get(cache), MUTATION_TS = _b[2], MUTATION_END_TS = _b[3];
10723
+ // If there is no new data provided, revalidate the key with current state.
10724
+ if (args.length < 3) {
10725
+ // Revalidate and broadcast state.
10726
+ return [2 /*return*/, broadcastState(cache, key, cache.get(key), cache.get(keyErr), UNDEFINED, revalidate)];
10727
+ }
10728
+ beforeMutationTs = (MUTATION_TS[key] = getTimestamp());
10729
+ MUTATION_END_TS[key] = 0;
10730
+ if (isFunction$1(_data)) {
10731
+ // `_data` is a function, call it passing current cache value.
10732
+ try {
10733
+ _data = _data(cache.get(key));
10734
+ }
10735
+ catch (err) {
10736
+ // If it throws an error synchronously, we shouldn't update the cache.
10737
+ error = err;
10738
+ }
10739
+ }
10740
+ if (!(_data && isFunction$1(_data.then))) return [3 /*break*/, 2];
10741
+ return [4 /*yield*/, _data.catch(function (err) {
10742
+ error = err;
10743
+ })
10744
+ // Check if other mutations have occurred since we've started this mutation.
10745
+ // If there's a race we don't update cache or broadcast the change,
10746
+ // just return the data.
10747
+ ];
10748
+ case 1:
10749
+ // This means that the mutation is async, we need to check timestamps to
10750
+ // avoid race conditions.
10751
+ data = _c.sent();
10752
+ // Check if other mutations have occurred since we've started this mutation.
10753
+ // If there's a race we don't update cache or broadcast the change,
10754
+ // just return the data.
10755
+ if (beforeMutationTs !== MUTATION_TS[key]) {
10756
+ if (error)
10757
+ throw error;
10758
+ return [2 /*return*/, data];
10759
+ }
10760
+ return [3 /*break*/, 3];
10761
+ case 2:
10762
+ data = _data;
10763
+ _c.label = 3;
10764
+ case 3:
10765
+ // Only update cached data if there's no error. Data can be `undefined` here.
10766
+ if (!error) {
10767
+ cache.set(key, data);
10768
+ }
10769
+ // Always update or reset the error.
10770
+ cache.set(keyErr, error);
10771
+ // Reset the timestamp to mark the mutation has ended.
10772
+ MUTATION_END_TS[key] = getTimestamp();
10773
+ return [4 /*yield*/, broadcastState(cache, key, data, error, UNDEFINED, revalidate)
10774
+ // Throw error or return data
10775
+ ];
10776
+ case 4:
10777
+ res = _c.sent();
10778
+ // Throw error or return data
10779
+ if (error)
10780
+ throw error;
10781
+ return [2 /*return*/, res];
10782
+ }
10783
+ });
10784
+ });
10785
+ };
10786
+
10787
+ var revalidateAllKeys = function (revalidators, type) {
10788
+ for (var key in revalidators) {
10789
+ if (revalidators[key][0])
10790
+ revalidators[key][0](type);
10791
+ }
10792
+ };
10793
+ var initCache = function (provider, options) {
10794
+ // The global state for a specific provider will be used to deduplicate
10795
+ // requests and store listeners. As well as a mutate function that bound to
10796
+ // the cache.
10797
+ // Provider's global state might be already initialized. Let's try to get the
10798
+ // global state associated with the provider first.
10799
+ if (!SWRGlobalState.has(provider)) {
10800
+ var opts = mergeObjects(defaultConfigOptions, options);
10801
+ // If there's no global state bound to the provider, create a new one with the
10802
+ // new mutate function.
10803
+ var EVENT_REVALIDATORS = {};
10804
+ var mutate = internalMutate.bind(UNDEFINED, provider);
10805
+ var unmount = noop;
10806
+ // Update the state if it's new, or the provider has been extended.
10807
+ SWRGlobalState.set(provider, [
10808
+ EVENT_REVALIDATORS,
10809
+ {},
10810
+ {},
10811
+ {},
10812
+ {},
10813
+ {},
10814
+ mutate
10815
+ ]);
10816
+ // This is a new provider, we need to initialize it and setup DOM events
10817
+ // listeners for `focus` and `reconnect` actions.
10818
+ if (!IS_SERVER) {
10819
+ var releaseFocus_1 = opts.initFocus(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT));
10820
+ var releaseReconnect_1 = opts.initReconnect(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT));
10821
+ unmount = function () {
10822
+ releaseFocus_1 && releaseFocus_1();
10823
+ releaseReconnect_1 && releaseReconnect_1();
10824
+ // When un-mounting, we need to remove the cache provider from the state
10825
+ // storage too because it's a side-effect. Otherwise when re-mounting we
10826
+ // will not re-register those event listeners.
10827
+ SWRGlobalState.delete(provider);
10828
+ };
10829
+ }
10830
+ // We might want to inject an extra layer on top of `provider` in the future,
10831
+ // such as key serialization, auto GC, etc.
10832
+ // For now, it's just a `Map` interface without any modifications.
10833
+ return [provider, mutate, unmount];
10834
+ }
10835
+ return [provider, SWRGlobalState.get(provider)[6]];
10836
+ };
10837
+
10838
+ // error retry
10839
+ var onErrorRetry = function (_, __, config, revalidate, opts) {
10840
+ if (!preset.isVisible()) {
10841
+ // If it's hidden, stop. It will auto revalidate when refocusing.
10842
+ return;
10843
+ }
10844
+ var maxRetryCount = config.errorRetryCount;
10845
+ var currentRetryCount = opts.retryCount;
10846
+ // Exponential backoff
10847
+ var timeout = ~~((Math.random() + 0.5) *
10848
+ (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
10849
+ if (!isUndefined$1(maxRetryCount) && currentRetryCount > maxRetryCount) {
10850
+ return;
10851
+ }
10852
+ setTimeout(revalidate, timeout, opts);
10853
+ };
10854
+ // Default cache provider
10855
+ var _a = initCache(new Map()), cache = _a[0], mutate = _a[1];
10856
+ // Default config
10857
+ var defaultConfig = mergeObjects({
10858
+ // events
10859
+ onLoadingSlow: noop,
10860
+ onSuccess: noop,
10861
+ onError: noop,
10862
+ onErrorRetry: onErrorRetry,
10863
+ onDiscarded: noop,
10864
+ // switches
10865
+ revalidateOnFocus: true,
10866
+ revalidateOnReconnect: true,
10867
+ revalidateIfStale: true,
10868
+ shouldRetryOnError: true,
10869
+ // timeouts
10870
+ errorRetryInterval: slowConnection ? 10000 : 5000,
10871
+ focusThrottleInterval: 5 * 1000,
10872
+ dedupingInterval: 2 * 1000,
10873
+ loadingTimeout: slowConnection ? 5000 : 3000,
10874
+ // providers
10875
+ compare: function (currentData, newData) {
10876
+ return stableHash(currentData) == stableHash(newData);
10877
+ },
10878
+ isPaused: function () { return false; },
10879
+ cache: cache,
10880
+ mutate: mutate,
10881
+ fallback: {}
10882
+ },
10883
+ // use web preset by default
10884
+ preset);
10885
+
10886
+ var mergeConfigs$1 = function (a, b) {
10887
+ // Need to create a new object to avoid mutating the original here.
10888
+ var v = mergeObjects(a, b);
10889
+ // If two configs are provided, merge their `use` and `fallback` options.
10890
+ if (b) {
10891
+ var u1 = a.use, f1 = a.fallback;
10892
+ var u2 = b.use, f2 = b.fallback;
10893
+ if (u1 && u2) {
10894
+ v.use = u1.concat(u2);
10895
+ }
10896
+ if (f1 && f2) {
10897
+ v.fallback = mergeObjects(f1, f2);
10898
+ }
10899
+ }
10900
+ return v;
10901
+ };
10902
+
10903
+ var SWRConfigContext = createContext({});
10904
+ var SWRConfig$1 = function (props) {
10905
+ var value = props.value;
10906
+ // Extend parent context values and middleware.
10907
+ var extendedConfig = mergeConfigs$1(useContext(SWRConfigContext), value);
10908
+ // Should not use the inherited provider.
10909
+ var provider = value && value.provider;
10910
+ // Use a lazy initialized state to create the cache on first access.
10911
+ var cacheContext = useState(function () {
10912
+ return provider
10913
+ ? initCache(provider(extendedConfig.cache || cache), value)
10914
+ : UNDEFINED;
10915
+ })[0];
10916
+ // Override the cache if a new provider is given.
10917
+ if (cacheContext) {
10918
+ extendedConfig.cache = cacheContext[0];
10919
+ extendedConfig.mutate = cacheContext[1];
10920
+ }
10921
+ // Unsubscribe events.
10922
+ useIsomorphicLayoutEffect(function () { return (cacheContext ? cacheContext[2] : UNDEFINED); }, []);
10923
+ return createElement(SWRConfigContext.Provider, mergeObjects(props, {
10924
+ value: extendedConfig
10925
+ }));
10926
+ };
10927
+ var SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'default', {
10928
+ value: defaultConfig
10929
+ });
10930
+
10931
+ var zhCN = {
10932
+ moneySymbol: '¥',
10933
+ form: {
10934
+ lightFilter: {
10935
+ more: '更多筛选',
10936
+ clear: '清除',
10937
+ confirm: '确认',
10938
+ itemUnit: '项'
10939
+ }
10940
+ },
10941
+ tableForm: {
10942
+ search: '查询',
10943
+ reset: '重置',
10944
+ submit: '提交',
10945
+ collapsed: '展开',
10946
+ expand: '收起',
10947
+ inputPlaceholder: '请输入',
10948
+ selectPlaceholder: '请选择'
10949
+ },
10950
+ alert: {
10951
+ clear: '取消选择',
10952
+ selected: '已选择',
10953
+ item: '项'
10954
+ },
10955
+ pagination: {
10956
+ total: {
10957
+ range: '第',
10958
+ total: '条/总共',
10959
+ item: '条'
10960
+ }
10961
+ },
10962
+ tableToolBar: {
10963
+ leftPin: '固定在列首',
10964
+ rightPin: '固定在列尾',
10965
+ noPin: '不固定',
10966
+ leftFixedTitle: '固定在左侧',
10967
+ rightFixedTitle: '固定在右侧',
10968
+ noFixedTitle: '不固定',
10969
+ reset: '重置',
10970
+ columnDisplay: '列展示',
10971
+ columnSetting: '列设置',
10972
+ fullScreen: '全屏',
10973
+ exitFullScreen: '退出全屏',
10974
+ reload: '刷新',
10975
+ density: '密度',
10976
+ densityDefault: '正常',
10977
+ densityLarger: '默认',
10978
+ densityMiddle: '中等',
10979
+ densitySmall: '紧凑'
10980
+ },
10981
+ editableTable: {
10982
+ action: {
10983
+ save: '保存',
10984
+ cancel: '取消',
10985
+ delete: '删除'
10986
+ }
10987
+ },
10988
+ switch: {
10989
+ open: '打开',
10990
+ close: '关闭'
10991
+ },
10992
+ loginForm: {
10993
+ submitText: '登录'
10994
+ }
10995
+ };
10996
+
10997
+ function get$3(source, path, defaultValue) {
10998
+ // a[3].b -> a.3.b
10999
+ var paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
11000
+ var result = source;
11001
+ var message = defaultValue; // eslint-disable-next-line no-restricted-syntax
11002
+
11003
+ var _iterator = _createForOfIteratorHelper$1(paths),
11004
+ _step;
11005
+
11006
+ try {
11007
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
11008
+ var p = _step.value;
11009
+ message = Object(result)[p];
11010
+ result = Object(result)[p];
11011
+
11012
+ if (message === undefined) {
11013
+ return defaultValue;
11014
+ }
11015
+ }
11016
+ } catch (err) {
11017
+ _iterator.e(err);
11018
+ } finally {
11019
+ _iterator.f();
11020
+ }
11021
+
11022
+ return message;
11023
+ }
11024
+ /**
11025
+ * 创建一个操作函数
11026
+ *
11027
+ * @param locale
11028
+ * @param localeMap
11029
+ */
11030
+
11031
+
11032
+ var createIntl = function createIntl(locale, localeMap) {
11033
+ return {
11034
+ getMessage: function getMessage(id, defaultMessage) {
11035
+ return get$3(localeMap, id, defaultMessage) || defaultMessage;
11036
+ },
11037
+ locale: locale
11038
+ };
11039
+ };
11040
+ var zhCNIntl = createIntl('zh_CN', zhCN);
11041
+ var ConfigContext = /*#__PURE__*/React.createContext({
11042
+ intl: _objectSpread2$1(_objectSpread2$1({}, zhCNIntl), {}, {
11043
+ locale: 'default'
11044
+ }),
11045
+ valueTypeMap: {}
11046
+ });
11047
+ var ConfigConsumer = ConfigContext.Consumer,
11048
+ ConfigProvider = ConfigContext.Provider;
11049
+
11050
+ var _excluded$g = ["columns", "extraColumns", "request", "modalFormSearch", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig"],
10123
11051
  _excluded2$3 = ["actionMethod"];
10124
11052
 
10125
11053
  var TabelCard = function TabelCard(props, ref) {
@@ -10134,7 +11062,7 @@ var TabelCard = function TabelCard(props, ref) {
10134
11062
  onFormChange = props.onFormChange,
10135
11063
  modalConfig = props.modalConfig,
10136
11064
  optionColumnConfig = props.optionColumnConfig,
10137
- extraProps = _objectWithoutProperties(props, _excluded$f);
11065
+ extraProps = _objectWithoutProperties(props, _excluded$g);
10138
11066
 
10139
11067
  var actionRef = useRef();
10140
11068
  var formRef = useRef(null);
@@ -10463,6 +11391,7 @@ var TabelCard = function TabelCard(props, ref) {
10463
11391
  }
10464
11392
  });
10465
11393
  }, [actionRef]);
11394
+ var values = useContext(ConfigContext);
10466
11395
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalForm$1, _objectSpread2(_objectSpread2({
10467
11396
  ref: formRef,
10468
11397
  title: modalFormConfig.type || '新增',
@@ -10517,7 +11446,25 @@ var TabelCard = function TabelCard(props, ref) {
10517
11446
 
10518
11447
  return true;
10519
11448
  })
10520
- })), /*#__PURE__*/React.createElement(ProTable, _objectSpread2({
11449
+ })), /*#__PURE__*/React.createElement(ConfigContext.Provider, {
11450
+ value: _objectSpread2(_objectSpread2({}, values), {}, {
11451
+ valueTypeMap: {
11452
+ treeSelect: {
11453
+ render: function render(text) {
11454
+ return /*#__PURE__*/React.createElement("span", null, text);
11455
+ },
11456
+ renderFormItem: function renderFormItem(text, props) {
11457
+ return /*#__PURE__*/React.createElement(Index$5, _objectSpread2({
11458
+ request: props.request,
11459
+ showSearch: true,
11460
+ placeholder: "\u8BF7\u9009\u62E9",
11461
+ allowClear: true
11462
+ }, props === null || props === void 0 ? void 0 : props.fieldProps));
11463
+ }
11464
+ }
11465
+ }
11466
+ })
11467
+ }, /*#__PURE__*/React.createElement(ProTable, _objectSpread2({
10521
11468
  actionRef: actionRef,
10522
11469
  rowKey: "id",
10523
11470
  bordered: true,
@@ -10558,9 +11505,9 @@ var TabelCard = function TabelCard(props, ref) {
10558
11505
  pagination: {
10559
11506
  pageSize: 20
10560
11507
  }
10561
- }, extraProps)));
11508
+ }, extraProps))));
10562
11509
  };
10563
11510
 
10564
11511
  var index$1 = /*#__PURE__*/React.forwardRef(TabelCard);
10565
11512
 
10566
- export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, Index$4 as Checkbox, Index$8 as CountUp, Index$2 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Index$7 as Number, NumericInput, Index$3 as Radio, Index$1 as Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$5 as TreeSelect, Index$6 as WDatePicker, WForm$1 as WForm };
11513
+ export { Index$9 as AutoScroll, Index$b as Breadcrumb, WButton as Button, Index$c as Card, WCascader as Cascader, Index$4 as Checkbox, Index$8 as CountUp, Index$2 as DatePicker, index as IconFont, Index as Input, WInputNumber as InputNumber, Modal, ModalForm$1 as ModalForm, Index$7 as Number, NumericInput, Index$3 as Radio, Index$1 as Select, Index$a as Swiper, WSwitch as Switch, index$1 as TabelCard, Table, Index$5 as TreeSelect, Index$6 as WDatePicker, WForm$1 as WForm };