@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
package/lib/cjs/table/Table.js
CHANGED
|
@@ -397,6 +397,7 @@ class Table extends _baseComponent.default {
|
|
|
397
397
|
const hasRowSelected = _this.foundation.hasRowSelected(selectedRowKeys, allRowKeysSet);
|
|
398
398
|
|
|
399
399
|
return /*#__PURE__*/_react.default.createElement(_ColumnSelection.default, {
|
|
400
|
+
"aria-label": "".concat(allIsSelected ? 'Deselect' : 'Select', " all rows"),
|
|
400
401
|
disabled: disabled,
|
|
401
402
|
key: columnKey,
|
|
402
403
|
selected: allIsSelected,
|
|
@@ -413,6 +414,7 @@ class Table extends _baseComponent.default {
|
|
|
413
414
|
const checkboxPropsFn = () => typeof getCheckboxProps === 'function' ? getCheckboxProps(record) : {};
|
|
414
415
|
|
|
415
416
|
return /*#__PURE__*/_react.default.createElement(_ColumnSelection.default, {
|
|
417
|
+
"aria-label": "".concat(selected ? 'Deselect' : 'Select', " this row"),
|
|
416
418
|
getCheckboxProps: checkboxPropsFn,
|
|
417
419
|
selected: selected,
|
|
418
420
|
onChange: (status, e) => _this.toggleSelectRow(status, key, e)
|
|
@@ -597,6 +599,7 @@ class Table extends _baseComponent.default {
|
|
|
597
599
|
/**
|
|
598
600
|
* render pagination
|
|
599
601
|
* @param {object} pagination
|
|
602
|
+
* @param {object} propRenderPagination
|
|
600
603
|
*/
|
|
601
604
|
|
|
602
605
|
|
|
@@ -900,7 +903,8 @@ class Table extends _baseComponent.default {
|
|
|
900
903
|
disabledRowKeysSet: new _set.default(),
|
|
901
904
|
headWidths: [],
|
|
902
905
|
bodyHasScrollBar: false,
|
|
903
|
-
prePropRowSelection: undefined
|
|
906
|
+
prePropRowSelection: undefined,
|
|
907
|
+
prePagination: undefined
|
|
904
908
|
};
|
|
905
909
|
this.rootWrapRef = /*#__PURE__*/(0, _react.createRef)();
|
|
906
910
|
this.wrapRef = /*#__PURE__*/(0, _react.createRef)(); // table's outside wrap
|
|
@@ -1138,7 +1142,8 @@ class Table extends _baseComponent.default {
|
|
|
1138
1142
|
rowSelection,
|
|
1139
1143
|
dataSource,
|
|
1140
1144
|
childrenRecordName,
|
|
1141
|
-
rowKey
|
|
1145
|
+
rowKey,
|
|
1146
|
+
pagination
|
|
1142
1147
|
} = props;
|
|
1143
1148
|
props.columns && props.children && _utils2.logger.warn('columns should not given by object and children at the same time');
|
|
1144
1149
|
|
|
@@ -1192,6 +1197,21 @@ class Table extends _baseComponent.default {
|
|
|
1192
1197
|
willUpdateStates.prePropRowSelection = rowSelection;
|
|
1193
1198
|
}
|
|
1194
1199
|
|
|
1200
|
+
if (pagination !== state.prePagination) {
|
|
1201
|
+
let newPagination = {};
|
|
1202
|
+
|
|
1203
|
+
if ((0, _isObject2.default)(state.pagination)) {
|
|
1204
|
+
newPagination = (0, _assign.default)((0, _assign.default)({}, newPagination), state.pagination);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
if ((0, _isObject2.default)(pagination)) {
|
|
1208
|
+
newPagination = (0, _assign.default)((0, _assign.default)({}, newPagination), pagination);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
willUpdateStates.pagination = newPagination;
|
|
1212
|
+
willUpdateStates.prePagination = pagination;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1195
1215
|
return willUpdateStates;
|
|
1196
1216
|
}
|
|
1197
1217
|
|
|
@@ -1207,15 +1227,16 @@ class Table extends _baseComponent.default {
|
|
|
1207
1227
|
|
|
1208
1228
|
componentDidUpdate(prevProps, prevState) {
|
|
1209
1229
|
const {
|
|
1210
|
-
pagination,
|
|
1211
1230
|
dataSource,
|
|
1212
1231
|
expandedRowKeys,
|
|
1213
1232
|
expandAllRows,
|
|
1214
1233
|
expandAllGroupRows,
|
|
1215
1234
|
virtualized,
|
|
1216
|
-
components
|
|
1235
|
+
components,
|
|
1236
|
+
pagination: propsPagination
|
|
1217
1237
|
} = this.props;
|
|
1218
1238
|
const {
|
|
1239
|
+
pagination: statePagination,
|
|
1219
1240
|
queries: stateQueries,
|
|
1220
1241
|
cachedColumns: stateCachedColumns,
|
|
1221
1242
|
cachedChildren: stateCachedChildren,
|
|
@@ -1259,11 +1280,6 @@ class Table extends _baseComponent.default {
|
|
|
1259
1280
|
this.foundation.initExpandedRowKeys({
|
|
1260
1281
|
groups: stateGroups
|
|
1261
1282
|
});
|
|
1262
|
-
} // Update pagination
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
if (pagination !== prevProps.pagination) {
|
|
1266
|
-
states.pagination = (0, _isObject2.default)(pagination) ? (0, _assign.default)({}, pagination) : pagination;
|
|
1267
1283
|
}
|
|
1268
1284
|
/**
|
|
1269
1285
|
* After dataSource is updated || (cachedColumns || cachedChildren updated)
|
|
@@ -1280,23 +1296,26 @@ class Table extends _baseComponent.default {
|
|
|
1280
1296
|
this.foundation.setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
1281
1297
|
states.dataSource = filteredSortedDataSource;
|
|
1282
1298
|
|
|
1283
|
-
if (pagination === prevProps.pagination) {
|
|
1284
|
-
states.pagination = (0, _isObject2.default)(pagination) ? (0, _assign.default)({}, pagination) : pagination;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
1299
|
if (this.props.groupBy) {
|
|
1288
1300
|
states.groups = null;
|
|
1289
1301
|
}
|
|
1302
|
+
} // when dataSource has change, should reset currentPage
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
if (dataSource !== prevProps.dataSource) {
|
|
1306
|
+
states.pagination = (0, _isObject2.default)(statePagination) ? (0, _assign.default)((0, _assign.default)({}, statePagination), {
|
|
1307
|
+
currentPage: (0, _isObject2.default)(propsPagination) && propsPagination.currentPage ? propsPagination.currentPage : 1
|
|
1308
|
+
}) : statePagination;
|
|
1290
1309
|
}
|
|
1291
1310
|
|
|
1292
1311
|
if ((0, _keys.default)(states).length) {
|
|
1293
1312
|
const {
|
|
1294
1313
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
1314
|
+
pagination: mergedStatePagination = null,
|
|
1295
1315
|
queries: stateQueries = null,
|
|
1296
|
-
pagination: statePagination = null,
|
|
1297
1316
|
dataSource: stateDataSource = null
|
|
1298
1317
|
} = states;
|
|
1299
|
-
const handledProps = this.foundation.getCurrentPageData(stateDataSource,
|
|
1318
|
+
const handledProps = this.foundation.getCurrentPageData(stateDataSource, mergedStatePagination, stateQueries); // After the pager is updated, reset allRowKeys of the current page
|
|
1300
1319
|
|
|
1301
1320
|
this.adapter.setAllRowKeys(handledProps.allRowKeys);
|
|
1302
1321
|
this.adapter.setDisabledRowKeys(handledProps.disabledRowKeys);
|
|
@@ -1468,6 +1487,7 @@ class Table extends _baseComponent.default {
|
|
|
1468
1487
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1469
1488
|
ref: this.rootWrapRef,
|
|
1470
1489
|
className: (0, _classnames.default)(className, "".concat(prefixCls, "-wrapper")),
|
|
1490
|
+
"data-column-fixed": anyColumnFixed,
|
|
1471
1491
|
style: wrapStyle,
|
|
1472
1492
|
id: id
|
|
1473
1493
|
}, /*#__PURE__*/_react.default.createElement(_TableContextProvider.default, (0, _assign.default)({}, tableContextValue), /*#__PURE__*/_react.default.createElement(_spin.default, {
|
|
@@ -31,6 +31,7 @@ export interface TableCellProps extends BaseProps {
|
|
|
31
31
|
selected?: boolean;
|
|
32
32
|
expanded?: boolean;
|
|
33
33
|
disabled?: boolean;
|
|
34
|
+
colIndex?: number;
|
|
34
35
|
}
|
|
35
36
|
export default class TableCell extends BaseComponent<TableCellProps, Record<string, any>> {
|
|
36
37
|
static contextType: React.Context<import("./table-context").TableContextProps>;
|
|
@@ -65,6 +66,7 @@ export default class TableCell extends BaseComponent<TableCellProps, Record<stri
|
|
|
65
66
|
height: PropTypes.Requireable<string | number>;
|
|
66
67
|
selected: PropTypes.Requireable<boolean>;
|
|
67
68
|
expanded: PropTypes.Requireable<boolean>;
|
|
69
|
+
colIndex: PropTypes.Requireable<number>;
|
|
68
70
|
};
|
|
69
71
|
get adapter(): TableCellAdapter;
|
|
70
72
|
ref: React.MutableRefObject<any>;
|
|
@@ -320,7 +320,8 @@ class TableCell extends _baseComponent.default {
|
|
|
320
320
|
fixedLeft,
|
|
321
321
|
fixedRight,
|
|
322
322
|
lastFixedLeft,
|
|
323
|
-
firstFixedRight
|
|
323
|
+
firstFixedRight,
|
|
324
|
+
colIndex
|
|
324
325
|
} = this.props;
|
|
325
326
|
const {
|
|
326
327
|
className
|
|
@@ -359,6 +360,8 @@ class TableCell extends _baseComponent.default {
|
|
|
359
360
|
["".concat(prefixCls, "-cell-fixed-right-first")]: firstFixedRight
|
|
360
361
|
});
|
|
361
362
|
return /*#__PURE__*/_react.default.createElement(BodyCell, (0, _assign.default)({
|
|
363
|
+
role: "gridcell",
|
|
364
|
+
"aria-colindex": colIndex + 1,
|
|
362
365
|
className: columnCls,
|
|
363
366
|
onClick: this.handleClick
|
|
364
367
|
}, newTdProps, {
|
|
@@ -400,5 +403,6 @@ TableCell.propTypes = {
|
|
|
400
403
|
width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
401
404
|
height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
402
405
|
selected: _propTypes.default.bool,
|
|
403
|
-
expanded: _propTypes.default.bool
|
|
406
|
+
expanded: _propTypes.default.bool,
|
|
407
|
+
colIndex: _propTypes.default.number
|
|
404
408
|
};
|
|
@@ -178,12 +178,18 @@ class TableHeaderRow extends _baseComponent.default {
|
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
return /*#__PURE__*/_react.default.createElement(HeaderCell, (0, _assign.default)({
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(HeaderCell, (0, _assign.default)({
|
|
182
|
+
role: "columnheader",
|
|
183
|
+
"aria-colindex": cellIndex + 1
|
|
184
|
+
}, props, {
|
|
182
185
|
style: cellStyle,
|
|
183
186
|
key: column.key || column.dataIndex || cellIndex
|
|
184
187
|
}));
|
|
185
188
|
});
|
|
186
|
-
return /*#__PURE__*/_react.default.createElement(HeaderRow, (0, _assign.default)({
|
|
189
|
+
return /*#__PURE__*/_react.default.createElement(HeaderRow, (0, _assign.default)({
|
|
190
|
+
role: "row",
|
|
191
|
+
"aria-rowindex": index + 1
|
|
192
|
+
}, rowProps, {
|
|
187
193
|
style: style,
|
|
188
194
|
ref: this.cacheRef
|
|
189
195
|
}), cells);
|
package/lib/cjs/tabs/TabBar.js
CHANGED
|
@@ -83,6 +83,8 @@ class TabBar extends _react.default.Component {
|
|
|
83
83
|
} = this.props;
|
|
84
84
|
const panelIcon = panel.icon ? this.renderIcon(panel.icon) : null;
|
|
85
85
|
const closableIcon = type === 'card' && panel.closable ? /*#__PURE__*/_react.default.createElement(_semiIcons.IconClose, {
|
|
86
|
+
"aria-label": "Close",
|
|
87
|
+
role: "button",
|
|
86
88
|
className: "".concat(_constants.cssClasses.TABS_TAB, "-icon-close"),
|
|
87
89
|
onClick: e => deleteTabItem(panel.itemKey, e)
|
|
88
90
|
}) : null;
|
|
@@ -95,16 +97,20 @@ class TabBar extends _react.default.Component {
|
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
const isSelected = this._isActive(key);
|
|
101
|
+
|
|
98
102
|
const className = (0, _classnames.default)(_constants.cssClasses.TABS_TAB, {
|
|
99
|
-
[_constants.cssClasses.TABS_TAB_ACTIVE]:
|
|
103
|
+
[_constants.cssClasses.TABS_TAB_ACTIVE]: isSelected,
|
|
100
104
|
[_constants.cssClasses.TABS_TAB_DISABLED]: panel.disabled,
|
|
101
105
|
["".concat(_constants.cssClasses.TABS_TAB, "-small")]: size === 'small',
|
|
102
106
|
["".concat(_constants.cssClasses.TABS_TAB, "-medium")]: size === 'medium'
|
|
103
107
|
});
|
|
104
108
|
return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
105
109
|
role: "tab",
|
|
110
|
+
id: "semiTab".concat(key),
|
|
111
|
+
"aria-controls": "semiTabPanel".concat(key),
|
|
106
112
|
"aria-disabled": panel.disabled ? 'true' : 'false',
|
|
107
|
-
"aria-selected":
|
|
113
|
+
"aria-selected": isSelected ? 'true' : 'false'
|
|
108
114
|
}, events, {
|
|
109
115
|
className: className,
|
|
110
116
|
key: this._getItemKey(key)
|
|
@@ -182,6 +188,7 @@ class TabBar extends _react.default.Component {
|
|
|
182
188
|
style: dropdownStyle,
|
|
183
189
|
trigger: 'hover'
|
|
184
190
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
191
|
+
role: "presentation",
|
|
185
192
|
className: arrowCls,
|
|
186
193
|
onClick: e => this.handleArrowClick(items, pos)
|
|
187
194
|
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
@@ -289,7 +296,8 @@ class TabBar extends _react.default.Component {
|
|
|
289
296
|
const extra = this.renderExtra();
|
|
290
297
|
const contents = collapsible ? this.renderCollapsedTab() : this.renderTabComponents(list);
|
|
291
298
|
return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
292
|
-
role: "
|
|
299
|
+
role: "tablist",
|
|
300
|
+
"aria-orientation": tabPosition === "left" ? "vertical" : "horizontal",
|
|
293
301
|
className: classNames,
|
|
294
302
|
style: style
|
|
295
303
|
}, (0, _getDataAttr.default)(restProps), {
|
package/lib/cjs/tabs/TabPane.js
CHANGED
|
@@ -132,7 +132,9 @@ class TabPane extends _react.PureComponent {
|
|
|
132
132
|
const shouldRender = this.shouldRender();
|
|
133
133
|
return /*#__PURE__*/_react.default.createElement("div", (0, _assign.default)({
|
|
134
134
|
ref: this.ref,
|
|
135
|
-
role: "
|
|
135
|
+
role: "tabpanel",
|
|
136
|
+
id: "semiTabPanel".concat(itemKey),
|
|
137
|
+
"aria-labelledby": "semiTab".concat(itemKey),
|
|
136
138
|
className: classNames,
|
|
137
139
|
style: style,
|
|
138
140
|
"aria-hidden": active ? 'false' : 'true'
|
package/lib/cjs/tabs/index.js
CHANGED
|
@@ -387,7 +387,6 @@ class Tabs extends _baseComponent.default {
|
|
|
387
387
|
}
|
|
388
388
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
389
389
|
ref: this.setContentRef,
|
|
390
|
-
role: "tab-content",
|
|
391
390
|
className: tabContentCls,
|
|
392
391
|
style: (0, _assign.default)({}, contentStyle)
|
|
393
392
|
}, content)));
|
|
@@ -40,8 +40,9 @@ export interface TagInputProps {
|
|
|
40
40
|
style?: React.CSSProperties;
|
|
41
41
|
suffix?: React.ReactNode;
|
|
42
42
|
validateStatus?: ValidateStatus;
|
|
43
|
-
value?: string[];
|
|
43
|
+
value?: string[] | undefined;
|
|
44
44
|
autoFocus?: boolean;
|
|
45
|
+
'aria-label'?: string;
|
|
45
46
|
}
|
|
46
47
|
export interface TagInputState {
|
|
47
48
|
tagsArray?: string[];
|
|
@@ -84,6 +85,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
84
85
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning">;
|
|
85
86
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
86
87
|
suffix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
88
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
87
89
|
};
|
|
88
90
|
static defaultProps: {
|
|
89
91
|
showClear: boolean;
|
|
@@ -118,6 +120,7 @@ declare class TagInput extends BaseComponent<TagInputProps, TagInputState> {
|
|
|
118
120
|
handleInputFocus: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
119
121
|
handleInputBlur: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
120
122
|
handleClearBtn: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
123
|
+
handleClearEnterPress: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
121
124
|
handleTagClose: (idx: number) => void;
|
|
122
125
|
handleInputMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
123
126
|
handleInputMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
@@ -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;
|
|
@@ -63,6 +69,7 @@ export declare type TimePickerProps = {
|
|
|
63
69
|
zIndex?: number | string;
|
|
64
70
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
65
71
|
onChange?: TimePickerAdapter['notifyChange'];
|
|
72
|
+
onChangeWithDateFirst?: boolean;
|
|
66
73
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
67
74
|
onOpenChange?: (open: boolean) => void;
|
|
68
75
|
};
|
|
@@ -83,6 +90,11 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
83
90
|
inputStyle: PropTypes.Requireable<object>;
|
|
84
91
|
panelHeader: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
85
92
|
panelFooter: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
93
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
94
|
+
'aria-invalid': PropTypes.Requireable<boolean>;
|
|
95
|
+
'aria-errormessage': PropTypes.Requireable<string>;
|
|
96
|
+
'aria-describedby': PropTypes.Requireable<string>;
|
|
97
|
+
'aria-required': PropTypes.Requireable<boolean>;
|
|
86
98
|
prefixCls: PropTypes.Requireable<string>;
|
|
87
99
|
clearText: PropTypes.Requireable<string>;
|
|
88
100
|
value: PropTypes.Requireable<string | number | string[] | number[] | Date | Date[]>;
|
|
@@ -124,6 +136,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
124
136
|
dateFnsLocale: PropTypes.Requireable<object>;
|
|
125
137
|
zIndex: PropTypes.Requireable<string | number>;
|
|
126
138
|
insetLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
139
|
+
insetLabelId: PropTypes.Requireable<string>;
|
|
127
140
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
128
141
|
type: PropTypes.Requireable<Type>;
|
|
129
142
|
rangeSeparator: PropTypes.Requireable<string>;
|
|
@@ -157,6 +170,7 @@ export default class TimePicker extends BaseComponent<TimePickerProps, TimePicke
|
|
|
157
170
|
onFocus: (...args: any[]) => void;
|
|
158
171
|
onBlur: (...args: any[]) => void;
|
|
159
172
|
onChange: (...args: any[]) => void;
|
|
173
|
+
onChangeWithDateFirst: boolean;
|
|
160
174
|
use12Hours: boolean;
|
|
161
175
|
focusOnOpen: boolean;
|
|
162
176
|
onKeyDown: (...args: any[]) => void;
|
|
@@ -183,9 +183,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
183
183
|
notifyOpenChange: function () {
|
|
184
184
|
return _this2.props.onOpenChange(...arguments);
|
|
185
185
|
},
|
|
186
|
-
notifyChange:
|
|
187
|
-
return _this2.props.onChange && _this2.props.onChange(...arguments);
|
|
188
|
-
},
|
|
186
|
+
notifyChange: (agr1, arg2) => this.props.onChange && this.props.onChange(agr1, arg2),
|
|
189
187
|
notifyFocus: function () {
|
|
190
188
|
return _this2.props.onFocus && _this2.props.onFocus(...arguments);
|
|
191
189
|
},
|
|
@@ -325,6 +323,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
325
323
|
zIndex,
|
|
326
324
|
getPopupContainer,
|
|
327
325
|
insetLabel,
|
|
326
|
+
insetLabelId,
|
|
328
327
|
inputStyle,
|
|
329
328
|
showClear,
|
|
330
329
|
panelHeader,
|
|
@@ -342,7 +341,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
342
341
|
motion,
|
|
343
342
|
autoAdjustOverflow
|
|
344
343
|
} = _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"]);
|
|
344
|
+
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
345
|
|
|
347
346
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
348
347
|
const position = this.foundation.getPosition();
|
|
@@ -370,6 +369,7 @@ class TimePicker extends _baseComponent.default {
|
|
|
370
369
|
value: inputValue,
|
|
371
370
|
onFocus: this.handleFocus,
|
|
372
371
|
insetLabel,
|
|
372
|
+
insetLabelId,
|
|
373
373
|
format,
|
|
374
374
|
locale,
|
|
375
375
|
localeCode,
|
|
@@ -421,6 +421,11 @@ class TimePicker extends _baseComponent.default {
|
|
|
421
421
|
exports.default = TimePicker;
|
|
422
422
|
TimePicker.contextType = _context3.default;
|
|
423
423
|
TimePicker.propTypes = (0, _assign.default)((0, _assign.default)({
|
|
424
|
+
'aria-labelledby': _propTypes.default.string,
|
|
425
|
+
'aria-invalid': _propTypes.default.bool,
|
|
426
|
+
'aria-errormessage': _propTypes.default.string,
|
|
427
|
+
'aria-describedby': _propTypes.default.string,
|
|
428
|
+
'aria-required': _propTypes.default.bool,
|
|
424
429
|
prefixCls: _propTypes.default.string,
|
|
425
430
|
clearText: _propTypes.default.string,
|
|
426
431
|
value: _TimeShape.TimeShape,
|
|
@@ -459,6 +464,7 @@ TimePicker.propTypes = (0, _assign.default)((0, _assign.default)({
|
|
|
459
464
|
dateFnsLocale: _propTypes.default.object,
|
|
460
465
|
zIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
461
466
|
insetLabel: _propTypes.default.node,
|
|
467
|
+
insetLabelId: _propTypes.default.string,
|
|
462
468
|
validateStatus: _propTypes.default.oneOf(_constants.strings.STATUS),
|
|
463
469
|
type: _propTypes.default.oneOf(_constants.strings.TYPES),
|
|
464
470
|
rangeSeparator: _propTypes.default.string,
|
|
@@ -495,6 +501,7 @@ TimePicker.defaultProps = (0, _assign.default)({
|
|
|
495
501
|
onFocus: _noop2.default,
|
|
496
502
|
onBlur: _noop2.default,
|
|
497
503
|
onChange: _noop2.default,
|
|
504
|
+
onChangeWithDateFirst: true,
|
|
498
505
|
use12Hours: false,
|
|
499
506
|
focusOnOpen: false,
|
|
500
507
|
onKeyDown: _noop2.default,
|
|
@@ -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>;
|
|
@@ -85,6 +91,7 @@ export default class LocaleTimePicker extends React.PureComponent<LocalePickerPr
|
|
|
85
91
|
onFocus: (...args: any[]) => void;
|
|
86
92
|
onBlur: (...args: any[]) => void;
|
|
87
93
|
onChange: (...args: any[]) => void;
|
|
94
|
+
onChangeWithDateFirst: boolean;
|
|
88
95
|
use12Hours: boolean;
|
|
89
96
|
focusOnOpen: boolean;
|
|
90
97
|
onKeyDown: (...args: any[]) => void;
|
|
@@ -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;
|