@douyinfe/semi-ui 2.22.0-alpha.0 → 2.22.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/semi.css +450 -38
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +5068 -6354
- 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/_base/baseComponent.js +3 -0
- package/lib/cjs/_cssAnimation/index.d.ts +39 -0
- package/lib/cjs/_cssAnimation/index.js +133 -0
- package/lib/cjs/anchor/index.d.ts +2 -2
- package/lib/cjs/anchor/link.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +6 -7
- 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/checkbox/checkbox.d.ts +5 -1
- package/lib/cjs/checkbox/checkbox.js +24 -0
- package/lib/cjs/checkbox/checkboxGroup.js +2 -2
- package/lib/cjs/checkbox/context.d.ts +1 -2
- 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 +10 -7
- 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 +6 -5
- package/lib/cjs/datePicker/monthsGrid.js +9 -26
- 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/dropdownMenu.d.ts +1 -0
- package/lib/cjs/dropdown/index.d.ts +5 -5
- package/lib/cjs/form/baseForm.d.ts +6 -4
- package/lib/cjs/form/errorMessage.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +3 -1
- 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 +2 -1
- package/lib/cjs/image/previewImage.d.ts +1 -1
- package/lib/cjs/image/previewImage.js +8 -5
- package/lib/cjs/image/previewInner.d.ts +1 -1
- package/lib/cjs/image/previewInner.js +3 -3
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/input/index.d.ts +1 -0
- package/lib/cjs/input/textarea.js +1 -1
- 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 +7 -7
- 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 +10 -5
- 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/slider/index.js +2 -2
- package/lib/cjs/space/index.d.ts +1 -1
- package/lib/cjs/spin/index.d.ts +1 -0
- 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 +15 -15
- package/lib/cjs/table/Table.js +20 -1
- package/lib/cjs/table/TableCell.d.ts +4 -4
- package/lib/cjs/table/TableHeaderRow.d.ts +3 -2
- package/lib/cjs/table/TablePagination.d.ts +1 -1
- package/lib/cjs/table/index.d.ts +15 -15
- package/lib/cjs/table/interface.d.ts +2 -0
- 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 +7 -11
- package/lib/cjs/tooltip/index.js +30 -39
- 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 +3 -3
- package/lib/cjs/upload/fileCard.d.ts +1 -1
- package/lib/es/_base/baseComponent.js +3 -0
- package/lib/es/_cssAnimation/index.d.ts +39 -0
- package/lib/es/_cssAnimation/index.js +122 -0
- package/lib/es/anchor/index.d.ts +2 -2
- package/lib/es/anchor/link.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +6 -7
- 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/checkbox/checkbox.d.ts +5 -1
- package/lib/es/checkbox/checkbox.js +24 -0
- package/lib/es/checkbox/checkboxGroup.js +2 -2
- package/lib/es/checkbox/context.d.ts +1 -2
- 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 +10 -7
- 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 +6 -5
- package/lib/es/datePicker/monthsGrid.js +9 -26
- 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/dropdownMenu.d.ts +1 -0
- package/lib/es/dropdown/index.d.ts +5 -5
- package/lib/es/form/baseForm.d.ts +6 -4
- package/lib/es/form/errorMessage.d.ts +1 -1
- package/lib/es/form/field.d.ts +3 -1
- 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 +2 -1
- package/lib/es/image/previewImage.d.ts +1 -1
- package/lib/es/image/previewImage.js +8 -5
- package/lib/es/image/previewInner.d.ts +1 -1
- package/lib/es/image/previewInner.js +3 -3
- package/lib/es/index.d.ts +1 -0
- package/lib/es/index.js +1 -0
- package/lib/es/input/index.d.ts +1 -0
- package/lib/es/input/textarea.js +1 -1
- 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 +7 -7
- 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 +10 -5
- 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/slider/index.js +2 -2
- package/lib/es/space/index.d.ts +1 -1
- package/lib/es/spin/index.d.ts +1 -0
- 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 +15 -15
- package/lib/es/table/Table.js +18 -1
- package/lib/es/table/TableCell.d.ts +4 -4
- package/lib/es/table/TableHeaderRow.d.ts +3 -2
- package/lib/es/table/TablePagination.d.ts +1 -1
- package/lib/es/table/index.d.ts +15 -15
- package/lib/es/table/interface.d.ts +2 -0
- 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 +7 -11
- package/lib/es/tooltip/index.js +27 -38
- 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 +3 -3
- package/lib/es/upload/fileCard.d.ts +1 -1
- package/package.json +7 -8
- 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
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import _toInteger from "lodash/toInteger";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable react/destructuring-assignment */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Transition } from '@douyinfe/semi-animation-react';
|
|
6
|
-
|
|
7
|
-
const TabPaneTransition = function () {
|
|
8
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9
|
-
const direction = props.direction ? 1 : -1;
|
|
10
|
-
const {
|
|
11
|
-
mode
|
|
12
|
-
} = props;
|
|
13
|
-
let {
|
|
14
|
-
motion
|
|
15
|
-
} = props;
|
|
16
|
-
const ratio = 60;
|
|
17
|
-
|
|
18
|
-
if (typeof motion === 'function') {
|
|
19
|
-
motion = motion(props);
|
|
20
|
-
} else if (!motion || typeof motion !== 'object') {
|
|
21
|
-
motion = {};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (mode === 'vertical') {
|
|
25
|
-
return /*#__PURE__*/React.createElement(Transition, Object.assign({}, props, {
|
|
26
|
-
config: {
|
|
27
|
-
tension: 612,
|
|
28
|
-
friction: 32
|
|
29
|
-
},
|
|
30
|
-
from: {
|
|
31
|
-
translateY: direction * ratio,
|
|
32
|
-
opacity: 0
|
|
33
|
-
},
|
|
34
|
-
enter: {
|
|
35
|
-
translateY: 0,
|
|
36
|
-
opacity: {
|
|
37
|
-
val: 1,
|
|
38
|
-
duration: 200
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
leave: {
|
|
42
|
-
translateY: -1 * direction * ratio,
|
|
43
|
-
opacity: {
|
|
44
|
-
val: 0,
|
|
45
|
-
duration: 200
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, motion), typeof props.children === 'function' ? _ref => {
|
|
49
|
-
let {
|
|
50
|
-
translateY,
|
|
51
|
-
opacity
|
|
52
|
-
} = _ref;
|
|
53
|
-
// delete translateX in 0 in case of zIndex problems.
|
|
54
|
-
const finalState = _toInteger(translateY) === 0 ? {
|
|
55
|
-
opacity
|
|
56
|
-
} : {
|
|
57
|
-
transform: "translateY(".concat(_toInteger(translateY), "px)"),
|
|
58
|
-
opacity
|
|
59
|
-
};
|
|
60
|
-
return props.children(finalState);
|
|
61
|
-
} : props.children);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return /*#__PURE__*/React.createElement(Transition, Object.assign({}, props, {
|
|
65
|
-
config: {
|
|
66
|
-
tension: 612,
|
|
67
|
-
friction: 32
|
|
68
|
-
},
|
|
69
|
-
from: {
|
|
70
|
-
translateX: direction * ratio,
|
|
71
|
-
opacity: 0
|
|
72
|
-
},
|
|
73
|
-
enter: {
|
|
74
|
-
translateX: 0,
|
|
75
|
-
opacity: {
|
|
76
|
-
val: 1,
|
|
77
|
-
duration: 200
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
leave: {
|
|
81
|
-
translateX: -1 * direction * ratio,
|
|
82
|
-
opacity: {
|
|
83
|
-
val: 0,
|
|
84
|
-
duration: 200
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}, motion), typeof props.children === 'function' ? _ref2 => {
|
|
88
|
-
let {
|
|
89
|
-
translateX,
|
|
90
|
-
opacity
|
|
91
|
-
} = _ref2;
|
|
92
|
-
// delete translateX in 0 in case of zIndex problems.
|
|
93
|
-
const finalState = _toInteger(translateX) === 0 ? {
|
|
94
|
-
opacity
|
|
95
|
-
} : {
|
|
96
|
-
transform: "translateX(".concat(_toInteger(translateX), "px)"),
|
|
97
|
-
opacity
|
|
98
|
-
};
|
|
99
|
-
return props.children(finalState);
|
|
100
|
-
} : props.children);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default TabPaneTransition;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Motion } from '../_base/base';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface ToastTransitionProps {
|
|
4
|
-
motion?: Motion<ToastTransitionProps>;
|
|
5
|
-
children?: React.ReactNode | ((TransitionProps: any) => any);
|
|
6
|
-
}
|
|
7
|
-
export default function ToastTransition(props?: ToastTransitionProps): JSX.Element;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// @ts-ignore Currently there is no types for semi-animation-react
|
|
2
|
-
import { Transition } from '@douyinfe/semi-animation-react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export default function ToastTransition() {
|
|
5
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
let {
|
|
7
|
-
motion = {}
|
|
8
|
-
} = props;
|
|
9
|
-
|
|
10
|
-
if (typeof motion === 'function') {
|
|
11
|
-
motion = motion(props);
|
|
12
|
-
} else if (!motion || typeof motion !== 'object') {
|
|
13
|
-
motion = {};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return /*#__PURE__*/React.createElement(Transition // onFrame={style => console.log(style)}
|
|
17
|
-
, Object.assign({
|
|
18
|
-
// onFrame={style => console.log(style)}
|
|
19
|
-
from: {
|
|
20
|
-
translateY: -100,
|
|
21
|
-
opacity: 0
|
|
22
|
-
},
|
|
23
|
-
enter: {
|
|
24
|
-
translateY: {
|
|
25
|
-
val: 0,
|
|
26
|
-
tension: 560,
|
|
27
|
-
friction: 32
|
|
28
|
-
},
|
|
29
|
-
opacity: {
|
|
30
|
-
val: 1,
|
|
31
|
-
duration: 300
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
leave: {
|
|
35
|
-
translateY: {
|
|
36
|
-
val: -100,
|
|
37
|
-
easing: 'easeOutCubic',
|
|
38
|
-
duration: 300
|
|
39
|
-
},
|
|
40
|
-
opacity: {
|
|
41
|
-
val: 0,
|
|
42
|
-
duration: 200
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}, motion), typeof props.children === 'function' ? _ref => {
|
|
46
|
-
let {
|
|
47
|
-
translateY,
|
|
48
|
-
opacity
|
|
49
|
-
} = _ref;
|
|
50
|
-
return props.children({
|
|
51
|
-
transform: "translateY(".concat(translateY, "%)"),
|
|
52
|
-
opacity
|
|
53
|
-
});
|
|
54
|
-
} : props.children);
|
|
55
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Motion } from '../_base/base';
|
|
3
|
-
export interface TooltipTransitionProps {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
children?: (arg: any) => React.ReactNode;
|
|
6
|
-
motion?: Motion<TooltipTransitionProps>;
|
|
7
|
-
}
|
|
8
|
-
declare const TooltipTransition: React.FC<TooltipTransitionProps>;
|
|
9
|
-
export default TooltipTransition;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-shadow */
|
|
4
|
-
import { StyledTransition } from '@douyinfe/semi-animation-react';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/tooltip/constants';
|
|
7
|
-
import getMotionObjFromProps from '@douyinfe/semi-foundation/lib/es/utils/getMotionObjFromProps';
|
|
8
|
-
const enterCls = "".concat(cssClasses.PREFIX, "-bounceIn");
|
|
9
|
-
const leaveCls = "".concat(cssClasses.PREFIX, "-zoomOut");
|
|
10
|
-
|
|
11
|
-
const TooltipTransition = function () {
|
|
12
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
|
-
const {
|
|
14
|
-
children
|
|
15
|
-
} = props;
|
|
16
|
-
const motion = getMotionObjFromProps(props); // add fillMode forwards to fix issue 715, tooltip close will flashing under react 18
|
|
17
|
-
|
|
18
|
-
return /*#__PURE__*/React.createElement(StyledTransition, Object.assign({}, props, {
|
|
19
|
-
enter: enterCls,
|
|
20
|
-
leave: leaveCls,
|
|
21
|
-
duration: '100ms'
|
|
22
|
-
}, motion, {
|
|
23
|
-
fillMode: 'forwards'
|
|
24
|
-
}), typeof children === 'function' ? _ref => {
|
|
25
|
-
let {
|
|
26
|
-
animateCls,
|
|
27
|
-
animateEvents,
|
|
28
|
-
animateStyle
|
|
29
|
-
} = _ref;
|
|
30
|
-
return children({
|
|
31
|
-
animateCls,
|
|
32
|
-
animateEvents,
|
|
33
|
-
animateStyle
|
|
34
|
-
});
|
|
35
|
-
} : children);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default TooltipTransition;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
export interface CollapseProps {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
motion?: boolean;
|
|
6
|
-
children?: React.ReactNode[];
|
|
7
|
-
duration?: number;
|
|
8
|
-
onMotionEnd?: () => void;
|
|
9
|
-
motionType?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface TransitionStyle {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
maxHeight?: number;
|
|
14
|
-
}
|
|
15
|
-
declare const Collapse: {
|
|
16
|
-
(props: CollapseProps): JSX.Element;
|
|
17
|
-
propType: {
|
|
18
|
-
motion: PropTypes.Requireable<boolean | object>;
|
|
19
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
|
-
duration: PropTypes.Requireable<number>;
|
|
21
|
-
onMotionEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
-
};
|
|
23
|
-
defaultProps: {
|
|
24
|
-
duration: number;
|
|
25
|
-
motion: boolean;
|
|
26
|
-
onMotionEnd: (...args: any[]) => void;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export default Collapse;
|
package/lib/es/tree/collapse.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import _noop from "lodash/noop";
|
|
2
|
-
|
|
3
|
-
/* eslint-disable arrow-body-style */
|
|
4
|
-
import React, { useRef, useState, useEffect, useCallback } from 'react';
|
|
5
|
-
import { Transition } from '@douyinfe/semi-animation-react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/collapsible/constants';
|
|
8
|
-
import getMotionObjFromProps from '@douyinfe/semi-foundation/lib/es/utils/getMotionObjFromProps';
|
|
9
|
-
const ease = 'cubicBezier(.25,.1,.25,1)';
|
|
10
|
-
|
|
11
|
-
const Collapse = props => {
|
|
12
|
-
const {
|
|
13
|
-
motion,
|
|
14
|
-
children,
|
|
15
|
-
duration,
|
|
16
|
-
onMotionEnd,
|
|
17
|
-
motionType
|
|
18
|
-
} = props;
|
|
19
|
-
const ref = useRef(null);
|
|
20
|
-
const [maxHeight, setMaxHeight] = useState(0); // cache last state
|
|
21
|
-
|
|
22
|
-
const [open, setOpen] = useState(true);
|
|
23
|
-
const [left, setLeft] = useState(false);
|
|
24
|
-
const [immediateAttr, setImmediateAttr] = useState(false);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (motionType === 'enter') {
|
|
27
|
-
!open && setOpen(true);
|
|
28
|
-
left && setLeft(false);
|
|
29
|
-
} else if (motionType === 'leave') {
|
|
30
|
-
!open && setOpen(true);
|
|
31
|
-
!immediateAttr && setImmediateAttr(true);
|
|
32
|
-
left && setLeft(false);
|
|
33
|
-
}
|
|
34
|
-
}, [motionType]);
|
|
35
|
-
const setHeight = useCallback(node => {
|
|
36
|
-
const currHeight = node && node.scrollHeight;
|
|
37
|
-
|
|
38
|
-
if (currHeight && maxHeight !== currHeight) {
|
|
39
|
-
setMaxHeight(currHeight);
|
|
40
|
-
}
|
|
41
|
-
}, [left]);
|
|
42
|
-
|
|
43
|
-
const resetHeight = () => {
|
|
44
|
-
ref.current.style.maxHeight = 'none';
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const formatStyle = style => {
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
49
|
-
const {
|
|
50
|
-
maxHeight
|
|
51
|
-
} = style;
|
|
52
|
-
return {
|
|
53
|
-
maxHeight
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const renderChildren = transitionStyle => {
|
|
58
|
-
const transition = transitionStyle && typeof transitionStyle === 'object' ? formatStyle(transitionStyle) : {};
|
|
59
|
-
const style = Object.assign({
|
|
60
|
-
overflow: 'hidden',
|
|
61
|
-
maxHeight: open ? 'none' : 0
|
|
62
|
-
}, transition);
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
style: style,
|
|
65
|
-
className: "".concat(cssClasses.PREFIX, "-wrapper"),
|
|
66
|
-
ref: ref
|
|
67
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
ref: setHeight
|
|
69
|
-
}, children));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const didLeave = () => {
|
|
73
|
-
setLeft(true);
|
|
74
|
-
setMaxHeight(0);
|
|
75
|
-
motionType === 'leave' && onMotionEnd();
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const onImmediateEnter = () => {
|
|
79
|
-
open && setOpen(false);
|
|
80
|
-
setImmediateAttr(false);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const didEnter = () => {
|
|
84
|
-
resetHeight();
|
|
85
|
-
immediateAttr && onImmediateEnter();
|
|
86
|
-
motionType === 'enter' && onMotionEnd();
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const renderContent = () => {
|
|
90
|
-
if (left) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const mergeMotion = getMotionObjFromProps({
|
|
95
|
-
didEnter,
|
|
96
|
-
didLeave,
|
|
97
|
-
motion
|
|
98
|
-
});
|
|
99
|
-
return motion ? /*#__PURE__*/React.createElement(Transition, Object.assign({
|
|
100
|
-
state: open ? 'enter' : 'leave',
|
|
101
|
-
immediate: immediateAttr,
|
|
102
|
-
from: {
|
|
103
|
-
maxHeight: 0
|
|
104
|
-
},
|
|
105
|
-
enter: {
|
|
106
|
-
maxHeight: {
|
|
107
|
-
val: maxHeight,
|
|
108
|
-
easing: ease,
|
|
109
|
-
duration
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
leave: {
|
|
113
|
-
maxHeight: {
|
|
114
|
-
val: 0,
|
|
115
|
-
easing: ease,
|
|
116
|
-
duration
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}, mergeMotion), transitionStyle => renderChildren(transitionStyle)) : renderChildren(null);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
return renderContent();
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
Collapse.propType = {
|
|
126
|
-
motion: PropTypes.oneOfType([PropTypes.bool, PropTypes.func, PropTypes.object]),
|
|
127
|
-
children: PropTypes.node,
|
|
128
|
-
duration: PropTypes.number,
|
|
129
|
-
onMotionEnd: PropTypes.func
|
|
130
|
-
};
|
|
131
|
-
Collapse.defaultProps = {
|
|
132
|
-
duration: 250,
|
|
133
|
-
motion: true,
|
|
134
|
-
onMotionEnd: _noop
|
|
135
|
-
};
|
|
136
|
-
export default Collapse;
|