@ant-design/pro-components 3.0.1-0 → 3.1.0-0
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/pro-components.min.js +1 -1
- package/es/card/ProCard.js +4 -2
- package/es/card/components/Actions/style.d.ts +1 -1
- package/es/card/components/Card/index.js +8 -4
- package/es/card/components/Card/style.d.ts +1 -1
- package/es/card/components/CheckCard/index.d.ts +6 -0
- package/es/card/components/CheckCard/index.js +2 -1
- package/es/card/components/CheckCard/style.d.ts +1 -1
- package/es/card/components/Divider/style.d.ts +1 -1
- package/es/card/components/Loading/style.d.ts +1 -1
- package/es/card/components/Operation/style.d.ts +1 -1
- package/es/card/components/Statistic/style.d.ts +1 -1
- package/es/card/components/Statistic/style.js +2 -6
- package/es/card/components/StatisticCard/index.js +4 -2
- package/es/card/components/StatisticCard/style.d.ts +1 -1
- package/es/card/typing.d.ts +5 -0
- package/es/descriptions/index.js +2 -1
- package/es/field/ValueTypeToComponent.js +4 -4
- package/es/field/components/Cascader/index.d.ts +0 -1
- package/es/field/components/Checkbox/index.d.ts +0 -1
- package/es/field/components/ColorPicker/index.d.ts +1 -1
- package/es/field/components/Percent/util.d.ts +1 -1
- package/es/field/components/Radio/index.d.ts +0 -1
- package/es/field/components/Segmented/index.d.ts +0 -1
- package/es/field/components/Select/LightSelect/index.js +1 -2
- package/es/field/components/Select/SearchSelect/index.d.ts +6 -1
- package/es/field/components/Select/SearchSelect/index.js +101 -15
- package/es/field/components/Select/index.d.ts +0 -3
- package/es/field/components/Select/index.js +5 -3
- package/es/field/components/TreeSelect/index.d.ts +0 -1
- package/es/form/BaseForm/BaseForm.d.ts +3 -0
- package/es/form/BaseForm/BaseForm.js +9 -2
- package/es/form/BaseForm/LightWrapper/style.d.ts +1 -1
- package/es/form/components/Captcha/index.d.ts +8 -2
- package/es/form/components/Captcha/index.js +9 -1
- package/es/form/components/DatePicker/BaseDatePicker.js +20 -12
- package/es/form/components/DateRangePicker/BaseDateRanger.js +38 -13
- package/es/form/components/FormItem/Group/index.js +1 -1
- package/es/form/components/FormItem/Group/style.d.ts +1 -1
- package/es/form/components/List/index.d.ts +1 -1
- package/es/form/components/List/style.d.ts +1 -1
- package/es/form/components/SchemaForm/index.js +1 -2
- package/es/form/components/Text/index.js +4 -2
- package/es/form/components/UploadButton/index.d.ts +1 -1
- package/es/form/components/UploadButton/index.js +3 -3
- package/es/form/index.d.ts +1 -0
- package/es/form/layouts/DrawerForm/index.d.ts +1 -1
- package/es/form/layouts/DrawerForm/index.js +3 -2
- package/es/form/layouts/DrawerForm/style.d.ts +1 -1
- package/es/form/layouts/LightFilter/style.d.ts +1 -1
- package/es/form/layouts/LoginForm/index.d.ts +1 -1
- package/es/form/layouts/LoginForm/style.d.ts +1 -1
- package/es/form/layouts/LoginFormPage/index.d.ts +1 -1
- package/es/form/layouts/LoginFormPage/style.d.ts +1 -1
- package/es/form/layouts/ModalForm/index.js +2 -1
- package/es/form/layouts/ProForm/index.d.ts +1 -1
- package/es/form/layouts/QueryFilter/index.d.ts +2 -1
- package/es/form/layouts/QueryFilter/style.d.ts +1 -1
- package/es/form/layouts/StepsForm/index.js +15 -2
- package/es/form/layouts/StepsForm/style.d.ts +1 -1
- package/es/layout/components/AppsLogoComponents/index.js +3 -1
- package/es/layout/components/AppsLogoComponents/style/index.d.ts +1 -1
- package/es/layout/components/CollapsedIcon/style.d.ts +1 -1
- package/es/layout/components/FooterToolbar/style/index.d.ts +1 -1
- package/es/layout/components/FooterToolbar/style/stylish.d.ts +1 -1
- package/es/layout/components/GlobalFooter/index.d.ts +1 -1
- package/es/layout/components/GlobalFooter/style.d.ts +1 -1
- package/es/layout/components/GlobalHeader/rightContentStyle.d.ts +1 -1
- package/es/layout/components/GlobalHeader/style.d.ts +1 -1
- package/es/layout/components/GridContent/style.d.ts +1 -1
- package/es/layout/components/Header/style/header.d.ts +1 -1
- package/es/layout/components/Header/style/stylish.d.ts +1 -1
- package/es/layout/components/Help/ProHelpDrawer.d.ts +1 -1
- package/es/layout/components/Help/ProHelpDrawer.js +3 -1
- package/es/layout/components/Help/ProHelpPopover.js +1 -1
- package/es/layout/components/Help/style.d.ts +1 -1
- package/es/layout/components/PageContainer/style/index.d.ts +1 -1
- package/es/layout/components/PageContainer/style/stylish.d.ts +1 -1
- package/es/layout/components/PageHeader/style/index.d.ts +1 -1
- package/es/layout/components/SettingDrawer/index.js +2 -2
- package/es/layout/components/SettingDrawer/style/index.d.ts +1 -1
- package/es/layout/components/SiderMenu/BaseMenu.d.ts +1 -1
- package/es/layout/components/SiderMenu/BaseMenu.js +3 -3
- package/es/layout/components/SiderMenu/SiderMenu.js +8 -8
- package/es/layout/components/SiderMenu/index.js +11 -6
- package/es/layout/components/SiderMenu/style/index.d.ts +1 -1
- package/es/layout/components/SiderMenu/style/menu.d.ts +1 -1
- package/es/layout/components/SiderMenu/style/stylish.d.ts +1 -1
- package/es/layout/components/TopNavHeader/style.d.ts +1 -1
- package/es/layout/defaultSettings.d.ts +6 -0
- package/es/layout/style/index.d.ts +1 -1
- package/es/list/style/index.d.ts +1 -1
- package/es/provider/index.d.ts +1 -0
- package/es/provider/index.js +11 -6
- package/es/provider/useStyle/index.d.ts +2 -1
- package/es/provider/useStyle/index.js +20 -12
- package/es/table/Table.js +412 -280
- package/es/table/components/Alert/index.d.ts +1 -1
- package/es/table/components/Alert/style.d.ts +1 -1
- package/es/table/components/ColumnSetting/index.d.ts +1 -1
- package/es/table/components/ColumnSetting/index.js +15 -3
- package/es/table/components/ColumnSetting/style.d.ts +1 -1
- package/es/table/components/DragSortTable/index.d.ts +1 -1
- package/es/table/components/DragSortTable/style.d.ts +1 -1
- package/es/table/components/EditableTable/index.js +530 -197
- package/es/table/components/ListToolBar/style.d.ts +1 -1
- package/es/table/style/index.d.ts +1 -1
- package/es/table/typing.d.ts +37 -12
- package/es/table/useFetchData.js +8 -13
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +5 -17
- package/es/table/utils/index.d.ts +60 -5
- package/es/table/utils/index.js +157 -18
- package/es/utils/components/DropdownFooter/style.d.ts +1 -1
- package/es/utils/components/FieldLabel/style.d.ts +1 -1
- package/es/utils/components/FilterDropdown/index.js +1 -1
- package/es/utils/components/FilterDropdown/style.d.ts +1 -1
- package/es/utils/components/InlineErrorFormItem/style.d.ts +1 -1
- package/es/utils/components/LabelIconTip/style.d.ts +1 -1
- package/es/utils/conversionMomentValue/index.js +14 -2
- package/es/utils/proFieldParsingText/index.js +1 -1
- package/es/utils/typing.d.ts +1 -1
- package/es/utils/useEditableArray/index.d.ts +3 -6
- package/es/utils/useEditableArray/index.js +562 -318
- package/es/utils/useEditableMap/index.js +82 -25
- package/es/utils/useMediaQuery/query.js +11 -5
- package/lib/card/ProCard.js +4 -2
- package/lib/card/components/Actions/style.d.ts +1 -1
- package/lib/card/components/Card/index.js +8 -4
- package/lib/card/components/Card/style.d.ts +1 -1
- package/lib/card/components/CheckCard/index.d.ts +6 -0
- package/lib/card/components/CheckCard/index.js +2 -1
- package/lib/card/components/CheckCard/style.d.ts +1 -1
- package/lib/card/components/Divider/style.d.ts +1 -1
- package/lib/card/components/Loading/style.d.ts +1 -1
- package/lib/card/components/Operation/style.d.ts +1 -1
- package/lib/card/components/Statistic/style.d.ts +1 -1
- package/lib/card/components/Statistic/style.js +2 -6
- package/lib/card/components/StatisticCard/index.js +4 -2
- package/lib/card/components/StatisticCard/style.d.ts +1 -1
- package/lib/card/typing.d.ts +5 -0
- package/lib/descriptions/index.js +2 -1
- package/lib/field/ValueTypeToComponent.js +4 -4
- package/lib/field/components/Cascader/index.d.ts +0 -1
- package/lib/field/components/Checkbox/index.d.ts +0 -1
- package/lib/field/components/ColorPicker/index.d.ts +1 -1
- package/lib/field/components/Percent/util.d.ts +1 -1
- package/lib/field/components/Radio/index.d.ts +0 -1
- package/lib/field/components/Segmented/index.d.ts +0 -1
- package/lib/field/components/Select/LightSelect/index.js +1 -2
- package/lib/field/components/Select/SearchSelect/index.d.ts +6 -1
- package/lib/field/components/Select/SearchSelect/index.js +101 -15
- package/lib/field/components/Select/index.d.ts +0 -3
- package/lib/field/components/Select/index.js +5 -3
- package/lib/field/components/TreeSelect/index.d.ts +0 -1
- package/lib/form/BaseForm/BaseForm.d.ts +3 -0
- package/lib/form/BaseForm/BaseForm.js +9 -2
- package/lib/form/BaseForm/LightWrapper/style.d.ts +1 -1
- package/lib/form/components/Captcha/index.d.ts +8 -2
- package/lib/form/components/Captcha/index.js +9 -1
- package/lib/form/components/DatePicker/BaseDatePicker.js +19 -11
- package/lib/form/components/DateRangePicker/BaseDateRanger.js +37 -12
- package/lib/form/components/Digit/DigitRange.d.ts +1 -1
- package/lib/form/components/FormItem/Group/index.js +1 -1
- package/lib/form/components/FormItem/Group/style.d.ts +1 -1
- package/lib/form/components/List/index.d.ts +1 -1
- package/lib/form/components/List/style.d.ts +1 -1
- package/lib/form/components/SchemaForm/index.js +1 -2
- package/lib/form/components/Text/index.js +4 -2
- package/lib/form/components/UploadButton/index.d.ts +1 -1
- package/lib/form/components/UploadButton/index.js +3 -3
- package/lib/form/index.d.ts +1 -0
- package/lib/form/layouts/DrawerForm/index.d.ts +1 -1
- package/lib/form/layouts/DrawerForm/index.js +3 -2
- package/lib/form/layouts/DrawerForm/style.d.ts +1 -1
- package/lib/form/layouts/LightFilter/style.d.ts +1 -1
- package/lib/form/layouts/LoginForm/index.d.ts +1 -1
- package/lib/form/layouts/LoginForm/style.d.ts +1 -1
- package/lib/form/layouts/LoginFormPage/index.d.ts +1 -1
- package/lib/form/layouts/LoginFormPage/style.d.ts +1 -1
- package/lib/form/layouts/ModalForm/index.js +2 -1
- package/lib/form/layouts/ProForm/index.d.ts +2 -2
- package/lib/form/layouts/QueryFilter/index.d.ts +2 -1
- package/lib/form/layouts/QueryFilter/style.d.ts +1 -1
- package/lib/form/layouts/StepsForm/index.js +15 -2
- package/lib/form/layouts/StepsForm/style.d.ts +1 -1
- package/lib/layout/components/AppsLogoComponents/index.js +3 -1
- package/lib/layout/components/AppsLogoComponents/style/index.d.ts +1 -1
- package/lib/layout/components/CollapsedIcon/style.d.ts +1 -1
- package/lib/layout/components/FooterToolbar/style/index.d.ts +1 -1
- package/lib/layout/components/FooterToolbar/style/stylish.d.ts +1 -1
- package/lib/layout/components/GlobalFooter/index.d.ts +1 -1
- package/lib/layout/components/GlobalFooter/style.d.ts +1 -1
- package/lib/layout/components/GlobalHeader/rightContentStyle.d.ts +1 -1
- package/lib/layout/components/GlobalHeader/style.d.ts +1 -1
- package/lib/layout/components/GridContent/style.d.ts +1 -1
- package/lib/layout/components/Header/style/header.d.ts +1 -1
- package/lib/layout/components/Header/style/stylish.d.ts +1 -1
- package/lib/layout/components/Help/ProHelpDrawer.d.ts +1 -1
- package/lib/layout/components/Help/ProHelpDrawer.js +3 -1
- package/lib/layout/components/Help/ProHelpPopover.js +1 -1
- package/lib/layout/components/Help/style.d.ts +1 -1
- package/lib/layout/components/PageContainer/style/index.d.ts +1 -1
- package/lib/layout/components/PageContainer/style/stylish.d.ts +1 -1
- package/lib/layout/components/PageHeader/style/index.d.ts +1 -1
- package/lib/layout/components/SettingDrawer/index.js +2 -2
- package/lib/layout/components/SettingDrawer/style/index.d.ts +1 -1
- package/lib/layout/components/SiderMenu/BaseMenu.d.ts +1 -1
- package/lib/layout/components/SiderMenu/BaseMenu.js +3 -3
- package/lib/layout/components/SiderMenu/SiderMenu.js +8 -8
- package/lib/layout/components/SiderMenu/index.js +11 -6
- package/lib/layout/components/SiderMenu/style/index.d.ts +1 -1
- package/lib/layout/components/SiderMenu/style/menu.d.ts +1 -1
- package/lib/layout/components/SiderMenu/style/stylish.d.ts +1 -1
- package/lib/layout/components/TopNavHeader/style.d.ts +1 -1
- package/lib/layout/defaultSettings.d.ts +6 -0
- package/lib/layout/style/index.d.ts +1 -1
- package/lib/list/style/index.d.ts +1 -1
- package/lib/provider/index.d.ts +1 -0
- package/lib/provider/index.js +11 -6
- package/lib/provider/useStyle/index.d.ts +2 -1
- package/lib/provider/useStyle/index.js +20 -12
- package/lib/table/Table.js +422 -290
- package/lib/table/components/Alert/index.d.ts +1 -1
- package/lib/table/components/Alert/style.d.ts +1 -1
- package/lib/table/components/ColumnSetting/index.d.ts +1 -1
- package/lib/table/components/ColumnSetting/index.js +15 -3
- package/lib/table/components/ColumnSetting/style.d.ts +1 -1
- package/lib/table/components/DragSortTable/index.d.ts +1 -1
- package/lib/table/components/DragSortTable/style.d.ts +1 -1
- package/lib/table/components/EditableTable/index.js +529 -196
- package/lib/table/components/ListToolBar/style.d.ts +1 -1
- package/lib/table/style/index.d.ts +1 -1
- package/lib/table/typing.d.ts +37 -12
- package/lib/table/useFetchData.js +8 -13
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +4 -16
- package/lib/table/utils/index.d.ts +60 -5
- package/lib/table/utils/index.js +159 -20
- package/lib/utils/components/DropdownFooter/style.d.ts +1 -1
- package/lib/utils/components/FieldLabel/style.d.ts +1 -1
- package/lib/utils/components/FilterDropdown/index.js +1 -1
- package/lib/utils/components/FilterDropdown/style.d.ts +1 -1
- package/lib/utils/components/InlineErrorFormItem/style.d.ts +1 -1
- package/lib/utils/components/LabelIconTip/style.d.ts +1 -1
- package/lib/utils/conversionMomentValue/index.js +14 -2
- package/lib/utils/proFieldParsingText/index.js +1 -1
- package/lib/utils/typing.d.ts +1 -1
- package/lib/utils/useEditableArray/index.d.ts +3 -6
- package/lib/utils/useEditableArray/index.js +568 -324
- package/lib/utils/useEditableMap/index.js +82 -25
- package/lib/utils/useMediaQuery/query.js +10 -4
- package/package.json +45 -45
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
6
|
/* eslint-disable react-hooks/exhaustive-deps */import { get, useMergedState } from '@rc-component/util';
|
|
6
7
|
import { message } from 'antd';
|
|
7
8
|
import { useCallback, useMemo, useRef } from 'react';
|
|
9
|
+
import { useRefFunction } from '..';
|
|
8
10
|
import { useIntl } from "../../provider";
|
|
9
11
|
import { defaultActionRender, recordKeyToString } from "../useEditableArray";
|
|
10
12
|
|
|
@@ -52,48 +54,94 @@ export function useEditableMap(props) {
|
|
|
52
54
|
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
53
55
|
editableKeys = _useMergedState2[0],
|
|
54
56
|
setEditableRowKeys = _useMergedState2[1];
|
|
57
|
+
|
|
55
58
|
/** 一个用来标志的set 提供了方便的 api 来去重什么的 */
|
|
56
59
|
var editableKeysSet = useMemo(function () {
|
|
57
|
-
var keys = editableType === 'single' ? editableKeys === null || editableKeys === void 0 ? void 0 : editableKeys.slice(0, 1) : editableKeys;
|
|
58
|
-
return new Set(keys)
|
|
59
|
-
|
|
60
|
+
var keys = editableType === 'single' ? (editableKeys === null || editableKeys === void 0 ? void 0 : editableKeys.slice(0, 1)) || [] : editableKeys || [];
|
|
61
|
+
return new Set(keys.map(function (key) {
|
|
62
|
+
return String(key);
|
|
63
|
+
}));
|
|
64
|
+
}, [editableKeys, editableType]);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 检查 key 是否在编辑列表中
|
|
68
|
+
* 使用 editableKeysSet 进行快速查找,性能更好
|
|
69
|
+
*/
|
|
70
|
+
var checkKeyInEditableList = useRefFunction(function (recordKey) {
|
|
71
|
+
var keyStr = String(recordKeyToString(recordKey));
|
|
72
|
+
return editableKeysSet.has(keyStr);
|
|
73
|
+
});
|
|
60
74
|
|
|
61
75
|
/** 这行是不是编辑状态 */
|
|
62
76
|
var isEditable = useCallback(function (recordKey) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
return checkKeyInEditableList(recordKey);
|
|
78
|
+
}, [checkKeyInEditableList]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 验证是否可以开始编辑
|
|
82
|
+
*/
|
|
83
|
+
var validateCanStartEdit = useRefFunction(function () {
|
|
84
|
+
// 如果是单行模式,检查是否已有编辑中的行
|
|
85
|
+
if (editableType === 'single' && editableKeys && editableKeys.length > 0) {
|
|
86
|
+
warning(props.onlyOneLineEditorAlertMessage || intl.getMessage('editableTable.onlyOneLineEditor', '只能同时编辑一行'));
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
});
|
|
66
91
|
|
|
67
92
|
/**
|
|
68
93
|
* 进入编辑状态
|
|
69
94
|
*
|
|
70
95
|
* @param recordKey
|
|
96
|
+
* @param recordValue
|
|
71
97
|
*/
|
|
72
|
-
var startEditable = function
|
|
98
|
+
var startEditable = useRefFunction(function (recordKey, recordValue) {
|
|
73
99
|
var _ref2;
|
|
74
|
-
//
|
|
75
|
-
if (
|
|
76
|
-
warning(props.onlyOneLineEditorAlertMessage || intl.getMessage('editableTable.onlyOneLineEditor', '只能同时编辑一行'));
|
|
100
|
+
// 验证是否可以开始编辑
|
|
101
|
+
if (!validateCanStartEdit()) {
|
|
77
102
|
return false;
|
|
78
103
|
}
|
|
104
|
+
var keyStr = String(recordKeyToString(recordKey));
|
|
105
|
+
|
|
106
|
+
// 检查是否已经在编辑列表中,避免重复添加
|
|
107
|
+
if (checkKeyInEditableList(recordKey)) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// 保存编辑前的数据
|
|
79
112
|
preEditRowRef.current = (_ref2 = recordValue !== null && recordValue !== void 0 ? recordValue : get(props.dataSource, Array.isArray(recordKey) ? recordKey : [recordKey])) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
80
|
-
|
|
81
|
-
|
|
113
|
+
|
|
114
|
+
// 更新编辑 keys(不直接修改 editableKeysSet)
|
|
115
|
+
var newKeys = editableType === 'single' ? [keyStr] : [].concat(_toConsumableArray(editableKeys || []), [keyStr]);
|
|
116
|
+
setEditableRowKeys(newKeys);
|
|
82
117
|
return true;
|
|
83
|
-
};
|
|
118
|
+
});
|
|
84
119
|
|
|
85
120
|
/**
|
|
86
121
|
* 退出编辑状态
|
|
87
122
|
*
|
|
88
123
|
* @param recordKey
|
|
89
124
|
*/
|
|
90
|
-
var cancelEditable = function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
125
|
+
var cancelEditable = useRefFunction(function (recordKey) {
|
|
126
|
+
var keyStr = String(recordKeyToString(recordKey));
|
|
127
|
+
|
|
128
|
+
// 检查是否在编辑列表中
|
|
129
|
+
if (!checkKeyInEditableList(recordKey)) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 更新编辑 keys(不直接修改 editableKeysSet)
|
|
134
|
+
var newKeys = (editableKeys || []).filter(function (key) {
|
|
135
|
+
return String(key) !== keyStr;
|
|
136
|
+
});
|
|
137
|
+
setEditableRowKeys(newKeys);
|
|
94
138
|
return true;
|
|
95
|
-
};
|
|
96
|
-
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 取消编辑的回调
|
|
143
|
+
*/
|
|
144
|
+
var onCancel = useRefFunction( /*#__PURE__*/function () {
|
|
97
145
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(recordKey, editRow, originRow, newLine) {
|
|
98
146
|
var _props$onCancel;
|
|
99
147
|
var success;
|
|
@@ -117,11 +165,15 @@ export function useEditableMap(props) {
|
|
|
117
165
|
}
|
|
118
166
|
}, _callee);
|
|
119
167
|
}));
|
|
120
|
-
return function
|
|
168
|
+
return function (_x, _x2, _x3, _x4) {
|
|
121
169
|
return _ref3.apply(this, arguments);
|
|
122
170
|
};
|
|
123
|
-
}();
|
|
124
|
-
|
|
171
|
+
}());
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 保存编辑的回调
|
|
175
|
+
*/
|
|
176
|
+
var onSave = useRefFunction( /*#__PURE__*/function () {
|
|
125
177
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(recordKey, editRow, originRow) {
|
|
126
178
|
var _props$onSave;
|
|
127
179
|
var success, actionProps;
|
|
@@ -141,6 +193,7 @@ export function useEditableMap(props) {
|
|
|
141
193
|
_context2.next = 7;
|
|
142
194
|
return cancelEditable(recordKey);
|
|
143
195
|
case 7:
|
|
196
|
+
// 更新数据源
|
|
144
197
|
actionProps = {
|
|
145
198
|
data: props.dataSource,
|
|
146
199
|
row: editRow,
|
|
@@ -155,13 +208,17 @@ export function useEditableMap(props) {
|
|
|
155
208
|
}
|
|
156
209
|
}, _callee2);
|
|
157
210
|
}));
|
|
158
|
-
return function
|
|
211
|
+
return function (_x5, _x6, _x7) {
|
|
159
212
|
return _ref4.apply(this, arguments);
|
|
160
213
|
};
|
|
161
|
-
}();
|
|
214
|
+
}());
|
|
162
215
|
var saveText = intl.getMessage('editableTable.action.save', '保存');
|
|
163
216
|
var deleteText = intl.getMessage('editableTable.action.delete', '删除');
|
|
164
217
|
var cancelText = intl.getMessage('editableTable.action.cancel', '取消');
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* 渲染操作按钮
|
|
221
|
+
*/
|
|
165
222
|
var actionRender = useCallback(function (key, config) {
|
|
166
223
|
var renderConfig = _objectSpread({
|
|
167
224
|
recordKey: key,
|
|
@@ -186,7 +243,7 @@ export function useEditableMap(props) {
|
|
|
186
243
|
});
|
|
187
244
|
}
|
|
188
245
|
return [renderResult.save, renderResult.delete, renderResult.cancel];
|
|
189
|
-
}, [editableKeys
|
|
246
|
+
}, [editableKeys, props.dataSource, cancelEditable, onCancel, onSave]);
|
|
190
247
|
return {
|
|
191
248
|
editableKeys: editableKeys,
|
|
192
249
|
setEditableRowKeys: setEditableRowKeys,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import { useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
3
3
|
export default function useMediaQuery(mediaQuery) {
|
|
4
4
|
var isSsr = typeof window === 'undefined';
|
|
5
5
|
var _useState = useState(function () {
|
|
@@ -8,7 +8,12 @@ export default function useMediaQuery(mediaQuery) {
|
|
|
8
8
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9
9
|
matches = _useState2[0],
|
|
10
10
|
setMatches = _useState2[1];
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// 在 SSR 环境中使用 useEffect,在客户端使用 useLayoutEffect
|
|
13
|
+
// 这样可以避免 SSR 警告,同时在客户端保持同步更新
|
|
14
|
+
// 使用条件表达式确保 hooks 调用顺序一致
|
|
15
|
+
var EffectHook = isSsr ? useEffect : useLayoutEffect;
|
|
16
|
+
EffectHook(function () {
|
|
12
17
|
if (isSsr) {
|
|
13
18
|
return;
|
|
14
19
|
}
|
|
@@ -16,10 +21,11 @@ export default function useMediaQuery(mediaQuery) {
|
|
|
16
21
|
var listener = function listener(e) {
|
|
17
22
|
return setMatches(e.matches);
|
|
18
23
|
};
|
|
19
|
-
|
|
24
|
+
// 使用最新的 addEventListener API
|
|
25
|
+
mediaQueryList.addEventListener('change', listener);
|
|
20
26
|
return function () {
|
|
21
|
-
return mediaQueryList.
|
|
27
|
+
return mediaQueryList.removeEventListener('change', listener);
|
|
22
28
|
};
|
|
23
|
-
}, [mediaQuery]);
|
|
29
|
+
}, [mediaQuery, isSsr]);
|
|
24
30
|
return matches;
|
|
25
31
|
}
|
package/lib/card/ProCard.js
CHANGED
|
@@ -11,8 +11,10 @@ var _Divider = _interopRequireDefault(require("./components/Divider"));
|
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
12
|
var Group = function Group(props) {
|
|
13
13
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, (0, _objectSpread2.default)({
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
styles: {
|
|
15
|
+
body: {
|
|
16
|
+
padding: 0
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}, props));
|
|
18
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export default function useStyle(prefixCls?: string): {
|
|
3
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
3
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
4
4
|
hashId: string;
|
|
5
5
|
};
|
|
@@ -22,13 +22,14 @@ var _Actions = _interopRequireDefault(require("../Actions"));
|
|
|
22
22
|
var _Loading = _interopRequireDefault(require("../Loading"));
|
|
23
23
|
var _style = _interopRequireDefault(require("./style"));
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
var _excluded = ["className", "style", "bodyStyle", "headStyle", "title", "subTitle", "extra", "wrap", "layout", "loading", "gutter", "tooltip", "split", "headerBordered", "variant", "boxShadow", "children", "size", "actions", "ghost", "hoverable", "direction", "collapsed", "collapsible", "collapsibleIconRender", "colStyle", "defaultCollapsed", "onCollapse", "checked", "onChecked", "tabs", "type"];
|
|
25
|
+
var _excluded = ["className", "style", "bodyStyle", "headStyle", "styles", "title", "subTitle", "extra", "wrap", "layout", "loading", "gutter", "tooltip", "split", "headerBordered", "variant", "boxShadow", "children", "size", "actions", "ghost", "hoverable", "direction", "collapsed", "collapsible", "collapsibleIconRender", "colStyle", "defaultCollapsed", "onCollapse", "checked", "onChecked", "tabs", "type"];
|
|
26
26
|
var Card = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
27
27
|
var _classNames2;
|
|
28
28
|
var className = props.className,
|
|
29
29
|
style = props.style,
|
|
30
30
|
bodyStyle = props.bodyStyle,
|
|
31
31
|
headStyle = props.headStyle,
|
|
32
|
+
styles = props.styles,
|
|
32
33
|
title = props.title,
|
|
33
34
|
subTitle = props.subTitle,
|
|
34
35
|
extra = props.extra,
|
|
@@ -189,10 +190,13 @@ var Card = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
189
190
|
});
|
|
190
191
|
var cardCls = (0, _classnames.default)("".concat(prefixCls), className, hashId, (_classNames2 = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-border"), variant === 'outlined'), "".concat(prefixCls, "-box-shadow"), boxShadow), "".concat(prefixCls, "-contain-card"), containProCard), "".concat(prefixCls, "-loading"), loading), "".concat(prefixCls, "-split"), split === 'vertical' || split === 'horizontal'), "".concat(prefixCls, "-ghost"), ghost), "".concat(prefixCls, "-hoverable"), hoverable), "".concat(prefixCls, "-size-").concat(size), size), "".concat(prefixCls, "-type-").concat(type), type), "".concat(prefixCls, "-collapse"), collapsed), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-checked"), checked)));
|
|
191
192
|
var bodyCls = (0, _classnames.default)("".concat(prefixCls, "-body"), hashId, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-body-center"), layout === 'center'), "".concat(prefixCls, "-body-direction-column"), split === 'horizontal' || direction === 'column'), "".concat(prefixCls, "-body-wrap"), wrap && containProCard));
|
|
192
|
-
|
|
193
|
+
|
|
194
|
+
// 支持新的 styles API,同时保持向后兼容
|
|
195
|
+
var cardBodyStyle = (styles === null || styles === void 0 ? void 0 : styles.body) || bodyStyle;
|
|
196
|
+
var cardHeadStyle = (styles === null || styles === void 0 ? void 0 : styles.header) || headStyle;
|
|
193
197
|
var loadingDOM = /*#__PURE__*/_react.default.isValidElement(loading) ? loading : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {
|
|
194
198
|
prefix: prefixCls,
|
|
195
|
-
style: (
|
|
199
|
+
style: (cardBodyStyle === null || cardBodyStyle === void 0 ? void 0 : cardBodyStyle.padding) === 0 || (cardBodyStyle === null || cardBodyStyle === void 0 ? void 0 : cardBodyStyle.padding) === '0px' ? {
|
|
196
200
|
padding: 24
|
|
197
201
|
} : undefined
|
|
198
202
|
});
|
|
@@ -218,7 +222,7 @@ var Card = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
218
222
|
}, (0, _util.omit)(rest, ['prefixCls', 'colSpan'])), {}, {
|
|
219
223
|
children: [(title || extra || collapsibleButton) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
220
224
|
className: (0, _classnames.default)("".concat(prefixCls, "-header"), hashId, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-header-border"), headerBordered || type === 'inner'), "".concat(prefixCls, "-header-collapsible"), collapsibleButton)),
|
|
221
|
-
style:
|
|
225
|
+
style: cardHeadStyle,
|
|
222
226
|
onClick: function onClick() {
|
|
223
227
|
if (collapsible === 'header' || collapsible === true) setCollapsed(!collapsed);
|
|
224
228
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export default function useStyle(prefixCls: string): {
|
|
3
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
3
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
4
4
|
hashId: string;
|
|
5
5
|
};
|
|
@@ -140,6 +140,12 @@ interface CheckCardProps {
|
|
|
140
140
|
* Custom style for the content area.
|
|
141
141
|
*/
|
|
142
142
|
bodyStyle?: React.CSSProperties;
|
|
143
|
+
/**
|
|
144
|
+
* Styles configuration.
|
|
145
|
+
*/
|
|
146
|
+
styles?: {
|
|
147
|
+
body?: React.CSSProperties;
|
|
148
|
+
};
|
|
143
149
|
/**
|
|
144
150
|
* The action area in the bottom right corner.
|
|
145
151
|
*/
|
|
@@ -23,6 +23,7 @@ var _excluded = ["prefixCls", "className", "avatar", "title", "description", "co
|
|
|
23
23
|
* Props for the CheckCard component.
|
|
24
24
|
*/
|
|
25
25
|
var CheckCard = function CheckCard(props) {
|
|
26
|
+
var _props$styles;
|
|
26
27
|
var _useMountMergeState = (0, _utils.useMountMergeState)(props.defaultChecked || false, {
|
|
27
28
|
value: props.checked,
|
|
28
29
|
onChange: props.onChange
|
|
@@ -172,7 +173,7 @@ var CheckCard = function CheckCard(props) {
|
|
|
172
173
|
onMouseEnter: props.onMouseEnter,
|
|
173
174
|
children: [metaDom, props.children ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
174
175
|
className: (0, _classnames.default)("".concat(prefixCls, "-body"), hashId),
|
|
175
|
-
style: props.bodyStyle,
|
|
176
|
+
style: ((_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.body) || props.bodyStyle,
|
|
176
177
|
children: props.children
|
|
177
178
|
}) : null, props.actions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Actions.default, {
|
|
178
179
|
actions: props.actions,
|
|
@@ -6,6 +6,6 @@ export interface ProListToken extends ProAliasToken {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const cardLoading: Keyframes;
|
|
8
8
|
export declare function useStyle(prefixCls: string): {
|
|
9
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
9
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
10
|
hashId: string;
|
|
11
11
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export default function useStyle(prefixCls: string): {
|
|
3
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
3
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
4
4
|
hashId: string;
|
|
5
5
|
};
|
|
@@ -6,6 +6,6 @@ export interface ProToken extends ProAliasToken {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const cardLoading: Keyframes;
|
|
8
8
|
export declare function useStyle(prefixCls: string): {
|
|
9
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
9
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
10
|
hashId: string;
|
|
11
11
|
};
|
|
@@ -4,6 +4,6 @@ export interface ProToken extends ProAliasToken {
|
|
|
4
4
|
componentCls: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function useStyle(prefixCls: string): {
|
|
7
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
8
8
|
hashId: string;
|
|
9
9
|
};
|
|
@@ -4,6 +4,6 @@ export interface ProListToken extends ProAliasToken {
|
|
|
4
4
|
componentCls: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function useStyle(prefixCls: string): {
|
|
7
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
8
8
|
hashId: string;
|
|
9
9
|
};
|
|
@@ -40,13 +40,9 @@ var genProStyle = function genProStyle(token) {
|
|
|
40
40
|
transform: 'rotate(180deg)'
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
'&-content':
|
|
43
|
+
'&-content': {
|
|
44
44
|
width: '100%'
|
|
45
|
-
},
|
|
46
|
-
'&-value-int': {
|
|
47
|
-
fontSize: token.fontSizeHeading3
|
|
48
|
-
}
|
|
49
|
-
}),
|
|
45
|
+
},
|
|
50
46
|
'&-description': {
|
|
51
47
|
width: '100%'
|
|
52
48
|
}
|
|
@@ -66,8 +66,10 @@ var StatisticCard = function StatisticCard(props) {
|
|
|
66
66
|
};
|
|
67
67
|
var Group = function Group(props) {
|
|
68
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StatisticCard, (0, _objectSpread2.default)({
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
styles: {
|
|
70
|
+
body: {
|
|
71
|
+
padding: 0
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
}, props));
|
|
73
75
|
};
|
|
@@ -4,6 +4,6 @@ export interface ProListToken extends ProAliasToken {
|
|
|
4
4
|
componentCls: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function useStyle(prefixCls: string): {
|
|
7
|
-
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").
|
|
7
|
+
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
8
8
|
hashId: string;
|
|
9
9
|
};
|
package/lib/card/typing.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ type CardPropsBase = {
|
|
|
10
10
|
headStyle?: React.CSSProperties;
|
|
11
11
|
/** 内容样式 */
|
|
12
12
|
bodyStyle?: React.CSSProperties;
|
|
13
|
+
/** 样式配置 */
|
|
14
|
+
styles?: {
|
|
15
|
+
header?: React.CSSProperties;
|
|
16
|
+
body?: React.CSSProperties;
|
|
17
|
+
};
|
|
13
18
|
/** 页头是否有分割线 */
|
|
14
19
|
headerBordered?: boolean;
|
|
15
20
|
/** 卡片标题 */
|
|
@@ -762,22 +762,22 @@ var ValueTypeToComponentMap = {
|
|
|
762
762
|
render: function render(text, props) {
|
|
763
763
|
var fieldProps = (0, _utils.pickProProps)(props.fieldProps);
|
|
764
764
|
var placeholder = typeof props.placeholder === 'string' ? props.placeholder : undefined;
|
|
765
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Cascader.default, {
|
|
765
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Cascader.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
766
766
|
mode: props.mode,
|
|
767
767
|
text: text,
|
|
768
768
|
placeholder: placeholder,
|
|
769
769
|
fieldProps: fieldProps
|
|
770
|
-
});
|
|
770
|
+
}));
|
|
771
771
|
},
|
|
772
772
|
formItemRender: function formItemRender(text, props) {
|
|
773
773
|
var fieldProps = (0, _utils.pickProProps)(props.fieldProps);
|
|
774
774
|
var placeholder = typeof props.placeholder === 'string' ? props.placeholder : undefined;
|
|
775
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Cascader.default, {
|
|
775
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Cascader.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
776
776
|
mode: props.mode,
|
|
777
777
|
text: text,
|
|
778
778
|
placeholder: placeholder,
|
|
779
779
|
fieldProps: fieldProps
|
|
780
|
-
});
|
|
780
|
+
}));
|
|
781
781
|
}
|
|
782
782
|
},
|
|
783
783
|
treeSelect: {
|
|
@@ -21,7 +21,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
21
21
|
fieldProps?: any;
|
|
22
22
|
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
23
23
|
id?: string | undefined;
|
|
24
|
-
children?: React.ReactNode;
|
|
25
24
|
defaultKeyWords?: string | undefined;
|
|
26
25
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
27
26
|
export default _default;
|
|
@@ -17,7 +17,6 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
17
17
|
fieldProps?: any;
|
|
18
18
|
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
19
19
|
id?: string | undefined;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
20
|
defaultKeyWords?: string | undefined;
|
|
22
21
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
23
22
|
export default _default;
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
|
|
4
4
|
text: string;
|
|
5
5
|
mode?: "update" | "read" | "edit" | undefined;
|
|
6
|
-
} & Partial<Omit<ColorPickerProps, "
|
|
6
|
+
} & Partial<Omit<ColorPickerProps, "mode" | "value">> & React.RefAttributes<any>>;
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** 获取展示符号 */
|
|
2
2
|
export declare function getSymbolByRealValue(realValue: number): "-" | "+" | null;
|
|
3
3
|
/** 获取颜色 */
|
|
4
|
-
export declare function getColorByRealValue(realValue: number /** ,color: string */): "#
|
|
4
|
+
export declare function getColorByRealValue(realValue: number /** ,color: string */): "#595959" | "#52c41a" | "#ff4d4f";
|
|
5
5
|
/** 获取到最后展示的数字 */
|
|
6
6
|
export declare function getRealTextWithPrecision(realValue: number, precision?: number): string | number;
|
|
7
7
|
/**
|
|
@@ -17,7 +17,6 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
17
17
|
fieldProps?: any;
|
|
18
18
|
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
19
19
|
id?: string | undefined;
|
|
20
|
-
children?: React.ReactNode;
|
|
21
20
|
defaultKeyWords?: string | undefined;
|
|
22
21
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
23
22
|
export default _default;
|
|
@@ -11,7 +11,6 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
11
11
|
fieldProps?: any;
|
|
12
12
|
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
13
13
|
id?: string | undefined;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
14
|
defaultKeyWords?: string | undefined;
|
|
16
15
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
17
16
|
export default _default;
|
|
@@ -18,7 +18,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
var _utils = require("../../../../utils");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
var _excluded = ["label", "prefixCls", "onChange", "value", "mode", "
|
|
21
|
+
var _excluded = ["label", "prefixCls", "onChange", "value", "mode", "defaultValue", "size", "showSearch", "disabled", "style", "className", "options", "onSearch", "allowClear", "labelInValue", "fieldNames", "lightLabel", "labelTrigger", "optionFilterProp", "optionLabelProp", "valueMaxLength", "fetchDataOnSearch", "fetchData", "variant"];
|
|
22
22
|
/**
|
|
23
23
|
* 如果有 label 就优先使用 label
|
|
24
24
|
*
|
|
@@ -37,7 +37,6 @@ var LightSelect = exports.LightSelect = function LightSelect(props, ref) {
|
|
|
37
37
|
_onChange = props.onChange,
|
|
38
38
|
value = props.value,
|
|
39
39
|
mode = props.mode,
|
|
40
|
-
children = props.children,
|
|
41
40
|
defaultValue = props.defaultValue,
|
|
42
41
|
size = props.size,
|
|
43
42
|
showSearch = props.showSearch,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { SelectProps } from 'antd';
|
|
2
|
-
import type { LabeledValue } from 'antd/lib/select';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import type { RequestOptionsType } from '../../../../utils';
|
|
4
|
+
export type LabeledValue = {
|
|
5
|
+
key?: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
value: string | number;
|
|
8
|
+
};
|
|
9
|
+
export type DefaultOptionType = NonNullable<SelectProps['options']>[number];
|
|
5
10
|
export type KeyLabel = Partial<LabeledValue> & RequestOptionsType;
|
|
6
11
|
/** 用户扩展数据后的值类型 */
|
|
7
12
|
export type DataValueType<T> = KeyLabel & T;
|