seeder-st2110-components 1.7.3 → 1.7.5
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 +1492 -276
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1492 -276
- 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
|
|
9
|
-
return (r = _toPropertyKey
|
|
8
|
+
function _defineProperty(e, r, t) {
|
|
9
|
+
return (r = _toPropertyKey(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
|
|
16
|
+
function ownKeys(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$1(e, r) {
|
|
|
23
23
|
}
|
|
24
24
|
return t;
|
|
25
25
|
}
|
|
26
|
-
function _objectSpread2
|
|
26
|
+
function _objectSpread2(e) {
|
|
27
27
|
for (var r = 1; r < arguments.length; r++) {
|
|
28
28
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
29
|
-
r % 2 ? ownKeys
|
|
30
|
-
_defineProperty
|
|
31
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys
|
|
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) {
|
|
32
32
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
return e;
|
|
36
36
|
}
|
|
37
|
-
function _objectWithoutProperties
|
|
37
|
+
function _objectWithoutProperties(e, t) {
|
|
38
38
|
if (null == e) return {};
|
|
39
39
|
var o,
|
|
40
40
|
r,
|
|
41
|
-
i = _objectWithoutPropertiesLoose
|
|
41
|
+
i = _objectWithoutPropertiesLoose(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
|
|
48
|
+
function _objectWithoutPropertiesLoose(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$1(r, e) {
|
|
|
54
54
|
}
|
|
55
55
|
return t;
|
|
56
56
|
}
|
|
57
|
-
function _toPrimitive
|
|
57
|
+
function _toPrimitive(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$1(t, r) {
|
|
|
64
64
|
}
|
|
65
65
|
return ("string" === r ? String : Number)(t);
|
|
66
66
|
}
|
|
67
|
-
function _toPropertyKey
|
|
68
|
-
var i = _toPrimitive
|
|
67
|
+
function _toPropertyKey(t) {
|
|
68
|
+
var i = _toPrimitive(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
|
|
115
|
+
setSystemStatus(prev => _objectSpread2(_objectSpread2({}, 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
|
|
210
|
+
items.push(_objectSpread2(_objectSpread2({}, 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
|
|
254
|
+
const _excluded$2 = ["width", "okText", "cancelText", "styles"];
|
|
255
|
+
const StyledModal = 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
|
|
262
|
+
restProps = _objectWithoutProperties(props, _excluded$2);
|
|
263
263
|
|
|
264
264
|
// 基础样式配置
|
|
265
265
|
const baseStyles = {
|
|
@@ -287,15 +287,15 @@ const StyledModal$2 = props => {
|
|
|
287
287
|
};
|
|
288
288
|
|
|
289
289
|
// 合并样式
|
|
290
|
-
const styles = _objectSpread2
|
|
291
|
-
return /*#__PURE__*/jsx(Modal, _objectSpread2
|
|
290
|
+
const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
|
|
291
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread2({
|
|
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$1 = StyledModal;
|
|
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$1, {
|
|
339
339
|
title: title,
|
|
340
340
|
width: width,
|
|
341
341
|
open: true,
|
|
@@ -916,7 +916,7 @@ const NetworkFieldGroup = _ref => {
|
|
|
916
916
|
enabled: true
|
|
917
917
|
}
|
|
918
918
|
};
|
|
919
|
-
const mergedFieldConfig = _objectSpread2
|
|
919
|
+
const mergedFieldConfig = _objectSpread2(_objectSpread2(_objectSpread2({}, defaultFieldConfig), fieldConfig), {}, {
|
|
920
920
|
netmask: {
|
|
921
921
|
label: "Netmask",
|
|
922
922
|
enabled: (_fieldConfig$netmask$ = (_fieldConfig$netmask = fieldConfig.netmask) === null || _fieldConfig$netmask === void 0 ? void 0 : _fieldConfig$netmask.enabled) !== null && _fieldConfig$netmask$ !== void 0 ? _fieldConfig$netmask$ : defaultFieldConfig.netmask.enabled // 合并 enabled
|
|
@@ -992,18 +992,18 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
992
992
|
hasInitialized: false
|
|
993
993
|
});
|
|
994
994
|
const preparedFieldConfig = useMemo(() => {
|
|
995
|
-
const config = _objectSpread2
|
|
995
|
+
const config = _objectSpread2({}, fieldConfig);
|
|
996
996
|
|
|
997
997
|
// 确保LAN和QSFP的配置存在
|
|
998
998
|
config.LAN = config.LAN || {};
|
|
999
999
|
config.QSFP = config.QSFP || {};
|
|
1000
1000
|
if (sections.includes('LAN')) {
|
|
1001
|
-
config.LAN.netmask = _objectSpread2
|
|
1001
|
+
config.LAN.netmask = _objectSpread2(_objectSpread2({}, config.LAN.netmask || {}), {}, {
|
|
1002
1002
|
enabled: showNetmask.LAN
|
|
1003
1003
|
});
|
|
1004
1004
|
}
|
|
1005
1005
|
if (sections.includes('QSFP')) {
|
|
1006
|
-
config.QSFP.netmask = _objectSpread2
|
|
1006
|
+
config.QSFP.netmask = _objectSpread2(_objectSpread2({}, config.QSFP.netmask || {}), {}, {
|
|
1007
1007
|
enabled: showNetmask.QSFP
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
@@ -1073,7 +1073,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1073
1073
|
const initialValues = useMemo(() => {
|
|
1074
1074
|
const values = {};
|
|
1075
1075
|
if (sections.includes('LAN') && lanConfigs.length > 0) {
|
|
1076
|
-
values.LAN = lanConfigs.map(config => _objectSpread2
|
|
1076
|
+
values.LAN = lanConfigs.map(config => _objectSpread2({
|
|
1077
1077
|
connection_id: config.connection_id,
|
|
1078
1078
|
display_name: config.display_name,
|
|
1079
1079
|
ip_address: config.ip_address
|
|
@@ -1082,7 +1082,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1082
1082
|
} : {}));
|
|
1083
1083
|
}
|
|
1084
1084
|
if (sections.includes('QSFP') && st2110Interfaces.length > 0) {
|
|
1085
|
-
values.QSFP = st2110Interfaces.map(iface => _objectSpread2
|
|
1085
|
+
values.QSFP = st2110Interfaces.map(iface => _objectSpread2(_objectSpread2({}, iface.id !== undefined && {
|
|
1086
1086
|
id: iface.id
|
|
1087
1087
|
}), {}, {
|
|
1088
1088
|
display_name: iface.display_name,
|
|
@@ -1151,7 +1151,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1151
1151
|
if (sections.includes('LAN') && values.LAN) {
|
|
1152
1152
|
const lanData = values.LAN.map((item, index) => {
|
|
1153
1153
|
var _lanConfigs$index;
|
|
1154
|
-
return _objectSpread2
|
|
1154
|
+
return _objectSpread2({
|
|
1155
1155
|
connection_id: (_lanConfigs$index = lanConfigs[index]) === null || _lanConfigs$index === void 0 ? void 0 : _lanConfigs$index.connection_id,
|
|
1156
1156
|
ip_address: item.ip_address
|
|
1157
1157
|
}, showNetmask.LAN ? {
|
|
@@ -1165,7 +1165,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1165
1165
|
if (sections.includes('QSFP') && values.QSFP) {
|
|
1166
1166
|
const interfacesData = values.QSFP.map((item, index) => {
|
|
1167
1167
|
var _st2110Interfaces$ind, _st2110Interfaces$ind2, _st2110Interfaces$ind3;
|
|
1168
|
-
return _objectSpread2
|
|
1168
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind = st2110Interfaces[index]) === null || _st2110Interfaces$ind === void 0 ? void 0 : _st2110Interfaces$ind.id) !== undefined && {
|
|
1169
1169
|
id: st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind2 = st2110Interfaces[index]) === null || _st2110Interfaces$ind2 === void 0 ? void 0 : _st2110Interfaces$ind2.id
|
|
1170
1170
|
}), (st2110Interfaces === null || st2110Interfaces === void 0 || (_st2110Interfaces$ind3 = st2110Interfaces[index]) === null || _st2110Interfaces$ind3 === void 0 ? void 0 : _st2110Interfaces$ind3.ip) !== undefined ? {
|
|
1171
1171
|
ip: item.ip_address
|
|
@@ -1197,7 +1197,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1197
1197
|
}, [form, sections, lanConfigs, st2110Interfaces, updateLanConfig, updateSysConfig, handleSuccess]);
|
|
1198
1198
|
|
|
1199
1199
|
// 合并默认模态框属性和传入的属性
|
|
1200
|
-
const mergedModalProps = _objectSpread2
|
|
1200
|
+
const mergedModalProps = _objectSpread2({
|
|
1201
1201
|
title: "Network Settings",
|
|
1202
1202
|
width: 650,
|
|
1203
1203
|
open,
|
|
@@ -1212,7 +1212,7 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1212
1212
|
}, modalProps);
|
|
1213
1213
|
|
|
1214
1214
|
// 合并默认表单属性和传入的属性
|
|
1215
|
-
const mergedFormProps = _objectSpread2
|
|
1215
|
+
const mergedFormProps = _objectSpread2({
|
|
1216
1216
|
form: form,
|
|
1217
1217
|
labelCol: {
|
|
1218
1218
|
span: 6
|
|
@@ -1222,8 +1222,8 @@ const NetworkSettingsModal = _ref2 => {
|
|
|
1222
1222
|
},
|
|
1223
1223
|
autoComplete: "off"
|
|
1224
1224
|
}, formProps);
|
|
1225
|
-
return /*#__PURE__*/jsxs(StyledModal$
|
|
1226
|
-
children: [/*#__PURE__*/jsxs(Form, _objectSpread2
|
|
1225
|
+
return /*#__PURE__*/jsxs(StyledModal$1, _objectSpread2(_objectSpread2({}, mergedModalProps), {}, {
|
|
1226
|
+
children: [/*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
1227
1227
|
children: [sections.includes('LAN') && lanConfigs.length > 0 && /*#__PURE__*/jsxs(Fragment, {
|
|
1228
1228
|
children: [/*#__PURE__*/jsx(NetworkFieldGroup, {
|
|
1229
1229
|
prefix: "LAN",
|
|
@@ -1345,7 +1345,7 @@ function convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder) {
|
|
|
1345
1345
|
formType: 'text'
|
|
1346
1346
|
};
|
|
1347
1347
|
const value = ptpStatus[key];
|
|
1348
|
-
return _objectSpread2
|
|
1348
|
+
return _objectSpread2(_objectSpread2({
|
|
1349
1349
|
key,
|
|
1350
1350
|
value
|
|
1351
1351
|
}, config), {}, {
|
|
@@ -1457,7 +1457,7 @@ const PtpModal = _ref => {
|
|
|
1457
1457
|
if (!open || !ptpStatus) return null;
|
|
1458
1458
|
|
|
1459
1459
|
// 合并默认模态框属性和传入的属性
|
|
1460
|
-
const mergedModalProps = _objectSpread2
|
|
1460
|
+
const mergedModalProps = _objectSpread2({
|
|
1461
1461
|
title: "PTP",
|
|
1462
1462
|
width: 650,
|
|
1463
1463
|
open,
|
|
@@ -1469,7 +1469,7 @@ const PtpModal = _ref => {
|
|
|
1469
1469
|
}, modalProps);
|
|
1470
1470
|
|
|
1471
1471
|
// 合并默认表单属性和传入的属性
|
|
1472
|
-
const mergedFormProps = _objectSpread2
|
|
1472
|
+
const mergedFormProps = _objectSpread2({
|
|
1473
1473
|
form: form,
|
|
1474
1474
|
name: "ptpForm",
|
|
1475
1475
|
labelCol: {
|
|
@@ -1480,8 +1480,8 @@ const PtpModal = _ref => {
|
|
|
1480
1480
|
},
|
|
1481
1481
|
autoComplete: "off"
|
|
1482
1482
|
}, formProps);
|
|
1483
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
1484
|
-
children: /*#__PURE__*/jsx(Form, _objectSpread2
|
|
1483
|
+
return /*#__PURE__*/jsx(StyledModal$1, _objectSpread2(_objectSpread2({}, mergedModalProps), {}, {
|
|
1484
|
+
children: /*#__PURE__*/jsx(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
|
|
1485
1485
|
children: ptpStatusArray.map(item => /*#__PURE__*/jsx(Form.Item, {
|
|
1486
1486
|
label: item.label,
|
|
1487
1487
|
name: item.key,
|
|
@@ -1676,7 +1676,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1676
1676
|
return fields.category_list.options.map(category => {
|
|
1677
1677
|
const isInitiallySelected = initialSelected.includes(category.name);
|
|
1678
1678
|
const shouldDisable = isSavedPreset ? !isInitiallySelected : false;
|
|
1679
|
-
return _objectSpread2
|
|
1679
|
+
return _objectSpread2(_objectSpread2({}, category), {}, {
|
|
1680
1680
|
disabled: shouldDisable,
|
|
1681
1681
|
initiallySelected: isInitiallySelected
|
|
1682
1682
|
});
|
|
@@ -1826,7 +1826,7 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
|
|
|
1826
1826
|
}) :
|
|
1827
1827
|
/*#__PURE__*/
|
|
1828
1828
|
// 非编辑模式下的按钮
|
|
1829
|
-
jsx(SubmitButton, _objectSpread2
|
|
1829
|
+
jsx(SubmitButton, _objectSpread2(_objectSpread2({
|
|
1830
1830
|
action: handleLoad
|
|
1831
1831
|
}, hasCategoryList && {
|
|
1832
1832
|
disabled: !currentSelected.length
|
|
@@ -1891,8 +1891,8 @@ const Preset = _ref => {
|
|
|
1891
1891
|
enableEdit = true
|
|
1892
1892
|
} = _ref;
|
|
1893
1893
|
const {
|
|
1894
|
-
message
|
|
1895
|
-
modal
|
|
1894
|
+
message,
|
|
1895
|
+
modal
|
|
1896
1896
|
} = App.useApp();
|
|
1897
1897
|
const [presetList, setPresetList] = useState([]);
|
|
1898
1898
|
const [selectedPreset, setSelectedPreset] = useState(null);
|
|
@@ -1925,7 +1925,7 @@ const Preset = _ref => {
|
|
|
1925
1925
|
var _fields$category_list;
|
|
1926
1926
|
const unsavedPreset = presetList.find(item => !item.id);
|
|
1927
1927
|
if (unsavedPreset) {
|
|
1928
|
-
|
|
1928
|
+
message.warning('Existing unsaved preset detected.');
|
|
1929
1929
|
return;
|
|
1930
1930
|
}
|
|
1931
1931
|
|
|
@@ -1942,7 +1942,7 @@ const Preset = _ref => {
|
|
|
1942
1942
|
setPresetList([...presetList, newPreset]);
|
|
1943
1943
|
setSelectedPreset(newPreset);
|
|
1944
1944
|
form.setFieldsValue(newPreset);
|
|
1945
|
-
}, [form, presetList,
|
|
1945
|
+
}, [form, presetList, message]);
|
|
1946
1946
|
const handleRemove = useCallback(async () => {
|
|
1947
1947
|
if (!selectedPreset) return;
|
|
1948
1948
|
|
|
@@ -1950,7 +1950,7 @@ const Preset = _ref => {
|
|
|
1950
1950
|
const isUnsavedPreset = !selectedPreset.id;
|
|
1951
1951
|
const presetName = selectedPreset.name || 'Untitled Preset';
|
|
1952
1952
|
try {
|
|
1953
|
-
|
|
1953
|
+
modal.confirm({
|
|
1954
1954
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
1955
1955
|
title: 'Delete Preset',
|
|
1956
1956
|
content: "".concat(texts.deleteConfirm, " \"").concat(presetName, "\"?"),
|
|
@@ -1963,7 +1963,7 @@ const Preset = _ref => {
|
|
|
1963
1963
|
await removePreset({
|
|
1964
1964
|
id: selectedPreset.id
|
|
1965
1965
|
});
|
|
1966
|
-
|
|
1966
|
+
message.success(texts.successText);
|
|
1967
1967
|
} else {
|
|
1968
1968
|
// 移除未保存的预设
|
|
1969
1969
|
setPresetList(prev => prev.filter(item => !!item.id));
|
|
@@ -2002,59 +2002,77 @@ const Preset = _ref => {
|
|
|
2002
2002
|
} catch (error) {
|
|
2003
2003
|
console.error('Failed to delete preset:', error);
|
|
2004
2004
|
}
|
|
2005
|
-
}, [selectedPreset, form,
|
|
2005
|
+
}, [selectedPreset, form, modal, message, texts, removePreset, getPresetList]);
|
|
2006
2006
|
const handleLoadPreset = useCallback(async loadData => {
|
|
2007
2007
|
if (!loadData) return;
|
|
2008
|
+
let modalInstance = null;
|
|
2009
|
+
let resolveOk = null; // 用于控制 confirm 关闭时机
|
|
2008
2010
|
|
|
2009
|
-
|
|
2010
|
-
AntdModal.confirm({
|
|
2011
|
+
modalInstance = modal.confirm({
|
|
2011
2012
|
title: 'Load Preset',
|
|
2012
2013
|
content: "".concat(texts.loadConfirm, " \"").concat(loadData.name, "\"?"),
|
|
2013
2014
|
cancelText: 'No',
|
|
2014
2015
|
okText: 'Yes',
|
|
2015
|
-
onOk
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2016
|
+
// onOk 返回一个 pending Promise
|
|
2017
|
+
onOk: () => {
|
|
2018
|
+
return new Promise((resolve, reject) => {
|
|
2019
|
+
resolveOk = resolve;
|
|
2020
|
+
|
|
2021
|
+
// 立即切换为 loading 状态
|
|
2022
|
+
modalInstance.update({
|
|
2023
|
+
title: texts.loadText,
|
|
2024
|
+
content: /*#__PURE__*/jsx(Spin, {
|
|
2025
|
+
size: "large",
|
|
2026
|
+
className: "block mx-auto"
|
|
2027
|
+
}),
|
|
2028
|
+
okButtonProps: {
|
|
2029
|
+
style: {
|
|
2030
|
+
display: 'none'
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
cancelButtonProps: {
|
|
2034
|
+
style: {
|
|
2035
|
+
display: 'none'
|
|
2036
|
+
}
|
|
2037
|
+
},
|
|
2038
|
+
maskClosable: false,
|
|
2039
|
+
closable: false
|
|
2040
|
+
});
|
|
2041
|
+
(async () => {
|
|
2042
|
+
try {
|
|
2043
|
+
await loadPreset(_objectSpread2({
|
|
2044
|
+
id: loadData.id
|
|
2045
|
+
}, loadData.category_list && {
|
|
2046
|
+
category_list: loadData.category_list
|
|
2047
|
+
}));
|
|
2048
|
+
|
|
2049
|
+
// 成功:1秒后自动关闭
|
|
2050
|
+
setTimeout(() => {
|
|
2051
|
+
var _resolveOk;
|
|
2052
|
+
(_resolveOk = resolveOk) === null || _resolveOk === void 0 || _resolveOk();
|
|
2053
|
+
message.success(texts.successText);
|
|
2054
|
+
// 加载成功的外部回调
|
|
2055
|
+
if (onLoadSuccess) {
|
|
2056
|
+
onLoadSuccess(loadData);
|
|
2057
|
+
}
|
|
2058
|
+
}, 1000);
|
|
2059
|
+
} catch (error) {
|
|
2060
|
+
console.error('Failed to load preset:', error);
|
|
2061
|
+
// 失败:直接关闭 modal
|
|
2062
|
+
modalInstance.destroy();
|
|
2063
|
+
// 加载失败的外部回调
|
|
2064
|
+
if (onLoadError) {
|
|
2065
|
+
onLoadError(error, loadData);
|
|
2066
|
+
}
|
|
2027
2067
|
}
|
|
2028
|
-
}
|
|
2068
|
+
})();
|
|
2029
2069
|
});
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
}, loadData.category_list && {
|
|
2034
|
-
category_list: loadData.category_list
|
|
2035
|
-
}));
|
|
2036
|
-
// 成功时延迟关闭
|
|
2037
|
-
setTimeout(() => {
|
|
2038
|
-
modalInstance.destroy();
|
|
2039
|
-
AntdMessage.success(texts.successText);
|
|
2040
|
-
|
|
2041
|
-
// 加载成功的外部回调
|
|
2042
|
-
if (onLoadSuccess) {
|
|
2043
|
-
onLoadSuccess(loadData);
|
|
2044
|
-
}
|
|
2045
|
-
}, 1000);
|
|
2046
|
-
} catch (error) {
|
|
2047
|
-
console.error('Failed to load preset:', error);
|
|
2048
|
-
modalInstance.destroy();
|
|
2049
|
-
|
|
2050
|
-
// 加载失败的外部回调
|
|
2051
|
-
if (onLoadError) {
|
|
2052
|
-
onLoadError(error, loadData);
|
|
2053
|
-
}
|
|
2054
|
-
}
|
|
2070
|
+
},
|
|
2071
|
+
onCancel: () => {
|
|
2072
|
+
// 用户取消
|
|
2055
2073
|
}
|
|
2056
2074
|
});
|
|
2057
|
-
}, [loadPreset, texts,
|
|
2075
|
+
}, [loadPreset, texts, message, modal, onLoadSuccess, onLoadError]);
|
|
2058
2076
|
const handleSave = useCallback(async () => {
|
|
2059
2077
|
setLoading(true);
|
|
2060
2078
|
try {
|
|
@@ -2064,7 +2082,7 @@ const Preset = _ref => {
|
|
|
2064
2082
|
// 验证预设名称
|
|
2065
2083
|
if ((_fields$name = fields.name) !== null && _fields$name !== void 0 && _fields$name.required) {
|
|
2066
2084
|
if (!values.name || values.name.trim() === '') {
|
|
2067
|
-
|
|
2085
|
+
message.error('Name is required.');
|
|
2068
2086
|
return; // 直接返回 不执行
|
|
2069
2087
|
}
|
|
2070
2088
|
}
|
|
@@ -2072,12 +2090,12 @@ const Preset = _ref => {
|
|
|
2072
2090
|
// 验证分类列表
|
|
2073
2091
|
if ((_fields$category_list2 = fields.category_list) !== null && _fields$category_list2 !== void 0 && _fields$category_list2.required) {
|
|
2074
2092
|
if (!values.category_list || values.category_list.length === 0) {
|
|
2075
|
-
|
|
2093
|
+
message.error('No category selected.');
|
|
2076
2094
|
return;
|
|
2077
2095
|
}
|
|
2078
2096
|
}
|
|
2079
2097
|
await savePreset(values);
|
|
2080
|
-
|
|
2098
|
+
message.success(texts.successText);
|
|
2081
2099
|
const savedPresetName = values.name;
|
|
2082
2100
|
|
|
2083
2101
|
// 刷新列表
|
|
@@ -2099,10 +2117,10 @@ const Preset = _ref => {
|
|
|
2099
2117
|
} finally {
|
|
2100
2118
|
setLoading(false);
|
|
2101
2119
|
}
|
|
2102
|
-
}, [form,
|
|
2120
|
+
}, [form, message, texts, savePreset, getPresetList]);
|
|
2103
2121
|
const handleUpdate = useCallback(async () => {
|
|
2104
2122
|
if (!selectedPreset || !selectedPreset.id) {
|
|
2105
|
-
|
|
2123
|
+
message.error('No preset selected or preset ID is missing.');
|
|
2106
2124
|
return;
|
|
2107
2125
|
}
|
|
2108
2126
|
setLoading(true);
|
|
@@ -2113,7 +2131,7 @@ const Preset = _ref => {
|
|
|
2113
2131
|
// 验证预设名称
|
|
2114
2132
|
if ((_fields$name2 = fields.name) !== null && _fields$name2 !== void 0 && _fields$name2.required) {
|
|
2115
2133
|
if (!values.name || values.name.trim() === '') {
|
|
2116
|
-
|
|
2134
|
+
message.error('Name is required.');
|
|
2117
2135
|
return; // 直接返回 不执行
|
|
2118
2136
|
}
|
|
2119
2137
|
}
|
|
@@ -2133,20 +2151,20 @@ const Preset = _ref => {
|
|
|
2133
2151
|
if (updatedPreset) {
|
|
2134
2152
|
setSelectedPreset(updatedPreset);
|
|
2135
2153
|
}
|
|
2136
|
-
|
|
2154
|
+
message.success(texts.successText);
|
|
2137
2155
|
} catch (error) {
|
|
2138
2156
|
console.error('Failed to update preset:', error);
|
|
2139
2157
|
throw error;
|
|
2140
2158
|
} finally {
|
|
2141
2159
|
setLoading(false);
|
|
2142
2160
|
}
|
|
2143
|
-
}, [form,
|
|
2161
|
+
}, [form, message, texts, updatePreset, selectedPreset]);
|
|
2144
2162
|
|
|
2145
2163
|
// 初始化数据
|
|
2146
2164
|
useEffect(() => {
|
|
2147
2165
|
fetchPresetList();
|
|
2148
2166
|
}, [fetchPresetList]);
|
|
2149
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
2167
|
+
return /*#__PURE__*/jsx(StyledModal$1, {
|
|
2150
2168
|
title: texts.title,
|
|
2151
2169
|
width: width,
|
|
2152
2170
|
open: open,
|
|
@@ -2229,7 +2247,7 @@ const UpgradeManager = _ref => {
|
|
|
2229
2247
|
statusPollingInterval = 1000,
|
|
2230
2248
|
children
|
|
2231
2249
|
} = _ref,
|
|
2232
|
-
dropdownProps = _objectWithoutProperties
|
|
2250
|
+
dropdownProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
2233
2251
|
const [upgradeElement] = useUpgrade$1({
|
|
2234
2252
|
menuItems,
|
|
2235
2253
|
onMenuClick,
|
|
@@ -2245,7 +2263,7 @@ const UpgradeManager = _ref => {
|
|
|
2245
2263
|
const dropdownElement = upgradeElement.props.children[0];
|
|
2246
2264
|
const otherElements = upgradeElement.props.children.slice(1);
|
|
2247
2265
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
2248
|
-
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2
|
|
2266
|
+
children: [/*#__PURE__*/jsx(Dropdown, _objectSpread2(_objectSpread2(_objectSpread2({}, dropdownProps), dropdownElement.props), {}, {
|
|
2249
2267
|
children: children
|
|
2250
2268
|
})), otherElements]
|
|
2251
2269
|
});
|
|
@@ -2260,15 +2278,15 @@ UpgradeManager.defaultProps = {
|
|
|
2260
2278
|
};
|
|
2261
2279
|
var UpgradeManager$1 = UpgradeManager;
|
|
2262
2280
|
|
|
2263
|
-
function getDefaultExportFromCjs$
|
|
2281
|
+
function getDefaultExportFromCjs$4 (x) {
|
|
2264
2282
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2265
2283
|
}
|
|
2266
2284
|
|
|
2267
|
-
var propTypes$
|
|
2285
|
+
var propTypes$4 = {exports: {}};
|
|
2268
2286
|
|
|
2269
|
-
var reactIs$
|
|
2287
|
+
var reactIs$4 = {exports: {}};
|
|
2270
2288
|
|
|
2271
|
-
var reactIs_production_min$
|
|
2289
|
+
var reactIs_production_min$4 = {};
|
|
2272
2290
|
|
|
2273
2291
|
/** @license React v16.13.1
|
|
2274
2292
|
* react-is.production.min.js
|
|
@@ -2279,21 +2297,21 @@ var reactIs_production_min$3 = {};
|
|
|
2279
2297
|
* LICENSE file in the root directory of this source tree.
|
|
2280
2298
|
*/
|
|
2281
2299
|
|
|
2282
|
-
var hasRequiredReactIs_production_min$
|
|
2300
|
+
var hasRequiredReactIs_production_min$4;
|
|
2283
2301
|
|
|
2284
|
-
function requireReactIs_production_min$
|
|
2285
|
-
if (hasRequiredReactIs_production_min$
|
|
2286
|
-
hasRequiredReactIs_production_min$
|
|
2302
|
+
function requireReactIs_production_min$4 () {
|
|
2303
|
+
if (hasRequiredReactIs_production_min$4) return reactIs_production_min$4;
|
|
2304
|
+
hasRequiredReactIs_production_min$4 = 1;
|
|
2287
2305
|
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
2288
2306
|
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
2289
|
-
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$
|
|
2290
|
-
reactIs_production_min$
|
|
2291
|
-
reactIs_production_min$
|
|
2292
|
-
reactIs_production_min$
|
|
2293
|
-
return reactIs_production_min$
|
|
2307
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$4.AsyncMode=l;reactIs_production_min$4.ConcurrentMode=m;reactIs_production_min$4.ContextConsumer=k;reactIs_production_min$4.ContextProvider=h;reactIs_production_min$4.Element=c;reactIs_production_min$4.ForwardRef=n;reactIs_production_min$4.Fragment=e;reactIs_production_min$4.Lazy=t;reactIs_production_min$4.Memo=r;reactIs_production_min$4.Portal=d;
|
|
2308
|
+
reactIs_production_min$4.Profiler=g;reactIs_production_min$4.StrictMode=f;reactIs_production_min$4.Suspense=p;reactIs_production_min$4.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$4.isConcurrentMode=A;reactIs_production_min$4.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$4.isContextProvider=function(a){return z(a)===h};reactIs_production_min$4.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$4.isForwardRef=function(a){return z(a)===n};reactIs_production_min$4.isFragment=function(a){return z(a)===e};reactIs_production_min$4.isLazy=function(a){return z(a)===t};
|
|
2309
|
+
reactIs_production_min$4.isMemo=function(a){return z(a)===r};reactIs_production_min$4.isPortal=function(a){return z(a)===d};reactIs_production_min$4.isProfiler=function(a){return z(a)===g};reactIs_production_min$4.isStrictMode=function(a){return z(a)===f};reactIs_production_min$4.isSuspense=function(a){return z(a)===p};
|
|
2310
|
+
reactIs_production_min$4.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$4.typeOf=z;
|
|
2311
|
+
return reactIs_production_min$4;
|
|
2294
2312
|
}
|
|
2295
2313
|
|
|
2296
|
-
var reactIs_development$
|
|
2314
|
+
var reactIs_development$4 = {};
|
|
2297
2315
|
|
|
2298
2316
|
/** @license React v16.13.1
|
|
2299
2317
|
* react-is.development.js
|
|
@@ -2304,11 +2322,11 @@ var reactIs_development$3 = {};
|
|
|
2304
2322
|
* LICENSE file in the root directory of this source tree.
|
|
2305
2323
|
*/
|
|
2306
2324
|
|
|
2307
|
-
var hasRequiredReactIs_development$
|
|
2325
|
+
var hasRequiredReactIs_development$4;
|
|
2308
2326
|
|
|
2309
|
-
function requireReactIs_development$
|
|
2310
|
-
if (hasRequiredReactIs_development$
|
|
2311
|
-
hasRequiredReactIs_development$
|
|
2327
|
+
function requireReactIs_development$4 () {
|
|
2328
|
+
if (hasRequiredReactIs_development$4) return reactIs_development$4;
|
|
2329
|
+
hasRequiredReactIs_development$4 = 1;
|
|
2312
2330
|
|
|
2313
2331
|
|
|
2314
2332
|
|
|
@@ -2449,51 +2467,51 @@ function requireReactIs_development$3 () {
|
|
|
2449
2467
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2450
2468
|
}
|
|
2451
2469
|
|
|
2452
|
-
reactIs_development$
|
|
2453
|
-
reactIs_development$
|
|
2454
|
-
reactIs_development$
|
|
2455
|
-
reactIs_development$
|
|
2456
|
-
reactIs_development$
|
|
2457
|
-
reactIs_development$
|
|
2458
|
-
reactIs_development$
|
|
2459
|
-
reactIs_development$
|
|
2460
|
-
reactIs_development$
|
|
2461
|
-
reactIs_development$
|
|
2462
|
-
reactIs_development$
|
|
2463
|
-
reactIs_development$
|
|
2464
|
-
reactIs_development$
|
|
2465
|
-
reactIs_development$
|
|
2466
|
-
reactIs_development$
|
|
2467
|
-
reactIs_development$
|
|
2468
|
-
reactIs_development$
|
|
2469
|
-
reactIs_development$
|
|
2470
|
-
reactIs_development$
|
|
2471
|
-
reactIs_development$
|
|
2472
|
-
reactIs_development$
|
|
2473
|
-
reactIs_development$
|
|
2474
|
-
reactIs_development$
|
|
2475
|
-
reactIs_development$
|
|
2476
|
-
reactIs_development$
|
|
2477
|
-
reactIs_development$
|
|
2478
|
-
reactIs_development$
|
|
2479
|
-
reactIs_development$
|
|
2470
|
+
reactIs_development$4.AsyncMode = AsyncMode;
|
|
2471
|
+
reactIs_development$4.ConcurrentMode = ConcurrentMode;
|
|
2472
|
+
reactIs_development$4.ContextConsumer = ContextConsumer;
|
|
2473
|
+
reactIs_development$4.ContextProvider = ContextProvider;
|
|
2474
|
+
reactIs_development$4.Element = Element;
|
|
2475
|
+
reactIs_development$4.ForwardRef = ForwardRef;
|
|
2476
|
+
reactIs_development$4.Fragment = Fragment;
|
|
2477
|
+
reactIs_development$4.Lazy = Lazy;
|
|
2478
|
+
reactIs_development$4.Memo = Memo;
|
|
2479
|
+
reactIs_development$4.Portal = Portal;
|
|
2480
|
+
reactIs_development$4.Profiler = Profiler;
|
|
2481
|
+
reactIs_development$4.StrictMode = StrictMode;
|
|
2482
|
+
reactIs_development$4.Suspense = Suspense;
|
|
2483
|
+
reactIs_development$4.isAsyncMode = isAsyncMode;
|
|
2484
|
+
reactIs_development$4.isConcurrentMode = isConcurrentMode;
|
|
2485
|
+
reactIs_development$4.isContextConsumer = isContextConsumer;
|
|
2486
|
+
reactIs_development$4.isContextProvider = isContextProvider;
|
|
2487
|
+
reactIs_development$4.isElement = isElement;
|
|
2488
|
+
reactIs_development$4.isForwardRef = isForwardRef;
|
|
2489
|
+
reactIs_development$4.isFragment = isFragment;
|
|
2490
|
+
reactIs_development$4.isLazy = isLazy;
|
|
2491
|
+
reactIs_development$4.isMemo = isMemo;
|
|
2492
|
+
reactIs_development$4.isPortal = isPortal;
|
|
2493
|
+
reactIs_development$4.isProfiler = isProfiler;
|
|
2494
|
+
reactIs_development$4.isStrictMode = isStrictMode;
|
|
2495
|
+
reactIs_development$4.isSuspense = isSuspense;
|
|
2496
|
+
reactIs_development$4.isValidElementType = isValidElementType;
|
|
2497
|
+
reactIs_development$4.typeOf = typeOf;
|
|
2480
2498
|
})();
|
|
2481
2499
|
}
|
|
2482
|
-
return reactIs_development$
|
|
2500
|
+
return reactIs_development$4;
|
|
2483
2501
|
}
|
|
2484
2502
|
|
|
2485
|
-
var hasRequiredReactIs$
|
|
2503
|
+
var hasRequiredReactIs$4;
|
|
2486
2504
|
|
|
2487
|
-
function requireReactIs$
|
|
2488
|
-
if (hasRequiredReactIs$
|
|
2489
|
-
hasRequiredReactIs$
|
|
2505
|
+
function requireReactIs$4 () {
|
|
2506
|
+
if (hasRequiredReactIs$4) return reactIs$4.exports;
|
|
2507
|
+
hasRequiredReactIs$4 = 1;
|
|
2490
2508
|
|
|
2491
2509
|
if (process.env.NODE_ENV === 'production') {
|
|
2492
|
-
reactIs$
|
|
2510
|
+
reactIs$4.exports = requireReactIs_production_min$4();
|
|
2493
2511
|
} else {
|
|
2494
|
-
reactIs$
|
|
2512
|
+
reactIs$4.exports = requireReactIs_development$4();
|
|
2495
2513
|
}
|
|
2496
|
-
return reactIs$
|
|
2514
|
+
return reactIs$4.exports;
|
|
2497
2515
|
}
|
|
2498
2516
|
|
|
2499
2517
|
/*
|
|
@@ -2502,12 +2520,12 @@ object-assign
|
|
|
2502
2520
|
@license MIT
|
|
2503
2521
|
*/
|
|
2504
2522
|
|
|
2505
|
-
var objectAssign$
|
|
2506
|
-
var hasRequiredObjectAssign$
|
|
2523
|
+
var objectAssign$4;
|
|
2524
|
+
var hasRequiredObjectAssign$4;
|
|
2507
2525
|
|
|
2508
|
-
function requireObjectAssign$
|
|
2509
|
-
if (hasRequiredObjectAssign$
|
|
2510
|
-
hasRequiredObjectAssign$
|
|
2526
|
+
function requireObjectAssign$4 () {
|
|
2527
|
+
if (hasRequiredObjectAssign$4) return objectAssign$4;
|
|
2528
|
+
hasRequiredObjectAssign$4 = 1;
|
|
2511
2529
|
/* eslint-disable no-unused-vars */
|
|
2512
2530
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
2513
2531
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -2565,7 +2583,7 @@ function requireObjectAssign$3 () {
|
|
|
2565
2583
|
}
|
|
2566
2584
|
}
|
|
2567
2585
|
|
|
2568
|
-
objectAssign$
|
|
2586
|
+
objectAssign$4 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
2569
2587
|
var from;
|
|
2570
2588
|
var to = toObject(target);
|
|
2571
2589
|
var symbols;
|
|
@@ -2591,7 +2609,7 @@ function requireObjectAssign$3 () {
|
|
|
2591
2609
|
|
|
2592
2610
|
return to;
|
|
2593
2611
|
};
|
|
2594
|
-
return objectAssign$
|
|
2612
|
+
return objectAssign$4;
|
|
2595
2613
|
}
|
|
2596
2614
|
|
|
2597
2615
|
/**
|
|
@@ -2601,27 +2619,27 @@ function requireObjectAssign$3 () {
|
|
|
2601
2619
|
* LICENSE file in the root directory of this source tree.
|
|
2602
2620
|
*/
|
|
2603
2621
|
|
|
2604
|
-
var ReactPropTypesSecret_1$
|
|
2605
|
-
var hasRequiredReactPropTypesSecret$
|
|
2622
|
+
var ReactPropTypesSecret_1$4;
|
|
2623
|
+
var hasRequiredReactPropTypesSecret$4;
|
|
2606
2624
|
|
|
2607
|
-
function requireReactPropTypesSecret$
|
|
2608
|
-
if (hasRequiredReactPropTypesSecret$
|
|
2609
|
-
hasRequiredReactPropTypesSecret$
|
|
2625
|
+
function requireReactPropTypesSecret$4 () {
|
|
2626
|
+
if (hasRequiredReactPropTypesSecret$4) return ReactPropTypesSecret_1$4;
|
|
2627
|
+
hasRequiredReactPropTypesSecret$4 = 1;
|
|
2610
2628
|
|
|
2611
2629
|
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2612
2630
|
|
|
2613
|
-
ReactPropTypesSecret_1$
|
|
2614
|
-
return ReactPropTypesSecret_1$
|
|
2631
|
+
ReactPropTypesSecret_1$4 = ReactPropTypesSecret;
|
|
2632
|
+
return ReactPropTypesSecret_1$4;
|
|
2615
2633
|
}
|
|
2616
2634
|
|
|
2617
|
-
var has$
|
|
2618
|
-
var hasRequiredHas$
|
|
2635
|
+
var has$4;
|
|
2636
|
+
var hasRequiredHas$4;
|
|
2619
2637
|
|
|
2620
|
-
function requireHas$
|
|
2621
|
-
if (hasRequiredHas$
|
|
2622
|
-
hasRequiredHas$
|
|
2623
|
-
has$
|
|
2624
|
-
return has$
|
|
2638
|
+
function requireHas$4 () {
|
|
2639
|
+
if (hasRequiredHas$4) return has$4;
|
|
2640
|
+
hasRequiredHas$4 = 1;
|
|
2641
|
+
has$4 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2642
|
+
return has$4;
|
|
2625
2643
|
}
|
|
2626
2644
|
|
|
2627
2645
|
/**
|
|
@@ -2631,19 +2649,19 @@ function requireHas$3 () {
|
|
|
2631
2649
|
* LICENSE file in the root directory of this source tree.
|
|
2632
2650
|
*/
|
|
2633
2651
|
|
|
2634
|
-
var checkPropTypes_1$
|
|
2635
|
-
var hasRequiredCheckPropTypes$
|
|
2652
|
+
var checkPropTypes_1$4;
|
|
2653
|
+
var hasRequiredCheckPropTypes$4;
|
|
2636
2654
|
|
|
2637
|
-
function requireCheckPropTypes$
|
|
2638
|
-
if (hasRequiredCheckPropTypes$
|
|
2639
|
-
hasRequiredCheckPropTypes$
|
|
2655
|
+
function requireCheckPropTypes$4 () {
|
|
2656
|
+
if (hasRequiredCheckPropTypes$4) return checkPropTypes_1$4;
|
|
2657
|
+
hasRequiredCheckPropTypes$4 = 1;
|
|
2640
2658
|
|
|
2641
2659
|
var printWarning = function() {};
|
|
2642
2660
|
|
|
2643
2661
|
if (process.env.NODE_ENV !== 'production') {
|
|
2644
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
2662
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$4();
|
|
2645
2663
|
var loggedTypeFailures = {};
|
|
2646
|
-
var has = /*@__PURE__*/ requireHas$
|
|
2664
|
+
var has = /*@__PURE__*/ requireHas$4();
|
|
2647
2665
|
|
|
2648
2666
|
printWarning = function(text) {
|
|
2649
2667
|
var message = 'Warning: ' + text;
|
|
@@ -2731,8 +2749,8 @@ function requireCheckPropTypes$3 () {
|
|
|
2731
2749
|
}
|
|
2732
2750
|
};
|
|
2733
2751
|
|
|
2734
|
-
checkPropTypes_1$
|
|
2735
|
-
return checkPropTypes_1$
|
|
2752
|
+
checkPropTypes_1$4 = checkPropTypes;
|
|
2753
|
+
return checkPropTypes_1$4;
|
|
2736
2754
|
}
|
|
2737
2755
|
|
|
2738
2756
|
/**
|
|
@@ -2742,19 +2760,19 @@ function requireCheckPropTypes$3 () {
|
|
|
2742
2760
|
* LICENSE file in the root directory of this source tree.
|
|
2743
2761
|
*/
|
|
2744
2762
|
|
|
2745
|
-
var factoryWithTypeCheckers$
|
|
2746
|
-
var hasRequiredFactoryWithTypeCheckers$
|
|
2763
|
+
var factoryWithTypeCheckers$4;
|
|
2764
|
+
var hasRequiredFactoryWithTypeCheckers$4;
|
|
2747
2765
|
|
|
2748
|
-
function requireFactoryWithTypeCheckers$
|
|
2749
|
-
if (hasRequiredFactoryWithTypeCheckers$
|
|
2750
|
-
hasRequiredFactoryWithTypeCheckers$
|
|
2766
|
+
function requireFactoryWithTypeCheckers$4 () {
|
|
2767
|
+
if (hasRequiredFactoryWithTypeCheckers$4) return factoryWithTypeCheckers$4;
|
|
2768
|
+
hasRequiredFactoryWithTypeCheckers$4 = 1;
|
|
2751
2769
|
|
|
2752
|
-
var ReactIs = requireReactIs$
|
|
2753
|
-
var assign = requireObjectAssign$
|
|
2770
|
+
var ReactIs = requireReactIs$4();
|
|
2771
|
+
var assign = requireObjectAssign$4();
|
|
2754
2772
|
|
|
2755
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
2756
|
-
var has = /*@__PURE__*/ requireHas$
|
|
2757
|
-
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$
|
|
2773
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$4();
|
|
2774
|
+
var has = /*@__PURE__*/ requireHas$4();
|
|
2775
|
+
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$4();
|
|
2758
2776
|
|
|
2759
2777
|
var printWarning = function() {};
|
|
2760
2778
|
|
|
@@ -2777,7 +2795,7 @@ function requireFactoryWithTypeCheckers$3 () {
|
|
|
2777
2795
|
return null;
|
|
2778
2796
|
}
|
|
2779
2797
|
|
|
2780
|
-
factoryWithTypeCheckers$
|
|
2798
|
+
factoryWithTypeCheckers$4 = function(isValidElement, throwOnDirectAccess) {
|
|
2781
2799
|
/* global Symbol */
|
|
2782
2800
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2783
2801
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
@@ -3350,7 +3368,7 @@ function requireFactoryWithTypeCheckers$3 () {
|
|
|
3350
3368
|
|
|
3351
3369
|
return ReactPropTypes;
|
|
3352
3370
|
};
|
|
3353
|
-
return factoryWithTypeCheckers$
|
|
3371
|
+
return factoryWithTypeCheckers$4;
|
|
3354
3372
|
}
|
|
3355
3373
|
|
|
3356
3374
|
/**
|
|
@@ -3360,20 +3378,20 @@ function requireFactoryWithTypeCheckers$3 () {
|
|
|
3360
3378
|
* LICENSE file in the root directory of this source tree.
|
|
3361
3379
|
*/
|
|
3362
3380
|
|
|
3363
|
-
var factoryWithThrowingShims$
|
|
3364
|
-
var hasRequiredFactoryWithThrowingShims$
|
|
3381
|
+
var factoryWithThrowingShims$4;
|
|
3382
|
+
var hasRequiredFactoryWithThrowingShims$4;
|
|
3365
3383
|
|
|
3366
|
-
function requireFactoryWithThrowingShims$
|
|
3367
|
-
if (hasRequiredFactoryWithThrowingShims$
|
|
3368
|
-
hasRequiredFactoryWithThrowingShims$
|
|
3384
|
+
function requireFactoryWithThrowingShims$4 () {
|
|
3385
|
+
if (hasRequiredFactoryWithThrowingShims$4) return factoryWithThrowingShims$4;
|
|
3386
|
+
hasRequiredFactoryWithThrowingShims$4 = 1;
|
|
3369
3387
|
|
|
3370
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$
|
|
3388
|
+
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$4();
|
|
3371
3389
|
|
|
3372
3390
|
function emptyFunction() {}
|
|
3373
3391
|
function emptyFunctionWithReset() {}
|
|
3374
3392
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3375
3393
|
|
|
3376
|
-
factoryWithThrowingShims$
|
|
3394
|
+
factoryWithThrowingShims$4 = function() {
|
|
3377
3395
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3378
3396
|
if (secret === ReactPropTypesSecret) {
|
|
3379
3397
|
// It is still safe when called from React.
|
|
@@ -3421,7 +3439,7 @@ function requireFactoryWithThrowingShims$3 () {
|
|
|
3421
3439
|
|
|
3422
3440
|
return ReactPropTypes;
|
|
3423
3441
|
};
|
|
3424
|
-
return factoryWithThrowingShims$
|
|
3442
|
+
return factoryWithThrowingShims$4;
|
|
3425
3443
|
}
|
|
3426
3444
|
|
|
3427
3445
|
/**
|
|
@@ -3431,28 +3449,28 @@ function requireFactoryWithThrowingShims$3 () {
|
|
|
3431
3449
|
* LICENSE file in the root directory of this source tree.
|
|
3432
3450
|
*/
|
|
3433
3451
|
|
|
3434
|
-
var hasRequiredPropTypes$
|
|
3452
|
+
var hasRequiredPropTypes$4;
|
|
3435
3453
|
|
|
3436
|
-
function requirePropTypes$
|
|
3437
|
-
if (hasRequiredPropTypes$
|
|
3438
|
-
hasRequiredPropTypes$
|
|
3454
|
+
function requirePropTypes$4 () {
|
|
3455
|
+
if (hasRequiredPropTypes$4) return propTypes$4.exports;
|
|
3456
|
+
hasRequiredPropTypes$4 = 1;
|
|
3439
3457
|
if (process.env.NODE_ENV !== 'production') {
|
|
3440
|
-
var ReactIs = requireReactIs$
|
|
3458
|
+
var ReactIs = requireReactIs$4();
|
|
3441
3459
|
|
|
3442
3460
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3443
3461
|
// http://fb.me/prop-types-in-prod
|
|
3444
3462
|
var throwOnDirectAccess = true;
|
|
3445
|
-
propTypes$
|
|
3463
|
+
propTypes$4.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$4()(ReactIs.isElement, throwOnDirectAccess);
|
|
3446
3464
|
} else {
|
|
3447
3465
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3448
3466
|
// http://fb.me/prop-types-in-prod
|
|
3449
|
-
propTypes$
|
|
3467
|
+
propTypes$4.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$4()();
|
|
3450
3468
|
}
|
|
3451
|
-
return propTypes$
|
|
3469
|
+
return propTypes$4.exports;
|
|
3452
3470
|
}
|
|
3453
3471
|
|
|
3454
|
-
var propTypesExports$
|
|
3455
|
-
var PropTypes$
|
|
3472
|
+
var propTypesExports$4 = /*@__PURE__*/ requirePropTypes$4();
|
|
3473
|
+
var PropTypes$4 = /*@__PURE__*/getDefaultExportFromCjs$4(propTypesExports$4);
|
|
3456
3474
|
|
|
3457
3475
|
const SystemOperations = _ref => {
|
|
3458
3476
|
let {
|
|
@@ -3468,7 +3486,7 @@ const SystemOperations = _ref => {
|
|
|
3468
3486
|
run
|
|
3469
3487
|
} = _ref;
|
|
3470
3488
|
const {
|
|
3471
|
-
modal
|
|
3489
|
+
modal
|
|
3472
3490
|
} = App.useApp();
|
|
3473
3491
|
const menuItems = [{
|
|
3474
3492
|
key: "poweroff",
|
|
@@ -3490,7 +3508,7 @@ const SystemOperations = _ref => {
|
|
|
3490
3508
|
restart: "restart"
|
|
3491
3509
|
};
|
|
3492
3510
|
const actionText = actionLabels[action] || action;
|
|
3493
|
-
|
|
3511
|
+
modal.confirm({
|
|
3494
3512
|
icon: /*#__PURE__*/jsx(ExclamationCircleFilled, {}),
|
|
3495
3513
|
title: confirmTitle,
|
|
3496
3514
|
content: confirmMessage.replace('{action}', actionText),
|
|
@@ -3534,15 +3552,15 @@ const SystemOperations = _ref => {
|
|
|
3534
3552
|
});
|
|
3535
3553
|
};
|
|
3536
3554
|
SystemOperations.propTypes = {
|
|
3537
|
-
onPowerOff: PropTypes$
|
|
3538
|
-
onRestart: PropTypes$
|
|
3539
|
-
powerOffLabel: PropTypes$
|
|
3540
|
-
restartLabel: PropTypes$
|
|
3541
|
-
iconClassName: PropTypes$
|
|
3542
|
-
confirmTitle: PropTypes$
|
|
3543
|
-
cancelText: PropTypes$
|
|
3544
|
-
okText: PropTypes$
|
|
3545
|
-
run: PropTypes$
|
|
3555
|
+
onPowerOff: PropTypes$4.func,
|
|
3556
|
+
onRestart: PropTypes$4.func,
|
|
3557
|
+
powerOffLabel: PropTypes$4.string,
|
|
3558
|
+
restartLabel: PropTypes$4.string,
|
|
3559
|
+
iconClassName: PropTypes$4.string,
|
|
3560
|
+
confirmTitle: PropTypes$4.string,
|
|
3561
|
+
cancelText: PropTypes$4.string,
|
|
3562
|
+
okText: PropTypes$4.string,
|
|
3563
|
+
run: PropTypes$4.func
|
|
3546
3564
|
};
|
|
3547
3565
|
var SystemOperations$1 = SystemOperations;
|
|
3548
3566
|
|
|
@@ -3585,10 +3603,10 @@ const useSpaLogo = function () {
|
|
|
3585
3603
|
}, "logo")];
|
|
3586
3604
|
};
|
|
3587
3605
|
useSpaLogo.propTypes = {
|
|
3588
|
-
logoUrl: PropTypes$
|
|
3589
|
-
logoWidth: PropTypes$
|
|
3590
|
-
logoAlt: PropTypes$
|
|
3591
|
-
onClick: PropTypes$
|
|
3606
|
+
logoUrl: PropTypes$4.string,
|
|
3607
|
+
logoWidth: PropTypes$4.number,
|
|
3608
|
+
logoAlt: PropTypes$4.string,
|
|
3609
|
+
onClick: PropTypes$4.func
|
|
3592
3610
|
};
|
|
3593
3611
|
var useSpaLogo$1 = useSpaLogo;
|
|
3594
3612
|
|
|
@@ -3690,23 +3708,23 @@ const CommonHeader = _ref => {
|
|
|
3690
3708
|
|
|
3691
3709
|
// PropTypes 类型检查
|
|
3692
3710
|
CommonHeader.propTypes = {
|
|
3693
|
-
menuElement: PropTypes$
|
|
3694
|
-
productInfo: PropTypes$
|
|
3695
|
-
productName: PropTypes$
|
|
3696
|
-
version: PropTypes$
|
|
3711
|
+
menuElement: PropTypes$4.node,
|
|
3712
|
+
productInfo: PropTypes$4.shape({
|
|
3713
|
+
productName: PropTypes$4.string,
|
|
3714
|
+
version: PropTypes$4.string
|
|
3697
3715
|
}),
|
|
3698
|
-
showLogo: PropTypes$
|
|
3699
|
-
showProductInfo: PropTypes$
|
|
3700
|
-
showHardwareUsage: PropTypes$
|
|
3701
|
-
showSystemOperations: PropTypes$
|
|
3702
|
-
onPowerOff: PropTypes$
|
|
3703
|
-
onRestart: PropTypes$
|
|
3704
|
-
onRun: PropTypes$
|
|
3705
|
-
hardwareMonitorUrl: PropTypes$
|
|
3706
|
-
getSocketUrl: PropTypes$
|
|
3707
|
-
logoProps: PropTypes$
|
|
3708
|
-
className: PropTypes$
|
|
3709
|
-
style: PropTypes$
|
|
3716
|
+
showLogo: PropTypes$4.bool,
|
|
3717
|
+
showProductInfo: PropTypes$4.bool,
|
|
3718
|
+
showHardwareUsage: PropTypes$4.bool,
|
|
3719
|
+
showSystemOperations: PropTypes$4.bool,
|
|
3720
|
+
onPowerOff: PropTypes$4.func,
|
|
3721
|
+
onRestart: PropTypes$4.func,
|
|
3722
|
+
onRun: PropTypes$4.func,
|
|
3723
|
+
hardwareMonitorUrl: PropTypes$4.string,
|
|
3724
|
+
getSocketUrl: PropTypes$4.func,
|
|
3725
|
+
logoProps: PropTypes$4.object,
|
|
3726
|
+
className: PropTypes$4.string,
|
|
3727
|
+
style: PropTypes$4.object
|
|
3710
3728
|
};
|
|
3711
3729
|
var CommonHeader$1 = CommonHeader;
|
|
3712
3730
|
|
|
@@ -3736,10 +3754,10 @@ const LSMLabelField = props => {
|
|
|
3736
3754
|
};
|
|
3737
3755
|
loadLsmData();
|
|
3738
3756
|
}, [fetchLsmData]);
|
|
3739
|
-
return /*#__PURE__*/jsx(Form.Item, _objectSpread2
|
|
3757
|
+
return /*#__PURE__*/jsx(Form.Item, _objectSpread2(_objectSpread2({
|
|
3740
3758
|
label: label
|
|
3741
3759
|
}, formItemProps), {}, {
|
|
3742
|
-
children: /*#__PURE__*/jsx(Select, _objectSpread2
|
|
3760
|
+
children: /*#__PURE__*/jsx(Select, _objectSpread2(_objectSpread2(_objectSpread2({}, field), selectProps), {}, {
|
|
3743
3761
|
options: lsmList,
|
|
3744
3762
|
fieldNames: fieldNames,
|
|
3745
3763
|
allowClear: true,
|
|
@@ -3755,15 +3773,15 @@ const LSMLabelField = props => {
|
|
|
3755
3773
|
};
|
|
3756
3774
|
var LSMLabelField$1 = /*#__PURE__*/memo(LSMLabelField);
|
|
3757
3775
|
|
|
3758
|
-
function _defineProperty(e, r, t) {
|
|
3759
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
3776
|
+
function _defineProperty$1(e, r, t) {
|
|
3777
|
+
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
3760
3778
|
value: t,
|
|
3761
3779
|
enumerable: !0,
|
|
3762
3780
|
configurable: !0,
|
|
3763
3781
|
writable: !0
|
|
3764
3782
|
}) : e[r] = t, e;
|
|
3765
3783
|
}
|
|
3766
|
-
function ownKeys(e, r) {
|
|
3784
|
+
function ownKeys$1(e, r) {
|
|
3767
3785
|
var t = Object.keys(e);
|
|
3768
3786
|
if (Object.getOwnPropertySymbols) {
|
|
3769
3787
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -3773,29 +3791,29 @@ function ownKeys(e, r) {
|
|
|
3773
3791
|
}
|
|
3774
3792
|
return t;
|
|
3775
3793
|
}
|
|
3776
|
-
function _objectSpread2(e) {
|
|
3794
|
+
function _objectSpread2$1(e) {
|
|
3777
3795
|
for (var r = 1; r < arguments.length; r++) {
|
|
3778
3796
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
3779
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
3780
|
-
_defineProperty(e, r, t[r]);
|
|
3781
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
3797
|
+
r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {
|
|
3798
|
+
_defineProperty$1(e, r, t[r]);
|
|
3799
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {
|
|
3782
3800
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
3783
3801
|
});
|
|
3784
3802
|
}
|
|
3785
3803
|
return e;
|
|
3786
3804
|
}
|
|
3787
|
-
function _objectWithoutProperties(e, t) {
|
|
3805
|
+
function _objectWithoutProperties$1(e, t) {
|
|
3788
3806
|
if (null == e) return {};
|
|
3789
3807
|
var o,
|
|
3790
3808
|
r,
|
|
3791
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
3809
|
+
i = _objectWithoutPropertiesLoose$1(e, t);
|
|
3792
3810
|
if (Object.getOwnPropertySymbols) {
|
|
3793
3811
|
var n = Object.getOwnPropertySymbols(e);
|
|
3794
3812
|
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
3795
3813
|
}
|
|
3796
3814
|
return i;
|
|
3797
3815
|
}
|
|
3798
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
3816
|
+
function _objectWithoutPropertiesLoose$1(r, e) {
|
|
3799
3817
|
if (null == r) return {};
|
|
3800
3818
|
var t = {};
|
|
3801
3819
|
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
@@ -3804,7 +3822,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
3804
3822
|
}
|
|
3805
3823
|
return t;
|
|
3806
3824
|
}
|
|
3807
|
-
function _toPrimitive(t, r) {
|
|
3825
|
+
function _toPrimitive$1(t, r) {
|
|
3808
3826
|
if ("object" != typeof t || !t) return t;
|
|
3809
3827
|
var e = t[Symbol.toPrimitive];
|
|
3810
3828
|
if (void 0 !== e) {
|
|
@@ -3814,19 +3832,19 @@ function _toPrimitive(t, r) {
|
|
|
3814
3832
|
}
|
|
3815
3833
|
return ("string" === r ? String : Number)(t);
|
|
3816
3834
|
}
|
|
3817
|
-
function _toPropertyKey(t) {
|
|
3818
|
-
var i = _toPrimitive(t, "string");
|
|
3835
|
+
function _toPropertyKey$1(t) {
|
|
3836
|
+
var i = _toPrimitive$1(t, "string");
|
|
3819
3837
|
return "symbol" == typeof i ? i : i + "";
|
|
3820
3838
|
}
|
|
3821
|
-
const _excluded$
|
|
3822
|
-
const StyledModal = props => {
|
|
3839
|
+
const _excluded$3 = ["width", "okText", "cancelText", "styles"];
|
|
3840
|
+
const StyledModal$2 = props => {
|
|
3823
3841
|
const {
|
|
3824
3842
|
width = "520px",
|
|
3825
3843
|
okText = "Apply",
|
|
3826
3844
|
cancelText = "Close",
|
|
3827
3845
|
styles: propStyles = {}
|
|
3828
3846
|
} = props,
|
|
3829
|
-
restProps = _objectWithoutProperties(props, _excluded$
|
|
3847
|
+
restProps = _objectWithoutProperties$1(props, _excluded$3);
|
|
3830
3848
|
|
|
3831
3849
|
// 基础样式配置
|
|
3832
3850
|
const baseStyles = {
|
|
@@ -3854,15 +3872,1213 @@ const StyledModal = props => {
|
|
|
3854
3872
|
};
|
|
3855
3873
|
|
|
3856
3874
|
// 合并样式
|
|
3857
|
-
const styles = _objectSpread2(_objectSpread2({}, baseStyles), propStyles);
|
|
3858
|
-
return /*#__PURE__*/jsx(Modal, _objectSpread2({
|
|
3875
|
+
const styles = _objectSpread2$1(_objectSpread2$1({}, baseStyles), propStyles);
|
|
3876
|
+
return /*#__PURE__*/jsx(Modal, _objectSpread2$1({
|
|
3859
3877
|
width: width,
|
|
3860
3878
|
okText: okText,
|
|
3861
3879
|
cancelText: cancelText,
|
|
3862
3880
|
styles: styles
|
|
3863
3881
|
}, restProps));
|
|
3864
3882
|
};
|
|
3865
|
-
var StyledModal$
|
|
3883
|
+
var StyledModal$3 = StyledModal$2;
|
|
3884
|
+
function getDefaultExportFromCjs$3(x) {
|
|
3885
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3886
|
+
}
|
|
3887
|
+
var propTypes$3 = {
|
|
3888
|
+
exports: {}
|
|
3889
|
+
};
|
|
3890
|
+
var reactIs$3 = {
|
|
3891
|
+
exports: {}
|
|
3892
|
+
};
|
|
3893
|
+
var reactIs_production_min$3 = {};
|
|
3894
|
+
|
|
3895
|
+
/** @license React v16.13.1
|
|
3896
|
+
* react-is.production.min.js
|
|
3897
|
+
*
|
|
3898
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3899
|
+
*
|
|
3900
|
+
* This source code is licensed under the MIT license found in the
|
|
3901
|
+
* LICENSE file in the root directory of this source tree.
|
|
3902
|
+
*/
|
|
3903
|
+
|
|
3904
|
+
var hasRequiredReactIs_production_min$3;
|
|
3905
|
+
function requireReactIs_production_min$3() {
|
|
3906
|
+
if (hasRequiredReactIs_production_min$3) return reactIs_production_min$3;
|
|
3907
|
+
hasRequiredReactIs_production_min$3 = 1;
|
|
3908
|
+
var b = "function" === typeof Symbol && Symbol.for,
|
|
3909
|
+
c = b ? Symbol.for("react.element") : 60103,
|
|
3910
|
+
d = b ? Symbol.for("react.portal") : 60106,
|
|
3911
|
+
e = b ? Symbol.for("react.fragment") : 60107,
|
|
3912
|
+
f = b ? Symbol.for("react.strict_mode") : 60108,
|
|
3913
|
+
g = b ? Symbol.for("react.profiler") : 60114,
|
|
3914
|
+
h = b ? Symbol.for("react.provider") : 60109,
|
|
3915
|
+
k = b ? Symbol.for("react.context") : 60110,
|
|
3916
|
+
l = b ? Symbol.for("react.async_mode") : 60111,
|
|
3917
|
+
m = b ? Symbol.for("react.concurrent_mode") : 60111,
|
|
3918
|
+
n = b ? Symbol.for("react.forward_ref") : 60112,
|
|
3919
|
+
p = b ? Symbol.for("react.suspense") : 60113,
|
|
3920
|
+
q = b ? Symbol.for("react.suspense_list") : 60120,
|
|
3921
|
+
r = b ? Symbol.for("react.memo") : 60115,
|
|
3922
|
+
t = b ? Symbol.for("react.lazy") : 60116,
|
|
3923
|
+
v = b ? Symbol.for("react.block") : 60121,
|
|
3924
|
+
w = b ? Symbol.for("react.fundamental") : 60117,
|
|
3925
|
+
x = b ? Symbol.for("react.responder") : 60118,
|
|
3926
|
+
y = b ? Symbol.for("react.scope") : 60119;
|
|
3927
|
+
function z(a) {
|
|
3928
|
+
if ("object" === typeof a && null !== a) {
|
|
3929
|
+
var u = a.$$typeof;
|
|
3930
|
+
switch (u) {
|
|
3931
|
+
case c:
|
|
3932
|
+
switch (a = a.type, a) {
|
|
3933
|
+
case l:
|
|
3934
|
+
case m:
|
|
3935
|
+
case e:
|
|
3936
|
+
case g:
|
|
3937
|
+
case f:
|
|
3938
|
+
case p:
|
|
3939
|
+
return a;
|
|
3940
|
+
default:
|
|
3941
|
+
switch (a = a && a.$$typeof, a) {
|
|
3942
|
+
case k:
|
|
3943
|
+
case n:
|
|
3944
|
+
case t:
|
|
3945
|
+
case r:
|
|
3946
|
+
case h:
|
|
3947
|
+
return a;
|
|
3948
|
+
default:
|
|
3949
|
+
return u;
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
case d:
|
|
3953
|
+
return u;
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
function A(a) {
|
|
3958
|
+
return z(a) === m;
|
|
3959
|
+
}
|
|
3960
|
+
reactIs_production_min$3.AsyncMode = l;
|
|
3961
|
+
reactIs_production_min$3.ConcurrentMode = m;
|
|
3962
|
+
reactIs_production_min$3.ContextConsumer = k;
|
|
3963
|
+
reactIs_production_min$3.ContextProvider = h;
|
|
3964
|
+
reactIs_production_min$3.Element = c;
|
|
3965
|
+
reactIs_production_min$3.ForwardRef = n;
|
|
3966
|
+
reactIs_production_min$3.Fragment = e;
|
|
3967
|
+
reactIs_production_min$3.Lazy = t;
|
|
3968
|
+
reactIs_production_min$3.Memo = r;
|
|
3969
|
+
reactIs_production_min$3.Portal = d;
|
|
3970
|
+
reactIs_production_min$3.Profiler = g;
|
|
3971
|
+
reactIs_production_min$3.StrictMode = f;
|
|
3972
|
+
reactIs_production_min$3.Suspense = p;
|
|
3973
|
+
reactIs_production_min$3.isAsyncMode = function (a) {
|
|
3974
|
+
return A(a) || z(a) === l;
|
|
3975
|
+
};
|
|
3976
|
+
reactIs_production_min$3.isConcurrentMode = A;
|
|
3977
|
+
reactIs_production_min$3.isContextConsumer = function (a) {
|
|
3978
|
+
return z(a) === k;
|
|
3979
|
+
};
|
|
3980
|
+
reactIs_production_min$3.isContextProvider = function (a) {
|
|
3981
|
+
return z(a) === h;
|
|
3982
|
+
};
|
|
3983
|
+
reactIs_production_min$3.isElement = function (a) {
|
|
3984
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
|
3985
|
+
};
|
|
3986
|
+
reactIs_production_min$3.isForwardRef = function (a) {
|
|
3987
|
+
return z(a) === n;
|
|
3988
|
+
};
|
|
3989
|
+
reactIs_production_min$3.isFragment = function (a) {
|
|
3990
|
+
return z(a) === e;
|
|
3991
|
+
};
|
|
3992
|
+
reactIs_production_min$3.isLazy = function (a) {
|
|
3993
|
+
return z(a) === t;
|
|
3994
|
+
};
|
|
3995
|
+
reactIs_production_min$3.isMemo = function (a) {
|
|
3996
|
+
return z(a) === r;
|
|
3997
|
+
};
|
|
3998
|
+
reactIs_production_min$3.isPortal = function (a) {
|
|
3999
|
+
return z(a) === d;
|
|
4000
|
+
};
|
|
4001
|
+
reactIs_production_min$3.isProfiler = function (a) {
|
|
4002
|
+
return z(a) === g;
|
|
4003
|
+
};
|
|
4004
|
+
reactIs_production_min$3.isStrictMode = function (a) {
|
|
4005
|
+
return z(a) === f;
|
|
4006
|
+
};
|
|
4007
|
+
reactIs_production_min$3.isSuspense = function (a) {
|
|
4008
|
+
return z(a) === p;
|
|
4009
|
+
};
|
|
4010
|
+
reactIs_production_min$3.isValidElementType = function (a) {
|
|
4011
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
4012
|
+
};
|
|
4013
|
+
reactIs_production_min$3.typeOf = z;
|
|
4014
|
+
return reactIs_production_min$3;
|
|
4015
|
+
}
|
|
4016
|
+
var reactIs_development$3 = {};
|
|
4017
|
+
|
|
4018
|
+
/** @license React v16.13.1
|
|
4019
|
+
* react-is.development.js
|
|
4020
|
+
*
|
|
4021
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4022
|
+
*
|
|
4023
|
+
* This source code is licensed under the MIT license found in the
|
|
4024
|
+
* LICENSE file in the root directory of this source tree.
|
|
4025
|
+
*/
|
|
4026
|
+
|
|
4027
|
+
var hasRequiredReactIs_development$3;
|
|
4028
|
+
function requireReactIs_development$3() {
|
|
4029
|
+
if (hasRequiredReactIs_development$3) return reactIs_development$3;
|
|
4030
|
+
hasRequiredReactIs_development$3 = 1;
|
|
4031
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4032
|
+
(function () {
|
|
4033
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
4034
|
+
// nor polyfill, then a plain number is used for performance.
|
|
4035
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
4036
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
4037
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
4038
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
4039
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
4040
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
4041
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
4042
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
4043
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
4044
|
+
|
|
4045
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
4046
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
4047
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
4048
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
4049
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
4050
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
4051
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
4052
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
4053
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
4054
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
4055
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
4056
|
+
function isValidElementType(type) {
|
|
4057
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
4058
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
4059
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
4060
|
+
}
|
|
4061
|
+
function typeOf(object) {
|
|
4062
|
+
if (typeof object === 'object' && object !== null) {
|
|
4063
|
+
var $$typeof = object.$$typeof;
|
|
4064
|
+
switch ($$typeof) {
|
|
4065
|
+
case REACT_ELEMENT_TYPE:
|
|
4066
|
+
var type = object.type;
|
|
4067
|
+
switch (type) {
|
|
4068
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
4069
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
4070
|
+
case REACT_FRAGMENT_TYPE:
|
|
4071
|
+
case REACT_PROFILER_TYPE:
|
|
4072
|
+
case REACT_STRICT_MODE_TYPE:
|
|
4073
|
+
case REACT_SUSPENSE_TYPE:
|
|
4074
|
+
return type;
|
|
4075
|
+
default:
|
|
4076
|
+
var $$typeofType = type && type.$$typeof;
|
|
4077
|
+
switch ($$typeofType) {
|
|
4078
|
+
case REACT_CONTEXT_TYPE:
|
|
4079
|
+
case REACT_FORWARD_REF_TYPE:
|
|
4080
|
+
case REACT_LAZY_TYPE:
|
|
4081
|
+
case REACT_MEMO_TYPE:
|
|
4082
|
+
case REACT_PROVIDER_TYPE:
|
|
4083
|
+
return $$typeofType;
|
|
4084
|
+
default:
|
|
4085
|
+
return $$typeof;
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
case REACT_PORTAL_TYPE:
|
|
4089
|
+
return $$typeof;
|
|
4090
|
+
}
|
|
4091
|
+
}
|
|
4092
|
+
return undefined;
|
|
4093
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
4094
|
+
|
|
4095
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
4096
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
4097
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
4098
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
4099
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
4100
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
4101
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
4102
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
4103
|
+
var Memo = REACT_MEMO_TYPE;
|
|
4104
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
4105
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
4106
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
4107
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
4108
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
4109
|
+
|
|
4110
|
+
function isAsyncMode(object) {
|
|
4111
|
+
{
|
|
4112
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
4113
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
4114
|
+
|
|
4115
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
4119
|
+
}
|
|
4120
|
+
function isConcurrentMode(object) {
|
|
4121
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
4122
|
+
}
|
|
4123
|
+
function isContextConsumer(object) {
|
|
4124
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
4125
|
+
}
|
|
4126
|
+
function isContextProvider(object) {
|
|
4127
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
4128
|
+
}
|
|
4129
|
+
function isElement(object) {
|
|
4130
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
4131
|
+
}
|
|
4132
|
+
function isForwardRef(object) {
|
|
4133
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
4134
|
+
}
|
|
4135
|
+
function isFragment(object) {
|
|
4136
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
4137
|
+
}
|
|
4138
|
+
function isLazy(object) {
|
|
4139
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
4140
|
+
}
|
|
4141
|
+
function isMemo(object) {
|
|
4142
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
4143
|
+
}
|
|
4144
|
+
function isPortal(object) {
|
|
4145
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
4146
|
+
}
|
|
4147
|
+
function isProfiler(object) {
|
|
4148
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
4149
|
+
}
|
|
4150
|
+
function isStrictMode(object) {
|
|
4151
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
4152
|
+
}
|
|
4153
|
+
function isSuspense(object) {
|
|
4154
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
4155
|
+
}
|
|
4156
|
+
reactIs_development$3.AsyncMode = AsyncMode;
|
|
4157
|
+
reactIs_development$3.ConcurrentMode = ConcurrentMode;
|
|
4158
|
+
reactIs_development$3.ContextConsumer = ContextConsumer;
|
|
4159
|
+
reactIs_development$3.ContextProvider = ContextProvider;
|
|
4160
|
+
reactIs_development$3.Element = Element;
|
|
4161
|
+
reactIs_development$3.ForwardRef = ForwardRef;
|
|
4162
|
+
reactIs_development$3.Fragment = Fragment;
|
|
4163
|
+
reactIs_development$3.Lazy = Lazy;
|
|
4164
|
+
reactIs_development$3.Memo = Memo;
|
|
4165
|
+
reactIs_development$3.Portal = Portal;
|
|
4166
|
+
reactIs_development$3.Profiler = Profiler;
|
|
4167
|
+
reactIs_development$3.StrictMode = StrictMode;
|
|
4168
|
+
reactIs_development$3.Suspense = Suspense;
|
|
4169
|
+
reactIs_development$3.isAsyncMode = isAsyncMode;
|
|
4170
|
+
reactIs_development$3.isConcurrentMode = isConcurrentMode;
|
|
4171
|
+
reactIs_development$3.isContextConsumer = isContextConsumer;
|
|
4172
|
+
reactIs_development$3.isContextProvider = isContextProvider;
|
|
4173
|
+
reactIs_development$3.isElement = isElement;
|
|
4174
|
+
reactIs_development$3.isForwardRef = isForwardRef;
|
|
4175
|
+
reactIs_development$3.isFragment = isFragment;
|
|
4176
|
+
reactIs_development$3.isLazy = isLazy;
|
|
4177
|
+
reactIs_development$3.isMemo = isMemo;
|
|
4178
|
+
reactIs_development$3.isPortal = isPortal;
|
|
4179
|
+
reactIs_development$3.isProfiler = isProfiler;
|
|
4180
|
+
reactIs_development$3.isStrictMode = isStrictMode;
|
|
4181
|
+
reactIs_development$3.isSuspense = isSuspense;
|
|
4182
|
+
reactIs_development$3.isValidElementType = isValidElementType;
|
|
4183
|
+
reactIs_development$3.typeOf = typeOf;
|
|
4184
|
+
})();
|
|
4185
|
+
}
|
|
4186
|
+
return reactIs_development$3;
|
|
4187
|
+
}
|
|
4188
|
+
var hasRequiredReactIs$3;
|
|
4189
|
+
function requireReactIs$3() {
|
|
4190
|
+
if (hasRequiredReactIs$3) return reactIs$3.exports;
|
|
4191
|
+
hasRequiredReactIs$3 = 1;
|
|
4192
|
+
if (process.env.NODE_ENV === 'production') {
|
|
4193
|
+
reactIs$3.exports = requireReactIs_production_min$3();
|
|
4194
|
+
} else {
|
|
4195
|
+
reactIs$3.exports = requireReactIs_development$3();
|
|
4196
|
+
}
|
|
4197
|
+
return reactIs$3.exports;
|
|
4198
|
+
}
|
|
4199
|
+
|
|
4200
|
+
/*
|
|
4201
|
+
object-assign
|
|
4202
|
+
(c) Sindre Sorhus
|
|
4203
|
+
@license MIT
|
|
4204
|
+
*/
|
|
4205
|
+
|
|
4206
|
+
var objectAssign$3;
|
|
4207
|
+
var hasRequiredObjectAssign$3;
|
|
4208
|
+
function requireObjectAssign$3() {
|
|
4209
|
+
if (hasRequiredObjectAssign$3) return objectAssign$3;
|
|
4210
|
+
hasRequiredObjectAssign$3 = 1;
|
|
4211
|
+
/* eslint-disable no-unused-vars */
|
|
4212
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
4213
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4214
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
4215
|
+
function toObject(val) {
|
|
4216
|
+
if (val === null || val === undefined) {
|
|
4217
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
4218
|
+
}
|
|
4219
|
+
return Object(val);
|
|
4220
|
+
}
|
|
4221
|
+
function shouldUseNative() {
|
|
4222
|
+
try {
|
|
4223
|
+
if (!Object.assign) {
|
|
4224
|
+
return false;
|
|
4225
|
+
}
|
|
4226
|
+
|
|
4227
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
4228
|
+
|
|
4229
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
4230
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
4231
|
+
test1[5] = 'de';
|
|
4232
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
4233
|
+
return false;
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4237
|
+
var test2 = {};
|
|
4238
|
+
for (var i = 0; i < 10; i++) {
|
|
4239
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
4240
|
+
}
|
|
4241
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
4242
|
+
return test2[n];
|
|
4243
|
+
});
|
|
4244
|
+
if (order2.join('') !== '0123456789') {
|
|
4245
|
+
return false;
|
|
4246
|
+
}
|
|
4247
|
+
|
|
4248
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
4249
|
+
var test3 = {};
|
|
4250
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
4251
|
+
test3[letter] = letter;
|
|
4252
|
+
});
|
|
4253
|
+
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
4254
|
+
return false;
|
|
4255
|
+
}
|
|
4256
|
+
return true;
|
|
4257
|
+
} catch (err) {
|
|
4258
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
4259
|
+
return false;
|
|
4260
|
+
}
|
|
4261
|
+
}
|
|
4262
|
+
objectAssign$3 = shouldUseNative() ? Object.assign : function (target, source) {
|
|
4263
|
+
var from;
|
|
4264
|
+
var to = toObject(target);
|
|
4265
|
+
var symbols;
|
|
4266
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
4267
|
+
from = Object(arguments[s]);
|
|
4268
|
+
for (var key in from) {
|
|
4269
|
+
if (hasOwnProperty.call(from, key)) {
|
|
4270
|
+
to[key] = from[key];
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
if (getOwnPropertySymbols) {
|
|
4274
|
+
symbols = getOwnPropertySymbols(from);
|
|
4275
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
4276
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
4277
|
+
to[symbols[i]] = from[symbols[i]];
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
return to;
|
|
4283
|
+
};
|
|
4284
|
+
return objectAssign$3;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
/**
|
|
4288
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4289
|
+
*
|
|
4290
|
+
* This source code is licensed under the MIT license found in the
|
|
4291
|
+
* LICENSE file in the root directory of this source tree.
|
|
4292
|
+
*/
|
|
4293
|
+
|
|
4294
|
+
var ReactPropTypesSecret_1$3;
|
|
4295
|
+
var hasRequiredReactPropTypesSecret$3;
|
|
4296
|
+
function requireReactPropTypesSecret$3() {
|
|
4297
|
+
if (hasRequiredReactPropTypesSecret$3) return ReactPropTypesSecret_1$3;
|
|
4298
|
+
hasRequiredReactPropTypesSecret$3 = 1;
|
|
4299
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
4300
|
+
ReactPropTypesSecret_1$3 = ReactPropTypesSecret;
|
|
4301
|
+
return ReactPropTypesSecret_1$3;
|
|
4302
|
+
}
|
|
4303
|
+
var has$3;
|
|
4304
|
+
var hasRequiredHas$3;
|
|
4305
|
+
function requireHas$3() {
|
|
4306
|
+
if (hasRequiredHas$3) return has$3;
|
|
4307
|
+
hasRequiredHas$3 = 1;
|
|
4308
|
+
has$3 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
4309
|
+
return has$3;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
/**
|
|
4313
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4314
|
+
*
|
|
4315
|
+
* This source code is licensed under the MIT license found in the
|
|
4316
|
+
* LICENSE file in the root directory of this source tree.
|
|
4317
|
+
*/
|
|
4318
|
+
|
|
4319
|
+
var checkPropTypes_1$3;
|
|
4320
|
+
var hasRequiredCheckPropTypes$3;
|
|
4321
|
+
function requireCheckPropTypes$3() {
|
|
4322
|
+
if (hasRequiredCheckPropTypes$3) return checkPropTypes_1$3;
|
|
4323
|
+
hasRequiredCheckPropTypes$3 = 1;
|
|
4324
|
+
var printWarning = function () {};
|
|
4325
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4326
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$3();
|
|
4327
|
+
var loggedTypeFailures = {};
|
|
4328
|
+
var has = /*@__PURE__*/requireHas$3();
|
|
4329
|
+
printWarning = function (text) {
|
|
4330
|
+
var message = 'Warning: ' + text;
|
|
4331
|
+
if (typeof console !== 'undefined') {
|
|
4332
|
+
console.error(message);
|
|
4333
|
+
}
|
|
4334
|
+
try {
|
|
4335
|
+
// --- Welcome to debugging React ---
|
|
4336
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
4337
|
+
// to find the callsite that caused this warning to fire.
|
|
4338
|
+
throw new Error(message);
|
|
4339
|
+
} catch (x) {/**/}
|
|
4340
|
+
};
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
/**
|
|
4344
|
+
* Assert that the values match with the type specs.
|
|
4345
|
+
* Error messages are memorized and will only be shown once.
|
|
4346
|
+
*
|
|
4347
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
4348
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
4349
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
4350
|
+
* @param {string} componentName Name of the component for error messages.
|
|
4351
|
+
* @param {?Function} getStack Returns the component stack.
|
|
4352
|
+
* @private
|
|
4353
|
+
*/
|
|
4354
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
4355
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4356
|
+
for (var typeSpecName in typeSpecs) {
|
|
4357
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
4358
|
+
var error;
|
|
4359
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
4360
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
4361
|
+
// After these have been cleaned up, we'll let them throw.
|
|
4362
|
+
try {
|
|
4363
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
4364
|
+
// behavior as without this statement except with a better message.
|
|
4365
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
4366
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
4367
|
+
err.name = 'Invariant Violation';
|
|
4368
|
+
throw err;
|
|
4369
|
+
}
|
|
4370
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
4371
|
+
} catch (ex) {
|
|
4372
|
+
error = ex;
|
|
4373
|
+
}
|
|
4374
|
+
if (error && !(error instanceof Error)) {
|
|
4375
|
+
printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
|
|
4376
|
+
}
|
|
4377
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
4378
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
4379
|
+
// same error.
|
|
4380
|
+
loggedTypeFailures[error.message] = true;
|
|
4381
|
+
var stack = getStack ? getStack() : '';
|
|
4382
|
+
printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
|
|
4389
|
+
/**
|
|
4390
|
+
* Resets warning cache when testing.
|
|
4391
|
+
*
|
|
4392
|
+
* @private
|
|
4393
|
+
*/
|
|
4394
|
+
checkPropTypes.resetWarningCache = function () {
|
|
4395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4396
|
+
loggedTypeFailures = {};
|
|
4397
|
+
}
|
|
4398
|
+
};
|
|
4399
|
+
checkPropTypes_1$3 = checkPropTypes;
|
|
4400
|
+
return checkPropTypes_1$3;
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
/**
|
|
4404
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4405
|
+
*
|
|
4406
|
+
* This source code is licensed under the MIT license found in the
|
|
4407
|
+
* LICENSE file in the root directory of this source tree.
|
|
4408
|
+
*/
|
|
4409
|
+
|
|
4410
|
+
var factoryWithTypeCheckers$3;
|
|
4411
|
+
var hasRequiredFactoryWithTypeCheckers$3;
|
|
4412
|
+
function requireFactoryWithTypeCheckers$3() {
|
|
4413
|
+
if (hasRequiredFactoryWithTypeCheckers$3) return factoryWithTypeCheckers$3;
|
|
4414
|
+
hasRequiredFactoryWithTypeCheckers$3 = 1;
|
|
4415
|
+
var ReactIs = requireReactIs$3();
|
|
4416
|
+
var assign = requireObjectAssign$3();
|
|
4417
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$3();
|
|
4418
|
+
var has = /*@__PURE__*/requireHas$3();
|
|
4419
|
+
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes$3();
|
|
4420
|
+
var printWarning = function () {};
|
|
4421
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4422
|
+
printWarning = function (text) {
|
|
4423
|
+
var message = 'Warning: ' + text;
|
|
4424
|
+
if (typeof console !== 'undefined') {
|
|
4425
|
+
console.error(message);
|
|
4426
|
+
}
|
|
4427
|
+
try {
|
|
4428
|
+
// --- Welcome to debugging React ---
|
|
4429
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
4430
|
+
// to find the callsite that caused this warning to fire.
|
|
4431
|
+
throw new Error(message);
|
|
4432
|
+
} catch (x) {}
|
|
4433
|
+
};
|
|
4434
|
+
}
|
|
4435
|
+
function emptyFunctionThatReturnsNull() {
|
|
4436
|
+
return null;
|
|
4437
|
+
}
|
|
4438
|
+
factoryWithTypeCheckers$3 = function (isValidElement, throwOnDirectAccess) {
|
|
4439
|
+
/* global Symbol */
|
|
4440
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
4441
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
4442
|
+
|
|
4443
|
+
/**
|
|
4444
|
+
* Returns the iterator method function contained on the iterable object.
|
|
4445
|
+
*
|
|
4446
|
+
* Be sure to invoke the function with the iterable as context:
|
|
4447
|
+
*
|
|
4448
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
4449
|
+
* if (iteratorFn) {
|
|
4450
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
4451
|
+
* ...
|
|
4452
|
+
* }
|
|
4453
|
+
*
|
|
4454
|
+
* @param {?object} maybeIterable
|
|
4455
|
+
* @return {?function}
|
|
4456
|
+
*/
|
|
4457
|
+
function getIteratorFn(maybeIterable) {
|
|
4458
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
4459
|
+
if (typeof iteratorFn === 'function') {
|
|
4460
|
+
return iteratorFn;
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
|
|
4464
|
+
/**
|
|
4465
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
4466
|
+
* supplied to React components. Example usage:
|
|
4467
|
+
*
|
|
4468
|
+
* var Props = require('ReactPropTypes');
|
|
4469
|
+
* var MyArticle = React.createClass({
|
|
4470
|
+
* propTypes: {
|
|
4471
|
+
* // An optional string prop named "description".
|
|
4472
|
+
* description: Props.string,
|
|
4473
|
+
*
|
|
4474
|
+
* // A required enum prop named "category".
|
|
4475
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
4476
|
+
*
|
|
4477
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
4478
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
4479
|
+
* },
|
|
4480
|
+
* render: function() { ... }
|
|
4481
|
+
* });
|
|
4482
|
+
*
|
|
4483
|
+
* A more formal specification of how these methods are used:
|
|
4484
|
+
*
|
|
4485
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
4486
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
4487
|
+
*
|
|
4488
|
+
* Each and every declaration produces a function with the same signature. This
|
|
4489
|
+
* allows the creation of custom validation functions. For example:
|
|
4490
|
+
*
|
|
4491
|
+
* var MyLink = React.createClass({
|
|
4492
|
+
* propTypes: {
|
|
4493
|
+
* // An optional string or URI prop named "href".
|
|
4494
|
+
* href: function(props, propName, componentName) {
|
|
4495
|
+
* var propValue = props[propName];
|
|
4496
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
4497
|
+
* !(propValue instanceof URI)) {
|
|
4498
|
+
* return new Error(
|
|
4499
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
4500
|
+
* componentName
|
|
4501
|
+
* );
|
|
4502
|
+
* }
|
|
4503
|
+
* }
|
|
4504
|
+
* },
|
|
4505
|
+
* render: function() {...}
|
|
4506
|
+
* });
|
|
4507
|
+
*
|
|
4508
|
+
* @internal
|
|
4509
|
+
*/
|
|
4510
|
+
|
|
4511
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
4512
|
+
|
|
4513
|
+
// Important!
|
|
4514
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
4515
|
+
var ReactPropTypes = {
|
|
4516
|
+
array: createPrimitiveTypeChecker('array'),
|
|
4517
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
4518
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
4519
|
+
func: createPrimitiveTypeChecker('function'),
|
|
4520
|
+
number: createPrimitiveTypeChecker('number'),
|
|
4521
|
+
object: createPrimitiveTypeChecker('object'),
|
|
4522
|
+
string: createPrimitiveTypeChecker('string'),
|
|
4523
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
4524
|
+
any: createAnyTypeChecker(),
|
|
4525
|
+
arrayOf: createArrayOfTypeChecker,
|
|
4526
|
+
element: createElementTypeChecker(),
|
|
4527
|
+
elementType: createElementTypeTypeChecker(),
|
|
4528
|
+
instanceOf: createInstanceTypeChecker,
|
|
4529
|
+
node: createNodeChecker(),
|
|
4530
|
+
objectOf: createObjectOfTypeChecker,
|
|
4531
|
+
oneOf: createEnumTypeChecker,
|
|
4532
|
+
oneOfType: createUnionTypeChecker,
|
|
4533
|
+
shape: createShapeTypeChecker,
|
|
4534
|
+
exact: createStrictShapeTypeChecker
|
|
4535
|
+
};
|
|
4536
|
+
|
|
4537
|
+
/**
|
|
4538
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
4539
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
4540
|
+
*/
|
|
4541
|
+
/*eslint-disable no-self-compare*/
|
|
4542
|
+
function is(x, y) {
|
|
4543
|
+
// SameValue algorithm
|
|
4544
|
+
if (x === y) {
|
|
4545
|
+
// Steps 1-5, 7-10
|
|
4546
|
+
// Steps 6.b-6.e: +0 != -0
|
|
4547
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
4548
|
+
} else {
|
|
4549
|
+
// Step 6.a: NaN == NaN
|
|
4550
|
+
return x !== x && y !== y;
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
/*eslint-enable no-self-compare*/
|
|
4554
|
+
|
|
4555
|
+
/**
|
|
4556
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
4557
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
4558
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
4559
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
4560
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
4561
|
+
*/
|
|
4562
|
+
function PropTypeError(message, data) {
|
|
4563
|
+
this.message = message;
|
|
4564
|
+
this.data = data && typeof data === 'object' ? data : {};
|
|
4565
|
+
this.stack = '';
|
|
4566
|
+
}
|
|
4567
|
+
// Make `instanceof Error` still work for returned errors.
|
|
4568
|
+
PropTypeError.prototype = Error.prototype;
|
|
4569
|
+
function createChainableTypeChecker(validate) {
|
|
4570
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4571
|
+
var manualPropTypeCallCache = {};
|
|
4572
|
+
var manualPropTypeWarningCount = 0;
|
|
4573
|
+
}
|
|
4574
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
4575
|
+
componentName = componentName || ANONYMOUS;
|
|
4576
|
+
propFullName = propFullName || propName;
|
|
4577
|
+
if (secret !== ReactPropTypesSecret) {
|
|
4578
|
+
if (throwOnDirectAccess) {
|
|
4579
|
+
// New behavior only for users of `prop-types` package
|
|
4580
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
4581
|
+
err.name = 'Invariant Violation';
|
|
4582
|
+
throw err;
|
|
4583
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
4584
|
+
// Old behavior for people using React.PropTypes
|
|
4585
|
+
var cacheKey = componentName + ':' + propName;
|
|
4586
|
+
if (!manualPropTypeCallCache[cacheKey] &&
|
|
4587
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
4588
|
+
manualPropTypeWarningCount < 3) {
|
|
4589
|
+
printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
|
4590
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
4591
|
+
manualPropTypeWarningCount++;
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
if (props[propName] == null) {
|
|
4596
|
+
if (isRequired) {
|
|
4597
|
+
if (props[propName] === null) {
|
|
4598
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
4599
|
+
}
|
|
4600
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
4601
|
+
}
|
|
4602
|
+
return null;
|
|
4603
|
+
} else {
|
|
4604
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
4608
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
4609
|
+
return chainedCheckType;
|
|
4610
|
+
}
|
|
4611
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
4612
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
4613
|
+
var propValue = props[propName];
|
|
4614
|
+
var propType = getPropType(propValue);
|
|
4615
|
+
if (propType !== expectedType) {
|
|
4616
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
4617
|
+
// check, but we can offer a more precise error message here rather than
|
|
4618
|
+
// 'of type `object`'.
|
|
4619
|
+
var preciseType = getPreciseType(propValue);
|
|
4620
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
|
|
4621
|
+
expectedType: expectedType
|
|
4622
|
+
});
|
|
4623
|
+
}
|
|
4624
|
+
return null;
|
|
4625
|
+
}
|
|
4626
|
+
return createChainableTypeChecker(validate);
|
|
4627
|
+
}
|
|
4628
|
+
function createAnyTypeChecker() {
|
|
4629
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
4630
|
+
}
|
|
4631
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
4632
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4633
|
+
if (typeof typeChecker !== 'function') {
|
|
4634
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
4635
|
+
}
|
|
4636
|
+
var propValue = props[propName];
|
|
4637
|
+
if (!Array.isArray(propValue)) {
|
|
4638
|
+
var propType = getPropType(propValue);
|
|
4639
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
4640
|
+
}
|
|
4641
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
4642
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
4643
|
+
if (error instanceof Error) {
|
|
4644
|
+
return error;
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
return null;
|
|
4648
|
+
}
|
|
4649
|
+
return createChainableTypeChecker(validate);
|
|
4650
|
+
}
|
|
4651
|
+
function createElementTypeChecker() {
|
|
4652
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4653
|
+
var propValue = props[propName];
|
|
4654
|
+
if (!isValidElement(propValue)) {
|
|
4655
|
+
var propType = getPropType(propValue);
|
|
4656
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
4657
|
+
}
|
|
4658
|
+
return null;
|
|
4659
|
+
}
|
|
4660
|
+
return createChainableTypeChecker(validate);
|
|
4661
|
+
}
|
|
4662
|
+
function createElementTypeTypeChecker() {
|
|
4663
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4664
|
+
var propValue = props[propName];
|
|
4665
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
|
4666
|
+
var propType = getPropType(propValue);
|
|
4667
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
4668
|
+
}
|
|
4669
|
+
return null;
|
|
4670
|
+
}
|
|
4671
|
+
return createChainableTypeChecker(validate);
|
|
4672
|
+
}
|
|
4673
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
4674
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4675
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
4676
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
4677
|
+
var actualClassName = getClassName(props[propName]);
|
|
4678
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
4679
|
+
}
|
|
4680
|
+
return null;
|
|
4681
|
+
}
|
|
4682
|
+
return createChainableTypeChecker(validate);
|
|
4683
|
+
}
|
|
4684
|
+
function createEnumTypeChecker(expectedValues) {
|
|
4685
|
+
if (!Array.isArray(expectedValues)) {
|
|
4686
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4687
|
+
if (arguments.length > 1) {
|
|
4688
|
+
printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
|
|
4689
|
+
} else {
|
|
4690
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
4691
|
+
}
|
|
4692
|
+
}
|
|
4693
|
+
return emptyFunctionThatReturnsNull;
|
|
4694
|
+
}
|
|
4695
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4696
|
+
var propValue = props[propName];
|
|
4697
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
4698
|
+
if (is(propValue, expectedValues[i])) {
|
|
4699
|
+
return null;
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
4703
|
+
var type = getPreciseType(value);
|
|
4704
|
+
if (type === 'symbol') {
|
|
4705
|
+
return String(value);
|
|
4706
|
+
}
|
|
4707
|
+
return value;
|
|
4708
|
+
});
|
|
4709
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
4710
|
+
}
|
|
4711
|
+
return createChainableTypeChecker(validate);
|
|
4712
|
+
}
|
|
4713
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
4714
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4715
|
+
if (typeof typeChecker !== 'function') {
|
|
4716
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
4717
|
+
}
|
|
4718
|
+
var propValue = props[propName];
|
|
4719
|
+
var propType = getPropType(propValue);
|
|
4720
|
+
if (propType !== 'object') {
|
|
4721
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
4722
|
+
}
|
|
4723
|
+
for (var key in propValue) {
|
|
4724
|
+
if (has(propValue, key)) {
|
|
4725
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4726
|
+
if (error instanceof Error) {
|
|
4727
|
+
return error;
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
return null;
|
|
4732
|
+
}
|
|
4733
|
+
return createChainableTypeChecker(validate);
|
|
4734
|
+
}
|
|
4735
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
4736
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
4737
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
4738
|
+
return emptyFunctionThatReturnsNull;
|
|
4739
|
+
}
|
|
4740
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
4741
|
+
var checker = arrayOfTypeCheckers[i];
|
|
4742
|
+
if (typeof checker !== 'function') {
|
|
4743
|
+
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
4744
|
+
return emptyFunctionThatReturnsNull;
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4747
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4748
|
+
var expectedTypes = [];
|
|
4749
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
4750
|
+
var checker = arrayOfTypeCheckers[i];
|
|
4751
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
4752
|
+
if (checkerResult == null) {
|
|
4753
|
+
return null;
|
|
4754
|
+
}
|
|
4755
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
4756
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
4760
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
4761
|
+
}
|
|
4762
|
+
return createChainableTypeChecker(validate);
|
|
4763
|
+
}
|
|
4764
|
+
function createNodeChecker() {
|
|
4765
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4766
|
+
if (!isNode(props[propName])) {
|
|
4767
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
4768
|
+
}
|
|
4769
|
+
return null;
|
|
4770
|
+
}
|
|
4771
|
+
return createChainableTypeChecker(validate);
|
|
4772
|
+
}
|
|
4773
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
4774
|
+
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
|
|
4775
|
+
}
|
|
4776
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
4777
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4778
|
+
var propValue = props[propName];
|
|
4779
|
+
var propType = getPropType(propValue);
|
|
4780
|
+
if (propType !== 'object') {
|
|
4781
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
4782
|
+
}
|
|
4783
|
+
for (var key in shapeTypes) {
|
|
4784
|
+
var checker = shapeTypes[key];
|
|
4785
|
+
if (typeof checker !== 'function') {
|
|
4786
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
4787
|
+
}
|
|
4788
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4789
|
+
if (error) {
|
|
4790
|
+
return error;
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
return null;
|
|
4794
|
+
}
|
|
4795
|
+
return createChainableTypeChecker(validate);
|
|
4796
|
+
}
|
|
4797
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
4798
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
4799
|
+
var propValue = props[propName];
|
|
4800
|
+
var propType = getPropType(propValue);
|
|
4801
|
+
if (propType !== 'object') {
|
|
4802
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
4803
|
+
}
|
|
4804
|
+
// We need to check all keys in case some are required but missing from props.
|
|
4805
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
4806
|
+
for (var key in allKeys) {
|
|
4807
|
+
var checker = shapeTypes[key];
|
|
4808
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
4809
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
4810
|
+
}
|
|
4811
|
+
if (!checker) {
|
|
4812
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
|
4813
|
+
}
|
|
4814
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
4815
|
+
if (error) {
|
|
4816
|
+
return error;
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4819
|
+
return null;
|
|
4820
|
+
}
|
|
4821
|
+
return createChainableTypeChecker(validate);
|
|
4822
|
+
}
|
|
4823
|
+
function isNode(propValue) {
|
|
4824
|
+
switch (typeof propValue) {
|
|
4825
|
+
case 'number':
|
|
4826
|
+
case 'string':
|
|
4827
|
+
case 'undefined':
|
|
4828
|
+
return true;
|
|
4829
|
+
case 'boolean':
|
|
4830
|
+
return !propValue;
|
|
4831
|
+
case 'object':
|
|
4832
|
+
if (Array.isArray(propValue)) {
|
|
4833
|
+
return propValue.every(isNode);
|
|
4834
|
+
}
|
|
4835
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
4836
|
+
return true;
|
|
4837
|
+
}
|
|
4838
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
4839
|
+
if (iteratorFn) {
|
|
4840
|
+
var iterator = iteratorFn.call(propValue);
|
|
4841
|
+
var step;
|
|
4842
|
+
if (iteratorFn !== propValue.entries) {
|
|
4843
|
+
while (!(step = iterator.next()).done) {
|
|
4844
|
+
if (!isNode(step.value)) {
|
|
4845
|
+
return false;
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4848
|
+
} else {
|
|
4849
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
4850
|
+
while (!(step = iterator.next()).done) {
|
|
4851
|
+
var entry = step.value;
|
|
4852
|
+
if (entry) {
|
|
4853
|
+
if (!isNode(entry[1])) {
|
|
4854
|
+
return false;
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
} else {
|
|
4860
|
+
return false;
|
|
4861
|
+
}
|
|
4862
|
+
return true;
|
|
4863
|
+
default:
|
|
4864
|
+
return false;
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
function isSymbol(propType, propValue) {
|
|
4868
|
+
// Native Symbol.
|
|
4869
|
+
if (propType === 'symbol') {
|
|
4870
|
+
return true;
|
|
4871
|
+
}
|
|
4872
|
+
|
|
4873
|
+
// falsy value can't be a Symbol
|
|
4874
|
+
if (!propValue) {
|
|
4875
|
+
return false;
|
|
4876
|
+
}
|
|
4877
|
+
|
|
4878
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
4879
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
4880
|
+
return true;
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
4884
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
4885
|
+
return true;
|
|
4886
|
+
}
|
|
4887
|
+
return false;
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
4891
|
+
function getPropType(propValue) {
|
|
4892
|
+
var propType = typeof propValue;
|
|
4893
|
+
if (Array.isArray(propValue)) {
|
|
4894
|
+
return 'array';
|
|
4895
|
+
}
|
|
4896
|
+
if (propValue instanceof RegExp) {
|
|
4897
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
4898
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
4899
|
+
// passes PropTypes.object.
|
|
4900
|
+
return 'object';
|
|
4901
|
+
}
|
|
4902
|
+
if (isSymbol(propType, propValue)) {
|
|
4903
|
+
return 'symbol';
|
|
4904
|
+
}
|
|
4905
|
+
return propType;
|
|
4906
|
+
}
|
|
4907
|
+
|
|
4908
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
4909
|
+
// See `createPrimitiveTypeChecker`.
|
|
4910
|
+
function getPreciseType(propValue) {
|
|
4911
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
4912
|
+
return '' + propValue;
|
|
4913
|
+
}
|
|
4914
|
+
var propType = getPropType(propValue);
|
|
4915
|
+
if (propType === 'object') {
|
|
4916
|
+
if (propValue instanceof Date) {
|
|
4917
|
+
return 'date';
|
|
4918
|
+
} else if (propValue instanceof RegExp) {
|
|
4919
|
+
return 'regexp';
|
|
4920
|
+
}
|
|
4921
|
+
}
|
|
4922
|
+
return propType;
|
|
4923
|
+
}
|
|
4924
|
+
|
|
4925
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
4926
|
+
// For example, "undefined" or "of type array"
|
|
4927
|
+
function getPostfixForTypeWarning(value) {
|
|
4928
|
+
var type = getPreciseType(value);
|
|
4929
|
+
switch (type) {
|
|
4930
|
+
case 'array':
|
|
4931
|
+
case 'object':
|
|
4932
|
+
return 'an ' + type;
|
|
4933
|
+
case 'boolean':
|
|
4934
|
+
case 'date':
|
|
4935
|
+
case 'regexp':
|
|
4936
|
+
return 'a ' + type;
|
|
4937
|
+
default:
|
|
4938
|
+
return type;
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
|
|
4942
|
+
// Returns class name of the object, if any.
|
|
4943
|
+
function getClassName(propValue) {
|
|
4944
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
4945
|
+
return ANONYMOUS;
|
|
4946
|
+
}
|
|
4947
|
+
return propValue.constructor.name;
|
|
4948
|
+
}
|
|
4949
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
4950
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
4951
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
4952
|
+
return ReactPropTypes;
|
|
4953
|
+
};
|
|
4954
|
+
return factoryWithTypeCheckers$3;
|
|
4955
|
+
}
|
|
4956
|
+
|
|
4957
|
+
/**
|
|
4958
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
4959
|
+
*
|
|
4960
|
+
* This source code is licensed under the MIT license found in the
|
|
4961
|
+
* LICENSE file in the root directory of this source tree.
|
|
4962
|
+
*/
|
|
4963
|
+
|
|
4964
|
+
var factoryWithThrowingShims$3;
|
|
4965
|
+
var hasRequiredFactoryWithThrowingShims$3;
|
|
4966
|
+
function requireFactoryWithThrowingShims$3() {
|
|
4967
|
+
if (hasRequiredFactoryWithThrowingShims$3) return factoryWithThrowingShims$3;
|
|
4968
|
+
hasRequiredFactoryWithThrowingShims$3 = 1;
|
|
4969
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$3();
|
|
4970
|
+
function emptyFunction() {}
|
|
4971
|
+
function emptyFunctionWithReset() {}
|
|
4972
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
4973
|
+
factoryWithThrowingShims$3 = function () {
|
|
4974
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
4975
|
+
if (secret === ReactPropTypesSecret) {
|
|
4976
|
+
// It is still safe when called from React.
|
|
4977
|
+
return;
|
|
4978
|
+
}
|
|
4979
|
+
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
4980
|
+
err.name = 'Invariant Violation';
|
|
4981
|
+
throw err;
|
|
4982
|
+
}
|
|
4983
|
+
shim.isRequired = shim;
|
|
4984
|
+
function getShim() {
|
|
4985
|
+
return shim;
|
|
4986
|
+
} // Important!
|
|
4987
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
4988
|
+
var ReactPropTypes = {
|
|
4989
|
+
array: shim,
|
|
4990
|
+
bigint: shim,
|
|
4991
|
+
bool: shim,
|
|
4992
|
+
func: shim,
|
|
4993
|
+
number: shim,
|
|
4994
|
+
object: shim,
|
|
4995
|
+
string: shim,
|
|
4996
|
+
symbol: shim,
|
|
4997
|
+
any: shim,
|
|
4998
|
+
arrayOf: getShim,
|
|
4999
|
+
element: shim,
|
|
5000
|
+
elementType: shim,
|
|
5001
|
+
instanceOf: getShim,
|
|
5002
|
+
node: shim,
|
|
5003
|
+
objectOf: getShim,
|
|
5004
|
+
oneOf: getShim,
|
|
5005
|
+
oneOfType: getShim,
|
|
5006
|
+
shape: getShim,
|
|
5007
|
+
exact: getShim,
|
|
5008
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
5009
|
+
resetWarningCache: emptyFunction
|
|
5010
|
+
};
|
|
5011
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
5012
|
+
return ReactPropTypes;
|
|
5013
|
+
};
|
|
5014
|
+
return factoryWithThrowingShims$3;
|
|
5015
|
+
}
|
|
5016
|
+
|
|
5017
|
+
/**
|
|
5018
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
5019
|
+
*
|
|
5020
|
+
* This source code is licensed under the MIT license found in the
|
|
5021
|
+
* LICENSE file in the root directory of this source tree.
|
|
5022
|
+
*/
|
|
5023
|
+
|
|
5024
|
+
var hasRequiredPropTypes$3;
|
|
5025
|
+
function requirePropTypes$3() {
|
|
5026
|
+
if (hasRequiredPropTypes$3) return propTypes$3.exports;
|
|
5027
|
+
hasRequiredPropTypes$3 = 1;
|
|
5028
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5029
|
+
var ReactIs = requireReactIs$3();
|
|
5030
|
+
|
|
5031
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
5032
|
+
// http://fb.me/prop-types-in-prod
|
|
5033
|
+
var throwOnDirectAccess = true;
|
|
5034
|
+
propTypes$3.exports = /*@__PURE__*/requireFactoryWithTypeCheckers$3()(ReactIs.isElement, throwOnDirectAccess);
|
|
5035
|
+
} else {
|
|
5036
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
5037
|
+
// http://fb.me/prop-types-in-prod
|
|
5038
|
+
propTypes$3.exports = /*@__PURE__*/requireFactoryWithThrowingShims$3()();
|
|
5039
|
+
}
|
|
5040
|
+
return propTypes$3.exports;
|
|
5041
|
+
}
|
|
5042
|
+
var propTypesExports$3 = /*@__PURE__*/requirePropTypes$3();
|
|
5043
|
+
var PropTypes$3 = /*@__PURE__*/getDefaultExportFromCjs$3(propTypesExports$3);
|
|
5044
|
+
({
|
|
5045
|
+
onPowerOff: PropTypes$3.func,
|
|
5046
|
+
onRestart: PropTypes$3.func,
|
|
5047
|
+
powerOffLabel: PropTypes$3.string,
|
|
5048
|
+
restartLabel: PropTypes$3.string,
|
|
5049
|
+
iconClassName: PropTypes$3.string,
|
|
5050
|
+
confirmTitle: PropTypes$3.string,
|
|
5051
|
+
cancelText: PropTypes$3.string,
|
|
5052
|
+
okText: PropTypes$3.string,
|
|
5053
|
+
run: PropTypes$3.func
|
|
5054
|
+
});
|
|
5055
|
+
({
|
|
5056
|
+
logoUrl: PropTypes$3.string,
|
|
5057
|
+
logoWidth: PropTypes$3.number,
|
|
5058
|
+
logoAlt: PropTypes$3.string,
|
|
5059
|
+
onClick: PropTypes$3.func
|
|
5060
|
+
});
|
|
5061
|
+
|
|
5062
|
+
// PropTypes 类型检查
|
|
5063
|
+
({
|
|
5064
|
+
menuElement: PropTypes$3.node,
|
|
5065
|
+
productInfo: PropTypes$3.shape({
|
|
5066
|
+
productName: PropTypes$3.string,
|
|
5067
|
+
version: PropTypes$3.string
|
|
5068
|
+
}),
|
|
5069
|
+
showLogo: PropTypes$3.bool,
|
|
5070
|
+
showProductInfo: PropTypes$3.bool,
|
|
5071
|
+
showHardwareUsage: PropTypes$3.bool,
|
|
5072
|
+
showSystemOperations: PropTypes$3.bool,
|
|
5073
|
+
onPowerOff: PropTypes$3.func,
|
|
5074
|
+
onRestart: PropTypes$3.func,
|
|
5075
|
+
onRun: PropTypes$3.func,
|
|
5076
|
+
hardwareMonitorUrl: PropTypes$3.string,
|
|
5077
|
+
getSocketUrl: PropTypes$3.func,
|
|
5078
|
+
logoProps: PropTypes$3.object,
|
|
5079
|
+
className: PropTypes$3.string,
|
|
5080
|
+
style: PropTypes$3.object
|
|
5081
|
+
});
|
|
3866
5082
|
function getDefaultExportFromCjs$2(x) {
|
|
3867
5083
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3868
5084
|
}
|
|
@@ -7512,7 +8728,7 @@ const NmosModal = _ref => {
|
|
|
7512
8728
|
const values = await form.getFieldsValue();
|
|
7513
8729
|
setLoading(true);
|
|
7514
8730
|
try {
|
|
7515
|
-
const response = await updateNmosSettings(_objectSpread2
|
|
8731
|
+
const response = await updateNmosSettings(_objectSpread2(_objectSpread2({}, nmosSettings), values));
|
|
7516
8732
|
if (response) {
|
|
7517
8733
|
message.success('Success');
|
|
7518
8734
|
setTimeout(() => {
|
|
@@ -7525,7 +8741,7 @@ const NmosModal = _ref => {
|
|
|
7525
8741
|
setLoading(false);
|
|
7526
8742
|
}
|
|
7527
8743
|
};
|
|
7528
|
-
return /*#__PURE__*/jsx(StyledModal$
|
|
8744
|
+
return /*#__PURE__*/jsx(StyledModal$3, _objectSpread2(_objectSpread2({
|
|
7529
8745
|
title: "NMOS",
|
|
7530
8746
|
width: 650,
|
|
7531
8747
|
open: open,
|
|
@@ -7534,7 +8750,7 @@ const NmosModal = _ref => {
|
|
|
7534
8750
|
confirmLoading: loading,
|
|
7535
8751
|
destroyOnClose: true // 关闭时销毁组件,确保下次打开重新初始化
|
|
7536
8752
|
}, modalProps), {}, {
|
|
7537
|
-
children: /*#__PURE__*/jsxs(Form, _objectSpread2
|
|
8753
|
+
children: /*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({
|
|
7538
8754
|
form: form,
|
|
7539
8755
|
name: "nmosForm",
|
|
7540
8756
|
labelCol: {
|
|
@@ -7570,7 +8786,7 @@ const NmosModal = _ref => {
|
|
|
7570
8786
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
7571
8787
|
label: "Registry Port",
|
|
7572
8788
|
name: "registration_port",
|
|
7573
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2
|
|
8789
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
7574
8790
|
min: 0,
|
|
7575
8791
|
max: 65535,
|
|
7576
8792
|
style: {
|
|
@@ -7599,7 +8815,7 @@ const NmosModal = _ref => {
|
|
|
7599
8815
|
}), /*#__PURE__*/jsx(Form.Item, {
|
|
7600
8816
|
label: "Logging Level",
|
|
7601
8817
|
name: "logging_level",
|
|
7602
|
-
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2
|
|
8818
|
+
children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
|
|
7603
8819
|
min: -40,
|
|
7604
8820
|
max: 40,
|
|
7605
8821
|
style: {
|
|
@@ -7707,7 +8923,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
7707
8923
|
// 新增 disabled 属性
|
|
7708
8924
|
style
|
|
7709
8925
|
} = _ref2,
|
|
7710
|
-
restProps = _objectWithoutProperties
|
|
8926
|
+
restProps = _objectWithoutProperties(_ref2, _excluded);
|
|
7711
8927
|
const inputRef = useRef(null);
|
|
7712
8928
|
const [isMouseDown, setIsMouseDown] = useState(false);
|
|
7713
8929
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -7816,7 +9032,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
7816
9032
|
applyMovement(totalMovement.current, e);
|
|
7817
9033
|
}, [isMouseDown, disabled]);
|
|
7818
9034
|
const getModifiers = useCallback(e => {
|
|
7819
|
-
const mods = _objectSpread2
|
|
9035
|
+
const mods = _objectSpread2(_objectSpread2({}, defaultModifiers), modifierKeys);
|
|
7820
9036
|
for (const key in mods) {
|
|
7821
9037
|
if (key !== "default" && e[key]) {
|
|
7822
9038
|
currentMultiplier.current = mods[key].multiplier;
|
|
@@ -7932,7 +9148,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
7932
9148
|
background: 'rgba(255, 255, 255, 0.08)',
|
|
7933
9149
|
color: 'rgba(255, 255, 255, 0.25)'
|
|
7934
9150
|
} : {};
|
|
7935
|
-
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2
|
|
9151
|
+
return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement("input", _objectSpread2({
|
|
7936
9152
|
ref: inputRef,
|
|
7937
9153
|
type: "text",
|
|
7938
9154
|
inputMode: "numeric",
|
|
@@ -7946,7 +9162,7 @@ function DraggableNumberInput(_ref2) {
|
|
|
7946
9162
|
disabled: disabled,
|
|
7947
9163
|
// 添加 disabled 属性
|
|
7948
9164
|
className: "draggable-number-input ".concat(className, " ").concat(isDragging ? "dragging" : "", " ").concat(disabled ? "disabled" : ""),
|
|
7949
|
-
style: _objectSpread2
|
|
9165
|
+
style: _objectSpread2(_objectSpread2(_objectSpread2({}, {
|
|
7950
9166
|
cursor: disabled ? 'not-allowed' : 'ew-resize',
|
|
7951
9167
|
userSelect: disabled ? 'none' : 'auto',
|
|
7952
9168
|
caretColor: isDragging ? "transparent" : "initial"
|
|
@@ -7956,5 +9172,5 @@ function DraggableNumberInput(_ref2) {
|
|
|
7956
9172
|
}));
|
|
7957
9173
|
}
|
|
7958
9174
|
|
|
7959
|
-
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$
|
|
9175
|
+
export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$1 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, useAuth, useHardwareUsage$1 as useHardwareUsage, usePageReload$1 as usePageReload, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade };
|
|
7960
9176
|
//# sourceMappingURL=index.esm.js.map
|