@douyinfe/semi-ui 2.22.0-beta.0 → 2.22.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/semi.css +438 -38
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +4084 -5300
- 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/lib/cjs/_cssAnimation/index.d.ts +39 -0
- package/lib/cjs/_cssAnimation/index.js +133 -0
- package/lib/cjs/anchor/index.d.ts +3 -3
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +7 -8
- package/lib/cjs/autoComplete/option.d.ts +1 -1
- package/lib/cjs/banner/index.d.ts +2 -2
- package/lib/cjs/breadcrumb/index.d.ts +3 -3
- package/lib/cjs/breadcrumb/item.d.ts +3 -3
- package/lib/cjs/button/index.d.ts +2 -2
- package/lib/cjs/calendar/dayCalendar.d.ts +2 -2
- package/lib/cjs/calendar/index.d.ts +2 -2
- package/lib/cjs/calendar/monthCalendar.d.ts +2 -2
- package/lib/cjs/calendar/rangeCalendar.d.ts +2 -2
- package/lib/cjs/calendar/weekCalendar.d.ts +2 -2
- package/lib/cjs/card/cardGroup.d.ts +1 -1
- package/lib/cjs/carousel/index.d.ts +1 -1
- package/lib/cjs/cascader/index.d.ts +7 -8
- package/lib/cjs/cascader/index.js +8 -6
- package/lib/cjs/collapse/collapse-context.d.ts +1 -2
- package/lib/cjs/collapse/index.d.ts +3 -3
- package/lib/cjs/collapse/item.d.ts +2 -2
- package/lib/cjs/collapsible/index.d.ts +32 -19
- package/lib/cjs/collapsible/index.js +157 -121
- package/lib/cjs/configProvider/index.d.ts +1 -1
- package/lib/cjs/datePicker/dateInput.d.ts +3 -3
- package/lib/cjs/datePicker/datePicker.d.ts +12 -9
- package/lib/cjs/datePicker/datePicker.js +11 -13
- package/lib/cjs/datePicker/month.d.ts +1 -1
- package/lib/cjs/datePicker/month.js +5 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +7 -6
- package/lib/cjs/datePicker/monthsGrid.js +9 -26
- package/lib/cjs/datePicker/quickControl.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/cjs/datePicker/yearAndMonth.js +13 -8
- package/lib/cjs/descriptions/index.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownItem.d.ts +2 -1
- package/lib/cjs/dropdown/dropdownItem.js +3 -1
- package/lib/cjs/dropdown/index.d.ts +5 -6
- package/lib/cjs/form/baseForm.d.ts +7 -5
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +4 -2
- package/lib/cjs/form/label.d.ts +1 -1
- package/lib/cjs/grid/col.d.ts +6 -6
- package/lib/cjs/grid/row.d.ts +1 -1
- package/lib/cjs/iconButton/index.d.ts +2 -2
- package/lib/cjs/image/image.d.ts +4 -4
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/inputNumber/index.d.ts +2 -2
- package/lib/cjs/locale/source/ro.d.ts +3 -3
- package/lib/cjs/modal/Modal.d.ts +6 -6
- package/lib/cjs/modal/Modal.js +80 -56
- package/lib/cjs/modal/ModalContent.js +6 -5
- package/lib/cjs/modal/confirm.d.ts +10 -10
- package/lib/cjs/modal/confirm.js +1 -15
- package/lib/cjs/modal/useModal/HookModal.d.ts +0 -2
- package/lib/cjs/modal/useModal/HookModal.js +6 -18
- package/lib/cjs/navigation/Footer.d.ts +1 -1
- package/lib/cjs/navigation/Header.d.ts +3 -3
- package/lib/cjs/navigation/Item.d.ts +4 -4
- package/lib/cjs/navigation/Item.js +11 -5
- package/lib/cjs/navigation/OpenIconTransition.d.ts +1 -15
- package/lib/cjs/navigation/OpenIconTransition.js +1 -82
- package/lib/cjs/navigation/SubNav.d.ts +4 -4
- package/lib/cjs/navigation/SubNav.js +43 -27
- package/lib/cjs/navigation/index.d.ts +8 -11
- package/lib/cjs/notification/index.d.ts +0 -1
- package/lib/cjs/notification/index.js +25 -15
- package/lib/cjs/notification/notice.d.ts +3 -1
- package/lib/cjs/notification/notice.js +3 -1
- package/lib/cjs/popconfirm/index.d.ts +4 -5
- package/lib/cjs/popover/index.d.ts +8 -8
- package/lib/cjs/popover/index.js +1 -1
- package/lib/cjs/progress/index.d.ts +4 -4
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/scrollList/index.d.ts +1 -1
- package/lib/cjs/scrollList/scrollItem.d.ts +3 -3
- package/lib/cjs/scrollList/scrollItem.js +2 -2
- package/lib/cjs/select/index.d.ts +11 -6
- package/lib/cjs/select/index.js +108 -60
- package/lib/cjs/select/option.d.ts +1 -1
- package/lib/cjs/select/optionGroup.d.ts +1 -1
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +8 -0
- package/lib/cjs/sideSheet/SideSheetContent.js +10 -6
- package/lib/cjs/sideSheet/index.d.ts +4 -4
- package/lib/cjs/sideSheet/index.js +69 -39
- package/lib/cjs/space/index.d.ts +1 -1
- package/lib/cjs/spin/index.js +1 -4
- package/lib/cjs/table/Body/BaseRow.d.ts +5 -5
- package/lib/cjs/table/Body/ExpandedRow.d.ts +3 -3
- package/lib/cjs/table/Body/SectionRow.d.ts +3 -3
- package/lib/cjs/table/Column.d.ts +4 -4
- package/lib/cjs/table/ColumnShape.d.ts +4 -4
- package/lib/cjs/table/ColumnSorter.d.ts +1 -1
- package/lib/cjs/table/CustomExpandIcon.d.ts +1 -1
- package/lib/cjs/table/CustomExpandIcon.js +13 -5
- package/lib/cjs/table/Table.d.ts +16 -16
- package/lib/cjs/table/TableCell.d.ts +4 -4
- package/lib/cjs/table/TableHeaderRow.d.ts +2 -2
- package/lib/cjs/table/TablePagination.d.ts +1 -1
- package/lib/cjs/table/index.d.ts +15 -15
- package/lib/cjs/tabs/TabPane.d.ts +2 -8
- package/lib/cjs/tabs/TabPane.js +40 -38
- package/lib/cjs/tabs/index.d.ts +5 -3
- package/lib/cjs/tabs/index.js +26 -4
- package/lib/cjs/tabs/interface.d.ts +2 -0
- package/lib/cjs/tag/group.d.ts +1 -0
- package/lib/cjs/tag/group.js +6 -3
- package/lib/cjs/tag/index.d.ts +1 -1
- package/lib/cjs/tag/index.js +1 -0
- package/lib/cjs/tag/interface.d.ts +3 -1
- package/lib/cjs/tagInput/index.d.ts +3 -3
- package/lib/cjs/timePicker/Combobox.js +4 -8
- package/lib/cjs/timePicker/PanelShape.d.ts +2 -2
- package/lib/cjs/timePicker/TimePicker.d.ts +11 -11
- package/lib/cjs/timePicker/TimePicker.js +3 -1
- package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +10 -9
- package/lib/cjs/timeline/index.d.ts +1 -1
- package/lib/cjs/toast/index.d.ts +2 -4
- package/lib/cjs/toast/index.js +29 -14
- package/lib/cjs/toast/toast.d.ts +4 -2
- package/lib/cjs/toast/toast.js +3 -1
- package/lib/cjs/tooltip/index.d.ts +8 -9
- package/lib/cjs/tooltip/index.js +30 -37
- package/lib/cjs/transfer/index.d.ts +1 -1
- package/lib/cjs/tree/autoSizer.d.ts +2 -2
- package/lib/cjs/tree/index.d.ts +5 -5
- package/lib/cjs/tree/nodeCollapsible.d.ts +11 -0
- package/lib/cjs/tree/nodeCollapsible.js +50 -0
- package/lib/cjs/tree/nodeList.js +6 -5
- package/lib/cjs/tree/treeNode.d.ts +1 -1
- package/lib/cjs/treeSelect/index.d.ts +12 -9
- package/lib/cjs/treeSelect/index.js +23 -9
- package/lib/cjs/trigger/index.d.ts +1 -1
- package/lib/cjs/typography/base.d.ts +8 -8
- package/lib/cjs/typography/index.d.ts +2 -0
- package/lib/cjs/typography/index.js +3 -0
- package/lib/cjs/typography/interface.d.ts +2 -0
- package/lib/cjs/typography/numeral.d.ts +68 -0
- package/lib/cjs/typography/numeral.js +106 -0
- package/lib/cjs/typography/paragraph.d.ts +3 -3
- package/lib/cjs/typography/text.d.ts +4 -4
- package/lib/cjs/typography/title.d.ts +4 -4
- package/lib/cjs/upload/fileCard.d.ts +1 -1
- package/lib/es/_cssAnimation/index.d.ts +39 -0
- package/lib/es/_cssAnimation/index.js +122 -0
- package/lib/es/anchor/index.d.ts +3 -3
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +7 -8
- package/lib/es/autoComplete/option.d.ts +1 -1
- package/lib/es/banner/index.d.ts +2 -2
- package/lib/es/breadcrumb/index.d.ts +3 -3
- package/lib/es/breadcrumb/item.d.ts +3 -3
- package/lib/es/button/index.d.ts +2 -2
- package/lib/es/calendar/dayCalendar.d.ts +2 -2
- package/lib/es/calendar/index.d.ts +2 -2
- package/lib/es/calendar/monthCalendar.d.ts +2 -2
- package/lib/es/calendar/rangeCalendar.d.ts +2 -2
- package/lib/es/calendar/weekCalendar.d.ts +2 -2
- package/lib/es/card/cardGroup.d.ts +1 -1
- package/lib/es/carousel/index.d.ts +1 -1
- package/lib/es/cascader/index.d.ts +7 -8
- package/lib/es/cascader/index.js +8 -6
- package/lib/es/collapse/collapse-context.d.ts +1 -2
- package/lib/es/collapse/index.d.ts +3 -3
- package/lib/es/collapse/item.d.ts +2 -2
- package/lib/es/collapsible/index.d.ts +32 -19
- package/lib/es/collapsible/index.js +158 -119
- package/lib/es/configProvider/index.d.ts +1 -1
- package/lib/es/datePicker/dateInput.d.ts +3 -3
- package/lib/es/datePicker/datePicker.d.ts +12 -9
- package/lib/es/datePicker/datePicker.js +11 -13
- package/lib/es/datePicker/month.d.ts +1 -1
- package/lib/es/datePicker/month.js +5 -1
- package/lib/es/datePicker/monthsGrid.d.ts +7 -6
- package/lib/es/datePicker/monthsGrid.js +9 -26
- package/lib/es/datePicker/quickControl.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.d.ts +1 -1
- package/lib/es/datePicker/yearAndMonth.js +13 -8
- package/lib/es/descriptions/index.d.ts +1 -1
- package/lib/es/dropdown/dropdownItem.d.ts +2 -1
- package/lib/es/dropdown/dropdownItem.js +3 -1
- package/lib/es/dropdown/index.d.ts +5 -6
- package/lib/es/form/baseForm.d.ts +7 -5
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/field.d.ts +4 -2
- package/lib/es/form/label.d.ts +1 -1
- package/lib/es/grid/col.d.ts +6 -6
- package/lib/es/grid/row.d.ts +1 -1
- package/lib/es/iconButton/index.d.ts +2 -2
- package/lib/es/image/image.d.ts +4 -4
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/index.d.ts +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/inputNumber/index.d.ts +2 -2
- package/lib/es/locale/source/ro.d.ts +3 -3
- package/lib/es/modal/Modal.d.ts +6 -6
- package/lib/es/modal/Modal.js +79 -56
- package/lib/es/modal/ModalContent.js +6 -5
- package/lib/es/modal/confirm.d.ts +10 -10
- package/lib/es/modal/confirm.js +1 -14
- package/lib/es/modal/useModal/HookModal.d.ts +0 -2
- package/lib/es/modal/useModal/HookModal.js +7 -19
- package/lib/es/navigation/Footer.d.ts +1 -1
- package/lib/es/navigation/Header.d.ts +3 -3
- package/lib/es/navigation/Item.d.ts +4 -4
- package/lib/es/navigation/Item.js +11 -5
- package/lib/es/navigation/OpenIconTransition.d.ts +1 -15
- package/lib/es/navigation/OpenIconTransition.js +1 -66
- package/lib/es/navigation/SubNav.d.ts +4 -4
- package/lib/es/navigation/SubNav.js +43 -28
- package/lib/es/navigation/index.d.ts +8 -11
- package/lib/es/notification/index.d.ts +0 -1
- package/lib/es/notification/index.js +24 -14
- package/lib/es/notification/notice.d.ts +3 -1
- package/lib/es/notification/notice.js +3 -1
- package/lib/es/popconfirm/index.d.ts +4 -5
- package/lib/es/popover/index.d.ts +8 -8
- package/lib/es/popover/index.js +1 -1
- package/lib/es/progress/index.d.ts +4 -4
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/scrollList/index.d.ts +1 -1
- package/lib/es/scrollList/scrollItem.d.ts +3 -3
- package/lib/es/scrollList/scrollItem.js +3 -3
- package/lib/es/select/index.d.ts +11 -6
- package/lib/es/select/index.js +108 -60
- package/lib/es/select/option.d.ts +1 -1
- package/lib/es/select/optionGroup.d.ts +1 -1
- package/lib/es/sideSheet/SideSheetContent.d.ts +8 -0
- package/lib/es/sideSheet/SideSheetContent.js +10 -6
- package/lib/es/sideSheet/index.d.ts +4 -4
- package/lib/es/sideSheet/index.js +67 -37
- package/lib/es/space/index.d.ts +1 -1
- package/lib/es/spin/index.js +1 -4
- package/lib/es/table/Body/BaseRow.d.ts +5 -5
- package/lib/es/table/Body/ExpandedRow.d.ts +3 -3
- package/lib/es/table/Body/SectionRow.d.ts +3 -3
- package/lib/es/table/Column.d.ts +4 -4
- package/lib/es/table/ColumnShape.d.ts +4 -4
- package/lib/es/table/ColumnSorter.d.ts +1 -1
- package/lib/es/table/CustomExpandIcon.d.ts +1 -1
- package/lib/es/table/CustomExpandIcon.js +13 -5
- package/lib/es/table/Table.d.ts +16 -16
- package/lib/es/table/TableCell.d.ts +4 -4
- package/lib/es/table/TableHeaderRow.d.ts +2 -2
- package/lib/es/table/TablePagination.d.ts +1 -1
- package/lib/es/table/index.d.ts +15 -15
- package/lib/es/tabs/TabPane.d.ts +2 -8
- package/lib/es/tabs/TabPane.js +40 -38
- package/lib/es/tabs/index.d.ts +5 -3
- package/lib/es/tabs/index.js +26 -4
- package/lib/es/tabs/interface.d.ts +2 -0
- package/lib/es/tag/group.d.ts +1 -0
- package/lib/es/tag/group.js +6 -3
- package/lib/es/tag/index.d.ts +1 -1
- package/lib/es/tag/index.js +1 -0
- package/lib/es/tag/interface.d.ts +3 -1
- package/lib/es/tagInput/index.d.ts +3 -3
- package/lib/es/timePicker/Combobox.js +4 -8
- package/lib/es/timePicker/PanelShape.d.ts +2 -2
- package/lib/es/timePicker/TimePicker.d.ts +11 -11
- package/lib/es/timePicker/TimePicker.js +3 -1
- package/lib/es/timePicker/TimeShape.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +10 -9
- package/lib/es/timeline/index.d.ts +1 -1
- package/lib/es/toast/index.d.ts +2 -4
- package/lib/es/toast/index.js +27 -13
- package/lib/es/toast/toast.d.ts +4 -2
- package/lib/es/toast/toast.js +3 -1
- package/lib/es/tooltip/index.d.ts +8 -9
- package/lib/es/tooltip/index.js +27 -36
- package/lib/es/transfer/index.d.ts +1 -1
- package/lib/es/tree/autoSizer.d.ts +2 -2
- package/lib/es/tree/index.d.ts +5 -5
- package/lib/es/tree/nodeCollapsible.d.ts +11 -0
- package/lib/es/tree/nodeCollapsible.js +35 -0
- package/lib/es/tree/nodeList.js +6 -5
- package/lib/es/tree/treeNode.d.ts +1 -1
- package/lib/es/treeSelect/index.d.ts +12 -9
- package/lib/es/treeSelect/index.js +22 -8
- package/lib/es/trigger/index.d.ts +1 -1
- package/lib/es/typography/base.d.ts +8 -8
- package/lib/es/typography/index.d.ts +2 -0
- package/lib/es/typography/index.js +2 -0
- package/lib/es/typography/interface.d.ts +2 -0
- package/lib/es/typography/numeral.d.ts +68 -0
- package/lib/es/typography/numeral.js +86 -0
- package/lib/es/typography/paragraph.d.ts +3 -3
- package/lib/es/typography/text.d.ts +4 -4
- package/lib/es/typography/title.d.ts +4 -4
- package/lib/es/upload/fileCard.d.ts +1 -1
- package/package.json +7 -7
- package/lib/cjs/motions/Rotate.d.ts +0 -23
- package/lib/cjs/motions/Rotate.js +0 -76
- package/lib/cjs/navigation/SubNavTransition.d.ts +0 -17
- package/lib/cjs/navigation/SubNavTransition.js +0 -83
- package/lib/cjs/notification/NoticeTransition.d.ts +0 -10
- package/lib/cjs/notification/NoticeTransition.js +0 -85
- package/lib/cjs/sideSheet/SideSheetTransition.d.ts +0 -12
- package/lib/cjs/sideSheet/SideSheetTransition.js +0 -115
- package/lib/cjs/tabs/TabPaneTransition.d.ts +0 -4
- package/lib/cjs/tabs/TabPaneTransition.js +0 -114
- package/lib/cjs/toast/ToastTransition.d.ts +0 -7
- package/lib/cjs/toast/ToastTransition.js +0 -66
- package/lib/cjs/tooltip/TooltipStyledTransition.d.ts +0 -9
- package/lib/cjs/tooltip/TooltipStyledTransition.js +0 -52
- package/lib/cjs/tree/collapse.d.ts +0 -29
- package/lib/cjs/tree/collapse.js +0 -155
- package/lib/es/motions/Rotate.d.ts +0 -23
- package/lib/es/motions/Rotate.js +0 -60
- package/lib/es/navigation/SubNavTransition.d.ts +0 -17
- package/lib/es/navigation/SubNavTransition.js +0 -66
- package/lib/es/notification/NoticeTransition.d.ts +0 -10
- package/lib/es/notification/NoticeTransition.js +0 -74
- package/lib/es/sideSheet/SideSheetTransition.d.ts +0 -12
- package/lib/es/sideSheet/SideSheetTransition.js +0 -102
- package/lib/es/tabs/TabPaneTransition.d.ts +0 -4
- package/lib/es/tabs/TabPaneTransition.js +0 -103
- package/lib/es/toast/ToastTransition.d.ts +0 -7
- package/lib/es/toast/ToastTransition.js +0 -55
- package/lib/es/tooltip/TooltipStyledTransition.d.ts +0 -9
- package/lib/es/tooltip/TooltipStyledTransition.js +0 -38
- package/lib/es/tree/collapse.d.ts +0 -29
- package/lib/es/tree/collapse.js +0 -136
|
@@ -11,13 +11,13 @@ import cls from 'classnames';
|
|
|
11
11
|
import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
|
|
12
12
|
import isNullOrUndefined from '@douyinfe/semi-foundation/lib/es/utils/isNullOrUndefined';
|
|
13
13
|
import SubNavFoundation from '@douyinfe/semi-foundation/lib/es/navigation/subNavFoundation';
|
|
14
|
-
import { strings, numbers } from '@douyinfe/semi-foundation/lib/es/navigation/constants';
|
|
14
|
+
import { strings, numbers, cssClasses } from '@douyinfe/semi-foundation/lib/es/navigation/constants';
|
|
15
15
|
import { IconChevronDown, IconChevronUp, IconChevronRight } from '@douyinfe/semi-icons';
|
|
16
16
|
import NavItem from './Item';
|
|
17
17
|
import Dropdown from '../dropdown';
|
|
18
18
|
import NavContext from './nav-context';
|
|
19
|
-
import
|
|
20
|
-
import
|
|
19
|
+
import Collapsible from "../collapsible";
|
|
20
|
+
import CSSAnimation from "../_cssAnimation";
|
|
21
21
|
export default class SubNav extends BaseComponent {
|
|
22
22
|
constructor(props) {
|
|
23
23
|
super(props);
|
|
@@ -127,14 +127,19 @@ export default class SubNav extends BaseComponent {
|
|
|
127
127
|
["".concat(prefixCls, "-item-icon-info")]: !isToggleIcon
|
|
128
128
|
});
|
|
129
129
|
const isOpen = this.adapter.getIsOpen();
|
|
130
|
-
const iconElem = /*#__PURE__*/React.isValidElement(icon) ? withTransition ?
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
const iconElem = /*#__PURE__*/React.isValidElement(icon) ? withTransition ? /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
131
|
+
animationState: isOpen ? "enter" : "leave",
|
|
132
|
+
startClassName: "".concat(cssClasses.PREFIX, "-icon-rotate-").concat(isOpen ? "0" : "180")
|
|
133
|
+
}, _ref => {
|
|
134
|
+
let {
|
|
135
|
+
animationClassName
|
|
136
|
+
} = _ref;
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
return /*#__PURE__*/React.cloneElement(icon, {
|
|
139
|
+
size: iconSize,
|
|
140
|
+
className: animationClassName
|
|
141
|
+
});
|
|
142
|
+
}) // @ts-ignore
|
|
138
143
|
: /*#__PURE__*/React.cloneElement(icon, {
|
|
139
144
|
size: iconSize
|
|
140
145
|
}) : null;
|
|
@@ -161,6 +166,7 @@ export default class SubNav extends BaseComponent {
|
|
|
161
166
|
subNavMotion,
|
|
162
167
|
limitIndent
|
|
163
168
|
} = this.context;
|
|
169
|
+
const isOpen = this.adapter.getIsOpen();
|
|
164
170
|
const titleCls = cls("".concat(prefixCls, "-sub-title"), {
|
|
165
171
|
["".concat(prefixCls, "-sub-title-selected")]: this.adapter.getIsSelected(itemKey),
|
|
166
172
|
["".concat(prefixCls, "-sub-title-disabled")]: disabled
|
|
@@ -176,9 +182,13 @@ export default class SubNav extends BaseComponent {
|
|
|
176
182
|
}
|
|
177
183
|
} else if (mode === strings.MODE_HORIZONTAL) {
|
|
178
184
|
if (isInSubNav) {
|
|
179
|
-
toggleIconType = /*#__PURE__*/React.createElement(IconChevronRight,
|
|
185
|
+
toggleIconType = /*#__PURE__*/React.createElement(IconChevronRight, {
|
|
186
|
+
"aria-hidden": true
|
|
187
|
+
});
|
|
180
188
|
} else {
|
|
181
|
-
toggleIconType = /*#__PURE__*/React.createElement(IconChevronDown,
|
|
189
|
+
toggleIconType = /*#__PURE__*/React.createElement(IconChevronDown, {
|
|
190
|
+
"aria-hidden": true
|
|
191
|
+
}); // Horizontal mode does not require animation fix#1198
|
|
182
192
|
// withTransition = true;
|
|
183
193
|
}
|
|
184
194
|
} else {
|
|
@@ -186,7 +196,9 @@ export default class SubNav extends BaseComponent {
|
|
|
186
196
|
withTransition = true;
|
|
187
197
|
}
|
|
188
198
|
|
|
189
|
-
toggleIconType = /*#__PURE__*/React.createElement(IconChevronDown,
|
|
199
|
+
toggleIconType = /*#__PURE__*/React.createElement(IconChevronDown, {
|
|
200
|
+
"aria-hidden": true
|
|
201
|
+
});
|
|
190
202
|
}
|
|
191
203
|
|
|
192
204
|
let placeholderIcons = null;
|
|
@@ -197,13 +209,16 @@ export default class SubNav extends BaseComponent {
|
|
|
197
209
|
placeholderIcons = _times(iconAmount, index => this.renderIcon(null, strings.ICON_POS_RIGHT, false, false, index));
|
|
198
210
|
}
|
|
199
211
|
|
|
212
|
+
const isIconChevronRightShow = !isCollapsed && isInSubNav && mode === strings.MODE_HORIZONTAL || isCollapsed && isInSubNav;
|
|
200
213
|
const titleDiv = /*#__PURE__*/React.createElement("div", {
|
|
201
214
|
role: "menuitem",
|
|
202
|
-
|
|
215
|
+
// to avoid nested horizontal navigation be focused
|
|
216
|
+
tabIndex: isIconChevronRightShow ? -1 : 0,
|
|
203
217
|
ref: this.setTitleRef,
|
|
204
218
|
className: titleCls,
|
|
205
219
|
onClick: this.handleClick,
|
|
206
|
-
onKeyPress: this.handleKeyPress
|
|
220
|
+
onKeyPress: this.handleKeyPress,
|
|
221
|
+
"aria-expanded": isOpen ? 'true' : 'false'
|
|
207
222
|
}, /*#__PURE__*/React.createElement("div", {
|
|
208
223
|
className: "".concat(prefixCls, "-item-inner")
|
|
209
224
|
}, placeholderIcons, this.context.toggleIconPosition === strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== strings.MODE_HORIZONTAL ? this.renderIcon(icon, strings.ICON_POS_LEFT, false, false, 'key-inSubNav-position-left') : null, /*#__PURE__*/React.createElement("span", {
|
|
@@ -229,14 +244,12 @@ export default class SubNav extends BaseComponent {
|
|
|
229
244
|
["".concat(prefixCls, "-sub-open")]: isOpen,
|
|
230
245
|
["".concat(prefixCls, "-sub-popover")]: isCollapsed || isHorizontal
|
|
231
246
|
});
|
|
232
|
-
const ulWithMotion = /*#__PURE__*/React.createElement(
|
|
247
|
+
const ulWithMotion = /*#__PURE__*/React.createElement(Collapsible, {
|
|
233
248
|
motion: subNavMotion,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
visibility: isCollapsed ? 'hidden' : 'visible'
|
|
239
|
-
}),
|
|
249
|
+
isOpen: isOpen,
|
|
250
|
+
keepDOM: false,
|
|
251
|
+
fade: true
|
|
252
|
+
}, !isCollapsed ? /*#__PURE__*/React.createElement("ul", {
|
|
240
253
|
className: subNavCls
|
|
241
254
|
}, children) : null);
|
|
242
255
|
const finalDom = isHorizontal ? null : subNavMotion ? ulWithMotion : isOpen && !isCollapsed ? /*#__PURE__*/React.createElement("ul", {
|
|
@@ -280,9 +293,7 @@ export default class SubNav extends BaseComponent {
|
|
|
280
293
|
// Do not show dropdown when disabled
|
|
281
294
|
_elem = !disabled ? /*#__PURE__*/React.createElement(Dropdown, Object.assign({
|
|
282
295
|
className: subNavCls,
|
|
283
|
-
render: /*#__PURE__*/React.createElement(Dropdown.Menu, null,
|
|
284
|
-
className: "".concat(prefixCls, "-popover-crumb")
|
|
285
|
-
}), children),
|
|
296
|
+
render: /*#__PURE__*/React.createElement(Dropdown.Menu, null, children),
|
|
286
297
|
position: mode === strings.MODE_HORIZONTAL && !isInSubNav ? 'bottomLeft' : 'rightTop',
|
|
287
298
|
mouseEnterDelay: subNavOpenDelay,
|
|
288
299
|
mouseLeaveDelay: subNavCloseDelay,
|
|
@@ -396,8 +407,12 @@ SubNav.defaultProps = {
|
|
|
396
407
|
isOpen: false,
|
|
397
408
|
maxHeight: numbers.DEFAULT_SUBNAV_MAX_HEIGHT,
|
|
398
409
|
toggleIcon: {
|
|
399
|
-
open: /*#__PURE__*/React.createElement(IconChevronUp,
|
|
400
|
-
|
|
410
|
+
open: /*#__PURE__*/React.createElement(IconChevronUp, {
|
|
411
|
+
"aria-hidden": true
|
|
412
|
+
}),
|
|
413
|
+
closed: /*#__PURE__*/React.createElement(IconChevronDown, {
|
|
414
|
+
"aria-hidden": true
|
|
415
|
+
})
|
|
401
416
|
},
|
|
402
417
|
disabled: false
|
|
403
418
|
};
|
|
@@ -7,14 +7,11 @@ import Item, { NavItemProps } from './Item';
|
|
|
7
7
|
import Footer, { NavFooterProps } from './Footer';
|
|
8
8
|
import Header, { NavHeaderProps } from './Header';
|
|
9
9
|
import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
|
|
10
|
-
import { Motion } from '../_base/base';
|
|
11
10
|
export type { CollapseButtonProps } from './CollapseButton';
|
|
12
11
|
export type { NavFooterProps } from './Footer';
|
|
13
12
|
export type { NavHeaderProps } from './Header';
|
|
14
13
|
export type { NavItemProps } from './Item';
|
|
15
|
-
export type { OpenIconTransitionProps } from './OpenIconTransition';
|
|
16
14
|
export type { ToggleIcon, SubNavProps } from './SubNav';
|
|
17
|
-
export type { SubNavTransitionProps } from './SubNavTransition';
|
|
18
15
|
export declare type Mode = 'vertical' | 'horizontal';
|
|
19
16
|
export interface OnSelectedData {
|
|
20
17
|
itemKey: React.ReactText;
|
|
@@ -47,7 +44,7 @@ export interface NavProps extends BaseProps {
|
|
|
47
44
|
prefixCls?: string;
|
|
48
45
|
selectedKeys?: React.ReactText[];
|
|
49
46
|
subNavCloseDelay?: number;
|
|
50
|
-
subNavMotion?:
|
|
47
|
+
subNavMotion?: boolean;
|
|
51
48
|
subNavOpenDelay?: number;
|
|
52
49
|
toggleIconPosition?: string;
|
|
53
50
|
tooltipHideDelay?: number;
|
|
@@ -82,10 +79,10 @@ declare class Nav extends BaseComponent<NavProps, NavState> {
|
|
|
82
79
|
static Header: typeof Header;
|
|
83
80
|
static Footer: typeof Footer;
|
|
84
81
|
static propTypes: {
|
|
85
|
-
defaultOpenKeys: PropTypes.Requireable<
|
|
86
|
-
openKeys: PropTypes.Requireable<
|
|
87
|
-
defaultSelectedKeys: PropTypes.Requireable<
|
|
88
|
-
selectedKeys: PropTypes.Requireable<
|
|
82
|
+
defaultOpenKeys: PropTypes.Requireable<NonNullable<string | number>[]>;
|
|
83
|
+
openKeys: PropTypes.Requireable<NonNullable<string | number>[]>;
|
|
84
|
+
defaultSelectedKeys: PropTypes.Requireable<NonNullable<string | number>[]>;
|
|
85
|
+
selectedKeys: PropTypes.Requireable<NonNullable<string | number>[]>;
|
|
89
86
|
mode: PropTypes.Requireable<string>;
|
|
90
87
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
91
88
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -96,7 +93,7 @@ declare class Nav extends BaseComponent<NavProps, NavState> {
|
|
|
96
93
|
onCollapseChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
97
94
|
multiple: PropTypes.Requireable<boolean>;
|
|
98
95
|
onDeselect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
99
|
-
subNavMotion: PropTypes.Requireable<boolean | object
|
|
96
|
+
subNavMotion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
100
97
|
subNavCloseDelay: PropTypes.Requireable<number>;
|
|
101
98
|
subNavOpenDelay: PropTypes.Requireable<number>;
|
|
102
99
|
tooltipShowDelay: PropTypes.Requireable<number>;
|
|
@@ -107,8 +104,8 @@ declare class Nav extends BaseComponent<NavProps, NavState> {
|
|
|
107
104
|
className: PropTypes.Requireable<string>;
|
|
108
105
|
toggleIconPosition: PropTypes.Requireable<string>;
|
|
109
106
|
prefixCls: PropTypes.Requireable<string>;
|
|
110
|
-
header: PropTypes.Requireable<object | PropTypes.ReactNodeLike
|
|
111
|
-
footer: PropTypes.Requireable<object | PropTypes.ReactNodeLike
|
|
107
|
+
header: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
|
108
|
+
footer: PropTypes.Requireable<NonNullable<object | PropTypes.ReactNodeLike>>;
|
|
112
109
|
limitIndent: PropTypes.Requireable<boolean>;
|
|
113
110
|
};
|
|
114
111
|
static defaultProps: {
|
|
@@ -6,7 +6,6 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
6
6
|
import '@douyinfe/semi-foundation/lib/es/notification/notification.css';
|
|
7
7
|
import useNotification from './useNotification';
|
|
8
8
|
import { NoticeInstance, NoticePosition, NoticeProps, NoticeState } from '@douyinfe/semi-foundation/lib/es/notification/notificationFoundation';
|
|
9
|
-
export type { NoticeTransitionProps } from './NoticeTransition';
|
|
10
9
|
export interface NoticeReactProps extends NoticeProps {
|
|
11
10
|
style?: CSSProperties;
|
|
12
11
|
}
|
|
@@ -8,9 +8,9 @@ import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/notificati
|
|
|
8
8
|
import Notice from './notice';
|
|
9
9
|
import BaseComponent from '../_base/baseComponent';
|
|
10
10
|
import '@douyinfe/semi-foundation/lib/es/notification/notification.css';
|
|
11
|
-
import NoticeTransition from './NoticeTransition';
|
|
12
11
|
import getUuid from '@douyinfe/semi-foundation/lib/es/utils/uuid';
|
|
13
12
|
import useNotification from './useNotification';
|
|
13
|
+
import CSSAnimation from "../_cssAnimation";
|
|
14
14
|
let ref = null;
|
|
15
15
|
const defaultConfig = {
|
|
16
16
|
duration: 3,
|
|
@@ -51,19 +51,29 @@ class NotificationList extends BaseComponent {
|
|
|
51
51
|
key: position,
|
|
52
52
|
className: className,
|
|
53
53
|
style: style
|
|
54
|
-
}, notices.map((notice, index) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
}, notices.map((notice, index) => {
|
|
55
|
+
const isRemoved = removedItems.find(removedItem => removedItem.id === notice.id) !== undefined;
|
|
56
|
+
return /*#__PURE__*/React.createElement(CSSAnimation, {
|
|
57
|
+
key: notice.id,
|
|
58
|
+
animationState: isRemoved ? "leave" : "enter",
|
|
59
|
+
startClassName: "".concat(cssClasses.NOTICE, "-animation-").concat(isRemoved ? "hide" : "show", "_").concat(position)
|
|
60
|
+
}, _ref => {
|
|
61
|
+
let {
|
|
62
|
+
animationClassName,
|
|
63
|
+
animationEventsNeedBind,
|
|
64
|
+
isAnimating
|
|
65
|
+
} = _ref;
|
|
66
|
+
return isRemoved && !isAnimating ? null : /*#__PURE__*/React.createElement(Notice, Object.assign({}, notice, {
|
|
67
|
+
className: cls({
|
|
68
|
+
[notice.className]: Boolean(notice.className),
|
|
69
|
+
[animationClassName]: true
|
|
70
|
+
})
|
|
71
|
+
}, animationEventsNeedBind, {
|
|
72
|
+
style: Object.assign({}, notice.style),
|
|
73
|
+
close: _this.remove
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
}))
|
|
67
77
|
);
|
|
68
78
|
}
|
|
69
79
|
|
|
@@ -9,12 +9,14 @@ export interface NoticeReactProps extends NoticeProps {
|
|
|
9
9
|
content?: React.ReactNode;
|
|
10
10
|
icon?: React.ReactNode;
|
|
11
11
|
onClick?: (e: React.MouseEvent) => void;
|
|
12
|
+
onAnimationEnd?: (e: React.AnimationEvent) => void;
|
|
13
|
+
onAnimationStart?: (e: React.AnimationEvent) => void;
|
|
12
14
|
}
|
|
13
15
|
declare class Notice extends BaseComponent<NoticeReactProps, NoticeState> {
|
|
14
16
|
static contextType: React.Context<ContextValue>;
|
|
15
17
|
static propTypes: {
|
|
16
18
|
duration: PropTypes.Requireable<number>;
|
|
17
|
-
id: PropTypes.Requireable<string | number
|
|
19
|
+
id: PropTypes.Requireable<NonNullable<string | number>>;
|
|
18
20
|
title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
19
21
|
content: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
22
|
type: PropTypes.Requireable<string>;
|
|
@@ -158,7 +158,9 @@ class Notice extends BaseComponent {
|
|
|
158
158
|
onMouseLeave: this.startCloseTimer,
|
|
159
159
|
onClick: this.notifyClick,
|
|
160
160
|
"aria-labelledby": titleID,
|
|
161
|
-
role: 'alert'
|
|
161
|
+
role: 'alert',
|
|
162
|
+
onAnimationEnd: this.props.onAnimationEnd,
|
|
163
|
+
onAnimationStart: this.props.onAnimationStart
|
|
162
164
|
}, /*#__PURE__*/React.createElement("div", null, this.renderTypeIcon()), /*#__PURE__*/React.createElement("div", {
|
|
163
165
|
className: "".concat(prefixCls, "-inner")
|
|
164
166
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -8,7 +8,6 @@ import { ButtonProps } from '../button';
|
|
|
8
8
|
import { Type as ButtonType } from '../button/Button';
|
|
9
9
|
import { ContextValue } from '../configProvider/context';
|
|
10
10
|
import '@douyinfe/semi-foundation/lib/es/popconfirm/popconfirm.css';
|
|
11
|
-
import { Motion } from '../_base/base';
|
|
12
11
|
export interface PopconfirmProps extends PopoverProps {
|
|
13
12
|
cancelText?: string;
|
|
14
13
|
cancelButtonProps?: ButtonProps;
|
|
@@ -20,7 +19,7 @@ export interface PopconfirmProps extends PopoverProps {
|
|
|
20
19
|
okText?: string;
|
|
21
20
|
okType?: ButtonType;
|
|
22
21
|
okButtonProps?: ButtonProps;
|
|
23
|
-
motion?:
|
|
22
|
+
motion?: boolean;
|
|
24
23
|
title?: React.ReactNode;
|
|
25
24
|
visible?: boolean;
|
|
26
25
|
prefixCls?: string;
|
|
@@ -40,14 +39,14 @@ export interface PopconfirmState {
|
|
|
40
39
|
export default class Popconfirm extends BaseComponent<PopconfirmProps, PopconfirmState> {
|
|
41
40
|
static contextType: React.Context<ContextValue>;
|
|
42
41
|
static propTypes: {
|
|
43
|
-
motion: PropTypes.Requireable<boolean | object
|
|
42
|
+
motion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
44
43
|
disabled: PropTypes.Requireable<boolean>;
|
|
45
44
|
content: PropTypes.Requireable<any>;
|
|
46
45
|
title: PropTypes.Requireable<any>;
|
|
47
46
|
prefixCls: PropTypes.Requireable<string>;
|
|
48
47
|
className: PropTypes.Requireable<string>;
|
|
49
48
|
style: PropTypes.Requireable<object>;
|
|
50
|
-
icon: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
49
|
+
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
51
50
|
okText: PropTypes.Requireable<string>;
|
|
52
51
|
okType: PropTypes.Requireable<string>;
|
|
53
52
|
cancelText: PropTypes.Requireable<string>;
|
|
@@ -60,7 +59,7 @@ export default class Popconfirm extends BaseComponent<PopconfirmProps, Popconfir
|
|
|
60
59
|
defaultVisible: PropTypes.Requireable<boolean>;
|
|
61
60
|
okButtonProps: PropTypes.Requireable<object>;
|
|
62
61
|
cancelButtonProps: PropTypes.Requireable<object>;
|
|
63
|
-
stopPropagation: PropTypes.Requireable<string | boolean
|
|
62
|
+
stopPropagation: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
64
63
|
zIndex: PropTypes.Requireable<number>;
|
|
65
64
|
trigger: PropTypes.Requireable<string>;
|
|
66
65
|
position: PropTypes.Requireable<string>;
|
|
@@ -4,7 +4,6 @@ import { ContextValue } from '../configProvider/context';
|
|
|
4
4
|
import { ArrowBounding, Position, TooltipProps, Trigger, RenderContentProps } from '../tooltip/index';
|
|
5
5
|
import '@douyinfe/semi-foundation/lib/es/popover/popover.css';
|
|
6
6
|
import { BaseProps } from '../_base/baseComponent';
|
|
7
|
-
import { Motion } from '../_base/base';
|
|
8
7
|
import type { ArrowProps } from './Arrow';
|
|
9
8
|
export type { ArrowProps };
|
|
10
9
|
declare interface ArrowStyle {
|
|
@@ -17,7 +16,7 @@ export interface PopoverProps extends BaseProps {
|
|
|
17
16
|
content?: TooltipProps['content'];
|
|
18
17
|
visible?: boolean;
|
|
19
18
|
autoAdjustOverflow?: boolean;
|
|
20
|
-
motion?:
|
|
19
|
+
motion?: boolean;
|
|
21
20
|
position?: Position;
|
|
22
21
|
mouseEnterDelay?: number;
|
|
23
22
|
mouseLeaveDelay?: number;
|
|
@@ -41,6 +40,7 @@ export interface PopoverProps extends BaseProps {
|
|
|
41
40
|
onEscKeyDown?: TooltipProps['onEscKeyDown'];
|
|
42
41
|
clickToHide?: TooltipProps['clickToHide'];
|
|
43
42
|
disableFocusListener?: boolean;
|
|
43
|
+
afterClose?: () => void;
|
|
44
44
|
}
|
|
45
45
|
export interface PopoverState {
|
|
46
46
|
popConfirmVisible: boolean;
|
|
@@ -49,15 +49,15 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
|
|
|
49
49
|
static contextType: React.Context<ContextValue>;
|
|
50
50
|
static propTypes: {
|
|
51
51
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
52
|
-
content: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
52
|
+
content: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
53
53
|
visible: PropTypes.Requireable<boolean>;
|
|
54
54
|
autoAdjustOverflow: PropTypes.Requireable<boolean>;
|
|
55
|
-
motion: PropTypes.Requireable<boolean
|
|
56
|
-
position: PropTypes.Requireable<"
|
|
55
|
+
motion: PropTypes.Requireable<boolean>;
|
|
56
|
+
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver">;
|
|
57
57
|
mouseEnterDelay: PropTypes.Requireable<number>;
|
|
58
58
|
mouseLeaveDelay: PropTypes.Requireable<number>;
|
|
59
|
-
trigger: PropTypes.Validator<"hover" | "focus" | "click" | "custom"
|
|
60
|
-
contentClassName: PropTypes.Requireable<string | any[]
|
|
59
|
+
trigger: PropTypes.Validator<NonNullable<"hover" | "focus" | "click" | "custom">>;
|
|
60
|
+
contentClassName: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
61
61
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
62
62
|
onClickOutSide: PropTypes.Requireable<(...args: any[]) => any>;
|
|
63
63
|
style: PropTypes.Requireable<object>;
|
|
@@ -67,7 +67,7 @@ declare class Popover extends React.PureComponent<PopoverProps, PopoverState> {
|
|
|
67
67
|
arrowStyle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
68
68
|
borderColor: PropTypes.Requireable<string>;
|
|
69
69
|
backgroundColor: PropTypes.Requireable<string>;
|
|
70
|
-
borderOpacity: PropTypes.Requireable<string | number
|
|
70
|
+
borderOpacity: PropTypes.Requireable<NonNullable<string | number>>;
|
|
71
71
|
}>>;
|
|
72
72
|
arrowPointAtCenter: PropTypes.Requireable<boolean>;
|
|
73
73
|
arrowBounding: PropTypes.Requireable<object>;
|
package/lib/es/popover/index.js
CHANGED
|
@@ -118,7 +118,7 @@ Popover.propTypes = {
|
|
|
118
118
|
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
119
119
|
visible: PropTypes.bool,
|
|
120
120
|
autoAdjustOverflow: PropTypes.bool,
|
|
121
|
-
motion: PropTypes.
|
|
121
|
+
motion: PropTypes.bool,
|
|
122
122
|
position: PropTypes.oneOf(positionSet),
|
|
123
123
|
// getPopupContainer: PropTypes.func,
|
|
124
124
|
mouseEnterDelay: PropTypes.number,
|
|
@@ -35,18 +35,18 @@ declare class Progress extends Component<ProgressProps, ProgressState> {
|
|
|
35
35
|
'aria-valuetext': PropTypes.Requireable<string>;
|
|
36
36
|
className: PropTypes.Requireable<string>;
|
|
37
37
|
direction: PropTypes.Requireable<string>;
|
|
38
|
-
format: PropTypes.Requireable<PropTypes.ReactNodeLike | ((...args: any[]) => any)
|
|
38
|
+
format: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
39
39
|
id: PropTypes.Requireable<string>;
|
|
40
|
-
motion: PropTypes.Requireable<boolean | object
|
|
40
|
+
motion: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
41
41
|
orbitStroke: PropTypes.Requireable<string>;
|
|
42
42
|
percent: PropTypes.Requireable<number>;
|
|
43
43
|
scale: PropTypes.Requireable<number>;
|
|
44
44
|
showInfo: PropTypes.Requireable<boolean>;
|
|
45
45
|
size: PropTypes.Requireable<string>;
|
|
46
|
-
stroke: PropTypes.Requireable<string | PropTypes.InferProps<{
|
|
46
|
+
stroke: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
47
47
|
percent: PropTypes.Requireable<number>;
|
|
48
48
|
color: PropTypes.Requireable<string>;
|
|
49
|
-
}>[]
|
|
49
|
+
}>[]>>;
|
|
50
50
|
strokeGradient: PropTypes.Requireable<boolean>;
|
|
51
51
|
strokeLinecap: PropTypes.Requireable<string>;
|
|
52
52
|
strokeWidth: PropTypes.Requireable<number>;
|
package/lib/es/rating/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export default class Rating extends BaseComponent<RatingProps, RatingState> {
|
|
|
69
69
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
70
|
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
71
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
72
|
-
size: PropTypes.Requireable<number | "default" | "small"
|
|
72
|
+
size: PropTypes.Requireable<NonNullable<number | "default" | "small">>;
|
|
73
73
|
tooltips: PropTypes.Requireable<string[]>;
|
|
74
74
|
id: PropTypes.Requireable<string>;
|
|
75
75
|
preventScroll: PropTypes.Requireable<boolean>;
|
package/lib/es/rating/item.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export default class Item extends BaseComponent<RatingItemProps, RatingItemState
|
|
|
40
40
|
disabled: PropTypes.Requireable<boolean>;
|
|
41
41
|
count: PropTypes.Requireable<number>;
|
|
42
42
|
ariaLabelPrefix: PropTypes.Requireable<string>;
|
|
43
|
-
size: PropTypes.Requireable<number | "default" | "small"
|
|
43
|
+
size: PropTypes.Requireable<NonNullable<number | "default" | "small">>;
|
|
44
44
|
'aria-describedby': PropTypes.Requireable<string>;
|
|
45
45
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -18,7 +18,7 @@ declare class ScrollList extends BaseComponent<ScrollListProps, {}> {
|
|
|
18
18
|
header: propTypes.Requireable<propTypes.ReactNodeLike>;
|
|
19
19
|
footer: propTypes.Requireable<propTypes.ReactNodeLike>;
|
|
20
20
|
children: propTypes.Requireable<propTypes.ReactNodeLike>;
|
|
21
|
-
bodyHeight: propTypes.Requireable<string | number
|
|
21
|
+
bodyHeight: propTypes.Requireable<NonNullable<string | number>>;
|
|
22
22
|
};
|
|
23
23
|
constructor(props: ScrollListProps);
|
|
24
24
|
render(): JSX.Element;
|
|
@@ -26,7 +26,7 @@ export interface ScrollItemState {
|
|
|
26
26
|
}
|
|
27
27
|
export default class ScrollItem<T extends Item> extends BaseComponent<ScrollItemProps<T>, ScrollItemState> {
|
|
28
28
|
static propTypes: {
|
|
29
|
-
mode: PropTypes.Requireable<
|
|
29
|
+
mode: PropTypes.Requireable<"normal" | "wheel">;
|
|
30
30
|
cycled: PropTypes.Requireable<boolean>;
|
|
31
31
|
list: PropTypes.Requireable<any[]>;
|
|
32
32
|
selectedIndex: PropTypes.Requireable<number>;
|
|
@@ -34,8 +34,8 @@ export default class ScrollItem<T extends Item> extends BaseComponent<ScrollItem
|
|
|
34
34
|
transform: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
35
|
className: PropTypes.Requireable<string>;
|
|
36
36
|
style: PropTypes.Requireable<object>;
|
|
37
|
-
motion: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
38
|
-
type: PropTypes.Requireable<string | number
|
|
37
|
+
motion: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
38
|
+
type: PropTypes.Requireable<NonNullable<string | number>>;
|
|
39
39
|
};
|
|
40
40
|
static defaultProps: {
|
|
41
41
|
selectedIndex: number;
|
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import BaseComponent from '../_base/baseComponent';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
|
-
import { cssClasses, numbers } from '@douyinfe/semi-foundation/lib/es/scrollList/constants';
|
|
12
|
+
import { cssClasses, numbers, strings } from '@douyinfe/semi-foundation/lib/es/scrollList/constants';
|
|
13
13
|
import ItemFoundation from '@douyinfe/semi-foundation/lib/es/scrollList/itemFoundation';
|
|
14
14
|
import animatedScrollTo from '@douyinfe/semi-foundation/lib/es/scrollList/scrollTo';
|
|
15
15
|
import isElement from '@douyinfe/semi-foundation/lib/es/utils/isElement';
|
|
@@ -414,7 +414,7 @@ export default class ScrollItem extends BaseComponent {
|
|
|
414
414
|
this._cacheSelectedNode(nearestNode);
|
|
415
415
|
|
|
416
416
|
this.foundation.selectNode(nearestNode, this.list);
|
|
417
|
-
}, msPerFrame *
|
|
417
|
+
}, msPerFrame * 2);
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
get adapter() {
|
|
@@ -526,7 +526,7 @@ export default class ScrollItem extends BaseComponent {
|
|
|
526
526
|
|
|
527
527
|
}
|
|
528
528
|
ScrollItem.propTypes = {
|
|
529
|
-
mode: PropTypes.
|
|
529
|
+
mode: PropTypes.oneOf(strings.MODE),
|
|
530
530
|
cycled: PropTypes.bool,
|
|
531
531
|
list: PropTypes.array,
|
|
532
532
|
selectedIndex: PropTypes.number,
|
package/lib/es/select/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { ContextValue } from '../configProvider/context';
|
|
4
4
|
import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/es/select/foundation';
|
|
5
5
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
6
|
+
import { PopoverProps } from '../popover/index';
|
|
6
7
|
import { InputProps } from '../input/index';
|
|
7
8
|
import Option, { OptionProps } from './option';
|
|
8
9
|
import OptionGroup from './optionGroup';
|
|
@@ -123,6 +124,8 @@ export declare type SelectProps = {
|
|
|
123
124
|
onListScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
|
|
124
125
|
children?: React.ReactNode;
|
|
125
126
|
preventScroll?: boolean;
|
|
127
|
+
showRestTagsPopover?: boolean;
|
|
128
|
+
restTagsPopoverProps?: PopoverProps;
|
|
126
129
|
} & Pick<TooltipProps, 'spacing' | 'getPopupContainer' | 'motion' | 'autoAdjustOverflow' | 'mouseLeaveDelay' | 'mouseEnterDelay' | 'stopPropagation'> & React.RefAttributes<any>;
|
|
127
130
|
export interface SelectState {
|
|
128
131
|
isOpen: boolean;
|
|
@@ -138,6 +141,7 @@ export interface SelectState {
|
|
|
138
141
|
optionGroups: Array<any>;
|
|
139
142
|
isHovering: boolean;
|
|
140
143
|
isFocusInContainer: boolean;
|
|
144
|
+
isFullTags: boolean;
|
|
141
145
|
}
|
|
142
146
|
declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
143
147
|
static contextType: React.Context<ContextValue>;
|
|
@@ -152,15 +156,15 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
152
156
|
autoFocus: PropTypes.Requireable<boolean>;
|
|
153
157
|
autoClearSearchValue: PropTypes.Requireable<boolean>;
|
|
154
158
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
155
|
-
defaultValue: PropTypes.Requireable<string | number | object
|
|
156
|
-
value: PropTypes.Requireable<string | number | object
|
|
159
|
+
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
160
|
+
value: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
157
161
|
placeholder: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
158
162
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
159
163
|
multiple: PropTypes.Requireable<boolean>;
|
|
160
|
-
filter: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
164
|
+
filter: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
161
165
|
max: PropTypes.Requireable<number>;
|
|
162
166
|
maxTagCount: PropTypes.Requireable<number>;
|
|
163
|
-
maxHeight: PropTypes.Requireable<string | number
|
|
167
|
+
maxHeight: PropTypes.Requireable<NonNullable<string | number>>;
|
|
164
168
|
style: PropTypes.Requireable<object>;
|
|
165
169
|
className: PropTypes.Requireable<string>;
|
|
166
170
|
size: PropTypes.Requireable<SelectSize>;
|
|
@@ -168,7 +172,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
168
172
|
emptyContent: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
169
173
|
onDropdownVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
170
174
|
zIndex: PropTypes.Requireable<number>;
|
|
171
|
-
position: PropTypes.Requireable<"
|
|
175
|
+
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
172
176
|
onSearch: PropTypes.Requireable<(...args: any[]) => any>;
|
|
173
177
|
getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>;
|
|
174
178
|
dropdownClassName: PropTypes.Requireable<string>;
|
|
@@ -186,7 +190,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
186
190
|
defaultActiveFirstOption: PropTypes.Requireable<boolean>;
|
|
187
191
|
triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
188
192
|
stopPropagation: PropTypes.Requireable<boolean>;
|
|
189
|
-
motion: PropTypes.Requireable<boolean
|
|
193
|
+
motion: PropTypes.Requireable<boolean>;
|
|
190
194
|
onChangeWithObject: PropTypes.Requireable<boolean>;
|
|
191
195
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
192
196
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -256,6 +260,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
256
260
|
renderVirtualizeList(visibleOptions: OptionProps[]): JSX.Element;
|
|
257
261
|
renderOptions(children?: React.ReactNode): JSX.Element;
|
|
258
262
|
renderSingleSelection(selections: Map<OptionProps['label'], any>, filterable: boolean): JSX.Element;
|
|
263
|
+
getTagItem: (item: any, i: number, renderSelectedItem: RenderSelectedItemFn) => JSX.Element;
|
|
259
264
|
renderMultipleSelection(selections: Map<OptionProps['label'], any>, filterable: boolean): JSX.Element;
|
|
260
265
|
onMouseEnter(e: MouseEvent): void;
|
|
261
266
|
onMouseLeave(e: MouseEvent): void;
|