@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
package/lib/es/tree/nodeList.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _isEqual from "lodash/isEqual";
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import TreeContext from './treeContext';
|
|
4
|
-
import
|
|
4
|
+
import NodeCollapsible from './nodeCollapsible';
|
|
5
5
|
|
|
6
6
|
const getTreeNodeKey = treeNode => {
|
|
7
7
|
const {
|
|
@@ -91,11 +91,12 @@ export default class NodeList extends PureComponent {
|
|
|
91
91
|
|
|
92
92
|
if (isMotionNode && treeNode.length) {
|
|
93
93
|
const nodeKey = getTreeNodeKey(treeNode[0]);
|
|
94
|
-
return /*#__PURE__*/React.createElement(
|
|
95
|
-
|
|
94
|
+
return /*#__PURE__*/React.createElement(NodeCollapsible, {
|
|
95
|
+
open: motionType === 'hide',
|
|
96
|
+
duration: 200,
|
|
97
|
+
motion: Boolean(motionType),
|
|
96
98
|
key: "motion-".concat(nodeKey),
|
|
97
|
-
onMotionEnd: this.onMotionEnd
|
|
98
|
-
motion: Boolean(motionType)
|
|
99
|
+
onMotionEnd: this.onMotionEnd
|
|
99
100
|
}, treeNode.map(node => renderTreeNode(node)));
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -21,7 +21,7 @@ export default class TreeNode extends PureComponent<TreeNodeProps, TreeNodeState
|
|
|
21
21
|
keyword: PropTypes.Requireable<string>;
|
|
22
22
|
treeNodeFilterProp: PropTypes.Requireable<string>;
|
|
23
23
|
selectedKey: PropTypes.Requireable<string>;
|
|
24
|
-
motionKey: PropTypes.Requireable<string | string[]
|
|
24
|
+
motionKey: PropTypes.Requireable<NonNullable<string | string[]>>;
|
|
25
25
|
};
|
|
26
26
|
static defaultProps: {
|
|
27
27
|
selectedKey: string;
|
|
@@ -8,7 +8,7 @@ import { ContextValue } from '../configProvider/context';
|
|
|
8
8
|
import Input, { InputProps } from '../input/index';
|
|
9
9
|
import TagInput from '../tagInput';
|
|
10
10
|
import { TreeProps, TreeState, FlattenNode, TreeNodeData, TreeNodeProps } from '../tree/interface';
|
|
11
|
-
import {
|
|
11
|
+
import { PopoverProps } from '../popover/index';
|
|
12
12
|
export declare type ExpandAction = false | 'click' | 'doubleClick';
|
|
13
13
|
export interface TriggerRenderProps extends Omit<BasicTriggerRenderProps, 'componentProps'> {
|
|
14
14
|
[x: string]: any;
|
|
@@ -40,7 +40,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
|
|
|
40
40
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
41
41
|
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
42
42
|
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
43
|
-
motion?:
|
|
43
|
+
motion?: boolean;
|
|
44
44
|
mouseEnterDelay?: number;
|
|
45
45
|
mouseLeaveDelay?: number;
|
|
46
46
|
arrowIcon?: React.ReactNode;
|
|
@@ -69,6 +69,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
|
|
|
69
69
|
zIndex?: number;
|
|
70
70
|
searchPosition?: string;
|
|
71
71
|
stopPropagation?: boolean | string;
|
|
72
|
+
restTagsPopoverProps?: PopoverProps;
|
|
72
73
|
searchRender?: boolean | ((inputProps: InputProps) => React.ReactNode);
|
|
73
74
|
onSelect?: (selectedKeys: string, selected: boolean, selectedNode: TreeNodeData) => void;
|
|
74
75
|
renderSelectedItem?: RenderSelectedItem;
|
|
@@ -102,13 +103,13 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
102
103
|
onLoad: PropTypes.Requireable<(...args: any[]) => any>;
|
|
103
104
|
arrowIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
104
105
|
defaultOpen: PropTypes.Requireable<boolean>;
|
|
105
|
-
defaultValue: PropTypes.Requireable<string | any[]
|
|
106
|
+
defaultValue: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
106
107
|
defaultExpandAll: PropTypes.Requireable<boolean>;
|
|
107
108
|
defaultExpandedKeys: PropTypes.Requireable<any[]>;
|
|
108
109
|
expandAll: PropTypes.Requireable<boolean>;
|
|
109
110
|
disabled: PropTypes.Requireable<boolean>;
|
|
110
111
|
disableStrictly: PropTypes.Requireable<boolean>;
|
|
111
|
-
filterTreeNode: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
112
|
+
filterTreeNode: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
112
113
|
multiple: PropTypes.Requireable<boolean>;
|
|
113
114
|
searchPlaceholder: PropTypes.Requireable<string>;
|
|
114
115
|
searchAutoFocus: PropTypes.Requireable<boolean>;
|
|
@@ -121,7 +122,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
121
122
|
onChangeWithObject: PropTypes.Requireable<boolean>;
|
|
122
123
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
123
124
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
124
|
-
value: PropTypes.Requireable<string | number | object
|
|
125
|
+
value: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
125
126
|
expandedKeys: PropTypes.Requireable<any[]>;
|
|
126
127
|
autoExpandParent: PropTypes.Requireable<boolean>;
|
|
127
128
|
showClear: PropTypes.Requireable<boolean>;
|
|
@@ -133,12 +134,12 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
133
134
|
leafOnly: PropTypes.Requireable<boolean>;
|
|
134
135
|
treeData: PropTypes.Requireable<PropTypes.InferProps<{
|
|
135
136
|
key: PropTypes.Validator<string>;
|
|
136
|
-
value: PropTypes.Requireable<string | number
|
|
137
|
+
value: PropTypes.Requireable<NonNullable<string | number>>;
|
|
137
138
|
label: PropTypes.Requireable<any>;
|
|
138
139
|
}>[]>;
|
|
139
140
|
dropdownClassName: PropTypes.Requireable<string>;
|
|
140
141
|
dropdownStyle: PropTypes.Requireable<object>;
|
|
141
|
-
motion: PropTypes.Requireable<boolean
|
|
142
|
+
motion: PropTypes.Requireable<boolean>;
|
|
142
143
|
placeholder: PropTypes.Requireable<string>;
|
|
143
144
|
maxTagCount: PropTypes.Requireable<number>;
|
|
144
145
|
size: PropTypes.Requireable<Size>;
|
|
@@ -156,7 +157,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
156
157
|
mouseEnterDelay: PropTypes.Requireable<number>;
|
|
157
158
|
mouseLeaveDelay: PropTypes.Requireable<number>;
|
|
158
159
|
triggerRender: PropTypes.Requireable<(...args: any[]) => any>;
|
|
159
|
-
stopPropagation: PropTypes.Requireable<string | boolean
|
|
160
|
+
stopPropagation: PropTypes.Requireable<NonNullable<string | boolean>>;
|
|
160
161
|
outerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
161
162
|
outerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
162
163
|
onVisibleChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -167,10 +168,12 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
|
|
|
167
168
|
renderFullLabel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
168
169
|
labelEllipsis: PropTypes.Requireable<boolean>;
|
|
169
170
|
optionListStyle: PropTypes.Requireable<object>;
|
|
170
|
-
searchRender: PropTypes.Requireable<boolean | ((...args: any[]) => any)
|
|
171
|
+
searchRender: PropTypes.Requireable<NonNullable<boolean | ((...args: any[]) => any)>>;
|
|
171
172
|
renderSelectedItem: PropTypes.Requireable<(...args: any[]) => any>;
|
|
172
173
|
checkRelation: PropTypes.Requireable<string>;
|
|
173
174
|
'aria-label': PropTypes.Requireable<string>;
|
|
175
|
+
showRestTagsPopover: PropTypes.Requireable<boolean>;
|
|
176
|
+
restTagsPopoverProps: PropTypes.Requireable<object>;
|
|
174
177
|
};
|
|
175
178
|
static defaultProps: Partial<TreeSelectProps>;
|
|
176
179
|
inputRef: React.RefObject<typeof Input>;
|
|
@@ -20,7 +20,6 @@ import ConfigContext from '../configProvider/context';
|
|
|
20
20
|
import TagGroup from '../tag/group';
|
|
21
21
|
import Tag from '../tag/index';
|
|
22
22
|
import Input from '../input/index';
|
|
23
|
-
import Popover from '../popover/index';
|
|
24
23
|
import AutoSizer from '../tree/autoSizer';
|
|
25
24
|
import TreeContext from '../tree/treeContext';
|
|
26
25
|
import TreeNode from '../tree/treeNode';
|
|
@@ -32,6 +31,7 @@ import TagInput from '../tagInput';
|
|
|
32
31
|
import { isSemiIcon } from '../_utils';
|
|
33
32
|
import { IconChevronDown, IconClear, IconSearch } from '@douyinfe/semi-icons';
|
|
34
33
|
import CheckboxGroup from '../checkbox/checkboxGroup';
|
|
34
|
+
import Popover from '../popover/index';
|
|
35
35
|
const prefixcls = cssClasses.PREFIX;
|
|
36
36
|
const prefixTree = cssClasses.PREFIX_TREE;
|
|
37
37
|
const key = 0;
|
|
@@ -261,7 +261,9 @@ class TreeSelect extends BaseComponent {
|
|
|
261
261
|
placeholder,
|
|
262
262
|
maxTagCount,
|
|
263
263
|
searchPosition,
|
|
264
|
-
filterTreeNode
|
|
264
|
+
filterTreeNode,
|
|
265
|
+
showRestTagsPopover,
|
|
266
|
+
restTagsPopoverProps
|
|
265
267
|
} = this.props;
|
|
266
268
|
const isTriggerPositionSearch = filterTreeNode && searchPosition === strings.SEARCH_POSITION_TRIGGER; // searchPosition = trigger
|
|
267
269
|
|
|
@@ -287,7 +289,9 @@ class TreeSelect extends BaseComponent {
|
|
|
287
289
|
maxTagCount: maxTagCount,
|
|
288
290
|
tagList: tagList,
|
|
289
291
|
size: "large",
|
|
290
|
-
mode: "custom"
|
|
292
|
+
mode: "custom",
|
|
293
|
+
showPopover: showRestTagsPopover,
|
|
294
|
+
popoverProps: restTagsPopoverProps
|
|
291
295
|
});
|
|
292
296
|
};
|
|
293
297
|
|
|
@@ -535,7 +539,9 @@ class TreeSelect extends BaseComponent {
|
|
|
535
539
|
searchAutoFocus,
|
|
536
540
|
placeholder,
|
|
537
541
|
maxTagCount,
|
|
538
|
-
checkRelation
|
|
542
|
+
checkRelation,
|
|
543
|
+
showRestTagsPopover,
|
|
544
|
+
restTagsPopoverProps
|
|
539
545
|
} = this.props;
|
|
540
546
|
const {
|
|
541
547
|
keyEntities,
|
|
@@ -560,9 +566,13 @@ class TreeSelect extends BaseComponent {
|
|
|
560
566
|
value: keyList,
|
|
561
567
|
inputValue: inputValue,
|
|
562
568
|
size: size,
|
|
569
|
+
showRestTagsPopover: showRestTagsPopover,
|
|
570
|
+
restTagsPopoverProps: restTagsPopoverProps,
|
|
571
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
563
572
|
autoFocus: searchAutoFocus,
|
|
564
573
|
renderTagItem: (itemKey, index) => this.renderTagItem(itemKey, index),
|
|
565
|
-
onRemove: itemKey => this.removeTag(itemKey)
|
|
574
|
+
onRemove: itemKey => this.removeTag(itemKey),
|
|
575
|
+
expandRestTagsOnClick: false
|
|
566
576
|
});
|
|
567
577
|
}; // render Tree
|
|
568
578
|
|
|
@@ -1268,7 +1278,7 @@ TreeSelect.propTypes = {
|
|
|
1268
1278
|
})),
|
|
1269
1279
|
dropdownClassName: PropTypes.string,
|
|
1270
1280
|
dropdownStyle: PropTypes.object,
|
|
1271
|
-
motion: PropTypes.
|
|
1281
|
+
motion: PropTypes.bool,
|
|
1272
1282
|
placeholder: PropTypes.string,
|
|
1273
1283
|
maxTagCount: PropTypes.number,
|
|
1274
1284
|
size: PropTypes.oneOf(strings.SIZE_SET),
|
|
@@ -1300,7 +1310,9 @@ TreeSelect.propTypes = {
|
|
|
1300
1310
|
searchRender: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
|
|
1301
1311
|
renderSelectedItem: PropTypes.func,
|
|
1302
1312
|
checkRelation: PropTypes.string,
|
|
1303
|
-
'aria-label': PropTypes.string
|
|
1313
|
+
'aria-label': PropTypes.string,
|
|
1314
|
+
showRestTagsPopover: PropTypes.bool,
|
|
1315
|
+
restTagsPopoverProps: PropTypes.object
|
|
1304
1316
|
};
|
|
1305
1317
|
TreeSelect.defaultProps = {
|
|
1306
1318
|
searchPosition: strings.SEARCH_POSITION_DROPDOWN,
|
|
@@ -1328,6 +1340,8 @@ TreeSelect.defaultProps = {
|
|
|
1328
1340
|
clickToHide: true,
|
|
1329
1341
|
searchAutoFocus: false,
|
|
1330
1342
|
checkRelation: 'related',
|
|
1331
|
-
'aria-label': 'TreeSelect'
|
|
1343
|
+
'aria-label': 'TreeSelect',
|
|
1344
|
+
showRestTagsPopover: false,
|
|
1345
|
+
restTagsPopoverProps: {}
|
|
1332
1346
|
};
|
|
1333
1347
|
export default TreeSelect;
|
|
@@ -27,7 +27,7 @@ declare class Trigger extends React.PureComponent<TriggerProps> {
|
|
|
27
27
|
componentProps: PropTypes.Requireable<object>;
|
|
28
28
|
value: PropTypes.Requireable<any>;
|
|
29
29
|
inputValue: PropTypes.Requireable<string>;
|
|
30
|
-
placeholder: PropTypes.Requireable<string | any[]
|
|
30
|
+
placeholder: PropTypes.Requireable<NonNullable<string | any[]>>;
|
|
31
31
|
className: PropTypes.Requireable<string>;
|
|
32
32
|
style: PropTypes.Requireable<object>;
|
|
33
33
|
};
|
|
@@ -36,38 +36,38 @@ interface BaseTypographyState {
|
|
|
36
36
|
export default class Base extends Component<BaseTypographyProps, BaseTypographyState> {
|
|
37
37
|
static propTypes: {
|
|
38
38
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
39
|
-
copyable: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
39
|
+
copyable: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
40
40
|
text: PropTypes.Requireable<string>;
|
|
41
41
|
onCopy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
42
|
successTip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
43
43
|
copyTip: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
44
|
-
}
|
|
44
|
+
}>>>;
|
|
45
45
|
delete: PropTypes.Requireable<boolean>;
|
|
46
46
|
disabled: PropTypes.Requireable<boolean>;
|
|
47
|
-
ellipsis: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
47
|
+
ellipsis: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
48
48
|
rows: PropTypes.Requireable<number>;
|
|
49
49
|
expandable: PropTypes.Requireable<boolean>;
|
|
50
50
|
expandText: PropTypes.Requireable<string>;
|
|
51
51
|
onExpand: PropTypes.Requireable<(...args: any[]) => any>;
|
|
52
52
|
suffix: PropTypes.Requireable<string>;
|
|
53
|
-
showTooltip: PropTypes.Requireable<boolean | PropTypes.InferProps<{
|
|
53
|
+
showTooltip: PropTypes.Requireable<NonNullable<boolean | PropTypes.InferProps<{
|
|
54
54
|
type: PropTypes.Requireable<string>;
|
|
55
55
|
opts: PropTypes.Requireable<object>;
|
|
56
|
-
}
|
|
56
|
+
}>>>;
|
|
57
57
|
collapsible: PropTypes.Requireable<boolean>;
|
|
58
58
|
collapseText: PropTypes.Requireable<string>;
|
|
59
59
|
pos: PropTypes.Requireable<string>;
|
|
60
|
-
}
|
|
60
|
+
}>>>;
|
|
61
61
|
mark: PropTypes.Requireable<boolean>;
|
|
62
62
|
underline: PropTypes.Requireable<boolean>;
|
|
63
|
-
link: PropTypes.Requireable<boolean | object
|
|
63
|
+
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
64
64
|
spacing: PropTypes.Requireable<"normal" | "extended">;
|
|
65
65
|
strong: PropTypes.Requireable<boolean>;
|
|
66
66
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
67
67
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
68
68
|
style: PropTypes.Requireable<object>;
|
|
69
69
|
className: PropTypes.Requireable<string>;
|
|
70
|
-
icon: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
70
|
+
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
71
71
|
heading: PropTypes.Requireable<string>;
|
|
72
72
|
component: PropTypes.Requireable<string>;
|
|
73
73
|
};
|
|
@@ -2,10 +2,12 @@ import BaseTypography from './typography';
|
|
|
2
2
|
import Text from './text';
|
|
3
3
|
import Title from './title';
|
|
4
4
|
import Paragraph from './paragraph';
|
|
5
|
+
import Numeral from './numeral';
|
|
5
6
|
export declare type TypographyType = typeof BaseTypography & {
|
|
6
7
|
Text: typeof Text;
|
|
7
8
|
Title: typeof Title;
|
|
8
9
|
Paragraph: typeof Paragraph;
|
|
10
|
+
Numeral: typeof Numeral;
|
|
9
11
|
};
|
|
10
12
|
declare const Typography: TypographyType;
|
|
11
13
|
export type { BaseTypographyProps } from './base';
|
|
@@ -2,9 +2,11 @@ import BaseTypography from './typography';
|
|
|
2
2
|
import Text from './text';
|
|
3
3
|
import Title from './title';
|
|
4
4
|
import Paragraph from './paragraph';
|
|
5
|
+
import Numeral from './numeral';
|
|
5
6
|
const Typography = BaseTypography;
|
|
6
7
|
Typography.Text = Text;
|
|
7
8
|
Typography.Title = Title;
|
|
8
9
|
Typography.Paragraph = Paragraph;
|
|
10
|
+
Typography.Numeral = Numeral;
|
|
9
11
|
export * from './interface';
|
|
10
12
|
export default Typography;
|
|
@@ -23,3 +23,5 @@ export declare type OmitTypographyProps = 'dangerouslySetInnerHTML';
|
|
|
23
23
|
export declare type TypographyBaseType = ArrayElement<typeof strings.TYPE>;
|
|
24
24
|
export declare type TypographyBaseSize = ArrayElement<typeof strings.SIZE>;
|
|
25
25
|
export declare type TypographyBaseSpacing = ArrayElement<typeof strings.SPACING>;
|
|
26
|
+
export declare type TypographyBaseRule = ArrayElement<typeof strings.RULE>;
|
|
27
|
+
export declare type TypographyBaseTruncate = ArrayElement<typeof strings.TRUNCATE>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { TypographyBaseSize, TypographyBaseType, TypographyBaseRule, OmitTypographyProps, TypographyBaseTruncate } from './interface';
|
|
4
|
+
import { CopyableConfig, LinkType } from './title';
|
|
5
|
+
declare type OmitNumeralProps = OmitTypographyProps;
|
|
6
|
+
export interface NumeralProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, OmitNumeralProps> {
|
|
7
|
+
rule?: TypographyBaseRule;
|
|
8
|
+
precision?: number;
|
|
9
|
+
truncate?: TypographyBaseTruncate;
|
|
10
|
+
parser?: (value: string) => string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
code?: boolean;
|
|
14
|
+
component?: React.ElementType;
|
|
15
|
+
copyable?: CopyableConfig | boolean;
|
|
16
|
+
delete?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: React.ReactNode | string;
|
|
19
|
+
link?: LinkType;
|
|
20
|
+
mark?: boolean;
|
|
21
|
+
size?: TypographyBaseSize;
|
|
22
|
+
strong?: boolean;
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
type?: TypographyBaseType;
|
|
25
|
+
underline?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export default class Numeral extends PureComponent<NumeralProps> {
|
|
28
|
+
static propTypes: {
|
|
29
|
+
rule: PropTypes.Requireable<"text" | "numbers" | "bytes-decimal" | "bytes-binary" | "percentages" | "exponential">;
|
|
30
|
+
precision: PropTypes.Requireable<number>;
|
|
31
|
+
truncate: PropTypes.Requireable<"ceil" | "floor" | "round">;
|
|
32
|
+
parser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
+
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
|
+
delete: PropTypes.Requireable<boolean>;
|
|
35
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
36
|
+
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
37
|
+
mark: PropTypes.Requireable<boolean>;
|
|
38
|
+
underline: PropTypes.Requireable<boolean>;
|
|
39
|
+
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
40
|
+
strong: PropTypes.Requireable<boolean>;
|
|
41
|
+
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
42
|
+
size: PropTypes.Requireable<"small" | "normal">;
|
|
43
|
+
style: PropTypes.Requireable<object>;
|
|
44
|
+
className: PropTypes.Requireable<string>;
|
|
45
|
+
code: PropTypes.Requireable<boolean>;
|
|
46
|
+
component: PropTypes.Requireable<string>;
|
|
47
|
+
};
|
|
48
|
+
static defaultProps: {
|
|
49
|
+
rule: string;
|
|
50
|
+
precision: number;
|
|
51
|
+
truncate: string;
|
|
52
|
+
parser: any;
|
|
53
|
+
copyable: boolean;
|
|
54
|
+
delete: boolean;
|
|
55
|
+
icon: string;
|
|
56
|
+
mark: boolean;
|
|
57
|
+
underline: boolean;
|
|
58
|
+
strong: boolean;
|
|
59
|
+
link: boolean;
|
|
60
|
+
type: string;
|
|
61
|
+
style: {};
|
|
62
|
+
size: string;
|
|
63
|
+
className: string;
|
|
64
|
+
};
|
|
65
|
+
formatNodeDFS(node: any): any;
|
|
66
|
+
render(): JSX.Element;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { strings } from '@douyinfe/semi-foundation/lib/es/typography/constants';
|
|
4
|
+
import Base from './base';
|
|
5
|
+
import FormatNumeral from '@douyinfe/semi-foundation/lib/es/typography/formatNumeral';
|
|
6
|
+
export default class Numeral extends PureComponent {
|
|
7
|
+
// Traverse the entire virtual DOM using a depth-first traversal algorithm, then format each piece. (in react)
|
|
8
|
+
formatNodeDFS(node) {
|
|
9
|
+
if (!Array.isArray(node)) {
|
|
10
|
+
node = [node];
|
|
11
|
+
} // Because the property is read-only, an object is returned for overwriting rather than directly modifying the object's contents.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
node = node.map(item => {
|
|
15
|
+
if (typeof item === 'string' || typeof item === 'number') {
|
|
16
|
+
// Formatting the digital content of nodes.
|
|
17
|
+
return new FormatNumeral(String(item), this.props.rule, this.props.precision, this.props.truncate, this.props.parser).format();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof item === 'function') {
|
|
21
|
+
return this.formatNodeDFS(item());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof item === 'object' && 'children' in item['props']) {
|
|
25
|
+
return Object.assign(Object.assign({}, item), {
|
|
26
|
+
props: Object.assign(Object.assign({}, item['props']), {
|
|
27
|
+
children: this.formatNodeDFS(item['props']['children'])
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return item;
|
|
33
|
+
});
|
|
34
|
+
return node.length === 1 ? node[0] : node;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
render() {
|
|
38
|
+
// Deep copy and remove props that are not needed by the Base component.
|
|
39
|
+
const baseProps = Object.assign({}, this.props);
|
|
40
|
+
delete baseProps.rule;
|
|
41
|
+
delete baseProps.parser; // Each piece of content in the virtual DOM is formatted by the `formatNumeral` function.
|
|
42
|
+
|
|
43
|
+
baseProps.children = this.formatNodeDFS(this.props.children);
|
|
44
|
+
return /*#__PURE__*/React.createElement(Base, Object.assign({
|
|
45
|
+
component: 'span'
|
|
46
|
+
}, baseProps));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
Numeral.propTypes = {
|
|
51
|
+
rule: PropTypes.oneOf(strings.RULE),
|
|
52
|
+
precision: PropTypes.number,
|
|
53
|
+
truncate: PropTypes.oneOf(strings.TRUNCATE),
|
|
54
|
+
parser: PropTypes.func,
|
|
55
|
+
copyable: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
56
|
+
delete: PropTypes.bool,
|
|
57
|
+
disabled: PropTypes.bool,
|
|
58
|
+
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
59
|
+
mark: PropTypes.bool,
|
|
60
|
+
underline: PropTypes.bool,
|
|
61
|
+
link: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
|
|
62
|
+
strong: PropTypes.bool,
|
|
63
|
+
type: PropTypes.oneOf(strings.TYPE),
|
|
64
|
+
size: PropTypes.oneOf(strings.SIZE),
|
|
65
|
+
style: PropTypes.object,
|
|
66
|
+
className: PropTypes.string,
|
|
67
|
+
code: PropTypes.bool,
|
|
68
|
+
component: PropTypes.string
|
|
69
|
+
};
|
|
70
|
+
Numeral.defaultProps = {
|
|
71
|
+
rule: 'text',
|
|
72
|
+
precision: 0,
|
|
73
|
+
truncate: 'round',
|
|
74
|
+
parser: undefined,
|
|
75
|
+
copyable: false,
|
|
76
|
+
delete: false,
|
|
77
|
+
icon: '',
|
|
78
|
+
mark: false,
|
|
79
|
+
underline: false,
|
|
80
|
+
strong: false,
|
|
81
|
+
link: false,
|
|
82
|
+
type: 'primary',
|
|
83
|
+
style: {},
|
|
84
|
+
size: 'normal',
|
|
85
|
+
className: ''
|
|
86
|
+
};
|
|
@@ -21,12 +21,12 @@ export interface ParagraphProps extends Omit<React.HTMLAttributes<HTMLParagraphE
|
|
|
21
21
|
}
|
|
22
22
|
export default class Paragraph extends PureComponent<ParagraphProps> {
|
|
23
23
|
static propTypes: {
|
|
24
|
-
copyable: PropTypes.Requireable<boolean | object
|
|
24
|
+
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
25
25
|
delete: PropTypes.Requireable<boolean>;
|
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
-
ellipsis: PropTypes.Requireable<boolean | object
|
|
27
|
+
ellipsis: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
28
28
|
mark: PropTypes.Requireable<boolean>;
|
|
29
|
-
link: PropTypes.Requireable<boolean | object
|
|
29
|
+
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
30
30
|
underline: PropTypes.Requireable<boolean>;
|
|
31
31
|
strong: PropTypes.Requireable<boolean>;
|
|
32
32
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
@@ -23,14 +23,14 @@ export interface TextProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, O
|
|
|
23
23
|
}
|
|
24
24
|
export default class Text extends PureComponent<TextProps> {
|
|
25
25
|
static propTypes: {
|
|
26
|
-
copyable: PropTypes.Requireable<boolean | object
|
|
26
|
+
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
27
27
|
delete: PropTypes.Requireable<boolean>;
|
|
28
28
|
disabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
icon: PropTypes.Requireable<PropTypes.ReactNodeLike
|
|
30
|
-
ellipsis: PropTypes.Requireable<boolean | object
|
|
29
|
+
icon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
30
|
+
ellipsis: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
31
31
|
mark: PropTypes.Requireable<boolean>;
|
|
32
32
|
underline: PropTypes.Requireable<boolean>;
|
|
33
|
-
link: PropTypes.Requireable<boolean | object
|
|
33
|
+
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
34
34
|
strong: PropTypes.Requireable<boolean>;
|
|
35
35
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
36
36
|
size: PropTypes.Requireable<"small" | "normal">;
|
|
@@ -28,16 +28,16 @@ export interface TitleProps extends Omit<React.HTMLAttributes<HTMLHeadingElement
|
|
|
28
28
|
}
|
|
29
29
|
export default class Title extends PureComponent<TitleProps> {
|
|
30
30
|
static propTypes: {
|
|
31
|
-
copyable: PropTypes.Requireable<boolean | object
|
|
31
|
+
copyable: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
32
32
|
delete: PropTypes.Requireable<boolean>;
|
|
33
33
|
disabled: PropTypes.Requireable<boolean>;
|
|
34
|
-
ellipsis: PropTypes.Requireable<boolean | object
|
|
34
|
+
ellipsis: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
35
35
|
mark: PropTypes.Requireable<boolean>;
|
|
36
|
-
link: PropTypes.Requireable<boolean | object
|
|
36
|
+
link: PropTypes.Requireable<NonNullable<boolean | object>>;
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<1 | 2 | 3 | 4 |
|
|
40
|
+
heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -21,7 +21,7 @@ declare class FileCard extends PureComponent<FileCardProps> {
|
|
|
21
21
|
previewFile: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
22
|
showReplace: PropTypes.Requireable<boolean>;
|
|
23
23
|
showRetry: PropTypes.Requireable<boolean>;
|
|
24
|
-
size: PropTypes.Requireable<string | number
|
|
24
|
+
size: PropTypes.Requireable<NonNullable<string | number>>;
|
|
25
25
|
status: PropTypes.Requireable<string>;
|
|
26
26
|
style: PropTypes.Requireable<object>;
|
|
27
27
|
url: PropTypes.Requireable<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.22.0-beta.
|
|
3
|
+
"version": "2.22.0-beta.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@douyinfe/semi-animation": "2.12.0",
|
|
21
|
-
"@douyinfe/semi-animation-react": "2.22.0-beta.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.22.0-beta.
|
|
23
|
-
"@douyinfe/semi-icons": "2.22.0-beta.
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.22.0-beta.2",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.22.0-beta.2",
|
|
23
|
+
"@douyinfe/semi-icons": "2.22.0-beta.2",
|
|
24
24
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.22.0-beta.
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.22.0-beta.2",
|
|
26
26
|
"async-validator": "^3.5.0",
|
|
27
27
|
"classnames": "^2.2.6",
|
|
28
28
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f6c8d4d27e0c56d5967d1275775ce487ca846d22",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
76
|
"@babel/preset-env": "^7.15.8",
|
|
77
77
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.22.0-beta.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.22.0-beta.2",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"@types/react": ">=16.0.0",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
export interface TransitionStyle {
|
|
4
|
-
rotate?: number;
|
|
5
|
-
}
|
|
6
|
-
export interface OpenIconTransitionProps {
|
|
7
|
-
isOpen?: boolean;
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
enterDeg?: number;
|
|
10
|
-
fromDeg?: number;
|
|
11
|
-
duration?: number;
|
|
12
|
-
}
|
|
13
|
-
declare function OpenIconTransition(props?: OpenIconTransitionProps): React.ReactElement;
|
|
14
|
-
declare namespace OpenIconTransition {
|
|
15
|
-
var propTypes: {
|
|
16
|
-
isOpen: PropTypes.Validator<boolean>;
|
|
17
|
-
children: PropTypes.Validator<any>;
|
|
18
|
-
enterDeg: PropTypes.Requireable<number>;
|
|
19
|
-
fromDeg: PropTypes.Requireable<number>;
|
|
20
|
-
duration: PropTypes.Requireable<number>;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export default OpenIconTransition;
|