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