seeder-st2110-components 1.7.9 → 1.7.10
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 +1982 -226
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1987 -226
- 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$4 = ["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$4);
|
|
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,
|
|
@@ -928,6 +928,555 @@ const usePageReload = () => {
|
|
|
928
928
|
};
|
|
929
929
|
var usePageReload$1 = usePageReload;
|
|
930
930
|
|
|
931
|
+
const getReadyStateText = state => {
|
|
932
|
+
const states = {
|
|
933
|
+
0: 'CONNECTING',
|
|
934
|
+
1: 'OPEN',
|
|
935
|
+
2: 'CLOSING',
|
|
936
|
+
3: 'CLOSED'
|
|
937
|
+
};
|
|
938
|
+
return states[state] || "UNKNOWN(".concat(state, ")");
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
// 创建空日志器
|
|
942
|
+
const createDummyLogger = () => {
|
|
943
|
+
const dummyFn = () => {};
|
|
944
|
+
return {
|
|
945
|
+
log: dummyFn,
|
|
946
|
+
exportLogs: dummyFn,
|
|
947
|
+
getLogStats: () => ({
|
|
948
|
+
total: 0,
|
|
949
|
+
errors: 0,
|
|
950
|
+
warnings: 0,
|
|
951
|
+
info: 0,
|
|
952
|
+
lastTimestamp: null
|
|
953
|
+
}),
|
|
954
|
+
clearLogs: dummyFn,
|
|
955
|
+
logs: []
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
// 创建通用的日志器
|
|
960
|
+
const createGlobalLogger = function () {
|
|
961
|
+
let webSocketUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
962
|
+
const logs = [];
|
|
963
|
+
const maxLogs = 1000;
|
|
964
|
+
|
|
965
|
+
// 判断是否为开发环境
|
|
966
|
+
const isDevelopment = process.env.NODE_ENV === 'development';
|
|
967
|
+
const log = function (level, message) {
|
|
968
|
+
let data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
969
|
+
const timestamp = new Date().toISOString();
|
|
970
|
+
const logEntry = {
|
|
971
|
+
timestamp,
|
|
972
|
+
level,
|
|
973
|
+
message,
|
|
974
|
+
data,
|
|
975
|
+
timestampDisplay: new Date().toLocaleString('zh-CN', {
|
|
976
|
+
year: 'numeric',
|
|
977
|
+
month: '2-digit',
|
|
978
|
+
day: '2-digit',
|
|
979
|
+
hour: '2-digit',
|
|
980
|
+
minute: '2-digit',
|
|
981
|
+
second: '2-digit',
|
|
982
|
+
hour12: false
|
|
983
|
+
})
|
|
984
|
+
};
|
|
985
|
+
logs.push(logEntry);
|
|
986
|
+
if (logs.length > maxLogs) logs.shift();
|
|
987
|
+
|
|
988
|
+
// 只在开发环境下输出到控制台
|
|
989
|
+
if (isDevelopment) {
|
|
990
|
+
const consoleMessage = "[".concat(logEntry.timestampDisplay, "] [WebSocket] [").concat(level, "] ").concat(message);
|
|
991
|
+
const consoleArgs = [consoleMessage];
|
|
992
|
+
if (Object.keys(data).length > 0) consoleArgs.push(data);
|
|
993
|
+
switch (level) {
|
|
994
|
+
case 'ERROR':
|
|
995
|
+
console.error(...consoleArgs);
|
|
996
|
+
break;
|
|
997
|
+
case 'WARN':
|
|
998
|
+
console.warn(...consoleArgs);
|
|
999
|
+
break;
|
|
1000
|
+
case 'INFO':
|
|
1001
|
+
console.info(...consoleArgs);
|
|
1002
|
+
break;
|
|
1003
|
+
default:
|
|
1004
|
+
console.log(...consoleArgs);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return logEntry;
|
|
1008
|
+
};
|
|
1009
|
+
const exportLogs = function () {
|
|
1010
|
+
let filenamePrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'websocket';
|
|
1011
|
+
if (logs.length === 0) {
|
|
1012
|
+
log('WARN', '没有日志可导出', {
|
|
1013
|
+
filenamePrefix
|
|
1014
|
+
});
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
const logText = logs.map(entry => "[".concat(entry.timestampDisplay, "] [").concat(entry.level, "] ").concat(entry.message, "\n\u6570\u636E: ").concat(JSON.stringify(entry.data, null, 2))).join('\n' + '='.repeat(50) + '\n');
|
|
1018
|
+
const blob = new Blob([logText], {
|
|
1019
|
+
type: 'text/plain;charset=utf-8'
|
|
1020
|
+
});
|
|
1021
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
1022
|
+
let hostname = 'unknown';
|
|
1023
|
+
let pathname = 'unknown';
|
|
1024
|
+
try {
|
|
1025
|
+
if (webSocketUrl) {
|
|
1026
|
+
const urlObj = new URL(webSocketUrl.replace(/^ws/, 'http'));
|
|
1027
|
+
hostname = urlObj.hostname.replace(/\./g, '-');
|
|
1028
|
+
pathname = urlObj.pathname.replace(/\//g, '-').replace(/^-|-$/g, '') || 'root';
|
|
1029
|
+
}
|
|
1030
|
+
} catch (error) {
|
|
1031
|
+
console.warn('无法解析WebSocket URL:', error);
|
|
1032
|
+
}
|
|
1033
|
+
const readableTime = new Date().toLocaleString('zh-CN', {
|
|
1034
|
+
year: 'numeric',
|
|
1035
|
+
month: '2-digit',
|
|
1036
|
+
day: '2-digit',
|
|
1037
|
+
hour: '2-digit',
|
|
1038
|
+
minute: '2-digit',
|
|
1039
|
+
second: '2-digit',
|
|
1040
|
+
hour12: false
|
|
1041
|
+
}).replace(/[\/:\s]/g, '-');
|
|
1042
|
+
const filename = "".concat(filenamePrefix, "-").concat(hostname, "-").concat(pathname, "-").concat(readableTime, ".log");
|
|
1043
|
+
const a = document.createElement('a');
|
|
1044
|
+
a.href = blobUrl;
|
|
1045
|
+
a.download = filename;
|
|
1046
|
+
document.body.appendChild(a);
|
|
1047
|
+
a.click();
|
|
1048
|
+
document.body.removeChild(a);
|
|
1049
|
+
URL.revokeObjectURL(blobUrl);
|
|
1050
|
+
log('INFO', '日志文件已导出', {
|
|
1051
|
+
count: logs.length,
|
|
1052
|
+
filename
|
|
1053
|
+
});
|
|
1054
|
+
};
|
|
1055
|
+
const getLogStats = () => {
|
|
1056
|
+
var _logs;
|
|
1057
|
+
return {
|
|
1058
|
+
total: logs.length,
|
|
1059
|
+
errors: logs.filter(l => l.level === 'ERROR').length,
|
|
1060
|
+
warnings: logs.filter(l => l.level === 'WARN').length,
|
|
1061
|
+
info: logs.filter(l => l.level === 'INFO').length,
|
|
1062
|
+
lastTimestamp: (_logs = logs[logs.length - 1]) === null || _logs === void 0 ? void 0 : _logs.timestampDisplay
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
const clearLogs = () => {
|
|
1066
|
+
logs.length = 0;
|
|
1067
|
+
log('INFO', '日志已清空');
|
|
1068
|
+
};
|
|
1069
|
+
return {
|
|
1070
|
+
log,
|
|
1071
|
+
exportLogs,
|
|
1072
|
+
getLogStats,
|
|
1073
|
+
clearLogs,
|
|
1074
|
+
logs
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
// 心跳管理器
|
|
1079
|
+
const useHeartbeat = function (sendMessage, readyState, config, logger) {
|
|
1080
|
+
let enabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1081
|
+
const heartbeatTimerRef = useRef(null);
|
|
1082
|
+
const lastHeartbeatTimeRef = useRef(Date.now());
|
|
1083
|
+
const isMountedRef = useRef(true);
|
|
1084
|
+
const configRef = useRef({
|
|
1085
|
+
interval: (config === null || config === void 0 ? void 0 : config.interval) || 20000,
|
|
1086
|
+
message: (config === null || config === void 0 ? void 0 : config.message) || {
|
|
1087
|
+
type: 'ping'
|
|
1088
|
+
}
|
|
1089
|
+
});
|
|
1090
|
+
const stateRef = useRef({
|
|
1091
|
+
sendMessage,
|
|
1092
|
+
readyState,
|
|
1093
|
+
enabled
|
|
1094
|
+
});
|
|
1095
|
+
useEffect(() => {
|
|
1096
|
+
configRef.current = {
|
|
1097
|
+
interval: (config === null || config === void 0 ? void 0 : config.interval) || 20000,
|
|
1098
|
+
message: (config === null || config === void 0 ? void 0 : config.message) || {
|
|
1099
|
+
type: 'ping'
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
}, [config === null || config === void 0 ? void 0 : config.interval, config === null || config === void 0 ? void 0 : config.message]);
|
|
1103
|
+
useEffect(() => {
|
|
1104
|
+
stateRef.current = {
|
|
1105
|
+
sendMessage,
|
|
1106
|
+
readyState,
|
|
1107
|
+
enabled
|
|
1108
|
+
};
|
|
1109
|
+
}, [sendMessage, readyState, enabled]);
|
|
1110
|
+
useEffect(() => {
|
|
1111
|
+
return () => {
|
|
1112
|
+
isMountedRef.current = false;
|
|
1113
|
+
if (heartbeatTimerRef.current) {
|
|
1114
|
+
clearInterval(heartbeatTimerRef.current);
|
|
1115
|
+
}
|
|
1116
|
+
};
|
|
1117
|
+
}, []);
|
|
1118
|
+
const stopHeartbeat = useCallback(() => {
|
|
1119
|
+
if (heartbeatTimerRef.current) {
|
|
1120
|
+
clearInterval(heartbeatTimerRef.current);
|
|
1121
|
+
heartbeatTimerRef.current = null;
|
|
1122
|
+
if (stateRef.current.enabled) {
|
|
1123
|
+
logger.log('INFO', '停止心跳机制');
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
}, [logger]);
|
|
1127
|
+
const startHeartbeat = useCallback(() => {
|
|
1128
|
+
stopHeartbeat();
|
|
1129
|
+
const currentState = stateRef.current;
|
|
1130
|
+
const currentConfig = configRef.current;
|
|
1131
|
+
if (!currentState.enabled) return;
|
|
1132
|
+
logger.log('INFO', '启动心跳机制', {
|
|
1133
|
+
interval: currentConfig.interval
|
|
1134
|
+
});
|
|
1135
|
+
heartbeatTimerRef.current = setInterval(() => {
|
|
1136
|
+
// 检查组件是否挂载
|
|
1137
|
+
if (!isMountedRef.current || !heartbeatTimerRef.current) {
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
// 目的: 总是获取最新的值
|
|
1142
|
+
const latestState = stateRef.current;
|
|
1143
|
+
const latestConfig = configRef.current;
|
|
1144
|
+
if (latestState.sendMessage && latestState.readyState === 1) {
|
|
1145
|
+
try {
|
|
1146
|
+
latestState.sendMessage(JSON.stringify(latestConfig.message));
|
|
1147
|
+
lastHeartbeatTimeRef.current = Date.now();
|
|
1148
|
+
logger.log('DEBUG', '发送心跳包', {
|
|
1149
|
+
timeSinceLastHeartbeat: Date.now() - lastHeartbeatTimeRef.current,
|
|
1150
|
+
readyState: getReadyStateText(latestState.readyState)
|
|
1151
|
+
});
|
|
1152
|
+
} catch (error) {
|
|
1153
|
+
logger.log('ERROR', '发送心跳失败', {
|
|
1154
|
+
error: error.message,
|
|
1155
|
+
readyState: getReadyStateText(latestState.readyState)
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}, currentConfig.interval);
|
|
1160
|
+
}, [stopHeartbeat, logger]);
|
|
1161
|
+
|
|
1162
|
+
// 自动管理心跳
|
|
1163
|
+
useEffect(() => {
|
|
1164
|
+
const currentState = stateRef.current;
|
|
1165
|
+
if (currentState.enabled) {
|
|
1166
|
+
if (currentState.readyState === 1) {
|
|
1167
|
+
startHeartbeat();
|
|
1168
|
+
} else {
|
|
1169
|
+
stopHeartbeat();
|
|
1170
|
+
}
|
|
1171
|
+
} else {
|
|
1172
|
+
stopHeartbeat();
|
|
1173
|
+
}
|
|
1174
|
+
return () => {
|
|
1175
|
+
if (heartbeatTimerRef.current) {
|
|
1176
|
+
clearInterval(heartbeatTimerRef.current);
|
|
1177
|
+
heartbeatTimerRef.current = null;
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
}, [readyState, enabled, startHeartbeat, stopHeartbeat]);
|
|
1181
|
+
const heartbeatImpl = useMemo(() => {
|
|
1182
|
+
if (!enabled) {
|
|
1183
|
+
return {
|
|
1184
|
+
startHeartbeat: () => {},
|
|
1185
|
+
stopHeartbeat: () => {},
|
|
1186
|
+
getLastHeartbeatTime: () => null,
|
|
1187
|
+
isEnabled: false
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
return {
|
|
1191
|
+
startHeartbeat,
|
|
1192
|
+
stopHeartbeat,
|
|
1193
|
+
getLastHeartbeatTime: () => lastHeartbeatTimeRef.current,
|
|
1194
|
+
isEnabled: true
|
|
1195
|
+
};
|
|
1196
|
+
}, [enabled, startHeartbeat, stopHeartbeat]);
|
|
1197
|
+
return heartbeatImpl;
|
|
1198
|
+
};
|
|
1199
|
+
const useWebSocketWithFeatures = config => {
|
|
1200
|
+
const {
|
|
1201
|
+
url,
|
|
1202
|
+
options = {},
|
|
1203
|
+
heartbeat: heartbeatConfig = false,
|
|
1204
|
+
enableLog = true
|
|
1205
|
+
} = config;
|
|
1206
|
+
const [isConnected, setIsConnected] = useState(false);
|
|
1207
|
+
|
|
1208
|
+
// 创建 logger 实例
|
|
1209
|
+
const logger = useMemo(() => {
|
|
1210
|
+
if (enableLog) {
|
|
1211
|
+
return createGlobalLogger(url);
|
|
1212
|
+
}
|
|
1213
|
+
return createDummyLogger();
|
|
1214
|
+
}, [url, enableLog]);
|
|
1215
|
+
const websocketOptions = useMemo(() => _objectSpread2$1(_objectSpread2$1({}, options), {}, {
|
|
1216
|
+
onOpen: event => {
|
|
1217
|
+
var _options$onOpen;
|
|
1218
|
+
logger.log('INFO', 'WebSocket 连接成功', {
|
|
1219
|
+
url,
|
|
1220
|
+
readyState: getReadyStateText(1),
|
|
1221
|
+
// 连接成功时 readyState 为 1
|
|
1222
|
+
eventCode: event === null || event === void 0 ? void 0 : event.code
|
|
1223
|
+
});
|
|
1224
|
+
setIsConnected(true);
|
|
1225
|
+
(_options$onOpen = options.onOpen) === null || _options$onOpen === void 0 || _options$onOpen.call(options, event);
|
|
1226
|
+
},
|
|
1227
|
+
onError: error => {
|
|
1228
|
+
var _options$onError;
|
|
1229
|
+
logger.log('ERROR', 'WebSocket 连接错误', {
|
|
1230
|
+
url,
|
|
1231
|
+
error: error.message,
|
|
1232
|
+
errorType: error.type,
|
|
1233
|
+
readyState: getReadyStateText(3) // 错误时 readyState 为 3
|
|
1234
|
+
});
|
|
1235
|
+
setIsConnected(false);
|
|
1236
|
+
(_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, error);
|
|
1237
|
+
},
|
|
1238
|
+
onClose: event => {
|
|
1239
|
+
var _options$onClose;
|
|
1240
|
+
logger.log('WARN', 'WebSocket 连接断开', {
|
|
1241
|
+
url,
|
|
1242
|
+
code: event.code,
|
|
1243
|
+
reason: event.reason,
|
|
1244
|
+
wasClean: event.wasClean,
|
|
1245
|
+
readyState: getReadyStateText(3) // 关闭时 readyState 为 3
|
|
1246
|
+
});
|
|
1247
|
+
setIsConnected(false);
|
|
1248
|
+
(_options$onClose = options.onClose) === null || _options$onClose === void 0 || _options$onClose.call(options, event);
|
|
1249
|
+
},
|
|
1250
|
+
onReconnect: count => {
|
|
1251
|
+
var _options$onReconnect;
|
|
1252
|
+
logger.log('INFO', '尝试重新连接', {
|
|
1253
|
+
url,
|
|
1254
|
+
attempt: count,
|
|
1255
|
+
maxAttempts: options.reconnectLimit || 10
|
|
1256
|
+
});
|
|
1257
|
+
(_options$onReconnect = options.onReconnect) === null || _options$onReconnect === void 0 || _options$onReconnect.call(options, count);
|
|
1258
|
+
}
|
|
1259
|
+
}), [url, options, logger]);
|
|
1260
|
+
const {
|
|
1261
|
+
latestMessage,
|
|
1262
|
+
readyState,
|
|
1263
|
+
sendMessage,
|
|
1264
|
+
connect,
|
|
1265
|
+
disconnect
|
|
1266
|
+
} = useWebSocket(url, websocketOptions);
|
|
1267
|
+
const heartbeatOptions = useMemo(() => heartbeatConfig === true ? {} : heartbeatConfig, [heartbeatConfig]);
|
|
1268
|
+
const heartbeatEnabled = useMemo(() => heartbeatConfig !== false, [heartbeatConfig]);
|
|
1269
|
+
const heartbeat = useHeartbeat(sendMessage, readyState, heartbeatOptions, logger, heartbeatEnabled);
|
|
1270
|
+
|
|
1271
|
+
// 在全局暴露日志方法
|
|
1272
|
+
useEffect(() => {
|
|
1273
|
+
if (typeof window !== 'undefined' && enableLog) {
|
|
1274
|
+
// 生成唯一的键名:基于URL进行base64编码
|
|
1275
|
+
const key = "exportWebSocketLogs_".concat(btoa(url));
|
|
1276
|
+
// 在window对象上添加方法
|
|
1277
|
+
window[key] = () => logger.exportLogs();
|
|
1278
|
+
}
|
|
1279
|
+
return () => {
|
|
1280
|
+
if (typeof window !== 'undefined' && enableLog) {
|
|
1281
|
+
const key = "exportWebSocketLogs_".concat(btoa(url));
|
|
1282
|
+
delete window[key];
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
}, [url, enableLog, logger]);
|
|
1286
|
+
const loggerMethods = useMemo(() => ({
|
|
1287
|
+
log: (level, message, data) => logger.log(level, message, data),
|
|
1288
|
+
exportLogs: () => logger.exportLogs(),
|
|
1289
|
+
getLogStats: () => logger.getLogStats(),
|
|
1290
|
+
clearLogs: () => logger.clearLogs()
|
|
1291
|
+
}), [logger]);
|
|
1292
|
+
return {
|
|
1293
|
+
latestMessage,
|
|
1294
|
+
readyState,
|
|
1295
|
+
sendMessage,
|
|
1296
|
+
connect,
|
|
1297
|
+
disconnect,
|
|
1298
|
+
isConnected,
|
|
1299
|
+
readyStateText: getReadyStateText(readyState),
|
|
1300
|
+
// 心跳功能
|
|
1301
|
+
heartbeat,
|
|
1302
|
+
// 日志功能
|
|
1303
|
+
logger: enableLog ? loggerMethods : null
|
|
1304
|
+
};
|
|
1305
|
+
};
|
|
1306
|
+
var useWebSocketWithFeatures$1 = useWebSocketWithFeatures;
|
|
1307
|
+
|
|
1308
|
+
// 在控制台中直接查看所有可用的导出方法 Object.keys(window).filter(key => key.startsWith('exportWebSocketLogs_'))
|
|
1309
|
+
// 导出特定连接的日志 window['exportWebSocketLogs_d3M6Ly8xOTIuMTY4LjEyMy4yMDQvd3MvZHZyL3ZpZGVvX3N0YXR1c19jaGFuZ2U=']();
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* seeder-st2110-components 组件库国际化 Hook
|
|
1313
|
+
*
|
|
1314
|
+
* 设计目标:
|
|
1315
|
+
* 1. 不依赖特定的国际化库(react-intl, i18next 等)
|
|
1316
|
+
* 2. 可以与主项目(Umi)的国际化集成
|
|
1317
|
+
* 3. 支持简单的变量替换
|
|
1318
|
+
* 4. 降级处理:如果没有翻译,显示 key 本身
|
|
1319
|
+
*/
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* 获取当前语言环境
|
|
1323
|
+
* 优先从 Umi 全局变量读取,其次使用默认值
|
|
1324
|
+
*/
|
|
1325
|
+
const getLocale = () => {
|
|
1326
|
+
// 尝试从 Umi 获取语言设置
|
|
1327
|
+
if (typeof window !== 'undefined') {
|
|
1328
|
+
var _window$g_initialProp;
|
|
1329
|
+
if ((_window$g_initialProp = window.g_initialProps) !== null && _window$g_initialProp !== void 0 && _window$g_initialProp.locale) {
|
|
1330
|
+
return window.g_initialProps.locale;
|
|
1331
|
+
}
|
|
1332
|
+
if (window.__UMI_LOCALE__) {
|
|
1333
|
+
return window.__UMI_LOCALE__;
|
|
1334
|
+
}
|
|
1335
|
+
if (window.__COMPONENT_LOCALE__) {
|
|
1336
|
+
return window.__COMPONENT_LOCALE__;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return 'zh-CN';
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* 获取语言包
|
|
1344
|
+
*/
|
|
1345
|
+
const getMessages = () => {
|
|
1346
|
+
if (typeof window !== 'undefined') {
|
|
1347
|
+
return window.__COMPONENT_I18N_MESSAGES__ || {};
|
|
1348
|
+
}
|
|
1349
|
+
return {};
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* 格式化消息
|
|
1354
|
+
* @param {string} id - 国际化 key
|
|
1355
|
+
* @param {object} values - 变量替换值
|
|
1356
|
+
* @param {string} locale - 语言环境
|
|
1357
|
+
* @param {object} messages - 语言包
|
|
1358
|
+
*/
|
|
1359
|
+
const formatMessage = function (_ref) {
|
|
1360
|
+
var _messages$locale, _messages$enUS;
|
|
1361
|
+
let {
|
|
1362
|
+
id
|
|
1363
|
+
} = _ref;
|
|
1364
|
+
let values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1365
|
+
let locale = arguments.length > 2 ? arguments[2] : undefined;
|
|
1366
|
+
let messages = arguments.length > 3 ? arguments[3] : undefined;
|
|
1367
|
+
const message = ((_messages$locale = messages[locale]) === null || _messages$locale === void 0 ? void 0 : _messages$locale[id]) || ((_messages$enUS = messages['en-US']) === null || _messages$enUS === void 0 ? void 0 : _messages$enUS[id]) || id;
|
|
1368
|
+
|
|
1369
|
+
// 支持变量替换 {min}, {max}, {value} 等
|
|
1370
|
+
return message.replace(/\{(\w+)\}/g, (match, key) => {
|
|
1371
|
+
return values[key] !== undefined ? values[key] : match;
|
|
1372
|
+
});
|
|
1373
|
+
};
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* 国际化 Hook
|
|
1377
|
+
*
|
|
1378
|
+
* @returns {{
|
|
1379
|
+
* locale: string,
|
|
1380
|
+
* formatMessage: function,
|
|
1381
|
+
* messages: object
|
|
1382
|
+
* }}
|
|
1383
|
+
*
|
|
1384
|
+
* @example
|
|
1385
|
+
* const intl = useIntl();
|
|
1386
|
+
* const title = intl.formatMessage({ id: 'networkSettings.title' });
|
|
1387
|
+
* const message = intl.formatMessage({ id: 'validation.minLength' }, { min: 3 });
|
|
1388
|
+
*/
|
|
1389
|
+
const useIntl = () => {
|
|
1390
|
+
const locale = getLocale();
|
|
1391
|
+
const messages = getMessages();
|
|
1392
|
+
const formatMessageFn = function (_ref2) {
|
|
1393
|
+
let {
|
|
1394
|
+
id
|
|
1395
|
+
} = _ref2;
|
|
1396
|
+
let values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1397
|
+
return formatMessage({
|
|
1398
|
+
id
|
|
1399
|
+
}, values, locale, messages);
|
|
1400
|
+
};
|
|
1401
|
+
return {
|
|
1402
|
+
locale,
|
|
1403
|
+
formatMessage: formatMessageFn,
|
|
1404
|
+
messages
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* 设置语言环境(可选)
|
|
1410
|
+
* 如果需要在运行时切换语言,可以调用此函数
|
|
1411
|
+
*
|
|
1412
|
+
* @param {string} locale - 语言代码,如 'zh-CN' 或 'en-US'
|
|
1413
|
+
*/
|
|
1414
|
+
const setLocale = locale => {
|
|
1415
|
+
if (typeof window !== 'undefined') {
|
|
1416
|
+
window.__COMPONENT_LOCALE__ = locale;
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* 注册语言包(可选)
|
|
1422
|
+
* 如果需要在运行时注册语言包,可以调用此函数
|
|
1423
|
+
*
|
|
1424
|
+
* @param {string} locale - 语言代码
|
|
1425
|
+
* @param {object} messages - 语言包对象
|
|
1426
|
+
*/
|
|
1427
|
+
const addMessages = (locale, messages) => {
|
|
1428
|
+
if (typeof window !== 'undefined') {
|
|
1429
|
+
if (!window.__COMPONENT_I18N_MESSAGES__) {
|
|
1430
|
+
window.__COMPONENT_I18N_MESSAGES__ = {};
|
|
1431
|
+
}
|
|
1432
|
+
window.__COMPONENT_I18N_MESSAGES__[locale] = messages;
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
/**
|
|
1437
|
+
* 初始化国际化
|
|
1438
|
+
* 在组件库初始化时调用,注册默认语言包
|
|
1439
|
+
*/
|
|
1440
|
+
const initI18n = () => {
|
|
1441
|
+
// 注册中文语言包
|
|
1442
|
+
addMessages('zh-CN', {
|
|
1443
|
+
'button.ok': '确定',
|
|
1444
|
+
'button.cancel': '取消',
|
|
1445
|
+
'button.save': '保存',
|
|
1446
|
+
'button.delete': '删除',
|
|
1447
|
+
'button.edit': '编辑',
|
|
1448
|
+
'button.add': '添加',
|
|
1449
|
+
'button.confirm': '确认',
|
|
1450
|
+
'button.close': '关闭',
|
|
1451
|
+
'button.apply': '应用',
|
|
1452
|
+
'menu.networkSettings': '网络设置',
|
|
1453
|
+
'menu.ptp': 'PTP',
|
|
1454
|
+
'menu.nmos': 'NMOS',
|
|
1455
|
+
'menu.preset': '预设',
|
|
1456
|
+
'menu.license': '许可证'
|
|
1457
|
+
// ... 其他默认翻译
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
// 注册英文语言包
|
|
1461
|
+
addMessages('en-US', {
|
|
1462
|
+
'button.ok': 'OK',
|
|
1463
|
+
'button.cancel': 'Cancel',
|
|
1464
|
+
'button.save': 'Save',
|
|
1465
|
+
'button.delete': 'Delete',
|
|
1466
|
+
'button.edit': 'Edit',
|
|
1467
|
+
'button.add': 'Add',
|
|
1468
|
+
'button.confirm': 'Confirm',
|
|
1469
|
+
'button.close': 'Close',
|
|
1470
|
+
'button.apply': 'Apply',
|
|
1471
|
+
'menu.networkSettings': 'Network Settings',
|
|
1472
|
+
'menu.ptp': 'PTP',
|
|
1473
|
+
'menu.nmos': 'NMOS',
|
|
1474
|
+
'menu.preset': 'Preset',
|
|
1475
|
+
'menu.license': 'License'
|
|
1476
|
+
// ... 其他默认翻译
|
|
1477
|
+
});
|
|
1478
|
+
};
|
|
1479
|
+
|
|
931
1480
|
const NetworkFieldGroup = _ref => {
|
|
932
1481
|
var _fieldConfig$netmask$, _fieldConfig$netmask;
|
|
933
1482
|
let {
|
|
@@ -935,22 +1484,30 @@ const NetworkFieldGroup = _ref => {
|
|
|
935
1484
|
interfaces,
|
|
936
1485
|
fieldConfig = {}
|
|
937
1486
|
} = _ref;
|
|
1487
|
+
const intl = useIntl();
|
|
1488
|
+
|
|
938
1489
|
// 默认字段配置
|
|
939
1490
|
const defaultFieldConfig = {
|
|
940
1491
|
name: {
|
|
941
|
-
label:
|
|
1492
|
+
label: intl.formatMessage({
|
|
1493
|
+
id: 'label.name'
|
|
1494
|
+
}),
|
|
942
1495
|
enabled: true
|
|
943
1496
|
},
|
|
944
1497
|
ip: {
|
|
945
|
-
label:
|
|
1498
|
+
label: intl.formatMessage({
|
|
1499
|
+
id: 'networkSettings.ipAddress'
|
|
1500
|
+
}),
|
|
946
1501
|
enabled: true
|
|
947
1502
|
},
|
|
948
1503
|
netmask: {
|
|
949
|
-
label:
|
|
1504
|
+
label: intl.formatMessage({
|
|
1505
|
+
id: 'networkSettings.subnetMask'
|
|
1506
|
+
}),
|
|
950
1507
|
enabled: true
|
|
951
1508
|
}
|
|
952
1509
|
};
|
|
953
|
-
const mergedFieldConfig = _objectSpread2(_objectSpread2(_objectSpread2({}, defaultFieldConfig), fieldConfig), {}, {
|
|
1510
|
+
const mergedFieldConfig = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, defaultFieldConfig), fieldConfig), {}, {
|
|
954
1511
|
netmask: {
|
|
955
1512
|
label: "Netmask",
|
|
956
1513
|
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
|
|
@@ -994,11 +1551,11 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
994
1551
|
open,
|
|
995
1552
|
onClose,
|
|
996
1553
|
getLanConfig,
|
|
997
|
-
// 可选 - 单独获取LAN配置的函数
|
|
1554
|
+
// 可选 - 单独获取 LAN 配置的函数
|
|
998
1555
|
getSysConfig,
|
|
999
|
-
// 可选 - 单独获取QSFP配置的函数
|
|
1556
|
+
// 可选 - 单独获取 QSFP 配置的函数
|
|
1000
1557
|
getConfig,
|
|
1001
|
-
// 可选 - 统一获取配置的函数 ipgweb专用
|
|
1558
|
+
// 可选 - 统一获取配置的函数 ipgweb 专用
|
|
1002
1559
|
updateLanConfig,
|
|
1003
1560
|
updateSysConfig,
|
|
1004
1561
|
restart,
|
|
@@ -1014,6 +1571,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1014
1571
|
},
|
|
1015
1572
|
restartRemark
|
|
1016
1573
|
} = _ref2;
|
|
1574
|
+
const intl = useIntl();
|
|
1017
1575
|
const {
|
|
1018
1576
|
message,
|
|
1019
1577
|
modal
|
|
@@ -1031,18 +1589,18 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1031
1589
|
hasInitialized: false
|
|
1032
1590
|
});
|
|
1033
1591
|
const preparedFieldConfig = useMemo(() => {
|
|
1034
|
-
const config = _objectSpread2({}, fieldConfig);
|
|
1592
|
+
const config = _objectSpread2$1({}, fieldConfig);
|
|
1035
1593
|
|
|
1036
1594
|
// 确保LAN和QSFP的配置存在
|
|
1037
1595
|
config.LAN = config.LAN || {};
|
|
1038
1596
|
config.QSFP = config.QSFP || {};
|
|
1039
1597
|
if (sections.includes('LAN')) {
|
|
1040
|
-
config.LAN.netmask = _objectSpread2(_objectSpread2({}, config.LAN.netmask || {}), {}, {
|
|
1598
|
+
config.LAN.netmask = _objectSpread2$1(_objectSpread2$1({}, config.LAN.netmask || {}), {}, {
|
|
1041
1599
|
enabled: showNetmask.LAN
|
|
1042
1600
|
});
|
|
1043
1601
|
}
|
|
1044
1602
|
if (sections.includes('QSFP')) {
|
|
1045
|
-
config.QSFP.netmask = _objectSpread2(_objectSpread2({}, config.QSFP.netmask || {}), {}, {
|
|
1603
|
+
config.QSFP.netmask = _objectSpread2$1(_objectSpread2$1({}, config.QSFP.netmask || {}), {}, {
|
|
1046
1604
|
enabled: showNetmask.QSFP
|
|
1047
1605
|
});
|
|
1048
1606
|
}
|
|
@@ -1117,7 +1675,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1117
1675
|
const initialValues = useMemo(() => {
|
|
1118
1676
|
const values = {};
|
|
1119
1677
|
if (sections.includes('LAN') && lanConfigs.length > 0) {
|
|
1120
|
-
values.LAN = lanConfigs.map(config => _objectSpread2({
|
|
1678
|
+
values.LAN = lanConfigs.map(config => _objectSpread2$1({
|
|
1121
1679
|
connection_id: config.connection_id,
|
|
1122
1680
|
display_name: config.display_name,
|
|
1123
1681
|
ip_address: config.ip_address
|
|
@@ -1126,7 +1684,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1126
1684
|
} : {}));
|
|
1127
1685
|
}
|
|
1128
1686
|
if (sections.includes('QSFP') && st2110Interfaces.length > 0) {
|
|
1129
|
-
values.QSFP = st2110Interfaces.map(iface => _objectSpread2(_objectSpread2({}, iface.id !== undefined && {
|
|
1687
|
+
values.QSFP = st2110Interfaces.map(iface => _objectSpread2$1(_objectSpread2$1({}, iface.id !== undefined && {
|
|
1130
1688
|
id: iface.id
|
|
1131
1689
|
}), {}, {
|
|
1132
1690
|
display_name: iface.display_name,
|
|
@@ -1149,11 +1707,14 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1149
1707
|
// 成功处理
|
|
1150
1708
|
const handleSuccess = useCallback(async function () {
|
|
1151
1709
|
let {
|
|
1152
|
-
messageText
|
|
1710
|
+
messageText,
|
|
1153
1711
|
isPopup = false,
|
|
1154
1712
|
refresh = !restart
|
|
1155
1713
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1156
|
-
|
|
1714
|
+
const defaultMessage = intl.formatMessage({
|
|
1715
|
+
id: 'networkSettings.saveSuccess'
|
|
1716
|
+
});
|
|
1717
|
+
message.success(messageText || defaultMessage);
|
|
1157
1718
|
if (refresh && getConfig) {
|
|
1158
1719
|
try {
|
|
1159
1720
|
const newConfig = await getConfig();
|
|
@@ -1177,9 +1738,15 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1177
1738
|
if (updatedConfig !== null && updatedConfig !== void 0 && updatedConfig.is_restart_required) {
|
|
1178
1739
|
modal.confirm({
|
|
1179
1740
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
1180
|
-
title:
|
|
1181
|
-
|
|
1182
|
-
|
|
1741
|
+
title: intl.formatMessage({
|
|
1742
|
+
id: 'networkSettings.restartRequired'
|
|
1743
|
+
}),
|
|
1744
|
+
cancelText: intl.formatMessage({
|
|
1745
|
+
id: 'networkSettings.restartLater'
|
|
1746
|
+
}),
|
|
1747
|
+
okText: intl.formatMessage({
|
|
1748
|
+
id: 'networkSettings.restartNow'
|
|
1749
|
+
}),
|
|
1183
1750
|
onOk: async () => {
|
|
1184
1751
|
await restart();
|
|
1185
1752
|
if (onRestartSuccess && typeof onRestartSuccess === 'function') {
|
|
@@ -1195,9 +1762,15 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1195
1762
|
// 无接口:直接弹出重启确认框
|
|
1196
1763
|
modal.confirm({
|
|
1197
1764
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
1198
|
-
title:
|
|
1199
|
-
|
|
1200
|
-
|
|
1765
|
+
title: intl.formatMessage({
|
|
1766
|
+
id: 'networkSettings.restartRequired'
|
|
1767
|
+
}),
|
|
1768
|
+
cancelText: intl.formatMessage({
|
|
1769
|
+
id: 'networkSettings.restartLater'
|
|
1770
|
+
}),
|
|
1771
|
+
okText: intl.formatMessage({
|
|
1772
|
+
id: 'networkSettings.restartNow'
|
|
1773
|
+
}),
|
|
1201
1774
|
onOk: async () => {
|
|
1202
1775
|
await restart();
|
|
1203
1776
|
if (onRestartSuccess && typeof onRestartSuccess === 'function') {
|
|
@@ -1208,7 +1781,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1208
1781
|
}
|
|
1209
1782
|
}
|
|
1210
1783
|
onClose();
|
|
1211
|
-
}, [message, modal, getSysConfig, restart, getConfig, sections, onClose]);
|
|
1784
|
+
}, [intl, message, modal, getSysConfig, restart, getConfig, sections, onClose]);
|
|
1212
1785
|
const handleSubmit = useCallback(async () => {
|
|
1213
1786
|
setSubmitLoading(true);
|
|
1214
1787
|
try {
|
|
@@ -1232,7 +1805,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1232
1805
|
if (sections.includes('LAN') && values.LAN) {
|
|
1233
1806
|
const lanData = values.LAN.map((item, index) => {
|
|
1234
1807
|
var _lanConfigs$index;
|
|
1235
|
-
return _objectSpread2({
|
|
1808
|
+
return _objectSpread2$1({
|
|
1236
1809
|
connection_id: (_lanConfigs$index = lanConfigs[index]) === null || _lanConfigs$index === void 0 ? void 0 : _lanConfigs$index.connection_id,
|
|
1237
1810
|
ip_address: item.ip_address
|
|
1238
1811
|
}, showNetmask.LAN ? {
|
|
@@ -1246,7 +1819,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1246
1819
|
if (sections.includes('QSFP') && values.QSFP) {
|
|
1247
1820
|
const interfacesData = values.QSFP.map((item, index) => {
|
|
1248
1821
|
var _st2110Interfaces$ind, _st2110Interfaces$ind2, _st2110Interfaces$ind3;
|
|
1249
|
-
return _objectSpread2(_objectSpread2(_objectSpread2({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
|
|
1822
|
+
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 && {
|
|
1250
1823
|
id: st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind2 = st2110Interfaces[index]) === null || _st2110Interfaces$ind2 === void 0 ? void 0 : _st2110Interfaces$ind2.id
|
|
1251
1824
|
}), (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind3 = st2110Interfaces[index]) === null || _st2110Interfaces$ind3 === void 0 ? void 0 : _st2110Interfaces$ind3.ip) !== undefined ? {
|
|
1252
1825
|
ip: item.ip_address
|
|
@@ -1288,22 +1861,28 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1288
1861
|
}, [form, sections, lanConfigs, st2110Interfaces, updateLanConfig, updateSysConfig, handleSuccess]);
|
|
1289
1862
|
|
|
1290
1863
|
// 合并默认模态框属性和传入的属性
|
|
1291
|
-
const mergedModalProps = _objectSpread2({
|
|
1292
|
-
title:
|
|
1864
|
+
const mergedModalProps = _objectSpread2$1({
|
|
1865
|
+
title: intl.formatMessage({
|
|
1866
|
+
id: 'networkSettings.title'
|
|
1867
|
+
}),
|
|
1293
1868
|
width: 650,
|
|
1294
1869
|
open,
|
|
1295
1870
|
confirmLoading: submitLoading,
|
|
1296
1871
|
onOk: handleSubmit,
|
|
1297
1872
|
onCancel: onClose,
|
|
1298
|
-
okText:
|
|
1299
|
-
|
|
1873
|
+
okText: intl.formatMessage({
|
|
1874
|
+
id: 'button.apply'
|
|
1875
|
+
}),
|
|
1876
|
+
cancelText: intl.formatMessage({
|
|
1877
|
+
id: 'button.close'
|
|
1878
|
+
}),
|
|
1300
1879
|
centered: true,
|
|
1301
1880
|
destroyOnHidden: true,
|
|
1302
1881
|
forceRender: true
|
|
1303
1882
|
}, modalProps);
|
|
1304
1883
|
|
|
1305
1884
|
// 合并默认表单属性和传入的属性
|
|
1306
|
-
const mergedFormProps = _objectSpread2({
|
|
1885
|
+
const mergedFormProps = _objectSpread2$1({
|
|
1307
1886
|
form: form,
|
|
1308
1887
|
labelCol: {
|
|
1309
1888
|
span: 6
|
|
@@ -1313,8 +1892,8 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1313
1892
|
},
|
|
1314
1893
|
autoComplete: "off"
|
|
1315
1894
|
}, formProps);
|
|
1316
|
-
return /*#__PURE__*/jsxs(StyledModal$
|
|
1317
|
-
children: [/*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
1895
|
+
return /*#__PURE__*/jsxs(StyledModal$3, _objectSpread2$1(_objectSpread2$1({}, mergedModalProps), {}, {
|
|
1896
|
+
children: [/*#__PURE__*/jsxs(Form, _objectSpread2$1(_objectSpread2$1({}, mergedFormProps), {}, {
|
|
1318
1897
|
children: [sections.includes('LAN') && lanConfigs.length > 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
1319
1898
|
children: [/*#__PURE__*/jsx(NetworkFieldGroup, {
|
|
1320
1899
|
prefix: "LAN",
|
|
@@ -1436,7 +2015,7 @@ function convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder) {
|
|
|
1436
2015
|
formType: 'text'
|
|
1437
2016
|
};
|
|
1438
2017
|
const value = ptpStatus[key];
|
|
1439
|
-
return _objectSpread2(_objectSpread2({
|
|
2018
|
+
return _objectSpread2$1(_objectSpread2$1({
|
|
1440
2019
|
key,
|
|
1441
2020
|
value
|
|
1442
2021
|
}, config), {}, {
|
|
@@ -1548,7 +2127,7 @@ const PtpModal = _ref => {
|
|
|
1548
2127
|
if (!open || !ptpStatus) return null;
|
|
1549
2128
|
|
|
1550
2129
|
// 合并默认模态框属性和传入的属性
|
|
1551
|
-
const mergedModalProps = _objectSpread2({
|
|
2130
|
+
const mergedModalProps = _objectSpread2$1({
|
|
1552
2131
|
title: "PTP",
|
|
1553
2132
|
width: 650,
|
|
1554
2133
|
open,
|
|
@@ -1560,7 +2139,7 @@ const PtpModal = _ref => {
|
|
|
1560
2139
|
}, modalProps);
|
|
1561
2140
|
|
|
1562
2141
|
// 合并默认表单属性和传入的属性
|
|
1563
|
-
const mergedFormProps = _objectSpread2({
|
|
2142
|
+
const mergedFormProps = _objectSpread2$1({
|
|
1564
2143
|
form: form,
|
|
1565
2144
|
name: "ptpForm",
|
|
1566
2145
|
labelCol: {
|
|
@@ -1571,8 +2150,8 @@ const PtpModal = _ref => {
|
|
|
1571
2150
|
},
|
|
1572
2151
|
autoComplete: "off"
|
|
1573
2152
|
}, formProps);
|
|
1574
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
1575
|
-
children: /*#__PURE__*/jsx(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
2153
|
+
return /*#__PURE__*/jsx(StyledModal$3, _objectSpread2$1(_objectSpread2$1({}, mergedModalProps), {}, {
|
|
2154
|
+
children: /*#__PURE__*/jsx(Form, _objectSpread2$1(_objectSpread2$1({}, mergedFormProps), {}, {
|
|
1576
2155
|
children: ptpStatusArray.map(item => /*#__PURE__*/jsx(Form.Item, {
|
|
1577
2156
|
label: item.label,
|
|
1578
2157
|
name: item.key,
|
|
@@ -1767,7 +2346,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1767
2346
|
return fields.category_list.options.map(category => {
|
|
1768
2347
|
const isInitiallySelected = initialSelected.includes(category.name);
|
|
1769
2348
|
const shouldDisable = isSavedPreset ? !isInitiallySelected : false;
|
|
1770
|
-
return _objectSpread2(_objectSpread2({}, category), {}, {
|
|
2349
|
+
return _objectSpread2$1(_objectSpread2$1({}, category), {}, {
|
|
1771
2350
|
disabled: shouldDisable,
|
|
1772
2351
|
initiallySelected: isInitiallySelected
|
|
1773
2352
|
});
|
|
@@ -1917,7 +2496,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1917
2496
|
}) :
|
|
1918
2497
|
/*#__PURE__*/
|
|
1919
2498
|
// 非编辑模式下的按钮
|
|
1920
|
-
jsx(SubmitButton, _objectSpread2(_objectSpread2({
|
|
2499
|
+
jsx(SubmitButton, _objectSpread2$1(_objectSpread2$1({
|
|
1921
2500
|
action: handleLoad
|
|
1922
2501
|
}, hasCategoryList && {
|
|
1923
2502
|
disabled: !currentSelected.length
|
|
@@ -2131,7 +2710,7 @@ const Preset = _ref => {
|
|
|
2131
2710
|
});
|
|
2132
2711
|
(async () => {
|
|
2133
2712
|
try {
|
|
2134
|
-
await loadPreset(_objectSpread2({
|
|
2713
|
+
await loadPreset(_objectSpread2$1({
|
|
2135
2714
|
id: loadData.id
|
|
2136
2715
|
}, loadData.category_list && {
|
|
2137
2716
|
category_list: loadData.category_list
|
|
@@ -2255,7 +2834,7 @@ const Preset = _ref => {
|
|
|
2255
2834
|
useEffect(() => {
|
|
2256
2835
|
fetchPresetList();
|
|
2257
2836
|
}, [fetchPresetList]);
|
|
2258
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
2837
|
+
return /*#__PURE__*/jsx(StyledModal$3, {
|
|
2259
2838
|
title: texts.title,
|
|
2260
2839
|
width: width,
|
|
2261
2840
|
open: open,
|
|
@@ -2336,7 +2915,7 @@ const UpgradeManager = _ref => {
|
|
|
2336
2915
|
statusPollingInterval = 1000,
|
|
2337
2916
|
children
|
|
2338
2917
|
} = _ref,
|
|
2339
|
-
dropdownProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
2918
|
+
dropdownProps = _objectWithoutProperties$1(_ref, _excluded$2);
|
|
2340
2919
|
const [upgradeElement] = useUpgrade$1({
|
|
2341
2920
|
menuItems,
|
|
2342
2921
|
onMenuClick,
|
|
@@ -2352,7 +2931,7 @@ const UpgradeManager = _ref => {
|
|
|
2352
2931
|
const dropdownElement = upgradeElement.props.children[0];
|
|
2353
2932
|
const otherElements = upgradeElement.props.children.slice(1);
|
|
2354
2933
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2355
|
-
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2(_objectSpread2(_objectSpread2({}, dropdownProps), dropdownElement.props), {}, {
|
|
2934
|
+
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, dropdownProps), dropdownElement.props), {}, {
|
|
2356
2935
|
children: children
|
|
2357
2936
|
})), otherElements]
|
|
2358
2937
|
});
|
|
@@ -2367,15 +2946,15 @@ UpgradeManager.defaultProps = {
|
|
|
2367
2946
|
};
|
|
2368
2947
|
var UpgradeManager$1 = UpgradeManager;
|
|
2369
2948
|
|
|
2370
|
-
function getDefaultExportFromCjs$
|
|
2949
|
+
function getDefaultExportFromCjs$7 (x) {
|
|
2371
2950
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2372
2951
|
}
|
|
2373
2952
|
|
|
2374
|
-
var propTypes$
|
|
2953
|
+
var propTypes$7 = {exports: {}};
|
|
2375
2954
|
|
|
2376
|
-
var reactIs$
|
|
2955
|
+
var reactIs$7 = {exports: {}};
|
|
2377
2956
|
|
|
2378
|
-
var reactIs_production_min$
|
|
2957
|
+
var reactIs_production_min$7 = {};
|
|
2379
2958
|
|
|
2380
2959
|
/** @license React v16.13.1
|
|
2381
2960
|
* react-is.production.min.js
|
|
@@ -2386,21 +2965,21 @@ var reactIs_production_min$6 = {};
|
|
|
2386
2965
|
* LICENSE file in the root directory of this source tree.
|
|
2387
2966
|
*/
|
|
2388
2967
|
|
|
2389
|
-
var hasRequiredReactIs_production_min$
|
|
2968
|
+
var hasRequiredReactIs_production_min$7;
|
|
2390
2969
|
|
|
2391
|
-
function requireReactIs_production_min$
|
|
2392
|
-
if (hasRequiredReactIs_production_min$
|
|
2393
|
-
hasRequiredReactIs_production_min$
|
|
2970
|
+
function requireReactIs_production_min$7 () {
|
|
2971
|
+
if (hasRequiredReactIs_production_min$7) return reactIs_production_min$7;
|
|
2972
|
+
hasRequiredReactIs_production_min$7 = 1;
|
|
2394
2973
|
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?
|
|
2395
2974
|
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;
|
|
2396
|
-
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$
|
|
2397
|
-
reactIs_production_min$
|
|
2398
|
-
reactIs_production_min$
|
|
2399
|
-
reactIs_production_min$
|
|
2400
|
-
return reactIs_production_min$
|
|
2975
|
+
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$7.AsyncMode=l;reactIs_production_min$7.ConcurrentMode=m;reactIs_production_min$7.ContextConsumer=k;reactIs_production_min$7.ContextProvider=h;reactIs_production_min$7.Element=c;reactIs_production_min$7.ForwardRef=n;reactIs_production_min$7.Fragment=e;reactIs_production_min$7.Lazy=t;reactIs_production_min$7.Memo=r;reactIs_production_min$7.Portal=d;
|
|
2976
|
+
reactIs_production_min$7.Profiler=g;reactIs_production_min$7.StrictMode=f;reactIs_production_min$7.Suspense=p;reactIs_production_min$7.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$7.isConcurrentMode=A;reactIs_production_min$7.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$7.isContextProvider=function(a){return z(a)===h};reactIs_production_min$7.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$7.isForwardRef=function(a){return z(a)===n};reactIs_production_min$7.isFragment=function(a){return z(a)===e};reactIs_production_min$7.isLazy=function(a){return z(a)===t};
|
|
2977
|
+
reactIs_production_min$7.isMemo=function(a){return z(a)===r};reactIs_production_min$7.isPortal=function(a){return z(a)===d};reactIs_production_min$7.isProfiler=function(a){return z(a)===g};reactIs_production_min$7.isStrictMode=function(a){return z(a)===f};reactIs_production_min$7.isSuspense=function(a){return z(a)===p};
|
|
2978
|
+
reactIs_production_min$7.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$7.typeOf=z;
|
|
2979
|
+
return reactIs_production_min$7;
|
|
2401
2980
|
}
|
|
2402
2981
|
|
|
2403
|
-
var reactIs_development$
|
|
2982
|
+
var reactIs_development$7 = {};
|
|
2404
2983
|
|
|
2405
2984
|
/** @license React v16.13.1
|
|
2406
2985
|
* react-is.development.js
|
|
@@ -2411,11 +2990,11 @@ var reactIs_development$6 = {};
|
|
|
2411
2990
|
* LICENSE file in the root directory of this source tree.
|
|
2412
2991
|
*/
|
|
2413
2992
|
|
|
2414
|
-
var hasRequiredReactIs_development$
|
|
2993
|
+
var hasRequiredReactIs_development$7;
|
|
2415
2994
|
|
|
2416
|
-
function requireReactIs_development$
|
|
2417
|
-
if (hasRequiredReactIs_development$
|
|
2418
|
-
hasRequiredReactIs_development$
|
|
2995
|
+
function requireReactIs_development$7 () {
|
|
2996
|
+
if (hasRequiredReactIs_development$7) return reactIs_development$7;
|
|
2997
|
+
hasRequiredReactIs_development$7 = 1;
|
|
2419
2998
|
|
|
2420
2999
|
|
|
2421
3000
|
|
|
@@ -2556,51 +3135,51 @@ function requireReactIs_development$6 () {
|
|
|
2556
3135
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2557
3136
|
}
|
|
2558
3137
|
|
|
2559
|
-
reactIs_development$
|
|
2560
|
-
reactIs_development$
|
|
2561
|
-
reactIs_development$
|
|
2562
|
-
reactIs_development$
|
|
2563
|
-
reactIs_development$
|
|
2564
|
-
reactIs_development$
|
|
2565
|
-
reactIs_development$
|
|
2566
|
-
reactIs_development$
|
|
2567
|
-
reactIs_development$
|
|
2568
|
-
reactIs_development$
|
|
2569
|
-
reactIs_development$
|
|
2570
|
-
reactIs_development$
|
|
2571
|
-
reactIs_development$
|
|
2572
|
-
reactIs_development$
|
|
2573
|
-
reactIs_development$
|
|
2574
|
-
reactIs_development$
|
|
2575
|
-
reactIs_development$
|
|
2576
|
-
reactIs_development$
|
|
2577
|
-
reactIs_development$
|
|
2578
|
-
reactIs_development$
|
|
2579
|
-
reactIs_development$
|
|
2580
|
-
reactIs_development$
|
|
2581
|
-
reactIs_development$
|
|
2582
|
-
reactIs_development$
|
|
2583
|
-
reactIs_development$
|
|
2584
|
-
reactIs_development$
|
|
2585
|
-
reactIs_development$
|
|
2586
|
-
reactIs_development$
|
|
3138
|
+
reactIs_development$7.AsyncMode = AsyncMode;
|
|
3139
|
+
reactIs_development$7.ConcurrentMode = ConcurrentMode;
|
|
3140
|
+
reactIs_development$7.ContextConsumer = ContextConsumer;
|
|
3141
|
+
reactIs_development$7.ContextProvider = ContextProvider;
|
|
3142
|
+
reactIs_development$7.Element = Element;
|
|
3143
|
+
reactIs_development$7.ForwardRef = ForwardRef;
|
|
3144
|
+
reactIs_development$7.Fragment = Fragment;
|
|
3145
|
+
reactIs_development$7.Lazy = Lazy;
|
|
3146
|
+
reactIs_development$7.Memo = Memo;
|
|
3147
|
+
reactIs_development$7.Portal = Portal;
|
|
3148
|
+
reactIs_development$7.Profiler = Profiler;
|
|
3149
|
+
reactIs_development$7.StrictMode = StrictMode;
|
|
3150
|
+
reactIs_development$7.Suspense = Suspense;
|
|
3151
|
+
reactIs_development$7.isAsyncMode = isAsyncMode;
|
|
3152
|
+
reactIs_development$7.isConcurrentMode = isConcurrentMode;
|
|
3153
|
+
reactIs_development$7.isContextConsumer = isContextConsumer;
|
|
3154
|
+
reactIs_development$7.isContextProvider = isContextProvider;
|
|
3155
|
+
reactIs_development$7.isElement = isElement;
|
|
3156
|
+
reactIs_development$7.isForwardRef = isForwardRef;
|
|
3157
|
+
reactIs_development$7.isFragment = isFragment;
|
|
3158
|
+
reactIs_development$7.isLazy = isLazy;
|
|
3159
|
+
reactIs_development$7.isMemo = isMemo;
|
|
3160
|
+
reactIs_development$7.isPortal = isPortal;
|
|
3161
|
+
reactIs_development$7.isProfiler = isProfiler;
|
|
3162
|
+
reactIs_development$7.isStrictMode = isStrictMode;
|
|
3163
|
+
reactIs_development$7.isSuspense = isSuspense;
|
|
3164
|
+
reactIs_development$7.isValidElementType = isValidElementType;
|
|
3165
|
+
reactIs_development$7.typeOf = typeOf;
|
|
2587
3166
|
})();
|
|
2588
3167
|
}
|
|
2589
|
-
return reactIs_development$
|
|
3168
|
+
return reactIs_development$7;
|
|
2590
3169
|
}
|
|
2591
3170
|
|
|
2592
|
-
var hasRequiredReactIs$
|
|
3171
|
+
var hasRequiredReactIs$7;
|
|
2593
3172
|
|
|
2594
|
-
function requireReactIs$
|
|
2595
|
-
if (hasRequiredReactIs$
|
|
2596
|
-
hasRequiredReactIs$
|
|
3173
|
+
function requireReactIs$7 () {
|
|
3174
|
+
if (hasRequiredReactIs$7) return reactIs$7.exports;
|
|
3175
|
+
hasRequiredReactIs$7 = 1;
|
|
2597
3176
|
|
|
2598
3177
|
if (process.env.NODE_ENV === 'production') {
|
|
2599
|
-
reactIs$
|
|
3178
|
+
reactIs$7.exports = requireReactIs_production_min$7();
|
|
2600
3179
|
} else {
|
|
2601
|
-
reactIs$
|
|
3180
|
+
reactIs$7.exports = requireReactIs_development$7();
|
|
2602
3181
|
}
|
|
2603
|
-
return reactIs$
|
|
3182
|
+
return reactIs$7.exports;
|
|
2604
3183
|
}
|
|
2605
3184
|
|
|
2606
3185
|
/*
|
|
@@ -2609,12 +3188,12 @@ object-assign
|
|
|
2609
3188
|
@license MIT
|
|
2610
3189
|
*/
|
|
2611
3190
|
|
|
2612
|
-
var objectAssign$
|
|
2613
|
-
var hasRequiredObjectAssign$
|
|
3191
|
+
var objectAssign$7;
|
|
3192
|
+
var hasRequiredObjectAssign$7;
|
|
2614
3193
|
|
|
2615
|
-
function requireObjectAssign$
|
|
2616
|
-
if (hasRequiredObjectAssign$
|
|
2617
|
-
hasRequiredObjectAssign$
|
|
3194
|
+
function requireObjectAssign$7 () {
|
|
3195
|
+
if (hasRequiredObjectAssign$7) return objectAssign$7;
|
|
3196
|
+
hasRequiredObjectAssign$7 = 1;
|
|
2618
3197
|
/* eslint-disable no-unused-vars */
|
|
2619
3198
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2620
3199
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -2672,7 +3251,7 @@ function requireObjectAssign$6 () {
|
|
|
2672
3251
|
}
|
|
2673
3252
|
}
|
|
2674
3253
|
|
|
2675
|
-
objectAssign$
|
|
3254
|
+
objectAssign$7 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
2676
3255
|
var from;
|
|
2677
3256
|
var to = toObject(target);
|
|
2678
3257
|
var symbols;
|
|
@@ -2698,7 +3277,7 @@ function requireObjectAssign$6 () {
|
|
|
2698
3277
|
|
|
2699
3278
|
return to;
|
|
2700
3279
|
};
|
|
2701
|
-
return objectAssign$
|
|
3280
|
+
return objectAssign$7;
|
|
2702
3281
|
}
|
|
2703
3282
|
|
|
2704
3283
|
/**
|
|
@@ -2708,27 +3287,27 @@ function requireObjectAssign$6 () {
|
|
|
2708
3287
|
* LICENSE file in the root directory of this source tree.
|
|
2709
3288
|
*/
|
|
2710
3289
|
|
|
2711
|
-
var ReactPropTypesSecret_1$
|
|
2712
|
-
var hasRequiredReactPropTypesSecret$
|
|
3290
|
+
var ReactPropTypesSecret_1$7;
|
|
3291
|
+
var hasRequiredReactPropTypesSecret$7;
|
|
2713
3292
|
|
|
2714
|
-
function requireReactPropTypesSecret$
|
|
2715
|
-
if (hasRequiredReactPropTypesSecret$
|
|
2716
|
-
hasRequiredReactPropTypesSecret$
|
|
3293
|
+
function requireReactPropTypesSecret$7 () {
|
|
3294
|
+
if (hasRequiredReactPropTypesSecret$7) return ReactPropTypesSecret_1$7;
|
|
3295
|
+
hasRequiredReactPropTypesSecret$7 = 1;
|
|
2717
3296
|
|
|
2718
3297
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2719
3298
|
|
|
2720
|
-
ReactPropTypesSecret_1$
|
|
2721
|
-
return ReactPropTypesSecret_1$
|
|
3299
|
+
ReactPropTypesSecret_1$7 = ReactPropTypesSecret;
|
|
3300
|
+
return ReactPropTypesSecret_1$7;
|
|
2722
3301
|
}
|
|
2723
3302
|
|
|
2724
|
-
var has$
|
|
2725
|
-
var hasRequiredHas$
|
|
3303
|
+
var has$7;
|
|
3304
|
+
var hasRequiredHas$7;
|
|
2726
3305
|
|
|
2727
|
-
function requireHas$
|
|
2728
|
-
if (hasRequiredHas$
|
|
2729
|
-
hasRequiredHas$
|
|
2730
|
-
has$
|
|
2731
|
-
return has$
|
|
3306
|
+
function requireHas$7 () {
|
|
3307
|
+
if (hasRequiredHas$7) return has$7;
|
|
3308
|
+
hasRequiredHas$7 = 1;
|
|
3309
|
+
has$7 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
3310
|
+
return has$7;
|
|
2732
3311
|
}
|
|
2733
3312
|
|
|
2734
3313
|
/**
|
|
@@ -2738,19 +3317,19 @@ function requireHas$6 () {
|
|
|
2738
3317
|
* LICENSE file in the root directory of this source tree.
|
|
2739
3318
|
*/
|
|
2740
3319
|
|
|
2741
|
-
var checkPropTypes_1$
|
|
2742
|
-
var hasRequiredCheckPropTypes$
|
|
3320
|
+
var checkPropTypes_1$7;
|
|
3321
|
+
var hasRequiredCheckPropTypes$7;
|
|
2743
3322
|
|
|
2744
|
-
function requireCheckPropTypes$
|
|
2745
|
-
if (hasRequiredCheckPropTypes$
|
|
2746
|
-
hasRequiredCheckPropTypes$
|
|
3323
|
+
function requireCheckPropTypes$7 () {
|
|
3324
|
+
if (hasRequiredCheckPropTypes$7) return checkPropTypes_1$7;
|
|
3325
|
+
hasRequiredCheckPropTypes$7 = 1;
|
|
2747
3326
|
|
|
2748
3327
|
var printWarning = function() {};
|
|
2749
3328
|
|
|
2750
3329
|
if (process.env.NODE_ENV !== 'production') {
|
|
2751
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
3330
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$7();
|
|
2752
3331
|
var loggedTypeFailures = {};
|
|
2753
|
-
var has = /*@__PURE__*/ requireHas$
|
|
3332
|
+
var has = /*@__PURE__*/ requireHas$7();
|
|
2754
3333
|
|
|
2755
3334
|
printWarning = function(text) {
|
|
2756
3335
|
var message = 'Warning: ' + text;
|
|
@@ -2838,8 +3417,8 @@ function requireCheckPropTypes$6 () {
|
|
|
2838
3417
|
}
|
|
2839
3418
|
};
|
|
2840
3419
|
|
|
2841
|
-
checkPropTypes_1$
|
|
2842
|
-
return checkPropTypes_1$
|
|
3420
|
+
checkPropTypes_1$7 = checkPropTypes;
|
|
3421
|
+
return checkPropTypes_1$7;
|
|
2843
3422
|
}
|
|
2844
3423
|
|
|
2845
3424
|
/**
|
|
@@ -2849,19 +3428,19 @@ function requireCheckPropTypes$6 () {
|
|
|
2849
3428
|
* LICENSE file in the root directory of this source tree.
|
|
2850
3429
|
*/
|
|
2851
3430
|
|
|
2852
|
-
var factoryWithTypeCheckers$
|
|
2853
|
-
var hasRequiredFactoryWithTypeCheckers$
|
|
3431
|
+
var factoryWithTypeCheckers$7;
|
|
3432
|
+
var hasRequiredFactoryWithTypeCheckers$7;
|
|
2854
3433
|
|
|
2855
|
-
function requireFactoryWithTypeCheckers$
|
|
2856
|
-
if (hasRequiredFactoryWithTypeCheckers$
|
|
2857
|
-
hasRequiredFactoryWithTypeCheckers$
|
|
3434
|
+
function requireFactoryWithTypeCheckers$7 () {
|
|
3435
|
+
if (hasRequiredFactoryWithTypeCheckers$7) return factoryWithTypeCheckers$7;
|
|
3436
|
+
hasRequiredFactoryWithTypeCheckers$7 = 1;
|
|
2858
3437
|
|
|
2859
|
-
var ReactIs = requireReactIs$
|
|
2860
|
-
var assign = requireObjectAssign$
|
|
3438
|
+
var ReactIs = requireReactIs$7();
|
|
3439
|
+
var assign = requireObjectAssign$7();
|
|
2861
3440
|
|
|
2862
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
2863
|
-
var has = /*@__PURE__*/ requireHas$
|
|
2864
|
-
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$
|
|
3441
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$7();
|
|
3442
|
+
var has = /*@__PURE__*/ requireHas$7();
|
|
3443
|
+
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$7();
|
|
2865
3444
|
|
|
2866
3445
|
var printWarning = function() {};
|
|
2867
3446
|
|
|
@@ -2884,7 +3463,7 @@ function requireFactoryWithTypeCheckers$6 () {
|
|
|
2884
3463
|
return null;
|
|
2885
3464
|
}
|
|
2886
3465
|
|
|
2887
|
-
factoryWithTypeCheckers$
|
|
3466
|
+
factoryWithTypeCheckers$7 = function(isValidElement, throwOnDirectAccess) {
|
|
2888
3467
|
/* global Symbol */
|
|
2889
3468
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2890
3469
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
@@ -3457,7 +4036,7 @@ function requireFactoryWithTypeCheckers$6 () {
|
|
|
3457
4036
|
|
|
3458
4037
|
return ReactPropTypes;
|
|
3459
4038
|
};
|
|
3460
|
-
return factoryWithTypeCheckers$
|
|
4039
|
+
return factoryWithTypeCheckers$7;
|
|
3461
4040
|
}
|
|
3462
4041
|
|
|
3463
4042
|
/**
|
|
@@ -3467,20 +4046,20 @@ function requireFactoryWithTypeCheckers$6 () {
|
|
|
3467
4046
|
* LICENSE file in the root directory of this source tree.
|
|
3468
4047
|
*/
|
|
3469
4048
|
|
|
3470
|
-
var factoryWithThrowingShims$
|
|
3471
|
-
var hasRequiredFactoryWithThrowingShims$
|
|
4049
|
+
var factoryWithThrowingShims$7;
|
|
4050
|
+
var hasRequiredFactoryWithThrowingShims$7;
|
|
3472
4051
|
|
|
3473
|
-
function requireFactoryWithThrowingShims$
|
|
3474
|
-
if (hasRequiredFactoryWithThrowingShims$
|
|
3475
|
-
hasRequiredFactoryWithThrowingShims$
|
|
4052
|
+
function requireFactoryWithThrowingShims$7 () {
|
|
4053
|
+
if (hasRequiredFactoryWithThrowingShims$7) return factoryWithThrowingShims$7;
|
|
4054
|
+
hasRequiredFactoryWithThrowingShims$7 = 1;
|
|
3476
4055
|
|
|
3477
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
4056
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$7();
|
|
3478
4057
|
|
|
3479
4058
|
function emptyFunction() {}
|
|
3480
4059
|
function emptyFunctionWithReset() {}
|
|
3481
4060
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3482
4061
|
|
|
3483
|
-
factoryWithThrowingShims$
|
|
4062
|
+
factoryWithThrowingShims$7 = function() {
|
|
3484
4063
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3485
4064
|
if (secret === ReactPropTypesSecret) {
|
|
3486
4065
|
// It is still safe when called from React.
|
|
@@ -3528,7 +4107,7 @@ function requireFactoryWithThrowingShims$6 () {
|
|
|
3528
4107
|
|
|
3529
4108
|
return ReactPropTypes;
|
|
3530
4109
|
};
|
|
3531
|
-
return factoryWithThrowingShims$
|
|
4110
|
+
return factoryWithThrowingShims$7;
|
|
3532
4111
|
}
|
|
3533
4112
|
|
|
3534
4113
|
/**
|
|
@@ -3538,28 +4117,28 @@ function requireFactoryWithThrowingShims$6 () {
|
|
|
3538
4117
|
* LICENSE file in the root directory of this source tree.
|
|
3539
4118
|
*/
|
|
3540
4119
|
|
|
3541
|
-
var hasRequiredPropTypes$
|
|
4120
|
+
var hasRequiredPropTypes$7;
|
|
3542
4121
|
|
|
3543
|
-
function requirePropTypes$
|
|
3544
|
-
if (hasRequiredPropTypes$
|
|
3545
|
-
hasRequiredPropTypes$
|
|
4122
|
+
function requirePropTypes$7 () {
|
|
4123
|
+
if (hasRequiredPropTypes$7) return propTypes$7.exports;
|
|
4124
|
+
hasRequiredPropTypes$7 = 1;
|
|
3546
4125
|
if (process.env.NODE_ENV !== 'production') {
|
|
3547
|
-
var ReactIs = requireReactIs$
|
|
4126
|
+
var ReactIs = requireReactIs$7();
|
|
3548
4127
|
|
|
3549
4128
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3550
4129
|
// http://fb.me/prop-types-in-prod
|
|
3551
4130
|
var throwOnDirectAccess = true;
|
|
3552
|
-
propTypes$
|
|
4131
|
+
propTypes$7.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$7()(ReactIs.isElement, throwOnDirectAccess);
|
|
3553
4132
|
} else {
|
|
3554
4133
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3555
4134
|
// http://fb.me/prop-types-in-prod
|
|
3556
|
-
propTypes$
|
|
4135
|
+
propTypes$7.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$7()();
|
|
3557
4136
|
}
|
|
3558
|
-
return propTypes$
|
|
4137
|
+
return propTypes$7.exports;
|
|
3559
4138
|
}
|
|
3560
4139
|
|
|
3561
|
-
var propTypesExports$
|
|
3562
|
-
var PropTypes$
|
|
4140
|
+
var propTypesExports$7 = /*@__PURE__*/ requirePropTypes$7();
|
|
4141
|
+
var PropTypes$7 = /*@__PURE__*/getDefaultExportFromCjs$7(propTypesExports$7);
|
|
3563
4142
|
|
|
3564
4143
|
const SystemOperations = _ref => {
|
|
3565
4144
|
let {
|
|
@@ -3650,15 +4229,15 @@ const SystemOperations = _ref => {
|
|
|
3650
4229
|
});
|
|
3651
4230
|
};
|
|
3652
4231
|
SystemOperations.propTypes = {
|
|
3653
|
-
onPowerOff: PropTypes$
|
|
3654
|
-
onRestart: PropTypes$
|
|
3655
|
-
powerOffLabel: PropTypes$
|
|
3656
|
-
restartLabel: PropTypes$
|
|
3657
|
-
iconClassName: PropTypes$
|
|
3658
|
-
confirmTitle: PropTypes$
|
|
3659
|
-
cancelText: PropTypes$
|
|
3660
|
-
okText: PropTypes$
|
|
3661
|
-
run: PropTypes$
|
|
4232
|
+
onPowerOff: PropTypes$7.func,
|
|
4233
|
+
onRestart: PropTypes$7.func,
|
|
4234
|
+
powerOffLabel: PropTypes$7.string,
|
|
4235
|
+
restartLabel: PropTypes$7.string,
|
|
4236
|
+
iconClassName: PropTypes$7.string,
|
|
4237
|
+
confirmTitle: PropTypes$7.string,
|
|
4238
|
+
cancelText: PropTypes$7.string,
|
|
4239
|
+
okText: PropTypes$7.string,
|
|
4240
|
+
run: PropTypes$7.func
|
|
3662
4241
|
};
|
|
3663
4242
|
var SystemOperations$1 = SystemOperations;
|
|
3664
4243
|
|
|
@@ -3701,10 +4280,10 @@ const useSpaLogo = function () {
|
|
|
3701
4280
|
}, "logo")];
|
|
3702
4281
|
};
|
|
3703
4282
|
useSpaLogo.propTypes = {
|
|
3704
|
-
logoUrl: PropTypes$
|
|
3705
|
-
logoWidth: PropTypes$
|
|
3706
|
-
logoAlt: PropTypes$
|
|
3707
|
-
onClick: PropTypes$
|
|
4283
|
+
logoUrl: PropTypes$7.string,
|
|
4284
|
+
logoWidth: PropTypes$7.number,
|
|
4285
|
+
logoAlt: PropTypes$7.string,
|
|
4286
|
+
onClick: PropTypes$7.func
|
|
3708
4287
|
};
|
|
3709
4288
|
var useSpaLogo$1 = useSpaLogo;
|
|
3710
4289
|
|
|
@@ -3816,10 +4395,10 @@ const LSMLabelField = props => {
|
|
|
3816
4395
|
};
|
|
3817
4396
|
loadLsmData();
|
|
3818
4397
|
}, [fetchLsmData]);
|
|
3819
|
-
return /*#__PURE__*/jsx(Form.Item, _objectSpread2(_objectSpread2({
|
|
4398
|
+
return /*#__PURE__*/jsx(Form.Item, _objectSpread2$1(_objectSpread2$1({
|
|
3820
4399
|
label: label
|
|
3821
4400
|
}, formItemProps), {}, {
|
|
3822
|
-
children: /*#__PURE__*/jsx(Select, _objectSpread2(_objectSpread2(_objectSpread2({}, field), selectProps), {}, {
|
|
4401
|
+
children: /*#__PURE__*/jsx(Select, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, field), selectProps), {}, {
|
|
3823
4402
|
options: lsmList,
|
|
3824
4403
|
fieldNames: fieldNames,
|
|
3825
4404
|
allowClear: true,
|
|
@@ -3835,15 +4414,15 @@ const LSMLabelField = props => {
|
|
|
3835
4414
|
};
|
|
3836
4415
|
var LSMLabelField$1 = /*#__PURE__*/memo(LSMLabelField);
|
|
3837
4416
|
|
|
3838
|
-
function _defineProperty
|
|
3839
|
-
return (r = _toPropertyKey
|
|
4417
|
+
function _defineProperty(e, r, t) {
|
|
4418
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
3840
4419
|
value: t,
|
|
3841
4420
|
enumerable: !0,
|
|
3842
4421
|
configurable: !0,
|
|
3843
4422
|
writable: !0
|
|
3844
4423
|
}) : e[r] = t, e;
|
|
3845
4424
|
}
|
|
3846
|
-
function ownKeys
|
|
4425
|
+
function ownKeys(e, r) {
|
|
3847
4426
|
var t = Object.keys(e);
|
|
3848
4427
|
if (Object.getOwnPropertySymbols) {
|
|
3849
4428
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -3853,29 +4432,29 @@ function ownKeys$1(e, r) {
|
|
|
3853
4432
|
}
|
|
3854
4433
|
return t;
|
|
3855
4434
|
}
|
|
3856
|
-
function _objectSpread2
|
|
4435
|
+
function _objectSpread2(e) {
|
|
3857
4436
|
for (var r = 1; r < arguments.length; r++) {
|
|
3858
4437
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
3859
|
-
r % 2 ? ownKeys
|
|
3860
|
-
_defineProperty
|
|
3861
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys
|
|
4438
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
4439
|
+
_defineProperty(e, r, t[r]);
|
|
4440
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
3862
4441
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
3863
4442
|
});
|
|
3864
4443
|
}
|
|
3865
4444
|
return e;
|
|
3866
4445
|
}
|
|
3867
|
-
function _objectWithoutProperties
|
|
4446
|
+
function _objectWithoutProperties(e, t) {
|
|
3868
4447
|
if (null == e) return {};
|
|
3869
4448
|
var o,
|
|
3870
4449
|
r,
|
|
3871
|
-
i = _objectWithoutPropertiesLoose
|
|
4450
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
3872
4451
|
if (Object.getOwnPropertySymbols) {
|
|
3873
4452
|
var n = Object.getOwnPropertySymbols(e);
|
|
3874
4453
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
3875
4454
|
}
|
|
3876
4455
|
return i;
|
|
3877
4456
|
}
|
|
3878
|
-
function _objectWithoutPropertiesLoose
|
|
4457
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
3879
4458
|
if (null == r) return {};
|
|
3880
4459
|
var t = {};
|
|
3881
4460
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -3884,7 +4463,7 @@ function _objectWithoutPropertiesLoose$1(r, e) {
|
|
|
3884
4463
|
}
|
|
3885
4464
|
return t;
|
|
3886
4465
|
}
|
|
3887
|
-
function _toPrimitive
|
|
4466
|
+
function _toPrimitive(t, r) {
|
|
3888
4467
|
if ("object" != typeof t || !t) return t;
|
|
3889
4468
|
var e = t[Symbol.toPrimitive];
|
|
3890
4469
|
if (void 0 !== e) {
|
|
@@ -3894,19 +4473,19 @@ function _toPrimitive$1(t, r) {
|
|
|
3894
4473
|
}
|
|
3895
4474
|
return ("string" === r ? String : Number)(t);
|
|
3896
4475
|
}
|
|
3897
|
-
function _toPropertyKey
|
|
3898
|
-
var i = _toPrimitive
|
|
4476
|
+
function _toPropertyKey(t) {
|
|
4477
|
+
var i = _toPrimitive(t, "string");
|
|
3899
4478
|
return "symbol" == typeof i ? i : i + "";
|
|
3900
4479
|
}
|
|
3901
|
-
const _excluded$
|
|
3902
|
-
const StyledModal
|
|
4480
|
+
const _excluded$3 = ["width", "okText", "cancelText", "styles"];
|
|
4481
|
+
const StyledModal = props => {
|
|
3903
4482
|
const {
|
|
3904
4483
|
width = "520px",
|
|
3905
4484
|
okText = "Apply",
|
|
3906
4485
|
cancelText = "Close",
|
|
3907
4486
|
styles: propStyles = {}
|
|
3908
4487
|
} = props,
|
|
3909
|
-
restProps = _objectWithoutProperties
|
|
4488
|
+
restProps = _objectWithoutProperties(props, _excluded$3);
|
|
3910
4489
|
|
|
3911
4490
|
// 基础样式配置
|
|
3912
4491
|
const baseStyles = {
|
|
@@ -3934,15 +4513,1192 @@ const StyledModal$2 = props => {
|
|
|
3934
4513
|
};
|
|
3935
4514
|
|
|
3936
4515
|
// 合并样式
|
|
3937
|
-
const styles = _objectSpread2
|
|
3938
|
-
return /*#__PURE__*/jsx(Modal, _objectSpread2
|
|
4516
|
+
const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
|
|
4517
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread2({
|
|
3939
4518
|
width: width,
|
|
3940
4519
|
okText: okText,
|
|
3941
4520
|
cancelText: cancelText,
|
|
3942
4521
|
styles: styles
|
|
3943
4522
|
}, restProps));
|
|
3944
4523
|
};
|
|
3945
|
-
var StyledModal$
|
|
4524
|
+
var StyledModal$1 = StyledModal;
|
|
4525
|
+
function getDefaultExportFromCjs$6(x) {
|
|
4526
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
4527
|
+
}
|
|
4528
|
+
var propTypes$6 = {
|
|
4529
|
+
exports: {}
|
|
4530
|
+
};
|
|
4531
|
+
var reactIs$6 = {
|
|
4532
|
+
exports: {}
|
|
4533
|
+
};
|
|
4534
|
+
var reactIs_production_min$6 = {};
|
|
4535
|
+
|
|
4536
|
+
/** @license React v16.13.1
|
|
4537
|
+
* react-is.production.min.js
|
|
4538
|
+
*
|
|
4539
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4540
|
+
*
|
|
4541
|
+
* This source code is licensed under the MIT license found in the
|
|
4542
|
+
* LICENSE file in the root directory of this source tree.
|
|
4543
|
+
*/
|
|
4544
|
+
|
|
4545
|
+
var hasRequiredReactIs_production_min$6;
|
|
4546
|
+
function requireReactIs_production_min$6() {
|
|
4547
|
+
if (hasRequiredReactIs_production_min$6) return reactIs_production_min$6;
|
|
4548
|
+
hasRequiredReactIs_production_min$6 = 1;
|
|
4549
|
+
var b = "function" === typeof Symbol && Symbol.for,
|
|
4550
|
+
c = b ? Symbol.for("react.element") : 60103,
|
|
4551
|
+
d = b ? Symbol.for("react.portal") : 60106,
|
|
4552
|
+
e = b ? Symbol.for("react.fragment") : 60107,
|
|
4553
|
+
f = b ? Symbol.for("react.strict_mode") : 60108,
|
|
4554
|
+
g = b ? Symbol.for("react.profiler") : 60114,
|
|
4555
|
+
h = b ? Symbol.for("react.provider") : 60109,
|
|
4556
|
+
k = b ? Symbol.for("react.context") : 60110,
|
|
4557
|
+
l = b ? Symbol.for("react.async_mode") : 60111,
|
|
4558
|
+
m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
|
4559
|
+
n = b ? Symbol.for("react.forward_ref") : 60112,
|
|
4560
|
+
p = b ? Symbol.for("react.suspense") : 60113,
|
|
4561
|
+
q = b ? Symbol.for("react.suspense_list") : 60120,
|
|
4562
|
+
r = b ? Symbol.for("react.memo") : 60115,
|
|
4563
|
+
t = b ? Symbol.for("react.lazy") : 60116,
|
|
4564
|
+
v = b ? Symbol.for("react.block") : 60121,
|
|
4565
|
+
w = b ? Symbol.for("react.fundamental") : 60117,
|
|
4566
|
+
x = b ? Symbol.for("react.responder") : 60118,
|
|
4567
|
+
y = b ? Symbol.for("react.scope") : 60119;
|
|
4568
|
+
function z(a) {
|
|
4569
|
+
if ("object" === typeof a && null !== a) {
|
|
4570
|
+
var u = a.$$typeof;
|
|
4571
|
+
switch (u) {
|
|
4572
|
+
case c:
|
|
4573
|
+
switch (a = a.type, a) {
|
|
4574
|
+
case l:
|
|
4575
|
+
case m:
|
|
4576
|
+
case e:
|
|
4577
|
+
case g:
|
|
4578
|
+
case f:
|
|
4579
|
+
case p:
|
|
4580
|
+
return a;
|
|
4581
|
+
default:
|
|
4582
|
+
switch (a = a && a.$$typeof, a) {
|
|
4583
|
+
case k:
|
|
4584
|
+
case n:
|
|
4585
|
+
case t:
|
|
4586
|
+
case r:
|
|
4587
|
+
case h:
|
|
4588
|
+
return a;
|
|
4589
|
+
default:
|
|
4590
|
+
return u;
|
|
4591
|
+
}
|
|
4592
|
+
}
|
|
4593
|
+
case d:
|
|
4594
|
+
return u;
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
}
|
|
4598
|
+
function A(a) {
|
|
4599
|
+
return z(a) === m;
|
|
4600
|
+
}
|
|
4601
|
+
reactIs_production_min$6.AsyncMode = l;
|
|
4602
|
+
reactIs_production_min$6.ConcurrentMode = m;
|
|
4603
|
+
reactIs_production_min$6.ContextConsumer = k;
|
|
4604
|
+
reactIs_production_min$6.ContextProvider = h;
|
|
4605
|
+
reactIs_production_min$6.Element = c;
|
|
4606
|
+
reactIs_production_min$6.ForwardRef = n;
|
|
4607
|
+
reactIs_production_min$6.Fragment = e;
|
|
4608
|
+
reactIs_production_min$6.Lazy = t;
|
|
4609
|
+
reactIs_production_min$6.Memo = r;
|
|
4610
|
+
reactIs_production_min$6.Portal = d;
|
|
4611
|
+
reactIs_production_min$6.Profiler = g;
|
|
4612
|
+
reactIs_production_min$6.StrictMode = f;
|
|
4613
|
+
reactIs_production_min$6.Suspense = p;
|
|
4614
|
+
reactIs_production_min$6.isAsyncMode = function (a) {
|
|
4615
|
+
return A(a) || z(a) === l;
|
|
4616
|
+
};
|
|
4617
|
+
reactIs_production_min$6.isConcurrentMode = A;
|
|
4618
|
+
reactIs_production_min$6.isContextConsumer = function (a) {
|
|
4619
|
+
return z(a) === k;
|
|
4620
|
+
};
|
|
4621
|
+
reactIs_production_min$6.isContextProvider = function (a) {
|
|
4622
|
+
return z(a) === h;
|
|
4623
|
+
};
|
|
4624
|
+
reactIs_production_min$6.isElement = function (a) {
|
|
4625
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
4626
|
+
};
|
|
4627
|
+
reactIs_production_min$6.isForwardRef = function (a) {
|
|
4628
|
+
return z(a) === n;
|
|
4629
|
+
};
|
|
4630
|
+
reactIs_production_min$6.isFragment = function (a) {
|
|
4631
|
+
return z(a) === e;
|
|
4632
|
+
};
|
|
4633
|
+
reactIs_production_min$6.isLazy = function (a) {
|
|
4634
|
+
return z(a) === t;
|
|
4635
|
+
};
|
|
4636
|
+
reactIs_production_min$6.isMemo = function (a) {
|
|
4637
|
+
return z(a) === r;
|
|
4638
|
+
};
|
|
4639
|
+
reactIs_production_min$6.isPortal = function (a) {
|
|
4640
|
+
return z(a) === d;
|
|
4641
|
+
};
|
|
4642
|
+
reactIs_production_min$6.isProfiler = function (a) {
|
|
4643
|
+
return z(a) === g;
|
|
4644
|
+
};
|
|
4645
|
+
reactIs_production_min$6.isStrictMode = function (a) {
|
|
4646
|
+
return z(a) === f;
|
|
4647
|
+
};
|
|
4648
|
+
reactIs_production_min$6.isSuspense = function (a) {
|
|
4649
|
+
return z(a) === p;
|
|
4650
|
+
};
|
|
4651
|
+
reactIs_production_min$6.isValidElementType = function (a) {
|
|
4652
|
+
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);
|
|
4653
|
+
};
|
|
4654
|
+
reactIs_production_min$6.typeOf = z;
|
|
4655
|
+
return reactIs_production_min$6;
|
|
4656
|
+
}
|
|
4657
|
+
var reactIs_development$6 = {};
|
|
4658
|
+
|
|
4659
|
+
/** @license React v16.13.1
|
|
4660
|
+
* react-is.development.js
|
|
4661
|
+
*
|
|
4662
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4663
|
+
*
|
|
4664
|
+
* This source code is licensed under the MIT license found in the
|
|
4665
|
+
* LICENSE file in the root directory of this source tree.
|
|
4666
|
+
*/
|
|
4667
|
+
|
|
4668
|
+
var hasRequiredReactIs_development$6;
|
|
4669
|
+
function requireReactIs_development$6() {
|
|
4670
|
+
if (hasRequiredReactIs_development$6) return reactIs_development$6;
|
|
4671
|
+
hasRequiredReactIs_development$6 = 1;
|
|
4672
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4673
|
+
(function () {
|
|
4674
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
4675
|
+
// nor polyfill, then a plain number is used for performance.
|
|
4676
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
4677
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
4678
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
4679
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
4680
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
4681
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
4682
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
4683
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
4684
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
4685
|
+
|
|
4686
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
4687
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
4688
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
4689
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
4690
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
4691
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
4692
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
4693
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
4694
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
4695
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
4696
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
4697
|
+
function isValidElementType(type) {
|
|
4698
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
4699
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
4700
|
+
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);
|
|
4701
|
+
}
|
|
4702
|
+
function typeOf(object) {
|
|
4703
|
+
if (typeof object === 'object' && object !== null) {
|
|
4704
|
+
var $$typeof = object.$$typeof;
|
|
4705
|
+
switch ($$typeof) {
|
|
4706
|
+
case REACT_ELEMENT_TYPE:
|
|
4707
|
+
var type = object.type;
|
|
4708
|
+
switch (type) {
|
|
4709
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
4710
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
4711
|
+
case REACT_FRAGMENT_TYPE:
|
|
4712
|
+
case REACT_PROFILER_TYPE:
|
|
4713
|
+
case REACT_STRICT_MODE_TYPE:
|
|
4714
|
+
case REACT_SUSPENSE_TYPE:
|
|
4715
|
+
return type;
|
|
4716
|
+
default:
|
|
4717
|
+
var $$typeofType = type && type.$$typeof;
|
|
4718
|
+
switch ($$typeofType) {
|
|
4719
|
+
case REACT_CONTEXT_TYPE:
|
|
4720
|
+
case REACT_FORWARD_REF_TYPE:
|
|
4721
|
+
case REACT_LAZY_TYPE:
|
|
4722
|
+
case REACT_MEMO_TYPE:
|
|
4723
|
+
case REACT_PROVIDER_TYPE:
|
|
4724
|
+
return $$typeofType;
|
|
4725
|
+
default:
|
|
4726
|
+
return $$typeof;
|
|
4727
|
+
}
|
|
4728
|
+
}
|
|
4729
|
+
case REACT_PORTAL_TYPE:
|
|
4730
|
+
return $$typeof;
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
return undefined;
|
|
4734
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
4735
|
+
|
|
4736
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
4737
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
4738
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
4739
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
4740
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
4741
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
4742
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
4743
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
4744
|
+
var Memo = REACT_MEMO_TYPE;
|
|
4745
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
4746
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
4747
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
4748
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
4749
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
4750
|
+
|
|
4751
|
+
function isAsyncMode(object) {
|
|
4752
|
+
{
|
|
4753
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
4754
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
4755
|
+
|
|
4756
|
+
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.');
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
4760
|
+
}
|
|
4761
|
+
function isConcurrentMode(object) {
|
|
4762
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
4763
|
+
}
|
|
4764
|
+
function isContextConsumer(object) {
|
|
4765
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
4766
|
+
}
|
|
4767
|
+
function isContextProvider(object) {
|
|
4768
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
4769
|
+
}
|
|
4770
|
+
function isElement(object) {
|
|
4771
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
4772
|
+
}
|
|
4773
|
+
function isForwardRef(object) {
|
|
4774
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
4775
|
+
}
|
|
4776
|
+
function isFragment(object) {
|
|
4777
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
4778
|
+
}
|
|
4779
|
+
function isLazy(object) {
|
|
4780
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
4781
|
+
}
|
|
4782
|
+
function isMemo(object) {
|
|
4783
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
4784
|
+
}
|
|
4785
|
+
function isPortal(object) {
|
|
4786
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
4787
|
+
}
|
|
4788
|
+
function isProfiler(object) {
|
|
4789
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
4790
|
+
}
|
|
4791
|
+
function isStrictMode(object) {
|
|
4792
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
4793
|
+
}
|
|
4794
|
+
function isSuspense(object) {
|
|
4795
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
4796
|
+
}
|
|
4797
|
+
reactIs_development$6.AsyncMode = AsyncMode;
|
|
4798
|
+
reactIs_development$6.ConcurrentMode = ConcurrentMode;
|
|
4799
|
+
reactIs_development$6.ContextConsumer = ContextConsumer;
|
|
4800
|
+
reactIs_development$6.ContextProvider = ContextProvider;
|
|
4801
|
+
reactIs_development$6.Element = Element;
|
|
4802
|
+
reactIs_development$6.ForwardRef = ForwardRef;
|
|
4803
|
+
reactIs_development$6.Fragment = Fragment;
|
|
4804
|
+
reactIs_development$6.Lazy = Lazy;
|
|
4805
|
+
reactIs_development$6.Memo = Memo;
|
|
4806
|
+
reactIs_development$6.Portal = Portal;
|
|
4807
|
+
reactIs_development$6.Profiler = Profiler;
|
|
4808
|
+
reactIs_development$6.StrictMode = StrictMode;
|
|
4809
|
+
reactIs_development$6.Suspense = Suspense;
|
|
4810
|
+
reactIs_development$6.isAsyncMode = isAsyncMode;
|
|
4811
|
+
reactIs_development$6.isConcurrentMode = isConcurrentMode;
|
|
4812
|
+
reactIs_development$6.isContextConsumer = isContextConsumer;
|
|
4813
|
+
reactIs_development$6.isContextProvider = isContextProvider;
|
|
4814
|
+
reactIs_development$6.isElement = isElement;
|
|
4815
|
+
reactIs_development$6.isForwardRef = isForwardRef;
|
|
4816
|
+
reactIs_development$6.isFragment = isFragment;
|
|
4817
|
+
reactIs_development$6.isLazy = isLazy;
|
|
4818
|
+
reactIs_development$6.isMemo = isMemo;
|
|
4819
|
+
reactIs_development$6.isPortal = isPortal;
|
|
4820
|
+
reactIs_development$6.isProfiler = isProfiler;
|
|
4821
|
+
reactIs_development$6.isStrictMode = isStrictMode;
|
|
4822
|
+
reactIs_development$6.isSuspense = isSuspense;
|
|
4823
|
+
reactIs_development$6.isValidElementType = isValidElementType;
|
|
4824
|
+
reactIs_development$6.typeOf = typeOf;
|
|
4825
|
+
})();
|
|
4826
|
+
}
|
|
4827
|
+
return reactIs_development$6;
|
|
4828
|
+
}
|
|
4829
|
+
var hasRequiredReactIs$6;
|
|
4830
|
+
function requireReactIs$6() {
|
|
4831
|
+
if (hasRequiredReactIs$6) return reactIs$6.exports;
|
|
4832
|
+
hasRequiredReactIs$6 = 1;
|
|
4833
|
+
if (process.env.NODE_ENV === 'production') {
|
|
4834
|
+
reactIs$6.exports = requireReactIs_production_min$6();
|
|
4835
|
+
} else {
|
|
4836
|
+
reactIs$6.exports = requireReactIs_development$6();
|
|
4837
|
+
}
|
|
4838
|
+
return reactIs$6.exports;
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
/*
|
|
4842
|
+
object-assign
|
|
4843
|
+
(c) Sindre Sorhus
|
|
4844
|
+
@license MIT
|
|
4845
|
+
*/
|
|
4846
|
+
|
|
4847
|
+
var objectAssign$6;
|
|
4848
|
+
var hasRequiredObjectAssign$6;
|
|
4849
|
+
function requireObjectAssign$6() {
|
|
4850
|
+
if (hasRequiredObjectAssign$6) return objectAssign$6;
|
|
4851
|
+
hasRequiredObjectAssign$6 = 1;
|
|
4852
|
+
/* eslint-disable no-unused-vars */
|
|
4853
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
4854
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4855
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
4856
|
+
function toObject(val) {
|
|
4857
|
+
if (val === null || val === undefined) {
|
|
4858
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
4859
|
+
}
|
|
4860
|
+
return Object(val);
|
|
4861
|
+
}
|
|
4862
|
+
function shouldUseNative() {
|
|
4863
|
+
try {
|
|
4864
|
+
if (!Object.assign) {
|
|
4865
|
+
return false;
|
|
4866
|
+
}
|
|
4867
|
+
|
|
4868
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
4869
|
+
|
|
4870
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
4871
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
4872
|
+
test1[5] = 'de';
|
|
4873
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
4874
|
+
return false;
|
|
4875
|
+
}
|
|
4876
|
+
|
|
4877
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4878
|
+
var test2 = {};
|
|
4879
|
+
for (var i = 0; i < 10; i++) {
|
|
4880
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
4881
|
+
}
|
|
4882
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
4883
|
+
return test2[n];
|
|
4884
|
+
});
|
|
4885
|
+
if (order2.join('') !== '0123456789') {
|
|
4886
|
+
return false;
|
|
4887
|
+
}
|
|
4888
|
+
|
|
4889
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4890
|
+
var test3 = {};
|
|
4891
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
4892
|
+
test3[letter] = letter;
|
|
4893
|
+
});
|
|
4894
|
+
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
4895
|
+
return false;
|
|
4896
|
+
}
|
|
4897
|
+
return true;
|
|
4898
|
+
} catch (err) {
|
|
4899
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
4900
|
+
return false;
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4903
|
+
objectAssign$6 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
4904
|
+
var from;
|
|
4905
|
+
var to = toObject(target);
|
|
4906
|
+
var symbols;
|
|
4907
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
4908
|
+
from = Object(arguments[s]);
|
|
4909
|
+
for (var key in from) {
|
|
4910
|
+
if (hasOwnProperty.call(from, key)) {
|
|
4911
|
+
to[key] = from[key];
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
if (getOwnPropertySymbols) {
|
|
4915
|
+
symbols = getOwnPropertySymbols(from);
|
|
4916
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
4917
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
4918
|
+
to[symbols[i]] = from[symbols[i]];
|
|
4919
|
+
}
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4923
|
+
return to;
|
|
4924
|
+
};
|
|
4925
|
+
return objectAssign$6;
|
|
4926
|
+
}
|
|
4927
|
+
|
|
4928
|
+
/**
|
|
4929
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4930
|
+
*
|
|
4931
|
+
* This source code is licensed under the MIT license found in the
|
|
4932
|
+
* LICENSE file in the root directory of this source tree.
|
|
4933
|
+
*/
|
|
4934
|
+
|
|
4935
|
+
var ReactPropTypesSecret_1$6;
|
|
4936
|
+
var hasRequiredReactPropTypesSecret$6;
|
|
4937
|
+
function requireReactPropTypesSecret$6() {
|
|
4938
|
+
if (hasRequiredReactPropTypesSecret$6) return ReactPropTypesSecret_1$6;
|
|
4939
|
+
hasRequiredReactPropTypesSecret$6 = 1;
|
|
4940
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
4941
|
+
ReactPropTypesSecret_1$6 = ReactPropTypesSecret;
|
|
4942
|
+
return ReactPropTypesSecret_1$6;
|
|
4943
|
+
}
|
|
4944
|
+
var has$6;
|
|
4945
|
+
var hasRequiredHas$6;
|
|
4946
|
+
function requireHas$6() {
|
|
4947
|
+
if (hasRequiredHas$6) return has$6;
|
|
4948
|
+
hasRequiredHas$6 = 1;
|
|
4949
|
+
has$6 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
4950
|
+
return has$6;
|
|
4951
|
+
}
|
|
4952
|
+
|
|
4953
|
+
/**
|
|
4954
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4955
|
+
*
|
|
4956
|
+
* This source code is licensed under the MIT license found in the
|
|
4957
|
+
* LICENSE file in the root directory of this source tree.
|
|
4958
|
+
*/
|
|
4959
|
+
|
|
4960
|
+
var checkPropTypes_1$6;
|
|
4961
|
+
var hasRequiredCheckPropTypes$6;
|
|
4962
|
+
function requireCheckPropTypes$6() {
|
|
4963
|
+
if (hasRequiredCheckPropTypes$6) return checkPropTypes_1$6;
|
|
4964
|
+
hasRequiredCheckPropTypes$6 = 1;
|
|
4965
|
+
var printWarning = function () {};
|
|
4966
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4967
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$6();
|
|
4968
|
+
var loggedTypeFailures = {};
|
|
4969
|
+
var has = /*@__PURE__*/requireHas$6();
|
|
4970
|
+
printWarning = function (text) {
|
|
4971
|
+
var message = 'Warning: ' + text;
|
|
4972
|
+
if (typeof console !== 'undefined') {
|
|
4973
|
+
console.error(message);
|
|
4974
|
+
}
|
|
4975
|
+
try {
|
|
4976
|
+
// --- Welcome to debugging React ---
|
|
4977
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
4978
|
+
// to find the callsite that caused this warning to fire.
|
|
4979
|
+
throw new Error(message);
|
|
4980
|
+
} catch (x) {/**/}
|
|
4981
|
+
};
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4984
|
+
/**
|
|
4985
|
+
* Assert that the values match with the type specs.
|
|
4986
|
+
* Error messages are memorized and will only be shown once.
|
|
4987
|
+
*
|
|
4988
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
4989
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
4990
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
4991
|
+
* @param {string} componentName Name of the component for error messages.
|
|
4992
|
+
* @param {?Function} getStack Returns the component stack.
|
|
4993
|
+
* @private
|
|
4994
|
+
*/
|
|
4995
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
4996
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4997
|
+
for (var typeSpecName in typeSpecs) {
|
|
4998
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
4999
|
+
var error;
|
|
5000
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
5001
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
5002
|
+
// After these have been cleaned up, we'll let them throw.
|
|
5003
|
+
try {
|
|
5004
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
5005
|
+
// behavior as without this statement except with a better message.
|
|
5006
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
5007
|
+
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`.');
|
|
5008
|
+
err.name = 'Invariant Violation';
|
|
5009
|
+
throw err;
|
|
5010
|
+
}
|
|
5011
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
5012
|
+
} catch (ex) {
|
|
5013
|
+
error = ex;
|
|
5014
|
+
}
|
|
5015
|
+
if (error && !(error instanceof Error)) {
|
|
5016
|
+
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).');
|
|
5017
|
+
}
|
|
5018
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
5019
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
5020
|
+
// same error.
|
|
5021
|
+
loggedTypeFailures[error.message] = true;
|
|
5022
|
+
var stack = getStack ? getStack() : '';
|
|
5023
|
+
printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
5029
|
+
|
|
5030
|
+
/**
|
|
5031
|
+
* Resets warning cache when testing.
|
|
5032
|
+
*
|
|
5033
|
+
* @private
|
|
5034
|
+
*/
|
|
5035
|
+
checkPropTypes.resetWarningCache = function () {
|
|
5036
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5037
|
+
loggedTypeFailures = {};
|
|
5038
|
+
}
|
|
5039
|
+
};
|
|
5040
|
+
checkPropTypes_1$6 = checkPropTypes;
|
|
5041
|
+
return checkPropTypes_1$6;
|
|
5042
|
+
}
|
|
5043
|
+
|
|
5044
|
+
/**
|
|
5045
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5046
|
+
*
|
|
5047
|
+
* This source code is licensed under the MIT license found in the
|
|
5048
|
+
* LICENSE file in the root directory of this source tree.
|
|
5049
|
+
*/
|
|
5050
|
+
|
|
5051
|
+
var factoryWithTypeCheckers$6;
|
|
5052
|
+
var hasRequiredFactoryWithTypeCheckers$6;
|
|
5053
|
+
function requireFactoryWithTypeCheckers$6() {
|
|
5054
|
+
if (hasRequiredFactoryWithTypeCheckers$6) return factoryWithTypeCheckers$6;
|
|
5055
|
+
hasRequiredFactoryWithTypeCheckers$6 = 1;
|
|
5056
|
+
var ReactIs = requireReactIs$6();
|
|
5057
|
+
var assign = requireObjectAssign$6();
|
|
5058
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$6();
|
|
5059
|
+
var has = /*@__PURE__*/requireHas$6();
|
|
5060
|
+
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes$6();
|
|
5061
|
+
var printWarning = function () {};
|
|
5062
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5063
|
+
printWarning = function (text) {
|
|
5064
|
+
var message = 'Warning: ' + text;
|
|
5065
|
+
if (typeof console !== 'undefined') {
|
|
5066
|
+
console.error(message);
|
|
5067
|
+
}
|
|
5068
|
+
try {
|
|
5069
|
+
// --- Welcome to debugging React ---
|
|
5070
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
5071
|
+
// to find the callsite that caused this warning to fire.
|
|
5072
|
+
throw new Error(message);
|
|
5073
|
+
} catch (x) {}
|
|
5074
|
+
};
|
|
5075
|
+
}
|
|
5076
|
+
function emptyFunctionThatReturnsNull() {
|
|
5077
|
+
return null;
|
|
5078
|
+
}
|
|
5079
|
+
factoryWithTypeCheckers$6 = function (isValidElement, throwOnDirectAccess) {
|
|
5080
|
+
/* global Symbol */
|
|
5081
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
5082
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
5083
|
+
|
|
5084
|
+
/**
|
|
5085
|
+
* Returns the iterator method function contained on the iterable object.
|
|
5086
|
+
*
|
|
5087
|
+
* Be sure to invoke the function with the iterable as context:
|
|
5088
|
+
*
|
|
5089
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
5090
|
+
* if (iteratorFn) {
|
|
5091
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
5092
|
+
* ...
|
|
5093
|
+
* }
|
|
5094
|
+
*
|
|
5095
|
+
* @param {?object} maybeIterable
|
|
5096
|
+
* @return {?function}
|
|
5097
|
+
*/
|
|
5098
|
+
function getIteratorFn(maybeIterable) {
|
|
5099
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
5100
|
+
if (typeof iteratorFn === 'function') {
|
|
5101
|
+
return iteratorFn;
|
|
5102
|
+
}
|
|
5103
|
+
}
|
|
5104
|
+
|
|
5105
|
+
/**
|
|
5106
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
5107
|
+
* supplied to React components. Example usage:
|
|
5108
|
+
*
|
|
5109
|
+
* var Props = require('ReactPropTypes');
|
|
5110
|
+
* var MyArticle = React.createClass({
|
|
5111
|
+
* propTypes: {
|
|
5112
|
+
* // An optional string prop named "description".
|
|
5113
|
+
* description: Props.string,
|
|
5114
|
+
*
|
|
5115
|
+
* // A required enum prop named "category".
|
|
5116
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
5117
|
+
*
|
|
5118
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
5119
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
5120
|
+
* },
|
|
5121
|
+
* render: function() { ... }
|
|
5122
|
+
* });
|
|
5123
|
+
*
|
|
5124
|
+
* A more formal specification of how these methods are used:
|
|
5125
|
+
*
|
|
5126
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
5127
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
5128
|
+
*
|
|
5129
|
+
* Each and every declaration produces a function with the same signature. This
|
|
5130
|
+
* allows the creation of custom validation functions. For example:
|
|
5131
|
+
*
|
|
5132
|
+
* var MyLink = React.createClass({
|
|
5133
|
+
* propTypes: {
|
|
5134
|
+
* // An optional string or URI prop named "href".
|
|
5135
|
+
* href: function(props, propName, componentName) {
|
|
5136
|
+
* var propValue = props[propName];
|
|
5137
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
5138
|
+
* !(propValue instanceof URI)) {
|
|
5139
|
+
* return new Error(
|
|
5140
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
5141
|
+
* componentName
|
|
5142
|
+
* );
|
|
5143
|
+
* }
|
|
5144
|
+
* }
|
|
5145
|
+
* },
|
|
5146
|
+
* render: function() {...}
|
|
5147
|
+
* });
|
|
5148
|
+
*
|
|
5149
|
+
* @internal
|
|
5150
|
+
*/
|
|
5151
|
+
|
|
5152
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
5153
|
+
|
|
5154
|
+
// Important!
|
|
5155
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
5156
|
+
var ReactPropTypes = {
|
|
5157
|
+
array: createPrimitiveTypeChecker('array'),
|
|
5158
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
5159
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
5160
|
+
func: createPrimitiveTypeChecker('function'),
|
|
5161
|
+
number: createPrimitiveTypeChecker('number'),
|
|
5162
|
+
object: createPrimitiveTypeChecker('object'),
|
|
5163
|
+
string: createPrimitiveTypeChecker('string'),
|
|
5164
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
5165
|
+
any: createAnyTypeChecker(),
|
|
5166
|
+
arrayOf: createArrayOfTypeChecker,
|
|
5167
|
+
element: createElementTypeChecker(),
|
|
5168
|
+
elementType: createElementTypeTypeChecker(),
|
|
5169
|
+
instanceOf: createInstanceTypeChecker,
|
|
5170
|
+
node: createNodeChecker(),
|
|
5171
|
+
objectOf: createObjectOfTypeChecker,
|
|
5172
|
+
oneOf: createEnumTypeChecker,
|
|
5173
|
+
oneOfType: createUnionTypeChecker,
|
|
5174
|
+
shape: createShapeTypeChecker,
|
|
5175
|
+
exact: createStrictShapeTypeChecker
|
|
5176
|
+
};
|
|
5177
|
+
|
|
5178
|
+
/**
|
|
5179
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
5180
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
5181
|
+
*/
|
|
5182
|
+
/*eslint-disable no-self-compare*/
|
|
5183
|
+
function is(x, y) {
|
|
5184
|
+
// SameValue algorithm
|
|
5185
|
+
if (x === y) {
|
|
5186
|
+
// Steps 1-5, 7-10
|
|
5187
|
+
// Steps 6.b-6.e: +0 != -0
|
|
5188
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
5189
|
+
} else {
|
|
5190
|
+
// Step 6.a: NaN == NaN
|
|
5191
|
+
return x !== x && y !== y;
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
/*eslint-enable no-self-compare*/
|
|
5195
|
+
|
|
5196
|
+
/**
|
|
5197
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
5198
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
5199
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
5200
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
5201
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
5202
|
+
*/
|
|
5203
|
+
function PropTypeError(message, data) {
|
|
5204
|
+
this.message = message;
|
|
5205
|
+
this.data = data && typeof data === 'object' ? data : {};
|
|
5206
|
+
this.stack = '';
|
|
5207
|
+
}
|
|
5208
|
+
// Make `instanceof Error` still work for returned errors.
|
|
5209
|
+
PropTypeError.prototype = Error.prototype;
|
|
5210
|
+
function createChainableTypeChecker(validate) {
|
|
5211
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5212
|
+
var manualPropTypeCallCache = {};
|
|
5213
|
+
var manualPropTypeWarningCount = 0;
|
|
5214
|
+
}
|
|
5215
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
5216
|
+
componentName = componentName || ANONYMOUS;
|
|
5217
|
+
propFullName = propFullName || propName;
|
|
5218
|
+
if (secret !== ReactPropTypesSecret) {
|
|
5219
|
+
if (throwOnDirectAccess) {
|
|
5220
|
+
// New behavior only for users of `prop-types` package
|
|
5221
|
+
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');
|
|
5222
|
+
err.name = 'Invariant Violation';
|
|
5223
|
+
throw err;
|
|
5224
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
5225
|
+
// Old behavior for people using React.PropTypes
|
|
5226
|
+
var cacheKey = componentName + ':' + propName;
|
|
5227
|
+
if (!manualPropTypeCallCache[cacheKey] &&
|
|
5228
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
5229
|
+
manualPropTypeWarningCount < 3) {
|
|
5230
|
+
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.');
|
|
5231
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
5232
|
+
manualPropTypeWarningCount++;
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
}
|
|
5236
|
+
if (props[propName] == null) {
|
|
5237
|
+
if (isRequired) {
|
|
5238
|
+
if (props[propName] === null) {
|
|
5239
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
5240
|
+
}
|
|
5241
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
5242
|
+
}
|
|
5243
|
+
return null;
|
|
5244
|
+
} else {
|
|
5245
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5248
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
5249
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
5250
|
+
return chainedCheckType;
|
|
5251
|
+
}
|
|
5252
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
5253
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
5254
|
+
var propValue = props[propName];
|
|
5255
|
+
var propType = getPropType(propValue);
|
|
5256
|
+
if (propType !== expectedType) {
|
|
5257
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
5258
|
+
// check, but we can offer a more precise error message here rather than
|
|
5259
|
+
// 'of type `object`'.
|
|
5260
|
+
var preciseType = getPreciseType(propValue);
|
|
5261
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
|
|
5262
|
+
expectedType: expectedType
|
|
5263
|
+
});
|
|
5264
|
+
}
|
|
5265
|
+
return null;
|
|
5266
|
+
}
|
|
5267
|
+
return createChainableTypeChecker(validate);
|
|
5268
|
+
}
|
|
5269
|
+
function createAnyTypeChecker() {
|
|
5270
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
5271
|
+
}
|
|
5272
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
5273
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5274
|
+
if (typeof typeChecker !== 'function') {
|
|
5275
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
5276
|
+
}
|
|
5277
|
+
var propValue = props[propName];
|
|
5278
|
+
if (!Array.isArray(propValue)) {
|
|
5279
|
+
var propType = getPropType(propValue);
|
|
5280
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
5281
|
+
}
|
|
5282
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
5283
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
5284
|
+
if (error instanceof Error) {
|
|
5285
|
+
return error;
|
|
5286
|
+
}
|
|
5287
|
+
}
|
|
5288
|
+
return null;
|
|
5289
|
+
}
|
|
5290
|
+
return createChainableTypeChecker(validate);
|
|
5291
|
+
}
|
|
5292
|
+
function createElementTypeChecker() {
|
|
5293
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5294
|
+
var propValue = props[propName];
|
|
5295
|
+
if (!isValidElement(propValue)) {
|
|
5296
|
+
var propType = getPropType(propValue);
|
|
5297
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
5298
|
+
}
|
|
5299
|
+
return null;
|
|
5300
|
+
}
|
|
5301
|
+
return createChainableTypeChecker(validate);
|
|
5302
|
+
}
|
|
5303
|
+
function createElementTypeTypeChecker() {
|
|
5304
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5305
|
+
var propValue = props[propName];
|
|
5306
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
5307
|
+
var propType = getPropType(propValue);
|
|
5308
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
5309
|
+
}
|
|
5310
|
+
return null;
|
|
5311
|
+
}
|
|
5312
|
+
return createChainableTypeChecker(validate);
|
|
5313
|
+
}
|
|
5314
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
5315
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5316
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
5317
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
5318
|
+
var actualClassName = getClassName(props[propName]);
|
|
5319
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
5320
|
+
}
|
|
5321
|
+
return null;
|
|
5322
|
+
}
|
|
5323
|
+
return createChainableTypeChecker(validate);
|
|
5324
|
+
}
|
|
5325
|
+
function createEnumTypeChecker(expectedValues) {
|
|
5326
|
+
if (!Array.isArray(expectedValues)) {
|
|
5327
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5328
|
+
if (arguments.length > 1) {
|
|
5329
|
+
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]).');
|
|
5330
|
+
} else {
|
|
5331
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
5332
|
+
}
|
|
5333
|
+
}
|
|
5334
|
+
return emptyFunctionThatReturnsNull;
|
|
5335
|
+
}
|
|
5336
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5337
|
+
var propValue = props[propName];
|
|
5338
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
5339
|
+
if (is(propValue, expectedValues[i])) {
|
|
5340
|
+
return null;
|
|
5341
|
+
}
|
|
5342
|
+
}
|
|
5343
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
5344
|
+
var type = getPreciseType(value);
|
|
5345
|
+
if (type === 'symbol') {
|
|
5346
|
+
return String(value);
|
|
5347
|
+
}
|
|
5348
|
+
return value;
|
|
5349
|
+
});
|
|
5350
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
5351
|
+
}
|
|
5352
|
+
return createChainableTypeChecker(validate);
|
|
5353
|
+
}
|
|
5354
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
5355
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5356
|
+
if (typeof typeChecker !== 'function') {
|
|
5357
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
5358
|
+
}
|
|
5359
|
+
var propValue = props[propName];
|
|
5360
|
+
var propType = getPropType(propValue);
|
|
5361
|
+
if (propType !== 'object') {
|
|
5362
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
5363
|
+
}
|
|
5364
|
+
for (var key in propValue) {
|
|
5365
|
+
if (has(propValue, key)) {
|
|
5366
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
5367
|
+
if (error instanceof Error) {
|
|
5368
|
+
return error;
|
|
5369
|
+
}
|
|
5370
|
+
}
|
|
5371
|
+
}
|
|
5372
|
+
return null;
|
|
5373
|
+
}
|
|
5374
|
+
return createChainableTypeChecker(validate);
|
|
5375
|
+
}
|
|
5376
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
5377
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
5378
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
5379
|
+
return emptyFunctionThatReturnsNull;
|
|
5380
|
+
}
|
|
5381
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
5382
|
+
var checker = arrayOfTypeCheckers[i];
|
|
5383
|
+
if (typeof checker !== 'function') {
|
|
5384
|
+
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
5385
|
+
return emptyFunctionThatReturnsNull;
|
|
5386
|
+
}
|
|
5387
|
+
}
|
|
5388
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5389
|
+
var expectedTypes = [];
|
|
5390
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
5391
|
+
var checker = arrayOfTypeCheckers[i];
|
|
5392
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
5393
|
+
if (checkerResult == null) {
|
|
5394
|
+
return null;
|
|
5395
|
+
}
|
|
5396
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
5397
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
5398
|
+
}
|
|
5399
|
+
}
|
|
5400
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
5401
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
5402
|
+
}
|
|
5403
|
+
return createChainableTypeChecker(validate);
|
|
5404
|
+
}
|
|
5405
|
+
function createNodeChecker() {
|
|
5406
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5407
|
+
if (!isNode(props[propName])) {
|
|
5408
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
5409
|
+
}
|
|
5410
|
+
return null;
|
|
5411
|
+
}
|
|
5412
|
+
return createChainableTypeChecker(validate);
|
|
5413
|
+
}
|
|
5414
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
5415
|
+
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 + '`.');
|
|
5416
|
+
}
|
|
5417
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
5418
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5419
|
+
var propValue = props[propName];
|
|
5420
|
+
var propType = getPropType(propValue);
|
|
5421
|
+
if (propType !== 'object') {
|
|
5422
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
5423
|
+
}
|
|
5424
|
+
for (var key in shapeTypes) {
|
|
5425
|
+
var checker = shapeTypes[key];
|
|
5426
|
+
if (typeof checker !== 'function') {
|
|
5427
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
5428
|
+
}
|
|
5429
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
5430
|
+
if (error) {
|
|
5431
|
+
return error;
|
|
5432
|
+
}
|
|
5433
|
+
}
|
|
5434
|
+
return null;
|
|
5435
|
+
}
|
|
5436
|
+
return createChainableTypeChecker(validate);
|
|
5437
|
+
}
|
|
5438
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
5439
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
5440
|
+
var propValue = props[propName];
|
|
5441
|
+
var propType = getPropType(propValue);
|
|
5442
|
+
if (propType !== 'object') {
|
|
5443
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
5444
|
+
}
|
|
5445
|
+
// We need to check all keys in case some are required but missing from props.
|
|
5446
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
5447
|
+
for (var key in allKeys) {
|
|
5448
|
+
var checker = shapeTypes[key];
|
|
5449
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
5450
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
5451
|
+
}
|
|
5452
|
+
if (!checker) {
|
|
5453
|
+
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, ' '));
|
|
5454
|
+
}
|
|
5455
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
5456
|
+
if (error) {
|
|
5457
|
+
return error;
|
|
5458
|
+
}
|
|
5459
|
+
}
|
|
5460
|
+
return null;
|
|
5461
|
+
}
|
|
5462
|
+
return createChainableTypeChecker(validate);
|
|
5463
|
+
}
|
|
5464
|
+
function isNode(propValue) {
|
|
5465
|
+
switch (typeof propValue) {
|
|
5466
|
+
case 'number':
|
|
5467
|
+
case 'string':
|
|
5468
|
+
case 'undefined':
|
|
5469
|
+
return true;
|
|
5470
|
+
case 'boolean':
|
|
5471
|
+
return !propValue;
|
|
5472
|
+
case 'object':
|
|
5473
|
+
if (Array.isArray(propValue)) {
|
|
5474
|
+
return propValue.every(isNode);
|
|
5475
|
+
}
|
|
5476
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
5477
|
+
return true;
|
|
5478
|
+
}
|
|
5479
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
5480
|
+
if (iteratorFn) {
|
|
5481
|
+
var iterator = iteratorFn.call(propValue);
|
|
5482
|
+
var step;
|
|
5483
|
+
if (iteratorFn !== propValue.entries) {
|
|
5484
|
+
while (!(step = iterator.next()).done) {
|
|
5485
|
+
if (!isNode(step.value)) {
|
|
5486
|
+
return false;
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
} else {
|
|
5490
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
5491
|
+
while (!(step = iterator.next()).done) {
|
|
5492
|
+
var entry = step.value;
|
|
5493
|
+
if (entry) {
|
|
5494
|
+
if (!isNode(entry[1])) {
|
|
5495
|
+
return false;
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
}
|
|
5500
|
+
} else {
|
|
5501
|
+
return false;
|
|
5502
|
+
}
|
|
5503
|
+
return true;
|
|
5504
|
+
default:
|
|
5505
|
+
return false;
|
|
5506
|
+
}
|
|
5507
|
+
}
|
|
5508
|
+
function isSymbol(propType, propValue) {
|
|
5509
|
+
// Native Symbol.
|
|
5510
|
+
if (propType === 'symbol') {
|
|
5511
|
+
return true;
|
|
5512
|
+
}
|
|
5513
|
+
|
|
5514
|
+
// falsy value can't be a Symbol
|
|
5515
|
+
if (!propValue) {
|
|
5516
|
+
return false;
|
|
5517
|
+
}
|
|
5518
|
+
|
|
5519
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
5520
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
5521
|
+
return true;
|
|
5522
|
+
}
|
|
5523
|
+
|
|
5524
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
5525
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
5526
|
+
return true;
|
|
5527
|
+
}
|
|
5528
|
+
return false;
|
|
5529
|
+
}
|
|
5530
|
+
|
|
5531
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
5532
|
+
function getPropType(propValue) {
|
|
5533
|
+
var propType = typeof propValue;
|
|
5534
|
+
if (Array.isArray(propValue)) {
|
|
5535
|
+
return 'array';
|
|
5536
|
+
}
|
|
5537
|
+
if (propValue instanceof RegExp) {
|
|
5538
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
5539
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
5540
|
+
// passes PropTypes.object.
|
|
5541
|
+
return 'object';
|
|
5542
|
+
}
|
|
5543
|
+
if (isSymbol(propType, propValue)) {
|
|
5544
|
+
return 'symbol';
|
|
5545
|
+
}
|
|
5546
|
+
return propType;
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
5550
|
+
// See `createPrimitiveTypeChecker`.
|
|
5551
|
+
function getPreciseType(propValue) {
|
|
5552
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
5553
|
+
return '' + propValue;
|
|
5554
|
+
}
|
|
5555
|
+
var propType = getPropType(propValue);
|
|
5556
|
+
if (propType === 'object') {
|
|
5557
|
+
if (propValue instanceof Date) {
|
|
5558
|
+
return 'date';
|
|
5559
|
+
} else if (propValue instanceof RegExp) {
|
|
5560
|
+
return 'regexp';
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
5563
|
+
return propType;
|
|
5564
|
+
}
|
|
5565
|
+
|
|
5566
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
5567
|
+
// For example, "undefined" or "of type array"
|
|
5568
|
+
function getPostfixForTypeWarning(value) {
|
|
5569
|
+
var type = getPreciseType(value);
|
|
5570
|
+
switch (type) {
|
|
5571
|
+
case 'array':
|
|
5572
|
+
case 'object':
|
|
5573
|
+
return 'an ' + type;
|
|
5574
|
+
case 'boolean':
|
|
5575
|
+
case 'date':
|
|
5576
|
+
case 'regexp':
|
|
5577
|
+
return 'a ' + type;
|
|
5578
|
+
default:
|
|
5579
|
+
return type;
|
|
5580
|
+
}
|
|
5581
|
+
}
|
|
5582
|
+
|
|
5583
|
+
// Returns class name of the object, if any.
|
|
5584
|
+
function getClassName(propValue) {
|
|
5585
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
5586
|
+
return ANONYMOUS;
|
|
5587
|
+
}
|
|
5588
|
+
return propValue.constructor.name;
|
|
5589
|
+
}
|
|
5590
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
5591
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
5592
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
5593
|
+
return ReactPropTypes;
|
|
5594
|
+
};
|
|
5595
|
+
return factoryWithTypeCheckers$6;
|
|
5596
|
+
}
|
|
5597
|
+
|
|
5598
|
+
/**
|
|
5599
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5600
|
+
*
|
|
5601
|
+
* This source code is licensed under the MIT license found in the
|
|
5602
|
+
* LICENSE file in the root directory of this source tree.
|
|
5603
|
+
*/
|
|
5604
|
+
|
|
5605
|
+
var factoryWithThrowingShims$6;
|
|
5606
|
+
var hasRequiredFactoryWithThrowingShims$6;
|
|
5607
|
+
function requireFactoryWithThrowingShims$6() {
|
|
5608
|
+
if (hasRequiredFactoryWithThrowingShims$6) return factoryWithThrowingShims$6;
|
|
5609
|
+
hasRequiredFactoryWithThrowingShims$6 = 1;
|
|
5610
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$6();
|
|
5611
|
+
function emptyFunction() {}
|
|
5612
|
+
function emptyFunctionWithReset() {}
|
|
5613
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
5614
|
+
factoryWithThrowingShims$6 = function () {
|
|
5615
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
5616
|
+
if (secret === ReactPropTypesSecret) {
|
|
5617
|
+
// It is still safe when called from React.
|
|
5618
|
+
return;
|
|
5619
|
+
}
|
|
5620
|
+
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');
|
|
5621
|
+
err.name = 'Invariant Violation';
|
|
5622
|
+
throw err;
|
|
5623
|
+
}
|
|
5624
|
+
shim.isRequired = shim;
|
|
5625
|
+
function getShim() {
|
|
5626
|
+
return shim;
|
|
5627
|
+
} // Important!
|
|
5628
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
5629
|
+
var ReactPropTypes = {
|
|
5630
|
+
array: shim,
|
|
5631
|
+
bigint: shim,
|
|
5632
|
+
bool: shim,
|
|
5633
|
+
func: shim,
|
|
5634
|
+
number: shim,
|
|
5635
|
+
object: shim,
|
|
5636
|
+
string: shim,
|
|
5637
|
+
symbol: shim,
|
|
5638
|
+
any: shim,
|
|
5639
|
+
arrayOf: getShim,
|
|
5640
|
+
element: shim,
|
|
5641
|
+
elementType: shim,
|
|
5642
|
+
instanceOf: getShim,
|
|
5643
|
+
node: shim,
|
|
5644
|
+
objectOf: getShim,
|
|
5645
|
+
oneOf: getShim,
|
|
5646
|
+
oneOfType: getShim,
|
|
5647
|
+
shape: getShim,
|
|
5648
|
+
exact: getShim,
|
|
5649
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
5650
|
+
resetWarningCache: emptyFunction
|
|
5651
|
+
};
|
|
5652
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
5653
|
+
return ReactPropTypes;
|
|
5654
|
+
};
|
|
5655
|
+
return factoryWithThrowingShims$6;
|
|
5656
|
+
}
|
|
5657
|
+
|
|
5658
|
+
/**
|
|
5659
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5660
|
+
*
|
|
5661
|
+
* This source code is licensed under the MIT license found in the
|
|
5662
|
+
* LICENSE file in the root directory of this source tree.
|
|
5663
|
+
*/
|
|
5664
|
+
|
|
5665
|
+
var hasRequiredPropTypes$6;
|
|
5666
|
+
function requirePropTypes$6() {
|
|
5667
|
+
if (hasRequiredPropTypes$6) return propTypes$6.exports;
|
|
5668
|
+
hasRequiredPropTypes$6 = 1;
|
|
5669
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5670
|
+
var ReactIs = requireReactIs$6();
|
|
5671
|
+
|
|
5672
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
5673
|
+
// http://fb.me/prop-types-in-prod
|
|
5674
|
+
var throwOnDirectAccess = true;
|
|
5675
|
+
propTypes$6.exports = /*@__PURE__*/requireFactoryWithTypeCheckers$6()(ReactIs.isElement, throwOnDirectAccess);
|
|
5676
|
+
} else {
|
|
5677
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
5678
|
+
// http://fb.me/prop-types-in-prod
|
|
5679
|
+
propTypes$6.exports = /*@__PURE__*/requireFactoryWithThrowingShims$6()();
|
|
5680
|
+
}
|
|
5681
|
+
return propTypes$6.exports;
|
|
5682
|
+
}
|
|
5683
|
+
var propTypesExports$6 = /*@__PURE__*/requirePropTypes$6();
|
|
5684
|
+
var PropTypes$6 = /*@__PURE__*/getDefaultExportFromCjs$6(propTypesExports$6);
|
|
5685
|
+
({
|
|
5686
|
+
onPowerOff: PropTypes$6.func,
|
|
5687
|
+
onRestart: PropTypes$6.func,
|
|
5688
|
+
powerOffLabel: PropTypes$6.string,
|
|
5689
|
+
restartLabel: PropTypes$6.string,
|
|
5690
|
+
iconClassName: PropTypes$6.string,
|
|
5691
|
+
confirmTitle: PropTypes$6.string,
|
|
5692
|
+
cancelText: PropTypes$6.string,
|
|
5693
|
+
okText: PropTypes$6.string,
|
|
5694
|
+
run: PropTypes$6.func
|
|
5695
|
+
});
|
|
5696
|
+
({
|
|
5697
|
+
logoUrl: PropTypes$6.string,
|
|
5698
|
+
logoWidth: PropTypes$6.number,
|
|
5699
|
+
logoAlt: PropTypes$6.string,
|
|
5700
|
+
onClick: PropTypes$6.func
|
|
5701
|
+
});
|
|
3946
5702
|
function getDefaultExportFromCjs$5(x) {
|
|
3947
5703
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3948
5704
|
}
|
|
@@ -11165,7 +12921,7 @@ const NmosModal = _ref => {
|
|
|
11165
12921
|
const values = await form.getFieldsValue();
|
|
11166
12922
|
setLoading(true);
|
|
11167
12923
|
try {
|
|
11168
|
-
const response = await updateNmosSettings(_objectSpread2(_objectSpread2({}, nmosSettings), values));
|
|
12924
|
+
const response = await updateNmosSettings(_objectSpread2$1(_objectSpread2$1({}, nmosSettings), values));
|
|
11169
12925
|
if (response) {
|
|
11170
12926
|
message.success('Success');
|
|
11171
12927
|
setTimeout(() => {
|
|
@@ -11178,16 +12934,16 @@ const NmosModal = _ref => {
|
|
|
11178
12934
|
setLoading(false);
|
|
11179
12935
|
}
|
|
11180
12936
|
};
|
|
11181
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
12937
|
+
return /*#__PURE__*/jsx(StyledModal$1, _objectSpread2$1(_objectSpread2$1({
|
|
11182
12938
|
title: "NMOS",
|
|
11183
12939
|
width: 650,
|
|
11184
12940
|
open: open,
|
|
11185
12941
|
onOk: handleSubmit,
|
|
11186
12942
|
onCancel: onClose,
|
|
11187
12943
|
confirmLoading: loading,
|
|
11188
|
-
|
|
12944
|
+
destroyOnHidden: true // 关闭时销毁组件,确保下次打开重新初始化
|
|
11189
12945
|
}, modalProps), {}, {
|
|
11190
|
-
children: /*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({
|
|
12946
|
+
children: /*#__PURE__*/jsxs(Form, _objectSpread2$1(_objectSpread2$1({
|
|
11191
12947
|
form: form,
|
|
11192
12948
|
name: "nmosForm",
|
|
11193
12949
|
labelCol: {
|
|
@@ -11223,7 +12979,7 @@ const NmosModal = _ref => {
|
|
|
11223
12979
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
11224
12980
|
label: "Registry Port",
|
|
11225
12981
|
name: "registration_port",
|
|
11226
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
12982
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2$1(_objectSpread2$1({}, numberProps), {}, {
|
|
11227
12983
|
min: 0,
|
|
11228
12984
|
max: 65535,
|
|
11229
12985
|
style: {
|
|
@@ -11252,7 +13008,7 @@ const NmosModal = _ref => {
|
|
|
11252
13008
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
11253
13009
|
label: "Logging Level",
|
|
11254
13010
|
name: "logging_level",
|
|
11255
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
13011
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2$1(_objectSpread2$1({}, numberProps), {}, {
|
|
11256
13012
|
min: -40,
|
|
11257
13013
|
max: 40,
|
|
11258
13014
|
style: {
|
|
@@ -11538,7 +13294,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
11538
13294
|
// 新增 disabled 属性
|
|
11539
13295
|
style
|
|
11540
13296
|
} = _ref2,
|
|
11541
|
-
restProps = _objectWithoutProperties(_ref2, _excluded$1);
|
|
13297
|
+
restProps = _objectWithoutProperties$1(_ref2, _excluded$1);
|
|
11542
13298
|
const inputRef = useRef(null);
|
|
11543
13299
|
const [isMouseDown, setIsMouseDown] = useState(false);
|
|
11544
13300
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -11647,7 +13403,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
11647
13403
|
applyMovement(totalMovement.current, e);
|
|
11648
13404
|
}, [isMouseDown, disabled]);
|
|
11649
13405
|
const getModifiers = useCallback(e => {
|
|
11650
|
-
const mods = _objectSpread2(_objectSpread2({}, defaultModifiers), modifierKeys);
|
|
13406
|
+
const mods = _objectSpread2$1(_objectSpread2$1({}, defaultModifiers), modifierKeys);
|
|
11651
13407
|
for (const key in mods) {
|
|
11652
13408
|
if (key !== "default" && e[key]) {
|
|
11653
13409
|
currentMultiplier.current = mods[key].multiplier;
|
|
@@ -11763,7 +13519,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
11763
13519
|
background: 'rgba(255, 255, 255, 0.08)',
|
|
11764
13520
|
color: 'rgba(255, 255, 255, 0.25)'
|
|
11765
13521
|
} : {};
|
|
11766
|
-
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2({
|
|
13522
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2$1({
|
|
11767
13523
|
ref: inputRef,
|
|
11768
13524
|
type: "text",
|
|
11769
13525
|
inputMode: "numeric",
|
|
@@ -11777,7 +13533,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
11777
13533
|
disabled: disabled,
|
|
11778
13534
|
// 添加 disabled 属性
|
|
11779
13535
|
className: "draggable-number-input ".concat(className, " ").concat(isDragging ? "dragging" : "", " ").concat(disabled ? "disabled" : ""),
|
|
11780
|
-
style: _objectSpread2(_objectSpread2(_objectSpread2({}, {
|
|
13536
|
+
style: _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, {
|
|
11781
13537
|
cursor: disabled ? 'not-allowed' : 'ew-resize',
|
|
11782
13538
|
userSelect: disabled ? 'none' : 'auto',
|
|
11783
13539
|
caretColor: isDragging ? "transparent" : "initial"
|
|
@@ -11798,7 +13554,7 @@ const BoundedInput = _ref => {
|
|
|
11798
13554
|
placeholder = 'Enter an integer',
|
|
11799
13555
|
disabled = false
|
|
11800
13556
|
} = _ref,
|
|
11801
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
13557
|
+
props = _objectWithoutProperties$1(_ref, _excluded);
|
|
11802
13558
|
// 1. 处理输入变更:只管记录,不修正,不打断
|
|
11803
13559
|
const handleChange = val => {
|
|
11804
13560
|
if (val === null || val === undefined) {
|
|
@@ -11830,7 +13586,7 @@ const BoundedInput = _ref => {
|
|
|
11830
13586
|
onChange === null || onChange === void 0 || onChange(safeVal);
|
|
11831
13587
|
}
|
|
11832
13588
|
};
|
|
11833
|
-
return /*#__PURE__*/jsx(InputNumber, _objectSpread2({
|
|
13589
|
+
return /*#__PURE__*/jsx(InputNumber, _objectSpread2$1({
|
|
11834
13590
|
value: value,
|
|
11835
13591
|
onChange: handleChange,
|
|
11836
13592
|
onBlur: handleBlur,
|
|
@@ -11857,7 +13613,7 @@ const BoundedInput = _ref => {
|
|
|
11857
13613
|
/**
|
|
11858
13614
|
* 专用端口输入框
|
|
11859
13615
|
*/
|
|
11860
|
-
const PortInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2({
|
|
13616
|
+
const PortInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2$1({
|
|
11861
13617
|
min: 0,
|
|
11862
13618
|
max: 65535,
|
|
11863
13619
|
placeholder: "Enter port (0-65535)"
|
|
@@ -11866,11 +13622,11 @@ const PortInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2({
|
|
|
11866
13622
|
/**
|
|
11867
13623
|
* 专用 Payload 输入框
|
|
11868
13624
|
*/
|
|
11869
|
-
const PayloadInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2({
|
|
13625
|
+
const PayloadInput = props => /*#__PURE__*/jsx(BoundedInput, _objectSpread2$1({
|
|
11870
13626
|
min: 96,
|
|
11871
13627
|
max: 127,
|
|
11872
13628
|
placeholder: "Enter payload (96-127)"
|
|
11873
13629
|
}, props));
|
|
11874
13630
|
|
|
11875
|
-
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, MaintenancePage, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PayloadInput, PortInput, PresetModal, PtpModal$1 as PtpModal, StyledModal$
|
|
13631
|
+
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, MaintenancePage, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PayloadInput, PortInput, PresetModal, PtpModal$1 as PtpModal, StyledModal$3 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, addMessages, initI18n, setLocale, useAuth, useHardwareUsage$1 as useHardwareUsage, useIntl, usePageReload$1 as usePageReload, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade, useWebSocketWithFeatures$1 as useWebSocketWithFeatures };
|
|
11876
13632
|
//# sourceMappingURL=index.esm.js.map
|