@douyinfe/semi-ui 2.2.2 → 2.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_base/_story/a11y.jsx +6 -6
- package/_base/_story/a11y.scss +0 -1
- package/_base/_story/index.scss +2 -5
- package/_utils/hooks/usePrevFocus.ts +16 -0
- package/_utils/index.ts +4 -0
- package/anchor/_story/anchor.stories.js +1 -1
- package/anchor/index.tsx +5 -2
- package/anchor/link.tsx +29 -4
- package/autoComplete/index.tsx +28 -1
- package/avatar/_story/avatar.stories.js +4 -4
- package/avatar/index.tsx +6 -4
- package/banner/index.tsx +2 -1
- package/breadcrumb/_story/breadcrumb.stories.js +22 -8
- package/breadcrumb/index.tsx +8 -1
- package/breadcrumb/item.tsx +1 -1
- package/button/Button.tsx +4 -0
- package/button/__test__/button.test.js +1 -1
- package/button/_story/button.stories.js +10 -10
- package/button/buttonGroup.tsx +4 -2
- package/button/splitButtonGroup.tsx +5 -2
- package/card/_story/card.stories.js +8 -1
- package/card/_story/card.stories.tsx +3 -0
- package/card/index.tsx +5 -2
- package/cascader/index.tsx +33 -5
- package/checkbox/_story/checkbox.stories.js +19 -12
- package/checkbox/checkbox.tsx +40 -5
- package/checkbox/checkboxGroup.tsx +30 -5
- package/checkbox/checkboxInner.tsx +25 -2
- package/collapse/index.tsx +1 -1
- package/collapse/item.tsx +12 -7
- package/collapsible/index.tsx +4 -2
- package/configProvider/_story/configProvider.stories.tsx +27 -0
- package/datePicker/datePicker.tsx +19 -0
- package/dist/css/semi.css +23 -12
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2502 -1249
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/dropdown/dropdownItem.tsx +1 -1
- package/dropdown/dropdownMenu.tsx +1 -1
- package/dropdown/index.tsx +11 -3
- package/empty/index.tsx +4 -4
- package/form/_story/FormApi/formApiDemo.jsx +3 -2
- package/form/_story/Validate/validateDemo.jsx +1 -1
- package/form/_story/demo.jsx +12 -3
- package/form/_story/form.stories.js +0 -7
- package/form/baseForm.tsx +2 -0
- package/form/errorMessage.tsx +13 -2
- package/form/hoc/withField.tsx +37 -8
- package/form/index.tsx +0 -2
- package/form/interface.ts +2 -0
- package/form/label.tsx +4 -2
- package/input/index.tsx +49 -4
- package/input/inputGroup.tsx +9 -4
- package/input/textarea.tsx +30 -9
- package/inputNumber/__test__/inputNumber.test.js +36 -8
- package/inputNumber/index.tsx +30 -2
- package/layout/Sider.tsx +6 -2
- package/layout/index.tsx +4 -3
- package/lib/cjs/_utils/hooks/usePrevFocus.d.ts +2 -0
- package/lib/cjs/_utils/hooks/usePrevFocus.js +30 -0
- package/lib/cjs/_utils/index.d.ts +1 -0
- package/lib/cjs/_utils/index.js +6 -1
- package/lib/cjs/anchor/index.d.ts +2 -0
- package/lib/cjs/anchor/index.js +6 -1
- package/lib/cjs/anchor/link.d.ts +4 -1
- package/lib/cjs/anchor/link.js +39 -5
- package/lib/cjs/autoComplete/index.d.ts +17 -0
- package/lib/cjs/autoComplete/index.js +21 -2
- package/lib/cjs/avatar/index.d.ts +4 -3
- package/lib/cjs/avatar/index.js +15 -11
- package/lib/cjs/banner/index.js +4 -2
- package/lib/cjs/breadcrumb/index.d.ts +3 -0
- package/lib/cjs/breadcrumb/index.js +10 -4
- package/lib/cjs/breadcrumb/item.js +2 -2
- package/lib/cjs/button/Button.d.ts +2 -0
- package/lib/cjs/button/Button.js +4 -2
- package/lib/cjs/button/buttonGroup.d.ts +3 -0
- package/lib/cjs/button/buttonGroup.js +8 -4
- package/lib/cjs/button/index.d.ts +1 -0
- package/lib/cjs/button/splitButtonGroup.d.ts +3 -0
- package/lib/cjs/button/splitButtonGroup.js +5 -2
- package/lib/cjs/card/index.d.ts +3 -0
- package/lib/cjs/card/index.js +3 -1
- package/lib/cjs/cascader/index.d.ts +14 -0
- package/lib/cjs/cascader/index.js +35 -7
- package/lib/cjs/checkbox/checkbox.d.ts +21 -1
- package/lib/cjs/checkbox/checkbox.js +51 -17
- package/lib/cjs/checkbox/checkboxGroup.d.ts +13 -1
- package/lib/cjs/checkbox/checkboxGroup.js +16 -3
- package/lib/cjs/checkbox/checkboxInner.d.ts +15 -0
- package/lib/cjs/checkbox/checkboxInner.js +20 -3
- package/lib/cjs/collapse/item.d.ts +2 -1
- package/lib/cjs/collapse/item.js +12 -2
- package/lib/cjs/collapsible/index.d.ts +1 -0
- package/lib/cjs/collapsible/index.js +4 -2
- package/lib/cjs/datePicker/datePicker.d.ts +12 -0
- package/lib/cjs/datePicker/datePicker.js +14 -1
- package/lib/cjs/dropdown/dropdownItem.js +3 -1
- package/lib/cjs/dropdown/dropdownMenu.js +4 -1
- package/lib/cjs/dropdown/index.d.ts +10 -3
- package/lib/cjs/form/baseForm.d.ts +9 -0
- package/lib/cjs/form/baseForm.js +3 -1
- package/lib/cjs/form/errorMessage.d.ts +4 -0
- package/lib/cjs/form/errorMessage.js +21 -3
- package/lib/cjs/form/field.d.ts +7 -0
- package/lib/cjs/form/hoc/withField.js +49 -16
- package/lib/cjs/form/index.d.ts +0 -1
- package/lib/cjs/form/interface.d.ts +2 -0
- package/lib/cjs/form/label.d.ts +2 -0
- package/lib/cjs/form/label.js +5 -2
- package/lib/cjs/input/index.d.ts +16 -0
- package/lib/cjs/input/index.js +51 -15
- package/lib/cjs/input/inputGroup.d.ts +2 -1
- package/lib/cjs/input/inputGroup.js +11 -1
- package/lib/cjs/input/textarea.js +16 -3
- package/lib/cjs/inputNumber/index.d.ts +8 -0
- package/lib/cjs/inputNumber/index.js +35 -4
- package/lib/cjs/layout/Sider.d.ts +4 -0
- package/lib/cjs/layout/Sider.js +4 -1
- package/lib/cjs/layout/index.js +2 -0
- package/lib/cjs/list/index.d.ts +4 -4
- package/lib/cjs/list/item.js +0 -1
- package/lib/cjs/modal/Modal.js +2 -0
- package/lib/cjs/modal/ModalContent.d.ts +3 -1
- package/lib/cjs/modal/ModalContent.js +47 -5
- package/lib/cjs/navigation/Item.d.ts +4 -2
- package/lib/cjs/navigation/Item.js +25 -5
- package/lib/cjs/navigation/SubNav.d.ts +4 -2
- package/lib/cjs/navigation/SubNav.js +8 -1
- package/lib/cjs/navigation/index.js +2 -0
- package/lib/cjs/notification/notice.d.ts +1 -1
- package/lib/cjs/notification/notice.js +32 -22
- package/lib/cjs/pagination/index.js +16 -6
- package/lib/cjs/popover/index.js +7 -3
- package/lib/cjs/progress/index.d.ts +8 -0
- package/lib/cjs/progress/index.js +42 -9
- package/lib/cjs/radio/radio.d.ts +6 -1
- package/lib/cjs/radio/radio.js +17 -5
- package/lib/cjs/radio/radioGroup.d.ts +16 -1
- package/lib/cjs/radio/radioGroup.js +18 -3
- package/lib/cjs/radio/radioInner.d.ts +6 -1
- package/lib/cjs/radio/radioInner.js +11 -3
- package/lib/cjs/rating/index.d.ts +14 -0
- package/lib/cjs/rating/index.js +14 -3
- package/lib/cjs/rating/item.d.ts +2 -0
- package/lib/cjs/rating/item.js +6 -1
- package/lib/cjs/select/index.d.ts +16 -0
- package/lib/cjs/select/index.js +65 -19
- package/lib/cjs/select/option.js +28 -22
- package/lib/cjs/sideSheet/SideSheetContent.d.ts +1 -0
- package/lib/cjs/sideSheet/SideSheetContent.js +4 -1
- package/lib/cjs/sideSheet/index.d.ts +1 -0
- package/lib/cjs/sideSheet/index.js +2 -1
- package/lib/cjs/slider/index.d.ts +2 -1
- package/lib/cjs/slider/index.js +64 -17
- package/lib/cjs/spin/icon.js +3 -4
- package/lib/cjs/steps/basicStep.d.ts +3 -0
- package/lib/cjs/steps/basicStep.js +23 -25
- package/lib/cjs/steps/basicSteps.d.ts +1 -0
- package/lib/cjs/steps/basicSteps.js +2 -1
- package/lib/cjs/steps/fillStep.d.ts +3 -0
- package/lib/cjs/steps/fillStep.js +19 -4
- package/lib/cjs/steps/fillSteps.d.ts +1 -0
- package/lib/cjs/steps/fillSteps.js +2 -1
- package/lib/cjs/steps/navStep.d.ts +3 -0
- package/lib/cjs/steps/navStep.js +22 -25
- package/lib/cjs/steps/navSteps.d.ts +1 -0
- package/lib/cjs/steps/navSteps.js +2 -1
- package/lib/cjs/switch/index.d.ts +12 -0
- package/lib/cjs/switch/index.js +19 -4
- package/lib/cjs/table/Body/BaseRow.js +35 -3
- package/lib/cjs/table/Body/index.js +9 -1
- package/lib/cjs/table/ColumnFilter.js +4 -0
- package/lib/cjs/table/ColumnSelection.d.ts +3 -0
- package/lib/cjs/table/ColumnSelection.js +6 -2
- package/lib/cjs/table/ColumnSorter.js +19 -3
- package/lib/cjs/table/CustomExpandIcon.js +7 -1
- package/lib/cjs/table/Table.d.ts +2 -0
- package/lib/cjs/table/Table.js +35 -15
- package/lib/cjs/table/TableCell.d.ts +2 -0
- package/lib/cjs/table/TableCell.js +6 -2
- package/lib/cjs/table/TableHeaderRow.js +8 -2
- package/lib/cjs/tabs/TabBar.js +11 -3
- package/lib/cjs/tabs/TabPane.js +3 -1
- package/lib/cjs/tabs/index.js +0 -1
- package/lib/cjs/tagInput/index.d.ts +4 -1
- package/lib/cjs/tagInput/index.js +29 -3
- package/lib/cjs/timePicker/TimePicker.d.ts +14 -0
- package/lib/cjs/timePicker/TimePicker.js +11 -4
- package/lib/cjs/timePicker/index.d.ts +7 -0
- package/lib/cjs/timeline/index.d.ts +1 -1
- package/lib/cjs/timeline/index.js +1 -0
- package/lib/cjs/timeline/item.js +4 -2
- package/lib/cjs/toast/toast.js +2 -0
- package/lib/cjs/tooltip/TriangleArrow.js +1 -0
- package/lib/cjs/tooltip/TriangleArrowVertical.js +1 -0
- package/lib/cjs/tooltip/index.d.ts +16 -12
- package/lib/cjs/tooltip/index.js +55 -39
- package/lib/cjs/transfer/index.js +32 -14
- package/lib/cjs/tree/index.d.ts +1 -0
- package/lib/cjs/tree/index.js +15 -6
- package/lib/cjs/tree/treeNode.d.ts +12 -4
- package/lib/cjs/tree/treeNode.js +54 -5
- package/lib/cjs/treeSelect/index.d.ts +16 -0
- package/lib/cjs/treeSelect/index.js +60 -12
- package/lib/cjs/typography/base.js +18 -7
- package/lib/cjs/typography/copyable.js +6 -1
- package/lib/cjs/upload/fileCard.js +26 -7
- package/lib/cjs/upload/index.js +19 -4
- package/lib/es/_utils/hooks/usePrevFocus.d.ts +2 -0
- package/lib/es/_utils/hooks/usePrevFocus.js +15 -0
- package/lib/es/_utils/index.d.ts +1 -0
- package/lib/es/_utils/index.js +4 -1
- package/lib/es/anchor/index.d.ts +2 -0
- package/lib/es/anchor/index.js +6 -1
- package/lib/es/anchor/link.d.ts +4 -1
- package/lib/es/anchor/link.js +38 -5
- package/lib/es/autoComplete/index.d.ts +17 -0
- package/lib/es/autoComplete/index.js +21 -2
- package/lib/es/avatar/index.d.ts +4 -3
- package/lib/es/avatar/index.js +15 -11
- package/lib/es/banner/index.js +4 -2
- package/lib/es/breadcrumb/index.d.ts +3 -0
- package/lib/es/breadcrumb/index.js +10 -4
- package/lib/es/breadcrumb/item.js +2 -2
- package/lib/es/button/Button.d.ts +2 -0
- package/lib/es/button/Button.js +4 -2
- package/lib/es/button/buttonGroup.d.ts +3 -0
- package/lib/es/button/buttonGroup.js +8 -4
- package/lib/es/button/index.d.ts +1 -0
- package/lib/es/button/splitButtonGroup.d.ts +3 -0
- package/lib/es/button/splitButtonGroup.js +5 -2
- package/lib/es/card/index.d.ts +3 -0
- package/lib/es/card/index.js +3 -1
- package/lib/es/cascader/index.d.ts +14 -0
- package/lib/es/cascader/index.js +35 -7
- package/lib/es/checkbox/checkbox.d.ts +21 -1
- package/lib/es/checkbox/checkbox.js +50 -17
- package/lib/es/checkbox/checkboxGroup.d.ts +13 -1
- package/lib/es/checkbox/checkboxGroup.js +18 -5
- package/lib/es/checkbox/checkboxInner.d.ts +15 -0
- package/lib/es/checkbox/checkboxInner.js +20 -3
- package/lib/es/collapse/item.d.ts +2 -1
- package/lib/es/collapse/item.js +11 -2
- package/lib/es/collapsible/index.d.ts +1 -0
- package/lib/es/collapsible/index.js +4 -2
- package/lib/es/datePicker/datePicker.d.ts +12 -0
- package/lib/es/datePicker/datePicker.js +14 -1
- package/lib/es/dropdown/dropdownItem.js +3 -1
- package/lib/es/dropdown/dropdownMenu.js +4 -1
- package/lib/es/dropdown/index.d.ts +10 -3
- package/lib/es/form/baseForm.d.ts +9 -0
- package/lib/es/form/baseForm.js +3 -1
- package/lib/es/form/errorMessage.d.ts +4 -0
- package/lib/es/form/errorMessage.js +21 -3
- package/lib/es/form/field.d.ts +7 -0
- package/lib/es/form/hoc/withField.js +48 -15
- package/lib/es/form/index.d.ts +0 -1
- package/lib/es/form/index.js +0 -1
- package/lib/es/form/interface.d.ts +2 -0
- package/lib/es/form/label.d.ts +2 -0
- package/lib/es/form/label.js +5 -2
- package/lib/es/input/index.d.ts +16 -0
- package/lib/es/input/index.js +51 -15
- package/lib/es/input/inputGroup.d.ts +2 -1
- package/lib/es/input/inputGroup.js +11 -1
- package/lib/es/input/textarea.js +16 -3
- package/lib/es/inputNumber/index.d.ts +8 -0
- package/lib/es/inputNumber/index.js +36 -4
- package/lib/es/layout/Sider.d.ts +4 -0
- package/lib/es/layout/Sider.js +4 -1
- package/lib/es/layout/index.js +2 -0
- package/lib/es/list/index.d.ts +4 -4
- package/lib/es/list/item.js +0 -1
- package/lib/es/modal/Modal.js +2 -0
- package/lib/es/modal/ModalContent.d.ts +3 -1
- package/lib/es/modal/ModalContent.js +46 -5
- package/lib/es/navigation/Item.d.ts +4 -2
- package/lib/es/navigation/Item.js +25 -5
- package/lib/es/navigation/SubNav.d.ts +4 -2
- package/lib/es/navigation/SubNav.js +8 -1
- package/lib/es/navigation/index.js +2 -0
- package/lib/es/notification/notice.d.ts +1 -1
- package/lib/es/notification/notice.js +33 -24
- package/lib/es/pagination/index.js +16 -6
- package/lib/es/popover/index.js +7 -3
- package/lib/es/progress/index.d.ts +8 -0
- package/lib/es/progress/index.js +42 -9
- package/lib/es/radio/radio.d.ts +6 -1
- package/lib/es/radio/radio.js +16 -5
- package/lib/es/radio/radioGroup.d.ts +16 -1
- package/lib/es/radio/radioGroup.js +18 -3
- package/lib/es/radio/radioInner.d.ts +6 -1
- package/lib/es/radio/radioInner.js +11 -3
- package/lib/es/rating/index.d.ts +14 -0
- package/lib/es/rating/index.js +14 -3
- package/lib/es/rating/item.d.ts +2 -0
- package/lib/es/rating/item.js +6 -1
- package/lib/es/select/index.d.ts +16 -0
- package/lib/es/select/index.js +63 -17
- package/lib/es/select/option.js +28 -22
- package/lib/es/sideSheet/SideSheetContent.d.ts +1 -0
- package/lib/es/sideSheet/SideSheetContent.js +4 -1
- package/lib/es/sideSheet/index.d.ts +1 -0
- package/lib/es/sideSheet/index.js +2 -1
- package/lib/es/slider/index.d.ts +2 -1
- package/lib/es/slider/index.js +63 -16
- package/lib/es/spin/icon.js +3 -4
- package/lib/es/steps/basicStep.d.ts +3 -0
- package/lib/es/steps/basicStep.js +23 -23
- package/lib/es/steps/basicSteps.d.ts +1 -0
- package/lib/es/steps/basicSteps.js +2 -1
- package/lib/es/steps/fillStep.d.ts +3 -0
- package/lib/es/steps/fillStep.js +19 -4
- package/lib/es/steps/fillSteps.d.ts +1 -0
- package/lib/es/steps/fillSteps.js +2 -1
- package/lib/es/steps/navStep.d.ts +3 -0
- package/lib/es/steps/navStep.js +22 -23
- package/lib/es/steps/navSteps.d.ts +1 -0
- package/lib/es/steps/navSteps.js +2 -1
- package/lib/es/switch/index.d.ts +12 -0
- package/lib/es/switch/index.js +19 -4
- package/lib/es/table/Body/BaseRow.js +35 -3
- package/lib/es/table/Body/index.js +9 -2
- package/lib/es/table/ColumnFilter.js +4 -0
- package/lib/es/table/ColumnSelection.d.ts +3 -0
- package/lib/es/table/ColumnSelection.js +6 -2
- package/lib/es/table/ColumnSorter.js +17 -3
- package/lib/es/table/CustomExpandIcon.js +6 -1
- package/lib/es/table/Table.d.ts +2 -0
- package/lib/es/table/Table.js +35 -15
- package/lib/es/table/TableCell.d.ts +2 -0
- package/lib/es/table/TableCell.js +6 -2
- package/lib/es/table/TableHeaderRow.js +8 -2
- package/lib/es/tabs/TabBar.js +11 -3
- package/lib/es/tabs/TabPane.js +3 -1
- package/lib/es/tabs/index.js +0 -1
- package/lib/es/tagInput/index.d.ts +4 -1
- package/lib/es/tagInput/index.js +29 -3
- package/lib/es/timePicker/TimePicker.d.ts +14 -0
- package/lib/es/timePicker/TimePicker.js +11 -4
- package/lib/es/timePicker/index.d.ts +7 -0
- package/lib/es/timeline/index.d.ts +1 -1
- package/lib/es/timeline/index.js +1 -0
- package/lib/es/timeline/item.js +4 -2
- package/lib/es/toast/toast.js +2 -0
- package/lib/es/tooltip/TriangleArrow.js +1 -0
- package/lib/es/tooltip/TriangleArrowVertical.js +1 -0
- package/lib/es/tooltip/index.d.ts +16 -12
- package/lib/es/tooltip/index.js +53 -39
- package/lib/es/transfer/index.js +32 -14
- package/lib/es/tree/index.d.ts +1 -0
- package/lib/es/tree/index.js +15 -6
- package/lib/es/tree/treeNode.d.ts +12 -4
- package/lib/es/tree/treeNode.js +53 -5
- package/lib/es/treeSelect/index.d.ts +16 -0
- package/lib/es/treeSelect/index.js +57 -10
- package/lib/es/typography/base.js +17 -7
- package/lib/es/typography/copyable.js +5 -1
- package/lib/es/upload/fileCard.js +26 -7
- package/lib/es/upload/index.js +19 -4
- package/list/index.tsx +5 -5
- package/list/item.tsx +0 -1
- package/modal/Modal.tsx +2 -0
- package/modal/ModalContent.tsx +35 -5
- package/navigation/Item.tsx +15 -0
- package/navigation/SubNav.tsx +13 -1
- package/navigation/index.tsx +1 -1
- package/notification/notice.tsx +19 -14
- package/package.json +8 -8
- package/pagination/index.tsx +9 -5
- package/popover/index.tsx +5 -0
- package/progress/_story/progress.stories.js +18 -18
- package/progress/index.tsx +58 -20
- package/radio/radio.tsx +12 -2
- package/radio/radioGroup.tsx +29 -3
- package/radio/radioInner.tsx +10 -1
- package/rating/index.tsx +19 -2
- package/rating/item.tsx +6 -0
- package/select/__test__/select.test.js +45 -0
- package/select/_story/select.stories.js +29 -0
- package/select/index.tsx +57 -4
- package/select/option.tsx +3 -0
- package/sideSheet/SideSheetContent.tsx +6 -4
- package/sideSheet/index.tsx +3 -2
- package/slider/__test__/slider.test.js +9 -0
- package/slider/_story/slider.stories.js +1 -1
- package/slider/index.tsx +44 -7
- package/spin/icon.tsx +4 -3
- package/steps/basicStep.tsx +15 -4
- package/steps/basicSteps.tsx +3 -2
- package/steps/fillStep.tsx +27 -12
- package/steps/fillSteps.tsx +2 -0
- package/steps/navStep.tsx +15 -4
- package/steps/navSteps.tsx +3 -2
- package/switch/_story/switch.stories.js +20 -19
- package/switch/_story/switch.stories.tsx +13 -13
- package/switch/index.tsx +23 -5
- package/table/Body/BaseRow.tsx +25 -1
- package/table/Body/index.tsx +7 -2
- package/table/ColumnFilter.tsx +7 -1
- package/table/ColumnSelection.tsx +4 -1
- package/table/ColumnSorter.tsx +18 -1
- package/table/CustomExpandIcon.tsx +5 -0
- package/table/Table.tsx +30 -14
- package/table/TableCell.tsx +11 -1
- package/table/TableHeaderRow.tsx +16 -2
- package/table/__test__/table.test.js +46 -0
- package/table/_story/table.stories.js +2 -0
- package/table/_story/v2/FixedColumnsChange/index.jsx +104 -0
- package/table/_story/v2/FixedZIndex/index.jsx +87 -0
- package/tabs/TabBar.tsx +8 -5
- package/tabs/TabPane.tsx +3 -1
- package/tabs/index.tsx +0 -1
- package/tagInput/__test__/tagInput.test.js +46 -0
- package/tagInput/_story/tagInput.stories.js +2 -2
- package/tagInput/index.tsx +31 -8
- package/timePicker/TimePicker.tsx +17 -2
- package/timePicker/__test__/timePicker.test.js +34 -3
- package/timePicker/_story/timepicker.stories.js +18 -0
- package/timeline/_story/timeline.stories.js +1 -1
- package/timeline/index.tsx +2 -2
- package/timeline/item.tsx +2 -1
- package/toast/toast.tsx +2 -0
- package/tooltip/TriangleArrow.tsx +1 -1
- package/tooltip/TriangleArrowVertical.tsx +1 -1
- package/tooltip/_story/tooltip.stories.js +562 -514
- package/tooltip/index.tsx +51 -33
- package/transfer/index.tsx +29 -25
- package/tree/_story/tree.stories.js +3 -3
- package/tree/index.tsx +10 -2
- package/tree/treeNode.tsx +54 -11
- package/treeSelect/__test__/treeMultiple.test.js +5 -0
- package/treeSelect/_story/treeSelect.stories.js +12 -0
- package/treeSelect/index.tsx +58 -7
- package/typography/base.tsx +7 -1
- package/typography/copyable.tsx +10 -1
- package/upload/fileCard.tsx +14 -16
- package/upload/index.tsx +10 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useMemo } from 'react';
|
|
2
2
|
import Tooltip from '../index';
|
|
3
3
|
import './story.scss';
|
|
4
|
-
import { Tag, Icon, IconButton, Switch, Checkbox, Radio, Button, Select } from '@douyinfe/semi-ui';
|
|
4
|
+
import { Tag, Icon, IconButton, Switch, Checkbox, Radio, Button, Select, InputNumber } from '@douyinfe/semi-ui';
|
|
5
5
|
|
|
6
6
|
import InTableDemo from './InTable';
|
|
7
7
|
import EdgeDemo from './Edge';
|
|
@@ -13,181 +13,185 @@ import ContainerPosition from './ContainerPosition';
|
|
|
13
13
|
import { IconList, IconSidebar, IconEdit } from '@douyinfe/semi-icons';
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
title: 'Tooltip',
|
|
17
|
+
parameters: {
|
|
18
|
+
chromatic: { disableSnapshot: true },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
21
|
|
|
22
22
|
function test(visible) {
|
|
23
|
-
|
|
23
|
+
console.log('visible Change:' + visible);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const ScrollDemo = function ScrollDemo(props = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
27
|
+
const tops = [
|
|
28
|
+
['topLeft', 'TL'],
|
|
29
|
+
['top', 'Top'],
|
|
30
|
+
['topRight', 'TR'],
|
|
31
|
+
];
|
|
32
|
+
const lefts = [
|
|
33
|
+
['leftTop', 'LT'],
|
|
34
|
+
['left', 'Left'],
|
|
35
|
+
['leftBottom', 'LB'],
|
|
36
|
+
];
|
|
37
|
+
const rights = [
|
|
38
|
+
['rightTop', 'RT'],
|
|
39
|
+
['right', 'Right'],
|
|
40
|
+
['rightBottom', 'RB'],
|
|
41
|
+
];
|
|
42
|
+
const bottoms = [
|
|
43
|
+
['bottomLeft', 'BL'],
|
|
44
|
+
['bottom', 'Bottom'],
|
|
45
|
+
['bottomRight', 'BR'],
|
|
46
|
+
];
|
|
47
|
+
const { tagStyle, ...restProps } = props;
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
style={{
|
|
51
|
+
paddingLeft: 40,
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<div
|
|
55
|
+
style={{
|
|
56
|
+
marginLeft: 40,
|
|
57
|
+
whiteSpace: 'nowrap',
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
{tops.map((pos, index) => (
|
|
61
|
+
<Tooltip
|
|
62
|
+
content={
|
|
63
|
+
<article>
|
|
64
|
+
<p>hi bytedance</p>
|
|
65
|
+
<p>hi bytedance</p>
|
|
66
|
+
</article>
|
|
67
|
+
}
|
|
68
|
+
position={Array.isArray(pos) ? pos[0] : pos}
|
|
69
|
+
key={index}
|
|
70
|
+
trigger={'click'}
|
|
71
|
+
{...restProps}
|
|
72
|
+
>
|
|
73
|
+
<Tag style={tagStyle}>{Array.isArray(pos) ? pos[1] : pos}</Tag>
|
|
74
|
+
</Tooltip>
|
|
75
|
+
))}
|
|
76
|
+
</div>
|
|
77
|
+
<div
|
|
78
|
+
style={{
|
|
79
|
+
width: 40,
|
|
80
|
+
float: 'left',
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
{lefts.map((pos, index) => (
|
|
84
|
+
<Tooltip
|
|
85
|
+
content={
|
|
86
|
+
<article>
|
|
87
|
+
<p>hi bytedance</p>
|
|
88
|
+
<p>hi bytedance</p>
|
|
89
|
+
</article>
|
|
90
|
+
}
|
|
91
|
+
position={Array.isArray(pos) ? pos[0] : pos}
|
|
92
|
+
key={index}
|
|
93
|
+
trigger={'click'}
|
|
94
|
+
{...restProps}
|
|
95
|
+
>
|
|
96
|
+
<Tag style={tagStyle}>{Array.isArray(pos) ? pos[1] : pos}</Tag>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
<div
|
|
101
|
+
style={{
|
|
102
|
+
width: 40,
|
|
103
|
+
marginLeft: 180,
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
{rights.map((pos, index) => (
|
|
107
|
+
<Tooltip
|
|
108
|
+
content={
|
|
109
|
+
<article>
|
|
110
|
+
<p>hi bytedance</p>
|
|
111
|
+
<p>hi bytedance</p>
|
|
112
|
+
</article>
|
|
113
|
+
}
|
|
114
|
+
position={Array.isArray(pos) ? pos[0] : pos}
|
|
115
|
+
key={index}
|
|
116
|
+
trigger={'click'}
|
|
117
|
+
{...restProps}
|
|
118
|
+
>
|
|
119
|
+
<Tag style={tagStyle}>{Array.isArray(pos) ? pos[1] : pos}</Tag>
|
|
120
|
+
</Tooltip>
|
|
121
|
+
))}
|
|
122
|
+
</div>
|
|
123
|
+
<div
|
|
124
|
+
style={{
|
|
125
|
+
marginLeft: 40,
|
|
126
|
+
clear: 'both',
|
|
127
|
+
whiteSpace: 'nowrap',
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{bottoms.map((pos, index) => (
|
|
131
|
+
<Tooltip
|
|
132
|
+
content={
|
|
133
|
+
<article>
|
|
134
|
+
<p>hi bytedance</p>
|
|
135
|
+
<p>hi bytedance</p>
|
|
136
|
+
</article>
|
|
137
|
+
}
|
|
138
|
+
position={Array.isArray(pos) ? pos[0] : pos}
|
|
139
|
+
key={index}
|
|
140
|
+
trigger={'click'}
|
|
141
|
+
{...restProps}
|
|
142
|
+
>
|
|
143
|
+
<Tag style={tagStyle}>{Array.isArray(pos) ? pos[1] : pos}</Tag>
|
|
144
|
+
</Tooltip>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
export const TooltipOnVisibleChange = () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
152
|
+
const [visible, setVisible] = useState(true);
|
|
153
|
+
return (
|
|
154
|
+
<div className="demo">
|
|
155
|
+
<div>
|
|
156
|
+
<label>受控</label>
|
|
157
|
+
<Tooltip
|
|
158
|
+
content={
|
|
159
|
+
<article>
|
|
160
|
+
<p>hi bytedance</p>
|
|
161
|
+
<p>hi bytedance</p>
|
|
162
|
+
</article>
|
|
163
|
+
}
|
|
164
|
+
position="top"
|
|
165
|
+
onVisibleChange={setVisible}
|
|
166
|
+
trigger="click"
|
|
167
|
+
visible={visible}
|
|
168
|
+
>
|
|
169
|
+
<Tag>demo</Tag>
|
|
170
|
+
</Tooltip>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<br />
|
|
174
|
+
<br />
|
|
175
|
+
<div>
|
|
176
|
+
<label>非受控</label>
|
|
177
|
+
<Tooltip
|
|
178
|
+
content={
|
|
179
|
+
<article>
|
|
180
|
+
<p>hi bytedance</p>
|
|
181
|
+
<p>hi bytedance</p>
|
|
182
|
+
</article>
|
|
183
|
+
}
|
|
184
|
+
position="leftTop"
|
|
185
|
+
onVisibleChange={test}
|
|
186
|
+
trigger="click"
|
|
187
|
+
>
|
|
188
|
+
<Tag>demo</Tag>
|
|
189
|
+
</Tooltip>
|
|
190
|
+
</div>
|
|
191
|
+
<br />
|
|
192
|
+
<br />
|
|
193
|
+
|
|
194
|
+
{/* <Tooltip
|
|
191
195
|
content={
|
|
192
196
|
<article>
|
|
193
197
|
<p>hi bytedance</p>
|
|
@@ -231,439 +235,439 @@ export const TooltipOnVisibleChange = () => {
|
|
|
231
235
|
>
|
|
232
236
|
<Tag>click</Tag>
|
|
233
237
|
</Tooltip> */}
|
|
234
|
-
|
|
235
|
-
|
|
238
|
+
</div>
|
|
239
|
+
);
|
|
236
240
|
};
|
|
237
241
|
|
|
238
242
|
TooltipOnVisibleChange.story = {
|
|
239
|
-
|
|
243
|
+
name: 'tooltip onVisibleChange',
|
|
240
244
|
};
|
|
241
245
|
|
|
242
246
|
export const GetPopupContainerDemo = () => (
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
247
|
+
<div className="demo">
|
|
248
|
+
<div className="content-layer" />
|
|
249
|
+
<Tooltip
|
|
250
|
+
content={
|
|
251
|
+
<article>
|
|
252
|
+
<p>hi bytedance</p> <p>hi bytedance</p>
|
|
253
|
+
</article>
|
|
254
|
+
}
|
|
255
|
+
position="bottom"
|
|
256
|
+
visible
|
|
257
|
+
trigger="custom"
|
|
258
|
+
getPopupContainer={() => document.querySelector('.content-layer')}
|
|
259
|
+
>
|
|
260
|
+
<Tag>指定弹出层的容器</Tag>
|
|
261
|
+
{/* <div className='content'></div> */}
|
|
262
|
+
</Tooltip>
|
|
263
|
+
<div>
|
|
264
|
+
<label>给定容器为window,看是否报错</label>
|
|
265
|
+
<Tooltip content={'单选'} position="top" getPopupContainer={() => window}>
|
|
266
|
+
<Radio style={{ display: 'inline-flex' }}>单选</Radio>
|
|
267
|
+
</Tooltip>
|
|
268
|
+
</div>
|
|
264
269
|
</div>
|
|
265
|
-
</div>
|
|
266
270
|
);
|
|
267
271
|
|
|
268
272
|
GetPopupContainerDemo.story = {
|
|
269
|
-
|
|
273
|
+
name: 'tooltip指定弹出层的容器',
|
|
270
274
|
};
|
|
271
275
|
|
|
272
276
|
export const TooltipAll = () => (
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
277
|
+
<div className="demo">
|
|
278
|
+
<ScrollDemo />
|
|
279
|
+
<div
|
|
280
|
+
style={{
|
|
281
|
+
padding: 120,
|
|
282
|
+
}}
|
|
283
|
+
>
|
|
284
|
+
<ScrollDemo
|
|
285
|
+
showArrow
|
|
286
|
+
tagStyle={{
|
|
287
|
+
height: 80,
|
|
288
|
+
}}
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
286
291
|
</div>
|
|
287
|
-
</div>
|
|
288
292
|
);
|
|
289
293
|
|
|
290
294
|
TooltipAll.story = {
|
|
291
|
-
|
|
295
|
+
name: 'tooltip All',
|
|
292
296
|
};
|
|
293
297
|
|
|
294
298
|
export const NoContent = () => (
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
299
|
+
<div className="demo">
|
|
300
|
+
<div
|
|
301
|
+
style={{
|
|
302
|
+
padding: 120,
|
|
303
|
+
}}
|
|
304
|
+
>
|
|
305
|
+
<ScrollDemo showArrow content={''} />
|
|
306
|
+
</div>
|
|
307
|
+
<div
|
|
308
|
+
style={{
|
|
309
|
+
padding: 120,
|
|
310
|
+
}}
|
|
311
|
+
>
|
|
312
|
+
<ScrollDemo
|
|
313
|
+
showArrow
|
|
314
|
+
tagStyle={{
|
|
315
|
+
minHeight: 80,
|
|
316
|
+
minWidth: 120,
|
|
317
|
+
}}
|
|
318
|
+
content={''}
|
|
319
|
+
/>
|
|
320
|
+
</div>
|
|
316
321
|
</div>
|
|
317
|
-
</div>
|
|
318
322
|
);
|
|
319
323
|
|
|
320
324
|
NoContent.story = {
|
|
321
|
-
|
|
325
|
+
name: 'no content',
|
|
322
326
|
};
|
|
323
327
|
|
|
324
328
|
export const AdjustPosition = () => (
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
329
|
+
<>
|
|
330
|
+
<div className="adjust">
|
|
331
|
+
<div className="wrapper">
|
|
332
|
+
第一个滚动区域
|
|
333
|
+
<Tooltip
|
|
334
|
+
content={
|
|
335
|
+
<article>
|
|
336
|
+
<p>hi bytedance</p>
|
|
337
|
+
<p>hi bytedance</p>
|
|
338
|
+
</article>
|
|
339
|
+
}
|
|
340
|
+
position="rightBottom"
|
|
341
|
+
trigger="click"
|
|
342
|
+
>
|
|
343
|
+
{/* <Tag className='topLeft'>topleft</Tag> */}
|
|
344
|
+
<div>test</div>
|
|
345
|
+
</Tooltip>
|
|
346
|
+
<Tooltip
|
|
347
|
+
content={
|
|
348
|
+
<article>
|
|
349
|
+
<p>hi bytedance</p>
|
|
350
|
+
<p>hi bytedance</p>
|
|
351
|
+
</article>
|
|
352
|
+
}
|
|
353
|
+
position="topRight"
|
|
354
|
+
trigger="click"
|
|
355
|
+
>
|
|
356
|
+
<Tag className="topRight">topRight</Tag>
|
|
357
|
+
</Tooltip>
|
|
358
|
+
<Tooltip
|
|
359
|
+
content={
|
|
360
|
+
<article>
|
|
361
|
+
<p>hi bytedance</p>
|
|
362
|
+
<p>hi bytedance</p>
|
|
363
|
+
</article>
|
|
364
|
+
}
|
|
365
|
+
position="bottomLeft"
|
|
366
|
+
trigger="click"
|
|
367
|
+
>
|
|
368
|
+
<Tag className="bottomLeft">bottomLeft</Tag>
|
|
369
|
+
</Tooltip>
|
|
370
|
+
<Tooltip
|
|
371
|
+
content={
|
|
372
|
+
<article>
|
|
373
|
+
<p>hi bytedance</p>
|
|
374
|
+
<p>hi bytedance</p>
|
|
375
|
+
</article>
|
|
376
|
+
}
|
|
377
|
+
position="bottomRight"
|
|
378
|
+
trigger="click"
|
|
379
|
+
>
|
|
380
|
+
<Tag className="bottomRight">bottomRight</Tag>
|
|
381
|
+
</Tooltip>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
<div className="adjust2">
|
|
385
|
+
<div className="wrapper2">第二个滚动区域</div>
|
|
386
|
+
</div>
|
|
387
|
+
</>
|
|
384
388
|
);
|
|
385
389
|
|
|
386
390
|
AdjustPosition.story = {
|
|
387
|
-
|
|
388
|
-
}
|
|
391
|
+
name: '自适应',
|
|
392
|
+
};
|
|
389
393
|
|
|
390
394
|
export const CompositeComponent = () => (
|
|
391
|
-
|
|
392
|
-
style={{
|
|
393
|
-
padding: 50,
|
|
394
|
-
}}
|
|
395
|
-
>
|
|
396
|
-
<Tooltip
|
|
397
|
-
content={
|
|
398
|
-
<article>
|
|
399
|
-
<p>hi bytedance</p> <p>hi bytedance</p>
|
|
400
|
-
</article>
|
|
401
|
-
}
|
|
402
|
-
position="top"
|
|
403
|
-
>
|
|
404
|
-
<IconList />
|
|
405
|
-
</Tooltip>
|
|
406
|
-
<Tooltip content={'收起'} position="top">
|
|
407
|
-
<IconButton icon={<IconSidebar />} />
|
|
408
|
-
</Tooltip>
|
|
409
|
-
<Tooltip content={'开关'} position="top">
|
|
410
|
-
<Switch />
|
|
411
|
-
</Tooltip>
|
|
412
|
-
<Tooltip content={'选择框'} position="top">
|
|
413
|
-
<Checkbox
|
|
414
|
-
style={{
|
|
415
|
-
display: 'inline-flex',
|
|
416
|
-
}}
|
|
417
|
-
>
|
|
418
|
-
选择框
|
|
419
|
-
</Checkbox>
|
|
420
|
-
</Tooltip>
|
|
421
|
-
<Tooltip content={'单选'} position="top">
|
|
422
|
-
<Radio
|
|
395
|
+
<div
|
|
423
396
|
style={{
|
|
424
|
-
|
|
397
|
+
padding: 50,
|
|
425
398
|
}}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
399
|
+
>
|
|
400
|
+
<Tooltip
|
|
401
|
+
content={
|
|
402
|
+
<article>
|
|
403
|
+
<p>hi bytedance</p> <p>hi bytedance</p>
|
|
404
|
+
</article>
|
|
405
|
+
}
|
|
406
|
+
position="top"
|
|
407
|
+
>
|
|
408
|
+
<IconList />
|
|
409
|
+
</Tooltip>
|
|
410
|
+
<Tooltip content={'收起'} position="top">
|
|
411
|
+
<IconButton icon={<IconSidebar />} />
|
|
412
|
+
</Tooltip>
|
|
413
|
+
<Tooltip content={'开关'} position="top">
|
|
414
|
+
<Switch />
|
|
415
|
+
</Tooltip>
|
|
416
|
+
<Tooltip content={'选择框'} position="top">
|
|
417
|
+
<Checkbox
|
|
418
|
+
style={{
|
|
419
|
+
display: 'inline-flex',
|
|
420
|
+
}}
|
|
421
|
+
>
|
|
422
|
+
选择框
|
|
423
|
+
</Checkbox>
|
|
424
|
+
</Tooltip>
|
|
425
|
+
<Tooltip content={'单选'} position="top">
|
|
426
|
+
<Radio
|
|
427
|
+
style={{
|
|
428
|
+
display: 'inline-flex',
|
|
429
|
+
}}
|
|
430
|
+
>
|
|
431
|
+
单选
|
|
432
|
+
</Radio>
|
|
433
|
+
</Tooltip>
|
|
434
|
+
</div>
|
|
431
435
|
);
|
|
432
436
|
|
|
433
437
|
CompositeComponent.story = {
|
|
434
|
-
|
|
435
|
-
}
|
|
438
|
+
name: '复合组件',
|
|
439
|
+
};
|
|
436
440
|
|
|
437
441
|
export const WrapDisabledElems = () => (
|
|
438
|
-
|
|
439
|
-
style={{
|
|
440
|
-
padding: 50,
|
|
441
|
-
}}
|
|
442
|
-
>
|
|
443
|
-
<Tooltip content="disabled">
|
|
444
|
-
<IconButton disabled icon={<IconEdit />} />
|
|
445
|
-
</Tooltip>
|
|
446
|
-
<Tooltip content="disabled">
|
|
447
|
-
<IconButton disabled icon={<IconEdit />} block />
|
|
448
|
-
</Tooltip>
|
|
449
|
-
<Tooltip content="disabled">
|
|
450
|
-
<Button disabled block>
|
|
451
|
-
编辑
|
|
452
|
-
</Button>
|
|
453
|
-
</Tooltip>
|
|
454
|
-
<Tooltip content="disabled">
|
|
455
|
-
<Button
|
|
456
|
-
disabled
|
|
442
|
+
<div
|
|
457
443
|
style={{
|
|
458
|
-
|
|
444
|
+
padding: 50,
|
|
459
445
|
}}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
446
|
+
>
|
|
447
|
+
<Tooltip content="disabled">
|
|
448
|
+
<IconButton disabled icon={<IconEdit />} />
|
|
449
|
+
</Tooltip>
|
|
450
|
+
<Tooltip content="disabled">
|
|
451
|
+
<IconButton disabled icon={<IconEdit />} block />
|
|
452
|
+
</Tooltip>
|
|
453
|
+
<Tooltip content="disabled">
|
|
454
|
+
<Button disabled block>
|
|
455
|
+
编辑
|
|
456
|
+
</Button>
|
|
457
|
+
</Tooltip>
|
|
458
|
+
<Tooltip content="disabled">
|
|
459
|
+
<Button
|
|
460
|
+
disabled
|
|
461
|
+
style={{
|
|
462
|
+
display: 'block',
|
|
463
|
+
}}
|
|
464
|
+
>
|
|
465
|
+
编辑
|
|
466
|
+
</Button>
|
|
467
|
+
</Tooltip>
|
|
468
|
+
</div>
|
|
465
469
|
);
|
|
466
470
|
|
|
467
471
|
WrapDisabledElems.story = {
|
|
468
|
-
|
|
472
|
+
name: 'wrap disabled elems',
|
|
469
473
|
};
|
|
470
474
|
|
|
471
475
|
export const InTable = () => (
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
476
|
+
<div
|
|
477
|
+
style={{
|
|
478
|
+
marginTop: 50,
|
|
479
|
+
}}
|
|
480
|
+
>
|
|
481
|
+
<InTableDemo />
|
|
482
|
+
</div>
|
|
479
483
|
);
|
|
480
484
|
|
|
481
485
|
InTable.story = {
|
|
482
|
-
|
|
486
|
+
name: 'in table',
|
|
483
487
|
};
|
|
484
488
|
|
|
485
489
|
export const _EdgeDemo = () => <EdgeDemo />;
|
|
486
490
|
|
|
487
491
|
_EdgeDemo.story = {
|
|
488
|
-
|
|
492
|
+
name: 'edge demo',
|
|
489
493
|
};
|
|
490
494
|
|
|
491
495
|
export const ScrollTooltipDemo = () => <ScrollTooltip />;
|
|
492
496
|
ScrollTooltipDemo.story = {
|
|
493
|
-
|
|
494
|
-
}
|
|
497
|
+
name: 'scroll demo and set popup container',
|
|
498
|
+
};
|
|
495
499
|
export const DangerousHtmlDemo = () => <DangerousHtml />;
|
|
496
500
|
DangerousHtmlDemo.story = {
|
|
497
|
-
|
|
498
|
-
}
|
|
501
|
+
name: 'in dangerous html',
|
|
502
|
+
};
|
|
499
503
|
export const ArrowPointAtCenterDemo = () => <ArrowPointAtCenter />;
|
|
500
504
|
ArrowPointAtCenterDemo.story = {
|
|
501
|
-
|
|
502
|
-
}
|
|
505
|
+
name: 'arrow point at center',
|
|
506
|
+
};
|
|
503
507
|
export const CustomContainerDemo = () => <CustomContainer />;
|
|
504
508
|
CustomContainerDemo.story = {
|
|
505
|
-
|
|
506
|
-
}
|
|
509
|
+
name: 'custom container',
|
|
510
|
+
};
|
|
507
511
|
export const ContainerPositionDemo = () => <ContainerPosition />;
|
|
508
512
|
ContainerPositionDemo.story = {
|
|
509
|
-
|
|
510
|
-
}
|
|
513
|
+
name: 'container observer',
|
|
514
|
+
};
|
|
511
515
|
|
|
512
516
|
export const QuickMoveMouse = () => {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
/**
|
|
518
|
+
* mouseEnterDelay, mouseLeaveDelay 默认都为 50
|
|
519
|
+
* mouseEnterDelay, mouseLeaveDelay 都为 0,快速滑动可能出现两个 tooltip 出现
|
|
520
|
+
*/
|
|
521
|
+
const Demo = () => {
|
|
522
|
+
const props = {
|
|
523
|
+
mouseEnterDelay: 50,
|
|
524
|
+
mouseLeaveDelay: 0,
|
|
525
|
+
};
|
|
526
|
+
return (
|
|
527
|
+
<div className="demo">
|
|
528
|
+
<div>
|
|
529
|
+
<Tooltip content={'1'} {...props}>
|
|
530
|
+
aaaaaaaaaaa
|
|
531
|
+
</Tooltip>
|
|
532
|
+
</div>
|
|
533
|
+
<div>
|
|
534
|
+
<Tooltip content={'2'} {...props}>
|
|
535
|
+
bbbbbbbbbbb
|
|
536
|
+
</Tooltip>
|
|
537
|
+
</div>
|
|
538
|
+
<div>
|
|
539
|
+
<Tooltip content={'3'} {...props}>
|
|
540
|
+
ccccccccccc
|
|
541
|
+
</Tooltip>
|
|
542
|
+
</div>
|
|
543
|
+
<div>
|
|
544
|
+
<Tooltip content={'4'} {...props}>
|
|
545
|
+
aaaaaaaaaaa
|
|
546
|
+
</Tooltip>
|
|
547
|
+
</div>
|
|
548
|
+
<div>
|
|
549
|
+
<Tooltip content={'5'} {...props}>
|
|
550
|
+
bbbbbbbbbbb
|
|
551
|
+
</Tooltip>
|
|
552
|
+
</div>
|
|
553
|
+
<div>
|
|
554
|
+
<Tooltip content={'6'} {...props}>
|
|
555
|
+
ccccccccccc
|
|
556
|
+
</Tooltip>
|
|
557
|
+
</div>
|
|
558
|
+
<div>
|
|
559
|
+
<Tooltip content={'7'} {...props}>
|
|
560
|
+
aaaaaaaaaaa
|
|
561
|
+
</Tooltip>
|
|
562
|
+
</div>
|
|
563
|
+
<div>
|
|
564
|
+
<Tooltip content={'8'} {...props}>
|
|
565
|
+
bbbbbbbbbbb
|
|
566
|
+
</Tooltip>
|
|
567
|
+
</div>
|
|
568
|
+
<div>
|
|
569
|
+
<Tooltip content={'9'} {...props}>
|
|
570
|
+
ccccccccccc
|
|
571
|
+
</Tooltip>
|
|
572
|
+
</div>
|
|
573
|
+
</div>
|
|
574
|
+
);
|
|
521
575
|
};
|
|
522
|
-
return (
|
|
523
|
-
<div className="demo">
|
|
524
|
-
<div>
|
|
525
|
-
<Tooltip content={'1'} {...props}>
|
|
526
|
-
aaaaaaaaaaa
|
|
527
|
-
</Tooltip>
|
|
528
|
-
</div>
|
|
529
|
-
<div>
|
|
530
|
-
<Tooltip content={'2'} {...props}>
|
|
531
|
-
bbbbbbbbbbb
|
|
532
|
-
</Tooltip>
|
|
533
|
-
</div>
|
|
534
|
-
<div>
|
|
535
|
-
<Tooltip content={'3'} {...props}>
|
|
536
|
-
ccccccccccc
|
|
537
|
-
</Tooltip>
|
|
538
|
-
</div>
|
|
539
|
-
<div>
|
|
540
|
-
<Tooltip content={'4'} {...props}>
|
|
541
|
-
aaaaaaaaaaa
|
|
542
|
-
</Tooltip>
|
|
543
|
-
</div>
|
|
544
|
-
<div>
|
|
545
|
-
<Tooltip content={'5'} {...props}>
|
|
546
|
-
bbbbbbbbbbb
|
|
547
|
-
</Tooltip>
|
|
548
|
-
</div>
|
|
549
|
-
<div>
|
|
550
|
-
<Tooltip content={'6'} {...props}>
|
|
551
|
-
ccccccccccc
|
|
552
|
-
</Tooltip>
|
|
553
|
-
</div>
|
|
554
|
-
<div>
|
|
555
|
-
<Tooltip content={'7'} {...props}>
|
|
556
|
-
aaaaaaaaaaa
|
|
557
|
-
</Tooltip>
|
|
558
|
-
</div>
|
|
559
|
-
<div>
|
|
560
|
-
<Tooltip content={'8'} {...props}>
|
|
561
|
-
bbbbbbbbbbb
|
|
562
|
-
</Tooltip>
|
|
563
|
-
</div>
|
|
564
|
-
<div>
|
|
565
|
-
<Tooltip content={'9'} {...props}>
|
|
566
|
-
ccccccccccc
|
|
567
|
-
</Tooltip>
|
|
568
|
-
</div>
|
|
569
|
-
</div>
|
|
570
|
-
);
|
|
571
|
-
};
|
|
572
576
|
|
|
573
|
-
|
|
577
|
+
return <Demo />;
|
|
574
578
|
};
|
|
575
579
|
|
|
576
580
|
QuickMoveMouse.story = {
|
|
577
|
-
|
|
578
|
-
}
|
|
581
|
+
name: '快速移动鼠标可见性',
|
|
582
|
+
};
|
|
579
583
|
|
|
580
584
|
export const MotionFalseFix1402 = () => {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
585
|
+
function Demo() {
|
|
586
|
+
const Test = React.forwardRef((props, ref) => (
|
|
587
|
+
<span {...props} ref={ref}>
|
|
588
|
+
Test
|
|
589
|
+
</span>
|
|
590
|
+
));
|
|
591
|
+
return (
|
|
592
|
+
<div>
|
|
593
|
+
<Tooltip content={'hi bytedance'} motion={false}>
|
|
594
|
+
<Test />
|
|
595
|
+
</Tooltip>
|
|
596
|
+
<br />
|
|
597
|
+
<br />
|
|
598
|
+
<Tooltip content={'hi bytedance'}>
|
|
599
|
+
<Test />
|
|
600
|
+
</Tooltip>
|
|
601
|
+
</div>
|
|
602
|
+
);
|
|
603
|
+
}
|
|
600
604
|
|
|
601
|
-
|
|
605
|
+
return <Demo />;
|
|
602
606
|
};
|
|
603
607
|
|
|
604
608
|
MotionFalseFix1402.story = {
|
|
605
|
-
|
|
609
|
+
name: 'motion=false fix #1402',
|
|
606
610
|
};
|
|
607
611
|
|
|
608
612
|
export const DisabledWrapperCls = () => (
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
613
|
+
<>
|
|
614
|
+
<Tooltip wrapperClassName="test" content={'hi bytedance'}>
|
|
615
|
+
<Button>按钮</Button>
|
|
616
|
+
</Tooltip>
|
|
617
|
+
<br />
|
|
618
|
+
<br />
|
|
619
|
+
<Tooltip wrapperClassName="test" content={'hi bytedance'}>
|
|
620
|
+
<Button disabled>禁用的单个按钮</Button>
|
|
621
|
+
</Tooltip>
|
|
622
|
+
<br />
|
|
623
|
+
<br />
|
|
624
|
+
<Tooltip wrapperClassName="test" content={'hi bytedance'}>
|
|
625
|
+
<Button>正常的多个按钮</Button>
|
|
626
|
+
<Button>正常的多个按钮</Button>
|
|
627
|
+
</Tooltip>
|
|
628
|
+
<br />
|
|
629
|
+
<br />
|
|
630
|
+
<Tooltip wrapperClassName="test" content={'hi bytedance'}>
|
|
631
|
+
<Select disabled placeholder="请选择业务线" style={{ width: 120 }}>
|
|
632
|
+
<Select.Option value="abc">抖音</Select.Option>
|
|
633
|
+
<Select.Option value="hotsoon">火山</Select.Option>
|
|
634
|
+
<Select.Option value="jianying" disabled>
|
|
635
|
+
剪映
|
|
636
|
+
</Select.Option>
|
|
637
|
+
<Select.Option value="xigua">西瓜视频</Select.Option>
|
|
638
|
+
</Select>
|
|
639
|
+
</Tooltip>
|
|
640
|
+
<br />
|
|
641
|
+
<br />
|
|
642
|
+
</>
|
|
639
643
|
);
|
|
640
644
|
|
|
641
645
|
DisabledWrapperCls.story = {
|
|
642
|
-
|
|
646
|
+
name: 'disabledWrapperCls',
|
|
643
647
|
};
|
|
644
648
|
|
|
645
649
|
export const ShowArrow = () => {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
650
|
+
function Demo() {
|
|
651
|
+
const Test = React.forwardRef((props, ref) => (
|
|
652
|
+
<Tag {...props} ref={ref}>
|
|
653
|
+
Test
|
|
654
|
+
</Tag>
|
|
655
|
+
));
|
|
656
|
+
return (
|
|
657
|
+
<div>
|
|
658
|
+
<h4>should show content and arrow when click</h4>
|
|
659
|
+
<Tooltip showArrow trigger="click" content={'hi bytedance'}>
|
|
660
|
+
<Test />
|
|
661
|
+
</Tooltip>
|
|
662
|
+
</div>
|
|
663
|
+
);
|
|
664
|
+
}
|
|
661
665
|
|
|
662
|
-
|
|
666
|
+
return <Demo />;
|
|
663
667
|
};
|
|
664
668
|
|
|
665
669
|
ShowArrow.story = {
|
|
666
|
-
|
|
670
|
+
name: 'showArrow',
|
|
667
671
|
};
|
|
668
672
|
|
|
669
673
|
export const OnClickOutSideDemo = () => {
|
|
@@ -671,20 +675,64 @@ export const OnClickOutSideDemo = () => {
|
|
|
671
675
|
let clickOutSide = () => {
|
|
672
676
|
console.log('clickOutSide');
|
|
673
677
|
setV(false);
|
|
674
|
-
}
|
|
678
|
+
};
|
|
675
679
|
return (
|
|
676
680
|
<>
|
|
677
|
-
<Tooltip onClickOutSide={() => clickOutSide()} content={'hi bytedance'} visible={v} trigger=
|
|
681
|
+
<Tooltip onClickOutSide={() => clickOutSide()} content={'hi bytedance'} visible={v} trigger="custom">
|
|
678
682
|
<Button onClick={() => setV(true)}>按钮</Button>
|
|
679
683
|
</Tooltip>
|
|
680
684
|
<br />
|
|
681
685
|
<br />
|
|
682
|
-
<Tooltip onClickOutSide={() => console.log('clickOutSide')} content={'hi bytedance'} trigger=
|
|
683
|
-
<Button
|
|
686
|
+
<Tooltip onClickOutSide={() => console.log('clickOutSide')} content={'hi bytedance'} trigger="click">
|
|
687
|
+
<Button>单个按钮</Button>
|
|
684
688
|
</Tooltip>
|
|
685
689
|
</>
|
|
686
690
|
);
|
|
687
|
-
}
|
|
691
|
+
};
|
|
688
692
|
OnClickOutSideDemo.story = {
|
|
689
693
|
name: 'OnClickOutSide',
|
|
690
|
-
};
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
export const AutoAdjustWithSpacing = () => {
|
|
697
|
+
const [height, setHeight] = useState(84);
|
|
698
|
+
const [key, setKey] = useState(1);
|
|
699
|
+
const initSpacing = 8;
|
|
700
|
+
const [spacing, setSpacing] = useState(initSpacing);
|
|
701
|
+
|
|
702
|
+
const change = (height, hasSpace) => {
|
|
703
|
+
setHeight(height);
|
|
704
|
+
hasSpace ? setSpacing(initSpacing) : setSpacing(0);
|
|
705
|
+
setKey(Math.random());
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
return (
|
|
709
|
+
<div className="demo1">
|
|
710
|
+
<div>
|
|
711
|
+
<Tooltip
|
|
712
|
+
motion={false}
|
|
713
|
+
rePosKey={key}
|
|
714
|
+
// spacing={spacing}
|
|
715
|
+
content={
|
|
716
|
+
<article style={{ boxSizing: 'border-box', height: height }}>
|
|
717
|
+
<p>hi bytedance, + padding 20</p>
|
|
718
|
+
<p>hi bytedance</p>
|
|
719
|
+
</article>
|
|
720
|
+
}
|
|
721
|
+
position="top"
|
|
722
|
+
trigger="custom"
|
|
723
|
+
visible={true}
|
|
724
|
+
>
|
|
725
|
+
<Tag>demo</Tag>
|
|
726
|
+
</Tooltip>
|
|
727
|
+
</div>
|
|
728
|
+
<div style={{ marginTop: 200 }}>
|
|
729
|
+
<Switch onChange={hasSpace => change(height, hasSpace)} checked={spacing === initSpacing ? true : false}></Switch>
|
|
730
|
+
<InputNumber onChange={height => change(Number(height))} value={height} style={{ width: 200 }} />
|
|
731
|
+
</div>
|
|
732
|
+
</div>
|
|
733
|
+
)
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
AutoAdjustWithSpacing.story = {
|
|
737
|
+
name: 'AutoAdjustWithSpacing',
|
|
738
|
+
};
|