@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
|
@@ -4,6 +4,7 @@ import { Size, BasicTriggerRenderProps, BasicTreeSelectProps, BasicTreeSelectInn
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/tree/tree.css';
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/es/treeSelect/treeSelect.css';
|
|
6
6
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
7
|
+
import { ContextValue } from '../configProvider/context';
|
|
7
8
|
import Input, { InputProps } from '../input/index';
|
|
8
9
|
import TagInput from '../tagInput';
|
|
9
10
|
import { TreeProps, TreeState, FlattenNode, TreeNodeData, TreeNodeProps } from '../tree/interface';
|
|
@@ -89,7 +90,7 @@ export interface TreeSelectState extends Omit<BasicTreeSelectInnerData, Override
|
|
|
89
90
|
prevProps: TreeSelectProps;
|
|
90
91
|
}
|
|
91
92
|
declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
|
|
92
|
-
static contextType: React.Context<
|
|
93
|
+
static contextType: React.Context<ContextValue>;
|
|
93
94
|
static propTypes: {
|
|
94
95
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
95
96
|
'aria-errormessage': PropTypes.Requireable<string>;
|
|
@@ -182,6 +183,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
182
183
|
onNodeDoubleClick: any;
|
|
183
184
|
onMotionEnd: any;
|
|
184
185
|
treeSelectID: string;
|
|
186
|
+
context: ContextValue;
|
|
185
187
|
constructor(props: TreeSelectProps);
|
|
186
188
|
static getDerivedStateFromProps(props: TreeSelectProps, prevState: TreeSelectState): Partial<TreeSelectState>;
|
|
187
189
|
get adapter(): TreeSelectAdapter<TreeSelectProps, TreeSelectState>;
|
|
@@ -214,14 +216,14 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
214
216
|
renderArrow: () => JSX.Element;
|
|
215
217
|
renderClearBtn: () => JSX.Element;
|
|
216
218
|
renderSelection: () => JSX.Element;
|
|
217
|
-
renderTagItem: (key: string, idx: number) => React.
|
|
219
|
+
renderTagItem: (key: string, idx: number) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
218
220
|
renderTagInput: () => JSX.Element;
|
|
219
221
|
renderInput: () => JSX.Element;
|
|
220
222
|
renderEmpty: () => JSX.Element;
|
|
221
223
|
onNodeLoad: (data: TreeNodeData) => Promise<unknown>;
|
|
222
|
-
onNodeSelect: (e: React.MouseEvent, treeNode: TreeNodeProps) => void;
|
|
223
|
-
onNodeCheck: (e: React.MouseEvent, treeNode: TreeNodeProps) => void;
|
|
224
|
-
onNodeExpand: (e: React.MouseEvent, treeNode: TreeNodeProps) => void;
|
|
224
|
+
onNodeSelect: (e: React.MouseEvent | React.KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
225
|
+
onNodeCheck: (e: React.MouseEvent | React.KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
226
|
+
onNodeExpand: (e: React.MouseEvent | React.KeyboardEvent, treeNode: TreeNodeProps) => void;
|
|
225
227
|
getTreeNodeRequiredProps: () => {
|
|
226
228
|
expandedKeys: Set<string>;
|
|
227
229
|
selectedKeys: string[];
|
|
@@ -37,7 +37,7 @@ export declare class Copyable extends React.PureComponent<CopyableProps, Copyabl
|
|
|
37
37
|
copy: (e: React.MouseEvent) => void;
|
|
38
38
|
setCopied: (item: string, timer: number) => void;
|
|
39
39
|
resetCopied: () => void;
|
|
40
|
-
renderSuccessTip: () => React.
|
|
40
|
+
renderSuccessTip: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
41
41
|
render(): JSX.Element;
|
|
42
42
|
}
|
|
43
43
|
export default Copyable;
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface UploadProps {
|
|
|
14
14
|
beforeUpload?: (object: BeforeUploadProps) => BeforeUploadObjectResult | Promise<BeforeUploadObjectResult> | boolean;
|
|
15
15
|
beforeClear?: (fileList: Array<FileItem>) => boolean | Promise<boolean>;
|
|
16
16
|
beforeRemove?: (file: FileItem, fileList: Array<FileItem>) => boolean | Promise<boolean>;
|
|
17
|
-
capture?: boolean |
|
|
17
|
+
capture?: boolean | 'user' | 'environment' | undefined;
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
className?: string;
|
|
20
20
|
customRequest?: (object: customRequestArgs) => void;
|
|
@@ -190,7 +190,7 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
190
190
|
onDragOver: (e: DragEvent<HTMLDivElement>) => void;
|
|
191
191
|
onDragLeave: (e: DragEvent<HTMLDivElement>) => void;
|
|
192
192
|
onDragEnter: (e: DragEvent<HTMLDivElement>) => void;
|
|
193
|
-
renderAddContent: () => React.
|
|
193
|
+
renderAddContent: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
194
194
|
renderDragArea: () => ReactNode;
|
|
195
195
|
render(): ReactNode;
|
|
196
196
|
}
|
package/list/index.tsx
CHANGED
package/list/item.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/list/constants';
|
|
5
5
|
import { noop } from 'lodash';
|
|
6
6
|
import { Col } from '../grid';
|
|
7
|
-
import ListContext from './list-context';
|
|
7
|
+
import ListContext, { ListContextValue } from './list-context';
|
|
8
8
|
|
|
9
9
|
export interface ListItemProps {
|
|
10
10
|
extra?: React.ReactNode;
|
|
@@ -12,6 +12,7 @@ export interface ListItemProps {
|
|
|
12
12
|
main?: React.ReactNode;
|
|
13
13
|
align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
|
|
14
14
|
className?: string;
|
|
15
|
+
children?: React.ReactNode | undefined;
|
|
15
16
|
style?: React.CSSProperties;
|
|
16
17
|
onClick?: React.MouseEventHandler<HTMLLIElement>;
|
|
17
18
|
onRightClick?: React.MouseEventHandler<HTMLLIElement>;
|
|
@@ -29,6 +30,7 @@ export default class ListItem extends PureComponent<ListItemProps> {
|
|
|
29
30
|
main: PropTypes.node,
|
|
30
31
|
align: PropTypes.oneOf(strings.ALIGN),
|
|
31
32
|
className: PropTypes.string,
|
|
33
|
+
children: PropTypes.node,
|
|
32
34
|
style: PropTypes.object,
|
|
33
35
|
onClick: PropTypes.func,
|
|
34
36
|
onRightClick: PropTypes.func,
|
|
@@ -42,6 +44,8 @@ export default class ListItem extends PureComponent<ListItemProps> {
|
|
|
42
44
|
onMouseLeave: noop,
|
|
43
45
|
};
|
|
44
46
|
|
|
47
|
+
context: ListContextValue;
|
|
48
|
+
|
|
45
49
|
wrapWithGrid(content: React.ReactNode) {
|
|
46
50
|
const { grid } = this.context;
|
|
47
51
|
const { gutter, justify, type, align, ...rest } = grid;
|
|
@@ -85,6 +89,7 @@ export default class ListItem extends PureComponent<ListItemProps> {
|
|
|
85
89
|
);
|
|
86
90
|
}
|
|
87
91
|
let content = (
|
|
92
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
88
93
|
<li
|
|
89
94
|
className={itemCls}
|
|
90
95
|
style={style}
|
package/modal/Modal.tsx
CHANGED
|
@@ -22,6 +22,7 @@ export type Directions = 'ltr' | 'rtl';
|
|
|
22
22
|
|
|
23
23
|
export interface ModalReactProps extends ModalProps {
|
|
24
24
|
cancelButtonProps?: ButtonProps;
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
25
26
|
okButtonProps?: ButtonProps;
|
|
26
27
|
bodyStyle?: CSSProperties;
|
|
27
28
|
maskStyle?: CSSProperties;
|
package/modal/ModalContent.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import React, { CSSProperties } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import cls from 'classnames';
|
|
5
5
|
import { cssClasses } from '@douyinfe/semi-foundation/modal/constants';
|
|
6
|
-
import ConfigContext from '../configProvider/context';
|
|
6
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
7
7
|
import Button from '../iconButton';
|
|
8
8
|
import Typography from '../typography';
|
|
9
9
|
import BaseComponent from '../_base/baseComponent';
|
|
@@ -19,7 +19,11 @@ import { getActiveElement } from '../_utils';
|
|
|
19
19
|
|
|
20
20
|
let uuid = 0;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
export interface ModalContentReactProps extends ModalContentProps {
|
|
24
|
+
children?: React.ReactNode | undefined;
|
|
25
|
+
}
|
|
26
|
+
export default class ModalContent extends BaseComponent<ModalContentReactProps, ModalContentState> {
|
|
23
27
|
static contextType = ConfigContext;
|
|
24
28
|
static propTypes = {
|
|
25
29
|
close: PropTypes.func,
|
|
@@ -40,6 +44,8 @@ export default class ModalContent extends BaseComponent<ModalContentProps, Modal
|
|
|
40
44
|
|
|
41
45
|
modalDialogRef: React.MutableRefObject<HTMLDivElement>;
|
|
42
46
|
foundation: ModalContentFoundation;
|
|
47
|
+
context: ContextValue;
|
|
48
|
+
|
|
43
49
|
constructor(props: ModalContentProps) {
|
|
44
50
|
super(props);
|
|
45
51
|
this.state = {
|
|
@@ -255,7 +261,7 @@ export default class ModalContent extends BaseComponent<ModalContentProps, Modal
|
|
|
255
261
|
onAnimationEnd={props.onAnimationEnd}
|
|
256
262
|
className={cls([`${cssClasses.DIALOG}-content`,
|
|
257
263
|
props.contentClassName,
|
|
258
|
-
{[`${cssClasses.DIALOG}-content-fullScreen`]: props.isFullScreen }])}>
|
|
264
|
+
{ [`${cssClasses.DIALOG}-content-fullScreen`]: props.isFullScreen }])}>
|
|
259
265
|
{header}
|
|
260
266
|
{body}
|
|
261
267
|
{footer}
|
package/navigation/Footer.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { strings, cssClasses } from '@douyinfe/semi-foundation/navigation/consta
|
|
|
6
6
|
import CollapseButton from './CollapseButton';
|
|
7
7
|
import '@douyinfe/semi-foundation/navigation/navigation.scss';
|
|
8
8
|
|
|
9
|
-
import NavContext from './nav-context';
|
|
9
|
+
import NavContext, { NavContextType } from './nav-context';
|
|
10
10
|
import { BaseProps } from '../_base/baseComponent';
|
|
11
11
|
|
|
12
12
|
export interface NavFooterProps extends BaseProps {
|
|
@@ -28,6 +28,8 @@ export default class NavFooter extends PureComponent<NavFooterProps> {
|
|
|
28
28
|
static defaultProps = {
|
|
29
29
|
collapseButton: false,
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
context: NavContextType;
|
|
31
33
|
|
|
32
34
|
renderCollapseButton = () => {
|
|
33
35
|
const { collapseButton, collapseText } = this.props;
|
package/navigation/Header.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import isNullOrUndefined from '@douyinfe/semi-foundation/utils/isNullOrUndefined
|
|
|
6
6
|
import { cssClasses } from '@douyinfe/semi-foundation/navigation/constants';
|
|
7
7
|
import '@douyinfe/semi-foundation/navigation/navigation.scss';
|
|
8
8
|
|
|
9
|
-
import NavContext from './nav-context';
|
|
9
|
+
import NavContext, { NavContextType } from './nav-context';
|
|
10
10
|
import { BaseProps } from '../_base/baseComponent';
|
|
11
11
|
|
|
12
12
|
export type Logo = React.ReactNode;
|
|
@@ -37,6 +37,8 @@ export default class NavHeader extends PureComponent<NavHeaderProps> {
|
|
|
37
37
|
prefixCls: cssClasses.PREFIX,
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
context: NavContextType;
|
|
41
|
+
|
|
40
42
|
renderLogo(logo: React.ReactNode) {
|
|
41
43
|
if (React.isValidElement(logo)) {
|
|
42
44
|
return logo;
|
package/navigation/Item.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import ItemFoundation, {
|
|
|
16
16
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/navigation/constants';
|
|
17
17
|
|
|
18
18
|
import Tooltip from '../tooltip';
|
|
19
|
-
import NavContext from './nav-context';
|
|
19
|
+
import NavContext, { NavContextType } from './nav-context';
|
|
20
20
|
import Dropdown from '../dropdown';
|
|
21
21
|
|
|
22
22
|
const clsPrefix = `${cssClasses.PREFIX}-item`;
|
|
@@ -81,6 +81,7 @@ export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
foundation: ItemFoundation;
|
|
84
|
+
context: NavContextType;
|
|
84
85
|
constructor(props: NavItemProps) {
|
|
85
86
|
super(props);
|
|
86
87
|
this.state = {
|
|
@@ -112,9 +113,9 @@ export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
|
112
113
|
notifyMouseLeave: (...args) => this.props.onMouseLeave(...args),
|
|
113
114
|
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed) || false,
|
|
114
115
|
getSelected: () =>
|
|
115
|
-
Boolean(this.context && this.context.selectedKeys && this.context.selectedKeys.includes(this.props.itemKey)),
|
|
116
|
+
Boolean(this.context && this.context.selectedKeys && this.context.selectedKeys.includes(this.props.itemKey as string)),
|
|
116
117
|
getIsOpen: () =>
|
|
117
|
-
Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey)),
|
|
118
|
+
Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey as string)),
|
|
118
119
|
};
|
|
119
120
|
}
|
|
120
121
|
|
|
@@ -9,7 +9,8 @@ const formatStyle = function formatStyle({ rotate = 0 }) {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export interface OpenIconTransitionProps {
|
|
12
|
-
children?: React.ReactNode;
|
|
12
|
+
children?: React.ReactNode | ((transitionArgus?: any) => React.ReactNode);
|
|
13
|
+
isCollapsed?: boolean;
|
|
13
14
|
isOpen?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
package/navigation/SubNav.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import { IconChevronDown, IconChevronUp, IconChevronRight } from '@douyinfe/semi
|
|
|
14
14
|
|
|
15
15
|
import NavItem from './Item';
|
|
16
16
|
import Dropdown, { DropdownProps } from '../dropdown';
|
|
17
|
-
import NavContext from './nav-context';
|
|
17
|
+
import NavContext, { NavContextType } from './nav-context';
|
|
18
18
|
|
|
19
19
|
import { times, get } from 'lodash';
|
|
20
20
|
|
|
@@ -116,6 +116,7 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
116
116
|
titleRef: React.RefObject<HTMLDivElement>;
|
|
117
117
|
itemRef: React.RefObject<HTMLLIElement>;
|
|
118
118
|
foundation: SubNavFoundation;
|
|
119
|
+
context: NavContextType;
|
|
119
120
|
constructor(props: SubNavProps) {
|
|
120
121
|
super(props);
|
|
121
122
|
this.state = {
|
|
@@ -162,9 +163,9 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
162
163
|
notifyGlobalOpenChange: (...args) => this._invokeContextFunc('onOpenChange', ...args),
|
|
163
164
|
notifyGlobalOnSelect: (...args) => this._invokeContextFunc('onSelect', ...args),
|
|
164
165
|
notifyGlobalOnClick: (...args) => this._invokeContextFunc('onClick', ...args),
|
|
165
|
-
getIsSelected: itemKey => Boolean(!isNullOrUndefined(itemKey) && get(this.context, 'selectedKeys', []).includes(itemKey)),
|
|
166
|
+
getIsSelected: itemKey => Boolean(!isNullOrUndefined(itemKey) && get(this.context, 'selectedKeys', []).includes(String(itemKey))),
|
|
166
167
|
getIsOpen: () =>
|
|
167
|
-
Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey)),
|
|
168
|
+
Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(String(this.props.itemKey))),
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -13,7 +13,7 @@ const formatStyle = function formatStyle({ maxHeight, opacity }: { maxHeight: nu
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export interface SubNavTransitionProps {
|
|
16
|
-
children?: React.ReactNode;
|
|
16
|
+
children?: React.ReactNode | ((transitionProps?: any) => React.ReactNode);
|
|
17
17
|
isCollapsed?: boolean;
|
|
18
18
|
maxHeight?: number;
|
|
19
19
|
motion?: Motion;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { NavProps } from './index';
|
|
4
|
+
import { Locale } from '../locale/interface';
|
|
5
|
+
export interface NavContextType {
|
|
6
|
+
isCollapsed?: boolean;
|
|
7
|
+
mode?: NavProps['mode'];
|
|
8
|
+
openKeys?: string[];
|
|
9
|
+
onCollapseChange?: NavProps['onCollapseChange'];
|
|
10
|
+
prefixCls?: string;
|
|
11
|
+
selectedKeys?: string[];
|
|
12
|
+
toggleIconPosition?: string;
|
|
13
|
+
selectedKeysIsControlled?: boolean;
|
|
14
|
+
openKeysIsControlled?: boolean;
|
|
15
|
+
limitIndent?: boolean;
|
|
16
|
+
isInSubNav?: boolean;
|
|
17
|
+
locale?: Locale['Navigation'];
|
|
18
|
+
subNavMotion?: NavProps['subNavMotion'];
|
|
19
|
+
subNavCloseDelay?: NavProps['subNavCloseDelay'];
|
|
20
|
+
subNavOpenDelay?: NavProps['subNavOpenDelay'];
|
|
21
|
+
canUpdateOpenKeys?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const NavContext = React.createContext<NavContextType>({
|
|
4
25
|
isCollapsed: false,
|
|
5
26
|
selectedKeys: [],
|
|
6
27
|
openKeys: [],
|
|
@@ -9,7 +9,7 @@ export type ArgsType<T> = T extends (...args: infer A) => any ? A : never;
|
|
|
9
9
|
export interface NoticeTransitionProps{
|
|
10
10
|
position?: NoticePosition;
|
|
11
11
|
motion?: Motion<NoticeTransitionProps>;
|
|
12
|
-
children?:
|
|
12
|
+
children?: React.ReactNode | ((TransitionProps?: any) => React.ReactNode);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
type NoticeTransitionFormatFuncType = (styles: { translate: string;opacity: string | number }) => any;
|
package/notification/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { CSSProperties } from 'react';
|
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import cls from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import ConfigContext from '../configProvider/context';
|
|
5
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
6
6
|
import NotificationListFoundation, {
|
|
7
7
|
ConfigProps, NotificationListAdapter,
|
|
8
8
|
NotificationListProps,
|
|
@@ -75,6 +75,8 @@ class NotificationList extends BaseComponent<NotificationListProps, Notification
|
|
|
75
75
|
this.foundation = new NotificationListFoundation(this.adapter);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
context: ContextValue;
|
|
79
|
+
|
|
78
80
|
get adapter(): NotificationListAdapter {
|
|
79
81
|
return {
|
|
80
82
|
...super.adapter,
|
package/notification/notice.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import cls from 'classnames';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import ConfigContext from '../configProvider/context';
|
|
5
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
6
6
|
import { cssClasses, numbers, strings } from '@douyinfe/semi-foundation/notification/constants';
|
|
7
7
|
import NotificationFoundation, {
|
|
8
8
|
NoticeAdapter,
|
|
@@ -82,6 +82,8 @@ class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
|
|
|
82
82
|
this.foundation = new NotificationFoundation(this.adapter);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
context: ContextValue;
|
|
86
|
+
|
|
85
87
|
componentWillUnmount() {
|
|
86
88
|
this.foundation.destroy();
|
|
87
89
|
}
|
|
@@ -5,6 +5,7 @@ import { isEqual, isEmpty } from 'lodash';
|
|
|
5
5
|
export interface ReactIntersectionObserverProps {
|
|
6
6
|
onIntersect?: IntersectionObserverCallback;
|
|
7
7
|
option?: IntersectionObserverInit;
|
|
8
|
+
children?: React.ReactNode;
|
|
8
9
|
root?: IntersectionObserverInit['root'];
|
|
9
10
|
threshold?: IntersectionObserverInit['threshold'];
|
|
10
11
|
rootMargin?: IntersectionObserverInit['rootMargin'];
|
|
@@ -86,7 +87,7 @@ export default class ReactIntersectionObserver extends React.PureComponent<React
|
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
render()
|
|
90
|
+
render() {
|
|
90
91
|
const { children } = this.props;
|
|
91
92
|
return children;
|
|
92
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.9.0-beta.
|
|
3
|
+
"version": "2.9.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
|
-
"@douyinfe/semi-animation": "2.9.0-beta.
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.9.0-beta.
|
|
19
|
-
"@douyinfe/semi-foundation": "2.9.0-beta.
|
|
20
|
-
"@douyinfe/semi-icons": "2.9.0-beta.
|
|
21
|
-
"@douyinfe/semi-illustrations": "2.9.0-beta.
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.9.0-beta.
|
|
17
|
+
"@douyinfe/semi-animation": "2.9.0-beta.1",
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.9.0-beta.1",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.9.0-beta.1",
|
|
20
|
+
"@douyinfe/semi-icons": "2.9.0-beta.1",
|
|
21
|
+
"@douyinfe/semi-illustrations": "2.9.0-beta.1",
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.9.0-beta.1",
|
|
23
23
|
"@types/react-window": "^1.8.2",
|
|
24
24
|
"async-validator": "^3.5.0",
|
|
25
25
|
"classnames": "^2.2.6",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b246f204d2f33e5de4155b5d0377eace25b6456f",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.9.0-beta.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.9.0-beta.1",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"babel-loader": "^8.2.2",
|
package/pagination/index.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import { numbers as popoverNumbers } from '@douyinfe/semi-foundation/popover/con
|
|
|
17
17
|
import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons';
|
|
18
18
|
import warning from '@douyinfe/semi-foundation/utils/warning';
|
|
19
19
|
|
|
20
|
-
import ConfigContext from '../configProvider/context';
|
|
20
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
21
21
|
import LocaleConsumer from '../locale/localeConsumer';
|
|
22
22
|
import { Locale } from '../locale/interface';
|
|
23
23
|
import Select from '../select/index';
|
|
@@ -135,6 +135,8 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
context: ContextValue;
|
|
139
|
+
|
|
138
140
|
get adapter(): PaginationAdapter<PaginationProps, PaginationState> {
|
|
139
141
|
return {
|
|
140
142
|
...super.adapter,
|
|
@@ -371,6 +373,7 @@ export default class Pagination extends BaseComponent<PaginationProps, Paginatio
|
|
|
371
373
|
const itemHeight = 32;
|
|
372
374
|
const listHeight = count >= 5 ? itemHeight * 5 : itemHeight * count;
|
|
373
375
|
return (
|
|
376
|
+
// @ts-ignore skip type check cause react-window not update with @types/react 18
|
|
374
377
|
<List
|
|
375
378
|
className={`${prefixCls}-rest-list`}
|
|
376
379
|
itemData={restList}
|
package/popconfirm/index.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import Popover, { PopoverProps } from '../popover';
|
|
|
11
11
|
import { Position, Trigger } from '../tooltip';
|
|
12
12
|
import Button, { ButtonProps } from '../button';
|
|
13
13
|
import { Type as ButtonType } from '../button/Button';
|
|
14
|
-
import ConfigContext from '../configProvider/context';
|
|
14
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
15
15
|
import LocaleConsumer from '../locale/localeConsumer';
|
|
16
16
|
import { Locale as LocaleObject } from '../locale/interface';
|
|
17
17
|
import '@douyinfe/semi-foundation/popconfirm/popconfirm.scss';
|
|
@@ -105,6 +105,8 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
105
105
|
this.foundation = new PopconfirmFoundation(this.adapter);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
context: ContextValue;
|
|
109
|
+
|
|
108
110
|
static getDerivedStateFromProps(props: PopconfirmProps, state: PopconfirmState) {
|
|
109
111
|
const willUpdateStates: Partial<PopconfirmState> = {};
|
|
110
112
|
const { hasOwnProperty } = Object.prototype;
|
package/popover/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import ConfigContext from '../configProvider/context';
|
|
4
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
5
5
|
import { cssClasses, strings, numbers } from '@douyinfe/semi-foundation/popover/constants';
|
|
6
6
|
import Tooltip, { ArrowBounding, Position, TooltipProps, Trigger, RenderContentProps } from '../tooltip/index';
|
|
7
7
|
import Arrow from './Arrow';
|
|
@@ -101,6 +101,8 @@ class Popover extends React.PureComponent<PopoverProps, PopoverState> {
|
|
|
101
101
|
guardFocus: true,
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
context: ContextValue;
|
|
105
|
+
|
|
104
106
|
renderPopCard = ({ initialFocusRef }: { initialFocusRef: RenderContentProps['initialFocusRef'] }) => {
|
|
105
107
|
const { content, contentClassName, prefixCls } = this.props;
|
|
106
108
|
const { direction } = this.context;
|
package/radio/radio.tsx
CHANGED
package/radio/radioGroup.tsx
CHANGED
|
@@ -30,6 +30,7 @@ export type RadioGroupProps = {
|
|
|
30
30
|
value?: string | number;
|
|
31
31
|
onChange?: (event: RadioChangeEvent) => void;
|
|
32
32
|
className?: string;
|
|
33
|
+
children?: React.ReactNode | undefined;
|
|
33
34
|
style?: React.CSSProperties;
|
|
34
35
|
direction?: ArrayElement<typeof strings.DIRECTION_SET>;
|
|
35
36
|
mode?: RadioMode;
|
package/select/index.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import React, { Fragment, MouseEvent, ReactInstance } from 'react';
|
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import cls from 'classnames';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import ConfigContext from '../configProvider/context';
|
|
7
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
8
8
|
import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/select/foundation';
|
|
9
9
|
import { cssClasses, strings, numbers } from '@douyinfe/semi-foundation/select/constants';
|
|
10
10
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
@@ -321,6 +321,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
321
321
|
selectOptionListID: string;
|
|
322
322
|
clickOutsideHandler: (e: MouseEvent) => void;
|
|
323
323
|
foundation: SelectFoundation;
|
|
324
|
+
context: ContextValue;
|
|
324
325
|
|
|
325
326
|
constructor(props: SelectProps) {
|
|
326
327
|
super(props);
|
package/select/utils.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import React, { CSSProperties } from 'react';
|
|
|
4
4
|
import { Motion } from '../_base/base';
|
|
5
5
|
|
|
6
6
|
export interface SideSheetTransitionProps{
|
|
7
|
-
children?: React.
|
|
7
|
+
children?: React.ReactNode | ((TransitionProps: any) => React.ReactNode);
|
|
8
8
|
motion?: Motion<SideSheetTransitionProps>;
|
|
9
9
|
controlled?: boolean;
|
|
10
10
|
visible?: boolean;
|
package/sideSheet/index.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Portal from '../_portal';
|
|
6
6
|
import cls from 'classnames';
|
|
7
|
-
import ConfigContext from '../configProvider/context';
|
|
7
|
+
import ConfigContext, { ContextValue } from '../configProvider/context';
|
|
8
8
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/sideSheet/constants';
|
|
9
9
|
import SideSheetTransition from './SideSheetTransition';
|
|
10
10
|
import SideSheetContent from './SideSheetContent';
|
|
@@ -32,7 +32,6 @@ export interface SideSheetReactProps extends SideSheetProps {
|
|
|
32
32
|
footer?: React.ReactNode;
|
|
33
33
|
children?: React.ReactNode;
|
|
34
34
|
onCancel?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
35
|
-
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
export {
|
|
@@ -93,6 +92,8 @@ export default class SideSheet extends BaseComponent<SideSheetReactProps, SideSh
|
|
|
93
92
|
this._active = false;
|
|
94
93
|
}
|
|
95
94
|
|
|
95
|
+
context: ContextValue;
|
|
96
|
+
|
|
96
97
|
get adapter(): SideSheetAdapter {
|
|
97
98
|
return {
|
|
98
99
|
...super.adapter,
|
|
@@ -7,7 +7,7 @@ import { get, set, isNull } from 'lodash';
|
|
|
7
7
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/table/constants';
|
|
8
8
|
import { arrayAdd, filterColumns } from '@douyinfe/semi-foundation/table/utils';
|
|
9
9
|
import Store from '@douyinfe/semi-foundation/utils/Store';
|
|
10
|
-
import TableContext from '../table-context';
|
|
10
|
+
import TableContext, { TableContextProps } from '../table-context';
|
|
11
11
|
import TableRow from './BaseRow';
|
|
12
12
|
import { amendTableWidth } from '../utils';
|
|
13
13
|
import { ColumnProps, ExpandIcon, TableComponents, Virtualized, Fixed } from '../interface';
|
|
@@ -68,6 +68,8 @@ export default class TableExpandedRow extends PureComponent<TableExpandedRowProp
|
|
|
68
68
|
prefixCls: cssClasses.PREFIX,
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
context: TableContextProps;
|
|
72
|
+
|
|
71
73
|
render() {
|
|
72
74
|
const {
|
|
73
75
|
record,
|
|
@@ -10,7 +10,7 @@ import Store from '@douyinfe/semi-foundation/utils/Store';
|
|
|
10
10
|
import { cssClasses, strings } from '@douyinfe/semi-foundation/table/constants';
|
|
11
11
|
import { filterColumns } from '@douyinfe/semi-foundation/table/utils';
|
|
12
12
|
import BaseRow from './BaseRow';
|
|
13
|
-
import TableContext from '../table-context';
|
|
13
|
+
import TableContext, { TableContextProps } from '../table-context';
|
|
14
14
|
import {
|
|
15
15
|
ColumnProps,
|
|
16
16
|
RenderGroupSection,
|
|
@@ -79,6 +79,8 @@ class SectionRow extends PureComponent<SectionRowProps> {
|
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
+
context: TableContextProps;
|
|
83
|
+
|
|
82
84
|
onRow = (...args: any[]): OnRowReturnObject => {
|
|
83
85
|
const { onGroupedRow, clickGroupedRowToExpand, onExpand, groupKey, expanded } = this.props;
|
|
84
86
|
const rowProps: { onClick?: (e: React.MouseEvent) => void } = {};
|
package/table/Body/index.tsx
CHANGED
|
@@ -30,7 +30,7 @@ import ExpandedRow from './ExpandedRow';
|
|
|
30
30
|
import SectionRow from './SectionRow';
|
|
31
31
|
import TableHeader from '../TableHeader';
|
|
32
32
|
import ConfigContext from '../../configProvider/context';
|
|
33
|
-
import TableContext from '../table-context';
|
|
33
|
+
import TableContext, { TableContextProps } from '../table-context';
|
|
34
34
|
import {
|
|
35
35
|
ExpandedRowRender,
|
|
36
36
|
Virtualized,
|
|
@@ -132,6 +132,7 @@ class Body extends BaseComponent<BodyProps, BodyState> {
|
|
|
132
132
|
foundation: BodyFoundation;
|
|
133
133
|
cellWidths: number[];
|
|
134
134
|
flattenedColumns: ColumnProps[];
|
|
135
|
+
context: TableContextProps;
|
|
135
136
|
constructor(props: BodyProps, context: BodyContext) {
|
|
136
137
|
super(props);
|
|
137
138
|
this.ref = React.createRef();
|
|
@@ -271,7 +272,7 @@ class Body extends BaseComponent<BodyProps, BodyState> {
|
|
|
271
272
|
|
|
272
273
|
itemKey = (index: number, data: Array<FlattenData | GroupFlattenData>) => get(data, [index, 'key'], index);
|
|
273
274
|
|
|
274
|
-
handleRowClick = (rowKey: RowKey<any>, e: React.MouseEvent
|
|
275
|
+
handleRowClick = (rowKey: RowKey<any>, e: React.MouseEvent<HTMLElement>, expand: boolean) => {
|
|
275
276
|
const { handleRowExpanded } = this.context;
|
|
276
277
|
handleRowExpanded(!expand, rowKey, e);
|
|
277
278
|
};
|