@ant-design/pro-components 2.3.27 → 2.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.js +389 -360
- package/dist/components.min.js +1 -1
- package/es/version.js +10 -10
- package/package.json +9 -9
package/dist/components.js
CHANGED
|
@@ -20101,6 +20101,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20101
20101
|
"omitBoolean": function() { return /* reexport */ omitBoolean; },
|
|
20102
20102
|
"omitUndefined": function() { return /* reexport */ omitUndefined; },
|
|
20103
20103
|
"omitUndefinedAndEmptyArr": function() { return /* reexport */ omitUndefinedAndEmptyArr; },
|
|
20104
|
+
"openVisibleCompatible": function() { return /* reexport */ openVisibleCompatible; },
|
|
20104
20105
|
"operationUnit": function() { return /* reexport */ operationUnit; },
|
|
20105
20106
|
"parseValueToDay": function() { return /* reexport */ parseValueToDay; },
|
|
20106
20107
|
"pickProFormItemProps": function() { return /* reexport */ pickProFormItemProps; },
|
|
@@ -20130,7 +20131,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20130
20131
|
"useMountMergeState": function() { return /* reexport */ useMergedState/* default */.Z; },
|
|
20131
20132
|
"usePrevious": function() { return /* reexport */ usePrevious; },
|
|
20132
20133
|
"useRefFunction": function() { return /* reexport */ useRefFunction; },
|
|
20133
|
-
"useSafeState": function() { return /* reexport */ useSafeState; },
|
|
20134
20134
|
"useStyle": function() { return /* reexport */ useStyle; },
|
|
20135
20135
|
"useToken": function() { return /* reexport */ useStyle_useToken; },
|
|
20136
20136
|
"version": function() { return /* reexport */ version_version; },
|
|
@@ -27289,6 +27289,49 @@ var FieldLabelFunction = function FieldLabelFunction(props, ref) {
|
|
|
27289
27289
|
}));
|
|
27290
27290
|
};
|
|
27291
27291
|
var FieldLabel = /*#__PURE__*/external_React_default().forwardRef(FieldLabelFunction);
|
|
27292
|
+
;// CONCATENATED MODULE: ./packages/utils/es/components/FilterDropdown/style.js
|
|
27293
|
+
|
|
27294
|
+
|
|
27295
|
+
|
|
27296
|
+
var FilterDropdown_style_genProStyle = function genProStyle(token) {
|
|
27297
|
+
var _ref;
|
|
27298
|
+
return _ref = {}, defineProperty_defineProperty(_ref, "".concat(token.componentCls, "-label"), {
|
|
27299
|
+
cursor: 'pointer'
|
|
27300
|
+
}), defineProperty_defineProperty(_ref, "".concat(token.componentCls, "-overlay"), {
|
|
27301
|
+
minWidth: '200px',
|
|
27302
|
+
marginBlockStart: '4px',
|
|
27303
|
+
backgroundColor: token.colorBgContainer,
|
|
27304
|
+
boxShadow: token.boxShadowCard,
|
|
27305
|
+
'*': {
|
|
27306
|
+
fontFamily: token.fontFamily,
|
|
27307
|
+
boxSizing: 'border-box'
|
|
27308
|
+
}
|
|
27309
|
+
}), defineProperty_defineProperty(_ref, "".concat(token.componentCls, "-content"), {
|
|
27310
|
+
paddingBlock: 16,
|
|
27311
|
+
paddingInline: 16
|
|
27312
|
+
}), _ref;
|
|
27313
|
+
};
|
|
27314
|
+
function FilterDropdown_style_useStyle(prefixCls) {
|
|
27315
|
+
return useStyle('FilterDropdown', function (token) {
|
|
27316
|
+
var proToken = objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, token), {}, {
|
|
27317
|
+
componentCls: ".".concat(prefixCls)
|
|
27318
|
+
});
|
|
27319
|
+
return [FilterDropdown_style_genProStyle(proToken)];
|
|
27320
|
+
});
|
|
27321
|
+
}
|
|
27322
|
+
;// CONCATENATED MODULE: ./packages/utils/es/omitUndefined/index.js
|
|
27323
|
+
var omitUndefined = function omitUndefined(obj) {
|
|
27324
|
+
var newObj = {};
|
|
27325
|
+
Object.keys(obj || {}).forEach(function (key) {
|
|
27326
|
+
if (obj[key] !== undefined) {
|
|
27327
|
+
newObj[key] = obj[key];
|
|
27328
|
+
}
|
|
27329
|
+
});
|
|
27330
|
+
if (Object.keys(newObj).length < 1) {
|
|
27331
|
+
return undefined;
|
|
27332
|
+
}
|
|
27333
|
+
return newObj;
|
|
27334
|
+
};
|
|
27292
27335
|
;// CONCATENATED MODULE: ./packages/utils/es/compareVersions/index.js
|
|
27293
27336
|
|
|
27294
27337
|
|
|
@@ -27345,14 +27388,9 @@ var compareSegments = function compareSegments(a, b) {
|
|
|
27345
27388
|
* @returns RegExpMatchArray
|
|
27346
27389
|
*/
|
|
27347
27390
|
var validateAndParse = function validateAndParse(version) {
|
|
27348
|
-
|
|
27349
|
-
throw new TypeError('Invalid argument expected string');
|
|
27350
|
-
}
|
|
27391
|
+
var _match$shift;
|
|
27351
27392
|
var match = version.match(semver);
|
|
27352
|
-
|
|
27353
|
-
throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
|
|
27354
|
-
}
|
|
27355
|
-
match.shift();
|
|
27393
|
+
match === null || match === void 0 ? void 0 : (_match$shift = match.shift) === null || _match$shift === void 0 ? void 0 : _match$shift.call(match);
|
|
27356
27394
|
return match;
|
|
27357
27395
|
};
|
|
27358
27396
|
/**
|
|
@@ -27372,44 +27410,26 @@ var compareVersions = function compareVersions(v1, v2) {
|
|
|
27372
27410
|
// validate numbers
|
|
27373
27411
|
var r = compareSegments(n1, n2);
|
|
27374
27412
|
if (r !== 0) return r;
|
|
27375
|
-
|
|
27376
|
-
if (p1 && p2) {
|
|
27377
|
-
return compareSegments(p1.split('.'), p2.split('.'));
|
|
27378
|
-
} else if (p1 || p2) {
|
|
27413
|
+
if (p1 || p2) {
|
|
27379
27414
|
return p1 ? -1 : 1;
|
|
27380
27415
|
}
|
|
27381
27416
|
return 0;
|
|
27382
27417
|
};
|
|
27383
|
-
;// CONCATENATED MODULE: ./packages/utils/es/
|
|
27418
|
+
;// CONCATENATED MODULE: ./packages/utils/es/compareVersions/openVisibleCompatible.js
|
|
27384
27419
|
|
|
27385
27420
|
|
|
27386
27421
|
|
|
27387
|
-
var
|
|
27388
|
-
var
|
|
27389
|
-
|
|
27390
|
-
|
|
27391
|
-
}
|
|
27392
|
-
|
|
27393
|
-
|
|
27394
|
-
|
|
27395
|
-
|
|
27396
|
-
'*': {
|
|
27397
|
-
fontFamily: token.fontFamily,
|
|
27398
|
-
boxSizing: 'border-box'
|
|
27399
|
-
}
|
|
27400
|
-
}), defineProperty_defineProperty(_ref, "".concat(token.componentCls, "-content"), {
|
|
27401
|
-
paddingBlock: 16,
|
|
27402
|
-
paddingInline: 16
|
|
27403
|
-
}), _ref;
|
|
27422
|
+
var openVisibleCompatible = function openVisibleCompatible(open, onOpenChange) {
|
|
27423
|
+
var props = compareVersions(process.env.ANTD_VERSION || external_antd_.version, '4.23.0') > -1 ? {
|
|
27424
|
+
open: open,
|
|
27425
|
+
onOpenChange: onOpenChange
|
|
27426
|
+
} : {
|
|
27427
|
+
visible: open,
|
|
27428
|
+
onVisibleChange: onOpenChange
|
|
27429
|
+
};
|
|
27430
|
+
return omitUndefined(props);
|
|
27404
27431
|
};
|
|
27405
|
-
|
|
27406
|
-
return useStyle('FilterDropdown', function (token) {
|
|
27407
|
-
var proToken = objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, token), {}, {
|
|
27408
|
-
componentCls: ".".concat(prefixCls)
|
|
27409
|
-
});
|
|
27410
|
-
return [FilterDropdown_style_genProStyle(proToken)];
|
|
27411
|
-
});
|
|
27412
|
-
}
|
|
27432
|
+
|
|
27413
27433
|
;// CONCATENATED MODULE: ./packages/utils/es/components/FilterDropdown/index.js
|
|
27414
27434
|
|
|
27415
27435
|
|
|
@@ -27436,13 +27456,7 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
27436
27456
|
var _useStyle = FilterDropdown_style_useStyle(prefixCls),
|
|
27437
27457
|
wrapSSR = _useStyle.wrapSSR,
|
|
27438
27458
|
hashId = _useStyle.hashId;
|
|
27439
|
-
var dropdownOpenProps =
|
|
27440
|
-
open: open || visible || false,
|
|
27441
|
-
onOpenChange: onOpenChange || onVisibleChange
|
|
27442
|
-
} : {
|
|
27443
|
-
visible: open || visible || false,
|
|
27444
|
-
onVisibleChange: onOpenChange || onVisibleChange
|
|
27445
|
-
};
|
|
27459
|
+
var dropdownOpenProps = openVisibleCompatible(open || visible || false, onOpenChange || onVisibleChange);
|
|
27446
27460
|
return wrapSSR((0,jsx_runtime.jsx)(external_antd_.Dropdown, objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
27447
27461
|
disabled: disabled,
|
|
27448
27462
|
placement: placement,
|
|
@@ -27576,7 +27590,6 @@ var InlineErrorFormItem_excluded = ["label", "rules", "name", "children", "popov
|
|
|
27576
27590
|
|
|
27577
27591
|
|
|
27578
27592
|
|
|
27579
|
-
|
|
27580
27593
|
var FIX_INLINE_STYLE = {
|
|
27581
27594
|
marginBlockStart: -5,
|
|
27582
27595
|
marginBlockEnd: -5,
|
|
@@ -27608,23 +27621,14 @@ var InlineErrorFormItemPopover = function InlineErrorFormItemPopover(_ref) {
|
|
|
27608
27621
|
setErrorList(inputProps.errors);
|
|
27609
27622
|
}
|
|
27610
27623
|
}, [inputProps.errors, inputProps.validateStatus]);
|
|
27611
|
-
var
|
|
27612
|
-
|
|
27613
|
-
|
|
27614
|
-
|
|
27615
|
-
setOpen(changeOpen);
|
|
27616
|
-
}
|
|
27617
|
-
} : {
|
|
27618
|
-
visible: errorStringList.length < 1 ? false : open,
|
|
27619
|
-
onVisibleChange: function onVisibleChange(changeOpen) {
|
|
27620
|
-
if (changeOpen === open) return;
|
|
27621
|
-
setOpen(changeOpen);
|
|
27622
|
-
}
|
|
27623
|
-
};
|
|
27624
|
+
var popoverOpenProps = openVisibleCompatible(errorStringList.length < 1 ? false : open, function (changeOpen) {
|
|
27625
|
+
if (changeOpen === open) return;
|
|
27626
|
+
setOpen(changeOpen);
|
|
27627
|
+
});
|
|
27624
27628
|
return (0,jsx_runtime.jsx)(external_antd_.Popover, objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
27625
27629
|
trigger: (popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.trigger) || 'focus',
|
|
27626
27630
|
placement: (popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.placement) || 'topRight'
|
|
27627
|
-
},
|
|
27631
|
+
}, popoverOpenProps), {}, {
|
|
27628
27632
|
getPopupContainer: popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.getPopupContainer,
|
|
27629
27633
|
getTooltipContainer: popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.getTooltipContainer,
|
|
27630
27634
|
content: wrapSSR((0,jsx_runtime.jsxs)("div", {
|
|
@@ -28913,19 +28917,6 @@ var omitBoolean = function omitBoolean(obj) {
|
|
|
28913
28917
|
}
|
|
28914
28918
|
return undefined;
|
|
28915
28919
|
};
|
|
28916
|
-
;// CONCATENATED MODULE: ./packages/utils/es/omitUndefined/index.js
|
|
28917
|
-
var omitUndefined = function omitUndefined(obj) {
|
|
28918
|
-
var newObj = {};
|
|
28919
|
-
Object.keys(obj || {}).forEach(function (key) {
|
|
28920
|
-
if (obj[key] !== undefined) {
|
|
28921
|
-
newObj[key] = obj[key];
|
|
28922
|
-
}
|
|
28923
|
-
});
|
|
28924
|
-
if (Object.keys(newObj).length < 1) {
|
|
28925
|
-
return undefined;
|
|
28926
|
-
}
|
|
28927
|
-
return newObj;
|
|
28928
|
-
};
|
|
28929
28920
|
;// CONCATENATED MODULE: ./packages/utils/es/omitUndefinedAndEmptyArr/index.js
|
|
28930
28921
|
var omitUndefinedAndEmptyArr = function omitUndefinedAndEmptyArr(obj) {
|
|
28931
28922
|
var newObj = {};
|
|
@@ -29312,7 +29303,7 @@ function editableRowByKey(keyProps, action) {
|
|
|
29312
29303
|
*
|
|
29313
29304
|
* @param ActionRenderConfig
|
|
29314
29305
|
*/
|
|
29315
|
-
function SaveEditableAction(_ref) {
|
|
29306
|
+
function SaveEditableAction(_ref, ref) {
|
|
29316
29307
|
var recordKey = _ref.recordKey,
|
|
29317
29308
|
onSave = _ref.onSave,
|
|
29318
29309
|
row = _ref.row,
|
|
@@ -29326,59 +29317,85 @@ function SaveEditableAction(_ref) {
|
|
|
29326
29317
|
_useMountMergeState2 = slicedToArray_slicedToArray(_useMountMergeState, 2),
|
|
29327
29318
|
loading = _useMountMergeState2[0],
|
|
29328
29319
|
setLoading = _useMountMergeState2[1];
|
|
29320
|
+
var save = useRefFunction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
29321
|
+
var _context$getFieldForm, isMapEditor, namePath, fields, _recordKey, recordKeyPath, curValue, data, res;
|
|
29322
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
29323
|
+
while (1) {
|
|
29324
|
+
switch (_context.prev = _context.next) {
|
|
29325
|
+
case 0:
|
|
29326
|
+
_context.prev = 0;
|
|
29327
|
+
isMapEditor = editorType === 'Map'; // 为了兼容类型为 array 的 dataIndex,当 recordKey 是一个数组时,用于获取表单值的 key 只取第一项,
|
|
29328
|
+
// 从表单中获取回来之后,再根据 namepath 获取具体的某个字段并设置
|
|
29329
|
+
namePath = [tableName, Array.isArray(recordKey) ? recordKey[0] : recordKey].map(function (key) {
|
|
29330
|
+
return key === null || key === void 0 ? void 0 : key.toString();
|
|
29331
|
+
}).flat(1).filter(Boolean);
|
|
29332
|
+
setLoading(true);
|
|
29333
|
+
// @ts-expect-error
|
|
29334
|
+
_context.next = 6;
|
|
29335
|
+
return form.validateFields(namePath, {
|
|
29336
|
+
recursive: true
|
|
29337
|
+
});
|
|
29338
|
+
case 6:
|
|
29339
|
+
fields = ((_context$getFieldForm = context.getFieldFormatValue) === null || _context$getFieldForm === void 0 ? void 0 : _context$getFieldForm.call(context, namePath)) || form.getFieldValue(namePath); // 处理 dataIndex 为数组的情况
|
|
29340
|
+
if (Array.isArray(recordKey) && recordKey.length > 1) {
|
|
29341
|
+
// 获取 namepath
|
|
29342
|
+
_recordKey = _toArray(recordKey), recordKeyPath = _recordKey.slice(1); // 将目标值获取出来并设置到 fields 当中
|
|
29343
|
+
curValue = (0,utils_get["default"])(fields, recordKeyPath);
|
|
29344
|
+
(0,set/* default */.Z)(fields, recordKeyPath, curValue);
|
|
29345
|
+
}
|
|
29346
|
+
data = isMapEditor ? (0,set/* default */.Z)({}, namePath, fields, true) : fields; // 获取数据并保存
|
|
29347
|
+
_context.next = 11;
|
|
29348
|
+
return onSave === null || onSave === void 0 ? void 0 : onSave(recordKey,
|
|
29349
|
+
// 如果是 map 模式,fields 就是一个值,所以需要set 到对象中
|
|
29350
|
+
// 数据模式 fields 是一个对象,所以不需要
|
|
29351
|
+
merge_merge({}, row, data), row, newLineConfig);
|
|
29352
|
+
case 11:
|
|
29353
|
+
res = _context.sent;
|
|
29354
|
+
setLoading(false);
|
|
29355
|
+
return _context.abrupt("return", res);
|
|
29356
|
+
case 16:
|
|
29357
|
+
_context.prev = 16;
|
|
29358
|
+
_context.t0 = _context["catch"](0);
|
|
29359
|
+
// eslint-disable-next-line no-console
|
|
29360
|
+
console.log(_context.t0);
|
|
29361
|
+
setLoading(false);
|
|
29362
|
+
throw _context.t0;
|
|
29363
|
+
case 21:
|
|
29364
|
+
case "end":
|
|
29365
|
+
return _context.stop();
|
|
29366
|
+
}
|
|
29367
|
+
}
|
|
29368
|
+
}, _callee, null, [[0, 16]]);
|
|
29369
|
+
})));
|
|
29370
|
+
(0,external_React_.useImperativeHandle)(ref, function () {
|
|
29371
|
+
return {
|
|
29372
|
+
save: save
|
|
29373
|
+
};
|
|
29374
|
+
});
|
|
29329
29375
|
return (0,jsx_runtime.jsxs)("a", {
|
|
29330
29376
|
onClick: function () {
|
|
29331
|
-
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
29332
|
-
|
|
29333
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
29377
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
29378
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
29334
29379
|
while (1) {
|
|
29335
|
-
switch (
|
|
29380
|
+
switch (_context2.prev = _context2.next) {
|
|
29336
29381
|
case 0:
|
|
29337
29382
|
e.stopPropagation();
|
|
29338
29383
|
e.preventDefault();
|
|
29339
|
-
|
|
29340
|
-
|
|
29341
|
-
|
|
29342
|
-
|
|
29343
|
-
|
|
29344
|
-
|
|
29345
|
-
|
|
29346
|
-
|
|
29347
|
-
|
|
29348
|
-
|
|
29349
|
-
recursive: true
|
|
29350
|
-
});
|
|
29351
|
-
case 8:
|
|
29352
|
-
fields = ((_context$getFieldForm = context.getFieldFormatValue) === null || _context$getFieldForm === void 0 ? void 0 : _context$getFieldForm.call(context, namePath)) || form.getFieldValue(namePath); // 处理 dataIndex 为数组的情况
|
|
29353
|
-
if (Array.isArray(recordKey) && recordKey.length > 1) {
|
|
29354
|
-
// 获取 namepath
|
|
29355
|
-
_recordKey = _toArray(recordKey), recordKeyPath = _recordKey.slice(1); // 将目标值获取出来并设置到 fields 当中
|
|
29356
|
-
curValue = (0,utils_get["default"])(fields, recordKeyPath);
|
|
29357
|
-
(0,set/* default */.Z)(fields, recordKeyPath, curValue);
|
|
29358
|
-
}
|
|
29359
|
-
data = isMapEditor ? (0,set/* default */.Z)({}, namePath, fields, true) : fields; // 获取数据并保存
|
|
29360
|
-
_context.next = 13;
|
|
29361
|
-
return onSave === null || onSave === void 0 ? void 0 : onSave(recordKey,
|
|
29362
|
-
// 如果是 map 模式,fields 就是一个值,所以需要set 到对象中
|
|
29363
|
-
// 数据模式 fields 是一个对象,所以不需要
|
|
29364
|
-
merge_merge({}, row, data), row, newLineConfig);
|
|
29365
|
-
case 13:
|
|
29366
|
-
res = _context.sent;
|
|
29367
|
-
setLoading(false);
|
|
29368
|
-
return _context.abrupt("return", res);
|
|
29369
|
-
case 18:
|
|
29370
|
-
_context.prev = 18;
|
|
29371
|
-
_context.t0 = _context["catch"](2);
|
|
29372
|
-
// eslint-disable-next-line no-console
|
|
29373
|
-
console.log(_context.t0);
|
|
29374
|
-
setLoading(false);
|
|
29375
|
-
return _context.abrupt("return", null);
|
|
29376
|
-
case 23:
|
|
29384
|
+
_context2.prev = 2;
|
|
29385
|
+
_context2.next = 5;
|
|
29386
|
+
return save();
|
|
29387
|
+
case 5:
|
|
29388
|
+
_context2.next = 9;
|
|
29389
|
+
break;
|
|
29390
|
+
case 7:
|
|
29391
|
+
_context2.prev = 7;
|
|
29392
|
+
_context2.t0 = _context2["catch"](2);
|
|
29393
|
+
case 9:
|
|
29377
29394
|
case "end":
|
|
29378
|
-
return
|
|
29395
|
+
return _context2.stop();
|
|
29379
29396
|
}
|
|
29380
29397
|
}
|
|
29381
|
-
},
|
|
29398
|
+
}, _callee2, null, [[2, 7]]);
|
|
29382
29399
|
}));
|
|
29383
29400
|
function onClick(_x) {
|
|
29384
29401
|
return _onClick.apply(this, arguments);
|
|
@@ -29397,45 +29414,45 @@ function SaveEditableAction(_ref) {
|
|
|
29397
29414
|
*
|
|
29398
29415
|
* @param ActionRenderConfig
|
|
29399
29416
|
*/
|
|
29400
|
-
var DeleteEditableAction = function DeleteEditableAction(
|
|
29401
|
-
var recordKey =
|
|
29402
|
-
onDelete =
|
|
29403
|
-
row =
|
|
29404
|
-
children =
|
|
29405
|
-
deletePopconfirmMessage =
|
|
29417
|
+
var DeleteEditableAction = function DeleteEditableAction(_ref3) {
|
|
29418
|
+
var recordKey = _ref3.recordKey,
|
|
29419
|
+
onDelete = _ref3.onDelete,
|
|
29420
|
+
row = _ref3.row,
|
|
29421
|
+
children = _ref3.children,
|
|
29422
|
+
deletePopconfirmMessage = _ref3.deletePopconfirmMessage;
|
|
29406
29423
|
var _useMountMergeState3 = (0,useMergedState/* default */.Z)(function () {
|
|
29407
29424
|
return false;
|
|
29408
29425
|
}),
|
|
29409
29426
|
_useMountMergeState4 = slicedToArray_slicedToArray(_useMountMergeState3, 2),
|
|
29410
29427
|
loading = _useMountMergeState4[0],
|
|
29411
29428
|
setLoading = _useMountMergeState4[1];
|
|
29412
|
-
var _onConfirm = useRefFunction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
29429
|
+
var _onConfirm = useRefFunction( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
29413
29430
|
var res;
|
|
29414
|
-
return _regeneratorRuntime().wrap(function
|
|
29431
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
29415
29432
|
while (1) {
|
|
29416
|
-
switch (
|
|
29433
|
+
switch (_context3.prev = _context3.next) {
|
|
29417
29434
|
case 0:
|
|
29418
|
-
|
|
29435
|
+
_context3.prev = 0;
|
|
29419
29436
|
setLoading(true);
|
|
29420
|
-
|
|
29437
|
+
_context3.next = 4;
|
|
29421
29438
|
return onDelete === null || onDelete === void 0 ? void 0 : onDelete(recordKey, row);
|
|
29422
29439
|
case 4:
|
|
29423
|
-
res =
|
|
29440
|
+
res = _context3.sent;
|
|
29424
29441
|
setLoading(false);
|
|
29425
|
-
return
|
|
29442
|
+
return _context3.abrupt("return", res);
|
|
29426
29443
|
case 9:
|
|
29427
|
-
|
|
29428
|
-
|
|
29444
|
+
_context3.prev = 9;
|
|
29445
|
+
_context3.t0 = _context3["catch"](0);
|
|
29429
29446
|
// eslint-disable-next-line no-console
|
|
29430
|
-
console.log(
|
|
29447
|
+
console.log(_context3.t0);
|
|
29431
29448
|
setLoading(false);
|
|
29432
|
-
return
|
|
29449
|
+
return _context3.abrupt("return", null);
|
|
29433
29450
|
case 14:
|
|
29434
29451
|
case "end":
|
|
29435
|
-
return
|
|
29452
|
+
return _context3.stop();
|
|
29436
29453
|
}
|
|
29437
29454
|
}
|
|
29438
|
-
},
|
|
29455
|
+
}, _callee3, null, [[0, 9]]);
|
|
29439
29456
|
})));
|
|
29440
29457
|
return children !== false ? (0,jsx_runtime.jsx)(external_antd_.Popconfirm, {
|
|
29441
29458
|
title: deletePopconfirmMessage,
|
|
@@ -29464,12 +29481,12 @@ var CancelEditableAction = function CancelEditableAction(props) {
|
|
|
29464
29481
|
var form = external_antd_.Form.useFormInstance();
|
|
29465
29482
|
return (0,jsx_runtime.jsx)("a", {
|
|
29466
29483
|
onClick: function () {
|
|
29467
|
-
var _onClick2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
29484
|
+
var _onClick2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e) {
|
|
29468
29485
|
var _context$getFieldForm2;
|
|
29469
29486
|
var isMapEditor, namePath, fields, record, res;
|
|
29470
|
-
return _regeneratorRuntime().wrap(function
|
|
29487
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
29471
29488
|
while (1) {
|
|
29472
|
-
switch (
|
|
29489
|
+
switch (_context4.prev = _context4.next) {
|
|
29473
29490
|
case 0:
|
|
29474
29491
|
e.stopPropagation();
|
|
29475
29492
|
e.preventDefault();
|
|
@@ -29477,20 +29494,20 @@ var CancelEditableAction = function CancelEditableAction(props) {
|
|
|
29477
29494
|
namePath = [tableName, recordKey].flat(1).filter(Boolean);
|
|
29478
29495
|
fields = ((_context$getFieldForm2 = context.getFieldFormatValue) === null || _context$getFieldForm2 === void 0 ? void 0 : _context$getFieldForm2.call(context, namePath)) || form.getFieldValue(namePath);
|
|
29479
29496
|
record = isMapEditor ? (0,set/* default */.Z)({}, namePath, fields) : fields;
|
|
29480
|
-
|
|
29497
|
+
_context4.next = 8;
|
|
29481
29498
|
return onCancel === null || onCancel === void 0 ? void 0 : onCancel(recordKey, record, row, newLineConfig);
|
|
29482
29499
|
case 8:
|
|
29483
|
-
res =
|
|
29500
|
+
res = _context4.sent;
|
|
29484
29501
|
cancelEditable(recordKey);
|
|
29485
29502
|
/** 充值为默认值,不然编辑的行会丢掉 */
|
|
29486
29503
|
form.setFieldsValue(defineProperty_defineProperty({}, recordKey, isMapEditor ? (0,utils_get["default"])(row, namePath) : row));
|
|
29487
|
-
return
|
|
29504
|
+
return _context4.abrupt("return", res);
|
|
29488
29505
|
case 12:
|
|
29489
29506
|
case "end":
|
|
29490
|
-
return
|
|
29507
|
+
return _context4.stop();
|
|
29491
29508
|
}
|
|
29492
29509
|
}
|
|
29493
|
-
},
|
|
29510
|
+
}, _callee4);
|
|
29494
29511
|
}));
|
|
29495
29512
|
function onClick(_x2) {
|
|
29496
29513
|
return _onClick2.apply(this, arguments);
|
|
@@ -29505,15 +29522,23 @@ function defaultActionRender(row, config) {
|
|
|
29505
29522
|
newLineConfig = config.newLineConfig,
|
|
29506
29523
|
saveText = config.saveText,
|
|
29507
29524
|
deleteText = config.deleteText;
|
|
29508
|
-
|
|
29509
|
-
|
|
29510
|
-
|
|
29511
|
-
|
|
29512
|
-
|
|
29513
|
-
|
|
29514
|
-
|
|
29515
|
-
|
|
29516
|
-
|
|
29525
|
+
var SaveEditableActionRef = /*#__PURE__*/(0,external_React_.forwardRef)(SaveEditableAction);
|
|
29526
|
+
var saveRef = /*#__PURE__*/(0,external_React_.createRef)();
|
|
29527
|
+
return {
|
|
29528
|
+
save: (0,jsx_runtime.jsx)(SaveEditableActionRef, objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, config), {}, {
|
|
29529
|
+
row: row,
|
|
29530
|
+
ref: saveRef,
|
|
29531
|
+
children: saveText
|
|
29532
|
+
}), 'save' + recordKey),
|
|
29533
|
+
saveRef: saveRef,
|
|
29534
|
+
delete: (newLineConfig === null || newLineConfig === void 0 ? void 0 : newLineConfig.options.recordKey) !== recordKey ? (0,jsx_runtime.jsx)(DeleteEditableAction, objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, config), {}, {
|
|
29535
|
+
row: row,
|
|
29536
|
+
children: deleteText
|
|
29537
|
+
}), 'delete' + recordKey) : undefined,
|
|
29538
|
+
cancel: (0,jsx_runtime.jsx)(CancelEditableAction, objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, config), {}, {
|
|
29539
|
+
row: row
|
|
29540
|
+
}), 'cancel' + recordKey)
|
|
29541
|
+
};
|
|
29517
29542
|
}
|
|
29518
29543
|
/**
|
|
29519
29544
|
* 一个方便的hooks 用于维护编辑的状态
|
|
@@ -29618,21 +29643,21 @@ function useEditableArray(props) {
|
|
|
29618
29643
|
* @param recordKey
|
|
29619
29644
|
*/
|
|
29620
29645
|
var cancelEditable = useRefFunction( /*#__PURE__*/function () {
|
|
29621
|
-
var
|
|
29646
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(recordKey, needReTry) {
|
|
29622
29647
|
var relayKey, key;
|
|
29623
|
-
return _regeneratorRuntime().wrap(function
|
|
29648
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
29624
29649
|
while (1) {
|
|
29625
|
-
switch (
|
|
29650
|
+
switch (_context5.prev = _context5.next) {
|
|
29626
29651
|
case 0:
|
|
29627
29652
|
relayKey = recordKeyToString(recordKey).toString();
|
|
29628
29653
|
key = dataSourceKeyIndexMapRef.current.get(relayKey);
|
|
29629
29654
|
/** 如果没找到key,转化一下再去找 */
|
|
29630
29655
|
if (!(!editableKeysSet.has(relayKey) && key && (needReTry !== null && needReTry !== void 0 ? needReTry : true) && props.tableName)) {
|
|
29631
|
-
|
|
29656
|
+
_context5.next = 5;
|
|
29632
29657
|
break;
|
|
29633
29658
|
}
|
|
29634
29659
|
cancelEditable(key, false);
|
|
29635
|
-
return
|
|
29660
|
+
return _context5.abrupt("return");
|
|
29636
29661
|
case 5:
|
|
29637
29662
|
/** 如果这个是 new Line 直接删除 */
|
|
29638
29663
|
if (newLineRecordCache && newLineRecordCache.options.recordKey === recordKey) {
|
|
@@ -29641,39 +29666,39 @@ function useEditableArray(props) {
|
|
|
29641
29666
|
editableKeysSet.delete(relayKey);
|
|
29642
29667
|
editableKeysSet.delete(recordKeyToString(recordKey));
|
|
29643
29668
|
setEditableRowKeys(Array.from(editableKeysSet));
|
|
29644
|
-
return
|
|
29669
|
+
return _context5.abrupt("return", true);
|
|
29645
29670
|
case 10:
|
|
29646
29671
|
case "end":
|
|
29647
|
-
return
|
|
29672
|
+
return _context5.stop();
|
|
29648
29673
|
}
|
|
29649
29674
|
}
|
|
29650
|
-
},
|
|
29675
|
+
}, _callee5);
|
|
29651
29676
|
}));
|
|
29652
29677
|
return function (_x3, _x4) {
|
|
29653
|
-
return
|
|
29678
|
+
return _ref5.apply(this, arguments);
|
|
29654
29679
|
};
|
|
29655
29680
|
}());
|
|
29656
|
-
var propsOnValuesChange = useDebounceFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
29681
|
+
var propsOnValuesChange = useDebounceFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
29657
29682
|
var _props$onValuesChange;
|
|
29658
29683
|
var _len,
|
|
29659
29684
|
rest,
|
|
29660
29685
|
_key,
|
|
29661
|
-
|
|
29662
|
-
return _regeneratorRuntime().wrap(function
|
|
29686
|
+
_args6 = arguments;
|
|
29687
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
29663
29688
|
while (1) {
|
|
29664
|
-
switch (
|
|
29689
|
+
switch (_context6.prev = _context6.next) {
|
|
29665
29690
|
case 0:
|
|
29666
|
-
for (_len =
|
|
29667
|
-
rest[_key] =
|
|
29691
|
+
for (_len = _args6.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
29692
|
+
rest[_key] = _args6[_key];
|
|
29668
29693
|
}
|
|
29669
29694
|
//@ts-ignore
|
|
29670
29695
|
(_props$onValuesChange = props.onValuesChange) === null || _props$onValuesChange === void 0 ? void 0 : _props$onValuesChange.call.apply(_props$onValuesChange, [props].concat(rest));
|
|
29671
29696
|
case 2:
|
|
29672
29697
|
case "end":
|
|
29673
|
-
return
|
|
29698
|
+
return _context6.stop();
|
|
29674
29699
|
}
|
|
29675
29700
|
}
|
|
29676
|
-
},
|
|
29701
|
+
}, _callee6);
|
|
29677
29702
|
})), 64);
|
|
29678
29703
|
var onValuesChange = useRefFunction(function (value, values) {
|
|
29679
29704
|
var _Object$keys$pop;
|
|
@@ -29714,6 +29739,67 @@ function useEditableArray(props) {
|
|
|
29714
29739
|
}) : newLineRecordData;
|
|
29715
29740
|
propsOnValuesChange.run(editRow || newLineRecordData, dataSource);
|
|
29716
29741
|
});
|
|
29742
|
+
var saveRefsMap = (0,external_React_.useRef)(new Map());
|
|
29743
|
+
(0,external_React_.useEffect)(function () {
|
|
29744
|
+
// 确保只保留编辑状态的,其它的都删除掉
|
|
29745
|
+
saveRefsMap.current.forEach(function (ref, key) {
|
|
29746
|
+
if (!editableKeysSet.has(key)) {
|
|
29747
|
+
saveRefsMap.current.delete(key);
|
|
29748
|
+
}
|
|
29749
|
+
});
|
|
29750
|
+
}, [saveRefsMap, editableKeysSet]);
|
|
29751
|
+
/**
|
|
29752
|
+
* 保存编辑行
|
|
29753
|
+
*
|
|
29754
|
+
* @param recordKey
|
|
29755
|
+
* @param needReTry
|
|
29756
|
+
*/
|
|
29757
|
+
var saveEditable = useRefFunction( /*#__PURE__*/function () {
|
|
29758
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(recordKey, needReTry) {
|
|
29759
|
+
var relayKey, key, saveRef, _saveRef$current;
|
|
29760
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
29761
|
+
while (1) {
|
|
29762
|
+
switch (_context7.prev = _context7.next) {
|
|
29763
|
+
case 0:
|
|
29764
|
+
relayKey = recordKeyToString(recordKey);
|
|
29765
|
+
key = dataSourceKeyIndexMapRef.current.get(recordKey.toString());
|
|
29766
|
+
/** 如果没找到key,转化一下再去找 */
|
|
29767
|
+
if (!(!editableKeysSet.has(relayKey) && key && (needReTry !== null && needReTry !== void 0 ? needReTry : true) && props.tableName)) {
|
|
29768
|
+
_context7.next = 6;
|
|
29769
|
+
break;
|
|
29770
|
+
}
|
|
29771
|
+
_context7.next = 5;
|
|
29772
|
+
return saveEditable(key, false);
|
|
29773
|
+
case 5:
|
|
29774
|
+
return _context7.abrupt("return", _context7.sent);
|
|
29775
|
+
case 6:
|
|
29776
|
+
saveRef = saveRefsMap.current.get(relayKey) || saveRefsMap.current.get(relayKey.toString());
|
|
29777
|
+
_context7.prev = 7;
|
|
29778
|
+
_context7.next = 10;
|
|
29779
|
+
return saveRef === null || saveRef === void 0 ? void 0 : (_saveRef$current = saveRef.current) === null || _saveRef$current === void 0 ? void 0 : _saveRef$current.save();
|
|
29780
|
+
case 10:
|
|
29781
|
+
_context7.next = 15;
|
|
29782
|
+
break;
|
|
29783
|
+
case 12:
|
|
29784
|
+
_context7.prev = 12;
|
|
29785
|
+
_context7.t0 = _context7["catch"](7);
|
|
29786
|
+
return _context7.abrupt("return", false);
|
|
29787
|
+
case 15:
|
|
29788
|
+
editableKeysSet.delete(relayKey);
|
|
29789
|
+
editableKeysSet.delete(relayKey.toString());
|
|
29790
|
+
setEditableRowKeys(Array.from(editableKeysSet));
|
|
29791
|
+
return _context7.abrupt("return", true);
|
|
29792
|
+
case 19:
|
|
29793
|
+
case "end":
|
|
29794
|
+
return _context7.stop();
|
|
29795
|
+
}
|
|
29796
|
+
}
|
|
29797
|
+
}, _callee7, null, [[7, 12]]);
|
|
29798
|
+
}));
|
|
29799
|
+
return function (_x5, _x6) {
|
|
29800
|
+
return _ref7.apply(this, arguments);
|
|
29801
|
+
};
|
|
29802
|
+
}());
|
|
29717
29803
|
/**
|
|
29718
29804
|
* 同时只能支持一行,取消之后数据消息,不会触发 dataSource
|
|
29719
29805
|
*
|
|
@@ -29775,22 +29861,22 @@ function useEditableArray(props) {
|
|
|
29775
29861
|
var deleteText = (props === null || props === void 0 ? void 0 : props.deleteText) || intl.getMessage('editableTable.action.delete', '删除');
|
|
29776
29862
|
var cancelText = (props === null || props === void 0 ? void 0 : props.cancelText) || intl.getMessage('editableTable.action.cancel', '取消');
|
|
29777
29863
|
var actionSaveRef = useRefFunction( /*#__PURE__*/function () {
|
|
29778
|
-
var
|
|
29864
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(recordKey, editRow, originRow, newLine) {
|
|
29779
29865
|
var _props$onSave, _recordKeyToString4, _options$parentKey;
|
|
29780
|
-
var
|
|
29781
|
-
return _regeneratorRuntime().wrap(function
|
|
29866
|
+
var _ref9, options, res, actionProps;
|
|
29867
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
29782
29868
|
while (1) {
|
|
29783
|
-
switch (
|
|
29869
|
+
switch (_context8.prev = _context8.next) {
|
|
29784
29870
|
case 0:
|
|
29785
|
-
|
|
29786
|
-
|
|
29871
|
+
_ref9 = newLine || newLineRecordRef.current || {}, options = _ref9.options;
|
|
29872
|
+
_context8.next = 3;
|
|
29787
29873
|
return props === null || props === void 0 ? void 0 : (_props$onSave = props.onSave) === null || _props$onSave === void 0 ? void 0 : _props$onSave.call(props, recordKey, editRow, originRow, newLine);
|
|
29788
29874
|
case 3:
|
|
29789
|
-
res =
|
|
29875
|
+
res = _context8.sent;
|
|
29790
29876
|
// 保存时解除编辑模式
|
|
29791
29877
|
cancelEditable(recordKey);
|
|
29792
29878
|
if (!(!(options === null || options === void 0 ? void 0 : options.parentKey) && (options === null || options === void 0 ? void 0 : options.recordKey) === recordKey)) {
|
|
29793
|
-
|
|
29879
|
+
_context8.next = 8;
|
|
29794
29880
|
break;
|
|
29795
29881
|
}
|
|
29796
29882
|
if ((options === null || options === void 0 ? void 0 : options.position) === 'top') {
|
|
@@ -29798,7 +29884,7 @@ function useEditableArray(props) {
|
|
|
29798
29884
|
} else {
|
|
29799
29885
|
props.setDataSource([].concat(toConsumableArray_toConsumableArray(props.dataSource), [editRow]));
|
|
29800
29886
|
}
|
|
29801
|
-
return
|
|
29887
|
+
return _context8.abrupt("return", res);
|
|
29802
29888
|
case 8:
|
|
29803
29889
|
actionProps = {
|
|
29804
29890
|
data: props.dataSource,
|
|
@@ -29810,25 +29896,25 @@ function useEditableArray(props) {
|
|
|
29810
29896
|
childrenColumnName: props.childrenColumnName || 'children'
|
|
29811
29897
|
};
|
|
29812
29898
|
props.setDataSource(editableRowByKey(actionProps, (options === null || options === void 0 ? void 0 : options.position) === 'top' ? 'top' : 'update'));
|
|
29813
|
-
return
|
|
29899
|
+
return _context8.abrupt("return", res);
|
|
29814
29900
|
case 11:
|
|
29815
29901
|
case "end":
|
|
29816
|
-
return
|
|
29902
|
+
return _context8.stop();
|
|
29817
29903
|
}
|
|
29818
29904
|
}
|
|
29819
|
-
},
|
|
29905
|
+
}, _callee8);
|
|
29820
29906
|
}));
|
|
29821
|
-
return function (
|
|
29822
|
-
return
|
|
29907
|
+
return function (_x7, _x8, _x9, _x10) {
|
|
29908
|
+
return _ref8.apply(this, arguments);
|
|
29823
29909
|
};
|
|
29824
29910
|
}());
|
|
29825
29911
|
var actionDeleteRef = useRefFunction( /*#__PURE__*/function () {
|
|
29826
|
-
var
|
|
29912
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(recordKey, editRow) {
|
|
29827
29913
|
var _props$onDelete;
|
|
29828
29914
|
var actionProps, res;
|
|
29829
|
-
return _regeneratorRuntime().wrap(function
|
|
29915
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
29830
29916
|
while (1) {
|
|
29831
|
-
switch (
|
|
29917
|
+
switch (_context9.prev = _context9.next) {
|
|
29832
29918
|
case 0:
|
|
29833
29919
|
actionProps = {
|
|
29834
29920
|
data: props.dataSource,
|
|
@@ -29837,48 +29923,48 @@ function useEditableArray(props) {
|
|
|
29837
29923
|
key: recordKey,
|
|
29838
29924
|
childrenColumnName: props.childrenColumnName || 'children'
|
|
29839
29925
|
};
|
|
29840
|
-
|
|
29926
|
+
_context9.next = 3;
|
|
29841
29927
|
return props === null || props === void 0 ? void 0 : (_props$onDelete = props.onDelete) === null || _props$onDelete === void 0 ? void 0 : _props$onDelete.call(props, recordKey, editRow);
|
|
29842
29928
|
case 3:
|
|
29843
|
-
res =
|
|
29844
|
-
|
|
29929
|
+
res = _context9.sent;
|
|
29930
|
+
_context9.next = 6;
|
|
29845
29931
|
return cancelEditable(recordKey);
|
|
29846
29932
|
case 6:
|
|
29847
29933
|
props.setDataSource(editableRowByKey(actionProps, 'delete'));
|
|
29848
|
-
return
|
|
29934
|
+
return _context9.abrupt("return", res);
|
|
29849
29935
|
case 8:
|
|
29850
29936
|
case "end":
|
|
29851
|
-
return
|
|
29937
|
+
return _context9.stop();
|
|
29852
29938
|
}
|
|
29853
29939
|
}
|
|
29854
|
-
},
|
|
29940
|
+
}, _callee9);
|
|
29855
29941
|
}));
|
|
29856
|
-
return function (
|
|
29857
|
-
return
|
|
29942
|
+
return function (_x11, _x12) {
|
|
29943
|
+
return _ref10.apply(this, arguments);
|
|
29858
29944
|
};
|
|
29859
29945
|
}());
|
|
29860
29946
|
var actionCancelRef = useRefFunction( /*#__PURE__*/function () {
|
|
29861
|
-
var
|
|
29947
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(recordKey, editRow, originRow, newLine) {
|
|
29862
29948
|
var _props$onCancel;
|
|
29863
29949
|
var res;
|
|
29864
|
-
return _regeneratorRuntime().wrap(function
|
|
29950
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
29865
29951
|
while (1) {
|
|
29866
|
-
switch (
|
|
29952
|
+
switch (_context10.prev = _context10.next) {
|
|
29867
29953
|
case 0:
|
|
29868
|
-
|
|
29954
|
+
_context10.next = 2;
|
|
29869
29955
|
return props === null || props === void 0 ? void 0 : (_props$onCancel = props.onCancel) === null || _props$onCancel === void 0 ? void 0 : _props$onCancel.call(props, recordKey, editRow, originRow, newLine);
|
|
29870
29956
|
case 2:
|
|
29871
|
-
res =
|
|
29872
|
-
return
|
|
29957
|
+
res = _context10.sent;
|
|
29958
|
+
return _context10.abrupt("return", res);
|
|
29873
29959
|
case 4:
|
|
29874
29960
|
case "end":
|
|
29875
|
-
return
|
|
29961
|
+
return _context10.stop();
|
|
29876
29962
|
}
|
|
29877
29963
|
}
|
|
29878
|
-
},
|
|
29964
|
+
}, _callee10);
|
|
29879
29965
|
}));
|
|
29880
|
-
return function (
|
|
29881
|
-
return
|
|
29966
|
+
return function (_x13, _x14, _x15, _x16) {
|
|
29967
|
+
return _ref11.apply(this, arguments);
|
|
29882
29968
|
};
|
|
29883
29969
|
}());
|
|
29884
29970
|
var actionRender = function actionRender(row) {
|
|
@@ -29900,13 +29986,19 @@ function useEditableArray(props) {
|
|
|
29900
29986
|
setEditableRowKeys: setEditableRowKeys,
|
|
29901
29987
|
deletePopconfirmMessage: props.deletePopconfirmMessage || "".concat(intl.getMessage('deleteThisLine', '删除此行'), "?")
|
|
29902
29988
|
};
|
|
29903
|
-
var
|
|
29989
|
+
var renderResult = defaultActionRender(row, config);
|
|
29990
|
+
// 缓存一下saveRef
|
|
29991
|
+
if (props.tableName) {
|
|
29992
|
+
saveRefsMap.current.set(dataSourceKeyIndexMapRef.current.get(recordKeyToString(key)) || recordKeyToString(key), renderResult.saveRef);
|
|
29993
|
+
} else {
|
|
29994
|
+
saveRefsMap.current.set(recordKeyToString(key), renderResult.saveRef);
|
|
29995
|
+
}
|
|
29904
29996
|
if (props.actionRender) return props.actionRender(row, config, {
|
|
29905
|
-
save:
|
|
29906
|
-
delete:
|
|
29907
|
-
cancel:
|
|
29997
|
+
save: renderResult.save,
|
|
29998
|
+
delete: renderResult.delete,
|
|
29999
|
+
cancel: renderResult.cancel
|
|
29908
30000
|
});
|
|
29909
|
-
return
|
|
30001
|
+
return [renderResult.save, renderResult.delete, renderResult.cancel];
|
|
29910
30002
|
};
|
|
29911
30003
|
return {
|
|
29912
30004
|
editableKeys: editableKeys,
|
|
@@ -29916,6 +30008,7 @@ function useEditableArray(props) {
|
|
|
29916
30008
|
startEditable: startEditable,
|
|
29917
30009
|
cancelEditable: cancelEditable,
|
|
29918
30010
|
addEditRecord: addEditRecord,
|
|
30011
|
+
saveEditable: saveEditable,
|
|
29919
30012
|
newLineRecord: newLineRecordCache,
|
|
29920
30013
|
preEditableKeys: editableKeysRef,
|
|
29921
30014
|
onValuesChange: onValuesChange
|
|
@@ -30093,15 +30186,15 @@ function useEditableMap(props) {
|
|
|
30093
30186
|
deletePopconfirmMessage: "".concat(intl.getMessage('deleteThisLine', '删除此行'), "?"),
|
|
30094
30187
|
editorType: 'Map'
|
|
30095
30188
|
}, config);
|
|
30096
|
-
var
|
|
30189
|
+
var renderResult = defaultActionRender(props.dataSource, renderConfig);
|
|
30097
30190
|
if (props.actionRender) {
|
|
30098
30191
|
return props.actionRender(props.dataSource, renderConfig, {
|
|
30099
|
-
save:
|
|
30100
|
-
delete:
|
|
30101
|
-
cancel:
|
|
30192
|
+
save: renderResult.save,
|
|
30193
|
+
delete: renderResult.delete,
|
|
30194
|
+
cancel: renderResult.cancel
|
|
30102
30195
|
});
|
|
30103
30196
|
}
|
|
30104
|
-
return
|
|
30197
|
+
return [renderResult.save, renderResult.delete, renderResult.cancel];
|
|
30105
30198
|
}, [editableKeys && editableKeys.join(','), props.dataSource]);
|
|
30106
30199
|
return {
|
|
30107
30200
|
editableKeys: editableKeys,
|
|
@@ -30112,34 +30205,6 @@ function useEditableMap(props) {
|
|
|
30112
30205
|
cancelEditable: cancelEditable
|
|
30113
30206
|
};
|
|
30114
30207
|
}
|
|
30115
|
-
;// CONCATENATED MODULE: ./packages/utils/es/useSafeState/index.js
|
|
30116
|
-
|
|
30117
|
-
|
|
30118
|
-
/**
|
|
30119
|
-
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
|
|
30120
|
-
* We do not make this auto is to avoid real memory leak.
|
|
30121
|
-
* Developer should confirm it's safe to ignore themselves.
|
|
30122
|
-
*/
|
|
30123
|
-
function useSafeState(defaultValue) {
|
|
30124
|
-
var destroyRef = external_React_.useRef(false);
|
|
30125
|
-
var _React$useState = external_React_.useState(defaultValue),
|
|
30126
|
-
_React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
|
|
30127
|
-
value = _React$useState2[0],
|
|
30128
|
-
setValue = _React$useState2[1];
|
|
30129
|
-
external_React_.useEffect(function () {
|
|
30130
|
-
destroyRef.current = false;
|
|
30131
|
-
return function () {
|
|
30132
|
-
destroyRef.current = true;
|
|
30133
|
-
};
|
|
30134
|
-
}, []);
|
|
30135
|
-
function safeSetState(updater, ignoreDestroy) {
|
|
30136
|
-
if (ignoreDestroy && destroyRef.current) {
|
|
30137
|
-
return;
|
|
30138
|
-
}
|
|
30139
|
-
setValue(updater);
|
|
30140
|
-
}
|
|
30141
|
-
return [value, safeSetState];
|
|
30142
|
-
}
|
|
30143
30208
|
;// CONCATENATED MODULE: ./packages/utils/es/index.js
|
|
30144
30209
|
|
|
30145
30210
|
|
|
@@ -31078,11 +31143,10 @@ var ProCardActions = function ProCardActions(props) {
|
|
|
31078
31143
|
})
|
|
31079
31144
|
}));
|
|
31080
31145
|
}
|
|
31081
|
-
|
|
31146
|
+
return wrapSSR((0,jsx_runtime.jsx)("ul", {
|
|
31082
31147
|
className: classnames_default()("".concat(prefixCls, "-actions"), hashId),
|
|
31083
31148
|
children: actions
|
|
31084
31149
|
}));
|
|
31085
|
-
return null;
|
|
31086
31150
|
};
|
|
31087
31151
|
/* harmony default export */ var Actions = (ProCardActions);
|
|
31088
31152
|
;// CONCATENATED MODULE: ./packages/card/es/components/Loading/style.js
|
|
@@ -31752,10 +31816,10 @@ var Card = /*#__PURE__*/external_React_default().forwardRef(function (props, ref
|
|
|
31752
31816
|
className: bodyCls,
|
|
31753
31817
|
style: cardBodyStyle,
|
|
31754
31818
|
children: loading ? loadingDOM : childrenModified
|
|
31755
|
-
}), (0,jsx_runtime.jsx)(Actions, {
|
|
31819
|
+
}), actions ? (0,jsx_runtime.jsx)(Actions, {
|
|
31756
31820
|
actions: actions,
|
|
31757
31821
|
prefixCls: prefixCls
|
|
31758
|
-
})]
|
|
31822
|
+
}) : null]
|
|
31759
31823
|
})));
|
|
31760
31824
|
});
|
|
31761
31825
|
/* harmony default export */ var components_Card = (Card);
|
|
@@ -37063,12 +37127,12 @@ var useFieldFetchData = function useFieldFetchData(props) {
|
|
|
37063
37127
|
var _ref5, _props$debounceTime, _props$fieldProps3, _props$fieldProps6;
|
|
37064
37128
|
var cacheForSwr = props.cacheForSwr,
|
|
37065
37129
|
fieldProps = props.fieldProps;
|
|
37066
|
-
var
|
|
37067
|
-
|
|
37068
|
-
keyWords =
|
|
37069
|
-
setKeyWords =
|
|
37130
|
+
var _useState = (0,external_React_.useState)(props.defaultKeyWords),
|
|
37131
|
+
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
37132
|
+
keyWords = _useState2[0],
|
|
37133
|
+
setKeyWords = _useState2[1];
|
|
37070
37134
|
/** Key 是用来缓存请求的,如果不在是有问题 */
|
|
37071
|
-
var
|
|
37135
|
+
var _useState3 = (0,external_React_.useState)(function () {
|
|
37072
37136
|
if (props.proFieldKey) {
|
|
37073
37137
|
return props.proFieldKey.toString();
|
|
37074
37138
|
}
|
|
@@ -37077,8 +37141,8 @@ var useFieldFetchData = function useFieldFetchData(props) {
|
|
|
37077
37141
|
}
|
|
37078
37142
|
return 'no-fetch';
|
|
37079
37143
|
}),
|
|
37080
|
-
|
|
37081
|
-
cacheKey =
|
|
37144
|
+
_useState4 = slicedToArray_slicedToArray(_useState3, 1),
|
|
37145
|
+
cacheKey = _useState4[0];
|
|
37082
37146
|
var proFieldKeyRef = (0,external_React_.useRef)(cacheKey);
|
|
37083
37147
|
var getOptionsFormValueEnum = (0,external_React_.useCallback)(function (coverValueEnum) {
|
|
37084
37148
|
return proFieldParsingValueEnumToArray(ObjToMap(coverValueEnum)).map(function (_ref3) {
|
|
@@ -40518,10 +40582,10 @@ var Money_excluded = ["content", "numberFormatOptions", "numberPopoverRender", "
|
|
|
40518
40582
|
|
|
40519
40583
|
|
|
40520
40584
|
|
|
40521
|
-
|
|
40522
40585
|
// 兼容代码-----------
|
|
40523
40586
|
|
|
40524
40587
|
|
|
40588
|
+
//----------------------
|
|
40525
40589
|
|
|
40526
40590
|
var defaultMoneyIntl = new Intl.NumberFormat('zh-Hans-CN', {
|
|
40527
40591
|
currency: 'CNY',
|
|
@@ -40630,11 +40694,7 @@ var InputNumberPopover = /*#__PURE__*/external_React_default().forwardRef(functi
|
|
|
40630
40694
|
var dom = content === null || content === void 0 ? void 0 : content(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, rest), {}, {
|
|
40631
40695
|
value: value
|
|
40632
40696
|
}));
|
|
40633
|
-
var props =
|
|
40634
|
-
open: dom ? open : false
|
|
40635
|
-
} : {
|
|
40636
|
-
visible: dom ? open : false
|
|
40637
|
-
};
|
|
40697
|
+
var props = openVisibleCompatible(dom ? open : false);
|
|
40638
40698
|
return (0,jsx_runtime.jsx)(external_antd_.Popover, objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
40639
40699
|
placement: "topLeft"
|
|
40640
40700
|
}, props), {}, {
|
|
@@ -44972,28 +45032,17 @@ function DrawerForm(_ref) {
|
|
|
44972
45032
|
return _ref3.apply(this, arguments);
|
|
44973
45033
|
};
|
|
44974
45034
|
}());
|
|
44975
|
-
var drawerOpenProps =
|
|
44976
|
-
open: open,
|
|
44977
|
-
onOpenChange: onVisibleChange,
|
|
44978
|
-
afterOpenChange: function afterOpenChange(e) {
|
|
44979
|
-
var _drawerProps$afterOpe;
|
|
44980
|
-
if (!e) resetFields();
|
|
44981
|
-
drawerProps === null || drawerProps === void 0 ? void 0 : (_drawerProps$afterOpe = drawerProps.afterOpenChange) === null || _drawerProps$afterOpe === void 0 ? void 0 : _drawerProps$afterOpe.call(drawerProps, e);
|
|
44982
|
-
}
|
|
44983
|
-
} : {
|
|
44984
|
-
visible: open,
|
|
44985
|
-
onVisibleChange: onVisibleChange,
|
|
44986
|
-
afterVisibleChange: function afterVisibleChange(e) {
|
|
44987
|
-
var _drawerProps$afterOpe2;
|
|
44988
|
-
if (!e) resetFields();
|
|
44989
|
-
drawerProps === null || drawerProps === void 0 ? void 0 : (_drawerProps$afterOpe2 = drawerProps.afterOpenChange) === null || _drawerProps$afterOpe2 === void 0 ? void 0 : _drawerProps$afterOpe2.call(drawerProps, e);
|
|
44990
|
-
}
|
|
44991
|
-
};
|
|
45035
|
+
var drawerOpenProps = openVisibleCompatible(open, onVisibleChange);
|
|
44992
45036
|
return (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
44993
45037
|
children: [(0,jsx_runtime.jsx)(external_antd_.Drawer, objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
44994
45038
|
title: title,
|
|
44995
45039
|
width: width || 800
|
|
44996
45040
|
}, drawerProps), drawerOpenProps), {}, {
|
|
45041
|
+
afterOpenChange: function afterOpenChange(e) {
|
|
45042
|
+
var _drawerProps$afterOpe;
|
|
45043
|
+
if (!e) resetFields();
|
|
45044
|
+
drawerProps === null || drawerProps === void 0 ? void 0 : (_drawerProps$afterOpe = drawerProps.afterOpenChange) === null || _drawerProps$afterOpe === void 0 ? void 0 : _drawerProps$afterOpe.call(drawerProps, e);
|
|
45045
|
+
},
|
|
44997
45046
|
onClose: function onClose(e) {
|
|
44998
45047
|
var _drawerProps$onClose2;
|
|
44999
45048
|
// 提交表单loading时,阻止弹框关闭
|
|
@@ -45393,7 +45442,6 @@ var ModalForm_excluded = ["children", "trigger", "onVisibleChange", "onOpenChang
|
|
|
45393
45442
|
|
|
45394
45443
|
|
|
45395
45444
|
|
|
45396
|
-
|
|
45397
45445
|
function ModalForm(_ref) {
|
|
45398
45446
|
var _context$locale3, _context$locale3$Moda, _context$locale4, _context$locale4$Moda;
|
|
45399
45447
|
var children = _ref.children,
|
|
@@ -45545,11 +45593,7 @@ function ModalForm(_ref) {
|
|
|
45545
45593
|
return _ref5.apply(this, arguments);
|
|
45546
45594
|
};
|
|
45547
45595
|
}(), [onFinish, setOpen, submitTimeout]);
|
|
45548
|
-
var modalOpenProps =
|
|
45549
|
-
open: open
|
|
45550
|
-
} : {
|
|
45551
|
-
visible: open
|
|
45552
|
-
};
|
|
45596
|
+
var modalOpenProps = openVisibleCompatible(open);
|
|
45553
45597
|
return (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
45554
45598
|
children: [(0,jsx_runtime.jsx)(external_antd_.Modal, objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
45555
45599
|
title: title,
|
|
@@ -51732,7 +51776,6 @@ function PageHeader_style_useStyle(prefixCls) {
|
|
|
51732
51776
|
|
|
51733
51777
|
|
|
51734
51778
|
|
|
51735
|
-
|
|
51736
51779
|
var renderBack = function renderBack(prefixCls, hashId, backIcon, onBack) {
|
|
51737
51780
|
if (!backIcon || !onBack) {
|
|
51738
51781
|
return null;
|
|
@@ -51825,13 +51868,13 @@ var renderChildren = function renderChildren(prefixCls, children, hashId) {
|
|
|
51825
51868
|
};
|
|
51826
51869
|
var PageHeader = function PageHeader(props) {
|
|
51827
51870
|
var _breadcrumbRender, _classNames;
|
|
51828
|
-
var
|
|
51829
|
-
|
|
51830
|
-
compact =
|
|
51831
|
-
updateCompact =
|
|
51871
|
+
var _React$useState = external_React_.useState(false),
|
|
51872
|
+
_React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
|
|
51873
|
+
compact = _React$useState2[0],
|
|
51874
|
+
updateCompact = _React$useState2[1];
|
|
51832
51875
|
var onResize = function onResize(_ref) {
|
|
51833
51876
|
var width = _ref.width;
|
|
51834
|
-
updateCompact(width < 768
|
|
51877
|
+
updateCompact(width < 768);
|
|
51835
51878
|
};
|
|
51836
51879
|
var _React$useContext = external_React_.useContext(external_antd_.ConfigProvider.ConfigContext),
|
|
51837
51880
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -52104,8 +52147,8 @@ function PageContainer_style_useStyle(prefixCls, componentsToken) {
|
|
|
52104
52147
|
|
|
52105
52148
|
|
|
52106
52149
|
|
|
52107
|
-
var PageContainer_excluded = ["title", "content", "pageHeaderRender", "header", "prefixedClassName", "extraContent", "style", "prefixCls", "hashId", "value", "breadcrumbRender"],
|
|
52108
|
-
PageContainer_excluded2 = ["children", "loading", "className", "style", "footer", "affixProps", "token", "fixedHeader", "breadcrumbRender"];
|
|
52150
|
+
var PageContainer_excluded = ["title", "content", "pageHeaderRender", "header", "prefixedClassName", "extraContent", "childrenContentStyle", "style", "prefixCls", "hashId", "value", "breadcrumbRender"],
|
|
52151
|
+
PageContainer_excluded2 = ["children", "loading", "className", "style", "footer", "affixProps", "token", "fixedHeader", "breadcrumbRender", "childrenContentStyle"];
|
|
52109
52152
|
|
|
52110
52153
|
|
|
52111
52154
|
|
|
@@ -52213,6 +52256,7 @@ var memoRenderPageHeader = function memoRenderPageHeader(props) {
|
|
|
52213
52256
|
header = props.header,
|
|
52214
52257
|
prefixedClassName = props.prefixedClassName,
|
|
52215
52258
|
extraContent = props.extraContent,
|
|
52259
|
+
childrenContentStyle = props.childrenContentStyle,
|
|
52216
52260
|
style = props.style,
|
|
52217
52261
|
prefixCls = props.prefixCls,
|
|
52218
52262
|
hashId = props.hashId,
|
|
@@ -52273,6 +52317,7 @@ var PageContainerBase = function PageContainerBase(props) {
|
|
|
52273
52317
|
propsToken = props.token,
|
|
52274
52318
|
fixedHeader = props.fixedHeader,
|
|
52275
52319
|
breadcrumbRender = props.breadcrumbRender,
|
|
52320
|
+
childrenContentStyle = props.childrenContentStyle,
|
|
52276
52321
|
restProps = objectWithoutProperties_objectWithoutProperties(props, PageContainer_excluded2);
|
|
52277
52322
|
var value = (0,external_React_.useContext)(RouteContext);
|
|
52278
52323
|
/** 告诉 props 是否存在 footerBar */
|
|
@@ -52332,10 +52377,11 @@ var PageContainerBase = function PageContainerBase(props) {
|
|
|
52332
52377
|
return children ? (0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
52333
52378
|
children: (0,jsx_runtime.jsx)("div", {
|
|
52334
52379
|
className: classnames_default()("".concat(basePageContainer, "-children-content ").concat(hashId)),
|
|
52380
|
+
style: childrenContentStyle,
|
|
52335
52381
|
children: children
|
|
52336
52382
|
})
|
|
52337
52383
|
}) : null;
|
|
52338
|
-
}, [children, basePageContainer, hashId]);
|
|
52384
|
+
}, [children, basePageContainer, childrenContentStyle, hashId]);
|
|
52339
52385
|
var renderContentDom = (0,external_React_.useMemo)(function () {
|
|
52340
52386
|
// 只要loadingDom非空我们就渲染loadingDom,否则渲染内容
|
|
52341
52387
|
var dom = loadingDom || content;
|
|
@@ -53085,13 +53131,9 @@ var AppsLogoComponents = function AppsLogoComponents(props) {
|
|
|
53085
53131
|
});
|
|
53086
53132
|
}, [appList, baseClassName, hashId]);
|
|
53087
53133
|
if (!(props === null || props === void 0 ? void 0 : (_props$appList = props.appList) === null || _props$appList === void 0 ? void 0 : _props$appList.length)) return null;
|
|
53088
|
-
var popoverOpenProps =
|
|
53089
|
-
|
|
53090
|
-
}
|
|
53091
|
-
onVisibleChange: function onVisibleChange() {
|
|
53092
|
-
return setOpen;
|
|
53093
|
-
}
|
|
53094
|
-
};
|
|
53134
|
+
var popoverOpenProps = openVisibleCompatible(undefined, function (openChange) {
|
|
53135
|
+
return setOpen(openChange);
|
|
53136
|
+
});
|
|
53095
53137
|
return wrapSSR((0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
53096
53138
|
children: [(0,jsx_runtime.jsx)("div", {
|
|
53097
53139
|
ref: ref,
|
|
@@ -53412,13 +53454,15 @@ var MenuCounter = createContainer(useMenuCounter);
|
|
|
53412
53454
|
|
|
53413
53455
|
|
|
53414
53456
|
var genProLayoutBaseMenuStyle = function genProLayoutBaseMenuStyle(token) {
|
|
53415
|
-
var _token$layout, _token$layout$sider, _collapsed, _collapsed2, _$
|
|
53416
|
-
return defineProperty_defineProperty({}, "".concat(token.componentCls), (_$
|
|
53457
|
+
var _token$layout, _token$layout$sider, _collapsed, _collapsed2, _$concat3, _itemTitle, _$concat5;
|
|
53458
|
+
return defineProperty_defineProperty({}, "".concat(token.componentCls), (_$concat5 = {
|
|
53417
53459
|
background: 'transparent',
|
|
53418
53460
|
border: 'none'
|
|
53419
|
-
}, defineProperty_defineProperty(_$
|
|
53461
|
+
}, defineProperty_defineProperty(_$concat5, "".concat(token.componentCls, "-menu-item"), {
|
|
53420
53462
|
transition: 'none !important'
|
|
53421
|
-
}), defineProperty_defineProperty(_$
|
|
53463
|
+
}), defineProperty_defineProperty(_$concat5, "".concat(token.componentCls, "-submenu-has-icon"), defineProperty_defineProperty({}, "> ".concat(token.antCls, "-menu-sub"), {
|
|
53464
|
+
paddingInlineStart: 10
|
|
53465
|
+
})), defineProperty_defineProperty(_$concat5, "& &-collapsed", (_collapsed = {}, defineProperty_defineProperty(_collapsed, "".concat(token.antCls, "-menu-item, \n ").concat(token.antCls, "-menu-item-group > ").concat(token.antCls, "-menu-item-group-list > ").concat(token.antCls, "-menu-item, \n ").concat(token.antCls, "-menu-item-group > ").concat(token.antCls, "-menu-item-group-list > ").concat(token.antCls, "-menu-submenu > ").concat(token.antCls, "-menu-submenu-title, \n ").concat(token.antCls, "-menu-submenu > ").concat(token.antCls, "-menu-submenu-title"), {
|
|
53422
53466
|
paddingInline: '0 !important',
|
|
53423
53467
|
height: 'auto !important',
|
|
53424
53468
|
marginBlock: '8px !important'
|
|
@@ -53427,7 +53471,7 @@ var genProLayoutBaseMenuStyle = function genProLayoutBaseMenuStyle(token) {
|
|
|
53427
53471
|
borderRadius: token.radiusBase
|
|
53428
53472
|
}), defineProperty_defineProperty(_collapsed, "".concat(token.componentCls, "-group"), defineProperty_defineProperty({}, "".concat(token.antCls, "-menu-item-group-title"), {
|
|
53429
53473
|
paddingInline: 0
|
|
53430
|
-
})), _collapsed)), defineProperty_defineProperty(_$
|
|
53474
|
+
})), _collapsed)), defineProperty_defineProperty(_$concat5, "".concat(token.componentCls, "-item-icon"), {
|
|
53431
53475
|
height: '14px',
|
|
53432
53476
|
width: '14px',
|
|
53433
53477
|
opacity: '0.85',
|
|
@@ -53435,7 +53479,7 @@ var genProLayoutBaseMenuStyle = function genProLayoutBaseMenuStyle(token) {
|
|
|
53435
53479
|
lineHeight: '14px',
|
|
53436
53480
|
height: '14px'
|
|
53437
53481
|
}
|
|
53438
|
-
}), defineProperty_defineProperty(_$
|
|
53482
|
+
}), defineProperty_defineProperty(_$concat5, '& &-item-title', (_itemTitle = {
|
|
53439
53483
|
display: 'flex',
|
|
53440
53484
|
flexDirection: 'row',
|
|
53441
53485
|
alignItems: 'center',
|
|
@@ -53454,16 +53498,16 @@ var genProLayoutBaseMenuStyle = function genProLayoutBaseMenuStyle(token) {
|
|
|
53454
53498
|
}), defineProperty_defineProperty(_itemTitle, "&".concat(token.componentCls, "-item-collapsed-show-title"), defineProperty_defineProperty({
|
|
53455
53499
|
lineHeight: '16px',
|
|
53456
53500
|
height: '48px'
|
|
53457
|
-
}, "&".concat(token.componentCls, "-item-title-collapsed"), (_$
|
|
53501
|
+
}, "&".concat(token.componentCls, "-item-title-collapsed"), (_$concat3 = {
|
|
53458
53502
|
display: 'flex'
|
|
53459
|
-
}, defineProperty_defineProperty(_$
|
|
53503
|
+
}, defineProperty_defineProperty(_$concat3, "".concat(token.componentCls, "-item-icon"), {
|
|
53460
53504
|
height: '16px',
|
|
53461
53505
|
lineHeight: '16px !important',
|
|
53462
53506
|
'.anticon': {
|
|
53463
53507
|
lineHeight: '16px',
|
|
53464
53508
|
height: '16px'
|
|
53465
53509
|
}
|
|
53466
|
-
}), defineProperty_defineProperty(_$
|
|
53510
|
+
}), defineProperty_defineProperty(_$concat3, "".concat(token.componentCls, "-item-text"), {
|
|
53467
53511
|
opacity: '1 !important',
|
|
53468
53512
|
display: 'inline !important',
|
|
53469
53513
|
textAlign: 'center',
|
|
@@ -53477,17 +53521,17 @@ var genProLayoutBaseMenuStyle = function genProLayoutBaseMenuStyle(token) {
|
|
|
53477
53521
|
margin: 0,
|
|
53478
53522
|
padding: 0,
|
|
53479
53523
|
marginBlockStart: 4
|
|
53480
|
-
}), _$
|
|
53524
|
+
}), _$concat3))), _itemTitle)), defineProperty_defineProperty(_$concat5, '&-group', defineProperty_defineProperty({}, "".concat(token.antCls, "-menu-item-group-title"), {
|
|
53481
53525
|
fontSize: 12,
|
|
53482
53526
|
color: token.colorTextLabel,
|
|
53483
53527
|
'.anticon': {
|
|
53484
53528
|
marginInlineEnd: 8
|
|
53485
53529
|
}
|
|
53486
|
-
})), defineProperty_defineProperty(_$
|
|
53530
|
+
})), defineProperty_defineProperty(_$concat5, '&-group-divider', {
|
|
53487
53531
|
color: token.colorTextSecondary,
|
|
53488
53532
|
fontSize: 12,
|
|
53489
53533
|
lineHeight: 20
|
|
53490
|
-
}), _$
|
|
53534
|
+
}), _$concat5));
|
|
53491
53535
|
};
|
|
53492
53536
|
function menu_useStyle(prefixCls) {
|
|
53493
53537
|
return useStyle('ProLayoutBaseMenu', function (token) {
|
|
@@ -53580,7 +53624,7 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(props) {
|
|
|
53580
53624
|
var children = (item === null || item === void 0 ? void 0 : item.children) || (item === null || item === void 0 ? void 0 : item.routes);
|
|
53581
53625
|
var menuType = isGroup && level === 0 ? 'group' : undefined;
|
|
53582
53626
|
if (Array.isArray(children) && children.length > 0) {
|
|
53583
|
-
var _this$props2, _this$props3, _classNames, _this$props4, _this$props5, _designToken$layout, _designToken$layout$s;
|
|
53627
|
+
var _this$props2, _this$props3, _classNames, _this$props4, _this$props5, _classNames3, _designToken$layout, _designToken$layout$s;
|
|
53584
53628
|
/** Menu 第一级可以有icon,或者 isGroup 时第二级别也要有 */
|
|
53585
53629
|
var shouldHasIcon = level === 0 || isGroup && level === 1;
|
|
53586
53630
|
// get defaultTitle by menuItemRender
|
|
@@ -53615,7 +53659,7 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(props) {
|
|
|
53615
53659
|
label: title,
|
|
53616
53660
|
onClick: isGroup ? undefined : item.onTitleClick,
|
|
53617
53661
|
children: childrenList,
|
|
53618
|
-
className: menuType
|
|
53662
|
+
className: classnames_default()((_classNames3 = {}, defineProperty_defineProperty(_classNames3, "".concat(baseClassName, "-group"), menuType === 'group'), defineProperty_defineProperty(_classNames3, "".concat(baseClassName, "-submenu"), menuType !== 'group'), defineProperty_defineProperty(_classNames3, "".concat(baseClassName, "-submenu-has-icon"), menuType !== 'group' && shouldHasIcon && iconDom), _classNames3))
|
|
53619
53663
|
}, isGroup && level === 0 ? {
|
|
53620
53664
|
type: 'divider',
|
|
53621
53665
|
prefixCls: prefixCls,
|
|
@@ -53654,7 +53698,7 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(props) {
|
|
|
53654
53698
|
return name;
|
|
53655
53699
|
};
|
|
53656
53700
|
this.getMenuItemPath = function (item, level) {
|
|
53657
|
-
var _this$props9, _this$props10,
|
|
53701
|
+
var _this$props9, _this$props10, _classNames4, _this$props11, _this$props12;
|
|
53658
53702
|
var itemPath = _this.conversionPath(item.path || '/');
|
|
53659
53703
|
var _this$props7 = _this.props,
|
|
53660
53704
|
_this$props7$location = _this$props7.location,
|
|
@@ -53677,7 +53721,7 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(props) {
|
|
|
53677
53721
|
var icon = !hasIcon ? null : getIcon(item.icon, iconPrefixes, "".concat(baseClassName, "-icon ").concat((_this$props9 = _this.props) === null || _this$props9 === void 0 ? void 0 : _this$props9.hashId));
|
|
53678
53722
|
var defaultIcon = collapsed && hasIcon ? getMenuTitleSymbol(name) : null;
|
|
53679
53723
|
var defaultItem = (0,jsx_runtime.jsxs)("div", {
|
|
53680
|
-
className: classnames_default()("".concat(baseClassName, "-item-title"), (_this$props10 = _this.props) === null || _this$props10 === void 0 ? void 0 : _this$props10.hashId, (
|
|
53724
|
+
className: classnames_default()("".concat(baseClassName, "-item-title"), (_this$props10 = _this.props) === null || _this$props10 === void 0 ? void 0 : _this$props10.hashId, (_classNames4 = {}, defineProperty_defineProperty(_classNames4, "".concat(baseClassName, "-item-title-collapsed"), collapsed), defineProperty_defineProperty(_classNames4, "".concat(baseClassName, "-item-collapsed-show-title"), (menu === null || menu === void 0 ? void 0 : menu.collapsedShowTitle) && collapsed), _classNames4)),
|
|
53681
53725
|
children: [icon ? (0,jsx_runtime.jsx)("span", {
|
|
53682
53726
|
className: "anticon ".concat(baseClassName, "-item-icon ").concat((_this$props11 = _this.props) === null || _this$props11 === void 0 ? void 0 : _this$props11.hashId),
|
|
53683
53727
|
children: icon
|
|
@@ -53689,14 +53733,14 @@ var MenuUtil = /*#__PURE__*/_createClass(function MenuUtil(props) {
|
|
|
53689
53733
|
var isHttpUrl = isUrl(itemPath);
|
|
53690
53734
|
// Is it a http link
|
|
53691
53735
|
if (isHttpUrl) {
|
|
53692
|
-
var _this$props13,
|
|
53736
|
+
var _this$props13, _classNames6, _this$props14, _this$props15;
|
|
53693
53737
|
defaultItem = (0,jsx_runtime.jsxs)("span", {
|
|
53694
53738
|
title: name,
|
|
53695
53739
|
onClick: function onClick() {
|
|
53696
53740
|
var _window, _window$open;
|
|
53697
53741
|
(_window = window) === null || _window === void 0 ? void 0 : (_window$open = _window.open) === null || _window$open === void 0 ? void 0 : _window$open.call(_window, itemPath, '_blank');
|
|
53698
53742
|
},
|
|
53699
|
-
className: classnames_default()("".concat(baseClassName, "-item-title"), (_this$props13 = _this.props) === null || _this$props13 === void 0 ? void 0 : _this$props13.hashId, (
|
|
53743
|
+
className: classnames_default()("".concat(baseClassName, "-item-title"), (_this$props13 = _this.props) === null || _this$props13 === void 0 ? void 0 : _this$props13.hashId, (_classNames6 = {}, defineProperty_defineProperty(_classNames6, "".concat(baseClassName, "-item-title-collapsed"), collapsed), defineProperty_defineProperty(_classNames6, "".concat(baseClassName, "-item-link"), true), defineProperty_defineProperty(_classNames6, "".concat(baseClassName, "-item-collapsed-show-title"), (menu === null || menu === void 0 ? void 0 : menu.collapsedShowTitle) && collapsed), _classNames6)),
|
|
53700
53744
|
children: [icon ? (0,jsx_runtime.jsx)("span", {
|
|
53701
53745
|
className: "anticon ".concat(baseClassName, "-item-icon ").concat((_this$props14 = _this.props) === null || _this$props14 === void 0 ? void 0 : _this$props14.hashId),
|
|
53702
53746
|
children: icon
|
|
@@ -53746,7 +53790,7 @@ var getOpenKeysProps = function getOpenKeysProps(openKeys, _ref) {
|
|
|
53746
53790
|
return openKeysProps;
|
|
53747
53791
|
};
|
|
53748
53792
|
var BaseMenu = function BaseMenu(props) {
|
|
53749
|
-
var
|
|
53793
|
+
var _classNames8;
|
|
53750
53794
|
var mode = props.mode,
|
|
53751
53795
|
className = props.className,
|
|
53752
53796
|
handleOpenChange = props.handleOpenChange,
|
|
@@ -53887,7 +53931,7 @@ var BaseMenu = function BaseMenu(props) {
|
|
|
53887
53931
|
backgroundColor: 'transparent',
|
|
53888
53932
|
border: 'none'
|
|
53889
53933
|
}, style),
|
|
53890
|
-
className: classnames_default()(className, hashId, baseClassName, (
|
|
53934
|
+
className: classnames_default()(className, hashId, baseClassName, (_classNames8 = {}, defineProperty_defineProperty(_classNames8, "".concat(baseClassName, "-horizontal"), mode === 'horizontal'), defineProperty_defineProperty(_classNames8, "".concat(baseClassName, "-collapsed"), props.collapsed), _classNames8)),
|
|
53891
53935
|
items: menuUtils.getNavMenuItems(finallyData, 0),
|
|
53892
53936
|
onOpenChange: setOpenKeys
|
|
53893
53937
|
}, props.menuProps)));
|
|
@@ -56153,17 +56197,7 @@ var SettingDrawer = function SettingDrawer(props) {
|
|
|
56153
56197
|
var _useStyle = SettingDrawer_style_useStyle(baseClassName),
|
|
56154
56198
|
wrapSSR = _useStyle.wrapSSR,
|
|
56155
56199
|
hashId = _useStyle.hashId;
|
|
56156
|
-
var drawerOpenProps =
|
|
56157
|
-
open: open,
|
|
56158
|
-
onClose: function onClose() {
|
|
56159
|
-
return setOpen(false);
|
|
56160
|
-
}
|
|
56161
|
-
} : {
|
|
56162
|
-
visible: open,
|
|
56163
|
-
onClose: function onClose() {
|
|
56164
|
-
return setOpen(false);
|
|
56165
|
-
}
|
|
56166
|
-
};
|
|
56200
|
+
var drawerOpenProps = openVisibleCompatible(open);
|
|
56167
56201
|
return wrapSSR((0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
56168
56202
|
children: [(0,jsx_runtime.jsx)("div", {
|
|
56169
56203
|
className: "".concat(baseClassName, "-handle ").concat(hashId),
|
|
@@ -56187,6 +56221,9 @@ var SettingDrawer = function SettingDrawer(props) {
|
|
|
56187
56221
|
})
|
|
56188
56222
|
}), (0,jsx_runtime.jsx)(external_antd_.Drawer, objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, drawerOpenProps), {}, {
|
|
56189
56223
|
width: 300,
|
|
56224
|
+
onClose: function onClose() {
|
|
56225
|
+
return setOpen(false);
|
|
56226
|
+
},
|
|
56190
56227
|
closable: false,
|
|
56191
56228
|
placement: "right",
|
|
56192
56229
|
getContainer: getContainer,
|
|
@@ -58417,17 +58454,9 @@ var SiderMenuWrapper = function SiderMenuWrapper(props) {
|
|
|
58417
58454
|
if (hide) {
|
|
58418
58455
|
return null;
|
|
58419
58456
|
}
|
|
58420
|
-
var drawerOpenProps =
|
|
58421
|
-
|
|
58422
|
-
|
|
58423
|
-
return onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(true);
|
|
58424
|
-
}
|
|
58425
|
-
} : {
|
|
58426
|
-
visible: !collapsed,
|
|
58427
|
-
onClose: function onClose() {
|
|
58428
|
-
return onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(true);
|
|
58429
|
-
}
|
|
58430
|
-
};
|
|
58457
|
+
var drawerOpenProps = openVisibleCompatible(!collapsed, function () {
|
|
58458
|
+
return onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(true);
|
|
58459
|
+
});
|
|
58431
58460
|
return wrapSSR(isMobile ? (0,jsx_runtime.jsx)(external_antd_.Drawer, objectSpread2_objectSpread2(objectSpread2_objectSpread2({
|
|
58432
58461
|
placement: "left",
|
|
58433
58462
|
className: classnames_default()("".concat(prefixCls, "-drawer-sider"), className)
|
|
@@ -69914,7 +69943,7 @@ function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
|
|
|
69914
69943
|
* Developer should confirm it's safe to ignore themselves.
|
|
69915
69944
|
*/
|
|
69916
69945
|
|
|
69917
|
-
function
|
|
69946
|
+
function useSafeState(defaultValue) {
|
|
69918
69947
|
var destroyRef = external_React_.useRef(false);
|
|
69919
69948
|
var _React$useState = external_React_.useState(defaultValue),
|
|
69920
69949
|
_React$useState2 = slicedToArray_slicedToArray(_React$useState, 2),
|
|
@@ -69962,7 +69991,7 @@ function useMergedState_useMergedState(defaultStateValue, option) {
|
|
|
69962
69991
|
onChange = _ref.onChange,
|
|
69963
69992
|
postState = _ref.postState; // ======================= Init =======================
|
|
69964
69993
|
|
|
69965
|
-
var _useState =
|
|
69994
|
+
var _useState = useSafeState(function () {
|
|
69966
69995
|
var finalValue = undefined;
|
|
69967
69996
|
var source;
|
|
69968
69997
|
if (hasValue(value)) {
|
|
@@ -71768,7 +71797,7 @@ function isActive(step) {
|
|
|
71768
71797
|
return step === STEP_ACTIVE || step === STEP_ACTIVATED;
|
|
71769
71798
|
}
|
|
71770
71799
|
/* harmony default export */ var useStepQueue = (function (status, callback) {
|
|
71771
|
-
var _useState =
|
|
71800
|
+
var _useState = useSafeState(STEP_NONE),
|
|
71772
71801
|
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
71773
71802
|
step = _useState2[0],
|
|
71774
71803
|
setStep = _useState2[1];
|
|
@@ -71887,15 +71916,15 @@ function useStatus(supportMotion, visible, getElement, _ref) {
|
|
|
71887
71916
|
onVisibleChanged = _ref.onVisibleChanged;
|
|
71888
71917
|
|
|
71889
71918
|
// Used for outer render usage to avoid `visible: false & status: none` to render nothing
|
|
71890
|
-
var _useState =
|
|
71919
|
+
var _useState = useSafeState(),
|
|
71891
71920
|
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
71892
71921
|
asyncVisible = _useState2[0],
|
|
71893
71922
|
setAsyncVisible = _useState2[1];
|
|
71894
|
-
var _useState3 =
|
|
71923
|
+
var _useState3 = useSafeState(STATUS_NONE),
|
|
71895
71924
|
_useState4 = slicedToArray_slicedToArray(_useState3, 2),
|
|
71896
71925
|
status = _useState4[0],
|
|
71897
71926
|
setStatus = _useState4[1];
|
|
71898
|
-
var _useState5 =
|
|
71927
|
+
var _useState5 = useSafeState(null),
|
|
71899
71928
|
_useState6 = slicedToArray_slicedToArray(_useState5, 2),
|
|
71900
71929
|
style = _useState6[0],
|
|
71901
71930
|
setStyle = _useState6[1];
|
|
@@ -73921,7 +73950,7 @@ RcAlign.displayName = 'Align';
|
|
|
73921
73950
|
|
|
73922
73951
|
var StatusQueue = ['measure', 'alignPre', 'align', null, 'motion'];
|
|
73923
73952
|
/* harmony default export */ var useVisibleStatus = (function (visible, doMeasure) {
|
|
73924
|
-
var _useState =
|
|
73953
|
+
var _useState = useSafeState(null),
|
|
73925
73954
|
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
73926
73955
|
status = _useState2[0],
|
|
73927
73956
|
setInternalStatus = _useState2[1];
|
|
@@ -78982,7 +79011,7 @@ Item.displayName = 'Item';
|
|
|
78982
79011
|
*/
|
|
78983
79012
|
|
|
78984
79013
|
function useBatchFrameState() {
|
|
78985
|
-
var _useState =
|
|
79014
|
+
var _useState = useSafeState({}),
|
|
78986
79015
|
_useState2 = slicedToArray_slicedToArray(_useState, 2),
|
|
78987
79016
|
forceUpdate = _useState2[1];
|
|
78988
79017
|
var statesRef = (0,external_React_.useRef)([]);
|
|
@@ -85272,17 +85301,17 @@ function BaseProList(props) {
|
|
|
85272
85301
|
/* harmony default export */ var list_es = ((/* unused pure expression or super */ null && (ProList)));
|
|
85273
85302
|
;// CONCATENATED MODULE: ./packages/components/src/version.ts
|
|
85274
85303
|
var version_version = {
|
|
85275
|
-
"@ant-design/pro-card": "2.0.
|
|
85276
|
-
"@ant-design/pro-components": "2.3.
|
|
85277
|
-
"@ant-design/pro-descriptions": "2.0.
|
|
85278
|
-
"@ant-design/pro-field": "2.1.
|
|
85279
|
-
"@ant-design/pro-form": "2.2.
|
|
85280
|
-
"@ant-design/pro-layout": "7.1.
|
|
85281
|
-
"@ant-design/pro-list": "2.0.
|
|
85282
|
-
"@ant-design/pro-provider": "2.0.
|
|
85304
|
+
"@ant-design/pro-card": "2.0.21",
|
|
85305
|
+
"@ant-design/pro-components": "2.3.27",
|
|
85306
|
+
"@ant-design/pro-descriptions": "2.0.23",
|
|
85307
|
+
"@ant-design/pro-field": "2.1.16",
|
|
85308
|
+
"@ant-design/pro-form": "2.2.14",
|
|
85309
|
+
"@ant-design/pro-layout": "7.1.15",
|
|
85310
|
+
"@ant-design/pro-list": "2.0.24",
|
|
85311
|
+
"@ant-design/pro-provider": "2.0.13",
|
|
85283
85312
|
"@ant-design/pro-skeleton": "2.0.4",
|
|
85284
|
-
"@ant-design/pro-table": "3.1.
|
|
85285
|
-
"@ant-design/pro-utils": "2.2.
|
|
85313
|
+
"@ant-design/pro-table": "3.1.1",
|
|
85314
|
+
"@ant-design/pro-utils": "2.2.13"
|
|
85286
85315
|
};
|
|
85287
85316
|
;// CONCATENATED MODULE: ./packages/components/src/index.tsx
|
|
85288
85317
|
|