@douyinfe/semi-ui 2.9.0-beta.0 → 2.9.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/__test__/anchor.test.js +1 -0
- package/anchor/_story/anchor.stories.js +23 -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/_story/badge.stories.js +34 -2
- 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/_story/cascader.stories.js +17 -2
- package/cascader/index.tsx +4 -3
- package/cascader/item.tsx +3 -1
- package/checkbox/_story/checkbox.stories.js +1 -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 +5 -0
- package/collapsible/index.tsx +2 -2
- package/configProvider/context.tsx +1 -1
- package/datePicker/_story/datePicker.stories.js +37 -0
- package/datePicker/datePicker.tsx +2 -1
- package/descriptions/index.tsx +2 -1
- package/descriptions/item.tsx +4 -1
- package/dist/css/semi.css +2 -2
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +7560 -3681
- 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 +9 -6
- 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/input/__test__/input.test.js +12 -3
- package/input/__test__/textArea.test.js +53 -0
- 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/index.js +1 -1
- 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/collapse/item.js +4 -2
- 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/hoc/withField.js +6 -4
- 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/Modal.js +3 -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/scrollList/scrollItem.js +5 -1
- 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/TabPane.js +4 -0
- package/lib/cjs/tabs/index.js +2 -0
- 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/tooltip/index.js +1 -1
- package/lib/cjs/transfer/index.d.ts +4 -3
- package/lib/cjs/transfer/index.js +5 -2
- 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/index.js +1 -1
- 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/collapse/item.js +4 -2
- 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/hoc/withField.js +6 -4
- 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/Modal.js +3 -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/scrollList/scrollItem.js +5 -1
- 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/TabPane.js +4 -0
- package/lib/es/tabs/index.js +2 -0
- 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/tooltip/index.js +1 -1
- package/lib/es/transfer/index.d.ts +4 -3
- package/lib/es/transfer/index.js +6 -2
- 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 +3 -0
- package/modal/ModalContent.tsx +9 -3
- package/modal/confirm.tsx +1 -1
- 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/_story/overflowList.stories.js +44 -0
- 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/scrollList/_story/SingleWheelList/index.js +72 -0
- package/scrollList/_story/scrolllist.stories.js +7 -0
- package/scrollList/scrollItem.tsx +4 -1
- 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/__test__/table.test.js +1 -0
- package/table/table-context.ts +10 -6
- package/tabs/TabPane.tsx +4 -0
- package/tabs/_story/tabs.stories.js +72 -0
- package/tabs/index.tsx +3 -2
- package/tabs/interface.ts +2 -1
- package/tag/group.tsx +5 -5
- package/tagInput/_story/tagInput.stories.js +14 -1
- package/timePicker/TimePicker.tsx +2 -2
- package/timePicker/_story/timepicker.stories.js +20 -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/_story/tooltip.stories.js +127 -15
- package/tooltip/index.tsx +3 -2
- package/transfer/index.tsx +7 -2
- 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/typography/__test__/typography.test.js +1 -0
- package/upload/__test__/upload.test.js +2 -0
- package/upload/_story/upload.stories.js +2 -2
- package/upload/index.tsx +1 -1
package/lib/cjs/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/cjs/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/cjs/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(): string | number | true | React.ReactElement<any, string | React.JSXElementConstructor<any>> | 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/cjs/tooltip/constants';
|
|
7
7
|
import '@douyinfe/semi-foundation/lib/cjs/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;
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -258,7 +258,7 @@ class Tooltip extends _baseComponent.default {
|
|
|
258
258
|
}, portalEventSet, {
|
|
259
259
|
"x-placement": placement,
|
|
260
260
|
style: (0, _assign.default)({
|
|
261
|
-
visibility: motion ?
|
|
261
|
+
visibility: motion ? 'hidden' : 'visible'
|
|
262
262
|
}, style)
|
|
263
263
|
}), contentNode, icon);
|
|
264
264
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -39,6 +39,7 @@ export interface SourcePanelProps {
|
|
|
39
39
|
noMatch: boolean;
|
|
40
40
|
filterData: Array<DataItem>;
|
|
41
41
|
sourceData: Array<DataItem>;
|
|
42
|
+
propsDataSource: DataSource;
|
|
42
43
|
allChecked: boolean;
|
|
43
44
|
showNumber: number;
|
|
44
45
|
inputValue: string;
|
|
@@ -150,15 +151,15 @@ declare class Transfer extends BaseComponent<TransferProps, TransferState> {
|
|
|
150
151
|
onSortEnd(callbackProps: OnSortEndProps): void;
|
|
151
152
|
renderFilter(locale: Locale['Transfer']): JSX.Element;
|
|
152
153
|
renderHeader(headerConfig: HeaderConfig): JSX.Element;
|
|
153
|
-
renderLeftItem(item: ResolvedDataItem, index: number): React.
|
|
154
|
-
renderLeft(locale: Locale['Transfer']): React.
|
|
154
|
+
renderLeftItem(item: ResolvedDataItem, index: number): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
155
|
+
renderLeft(locale: Locale['Transfer']): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
155
156
|
renderGroupTitle(group: GroupItem, index: number): JSX.Element;
|
|
156
157
|
renderLeftTree(): JSX.Element;
|
|
157
158
|
renderLeftList(visibileItems: Array<ResolvedDataItem>): JSX.Element;
|
|
158
159
|
renderRightItem(item: ResolvedDataItem): React.ReactNode;
|
|
159
160
|
renderEmpty(type: string, emptyText: React.ReactNode): JSX.Element;
|
|
160
161
|
renderRightSortableList(selectedData: Array<ResolvedDataItem>): JSX.Element;
|
|
161
|
-
renderRight(locale: Locale['Transfer']): React.
|
|
162
|
+
renderRight(locale: Locale['Transfer']): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
162
163
|
render(): JSX.Element;
|
|
163
164
|
}
|
|
164
165
|
export default Transfer;
|
|
@@ -296,7 +296,8 @@ class Transfer extends _baseComponent.default {
|
|
|
296
296
|
loading,
|
|
297
297
|
type,
|
|
298
298
|
emptyContent,
|
|
299
|
-
renderSourcePanel
|
|
299
|
+
renderSourcePanel,
|
|
300
|
+
dataSource
|
|
300
301
|
} = this.props;
|
|
301
302
|
const totalToken = locale.total;
|
|
302
303
|
const inSearchMode = inputValue !== '';
|
|
@@ -356,6 +357,7 @@ class Transfer extends _baseComponent.default {
|
|
|
356
357
|
noMatch,
|
|
357
358
|
filterData,
|
|
358
359
|
sourceData: data,
|
|
360
|
+
propsDataSource: dataSource,
|
|
359
361
|
allChecked: !leftContainesNotInSelected,
|
|
360
362
|
showNumber,
|
|
361
363
|
inputValue,
|
|
@@ -533,6 +535,7 @@ class Transfer extends _baseComponent.default {
|
|
|
533
535
|
}, (0, _map2.default)(items).call(items, (item, index) =>
|
|
534
536
|
/*#__PURE__*/
|
|
535
537
|
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
538
|
+
// @ts-ignore skip SortableItem type check
|
|
536
539
|
_react.default.createElement(SortableItem, (0, _assign.default)({
|
|
537
540
|
key: item.label,
|
|
538
541
|
index: index
|
|
@@ -543,7 +546,7 @@ class Transfer extends _baseComponent.default {
|
|
|
543
546
|
;
|
|
544
547
|
}, {
|
|
545
548
|
distance: 10
|
|
546
|
-
});
|
|
549
|
+
}); // @ts-ignore skip SortableItem type check
|
|
547
550
|
|
|
548
551
|
const sortList = /*#__PURE__*/_react.default.createElement(SortableList, {
|
|
549
552
|
useDragHandle: true,
|
package/lib/cjs/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/cjs/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/cjs/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/cjs/tree/treeNode.js
CHANGED
|
@@ -504,6 +504,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
504
504
|
const customLabel = renderFullLabel((0, _assign.default)({}, labelProps));
|
|
505
505
|
|
|
506
506
|
if (draggable) {
|
|
507
|
+
// @ts-ignore skip cloneElement type check
|
|
507
508
|
return /*#__PURE__*/_react.default.cloneElement(customLabel, (0, _assign.default)({
|
|
508
509
|
ref: this.setRef
|
|
509
510
|
}, dragProps));
|
|
@@ -512,6 +513,7 @@ class TreeNode extends _react.PureComponent {
|
|
|
512
513
|
return customLabel;
|
|
513
514
|
} else {
|
|
514
515
|
// In virtualization, props.style will contain location information
|
|
516
|
+
// @ts-ignore skip cloneElement type check
|
|
515
517
|
return /*#__PURE__*/_react.default.cloneElement(customLabel, {
|
|
516
518
|
style: (0, _assign.default)((0, _assign.default)({}, (0, _get2.default)(customLabel, ['props', 'style'])), style)
|
|
517
519
|
});
|
|
@@ -4,6 +4,7 @@ import { Size, BasicTriggerRenderProps, BasicTreeSelectProps, BasicTreeSelectInn
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/cjs/tree/tree.css';
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/cjs/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;
|
|
@@ -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
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The Semi Foundation / Adapter architecture split was inspired by Material Component For Web. (https://github.com/material-components/material-components-web)
|
|
3
3
|
* We re-implemented our own code based on the principle and added more functions we need according to actual needs.
|
|
4
4
|
*/
|
|
5
|
-
import React, { Component } from 'react';
|
|
5
|
+
import React, { Component, ReactNode } from 'react';
|
|
6
6
|
import { DefaultAdapter } from '@douyinfe/semi-foundation/lib/es/base/foundation';
|
|
7
7
|
import { VALIDATE_STATUS } from '@douyinfe/semi-foundation/lib/es/base/constants';
|
|
8
8
|
import { ArrayElement } from './base';
|
|
@@ -10,6 +10,7 @@ export declare type ValidateStatus = ArrayElement<typeof VALIDATE_STATUS>;
|
|
|
10
10
|
export interface BaseProps {
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
className?: string;
|
|
13
|
+
children?: ReactNode | undefined | any;
|
|
13
14
|
}
|
|
14
15
|
export default class BaseComponent<P extends BaseProps = {}, S = {}> extends Component<P, S> {
|
|
15
16
|
static propTypes: {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ContextValue } from '../configProvider/context';
|
|
3
4
|
import '@douyinfe/semi-foundation/lib/es/_portal/portal.css';
|
|
4
5
|
export interface PortalProps {
|
|
5
6
|
children: React.ReactNode;
|
|
@@ -13,7 +14,7 @@ export interface PortalState {
|
|
|
13
14
|
container: undefined | HTMLElement;
|
|
14
15
|
}
|
|
15
16
|
declare class Portal extends PureComponent<PortalProps, PortalState> {
|
|
16
|
-
static contextType: React.Context<
|
|
17
|
+
static contextType: React.Context<ContextValue>;
|
|
17
18
|
static defaultProps: {
|
|
18
19
|
prefixCls: string;
|
|
19
20
|
};
|
|
@@ -25,6 +26,7 @@ declare class Portal extends PureComponent<PortalProps, PortalState> {
|
|
|
25
26
|
didUpdate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
27
|
};
|
|
27
28
|
el: HTMLElement;
|
|
29
|
+
context: ContextValue;
|
|
28
30
|
constructor(props: PortalProps);
|
|
29
31
|
componentDidMount(): void;
|
|
30
32
|
componentDidUpdate(prevProps: PortalProps): void;
|
package/lib/es/anchor/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { strings } from '@douyinfe/semi-foundation/lib/es/anchor/constants';
|
|
4
4
|
import AnchorFoundation, { AnchorAdapter } from '@douyinfe/semi-foundation/lib/es/anchor/foundation';
|
|
@@ -10,6 +10,7 @@ export { LinkProps } from './link';
|
|
|
10
10
|
export interface AnchorProps {
|
|
11
11
|
autoCollapse?: boolean;
|
|
12
12
|
className?: string;
|
|
13
|
+
children?: ReactNode | undefined;
|
|
13
14
|
defaultAnchor?: string;
|
|
14
15
|
getContainer?: () => HTMLElement | Window;
|
|
15
16
|
maxHeight?: string | number;
|
package/lib/es/anchor/link.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import BaseComponent from '../_base/baseComponent';
|
|
4
4
|
import LinkFoundation, { LinkAdapter } from '@douyinfe/semi-foundation/lib/es/anchor/linkFoundation';
|
|
@@ -7,6 +7,7 @@ export interface LinkProps {
|
|
|
7
7
|
href?: string;
|
|
8
8
|
title?: string | React.ReactNode;
|
|
9
9
|
className?: string;
|
|
10
|
+
children?: ReactNode | undefined;
|
|
10
11
|
style?: React.CSSProperties;
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
}
|
|
@@ -34,7 +35,7 @@ export default class Link extends BaseComponent<LinkProps, {}> {
|
|
|
34
35
|
componentDidMount(): void;
|
|
35
36
|
componentDidUpdate(prevProps: LinkProps): void;
|
|
36
37
|
componentWillUnmount(): void;
|
|
37
|
-
renderTitle: () => React.
|
|
38
|
+
renderTitle: () => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
38
39
|
renderChildren: () => React.ReactNode;
|
|
39
40
|
render(): JSX.Element;
|
|
40
41
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { AutoCompleteAdapter, StateOptionItem, DataItem } from '@douyinfe/semi-foundation/lib/es/autoComplete/foundation';
|
|
4
4
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
@@ -27,7 +27,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
|
|
|
27
27
|
autoAdjustOverflow?: boolean;
|
|
28
28
|
autoFocus?: boolean;
|
|
29
29
|
className?: string;
|
|
30
|
-
children?:
|
|
30
|
+
children?: ReactNode | undefined;
|
|
31
31
|
data?: T[];
|
|
32
32
|
disabled?: boolean;
|
|
33
33
|
defaultOpen?: boolean;
|
|
@@ -15,7 +15,7 @@ export default class AvatarGroup extends PureComponent<AvatarGroupProps> {
|
|
|
15
15
|
renderMore: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
16
|
overlapFrom: PropTypes.Requireable<string>;
|
|
17
17
|
};
|
|
18
|
-
getAllAvatars():
|
|
18
|
+
getAllAvatars(): any[];
|
|
19
19
|
getMergeAvatars(avatars: React.ReactNode[]): React.ReactNode[];
|
|
20
20
|
renderMoreAvatar(restNumber: number, restAvatars: React.ReactNode[]): JSX.Element;
|
|
21
21
|
render(): JSX.Element;
|
|
@@ -4,7 +4,7 @@ export declare type AvatarShape = 'circle' | 'square';
|
|
|
4
4
|
export declare type AvatarSize = 'extra-extra-small' | 'extra-small' | 'small' | 'default' | 'medium' | 'large' | 'extra-large';
|
|
5
5
|
export declare type AvatarColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow';
|
|
6
6
|
export interface AvatarProps extends BaseProps {
|
|
7
|
-
children?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode | undefined;
|
|
8
8
|
color?: AvatarColor;
|
|
9
9
|
shape?: AvatarShape;
|
|
10
10
|
size?: AvatarSize;
|
|
@@ -22,7 +22,7 @@ export declare type AvatarGroupShape = 'circle' | 'square';
|
|
|
22
22
|
export declare type AvatarGroupSize = 'extra-extra-small' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
|
23
23
|
export declare type AvatarGroupOverlapFrom = 'start' | 'end';
|
|
24
24
|
export interface AvatarGroupProps {
|
|
25
|
-
children?: React.ReactNode;
|
|
25
|
+
children?: React.ReactNode | undefined;
|
|
26
26
|
shape?: AvatarGroupShape;
|
|
27
27
|
size?: AvatarGroupSize;
|
|
28
28
|
overlapFrom?: AvatarGroupOverlapFrom;
|
package/lib/es/badge/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ContextValue } from '../configProvider/context';
|
|
3
4
|
import '@douyinfe/semi-foundation/lib/es/badge/badge.css';
|
|
4
5
|
export declare type BadgeType = 'primary' | 'secondary' | 'tertiary' | 'danger' | 'warning';
|
|
5
6
|
export declare type BadgeTheme = 'solid' | 'light' | 'inverted';
|
|
@@ -13,13 +14,13 @@ export interface BadgeProps {
|
|
|
13
14
|
overflowCount?: number;
|
|
14
15
|
style?: React.CSSProperties;
|
|
15
16
|
className?: string;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
17
|
onMouseEnter?: (e: React.MouseEvent) => any;
|
|
18
18
|
onMouseLeave?: (e: React.MouseEvent) => any;
|
|
19
19
|
onClick?: (e: React.MouseEvent) => any;
|
|
20
|
+
children?: React.ReactNode | undefined;
|
|
20
21
|
}
|
|
21
22
|
export default class Badge extends PureComponent<BadgeProps> {
|
|
22
|
-
static contextType: React.Context<
|
|
23
|
+
static contextType: React.Context<ContextValue>;
|
|
23
24
|
static propTypes: {
|
|
24
25
|
count: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
26
|
dot: PropTypes.Requireable<boolean>;
|
|
@@ -43,5 +44,6 @@ export default class Badge extends PureComponent<BadgeProps> {
|
|
|
43
44
|
onMouseEnter: () => (...args: any[]) => void;
|
|
44
45
|
onMouseLeave: () => (...args: any[]) => void;
|
|
45
46
|
};
|
|
47
|
+
context: ContextValue;
|
|
46
48
|
render(): JSX.Element;
|
|
47
49
|
}
|
package/lib/es/banner/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare type Type = 'info' | 'danger' | 'warning' | 'success';
|
|
|
7
7
|
export interface BannerProps {
|
|
8
8
|
type?: Type;
|
|
9
9
|
className?: string;
|
|
10
|
+
children?: React.ReactNode | undefined;
|
|
10
11
|
fullMode?: boolean;
|
|
11
12
|
title?: React.ReactNode;
|
|
12
13
|
description?: React.ReactNode;
|
|
@@ -44,7 +45,7 @@ export default class Banner extends BaseComponent<BannerProps, BannerState> {
|
|
|
44
45
|
componentDidMount(): void;
|
|
45
46
|
componentWillUnmount(): void;
|
|
46
47
|
remove: React.MouseEventHandler;
|
|
47
|
-
renderCloser(): React.
|
|
48
|
+
renderCloser(): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
48
49
|
renderIcon(): JSX.Element;
|
|
49
50
|
render(): JSX.Element;
|
|
50
51
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { showToolTipProps } from './index';
|
|
3
3
|
import { BreadcrumbItemInfo } from './item';
|
|
4
|
-
export interface
|
|
4
|
+
export interface BreadContextType {
|
|
5
5
|
onClick?: (info: BreadcrumbItemInfo, event: React.MouseEvent) => void;
|
|
6
6
|
showTooltip?: boolean | showToolTipProps;
|
|
7
7
|
compact?: boolean;
|
|
8
8
|
separator?: string | React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
declare const BreadContext: React.Context<
|
|
10
|
+
declare const BreadContext: React.Context<BreadContextType>;
|
|
11
11
|
export default BreadContext;
|