@douyinfe/semi-ui 2.9.0-beta.0 → 2.9.0-beta.1
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/_base/baseComponent.tsx +2 -1
- package/_portal/index.tsx +2 -1
- package/anchor/index.tsx +2 -1
- package/anchor/link.tsx +2 -1
- package/autoComplete/index.tsx +2 -2
- package/avatar/interface.ts +2 -2
- package/backtop/index.tsx +1 -0
- package/badge/index.tsx +4 -2
- package/banner/index.tsx +1 -0
- package/breadcrumb/bread-context.tsx +2 -2
- package/breadcrumb/index.tsx +2 -2
- package/breadcrumb/item.tsx +11 -3
- package/button/Button.tsx +2 -1
- package/button/buttonGroup.tsx +2 -1
- package/calendar/_story/Demo.tsx +3 -3
- package/card/cardGroup.tsx +1 -0
- package/card/index.tsx +1 -0
- package/cascader/index.tsx +3 -2
- package/cascader/item.tsx +3 -1
- package/checkbox/checkbox.tsx +4 -2
- package/checkbox/checkboxGroup.tsx +1 -1
- package/checkbox/context.ts +3 -3
- package/collapse/index.tsx +1 -0
- package/collapse/item.tsx +3 -0
- package/collapsible/index.tsx +2 -2
- package/configProvider/context.tsx +1 -1
- package/datePicker/datePicker.tsx +2 -1
- package/descriptions/index.tsx +2 -1
- package/descriptions/item.tsx +4 -1
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +7563 -3604
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/dropdown/context.ts +6 -1
- package/dropdown/dropdownItem.tsx +2 -1
- package/dropdown/dropdownTitle.tsx +2 -1
- package/dropdown/index.tsx +3 -1
- package/empty/index.tsx +1 -1
- package/form/arrayField.tsx +1 -0
- package/form/baseForm.tsx +3 -2
- package/form/group.tsx +2 -0
- package/form/hoc/withField.tsx +1 -1
- package/form/label.tsx +1 -0
- package/form/section.tsx +1 -1
- package/form/slot.tsx +2 -0
- package/grid/col.tsx +3 -1
- package/grid/row.tsx +5 -1
- package/layout/Sider.tsx +3 -1
- package/layout/index.tsx +2 -0
- package/layout/layout-context.ts +1 -1
- package/lib/cjs/_base/baseComponent.d.ts +2 -1
- package/lib/cjs/_portal/index.d.ts +3 -1
- package/lib/cjs/anchor/index.d.ts +2 -1
- package/lib/cjs/anchor/link.d.ts +3 -2
- package/lib/cjs/autoComplete/index.d.ts +2 -2
- package/lib/cjs/avatar/avatarGroup.d.ts +1 -1
- package/lib/cjs/avatar/interface.d.ts +2 -2
- package/lib/cjs/backtop/index.d.ts +1 -0
- package/lib/cjs/badge/index.d.ts +4 -2
- package/lib/cjs/banner/index.d.ts +2 -1
- package/lib/cjs/breadcrumb/bread-context.d.ts +2 -2
- package/lib/cjs/breadcrumb/index.d.ts +2 -2
- package/lib/cjs/breadcrumb/item.d.ts +15 -3
- package/lib/cjs/button/Button.d.ts +2 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -0
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/timeCol.d.ts +1 -1
- package/lib/cjs/card/cardGroup.d.ts +1 -0
- package/lib/cjs/card/index.d.ts +2 -1
- package/lib/cjs/cascader/index.d.ts +5 -3
- package/lib/cjs/cascader/item.d.ts +3 -1
- package/lib/cjs/checkbox/checkbox.d.ts +5 -11
- package/lib/cjs/checkbox/checkbox.js +1 -1
- package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -1
- package/lib/cjs/checkbox/checkboxInner.d.ts +1 -10
- package/lib/cjs/checkbox/context.d.ts +3 -3
- package/lib/cjs/collapse/index.d.ts +1 -0
- package/lib/cjs/collapse/item.d.ts +2 -0
- package/lib/cjs/collapsible/index.d.ts +1 -1
- package/lib/cjs/configProvider/index.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +3 -1
- package/lib/cjs/datePicker/insetInput.d.ts +1 -0
- package/lib/cjs/descriptions/index.d.ts +4 -3
- package/lib/cjs/descriptions/item.d.ts +4 -1
- package/lib/cjs/dropdown/context.d.ts +5 -3
- package/lib/cjs/dropdown/dropdownItem.d.ts +3 -3
- package/lib/cjs/dropdown/dropdownMenu.d.ts +1 -0
- package/lib/cjs/dropdown/dropdownTitle.d.ts +3 -3
- package/lib/cjs/dropdown/index.d.ts +3 -3
- package/lib/cjs/empty/index.d.ts +1 -1
- package/lib/cjs/form/arrayField.d.ts +1 -0
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/baseForm.js +1 -1
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/group.d.ts +3 -1
- package/lib/cjs/form/label.d.ts +1 -0
- package/lib/cjs/form/section.d.ts +1 -1
- package/lib/cjs/form/slot.js +2 -0
- package/lib/cjs/grid/col.d.ts +3 -3
- package/lib/cjs/grid/row.d.ts +4 -3
- package/lib/cjs/iconButton/index.d.ts +1 -1
- package/lib/cjs/inputNumber/index.d.ts +1 -1
- package/lib/cjs/layout/Sider.d.ts +4 -1
- package/lib/cjs/layout/index.d.ts +2 -0
- package/lib/cjs/list/index.d.ts +1 -0
- package/lib/cjs/list/item.d.ts +5 -1
- package/lib/cjs/list/item.js +5 -1
- package/lib/cjs/modal/Modal.d.ts +1 -0
- package/lib/cjs/modal/ModalContent.d.ts +7 -2
- package/lib/cjs/modal/confirm.d.ts +10 -5
- package/lib/cjs/modal/useModal/index.d.ts +1 -0
- package/lib/cjs/navigation/Footer.d.ts +3 -5
- package/lib/cjs/navigation/Header.d.ts +4 -6
- package/lib/cjs/navigation/Item.d.ts +4 -6
- package/lib/cjs/navigation/OpenIconTransition.d.ts +2 -1
- package/lib/cjs/navigation/SubNav.d.ts +3 -5
- package/lib/cjs/navigation/SubNav.js +2 -2
- package/lib/cjs/navigation/SubNavTransition.d.ts +1 -1
- package/lib/cjs/navigation/index.d.ts +2 -2
- package/lib/cjs/navigation/nav-context.d.ts +21 -5
- package/lib/cjs/notification/NoticeTransition.d.ts +2 -2
- package/lib/cjs/notification/index.d.ts +3 -1
- package/lib/cjs/notification/notice.d.ts +3 -1
- package/lib/cjs/notification/useNotification/index.d.ts +1 -0
- package/lib/cjs/overflowList/intersectionObserver.d.ts +3 -2
- package/lib/cjs/pagination/index.d.ts +3 -1
- package/lib/cjs/pagination/index.js +15 -11
- package/lib/cjs/popconfirm/index.d.ts +4 -2
- package/lib/cjs/popover/index.d.ts +4 -2
- package/lib/cjs/progress/index.d.ts +1 -1
- package/lib/cjs/radio/radio.d.ts +1 -0
- package/lib/cjs/radio/radioGroup.d.ts +1 -0
- package/lib/cjs/select/index.d.ts +3 -1
- package/lib/cjs/select/optionGroup.d.ts +1 -1
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -0
- package/lib/cjs/sideSheet/SideSheetTransition.d.ts +1 -1
- package/lib/cjs/sideSheet/index.d.ts +3 -1
- package/lib/cjs/table/Body/BaseRow.d.ts +1 -1
- package/lib/cjs/table/Body/ExpandedRow.d.ts +4 -2
- package/lib/cjs/table/Body/SectionRow.d.ts +3 -1
- package/lib/cjs/table/Column.d.ts +1 -1
- package/lib/cjs/table/ColumnShape.d.ts +1 -1
- package/lib/cjs/table/CustomExpandIcon.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +10 -8
- package/lib/cjs/table/TableCell.d.ts +5 -3
- package/lib/cjs/table/TableHeaderRow.d.ts +3 -1
- package/lib/cjs/table/index.d.ts +4 -4
- package/lib/cjs/table/table-context.d.ts +7 -6
- package/lib/cjs/tabs/TabPane.d.ts +3 -1
- package/lib/cjs/tabs/interface.d.ts +2 -1
- package/lib/cjs/tag/group.d.ts +1 -1
- package/lib/cjs/timePicker/Combobox.d.ts +1 -0
- package/lib/cjs/timeline/index.d.ts +2 -1
- package/lib/cjs/timeline/item.d.ts +1 -0
- package/lib/cjs/toast/ToastTransition.d.ts +1 -1
- package/lib/cjs/toast/index.d.ts +8 -16
- package/lib/cjs/toast/toast.d.ts +4 -2
- package/lib/cjs/toast/useToast/index.d.ts +1 -0
- package/lib/cjs/tooltip/index.d.ts +4 -2
- package/lib/cjs/transfer/index.d.ts +3 -3
- package/lib/cjs/transfer/index.js +2 -1
- package/lib/cjs/tree/index.d.ts +13 -11
- package/lib/cjs/tree/nodeList.d.ts +1 -1
- package/lib/cjs/tree/treeContext.d.ts +10 -10
- package/lib/cjs/tree/treeNode.d.ts +11 -9
- package/lib/cjs/tree/treeNode.js +2 -0
- package/lib/cjs/treeSelect/index.d.ts +7 -5
- package/lib/cjs/typography/copyable.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +2 -2
- package/lib/es/_base/baseComponent.d.ts +2 -1
- package/lib/es/_portal/index.d.ts +3 -1
- package/lib/es/anchor/index.d.ts +2 -1
- package/lib/es/anchor/link.d.ts +3 -2
- package/lib/es/autoComplete/index.d.ts +2 -2
- package/lib/es/avatar/avatarGroup.d.ts +1 -1
- package/lib/es/avatar/interface.d.ts +2 -2
- package/lib/es/backtop/index.d.ts +1 -0
- package/lib/es/badge/index.d.ts +4 -2
- package/lib/es/banner/index.d.ts +2 -1
- package/lib/es/breadcrumb/bread-context.d.ts +2 -2
- package/lib/es/breadcrumb/index.d.ts +2 -2
- package/lib/es/breadcrumb/item.d.ts +15 -3
- package/lib/es/button/Button.d.ts +2 -1
- package/lib/es/button/buttonGroup.d.ts +1 -0
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/timeCol.d.ts +1 -1
- package/lib/es/card/cardGroup.d.ts +1 -0
- package/lib/es/card/index.d.ts +2 -1
- package/lib/es/cascader/index.d.ts +5 -3
- package/lib/es/cascader/item.d.ts +3 -1
- package/lib/es/checkbox/checkbox.d.ts +5 -11
- package/lib/es/checkbox/checkbox.js +1 -1
- package/lib/es/checkbox/checkboxGroup.d.ts +1 -1
- package/lib/es/checkbox/checkboxInner.d.ts +1 -10
- package/lib/es/checkbox/context.d.ts +3 -3
- package/lib/es/collapse/index.d.ts +1 -0
- package/lib/es/collapse/item.d.ts +2 -0
- package/lib/es/collapsible/index.d.ts +1 -1
- package/lib/es/configProvider/index.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +3 -1
- package/lib/es/datePicker/insetInput.d.ts +1 -0
- package/lib/es/descriptions/index.d.ts +4 -3
- package/lib/es/descriptions/item.d.ts +4 -1
- package/lib/es/dropdown/context.d.ts +5 -3
- package/lib/es/dropdown/dropdownItem.d.ts +3 -3
- package/lib/es/dropdown/dropdownMenu.d.ts +1 -0
- package/lib/es/dropdown/dropdownTitle.d.ts +3 -3
- package/lib/es/dropdown/index.d.ts +3 -3
- package/lib/es/empty/index.d.ts +1 -1
- package/lib/es/form/arrayField.d.ts +1 -0
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/baseForm.js +1 -1
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/group.d.ts +3 -1
- package/lib/es/form/label.d.ts +1 -0
- package/lib/es/form/section.d.ts +1 -1
- package/lib/es/form/slot.js +2 -0
- package/lib/es/grid/col.d.ts +3 -3
- package/lib/es/grid/row.d.ts +4 -3
- package/lib/es/iconButton/index.d.ts +1 -1
- package/lib/es/inputNumber/index.d.ts +1 -1
- package/lib/es/layout/Sider.d.ts +4 -1
- package/lib/es/layout/index.d.ts +2 -0
- package/lib/es/list/index.d.ts +1 -0
- package/lib/es/list/item.d.ts +5 -1
- package/lib/es/list/item.js +5 -1
- package/lib/es/modal/Modal.d.ts +1 -0
- package/lib/es/modal/ModalContent.d.ts +7 -2
- package/lib/es/modal/confirm.d.ts +10 -5
- package/lib/es/modal/useModal/index.d.ts +1 -0
- package/lib/es/navigation/Footer.d.ts +3 -5
- package/lib/es/navigation/Header.d.ts +4 -6
- package/lib/es/navigation/Item.d.ts +4 -6
- package/lib/es/navigation/OpenIconTransition.d.ts +2 -1
- package/lib/es/navigation/SubNav.d.ts +3 -5
- package/lib/es/navigation/SubNav.js +2 -2
- package/lib/es/navigation/SubNavTransition.d.ts +1 -1
- package/lib/es/navigation/index.d.ts +2 -2
- package/lib/es/navigation/nav-context.d.ts +21 -5
- package/lib/es/notification/NoticeTransition.d.ts +2 -2
- package/lib/es/notification/index.d.ts +3 -1
- package/lib/es/notification/notice.d.ts +3 -1
- package/lib/es/notification/useNotification/index.d.ts +1 -0
- package/lib/es/overflowList/intersectionObserver.d.ts +3 -2
- package/lib/es/pagination/index.d.ts +3 -1
- package/lib/es/pagination/index.js +15 -11
- package/lib/es/popconfirm/index.d.ts +4 -2
- package/lib/es/popover/index.d.ts +4 -2
- package/lib/es/progress/index.d.ts +1 -1
- package/lib/es/radio/radio.d.ts +1 -0
- package/lib/es/radio/radioGroup.d.ts +1 -0
- package/lib/es/select/index.d.ts +3 -1
- package/lib/es/select/optionGroup.d.ts +1 -1
- package/lib/es/sideSheet/SideSheetContent.d.ts +1 -0
- package/lib/es/sideSheet/SideSheetTransition.d.ts +1 -1
- package/lib/es/sideSheet/index.d.ts +3 -1
- package/lib/es/table/Body/BaseRow.d.ts +1 -1
- package/lib/es/table/Body/ExpandedRow.d.ts +4 -2
- package/lib/es/table/Body/SectionRow.d.ts +3 -1
- package/lib/es/table/Column.d.ts +1 -1
- package/lib/es/table/ColumnShape.d.ts +1 -1
- package/lib/es/table/CustomExpandIcon.d.ts +1 -1
- package/lib/es/table/Table.d.ts +10 -8
- package/lib/es/table/TableCell.d.ts +5 -3
- package/lib/es/table/TableHeaderRow.d.ts +3 -1
- package/lib/es/table/index.d.ts +4 -4
- package/lib/es/table/table-context.d.ts +7 -6
- package/lib/es/tabs/TabPane.d.ts +3 -1
- package/lib/es/tabs/interface.d.ts +2 -1
- package/lib/es/tag/group.d.ts +1 -1
- package/lib/es/timePicker/Combobox.d.ts +1 -0
- package/lib/es/timeline/index.d.ts +2 -1
- package/lib/es/timeline/item.d.ts +1 -0
- package/lib/es/toast/ToastTransition.d.ts +1 -1
- package/lib/es/toast/index.d.ts +8 -16
- package/lib/es/toast/toast.d.ts +4 -2
- package/lib/es/toast/useToast/index.d.ts +1 -0
- package/lib/es/tooltip/index.d.ts +4 -2
- package/lib/es/transfer/index.d.ts +3 -3
- package/lib/es/transfer/index.js +3 -1
- package/lib/es/tree/index.d.ts +13 -11
- package/lib/es/tree/nodeList.d.ts +1 -1
- package/lib/es/tree/treeContext.d.ts +10 -10
- package/lib/es/tree/treeNode.d.ts +11 -9
- package/lib/es/tree/treeNode.js +2 -0
- package/lib/es/treeSelect/index.d.ts +7 -5
- package/lib/es/typography/copyable.d.ts +1 -1
- package/lib/es/upload/index.d.ts +2 -2
- package/list/index.tsx +1 -0
- package/list/item.tsx +6 -1
- package/modal/Modal.tsx +1 -0
- package/modal/ModalContent.tsx +9 -3
- package/navigation/Footer.tsx +3 -1
- package/navigation/Header.tsx +3 -1
- package/navigation/Item.tsx +4 -3
- package/navigation/OpenIconTransition.tsx +2 -1
- package/navigation/SubNav.tsx +4 -3
- package/navigation/SubNavTransition.tsx +1 -1
- package/navigation/nav-context.ts +22 -1
- package/notification/NoticeTransition.tsx +1 -1
- package/notification/index.tsx +3 -1
- package/notification/notice.tsx +3 -1
- package/overflowList/intersectionObserver.tsx +2 -1
- package/package.json +9 -9
- package/pagination/index.tsx +4 -1
- package/popconfirm/index.tsx +3 -1
- package/popover/index.tsx +3 -1
- package/radio/radio.tsx +1 -0
- package/radio/radioGroup.tsx +1 -0
- package/select/index.tsx +2 -1
- package/select/utils.tsx +1 -1
- package/sideSheet/SideSheetContent.tsx +1 -0
- package/sideSheet/SideSheetTransition.tsx +1 -1
- package/sideSheet/index.tsx +3 -2
- package/table/Body/ExpandedRow.tsx +3 -1
- package/table/Body/SectionRow.tsx +3 -1
- package/table/Body/index.tsx +3 -2
- package/table/Table.tsx +4 -3
- package/table/TableCell.tsx +6 -4
- package/table/TableHeaderRow.tsx +3 -1
- package/table/table-context.ts +10 -6
- package/tabs/TabPane.tsx +2 -0
- package/tabs/index.tsx +2 -2
- package/tabs/interface.ts +2 -1
- package/tag/group.tsx +5 -5
- package/timePicker/TimePicker.tsx +1 -1
- package/timeline/index.tsx +1 -0
- package/timeline/item.tsx +1 -0
- package/toast/ToastTransition.tsx +1 -1
- package/toast/toast.tsx +3 -1
- package/tooltip/index.tsx +2 -1
- package/transfer/index.tsx +3 -1
- package/tree/index.tsx +12 -11
- package/tree/treeContext.tsx +10 -10
- package/tree/treeNode.tsx +10 -7
- package/treeSelect/index.tsx +5 -4
- package/upload/index.tsx +1 -1
package/lib/es/table/Table.d.ts
CHANGED
|
@@ -80,15 +80,15 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
80
80
|
sortDirections: PropTypes.Requireable<string[]>;
|
|
81
81
|
sortOrder: PropTypes.Requireable<string | boolean>;
|
|
82
82
|
sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
|
|
83
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
83
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
84
84
|
useFullRender: PropTypes.Requireable<boolean>;
|
|
85
85
|
width: PropTypes.Requireable<string | number>;
|
|
86
86
|
}>[]>;
|
|
87
87
|
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
88
88
|
id: PropTypes.Requireable<string>;
|
|
89
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
89
|
+
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
90
90
|
expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
|
|
91
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
91
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
92
92
|
onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
93
93
|
showHeader: PropTypes.Requireable<boolean>;
|
|
94
94
|
indentSize: PropTypes.Requireable<number>;
|
|
@@ -106,7 +106,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
106
106
|
defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
|
|
107
107
|
pagination: PropTypes.Requireable<boolean | object>;
|
|
108
108
|
renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
|
|
109
|
-
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
109
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
110
110
|
empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
111
111
|
dataSource: PropTypes.Requireable<any[]>;
|
|
112
112
|
childrenRecordName: PropTypes.Requireable<string>;
|
|
@@ -167,6 +167,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
167
167
|
scrollPosition: BodyScrollPosition;
|
|
168
168
|
position: BodyScrollPosition;
|
|
169
169
|
foundation: TableFoundation<RecordType>;
|
|
170
|
+
context: TableContextProps;
|
|
170
171
|
constructor(props: NormalTableProps<RecordType>, context: TableContextProps);
|
|
171
172
|
static getDerivedStateFromProps(props: NormalTableProps, state: NormalTableState): Partial<NormalTableState<Data>>;
|
|
172
173
|
componentDidMount(): void;
|
|
@@ -191,7 +192,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
191
192
|
setScrollPosition: (position: BodyScrollPosition) => void;
|
|
192
193
|
setScrollPositionClassName: () => void;
|
|
193
194
|
syncTableWidth: () => void;
|
|
194
|
-
renderSelection: (record?:
|
|
195
|
+
renderSelection: (record?: any, inHeader?: boolean) => React.ReactNode;
|
|
195
196
|
renderRowSelectionCallback: (text: string, record?: RecordType) => React.ReactNode;
|
|
196
197
|
renderTitleSelectionCallback: () => React.ReactNode;
|
|
197
198
|
normalizeSelectionColumn: (props?: {
|
|
@@ -234,7 +235,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
234
235
|
*/
|
|
235
236
|
renderPagination: (pagination: TablePaginationProps, propRenderPagination: RenderPagination) => JSX.Element;
|
|
236
237
|
renderTitle: (props?: {
|
|
237
|
-
title?: ReactNode;
|
|
238
|
+
title?: React.ReactNode | ((dataSource?: RecordType[]) => ReactNode);
|
|
238
239
|
prefixCls?: string;
|
|
239
240
|
dataSource?: any[];
|
|
240
241
|
}) => JSX.Element;
|
|
@@ -244,7 +245,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
244
245
|
dataSource?: RecordType[];
|
|
245
246
|
}) => JSX.Element;
|
|
246
247
|
renderFooter: (props?: {
|
|
247
|
-
footer?: ReactNode;
|
|
248
|
+
footer?: React.ReactNode | ((dataSource?: RecordType[]) => ReactNode);
|
|
248
249
|
prefixCls?: string;
|
|
249
250
|
dataSource?: RecordType[];
|
|
250
251
|
}) => JSX.Element;
|
|
@@ -283,6 +284,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
283
284
|
formatPageText?: import("./interface").FormatPageText;
|
|
284
285
|
style?: React.CSSProperties;
|
|
285
286
|
className?: string;
|
|
287
|
+
children?: any;
|
|
286
288
|
total?: number;
|
|
287
289
|
showTotal?: boolean;
|
|
288
290
|
pageSize?: number;
|
|
@@ -292,7 +294,7 @@ declare class Table<RecordType extends Record<string, any>> extends BaseComponen
|
|
|
292
294
|
defaultCurrentPage?: number;
|
|
293
295
|
onPageChange?: (currentPage: number) => void;
|
|
294
296
|
onPageSizeChange?: (newPageSize: number) => void;
|
|
295
|
-
onChange: (
|
|
297
|
+
onChange: (currentPage: number, pageSize: number) => void;
|
|
296
298
|
prevText?: React.ReactNode;
|
|
297
299
|
nextText?: React.ReactNode;
|
|
298
300
|
showSizeChanger?: boolean;
|
|
@@ -2,7 +2,8 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { TableCellAdapter } from '@douyinfe/semi-foundation/lib/es/table/cellFoundation';
|
|
4
4
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
5
|
-
import {
|
|
5
|
+
import { TableContextProps } from './table-context';
|
|
6
|
+
import { ColumnProps, ExpandIcon } from './interface';
|
|
6
7
|
export interface TableCellProps extends BaseProps {
|
|
7
8
|
record?: Record<string, any>;
|
|
8
9
|
prefixCls?: string;
|
|
@@ -19,7 +20,7 @@ export interface TableCellProps extends BaseProps {
|
|
|
19
20
|
* When hideExpandedColumn is true or isSection is true
|
|
20
21
|
* expandIcon is a custom icon or true
|
|
21
22
|
*/
|
|
22
|
-
expandIcon?:
|
|
23
|
+
expandIcon?: ExpandIcon;
|
|
23
24
|
renderExpandIcon?: (record: Record<string, any>) => ReactNode;
|
|
24
25
|
hideExpandedColumn?: boolean;
|
|
25
26
|
component?: any;
|
|
@@ -34,7 +35,7 @@ export interface TableCellProps extends BaseProps {
|
|
|
34
35
|
colIndex?: number;
|
|
35
36
|
}
|
|
36
37
|
export default class TableCell extends BaseComponent<TableCellProps, Record<string, any>> {
|
|
37
|
-
static contextType: React.Context<
|
|
38
|
+
static contextType: React.Context<TableContextProps>;
|
|
38
39
|
static defaultProps: {
|
|
39
40
|
indent: number;
|
|
40
41
|
indentSize: 20;
|
|
@@ -70,6 +71,7 @@ export default class TableCell extends BaseComponent<TableCellProps, Record<stri
|
|
|
70
71
|
};
|
|
71
72
|
get adapter(): TableCellAdapter;
|
|
72
73
|
ref: React.MutableRefObject<any>;
|
|
74
|
+
context: TableContextProps;
|
|
73
75
|
constructor(props: TableCellProps);
|
|
74
76
|
/**
|
|
75
77
|
* Control whether to execute the render function of the cell
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import BaseComponent from '../_base/baseComponent';
|
|
4
|
+
import { TableContextProps } from './table-context';
|
|
4
5
|
import { TableComponents, OnHeaderRow, Fixed } from './interface';
|
|
5
6
|
export interface TableHeaderRowProps {
|
|
6
7
|
components?: TableComponents;
|
|
@@ -14,7 +15,7 @@ export interface TableHeaderRowProps {
|
|
|
14
15
|
selectedRowKeysSet: Set<any>;
|
|
15
16
|
}
|
|
16
17
|
export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, Record<string, any>> {
|
|
17
|
-
static contextType: React.Context<
|
|
18
|
+
static contextType: React.Context<TableContextProps>;
|
|
18
19
|
static propTypes: {
|
|
19
20
|
components: PropTypes.Requireable<object>;
|
|
20
21
|
row: PropTypes.Requireable<any[]>;
|
|
@@ -52,6 +53,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
|
52
53
|
stopPropagation(e: any): void;
|
|
53
54
|
};
|
|
54
55
|
headerNode: HTMLElement;
|
|
56
|
+
context: TableContextProps;
|
|
55
57
|
constructor(props: TableHeaderRowProps);
|
|
56
58
|
cacheRef: (node: HTMLElement) => void;
|
|
57
59
|
componentDidUpdate(prevProps: TableHeaderRowProps): void;
|
package/lib/es/table/index.d.ts
CHANGED
|
@@ -43,15 +43,15 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
43
43
|
sortDirections: PropTypes.Requireable<string[]>;
|
|
44
44
|
sortOrder: PropTypes.Requireable<string | boolean>;
|
|
45
45
|
sorter: PropTypes.Requireable<boolean | ((...args: any[]) => any)>;
|
|
46
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
46
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
47
47
|
useFullRender: PropTypes.Requireable<boolean>;
|
|
48
48
|
width: PropTypes.Requireable<string | number>;
|
|
49
49
|
}>[]>;
|
|
50
50
|
hideExpandedColumn: PropTypes.Requireable<boolean>;
|
|
51
51
|
id: PropTypes.Requireable<string>;
|
|
52
|
-
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
52
|
+
expandIcon: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
53
53
|
expandCellFixed: PropTypes.Requireable<boolean | "left" | "right">;
|
|
54
|
-
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
54
|
+
title: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
55
55
|
onHeaderRow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
56
56
|
showHeader: PropTypes.Requireable<boolean>;
|
|
57
57
|
indentSize: PropTypes.Requireable<number>;
|
|
@@ -69,7 +69,7 @@ declare class Table<RecordType extends Record<string, any> = Data> extends React
|
|
|
69
69
|
defaultExpandedRowKeys: PropTypes.Requireable<any[]>;
|
|
70
70
|
pagination: PropTypes.Requireable<boolean | object>;
|
|
71
71
|
renderPagination: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
-
footer: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
72
|
+
footer: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
73
73
|
empty: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
74
74
|
dataSource: PropTypes.Requireable<any[]>;
|
|
75
75
|
childrenRecordName: PropTypes.Requireable<string>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ColumnProps, GetVirtualizedListRef } from './interface';
|
|
2
|
+
import { ColumnProps, GetVirtualizedListRef, RowKey } from './interface';
|
|
3
|
+
import { BaseHeadWidth } from '@douyinfe/semi-foundation/lib/es/table/foundation';
|
|
3
4
|
export interface TableContextProps {
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
anyColumnFixed?: boolean;
|
|
6
7
|
flattenedColumns?: ColumnProps[];
|
|
7
|
-
tableWidth?: number
|
|
8
|
-
headWidths?:
|
|
9
|
-
setHeadWidths?: (headWidth?:
|
|
8
|
+
tableWidth?: number;
|
|
9
|
+
headWidths?: BaseHeadWidth[][];
|
|
10
|
+
setHeadWidths?: (headWidth?: BaseHeadWidth[], index?: number) => void;
|
|
10
11
|
getHeadWidths?: (index?: number) => number[];
|
|
11
12
|
getCellWidths?: (flattenColumns: ColumnProps[], flattenedWidths?: number[], ignoreScrollBarKey?: boolean) => number[];
|
|
12
|
-
handleRowExpanded?: (expanded: boolean, realKey:
|
|
13
|
+
handleRowExpanded?: (expanded: boolean, realKey: RowKey<any>, domEvent: React.MouseEvent<HTMLElement>) => void;
|
|
13
14
|
renderExpandIcon?: (record: Record<string, any>, isNested?: boolean, groupKey?: string | number) => React.ReactNode;
|
|
14
|
-
renderSelection?: (record
|
|
15
|
+
renderSelection?: (record?: Record<string, any>, isHeader?: boolean) => React.ReactNode;
|
|
15
16
|
getVirtualizedListRef?: GetVirtualizedListRef;
|
|
16
17
|
setBodyHasScrollbar?: (bodyHasScrollBar: boolean) => void;
|
|
17
18
|
}
|
package/lib/es/tabs/TabPane.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { PureComponent, ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { TabContextValue } from './interface';
|
|
3
4
|
import { PlainTab, TabPaneProps } from './interface';
|
|
4
5
|
declare class TabPane extends PureComponent<TabPaneProps> {
|
|
5
6
|
static isTabPane: boolean;
|
|
6
|
-
static contextType: React.Context<
|
|
7
|
+
static contextType: React.Context<TabContextValue>;
|
|
7
8
|
static propTypes: {
|
|
8
9
|
className: PropTypes.Requireable<string>;
|
|
9
10
|
style: PropTypes.Requireable<object>;
|
|
@@ -18,6 +19,7 @@ declare class TabPane extends PureComponent<TabPaneProps> {
|
|
|
18
19
|
ref: React.RefObject<HTMLDivElement>;
|
|
19
20
|
isAnimating: boolean;
|
|
20
21
|
_active: boolean;
|
|
22
|
+
context: TabContextValue;
|
|
21
23
|
componentDidMount(): void;
|
|
22
24
|
getDirection: (activeKey: string, itemKey: string, panes: Array<PlainTab>) => boolean;
|
|
23
25
|
hideScroll: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
1
|
+
import React, { ComponentType, CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { Motion } from '../_base/base';
|
|
3
3
|
export declare type TabType = 'line' | 'card' | 'button';
|
|
4
4
|
export declare type TabSize = 'small' | 'medium' | 'large';
|
|
@@ -51,6 +51,7 @@ export interface TabBarProps {
|
|
|
51
51
|
}
|
|
52
52
|
export interface TabPaneProps {
|
|
53
53
|
className?: string;
|
|
54
|
+
children?: React.ReactNode | undefined;
|
|
54
55
|
disabled?: boolean;
|
|
55
56
|
icon?: ReactNode;
|
|
56
57
|
itemKey?: string;
|
package/lib/es/tag/group.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export default class TagGroup extends PureComponent<TagGroupProps> {
|
|
|
35
35
|
popoverProps: PropTypes.Requireable<object>;
|
|
36
36
|
avatarShape: PropTypes.Requireable<string>;
|
|
37
37
|
};
|
|
38
|
-
renderNTag(n: number, restTags:
|
|
38
|
+
renderNTag(n: number, restTags: React.ReactNode): JSX.Element;
|
|
39
39
|
renderMergeTags(tags: (Tag | React.ReactNode)[]): (React.ReactNode | Tag)[];
|
|
40
40
|
renderAllTags(): (React.ReactNode | Tag)[];
|
|
41
41
|
render(): JSX.Element;
|
|
@@ -11,6 +11,7 @@ export interface TimelineProps extends Pick<React.AriaAttributes, 'aria-label'>
|
|
|
11
11
|
className?: string;
|
|
12
12
|
style?: React.CSSProperties;
|
|
13
13
|
dataSource?: Data[];
|
|
14
|
+
children?: React.ReactNode | undefined;
|
|
14
15
|
}
|
|
15
16
|
declare class Timeline extends PureComponent<TimelineProps> {
|
|
16
17
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
@@ -25,7 +26,7 @@ declare class Timeline extends PureComponent<TimelineProps> {
|
|
|
25
26
|
mode: string;
|
|
26
27
|
};
|
|
27
28
|
getPosCls: (ele: React.ReactElement, idx: number) => string;
|
|
28
|
-
addClassName: (items: React.ReactNode) =>
|
|
29
|
+
addClassName: (items: React.ReactNode) => (string | number | React.ReactFragment | React.ReactElement<any, string | React.JSXElementConstructor<any>>)[];
|
|
29
30
|
render(): JSX.Element;
|
|
30
31
|
}
|
|
31
32
|
export default Timeline;
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
|
|
4
4
|
export interface TimelineItemProps {
|
|
5
5
|
color?: string;
|
|
6
|
+
children?: React.ReactNode | undefined;
|
|
6
7
|
time?: React.ReactNode;
|
|
7
8
|
type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
8
9
|
dot?: React.ReactNode;
|
|
@@ -2,6 +2,6 @@ import { Motion } from '../_base/base';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface ToastTransitionProps {
|
|
4
4
|
motion?: Motion<ToastTransitionProps>;
|
|
5
|
-
children?: React.
|
|
5
|
+
children?: React.ReactNode | ((TransitionProps: any) => any);
|
|
6
6
|
}
|
|
7
7
|
export default function ToastTransition(props?: ToastTransitionProps): JSX.Element;
|
package/lib/es/toast/index.d.ts
CHANGED
|
@@ -25,12 +25,10 @@ declare const createBaseToast: () => {
|
|
|
25
25
|
componentWillUnmount(): void;
|
|
26
26
|
isControlled: (key: any) => boolean;
|
|
27
27
|
log(text: string, ...rest: any): any;
|
|
28
|
-
context:
|
|
28
|
+
context: unknown;
|
|
29
29
|
setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
|
|
30
30
|
forceUpdate(callback?: () => void): void;
|
|
31
|
-
readonly props: Readonly<ToastListProps
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
}>;
|
|
31
|
+
readonly props: Readonly<ToastListProps>;
|
|
34
32
|
state: Readonly<ToastListState>;
|
|
35
33
|
refs: {
|
|
36
34
|
[key: string]: React.ReactInstance;
|
|
@@ -58,12 +56,10 @@ declare const createBaseToast: () => {
|
|
|
58
56
|
componentWillUnmount(): void;
|
|
59
57
|
isControlled: (key: any) => boolean;
|
|
60
58
|
log(text: string, ...rest: any): any;
|
|
61
|
-
context:
|
|
59
|
+
context: unknown;
|
|
62
60
|
setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
|
|
63
61
|
forceUpdate(callback?: () => void): void;
|
|
64
|
-
readonly props: Readonly<ToastListProps
|
|
65
|
-
children?: React.ReactNode;
|
|
66
|
-
}>;
|
|
62
|
+
readonly props: Readonly<ToastListProps>;
|
|
67
63
|
state: Readonly<ToastListState>;
|
|
68
64
|
refs: {
|
|
69
65
|
[key: string]: React.ReactInstance;
|
|
@@ -119,12 +115,10 @@ declare const _default: {
|
|
|
119
115
|
componentWillUnmount(): void;
|
|
120
116
|
isControlled: (key: any) => boolean;
|
|
121
117
|
log(text: string, ...rest: any): any;
|
|
122
|
-
context:
|
|
118
|
+
context: unknown;
|
|
123
119
|
setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
|
|
124
120
|
forceUpdate(callback?: () => void): void;
|
|
125
|
-
readonly props: Readonly<ToastListProps
|
|
126
|
-
children?: React.ReactNode;
|
|
127
|
-
}>;
|
|
121
|
+
readonly props: Readonly<ToastListProps>;
|
|
128
122
|
state: Readonly<ToastListState>;
|
|
129
123
|
refs: {
|
|
130
124
|
[key: string]: React.ReactInstance;
|
|
@@ -152,12 +146,10 @@ declare const _default: {
|
|
|
152
146
|
componentWillUnmount(): void;
|
|
153
147
|
isControlled: (key: any) => boolean;
|
|
154
148
|
log(text: string, ...rest: any): any;
|
|
155
|
-
context:
|
|
149
|
+
context: unknown;
|
|
156
150
|
setState<K extends keyof ToastListState>(state: ToastListState | ((prevState: Readonly<ToastListState>, props: Readonly<ToastListProps>) => ToastListState | Pick<ToastListState, K>) | Pick<ToastListState, K>, callback?: () => void): void;
|
|
157
151
|
forceUpdate(callback?: () => void): void;
|
|
158
|
-
readonly props: Readonly<ToastListProps
|
|
159
|
-
children?: React.ReactNode;
|
|
160
|
-
}>;
|
|
152
|
+
readonly props: Readonly<ToastListProps>;
|
|
161
153
|
state: Readonly<ToastListState>;
|
|
162
154
|
refs: {
|
|
163
155
|
[key: string]: React.ReactInstance;
|
package/lib/es/toast/toast.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ContextValue } from '../configProvider/context';
|
|
3
4
|
import { ToastAdapter, ToastState, ToastProps } from '@douyinfe/semi-foundation/lib/es/toast/toastFoundation';
|
|
4
5
|
import BaseComponent from '../_base/baseComponent';
|
|
5
6
|
export interface ToastReactProps extends ToastProps {
|
|
@@ -8,7 +9,7 @@ export interface ToastReactProps extends ToastProps {
|
|
|
8
9
|
content: React.ReactNode;
|
|
9
10
|
}
|
|
10
11
|
declare class Toast extends BaseComponent<ToastReactProps, ToastState> {
|
|
11
|
-
static contextType: React.Context<
|
|
12
|
+
static contextType: React.Context<ContextValue>;
|
|
12
13
|
static propTypes: {
|
|
13
14
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
15
|
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -33,13 +34,14 @@ declare class Toast extends BaseComponent<ToastReactProps, ToastState> {
|
|
|
33
34
|
theme: string;
|
|
34
35
|
};
|
|
35
36
|
constructor(props: ToastReactProps);
|
|
37
|
+
context: ContextValue;
|
|
36
38
|
get adapter(): ToastAdapter;
|
|
37
39
|
componentDidMount(): void;
|
|
38
40
|
componentWillUnmount(): void;
|
|
39
41
|
close(e: React.MouseEvent): void;
|
|
40
42
|
clearCloseTimer: () => void;
|
|
41
43
|
startCloseTimer: () => void;
|
|
42
|
-
renderIcon():
|
|
44
|
+
renderIcon(): true | React.ReactChild | React.ReactFragment;
|
|
43
45
|
render(): JSX.Element;
|
|
44
46
|
}
|
|
45
47
|
export default Toast;
|
|
@@ -6,6 +6,7 @@ import TooltipFoundation, { TooltipAdapter, Position } from '@douyinfe/semi-foun
|
|
|
6
6
|
import { strings } from '@douyinfe/semi-foundation/lib/es/tooltip/constants';
|
|
7
7
|
import '@douyinfe/semi-foundation/lib/es/tooltip/tooltip.css';
|
|
8
8
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
9
|
+
import { ContextValue } from '../configProvider/context';
|
|
9
10
|
import { Motion } from '../_base/base';
|
|
10
11
|
export { TooltipTransitionProps } from './TooltipStyledTransition';
|
|
11
12
|
export declare type Trigger = ArrayElement<typeof strings.TRIGGER_SET>;
|
|
@@ -70,7 +71,7 @@ interface TooltipState {
|
|
|
70
71
|
id: string;
|
|
71
72
|
}
|
|
72
73
|
export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
73
|
-
static contextType: React.Context<
|
|
74
|
+
static contextType: React.Context<ContextValue>;
|
|
74
75
|
static propTypes: {
|
|
75
76
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
76
77
|
motion: PropTypes.Requireable<boolean | object>;
|
|
@@ -86,7 +87,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
86
87
|
clickTriggerToHide: PropTypes.Requireable<boolean>;
|
|
87
88
|
visible: PropTypes.Requireable<boolean>;
|
|
88
89
|
style: PropTypes.Requireable<object>;
|
|
89
|
-
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
90
|
+
content: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
90
91
|
prefixCls: PropTypes.Requireable<string>;
|
|
91
92
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
93
|
onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -148,6 +149,7 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
148
149
|
getPopupContainer: () => HTMLElement;
|
|
149
150
|
containerPosition: string;
|
|
150
151
|
foundation: TooltipFoundation;
|
|
152
|
+
context: ContextValue;
|
|
151
153
|
constructor(props: TooltipProps);
|
|
152
154
|
setContainerEl: (node: HTMLDivElement) => {
|
|
153
155
|
current: HTMLDivElement;
|
|
@@ -150,15 +150,15 @@ declare class Transfer extends BaseComponent<TransferProps, TransferState> {
|
|
|
150
150
|
onSortEnd(callbackProps: OnSortEndProps): void;
|
|
151
151
|
renderFilter(locale: Locale['Transfer']): JSX.Element;
|
|
152
152
|
renderHeader(headerConfig: HeaderConfig): JSX.Element;
|
|
153
|
-
renderLeftItem(item: ResolvedDataItem, index: number): React.
|
|
154
|
-
renderLeft(locale: Locale['Transfer']): React.
|
|
153
|
+
renderLeftItem(item: ResolvedDataItem, index: number): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
154
|
+
renderLeft(locale: Locale['Transfer']): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
155
155
|
renderGroupTitle(group: GroupItem, index: number): JSX.Element;
|
|
156
156
|
renderLeftTree(): JSX.Element;
|
|
157
157
|
renderLeftList(visibileItems: Array<ResolvedDataItem>): JSX.Element;
|
|
158
158
|
renderRightItem(item: ResolvedDataItem): React.ReactNode;
|
|
159
159
|
renderEmpty(type: string, emptyText: React.ReactNode): JSX.Element;
|
|
160
160
|
renderRightSortableList(selectedData: Array<ResolvedDataItem>): JSX.Element;
|
|
161
|
-
renderRight(locale: Locale['Transfer']): React.
|
|
161
|
+
renderRight(locale: Locale['Transfer']): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
162
162
|
render(): JSX.Element;
|
|
163
163
|
}
|
|
164
164
|
export default Transfer;
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -492,6 +492,7 @@ class Transfer extends BaseComponent {
|
|
|
492
492
|
}, _mapInstanceProperty(items).call(items, (item, index) =>
|
|
493
493
|
/*#__PURE__*/
|
|
494
494
|
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
495
|
+
// @ts-ignore skip SortableItem type check
|
|
495
496
|
React.createElement(SortableItem, _Object$assign({
|
|
496
497
|
key: item.label,
|
|
497
498
|
index: index
|
|
@@ -502,7 +503,8 @@ class Transfer extends BaseComponent {
|
|
|
502
503
|
;
|
|
503
504
|
}, {
|
|
504
505
|
distance: 10
|
|
505
|
-
});
|
|
506
|
+
}); // @ts-ignore skip SortableItem type check
|
|
507
|
+
|
|
506
508
|
const sortList = /*#__PURE__*/React.createElement(SortableList, {
|
|
507
509
|
useDragHandle: true,
|
|
508
510
|
onSortEnd: this.onSortEnd,
|
package/lib/es/tree/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { MouseEvent } from 'react';
|
|
1
|
+
import React, { MouseEvent, KeyboardEvent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ContextValue } from '../configProvider/context';
|
|
3
4
|
import { TreeAdapter } from '@douyinfe/semi-foundation/lib/es/tree/foundation';
|
|
4
5
|
import BaseComponent from '../_base/baseComponent';
|
|
5
6
|
import Input from '../input/index';
|
|
@@ -9,7 +10,7 @@ import { TreeProps, TreeState, TreeNodeProps, TreeNodeData, FlattenNode, KeyEnti
|
|
|
9
10
|
export * from './interface';
|
|
10
11
|
export { AutoSizerProps } from './autoSizer';
|
|
11
12
|
declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
12
|
-
static contextType: React.Context<
|
|
13
|
+
static contextType: React.Context<ContextValue>;
|
|
13
14
|
static propTypes: {
|
|
14
15
|
blockNode: PropTypes.Requireable<boolean>;
|
|
15
16
|
className: PropTypes.Requireable<string>;
|
|
@@ -99,6 +100,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
99
100
|
dragNode: any;
|
|
100
101
|
onNodeClick: any;
|
|
101
102
|
onMotionEnd: any;
|
|
103
|
+
context: ContextValue;
|
|
102
104
|
constructor(props: TreeProps);
|
|
103
105
|
/**
|
|
104
106
|
* Process of getDerivedStateFromProps was inspired by rc-tree
|
|
@@ -109,18 +111,18 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
109
111
|
search: (value: string) => void;
|
|
110
112
|
renderInput(): JSX.Element;
|
|
111
113
|
renderEmpty: () => JSX.Element;
|
|
112
|
-
onNodeSelect: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
114
|
+
onNodeSelect: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
113
115
|
onNodeLoad: (data: TreeNodeData) => Promise<unknown>;
|
|
114
|
-
onNodeCheck: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
115
|
-
onNodeExpand: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
116
|
+
onNodeCheck: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
117
|
+
onNodeExpand: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
116
118
|
onNodeRightClick: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
117
119
|
onNodeDoubleClick: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
118
|
-
onNodeDragStart: (e: React.DragEvent<
|
|
119
|
-
onNodeDragEnter: (e: React.DragEvent<
|
|
120
|
-
onNodeDragOver: (e: React.DragEvent<
|
|
121
|
-
onNodeDragLeave: (e: React.DragEvent<
|
|
122
|
-
onNodeDragEnd: (e: React.DragEvent<
|
|
123
|
-
onNodeDrop: (e: React.DragEvent<
|
|
120
|
+
onNodeDragStart: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
121
|
+
onNodeDragEnter: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
122
|
+
onNodeDragOver: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
123
|
+
onNodeDragLeave: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
124
|
+
onNodeDragEnd: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
125
|
+
onNodeDrop: (e: React.DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
124
126
|
getTreeNodeRequiredProps: () => {
|
|
125
127
|
expandedKeys: Set<string>;
|
|
126
128
|
selectedKeys: string[];
|
|
@@ -5,5 +5,5 @@ export default class NodeList extends PureComponent<NodeListProps, NodeListState
|
|
|
5
5
|
constructor(props: NodeListProps);
|
|
6
6
|
static getDerivedStateFromProps(props: NodeListProps, prevState: NodeListState): {};
|
|
7
7
|
onMotionEnd: () => void;
|
|
8
|
-
render(): React.
|
|
8
|
+
render(): (string | number | boolean | React.ReactFragment | JSX.Element)[];
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode, MouseEvent, DragEvent } from 'react';
|
|
1
|
+
import React, { ReactNode, MouseEvent, DragEvent, KeyboardEvent } from 'react';
|
|
2
2
|
import { Virtualize, ExpandAction } from '@douyinfe/semi-foundation/lib/es/tree/foundation';
|
|
3
3
|
import { TreeNodeData, KeyEntities, TreeNodeProps, FlattenNode, RenderFullLabelProps } from './interface';
|
|
4
4
|
export interface TreeContextValue {
|
|
@@ -10,18 +10,18 @@ export interface TreeContextValue {
|
|
|
10
10
|
filterTreeNode?: boolean | ((inputValue: string, treeNodeString: string) => void);
|
|
11
11
|
keyEntities?: KeyEntities;
|
|
12
12
|
onNodeClick?: any;
|
|
13
|
-
onNodeExpand?: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
14
|
-
onNodeSelect?: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
15
|
-
onNodeCheck?: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
13
|
+
onNodeExpand?: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
14
|
+
onNodeSelect?: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
15
|
+
onNodeCheck?: (e: MouseEvent | KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
16
16
|
onNodeRightClick?: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
17
17
|
onNodeDoubleClick?: (e: MouseEvent, treeNode: TreeNodeProps) => void;
|
|
18
18
|
renderTreeNode?: (treeNode: FlattenNode, ind?: number, style?: React.CSSProperties) => ReactNode;
|
|
19
|
-
onNodeDragStart?: (e: DragEvent<
|
|
20
|
-
onNodeDragEnter?: (e: DragEvent<
|
|
21
|
-
onNodeDragOver?: (e: DragEvent<
|
|
22
|
-
onNodeDragLeave?: (e: DragEvent<
|
|
23
|
-
onNodeDragEnd?: (e: DragEvent<
|
|
24
|
-
onNodeDrop?: (e: DragEvent<
|
|
19
|
+
onNodeDragStart?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
20
|
+
onNodeDragEnter?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
21
|
+
onNodeDragOver?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
22
|
+
onNodeDragLeave?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
23
|
+
onNodeDragEnd?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
24
|
+
onNodeDrop?: (e: DragEvent<HTMLLIElement>, treeNode: TreeNodeProps) => void;
|
|
25
25
|
expandAction?: ExpandAction;
|
|
26
26
|
directory?: boolean;
|
|
27
27
|
multiple?: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { TreeContextValue } from './treeContext';
|
|
3
4
|
import { TreeNodeProps, TreeNodeState } from './interface';
|
|
4
5
|
export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState> {
|
|
5
|
-
static contextType: React.Context<
|
|
6
|
+
static contextType: React.Context<TreeContextValue>;
|
|
6
7
|
static propTypes: {
|
|
7
8
|
expanded: PropTypes.Requireable<boolean>;
|
|
8
9
|
selected: PropTypes.Requireable<boolean>;
|
|
@@ -28,6 +29,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
28
29
|
};
|
|
29
30
|
debounceSelect: any;
|
|
30
31
|
refNode: HTMLElement;
|
|
32
|
+
context: TreeContextValue;
|
|
31
33
|
constructor(props: TreeNodeProps);
|
|
32
34
|
onSelect: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
33
35
|
onExpand: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
@@ -43,13 +45,13 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
43
45
|
*/
|
|
44
46
|
handleliEnterPress: (e: React.KeyboardEvent) => void;
|
|
45
47
|
onDoubleClick: (e: React.MouseEvent) => void;
|
|
46
|
-
onDragStart: (e: React.DragEvent) => void;
|
|
47
|
-
onDragEnter: (e: React.DragEvent) => void;
|
|
48
|
-
onDragOver: (e: React.DragEvent) => void;
|
|
49
|
-
onDragLeave: (e: React.DragEvent) => void;
|
|
50
|
-
onDragEnd: (e: React.DragEvent) => void;
|
|
51
|
-
onDrop: (e: React.DragEvent) => void;
|
|
52
|
-
getNodeChildren: () => import("./interface").TreeNodeData[]
|
|
48
|
+
onDragStart: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
49
|
+
onDragEnter: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
50
|
+
onDragOver: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
51
|
+
onDragLeave: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
52
|
+
onDragEnd: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
53
|
+
onDrop: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
54
|
+
getNodeChildren: () => import("./interface").TreeNodeData[];
|
|
53
55
|
isLeaf: () => boolean;
|
|
54
56
|
isDisabled: () => boolean;
|
|
55
57
|
renderArrow(): JSX.Element;
|
|
@@ -58,5 +60,5 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
58
60
|
renderEmptyNode(): JSX.Element;
|
|
59
61
|
renderRealLabel: () => any;
|
|
60
62
|
setRef: (node: HTMLElement) => void;
|
|
61
|
-
render():
|
|
63
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
62
64
|
}
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -467,6 +467,7 @@ export default class TreeNode extends PureComponent {
|
|
|
467
467
|
const customLabel = renderFullLabel(_Object$assign({}, labelProps));
|
|
468
468
|
|
|
469
469
|
if (draggable) {
|
|
470
|
+
// @ts-ignore skip cloneElement type check
|
|
470
471
|
return /*#__PURE__*/React.cloneElement(customLabel, _Object$assign({
|
|
471
472
|
ref: this.setRef
|
|
472
473
|
}, dragProps));
|
|
@@ -475,6 +476,7 @@ export default class TreeNode extends PureComponent {
|
|
|
475
476
|
return customLabel;
|
|
476
477
|
} else {
|
|
477
478
|
// In virtualization, props.style will contain location information
|
|
479
|
+
// @ts-ignore skip cloneElement type check
|
|
478
480
|
return /*#__PURE__*/React.cloneElement(customLabel, {
|
|
479
481
|
style: _Object$assign(_Object$assign({}, _get(customLabel, ['props', 'style'])), style)
|
|
480
482
|
});
|