@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
1
|
+
import React, { PureComponent, ReactNode } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/button/button.css';
|
|
4
4
|
import { noop } from '@douyinfe/semi-foundation/lib/cjs/utils/function';
|
|
@@ -10,6 +10,7 @@ export interface ButtonProps {
|
|
|
10
10
|
id?: string;
|
|
11
11
|
block?: boolean;
|
|
12
12
|
circle?: boolean;
|
|
13
|
+
children?: ReactNode | undefined;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
className?: string;
|
|
15
16
|
icon?: React.ReactNode;
|
|
@@ -10,6 +10,7 @@ export interface ButtonGroupProps extends BaseProps {
|
|
|
10
10
|
size?: Size;
|
|
11
11
|
theme?: Theme;
|
|
12
12
|
className?: string;
|
|
13
|
+
children?: React.ReactChild;
|
|
13
14
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
14
15
|
}
|
|
15
16
|
export default class ButtonGroup extends BaseComponent<ButtonGroupProps> {
|
|
@@ -12,7 +12,7 @@ declare class Button extends React.PureComponent<ButtonProps> {
|
|
|
12
12
|
style: import("prop-types").Requireable<object>;
|
|
13
13
|
loading: import("prop-types").Requireable<boolean>;
|
|
14
14
|
prefixCls: import("prop-types").Requireable<string>;
|
|
15
|
-
icon: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
15
|
+
icon: import("prop-types").Requireable<object | import("prop-types").ReactNodeLike>;
|
|
16
16
|
iconSize: import("prop-types").Requireable<string>;
|
|
17
17
|
noHorizontalPadding: import("prop-types").Requireable<string | boolean | any[]>;
|
|
18
18
|
children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
@@ -9,7 +9,7 @@ export default class timeCol extends PureComponent<TimeColProps> {
|
|
|
9
9
|
renderTimeDisplay: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
10
|
};
|
|
11
11
|
static contextType: React.Context<Locale>;
|
|
12
|
-
formatTime(item: number): React.
|
|
12
|
+
formatTime(item: number): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
13
13
|
renderTime(): JSX.Element;
|
|
14
14
|
render(): JSX.Element;
|
|
15
15
|
}
|
package/lib/cjs/card/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent, ReactNode, CSSProperties } from 'react';
|
|
1
|
+
import React, { PureComponent, ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/card/card.css';
|
|
4
4
|
import Meta from './meta';
|
|
@@ -14,6 +14,7 @@ export interface CardProps {
|
|
|
14
14
|
bordered?: boolean;
|
|
15
15
|
/** Style class name */
|
|
16
16
|
className?: string;
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
17
18
|
/** Cover */
|
|
18
19
|
cover?: ReactNode;
|
|
19
20
|
/** Additional additions to the right of the title */
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode, CSSProperties, MouseEvent, KeyboardEvent } from 'reac
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { BasicCascaderInnerData, BasicCascaderProps, BasicTriggerRenderProps, BasicScrollPanelProps, CascaderAdapter, CascaderType } from '@douyinfe/semi-foundation/lib/cjs/cascader/foundation';
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/cjs/cascader/cascader.css';
|
|
5
|
+
import { ContextValue } from '../configProvider/context';
|
|
5
6
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
6
7
|
import Input from '../input/index';
|
|
7
8
|
import { PopoverProps } from '../popover/index';
|
|
@@ -32,7 +33,7 @@ export interface CascaderProps extends BasicCascaderProps {
|
|
|
32
33
|
motion?: Motion;
|
|
33
34
|
treeData?: Array<CascaderData>;
|
|
34
35
|
restTagsPopoverProps?: PopoverProps;
|
|
35
|
-
children?: ReactNode;
|
|
36
|
+
children?: React.ReactNode | undefined;
|
|
36
37
|
value?: Value;
|
|
37
38
|
prefix?: ReactNode;
|
|
38
39
|
suffix?: ReactNode;
|
|
@@ -59,7 +60,7 @@ export interface CascaderState extends BasicCascaderInnerData {
|
|
|
59
60
|
treeData?: Array<CascaderData>;
|
|
60
61
|
}
|
|
61
62
|
declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
62
|
-
static contextType: React.Context<
|
|
63
|
+
static contextType: React.Context<ContextValue>;
|
|
63
64
|
static propTypes: {
|
|
64
65
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
65
66
|
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
@@ -169,6 +170,7 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
169
170
|
optionsRef: React.RefObject<any>;
|
|
170
171
|
clickOutsideHandler: any;
|
|
171
172
|
mergeType: string;
|
|
173
|
+
context: ContextValue;
|
|
172
174
|
constructor(props: CascaderProps);
|
|
173
175
|
get adapter(): CascaderAdapter;
|
|
174
176
|
static getDerivedStateFromProps(props: CascaderProps, prevState: CascaderState): Partial<CascaderState>;
|
|
@@ -177,7 +179,7 @@ declare class Cascader extends BaseComponent<CascaderProps, CascaderState> {
|
|
|
177
179
|
componentDidUpdate(prevProps: CascaderProps): void;
|
|
178
180
|
handleInputChange: (value: string) => void;
|
|
179
181
|
handleTagRemove: (e: any, tagValuePath: Array<string | number>) => void;
|
|
180
|
-
renderTagItem: (value: string | Array<string>, idx: number, type: string) => React.
|
|
182
|
+
renderTagItem: (value: string | Array<string>, idx: number, type: string) => string | number | boolean | React.ReactFragment | JSX.Element;
|
|
181
183
|
renderTagInput(): JSX.Element;
|
|
182
184
|
renderInput(): JSX.Element;
|
|
183
185
|
handleItemClick: (e: MouseEvent | KeyboardEvent, item: Entity | Data) => void;
|
|
@@ -423,7 +423,7 @@ class Cascader extends _baseComponent.default {
|
|
|
423
423
|
|
|
424
424
|
this.handleClearEnterPress = e => {
|
|
425
425
|
e && e.stopPropagation();
|
|
426
|
-
this.foundation.handleClearEnterPress();
|
|
426
|
+
this.foundation.handleClearEnterPress(e);
|
|
427
427
|
};
|
|
428
428
|
|
|
429
429
|
this.showClearBtn = () => {
|
|
@@ -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 { CheckboxEvent } from '../checkbox';
|
|
4
5
|
import { BasicCascaderData, BasicEntity, ShowNextType, BasicData } from '@douyinfe/semi-foundation/lib/cjs/cascader/foundation';
|
|
5
6
|
export interface CascaderData extends BasicCascaderData {
|
|
@@ -39,7 +40,7 @@ export interface CascaderItemProps {
|
|
|
39
40
|
halfCheckedKeys: Set<string>;
|
|
40
41
|
}
|
|
41
42
|
export default class Item extends PureComponent<CascaderItemProps> {
|
|
42
|
-
static contextType: React.Context<
|
|
43
|
+
static contextType: React.Context<ContextValue>;
|
|
43
44
|
static propTypes: {
|
|
44
45
|
data: PropTypes.Requireable<any[]>;
|
|
45
46
|
emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -57,6 +58,7 @@ export default class Item extends PureComponent<CascaderItemProps> {
|
|
|
57
58
|
static defaultProps: {
|
|
58
59
|
empty: boolean;
|
|
59
60
|
};
|
|
61
|
+
context: ContextValue;
|
|
60
62
|
onClick: (e: React.MouseEvent | React.KeyboardEvent, item: Entity | Data) => void;
|
|
61
63
|
/**
|
|
62
64
|
* A11y: simulate item click
|
|
@@ -4,6 +4,7 @@ import CheckboxFoundation, { CheckboxAdapter, BasicCheckboxEvent, BasicTargetObj
|
|
|
4
4
|
import CheckboxInner from './checkboxInner';
|
|
5
5
|
import BaseComponent from '../_base/baseComponent';
|
|
6
6
|
import '@douyinfe/semi-foundation/lib/cjs/checkbox/checkbox.css';
|
|
7
|
+
import { CheckboxContextType } from './context';
|
|
7
8
|
export declare type CheckboxEvent = BasicCheckboxEvent;
|
|
8
9
|
export declare type TargetObject = BasicTargetObject;
|
|
9
10
|
export interface CheckboxProps extends BaseCheckboxProps {
|
|
@@ -12,6 +13,7 @@ export interface CheckboxProps extends BaseCheckboxProps {
|
|
|
12
13
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
13
14
|
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
14
15
|
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
16
|
+
children?: React.ReactNode | undefined;
|
|
15
17
|
onChange?: (e: CheckboxEvent) => any;
|
|
16
18
|
style?: React.CSSProperties;
|
|
17
19
|
onMouseEnter?: React.MouseEventHandler<HTMLSpanElement>;
|
|
@@ -25,16 +27,7 @@ interface CheckboxState {
|
|
|
25
27
|
checked: boolean;
|
|
26
28
|
}
|
|
27
29
|
declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
28
|
-
static contextType: React.Context<
|
|
29
|
-
checkboxGroup?: {
|
|
30
|
-
onChange: (evt: BasicCheckboxEvent) => void;
|
|
31
|
-
value: any[];
|
|
32
|
-
disabled: boolean;
|
|
33
|
-
name: any;
|
|
34
|
-
isCardType: boolean;
|
|
35
|
-
isPureCardType: boolean;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
30
|
+
static contextType: React.Context<CheckboxContextType>;
|
|
38
31
|
static propTypes: {
|
|
39
32
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
40
33
|
'aria-errormessage': PropTypes.Requireable<string>;
|
|
@@ -65,13 +58,14 @@ declare class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
|
|
|
65
58
|
onMouseLeave: (...args: any[]) => void;
|
|
66
59
|
};
|
|
67
60
|
checkboxEntity: CheckboxInner;
|
|
61
|
+
context: CheckboxContextType;
|
|
68
62
|
get adapter(): CheckboxAdapter<CheckboxProps, CheckboxState>;
|
|
69
63
|
foundation: CheckboxFoundation;
|
|
70
64
|
addonId: string;
|
|
71
65
|
extraId: string;
|
|
72
66
|
constructor(props: CheckboxProps);
|
|
73
67
|
componentDidUpdate(prevProps: CheckboxProps): void;
|
|
74
|
-
isInGroup():
|
|
68
|
+
isInGroup(): boolean;
|
|
75
69
|
focus(): void;
|
|
76
70
|
blur(): void;
|
|
77
71
|
handleChange: React.MouseEventHandler<HTMLSpanElement>;
|
|
@@ -17,7 +17,7 @@ export declare type CheckboxGroupProps = {
|
|
|
17
17
|
options?: any[];
|
|
18
18
|
value?: any[];
|
|
19
19
|
onChange?: (value: any[]) => void;
|
|
20
|
-
children?: React.ReactNode;
|
|
20
|
+
children?: React.ReactNode | undefined;
|
|
21
21
|
prefixCls?: string;
|
|
22
22
|
direction?: CheckboxDirection;
|
|
23
23
|
style?: React.CSSProperties;
|
|
@@ -18,16 +18,7 @@ export interface CheckboxInnerProps {
|
|
|
18
18
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
19
19
|
}
|
|
20
20
|
declare class CheckboxInner extends PureComponent<CheckboxInnerProps> {
|
|
21
|
-
static contextType: React.Context<
|
|
22
|
-
checkboxGroup?: {
|
|
23
|
-
onChange: (evt: import("@douyinfe/semi-foundation/lib/cjs/checkbox/checkboxFoundation").BasicCheckboxEvent) => void;
|
|
24
|
-
value: any[];
|
|
25
|
-
disabled: boolean;
|
|
26
|
-
name: any;
|
|
27
|
-
isCardType: boolean;
|
|
28
|
-
isPureCardType: boolean;
|
|
29
|
-
};
|
|
30
|
-
}>;
|
|
21
|
+
static contextType: React.Context<import("./context").CheckboxContextType>;
|
|
31
22
|
static propTypes: {
|
|
32
23
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
33
24
|
'aria-errormessage': PropTypes.Requireable<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BasicCheckboxEvent } from '@douyinfe/semi-foundation/lib/cjs/checkbox/checkboxFoundation';
|
|
3
|
-
declare type
|
|
3
|
+
declare type CheckboxContextType = {
|
|
4
4
|
checkboxGroup?: {
|
|
5
5
|
onChange: (evt: BasicCheckboxEvent) => void;
|
|
6
6
|
value: any[];
|
|
@@ -10,5 +10,5 @@ declare type CheckboxContext = {
|
|
|
10
10
|
isPureCardType: boolean;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
declare const Context: React.Context<
|
|
14
|
-
export { Context };
|
|
13
|
+
declare const Context: React.Context<CheckboxContextType>;
|
|
14
|
+
export { Context, CheckboxContextType };
|
|
@@ -9,6 +9,7 @@ export { CollapsePanelProps } from './item';
|
|
|
9
9
|
export interface CollapseReactProps extends CollapseProps {
|
|
10
10
|
expandIcon?: React.ReactNode;
|
|
11
11
|
collapseIcon?: React.ReactNode;
|
|
12
|
+
children?: React.ReactNode | undefined;
|
|
12
13
|
style?: CSSProperties;
|
|
13
14
|
onChange?: (activeKey: CollapseProps['activeKey'], e: React.MouseEvent) => void;
|
|
14
15
|
}
|
|
@@ -6,6 +6,7 @@ export interface CollapsePanelProps {
|
|
|
6
6
|
extra?: ReactNode;
|
|
7
7
|
header?: ReactNode;
|
|
8
8
|
className?: string;
|
|
9
|
+
children?: React.ReactNode | undefined;
|
|
9
10
|
reCalcKey?: number | string;
|
|
10
11
|
style?: CSSProperties;
|
|
11
12
|
}
|
|
@@ -19,6 +20,7 @@ export default class CollapsePanel extends PureComponent<CollapsePanelProps> {
|
|
|
19
20
|
reCalcKey: PropTypes.Requireable<string | number>;
|
|
20
21
|
};
|
|
21
22
|
private ariaID;
|
|
23
|
+
context: CollapseContextType;
|
|
22
24
|
renderHeader(active: boolean, expandIconEnable?: boolean): JSX.Element;
|
|
23
25
|
render(): JSX.Element;
|
|
24
26
|
}
|
package/lib/cjs/collapse/item.js
CHANGED
|
@@ -103,9 +103,11 @@ class CollapsePanel extends _react.PureComponent {
|
|
|
103
103
|
className,
|
|
104
104
|
children,
|
|
105
105
|
itemKey,
|
|
106
|
-
reCalcKey
|
|
106
|
+
reCalcKey,
|
|
107
|
+
header,
|
|
108
|
+
extra
|
|
107
109
|
} = _a,
|
|
108
|
-
restProps = __rest(_a, ["className", "children", "itemKey", "reCalcKey"]);
|
|
110
|
+
restProps = __rest(_a, ["className", "children", "itemKey", "reCalcKey", "header", "extra"]);
|
|
109
111
|
|
|
110
112
|
const {
|
|
111
113
|
keepDOM,
|
|
@@ -14,6 +14,6 @@ export default class ConfigProvider extends React.Component<ConfigProviderProps>
|
|
|
14
14
|
locale: import("../locale/interface").Locale;
|
|
15
15
|
direction: string;
|
|
16
16
|
};
|
|
17
|
-
renderChilren(): React.
|
|
17
|
+
renderChilren(): string | number | boolean | React.ReactFragment | JSX.Element;
|
|
18
18
|
render(): JSX.Element;
|
|
19
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { ContextValue } from '../configProvider/context';
|
|
3
4
|
import DatePickerFoundation, { DatePickerAdapter, DatePickerFoundationProps, DatePickerFoundationState, DayStatusType, PresetType, Type, RangeType } from '@douyinfe/semi-foundation/lib/cjs/datePicker/foundation';
|
|
4
5
|
import BaseComponent from '../_base/baseComponent';
|
|
5
6
|
import { DateInputProps } from './dateInput';
|
|
@@ -33,7 +34,7 @@ export interface DatePickerProps extends DatePickerFoundationProps {
|
|
|
33
34
|
}
|
|
34
35
|
export declare type DatePickerState = DatePickerFoundationState;
|
|
35
36
|
export default class DatePicker extends BaseComponent<DatePickerProps, DatePickerState> {
|
|
36
|
-
static contextType: React.Context<
|
|
37
|
+
static contextType: React.Context<ContextValue>;
|
|
37
38
|
static propTypes: {
|
|
38
39
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
39
40
|
'aria-errormessage': PropTypes.Requireable<string>;
|
|
@@ -157,6 +158,7 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
157
158
|
clickOutSideHandler: (e: MouseEvent) => void;
|
|
158
159
|
_mounted: boolean;
|
|
159
160
|
foundation: DatePickerFoundation;
|
|
161
|
+
context: ContextValue;
|
|
160
162
|
constructor(props: DatePickerProps);
|
|
161
163
|
get adapter(): DatePickerAdapter;
|
|
162
164
|
isRangeType(type: Type, triggerRender: DatePickerProps['triggerRender']): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/descriptions/descriptions.css';
|
|
4
|
-
import { DescriptionsAlign } from './descriptions-context';
|
|
4
|
+
import { DescriptionsAlign, DescriptionsContextValue } from './descriptions-context';
|
|
5
5
|
import Item from './item';
|
|
6
6
|
export { DescriptionsItemProps } from './item';
|
|
7
7
|
export declare type DescriptionsSize = 'small' | 'medium' | 'large';
|
|
@@ -16,11 +16,12 @@ export interface DescriptionsProps {
|
|
|
16
16
|
size?: DescriptionsSize;
|
|
17
17
|
style?: React.CSSProperties;
|
|
18
18
|
className?: string;
|
|
19
|
+
children?: React.ReactNode | undefined;
|
|
19
20
|
data?: Data[];
|
|
20
21
|
}
|
|
21
22
|
declare class Descriptions extends PureComponent<DescriptionsProps> {
|
|
22
23
|
static Item: typeof Item;
|
|
23
|
-
static contextType: React.Context<
|
|
24
|
+
static contextType: React.Context<DescriptionsContextValue>;
|
|
24
25
|
static propTypes: {
|
|
25
26
|
align: PropTypes.Requireable<string>;
|
|
26
27
|
row: PropTypes.Requireable<boolean>;
|
|
@@ -29,7 +30,7 @@ declare class Descriptions extends PureComponent<DescriptionsProps> {
|
|
|
29
30
|
className: PropTypes.Requireable<string>;
|
|
30
31
|
data: PropTypes.Requireable<PropTypes.InferProps<{
|
|
31
32
|
key: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
32
|
-
value: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
33
|
+
value: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
33
34
|
hidden: PropTypes.Requireable<boolean>;
|
|
34
35
|
className: PropTypes.Requireable<string>;
|
|
35
36
|
style: PropTypes.Requireable<object>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/cjs/descriptions/descriptions.css';
|
|
4
|
+
import { DescriptionsContextValue } from './descriptions-context';
|
|
4
5
|
export interface DescriptionsItemProps {
|
|
5
6
|
hidden?: boolean;
|
|
6
7
|
className?: string;
|
|
8
|
+
children?: React.ReactNode | undefined | (() => React.ReactNode);
|
|
7
9
|
style?: React.CSSProperties;
|
|
8
10
|
itemKey?: React.ReactNode;
|
|
9
11
|
}
|
|
@@ -14,6 +16,7 @@ export default class Item extends PureComponent<DescriptionsItemProps> {
|
|
|
14
16
|
className: PropTypes.Requireable<string>;
|
|
15
17
|
style: PropTypes.Requireable<object>;
|
|
16
18
|
};
|
|
17
|
-
static contextType: React.Context<
|
|
19
|
+
static contextType: React.Context<DescriptionsContextValue>;
|
|
20
|
+
context: DescriptionsContextValue;
|
|
18
21
|
render(): JSX.Element;
|
|
19
22
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
level
|
|
4
|
-
|
|
2
|
+
export interface DropdownContextType {
|
|
3
|
+
level?: number;
|
|
4
|
+
showTick?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const DropdownContext: React.Context<DropdownContextType>;
|
|
5
7
|
export default DropdownContext;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { DropdownContextType } from './context';
|
|
3
4
|
import BaseComponent, { BaseProps } from '../_base/baseComponent';
|
|
4
5
|
export declare type Type = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'danger';
|
|
5
6
|
export interface DropdownItemProps extends BaseProps {
|
|
@@ -31,9 +32,8 @@ declare class DropdownItem extends BaseComponent<DropdownItemProps> {
|
|
|
31
32
|
active: PropTypes.Requireable<boolean>;
|
|
32
33
|
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
33
34
|
};
|
|
34
|
-
static contextType: React.Context<
|
|
35
|
-
|
|
36
|
-
}>;
|
|
35
|
+
static contextType: React.Context<DropdownContextType>;
|
|
36
|
+
context: DropdownContextType;
|
|
37
37
|
static defaultProps: {
|
|
38
38
|
disabled: boolean;
|
|
39
39
|
divided: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { PureComponent } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { DropdownContextType } from './context';
|
|
3
4
|
import { BaseProps } from '../_base/baseComponent';
|
|
4
5
|
export declare type DropdownTitleProps = BaseProps;
|
|
5
6
|
declare class DropdownTitle extends PureComponent<DropdownTitleProps> {
|
|
@@ -8,9 +9,8 @@ declare class DropdownTitle extends PureComponent<DropdownTitleProps> {
|
|
|
8
9
|
className: PropTypes.Requireable<string>;
|
|
9
10
|
style: PropTypes.Requireable<object>;
|
|
10
11
|
};
|
|
11
|
-
static contextType: React.Context<
|
|
12
|
-
|
|
13
|
-
}>;
|
|
12
|
+
static contextType: React.Context<DropdownContextType>;
|
|
13
|
+
context: DropdownContextType;
|
|
14
14
|
render(): JSX.Element;
|
|
15
15
|
}
|
|
16
16
|
export default DropdownTitle;
|
|
@@ -6,6 +6,7 @@ import DropdownMenu from './dropdownMenu';
|
|
|
6
6
|
import DropdownItem, { DropdownItemProps } from './dropdownItem';
|
|
7
7
|
import { DropdownDividerProps } from './dropdownDivider';
|
|
8
8
|
import DropdownTitle, { DropdownTitleProps } from './dropdownTitle';
|
|
9
|
+
import { DropdownContextType } from './context';
|
|
9
10
|
import '@douyinfe/semi-foundation/lib/cjs/dropdown/dropdown.css';
|
|
10
11
|
import { Motion } from '../_base/base';
|
|
11
12
|
export { DropdownDividerProps } from './dropdownDivider';
|
|
@@ -51,9 +52,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
51
52
|
static Item: typeof DropdownItem;
|
|
52
53
|
static Divider: React.FC<import("../_base/baseComponent").BaseProps>;
|
|
53
54
|
static Title: typeof DropdownTitle;
|
|
54
|
-
static contextType: React.Context<
|
|
55
|
-
level: number;
|
|
56
|
-
}>;
|
|
55
|
+
static contextType: React.Context<DropdownContextType>;
|
|
57
56
|
static propTypes: {
|
|
58
57
|
render: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
58
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -86,6 +85,7 @@ declare class Dropdown extends BaseComponent<DropdownProps, DropdownState> {
|
|
|
86
85
|
showTick: boolean;
|
|
87
86
|
};
|
|
88
87
|
constructor(props: DropdownProps);
|
|
88
|
+
context: DropdownContextType;
|
|
89
89
|
get adapter(): {
|
|
90
90
|
setPopVisible: (popVisible: boolean) => void;
|
|
91
91
|
notifyVisibleChange: (visible: boolean) => void;
|
package/lib/cjs/empty/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare class ArrayFieldComponent extends Component<ArrayFieldProps, ArrayFieldS
|
|
|
22
22
|
cacheFieldValues: any[];
|
|
23
23
|
shouldUseInitValue: boolean;
|
|
24
24
|
cacheUpdateKey: string;
|
|
25
|
+
context: FormUpdaterContextType;
|
|
25
26
|
constructor(props: ArrayFieldProps, context: FormUpdaterContextType);
|
|
26
27
|
componentWillUnmount(): void;
|
|
27
28
|
componentDidUpdate(): void;
|
|
@@ -21,7 +21,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
21
21
|
onValueChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
22
|
initValues: PropTypes.Requireable<object>;
|
|
23
23
|
getFormApi: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
|
-
component: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
|
+
component: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>;
|
|
25
25
|
render: PropTypes.Requireable<(...args: any[]) => any>;
|
|
26
26
|
validateFields: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
style: PropTypes.Requireable<object>;
|
|
@@ -149,7 +149,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
149
149
|
constructor(props: BaseFormProps);
|
|
150
150
|
componentWillUnmount(): void;
|
|
151
151
|
get adapter(): BaseFormAdapter<BaseFormProps, BaseFormState>;
|
|
152
|
-
get content():
|
|
152
|
+
get content(): React.ReactNode;
|
|
153
153
|
submit(e: React.FormEvent<HTMLFormElement>): void;
|
|
154
154
|
reset(e: React.FormEvent<HTMLFormElement>): void;
|
|
155
155
|
render(): JSX.Element;
|
package/lib/cjs/form/baseForm.js
CHANGED
|
@@ -171,7 +171,7 @@ class Form extends _baseComponent.default {
|
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
if (component) {
|
|
174
|
-
return /*#__PURE__*/_react.default.createElement(component, props
|
|
174
|
+
return /*#__PURE__*/_react.default.createElement(component, props);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
if (render) {
|
|
@@ -14,7 +14,7 @@ export interface ErrorMessageProps {
|
|
|
14
14
|
}
|
|
15
15
|
export default class ErrorMessage extends PureComponent<ErrorMessageProps> {
|
|
16
16
|
static propTypes: {
|
|
17
|
-
error: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
+
error: PropTypes.Requireable<any[] | PropTypes.ReactNodeLike>;
|
|
18
18
|
className: PropTypes.Requireable<string>;
|
|
19
19
|
style: PropTypes.Requireable<object>;
|
|
20
20
|
validateStatus: PropTypes.Requireable<string>;
|
package/lib/cjs/form/group.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import { LabelProps } from './label';
|
|
3
3
|
import { InputGroupProps as BacisInputGroupProps } from '../input/inputGroup';
|
|
4
4
|
import { BaseFormProps } from './interface';
|
|
5
|
+
import { FormUpdaterContextType } from '@douyinfe/semi-foundation/lib/cjs/form/interface';
|
|
5
6
|
export interface InputGroupProps extends BacisInputGroupProps {
|
|
6
7
|
label?: LabelProps;
|
|
7
8
|
labelPosition?: 'left' | 'top';
|
|
8
9
|
}
|
|
9
10
|
declare class FormInputGroup extends Component<InputGroupProps> {
|
|
10
|
-
static contextType: React.Context<
|
|
11
|
+
static contextType: React.Context<FormUpdaterContextType>;
|
|
12
|
+
context: FormUpdaterContextType;
|
|
11
13
|
renderLabel(label: LabelProps, formProps: BaseFormProps): JSX.Element;
|
|
12
14
|
render(): JSX.Element;
|
|
13
15
|
}
|
|
@@ -147,7 +147,8 @@ function withField(Component, opts) {
|
|
|
147
147
|
const [cursor, setCursor, getCursor] = (0, _index.useStateWithGetter)(0);
|
|
148
148
|
const [status, setStatus] = (0, _react.useState)(validateStatus); // use props.validateStatus to init
|
|
149
149
|
|
|
150
|
-
const rulesRef = (0, _react.useRef)(rules);
|
|
150
|
+
const rulesRef = (0, _react.useRef)(rules);
|
|
151
|
+
const validateRef = (0, _react.useRef)(validate); // notNotify is true means that the onChange of the Form does not need to be triggered
|
|
151
152
|
// notUpdate is true means that this operation does not need to trigger the forceUpdate
|
|
152
153
|
|
|
153
154
|
const updateTouched = (isTouched, callOpts) => {
|
|
@@ -246,7 +247,7 @@ function withField(Component, opts) {
|
|
|
246
247
|
let maybePromisedErrors; // let errorThrowSync;
|
|
247
248
|
|
|
248
249
|
try {
|
|
249
|
-
maybePromisedErrors =
|
|
250
|
+
maybePromisedErrors = validateRef.current(val, values);
|
|
250
251
|
} catch (err) {
|
|
251
252
|
// error throw by syncValidate
|
|
252
253
|
maybePromisedErrors = err;
|
|
@@ -286,7 +287,7 @@ function withField(Component, opts) {
|
|
|
286
287
|
finalVal = transform(val);
|
|
287
288
|
}
|
|
288
289
|
|
|
289
|
-
if (
|
|
290
|
+
if (validateRef.current) {
|
|
290
291
|
return _validate(finalVal, updater.getValue(), callOpts);
|
|
291
292
|
} else if (latestRules) {
|
|
292
293
|
return _validateInternal(finalVal, callOpts);
|
|
@@ -395,7 +396,8 @@ function withField(Component, opts) {
|
|
|
395
396
|
|
|
396
397
|
(0, _react.useLayoutEffect)(() => {
|
|
397
398
|
rulesRef.current = rules;
|
|
398
|
-
|
|
399
|
+
validateRef.current = validate;
|
|
400
|
+
}, [rules, validate]); // exec validate once when trigger inlcude 'mount'
|
|
399
401
|
|
|
400
402
|
(0, _react.useLayoutEffect)(() => {
|
|
401
403
|
if (validateOnMount) {
|
package/lib/cjs/form/label.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface SectionProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
text?: React.ReactNode | string;
|
|
7
|
-
children?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode | undefined;
|
|
8
8
|
}
|
|
9
9
|
export default class Section extends PureComponent<SectionProps> {
|
|
10
10
|
static propTypes: {
|
package/lib/cjs/form/slot.js
CHANGED
|
@@ -105,12 +105,14 @@ const FormSlot = props => {
|
|
|
105
105
|
break;
|
|
106
106
|
|
|
107
107
|
case (0, _isString2.default)(label) || (0, _isNumber2.default)(label):
|
|
108
|
+
// @ts-ignore skip type check, the actual type is already determined
|
|
108
109
|
label = {
|
|
109
110
|
text: label
|
|
110
111
|
};
|
|
111
112
|
break;
|
|
112
113
|
|
|
113
114
|
case /*#__PURE__*/_react.default.isValidElement(label):
|
|
115
|
+
// @ts-ignore skip type check, the actual type is already determined
|
|
114
116
|
label = {
|
|
115
117
|
text: label
|
|
116
118
|
};
|