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/README.zh-CN.md +40 -40
- package/dist/components/Cascader/index.d.ts +8 -0
- package/dist/components/Swiper/index.d.ts +4 -0
- package/dist/components/Table/index.d.ts +1 -5
- package/dist/components/WForm/index.d.ts +1 -1
- package/dist/index.css +50 -17
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.css +50 -17
- package/dist/index.esm.js +1060 -113
- package/dist/index.js +1060 -111
- package/package.json +79 -79
package/dist/index.js
CHANGED
@@ -40,6 +40,8 @@ var _Checkbox = require('antd/es/checkbox');
|
|
40
40
|
require('antd/es/tree-select/style');
|
41
41
|
var _TreeSelect = require('antd/es/tree-select');
|
42
42
|
var uniqBy = require('lodash/uniqBy');
|
43
|
+
require('antd/es/cascader/style');
|
44
|
+
var _Cascader = require('antd/es/cascader');
|
43
45
|
var CountUp = require('react-countup');
|
44
46
|
var react = require('swiper/react');
|
45
47
|
var SwiperCore = require('swiper');
|
@@ -48,6 +50,9 @@ var _Breadcrumb = require('antd/es/breadcrumb');
|
|
48
50
|
var ReactDOM = require('react-dom');
|
49
51
|
require('antd/es/modal/style');
|
50
52
|
var _Modal = require('antd/es/modal');
|
53
|
+
require('antd/es/config-provider/style');
|
54
|
+
require('antd/es/config-provider');
|
55
|
+
require('antd/es/locale/zh_CN');
|
51
56
|
var ProTable = require('@ant-design/pro-table');
|
52
57
|
|
53
58
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -72,6 +77,7 @@ var _Radio__default = /*#__PURE__*/_interopDefaultLegacy(_Radio);
|
|
72
77
|
var _Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(_Checkbox);
|
73
78
|
var _TreeSelect__default = /*#__PURE__*/_interopDefaultLegacy(_TreeSelect);
|
74
79
|
var uniqBy__default = /*#__PURE__*/_interopDefaultLegacy(uniqBy);
|
80
|
+
var _Cascader__default = /*#__PURE__*/_interopDefaultLegacy(_Cascader);
|
75
81
|
var CountUp__default = /*#__PURE__*/_interopDefaultLegacy(CountUp);
|
76
82
|
var SwiperCore__default = /*#__PURE__*/_interopDefaultLegacy(SwiperCore);
|
77
83
|
var _Breadcrumb__default = /*#__PURE__*/_interopDefaultLegacy(_Breadcrumb);
|
@@ -7162,11 +7168,18 @@ function Table(_ref) {
|
|
7162
7168
|
flex: c.width ? '0 1 auto' : '1',
|
7163
7169
|
overflow: 'hidden'
|
7164
7170
|
}
|
7171
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
7172
|
+
style: {
|
7173
|
+
width: '100%',
|
7174
|
+
whiteSpace: 'nowrap',
|
7175
|
+
overflow: 'hidden',
|
7176
|
+
textOverflow: 'ellipsis'
|
7177
|
+
}
|
7165
7178
|
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data = columnsFields[c.dataIndex].find(function (item) {
|
7166
7179
|
return item.value == record[c.dataIndex];
|
7167
|
-
})) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex]));
|
7180
|
+
})) === null || _columnsFields$c$data === void 0 ? void 0 : _columnsFields$c$data.label : record[c.dataIndex])));
|
7168
7181
|
} else {
|
7169
|
-
var _columnsFields$c$data2;
|
7182
|
+
var _columnsFields$c$data2, _columnsFields$c$data3;
|
7170
7183
|
|
7171
7184
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
7172
7185
|
key: c.dataIndex,
|
@@ -7177,9 +7190,18 @@ function Table(_ref) {
|
|
7177
7190
|
overflow: 'hidden'
|
7178
7191
|
},
|
7179
7192
|
title: record[c.dataIndex]
|
7193
|
+
}, c.ellipsis ? /*#__PURE__*/React__default['default'].createElement("div", {
|
7194
|
+
style: {
|
7195
|
+
width: '100%',
|
7196
|
+
whiteSpace: 'nowrap',
|
7197
|
+
overflow: 'hidden',
|
7198
|
+
textOverflow: 'ellipsis'
|
7199
|
+
}
|
7180
7200
|
}, c.render ? c.render(record[c.dataIndex], record, index) : columnsFields[c.dataIndex] ? (_columnsFields$c$data2 = columnsFields[c.dataIndex].find(function (item) {
|
7181
7201
|
return item.value == record[c.dataIndex];
|
7182
|
-
})) === null || _columnsFields$c$data2 === void 0 ? void 0 : _columnsFields$c$data2.label : record[c.dataIndex])
|
7202
|
+
})) === 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) {
|
7203
|
+
return item.value == record[c.dataIndex];
|
7204
|
+
})) === null || _columnsFields$c$data3 === void 0 ? void 0 : _columnsFields$c$data3.label : record[c.dataIndex]);
|
7183
7205
|
}
|
7184
7206
|
}
|
7185
7207
|
});
|
@@ -7628,7 +7650,60 @@ RangePicker$2.defaultProps = {};
|
|
7628
7650
|
var Index$6 = WDatePicker$1;
|
7629
7651
|
Index$6.RangePicker = RangePicker$2;
|
7630
7652
|
|
7631
|
-
var _excluded$6 = ["
|
7653
|
+
var _excluded$6 = ["request", "options", "onLoad", "value", "onChange"];
|
7654
|
+
|
7655
|
+
var WCascader = function WCascader(props) {
|
7656
|
+
var request = props.request,
|
7657
|
+
options = props.options,
|
7658
|
+
onLoad = props.onLoad,
|
7659
|
+
value = props.value,
|
7660
|
+
_onChange = props.onChange,
|
7661
|
+
extraProps = _objectWithoutProperties(props, _excluded$6);
|
7662
|
+
|
7663
|
+
var _useState = React.useState(null),
|
7664
|
+
_useState2 = _slicedToArray(_useState, 2),
|
7665
|
+
resList = _useState2[0],
|
7666
|
+
setResList = _useState2[1];
|
7667
|
+
|
7668
|
+
React.useEffect(function () {
|
7669
|
+
_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
7670
|
+
var res;
|
7671
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
7672
|
+
while (1) {
|
7673
|
+
switch (_context.prev = _context.next) {
|
7674
|
+
case 0:
|
7675
|
+
if (!request) {
|
7676
|
+
_context.next = 6;
|
7677
|
+
break;
|
7678
|
+
}
|
7679
|
+
|
7680
|
+
_context.next = 3;
|
7681
|
+
return request();
|
7682
|
+
|
7683
|
+
case 3:
|
7684
|
+
res = _context.sent;
|
7685
|
+
setResList(res);
|
7686
|
+
onLoad && onLoad(res);
|
7687
|
+
|
7688
|
+
case 6:
|
7689
|
+
case "end":
|
7690
|
+
return _context.stop();
|
7691
|
+
}
|
7692
|
+
}
|
7693
|
+
}, _callee);
|
7694
|
+
}))();
|
7695
|
+
}, [JSON.stringify(resList)]);
|
7696
|
+
return /*#__PURE__*/React__default['default'].createElement(_Cascader__default['default'], _objectSpread2({
|
7697
|
+
value: typeof value === 'string' ? [value] : value,
|
7698
|
+
onChange: function onChange(v, options) {
|
7699
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(v, options);
|
7700
|
+
},
|
7701
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
7702
|
+
options: request ? resList : options
|
7703
|
+
}, extraProps));
|
7704
|
+
};
|
7705
|
+
|
7706
|
+
var _excluded$7 = ["columns", "extraColumns", "className", "style", "search", "disabled", "disabledHideInSearch", "onFormChange", "onSubmit", "onReset"];
|
7632
7707
|
var RangePicker$3 = Index$6.RangePicker;
|
7633
7708
|
|
7634
7709
|
var WForm = function WForm(props, ref) {
|
@@ -7642,7 +7717,7 @@ var WForm = function WForm(props, ref) {
|
|
7642
7717
|
onFormChange = props.onFormChange,
|
7643
7718
|
onSubmit = props.onSubmit,
|
7644
7719
|
onReset = props.onReset,
|
7645
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
7720
|
+
extraProps = _objectWithoutProperties(props, _excluded$7);
|
7646
7721
|
|
7647
7722
|
var _Form$useForm = _Form__default['default'].useForm(),
|
7648
7723
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
@@ -7728,7 +7803,7 @@ var WForm = function WForm(props, ref) {
|
|
7728
7803
|
});
|
7729
7804
|
}
|
7730
7805
|
}, c.fieldProps), _extraProps))));
|
7731
|
-
} else if (c.valueType == '
|
7806
|
+
} else if (c.valueType == 'cascader') {
|
7732
7807
|
var _extraProps2 = {};
|
7733
7808
|
|
7734
7809
|
if (c.request) {
|
@@ -7756,16 +7831,53 @@ var WForm = function WForm(props, ref) {
|
|
7756
7831
|
name: c.dataIndex,
|
7757
7832
|
label: c.title,
|
7758
7833
|
labelCol: _labelCol
|
7834
|
+
}), /*#__PURE__*/React__default['default'].createElement(WCascader, _objectSpread2(_objectSpread2({
|
7835
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
7836
|
+
disabled: disabled,
|
7837
|
+
onLoad: function onLoad(opt) {
|
7838
|
+
setColumnsFields(function (preColumnsFields) {
|
7839
|
+
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
7840
|
+
});
|
7841
|
+
}
|
7842
|
+
}, c.fieldProps), _extraProps2))));
|
7843
|
+
} else if (c.valueType == 'treeSelect') {
|
7844
|
+
var _extraProps3 = {};
|
7845
|
+
|
7846
|
+
if (c.request) {
|
7847
|
+
_extraProps3.request = c.request;
|
7848
|
+
}
|
7849
|
+
|
7850
|
+
var _labelCol2 = {};
|
7851
|
+
|
7852
|
+
if (search && search.labelWidth) {
|
7853
|
+
_labelCol2.style = {
|
7854
|
+
width: search.labelWidth
|
7855
|
+
};
|
7856
|
+
}
|
7857
|
+
|
7858
|
+
return /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
|
7859
|
+
style: {
|
7860
|
+
paddingLeft: '12px',
|
7861
|
+
paddingRight: '12px'
|
7862
|
+
}
|
7863
|
+
}, colProps), {}, {
|
7864
|
+
key: c.dataIndex
|
7865
|
+
}), /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread2(_objectSpread2({
|
7866
|
+
initialValue: c.initialValue
|
7867
|
+
}, c.formItemProps), {}, {
|
7868
|
+
name: c.dataIndex,
|
7869
|
+
label: c.title,
|
7870
|
+
labelCol: _labelCol2
|
7759
7871
|
}), /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2(_objectSpread2({
|
7760
7872
|
disabled: disabled,
|
7761
7873
|
placeholder: "\u8BF7\u9009\u62E9",
|
7762
7874
|
onLoad: function onLoad(opt) {}
|
7763
|
-
}, c.fieldProps),
|
7875
|
+
}, c.fieldProps), _extraProps3))));
|
7764
7876
|
} else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
|
7765
|
-
var
|
7877
|
+
var _labelCol3 = {};
|
7766
7878
|
|
7767
7879
|
if (search && search.labelWidth) {
|
7768
|
-
|
7880
|
+
_labelCol3.style = {
|
7769
7881
|
width: search.labelWidth
|
7770
7882
|
};
|
7771
7883
|
}
|
@@ -7805,16 +7917,16 @@ var WForm = function WForm(props, ref) {
|
|
7805
7917
|
}, c.formItemProps), {}, {
|
7806
7918
|
name: c.dataIndex,
|
7807
7919
|
label: c.title,
|
7808
|
-
labelCol:
|
7920
|
+
labelCol: _labelCol3
|
7809
7921
|
}), /*#__PURE__*/React__default['default'].createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
|
7810
7922
|
disabled: disabled,
|
7811
7923
|
placeholder: "\u8BF7\u8F93\u5165"
|
7812
7924
|
}, picker), showTime), c.fieldProps))));
|
7813
7925
|
} else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
|
7814
|
-
var
|
7926
|
+
var _labelCol4 = {};
|
7815
7927
|
|
7816
7928
|
if (search && search.labelWidth) {
|
7817
|
-
|
7929
|
+
_labelCol4.style = {
|
7818
7930
|
width: search.labelWidth
|
7819
7931
|
};
|
7820
7932
|
}
|
@@ -7841,7 +7953,7 @@ var WForm = function WForm(props, ref) {
|
|
7841
7953
|
}, c.formItemProps), {}, {
|
7842
7954
|
name: c.dataIndex,
|
7843
7955
|
label: c.title,
|
7844
|
-
labelCol:
|
7956
|
+
labelCol: _labelCol4
|
7845
7957
|
}), /*#__PURE__*/React__default['default'].createElement(RangePicker$3, _objectSpread2(_objectSpread2({
|
7846
7958
|
disabled: disabled
|
7847
7959
|
}, _showTime), c.fieldProps))));
|
@@ -7868,10 +7980,10 @@ var WForm = function WForm(props, ref) {
|
|
7868
7980
|
setColumnsFields(function (preColumnsFields) {
|
7869
7981
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
|
7870
7982
|
});
|
7871
|
-
var
|
7983
|
+
var _labelCol5 = {};
|
7872
7984
|
|
7873
7985
|
if (search && search.labelWidth) {
|
7874
|
-
|
7986
|
+
_labelCol5.style = {
|
7875
7987
|
width: search.labelWidth
|
7876
7988
|
};
|
7877
7989
|
}
|
@@ -7888,7 +8000,7 @@ var WForm = function WForm(props, ref) {
|
|
7888
8000
|
}, c.formItemProps), {}, {
|
7889
8001
|
name: c.dataIndex,
|
7890
8002
|
label: c.title,
|
7891
|
-
labelCol:
|
8003
|
+
labelCol: _labelCol5
|
7892
8004
|
}), /*#__PURE__*/React__default['default'].createElement(Index$4.Group, _objectSpread2({
|
7893
8005
|
disabled: disabled,
|
7894
8006
|
options: options
|
@@ -7917,10 +8029,10 @@ var WForm = function WForm(props, ref) {
|
|
7917
8029
|
setColumnsFields(function (preColumnsFields) {
|
7918
8030
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options));
|
7919
8031
|
});
|
7920
|
-
var
|
8032
|
+
var _labelCol6 = {};
|
7921
8033
|
|
7922
8034
|
if (search && search.labelWidth) {
|
7923
|
-
|
8035
|
+
_labelCol6.style = {
|
7924
8036
|
width: search.labelWidth
|
7925
8037
|
};
|
7926
8038
|
}
|
@@ -7946,7 +8058,7 @@ var WForm = function WForm(props, ref) {
|
|
7946
8058
|
}, c.formItemProps), {}, {
|
7947
8059
|
name: c.dataIndex,
|
7948
8060
|
label: c.title,
|
7949
|
-
labelCol:
|
8061
|
+
labelCol: _labelCol6
|
7950
8062
|
}), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2(_objectSpread2({
|
7951
8063
|
disabled: disabled
|
7952
8064
|
}, radioButtonProps), {}, {
|
@@ -7966,10 +8078,10 @@ var WForm = function WForm(props, ref) {
|
|
7966
8078
|
}
|
7967
8079
|
}
|
7968
8080
|
|
7969
|
-
var
|
8081
|
+
var _labelCol7 = {};
|
7970
8082
|
|
7971
8083
|
if (search && search.labelWidth) {
|
7972
|
-
|
8084
|
+
_labelCol7.style = {
|
7973
8085
|
width: search.labelWidth
|
7974
8086
|
};
|
7975
8087
|
} // if (columnsFieldsRef.current) {
|
@@ -7993,15 +8105,15 @@ var WForm = function WForm(props, ref) {
|
|
7993
8105
|
}, c.formItemProps), {}, {
|
7994
8106
|
name: c.dataIndex,
|
7995
8107
|
label: c.title,
|
7996
|
-
labelCol:
|
8108
|
+
labelCol: _labelCol7
|
7997
8109
|
}), /*#__PURE__*/React__default['default'].createElement(WSwitch, _objectSpread2({
|
7998
8110
|
disabled: disabled
|
7999
8111
|
}, c.fieldProps))));
|
8000
8112
|
} else if (c.valueType === 'digit') {
|
8001
|
-
var
|
8113
|
+
var _labelCol8 = {};
|
8002
8114
|
|
8003
8115
|
if (search && search.labelWidth) {
|
8004
|
-
|
8116
|
+
_labelCol8.style = {
|
8005
8117
|
width: search.labelWidth
|
8006
8118
|
};
|
8007
8119
|
}
|
@@ -8018,16 +8130,16 @@ var WForm = function WForm(props, ref) {
|
|
8018
8130
|
}, c.formItemProps), {}, {
|
8019
8131
|
name: c.dataIndex,
|
8020
8132
|
label: c.title,
|
8021
|
-
labelCol:
|
8133
|
+
labelCol: _labelCol8
|
8022
8134
|
}), /*#__PURE__*/React__default['default'].createElement(NumericInput, _objectSpread2({
|
8023
8135
|
disabled: disabled,
|
8024
8136
|
placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
|
8025
8137
|
}, c.fieldProps))));
|
8026
8138
|
} else if (c.renderFormItem) {
|
8027
|
-
var
|
8139
|
+
var _labelCol9 = {};
|
8028
8140
|
|
8029
8141
|
if (search && search.labelWidth) {
|
8030
|
-
|
8142
|
+
_labelCol9.style = {
|
8031
8143
|
width: search.labelWidth
|
8032
8144
|
};
|
8033
8145
|
}
|
@@ -8050,13 +8162,13 @@ var WForm = function WForm(props, ref) {
|
|
8050
8162
|
}, c.formItemProps), {}, {
|
8051
8163
|
name: c.dataIndex,
|
8052
8164
|
label: c.title,
|
8053
|
-
labelCol:
|
8165
|
+
labelCol: _labelCol9
|
8054
8166
|
}), baseitem)) : null;
|
8055
8167
|
} else if (c.valueType === 'textarea') {
|
8056
|
-
var
|
8168
|
+
var _labelCol10 = {};
|
8057
8169
|
|
8058
8170
|
if (search && search.labelWidth) {
|
8059
|
-
|
8171
|
+
_labelCol10.style = {
|
8060
8172
|
width: search.labelWidth
|
8061
8173
|
};
|
8062
8174
|
}
|
@@ -8073,17 +8185,17 @@ var WForm = function WForm(props, ref) {
|
|
8073
8185
|
}, c.formItemProps), {}, {
|
8074
8186
|
name: c.dataIndex,
|
8075
8187
|
label: c.title,
|
8076
|
-
labelCol:
|
8188
|
+
labelCol: _labelCol10
|
8077
8189
|
}), /*#__PURE__*/React__default['default'].createElement(Index.TextArea, _objectSpread2({
|
8078
8190
|
rows: 4,
|
8079
8191
|
disabled: disabled,
|
8080
8192
|
placeholder: "\u8BF7\u8F93\u5165"
|
8081
8193
|
}, c.fieldProps))));
|
8082
8194
|
} else if (c.valueType === 'inputNumber') {
|
8083
|
-
var
|
8195
|
+
var _labelCol11 = {};
|
8084
8196
|
|
8085
8197
|
if (search && search.labelWidth) {
|
8086
|
-
|
8198
|
+
_labelCol11.style = {
|
8087
8199
|
width: search.labelWidth
|
8088
8200
|
};
|
8089
8201
|
}
|
@@ -8100,16 +8212,16 @@ var WForm = function WForm(props, ref) {
|
|
8100
8212
|
}, c.formItemProps), {}, {
|
8101
8213
|
name: c.dataIndex,
|
8102
8214
|
label: c.title,
|
8103
|
-
labelCol:
|
8215
|
+
labelCol: _labelCol11
|
8104
8216
|
}), /*#__PURE__*/React__default['default'].createElement(WInputNumber, _objectSpread2({
|
8105
8217
|
disabled: disabled,
|
8106
8218
|
placeholder: "\u8BF7\u8F93\u5165"
|
8107
8219
|
}, c.fieldProps))));
|
8108
8220
|
} else {
|
8109
|
-
var
|
8221
|
+
var _labelCol12 = {};
|
8110
8222
|
|
8111
8223
|
if (search && search.labelWidth) {
|
8112
|
-
|
8224
|
+
_labelCol12.style = {
|
8113
8225
|
width: search.labelWidth
|
8114
8226
|
};
|
8115
8227
|
}
|
@@ -8126,7 +8238,7 @@ var WForm = function WForm(props, ref) {
|
|
8126
8238
|
}, c.formItemProps), {}, {
|
8127
8239
|
name: c.dataIndex,
|
8128
8240
|
label: c.title,
|
8129
|
-
labelCol:
|
8241
|
+
labelCol: _labelCol12
|
8130
8242
|
}), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2({
|
8131
8243
|
disabled: disabled,
|
8132
8244
|
placeholder: "\u8BF7\u8F93\u5165"
|
@@ -8150,12 +8262,12 @@ var WForm = function WForm(props, ref) {
|
|
8150
8262
|
}
|
8151
8263
|
|
8152
8264
|
if (c.valueType == 'select') {
|
8153
|
-
var
|
8265
|
+
var _extraProps4 = {};
|
8154
8266
|
|
8155
8267
|
if (c.request) {
|
8156
|
-
|
8268
|
+
_extraProps4.request = c.request;
|
8157
8269
|
} else if (c.valueEnum) {
|
8158
|
-
|
8270
|
+
_extraProps4.valueEnum = c.valueEnum;
|
8159
8271
|
}
|
8160
8272
|
|
8161
8273
|
var labelCol = {};
|
@@ -8190,18 +8302,55 @@ var WForm = function WForm(props, ref) {
|
|
8190
8302
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
8191
8303
|
});
|
8192
8304
|
}
|
8193
|
-
}, c.fieldProps),
|
8305
|
+
}, c.fieldProps), _extraProps4))));
|
8306
|
+
} else if (c.valueType == 'cascader') {
|
8307
|
+
var _extraProps5 = {};
|
8308
|
+
|
8309
|
+
if (c.request) {
|
8310
|
+
_extraProps5.request = c.request;
|
8311
|
+
}
|
8312
|
+
|
8313
|
+
var _labelCol13 = {};
|
8314
|
+
|
8315
|
+
if (search && search.labelWidth) {
|
8316
|
+
_labelCol13.style = {
|
8317
|
+
width: search.labelWidth
|
8318
|
+
};
|
8319
|
+
}
|
8320
|
+
|
8321
|
+
return /*#__PURE__*/React__default['default'].createElement(_Col__default['default'], _objectSpread2(_objectSpread2({
|
8322
|
+
style: {
|
8323
|
+
paddingLeft: '12px',
|
8324
|
+
paddingRight: '12px'
|
8325
|
+
}
|
8326
|
+
}, colProps), {}, {
|
8327
|
+
key: c.dataIndex
|
8328
|
+
}), /*#__PURE__*/React__default['default'].createElement(_Form__default['default'].Item, _objectSpread2(_objectSpread2({
|
8329
|
+
initialValue: c.initialValue
|
8330
|
+
}, c.formItemProps), {}, {
|
8331
|
+
name: c.dataIndex,
|
8332
|
+
label: c.title,
|
8333
|
+
labelCol: _labelCol13
|
8334
|
+
}), /*#__PURE__*/React__default['default'].createElement(WCascader, _objectSpread2(_objectSpread2({
|
8335
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
8336
|
+
disabled: disabled,
|
8337
|
+
onLoad: function onLoad(opt) {
|
8338
|
+
setColumnsFields(function (preColumnsFields) {
|
8339
|
+
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, opt));
|
8340
|
+
});
|
8341
|
+
}
|
8342
|
+
}, c.fieldProps), _extraProps5))));
|
8194
8343
|
} else if (c.valueType == 'treeSelect') {
|
8195
|
-
var
|
8344
|
+
var _extraProps6 = {};
|
8196
8345
|
|
8197
8346
|
if (c.request) {
|
8198
|
-
|
8347
|
+
_extraProps6.request = c.request;
|
8199
8348
|
}
|
8200
8349
|
|
8201
|
-
var
|
8350
|
+
var _labelCol14 = {};
|
8202
8351
|
|
8203
8352
|
if (search && search.labelWidth) {
|
8204
|
-
|
8353
|
+
_labelCol14.style = {
|
8205
8354
|
width: search.labelWidth
|
8206
8355
|
};
|
8207
8356
|
}
|
@@ -8218,17 +8367,17 @@ var WForm = function WForm(props, ref) {
|
|
8218
8367
|
}, c.formItemProps), {}, {
|
8219
8368
|
name: c.dataIndex,
|
8220
8369
|
label: c.title,
|
8221
|
-
labelCol:
|
8370
|
+
labelCol: _labelCol14
|
8222
8371
|
}), /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2(_objectSpread2({
|
8223
8372
|
disabled: disabled,
|
8224
8373
|
placeholder: "\u8BF7\u9009\u62E9",
|
8225
8374
|
onLoad: function onLoad(opt) {}
|
8226
|
-
}, c.fieldProps),
|
8375
|
+
}, c.fieldProps), _extraProps6))));
|
8227
8376
|
} else if (c.valueType && ['date', 'dateTime', 'dateMonth', 'dateYear'].includes(c.valueType)) {
|
8228
|
-
var
|
8377
|
+
var _labelCol15 = {};
|
8229
8378
|
|
8230
8379
|
if (search && search.labelWidth) {
|
8231
|
-
|
8380
|
+
_labelCol15.style = {
|
8232
8381
|
width: search.labelWidth
|
8233
8382
|
};
|
8234
8383
|
}
|
@@ -8268,16 +8417,16 @@ var WForm = function WForm(props, ref) {
|
|
8268
8417
|
}, c.formItemProps), {}, {
|
8269
8418
|
name: c.dataIndex,
|
8270
8419
|
label: c.title,
|
8271
|
-
labelCol:
|
8420
|
+
labelCol: _labelCol15
|
8272
8421
|
}), /*#__PURE__*/React__default['default'].createElement(Index$6, _objectSpread2(_objectSpread2(_objectSpread2({
|
8273
8422
|
disabled: disabled,
|
8274
8423
|
placeholder: "\u8BF7\u8F93\u5165"
|
8275
8424
|
}, picker), showTime), c.fieldProps))));
|
8276
8425
|
} else if (c.valueType === 'dateRange' || c.valueType === 'dateTimeRange') {
|
8277
|
-
var
|
8426
|
+
var _labelCol16 = {};
|
8278
8427
|
|
8279
8428
|
if (search && search.labelWidth) {
|
8280
|
-
|
8429
|
+
_labelCol16.style = {
|
8281
8430
|
width: search.labelWidth
|
8282
8431
|
};
|
8283
8432
|
}
|
@@ -8304,7 +8453,7 @@ var WForm = function WForm(props, ref) {
|
|
8304
8453
|
}, c.formItemProps), {}, {
|
8305
8454
|
name: c.dataIndex,
|
8306
8455
|
label: c.title,
|
8307
|
-
labelCol:
|
8456
|
+
labelCol: _labelCol16
|
8308
8457
|
}), /*#__PURE__*/React__default['default'].createElement(RangePicker$3, _objectSpread2(_objectSpread2({
|
8309
8458
|
disabled: disabled
|
8310
8459
|
}, _showTime2), c.fieldProps))));
|
@@ -8331,10 +8480,10 @@ var WForm = function WForm(props, ref) {
|
|
8331
8480
|
setColumnsFields(function (preColumnsFields) {
|
8332
8481
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, options));
|
8333
8482
|
});
|
8334
|
-
var
|
8483
|
+
var _labelCol17 = {};
|
8335
8484
|
|
8336
8485
|
if (search && search.labelWidth) {
|
8337
|
-
|
8486
|
+
_labelCol17.style = {
|
8338
8487
|
width: search.labelWidth
|
8339
8488
|
};
|
8340
8489
|
}
|
@@ -8351,7 +8500,7 @@ var WForm = function WForm(props, ref) {
|
|
8351
8500
|
}, c.formItemProps), {}, {
|
8352
8501
|
name: c.dataIndex,
|
8353
8502
|
label: c.title,
|
8354
|
-
labelCol:
|
8503
|
+
labelCol: _labelCol17
|
8355
8504
|
}), /*#__PURE__*/React__default['default'].createElement(Index$4.Group, _objectSpread2({
|
8356
8505
|
disabled: disabled,
|
8357
8506
|
options: options
|
@@ -8380,10 +8529,10 @@ var WForm = function WForm(props, ref) {
|
|
8380
8529
|
setColumnsFields(function (preColumnsFields) {
|
8381
8530
|
return _objectSpread2(_objectSpread2({}, preColumnsFields), {}, _defineProperty({}, c.dataIndex, _options3));
|
8382
8531
|
});
|
8383
|
-
var
|
8532
|
+
var _labelCol18 = {};
|
8384
8533
|
|
8385
8534
|
if (search && search.labelWidth) {
|
8386
|
-
|
8535
|
+
_labelCol18.style = {
|
8387
8536
|
width: search.labelWidth
|
8388
8537
|
};
|
8389
8538
|
}
|
@@ -8409,7 +8558,7 @@ var WForm = function WForm(props, ref) {
|
|
8409
8558
|
}, c.formItemProps), {}, {
|
8410
8559
|
name: c.dataIndex,
|
8411
8560
|
label: c.title,
|
8412
|
-
labelCol:
|
8561
|
+
labelCol: _labelCol18
|
8413
8562
|
}), /*#__PURE__*/React__default['default'].createElement(Index$3.Group, _objectSpread2(_objectSpread2({
|
8414
8563
|
disabled: disabled
|
8415
8564
|
}, radioButtonProps), {}, {
|
@@ -8429,10 +8578,10 @@ var WForm = function WForm(props, ref) {
|
|
8429
8578
|
}
|
8430
8579
|
}
|
8431
8580
|
|
8432
|
-
var
|
8581
|
+
var _labelCol19 = {};
|
8433
8582
|
|
8434
8583
|
if (search && search.labelWidth) {
|
8435
|
-
|
8584
|
+
_labelCol19.style = {
|
8436
8585
|
width: search.labelWidth
|
8437
8586
|
};
|
8438
8587
|
} // if (columnsFieldsRef.current) {
|
@@ -8456,15 +8605,15 @@ var WForm = function WForm(props, ref) {
|
|
8456
8605
|
}, c.formItemProps), {}, {
|
8457
8606
|
name: c.dataIndex,
|
8458
8607
|
label: c.title,
|
8459
|
-
labelCol:
|
8608
|
+
labelCol: _labelCol19
|
8460
8609
|
}), /*#__PURE__*/React__default['default'].createElement(WSwitch, _objectSpread2({
|
8461
8610
|
disabled: disabled
|
8462
8611
|
}, c.fieldProps))));
|
8463
8612
|
} else if (c.valueType === 'digit') {
|
8464
|
-
var
|
8613
|
+
var _labelCol20 = {};
|
8465
8614
|
|
8466
8615
|
if (search && search.labelWidth) {
|
8467
|
-
|
8616
|
+
_labelCol20.style = {
|
8468
8617
|
width: search.labelWidth
|
8469
8618
|
};
|
8470
8619
|
}
|
@@ -8481,16 +8630,16 @@ var WForm = function WForm(props, ref) {
|
|
8481
8630
|
}, c.formItemProps), {}, {
|
8482
8631
|
name: c.dataIndex,
|
8483
8632
|
label: c.title,
|
8484
|
-
labelCol:
|
8633
|
+
labelCol: _labelCol20
|
8485
8634
|
}), /*#__PURE__*/React__default['default'].createElement(NumericInput, _objectSpread2({
|
8486
8635
|
disabled: disabled,
|
8487
8636
|
placeholder: "\u8BF7\u8F93\u5165\u53C2\u6570(double/int)"
|
8488
8637
|
}, c.fieldProps))));
|
8489
8638
|
} else if (c.renderFormItem) {
|
8490
|
-
var
|
8639
|
+
var _labelCol21 = {};
|
8491
8640
|
|
8492
8641
|
if (search && search.labelWidth) {
|
8493
|
-
|
8642
|
+
_labelCol21.style = {
|
8494
8643
|
width: search.labelWidth
|
8495
8644
|
};
|
8496
8645
|
}
|
@@ -8513,13 +8662,13 @@ var WForm = function WForm(props, ref) {
|
|
8513
8662
|
}, c.formItemProps), {}, {
|
8514
8663
|
name: c.dataIndex,
|
8515
8664
|
label: c.title,
|
8516
|
-
labelCol:
|
8665
|
+
labelCol: _labelCol21
|
8517
8666
|
}), baseitem)) : null;
|
8518
8667
|
} else if (c.valueType === 'textarea') {
|
8519
|
-
var
|
8668
|
+
var _labelCol22 = {};
|
8520
8669
|
|
8521
8670
|
if (search && search.labelWidth) {
|
8522
|
-
|
8671
|
+
_labelCol22.style = {
|
8523
8672
|
width: search.labelWidth
|
8524
8673
|
};
|
8525
8674
|
}
|
@@ -8536,17 +8685,17 @@ var WForm = function WForm(props, ref) {
|
|
8536
8685
|
}, c.formItemProps), {}, {
|
8537
8686
|
name: c.dataIndex,
|
8538
8687
|
label: c.title,
|
8539
|
-
labelCol:
|
8688
|
+
labelCol: _labelCol22
|
8540
8689
|
}), /*#__PURE__*/React__default['default'].createElement(Index.TextArea, _objectSpread2({
|
8541
8690
|
rows: 4,
|
8542
8691
|
disabled: disabled,
|
8543
8692
|
placeholder: "\u8BF7\u8F93\u5165"
|
8544
8693
|
}, c.fieldProps))));
|
8545
8694
|
} else if (c.valueType === 'inputNumber') {
|
8546
|
-
var
|
8695
|
+
var _labelCol23 = {};
|
8547
8696
|
|
8548
8697
|
if (search && search.labelWidth) {
|
8549
|
-
|
8698
|
+
_labelCol23.style = {
|
8550
8699
|
width: search.labelWidth
|
8551
8700
|
};
|
8552
8701
|
}
|
@@ -8563,16 +8712,16 @@ var WForm = function WForm(props, ref) {
|
|
8563
8712
|
}, c.formItemProps), {}, {
|
8564
8713
|
name: c.dataIndex,
|
8565
8714
|
label: c.title,
|
8566
|
-
labelCol:
|
8715
|
+
labelCol: _labelCol23
|
8567
8716
|
}), /*#__PURE__*/React__default['default'].createElement(WInputNumber, _objectSpread2({
|
8568
8717
|
disabled: disabled,
|
8569
8718
|
placeholder: "\u8BF7\u8F93\u5165"
|
8570
8719
|
}, c.fieldProps))));
|
8571
8720
|
} else {
|
8572
|
-
var
|
8721
|
+
var _labelCol24 = {};
|
8573
8722
|
|
8574
8723
|
if (search && search.labelWidth) {
|
8575
|
-
|
8724
|
+
_labelCol24.style = {
|
8576
8725
|
width: search.labelWidth
|
8577
8726
|
};
|
8578
8727
|
}
|
@@ -8589,7 +8738,7 @@ var WForm = function WForm(props, ref) {
|
|
8589
8738
|
}, c.formItemProps), {}, {
|
8590
8739
|
name: c.dataIndex,
|
8591
8740
|
label: c.title,
|
8592
|
-
labelCol:
|
8741
|
+
labelCol: _labelCol24
|
8593
8742
|
}), /*#__PURE__*/React__default['default'].createElement(Index, _objectSpread2({
|
8594
8743
|
disabled: disabled,
|
8595
8744
|
placeholder: "\u8BF7\u8F93\u5165"
|
@@ -8732,8 +8881,8 @@ var WForm = function WForm(props, ref) {
|
|
8732
8881
|
|
8733
8882
|
var WForm$1 = /*#__PURE__*/React__default['default'].forwardRef(WForm);
|
8734
8883
|
|
8735
|
-
var _excluded$
|
8736
|
-
_excluded2$2 = ["count", "width", "height", "marginRight"];
|
8884
|
+
var _excluded$8 = ["height", "width", "count", "style", "numberStyle"],
|
8885
|
+
_excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
|
8737
8886
|
|
8738
8887
|
var Number = function Number(_ref) {
|
8739
8888
|
var height = _ref.height,
|
@@ -8742,7 +8891,7 @@ var Number = function Number(_ref) {
|
|
8742
8891
|
count = _ref$count === void 0 ? 0 : _ref$count,
|
8743
8892
|
style = _ref.style,
|
8744
8893
|
numberStyle = _ref.numberStyle,
|
8745
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
8894
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
8746
8895
|
|
8747
8896
|
// 上次的值
|
8748
8897
|
var _useState = React.useState(0),
|
@@ -8864,6 +9013,8 @@ Number.defaultProps = {
|
|
8864
9013
|
|
8865
9014
|
var Index$7 = function Index(props) {
|
8866
9015
|
var count = props.count,
|
9016
|
+
_props$numberCount = props.numberCount,
|
9017
|
+
numberCount = _props$numberCount === void 0 ? 5 : _props$numberCount,
|
8867
9018
|
width = props.width,
|
8868
9019
|
height = props.height,
|
8869
9020
|
_props$marginRight = props.marginRight,
|
@@ -8877,6 +9028,11 @@ var Index$7 = function Index(props) {
|
|
8877
9028
|
|
8878
9029
|
React.useEffect(function () {
|
8879
9030
|
var countArray = count.toString().split('');
|
9031
|
+
|
9032
|
+
if (numberCount > countArray.length) {
|
9033
|
+
countArray = [].concat(_toConsumableArray(Array(numberCount - countArray.length).fill(0)), _toConsumableArray(countArray));
|
9034
|
+
}
|
9035
|
+
|
8880
9036
|
setNumberList(countArray.map(function (num) {
|
8881
9037
|
return +num;
|
8882
9038
|
}));
|
@@ -8899,12 +9055,12 @@ var Index$7 = function Index(props) {
|
|
8899
9055
|
}));
|
8900
9056
|
};
|
8901
9057
|
|
8902
|
-
var _excluded$
|
9058
|
+
var _excluded$9 = ["duration"];
|
8903
9059
|
|
8904
9060
|
var Index$8 = function Index(props) {
|
8905
9061
|
var _props$duration = props.duration,
|
8906
9062
|
duration = _props$duration === void 0 ? 2.75 : _props$duration,
|
8907
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9063
|
+
extraProps = _objectWithoutProperties(props, _excluded$9);
|
8908
9064
|
return /*#__PURE__*/React__default['default'].createElement(CountUp__default['default'], _objectSpread2({
|
8909
9065
|
duration: duration
|
8910
9066
|
}, extraProps));
|
@@ -8912,7 +9068,7 @@ var Index$8 = function Index(props) {
|
|
8912
9068
|
|
8913
9069
|
Index$8.defaultProps = {};
|
8914
9070
|
|
8915
|
-
var _excluded$
|
9071
|
+
var _excluded$a = ["list", "render", "partSize"];
|
8916
9072
|
|
8917
9073
|
function AutoScroll(props) {
|
8918
9074
|
var inner1 = React.useRef();
|
@@ -8996,7 +9152,7 @@ var Index$9 = function Index(_ref) {
|
|
8996
9152
|
render = _ref.render,
|
8997
9153
|
_ref$partSize = _ref.partSize,
|
8998
9154
|
partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
|
8999
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
9155
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
9000
9156
|
|
9001
9157
|
{
|
9002
9158
|
var _useState = React.useState([]),
|
@@ -9073,28 +9229,42 @@ var Index$9 = function Index(_ref) {
|
|
9073
9229
|
}
|
9074
9230
|
};
|
9075
9231
|
|
9076
|
-
var _excluded$
|
9232
|
+
var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
9077
9233
|
|
9078
9234
|
SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation, SwiperCore.Autoplay]);
|
9079
9235
|
|
9080
9236
|
var Index$a = function Index(props) {
|
9081
9237
|
var data = props.data,
|
9082
9238
|
_onClick = props.onClick,
|
9239
|
+
_props$slidesPerView = props.slidesPerView,
|
9240
|
+
slidesPerView = _props$slidesPerView === void 0 ? 4 : _props$slidesPerView,
|
9241
|
+
rowKey = props.rowKey,
|
9242
|
+
onSwiperChange = props.onSwiperChange,
|
9083
9243
|
renderItem = props.renderItem,
|
9084
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9244
|
+
extraProps = _objectWithoutProperties(props, _excluded$b);
|
9085
9245
|
|
9086
|
-
|
9087
|
-
|
9088
|
-
|
9089
|
-
|
9090
|
-
} else {
|
9091
|
-
swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
|
9092
|
-
}
|
9246
|
+
var _useState = React.useState(null),
|
9247
|
+
_useState2 = _slicedToArray(_useState, 2),
|
9248
|
+
controlledSwiper = _useState2[0],
|
9249
|
+
setControlledSwiper = _useState2[1];
|
9093
9250
|
|
9094
|
-
|
9251
|
+
return /*#__PURE__*/React__default['default'].createElement(react.Swiper, _objectSpread2({
|
9252
|
+
onSwiper: function onSwiper(swiper) {
|
9253
|
+
return setControlledSwiper(swiper);
|
9254
|
+
},
|
9255
|
+
// onClick={(swiper, event) => {
|
9256
|
+
// if (swiper.clickedIndex - 4 > data.length) {
|
9257
|
+
// swiper.slideNext();
|
9258
|
+
// } else {
|
9259
|
+
// swiper.clickedIndex && swiper.slideTo(swiper.clickedIndex);
|
9260
|
+
// }
|
9261
|
+
// onClick && onClick(swiper, event);
|
9262
|
+
// }}
|
9263
|
+
onSlideChange: function onSlideChange(swiper) {
|
9264
|
+
onSwiperChange && onSwiperChange(swiper.realIndex, data[swiper.realIndex]);
|
9095
9265
|
},
|
9096
9266
|
className: "mySwiper",
|
9097
|
-
slidesPerView:
|
9267
|
+
slidesPerView: slidesPerView,
|
9098
9268
|
spaceBetween: 30,
|
9099
9269
|
loop: true,
|
9100
9270
|
loopFillGroupWithBlank: true,
|
@@ -9102,10 +9272,26 @@ var Index$a = function Index(props) {
|
|
9102
9272
|
navigation: true
|
9103
9273
|
}, extraProps), data.map(function (item, index) {
|
9104
9274
|
return /*#__PURE__*/React__default['default'].createElement(react.SwiperSlide, {
|
9105
|
-
key: index
|
9275
|
+
key: rowKey ? item[rowKey] : index
|
9106
9276
|
}, function (_ref) {
|
9107
9277
|
var isActive = _ref.isActive;
|
9108
|
-
return
|
9278
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
9279
|
+
style: {
|
9280
|
+
width: '100%',
|
9281
|
+
height: '100%'
|
9282
|
+
},
|
9283
|
+
onClick: function onClick(event) {
|
9284
|
+
if (controlledSwiper) {
|
9285
|
+
if (controlledSwiper.clickedIndex - slidesPerView > data.length) {
|
9286
|
+
controlledSwiper.slideNext();
|
9287
|
+
} else {
|
9288
|
+
controlledSwiper.clickedIndex && controlledSwiper.slideTo(controlledSwiper.clickedIndex);
|
9289
|
+
}
|
9290
|
+
|
9291
|
+
_onClick && _onClick(controlledSwiper, event);
|
9292
|
+
}
|
9293
|
+
}
|
9294
|
+
}, renderItem(item, index, isActive));
|
9109
9295
|
});
|
9110
9296
|
}));
|
9111
9297
|
};
|
@@ -9706,7 +9892,7 @@ function createBrowserHistory(props) {
|
|
9706
9892
|
return history;
|
9707
9893
|
}
|
9708
9894
|
|
9709
|
-
var _excluded$
|
9895
|
+
var _excluded$c = ["routes", "className"];
|
9710
9896
|
var history = createBrowserHistory();
|
9711
9897
|
|
9712
9898
|
function itemRender(route, params, routes, paths) {
|
@@ -9724,7 +9910,7 @@ function itemRender(route, params, routes, paths) {
|
|
9724
9910
|
var Index$b = function Index(_ref) {
|
9725
9911
|
var routes = _ref.routes,
|
9726
9912
|
className = _ref.className,
|
9727
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9913
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
9728
9914
|
|
9729
9915
|
return /*#__PURE__*/React__default['default'].createElement(_Breadcrumb__default['default'], _objectSpread2({
|
9730
9916
|
className: className || 'default',
|
@@ -9734,7 +9920,7 @@ var Index$b = function Index(_ref) {
|
|
9734
9920
|
}, props));
|
9735
9921
|
};
|
9736
9922
|
|
9737
|
-
var _excluded$
|
9923
|
+
var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
|
9738
9924
|
|
9739
9925
|
var Index$c = function Index(_ref) {
|
9740
9926
|
var _classNames;
|
@@ -9744,7 +9930,7 @@ var Index$c = function Index(_ref) {
|
|
9744
9930
|
className = _ref$className === void 0 ? 'default' : _ref$className,
|
9745
9931
|
headerTail = _ref.headerTail,
|
9746
9932
|
headerCenter = _ref.headerCenter,
|
9747
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9933
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
9748
9934
|
|
9749
9935
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
|
9750
9936
|
className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
|
@@ -9821,7 +10007,7 @@ function DialogModel(props) {
|
|
9821
10007
|
height: '100%',
|
9822
10008
|
position: 'relative'
|
9823
10009
|
}
|
9824
|
-
},
|
10010
|
+
}, props.children))), /*#__PURE__*/React__default['default'].createElement("div", {
|
9825
10011
|
className: 'mask',
|
9826
10012
|
onClick: function onClick() {
|
9827
10013
|
return onClose && onClose();
|
@@ -9851,7 +10037,7 @@ function DialogModel(props) {
|
|
9851
10037
|
return renderChildren;
|
9852
10038
|
}
|
9853
10039
|
|
9854
|
-
var _excluded$
|
10040
|
+
var _excluded$e = ["visible"];
|
9855
10041
|
|
9856
10042
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
9857
10043
|
_inherits(Modal, _React$PureComponent);
|
@@ -9940,7 +10126,9 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
9940
10126
|
style: style
|
9941
10127
|
}, this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
|
9942
10128
|
className: "model-content"
|
9943
|
-
},
|
10129
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
10130
|
+
className: "model-content-in"
|
10131
|
+
}, this.renderContent())), this.renderFooter());
|
9944
10132
|
}
|
9945
10133
|
}]);
|
9946
10134
|
|
@@ -9983,7 +10171,7 @@ Modal.show = function (config) {
|
|
9983
10171
|
manager.setShow = setShow;
|
9984
10172
|
|
9985
10173
|
var visible = props.visible,
|
9986
|
-
trueProps = _objectWithoutProperties(props, _excluded$
|
10174
|
+
trueProps = _objectWithoutProperties(props, _excluded$e);
|
9987
10175
|
|
9988
10176
|
React.useEffect(function () {
|
9989
10177
|
manager.mounted = true;
|
@@ -10007,7 +10195,7 @@ Modal.hidden = function () {
|
|
10007
10195
|
ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
|
10008
10196
|
};
|
10009
10197
|
|
10010
|
-
var _excluded$
|
10198
|
+
var _excluded$f = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
|
10011
10199
|
|
10012
10200
|
var ModalForm = function ModalForm(props, ref) {
|
10013
10201
|
var columns = props.columns,
|
@@ -10021,7 +10209,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10021
10209
|
title = props.title,
|
10022
10210
|
record = props.record,
|
10023
10211
|
onFormChange = props.onFormChange,
|
10024
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
10212
|
+
extraProps = _objectWithoutProperties(props, _excluded$f);
|
10025
10213
|
|
10026
10214
|
var formRef = React.useRef(null);
|
10027
10215
|
|
@@ -10152,7 +10340,748 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10152
10340
|
|
10153
10341
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
10154
10342
|
|
10155
|
-
|
10343
|
+
function _defineProperty$1(obj, key, value) {
|
10344
|
+
if (key in obj) {
|
10345
|
+
Object.defineProperty(obj, key, {
|
10346
|
+
value: value,
|
10347
|
+
enumerable: true,
|
10348
|
+
configurable: true,
|
10349
|
+
writable: true
|
10350
|
+
});
|
10351
|
+
} else {
|
10352
|
+
obj[key] = value;
|
10353
|
+
}
|
10354
|
+
|
10355
|
+
return obj;
|
10356
|
+
}
|
10357
|
+
|
10358
|
+
function ownKeys$1(object, enumerableOnly) {
|
10359
|
+
var keys = Object.keys(object);
|
10360
|
+
|
10361
|
+
if (Object.getOwnPropertySymbols) {
|
10362
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
10363
|
+
|
10364
|
+
if (enumerableOnly) {
|
10365
|
+
symbols = symbols.filter(function (sym) {
|
10366
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
10367
|
+
});
|
10368
|
+
}
|
10369
|
+
|
10370
|
+
keys.push.apply(keys, symbols);
|
10371
|
+
}
|
10372
|
+
|
10373
|
+
return keys;
|
10374
|
+
}
|
10375
|
+
|
10376
|
+
function _objectSpread2$1(target) {
|
10377
|
+
for (var i = 1; i < arguments.length; i++) {
|
10378
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
10379
|
+
|
10380
|
+
if (i % 2) {
|
10381
|
+
ownKeys$1(Object(source), true).forEach(function (key) {
|
10382
|
+
_defineProperty$1(target, key, source[key]);
|
10383
|
+
});
|
10384
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
10385
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
10386
|
+
} else {
|
10387
|
+
ownKeys$1(Object(source)).forEach(function (key) {
|
10388
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
10389
|
+
});
|
10390
|
+
}
|
10391
|
+
}
|
10392
|
+
|
10393
|
+
return target;
|
10394
|
+
}
|
10395
|
+
|
10396
|
+
function _arrayLikeToArray$1(arr, len) {
|
10397
|
+
if (len == null || len > arr.length) len = arr.length;
|
10398
|
+
|
10399
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
10400
|
+
arr2[i] = arr[i];
|
10401
|
+
}
|
10402
|
+
|
10403
|
+
return arr2;
|
10404
|
+
}
|
10405
|
+
|
10406
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
10407
|
+
if (!o) return;
|
10408
|
+
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
10409
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
10410
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
10411
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
10412
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
10413
|
+
}
|
10414
|
+
|
10415
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) {
|
10416
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
10417
|
+
|
10418
|
+
if (!it) {
|
10419
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
|
10420
|
+
if (it) o = it;
|
10421
|
+
var i = 0;
|
10422
|
+
|
10423
|
+
var F = function F() {};
|
10424
|
+
|
10425
|
+
return {
|
10426
|
+
s: F,
|
10427
|
+
n: function n() {
|
10428
|
+
if (i >= o.length) return {
|
10429
|
+
done: true
|
10430
|
+
};
|
10431
|
+
return {
|
10432
|
+
done: false,
|
10433
|
+
value: o[i++]
|
10434
|
+
};
|
10435
|
+
},
|
10436
|
+
e: function e(_e) {
|
10437
|
+
throw _e;
|
10438
|
+
},
|
10439
|
+
f: F
|
10440
|
+
};
|
10441
|
+
}
|
10442
|
+
|
10443
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10444
|
+
}
|
10445
|
+
|
10446
|
+
var normalCompletion = true,
|
10447
|
+
didErr = false,
|
10448
|
+
err;
|
10449
|
+
return {
|
10450
|
+
s: function s() {
|
10451
|
+
it = it.call(o);
|
10452
|
+
},
|
10453
|
+
n: function n() {
|
10454
|
+
var step = it.next();
|
10455
|
+
normalCompletion = step.done;
|
10456
|
+
return step;
|
10457
|
+
},
|
10458
|
+
e: function e(_e2) {
|
10459
|
+
didErr = true;
|
10460
|
+
err = _e2;
|
10461
|
+
},
|
10462
|
+
f: function f() {
|
10463
|
+
try {
|
10464
|
+
if (!normalCompletion && it["return"] != null) it["return"]();
|
10465
|
+
} finally {
|
10466
|
+
if (didErr) throw err;
|
10467
|
+
}
|
10468
|
+
}
|
10469
|
+
};
|
10470
|
+
}
|
10471
|
+
|
10472
|
+
/*! *****************************************************************************
|
10473
|
+
Copyright (c) Microsoft Corporation.
|
10474
|
+
|
10475
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
10476
|
+
purpose with or without fee is hereby granted.
|
10477
|
+
|
10478
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
10479
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
10480
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10481
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
10482
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
10483
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
10484
|
+
PERFORMANCE OF THIS SOFTWARE.
|
10485
|
+
***************************************************************************** */
|
10486
|
+
|
10487
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
10488
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10489
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
10490
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
10491
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
10492
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
10493
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
10494
|
+
});
|
10495
|
+
}
|
10496
|
+
|
10497
|
+
function __generator(thisArg, body) {
|
10498
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
10499
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
10500
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
10501
|
+
function step(op) {
|
10502
|
+
if (f) throw new TypeError("Generator is already executing.");
|
10503
|
+
while (_) try {
|
10504
|
+
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;
|
10505
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
10506
|
+
switch (op[0]) {
|
10507
|
+
case 0: case 1: t = op; break;
|
10508
|
+
case 4: _.label++; return { value: op[1], done: false };
|
10509
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
10510
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
10511
|
+
default:
|
10512
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
10513
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
10514
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
10515
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
10516
|
+
if (t[2]) _.ops.pop();
|
10517
|
+
_.trys.pop(); continue;
|
10518
|
+
}
|
10519
|
+
op = body.call(thisArg, _);
|
10520
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
10521
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
10522
|
+
}
|
10523
|
+
}
|
10524
|
+
|
10525
|
+
var noop = function () { };
|
10526
|
+
// Using noop() as the undefined value as undefined can possibly be replaced
|
10527
|
+
// by something else. Prettier ignore and extra parentheses are necessary here
|
10528
|
+
// to ensure that tsc doesn't remove the __NOINLINE__ comment.
|
10529
|
+
// prettier-ignore
|
10530
|
+
var UNDEFINED = ( /*#__NOINLINE__*/noop());
|
10531
|
+
var OBJECT = Object;
|
10532
|
+
var isUndefined$1 = function (v) { return v === UNDEFINED; };
|
10533
|
+
var isFunction$1 = function (v) { return typeof v == 'function'; };
|
10534
|
+
var mergeObjects = function (a, b) { return OBJECT.assign({}, a, b); };
|
10535
|
+
var STR_UNDEFINED = 'undefined';
|
10536
|
+
var hasWindow = function () { return typeof window != STR_UNDEFINED; };
|
10537
|
+
var hasDocument = function () { return typeof document != STR_UNDEFINED; };
|
10538
|
+
|
10539
|
+
// use WeakMap to store the object->key mapping
|
10540
|
+
// so the objects can be garbage collected.
|
10541
|
+
// WeakMap uses a hashtable under the hood, so the lookup
|
10542
|
+
// complexity is almost O(1).
|
10543
|
+
var table = new WeakMap();
|
10544
|
+
// counter of the key
|
10545
|
+
var counter = 0;
|
10546
|
+
// A stable hash implementation that supports:
|
10547
|
+
// - Fast and ensures unique hash properties
|
10548
|
+
// - Handles unserializable values
|
10549
|
+
// - Handles object key ordering
|
10550
|
+
// - Generates short results
|
10551
|
+
//
|
10552
|
+
// This is not a serialization function, and the result is not guaranteed to be
|
10553
|
+
// parsible.
|
10554
|
+
var stableHash = function (arg) {
|
10555
|
+
var type = typeof arg;
|
10556
|
+
var constructor = arg && arg.constructor;
|
10557
|
+
var isDate = constructor == Date;
|
10558
|
+
var result;
|
10559
|
+
var index;
|
10560
|
+
if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {
|
10561
|
+
// Object/function, not null/date/regexp. Use WeakMap to store the id first.
|
10562
|
+
// If it's already hashed, directly return the result.
|
10563
|
+
result = table.get(arg);
|
10564
|
+
if (result)
|
10565
|
+
return result;
|
10566
|
+
// Store the hash first for circular reference detection before entering the
|
10567
|
+
// recursive `stableHash` calls.
|
10568
|
+
// For other objects like set and map, we use this id directly as the hash.
|
10569
|
+
result = ++counter + '~';
|
10570
|
+
table.set(arg, result);
|
10571
|
+
if (constructor == Array) {
|
10572
|
+
// Array.
|
10573
|
+
result = '@';
|
10574
|
+
for (index = 0; index < arg.length; index++) {
|
10575
|
+
result += stableHash(arg[index]) + ',';
|
10576
|
+
}
|
10577
|
+
table.set(arg, result);
|
10578
|
+
}
|
10579
|
+
if (constructor == OBJECT) {
|
10580
|
+
// Object, sort keys.
|
10581
|
+
result = '#';
|
10582
|
+
var keys = OBJECT.keys(arg).sort();
|
10583
|
+
while (!isUndefined$1((index = keys.pop()))) {
|
10584
|
+
if (!isUndefined$1(arg[index])) {
|
10585
|
+
result += index + ':' + stableHash(arg[index]) + ',';
|
10586
|
+
}
|
10587
|
+
}
|
10588
|
+
table.set(arg, result);
|
10589
|
+
}
|
10590
|
+
}
|
10591
|
+
else {
|
10592
|
+
result = isDate
|
10593
|
+
? arg.toJSON()
|
10594
|
+
: type == 'symbol'
|
10595
|
+
? arg.toString()
|
10596
|
+
: type == 'string'
|
10597
|
+
? JSON.stringify(arg)
|
10598
|
+
: '' + arg;
|
10599
|
+
}
|
10600
|
+
return result;
|
10601
|
+
};
|
10602
|
+
|
10603
|
+
/**
|
10604
|
+
* Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
10605
|
+
* it's not reliable to detect if the browser is currently online or offline
|
10606
|
+
* based on `navigator.onLine`.
|
10607
|
+
* As a work around, we always assume it's online on first load, and change
|
10608
|
+
* the status upon `online` or `offline` events.
|
10609
|
+
*/
|
10610
|
+
var online = true;
|
10611
|
+
var isOnline = function () { return online; };
|
10612
|
+
var hasWin = hasWindow();
|
10613
|
+
var hasDoc = hasDocument();
|
10614
|
+
// For node and React Native, `add/removeEventListener` doesn't exist on window.
|
10615
|
+
var onWindowEvent = hasWin && window.addEventListener
|
10616
|
+
? window.addEventListener.bind(window)
|
10617
|
+
: noop;
|
10618
|
+
var onDocumentEvent = hasDoc ? document.addEventListener.bind(document) : noop;
|
10619
|
+
var offWindowEvent = hasWin && window.removeEventListener
|
10620
|
+
? window.removeEventListener.bind(window)
|
10621
|
+
: noop;
|
10622
|
+
var offDocumentEvent = hasDoc
|
10623
|
+
? document.removeEventListener.bind(document)
|
10624
|
+
: noop;
|
10625
|
+
var isVisible = function () {
|
10626
|
+
var visibilityState = hasDoc && document.visibilityState;
|
10627
|
+
if (!isUndefined$1(visibilityState)) {
|
10628
|
+
return visibilityState !== 'hidden';
|
10629
|
+
}
|
10630
|
+
return true;
|
10631
|
+
};
|
10632
|
+
var initFocus = function (cb) {
|
10633
|
+
// focus revalidate
|
10634
|
+
onDocumentEvent('visibilitychange', cb);
|
10635
|
+
onWindowEvent('focus', cb);
|
10636
|
+
return function () {
|
10637
|
+
offDocumentEvent('visibilitychange', cb);
|
10638
|
+
offWindowEvent('focus', cb);
|
10639
|
+
};
|
10640
|
+
};
|
10641
|
+
var initReconnect = function (cb) {
|
10642
|
+
// revalidate on reconnected
|
10643
|
+
var onOnline = function () {
|
10644
|
+
online = true;
|
10645
|
+
cb();
|
10646
|
+
};
|
10647
|
+
// nothing to revalidate, just update the status
|
10648
|
+
var onOffline = function () {
|
10649
|
+
online = false;
|
10650
|
+
};
|
10651
|
+
onWindowEvent('online', onOnline);
|
10652
|
+
onWindowEvent('offline', onOffline);
|
10653
|
+
return function () {
|
10654
|
+
offWindowEvent('online', onOnline);
|
10655
|
+
offWindowEvent('offline', onOffline);
|
10656
|
+
};
|
10657
|
+
};
|
10658
|
+
var preset = {
|
10659
|
+
isOnline: isOnline,
|
10660
|
+
isVisible: isVisible
|
10661
|
+
};
|
10662
|
+
var defaultConfigOptions = {
|
10663
|
+
initFocus: initFocus,
|
10664
|
+
initReconnect: initReconnect
|
10665
|
+
};
|
10666
|
+
|
10667
|
+
var IS_SERVER = !hasWindow() || 'Deno' in window;
|
10668
|
+
// React currently throws a warning when using useLayoutEffect on the server.
|
10669
|
+
// To get around it, we can conditionally useEffect on the server (no-op) and
|
10670
|
+
// useLayoutEffect in the browser.
|
10671
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
|
10672
|
+
// This assignment is to extend the Navigator type to use effectiveType.
|
10673
|
+
var navigatorConnection = typeof navigator !== 'undefined' &&
|
10674
|
+
navigator.connection;
|
10675
|
+
// Adjust the config based on slow connection status (<= 70Kbps).
|
10676
|
+
var slowConnection = !IS_SERVER &&
|
10677
|
+
navigatorConnection &&
|
10678
|
+
(['slow-2g', '2g'].includes(navigatorConnection.effectiveType) ||
|
10679
|
+
navigatorConnection.saveData);
|
10680
|
+
|
10681
|
+
var serialize = function (key) {
|
10682
|
+
if (isFunction$1(key)) {
|
10683
|
+
try {
|
10684
|
+
key = key();
|
10685
|
+
}
|
10686
|
+
catch (err) {
|
10687
|
+
// dependencies not ready
|
10688
|
+
key = '';
|
10689
|
+
}
|
10690
|
+
}
|
10691
|
+
var args = [].concat(key);
|
10692
|
+
// If key is not falsy, or not an empty array, hash it.
|
10693
|
+
key =
|
10694
|
+
typeof key == 'string'
|
10695
|
+
? key
|
10696
|
+
: (Array.isArray(key)
|
10697
|
+
? key.length
|
10698
|
+
: key)
|
10699
|
+
? stableHash(key)
|
10700
|
+
: '';
|
10701
|
+
var errorKey = key ? '$err$' + key : '';
|
10702
|
+
var isValidatingKey = key ? '$req$' + key : '';
|
10703
|
+
return [key, args, errorKey, isValidatingKey];
|
10704
|
+
};
|
10705
|
+
|
10706
|
+
// Global state used to deduplicate requests and store listeners
|
10707
|
+
var SWRGlobalState = new WeakMap();
|
10708
|
+
|
10709
|
+
var FOCUS_EVENT = 0;
|
10710
|
+
var RECONNECT_EVENT = 1;
|
10711
|
+
var MUTATE_EVENT = 2;
|
10712
|
+
|
10713
|
+
var broadcastState = function (cache, key, data, error, isValidating, revalidate) {
|
10714
|
+
var _a = SWRGlobalState.get(cache), EVENT_REVALIDATORS = _a[0], STATE_UPDATERS = _a[1], CONCURRENT_PROMISES = _a[4], CONCURRENT_PROMISES_TS = _a[5];
|
10715
|
+
var revalidators = EVENT_REVALIDATORS[key];
|
10716
|
+
var updaters = STATE_UPDATERS[key] || [];
|
10717
|
+
// Always update states of all hooks.
|
10718
|
+
for (var i = 0; i < updaters.length; ++i) {
|
10719
|
+
updaters[i](data, error, isValidating);
|
10720
|
+
}
|
10721
|
+
// If we also need to revalidate, only do it for the first hook.
|
10722
|
+
if (revalidate) {
|
10723
|
+
// Invalidate the key by deleting the concurrent request markers so new
|
10724
|
+
// requests will not be deduped.
|
10725
|
+
delete CONCURRENT_PROMISES[key];
|
10726
|
+
delete CONCURRENT_PROMISES_TS[key];
|
10727
|
+
if (revalidators && revalidators[0]) {
|
10728
|
+
return revalidators[0](MUTATE_EVENT).then(function () {
|
10729
|
+
return cache.get(key);
|
10730
|
+
});
|
10731
|
+
}
|
10732
|
+
}
|
10733
|
+
return cache.get(key);
|
10734
|
+
};
|
10735
|
+
|
10736
|
+
// Global timestamp.
|
10737
|
+
var __timestamp = 0;
|
10738
|
+
var getTimestamp = function () { return ++__timestamp; };
|
10739
|
+
|
10740
|
+
var internalMutate = function () {
|
10741
|
+
var args = [];
|
10742
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
10743
|
+
args[_i] = arguments[_i];
|
10744
|
+
}
|
10745
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
10746
|
+
var cache, _key, revalidate, _data, _a, key, keyErr, _b, MUTATION_TS, MUTATION_END_TS, data, error, beforeMutationTs, res;
|
10747
|
+
return __generator(this, function (_c) {
|
10748
|
+
switch (_c.label) {
|
10749
|
+
case 0:
|
10750
|
+
cache = args[0], _key = args[1];
|
10751
|
+
revalidate = args[3] !== false;
|
10752
|
+
_data = args[2];
|
10753
|
+
_a = serialize(_key), key = _a[0], keyErr = _a[2];
|
10754
|
+
if (!key)
|
10755
|
+
return [2 /*return*/];
|
10756
|
+
_b = SWRGlobalState.get(cache), MUTATION_TS = _b[2], MUTATION_END_TS = _b[3];
|
10757
|
+
// If there is no new data provided, revalidate the key with current state.
|
10758
|
+
if (args.length < 3) {
|
10759
|
+
// Revalidate and broadcast state.
|
10760
|
+
return [2 /*return*/, broadcastState(cache, key, cache.get(key), cache.get(keyErr), UNDEFINED, revalidate)];
|
10761
|
+
}
|
10762
|
+
beforeMutationTs = (MUTATION_TS[key] = getTimestamp());
|
10763
|
+
MUTATION_END_TS[key] = 0;
|
10764
|
+
if (isFunction$1(_data)) {
|
10765
|
+
// `_data` is a function, call it passing current cache value.
|
10766
|
+
try {
|
10767
|
+
_data = _data(cache.get(key));
|
10768
|
+
}
|
10769
|
+
catch (err) {
|
10770
|
+
// If it throws an error synchronously, we shouldn't update the cache.
|
10771
|
+
error = err;
|
10772
|
+
}
|
10773
|
+
}
|
10774
|
+
if (!(_data && isFunction$1(_data.then))) return [3 /*break*/, 2];
|
10775
|
+
return [4 /*yield*/, _data.catch(function (err) {
|
10776
|
+
error = err;
|
10777
|
+
})
|
10778
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10779
|
+
// If there's a race we don't update cache or broadcast the change,
|
10780
|
+
// just return the data.
|
10781
|
+
];
|
10782
|
+
case 1:
|
10783
|
+
// This means that the mutation is async, we need to check timestamps to
|
10784
|
+
// avoid race conditions.
|
10785
|
+
data = _c.sent();
|
10786
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10787
|
+
// If there's a race we don't update cache or broadcast the change,
|
10788
|
+
// just return the data.
|
10789
|
+
if (beforeMutationTs !== MUTATION_TS[key]) {
|
10790
|
+
if (error)
|
10791
|
+
throw error;
|
10792
|
+
return [2 /*return*/, data];
|
10793
|
+
}
|
10794
|
+
return [3 /*break*/, 3];
|
10795
|
+
case 2:
|
10796
|
+
data = _data;
|
10797
|
+
_c.label = 3;
|
10798
|
+
case 3:
|
10799
|
+
// Only update cached data if there's no error. Data can be `undefined` here.
|
10800
|
+
if (!error) {
|
10801
|
+
cache.set(key, data);
|
10802
|
+
}
|
10803
|
+
// Always update or reset the error.
|
10804
|
+
cache.set(keyErr, error);
|
10805
|
+
// Reset the timestamp to mark the mutation has ended.
|
10806
|
+
MUTATION_END_TS[key] = getTimestamp();
|
10807
|
+
return [4 /*yield*/, broadcastState(cache, key, data, error, UNDEFINED, revalidate)
|
10808
|
+
// Throw error or return data
|
10809
|
+
];
|
10810
|
+
case 4:
|
10811
|
+
res = _c.sent();
|
10812
|
+
// Throw error or return data
|
10813
|
+
if (error)
|
10814
|
+
throw error;
|
10815
|
+
return [2 /*return*/, res];
|
10816
|
+
}
|
10817
|
+
});
|
10818
|
+
});
|
10819
|
+
};
|
10820
|
+
|
10821
|
+
var revalidateAllKeys = function (revalidators, type) {
|
10822
|
+
for (var key in revalidators) {
|
10823
|
+
if (revalidators[key][0])
|
10824
|
+
revalidators[key][0](type);
|
10825
|
+
}
|
10826
|
+
};
|
10827
|
+
var initCache = function (provider, options) {
|
10828
|
+
// The global state for a specific provider will be used to deduplicate
|
10829
|
+
// requests and store listeners. As well as a mutate function that bound to
|
10830
|
+
// the cache.
|
10831
|
+
// Provider's global state might be already initialized. Let's try to get the
|
10832
|
+
// global state associated with the provider first.
|
10833
|
+
if (!SWRGlobalState.has(provider)) {
|
10834
|
+
var opts = mergeObjects(defaultConfigOptions, options);
|
10835
|
+
// If there's no global state bound to the provider, create a new one with the
|
10836
|
+
// new mutate function.
|
10837
|
+
var EVENT_REVALIDATORS = {};
|
10838
|
+
var mutate = internalMutate.bind(UNDEFINED, provider);
|
10839
|
+
var unmount = noop;
|
10840
|
+
// Update the state if it's new, or the provider has been extended.
|
10841
|
+
SWRGlobalState.set(provider, [
|
10842
|
+
EVENT_REVALIDATORS,
|
10843
|
+
{},
|
10844
|
+
{},
|
10845
|
+
{},
|
10846
|
+
{},
|
10847
|
+
{},
|
10848
|
+
mutate
|
10849
|
+
]);
|
10850
|
+
// This is a new provider, we need to initialize it and setup DOM events
|
10851
|
+
// listeners for `focus` and `reconnect` actions.
|
10852
|
+
if (!IS_SERVER) {
|
10853
|
+
var releaseFocus_1 = opts.initFocus(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT));
|
10854
|
+
var releaseReconnect_1 = opts.initReconnect(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT));
|
10855
|
+
unmount = function () {
|
10856
|
+
releaseFocus_1 && releaseFocus_1();
|
10857
|
+
releaseReconnect_1 && releaseReconnect_1();
|
10858
|
+
// When un-mounting, we need to remove the cache provider from the state
|
10859
|
+
// storage too because it's a side-effect. Otherwise when re-mounting we
|
10860
|
+
// will not re-register those event listeners.
|
10861
|
+
SWRGlobalState.delete(provider);
|
10862
|
+
};
|
10863
|
+
}
|
10864
|
+
// We might want to inject an extra layer on top of `provider` in the future,
|
10865
|
+
// such as key serialization, auto GC, etc.
|
10866
|
+
// For now, it's just a `Map` interface without any modifications.
|
10867
|
+
return [provider, mutate, unmount];
|
10868
|
+
}
|
10869
|
+
return [provider, SWRGlobalState.get(provider)[6]];
|
10870
|
+
};
|
10871
|
+
|
10872
|
+
// error retry
|
10873
|
+
var onErrorRetry = function (_, __, config, revalidate, opts) {
|
10874
|
+
if (!preset.isVisible()) {
|
10875
|
+
// If it's hidden, stop. It will auto revalidate when refocusing.
|
10876
|
+
return;
|
10877
|
+
}
|
10878
|
+
var maxRetryCount = config.errorRetryCount;
|
10879
|
+
var currentRetryCount = opts.retryCount;
|
10880
|
+
// Exponential backoff
|
10881
|
+
var timeout = ~~((Math.random() + 0.5) *
|
10882
|
+
(1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
|
10883
|
+
if (!isUndefined$1(maxRetryCount) && currentRetryCount > maxRetryCount) {
|
10884
|
+
return;
|
10885
|
+
}
|
10886
|
+
setTimeout(revalidate, timeout, opts);
|
10887
|
+
};
|
10888
|
+
// Default cache provider
|
10889
|
+
var _a = initCache(new Map()), cache = _a[0], mutate = _a[1];
|
10890
|
+
// Default config
|
10891
|
+
var defaultConfig = mergeObjects({
|
10892
|
+
// events
|
10893
|
+
onLoadingSlow: noop,
|
10894
|
+
onSuccess: noop,
|
10895
|
+
onError: noop,
|
10896
|
+
onErrorRetry: onErrorRetry,
|
10897
|
+
onDiscarded: noop,
|
10898
|
+
// switches
|
10899
|
+
revalidateOnFocus: true,
|
10900
|
+
revalidateOnReconnect: true,
|
10901
|
+
revalidateIfStale: true,
|
10902
|
+
shouldRetryOnError: true,
|
10903
|
+
// timeouts
|
10904
|
+
errorRetryInterval: slowConnection ? 10000 : 5000,
|
10905
|
+
focusThrottleInterval: 5 * 1000,
|
10906
|
+
dedupingInterval: 2 * 1000,
|
10907
|
+
loadingTimeout: slowConnection ? 5000 : 3000,
|
10908
|
+
// providers
|
10909
|
+
compare: function (currentData, newData) {
|
10910
|
+
return stableHash(currentData) == stableHash(newData);
|
10911
|
+
},
|
10912
|
+
isPaused: function () { return false; },
|
10913
|
+
cache: cache,
|
10914
|
+
mutate: mutate,
|
10915
|
+
fallback: {}
|
10916
|
+
},
|
10917
|
+
// use web preset by default
|
10918
|
+
preset);
|
10919
|
+
|
10920
|
+
var mergeConfigs$1 = function (a, b) {
|
10921
|
+
// Need to create a new object to avoid mutating the original here.
|
10922
|
+
var v = mergeObjects(a, b);
|
10923
|
+
// If two configs are provided, merge their `use` and `fallback` options.
|
10924
|
+
if (b) {
|
10925
|
+
var u1 = a.use, f1 = a.fallback;
|
10926
|
+
var u2 = b.use, f2 = b.fallback;
|
10927
|
+
if (u1 && u2) {
|
10928
|
+
v.use = u1.concat(u2);
|
10929
|
+
}
|
10930
|
+
if (f1 && f2) {
|
10931
|
+
v.fallback = mergeObjects(f1, f2);
|
10932
|
+
}
|
10933
|
+
}
|
10934
|
+
return v;
|
10935
|
+
};
|
10936
|
+
|
10937
|
+
var SWRConfigContext = React.createContext({});
|
10938
|
+
var SWRConfig$1 = function (props) {
|
10939
|
+
var value = props.value;
|
10940
|
+
// Extend parent context values and middleware.
|
10941
|
+
var extendedConfig = mergeConfigs$1(React.useContext(SWRConfigContext), value);
|
10942
|
+
// Should not use the inherited provider.
|
10943
|
+
var provider = value && value.provider;
|
10944
|
+
// Use a lazy initialized state to create the cache on first access.
|
10945
|
+
var cacheContext = React.useState(function () {
|
10946
|
+
return provider
|
10947
|
+
? initCache(provider(extendedConfig.cache || cache), value)
|
10948
|
+
: UNDEFINED;
|
10949
|
+
})[0];
|
10950
|
+
// Override the cache if a new provider is given.
|
10951
|
+
if (cacheContext) {
|
10952
|
+
extendedConfig.cache = cacheContext[0];
|
10953
|
+
extendedConfig.mutate = cacheContext[1];
|
10954
|
+
}
|
10955
|
+
// Unsubscribe events.
|
10956
|
+
useIsomorphicLayoutEffect(function () { return (cacheContext ? cacheContext[2] : UNDEFINED); }, []);
|
10957
|
+
return React.createElement(SWRConfigContext.Provider, mergeObjects(props, {
|
10958
|
+
value: extendedConfig
|
10959
|
+
}));
|
10960
|
+
};
|
10961
|
+
var SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'default', {
|
10962
|
+
value: defaultConfig
|
10963
|
+
});
|
10964
|
+
|
10965
|
+
var zhCN = {
|
10966
|
+
moneySymbol: '¥',
|
10967
|
+
form: {
|
10968
|
+
lightFilter: {
|
10969
|
+
more: '更多筛选',
|
10970
|
+
clear: '清除',
|
10971
|
+
confirm: '确认',
|
10972
|
+
itemUnit: '项'
|
10973
|
+
}
|
10974
|
+
},
|
10975
|
+
tableForm: {
|
10976
|
+
search: '查询',
|
10977
|
+
reset: '重置',
|
10978
|
+
submit: '提交',
|
10979
|
+
collapsed: '展开',
|
10980
|
+
expand: '收起',
|
10981
|
+
inputPlaceholder: '请输入',
|
10982
|
+
selectPlaceholder: '请选择'
|
10983
|
+
},
|
10984
|
+
alert: {
|
10985
|
+
clear: '取消选择',
|
10986
|
+
selected: '已选择',
|
10987
|
+
item: '项'
|
10988
|
+
},
|
10989
|
+
pagination: {
|
10990
|
+
total: {
|
10991
|
+
range: '第',
|
10992
|
+
total: '条/总共',
|
10993
|
+
item: '条'
|
10994
|
+
}
|
10995
|
+
},
|
10996
|
+
tableToolBar: {
|
10997
|
+
leftPin: '固定在列首',
|
10998
|
+
rightPin: '固定在列尾',
|
10999
|
+
noPin: '不固定',
|
11000
|
+
leftFixedTitle: '固定在左侧',
|
11001
|
+
rightFixedTitle: '固定在右侧',
|
11002
|
+
noFixedTitle: '不固定',
|
11003
|
+
reset: '重置',
|
11004
|
+
columnDisplay: '列展示',
|
11005
|
+
columnSetting: '列设置',
|
11006
|
+
fullScreen: '全屏',
|
11007
|
+
exitFullScreen: '退出全屏',
|
11008
|
+
reload: '刷新',
|
11009
|
+
density: '密度',
|
11010
|
+
densityDefault: '正常',
|
11011
|
+
densityLarger: '默认',
|
11012
|
+
densityMiddle: '中等',
|
11013
|
+
densitySmall: '紧凑'
|
11014
|
+
},
|
11015
|
+
editableTable: {
|
11016
|
+
action: {
|
11017
|
+
save: '保存',
|
11018
|
+
cancel: '取消',
|
11019
|
+
delete: '删除'
|
11020
|
+
}
|
11021
|
+
},
|
11022
|
+
switch: {
|
11023
|
+
open: '打开',
|
11024
|
+
close: '关闭'
|
11025
|
+
},
|
11026
|
+
loginForm: {
|
11027
|
+
submitText: '登录'
|
11028
|
+
}
|
11029
|
+
};
|
11030
|
+
|
11031
|
+
function get$3(source, path, defaultValue) {
|
11032
|
+
// a[3].b -> a.3.b
|
11033
|
+
var paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
11034
|
+
var result = source;
|
11035
|
+
var message = defaultValue; // eslint-disable-next-line no-restricted-syntax
|
11036
|
+
|
11037
|
+
var _iterator = _createForOfIteratorHelper$1(paths),
|
11038
|
+
_step;
|
11039
|
+
|
11040
|
+
try {
|
11041
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
11042
|
+
var p = _step.value;
|
11043
|
+
message = Object(result)[p];
|
11044
|
+
result = Object(result)[p];
|
11045
|
+
|
11046
|
+
if (message === undefined) {
|
11047
|
+
return defaultValue;
|
11048
|
+
}
|
11049
|
+
}
|
11050
|
+
} catch (err) {
|
11051
|
+
_iterator.e(err);
|
11052
|
+
} finally {
|
11053
|
+
_iterator.f();
|
11054
|
+
}
|
11055
|
+
|
11056
|
+
return message;
|
11057
|
+
}
|
11058
|
+
/**
|
11059
|
+
* 创建一个操作函数
|
11060
|
+
*
|
11061
|
+
* @param locale
|
11062
|
+
* @param localeMap
|
11063
|
+
*/
|
11064
|
+
|
11065
|
+
|
11066
|
+
var createIntl = function createIntl(locale, localeMap) {
|
11067
|
+
return {
|
11068
|
+
getMessage: function getMessage(id, defaultMessage) {
|
11069
|
+
return get$3(localeMap, id, defaultMessage) || defaultMessage;
|
11070
|
+
},
|
11071
|
+
locale: locale
|
11072
|
+
};
|
11073
|
+
};
|
11074
|
+
var zhCNIntl = createIntl('zh_CN', zhCN);
|
11075
|
+
var ConfigContext = /*#__PURE__*/React__default['default'].createContext({
|
11076
|
+
intl: _objectSpread2$1(_objectSpread2$1({}, zhCNIntl), {}, {
|
11077
|
+
locale: 'default'
|
11078
|
+
}),
|
11079
|
+
valueTypeMap: {}
|
11080
|
+
});
|
11081
|
+
var ConfigConsumer = ConfigContext.Consumer,
|
11082
|
+
ConfigProvider = ConfigContext.Provider;
|
11083
|
+
|
11084
|
+
var _excluded$g = ["columns", "extraColumns", "request", "modalFormSearch", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig"],
|
10156
11085
|
_excluded2$3 = ["actionMethod"];
|
10157
11086
|
|
10158
11087
|
var TabelCard = function TabelCard(props, ref) {
|
@@ -10167,7 +11096,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10167
11096
|
onFormChange = props.onFormChange,
|
10168
11097
|
modalConfig = props.modalConfig,
|
10169
11098
|
optionColumnConfig = props.optionColumnConfig,
|
10170
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
11099
|
+
extraProps = _objectWithoutProperties(props, _excluded$g);
|
10171
11100
|
|
10172
11101
|
var actionRef = React.useRef();
|
10173
11102
|
var formRef = React.useRef(null);
|
@@ -10496,6 +11425,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10496
11425
|
}
|
10497
11426
|
});
|
10498
11427
|
}, [actionRef]);
|
11428
|
+
var values = React.useContext(ConfigContext);
|
10499
11429
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10500
11430
|
ref: formRef,
|
10501
11431
|
title: modalFormConfig.type || '新增',
|
@@ -10550,7 +11480,25 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10550
11480
|
|
10551
11481
|
return true;
|
10552
11482
|
})
|
10553
|
-
})), /*#__PURE__*/React__default['default'].createElement(
|
11483
|
+
})), /*#__PURE__*/React__default['default'].createElement(ConfigContext.Provider, {
|
11484
|
+
value: _objectSpread2(_objectSpread2({}, values), {}, {
|
11485
|
+
valueTypeMap: {
|
11486
|
+
treeSelect: {
|
11487
|
+
render: function render(text) {
|
11488
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, text);
|
11489
|
+
},
|
11490
|
+
renderFormItem: function renderFormItem(text, props) {
|
11491
|
+
return /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2({
|
11492
|
+
request: props.request,
|
11493
|
+
showSearch: true,
|
11494
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
11495
|
+
allowClear: true
|
11496
|
+
}, props === null || props === void 0 ? void 0 : props.fieldProps));
|
11497
|
+
}
|
11498
|
+
}
|
11499
|
+
}
|
11500
|
+
})
|
11501
|
+
}, /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2({
|
10554
11502
|
actionRef: actionRef,
|
10555
11503
|
rowKey: "id",
|
10556
11504
|
bordered: true,
|
@@ -10591,7 +11539,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10591
11539
|
pagination: {
|
10592
11540
|
pageSize: 20
|
10593
11541
|
}
|
10594
|
-
}, extraProps)));
|
11542
|
+
}, extraProps))));
|
10595
11543
|
};
|
10596
11544
|
|
10597
11545
|
var index$1 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
|
@@ -10600,6 +11548,7 @@ exports.AutoScroll = Index$9;
|
|
10600
11548
|
exports.Breadcrumb = Index$b;
|
10601
11549
|
exports.Button = WButton;
|
10602
11550
|
exports.Card = Index$c;
|
11551
|
+
exports.Cascader = WCascader;
|
10603
11552
|
exports.Checkbox = Index$4;
|
10604
11553
|
exports.CountUp = Index$8;
|
10605
11554
|
exports.DatePicker = Index$2;
|