@douyinfe/semi-ui 2.2.0 → 2.3.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/__test__/datePicker.test.js +108 -0
- package/datePicker/_story/datePicker.stories.js +146 -2
- package/datePicker/datePicker.tsx +24 -0
- package/datePicker/monthsGrid.tsx +2 -1
- package/dist/css/semi.css +34 -7
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +2768 -1501
- 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/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 +25 -6
- package/inputNumber/_story/inputNumber.stories.js +12 -0
- package/inputNumber/index.tsx +33 -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 +22 -3
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGrid.js +2 -1
- package/lib/cjs/dropdown/dropdownItem.js +3 -1
- package/lib/cjs/dropdown/dropdownMenu.js +4 -1
- 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 +12 -1
- package/lib/cjs/inputNumber/index.d.ts +21 -12
- package/lib/cjs/inputNumber/index.js +37 -3
- 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/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 +31 -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 +12 -0
- package/lib/cjs/timePicker/TimePicker.js +9 -1
- package/lib/cjs/timePicker/index.d.ts +6 -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.d.ts +1 -1
- package/lib/cjs/transfer/index.js +35 -17
- 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 +44 -4
- 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 +22 -3
- package/lib/es/datePicker/monthsGrid.d.ts +1 -0
- package/lib/es/datePicker/monthsGrid.js +2 -1
- package/lib/es/dropdown/dropdownItem.js +3 -1
- package/lib/es/dropdown/dropdownMenu.js +4 -1
- 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 +12 -1
- package/lib/es/inputNumber/index.d.ts +21 -12
- package/lib/es/inputNumber/index.js +38 -3
- 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/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 +31 -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 +12 -0
- package/lib/es/timePicker/TimePicker.js +9 -1
- package/lib/es/timePicker/index.d.ts +6 -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.d.ts +1 -1
- package/lib/es/transfer/index.js +35 -17
- 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 +44 -4
- 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/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 +52 -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 +26 -13
- package/table/TableCell.tsx +11 -1
- package/table/TableHeaderRow.tsx +16 -2
- package/table/__test__/table.test.js +46 -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 +14 -1
- 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 +32 -28
- package/tree/_story/tree.stories.js +3 -3
- package/tree/index.tsx +10 -2
- package/tree/treeNode.tsx +46 -10
- 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
|
@@ -78,6 +78,10 @@ class TagInput extends _baseComponent.default {
|
|
|
78
78
|
this.foundation.handleClearBtn(e);
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
+
this.handleClearEnterPress = e => {
|
|
82
|
+
this.foundation.handleClearEnterPress(e);
|
|
83
|
+
};
|
|
84
|
+
|
|
81
85
|
this.handleTagClose = idx => {
|
|
82
86
|
this.foundation.handleTagClose(idx);
|
|
83
87
|
};
|
|
@@ -105,8 +109,21 @@ class TagInput extends _baseComponent.default {
|
|
|
105
109
|
value,
|
|
106
110
|
inputValue
|
|
107
111
|
} = nextProps;
|
|
112
|
+
const {
|
|
113
|
+
tagsArray: prevTagsArray
|
|
114
|
+
} = prevState;
|
|
115
|
+
let tagsArray;
|
|
116
|
+
|
|
117
|
+
if ((0, _isArray2.default)(value)) {
|
|
118
|
+
tagsArray = value;
|
|
119
|
+
} else if ('value' in nextProps && !value) {
|
|
120
|
+
tagsArray = [];
|
|
121
|
+
} else {
|
|
122
|
+
tagsArray = prevTagsArray;
|
|
123
|
+
}
|
|
124
|
+
|
|
108
125
|
return {
|
|
109
|
-
tagsArray
|
|
126
|
+
tagsArray,
|
|
110
127
|
inputValue: (0, _isString2.default)(inputValue) ? inputValue : prevState.inputValue
|
|
111
128
|
};
|
|
112
129
|
}
|
|
@@ -184,8 +201,12 @@ class TagInput extends _baseComponent.default {
|
|
|
184
201
|
|
|
185
202
|
if (showClear) {
|
|
186
203
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
204
|
+
role: "button",
|
|
205
|
+
tabIndex: 0,
|
|
206
|
+
"aria-label": "Clear TagInput value",
|
|
187
207
|
className: clearCls,
|
|
188
|
-
onClick: e => this.handleClearBtn(e)
|
|
208
|
+
onClick: e => this.handleClearBtn(e),
|
|
209
|
+
onKeyPress: e => this.handleClearEnterPress(e)
|
|
189
210
|
}, /*#__PURE__*/_react.default.createElement(_semiIcons.IconClear, null));
|
|
190
211
|
}
|
|
191
212
|
|
|
@@ -338,6 +359,9 @@ class TagInput extends _baseComponent.default {
|
|
|
338
359
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
339
360
|
style: style,
|
|
340
361
|
className: tagInputCls,
|
|
362
|
+
"aria-disabled": disabled,
|
|
363
|
+
"aria-label": this.props['aria-label'],
|
|
364
|
+
"aria-invalid": validateStatus === 'error',
|
|
341
365
|
onMouseEnter: e => {
|
|
342
366
|
this.handleInputMouseEnter(e);
|
|
343
367
|
},
|
|
@@ -347,6 +371,7 @@ class TagInput extends _baseComponent.default {
|
|
|
347
371
|
}, this.renderPrefix(), /*#__PURE__*/_react.default.createElement("div", {
|
|
348
372
|
className: wrapperCls
|
|
349
373
|
}, this.renderTags(), /*#__PURE__*/_react.default.createElement(_input.default, {
|
|
374
|
+
"aria-label": 'input value',
|
|
350
375
|
ref: this.inputRef,
|
|
351
376
|
className: inputCls,
|
|
352
377
|
disabled: disabled,
|
|
@@ -403,7 +428,8 @@ TagInput.propTypes = {
|
|
|
403
428
|
size: _propTypes.default.oneOf(_constants.strings.SIZE_SET),
|
|
404
429
|
validateStatus: _propTypes.default.oneOf(_constants.strings.STATUS),
|
|
405
430
|
prefix: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
406
|
-
suffix: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node])
|
|
431
|
+
suffix: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
432
|
+
'aria-label': _propTypes.default.string
|
|
407
433
|
};
|
|
408
434
|
TagInput.defaultProps = {
|
|
409
435
|
showClear: false,
|
|
@@ -15,6 +15,11 @@ export interface Panel {
|
|
|
15
15
|
export declare type BaseValueType = string | number | Date;
|
|
16
16
|
export declare type Type = 'time' | 'timeRange';
|
|
17
17
|
export declare type TimePickerProps = {
|
|
18
|
+
'aria-describedby'?: React.AriaAttributes['aria-describedby'];
|
|
19
|
+
'aria-errormessage'?: React.AriaAttributes['aria-errormessage'];
|
|
20
|
+
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
21
|
+
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
22
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
18
23
|
autoAdjustOverflow?: boolean;
|
|
19
24
|
autoFocus?: boolean;
|
|
20
25
|
className?: string;
|
|
@@ -35,6 +40,7 @@ export declare type TimePickerProps = {
|
|
|
35
40
|
inputReadOnly?: boolean;
|
|
36
41
|
inputStyle?: React.CSSProperties;
|
|
37
42
|
insetLabel?: React.ReactNode;
|
|
43
|
+
insetLabelId?: string;
|
|
38
44
|
locale?: Locale['TimePicker'];
|
|
39
45
|
localeCode?: string;
|
|
40
46
|
minuteStep?: number;
|
|
@@ -83,6 +89,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
83
89
|
inputStyle: PropTypes.Requireable<object>;
|
|
84
90
|
panelHeader: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
85
91
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
92
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
93
|
+
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
94
|
+
'aria-errormessage': PropTypes.Requireable<string>;
|
|
95
|
+
'aria-describedby': PropTypes.Requireable<string>;
|
|
96
|
+
'aria-required': PropTypes.Requireable<boolean>;
|
|
86
97
|
prefixCls: PropTypes.Requireable<string>;
|
|
87
98
|
clearText: PropTypes.Requireable<string>;
|
|
88
99
|
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
@@ -124,6 +135,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
124
135
|
dateFnsLocale: PropTypes.Requireable<object>;
|
|
125
136
|
zIndex: PropTypes.Requireable<string | number>;
|
|
126
137
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
138
|
+
insetLabelId: PropTypes.Requireable<string>;
|
|
127
139
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
128
140
|
type: PropTypes.Requireable<Type>;
|
|
129
141
|
rangeSeparator: PropTypes.Requireable<string>;
|
|
@@ -325,6 +325,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
325
325
|
zIndex,
|
|
326
326
|
getPopupContainer,
|
|
327
327
|
insetLabel,
|
|
328
|
+
insetLabelId,
|
|
328
329
|
inputStyle,
|
|
329
330
|
showClear,
|
|
330
331
|
panelHeader,
|
|
@@ -342,7 +343,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
342
343
|
motion,
|
|
343
344
|
autoAdjustOverflow
|
|
344
345
|
} = _a,
|
|
345
|
-
rest = __rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
|
|
346
|
+
rest = __rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
|
|
346
347
|
|
|
347
348
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
348
349
|
const position = this.foundation.getPosition();
|
|
@@ -370,6 +371,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
370
371
|
value: inputValue,
|
|
371
372
|
onFocus: this.handleFocus,
|
|
372
373
|
insetLabel,
|
|
374
|
+
insetLabelId,
|
|
373
375
|
format,
|
|
374
376
|
locale,
|
|
375
377
|
localeCode,
|
|
@@ -421,6 +423,11 @@ class TimePicker extends _baseComponent.default {
|
|
|
421
423
|
exports.default = TimePicker;
|
|
422
424
|
TimePicker.contextType = _context3.default;
|
|
423
425
|
TimePicker.propTypes = (0, _assign.default)((0, _assign.default)({
|
|
426
|
+
'aria-labelledby': _propTypes.default.string,
|
|
427
|
+
'aria-invalid': _propTypes.default.bool,
|
|
428
|
+
'aria-errormessage': _propTypes.default.string,
|
|
429
|
+
'aria-describedby': _propTypes.default.string,
|
|
430
|
+
'aria-required': _propTypes.default.bool,
|
|
424
431
|
prefixCls: _propTypes.default.string,
|
|
425
432
|
clearText: _propTypes.default.string,
|
|
426
433
|
value: _TimeShape.TimeShape,
|
|
@@ -459,6 +466,7 @@ TimePicker.propTypes = (0, _assign.default)((0, _assign.default)({
|
|
|
459
466
|
dateFnsLocale: _propTypes.default.object,
|
|
460
467
|
zIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
461
468
|
insetLabel: _propTypes.default.node,
|
|
469
|
+
insetLabelId: _propTypes.default.string,
|
|
462
470
|
validateStatus: _propTypes.default.oneOf(_constants.strings.STATUS),
|
|
463
471
|
type: _propTypes.default.oneOf(_constants.strings.TYPES),
|
|
464
472
|
rangeSeparator: _propTypes.default.string,
|
|
@@ -11,6 +11,11 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
11
11
|
inputStyle: import("prop-types").Requireable<object>;
|
|
12
12
|
panelHeader: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
13
13
|
panelFooter: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
14
|
+
'aria-labelledby': import("prop-types").Requireable<string>;
|
|
15
|
+
'aria-invalid': import("prop-types").Requireable<boolean>;
|
|
16
|
+
'aria-errormessage': import("prop-types").Requireable<string>;
|
|
17
|
+
'aria-describedby': import("prop-types").Requireable<string>;
|
|
18
|
+
'aria-required': import("prop-types").Requireable<boolean>;
|
|
14
19
|
prefixCls: import("prop-types").Requireable<string>;
|
|
15
20
|
clearText: import("prop-types").Requireable<string>;
|
|
16
21
|
value: import("prop-types").Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
@@ -52,6 +57,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
52
57
|
dateFnsLocale: import("prop-types").Requireable<object>;
|
|
53
58
|
zIndex: import("prop-types").Requireable<string | number>;
|
|
54
59
|
insetLabel: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
60
|
+
insetLabelId: import("prop-types").Requireable<string>;
|
|
55
61
|
validateStatus: import("prop-types").Requireable<"default" | "error" | "warning" | "success">;
|
|
56
62
|
type: import("prop-types").Requireable<import("./TimePicker").Type>;
|
|
57
63
|
rangeSeparator: import("prop-types").Requireable<string>;
|
|
@@ -6,7 +6,7 @@ export { TimelineItemProps } from './item';
|
|
|
6
6
|
export interface Data extends TimelineItemProps {
|
|
7
7
|
content: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export interface TimelineProps {
|
|
9
|
+
export interface TimelineProps extends Pick<React.AriaAttributes, 'aria-label'> {
|
|
10
10
|
mode?: 'left' | 'right' | 'center' | 'alternate';
|
|
11
11
|
className?: string;
|
|
12
12
|
style?: React.CSSProperties;
|
|
@@ -123,6 +123,7 @@ class Timeline extends _react.PureComponent {
|
|
|
123
123
|
|
|
124
124
|
const items = childrenList || this.addClassName(children);
|
|
125
125
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
126
|
+
"aria-label": this.props['aria-label'],
|
|
126
127
|
style: style,
|
|
127
128
|
className: classString
|
|
128
129
|
}, items);
|
package/lib/cjs/timeline/item.js
CHANGED
|
@@ -67,9 +67,11 @@ class Item extends _react.PureComponent {
|
|
|
67
67
|
style: style,
|
|
68
68
|
onClick: onClick
|
|
69
69
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
-
className: "".concat(prefixCls, "-tail")
|
|
70
|
+
className: "".concat(prefixCls, "-tail"),
|
|
71
|
+
"aria-hidden": true
|
|
71
72
|
}), /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
72
|
-
className: dotCls
|
|
73
|
+
className: dotCls,
|
|
74
|
+
"aria-hidden": true
|
|
73
75
|
}, dotStyle), dot), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
76
|
className: "".concat(prefixCls, "-content")
|
|
75
77
|
}, children, extra && /*#__PURE__*/_react.default.createElement("div", {
|
package/lib/cjs/toast/toast.js
CHANGED
|
@@ -135,6 +135,8 @@ class Toast extends _baseComponent.default {
|
|
|
135
135
|
const btnTheme = 'borderless';
|
|
136
136
|
const btnSize = 'small';
|
|
137
137
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
138
|
+
role: 'alert',
|
|
139
|
+
"aria-label": "".concat(type ? type : 'default', " type"),
|
|
138
140
|
className: toastCls,
|
|
139
141
|
style: style,
|
|
140
142
|
onMouseEnter: this.clearCloseTimer,
|
|
@@ -37,6 +37,7 @@ const TriangleArrowVertical = props => {
|
|
|
37
37
|
restProps = __rest(props, ["className", "style"]);
|
|
38
38
|
|
|
39
39
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _assign.default)({
|
|
40
|
+
"aria-hidden": true,
|
|
40
41
|
className: className,
|
|
41
42
|
style: style
|
|
42
43
|
}, restProps, {
|
|
@@ -36,6 +36,7 @@ export interface TooltipProps extends BaseProps {
|
|
|
36
36
|
showArrow?: boolean | React.ReactNode;
|
|
37
37
|
zIndex?: number;
|
|
38
38
|
rePosKey?: string | number;
|
|
39
|
+
role?: string;
|
|
39
40
|
arrowBounding?: ArrowBounding;
|
|
40
41
|
transformFromCenter?: boolean;
|
|
41
42
|
arrowPointAtCenter?: boolean;
|
|
@@ -57,6 +58,8 @@ interface TooltipState {
|
|
|
57
58
|
isInsert: boolean;
|
|
58
59
|
placement: Position;
|
|
59
60
|
transitionStyle: Record<string, any>;
|
|
61
|
+
isPositionUpdated: boolean;
|
|
62
|
+
id: string;
|
|
60
63
|
}
|
|
61
64
|
export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
62
65
|
static contextType: React.Context<import("../configProvider/context").ContextValue>;
|
|
@@ -92,30 +95,32 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
92
95
|
transformFromCenter: PropTypes.Requireable<boolean>;
|
|
93
96
|
arrowPointAtCenter: PropTypes.Requireable<boolean>;
|
|
94
97
|
stopPropagation: PropTypes.Requireable<boolean>;
|
|
98
|
+
role: PropTypes.Requireable<string>;
|
|
95
99
|
wrapWhenSpecial: PropTypes.Requireable<boolean>;
|
|
96
100
|
};
|
|
97
101
|
static defaultProps: {
|
|
98
|
-
|
|
102
|
+
arrowBounding: {
|
|
103
|
+
readonly offsetX: 0;
|
|
104
|
+
readonly offsetY: 2;
|
|
105
|
+
readonly width: 24;
|
|
106
|
+
readonly height: 7;
|
|
107
|
+
};
|
|
108
|
+
autoAdjustOverflow: boolean;
|
|
99
109
|
arrowPointAtCenter: boolean;
|
|
100
|
-
wrapWhenSpecial: boolean;
|
|
101
|
-
motion: boolean;
|
|
102
|
-
zIndex: 1060;
|
|
103
110
|
trigger: string;
|
|
111
|
+
transformFromCenter: boolean;
|
|
104
112
|
position: string;
|
|
105
113
|
prefixCls: "semi-tooltip";
|
|
106
|
-
|
|
114
|
+
role: string;
|
|
107
115
|
mouseEnterDelay: 50;
|
|
108
116
|
mouseLeaveDelay: 50;
|
|
117
|
+
motion: boolean;
|
|
109
118
|
onVisibleChange: (...args: any[]) => void;
|
|
110
119
|
onClickOutSide: (...args: any[]) => void;
|
|
111
120
|
spacing: 8;
|
|
112
121
|
showArrow: boolean;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
readonly offsetY: 2;
|
|
116
|
-
readonly width: 24;
|
|
117
|
-
readonly height: 7;
|
|
118
|
-
};
|
|
122
|
+
wrapWhenSpecial: boolean;
|
|
123
|
+
zIndex: 1060;
|
|
119
124
|
};
|
|
120
125
|
eventManager: Event;
|
|
121
126
|
triggerEl: React.RefObject<unknown>;
|
|
@@ -135,7 +140,6 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
|
|
|
135
140
|
componentDidMount(): void;
|
|
136
141
|
componentWillUnmount(): void;
|
|
137
142
|
isSpecial: (elem: React.ReactNode | HTMLElement | any) => boolean | "disabled" | "loading";
|
|
138
|
-
willEnter: () => void;
|
|
139
143
|
didLeave: () => void;
|
|
140
144
|
/** for transition - end */
|
|
141
145
|
rePosition(): any;
|
package/lib/cjs/tooltip/index.js
CHANGED
|
@@ -22,6 +22,8 @@ var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-s
|
|
|
22
22
|
|
|
23
23
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
|
|
24
24
|
|
|
25
|
+
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
|
26
|
+
|
|
25
27
|
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
26
28
|
|
|
27
29
|
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
@@ -54,6 +56,8 @@ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/
|
|
|
54
56
|
|
|
55
57
|
var _constants2 = require("@douyinfe/semi-foundation/lib/cjs/tooltip/constants");
|
|
56
58
|
|
|
59
|
+
var _uuid = require("@douyinfe/semi-foundation/lib/cjs/utils/uuid");
|
|
60
|
+
|
|
57
61
|
require("@douyinfe/semi-foundation/lib/cjs/tooltip/tooltip.css");
|
|
58
62
|
|
|
59
63
|
var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
|
|
@@ -127,18 +131,11 @@ class Tooltip extends _baseComponent.default {
|
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
return false;
|
|
130
|
-
};
|
|
134
|
+
}; // willEnter = () => {
|
|
135
|
+
// this.foundation.calcPosition();
|
|
136
|
+
// this.setState({ visible: true });
|
|
137
|
+
// };
|
|
131
138
|
|
|
132
|
-
this.willEnter = () => {
|
|
133
|
-
this.foundation.calcPosition();
|
|
134
|
-
/**
|
|
135
|
-
* Dangerous: remove setState in motion fix #1379
|
|
136
|
-
* because togglePortalVisible callback function will use visible state to notifyVisibleChange
|
|
137
|
-
* if visible state is old value, then notifyVisibleChange function will not be called
|
|
138
|
-
* we should ensure that after calling togglePortalVisible, callback function can get right visible value
|
|
139
|
-
*/
|
|
140
|
-
// this.setState({ visible: true });
|
|
141
|
-
};
|
|
142
139
|
|
|
143
140
|
this.didLeave = () => {
|
|
144
141
|
this.adapter.unregisterClickOutsideHandler();
|
|
@@ -194,7 +191,9 @@ class Tooltip extends _baseComponent.default {
|
|
|
194
191
|
visible,
|
|
195
192
|
portalEventSet,
|
|
196
193
|
placement,
|
|
197
|
-
transitionState
|
|
194
|
+
transitionState,
|
|
195
|
+
id,
|
|
196
|
+
isPositionUpdated
|
|
198
197
|
} = this.state;
|
|
199
198
|
const {
|
|
200
199
|
prefixCls,
|
|
@@ -202,6 +201,7 @@ class Tooltip extends _baseComponent.default {
|
|
|
202
201
|
showArrow,
|
|
203
202
|
style,
|
|
204
203
|
motion,
|
|
204
|
+
role,
|
|
205
205
|
zIndex
|
|
206
206
|
} = this.props;
|
|
207
207
|
const {
|
|
@@ -217,9 +217,8 @@ class Tooltip extends _baseComponent.default {
|
|
|
217
217
|
const icon = this.renderIcon();
|
|
218
218
|
const portalInnerStyle = (0, _omit2.default)(containerStyle, motion ? ['transformOrigin'] : undefined);
|
|
219
219
|
const transformOrigin = (0, _get2.default)(containerStyle, 'transformOrigin');
|
|
220
|
-
const inner = motion ? /*#__PURE__*/_react.default.createElement(_TooltipStyledTransition.default, {
|
|
220
|
+
const inner = motion && isPositionUpdated ? /*#__PURE__*/_react.default.createElement(_TooltipStyledTransition.default, {
|
|
221
221
|
position: placement,
|
|
222
|
-
willEnter: this.willEnter,
|
|
223
222
|
didLeave: this.didLeave,
|
|
224
223
|
motion: motion
|
|
225
224
|
}, transitionState === 'enter' ? _ref => {
|
|
@@ -230,13 +229,13 @@ class Tooltip extends _baseComponent.default {
|
|
|
230
229
|
} = _ref;
|
|
231
230
|
return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
232
231
|
className: (0, _classnames.default)(className, animateCls),
|
|
233
|
-
style: (0, _assign.default)((0, _assign.default)((0, _assign.default)({
|
|
234
|
-
visibility: 'visible'
|
|
235
|
-
}, animateStyle), {
|
|
232
|
+
style: (0, _assign.default)((0, _assign.default)((0, _assign.default)({}, animateStyle), {
|
|
236
233
|
transformOrigin
|
|
237
234
|
}), style)
|
|
238
235
|
}, portalEventSet, animateEvents, {
|
|
239
|
-
|
|
236
|
+
role: role,
|
|
237
|
+
"x-placement": placement,
|
|
238
|
+
id: id
|
|
240
239
|
}), content, icon);
|
|
241
240
|
} : null) : /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
242
241
|
className: className
|
|
@@ -307,7 +306,10 @@ class Tooltip extends _baseComponent.default {
|
|
|
307
306
|
},
|
|
308
307
|
isInsert: false,
|
|
309
308
|
placement: props.position || 'top',
|
|
310
|
-
transitionStyle: {}
|
|
309
|
+
transitionStyle: {},
|
|
310
|
+
isPositionUpdated: false,
|
|
311
|
+
id: (0, _uuid.getUuidShort)() // auto generate id, will be used by children.aria-describedby & content.id, improve a11y
|
|
312
|
+
|
|
311
313
|
};
|
|
312
314
|
this.foundation = new _foundation.default(this.adapter);
|
|
313
315
|
this.eventManager = new _Event.default();
|
|
@@ -345,18 +347,16 @@ class Tooltip extends _baseComponent.default {
|
|
|
345
347
|
transitionState: 'enter',
|
|
346
348
|
containerStyle: (0, _assign.default)((0, _assign.default)({}, this.state.containerStyle), containerStyle)
|
|
347
349
|
}, () => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
* then portal can't hide because _togglePortalVisible(false) will found isVisible=false and nowVisible=false(bug here)
|
|
353
|
-
*/
|
|
354
|
-
this.eventManager.emit('portalInserted');
|
|
350
|
+
(0, _setTimeout2.default)(() => {
|
|
351
|
+
// waiting child component mounted
|
|
352
|
+
this.eventManager.emit('portalInserted');
|
|
353
|
+
}, 0);
|
|
355
354
|
});
|
|
356
355
|
},
|
|
357
356
|
removePortal: () => {
|
|
358
357
|
this.setState({
|
|
359
|
-
isInsert: false
|
|
358
|
+
isInsert: false,
|
|
359
|
+
isPositionUpdated: false
|
|
360
360
|
});
|
|
361
361
|
},
|
|
362
362
|
getEventName: () => ({
|
|
@@ -438,7 +438,8 @@ class Tooltip extends _baseComponent.default {
|
|
|
438
438
|
|
|
439
439
|
this.setState({
|
|
440
440
|
containerStyle: (0, _assign.default)((0, _assign.default)({}, this.state.containerStyle), style),
|
|
441
|
-
placement: position
|
|
441
|
+
placement: position,
|
|
442
|
+
isPositionUpdated: true
|
|
442
443
|
}, () => {
|
|
443
444
|
this.eventManager.emit('positionUpdated');
|
|
444
445
|
});
|
|
@@ -596,10 +597,13 @@ class Tooltip extends _baseComponent.default {
|
|
|
596
597
|
render() {
|
|
597
598
|
const {
|
|
598
599
|
isInsert,
|
|
599
|
-
triggerEventSet
|
|
600
|
+
triggerEventSet,
|
|
601
|
+
visible,
|
|
602
|
+
id
|
|
600
603
|
} = this.state;
|
|
601
604
|
const {
|
|
602
|
-
wrapWhenSpecial
|
|
605
|
+
wrapWhenSpecial,
|
|
606
|
+
role
|
|
603
607
|
} = this.props;
|
|
604
608
|
let {
|
|
605
609
|
children
|
|
@@ -626,13 +630,23 @@ class Tooltip extends _baseComponent.default {
|
|
|
626
630
|
children = this.wrapSpan(children);
|
|
627
631
|
this.isWrapped = true;
|
|
628
632
|
}
|
|
633
|
+
} // eslint-disable-next-line prefer-const
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
let ariaAttribute = {}; // Take effect when used by Popover component
|
|
637
|
+
|
|
638
|
+
if (role === 'dialog') {
|
|
639
|
+
ariaAttribute['aria-expanded'] = visible ? 'true' : 'false';
|
|
640
|
+
ariaAttribute['aria-haspopup'] = 'dialog';
|
|
641
|
+
ariaAttribute['aria-controls'] = id;
|
|
642
|
+
} else {
|
|
643
|
+
ariaAttribute['aria-describedby'] = id;
|
|
629
644
|
} // The incoming children is a single valid element, otherwise wrap a layer with span
|
|
630
645
|
|
|
631
646
|
|
|
632
|
-
const newChild = /*#__PURE__*/_react.default.cloneElement(children, (0, _assign.default)((0, _assign.default)((0, _assign.default)({}, children.props), this.mergeEvents(children.props, triggerEventSet)), {
|
|
647
|
+
const newChild = /*#__PURE__*/_react.default.cloneElement(children, (0, _assign.default)((0, _assign.default)((0, _assign.default)((0, _assign.default)({}, ariaAttribute), children.props), this.mergeEvents(children.props, triggerEventSet)), {
|
|
633
648
|
style: (0, _assign.default)((0, _assign.default)({}, (0, _get2.default)(children, 'props.style')), extraStyle),
|
|
634
|
-
className: (0, _classnames.default)((0, _get2.default)(children, 'props.className')
|
|
635
|
-
),
|
|
649
|
+
className: (0, _classnames.default)((0, _get2.default)(children, 'props.className')),
|
|
636
650
|
// to maintain refs with callback
|
|
637
651
|
ref: node => {
|
|
638
652
|
// Keep your own reference
|
|
@@ -688,24 +702,26 @@ Tooltip.propTypes = {
|
|
|
688
702
|
arrowPointAtCenter: _propTypes.default.bool,
|
|
689
703
|
stopPropagation: _propTypes.default.bool,
|
|
690
704
|
// private
|
|
705
|
+
role: _propTypes.default.string,
|
|
691
706
|
wrapWhenSpecial: _propTypes.default.bool // when trigger has special status such as "disabled" or "loading", wrap span
|
|
692
707
|
|
|
693
708
|
};
|
|
694
709
|
Tooltip.defaultProps = {
|
|
695
|
-
|
|
710
|
+
arrowBounding: _constants2.numbers.ARROW_BOUNDING,
|
|
711
|
+
autoAdjustOverflow: true,
|
|
696
712
|
arrowPointAtCenter: true,
|
|
697
|
-
wrapWhenSpecial: true,
|
|
698
|
-
motion: true,
|
|
699
|
-
zIndex: _constants2.numbers.DEFAULT_Z_INDEX,
|
|
700
713
|
trigger: 'hover',
|
|
714
|
+
transformFromCenter: true,
|
|
701
715
|
position: 'top',
|
|
702
716
|
prefixCls: prefix,
|
|
703
|
-
|
|
717
|
+
role: 'tooltip',
|
|
704
718
|
mouseEnterDelay: _constants2.numbers.MOUSE_ENTER_DELAY,
|
|
705
719
|
mouseLeaveDelay: _constants2.numbers.MOUSE_LEAVE_DELAY,
|
|
720
|
+
motion: true,
|
|
706
721
|
onVisibleChange: _noop2.default,
|
|
707
722
|
onClickOutSide: _noop2.default,
|
|
708
723
|
spacing: _constants2.numbers.SPACING,
|
|
709
724
|
showArrow: true,
|
|
710
|
-
|
|
725
|
+
wrapWhenSpecial: true,
|
|
726
|
+
zIndex: _constants2.numbers.DEFAULT_Z_INDEX
|
|
711
727
|
};
|
|
@@ -152,7 +152,7 @@ declare class Transfer extends BaseComponent<TransferProps, TransferState> {
|
|
|
152
152
|
renderHeader(headerConfig: HeaderConfig): JSX.Element;
|
|
153
153
|
renderLeftItem(item: ResolvedDataItem, index: number): React.ReactNode;
|
|
154
154
|
renderLeft(locale: Locale['Transfer']): React.ReactNode;
|
|
155
|
-
renderGroupTitle(group: GroupItem): JSX.Element;
|
|
155
|
+
renderGroupTitle(group: GroupItem, index: number): JSX.Element;
|
|
156
156
|
renderLeftTree(): JSX.Element;
|
|
157
157
|
renderLeftList(visibileItems: Array<ResolvedDataItem>): JSX.Element;
|
|
158
158
|
renderRightItem(item: ResolvedDataItem): React.ReactNode;
|
|
@@ -209,6 +209,8 @@ class Transfer extends _baseComponent.default {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
+
role: "search",
|
|
213
|
+
"aria-label": "Transfer filter",
|
|
212
214
|
className: "".concat(prefixcls, "-filter")
|
|
213
215
|
}, /*#__PURE__*/_react.default.createElement(_index2.default, (0, _assign.default)({
|
|
214
216
|
prefix: /*#__PURE__*/_react.default.createElement(_semiIcons.IconSearch, null),
|
|
@@ -276,6 +278,7 @@ class Transfer extends _baseComponent.default {
|
|
|
276
278
|
disabled: item.disabled || disabled,
|
|
277
279
|
className: leftItemCls,
|
|
278
280
|
checked: checked,
|
|
281
|
+
role: "listitem",
|
|
279
282
|
onChange: () => this.onSelectOrRemove(item)
|
|
280
283
|
}, item.label);
|
|
281
284
|
}
|
|
@@ -373,11 +376,11 @@ class Transfer extends _baseComponent.default {
|
|
|
373
376
|
}, inputCom, content);
|
|
374
377
|
}
|
|
375
378
|
|
|
376
|
-
renderGroupTitle(group) {
|
|
379
|
+
renderGroupTitle(group, index) {
|
|
377
380
|
const groupCls = (0, _classnames.default)("".concat(prefixcls, "-group-title"));
|
|
378
381
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
379
382
|
className: groupCls,
|
|
380
|
-
key:
|
|
383
|
+
key: "title-".concat(index)
|
|
381
384
|
}, group.title);
|
|
382
385
|
}
|
|
383
386
|
|
|
@@ -432,7 +435,7 @@ class Transfer extends _baseComponent.default {
|
|
|
432
435
|
// group content already insert
|
|
433
436
|
content.push(optionContent);
|
|
434
437
|
} else if (parentGroup) {
|
|
435
|
-
const groupContent = this.renderGroupTitle(parentGroup);
|
|
438
|
+
const groupContent = this.renderGroupTitle(parentGroup, index);
|
|
436
439
|
groupStatus.set(parentGroup.title, true);
|
|
437
440
|
content.push(groupContent);
|
|
438
441
|
content.push(optionContent);
|
|
@@ -441,7 +444,9 @@ class Transfer extends _baseComponent.default {
|
|
|
441
444
|
}
|
|
442
445
|
});
|
|
443
446
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
444
|
-
className: "".concat(prefixcls, "-left-list")
|
|
447
|
+
className: "".concat(prefixcls, "-left-list"),
|
|
448
|
+
role: "list",
|
|
449
|
+
"aria-label": "Option list"
|
|
445
450
|
}, content);
|
|
446
451
|
}
|
|
447
452
|
|
|
@@ -479,19 +484,27 @@ class Transfer extends _baseComponent.default {
|
|
|
479
484
|
}
|
|
480
485
|
|
|
481
486
|
const DragHandle = (0, _reactSortableHoc.SortableHandle)(() => /*#__PURE__*/_react.default.createElement(_semiIcons.IconHandle, {
|
|
487
|
+
role: "button",
|
|
488
|
+
"aria-label": "Drag and sort",
|
|
482
489
|
className: "".concat(prefixcls, "-right-item-drag-handler")
|
|
483
490
|
}));
|
|
484
|
-
return
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
})
|
|
494
|
-
|
|
491
|
+
return (
|
|
492
|
+
/*#__PURE__*/
|
|
493
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
494
|
+
_react.default.createElement("div", {
|
|
495
|
+
role: "listitem",
|
|
496
|
+
className: rightItemCls,
|
|
497
|
+
key: newItem.key
|
|
498
|
+
}, draggable ? /*#__PURE__*/_react.default.createElement(DragHandle, null) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
499
|
+
className: "".concat(prefixcls, "-right-item-text")
|
|
500
|
+
}, label), /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
|
|
501
|
+
onClick: onRemove,
|
|
502
|
+
"aria-disabled": item.disabled,
|
|
503
|
+
className: (0, _classnames.default)("".concat(prefixcls, "-item-close-icon"), {
|
|
504
|
+
["".concat(prefixcls, "-item-close-icon-disabled")]: item.disabled
|
|
505
|
+
})
|
|
506
|
+
}))
|
|
507
|
+
);
|
|
495
508
|
}
|
|
496
509
|
|
|
497
510
|
renderEmpty(type, emptyText) {
|
|
@@ -501,6 +514,7 @@ class Transfer extends _baseComponent.default {
|
|
|
501
514
|
["".concat(prefixcls, "-left-empty")]: type === 'left'
|
|
502
515
|
});
|
|
503
516
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
517
|
+
"aria-label": "empty",
|
|
504
518
|
className: emptyCls
|
|
505
519
|
}, emptyText);
|
|
506
520
|
}
|
|
@@ -513,7 +527,9 @@ class Transfer extends _baseComponent.default {
|
|
|
513
527
|
items
|
|
514
528
|
} = _ref;
|
|
515
529
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
516
|
-
className: "".concat(prefixcls, "-right-list")
|
|
530
|
+
className: "".concat(prefixcls, "-right-list"),
|
|
531
|
+
role: "list",
|
|
532
|
+
"aria-label": "Selected list"
|
|
517
533
|
}, (0, _map2.default)(items).call(items, (item, index) =>
|
|
518
534
|
/*#__PURE__*/
|
|
519
535
|
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
@@ -583,7 +599,9 @@ class Transfer extends _baseComponent.default {
|
|
|
583
599
|
|
|
584
600
|
case selectedData.length && !draggable:
|
|
585
601
|
const list = /*#__PURE__*/_react.default.createElement("div", {
|
|
586
|
-
className: "".concat(prefixcls, "-right-list")
|
|
602
|
+
className: "".concat(prefixcls, "-right-list"),
|
|
603
|
+
role: "list",
|
|
604
|
+
"aria-label": "Selected list"
|
|
587
605
|
}, (0, _map2.default)(selectedData).call(selectedData, item => this.renderRightItem((0, _assign.default)({}, item))));
|
|
588
606
|
|
|
589
607
|
content = list;
|
package/lib/cjs/tree/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ declare class Tree extends BaseComponent<TreeProps, TreeState> {
|
|
|
70
70
|
onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
71
|
onDrop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
72
|
labelEllipsis: PropTypes.Requireable<boolean>;
|
|
73
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
73
74
|
};
|
|
74
75
|
static defaultProps: {
|
|
75
76
|
showClear: boolean;
|