@zat-design/sisyphus-react 3.1.4 → 3.1.5-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dumi/theme/builtins/Alert.tsx +19 -0
- package/.dumi/theme/builtins/Previewer.tsx +232 -0
- package/.dumi/theme/builtins/SourceCode.tsx +64 -0
- package/.dumi/theme/hooks/useCodeSandbox.tsx +197 -0
- package/.dumi/theme/hooks/useTheme.tsx +707 -0
- package/.dumi/theme/layouts/BasicLayout.tsx +88 -0
- package/.dumi/theme/layouts/components/Dark.less +157 -0
- package/.dumi/theme/layouts/components/Dark.tsx +78 -0
- package/.dumi/theme/layouts/components/Navbar.tsx +83 -0
- package/.dumi/theme/layouts/components/SideMenu.tsx +61 -0
- package/.dumi/theme/layouts/index.tsx +26 -0
- package/.dumi/theme/layouts/layout.less +87 -0
- package/.dumi/theme/typings.d.ts +7 -0
- package/dist/index.esm.css +122 -249
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +18 -2
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.js +11 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +81 -61
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/RenderFields.js +10 -5
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +5 -0
- package/es/ProForm/style/index.less +55 -169
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -2
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +3 -2
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +6 -1
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +69 -0
- package/es/locale/en_US.js +68 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.js +21 -0
- package/es/locale/zh_CN.d.ts +69 -0
- package/es/locale/zh_CN.js +68 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -1
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +17 -2
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.js +11 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/base/RangePicker/index.js +0 -3
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +76 -58
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +75 -13
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +1 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/render/RenderFields.js +9 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +5 -0
- package/lib/ProForm/style/index.less +55 -169
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +2 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/index.js +3 -2
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +23 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +6 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +69 -0
- package/lib/locale/en_US.js +74 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +28 -0
- package/lib/locale/zh_CN.d.ts +69 -0
- package/lib/locale/zh_CN.js +74 -0
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -1
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +2 -2
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -23,7 +23,7 @@ var _index = require("../../../../index");
|
|
|
23
23
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
24
24
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
25
25
|
var _useRequestList2 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
26
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "otherProps", "searchForm"],
|
|
26
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "otherProps", "searchForm", "defaultOne"],
|
|
27
27
|
_excluded2 = ["onOk"],
|
|
28
28
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
29
29
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -49,6 +49,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
49
49
|
isTooltip = props.isTooltip,
|
|
50
50
|
otherProps = props.otherProps,
|
|
51
51
|
searchForm = props.searchForm,
|
|
52
|
+
defaultOne = props.defaultOne,
|
|
52
53
|
restInputProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
53
54
|
var contentForm = _antd.Form.useFormInstance();
|
|
54
55
|
if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
|
|
@@ -126,7 +127,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
126
127
|
transformResponse: transformResponse
|
|
127
128
|
}, (0, _objectSpread2.default)({
|
|
128
129
|
manual: true,
|
|
129
|
-
ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible
|
|
130
|
+
ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible || defaultOne
|
|
130
131
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
|
131
132
|
data = _useRequestList.data,
|
|
132
133
|
loading = _useRequestList.loading,
|
|
@@ -411,14 +412,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
411
412
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
412
413
|
var getInitValues = /*#__PURE__*/function () {
|
|
413
414
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
414
|
-
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
|
|
415
|
+
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
|
|
415
416
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
416
417
|
while (1) switch (_context4.prev = _context4.next) {
|
|
417
418
|
case 0:
|
|
418
419
|
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
419
|
-
useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm.getFieldsValue());
|
|
420
|
+
useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
|
420
421
|
}
|
|
421
|
-
if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams)) {
|
|
422
|
+
if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
|
|
422
423
|
_context4.next = 13;
|
|
423
424
|
break;
|
|
424
425
|
}
|
|
@@ -432,7 +433,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
432
433
|
});
|
|
433
434
|
return _context4.abrupt("return");
|
|
434
435
|
case 5:
|
|
435
|
-
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams);
|
|
436
|
+
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || {});
|
|
436
437
|
page = (0, _objectSpread2.default)({
|
|
437
438
|
pageNum: 1,
|
|
438
439
|
pageSize: 10
|
|
@@ -454,6 +455,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
454
455
|
}
|
|
455
456
|
_data2 = isMultiple ? list : (_list = list) === null || _list === void 0 ? void 0 : _list[0];
|
|
456
457
|
nextSelectRowKeys = isMultiple ? value : [value];
|
|
458
|
+
console.log('data', _data2);
|
|
457
459
|
if (labelInValue) {
|
|
458
460
|
onChange(_data2);
|
|
459
461
|
}
|
|
@@ -475,6 +477,62 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
475
477
|
return _ref9.apply(this, arguments);
|
|
476
478
|
};
|
|
477
479
|
}();
|
|
480
|
+
// 初始化回显,当传入initParams时,前端用来回险
|
|
481
|
+
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
482
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
483
|
+
var _useRequest$options4, _useRequest$options5;
|
|
484
|
+
var queryBean, page, params, res, _list2, list, _res$data2, _data3, nextSelectRowKeys;
|
|
485
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
486
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
487
|
+
case 0:
|
|
488
|
+
queryBean = (0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options4 = useRequest.options) === null || _useRequest$options4 === void 0 ? void 0 : _useRequest$options4.defaultParams);
|
|
489
|
+
page = (0, _objectSpread2.default)({
|
|
490
|
+
pageNum: 1,
|
|
491
|
+
pageSize: 10
|
|
492
|
+
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
|
493
|
+
params = withPagination ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, page), {}, {
|
|
494
|
+
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
|
495
|
+
}) : queryBean;
|
|
496
|
+
params = transformParams ? transformParams(params) : params;
|
|
497
|
+
_context5.next = 6;
|
|
498
|
+
return runAsync(params);
|
|
499
|
+
case 6:
|
|
500
|
+
res = _context5.sent;
|
|
501
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
502
|
+
list = [];
|
|
503
|
+
if (transformResponse) {
|
|
504
|
+
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
|
505
|
+
} else {
|
|
506
|
+
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
|
507
|
+
}
|
|
508
|
+
_data3 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
|
|
509
|
+
nextSelectRowKeys = isMultiple ? value : [value];
|
|
510
|
+
console.log('data', _data3);
|
|
511
|
+
if (labelInValue) {
|
|
512
|
+
onChange(_data3);
|
|
513
|
+
} else {
|
|
514
|
+
onChange(isMultiple ? _data3.map(function (item) {
|
|
515
|
+
return item[valueKey];
|
|
516
|
+
}) : _data3[valueKey]);
|
|
517
|
+
}
|
|
518
|
+
// 更新内部展示值
|
|
519
|
+
setState({
|
|
520
|
+
_value: _data3,
|
|
521
|
+
isInit: false,
|
|
522
|
+
selectedRows: list,
|
|
523
|
+
selectedRowKeys: nextSelectRowKeys
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
case 8:
|
|
527
|
+
case "end":
|
|
528
|
+
return _context5.stop();
|
|
529
|
+
}
|
|
530
|
+
}, _callee5);
|
|
531
|
+
}));
|
|
532
|
+
return function getDefaultOneValues() {
|
|
533
|
+
return _ref10.apply(this, arguments);
|
|
534
|
+
};
|
|
535
|
+
}();
|
|
478
536
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
479
537
|
return {
|
|
480
538
|
handleClick: handleClick,
|
|
@@ -506,8 +564,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
506
564
|
});
|
|
507
565
|
(0, _react.useEffect)(function () {
|
|
508
566
|
if (onOff && !visible) {
|
|
509
|
-
var _useRequest$
|
|
510
|
-
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
|
567
|
+
var _useRequest$options6;
|
|
568
|
+
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
511
569
|
onReset();
|
|
512
570
|
}
|
|
513
571
|
var nextState = {
|
|
@@ -539,11 +597,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
539
597
|
}, [value, visible, isInit]);
|
|
540
598
|
(0, _react.useEffect)(function () {
|
|
541
599
|
if (!value) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
600
|
+
if (defaultOne) {
|
|
601
|
+
getDefaultOneValues();
|
|
602
|
+
} else {
|
|
603
|
+
setState({
|
|
604
|
+
_value: undefined,
|
|
605
|
+
selectedRowKeys: [],
|
|
606
|
+
selectedRows: []
|
|
607
|
+
});
|
|
608
|
+
}
|
|
547
609
|
}
|
|
548
610
|
if (labelInValue && _value && !(0, _lodash.isEqual)(value, _value)) {
|
|
549
611
|
setState({
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
> span {
|
|
24
24
|
position: relative;
|
|
25
|
-
font-size: var(--zaui-font-size
|
|
25
|
+
font-size: var(--zaui-font-size, 14px);
|
|
26
26
|
border: none;
|
|
27
27
|
border-radius: 50%;
|
|
28
28
|
}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
&:hover {
|
|
58
58
|
.ant-input,
|
|
59
59
|
.ant-input-group-addon {
|
|
60
|
-
border-color:
|
|
60
|
+
border-color: @zaui-form-control-line;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.ant-input-group-addon {
|
|
76
|
-
padding: 0px var(--zaui-space-size-
|
|
76
|
+
padding: 0px var(--zaui-space-size-sm, 8px);
|
|
77
77
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
78
78
|
cursor: pointer;
|
|
79
79
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RangePickerProps } from 'antd/es/date-picker';
|
|
3
3
|
import { Moment } from 'moment';
|
|
4
|
-
export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator'> & {
|
|
4
|
+
export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'separator' | 'mode'> & {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
foreverText?: string;
|
|
7
7
|
foreverDate?: string;
|
|
@@ -2,10 +2,11 @@ import { DatePickerProps } from 'antd';
|
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ProFormOtherProps } from '../../../propsType';
|
|
5
|
+
import { Props as ProRangeLimitProps } from '../ProRangeLimit';
|
|
5
6
|
export type DateType = DatePickerProps['value'];
|
|
6
|
-
export
|
|
7
|
+
export type ProTimeLimitProps = DistributiveOmit<DatePickerProps, 'value' | 'onChange' | 'mode'> & {
|
|
7
8
|
value?: string;
|
|
8
|
-
onChange?: (value:
|
|
9
|
+
onChange?: (value: ProTimeLimitProps['value'] | null, valueData: Moment) => void;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
foreverTime?: string;
|
|
11
12
|
foreverText?: string;
|
|
@@ -13,7 +14,11 @@ export interface Props<ValueType extends DateType | string | null = DateType> ex
|
|
|
13
14
|
format?: string;
|
|
14
15
|
valueType?: 'moment' | 'format' | 'ISO';
|
|
15
16
|
otherProps?: ProFormOtherProps;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare const
|
|
17
|
+
mode?: 'DatePicker';
|
|
18
|
+
};
|
|
19
|
+
export declare const ProTimeLimit: React.FC<ProTimeLimitProps>;
|
|
20
|
+
export type ProLimitProps = ProTimeLimitProps | (ProRangeLimitProps & {
|
|
21
|
+
mode: 'RangePicker';
|
|
22
|
+
});
|
|
23
|
+
declare const LimitPick: React.FC<ProLimitProps>;
|
|
19
24
|
export default LimitPick;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.ant-form-item-has-error {
|
|
2
2
|
.ant-picker-status-error
|
|
3
3
|
~ .forever-checkbox:not(.ant-input-disabled):not(.ant-input-borderless).ant-input {
|
|
4
|
-
background:
|
|
4
|
+
background: @zaui-base-bg;
|
|
5
5
|
border-color: var(--ant-error-color);
|
|
6
6
|
}
|
|
7
7
|
.forever-checkbox:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.pro-enum-select {
|
|
2
2
|
.close-icon {
|
|
3
3
|
position : relative;
|
|
4
|
-
margin-left : -
|
|
4
|
+
margin-left : calc(0px - @zaui-space-size-lg);
|
|
5
5
|
margin-right : var(--zaui-space-size-md, 14px);
|
|
6
6
|
color : #FFFFFF;
|
|
7
7
|
height: 12px;
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
> span {
|
|
18
18
|
position : relative;
|
|
19
|
-
font-size : 8px;
|
|
20
19
|
border : none;
|
|
21
20
|
border-radius : 50%;
|
|
22
21
|
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
.ant-table-thead>tr>th {
|
|
46
45
|
border : 0;
|
|
47
46
|
white-space : nowrap;
|
|
48
|
-
background-color:
|
|
47
|
+
background-color: @zaui-table-header-bg;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
.ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
|
|
@@ -69,7 +68,7 @@
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
.ant-table-tbody tr:nth-child(2n)>td {
|
|
72
|
-
background-color:
|
|
71
|
+
background-color: @zaui-table-strip-bg;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
.ant-table-tbody>.ant-table-placeholder>td {
|
|
@@ -81,7 +80,7 @@
|
|
|
81
80
|
>tr:hover:not(.ant-table-expanded-row, .ant-table-placeholder)>td,
|
|
82
81
|
.ant-table-row-hover,
|
|
83
82
|
.ant-table-row-hover>td {
|
|
84
|
-
background:
|
|
83
|
+
background: @zaui-table-hover-bg;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
|
|
@@ -89,13 +88,13 @@
|
|
|
89
88
|
|
|
90
89
|
.ant-table-row-hover,
|
|
91
90
|
.ant-table-row-hover>td {
|
|
92
|
-
background:
|
|
91
|
+
background: @zaui-table-hover-bg;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
.ant-table-fixed-header {
|
|
97
96
|
.ant-table-tbody tr:nth-child(n)>td {
|
|
98
|
-
background-color:
|
|
97
|
+
background-color: @zaui-table-strip-bg;
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
.ant-table-tbody tr:nth-child(2n)>td {
|
|
@@ -108,7 +107,7 @@
|
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
.ant-modal-footer {
|
|
111
|
-
padding:
|
|
110
|
+
padding: @zaui-space-size-md;
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
}
|
|
@@ -140,11 +140,9 @@ var RenderFields = function RenderFields(props) {
|
|
|
140
140
|
var _fieldProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
141
141
|
disabled: disabled
|
|
142
142
|
}, formItemChildProps), fieldProps);
|
|
143
|
-
if (formDisabled) {
|
|
143
|
+
if ((0, _lodash.isBoolean)(formDisabled)) {
|
|
144
144
|
_fieldProps.disabled = formDisabled;
|
|
145
|
-
// _disabled = formDisabled;
|
|
146
145
|
}
|
|
147
|
-
|
|
148
146
|
var componentProps = (0, _objectSpread2.default)({
|
|
149
147
|
disabled: _disabled,
|
|
150
148
|
placeholder: _placeholder,
|
|
@@ -154,6 +152,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
154
152
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
155
153
|
_formItemProps.valuePropName = 'checked';
|
|
156
154
|
}
|
|
155
|
+
// 时间范围placeholder处理
|
|
156
|
+
if (['RangePicker'].includes(_type) && !(fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.placeholder)) {
|
|
157
|
+
delete componentProps.placeholder;
|
|
158
|
+
}
|
|
157
159
|
// 没有找到对应组件 不渲染
|
|
158
160
|
if (!TargetComponent) {
|
|
159
161
|
return [];
|
|
@@ -180,11 +182,14 @@ var RenderFields = function RenderFields(props) {
|
|
|
180
182
|
}, 200);
|
|
181
183
|
return null;
|
|
182
184
|
}
|
|
185
|
+
console.log('====================================');
|
|
186
|
+
console.log('formDisabled', Boolean(formDisabled), props, columns);
|
|
187
|
+
console.log('====================================');
|
|
183
188
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
184
189
|
value: otherProps,
|
|
185
190
|
children: (0, _jsxRuntime.jsx)(_Render.default, {
|
|
186
191
|
show: show,
|
|
187
|
-
disabled: formDisabled,
|
|
192
|
+
disabled: Boolean(formDisabled),
|
|
188
193
|
form: form,
|
|
189
194
|
type: _type,
|
|
190
195
|
originComponent: component,
|
|
@@ -21,7 +21,8 @@ import { AddressProps } from '../combination/ProAddressBar/propsType';
|
|
|
21
21
|
import { ProCombinationProps } from '../combination/ProCombination/propsType';
|
|
22
22
|
import { ProModalSelectPropsType as ProModalSelectProps } from '../combination/ProModalSelect/propsType';
|
|
23
23
|
import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
|
|
24
|
-
import {
|
|
24
|
+
import { ProLimitProps } from '../combination/ProTimeLimit';
|
|
25
|
+
import { Props as ProRangeLimitProps } from '../combination/ProRangeLimit';
|
|
25
26
|
import { CheckboxPropsMap, ProEnum, PropProSelectsMap, PropRadioPropsMap } from '../../../ProEnum/propsType';
|
|
26
27
|
import { PropSelectProps as ProSelectProps } from '../../../ProSelect/propsType';
|
|
27
28
|
import { ProEditTableProps } from '../../../ProEditTable/propsType';
|
|
@@ -57,7 +58,7 @@ type FunctionArgs<Values> = (value: any, record: any, { form, index, namePath, o
|
|
|
57
58
|
namePath?: NamePath;
|
|
58
59
|
[key: string]: any;
|
|
59
60
|
}) => any;
|
|
60
|
-
type TransformToFormField<T extends ControlProps, Values> =
|
|
61
|
+
type TransformToFormField<T extends ControlProps, Values> = DistributiveOmit<T, 'onChange' | 'value'> & {
|
|
61
62
|
value?: T['value'];
|
|
62
63
|
onChange?: (value: Parameters<T['onChange']>[0], options: Parameters<T['onChange']>[1], form: FormInstance<Values>) => void;
|
|
63
64
|
onFieldChange?: FunctionArgs<Values>;
|
|
@@ -135,10 +136,10 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
135
136
|
fieldProps?: FieldProps<ProNumberRangeProps, Values, T>;
|
|
136
137
|
} | {
|
|
137
138
|
type?: 'ProRangeLimit';
|
|
138
|
-
fieldProps?: FieldProps<
|
|
139
|
+
fieldProps?: FieldProps<ProRangeLimitProps, Values, T>;
|
|
139
140
|
} | {
|
|
140
141
|
type?: 'ProTimeLimit';
|
|
141
|
-
fieldProps?: FieldProps<
|
|
142
|
+
fieldProps?: FieldProps<ProLimitProps, Values, T>;
|
|
142
143
|
} | {
|
|
143
144
|
type?: 'ProEnum';
|
|
144
145
|
fieldProps?: ProEnumFieldProps<Values, T>;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -26,6 +26,7 @@ var _useForm3 = require("./utils/useForm");
|
|
|
26
26
|
var _useFieldProps = require("./utils/useFieldProps");
|
|
27
27
|
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "originalValues", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required"];
|
|
28
28
|
var ProForm = function ProForm(props, ref) {
|
|
29
|
+
var _localStorage;
|
|
29
30
|
var _props$mode = props.mode,
|
|
30
31
|
mode = _props$mode === void 0 ? 'search' : _props$mode,
|
|
31
32
|
span = props.span,
|
|
@@ -180,6 +181,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
180
181
|
})
|
|
181
182
|
})) : null;
|
|
182
183
|
};
|
|
184
|
+
// 国际化,非中文时默认上下布局
|
|
185
|
+
if (((_localStorage = localStorage) === null || _localStorage === void 0 ? void 0 : _localStorage.locale) && localStorage.locale !== 'zh-CN') {
|
|
186
|
+
otherProps.layout = otherProps.layout || 'vertical';
|
|
187
|
+
}
|
|
183
188
|
return (0, _jsxRuntime.jsx)(_antd.Form, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
184
189
|
onKeyPress: function onKeyPress(event) {
|
|
185
190
|
if (!submitOnEnter) return;
|