@douyinfe/semi-ui 2.27.1 → 2.28.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 +228 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2446 -2082
- 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/_portal/index.js +2 -2
- package/lib/cjs/_utils/index.js +3 -1
- package/lib/cjs/anchor/index.js +9 -9
- package/lib/cjs/anchor/link.js +8 -8
- package/lib/cjs/autoComplete/index.js +8 -4
- package/lib/cjs/autoComplete/option.js +7 -7
- package/lib/cjs/avatar/avatarGroup.js +7 -7
- package/lib/cjs/avatar/index.js +12 -12
- package/lib/cjs/badge/index.js +8 -8
- package/lib/cjs/banner/index.js +12 -12
- package/lib/cjs/breadcrumb/index.js +12 -12
- package/lib/cjs/breadcrumb/item.js +8 -8
- package/lib/cjs/button/Button.js +9 -9
- package/lib/cjs/button/buttonGroup.js +5 -5
- package/lib/cjs/button/splitButtonGroup.js +1 -1
- package/lib/cjs/calendar/dayCalendar.js +13 -13
- package/lib/cjs/calendar/dayCol.js +17 -17
- package/lib/cjs/calendar/monthCalendar.js +38 -38
- package/lib/cjs/calendar/rangeCalendar.js +27 -27
- package/lib/cjs/calendar/timeCol.js +6 -6
- package/lib/cjs/calendar/weekCalendar.js +27 -27
- package/lib/cjs/card/cardGroup.js +2 -2
- package/lib/cjs/card/index.js +16 -16
- package/lib/cjs/card/meta.js +5 -5
- package/lib/cjs/carousel/CarouselArrow.js +6 -6
- package/lib/cjs/carousel/CarouselIndicator.js +6 -6
- package/lib/cjs/carousel/index.js +12 -12
- package/lib/cjs/cascader/index.d.ts +5 -2
- package/lib/cjs/cascader/index.js +40 -38
- package/lib/cjs/cascader/item.d.ts +15 -1
- package/lib/cjs/cascader/item.js +64 -32
- package/lib/cjs/checkbox/checkbox.js +14 -14
- package/lib/cjs/checkbox/checkboxGroup.js +4 -4
- package/lib/cjs/checkbox/checkboxInner.js +6 -6
- package/lib/cjs/collapse/item.js +9 -9
- package/lib/cjs/collapsible/index.js +3 -3
- package/lib/cjs/configProvider/index.js +1 -1
- package/lib/cjs/datePicker/dateInput.js +16 -16
- package/lib/cjs/datePicker/datePicker.js +9 -9
- package/lib/cjs/datePicker/footer.js +1 -1
- package/lib/cjs/datePicker/index.js +1 -1
- package/lib/cjs/datePicker/month.js +2 -2
- package/lib/cjs/datePicker/monthsGrid.js +27 -27
- package/lib/cjs/datePicker/navigation.js +1 -1
- package/lib/cjs/datePicker/quickControl.js +14 -14
- package/lib/cjs/datePicker/yearAndMonth.js +4 -4
- package/lib/cjs/descriptions/index.js +3 -3
- package/lib/cjs/descriptions/item.js +5 -5
- package/lib/cjs/divider/index.js +7 -7
- package/lib/cjs/dropdown/dropdownDivider.js +1 -1
- package/lib/cjs/dropdown/dropdownItem.js +7 -7
- package/lib/cjs/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/cjs/dropdown/dropdownMenu.js +1 -1
- package/lib/cjs/dropdown/dropdownTitle.js +2 -2
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/dropdown/index.js +3 -3
- package/lib/cjs/empty/index.js +7 -7
- package/lib/cjs/form/arrayField.js +1 -1
- package/lib/cjs/form/baseForm.d.ts +3 -1
- package/lib/cjs/form/baseForm.js +2 -2
- package/lib/cjs/form/errorMessage.js +1 -1
- package/lib/cjs/form/field.d.ts +3 -1
- package/lib/cjs/form/group.js +2 -2
- package/lib/cjs/form/hoc/withField.js +16 -16
- package/lib/cjs/form/label.js +9 -9
- package/lib/cjs/form/slot.js +5 -5
- package/lib/cjs/grid/col.js +11 -11
- package/lib/cjs/grid/row.js +4 -4
- package/lib/cjs/highlight/index.js +1 -1
- package/lib/cjs/iconButton/index.js +5 -5
- package/lib/cjs/image/image.js +10 -10
- package/lib/cjs/image/preview.d.ts +1 -1
- package/lib/cjs/image/preview.js +3 -3
- package/lib/cjs/image/previewFooter.js +12 -12
- package/lib/cjs/image/previewHeader.js +3 -3
- package/lib/cjs/image/previewImage.js +7 -7
- package/lib/cjs/image/previewInner.js +7 -7
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/index.js +38 -38
- package/lib/cjs/input/inputGroup.js +7 -7
- package/lib/cjs/input/textarea.js +14 -14
- package/lib/cjs/inputNumber/index.js +11 -11
- package/lib/cjs/layout/Sider.d.ts +1 -0
- package/lib/cjs/layout/Sider.js +4 -3
- package/lib/cjs/layout/index.js +4 -2
- package/lib/cjs/list/index.js +11 -11
- package/lib/cjs/list/item.js +6 -6
- package/lib/cjs/modal/ConfirmModal.js +7 -7
- package/lib/cjs/modal/Modal.d.ts +0 -2
- package/lib/cjs/modal/Modal.js +8 -10
- package/lib/cjs/modal/ModalContent.js +24 -24
- package/lib/cjs/modal/useModal/index.js +1 -1
- package/lib/cjs/navigation/CollapseButton.js +1 -1
- package/lib/cjs/navigation/Footer.js +2 -2
- package/lib/cjs/navigation/Header.js +5 -5
- package/lib/cjs/navigation/Item.js +16 -16
- package/lib/cjs/navigation/SubNav.js +14 -14
- package/lib/cjs/navigation/index.js +8 -8
- package/lib/cjs/notification/index.js +3 -3
- package/lib/cjs/notification/notice.js +12 -12
- package/lib/cjs/overflowList/index.d.ts +1 -1
- package/lib/cjs/overflowList/index.js +32 -35
- package/lib/cjs/overflowList/intersectionObserver.js +3 -1
- package/lib/cjs/pagination/index.js +26 -26
- package/lib/cjs/popconfirm/index.js +9 -9
- package/lib/cjs/popover/index.js +2 -2
- package/lib/cjs/progress/index.js +14 -14
- package/lib/cjs/radio/radio.js +22 -22
- package/lib/cjs/radio/radioGroup.js +5 -5
- package/lib/cjs/radio/radioInner.js +7 -7
- package/lib/cjs/rating/index.js +5 -5
- package/lib/cjs/rating/item.js +11 -11
- package/lib/cjs/scrollList/index.js +5 -5
- package/lib/cjs/scrollList/scrollItem.js +13 -13
- package/lib/cjs/select/index.d.ts +11 -0
- package/lib/cjs/select/index.js +297 -116
- package/lib/cjs/select/option.js +7 -7
- package/lib/cjs/sideSheet/SideSheetContent.js +10 -10
- package/lib/cjs/sideSheet/index.js +7 -7
- package/lib/cjs/skeleton/index.js +1 -1
- package/lib/cjs/skeleton/item.js +4 -4
- package/lib/cjs/slider/index.js +28 -28
- package/lib/cjs/space/index.js +12 -12
- package/lib/cjs/spin/icon.js +2 -2
- package/lib/cjs/spin/index.d.ts +1 -1
- package/lib/cjs/spin/index.js +6 -6
- package/lib/cjs/steps/basicStep.js +14 -14
- package/lib/cjs/steps/basicSteps.js +6 -6
- package/lib/cjs/steps/fillStep.js +10 -10
- package/lib/cjs/steps/fillSteps.js +4 -4
- package/lib/cjs/steps/navStep.js +5 -5
- package/lib/cjs/steps/navSteps.js +2 -2
- package/lib/cjs/table/Body/BaseRow.js +5 -5
- package/lib/cjs/table/Body/ExpandedRow.js +3 -3
- package/lib/cjs/table/Body/SectionRow.js +1 -1
- package/lib/cjs/table/Body/index.js +8 -8
- package/lib/cjs/table/ColGroup.js +2 -2
- package/lib/cjs/table/ColumnFilter.js +3 -3
- package/lib/cjs/table/ColumnSelection.js +2 -2
- package/lib/cjs/table/ColumnSorter.js +7 -7
- package/lib/cjs/table/CustomExpandIcon.js +2 -2
- package/lib/cjs/table/HeadTable.js +3 -3
- package/lib/cjs/table/Table.js +20 -20
- package/lib/cjs/table/TableCell.js +8 -8
- package/lib/cjs/table/TableHeader.js +1 -1
- package/lib/cjs/table/TableHeaderRow.d.ts +1 -1
- package/lib/cjs/table/TableHeaderRow.js +8 -8
- package/lib/cjs/table/TablePagination.js +3 -3
- package/lib/cjs/tabs/TabBar.js +31 -49
- package/lib/cjs/tabs/TabItem.d.ts +18 -0
- package/lib/cjs/tabs/TabItem.js +95 -0
- package/lib/cjs/tabs/TabPane.js +3 -3
- package/lib/cjs/tabs/index.d.ts +2 -1
- package/lib/cjs/tabs/index.js +5 -2
- package/lib/cjs/tag/group.js +5 -5
- package/lib/cjs/tag/index.js +13 -13
- package/lib/cjs/tagInput/index.js +33 -33
- package/lib/cjs/timePicker/Combobox.js +4 -4
- package/lib/cjs/timePicker/TimeInput.js +4 -4
- package/lib/cjs/timePicker/TimePicker.js +8 -8
- package/lib/cjs/timeline/index.js +8 -8
- package/lib/cjs/timeline/item.js +7 -7
- package/lib/cjs/toast/index.js +5 -5
- package/lib/cjs/toast/toast.js +9 -9
- package/lib/cjs/tooltip/index.js +7 -7
- package/lib/cjs/transfer/index.js +31 -31
- package/lib/cjs/tree/autoSizer.js +1 -1
- package/lib/cjs/tree/index.js +6 -6
- package/lib/cjs/tree/interface.d.ts +1 -0
- package/lib/cjs/tree/nodeList.js +1 -1
- package/lib/cjs/tree/treeNode.js +26 -26
- package/lib/cjs/treeSelect/index.js +41 -41
- package/lib/cjs/typography/base.js +14 -14
- package/lib/cjs/typography/copyable.js +3 -3
- package/lib/cjs/typography/paragraph.js +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/typography/title.js +1 -1
- package/lib/cjs/typography/util.js +1 -1
- package/lib/cjs/upload/fileCard.js +32 -32
- package/lib/cjs/upload/index.js +37 -37
- package/lib/es/_portal/index.js +2 -2
- package/lib/es/_utils/index.js +3 -1
- package/lib/es/anchor/index.js +9 -9
- package/lib/es/anchor/link.js +8 -8
- package/lib/es/autoComplete/index.js +8 -4
- package/lib/es/autoComplete/option.js +7 -7
- package/lib/es/avatar/avatarGroup.js +7 -7
- package/lib/es/avatar/index.js +12 -12
- package/lib/es/badge/index.js +8 -8
- package/lib/es/banner/index.js +12 -12
- package/lib/es/breadcrumb/index.js +12 -12
- package/lib/es/breadcrumb/item.js +8 -8
- package/lib/es/button/Button.js +9 -9
- package/lib/es/button/buttonGroup.js +5 -5
- package/lib/es/button/splitButtonGroup.js +1 -1
- package/lib/es/calendar/dayCalendar.js +13 -13
- package/lib/es/calendar/dayCol.js +17 -17
- package/lib/es/calendar/monthCalendar.js +38 -38
- package/lib/es/calendar/rangeCalendar.js +27 -27
- package/lib/es/calendar/timeCol.js +6 -6
- package/lib/es/calendar/weekCalendar.js +27 -27
- package/lib/es/card/cardGroup.js +2 -2
- package/lib/es/card/index.js +16 -16
- package/lib/es/card/meta.js +5 -5
- package/lib/es/carousel/CarouselArrow.js +6 -6
- package/lib/es/carousel/CarouselIndicator.js +6 -6
- package/lib/es/carousel/index.js +12 -12
- package/lib/es/cascader/index.d.ts +5 -2
- package/lib/es/cascader/index.js +40 -38
- package/lib/es/cascader/item.d.ts +15 -1
- package/lib/es/cascader/item.js +64 -32
- package/lib/es/checkbox/checkbox.js +14 -14
- package/lib/es/checkbox/checkboxGroup.js +4 -4
- package/lib/es/checkbox/checkboxInner.js +6 -6
- package/lib/es/collapse/item.js +9 -9
- package/lib/es/collapsible/index.js +3 -3
- package/lib/es/configProvider/index.js +1 -1
- package/lib/es/datePicker/dateInput.js +16 -16
- package/lib/es/datePicker/datePicker.js +9 -9
- package/lib/es/datePicker/footer.js +1 -1
- package/lib/es/datePicker/index.js +1 -1
- package/lib/es/datePicker/month.js +2 -2
- package/lib/es/datePicker/monthsGrid.js +27 -27
- package/lib/es/datePicker/navigation.js +1 -1
- package/lib/es/datePicker/quickControl.js +14 -14
- package/lib/es/datePicker/yearAndMonth.js +4 -4
- package/lib/es/descriptions/index.js +3 -3
- package/lib/es/descriptions/item.js +5 -5
- package/lib/es/divider/index.js +7 -7
- package/lib/es/dropdown/dropdownDivider.js +1 -1
- package/lib/es/dropdown/dropdownItem.js +7 -7
- package/lib/es/dropdown/dropdownMenu.d.ts +1 -1
- package/lib/es/dropdown/dropdownMenu.js +1 -1
- package/lib/es/dropdown/dropdownTitle.js +2 -2
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/dropdown/index.js +3 -3
- package/lib/es/empty/index.js +7 -7
- package/lib/es/form/arrayField.js +1 -1
- package/lib/es/form/baseForm.d.ts +3 -1
- package/lib/es/form/baseForm.js +2 -2
- package/lib/es/form/errorMessage.js +1 -1
- package/lib/es/form/field.d.ts +3 -1
- package/lib/es/form/group.js +2 -2
- package/lib/es/form/hoc/withField.js +16 -16
- package/lib/es/form/label.js +9 -9
- package/lib/es/form/slot.js +5 -5
- package/lib/es/grid/col.js +11 -11
- package/lib/es/grid/row.js +4 -4
- package/lib/es/highlight/index.js +1 -1
- package/lib/es/iconButton/index.js +5 -5
- package/lib/es/image/image.js +10 -10
- package/lib/es/image/preview.d.ts +1 -1
- package/lib/es/image/preview.js +3 -3
- package/lib/es/image/previewFooter.js +12 -12
- package/lib/es/image/previewHeader.js +3 -3
- package/lib/es/image/previewImage.js +7 -7
- package/lib/es/image/previewInner.js +7 -7
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/index.js +38 -38
- package/lib/es/input/inputGroup.js +7 -7
- package/lib/es/input/textarea.js +14 -14
- package/lib/es/inputNumber/index.js +11 -11
- package/lib/es/layout/Sider.d.ts +1 -0
- package/lib/es/layout/Sider.js +4 -3
- package/lib/es/layout/index.js +4 -2
- package/lib/es/list/index.js +11 -11
- package/lib/es/list/item.js +6 -6
- package/lib/es/modal/ConfirmModal.js +7 -7
- package/lib/es/modal/Modal.d.ts +0 -2
- package/lib/es/modal/Modal.js +8 -10
- package/lib/es/modal/ModalContent.js +24 -24
- package/lib/es/modal/useModal/index.js +1 -1
- package/lib/es/navigation/CollapseButton.js +1 -1
- package/lib/es/navigation/Footer.js +2 -2
- package/lib/es/navigation/Header.js +5 -5
- package/lib/es/navigation/Item.js +16 -16
- package/lib/es/navigation/SubNav.js +14 -14
- package/lib/es/navigation/index.js +8 -8
- package/lib/es/notification/index.js +3 -3
- package/lib/es/notification/notice.js +12 -12
- package/lib/es/overflowList/index.d.ts +1 -1
- package/lib/es/overflowList/index.js +31 -35
- package/lib/es/overflowList/intersectionObserver.js +2 -1
- package/lib/es/pagination/index.js +26 -26
- package/lib/es/popconfirm/index.js +9 -9
- package/lib/es/popover/index.js +2 -2
- package/lib/es/progress/index.js +14 -14
- package/lib/es/radio/radio.js +22 -22
- package/lib/es/radio/radioGroup.js +5 -5
- package/lib/es/radio/radioInner.js +7 -7
- package/lib/es/rating/index.js +5 -5
- package/lib/es/rating/item.js +11 -11
- package/lib/es/scrollList/index.js +5 -5
- package/lib/es/scrollList/scrollItem.js +13 -13
- package/lib/es/select/index.d.ts +11 -0
- package/lib/es/select/index.js +288 -112
- package/lib/es/select/option.js +7 -7
- package/lib/es/sideSheet/SideSheetContent.js +10 -10
- package/lib/es/sideSheet/index.js +7 -7
- package/lib/es/skeleton/index.js +1 -1
- package/lib/es/skeleton/item.js +4 -4
- package/lib/es/slider/index.js +28 -28
- package/lib/es/space/index.js +12 -12
- package/lib/es/spin/icon.js +2 -2
- package/lib/es/spin/index.d.ts +1 -1
- package/lib/es/spin/index.js +6 -6
- package/lib/es/steps/basicStep.js +14 -14
- package/lib/es/steps/basicSteps.js +6 -6
- package/lib/es/steps/fillStep.js +10 -10
- package/lib/es/steps/fillSteps.js +4 -4
- package/lib/es/steps/navStep.js +5 -5
- package/lib/es/steps/navSteps.js +2 -2
- package/lib/es/table/Body/BaseRow.js +5 -5
- package/lib/es/table/Body/ExpandedRow.js +3 -3
- package/lib/es/table/Body/SectionRow.js +1 -1
- package/lib/es/table/Body/index.js +8 -8
- package/lib/es/table/ColGroup.js +2 -2
- package/lib/es/table/ColumnFilter.js +3 -3
- package/lib/es/table/ColumnSelection.js +2 -2
- package/lib/es/table/ColumnSorter.js +7 -7
- package/lib/es/table/CustomExpandIcon.js +2 -2
- package/lib/es/table/HeadTable.js +3 -3
- package/lib/es/table/Table.js +20 -20
- package/lib/es/table/TableCell.js +8 -8
- package/lib/es/table/TableHeader.js +1 -1
- package/lib/es/table/TableHeaderRow.d.ts +1 -1
- package/lib/es/table/TableHeaderRow.js +8 -8
- package/lib/es/table/TablePagination.js +3 -3
- package/lib/es/tabs/TabBar.js +30 -50
- package/lib/es/tabs/TabItem.d.ts +18 -0
- package/lib/es/tabs/TabItem.js +78 -0
- package/lib/es/tabs/TabPane.js +3 -3
- package/lib/es/tabs/index.d.ts +2 -1
- package/lib/es/tabs/index.js +4 -2
- package/lib/es/tag/group.js +5 -5
- package/lib/es/tag/index.js +13 -13
- package/lib/es/tagInput/index.js +33 -33
- package/lib/es/timePicker/Combobox.js +4 -4
- package/lib/es/timePicker/TimeInput.js +4 -4
- package/lib/es/timePicker/TimePicker.js +8 -8
- package/lib/es/timeline/index.js +8 -8
- package/lib/es/timeline/item.js +7 -7
- package/lib/es/toast/index.js +5 -5
- package/lib/es/toast/toast.js +9 -9
- package/lib/es/tooltip/index.js +7 -7
- package/lib/es/transfer/index.js +31 -31
- package/lib/es/tree/autoSizer.js +1 -1
- package/lib/es/tree/index.js +6 -6
- package/lib/es/tree/interface.d.ts +1 -0
- package/lib/es/tree/nodeList.js +1 -1
- package/lib/es/tree/treeNode.js +26 -26
- package/lib/es/treeSelect/index.js +41 -41
- package/lib/es/typography/base.js +14 -14
- package/lib/es/typography/copyable.js +3 -3
- package/lib/es/typography/paragraph.js +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/typography/title.js +1 -1
- package/lib/es/typography/util.js +1 -1
- package/lib/es/upload/fileCard.js +32 -32
- package/lib/es/upload/index.js +37 -37
- package/package.json +8 -8
package/lib/es/tabs/TabBar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _pick from "lodash/pick";
|
|
1
2
|
import _isEmpty from "lodash/isEmpty";
|
|
2
3
|
|
|
3
4
|
var __rest = this && this.__rest || function (s, e) {
|
|
@@ -19,8 +20,9 @@ import getDataAttr from '@douyinfe/semi-foundation/lib/es/utils/getDataAttr';
|
|
|
19
20
|
import OverflowList from '../overflowList';
|
|
20
21
|
import Dropdown from '../dropdown';
|
|
21
22
|
import Button from '../button';
|
|
22
|
-
import { IconChevronRight, IconChevronLeft
|
|
23
|
+
import { IconChevronRight, IconChevronLeft } from '@douyinfe/semi-icons';
|
|
23
24
|
import { getUuidv4 } from '@douyinfe/semi-foundation/lib/es/utils/uuid';
|
|
25
|
+
import TabItem from './TabItem';
|
|
24
26
|
|
|
25
27
|
class TabBar extends React.Component {
|
|
26
28
|
constructor(props) {
|
|
@@ -33,7 +35,7 @@ class TabBar extends React.Component {
|
|
|
33
35
|
const key = this._getItemKey(itemKey); // eslint-disable-next-line max-len
|
|
34
36
|
|
|
35
37
|
|
|
36
|
-
const tabItem = document.querySelector(
|
|
38
|
+
const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
|
|
37
39
|
tabItem.scrollIntoView({
|
|
38
40
|
behavior: 'smooth',
|
|
39
41
|
block: 'nearest',
|
|
@@ -50,45 +52,23 @@ class TabBar extends React.Component {
|
|
|
50
52
|
const {
|
|
51
53
|
size,
|
|
52
54
|
type,
|
|
53
|
-
deleteTabItem
|
|
55
|
+
deleteTabItem,
|
|
56
|
+
handleKeyDown,
|
|
57
|
+
tabPosition
|
|
54
58
|
} = this.props;
|
|
55
|
-
const panelIcon = panel.icon ? this.renderIcon(panel.icon) : null;
|
|
56
|
-
const closableIcon = type === 'card' && panel.closable ? /*#__PURE__*/React.createElement(IconClose, {
|
|
57
|
-
"aria-label": "Close",
|
|
58
|
-
role: "button",
|
|
59
|
-
className: "".concat(cssClasses.TABS_TAB, "-icon-close"),
|
|
60
|
-
onClick: e => deleteTabItem(panel.itemKey, e)
|
|
61
|
-
}) : null;
|
|
62
|
-
let events = {};
|
|
63
|
-
const key = panel.itemKey;
|
|
64
|
-
|
|
65
|
-
if (!panel.disabled) {
|
|
66
|
-
events = {
|
|
67
|
-
onClick: e => this.handleItemClick(key, e)
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const isSelected = this._isActive(key);
|
|
72
59
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"aria-selected": isSelected ? 'true' : 'false',
|
|
86
|
-
tabIndex: isSelected ? 0 : -1,
|
|
87
|
-
onKeyDown: e => this.handleKeyDown(e, key, panel.closable)
|
|
88
|
-
}, events, {
|
|
89
|
-
className: className,
|
|
90
|
-
key: this._getItemKey(key)
|
|
91
|
-
}), panelIcon, panel.tab, closableIcon);
|
|
60
|
+
const isSelected = this._isActive(panel.itemKey);
|
|
61
|
+
|
|
62
|
+
return /*#__PURE__*/React.createElement(TabItem, Object.assign({}, _pick(panel, ['disabled', 'icon', 'itemKey', 'tab', 'closable']), {
|
|
63
|
+
key: this._getItemKey(panel.itemKey),
|
|
64
|
+
selected: isSelected,
|
|
65
|
+
size: size,
|
|
66
|
+
type: type,
|
|
67
|
+
tabPosition: tabPosition,
|
|
68
|
+
handleKeyDown: handleKeyDown,
|
|
69
|
+
deleteTabItem: deleteTabItem,
|
|
70
|
+
onClick: this.handleItemClick
|
|
71
|
+
}));
|
|
92
72
|
};
|
|
93
73
|
|
|
94
74
|
this.renderTabComponents = list => list.map(panel => this.renderTabItem(panel));
|
|
@@ -103,7 +83,7 @@ class TabBar extends React.Component {
|
|
|
103
83
|
const key = this._getItemKey(lastItem.itemKey); // eslint-disable-next-line max-len
|
|
104
84
|
|
|
105
85
|
|
|
106
|
-
const tabItem = document.querySelector(
|
|
86
|
+
const tabItem = document.querySelector(`[data-uuid="${this.state.uuid}"] .${cssClasses.TABS_TAB}[data-scrollkey="${key}"]`);
|
|
107
87
|
tabItem.scrollIntoView({
|
|
108
88
|
behavior: 'smooth',
|
|
109
89
|
block: 'nearest',
|
|
@@ -142,17 +122,17 @@ class TabBar extends React.Component {
|
|
|
142
122
|
}, panelIcon, tab);
|
|
143
123
|
}));
|
|
144
124
|
const arrowCls = cls({
|
|
145
|
-
[
|
|
146
|
-
[
|
|
125
|
+
[`${cssClasses.TABS_BAR}-arrow-${pos}`]: pos,
|
|
126
|
+
[`${cssClasses.TABS_BAR}-arrow`]: true
|
|
147
127
|
});
|
|
148
128
|
const dropdownCls = cls(dropdownClassName, {
|
|
149
|
-
[
|
|
129
|
+
[`${cssClasses.TABS_BAR}-dropdown`]: true
|
|
150
130
|
});
|
|
151
131
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
152
132
|
className: dropdownCls,
|
|
153
133
|
clickToHide: true,
|
|
154
134
|
clickTriggerToHide: true,
|
|
155
|
-
key:
|
|
135
|
+
key: `${rePosKey}-${pos}`,
|
|
156
136
|
position: pos === 'start' ? 'bottomLeft' : 'bottomRight',
|
|
157
137
|
render: disabled ? null : menu,
|
|
158
138
|
showTick: true,
|
|
@@ -195,14 +175,14 @@ class TabBar extends React.Component {
|
|
|
195
175
|
items: renderedList,
|
|
196
176
|
overflowRenderer: this.renderOverflow,
|
|
197
177
|
renderMode: "scroll",
|
|
198
|
-
className:
|
|
178
|
+
className: `${cssClasses.TABS_BAR}-overflow-list`,
|
|
199
179
|
visibleItemRenderer: this.renderTabItem
|
|
200
180
|
});
|
|
201
181
|
};
|
|
202
182
|
|
|
203
183
|
this._isActive = key => key === this.props.activeKey;
|
|
204
184
|
|
|
205
|
-
this._getItemKey = key =>
|
|
185
|
+
this._getItemKey = key => `${key}-bar`;
|
|
206
186
|
|
|
207
187
|
this.state = {
|
|
208
188
|
endInd: props.list.length,
|
|
@@ -233,8 +213,8 @@ class TabBar extends React.Component {
|
|
|
233
213
|
};
|
|
234
214
|
const tabBarExtraContentStyle = tabBarExtraContent && tabBarExtraContent.props ? tabBarExtraContent.props.style : {};
|
|
235
215
|
const extraCls = cls(cssClasses.TABS_BAR_EXTRA, {
|
|
236
|
-
[
|
|
237
|
-
[
|
|
216
|
+
[`${cssClasses.TABS_BAR}-${type}-extra`]: type,
|
|
217
|
+
[`${cssClasses.TABS_BAR}-${type}-extra-${size}`]: size
|
|
238
218
|
});
|
|
239
219
|
|
|
240
220
|
if (tabBarExtraContent) {
|
|
@@ -266,8 +246,8 @@ class TabBar extends React.Component {
|
|
|
266
246
|
[cssClasses.TABS_BAR_LINE]: type === 'line',
|
|
267
247
|
[cssClasses.TABS_BAR_CARD]: type === 'card',
|
|
268
248
|
[cssClasses.TABS_BAR_BUTTON]: type === 'button',
|
|
269
|
-
[
|
|
270
|
-
[
|
|
249
|
+
[`${cssClasses.TABS_BAR}-${tabPosition}`]: tabPosition,
|
|
250
|
+
[`${cssClasses.TABS_BAR}-collapse`]: collapsible
|
|
271
251
|
});
|
|
272
252
|
const extra = this.renderExtra();
|
|
273
253
|
const contents = collapsible ? this.renderCollapsedTab() : this.renderTabComponents(list);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactNode, MouseEvent } from 'react';
|
|
2
|
+
import { TabType, TabSize, TabPosition } from './interface';
|
|
3
|
+
export interface TabItemProps {
|
|
4
|
+
tab?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
size?: TabSize;
|
|
7
|
+
type?: TabType;
|
|
8
|
+
tabPosition?: TabPosition;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
itemKey?: string;
|
|
13
|
+
handleKeyDown?: (event: React.KeyboardEvent, itemKey: string, closable: boolean) => void;
|
|
14
|
+
deleteTabItem?: (tabKey: string, event: MouseEvent<Element>) => void;
|
|
15
|
+
onClick?: (itemKey: string, e: MouseEvent<Element>) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const ForwardTabItem: React.ForwardRefExoticComponent<TabItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default ForwardTabItem;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
+
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
import React, { forwardRef, useCallback, useMemo } from 'react';
|
|
13
|
+
import cls from 'classnames';
|
|
14
|
+
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/tabs/constants';
|
|
15
|
+
import { IconClose } from '@douyinfe/semi-icons';
|
|
16
|
+
|
|
17
|
+
const TabItem = (props, ref) => {
|
|
18
|
+
const {
|
|
19
|
+
tab,
|
|
20
|
+
size,
|
|
21
|
+
type,
|
|
22
|
+
icon,
|
|
23
|
+
selected,
|
|
24
|
+
closable,
|
|
25
|
+
disabled,
|
|
26
|
+
itemKey,
|
|
27
|
+
deleteTabItem,
|
|
28
|
+
tabPosition,
|
|
29
|
+
handleKeyDown,
|
|
30
|
+
onClick
|
|
31
|
+
} = props,
|
|
32
|
+
restProps = __rest(props, ["tab", "size", "type", "icon", "selected", "closable", "disabled", "itemKey", "deleteTabItem", "tabPosition", "handleKeyDown", "onClick"]);
|
|
33
|
+
|
|
34
|
+
const closableIcon = useMemo(() => {
|
|
35
|
+
return type === 'card' && closable ? /*#__PURE__*/React.createElement(IconClose, {
|
|
36
|
+
"aria-label": "Close",
|
|
37
|
+
role: "button",
|
|
38
|
+
className: `${cssClasses.TABS_TAB}-icon-close`,
|
|
39
|
+
onClick: e => deleteTabItem(itemKey, e)
|
|
40
|
+
}) : null;
|
|
41
|
+
}, [type, closable, deleteTabItem, itemKey]);
|
|
42
|
+
const renderIcon = useCallback(icon => /*#__PURE__*/React.createElement("span", null, icon), []);
|
|
43
|
+
const handleKeyDownInItem = useCallback(event => {
|
|
44
|
+
handleKeyDown && handleKeyDown(event, itemKey, closable);
|
|
45
|
+
}, [handleKeyDown, itemKey, closable]);
|
|
46
|
+
const handleItemClick = useCallback(e => {
|
|
47
|
+
!disabled && onClick && onClick(itemKey, e);
|
|
48
|
+
}, [itemKey, disabled, onClick]);
|
|
49
|
+
const panelIcon = icon ? renderIcon(icon) : null;
|
|
50
|
+
const className = cls(cssClasses.TABS_TAB, `${cssClasses.TABS_TAB}-${type}`, `${cssClasses.TABS_TAB}-${tabPosition}`, `${cssClasses.TABS_TAB}-single`, {
|
|
51
|
+
[cssClasses.TABS_TAB_ACTIVE]: selected,
|
|
52
|
+
[cssClasses.TABS_TAB_DISABLED]: disabled,
|
|
53
|
+
[`${cssClasses.TABS_TAB}-small`]: size === 'small',
|
|
54
|
+
[`${cssClasses.TABS_TAB}-medium`]: size === 'medium'
|
|
55
|
+
});
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
57
|
+
role: "tab",
|
|
58
|
+
id: `semiTab${itemKey}`,
|
|
59
|
+
"data-tabkey": `semiTab${itemKey}`,
|
|
60
|
+
"aria-controls": `semiTabPanel${itemKey}`,
|
|
61
|
+
"aria-disabled": disabled ? 'true' : 'false',
|
|
62
|
+
"aria-selected": selected ? 'true' : 'false',
|
|
63
|
+
tabIndex: selected ? 0 : -1,
|
|
64
|
+
onKeyDown: handleKeyDownInItem,
|
|
65
|
+
onClick: handleItemClick,
|
|
66
|
+
className: className
|
|
67
|
+
}, restProps, {
|
|
68
|
+
ref: ref
|
|
69
|
+
}), panelIcon, tab, closableIcon);
|
|
70
|
+
}; // Why is forwardRef needed here?
|
|
71
|
+
// Because TabItem needs to be used in OverflowList (when tabs' type is collapsible),
|
|
72
|
+
// OverflowList will pass ref to the outermost div DOM node of TabItem
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const ForwardTabItem = /*#__PURE__*/forwardRef(TabItem); // @ts-ignore
|
|
76
|
+
|
|
77
|
+
ForwardTabItem.elementType = 'Tabs.TabItem';
|
|
78
|
+
export default ForwardTabItem;
|
package/lib/es/tabs/TabPane.js
CHANGED
|
@@ -100,8 +100,8 @@ class TabPane extends PureComponent {
|
|
|
100
100
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
101
101
|
ref: this.ref,
|
|
102
102
|
role: "tabpanel",
|
|
103
|
-
id:
|
|
104
|
-
"aria-labelledby":
|
|
103
|
+
id: `semiTabPanel${itemKey}`,
|
|
104
|
+
"aria-labelledby": `semiTab${itemKey}`,
|
|
105
105
|
className: classNames,
|
|
106
106
|
style: style,
|
|
107
107
|
"aria-hidden": active ? 'false' : 'true',
|
|
@@ -118,7 +118,7 @@ class TabPane extends PureComponent {
|
|
|
118
118
|
animationEventsNeedBind
|
|
119
119
|
} = _ref;
|
|
120
120
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
121
|
-
className:
|
|
121
|
+
className: `${cssClasses.TABS_PANE_MOTION_OVERLAY} ${animationClassName}`,
|
|
122
122
|
"x-semi-prop": "children"
|
|
123
123
|
}, animationEventsNeedBind), shouldRender ? children : null);
|
|
124
124
|
}));
|
package/lib/es/tabs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent, ReactElement, ReactNode, RefCallback, RefObject } from 'react';
|
|
1
|
+
import React, { MouseEvent, ReactElement, ReactNode, RefCallback, RefObject } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import TabsFoundation, { TabsAdapter } from '@douyinfe/semi-foundation/lib/es/tabs/foundation';
|
|
4
4
|
import BaseComponent from '../_base/baseComponent';
|
|
@@ -14,6 +14,7 @@ export interface TabsState {
|
|
|
14
14
|
}
|
|
15
15
|
declare class Tabs extends BaseComponent<TabsProps, TabsState> {
|
|
16
16
|
static TabPane: typeof TabPane;
|
|
17
|
+
static TabItem: React.ForwardRefExoticComponent<import("./TabItem").TabItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
18
|
static propTypes: {
|
|
18
19
|
activeKey: PropTypes.Requireable<string>;
|
|
19
20
|
className: PropTypes.Requireable<string>;
|
package/lib/es/tabs/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import BaseComponent from '../_base/baseComponent';
|
|
|
23
23
|
import '@douyinfe/semi-foundation/lib/es/tabs/tabs.css';
|
|
24
24
|
import TabBar from './TabBar';
|
|
25
25
|
import TabPane from './TabPane';
|
|
26
|
+
import TabItem from './TabItem';
|
|
26
27
|
import TabsContext from './tabs-context';
|
|
27
28
|
const panePickKeys = ['className', 'style', 'disabled', 'itemKey', 'tab', 'icon'];
|
|
28
29
|
export * from './interface';
|
|
@@ -290,11 +291,11 @@ class Tabs extends BaseComponent {
|
|
|
290
291
|
} = this.state;
|
|
291
292
|
const tabWrapperCls = cls(className, {
|
|
292
293
|
[cssClasses.TABS]: true,
|
|
293
|
-
[
|
|
294
|
+
[`${cssClasses.TABS}-${tabPosition}`]: tabPosition
|
|
294
295
|
});
|
|
295
296
|
const tabContentCls = cls({
|
|
296
297
|
[cssClasses.TABS_CONTENT]: true,
|
|
297
|
-
[
|
|
298
|
+
[`${cssClasses.TABS_CONTENT}-${tabPosition}`]: tabPosition
|
|
298
299
|
});
|
|
299
300
|
const tabBarProps = {
|
|
300
301
|
activeKey,
|
|
@@ -335,6 +336,7 @@ class Tabs extends BaseComponent {
|
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
Tabs.TabPane = TabPane;
|
|
339
|
+
Tabs.TabItem = TabItem;
|
|
338
340
|
Tabs.propTypes = {
|
|
339
341
|
activeKey: PropTypes.string,
|
|
340
342
|
className: PropTypes.string,
|
package/lib/es/tag/group.js
CHANGED
|
@@ -33,7 +33,7 @@ export default class TagGroup extends PureComponent {
|
|
|
33
33
|
trigger: "hover",
|
|
34
34
|
position: "top",
|
|
35
35
|
autoAdjustOverflow: true,
|
|
36
|
-
className:
|
|
36
|
+
className: `${prefixCls}-rest-group-popover`
|
|
37
37
|
}, popoverProps, {
|
|
38
38
|
key: "_+n_Popover"
|
|
39
39
|
}), nTag);
|
|
@@ -116,10 +116,10 @@ export default class TagGroup extends PureComponent {
|
|
|
116
116
|
size
|
|
117
117
|
} = this.props;
|
|
118
118
|
const groupCls = classNames({
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
119
|
+
[`${prefixCls}-group`]: true,
|
|
120
|
+
[`${prefixCls}-group-max`]: maxTagCount,
|
|
121
|
+
[`${prefixCls}-group-small`]: size === 'small',
|
|
122
|
+
[`${prefixCls}-group-large`]: size === 'large'
|
|
123
123
|
}, className);
|
|
124
124
|
const tags = this.renderAllTags();
|
|
125
125
|
const tagContents = typeof maxTagCount === 'undefined' ? tags : this.renderMergeTags(tags);
|
package/lib/es/tag/index.js
CHANGED
|
@@ -146,16 +146,16 @@ export default class Tag extends Component {
|
|
|
146
146
|
const baseProps = Object.assign(Object.assign({}, attr), {
|
|
147
147
|
onClick,
|
|
148
148
|
className: classNames(prefixCls, {
|
|
149
|
-
[
|
|
150
|
-
[
|
|
151
|
-
[
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
156
|
-
[
|
|
157
|
-
[
|
|
158
|
-
[
|
|
149
|
+
[`${prefixCls}-default`]: size === 'default',
|
|
150
|
+
[`${prefixCls}-small`]: size === 'small',
|
|
151
|
+
[`${prefixCls}-large`]: size === 'large',
|
|
152
|
+
[`${prefixCls}-square`]: shape === 'square',
|
|
153
|
+
[`${prefixCls}-circle`]: shape === 'circle',
|
|
154
|
+
[`${prefixCls}-${type}`]: type,
|
|
155
|
+
[`${prefixCls}-${color}-${type}`]: color && type,
|
|
156
|
+
[`${prefixCls}-closable`]: closable,
|
|
157
|
+
[`${prefixCls}-invisible`]: !isVisible,
|
|
158
|
+
[`${prefixCls}-avatar-${avatarShape}`]: avatarSrc
|
|
159
159
|
}, className)
|
|
160
160
|
});
|
|
161
161
|
const wrapProps = clickable ? Object.assign(Object.assign({}, baseProps), a11yProps) : baseProps;
|
|
@@ -163,15 +163,15 @@ export default class Tag extends Component {
|
|
|
163
163
|
/*#__PURE__*/
|
|
164
164
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
165
165
|
React.createElement("div", {
|
|
166
|
-
className:
|
|
166
|
+
className: `${prefixCls}-close`,
|
|
167
167
|
onClick: e => this.close(e, children, tagKey)
|
|
168
168
|
}, /*#__PURE__*/React.createElement(IconClose, {
|
|
169
169
|
size: "small"
|
|
170
170
|
})) : null;
|
|
171
171
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
172
|
-
"aria-label": this.props['aria-label'] || _isString(children) ?
|
|
172
|
+
"aria-label": this.props['aria-label'] || _isString(children) ? `${closable ? 'Closable ' : ''}Tag: ${children}` : ''
|
|
173
173
|
}, wrapProps), avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/React.createElement("div", {
|
|
174
|
-
className:
|
|
174
|
+
className: `${prefixCls}-content`
|
|
175
175
|
}, children), closeIcon);
|
|
176
176
|
}
|
|
177
177
|
|
package/lib/es/tagInput/index.js
CHANGED
|
@@ -25,7 +25,7 @@ const SortableList = SortableContainer(_ref => {
|
|
|
25
25
|
items
|
|
26
26
|
} = _ref;
|
|
27
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className:
|
|
28
|
+
className: `${prefixCls}-sortable-list`
|
|
29
29
|
}, items.map((item, index) =>
|
|
30
30
|
/*#__PURE__*/
|
|
31
31
|
// @ts-ignore skip SortableItem type check
|
|
@@ -103,22 +103,22 @@ class TagInput extends BaseComponent {
|
|
|
103
103
|
active
|
|
104
104
|
} = this.state;
|
|
105
105
|
const showIconHandler = active && draggable;
|
|
106
|
-
const tagCls = cls(
|
|
107
|
-
[
|
|
108
|
-
[
|
|
106
|
+
const tagCls = cls(`${prefixCls}-wrapper-tag`, {
|
|
107
|
+
[`${prefixCls}-wrapper-tag-size-${size}`]: size,
|
|
108
|
+
[`${prefixCls}-wrapper-tag-icon`]: showIconHandler
|
|
109
109
|
});
|
|
110
|
-
const typoCls = cls(
|
|
111
|
-
[
|
|
110
|
+
const typoCls = cls(`${prefixCls}-wrapper-typo`, {
|
|
111
|
+
[`${prefixCls}-wrapper-typo-disabled`]: disabled
|
|
112
112
|
});
|
|
113
113
|
const itemWrapperCls = cls({
|
|
114
|
-
[
|
|
115
|
-
[
|
|
114
|
+
[`${prefixCls}-drag-item`]: showIconHandler,
|
|
115
|
+
[`${prefixCls}-wrapper-tag-icon`]: showIconHandler
|
|
116
116
|
});
|
|
117
117
|
const DragHandle = SortableHandle(() => /*#__PURE__*/React.createElement(IconHandle, {
|
|
118
|
-
className:
|
|
118
|
+
className: `${prefixCls}-drag-handler`
|
|
119
119
|
}));
|
|
120
120
|
return tagsArray.map((value, index) => {
|
|
121
|
-
const elementKey = showIconHandler ? value :
|
|
121
|
+
const elementKey = showIconHandler ? value : `${index}${value}`;
|
|
122
122
|
|
|
123
123
|
const onClose = () => {
|
|
124
124
|
!disabled && this.handleTagClose(index);
|
|
@@ -139,9 +139,9 @@ class TagInput extends BaseComponent {
|
|
|
139
139
|
closable: !disabled,
|
|
140
140
|
key: elementKey,
|
|
141
141
|
visible: true,
|
|
142
|
-
"aria-label":
|
|
142
|
+
"aria-label": `${!disabled ? 'Closable ' : ''}Tag: ${value}`
|
|
143
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
-
className:
|
|
144
|
+
className: `${prefixCls}-tag-content-wrapper`
|
|
145
145
|
}, showIconHandler && /*#__PURE__*/React.createElement(DragHandle, null), /*#__PURE__*/React.createElement(Paragraph, {
|
|
146
146
|
className: typoCls,
|
|
147
147
|
ellipsis: {
|
|
@@ -325,8 +325,8 @@ class TagInput extends BaseComponent {
|
|
|
325
325
|
disabled,
|
|
326
326
|
clearIcon
|
|
327
327
|
} = this.props;
|
|
328
|
-
const clearCls = cls(
|
|
329
|
-
[
|
|
328
|
+
const clearCls = cls(`${prefixCls}-clearBtn`, {
|
|
329
|
+
[`${prefixCls}-clearBtn-invisible`]: !hovering || inputValue === '' && tagsArray.length === 0 || disabled
|
|
330
330
|
});
|
|
331
331
|
|
|
332
332
|
if (showClear) {
|
|
@@ -355,11 +355,11 @@ class TagInput extends BaseComponent {
|
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
const prefixWrapperCls = cls(
|
|
359
|
-
[
|
|
360
|
-
[
|
|
358
|
+
const prefixWrapperCls = cls(`${prefixCls}-prefix`, {
|
|
359
|
+
[`${prefixCls}-inset-label`]: insetLabel,
|
|
360
|
+
[`${prefixCls}-prefix-text`]: labelNode && _isString(labelNode),
|
|
361
361
|
// eslint-disable-next-line max-len
|
|
362
|
-
[
|
|
362
|
+
[`${prefixCls}-prefix-icon`]: isSemiIcon(labelNode)
|
|
363
363
|
});
|
|
364
364
|
return (
|
|
365
365
|
/*#__PURE__*/
|
|
@@ -383,10 +383,10 @@ class TagInput extends BaseComponent {
|
|
|
383
383
|
return null;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
-
const suffixWrapperCls = cls(
|
|
387
|
-
[
|
|
386
|
+
const suffixWrapperCls = cls(`${prefixCls}-suffix`, {
|
|
387
|
+
[`${prefixCls}-suffix-text`]: suffix && _isString(suffix),
|
|
388
388
|
// eslint-disable-next-line max-len
|
|
389
|
-
[
|
|
389
|
+
[`${prefixCls}-suffix-icon`]: isSemiIcon(suffix)
|
|
390
390
|
});
|
|
391
391
|
return (
|
|
392
392
|
/*#__PURE__*/
|
|
@@ -413,8 +413,8 @@ class TagInput extends BaseComponent {
|
|
|
413
413
|
tagsArray,
|
|
414
414
|
active
|
|
415
415
|
} = this.state;
|
|
416
|
-
const restTagsCls = cls(
|
|
417
|
-
[
|
|
416
|
+
const restTagsCls = cls(`${prefixCls}-wrapper-n`, {
|
|
417
|
+
[`${prefixCls}-wrapper-n-disabled`]: disabled
|
|
418
418
|
});
|
|
419
419
|
const allTags = this.getAllTags();
|
|
420
420
|
let restTags = [];
|
|
@@ -438,7 +438,7 @@ class TagInput extends BaseComponent {
|
|
|
438
438
|
// @ts-ignore skip SortableItem type check
|
|
439
439
|
return /*#__PURE__*/React.createElement(SortableList, {
|
|
440
440
|
useDragHandle: true,
|
|
441
|
-
helperClass:
|
|
441
|
+
helperClass: `${prefixCls}-drag-item-move`,
|
|
442
442
|
items: sortableListItems,
|
|
443
443
|
onSortEnd: this.onSortEnd,
|
|
444
444
|
axis: "xy"
|
|
@@ -492,16 +492,16 @@ class TagInput extends BaseComponent {
|
|
|
492
492
|
active
|
|
493
493
|
} = this.state;
|
|
494
494
|
const tagInputCls = cls(prefixCls, className, {
|
|
495
|
-
[
|
|
496
|
-
[
|
|
497
|
-
[
|
|
498
|
-
[
|
|
499
|
-
[
|
|
500
|
-
[
|
|
501
|
-
[
|
|
495
|
+
[`${prefixCls}-focus`]: focusing || active,
|
|
496
|
+
[`${prefixCls}-disabled`]: disabled,
|
|
497
|
+
[`${prefixCls}-hover`]: hovering && !disabled,
|
|
498
|
+
[`${prefixCls}-error`]: validateStatus === 'error',
|
|
499
|
+
[`${prefixCls}-warning`]: validateStatus === 'warning',
|
|
500
|
+
[`${prefixCls}-small`]: size === 'small',
|
|
501
|
+
[`${prefixCls}-large`]: size === 'large'
|
|
502
502
|
});
|
|
503
|
-
const inputCls = cls(
|
|
504
|
-
const wrapperCls = cls(
|
|
503
|
+
const inputCls = cls(`${prefixCls}-wrapper-input`, `${prefixCls}-wrapper-input-${size}`);
|
|
504
|
+
const wrapperCls = cls(`${prefixCls}-wrapper`);
|
|
505
505
|
return (
|
|
506
506
|
/*#__PURE__*/
|
|
507
507
|
// eslint-disable-next-line
|
|
@@ -141,7 +141,7 @@ class Combobox extends BaseComponent {
|
|
|
141
141
|
|
|
142
142
|
const transformHour = value => value + locale.hour;
|
|
143
143
|
|
|
144
|
-
const className =
|
|
144
|
+
const className = `${prefixCls}-list-hour`;
|
|
145
145
|
return /*#__PURE__*/React.createElement(ScrollItem, Object.assign({
|
|
146
146
|
ref: current => this.cacheRefCurrent('hour', current),
|
|
147
147
|
mode: 'normal',
|
|
@@ -172,7 +172,7 @@ class Combobox extends BaseComponent {
|
|
|
172
172
|
|
|
173
173
|
const value = new Date(timeStampValue);
|
|
174
174
|
const disabledOptions = disabledMinutes && disabledMinutes(value.getHours());
|
|
175
|
-
const className =
|
|
175
|
+
const className = `${prefixCls}-list-minute`;
|
|
176
176
|
|
|
177
177
|
const transformMinute = min => min + locale.minute;
|
|
178
178
|
|
|
@@ -206,7 +206,7 @@ class Combobox extends BaseComponent {
|
|
|
206
206
|
|
|
207
207
|
const value = new Date(timeStampValue);
|
|
208
208
|
const disabledOptions = disabledSeconds && disabledSeconds(value.getHours(), value.getMinutes());
|
|
209
|
-
const className =
|
|
209
|
+
const className = `${prefixCls}-list-second`;
|
|
210
210
|
|
|
211
211
|
const transformSecond = sec => String(sec) + locale.second;
|
|
212
212
|
|
|
@@ -242,7 +242,7 @@ class Combobox extends BaseComponent {
|
|
|
242
242
|
text: locale.PM || '下午'
|
|
243
243
|
}];
|
|
244
244
|
const selected = isAM ? 0 : 1;
|
|
245
|
-
const className =
|
|
245
|
+
const className = `${prefixCls}-list-ampm`;
|
|
246
246
|
return /*#__PURE__*/React.createElement(ScrollItem, Object.assign({
|
|
247
247
|
ref: current => this.cacheRefCurrent('ampm', current),
|
|
248
248
|
mode: 'normal',
|
|
@@ -126,9 +126,9 @@ class TimeInput extends BaseComponent {
|
|
|
126
126
|
rest = __rest(_a, ["prefixCls", "placeholder", "inputReadOnly", "onFocus", "disabled", "type", "locale", "localeCode", "insetLabel", "validateStatus", "value", "onChange", "invalid", "format", "clearText", "disabledHours", "disabledMinutes", "disabledSeconds", "onEsc", "defaultOpenValue", "currentSelectPanel", "focusOnOpen", "timeStampValue", "timeZone", "defaultOpen", "dateFnsLocale"]); // const { focusing } = this.state;
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
const inputCls = classNames(
|
|
130
|
-
[
|
|
131
|
-
[
|
|
129
|
+
const inputCls = classNames(`${prefixCls}-input`, {
|
|
130
|
+
[`${prefixCls}-input-invalid`]: invalid,
|
|
131
|
+
[`${prefixCls}-input-readonly`]: inputReadOnly
|
|
132
132
|
});
|
|
133
133
|
const mergeValidateStatus = invalid ? 'error' : validateStatus;
|
|
134
134
|
return /*#__PURE__*/React.createElement(Input, Object.assign({}, rest, {
|
|
@@ -155,7 +155,7 @@ class TimeInput extends BaseComponent {
|
|
|
155
155
|
prefixCls
|
|
156
156
|
} = this.props;
|
|
157
157
|
return /*#__PURE__*/React.createElement("div", {
|
|
158
|
-
className:
|
|
158
|
+
className: `${prefixCls}-input-wrap`
|
|
159
159
|
}, this.getInput());
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -197,7 +197,7 @@ export default class TimePicker extends BaseComponent {
|
|
|
197
197
|
format: format,
|
|
198
198
|
isAM: isAM[0],
|
|
199
199
|
timeStampValue: value[0],
|
|
200
|
-
prefixCls:
|
|
200
|
+
prefixCls: `${prefixCls}-panel`,
|
|
201
201
|
onChange: v => this.handlePanelChange(v, 0),
|
|
202
202
|
onCurrentSelectPanelChange: this.onCurrentSelectPanelChange
|
|
203
203
|
}, this.createPanelProps(0)))];
|
|
@@ -208,7 +208,7 @@ export default class TimePicker extends BaseComponent {
|
|
|
208
208
|
format: format,
|
|
209
209
|
isAM: isAM[1],
|
|
210
210
|
timeStampValue: value[1],
|
|
211
|
-
prefixCls:
|
|
211
|
+
prefixCls: `${prefixCls}-panel`,
|
|
212
212
|
onChange: v => this.handlePanelChange(v, 1),
|
|
213
213
|
onCurrentSelectPanelChange: this.onCurrentSelectPanelChange
|
|
214
214
|
}, this.createPanelProps(1))));
|
|
@@ -252,10 +252,10 @@ export default class TimePicker extends BaseComponent {
|
|
|
252
252
|
selectColumnCount += 1;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
return classNames(
|
|
256
|
-
[
|
|
255
|
+
return classNames(`${prefixCls}-panel`, popupClassName, {
|
|
256
|
+
[`${prefixCls}-panel-narrow`]: (!showHour || !showMinute || !showSecond) && !use12Hours,
|
|
257
257
|
[cssClasses.RANGE_PICKER]: this.adapter.isRangePicker()
|
|
258
|
-
},
|
|
258
|
+
}, `${prefixCls}-panel-column-${selectColumnCount}`);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
focus() {// TODO this.picker is undefined, confirm keep this func or not
|
|
@@ -315,11 +315,11 @@ export default class TimePicker extends BaseComponent {
|
|
|
315
315
|
} = this.state;
|
|
316
316
|
const popupClassName = this.getPopupClassName();
|
|
317
317
|
const headerPrefix = classNames({
|
|
318
|
-
[
|
|
318
|
+
[`${prefixCls}-header`]: true
|
|
319
319
|
});
|
|
320
320
|
const panelPrefix = classNames({
|
|
321
|
-
[
|
|
322
|
-
[
|
|
321
|
+
[`${prefixCls}-panel`]: true,
|
|
322
|
+
[`${prefixCls}-panel-${size}`]: size
|
|
323
323
|
});
|
|
324
324
|
const inputProps = Object.assign(Object.assign({}, rest), {
|
|
325
325
|
disabled,
|