wargerm 0.2.22 → 0.2.26
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/components/Cascader/index.d.ts +8 -0
- package/dist/components/Swiper/index.d.ts +4 -1
- package/dist/components/Table/index.d.ts +1 -5
- package/dist/components/WForm/index.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1032 -104
- package/dist/index.js +1032 -102
- 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"
|
@@ -8652,7 +8801,21 @@ var WForm = function WForm(props, ref) {
|
|
8652
8801
|
};
|
8653
8802
|
|
8654
8803
|
var setFieldsValue = function setFieldsValue(record) {
|
8655
|
-
|
8804
|
+
var setFieldsValues = _objectSpread2({}, record);
|
8805
|
+
|
8806
|
+
filterFormColumns.forEach(function (c) {
|
8807
|
+
if (c.search && c.search.transformSetForm) {
|
8808
|
+
var transformObj = c.search.transformSetForm(setFieldsValues[c.dataIndex]);
|
8809
|
+
setFieldsValues = _objectSpread2(_objectSpread2({}, setFieldsValues), transformObj);
|
8810
|
+
|
8811
|
+
if (!transformObj[c.dataIndex]) {
|
8812
|
+
delete setFieldsValues[c.dataIndex];
|
8813
|
+
}
|
8814
|
+
|
8815
|
+
return false;
|
8816
|
+
}
|
8817
|
+
});
|
8818
|
+
form.setFieldsValue(setFieldsValues);
|
8656
8819
|
};
|
8657
8820
|
|
8658
8821
|
React.useImperativeHandle(ref, function () {
|
@@ -8732,7 +8895,7 @@ var WForm = function WForm(props, ref) {
|
|
8732
8895
|
|
8733
8896
|
var WForm$1 = /*#__PURE__*/React__default['default'].forwardRef(WForm);
|
8734
8897
|
|
8735
|
-
var _excluded$
|
8898
|
+
var _excluded$8 = ["height", "width", "count", "style", "numberStyle"],
|
8736
8899
|
_excluded2$2 = ["count", "numberCount", "width", "height", "marginRight"];
|
8737
8900
|
|
8738
8901
|
var Number = function Number(_ref) {
|
@@ -8742,7 +8905,7 @@ var Number = function Number(_ref) {
|
|
8742
8905
|
count = _ref$count === void 0 ? 0 : _ref$count,
|
8743
8906
|
style = _ref.style,
|
8744
8907
|
numberStyle = _ref.numberStyle,
|
8745
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
8908
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
8746
8909
|
|
8747
8910
|
// 上次的值
|
8748
8911
|
var _useState = React.useState(0),
|
@@ -8906,12 +9069,12 @@ var Index$7 = function Index(props) {
|
|
8906
9069
|
}));
|
8907
9070
|
};
|
8908
9071
|
|
8909
|
-
var _excluded$
|
9072
|
+
var _excluded$9 = ["duration"];
|
8910
9073
|
|
8911
9074
|
var Index$8 = function Index(props) {
|
8912
9075
|
var _props$duration = props.duration,
|
8913
9076
|
duration = _props$duration === void 0 ? 2.75 : _props$duration,
|
8914
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9077
|
+
extraProps = _objectWithoutProperties(props, _excluded$9);
|
8915
9078
|
return /*#__PURE__*/React__default['default'].createElement(CountUp__default['default'], _objectSpread2({
|
8916
9079
|
duration: duration
|
8917
9080
|
}, extraProps));
|
@@ -8919,7 +9082,7 @@ var Index$8 = function Index(props) {
|
|
8919
9082
|
|
8920
9083
|
Index$8.defaultProps = {};
|
8921
9084
|
|
8922
|
-
var _excluded$
|
9085
|
+
var _excluded$a = ["list", "render", "partSize"];
|
8923
9086
|
|
8924
9087
|
function AutoScroll(props) {
|
8925
9088
|
var inner1 = React.useRef();
|
@@ -9003,7 +9166,7 @@ var Index$9 = function Index(_ref) {
|
|
9003
9166
|
render = _ref.render,
|
9004
9167
|
_ref$partSize = _ref.partSize,
|
9005
9168
|
partSize = _ref$partSize === void 0 ? 4 : _ref$partSize,
|
9006
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
9169
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$a);
|
9007
9170
|
|
9008
9171
|
{
|
9009
9172
|
var _useState = React.useState([]),
|
@@ -9080,16 +9243,19 @@ var Index$9 = function Index(_ref) {
|
|
9080
9243
|
}
|
9081
9244
|
};
|
9082
9245
|
|
9083
|
-
var _excluded$
|
9246
|
+
var _excluded$b = ["data", "onClick", "slidesPerView", "rowKey", "onSwiperChange", "renderItem"];
|
9084
9247
|
|
9085
9248
|
SwiperCore__default['default'].use([SwiperCore.Pagination, SwiperCore.Navigation, SwiperCore.Autoplay]);
|
9086
9249
|
|
9087
9250
|
var Index$a = function Index(props) {
|
9088
9251
|
var data = props.data,
|
9089
9252
|
_onClick = props.onClick,
|
9090
|
-
|
9253
|
+
_props$slidesPerView = props.slidesPerView,
|
9254
|
+
slidesPerView = _props$slidesPerView === void 0 ? 4 : _props$slidesPerView,
|
9255
|
+
rowKey = props.rowKey,
|
9256
|
+
onSwiperChange = props.onSwiperChange,
|
9091
9257
|
renderItem = props.renderItem,
|
9092
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
9258
|
+
extraProps = _objectWithoutProperties(props, _excluded$b);
|
9093
9259
|
|
9094
9260
|
var _useState = React.useState(null),
|
9095
9261
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -9108,8 +9274,11 @@ var Index$a = function Index(props) {
|
|
9108
9274
|
// }
|
9109
9275
|
// onClick && onClick(swiper, event);
|
9110
9276
|
// }}
|
9277
|
+
onSlideChange: function onSlideChange(swiper) {
|
9278
|
+
onSwiperChange && onSwiperChange(swiper.realIndex, data[swiper.realIndex]);
|
9279
|
+
},
|
9111
9280
|
className: "mySwiper",
|
9112
|
-
slidesPerView:
|
9281
|
+
slidesPerView: slidesPerView,
|
9113
9282
|
spaceBetween: 30,
|
9114
9283
|
loop: true,
|
9115
9284
|
loopFillGroupWithBlank: true,
|
@@ -9117,7 +9286,7 @@ var Index$a = function Index(props) {
|
|
9117
9286
|
navigation: true
|
9118
9287
|
}, extraProps), data.map(function (item, index) {
|
9119
9288
|
return /*#__PURE__*/React__default['default'].createElement(react.SwiperSlide, {
|
9120
|
-
key: index
|
9289
|
+
key: rowKey ? item[rowKey] : index
|
9121
9290
|
}, function (_ref) {
|
9122
9291
|
var isActive = _ref.isActive;
|
9123
9292
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
@@ -9127,7 +9296,7 @@ var Index$a = function Index(props) {
|
|
9127
9296
|
},
|
9128
9297
|
onClick: function onClick(event) {
|
9129
9298
|
if (controlledSwiper) {
|
9130
|
-
if (controlledSwiper.clickedIndex -
|
9299
|
+
if (controlledSwiper.clickedIndex - slidesPerView > data.length) {
|
9131
9300
|
controlledSwiper.slideNext();
|
9132
9301
|
} else {
|
9133
9302
|
controlledSwiper.clickedIndex && controlledSwiper.slideTo(controlledSwiper.clickedIndex);
|
@@ -9737,7 +9906,7 @@ function createBrowserHistory(props) {
|
|
9737
9906
|
return history;
|
9738
9907
|
}
|
9739
9908
|
|
9740
|
-
var _excluded$
|
9909
|
+
var _excluded$c = ["routes", "className"];
|
9741
9910
|
var history = createBrowserHistory();
|
9742
9911
|
|
9743
9912
|
function itemRender(route, params, routes, paths) {
|
@@ -9755,7 +9924,7 @@ function itemRender(route, params, routes, paths) {
|
|
9755
9924
|
var Index$b = function Index(_ref) {
|
9756
9925
|
var routes = _ref.routes,
|
9757
9926
|
className = _ref.className,
|
9758
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9927
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
9759
9928
|
|
9760
9929
|
return /*#__PURE__*/React__default['default'].createElement(_Breadcrumb__default['default'], _objectSpread2({
|
9761
9930
|
className: className || 'default',
|
@@ -9765,7 +9934,7 @@ var Index$b = function Index(_ref) {
|
|
9765
9934
|
}, props));
|
9766
9935
|
};
|
9767
9936
|
|
9768
|
-
var _excluded$
|
9937
|
+
var _excluded$d = ["title", "className", "headerTail", "headerCenter"];
|
9769
9938
|
|
9770
9939
|
var Index$c = function Index(_ref) {
|
9771
9940
|
var _classNames;
|
@@ -9775,7 +9944,7 @@ var Index$c = function Index(_ref) {
|
|
9775
9944
|
className = _ref$className === void 0 ? 'default' : _ref$className,
|
9776
9945
|
headerTail = _ref.headerTail,
|
9777
9946
|
headerCenter = _ref.headerCenter,
|
9778
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
9947
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
9779
9948
|
|
9780
9949
|
return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread2({
|
9781
9950
|
className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, 'card-container', true), _defineProperty(_classNames, className, true), _classNames))
|
@@ -9882,7 +10051,7 @@ function DialogModel(props) {
|
|
9882
10051
|
return renderChildren;
|
9883
10052
|
}
|
9884
10053
|
|
9885
|
-
var _excluded$
|
10054
|
+
var _excluded$e = ["visible"];
|
9886
10055
|
|
9887
10056
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
9888
10057
|
_inherits(Modal, _React$PureComponent);
|
@@ -10016,7 +10185,7 @@ Modal.show = function (config) {
|
|
10016
10185
|
manager.setShow = setShow;
|
10017
10186
|
|
10018
10187
|
var visible = props.visible,
|
10019
|
-
trueProps = _objectWithoutProperties(props, _excluded$
|
10188
|
+
trueProps = _objectWithoutProperties(props, _excluded$e);
|
10020
10189
|
|
10021
10190
|
React.useEffect(function () {
|
10022
10191
|
manager.mounted = true;
|
@@ -10040,7 +10209,7 @@ Modal.hidden = function () {
|
|
10040
10209
|
ModalContainer[modelSysbol] && ModalContainer[modelSysbol].hidden();
|
10041
10210
|
};
|
10042
10211
|
|
10043
|
-
var _excluded$
|
10212
|
+
var _excluded$f = ["columns", "extraColumns", "search", "visible", "setVisible", "disabled", "submitMethod", "onSubmitSuccess", "title", "record", "onFormChange"];
|
10044
10213
|
|
10045
10214
|
var ModalForm = function ModalForm(props, ref) {
|
10046
10215
|
var columns = props.columns,
|
@@ -10054,7 +10223,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10054
10223
|
title = props.title,
|
10055
10224
|
record = props.record,
|
10056
10225
|
onFormChange = props.onFormChange,
|
10057
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
10226
|
+
extraProps = _objectWithoutProperties(props, _excluded$f);
|
10058
10227
|
|
10059
10228
|
var formRef = React.useRef(null);
|
10060
10229
|
|
@@ -10185,7 +10354,748 @@ var ModalForm = function ModalForm(props, ref) {
|
|
10185
10354
|
|
10186
10355
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
10187
10356
|
|
10188
|
-
|
10357
|
+
function _defineProperty$1(obj, key, value) {
|
10358
|
+
if (key in obj) {
|
10359
|
+
Object.defineProperty(obj, key, {
|
10360
|
+
value: value,
|
10361
|
+
enumerable: true,
|
10362
|
+
configurable: true,
|
10363
|
+
writable: true
|
10364
|
+
});
|
10365
|
+
} else {
|
10366
|
+
obj[key] = value;
|
10367
|
+
}
|
10368
|
+
|
10369
|
+
return obj;
|
10370
|
+
}
|
10371
|
+
|
10372
|
+
function ownKeys$1(object, enumerableOnly) {
|
10373
|
+
var keys = Object.keys(object);
|
10374
|
+
|
10375
|
+
if (Object.getOwnPropertySymbols) {
|
10376
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
10377
|
+
|
10378
|
+
if (enumerableOnly) {
|
10379
|
+
symbols = symbols.filter(function (sym) {
|
10380
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
10381
|
+
});
|
10382
|
+
}
|
10383
|
+
|
10384
|
+
keys.push.apply(keys, symbols);
|
10385
|
+
}
|
10386
|
+
|
10387
|
+
return keys;
|
10388
|
+
}
|
10389
|
+
|
10390
|
+
function _objectSpread2$1(target) {
|
10391
|
+
for (var i = 1; i < arguments.length; i++) {
|
10392
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
10393
|
+
|
10394
|
+
if (i % 2) {
|
10395
|
+
ownKeys$1(Object(source), true).forEach(function (key) {
|
10396
|
+
_defineProperty$1(target, key, source[key]);
|
10397
|
+
});
|
10398
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
10399
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
10400
|
+
} else {
|
10401
|
+
ownKeys$1(Object(source)).forEach(function (key) {
|
10402
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
10403
|
+
});
|
10404
|
+
}
|
10405
|
+
}
|
10406
|
+
|
10407
|
+
return target;
|
10408
|
+
}
|
10409
|
+
|
10410
|
+
function _arrayLikeToArray$1(arr, len) {
|
10411
|
+
if (len == null || len > arr.length) len = arr.length;
|
10412
|
+
|
10413
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
10414
|
+
arr2[i] = arr[i];
|
10415
|
+
}
|
10416
|
+
|
10417
|
+
return arr2;
|
10418
|
+
}
|
10419
|
+
|
10420
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
10421
|
+
if (!o) return;
|
10422
|
+
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
10423
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
10424
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
10425
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
10426
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
10427
|
+
}
|
10428
|
+
|
10429
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) {
|
10430
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
10431
|
+
|
10432
|
+
if (!it) {
|
10433
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
|
10434
|
+
if (it) o = it;
|
10435
|
+
var i = 0;
|
10436
|
+
|
10437
|
+
var F = function F() {};
|
10438
|
+
|
10439
|
+
return {
|
10440
|
+
s: F,
|
10441
|
+
n: function n() {
|
10442
|
+
if (i >= o.length) return {
|
10443
|
+
done: true
|
10444
|
+
};
|
10445
|
+
return {
|
10446
|
+
done: false,
|
10447
|
+
value: o[i++]
|
10448
|
+
};
|
10449
|
+
},
|
10450
|
+
e: function e(_e) {
|
10451
|
+
throw _e;
|
10452
|
+
},
|
10453
|
+
f: F
|
10454
|
+
};
|
10455
|
+
}
|
10456
|
+
|
10457
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10458
|
+
}
|
10459
|
+
|
10460
|
+
var normalCompletion = true,
|
10461
|
+
didErr = false,
|
10462
|
+
err;
|
10463
|
+
return {
|
10464
|
+
s: function s() {
|
10465
|
+
it = it.call(o);
|
10466
|
+
},
|
10467
|
+
n: function n() {
|
10468
|
+
var step = it.next();
|
10469
|
+
normalCompletion = step.done;
|
10470
|
+
return step;
|
10471
|
+
},
|
10472
|
+
e: function e(_e2) {
|
10473
|
+
didErr = true;
|
10474
|
+
err = _e2;
|
10475
|
+
},
|
10476
|
+
f: function f() {
|
10477
|
+
try {
|
10478
|
+
if (!normalCompletion && it["return"] != null) it["return"]();
|
10479
|
+
} finally {
|
10480
|
+
if (didErr) throw err;
|
10481
|
+
}
|
10482
|
+
}
|
10483
|
+
};
|
10484
|
+
}
|
10485
|
+
|
10486
|
+
/*! *****************************************************************************
|
10487
|
+
Copyright (c) Microsoft Corporation.
|
10488
|
+
|
10489
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
10490
|
+
purpose with or without fee is hereby granted.
|
10491
|
+
|
10492
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
10493
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
10494
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
10495
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
10496
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
10497
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
10498
|
+
PERFORMANCE OF THIS SOFTWARE.
|
10499
|
+
***************************************************************************** */
|
10500
|
+
|
10501
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
10502
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
10503
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
10504
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
10505
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
10506
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
10507
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
10508
|
+
});
|
10509
|
+
}
|
10510
|
+
|
10511
|
+
function __generator(thisArg, body) {
|
10512
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
10513
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
10514
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
10515
|
+
function step(op) {
|
10516
|
+
if (f) throw new TypeError("Generator is already executing.");
|
10517
|
+
while (_) try {
|
10518
|
+
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;
|
10519
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
10520
|
+
switch (op[0]) {
|
10521
|
+
case 0: case 1: t = op; break;
|
10522
|
+
case 4: _.label++; return { value: op[1], done: false };
|
10523
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
10524
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
10525
|
+
default:
|
10526
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
10527
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
10528
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
10529
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
10530
|
+
if (t[2]) _.ops.pop();
|
10531
|
+
_.trys.pop(); continue;
|
10532
|
+
}
|
10533
|
+
op = body.call(thisArg, _);
|
10534
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
10535
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
10536
|
+
}
|
10537
|
+
}
|
10538
|
+
|
10539
|
+
var noop = function () { };
|
10540
|
+
// Using noop() as the undefined value as undefined can possibly be replaced
|
10541
|
+
// by something else. Prettier ignore and extra parentheses are necessary here
|
10542
|
+
// to ensure that tsc doesn't remove the __NOINLINE__ comment.
|
10543
|
+
// prettier-ignore
|
10544
|
+
var UNDEFINED = ( /*#__NOINLINE__*/noop());
|
10545
|
+
var OBJECT = Object;
|
10546
|
+
var isUndefined$1 = function (v) { return v === UNDEFINED; };
|
10547
|
+
var isFunction$1 = function (v) { return typeof v == 'function'; };
|
10548
|
+
var mergeObjects = function (a, b) { return OBJECT.assign({}, a, b); };
|
10549
|
+
var STR_UNDEFINED = 'undefined';
|
10550
|
+
var hasWindow = function () { return typeof window != STR_UNDEFINED; };
|
10551
|
+
var hasDocument = function () { return typeof document != STR_UNDEFINED; };
|
10552
|
+
|
10553
|
+
// use WeakMap to store the object->key mapping
|
10554
|
+
// so the objects can be garbage collected.
|
10555
|
+
// WeakMap uses a hashtable under the hood, so the lookup
|
10556
|
+
// complexity is almost O(1).
|
10557
|
+
var table = new WeakMap();
|
10558
|
+
// counter of the key
|
10559
|
+
var counter = 0;
|
10560
|
+
// A stable hash implementation that supports:
|
10561
|
+
// - Fast and ensures unique hash properties
|
10562
|
+
// - Handles unserializable values
|
10563
|
+
// - Handles object key ordering
|
10564
|
+
// - Generates short results
|
10565
|
+
//
|
10566
|
+
// This is not a serialization function, and the result is not guaranteed to be
|
10567
|
+
// parsible.
|
10568
|
+
var stableHash = function (arg) {
|
10569
|
+
var type = typeof arg;
|
10570
|
+
var constructor = arg && arg.constructor;
|
10571
|
+
var isDate = constructor == Date;
|
10572
|
+
var result;
|
10573
|
+
var index;
|
10574
|
+
if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {
|
10575
|
+
// Object/function, not null/date/regexp. Use WeakMap to store the id first.
|
10576
|
+
// If it's already hashed, directly return the result.
|
10577
|
+
result = table.get(arg);
|
10578
|
+
if (result)
|
10579
|
+
return result;
|
10580
|
+
// Store the hash first for circular reference detection before entering the
|
10581
|
+
// recursive `stableHash` calls.
|
10582
|
+
// For other objects like set and map, we use this id directly as the hash.
|
10583
|
+
result = ++counter + '~';
|
10584
|
+
table.set(arg, result);
|
10585
|
+
if (constructor == Array) {
|
10586
|
+
// Array.
|
10587
|
+
result = '@';
|
10588
|
+
for (index = 0; index < arg.length; index++) {
|
10589
|
+
result += stableHash(arg[index]) + ',';
|
10590
|
+
}
|
10591
|
+
table.set(arg, result);
|
10592
|
+
}
|
10593
|
+
if (constructor == OBJECT) {
|
10594
|
+
// Object, sort keys.
|
10595
|
+
result = '#';
|
10596
|
+
var keys = OBJECT.keys(arg).sort();
|
10597
|
+
while (!isUndefined$1((index = keys.pop()))) {
|
10598
|
+
if (!isUndefined$1(arg[index])) {
|
10599
|
+
result += index + ':' + stableHash(arg[index]) + ',';
|
10600
|
+
}
|
10601
|
+
}
|
10602
|
+
table.set(arg, result);
|
10603
|
+
}
|
10604
|
+
}
|
10605
|
+
else {
|
10606
|
+
result = isDate
|
10607
|
+
? arg.toJSON()
|
10608
|
+
: type == 'symbol'
|
10609
|
+
? arg.toString()
|
10610
|
+
: type == 'string'
|
10611
|
+
? JSON.stringify(arg)
|
10612
|
+
: '' + arg;
|
10613
|
+
}
|
10614
|
+
return result;
|
10615
|
+
};
|
10616
|
+
|
10617
|
+
/**
|
10618
|
+
* Due to bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,
|
10619
|
+
* it's not reliable to detect if the browser is currently online or offline
|
10620
|
+
* based on `navigator.onLine`.
|
10621
|
+
* As a work around, we always assume it's online on first load, and change
|
10622
|
+
* the status upon `online` or `offline` events.
|
10623
|
+
*/
|
10624
|
+
var online = true;
|
10625
|
+
var isOnline = function () { return online; };
|
10626
|
+
var hasWin = hasWindow();
|
10627
|
+
var hasDoc = hasDocument();
|
10628
|
+
// For node and React Native, `add/removeEventListener` doesn't exist on window.
|
10629
|
+
var onWindowEvent = hasWin && window.addEventListener
|
10630
|
+
? window.addEventListener.bind(window)
|
10631
|
+
: noop;
|
10632
|
+
var onDocumentEvent = hasDoc ? document.addEventListener.bind(document) : noop;
|
10633
|
+
var offWindowEvent = hasWin && window.removeEventListener
|
10634
|
+
? window.removeEventListener.bind(window)
|
10635
|
+
: noop;
|
10636
|
+
var offDocumentEvent = hasDoc
|
10637
|
+
? document.removeEventListener.bind(document)
|
10638
|
+
: noop;
|
10639
|
+
var isVisible = function () {
|
10640
|
+
var visibilityState = hasDoc && document.visibilityState;
|
10641
|
+
if (!isUndefined$1(visibilityState)) {
|
10642
|
+
return visibilityState !== 'hidden';
|
10643
|
+
}
|
10644
|
+
return true;
|
10645
|
+
};
|
10646
|
+
var initFocus = function (cb) {
|
10647
|
+
// focus revalidate
|
10648
|
+
onDocumentEvent('visibilitychange', cb);
|
10649
|
+
onWindowEvent('focus', cb);
|
10650
|
+
return function () {
|
10651
|
+
offDocumentEvent('visibilitychange', cb);
|
10652
|
+
offWindowEvent('focus', cb);
|
10653
|
+
};
|
10654
|
+
};
|
10655
|
+
var initReconnect = function (cb) {
|
10656
|
+
// revalidate on reconnected
|
10657
|
+
var onOnline = function () {
|
10658
|
+
online = true;
|
10659
|
+
cb();
|
10660
|
+
};
|
10661
|
+
// nothing to revalidate, just update the status
|
10662
|
+
var onOffline = function () {
|
10663
|
+
online = false;
|
10664
|
+
};
|
10665
|
+
onWindowEvent('online', onOnline);
|
10666
|
+
onWindowEvent('offline', onOffline);
|
10667
|
+
return function () {
|
10668
|
+
offWindowEvent('online', onOnline);
|
10669
|
+
offWindowEvent('offline', onOffline);
|
10670
|
+
};
|
10671
|
+
};
|
10672
|
+
var preset = {
|
10673
|
+
isOnline: isOnline,
|
10674
|
+
isVisible: isVisible
|
10675
|
+
};
|
10676
|
+
var defaultConfigOptions = {
|
10677
|
+
initFocus: initFocus,
|
10678
|
+
initReconnect: initReconnect
|
10679
|
+
};
|
10680
|
+
|
10681
|
+
var IS_SERVER = !hasWindow() || 'Deno' in window;
|
10682
|
+
// React currently throws a warning when using useLayoutEffect on the server.
|
10683
|
+
// To get around it, we can conditionally useEffect on the server (no-op) and
|
10684
|
+
// useLayoutEffect in the browser.
|
10685
|
+
var useIsomorphicLayoutEffect = IS_SERVER ? React.useEffect : React.useLayoutEffect;
|
10686
|
+
// This assignment is to extend the Navigator type to use effectiveType.
|
10687
|
+
var navigatorConnection = typeof navigator !== 'undefined' &&
|
10688
|
+
navigator.connection;
|
10689
|
+
// Adjust the config based on slow connection status (<= 70Kbps).
|
10690
|
+
var slowConnection = !IS_SERVER &&
|
10691
|
+
navigatorConnection &&
|
10692
|
+
(['slow-2g', '2g'].includes(navigatorConnection.effectiveType) ||
|
10693
|
+
navigatorConnection.saveData);
|
10694
|
+
|
10695
|
+
var serialize = function (key) {
|
10696
|
+
if (isFunction$1(key)) {
|
10697
|
+
try {
|
10698
|
+
key = key();
|
10699
|
+
}
|
10700
|
+
catch (err) {
|
10701
|
+
// dependencies not ready
|
10702
|
+
key = '';
|
10703
|
+
}
|
10704
|
+
}
|
10705
|
+
var args = [].concat(key);
|
10706
|
+
// If key is not falsy, or not an empty array, hash it.
|
10707
|
+
key =
|
10708
|
+
typeof key == 'string'
|
10709
|
+
? key
|
10710
|
+
: (Array.isArray(key)
|
10711
|
+
? key.length
|
10712
|
+
: key)
|
10713
|
+
? stableHash(key)
|
10714
|
+
: '';
|
10715
|
+
var errorKey = key ? '$err$' + key : '';
|
10716
|
+
var isValidatingKey = key ? '$req$' + key : '';
|
10717
|
+
return [key, args, errorKey, isValidatingKey];
|
10718
|
+
};
|
10719
|
+
|
10720
|
+
// Global state used to deduplicate requests and store listeners
|
10721
|
+
var SWRGlobalState = new WeakMap();
|
10722
|
+
|
10723
|
+
var FOCUS_EVENT = 0;
|
10724
|
+
var RECONNECT_EVENT = 1;
|
10725
|
+
var MUTATE_EVENT = 2;
|
10726
|
+
|
10727
|
+
var broadcastState = function (cache, key, data, error, isValidating, revalidate) {
|
10728
|
+
var _a = SWRGlobalState.get(cache), EVENT_REVALIDATORS = _a[0], STATE_UPDATERS = _a[1], CONCURRENT_PROMISES = _a[4], CONCURRENT_PROMISES_TS = _a[5];
|
10729
|
+
var revalidators = EVENT_REVALIDATORS[key];
|
10730
|
+
var updaters = STATE_UPDATERS[key] || [];
|
10731
|
+
// Always update states of all hooks.
|
10732
|
+
for (var i = 0; i < updaters.length; ++i) {
|
10733
|
+
updaters[i](data, error, isValidating);
|
10734
|
+
}
|
10735
|
+
// If we also need to revalidate, only do it for the first hook.
|
10736
|
+
if (revalidate) {
|
10737
|
+
// Invalidate the key by deleting the concurrent request markers so new
|
10738
|
+
// requests will not be deduped.
|
10739
|
+
delete CONCURRENT_PROMISES[key];
|
10740
|
+
delete CONCURRENT_PROMISES_TS[key];
|
10741
|
+
if (revalidators && revalidators[0]) {
|
10742
|
+
return revalidators[0](MUTATE_EVENT).then(function () {
|
10743
|
+
return cache.get(key);
|
10744
|
+
});
|
10745
|
+
}
|
10746
|
+
}
|
10747
|
+
return cache.get(key);
|
10748
|
+
};
|
10749
|
+
|
10750
|
+
// Global timestamp.
|
10751
|
+
var __timestamp = 0;
|
10752
|
+
var getTimestamp = function () { return ++__timestamp; };
|
10753
|
+
|
10754
|
+
var internalMutate = function () {
|
10755
|
+
var args = [];
|
10756
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
10757
|
+
args[_i] = arguments[_i];
|
10758
|
+
}
|
10759
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
10760
|
+
var cache, _key, revalidate, _data, _a, key, keyErr, _b, MUTATION_TS, MUTATION_END_TS, data, error, beforeMutationTs, res;
|
10761
|
+
return __generator(this, function (_c) {
|
10762
|
+
switch (_c.label) {
|
10763
|
+
case 0:
|
10764
|
+
cache = args[0], _key = args[1];
|
10765
|
+
revalidate = args[3] !== false;
|
10766
|
+
_data = args[2];
|
10767
|
+
_a = serialize(_key), key = _a[0], keyErr = _a[2];
|
10768
|
+
if (!key)
|
10769
|
+
return [2 /*return*/];
|
10770
|
+
_b = SWRGlobalState.get(cache), MUTATION_TS = _b[2], MUTATION_END_TS = _b[3];
|
10771
|
+
// If there is no new data provided, revalidate the key with current state.
|
10772
|
+
if (args.length < 3) {
|
10773
|
+
// Revalidate and broadcast state.
|
10774
|
+
return [2 /*return*/, broadcastState(cache, key, cache.get(key), cache.get(keyErr), UNDEFINED, revalidate)];
|
10775
|
+
}
|
10776
|
+
beforeMutationTs = (MUTATION_TS[key] = getTimestamp());
|
10777
|
+
MUTATION_END_TS[key] = 0;
|
10778
|
+
if (isFunction$1(_data)) {
|
10779
|
+
// `_data` is a function, call it passing current cache value.
|
10780
|
+
try {
|
10781
|
+
_data = _data(cache.get(key));
|
10782
|
+
}
|
10783
|
+
catch (err) {
|
10784
|
+
// If it throws an error synchronously, we shouldn't update the cache.
|
10785
|
+
error = err;
|
10786
|
+
}
|
10787
|
+
}
|
10788
|
+
if (!(_data && isFunction$1(_data.then))) return [3 /*break*/, 2];
|
10789
|
+
return [4 /*yield*/, _data.catch(function (err) {
|
10790
|
+
error = err;
|
10791
|
+
})
|
10792
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10793
|
+
// If there's a race we don't update cache or broadcast the change,
|
10794
|
+
// just return the data.
|
10795
|
+
];
|
10796
|
+
case 1:
|
10797
|
+
// This means that the mutation is async, we need to check timestamps to
|
10798
|
+
// avoid race conditions.
|
10799
|
+
data = _c.sent();
|
10800
|
+
// Check if other mutations have occurred since we've started this mutation.
|
10801
|
+
// If there's a race we don't update cache or broadcast the change,
|
10802
|
+
// just return the data.
|
10803
|
+
if (beforeMutationTs !== MUTATION_TS[key]) {
|
10804
|
+
if (error)
|
10805
|
+
throw error;
|
10806
|
+
return [2 /*return*/, data];
|
10807
|
+
}
|
10808
|
+
return [3 /*break*/, 3];
|
10809
|
+
case 2:
|
10810
|
+
data = _data;
|
10811
|
+
_c.label = 3;
|
10812
|
+
case 3:
|
10813
|
+
// Only update cached data if there's no error. Data can be `undefined` here.
|
10814
|
+
if (!error) {
|
10815
|
+
cache.set(key, data);
|
10816
|
+
}
|
10817
|
+
// Always update or reset the error.
|
10818
|
+
cache.set(keyErr, error);
|
10819
|
+
// Reset the timestamp to mark the mutation has ended.
|
10820
|
+
MUTATION_END_TS[key] = getTimestamp();
|
10821
|
+
return [4 /*yield*/, broadcastState(cache, key, data, error, UNDEFINED, revalidate)
|
10822
|
+
// Throw error or return data
|
10823
|
+
];
|
10824
|
+
case 4:
|
10825
|
+
res = _c.sent();
|
10826
|
+
// Throw error or return data
|
10827
|
+
if (error)
|
10828
|
+
throw error;
|
10829
|
+
return [2 /*return*/, res];
|
10830
|
+
}
|
10831
|
+
});
|
10832
|
+
});
|
10833
|
+
};
|
10834
|
+
|
10835
|
+
var revalidateAllKeys = function (revalidators, type) {
|
10836
|
+
for (var key in revalidators) {
|
10837
|
+
if (revalidators[key][0])
|
10838
|
+
revalidators[key][0](type);
|
10839
|
+
}
|
10840
|
+
};
|
10841
|
+
var initCache = function (provider, options) {
|
10842
|
+
// The global state for a specific provider will be used to deduplicate
|
10843
|
+
// requests and store listeners. As well as a mutate function that bound to
|
10844
|
+
// the cache.
|
10845
|
+
// Provider's global state might be already initialized. Let's try to get the
|
10846
|
+
// global state associated with the provider first.
|
10847
|
+
if (!SWRGlobalState.has(provider)) {
|
10848
|
+
var opts = mergeObjects(defaultConfigOptions, options);
|
10849
|
+
// If there's no global state bound to the provider, create a new one with the
|
10850
|
+
// new mutate function.
|
10851
|
+
var EVENT_REVALIDATORS = {};
|
10852
|
+
var mutate = internalMutate.bind(UNDEFINED, provider);
|
10853
|
+
var unmount = noop;
|
10854
|
+
// Update the state if it's new, or the provider has been extended.
|
10855
|
+
SWRGlobalState.set(provider, [
|
10856
|
+
EVENT_REVALIDATORS,
|
10857
|
+
{},
|
10858
|
+
{},
|
10859
|
+
{},
|
10860
|
+
{},
|
10861
|
+
{},
|
10862
|
+
mutate
|
10863
|
+
]);
|
10864
|
+
// This is a new provider, we need to initialize it and setup DOM events
|
10865
|
+
// listeners for `focus` and `reconnect` actions.
|
10866
|
+
if (!IS_SERVER) {
|
10867
|
+
var releaseFocus_1 = opts.initFocus(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT));
|
10868
|
+
var releaseReconnect_1 = opts.initReconnect(revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT));
|
10869
|
+
unmount = function () {
|
10870
|
+
releaseFocus_1 && releaseFocus_1();
|
10871
|
+
releaseReconnect_1 && releaseReconnect_1();
|
10872
|
+
// When un-mounting, we need to remove the cache provider from the state
|
10873
|
+
// storage too because it's a side-effect. Otherwise when re-mounting we
|
10874
|
+
// will not re-register those event listeners.
|
10875
|
+
SWRGlobalState.delete(provider);
|
10876
|
+
};
|
10877
|
+
}
|
10878
|
+
// We might want to inject an extra layer on top of `provider` in the future,
|
10879
|
+
// such as key serialization, auto GC, etc.
|
10880
|
+
// For now, it's just a `Map` interface without any modifications.
|
10881
|
+
return [provider, mutate, unmount];
|
10882
|
+
}
|
10883
|
+
return [provider, SWRGlobalState.get(provider)[6]];
|
10884
|
+
};
|
10885
|
+
|
10886
|
+
// error retry
|
10887
|
+
var onErrorRetry = function (_, __, config, revalidate, opts) {
|
10888
|
+
if (!preset.isVisible()) {
|
10889
|
+
// If it's hidden, stop. It will auto revalidate when refocusing.
|
10890
|
+
return;
|
10891
|
+
}
|
10892
|
+
var maxRetryCount = config.errorRetryCount;
|
10893
|
+
var currentRetryCount = opts.retryCount;
|
10894
|
+
// Exponential backoff
|
10895
|
+
var timeout = ~~((Math.random() + 0.5) *
|
10896
|
+
(1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;
|
10897
|
+
if (!isUndefined$1(maxRetryCount) && currentRetryCount > maxRetryCount) {
|
10898
|
+
return;
|
10899
|
+
}
|
10900
|
+
setTimeout(revalidate, timeout, opts);
|
10901
|
+
};
|
10902
|
+
// Default cache provider
|
10903
|
+
var _a = initCache(new Map()), cache = _a[0], mutate = _a[1];
|
10904
|
+
// Default config
|
10905
|
+
var defaultConfig = mergeObjects({
|
10906
|
+
// events
|
10907
|
+
onLoadingSlow: noop,
|
10908
|
+
onSuccess: noop,
|
10909
|
+
onError: noop,
|
10910
|
+
onErrorRetry: onErrorRetry,
|
10911
|
+
onDiscarded: noop,
|
10912
|
+
// switches
|
10913
|
+
revalidateOnFocus: true,
|
10914
|
+
revalidateOnReconnect: true,
|
10915
|
+
revalidateIfStale: true,
|
10916
|
+
shouldRetryOnError: true,
|
10917
|
+
// timeouts
|
10918
|
+
errorRetryInterval: slowConnection ? 10000 : 5000,
|
10919
|
+
focusThrottleInterval: 5 * 1000,
|
10920
|
+
dedupingInterval: 2 * 1000,
|
10921
|
+
loadingTimeout: slowConnection ? 5000 : 3000,
|
10922
|
+
// providers
|
10923
|
+
compare: function (currentData, newData) {
|
10924
|
+
return stableHash(currentData) == stableHash(newData);
|
10925
|
+
},
|
10926
|
+
isPaused: function () { return false; },
|
10927
|
+
cache: cache,
|
10928
|
+
mutate: mutate,
|
10929
|
+
fallback: {}
|
10930
|
+
},
|
10931
|
+
// use web preset by default
|
10932
|
+
preset);
|
10933
|
+
|
10934
|
+
var mergeConfigs$1 = function (a, b) {
|
10935
|
+
// Need to create a new object to avoid mutating the original here.
|
10936
|
+
var v = mergeObjects(a, b);
|
10937
|
+
// If two configs are provided, merge their `use` and `fallback` options.
|
10938
|
+
if (b) {
|
10939
|
+
var u1 = a.use, f1 = a.fallback;
|
10940
|
+
var u2 = b.use, f2 = b.fallback;
|
10941
|
+
if (u1 && u2) {
|
10942
|
+
v.use = u1.concat(u2);
|
10943
|
+
}
|
10944
|
+
if (f1 && f2) {
|
10945
|
+
v.fallback = mergeObjects(f1, f2);
|
10946
|
+
}
|
10947
|
+
}
|
10948
|
+
return v;
|
10949
|
+
};
|
10950
|
+
|
10951
|
+
var SWRConfigContext = React.createContext({});
|
10952
|
+
var SWRConfig$1 = function (props) {
|
10953
|
+
var value = props.value;
|
10954
|
+
// Extend parent context values and middleware.
|
10955
|
+
var extendedConfig = mergeConfigs$1(React.useContext(SWRConfigContext), value);
|
10956
|
+
// Should not use the inherited provider.
|
10957
|
+
var provider = value && value.provider;
|
10958
|
+
// Use a lazy initialized state to create the cache on first access.
|
10959
|
+
var cacheContext = React.useState(function () {
|
10960
|
+
return provider
|
10961
|
+
? initCache(provider(extendedConfig.cache || cache), value)
|
10962
|
+
: UNDEFINED;
|
10963
|
+
})[0];
|
10964
|
+
// Override the cache if a new provider is given.
|
10965
|
+
if (cacheContext) {
|
10966
|
+
extendedConfig.cache = cacheContext[0];
|
10967
|
+
extendedConfig.mutate = cacheContext[1];
|
10968
|
+
}
|
10969
|
+
// Unsubscribe events.
|
10970
|
+
useIsomorphicLayoutEffect(function () { return (cacheContext ? cacheContext[2] : UNDEFINED); }, []);
|
10971
|
+
return React.createElement(SWRConfigContext.Provider, mergeObjects(props, {
|
10972
|
+
value: extendedConfig
|
10973
|
+
}));
|
10974
|
+
};
|
10975
|
+
var SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'default', {
|
10976
|
+
value: defaultConfig
|
10977
|
+
});
|
10978
|
+
|
10979
|
+
var zhCN = {
|
10980
|
+
moneySymbol: '¥',
|
10981
|
+
form: {
|
10982
|
+
lightFilter: {
|
10983
|
+
more: '更多筛选',
|
10984
|
+
clear: '清除',
|
10985
|
+
confirm: '确认',
|
10986
|
+
itemUnit: '项'
|
10987
|
+
}
|
10988
|
+
},
|
10989
|
+
tableForm: {
|
10990
|
+
search: '查询',
|
10991
|
+
reset: '重置',
|
10992
|
+
submit: '提交',
|
10993
|
+
collapsed: '展开',
|
10994
|
+
expand: '收起',
|
10995
|
+
inputPlaceholder: '请输入',
|
10996
|
+
selectPlaceholder: '请选择'
|
10997
|
+
},
|
10998
|
+
alert: {
|
10999
|
+
clear: '取消选择',
|
11000
|
+
selected: '已选择',
|
11001
|
+
item: '项'
|
11002
|
+
},
|
11003
|
+
pagination: {
|
11004
|
+
total: {
|
11005
|
+
range: '第',
|
11006
|
+
total: '条/总共',
|
11007
|
+
item: '条'
|
11008
|
+
}
|
11009
|
+
},
|
11010
|
+
tableToolBar: {
|
11011
|
+
leftPin: '固定在列首',
|
11012
|
+
rightPin: '固定在列尾',
|
11013
|
+
noPin: '不固定',
|
11014
|
+
leftFixedTitle: '固定在左侧',
|
11015
|
+
rightFixedTitle: '固定在右侧',
|
11016
|
+
noFixedTitle: '不固定',
|
11017
|
+
reset: '重置',
|
11018
|
+
columnDisplay: '列展示',
|
11019
|
+
columnSetting: '列设置',
|
11020
|
+
fullScreen: '全屏',
|
11021
|
+
exitFullScreen: '退出全屏',
|
11022
|
+
reload: '刷新',
|
11023
|
+
density: '密度',
|
11024
|
+
densityDefault: '正常',
|
11025
|
+
densityLarger: '默认',
|
11026
|
+
densityMiddle: '中等',
|
11027
|
+
densitySmall: '紧凑'
|
11028
|
+
},
|
11029
|
+
editableTable: {
|
11030
|
+
action: {
|
11031
|
+
save: '保存',
|
11032
|
+
cancel: '取消',
|
11033
|
+
delete: '删除'
|
11034
|
+
}
|
11035
|
+
},
|
11036
|
+
switch: {
|
11037
|
+
open: '打开',
|
11038
|
+
close: '关闭'
|
11039
|
+
},
|
11040
|
+
loginForm: {
|
11041
|
+
submitText: '登录'
|
11042
|
+
}
|
11043
|
+
};
|
11044
|
+
|
11045
|
+
function get$3(source, path, defaultValue) {
|
11046
|
+
// a[3].b -> a.3.b
|
11047
|
+
var paths = path.replace(/\[(\d+)\]/g, '.$1').split('.');
|
11048
|
+
var result = source;
|
11049
|
+
var message = defaultValue; // eslint-disable-next-line no-restricted-syntax
|
11050
|
+
|
11051
|
+
var _iterator = _createForOfIteratorHelper$1(paths),
|
11052
|
+
_step;
|
11053
|
+
|
11054
|
+
try {
|
11055
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
11056
|
+
var p = _step.value;
|
11057
|
+
message = Object(result)[p];
|
11058
|
+
result = Object(result)[p];
|
11059
|
+
|
11060
|
+
if (message === undefined) {
|
11061
|
+
return defaultValue;
|
11062
|
+
}
|
11063
|
+
}
|
11064
|
+
} catch (err) {
|
11065
|
+
_iterator.e(err);
|
11066
|
+
} finally {
|
11067
|
+
_iterator.f();
|
11068
|
+
}
|
11069
|
+
|
11070
|
+
return message;
|
11071
|
+
}
|
11072
|
+
/**
|
11073
|
+
* 创建一个操作函数
|
11074
|
+
*
|
11075
|
+
* @param locale
|
11076
|
+
* @param localeMap
|
11077
|
+
*/
|
11078
|
+
|
11079
|
+
|
11080
|
+
var createIntl = function createIntl(locale, localeMap) {
|
11081
|
+
return {
|
11082
|
+
getMessage: function getMessage(id, defaultMessage) {
|
11083
|
+
return get$3(localeMap, id, defaultMessage) || defaultMessage;
|
11084
|
+
},
|
11085
|
+
locale: locale
|
11086
|
+
};
|
11087
|
+
};
|
11088
|
+
var zhCNIntl = createIntl('zh_CN', zhCN);
|
11089
|
+
var ConfigContext = /*#__PURE__*/React__default['default'].createContext({
|
11090
|
+
intl: _objectSpread2$1(_objectSpread2$1({}, zhCNIntl), {}, {
|
11091
|
+
locale: 'default'
|
11092
|
+
}),
|
11093
|
+
valueTypeMap: {}
|
11094
|
+
});
|
11095
|
+
var ConfigConsumer = ConfigContext.Consumer,
|
11096
|
+
ConfigProvider = ConfigContext.Provider;
|
11097
|
+
|
11098
|
+
var _excluded$g = ["columns", "extraColumns", "request", "modalFormSearch", "tableAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "optionColumnConfig"],
|
10189
11099
|
_excluded2$3 = ["actionMethod"];
|
10190
11100
|
|
10191
11101
|
var TabelCard = function TabelCard(props, ref) {
|
@@ -10200,7 +11110,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10200
11110
|
onFormChange = props.onFormChange,
|
10201
11111
|
modalConfig = props.modalConfig,
|
10202
11112
|
optionColumnConfig = props.optionColumnConfig,
|
10203
|
-
extraProps = _objectWithoutProperties(props, _excluded$
|
11113
|
+
extraProps = _objectWithoutProperties(props, _excluded$g);
|
10204
11114
|
|
10205
11115
|
var actionRef = React.useRef();
|
10206
11116
|
var formRef = React.useRef(null);
|
@@ -10529,6 +11439,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10529
11439
|
}
|
10530
11440
|
});
|
10531
11441
|
}, [actionRef]);
|
11442
|
+
var values = React.useContext(ConfigContext);
|
10532
11443
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ModalForm$1, _objectSpread2(_objectSpread2({
|
10533
11444
|
ref: formRef,
|
10534
11445
|
title: modalFormConfig.type || '新增',
|
@@ -10583,7 +11494,25 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10583
11494
|
|
10584
11495
|
return true;
|
10585
11496
|
})
|
10586
|
-
})), /*#__PURE__*/React__default['default'].createElement(
|
11497
|
+
})), /*#__PURE__*/React__default['default'].createElement(ConfigContext.Provider, {
|
11498
|
+
value: _objectSpread2(_objectSpread2({}, values), {}, {
|
11499
|
+
valueTypeMap: {
|
11500
|
+
treeSelect: {
|
11501
|
+
render: function render(text) {
|
11502
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, text);
|
11503
|
+
},
|
11504
|
+
renderFormItem: function renderFormItem(text, props) {
|
11505
|
+
return /*#__PURE__*/React__default['default'].createElement(Index$5, _objectSpread2({
|
11506
|
+
request: props.request,
|
11507
|
+
showSearch: true,
|
11508
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
11509
|
+
allowClear: true
|
11510
|
+
}, props === null || props === void 0 ? void 0 : props.fieldProps));
|
11511
|
+
}
|
11512
|
+
}
|
11513
|
+
}
|
11514
|
+
})
|
11515
|
+
}, /*#__PURE__*/React__default['default'].createElement(ProTable__default['default'], _objectSpread2({
|
10587
11516
|
actionRef: actionRef,
|
10588
11517
|
rowKey: "id",
|
10589
11518
|
bordered: true,
|
@@ -10624,7 +11553,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
10624
11553
|
pagination: {
|
10625
11554
|
pageSize: 20
|
10626
11555
|
}
|
10627
|
-
}, extraProps)));
|
11556
|
+
}, extraProps))));
|
10628
11557
|
};
|
10629
11558
|
|
10630
11559
|
var index$1 = /*#__PURE__*/React__default['default'].forwardRef(TabelCard);
|
@@ -10633,6 +11562,7 @@ exports.AutoScroll = Index$9;
|
|
10633
11562
|
exports.Breadcrumb = Index$b;
|
10634
11563
|
exports.Button = WButton;
|
10635
11564
|
exports.Card = Index$c;
|
11565
|
+
exports.Cascader = WCascader;
|
10636
11566
|
exports.Checkbox = Index$4;
|
10637
11567
|
exports.CountUp = Index$8;
|
10638
11568
|
exports.DatePicker = Index$2;
|