seeder-st2110-components 1.7.2 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1557 -277
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1558 -277
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5,15 +5,15 @@ import { useWebSocket, useInterval } from 'ahooks';
|
|
|
5
5
|
import { LoadingOutlined, ExclamationCircleFilled, PlusOutlined } from '@ant-design/icons';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
|
|
8
|
-
function _defineProperty(e, r, t) {
|
|
9
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
8
|
+
function _defineProperty$1(e, r, t) {
|
|
9
|
+
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
10
10
|
value: t,
|
|
11
11
|
enumerable: !0,
|
|
12
12
|
configurable: !0,
|
|
13
13
|
writable: !0
|
|
14
14
|
}) : e[r] = t, e;
|
|
15
15
|
}
|
|
16
|
-
function ownKeys(e, r) {
|
|
16
|
+
function ownKeys$1(e, r) {
|
|
17
17
|
var t = Object.keys(e);
|
|
18
18
|
if (Object.getOwnPropertySymbols) {
|
|
19
19
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -23,29 +23,29 @@ function ownKeys(e, r) {
|
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
}
|
|
26
|
-
function _objectSpread2(e) {
|
|
26
|
+
function _objectSpread2$1(e) {
|
|
27
27
|
for (var r = 1; r < arguments.length; r++) {
|
|
28
28
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
29
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
30
|
-
_defineProperty(e, r, t[r]);
|
|
31
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
29
|
+
r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {
|
|
30
|
+
_defineProperty$1(e, r, t[r]);
|
|
31
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {
|
|
32
32
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
return e;
|
|
36
36
|
}
|
|
37
|
-
function _objectWithoutProperties(e, t) {
|
|
37
|
+
function _objectWithoutProperties$1(e, t) {
|
|
38
38
|
if (null == e) return {};
|
|
39
39
|
var o,
|
|
40
40
|
r,
|
|
41
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
41
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
42
42
|
if (Object.getOwnPropertySymbols) {
|
|
43
43
|
var n = Object.getOwnPropertySymbols(e);
|
|
44
44
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
45
45
|
}
|
|
46
46
|
return i;
|
|
47
47
|
}
|
|
48
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
48
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
49
49
|
if (null == r) return {};
|
|
50
50
|
var t = {};
|
|
51
51
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -54,7 +54,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
54
54
|
}
|
|
55
55
|
return t;
|
|
56
56
|
}
|
|
57
|
-
function _toPrimitive(t, r) {
|
|
57
|
+
function _toPrimitive$1(t, r) {
|
|
58
58
|
if ("object" != typeof t || !t) return t;
|
|
59
59
|
var e = t[Symbol.toPrimitive];
|
|
60
60
|
if (void 0 !== e) {
|
|
@@ -64,8 +64,8 @@ function _toPrimitive(t, r) {
|
|
|
64
64
|
}
|
|
65
65
|
return ("string" === r ? String : Number)(t);
|
|
66
66
|
}
|
|
67
|
-
function _toPropertyKey(t) {
|
|
68
|
-
var i = _toPrimitive(t, "string");
|
|
67
|
+
function _toPropertyKey$1(t) {
|
|
68
|
+
var i = _toPrimitive$1(t, "string");
|
|
69
69
|
return "symbol" == typeof i ? i : i + "";
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -112,7 +112,7 @@ const useHardwareWebSocket = socketUrl => {
|
|
|
112
112
|
const handleMessage = useCallback(message => {
|
|
113
113
|
try {
|
|
114
114
|
if (message) {
|
|
115
|
-
setSystemStatus(prev => _objectSpread2(_objectSpread2({}, prev), message));
|
|
115
|
+
setSystemStatus(prev => _objectSpread2$1(_objectSpread2$1({}, prev), message));
|
|
116
116
|
}
|
|
117
117
|
} catch (error) {
|
|
118
118
|
console.error('Message processing error:', error);
|
|
@@ -207,7 +207,7 @@ const getItems = details => {
|
|
|
207
207
|
items.push(createMetricItem('CPU Temperature', 'seeder-icon-CPUwendu', details.cpu_temp, '℃'));
|
|
208
208
|
}
|
|
209
209
|
if (details.mem_usage !== null && details.mem_usage !== undefined) {
|
|
210
|
-
items.push(_objectSpread2(_objectSpread2({}, createMetricItem('Memory Usage', 'seeder-icon-shiyongshuai', details.mem_usage, '%')), {}, {
|
|
210
|
+
items.push(_objectSpread2$1(_objectSpread2$1({}, createMetricItem('Memory Usage', 'seeder-icon-shiyongshuai', details.mem_usage, '%')), {}, {
|
|
211
211
|
memTotal: details.mem_total
|
|
212
212
|
}));
|
|
213
213
|
}
|
|
@@ -251,15 +251,15 @@ const useHardwareUsage = socketUrl => {
|
|
|
251
251
|
};
|
|
252
252
|
var useHardwareUsage$1 = useHardwareUsage;
|
|
253
253
|
|
|
254
|
-
const _excluded$
|
|
255
|
-
const StyledModal = props => {
|
|
254
|
+
const _excluded$3 = ["width", "okText", "cancelText", "styles"];
|
|
255
|
+
const StyledModal$2 = props => {
|
|
256
256
|
const {
|
|
257
257
|
width = "520px",
|
|
258
258
|
okText = "Apply",
|
|
259
259
|
cancelText = "Close",
|
|
260
260
|
styles: propStyles = {}
|
|
261
261
|
} = props,
|
|
262
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
262
|
+
restProps = _objectWithoutProperties$1(props, _excluded$3);
|
|
263
263
|
|
|
264
264
|
// 基础样式配置
|
|
265
265
|
const baseStyles = {
|
|
@@ -287,15 +287,15 @@ const StyledModal = props => {
|
|
|
287
287
|
};
|
|
288
288
|
|
|
289
289
|
// 合并样式
|
|
290
|
-
const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
|
|
291
|
-
return /*#__PURE__*/jsx(Modal, _objectSpread2({
|
|
290
|
+
const styles = _objectSpread2$1(_objectSpread2$1({}, baseStyles), propStyles);
|
|
291
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread2$1({
|
|
292
292
|
width: width,
|
|
293
293
|
okText: okText,
|
|
294
294
|
cancelText: cancelText,
|
|
295
295
|
styles: styles
|
|
296
296
|
}, restProps));
|
|
297
297
|
};
|
|
298
|
-
var StyledModal$
|
|
298
|
+
var StyledModal$3 = StyledModal$2;
|
|
299
299
|
|
|
300
300
|
const AuthorizationModal = _ref => {
|
|
301
301
|
let {
|
|
@@ -335,7 +335,7 @@ const AuthorizationModal = _ref => {
|
|
|
335
335
|
showIcon: true
|
|
336
336
|
});
|
|
337
337
|
const defaultOkText = isActivated ? "Reactivate" : "Activate Now";
|
|
338
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
338
|
+
return /*#__PURE__*/jsx(StyledModal$3, {
|
|
339
339
|
title: title,
|
|
340
340
|
width: width,
|
|
341
341
|
open: true,
|
|
@@ -830,6 +830,70 @@ const useSystemOperations = function () {
|
|
|
830
830
|
};
|
|
831
831
|
var useSystemOperations$1 = useSystemOperations;
|
|
832
832
|
|
|
833
|
+
const usePageReload = () => {
|
|
834
|
+
const [reloading, setReloading] = useState(false);
|
|
835
|
+
const startReload = useCallback(function () {
|
|
836
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 800;
|
|
837
|
+
if (reloading) return; // 防止重复触发
|
|
838
|
+
|
|
839
|
+
// 显示遮罩
|
|
840
|
+
setReloading(true);
|
|
841
|
+
|
|
842
|
+
// 设置背景色
|
|
843
|
+
document.body.style.backgroundColor = '#282828';
|
|
844
|
+
document.body.style.transition = 'background-color 0.1s';
|
|
845
|
+
document.body.offsetHeight;
|
|
846
|
+
|
|
847
|
+
// 延迟刷新
|
|
848
|
+
const timer = setTimeout(() => {
|
|
849
|
+
window.location.reload();
|
|
850
|
+
}, delay);
|
|
851
|
+
|
|
852
|
+
// 清理函数(防止内存泄漏)
|
|
853
|
+
return () => clearTimeout(timer);
|
|
854
|
+
}, [reloading]);
|
|
855
|
+
const ReloadOverlay = () => {
|
|
856
|
+
if (!reloading) return null;
|
|
857
|
+
return /*#__PURE__*/jsxs("div", {
|
|
858
|
+
style: {
|
|
859
|
+
position: 'fixed',
|
|
860
|
+
top: 0,
|
|
861
|
+
left: 0,
|
|
862
|
+
right: 0,
|
|
863
|
+
bottom: 0,
|
|
864
|
+
backgroundColor: '#282828',
|
|
865
|
+
display: 'flex',
|
|
866
|
+
flexDirection: 'column',
|
|
867
|
+
alignItems: 'center',
|
|
868
|
+
justifyContent: 'center',
|
|
869
|
+
zIndex: 999999,
|
|
870
|
+
color: 'white'
|
|
871
|
+
},
|
|
872
|
+
children: [/*#__PURE__*/jsx(Spin, {
|
|
873
|
+
size: "large"
|
|
874
|
+
}), /*#__PURE__*/jsx("div", {
|
|
875
|
+
style: {
|
|
876
|
+
marginTop: 20,
|
|
877
|
+
fontSize: 16
|
|
878
|
+
},
|
|
879
|
+
children: "Loading preset configuration..."
|
|
880
|
+
}), /*#__PURE__*/jsx("div", {
|
|
881
|
+
style: {
|
|
882
|
+
marginTop: 10,
|
|
883
|
+
fontSize: 12,
|
|
884
|
+
color: '#aaa'
|
|
885
|
+
},
|
|
886
|
+
children: "Page will refresh shortly"
|
|
887
|
+
})]
|
|
888
|
+
});
|
|
889
|
+
};
|
|
890
|
+
return {
|
|
891
|
+
startReload,
|
|
892
|
+
ReloadOverlay
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
var usePageReload$1 = usePageReload;
|
|
896
|
+
|
|
833
897
|
const NetworkFieldGroup = _ref => {
|
|
834
898
|
var _fieldConfig$netmask$, _fieldConfig$netmask;
|
|
835
899
|
let {
|
|
@@ -852,7 +916,7 @@ const NetworkFieldGroup = _ref => {
|
|
|
852
916
|
enabled: true
|
|
853
917
|
}
|
|
854
918
|
};
|
|
855
|
-
const mergedFieldConfig = _objectSpread2(_objectSpread2(_objectSpread2({}, defaultFieldConfig), fieldConfig), {}, {
|
|
919
|
+
const mergedFieldConfig = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, defaultFieldConfig), fieldConfig), {}, {
|
|
856
920
|
netmask: {
|
|
857
921
|
label: "Netmask",
|
|
858
922
|
enabled: (_fieldConfig$netmask$ = (_fieldConfig$netmask = fieldConfig.netmask) === null || _fieldConfig$netmask === void 0 ? void 0 : _fieldConfig$netmask.enabled) !== null && _fieldConfig$netmask$ !== void 0 ? _fieldConfig$netmask$ : defaultFieldConfig.netmask.enabled // 合并 enabled
|
|
@@ -928,18 +992,18 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
928
992
|
hasInitialized: false
|
|
929
993
|
});
|
|
930
994
|
const preparedFieldConfig = useMemo(() => {
|
|
931
|
-
const config = _objectSpread2({}, fieldConfig);
|
|
995
|
+
const config = _objectSpread2$1({}, fieldConfig);
|
|
932
996
|
|
|
933
997
|
// 确保LAN和QSFP的配置存在
|
|
934
998
|
config.LAN = config.LAN || {};
|
|
935
999
|
config.QSFP = config.QSFP || {};
|
|
936
1000
|
if (sections.includes('LAN')) {
|
|
937
|
-
config.LAN.netmask = _objectSpread2(_objectSpread2({}, config.LAN.netmask || {}), {}, {
|
|
1001
|
+
config.LAN.netmask = _objectSpread2$1(_objectSpread2$1({}, config.LAN.netmask || {}), {}, {
|
|
938
1002
|
enabled: showNetmask.LAN
|
|
939
1003
|
});
|
|
940
1004
|
}
|
|
941
1005
|
if (sections.includes('QSFP')) {
|
|
942
|
-
config.QSFP.netmask = _objectSpread2(_objectSpread2({}, config.QSFP.netmask || {}), {}, {
|
|
1006
|
+
config.QSFP.netmask = _objectSpread2$1(_objectSpread2$1({}, config.QSFP.netmask || {}), {}, {
|
|
943
1007
|
enabled: showNetmask.QSFP
|
|
944
1008
|
});
|
|
945
1009
|
}
|
|
@@ -1009,7 +1073,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1009
1073
|
const initialValues = useMemo(() => {
|
|
1010
1074
|
const values = {};
|
|
1011
1075
|
if (sections.includes('LAN') && lanConfigs.length > 0) {
|
|
1012
|
-
values.LAN = lanConfigs.map(config => _objectSpread2({
|
|
1076
|
+
values.LAN = lanConfigs.map(config => _objectSpread2$1({
|
|
1013
1077
|
connection_id: config.connection_id,
|
|
1014
1078
|
display_name: config.display_name,
|
|
1015
1079
|
ip_address: config.ip_address
|
|
@@ -1018,7 +1082,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1018
1082
|
} : {}));
|
|
1019
1083
|
}
|
|
1020
1084
|
if (sections.includes('QSFP') && st2110Interfaces.length > 0) {
|
|
1021
|
-
values.QSFP = st2110Interfaces.map(iface => _objectSpread2(_objectSpread2({}, iface.id !== undefined && {
|
|
1085
|
+
values.QSFP = st2110Interfaces.map(iface => _objectSpread2$1(_objectSpread2$1({}, iface.id !== undefined && {
|
|
1022
1086
|
id: iface.id
|
|
1023
1087
|
}), {}, {
|
|
1024
1088
|
display_name: iface.display_name,
|
|
@@ -1087,7 +1151,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1087
1151
|
if (sections.includes('LAN') && values.LAN) {
|
|
1088
1152
|
const lanData = values.LAN.map((item, index) => {
|
|
1089
1153
|
var _lanConfigs$index;
|
|
1090
|
-
return _objectSpread2({
|
|
1154
|
+
return _objectSpread2$1({
|
|
1091
1155
|
connection_id: (_lanConfigs$index = lanConfigs[index]) === null || _lanConfigs$index === void 0 ? void 0 : _lanConfigs$index.connection_id,
|
|
1092
1156
|
ip_address: item.ip_address
|
|
1093
1157
|
}, showNetmask.LAN ? {
|
|
@@ -1101,7 +1165,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1101
1165
|
if (sections.includes('QSFP') && values.QSFP) {
|
|
1102
1166
|
const interfacesData = values.QSFP.map((item, index) => {
|
|
1103
1167
|
var _st2110Interfaces$ind, _st2110Interfaces$ind2, _st2110Interfaces$ind3;
|
|
1104
|
-
return _objectSpread2(_objectSpread2(_objectSpread2({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
|
|
1168
|
+
return _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
|
|
1105
1169
|
id: st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind2 = st2110Interfaces[index]) === null || _st2110Interfaces$ind2 === void 0 ? void 0 : _st2110Interfaces$ind2.id
|
|
1106
1170
|
}), (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind3 = st2110Interfaces[index]) === null || _st2110Interfaces$ind3 === void 0 ? void 0 : _st2110Interfaces$ind3.ip) !== undefined ? {
|
|
1107
1171
|
ip: item.ip_address
|
|
@@ -1133,7 +1197,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1133
1197
|
}, [form, sections, lanConfigs, st2110Interfaces, updateLanConfig, updateSysConfig, handleSuccess]);
|
|
1134
1198
|
|
|
1135
1199
|
// 合并默认模态框属性和传入的属性
|
|
1136
|
-
const mergedModalProps = _objectSpread2({
|
|
1200
|
+
const mergedModalProps = _objectSpread2$1({
|
|
1137
1201
|
title: "Network Settings",
|
|
1138
1202
|
width: 650,
|
|
1139
1203
|
open,
|
|
@@ -1148,7 +1212,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1148
1212
|
}, modalProps);
|
|
1149
1213
|
|
|
1150
1214
|
// 合并默认表单属性和传入的属性
|
|
1151
|
-
const mergedFormProps = _objectSpread2({
|
|
1215
|
+
const mergedFormProps = _objectSpread2$1({
|
|
1152
1216
|
form: form,
|
|
1153
1217
|
labelCol: {
|
|
1154
1218
|
span: 6
|
|
@@ -1158,8 +1222,8 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1158
1222
|
},
|
|
1159
1223
|
autoComplete: "off"
|
|
1160
1224
|
}, formProps);
|
|
1161
|
-
return /*#__PURE__*/jsxs(StyledModal$
|
|
1162
|
-
children: [/*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
1225
|
+
return /*#__PURE__*/jsxs(StyledModal$3, _objectSpread2$1(_objectSpread2$1({}, mergedModalProps), {}, {
|
|
1226
|
+
children: [/*#__PURE__*/jsxs(Form, _objectSpread2$1(_objectSpread2$1({}, mergedFormProps), {}, {
|
|
1163
1227
|
children: [sections.includes('LAN') && lanConfigs.length > 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
1164
1228
|
children: [/*#__PURE__*/jsx(NetworkFieldGroup, {
|
|
1165
1229
|
prefix: "LAN",
|
|
@@ -1281,7 +1345,7 @@ function convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder) {
|
|
|
1281
1345
|
formType: 'text'
|
|
1282
1346
|
};
|
|
1283
1347
|
const value = ptpStatus[key];
|
|
1284
|
-
return _objectSpread2(_objectSpread2({
|
|
1348
|
+
return _objectSpread2$1(_objectSpread2$1({
|
|
1285
1349
|
key,
|
|
1286
1350
|
value
|
|
1287
1351
|
}, config), {}, {
|
|
@@ -1393,7 +1457,7 @@ const PtpModal = _ref => {
|
|
|
1393
1457
|
if (!open || !ptpStatus) return null;
|
|
1394
1458
|
|
|
1395
1459
|
// 合并默认模态框属性和传入的属性
|
|
1396
|
-
const mergedModalProps = _objectSpread2({
|
|
1460
|
+
const mergedModalProps = _objectSpread2$1({
|
|
1397
1461
|
title: "PTP",
|
|
1398
1462
|
width: 650,
|
|
1399
1463
|
open,
|
|
@@ -1405,7 +1469,7 @@ const PtpModal = _ref => {
|
|
|
1405
1469
|
}, modalProps);
|
|
1406
1470
|
|
|
1407
1471
|
// 合并默认表单属性和传入的属性
|
|
1408
|
-
const mergedFormProps = _objectSpread2({
|
|
1472
|
+
const mergedFormProps = _objectSpread2$1({
|
|
1409
1473
|
form: form,
|
|
1410
1474
|
name: "ptpForm",
|
|
1411
1475
|
labelCol: {
|
|
@@ -1416,8 +1480,8 @@ const PtpModal = _ref => {
|
|
|
1416
1480
|
},
|
|
1417
1481
|
autoComplete: "off"
|
|
1418
1482
|
}, formProps);
|
|
1419
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
1420
|
-
children: /*#__PURE__*/jsx(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
1483
|
+
return /*#__PURE__*/jsx(StyledModal$3, _objectSpread2$1(_objectSpread2$1({}, mergedModalProps), {}, {
|
|
1484
|
+
children: /*#__PURE__*/jsx(Form, _objectSpread2$1(_objectSpread2$1({}, mergedFormProps), {}, {
|
|
1421
1485
|
children: ptpStatusArray.map(item => /*#__PURE__*/jsx(Form.Item, {
|
|
1422
1486
|
label: item.label,
|
|
1423
1487
|
name: item.key,
|
|
@@ -1612,7 +1676,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1612
1676
|
return fields.category_list.options.map(category => {
|
|
1613
1677
|
const isInitiallySelected = initialSelected.includes(category.name);
|
|
1614
1678
|
const shouldDisable = isSavedPreset ? !isInitiallySelected : false;
|
|
1615
|
-
return _objectSpread2(_objectSpread2({}, category), {}, {
|
|
1679
|
+
return _objectSpread2$1(_objectSpread2$1({}, category), {}, {
|
|
1616
1680
|
disabled: shouldDisable,
|
|
1617
1681
|
initiallySelected: isInitiallySelected
|
|
1618
1682
|
});
|
|
@@ -1762,7 +1826,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1762
1826
|
}) :
|
|
1763
1827
|
/*#__PURE__*/
|
|
1764
1828
|
// 非编辑模式下的按钮
|
|
1765
|
-
jsx(SubmitButton, _objectSpread2(_objectSpread2({
|
|
1829
|
+
jsx(SubmitButton, _objectSpread2$1(_objectSpread2$1({
|
|
1766
1830
|
action: handleLoad
|
|
1767
1831
|
}, hasCategoryList && {
|
|
1768
1832
|
disabled: !currentSelected.length
|
|
@@ -1827,8 +1891,8 @@ const Preset = _ref => {
|
|
|
1827
1891
|
enableEdit = true
|
|
1828
1892
|
} = _ref;
|
|
1829
1893
|
const {
|
|
1830
|
-
message
|
|
1831
|
-
modal
|
|
1894
|
+
message,
|
|
1895
|
+
modal
|
|
1832
1896
|
} = App.useApp();
|
|
1833
1897
|
const [presetList, setPresetList] = useState([]);
|
|
1834
1898
|
const [selectedPreset, setSelectedPreset] = useState(null);
|
|
@@ -1861,7 +1925,7 @@ const Preset = _ref => {
|
|
|
1861
1925
|
var _fields$category_list;
|
|
1862
1926
|
const unsavedPreset = presetList.find(item => !item.id);
|
|
1863
1927
|
if (unsavedPreset) {
|
|
1864
|
-
|
|
1928
|
+
message.warning('Existing unsaved preset detected.');
|
|
1865
1929
|
return;
|
|
1866
1930
|
}
|
|
1867
1931
|
|
|
@@ -1878,7 +1942,7 @@ const Preset = _ref => {
|
|
|
1878
1942
|
setPresetList([...presetList, newPreset]);
|
|
1879
1943
|
setSelectedPreset(newPreset);
|
|
1880
1944
|
form.setFieldsValue(newPreset);
|
|
1881
|
-
}, [form, presetList,
|
|
1945
|
+
}, [form, presetList, message]);
|
|
1882
1946
|
const handleRemove = useCallback(async () => {
|
|
1883
1947
|
if (!selectedPreset) return;
|
|
1884
1948
|
|
|
@@ -1886,7 +1950,7 @@ const Preset = _ref => {
|
|
|
1886
1950
|
const isUnsavedPreset = !selectedPreset.id;
|
|
1887
1951
|
const presetName = selectedPreset.name || 'Untitled Preset';
|
|
1888
1952
|
try {
|
|
1889
|
-
|
|
1953
|
+
modal.confirm({
|
|
1890
1954
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
1891
1955
|
title: 'Delete Preset',
|
|
1892
1956
|
content: "".concat(texts.deleteConfirm, " \"").concat(presetName, "\"?"),
|
|
@@ -1899,7 +1963,7 @@ const Preset = _ref => {
|
|
|
1899
1963
|
await removePreset({
|
|
1900
1964
|
id: selectedPreset.id
|
|
1901
1965
|
});
|
|
1902
|
-
|
|
1966
|
+
message.success(texts.successText);
|
|
1903
1967
|
} else {
|
|
1904
1968
|
// 移除未保存的预设
|
|
1905
1969
|
setPresetList(prev => prev.filter(item => !!item.id));
|
|
@@ -1938,59 +2002,77 @@ const Preset = _ref => {
|
|
|
1938
2002
|
} catch (error) {
|
|
1939
2003
|
console.error('Failed to delete preset:', error);
|
|
1940
2004
|
}
|
|
1941
|
-
}, [selectedPreset, form,
|
|
2005
|
+
}, [selectedPreset, form, modal, message, texts, removePreset, getPresetList]);
|
|
1942
2006
|
const handleLoadPreset = useCallback(async loadData => {
|
|
1943
2007
|
if (!loadData) return;
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
AntdModal.confirm({
|
|
2008
|
+
let resolveLoading = null;
|
|
2009
|
+
const modalInstance = modal.confirm({
|
|
1947
2010
|
title: 'Load Preset',
|
|
1948
2011
|
content: "".concat(texts.loadConfirm, " \"").concat(loadData.name, "\"?"),
|
|
1949
2012
|
cancelText: 'No',
|
|
1950
2013
|
okText: 'Yes',
|
|
1951
|
-
onOk
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2014
|
+
// onOk 返回一个 pending Promise
|
|
2015
|
+
onOk: () => {
|
|
2016
|
+
return new Promise((resolve, reject) => {
|
|
2017
|
+
resolveLoading = resolve;
|
|
2018
|
+
|
|
2019
|
+
// 立即切换为 loading 状态
|
|
2020
|
+
modalInstance.update({
|
|
2021
|
+
title: texts.loadText,
|
|
2022
|
+
content: /*#__PURE__*/jsx(Spin, {
|
|
2023
|
+
size: "large",
|
|
2024
|
+
className: "block mx-auto"
|
|
2025
|
+
}),
|
|
2026
|
+
okButtonProps: {
|
|
2027
|
+
style: {
|
|
2028
|
+
display: 'none'
|
|
2029
|
+
}
|
|
2030
|
+
},
|
|
2031
|
+
cancelButtonProps: {
|
|
2032
|
+
style: {
|
|
2033
|
+
display: 'none'
|
|
2034
|
+
}
|
|
2035
|
+
},
|
|
2036
|
+
maskClosable: false,
|
|
2037
|
+
closable: false
|
|
2038
|
+
});
|
|
1965
2039
|
});
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2040
|
+
},
|
|
2041
|
+
onCancel: () => {
|
|
2042
|
+
// 用户取消
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
|
|
2046
|
+
// 延迟执行异步操作,确保 update 生效
|
|
2047
|
+
setTimeout(async () => {
|
|
2048
|
+
try {
|
|
2049
|
+
await loadPreset(_objectSpread2$1({
|
|
2050
|
+
id: loadData.id
|
|
2051
|
+
}, loadData.category_list && {
|
|
2052
|
+
category_list: loadData.category_list
|
|
2053
|
+
}));
|
|
2054
|
+
|
|
2055
|
+
// 成功 1秒后自动关闭
|
|
2056
|
+
setTimeout(() => {
|
|
2057
|
+
var _resolveLoading;
|
|
2058
|
+
(_resolveLoading = resolveLoading) === null || _resolveLoading === void 0 || _resolveLoading();
|
|
2059
|
+
message.success(texts.successText);
|
|
2060
|
+
|
|
2061
|
+
// 加载成功的外部回调
|
|
2062
|
+
if (onLoadSuccess) {
|
|
2063
|
+
onLoadSuccess(loadData);
|
|
1989
2064
|
}
|
|
2065
|
+
}, 2000);
|
|
2066
|
+
} catch (error) {
|
|
2067
|
+
console.error('Failed to load preset:', error);
|
|
2068
|
+
modalInstance.destroy();
|
|
2069
|
+
// 加载失败的外部回调
|
|
2070
|
+
if (onLoadError) {
|
|
2071
|
+
onLoadError(error, loadData);
|
|
1990
2072
|
}
|
|
1991
2073
|
}
|
|
1992
|
-
});
|
|
1993
|
-
}, [loadPreset, texts,
|
|
2074
|
+
}, 100);
|
|
2075
|
+
}, [loadPreset, texts, message, modal, onLoadSuccess, onLoadError]);
|
|
1994
2076
|
const handleSave = useCallback(async () => {
|
|
1995
2077
|
setLoading(true);
|
|
1996
2078
|
try {
|
|
@@ -2000,7 +2082,7 @@ const Preset = _ref => {
|
|
|
2000
2082
|
// 验证预设名称
|
|
2001
2083
|
if ((_fields$name = fields.name) !== null && _fields$name !== void 0 && _fields$name.required) {
|
|
2002
2084
|
if (!values.name || values.name.trim() === '') {
|
|
2003
|
-
|
|
2085
|
+
message.error('Name is required.');
|
|
2004
2086
|
return; // 直接返回 不执行
|
|
2005
2087
|
}
|
|
2006
2088
|
}
|
|
@@ -2008,12 +2090,12 @@ const Preset = _ref => {
|
|
|
2008
2090
|
// 验证分类列表
|
|
2009
2091
|
if ((_fields$category_list2 = fields.category_list) !== null && _fields$category_list2 !== void 0 && _fields$category_list2.required) {
|
|
2010
2092
|
if (!values.category_list || values.category_list.length === 0) {
|
|
2011
|
-
|
|
2093
|
+
message.error('No category selected.');
|
|
2012
2094
|
return;
|
|
2013
2095
|
}
|
|
2014
2096
|
}
|
|
2015
2097
|
await savePreset(values);
|
|
2016
|
-
|
|
2098
|
+
message.success(texts.successText);
|
|
2017
2099
|
const savedPresetName = values.name;
|
|
2018
2100
|
|
|
2019
2101
|
// 刷新列表
|
|
@@ -2035,10 +2117,10 @@ const Preset = _ref => {
|
|
|
2035
2117
|
} finally {
|
|
2036
2118
|
setLoading(false);
|
|
2037
2119
|
}
|
|
2038
|
-
}, [form,
|
|
2120
|
+
}, [form, message, texts, savePreset, getPresetList]);
|
|
2039
2121
|
const handleUpdate = useCallback(async () => {
|
|
2040
2122
|
if (!selectedPreset || !selectedPreset.id) {
|
|
2041
|
-
|
|
2123
|
+
message.error('No preset selected or preset ID is missing.');
|
|
2042
2124
|
return;
|
|
2043
2125
|
}
|
|
2044
2126
|
setLoading(true);
|
|
@@ -2049,7 +2131,7 @@ const Preset = _ref => {
|
|
|
2049
2131
|
// 验证预设名称
|
|
2050
2132
|
if ((_fields$name2 = fields.name) !== null && _fields$name2 !== void 0 && _fields$name2.required) {
|
|
2051
2133
|
if (!values.name || values.name.trim() === '') {
|
|
2052
|
-
|
|
2134
|
+
message.error('Name is required.');
|
|
2053
2135
|
return; // 直接返回 不执行
|
|
2054
2136
|
}
|
|
2055
2137
|
}
|
|
@@ -2069,20 +2151,20 @@ const Preset = _ref => {
|
|
|
2069
2151
|
if (updatedPreset) {
|
|
2070
2152
|
setSelectedPreset(updatedPreset);
|
|
2071
2153
|
}
|
|
2072
|
-
|
|
2154
|
+
message.success(texts.successText);
|
|
2073
2155
|
} catch (error) {
|
|
2074
2156
|
console.error('Failed to update preset:', error);
|
|
2075
2157
|
throw error;
|
|
2076
2158
|
} finally {
|
|
2077
2159
|
setLoading(false);
|
|
2078
2160
|
}
|
|
2079
|
-
}, [form,
|
|
2161
|
+
}, [form, message, texts, updatePreset, selectedPreset]);
|
|
2080
2162
|
|
|
2081
2163
|
// 初始化数据
|
|
2082
2164
|
useEffect(() => {
|
|
2083
2165
|
fetchPresetList();
|
|
2084
2166
|
}, [fetchPresetList]);
|
|
2085
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
2167
|
+
return /*#__PURE__*/jsx(StyledModal$3, {
|
|
2086
2168
|
title: texts.title,
|
|
2087
2169
|
width: width,
|
|
2088
2170
|
open: open,
|
|
@@ -2165,7 +2247,7 @@ const UpgradeManager = _ref => {
|
|
|
2165
2247
|
statusPollingInterval = 1000,
|
|
2166
2248
|
children
|
|
2167
2249
|
} = _ref,
|
|
2168
|
-
dropdownProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
2250
|
+
dropdownProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
2169
2251
|
const [upgradeElement] = useUpgrade$1({
|
|
2170
2252
|
menuItems,
|
|
2171
2253
|
onMenuClick,
|
|
@@ -2181,7 +2263,7 @@ const UpgradeManager = _ref => {
|
|
|
2181
2263
|
const dropdownElement = upgradeElement.props.children[0];
|
|
2182
2264
|
const otherElements = upgradeElement.props.children.slice(1);
|
|
2183
2265
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2184
|
-
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2(_objectSpread2(_objectSpread2({}, dropdownProps), dropdownElement.props), {}, {
|
|
2266
|
+
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, dropdownProps), dropdownElement.props), {}, {
|
|
2185
2267
|
children: children
|
|
2186
2268
|
})), otherElements]
|
|
2187
2269
|
});
|
|
@@ -2196,15 +2278,15 @@ UpgradeManager.defaultProps = {
|
|
|
2196
2278
|
};
|
|
2197
2279
|
var UpgradeManager$1 = UpgradeManager;
|
|
2198
2280
|
|
|
2199
|
-
function getDefaultExportFromCjs$
|
|
2281
|
+
function getDefaultExportFromCjs$3 (x) {
|
|
2200
2282
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2201
2283
|
}
|
|
2202
2284
|
|
|
2203
|
-
var propTypes$
|
|
2285
|
+
var propTypes$3 = {exports: {}};
|
|
2204
2286
|
|
|
2205
|
-
var reactIs$
|
|
2287
|
+
var reactIs$3 = {exports: {}};
|
|
2206
2288
|
|
|
2207
|
-
var reactIs_production_min$
|
|
2289
|
+
var reactIs_production_min$3 = {};
|
|
2208
2290
|
|
|
2209
2291
|
/** @license React v16.13.1
|
|
2210
2292
|
* react-is.production.min.js
|
|
@@ -2215,21 +2297,21 @@ var reactIs_production_min$2 = {};
|
|
|
2215
2297
|
* LICENSE file in the root directory of this source tree.
|
|
2216
2298
|
*/
|
|
2217
2299
|
|
|
2218
|
-
var hasRequiredReactIs_production_min$
|
|
2300
|
+
var hasRequiredReactIs_production_min$3;
|
|
2219
2301
|
|
|
2220
|
-
function requireReactIs_production_min$
|
|
2221
|
-
if (hasRequiredReactIs_production_min$
|
|
2222
|
-
hasRequiredReactIs_production_min$
|
|
2302
|
+
function requireReactIs_production_min$3 () {
|
|
2303
|
+
if (hasRequiredReactIs_production_min$3) return reactIs_production_min$3;
|
|
2304
|
+
hasRequiredReactIs_production_min$3 = 1;
|
|
2223
2305
|
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
2224
2306
|
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
2225
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$
|
|
2226
|
-
reactIs_production_min$
|
|
2227
|
-
reactIs_production_min$
|
|
2228
|
-
reactIs_production_min$
|
|
2229
|
-
return reactIs_production_min$
|
|
2307
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$3.AsyncMode=l;reactIs_production_min$3.ConcurrentMode=m;reactIs_production_min$3.ContextConsumer=k;reactIs_production_min$3.ContextProvider=h;reactIs_production_min$3.Element=c;reactIs_production_min$3.ForwardRef=n;reactIs_production_min$3.Fragment=e;reactIs_production_min$3.Lazy=t;reactIs_production_min$3.Memo=r;reactIs_production_min$3.Portal=d;
|
|
2308
|
+
reactIs_production_min$3.Profiler=g;reactIs_production_min$3.StrictMode=f;reactIs_production_min$3.Suspense=p;reactIs_production_min$3.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$3.isConcurrentMode=A;reactIs_production_min$3.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$3.isContextProvider=function(a){return z(a)===h};reactIs_production_min$3.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$3.isForwardRef=function(a){return z(a)===n};reactIs_production_min$3.isFragment=function(a){return z(a)===e};reactIs_production_min$3.isLazy=function(a){return z(a)===t};
|
|
2309
|
+
reactIs_production_min$3.isMemo=function(a){return z(a)===r};reactIs_production_min$3.isPortal=function(a){return z(a)===d};reactIs_production_min$3.isProfiler=function(a){return z(a)===g};reactIs_production_min$3.isStrictMode=function(a){return z(a)===f};reactIs_production_min$3.isSuspense=function(a){return z(a)===p};
|
|
2310
|
+
reactIs_production_min$3.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min$3.typeOf=z;
|
|
2311
|
+
return reactIs_production_min$3;
|
|
2230
2312
|
}
|
|
2231
2313
|
|
|
2232
|
-
var reactIs_development$
|
|
2314
|
+
var reactIs_development$3 = {};
|
|
2233
2315
|
|
|
2234
2316
|
/** @license React v16.13.1
|
|
2235
2317
|
* react-is.development.js
|
|
@@ -2240,11 +2322,11 @@ var reactIs_development$2 = {};
|
|
|
2240
2322
|
* LICENSE file in the root directory of this source tree.
|
|
2241
2323
|
*/
|
|
2242
2324
|
|
|
2243
|
-
var hasRequiredReactIs_development$
|
|
2325
|
+
var hasRequiredReactIs_development$3;
|
|
2244
2326
|
|
|
2245
|
-
function requireReactIs_development$
|
|
2246
|
-
if (hasRequiredReactIs_development$
|
|
2247
|
-
hasRequiredReactIs_development$
|
|
2327
|
+
function requireReactIs_development$3 () {
|
|
2328
|
+
if (hasRequiredReactIs_development$3) return reactIs_development$3;
|
|
2329
|
+
hasRequiredReactIs_development$3 = 1;
|
|
2248
2330
|
|
|
2249
2331
|
|
|
2250
2332
|
|
|
@@ -2385,51 +2467,51 @@ function requireReactIs_development$2 () {
|
|
|
2385
2467
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2386
2468
|
}
|
|
2387
2469
|
|
|
2388
|
-
reactIs_development$
|
|
2389
|
-
reactIs_development$
|
|
2390
|
-
reactIs_development$
|
|
2391
|
-
reactIs_development$
|
|
2392
|
-
reactIs_development$
|
|
2393
|
-
reactIs_development$
|
|
2394
|
-
reactIs_development$
|
|
2395
|
-
reactIs_development$
|
|
2396
|
-
reactIs_development$
|
|
2397
|
-
reactIs_development$
|
|
2398
|
-
reactIs_development$
|
|
2399
|
-
reactIs_development$
|
|
2400
|
-
reactIs_development$
|
|
2401
|
-
reactIs_development$
|
|
2402
|
-
reactIs_development$
|
|
2403
|
-
reactIs_development$
|
|
2404
|
-
reactIs_development$
|
|
2405
|
-
reactIs_development$
|
|
2406
|
-
reactIs_development$
|
|
2407
|
-
reactIs_development$
|
|
2408
|
-
reactIs_development$
|
|
2409
|
-
reactIs_development$
|
|
2410
|
-
reactIs_development$
|
|
2411
|
-
reactIs_development$
|
|
2412
|
-
reactIs_development$
|
|
2413
|
-
reactIs_development$
|
|
2414
|
-
reactIs_development$
|
|
2415
|
-
reactIs_development$
|
|
2470
|
+
reactIs_development$3.AsyncMode = AsyncMode;
|
|
2471
|
+
reactIs_development$3.ConcurrentMode = ConcurrentMode;
|
|
2472
|
+
reactIs_development$3.ContextConsumer = ContextConsumer;
|
|
2473
|
+
reactIs_development$3.ContextProvider = ContextProvider;
|
|
2474
|
+
reactIs_development$3.Element = Element;
|
|
2475
|
+
reactIs_development$3.ForwardRef = ForwardRef;
|
|
2476
|
+
reactIs_development$3.Fragment = Fragment;
|
|
2477
|
+
reactIs_development$3.Lazy = Lazy;
|
|
2478
|
+
reactIs_development$3.Memo = Memo;
|
|
2479
|
+
reactIs_development$3.Portal = Portal;
|
|
2480
|
+
reactIs_development$3.Profiler = Profiler;
|
|
2481
|
+
reactIs_development$3.StrictMode = StrictMode;
|
|
2482
|
+
reactIs_development$3.Suspense = Suspense;
|
|
2483
|
+
reactIs_development$3.isAsyncMode = isAsyncMode;
|
|
2484
|
+
reactIs_development$3.isConcurrentMode = isConcurrentMode;
|
|
2485
|
+
reactIs_development$3.isContextConsumer = isContextConsumer;
|
|
2486
|
+
reactIs_development$3.isContextProvider = isContextProvider;
|
|
2487
|
+
reactIs_development$3.isElement = isElement;
|
|
2488
|
+
reactIs_development$3.isForwardRef = isForwardRef;
|
|
2489
|
+
reactIs_development$3.isFragment = isFragment;
|
|
2490
|
+
reactIs_development$3.isLazy = isLazy;
|
|
2491
|
+
reactIs_development$3.isMemo = isMemo;
|
|
2492
|
+
reactIs_development$3.isPortal = isPortal;
|
|
2493
|
+
reactIs_development$3.isProfiler = isProfiler;
|
|
2494
|
+
reactIs_development$3.isStrictMode = isStrictMode;
|
|
2495
|
+
reactIs_development$3.isSuspense = isSuspense;
|
|
2496
|
+
reactIs_development$3.isValidElementType = isValidElementType;
|
|
2497
|
+
reactIs_development$3.typeOf = typeOf;
|
|
2416
2498
|
})();
|
|
2417
2499
|
}
|
|
2418
|
-
return reactIs_development$
|
|
2500
|
+
return reactIs_development$3;
|
|
2419
2501
|
}
|
|
2420
2502
|
|
|
2421
|
-
var hasRequiredReactIs$
|
|
2503
|
+
var hasRequiredReactIs$3;
|
|
2422
2504
|
|
|
2423
|
-
function requireReactIs$
|
|
2424
|
-
if (hasRequiredReactIs$
|
|
2425
|
-
hasRequiredReactIs$
|
|
2505
|
+
function requireReactIs$3 () {
|
|
2506
|
+
if (hasRequiredReactIs$3) return reactIs$3.exports;
|
|
2507
|
+
hasRequiredReactIs$3 = 1;
|
|
2426
2508
|
|
|
2427
2509
|
if (process.env.NODE_ENV === 'production') {
|
|
2428
|
-
reactIs$
|
|
2510
|
+
reactIs$3.exports = requireReactIs_production_min$3();
|
|
2429
2511
|
} else {
|
|
2430
|
-
reactIs$
|
|
2512
|
+
reactIs$3.exports = requireReactIs_development$3();
|
|
2431
2513
|
}
|
|
2432
|
-
return reactIs$
|
|
2514
|
+
return reactIs$3.exports;
|
|
2433
2515
|
}
|
|
2434
2516
|
|
|
2435
2517
|
/*
|
|
@@ -2438,12 +2520,12 @@ object-assign
|
|
|
2438
2520
|
@license MIT
|
|
2439
2521
|
*/
|
|
2440
2522
|
|
|
2441
|
-
var objectAssign$
|
|
2442
|
-
var hasRequiredObjectAssign$
|
|
2523
|
+
var objectAssign$3;
|
|
2524
|
+
var hasRequiredObjectAssign$3;
|
|
2443
2525
|
|
|
2444
|
-
function requireObjectAssign$
|
|
2445
|
-
if (hasRequiredObjectAssign$
|
|
2446
|
-
hasRequiredObjectAssign$
|
|
2526
|
+
function requireObjectAssign$3 () {
|
|
2527
|
+
if (hasRequiredObjectAssign$3) return objectAssign$3;
|
|
2528
|
+
hasRequiredObjectAssign$3 = 1;
|
|
2447
2529
|
/* eslint-disable no-unused-vars */
|
|
2448
2530
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2449
2531
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -2501,7 +2583,7 @@ function requireObjectAssign$2 () {
|
|
|
2501
2583
|
}
|
|
2502
2584
|
}
|
|
2503
2585
|
|
|
2504
|
-
objectAssign$
|
|
2586
|
+
objectAssign$3 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
2505
2587
|
var from;
|
|
2506
2588
|
var to = toObject(target);
|
|
2507
2589
|
var symbols;
|
|
@@ -2527,7 +2609,7 @@ function requireObjectAssign$2 () {
|
|
|
2527
2609
|
|
|
2528
2610
|
return to;
|
|
2529
2611
|
};
|
|
2530
|
-
return objectAssign$
|
|
2612
|
+
return objectAssign$3;
|
|
2531
2613
|
}
|
|
2532
2614
|
|
|
2533
2615
|
/**
|
|
@@ -2537,27 +2619,27 @@ function requireObjectAssign$2 () {
|
|
|
2537
2619
|
* LICENSE file in the root directory of this source tree.
|
|
2538
2620
|
*/
|
|
2539
2621
|
|
|
2540
|
-
var ReactPropTypesSecret_1$
|
|
2541
|
-
var hasRequiredReactPropTypesSecret$
|
|
2622
|
+
var ReactPropTypesSecret_1$3;
|
|
2623
|
+
var hasRequiredReactPropTypesSecret$3;
|
|
2542
2624
|
|
|
2543
|
-
function requireReactPropTypesSecret$
|
|
2544
|
-
if (hasRequiredReactPropTypesSecret$
|
|
2545
|
-
hasRequiredReactPropTypesSecret$
|
|
2625
|
+
function requireReactPropTypesSecret$3 () {
|
|
2626
|
+
if (hasRequiredReactPropTypesSecret$3) return ReactPropTypesSecret_1$3;
|
|
2627
|
+
hasRequiredReactPropTypesSecret$3 = 1;
|
|
2546
2628
|
|
|
2547
2629
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2548
2630
|
|
|
2549
|
-
ReactPropTypesSecret_1$
|
|
2550
|
-
return ReactPropTypesSecret_1$
|
|
2631
|
+
ReactPropTypesSecret_1$3 = ReactPropTypesSecret;
|
|
2632
|
+
return ReactPropTypesSecret_1$3;
|
|
2551
2633
|
}
|
|
2552
2634
|
|
|
2553
|
-
var has$
|
|
2554
|
-
var hasRequiredHas$
|
|
2635
|
+
var has$3;
|
|
2636
|
+
var hasRequiredHas$3;
|
|
2555
2637
|
|
|
2556
|
-
function requireHas$
|
|
2557
|
-
if (hasRequiredHas$
|
|
2558
|
-
hasRequiredHas$
|
|
2559
|
-
has$
|
|
2560
|
-
return has$
|
|
2638
|
+
function requireHas$3 () {
|
|
2639
|
+
if (hasRequiredHas$3) return has$3;
|
|
2640
|
+
hasRequiredHas$3 = 1;
|
|
2641
|
+
has$3 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2642
|
+
return has$3;
|
|
2561
2643
|
}
|
|
2562
2644
|
|
|
2563
2645
|
/**
|
|
@@ -2567,19 +2649,19 @@ function requireHas$2 () {
|
|
|
2567
2649
|
* LICENSE file in the root directory of this source tree.
|
|
2568
2650
|
*/
|
|
2569
2651
|
|
|
2570
|
-
var checkPropTypes_1$
|
|
2571
|
-
var hasRequiredCheckPropTypes$
|
|
2652
|
+
var checkPropTypes_1$3;
|
|
2653
|
+
var hasRequiredCheckPropTypes$3;
|
|
2572
2654
|
|
|
2573
|
-
function requireCheckPropTypes$
|
|
2574
|
-
if (hasRequiredCheckPropTypes$
|
|
2575
|
-
hasRequiredCheckPropTypes$
|
|
2655
|
+
function requireCheckPropTypes$3 () {
|
|
2656
|
+
if (hasRequiredCheckPropTypes$3) return checkPropTypes_1$3;
|
|
2657
|
+
hasRequiredCheckPropTypes$3 = 1;
|
|
2576
2658
|
|
|
2577
2659
|
var printWarning = function() {};
|
|
2578
2660
|
|
|
2579
2661
|
if (process.env.NODE_ENV !== 'production') {
|
|
2580
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
2662
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$3();
|
|
2581
2663
|
var loggedTypeFailures = {};
|
|
2582
|
-
var has = /*@__PURE__*/ requireHas$
|
|
2664
|
+
var has = /*@__PURE__*/ requireHas$3();
|
|
2583
2665
|
|
|
2584
2666
|
printWarning = function(text) {
|
|
2585
2667
|
var message = 'Warning: ' + text;
|
|
@@ -2667,8 +2749,8 @@ function requireCheckPropTypes$2 () {
|
|
|
2667
2749
|
}
|
|
2668
2750
|
};
|
|
2669
2751
|
|
|
2670
|
-
checkPropTypes_1$
|
|
2671
|
-
return checkPropTypes_1$
|
|
2752
|
+
checkPropTypes_1$3 = checkPropTypes;
|
|
2753
|
+
return checkPropTypes_1$3;
|
|
2672
2754
|
}
|
|
2673
2755
|
|
|
2674
2756
|
/**
|
|
@@ -2678,19 +2760,19 @@ function requireCheckPropTypes$2 () {
|
|
|
2678
2760
|
* LICENSE file in the root directory of this source tree.
|
|
2679
2761
|
*/
|
|
2680
2762
|
|
|
2681
|
-
var factoryWithTypeCheckers$
|
|
2682
|
-
var hasRequiredFactoryWithTypeCheckers$
|
|
2763
|
+
var factoryWithTypeCheckers$3;
|
|
2764
|
+
var hasRequiredFactoryWithTypeCheckers$3;
|
|
2683
2765
|
|
|
2684
|
-
function requireFactoryWithTypeCheckers$
|
|
2685
|
-
if (hasRequiredFactoryWithTypeCheckers$
|
|
2686
|
-
hasRequiredFactoryWithTypeCheckers$
|
|
2766
|
+
function requireFactoryWithTypeCheckers$3 () {
|
|
2767
|
+
if (hasRequiredFactoryWithTypeCheckers$3) return factoryWithTypeCheckers$3;
|
|
2768
|
+
hasRequiredFactoryWithTypeCheckers$3 = 1;
|
|
2687
2769
|
|
|
2688
|
-
var ReactIs = requireReactIs$
|
|
2689
|
-
var assign = requireObjectAssign$
|
|
2770
|
+
var ReactIs = requireReactIs$3();
|
|
2771
|
+
var assign = requireObjectAssign$3();
|
|
2690
2772
|
|
|
2691
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
2692
|
-
var has = /*@__PURE__*/ requireHas$
|
|
2693
|
-
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$
|
|
2773
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$3();
|
|
2774
|
+
var has = /*@__PURE__*/ requireHas$3();
|
|
2775
|
+
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$3();
|
|
2694
2776
|
|
|
2695
2777
|
var printWarning = function() {};
|
|
2696
2778
|
|
|
@@ -2713,7 +2795,7 @@ function requireFactoryWithTypeCheckers$2 () {
|
|
|
2713
2795
|
return null;
|
|
2714
2796
|
}
|
|
2715
2797
|
|
|
2716
|
-
factoryWithTypeCheckers$
|
|
2798
|
+
factoryWithTypeCheckers$3 = function(isValidElement, throwOnDirectAccess) {
|
|
2717
2799
|
/* global Symbol */
|
|
2718
2800
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2719
2801
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
@@ -3286,7 +3368,7 @@ function requireFactoryWithTypeCheckers$2 () {
|
|
|
3286
3368
|
|
|
3287
3369
|
return ReactPropTypes;
|
|
3288
3370
|
};
|
|
3289
|
-
return factoryWithTypeCheckers$
|
|
3371
|
+
return factoryWithTypeCheckers$3;
|
|
3290
3372
|
}
|
|
3291
3373
|
|
|
3292
3374
|
/**
|
|
@@ -3296,20 +3378,20 @@ function requireFactoryWithTypeCheckers$2 () {
|
|
|
3296
3378
|
* LICENSE file in the root directory of this source tree.
|
|
3297
3379
|
*/
|
|
3298
3380
|
|
|
3299
|
-
var factoryWithThrowingShims$
|
|
3300
|
-
var hasRequiredFactoryWithThrowingShims$
|
|
3381
|
+
var factoryWithThrowingShims$3;
|
|
3382
|
+
var hasRequiredFactoryWithThrowingShims$3;
|
|
3301
3383
|
|
|
3302
|
-
function requireFactoryWithThrowingShims$
|
|
3303
|
-
if (hasRequiredFactoryWithThrowingShims$
|
|
3304
|
-
hasRequiredFactoryWithThrowingShims$
|
|
3384
|
+
function requireFactoryWithThrowingShims$3 () {
|
|
3385
|
+
if (hasRequiredFactoryWithThrowingShims$3) return factoryWithThrowingShims$3;
|
|
3386
|
+
hasRequiredFactoryWithThrowingShims$3 = 1;
|
|
3305
3387
|
|
|
3306
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
3388
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$3();
|
|
3307
3389
|
|
|
3308
3390
|
function emptyFunction() {}
|
|
3309
3391
|
function emptyFunctionWithReset() {}
|
|
3310
3392
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3311
3393
|
|
|
3312
|
-
factoryWithThrowingShims$
|
|
3394
|
+
factoryWithThrowingShims$3 = function() {
|
|
3313
3395
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3314
3396
|
if (secret === ReactPropTypesSecret) {
|
|
3315
3397
|
// It is still safe when called from React.
|
|
@@ -3357,7 +3439,7 @@ function requireFactoryWithThrowingShims$2 () {
|
|
|
3357
3439
|
|
|
3358
3440
|
return ReactPropTypes;
|
|
3359
3441
|
};
|
|
3360
|
-
return factoryWithThrowingShims$
|
|
3442
|
+
return factoryWithThrowingShims$3;
|
|
3361
3443
|
}
|
|
3362
3444
|
|
|
3363
3445
|
/**
|
|
@@ -3367,28 +3449,28 @@ function requireFactoryWithThrowingShims$2 () {
|
|
|
3367
3449
|
* LICENSE file in the root directory of this source tree.
|
|
3368
3450
|
*/
|
|
3369
3451
|
|
|
3370
|
-
var hasRequiredPropTypes$
|
|
3452
|
+
var hasRequiredPropTypes$3;
|
|
3371
3453
|
|
|
3372
|
-
function requirePropTypes$
|
|
3373
|
-
if (hasRequiredPropTypes$
|
|
3374
|
-
hasRequiredPropTypes$
|
|
3454
|
+
function requirePropTypes$3 () {
|
|
3455
|
+
if (hasRequiredPropTypes$3) return propTypes$3.exports;
|
|
3456
|
+
hasRequiredPropTypes$3 = 1;
|
|
3375
3457
|
if (process.env.NODE_ENV !== 'production') {
|
|
3376
|
-
var ReactIs = requireReactIs$
|
|
3458
|
+
var ReactIs = requireReactIs$3();
|
|
3377
3459
|
|
|
3378
3460
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3379
3461
|
// http://fb.me/prop-types-in-prod
|
|
3380
3462
|
var throwOnDirectAccess = true;
|
|
3381
|
-
propTypes$
|
|
3463
|
+
propTypes$3.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$3()(ReactIs.isElement, throwOnDirectAccess);
|
|
3382
3464
|
} else {
|
|
3383
3465
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3384
3466
|
// http://fb.me/prop-types-in-prod
|
|
3385
|
-
propTypes$
|
|
3467
|
+
propTypes$3.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$3()();
|
|
3386
3468
|
}
|
|
3387
|
-
return propTypes$
|
|
3469
|
+
return propTypes$3.exports;
|
|
3388
3470
|
}
|
|
3389
3471
|
|
|
3390
|
-
var propTypesExports$
|
|
3391
|
-
var PropTypes$
|
|
3472
|
+
var propTypesExports$3 = /*@__PURE__*/ requirePropTypes$3();
|
|
3473
|
+
var PropTypes$3 = /*@__PURE__*/getDefaultExportFromCjs$3(propTypesExports$3);
|
|
3392
3474
|
|
|
3393
3475
|
const SystemOperations = _ref => {
|
|
3394
3476
|
let {
|
|
@@ -3404,7 +3486,7 @@ const SystemOperations = _ref => {
|
|
|
3404
3486
|
run
|
|
3405
3487
|
} = _ref;
|
|
3406
3488
|
const {
|
|
3407
|
-
modal
|
|
3489
|
+
modal
|
|
3408
3490
|
} = App.useApp();
|
|
3409
3491
|
const menuItems = [{
|
|
3410
3492
|
key: "poweroff",
|
|
@@ -3426,7 +3508,7 @@ const SystemOperations = _ref => {
|
|
|
3426
3508
|
restart: "restart"
|
|
3427
3509
|
};
|
|
3428
3510
|
const actionText = actionLabels[action] || action;
|
|
3429
|
-
|
|
3511
|
+
modal.confirm({
|
|
3430
3512
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
3431
3513
|
title: confirmTitle,
|
|
3432
3514
|
content: confirmMessage.replace('{action}', actionText),
|
|
@@ -3470,15 +3552,15 @@ const SystemOperations = _ref => {
|
|
|
3470
3552
|
});
|
|
3471
3553
|
};
|
|
3472
3554
|
SystemOperations.propTypes = {
|
|
3473
|
-
onPowerOff: PropTypes$
|
|
3474
|
-
onRestart: PropTypes$
|
|
3475
|
-
powerOffLabel: PropTypes$
|
|
3476
|
-
restartLabel: PropTypes$
|
|
3477
|
-
iconClassName: PropTypes$
|
|
3478
|
-
confirmTitle: PropTypes$
|
|
3479
|
-
cancelText: PropTypes$
|
|
3480
|
-
okText: PropTypes$
|
|
3481
|
-
run: PropTypes$
|
|
3555
|
+
onPowerOff: PropTypes$3.func,
|
|
3556
|
+
onRestart: PropTypes$3.func,
|
|
3557
|
+
powerOffLabel: PropTypes$3.string,
|
|
3558
|
+
restartLabel: PropTypes$3.string,
|
|
3559
|
+
iconClassName: PropTypes$3.string,
|
|
3560
|
+
confirmTitle: PropTypes$3.string,
|
|
3561
|
+
cancelText: PropTypes$3.string,
|
|
3562
|
+
okText: PropTypes$3.string,
|
|
3563
|
+
run: PropTypes$3.func
|
|
3482
3564
|
};
|
|
3483
3565
|
var SystemOperations$1 = SystemOperations;
|
|
3484
3566
|
|
|
@@ -3521,10 +3603,10 @@ const useSpaLogo = function () {
|
|
|
3521
3603
|
}, "logo")];
|
|
3522
3604
|
};
|
|
3523
3605
|
useSpaLogo.propTypes = {
|
|
3524
|
-
logoUrl: PropTypes$
|
|
3525
|
-
logoWidth: PropTypes$
|
|
3526
|
-
logoAlt: PropTypes$
|
|
3527
|
-
onClick: PropTypes$
|
|
3606
|
+
logoUrl: PropTypes$3.string,
|
|
3607
|
+
logoWidth: PropTypes$3.number,
|
|
3608
|
+
logoAlt: PropTypes$3.string,
|
|
3609
|
+
onClick: PropTypes$3.func
|
|
3528
3610
|
};
|
|
3529
3611
|
var useSpaLogo$1 = useSpaLogo;
|
|
3530
3612
|
|
|
@@ -3626,23 +3708,23 @@ const CommonHeader = _ref => {
|
|
|
3626
3708
|
|
|
3627
3709
|
// PropTypes 类型检查
|
|
3628
3710
|
CommonHeader.propTypes = {
|
|
3629
|
-
menuElement: PropTypes$
|
|
3630
|
-
productInfo: PropTypes$
|
|
3631
|
-
productName: PropTypes$
|
|
3632
|
-
version: PropTypes$
|
|
3711
|
+
menuElement: PropTypes$3.node,
|
|
3712
|
+
productInfo: PropTypes$3.shape({
|
|
3713
|
+
productName: PropTypes$3.string,
|
|
3714
|
+
version: PropTypes$3.string
|
|
3633
3715
|
}),
|
|
3634
|
-
showLogo: PropTypes$
|
|
3635
|
-
showProductInfo: PropTypes$
|
|
3636
|
-
showHardwareUsage: PropTypes$
|
|
3637
|
-
showSystemOperations: PropTypes$
|
|
3638
|
-
onPowerOff: PropTypes$
|
|
3639
|
-
onRestart: PropTypes$
|
|
3640
|
-
onRun: PropTypes$
|
|
3641
|
-
hardwareMonitorUrl: PropTypes$
|
|
3642
|
-
getSocketUrl: PropTypes$
|
|
3643
|
-
logoProps: PropTypes$
|
|
3644
|
-
className: PropTypes$
|
|
3645
|
-
style: PropTypes$
|
|
3716
|
+
showLogo: PropTypes$3.bool,
|
|
3717
|
+
showProductInfo: PropTypes$3.bool,
|
|
3718
|
+
showHardwareUsage: PropTypes$3.bool,
|
|
3719
|
+
showSystemOperations: PropTypes$3.bool,
|
|
3720
|
+
onPowerOff: PropTypes$3.func,
|
|
3721
|
+
onRestart: PropTypes$3.func,
|
|
3722
|
+
onRun: PropTypes$3.func,
|
|
3723
|
+
hardwareMonitorUrl: PropTypes$3.string,
|
|
3724
|
+
getSocketUrl: PropTypes$3.func,
|
|
3725
|
+
logoProps: PropTypes$3.object,
|
|
3726
|
+
className: PropTypes$3.string,
|
|
3727
|
+
style: PropTypes$3.object
|
|
3646
3728
|
};
|
|
3647
3729
|
var CommonHeader$1 = CommonHeader;
|
|
3648
3730
|
|
|
@@ -3672,10 +3754,10 @@ const LSMLabelField = props => {
|
|
|
3672
3754
|
};
|
|
3673
3755
|
loadLsmData();
|
|
3674
3756
|
}, [fetchLsmData]);
|
|
3675
|
-
return /*#__PURE__*/jsx(Form.Item, _objectSpread2(_objectSpread2({
|
|
3757
|
+
return /*#__PURE__*/jsx(Form.Item, _objectSpread2$1(_objectSpread2$1({
|
|
3676
3758
|
label: label
|
|
3677
3759
|
}, formItemProps), {}, {
|
|
3678
|
-
children: /*#__PURE__*/jsx(Select, _objectSpread2(_objectSpread2(_objectSpread2({}, field), selectProps), {}, {
|
|
3760
|
+
children: /*#__PURE__*/jsx(Select, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, field), selectProps), {}, {
|
|
3679
3761
|
options: lsmList,
|
|
3680
3762
|
fieldNames: fieldNames,
|
|
3681
3763
|
allowClear: true,
|
|
@@ -3691,15 +3773,15 @@ const LSMLabelField = props => {
|
|
|
3691
3773
|
};
|
|
3692
3774
|
var LSMLabelField$1 = /*#__PURE__*/memo(LSMLabelField);
|
|
3693
3775
|
|
|
3694
|
-
function _defineProperty
|
|
3695
|
-
return (r = _toPropertyKey
|
|
3776
|
+
function _defineProperty(e, r, t) {
|
|
3777
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
3696
3778
|
value: t,
|
|
3697
3779
|
enumerable: !0,
|
|
3698
3780
|
configurable: !0,
|
|
3699
3781
|
writable: !0
|
|
3700
3782
|
}) : e[r] = t, e;
|
|
3701
3783
|
}
|
|
3702
|
-
function ownKeys
|
|
3784
|
+
function ownKeys(e, r) {
|
|
3703
3785
|
var t = Object.keys(e);
|
|
3704
3786
|
if (Object.getOwnPropertySymbols) {
|
|
3705
3787
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -3709,29 +3791,29 @@ function ownKeys$1(e, r) {
|
|
|
3709
3791
|
}
|
|
3710
3792
|
return t;
|
|
3711
3793
|
}
|
|
3712
|
-
function _objectSpread2
|
|
3794
|
+
function _objectSpread2(e) {
|
|
3713
3795
|
for (var r = 1; r < arguments.length; r++) {
|
|
3714
3796
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
3715
|
-
r % 2 ? ownKeys
|
|
3716
|
-
_defineProperty
|
|
3717
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys
|
|
3797
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
3798
|
+
_defineProperty(e, r, t[r]);
|
|
3799
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
3718
3800
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
3719
3801
|
});
|
|
3720
3802
|
}
|
|
3721
3803
|
return e;
|
|
3722
3804
|
}
|
|
3723
|
-
function _objectWithoutProperties
|
|
3805
|
+
function _objectWithoutProperties(e, t) {
|
|
3724
3806
|
if (null == e) return {};
|
|
3725
3807
|
var o,
|
|
3726
3808
|
r,
|
|
3727
|
-
i = _objectWithoutPropertiesLoose
|
|
3809
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
3728
3810
|
if (Object.getOwnPropertySymbols) {
|
|
3729
3811
|
var n = Object.getOwnPropertySymbols(e);
|
|
3730
3812
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
3731
3813
|
}
|
|
3732
3814
|
return i;
|
|
3733
3815
|
}
|
|
3734
|
-
function _objectWithoutPropertiesLoose
|
|
3816
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
3735
3817
|
if (null == r) return {};
|
|
3736
3818
|
var t = {};
|
|
3737
3819
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -3740,7 +3822,7 @@ function _objectWithoutPropertiesLoose$1(r, e) {
|
|
|
3740
3822
|
}
|
|
3741
3823
|
return t;
|
|
3742
3824
|
}
|
|
3743
|
-
function _toPrimitive
|
|
3825
|
+
function _toPrimitive(t, r) {
|
|
3744
3826
|
if ("object" != typeof t || !t) return t;
|
|
3745
3827
|
var e = t[Symbol.toPrimitive];
|
|
3746
3828
|
if (void 0 !== e) {
|
|
@@ -3750,19 +3832,19 @@ function _toPrimitive$1(t, r) {
|
|
|
3750
3832
|
}
|
|
3751
3833
|
return ("string" === r ? String : Number)(t);
|
|
3752
3834
|
}
|
|
3753
|
-
function _toPropertyKey
|
|
3754
|
-
var i = _toPrimitive
|
|
3835
|
+
function _toPropertyKey(t) {
|
|
3836
|
+
var i = _toPrimitive(t, "string");
|
|
3755
3837
|
return "symbol" == typeof i ? i : i + "";
|
|
3756
3838
|
}
|
|
3757
|
-
const _excluded$
|
|
3758
|
-
const StyledModal
|
|
3839
|
+
const _excluded$2 = ["width", "okText", "cancelText", "styles"];
|
|
3840
|
+
const StyledModal = props => {
|
|
3759
3841
|
const {
|
|
3760
3842
|
width = "520px",
|
|
3761
3843
|
okText = "Apply",
|
|
3762
3844
|
cancelText = "Close",
|
|
3763
3845
|
styles: propStyles = {}
|
|
3764
3846
|
} = props,
|
|
3765
|
-
restProps = _objectWithoutProperties
|
|
3847
|
+
restProps = _objectWithoutProperties(props, _excluded$2);
|
|
3766
3848
|
|
|
3767
3849
|
// 基础样式配置
|
|
3768
3850
|
const baseStyles = {
|
|
@@ -3790,15 +3872,1213 @@ const StyledModal$2 = props => {
|
|
|
3790
3872
|
};
|
|
3791
3873
|
|
|
3792
3874
|
// 合并样式
|
|
3793
|
-
const styles = _objectSpread2
|
|
3794
|
-
return /*#__PURE__*/jsx(Modal, _objectSpread2
|
|
3875
|
+
const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
|
|
3876
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread2({
|
|
3795
3877
|
width: width,
|
|
3796
3878
|
okText: okText,
|
|
3797
3879
|
cancelText: cancelText,
|
|
3798
3880
|
styles: styles
|
|
3799
3881
|
}, restProps));
|
|
3800
3882
|
};
|
|
3801
|
-
var StyledModal$
|
|
3883
|
+
var StyledModal$1 = StyledModal;
|
|
3884
|
+
function getDefaultExportFromCjs$2(x) {
|
|
3885
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3886
|
+
}
|
|
3887
|
+
var propTypes$2 = {
|
|
3888
|
+
exports: {}
|
|
3889
|
+
};
|
|
3890
|
+
var reactIs$2 = {
|
|
3891
|
+
exports: {}
|
|
3892
|
+
};
|
|
3893
|
+
var reactIs_production_min$2 = {};
|
|
3894
|
+
|
|
3895
|
+
/** @license React v16.13.1
|
|
3896
|
+
* react-is.production.min.js
|
|
3897
|
+
*
|
|
3898
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3899
|
+
*
|
|
3900
|
+
* This source code is licensed under the MIT license found in the
|
|
3901
|
+
* LICENSE file in the root directory of this source tree.
|
|
3902
|
+
*/
|
|
3903
|
+
|
|
3904
|
+
var hasRequiredReactIs_production_min$2;
|
|
3905
|
+
function requireReactIs_production_min$2() {
|
|
3906
|
+
if (hasRequiredReactIs_production_min$2) return reactIs_production_min$2;
|
|
3907
|
+
hasRequiredReactIs_production_min$2 = 1;
|
|
3908
|
+
var b = "function" === typeof Symbol && Symbol.for,
|
|
3909
|
+
c = b ? Symbol.for("react.element") : 60103,
|
|
3910
|
+
d = b ? Symbol.for("react.portal") : 60106,
|
|
3911
|
+
e = b ? Symbol.for("react.fragment") : 60107,
|
|
3912
|
+
f = b ? Symbol.for("react.strict_mode") : 60108,
|
|
3913
|
+
g = b ? Symbol.for("react.profiler") : 60114,
|
|
3914
|
+
h = b ? Symbol.for("react.provider") : 60109,
|
|
3915
|
+
k = b ? Symbol.for("react.context") : 60110,
|
|
3916
|
+
l = b ? Symbol.for("react.async_mode") : 60111,
|
|
3917
|
+
m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
|
3918
|
+
n = b ? Symbol.for("react.forward_ref") : 60112,
|
|
3919
|
+
p = b ? Symbol.for("react.suspense") : 60113,
|
|
3920
|
+
q = b ? Symbol.for("react.suspense_list") : 60120,
|
|
3921
|
+
r = b ? Symbol.for("react.memo") : 60115,
|
|
3922
|
+
t = b ? Symbol.for("react.lazy") : 60116,
|
|
3923
|
+
v = b ? Symbol.for("react.block") : 60121,
|
|
3924
|
+
w = b ? Symbol.for("react.fundamental") : 60117,
|
|
3925
|
+
x = b ? Symbol.for("react.responder") : 60118,
|
|
3926
|
+
y = b ? Symbol.for("react.scope") : 60119;
|
|
3927
|
+
function z(a) {
|
|
3928
|
+
if ("object" === typeof a && null !== a) {
|
|
3929
|
+
var u = a.$$typeof;
|
|
3930
|
+
switch (u) {
|
|
3931
|
+
case c:
|
|
3932
|
+
switch (a = a.type, a) {
|
|
3933
|
+
case l:
|
|
3934
|
+
case m:
|
|
3935
|
+
case e:
|
|
3936
|
+
case g:
|
|
3937
|
+
case f:
|
|
3938
|
+
case p:
|
|
3939
|
+
return a;
|
|
3940
|
+
default:
|
|
3941
|
+
switch (a = a && a.$$typeof, a) {
|
|
3942
|
+
case k:
|
|
3943
|
+
case n:
|
|
3944
|
+
case t:
|
|
3945
|
+
case r:
|
|
3946
|
+
case h:
|
|
3947
|
+
return a;
|
|
3948
|
+
default:
|
|
3949
|
+
return u;
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
case d:
|
|
3953
|
+
return u;
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
function A(a) {
|
|
3958
|
+
return z(a) === m;
|
|
3959
|
+
}
|
|
3960
|
+
reactIs_production_min$2.AsyncMode = l;
|
|
3961
|
+
reactIs_production_min$2.ConcurrentMode = m;
|
|
3962
|
+
reactIs_production_min$2.ContextConsumer = k;
|
|
3963
|
+
reactIs_production_min$2.ContextProvider = h;
|
|
3964
|
+
reactIs_production_min$2.Element = c;
|
|
3965
|
+
reactIs_production_min$2.ForwardRef = n;
|
|
3966
|
+
reactIs_production_min$2.Fragment = e;
|
|
3967
|
+
reactIs_production_min$2.Lazy = t;
|
|
3968
|
+
reactIs_production_min$2.Memo = r;
|
|
3969
|
+
reactIs_production_min$2.Portal = d;
|
|
3970
|
+
reactIs_production_min$2.Profiler = g;
|
|
3971
|
+
reactIs_production_min$2.StrictMode = f;
|
|
3972
|
+
reactIs_production_min$2.Suspense = p;
|
|
3973
|
+
reactIs_production_min$2.isAsyncMode = function (a) {
|
|
3974
|
+
return A(a) || z(a) === l;
|
|
3975
|
+
};
|
|
3976
|
+
reactIs_production_min$2.isConcurrentMode = A;
|
|
3977
|
+
reactIs_production_min$2.isContextConsumer = function (a) {
|
|
3978
|
+
return z(a) === k;
|
|
3979
|
+
};
|
|
3980
|
+
reactIs_production_min$2.isContextProvider = function (a) {
|
|
3981
|
+
return z(a) === h;
|
|
3982
|
+
};
|
|
3983
|
+
reactIs_production_min$2.isElement = function (a) {
|
|
3984
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
3985
|
+
};
|
|
3986
|
+
reactIs_production_min$2.isForwardRef = function (a) {
|
|
3987
|
+
return z(a) === n;
|
|
3988
|
+
};
|
|
3989
|
+
reactIs_production_min$2.isFragment = function (a) {
|
|
3990
|
+
return z(a) === e;
|
|
3991
|
+
};
|
|
3992
|
+
reactIs_production_min$2.isLazy = function (a) {
|
|
3993
|
+
return z(a) === t;
|
|
3994
|
+
};
|
|
3995
|
+
reactIs_production_min$2.isMemo = function (a) {
|
|
3996
|
+
return z(a) === r;
|
|
3997
|
+
};
|
|
3998
|
+
reactIs_production_min$2.isPortal = function (a) {
|
|
3999
|
+
return z(a) === d;
|
|
4000
|
+
};
|
|
4001
|
+
reactIs_production_min$2.isProfiler = function (a) {
|
|
4002
|
+
return z(a) === g;
|
|
4003
|
+
};
|
|
4004
|
+
reactIs_production_min$2.isStrictMode = function (a) {
|
|
4005
|
+
return z(a) === f;
|
|
4006
|
+
};
|
|
4007
|
+
reactIs_production_min$2.isSuspense = function (a) {
|
|
4008
|
+
return z(a) === p;
|
|
4009
|
+
};
|
|
4010
|
+
reactIs_production_min$2.isValidElementType = function (a) {
|
|
4011
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
4012
|
+
};
|
|
4013
|
+
reactIs_production_min$2.typeOf = z;
|
|
4014
|
+
return reactIs_production_min$2;
|
|
4015
|
+
}
|
|
4016
|
+
var reactIs_development$2 = {};
|
|
4017
|
+
|
|
4018
|
+
/** @license React v16.13.1
|
|
4019
|
+
* react-is.development.js
|
|
4020
|
+
*
|
|
4021
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4022
|
+
*
|
|
4023
|
+
* This source code is licensed under the MIT license found in the
|
|
4024
|
+
* LICENSE file in the root directory of this source tree.
|
|
4025
|
+
*/
|
|
4026
|
+
|
|
4027
|
+
var hasRequiredReactIs_development$2;
|
|
4028
|
+
function requireReactIs_development$2() {
|
|
4029
|
+
if (hasRequiredReactIs_development$2) return reactIs_development$2;
|
|
4030
|
+
hasRequiredReactIs_development$2 = 1;
|
|
4031
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4032
|
+
(function () {
|
|
4033
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
4034
|
+
// nor polyfill, then a plain number is used for performance.
|
|
4035
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
4036
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
4037
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
4038
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
4039
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
4040
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
4041
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
4042
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
4043
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
4044
|
+
|
|
4045
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
4046
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
4047
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
4048
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
4049
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
4050
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
4051
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
4052
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
4053
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
4054
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
4055
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
4056
|
+
function isValidElementType(type) {
|
|
4057
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
4058
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
4059
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
4060
|
+
}
|
|
4061
|
+
function typeOf(object) {
|
|
4062
|
+
if (typeof object === 'object' && object !== null) {
|
|
4063
|
+
var $$typeof = object.$$typeof;
|
|
4064
|
+
switch ($$typeof) {
|
|
4065
|
+
case REACT_ELEMENT_TYPE:
|
|
4066
|
+
var type = object.type;
|
|
4067
|
+
switch (type) {
|
|
4068
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
4069
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
4070
|
+
case REACT_FRAGMENT_TYPE:
|
|
4071
|
+
case REACT_PROFILER_TYPE:
|
|
4072
|
+
case REACT_STRICT_MODE_TYPE:
|
|
4073
|
+
case REACT_SUSPENSE_TYPE:
|
|
4074
|
+
return type;
|
|
4075
|
+
default:
|
|
4076
|
+
var $$typeofType = type && type.$$typeof;
|
|
4077
|
+
switch ($$typeofType) {
|
|
4078
|
+
case REACT_CONTEXT_TYPE:
|
|
4079
|
+
case REACT_FORWARD_REF_TYPE:
|
|
4080
|
+
case REACT_LAZY_TYPE:
|
|
4081
|
+
case REACT_MEMO_TYPE:
|
|
4082
|
+
case REACT_PROVIDER_TYPE:
|
|
4083
|
+
return $$typeofType;
|
|
4084
|
+
default:
|
|
4085
|
+
return $$typeof;
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
case REACT_PORTAL_TYPE:
|
|
4089
|
+
return $$typeof;
|
|
4090
|
+
}
|
|
4091
|
+
}
|
|
4092
|
+
return undefined;
|
|
4093
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
4094
|
+
|
|
4095
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
4096
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
4097
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
4098
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
4099
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
4100
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
4101
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
4102
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
4103
|
+
var Memo = REACT_MEMO_TYPE;
|
|
4104
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
4105
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
4106
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
4107
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
4108
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
4109
|
+
|
|
4110
|
+
function isAsyncMode(object) {
|
|
4111
|
+
{
|
|
4112
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
4113
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
4114
|
+
|
|
4115
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
4119
|
+
}
|
|
4120
|
+
function isConcurrentMode(object) {
|
|
4121
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
4122
|
+
}
|
|
4123
|
+
function isContextConsumer(object) {
|
|
4124
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
4125
|
+
}
|
|
4126
|
+
function isContextProvider(object) {
|
|
4127
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
4128
|
+
}
|
|
4129
|
+
function isElement(object) {
|
|
4130
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
4131
|
+
}
|
|
4132
|
+
function isForwardRef(object) {
|
|
4133
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
4134
|
+
}
|
|
4135
|
+
function isFragment(object) {
|
|
4136
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
4137
|
+
}
|
|
4138
|
+
function isLazy(object) {
|
|
4139
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
4140
|
+
}
|
|
4141
|
+
function isMemo(object) {
|
|
4142
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
4143
|
+
}
|
|
4144
|
+
function isPortal(object) {
|
|
4145
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
4146
|
+
}
|
|
4147
|
+
function isProfiler(object) {
|
|
4148
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
4149
|
+
}
|
|
4150
|
+
function isStrictMode(object) {
|
|
4151
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
4152
|
+
}
|
|
4153
|
+
function isSuspense(object) {
|
|
4154
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
4155
|
+
}
|
|
4156
|
+
reactIs_development$2.AsyncMode = AsyncMode;
|
|
4157
|
+
reactIs_development$2.ConcurrentMode = ConcurrentMode;
|
|
4158
|
+
reactIs_development$2.ContextConsumer = ContextConsumer;
|
|
4159
|
+
reactIs_development$2.ContextProvider = ContextProvider;
|
|
4160
|
+
reactIs_development$2.Element = Element;
|
|
4161
|
+
reactIs_development$2.ForwardRef = ForwardRef;
|
|
4162
|
+
reactIs_development$2.Fragment = Fragment;
|
|
4163
|
+
reactIs_development$2.Lazy = Lazy;
|
|
4164
|
+
reactIs_development$2.Memo = Memo;
|
|
4165
|
+
reactIs_development$2.Portal = Portal;
|
|
4166
|
+
reactIs_development$2.Profiler = Profiler;
|
|
4167
|
+
reactIs_development$2.StrictMode = StrictMode;
|
|
4168
|
+
reactIs_development$2.Suspense = Suspense;
|
|
4169
|
+
reactIs_development$2.isAsyncMode = isAsyncMode;
|
|
4170
|
+
reactIs_development$2.isConcurrentMode = isConcurrentMode;
|
|
4171
|
+
reactIs_development$2.isContextConsumer = isContextConsumer;
|
|
4172
|
+
reactIs_development$2.isContextProvider = isContextProvider;
|
|
4173
|
+
reactIs_development$2.isElement = isElement;
|
|
4174
|
+
reactIs_development$2.isForwardRef = isForwardRef;
|
|
4175
|
+
reactIs_development$2.isFragment = isFragment;
|
|
4176
|
+
reactIs_development$2.isLazy = isLazy;
|
|
4177
|
+
reactIs_development$2.isMemo = isMemo;
|
|
4178
|
+
reactIs_development$2.isPortal = isPortal;
|
|
4179
|
+
reactIs_development$2.isProfiler = isProfiler;
|
|
4180
|
+
reactIs_development$2.isStrictMode = isStrictMode;
|
|
4181
|
+
reactIs_development$2.isSuspense = isSuspense;
|
|
4182
|
+
reactIs_development$2.isValidElementType = isValidElementType;
|
|
4183
|
+
reactIs_development$2.typeOf = typeOf;
|
|
4184
|
+
})();
|
|
4185
|
+
}
|
|
4186
|
+
return reactIs_development$2;
|
|
4187
|
+
}
|
|
4188
|
+
var hasRequiredReactIs$2;
|
|
4189
|
+
function requireReactIs$2() {
|
|
4190
|
+
if (hasRequiredReactIs$2) return reactIs$2.exports;
|
|
4191
|
+
hasRequiredReactIs$2 = 1;
|
|
4192
|
+
if (process.env.NODE_ENV === 'production') {
|
|
4193
|
+
reactIs$2.exports = requireReactIs_production_min$2();
|
|
4194
|
+
} else {
|
|
4195
|
+
reactIs$2.exports = requireReactIs_development$2();
|
|
4196
|
+
}
|
|
4197
|
+
return reactIs$2.exports;
|
|
4198
|
+
}
|
|
4199
|
+
|
|
4200
|
+
/*
|
|
4201
|
+
object-assign
|
|
4202
|
+
(c) Sindre Sorhus
|
|
4203
|
+
@license MIT
|
|
4204
|
+
*/
|
|
4205
|
+
|
|
4206
|
+
var objectAssign$2;
|
|
4207
|
+
var hasRequiredObjectAssign$2;
|
|
4208
|
+
function requireObjectAssign$2() {
|
|
4209
|
+
if (hasRequiredObjectAssign$2) return objectAssign$2;
|
|
4210
|
+
hasRequiredObjectAssign$2 = 1;
|
|
4211
|
+
/* eslint-disable no-unused-vars */
|
|
4212
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
4213
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4214
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
4215
|
+
function toObject(val) {
|
|
4216
|
+
if (val === null || val === undefined) {
|
|
4217
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
4218
|
+
}
|
|
4219
|
+
return Object(val);
|
|
4220
|
+
}
|
|
4221
|
+
function shouldUseNative() {
|
|
4222
|
+
try {
|
|
4223
|
+
if (!Object.assign) {
|
|
4224
|
+
return false;
|
|
4225
|
+
}
|
|
4226
|
+
|
|
4227
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
4228
|
+
|
|
4229
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
4230
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
4231
|
+
test1[5] = 'de';
|
|
4232
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
4233
|
+
return false;
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4237
|
+
var test2 = {};
|
|
4238
|
+
for (var i = 0; i < 10; i++) {
|
|
4239
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
4240
|
+
}
|
|
4241
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
4242
|
+
return test2[n];
|
|
4243
|
+
});
|
|
4244
|
+
if (order2.join('') !== '0123456789') {
|
|
4245
|
+
return false;
|
|
4246
|
+
}
|
|
4247
|
+
|
|
4248
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4249
|
+
var test3 = {};
|
|
4250
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
4251
|
+
test3[letter] = letter;
|
|
4252
|
+
});
|
|
4253
|
+
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
4254
|
+
return false;
|
|
4255
|
+
}
|
|
4256
|
+
return true;
|
|
4257
|
+
} catch (err) {
|
|
4258
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
4259
|
+
return false;
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
objectAssign$2 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
4263
|
+
var from;
|
|
4264
|
+
var to = toObject(target);
|
|
4265
|
+
var symbols;
|
|
4266
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
4267
|
+
from = Object(arguments[s]);
|
|
4268
|
+
for (var key in from) {
|
|
4269
|
+
if (hasOwnProperty.call(from, key)) {
|
|
4270
|
+
to[key] = from[key];
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
if (getOwnPropertySymbols) {
|
|
4274
|
+
symbols = getOwnPropertySymbols(from);
|
|
4275
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
4276
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
4277
|
+
to[symbols[i]] = from[symbols[i]];
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
return to;
|
|
4283
|
+
};
|
|
4284
|
+
return objectAssign$2;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4289
|
+
*
|
|
4290
|
+
* This source code is licensed under the MIT license found in the
|
|
4291
|
+
* LICENSE file in the root directory of this source tree.
|
|
4292
|
+
*/
|
|
4293
|
+
|
|
4294
|
+
var ReactPropTypesSecret_1$2;
|
|
4295
|
+
var hasRequiredReactPropTypesSecret$2;
|
|
4296
|
+
function requireReactPropTypesSecret$2() {
|
|
4297
|
+
if (hasRequiredReactPropTypesSecret$2) return ReactPropTypesSecret_1$2;
|
|
4298
|
+
hasRequiredReactPropTypesSecret$2 = 1;
|
|
4299
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
4300
|
+
ReactPropTypesSecret_1$2 = ReactPropTypesSecret;
|
|
4301
|
+
return ReactPropTypesSecret_1$2;
|
|
4302
|
+
}
|
|
4303
|
+
var has$2;
|
|
4304
|
+
var hasRequiredHas$2;
|
|
4305
|
+
function requireHas$2() {
|
|
4306
|
+
if (hasRequiredHas$2) return has$2;
|
|
4307
|
+
hasRequiredHas$2 = 1;
|
|
4308
|
+
has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
4309
|
+
return has$2;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
/**
|
|
4313
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4314
|
+
*
|
|
4315
|
+
* This source code is licensed under the MIT license found in the
|
|
4316
|
+
* LICENSE file in the root directory of this source tree.
|
|
4317
|
+
*/
|
|
4318
|
+
|
|
4319
|
+
var checkPropTypes_1$2;
|
|
4320
|
+
var hasRequiredCheckPropTypes$2;
|
|
4321
|
+
function requireCheckPropTypes$2() {
|
|
4322
|
+
if (hasRequiredCheckPropTypes$2) return checkPropTypes_1$2;
|
|
4323
|
+
hasRequiredCheckPropTypes$2 = 1;
|
|
4324
|
+
var printWarning = function () {};
|
|
4325
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4326
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$2();
|
|
4327
|
+
var loggedTypeFailures = {};
|
|
4328
|
+
var has = /*@__PURE__*/requireHas$2();
|
|
4329
|
+
printWarning = function (text) {
|
|
4330
|
+
var message = 'Warning: ' + text;
|
|
4331
|
+
if (typeof console !== 'undefined') {
|
|
4332
|
+
console.error(message);
|
|
4333
|
+
}
|
|
4334
|
+
try {
|
|
4335
|
+
// --- Welcome to debugging React ---
|
|
4336
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
4337
|
+
// to find the callsite that caused this warning to fire.
|
|
4338
|
+
throw new Error(message);
|
|
4339
|
+
} catch (x) {/**/}
|
|
4340
|
+
};
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* Assert that the values match with the type specs.
|
|
4345
|
+
* Error messages are memorized and will only be shown once.
|
|
4346
|
+
*
|
|
4347
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
4348
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
4349
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
4350
|
+
* @param {string} componentName Name of the component for error messages.
|
|
4351
|
+
* @param {?Function} getStack Returns the component stack.
|
|
4352
|
+
* @private
|
|
4353
|
+
*/
|
|
4354
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
4355
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4356
|
+
for (var typeSpecName in typeSpecs) {
|
|
4357
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
4358
|
+
var error;
|
|
4359
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
4360
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
4361
|
+
// After these have been cleaned up, we'll let them throw.
|
|
4362
|
+
try {
|
|
4363
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
4364
|
+
// behavior as without this statement except with a better message.
|
|
4365
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
4366
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
4367
|
+
err.name = 'Invariant Violation';
|
|
4368
|
+
throw err;
|
|
4369
|
+
}
|
|
4370
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
4371
|
+
} catch (ex) {
|
|
4372
|
+
error = ex;
|
|
4373
|
+
}
|
|
4374
|
+
if (error && !(error instanceof Error)) {
|
|
4375
|
+
printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
|
|
4376
|
+
}
|
|
4377
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
4378
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
4379
|
+
// same error.
|
|
4380
|
+
loggedTypeFailures[error.message] = true;
|
|
4381
|
+
var stack = getStack ? getStack() : '';
|
|
4382
|
+
printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
|
|
4389
|
+
/**
|
|
4390
|
+
* Resets warning cache when testing.
|
|
4391
|
+
*
|
|
4392
|
+
* @private
|
|
4393
|
+
*/
|
|
4394
|
+
checkPropTypes.resetWarningCache = function () {
|
|
4395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4396
|
+
loggedTypeFailures = {};
|
|
4397
|
+
}
|
|
4398
|
+
};
|
|
4399
|
+
checkPropTypes_1$2 = checkPropTypes;
|
|
4400
|
+
return checkPropTypes_1$2;
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
/**
|
|
4404
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4405
|
+
*
|
|
4406
|
+
* This source code is licensed under the MIT license found in the
|
|
4407
|
+
* LICENSE file in the root directory of this source tree.
|
|
4408
|
+
*/
|
|
4409
|
+
|
|
4410
|
+
var factoryWithTypeCheckers$2;
|
|
4411
|
+
var hasRequiredFactoryWithTypeCheckers$2;
|
|
4412
|
+
function requireFactoryWithTypeCheckers$2() {
|
|
4413
|
+
if (hasRequiredFactoryWithTypeCheckers$2) return factoryWithTypeCheckers$2;
|
|
4414
|
+
hasRequiredFactoryWithTypeCheckers$2 = 1;
|
|
4415
|
+
var ReactIs = requireReactIs$2();
|
|
4416
|
+
var assign = requireObjectAssign$2();
|
|
4417
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$2();
|
|
4418
|
+
var has = /*@__PURE__*/requireHas$2();
|
|
4419
|
+
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes$2();
|
|
4420
|
+
var printWarning = function () {};
|
|
4421
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4422
|
+
printWarning = function (text) {
|
|
4423
|
+
var message = 'Warning: ' + text;
|
|
4424
|
+
if (typeof console !== 'undefined') {
|
|
4425
|
+
console.error(message);
|
|
4426
|
+
}
|
|
4427
|
+
try {
|
|
4428
|
+
// --- Welcome to debugging React ---
|
|
4429
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
4430
|
+
// to find the callsite that caused this warning to fire.
|
|
4431
|
+
throw new Error(message);
|
|
4432
|
+
} catch (x) {}
|
|
4433
|
+
};
|
|
4434
|
+
}
|
|
4435
|
+
function emptyFunctionThatReturnsNull() {
|
|
4436
|
+
return null;
|
|
4437
|
+
}
|
|
4438
|
+
factoryWithTypeCheckers$2 = function (isValidElement, throwOnDirectAccess) {
|
|
4439
|
+
/* global Symbol */
|
|
4440
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
4441
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
4442
|
+
|
|
4443
|
+
/**
|
|
4444
|
+
* Returns the iterator method function contained on the iterable object.
|
|
4445
|
+
*
|
|
4446
|
+
* Be sure to invoke the function with the iterable as context:
|
|
4447
|
+
*
|
|
4448
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
4449
|
+
* if (iteratorFn) {
|
|
4450
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
4451
|
+
* ...
|
|
4452
|
+
* }
|
|
4453
|
+
*
|
|
4454
|
+
* @param {?object} maybeIterable
|
|
4455
|
+
* @return {?function}
|
|
4456
|
+
*/
|
|
4457
|
+
function getIteratorFn(maybeIterable) {
|
|
4458
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
4459
|
+
if (typeof iteratorFn === 'function') {
|
|
4460
|
+
return iteratorFn;
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4464
|
+
/**
|
|
4465
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
4466
|
+
* supplied to React components. Example usage:
|
|
4467
|
+
*
|
|
4468
|
+
* var Props = require('ReactPropTypes');
|
|
4469
|
+
* var MyArticle = React.createClass({
|
|
4470
|
+
* propTypes: {
|
|
4471
|
+
* // An optional string prop named "description".
|
|
4472
|
+
* description: Props.string,
|
|
4473
|
+
*
|
|
4474
|
+
* // A required enum prop named "category".
|
|
4475
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
4476
|
+
*
|
|
4477
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
4478
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
4479
|
+
* },
|
|
4480
|
+
* render: function() { ... }
|
|
4481
|
+
* });
|
|
4482
|
+
*
|
|
4483
|
+
* A more formal specification of how these methods are used:
|
|
4484
|
+
*
|
|
4485
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
4486
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
4487
|
+
*
|
|
4488
|
+
* Each and every declaration produces a function with the same signature. This
|
|
4489
|
+
* allows the creation of custom validation functions. For example:
|
|
4490
|
+
*
|
|
4491
|
+
* var MyLink = React.createClass({
|
|
4492
|
+
* propTypes: {
|
|
4493
|
+
* // An optional string or URI prop named "href".
|
|
4494
|
+
* href: function(props, propName, componentName) {
|
|
4495
|
+
* var propValue = props[propName];
|
|
4496
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
4497
|
+
* !(propValue instanceof URI)) {
|
|
4498
|
+
* return new Error(
|
|
4499
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
4500
|
+
* componentName
|
|
4501
|
+
* );
|
|
4502
|
+
* }
|
|
4503
|
+
* }
|
|
4504
|
+
* },
|
|
4505
|
+
* render: function() {...}
|
|
4506
|
+
* });
|
|
4507
|
+
*
|
|
4508
|
+
* @internal
|
|
4509
|
+
*/
|
|
4510
|
+
|
|
4511
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
4512
|
+
|
|
4513
|
+
// Important!
|
|
4514
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
4515
|
+
var ReactPropTypes = {
|
|
4516
|
+
array: createPrimitiveTypeChecker('array'),
|
|
4517
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
4518
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
4519
|
+
func: createPrimitiveTypeChecker('function'),
|
|
4520
|
+
number: createPrimitiveTypeChecker('number'),
|
|
4521
|
+
object: createPrimitiveTypeChecker('object'),
|
|
4522
|
+
string: createPrimitiveTypeChecker('string'),
|
|
4523
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
4524
|
+
any: createAnyTypeChecker(),
|
|
4525
|
+
arrayOf: createArrayOfTypeChecker,
|
|
4526
|
+
element: createElementTypeChecker(),
|
|
4527
|
+
elementType: createElementTypeTypeChecker(),
|
|
4528
|
+
instanceOf: createInstanceTypeChecker,
|
|
4529
|
+
node: createNodeChecker(),
|
|
4530
|
+
objectOf: createObjectOfTypeChecker,
|
|
4531
|
+
oneOf: createEnumTypeChecker,
|
|
4532
|
+
oneOfType: createUnionTypeChecker,
|
|
4533
|
+
shape: createShapeTypeChecker,
|
|
4534
|
+
exact: createStrictShapeTypeChecker
|
|
4535
|
+
};
|
|
4536
|
+
|
|
4537
|
+
/**
|
|
4538
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
4539
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
4540
|
+
*/
|
|
4541
|
+
/*eslint-disable no-self-compare*/
|
|
4542
|
+
function is(x, y) {
|
|
4543
|
+
// SameValue algorithm
|
|
4544
|
+
if (x === y) {
|
|
4545
|
+
// Steps 1-5, 7-10
|
|
4546
|
+
// Steps 6.b-6.e: +0 != -0
|
|
4547
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
4548
|
+
} else {
|
|
4549
|
+
// Step 6.a: NaN == NaN
|
|
4550
|
+
return x !== x && y !== y;
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
/*eslint-enable no-self-compare*/
|
|
4554
|
+
|
|
4555
|
+
/**
|
|
4556
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
4557
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
4558
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
4559
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
4560
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
4561
|
+
*/
|
|
4562
|
+
function PropTypeError(message, data) {
|
|
4563
|
+
this.message = message;
|
|
4564
|
+
this.data = data && typeof data === 'object' ? data : {};
|
|
4565
|
+
this.stack = '';
|
|
4566
|
+
}
|
|
4567
|
+
// Make `instanceof Error` still work for returned errors.
|
|
4568
|
+
PropTypeError.prototype = Error.prototype;
|
|
4569
|
+
function createChainableTypeChecker(validate) {
|
|
4570
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4571
|
+
var manualPropTypeCallCache = {};
|
|
4572
|
+
var manualPropTypeWarningCount = 0;
|
|
4573
|
+
}
|
|
4574
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
4575
|
+
componentName = componentName || ANONYMOUS;
|
|
4576
|
+
propFullName = propFullName || propName;
|
|
4577
|
+
if (secret !== ReactPropTypesSecret) {
|
|
4578
|
+
if (throwOnDirectAccess) {
|
|
4579
|
+
// New behavior only for users of `prop-types` package
|
|
4580
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
4581
|
+
err.name = 'Invariant Violation';
|
|
4582
|
+
throw err;
|
|
4583
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
4584
|
+
// Old behavior for people using React.PropTypes
|
|
4585
|
+
var cacheKey = componentName + ':' + propName;
|
|
4586
|
+
if (!manualPropTypeCallCache[cacheKey] &&
|
|
4587
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
4588
|
+
manualPropTypeWarningCount < 3) {
|
|
4589
|
+
printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
|
4590
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
4591
|
+
manualPropTypeWarningCount++;
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
if (props[propName] == null) {
|
|
4596
|
+
if (isRequired) {
|
|
4597
|
+
if (props[propName] === null) {
|
|
4598
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
4599
|
+
}
|
|
4600
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
4601
|
+
}
|
|
4602
|
+
return null;
|
|
4603
|
+
} else {
|
|
4604
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
4608
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
4609
|
+
return chainedCheckType;
|
|
4610
|
+
}
|
|
4611
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
4612
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
4613
|
+
var propValue = props[propName];
|
|
4614
|
+
var propType = getPropType(propValue);
|
|
4615
|
+
if (propType !== expectedType) {
|
|
4616
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
4617
|
+
// check, but we can offer a more precise error message here rather than
|
|
4618
|
+
// 'of type `object`'.
|
|
4619
|
+
var preciseType = getPreciseType(propValue);
|
|
4620
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
|
|
4621
|
+
expectedType: expectedType
|
|
4622
|
+
});
|
|
4623
|
+
}
|
|
4624
|
+
return null;
|
|
4625
|
+
}
|
|
4626
|
+
return createChainableTypeChecker(validate);
|
|
4627
|
+
}
|
|
4628
|
+
function createAnyTypeChecker() {
|
|
4629
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
4630
|
+
}
|
|
4631
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
4632
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4633
|
+
if (typeof typeChecker !== 'function') {
|
|
4634
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
4635
|
+
}
|
|
4636
|
+
var propValue = props[propName];
|
|
4637
|
+
if (!Array.isArray(propValue)) {
|
|
4638
|
+
var propType = getPropType(propValue);
|
|
4639
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
4640
|
+
}
|
|
4641
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
4642
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
4643
|
+
if (error instanceof Error) {
|
|
4644
|
+
return error;
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
return null;
|
|
4648
|
+
}
|
|
4649
|
+
return createChainableTypeChecker(validate);
|
|
4650
|
+
}
|
|
4651
|
+
function createElementTypeChecker() {
|
|
4652
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4653
|
+
var propValue = props[propName];
|
|
4654
|
+
if (!isValidElement(propValue)) {
|
|
4655
|
+
var propType = getPropType(propValue);
|
|
4656
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
4657
|
+
}
|
|
4658
|
+
return null;
|
|
4659
|
+
}
|
|
4660
|
+
return createChainableTypeChecker(validate);
|
|
4661
|
+
}
|
|
4662
|
+
function createElementTypeTypeChecker() {
|
|
4663
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4664
|
+
var propValue = props[propName];
|
|
4665
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
4666
|
+
var propType = getPropType(propValue);
|
|
4667
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
4668
|
+
}
|
|
4669
|
+
return null;
|
|
4670
|
+
}
|
|
4671
|
+
return createChainableTypeChecker(validate);
|
|
4672
|
+
}
|
|
4673
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
4674
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4675
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
4676
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
4677
|
+
var actualClassName = getClassName(props[propName]);
|
|
4678
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
4679
|
+
}
|
|
4680
|
+
return null;
|
|
4681
|
+
}
|
|
4682
|
+
return createChainableTypeChecker(validate);
|
|
4683
|
+
}
|
|
4684
|
+
function createEnumTypeChecker(expectedValues) {
|
|
4685
|
+
if (!Array.isArray(expectedValues)) {
|
|
4686
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4687
|
+
if (arguments.length > 1) {
|
|
4688
|
+
printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
|
|
4689
|
+
} else {
|
|
4690
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
4691
|
+
}
|
|
4692
|
+
}
|
|
4693
|
+
return emptyFunctionThatReturnsNull;
|
|
4694
|
+
}
|
|
4695
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4696
|
+
var propValue = props[propName];
|
|
4697
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
4698
|
+
if (is(propValue, expectedValues[i])) {
|
|
4699
|
+
return null;
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
4703
|
+
var type = getPreciseType(value);
|
|
4704
|
+
if (type === 'symbol') {
|
|
4705
|
+
return String(value);
|
|
4706
|
+
}
|
|
4707
|
+
return value;
|
|
4708
|
+
});
|
|
4709
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
4710
|
+
}
|
|
4711
|
+
return createChainableTypeChecker(validate);
|
|
4712
|
+
}
|
|
4713
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
4714
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4715
|
+
if (typeof typeChecker !== 'function') {
|
|
4716
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
4717
|
+
}
|
|
4718
|
+
var propValue = props[propName];
|
|
4719
|
+
var propType = getPropType(propValue);
|
|
4720
|
+
if (propType !== 'object') {
|
|
4721
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
4722
|
+
}
|
|
4723
|
+
for (var key in propValue) {
|
|
4724
|
+
if (has(propValue, key)) {
|
|
4725
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4726
|
+
if (error instanceof Error) {
|
|
4727
|
+
return error;
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
return null;
|
|
4732
|
+
}
|
|
4733
|
+
return createChainableTypeChecker(validate);
|
|
4734
|
+
}
|
|
4735
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
4736
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
4737
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
4738
|
+
return emptyFunctionThatReturnsNull;
|
|
4739
|
+
}
|
|
4740
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
4741
|
+
var checker = arrayOfTypeCheckers[i];
|
|
4742
|
+
if (typeof checker !== 'function') {
|
|
4743
|
+
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
4744
|
+
return emptyFunctionThatReturnsNull;
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4747
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4748
|
+
var expectedTypes = [];
|
|
4749
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
4750
|
+
var checker = arrayOfTypeCheckers[i];
|
|
4751
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
4752
|
+
if (checkerResult == null) {
|
|
4753
|
+
return null;
|
|
4754
|
+
}
|
|
4755
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
4756
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
4760
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
4761
|
+
}
|
|
4762
|
+
return createChainableTypeChecker(validate);
|
|
4763
|
+
}
|
|
4764
|
+
function createNodeChecker() {
|
|
4765
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4766
|
+
if (!isNode(props[propName])) {
|
|
4767
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
4768
|
+
}
|
|
4769
|
+
return null;
|
|
4770
|
+
}
|
|
4771
|
+
return createChainableTypeChecker(validate);
|
|
4772
|
+
}
|
|
4773
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
4774
|
+
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
|
|
4775
|
+
}
|
|
4776
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
4777
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4778
|
+
var propValue = props[propName];
|
|
4779
|
+
var propType = getPropType(propValue);
|
|
4780
|
+
if (propType !== 'object') {
|
|
4781
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
4782
|
+
}
|
|
4783
|
+
for (var key in shapeTypes) {
|
|
4784
|
+
var checker = shapeTypes[key];
|
|
4785
|
+
if (typeof checker !== 'function') {
|
|
4786
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
4787
|
+
}
|
|
4788
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4789
|
+
if (error) {
|
|
4790
|
+
return error;
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
return null;
|
|
4794
|
+
}
|
|
4795
|
+
return createChainableTypeChecker(validate);
|
|
4796
|
+
}
|
|
4797
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
4798
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4799
|
+
var propValue = props[propName];
|
|
4800
|
+
var propType = getPropType(propValue);
|
|
4801
|
+
if (propType !== 'object') {
|
|
4802
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
4803
|
+
}
|
|
4804
|
+
// We need to check all keys in case some are required but missing from props.
|
|
4805
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
4806
|
+
for (var key in allKeys) {
|
|
4807
|
+
var checker = shapeTypes[key];
|
|
4808
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
4809
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
4810
|
+
}
|
|
4811
|
+
if (!checker) {
|
|
4812
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
|
4813
|
+
}
|
|
4814
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4815
|
+
if (error) {
|
|
4816
|
+
return error;
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4819
|
+
return null;
|
|
4820
|
+
}
|
|
4821
|
+
return createChainableTypeChecker(validate);
|
|
4822
|
+
}
|
|
4823
|
+
function isNode(propValue) {
|
|
4824
|
+
switch (typeof propValue) {
|
|
4825
|
+
case 'number':
|
|
4826
|
+
case 'string':
|
|
4827
|
+
case 'undefined':
|
|
4828
|
+
return true;
|
|
4829
|
+
case 'boolean':
|
|
4830
|
+
return !propValue;
|
|
4831
|
+
case 'object':
|
|
4832
|
+
if (Array.isArray(propValue)) {
|
|
4833
|
+
return propValue.every(isNode);
|
|
4834
|
+
}
|
|
4835
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
4836
|
+
return true;
|
|
4837
|
+
}
|
|
4838
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
4839
|
+
if (iteratorFn) {
|
|
4840
|
+
var iterator = iteratorFn.call(propValue);
|
|
4841
|
+
var step;
|
|
4842
|
+
if (iteratorFn !== propValue.entries) {
|
|
4843
|
+
while (!(step = iterator.next()).done) {
|
|
4844
|
+
if (!isNode(step.value)) {
|
|
4845
|
+
return false;
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4848
|
+
} else {
|
|
4849
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
4850
|
+
while (!(step = iterator.next()).done) {
|
|
4851
|
+
var entry = step.value;
|
|
4852
|
+
if (entry) {
|
|
4853
|
+
if (!isNode(entry[1])) {
|
|
4854
|
+
return false;
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
} else {
|
|
4860
|
+
return false;
|
|
4861
|
+
}
|
|
4862
|
+
return true;
|
|
4863
|
+
default:
|
|
4864
|
+
return false;
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
function isSymbol(propType, propValue) {
|
|
4868
|
+
// Native Symbol.
|
|
4869
|
+
if (propType === 'symbol') {
|
|
4870
|
+
return true;
|
|
4871
|
+
}
|
|
4872
|
+
|
|
4873
|
+
// falsy value can't be a Symbol
|
|
4874
|
+
if (!propValue) {
|
|
4875
|
+
return false;
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4878
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
4879
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
4880
|
+
return true;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
4884
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
4885
|
+
return true;
|
|
4886
|
+
}
|
|
4887
|
+
return false;
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
4891
|
+
function getPropType(propValue) {
|
|
4892
|
+
var propType = typeof propValue;
|
|
4893
|
+
if (Array.isArray(propValue)) {
|
|
4894
|
+
return 'array';
|
|
4895
|
+
}
|
|
4896
|
+
if (propValue instanceof RegExp) {
|
|
4897
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
4898
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
4899
|
+
// passes PropTypes.object.
|
|
4900
|
+
return 'object';
|
|
4901
|
+
}
|
|
4902
|
+
if (isSymbol(propType, propValue)) {
|
|
4903
|
+
return 'symbol';
|
|
4904
|
+
}
|
|
4905
|
+
return propType;
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4908
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
4909
|
+
// See `createPrimitiveTypeChecker`.
|
|
4910
|
+
function getPreciseType(propValue) {
|
|
4911
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
4912
|
+
return '' + propValue;
|
|
4913
|
+
}
|
|
4914
|
+
var propType = getPropType(propValue);
|
|
4915
|
+
if (propType === 'object') {
|
|
4916
|
+
if (propValue instanceof Date) {
|
|
4917
|
+
return 'date';
|
|
4918
|
+
} else if (propValue instanceof RegExp) {
|
|
4919
|
+
return 'regexp';
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
return propType;
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
4926
|
+
// For example, "undefined" or "of type array"
|
|
4927
|
+
function getPostfixForTypeWarning(value) {
|
|
4928
|
+
var type = getPreciseType(value);
|
|
4929
|
+
switch (type) {
|
|
4930
|
+
case 'array':
|
|
4931
|
+
case 'object':
|
|
4932
|
+
return 'an ' + type;
|
|
4933
|
+
case 'boolean':
|
|
4934
|
+
case 'date':
|
|
4935
|
+
case 'regexp':
|
|
4936
|
+
return 'a ' + type;
|
|
4937
|
+
default:
|
|
4938
|
+
return type;
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
|
|
4942
|
+
// Returns class name of the object, if any.
|
|
4943
|
+
function getClassName(propValue) {
|
|
4944
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
4945
|
+
return ANONYMOUS;
|
|
4946
|
+
}
|
|
4947
|
+
return propValue.constructor.name;
|
|
4948
|
+
}
|
|
4949
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
4950
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
4951
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
4952
|
+
return ReactPropTypes;
|
|
4953
|
+
};
|
|
4954
|
+
return factoryWithTypeCheckers$2;
|
|
4955
|
+
}
|
|
4956
|
+
|
|
4957
|
+
/**
|
|
4958
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4959
|
+
*
|
|
4960
|
+
* This source code is licensed under the MIT license found in the
|
|
4961
|
+
* LICENSE file in the root directory of this source tree.
|
|
4962
|
+
*/
|
|
4963
|
+
|
|
4964
|
+
var factoryWithThrowingShims$2;
|
|
4965
|
+
var hasRequiredFactoryWithThrowingShims$2;
|
|
4966
|
+
function requireFactoryWithThrowingShims$2() {
|
|
4967
|
+
if (hasRequiredFactoryWithThrowingShims$2) return factoryWithThrowingShims$2;
|
|
4968
|
+
hasRequiredFactoryWithThrowingShims$2 = 1;
|
|
4969
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$2();
|
|
4970
|
+
function emptyFunction() {}
|
|
4971
|
+
function emptyFunctionWithReset() {}
|
|
4972
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
4973
|
+
factoryWithThrowingShims$2 = function () {
|
|
4974
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
4975
|
+
if (secret === ReactPropTypesSecret) {
|
|
4976
|
+
// It is still safe when called from React.
|
|
4977
|
+
return;
|
|
4978
|
+
}
|
|
4979
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
4980
|
+
err.name = 'Invariant Violation';
|
|
4981
|
+
throw err;
|
|
4982
|
+
}
|
|
4983
|
+
shim.isRequired = shim;
|
|
4984
|
+
function getShim() {
|
|
4985
|
+
return shim;
|
|
4986
|
+
} // Important!
|
|
4987
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
4988
|
+
var ReactPropTypes = {
|
|
4989
|
+
array: shim,
|
|
4990
|
+
bigint: shim,
|
|
4991
|
+
bool: shim,
|
|
4992
|
+
func: shim,
|
|
4993
|
+
number: shim,
|
|
4994
|
+
object: shim,
|
|
4995
|
+
string: shim,
|
|
4996
|
+
symbol: shim,
|
|
4997
|
+
any: shim,
|
|
4998
|
+
arrayOf: getShim,
|
|
4999
|
+
element: shim,
|
|
5000
|
+
elementType: shim,
|
|
5001
|
+
instanceOf: getShim,
|
|
5002
|
+
node: shim,
|
|
5003
|
+
objectOf: getShim,
|
|
5004
|
+
oneOf: getShim,
|
|
5005
|
+
oneOfType: getShim,
|
|
5006
|
+
shape: getShim,
|
|
5007
|
+
exact: getShim,
|
|
5008
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
5009
|
+
resetWarningCache: emptyFunction
|
|
5010
|
+
};
|
|
5011
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
5012
|
+
return ReactPropTypes;
|
|
5013
|
+
};
|
|
5014
|
+
return factoryWithThrowingShims$2;
|
|
5015
|
+
}
|
|
5016
|
+
|
|
5017
|
+
/**
|
|
5018
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5019
|
+
*
|
|
5020
|
+
* This source code is licensed under the MIT license found in the
|
|
5021
|
+
* LICENSE file in the root directory of this source tree.
|
|
5022
|
+
*/
|
|
5023
|
+
|
|
5024
|
+
var hasRequiredPropTypes$2;
|
|
5025
|
+
function requirePropTypes$2() {
|
|
5026
|
+
if (hasRequiredPropTypes$2) return propTypes$2.exports;
|
|
5027
|
+
hasRequiredPropTypes$2 = 1;
|
|
5028
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5029
|
+
var ReactIs = requireReactIs$2();
|
|
5030
|
+
|
|
5031
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
5032
|
+
// http://fb.me/prop-types-in-prod
|
|
5033
|
+
var throwOnDirectAccess = true;
|
|
5034
|
+
propTypes$2.exports = /*@__PURE__*/requireFactoryWithTypeCheckers$2()(ReactIs.isElement, throwOnDirectAccess);
|
|
5035
|
+
} else {
|
|
5036
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
5037
|
+
// http://fb.me/prop-types-in-prod
|
|
5038
|
+
propTypes$2.exports = /*@__PURE__*/requireFactoryWithThrowingShims$2()();
|
|
5039
|
+
}
|
|
5040
|
+
return propTypes$2.exports;
|
|
5041
|
+
}
|
|
5042
|
+
var propTypesExports$2 = /*@__PURE__*/requirePropTypes$2();
|
|
5043
|
+
var PropTypes$2 = /*@__PURE__*/getDefaultExportFromCjs$2(propTypesExports$2);
|
|
5044
|
+
({
|
|
5045
|
+
onPowerOff: PropTypes$2.func,
|
|
5046
|
+
onRestart: PropTypes$2.func,
|
|
5047
|
+
powerOffLabel: PropTypes$2.string,
|
|
5048
|
+
restartLabel: PropTypes$2.string,
|
|
5049
|
+
iconClassName: PropTypes$2.string,
|
|
5050
|
+
confirmTitle: PropTypes$2.string,
|
|
5051
|
+
cancelText: PropTypes$2.string,
|
|
5052
|
+
okText: PropTypes$2.string,
|
|
5053
|
+
run: PropTypes$2.func
|
|
5054
|
+
});
|
|
5055
|
+
({
|
|
5056
|
+
logoUrl: PropTypes$2.string,
|
|
5057
|
+
logoWidth: PropTypes$2.number,
|
|
5058
|
+
logoAlt: PropTypes$2.string,
|
|
5059
|
+
onClick: PropTypes$2.func
|
|
5060
|
+
});
|
|
5061
|
+
|
|
5062
|
+
// PropTypes 类型检查
|
|
5063
|
+
({
|
|
5064
|
+
menuElement: PropTypes$2.node,
|
|
5065
|
+
productInfo: PropTypes$2.shape({
|
|
5066
|
+
productName: PropTypes$2.string,
|
|
5067
|
+
version: PropTypes$2.string
|
|
5068
|
+
}),
|
|
5069
|
+
showLogo: PropTypes$2.bool,
|
|
5070
|
+
showProductInfo: PropTypes$2.bool,
|
|
5071
|
+
showHardwareUsage: PropTypes$2.bool,
|
|
5072
|
+
showSystemOperations: PropTypes$2.bool,
|
|
5073
|
+
onPowerOff: PropTypes$2.func,
|
|
5074
|
+
onRestart: PropTypes$2.func,
|
|
5075
|
+
onRun: PropTypes$2.func,
|
|
5076
|
+
hardwareMonitorUrl: PropTypes$2.string,
|
|
5077
|
+
getSocketUrl: PropTypes$2.func,
|
|
5078
|
+
logoProps: PropTypes$2.object,
|
|
5079
|
+
className: PropTypes$2.string,
|
|
5080
|
+
style: PropTypes$2.object
|
|
5081
|
+
});
|
|
3802
5082
|
function getDefaultExportFromCjs$1(x) {
|
|
3803
5083
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3804
5084
|
}
|
|
@@ -6250,7 +7530,7 @@ const NmosModal = _ref => {
|
|
|
6250
7530
|
const values = await form.getFieldsValue();
|
|
6251
7531
|
setLoading(true);
|
|
6252
7532
|
try {
|
|
6253
|
-
const response = await updateNmosSettings(_objectSpread2(_objectSpread2({}, nmosSettings), values));
|
|
7533
|
+
const response = await updateNmosSettings(_objectSpread2$1(_objectSpread2$1({}, nmosSettings), values));
|
|
6254
7534
|
if (response) {
|
|
6255
7535
|
message.success('Success');
|
|
6256
7536
|
setTimeout(() => {
|
|
@@ -6263,7 +7543,7 @@ const NmosModal = _ref => {
|
|
|
6263
7543
|
setLoading(false);
|
|
6264
7544
|
}
|
|
6265
7545
|
};
|
|
6266
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
7546
|
+
return /*#__PURE__*/jsx(StyledModal$1, _objectSpread2$1(_objectSpread2$1({
|
|
6267
7547
|
title: "NMOS",
|
|
6268
7548
|
width: 650,
|
|
6269
7549
|
open: open,
|
|
@@ -6272,7 +7552,7 @@ const NmosModal = _ref => {
|
|
|
6272
7552
|
confirmLoading: loading,
|
|
6273
7553
|
destroyOnClose: true // 关闭时销毁组件,确保下次打开重新初始化
|
|
6274
7554
|
}, modalProps), {}, {
|
|
6275
|
-
children: /*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({
|
|
7555
|
+
children: /*#__PURE__*/jsxs(Form, _objectSpread2$1(_objectSpread2$1({
|
|
6276
7556
|
form: form,
|
|
6277
7557
|
name: "nmosForm",
|
|
6278
7558
|
labelCol: {
|
|
@@ -6308,7 +7588,7 @@ const NmosModal = _ref => {
|
|
|
6308
7588
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
6309
7589
|
label: "Registry Port",
|
|
6310
7590
|
name: "registration_port",
|
|
6311
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
7591
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2$1(_objectSpread2$1({}, numberProps), {}, {
|
|
6312
7592
|
min: 0,
|
|
6313
7593
|
max: 65535,
|
|
6314
7594
|
style: {
|
|
@@ -6337,7 +7617,7 @@ const NmosModal = _ref => {
|
|
|
6337
7617
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
6338
7618
|
label: "Logging Level",
|
|
6339
7619
|
name: "logging_level",
|
|
6340
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
7620
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2$1(_objectSpread2$1({}, numberProps), {}, {
|
|
6341
7621
|
min: -40,
|
|
6342
7622
|
max: 40,
|
|
6343
7623
|
style: {
|
|
@@ -6445,7 +7725,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
6445
7725
|
// 新增 disabled 属性
|
|
6446
7726
|
style
|
|
6447
7727
|
} = _ref2,
|
|
6448
|
-
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
7728
|
+
restProps = _objectWithoutProperties$1(_ref2, _excluded);
|
|
6449
7729
|
const inputRef = useRef(null);
|
|
6450
7730
|
const [isMouseDown, setIsMouseDown] = useState(false);
|
|
6451
7731
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -6554,7 +7834,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
6554
7834
|
applyMovement(totalMovement.current, e);
|
|
6555
7835
|
}, [isMouseDown, disabled]);
|
|
6556
7836
|
const getModifiers = useCallback(e => {
|
|
6557
|
-
const mods = _objectSpread2(_objectSpread2({}, defaultModifiers), modifierKeys);
|
|
7837
|
+
const mods = _objectSpread2$1(_objectSpread2$1({}, defaultModifiers), modifierKeys);
|
|
6558
7838
|
for (const key in mods) {
|
|
6559
7839
|
if (key !== "default" && e[key]) {
|
|
6560
7840
|
currentMultiplier.current = mods[key].multiplier;
|
|
@@ -6670,7 +7950,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
6670
7950
|
background: 'rgba(255, 255, 255, 0.08)',
|
|
6671
7951
|
color: 'rgba(255, 255, 255, 0.25)'
|
|
6672
7952
|
} : {};
|
|
6673
|
-
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2({
|
|
7953
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2$1({
|
|
6674
7954
|
ref: inputRef,
|
|
6675
7955
|
type: "text",
|
|
6676
7956
|
inputMode: "numeric",
|
|
@@ -6684,7 +7964,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
6684
7964
|
disabled: disabled,
|
|
6685
7965
|
// 添加 disabled 属性
|
|
6686
7966
|
className: "draggable-number-input ".concat(className, " ").concat(isDragging ? "dragging" : "", " ").concat(disabled ? "disabled" : ""),
|
|
6687
|
-
style: _objectSpread2(_objectSpread2(_objectSpread2({}, {
|
|
7967
|
+
style: _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, {
|
|
6688
7968
|
cursor: disabled ? 'not-allowed' : 'ew-resize',
|
|
6689
7969
|
userSelect: disabled ? 'none' : 'auto',
|
|
6690
7970
|
caretColor: isDragging ? "transparent" : "initial"
|
|
@@ -6694,5 +7974,5 @@ function DraggableNumberInput(_ref2) {
|
|
|
6694
7974
|
}));
|
|
6695
7975
|
}
|
|
6696
7976
|
|
|
6697
|
-
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$
|
|
7977
|
+
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$3 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, useAuth, useHardwareUsage$1 as useHardwareUsage, usePageReload$1 as usePageReload, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade };
|
|
6698
7978
|
//# sourceMappingURL=index.esm.js.map
|