@ucloud-fe/react-components 1.5.17 → 1.5.18
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/CHANGELOG.md +1935 -0
- package/dist/assets/ucicon.eot +0 -0
- package/dist/assets/ucicon.svg +1569 -0
- package/dist/assets/ucicon.ttf +0 -0
- package/dist/assets/ucicon.woff +0 -0
- package/dist/icon.min.css +1 -0
- package/dist/icon.min.js +1 -0
- package/dist/main.min.js +19 -0
- package/lib/__index.js +228 -0
- package/lib/components/ActionList/ActionList.d.ts +40 -0
- package/lib/components/ActionList/ActionList.js +349 -0
- package/lib/components/ActionList/index.d.ts +10 -0
- package/lib/components/ActionList/index.js +23 -0
- package/lib/components/ActionList/style/index.d.ts +3 -0
- package/lib/components/ActionList/style/index.js +45 -0
- package/lib/components/AutoComplete/AutoComplete.d.ts +40 -0
- package/lib/components/AutoComplete/AutoComplete.js +181 -0
- package/lib/components/AutoComplete/Popup.d.ts +19 -0
- package/lib/components/AutoComplete/Popup.js +123 -0
- package/lib/components/AutoComplete/index.d.ts +2 -0
- package/lib/components/AutoComplete/index.js +13 -0
- package/lib/components/AutoComplete/style/index.d.ts +17 -0
- package/lib/components/AutoComplete/style/index.js +55 -0
- package/lib/components/Badge/Badge.d.ts +43 -0
- package/lib/components/Badge/Badge.js +175 -0
- package/lib/components/Badge/Bubble.d.ts +47 -0
- package/lib/components/Badge/Bubble.js +152 -0
- package/lib/components/Badge/index.d.ts +7 -0
- package/lib/components/Badge/index.js +20 -0
- package/lib/components/Badge/placements.d.ts +35 -0
- package/lib/components/Badge/placements.js +43 -0
- package/lib/components/Badge/style/index.d.ts +54 -0
- package/lib/components/Badge/style/index.js +143 -0
- package/lib/components/Box/Box.d.ts +47 -0
- package/lib/components/Box/Box.js +135 -0
- package/lib/components/Box/index.d.ts +2 -0
- package/lib/components/Box/index.js +13 -0
- package/lib/components/Box/style/index.d.ts +1 -0
- package/lib/components/Box/style/index.js +136 -0
- package/lib/components/Breadcrumb/BackButton.d.ts +4 -0
- package/lib/components/Breadcrumb/BackButton.js +24 -0
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +10 -0
- package/lib/components/Breadcrumb/Breadcrumb.js +60 -0
- package/lib/components/Breadcrumb/Item.d.ts +16 -0
- package/lib/components/Breadcrumb/Item.js +62 -0
- package/lib/components/Breadcrumb/index.d.ts +11 -0
- package/lib/components/Breadcrumb/index.js +27 -0
- package/lib/components/Breadcrumb/interface.d.ts +2 -0
- package/lib/components/Breadcrumb/interface.js +11 -0
- package/lib/components/Breadcrumb/style/index.d.ts +20 -0
- package/lib/components/Breadcrumb/style/index.js +104 -0
- package/lib/components/Button/.recodo/interaction.js +64 -0
- package/lib/components/Button/Button.d.ts +54 -0
- package/lib/components/Button/Button.js +132 -0
- package/lib/components/Button/index.d.ts +2 -0
- package/lib/components/Button/index.js +13 -0
- package/lib/components/Button/shared.d.ts +3 -0
- package/lib/components/Button/shared.js +15 -0
- package/lib/components/Button/style/index.d.ts +22 -0
- package/lib/components/Button/style/index.js +240 -0
- package/lib/components/Calendar/Calendar.d.ts +37 -0
- package/lib/components/Calendar/Calendar.js +113 -0
- package/lib/components/Calendar/Cell.d.ts +8 -0
- package/lib/components/Calendar/Cell.js +55 -0
- package/lib/components/Calendar/HeaderButton.d.ts +8 -0
- package/lib/components/Calendar/HeaderButton.js +75 -0
- package/lib/components/Calendar/HeaderSwitcher.d.ts +17 -0
- package/lib/components/Calendar/HeaderSwitcher.js +64 -0
- package/lib/components/Calendar/Month.d.ts +5 -0
- package/lib/components/Calendar/Month.js +93 -0
- package/lib/components/Calendar/TwoSide.d.ts +4 -0
- package/lib/components/Calendar/TwoSide.js +155 -0
- package/lib/components/Calendar/index.d.ts +10 -0
- package/lib/components/Calendar/index.js +26 -0
- package/lib/components/Calendar/locale/en_US.js +30 -0
- package/lib/components/Calendar/locale/zh_CN.d.ts +11 -0
- package/lib/components/Calendar/locale/zh_CN.js +27 -0
- package/lib/components/Calendar/style/index.d.ts +25 -0
- package/lib/components/Calendar/style/index.js +82 -0
- package/lib/components/Calendar/utils.d.ts +16 -0
- package/lib/components/Calendar/utils.js +162 -0
- package/lib/components/Card/Action.js +27 -0
- package/lib/components/Card/Card.js +109 -0
- package/lib/components/Card/Content.js +28 -0
- package/lib/components/Card/Footer.js +28 -0
- package/lib/components/Card/Header.js +40 -0
- package/lib/components/Card/SubArea.js +43 -0
- package/lib/components/Card/index.js +30 -0
- package/lib/components/Card/style/index.js +131 -0
- package/lib/components/Cascader/Cascade.d.ts +24 -0
- package/lib/components/Cascader/Cascade.js +280 -0
- package/lib/components/Cascader/CascadeContext.d.ts +7 -0
- package/lib/components/Cascader/CascadeContext.js +20 -0
- package/lib/components/Cascader/Cascader.d.ts +41 -0
- package/lib/components/Cascader/Cascader.js +359 -0
- package/lib/components/Cascader/Item.d.ts +14 -0
- package/lib/components/Cascader/Item.js +97 -0
- package/lib/components/Cascader/Items.d.ts +11 -0
- package/lib/components/Cascader/Items.js +175 -0
- package/lib/components/Cascader/index.d.ts +2 -0
- package/lib/components/Cascader/index.js +13 -0
- package/lib/components/Cascader/interface.d.ts +12 -0
- package/lib/components/Cascader/interface.js +5 -0
- package/lib/components/Cascader/locale/en_US.js +11 -0
- package/lib/components/Cascader/locale/zh_CN.d.ts +5 -0
- package/lib/components/Cascader/locale/zh_CN.js +11 -0
- package/lib/components/Cascader/style/cascade.d.ts +15 -0
- package/lib/components/Cascader/style/cascade.js +55 -0
- package/lib/components/Cascader/style/index.d.ts +11 -0
- package/lib/components/Cascader/style/index.js +49 -0
- package/lib/components/Checkbox/.recodo/interaction.js +100 -0
- package/lib/components/Checkbox/Checkbox.d.ts +29 -0
- package/lib/components/Checkbox/Checkbox.js +177 -0
- package/lib/components/Checkbox/CheckboxContext.d.ts +8 -0
- package/lib/components/Checkbox/CheckboxContext.js +21 -0
- package/lib/components/Checkbox/CheckboxIcon.d.ts +7 -0
- package/lib/components/Checkbox/CheckboxIcon.js +42 -0
- package/lib/components/Checkbox/Group.d.ts +26 -0
- package/lib/components/Checkbox/Group.js +108 -0
- package/lib/components/Checkbox/index.d.ts +13 -0
- package/lib/components/Checkbox/index.js +28 -0
- package/lib/components/Checkbox/interface.d.ts +8 -0
- package/lib/components/Checkbox/interface.js +17 -0
- package/lib/components/Checkbox/style/index.d.ts +31 -0
- package/lib/components/Checkbox/style/index.js +81 -0
- package/lib/components/Col/index.js +14 -0
- package/lib/components/Collapse/Collapse.d.ts +19 -0
- package/lib/components/Collapse/Collapse.js +63 -0
- package/lib/components/Collapse/CollapseContext.d.ts +4 -0
- package/lib/components/Collapse/CollapseContext.js +17 -0
- package/lib/components/Collapse/Panel.d.ts +29 -0
- package/lib/components/Collapse/Panel.js +98 -0
- package/lib/components/Collapse/hooks.d.ts +29 -0
- package/lib/components/Collapse/hooks.js +103 -0
- package/lib/components/Collapse/index.d.ts +9 -0
- package/lib/components/Collapse/index.js +26 -0
- package/lib/components/Collapse/style/index.d.ts +6 -0
- package/lib/components/Collapse/style/index.js +39 -0
- package/lib/components/Combine/Combine.d.ts +19 -0
- package/lib/components/Combine/Combine.js +80 -0
- package/lib/components/Combine/index.d.ts +3 -0
- package/lib/components/Combine/index.js +13 -0
- package/lib/components/Combine/style/index.d.ts +6 -0
- package/lib/components/Combine/style/index.js +60 -0
- package/lib/components/Compact/Compact.js +108 -0
- package/lib/components/Compact/index.js +13 -0
- package/lib/components/Compact/style/index.js +16 -0
- package/lib/components/ConfigProvider/ConfigContext.d.ts +9 -0
- package/lib/components/ConfigProvider/ConfigContext.js +24 -0
- package/lib/components/ConfigProvider/ConfigProvider.d.ts +40 -0
- package/lib/components/ConfigProvider/ConfigProvider.js +75 -0
- package/lib/components/ConfigProvider/index.d.ts +4 -0
- package/lib/components/ConfigProvider/index.js +20 -0
- package/lib/components/DatePicker/DatePicker.d.ts +73 -0
- package/lib/components/DatePicker/DatePicker.js +168 -0
- package/lib/components/DatePicker/Footer.d.ts +23 -0
- package/lib/components/DatePicker/Footer.js +96 -0
- package/lib/components/DatePicker/Month.d.ts +5 -0
- package/lib/components/DatePicker/Month.js +88 -0
- package/lib/components/DatePicker/Range.d.ts +101 -0
- package/lib/components/DatePicker/Range.js +549 -0
- package/lib/components/DatePicker/index.d.ts +11 -0
- package/lib/components/DatePicker/index.js +23 -0
- package/lib/components/DatePicker/locale/en_US.js +26 -0
- package/lib/components/DatePicker/locale/zh_CN.d.ts +20 -0
- package/lib/components/DatePicker/locale/zh_CN.js +26 -0
- package/lib/components/DatePicker/style/index.d.ts +62 -0
- package/lib/components/DatePicker/style/index.js +193 -0
- package/lib/components/DatePicker/usePicker.d.ts +11 -0
- package/lib/components/DatePicker/usePicker.js +424 -0
- package/lib/components/DatePicker/useRangePicker.d.ts +18 -0
- package/lib/components/DatePicker/useRangePicker.js +111 -0
- package/lib/components/DatePicker/utils.d.ts +18 -0
- package/lib/components/DatePicker/utils.js +143 -0
- package/lib/components/Drawer/Drawer.js +252 -0
- package/lib/components/Drawer/index.js +13 -0
- package/lib/components/Drawer/style/index.js +82 -0
- package/lib/components/EditableList/EditableList.js +277 -0
- package/lib/components/EditableList/index.js +13 -0
- package/lib/components/EditableList/locale/en_US.js +10 -0
- package/lib/components/EditableList/locale/zh_CN.js +10 -0
- package/lib/components/EditableList/style/index.js +28 -0
- package/lib/components/EditableTable/EditableTable.js +227 -0
- package/lib/components/EditableTable/index.js +13 -0
- package/lib/components/EditableTable/style/index.js +60 -0
- package/lib/components/Form/ControllerContext.d.ts +5 -0
- package/lib/components/Form/ControllerContext.js +15 -0
- package/lib/components/Form/Form.js +95 -0
- package/lib/components/Form/Group.js +89 -0
- package/lib/components/Form/Item.d.ts +37 -0
- package/lib/components/Form/Item.js +243 -0
- package/lib/components/Form/ItemContext.d.ts +3 -0
- package/lib/components/Form/ItemContext.js +15 -0
- package/lib/components/Form/ItemPropsWrap.js +44 -0
- package/lib/components/Form/SubArea.js +48 -0
- package/lib/components/Form/index.js +22 -0
- package/lib/components/Form/style/index.d.ts +59 -0
- package/lib/components/Form/style/index.js +229 -0
- package/lib/components/Grid/Col.d.ts +16 -0
- package/lib/components/Grid/Col.js +51 -0
- package/lib/components/Grid/Row.d.ts +17 -0
- package/lib/components/Grid/Row.js +68 -0
- package/lib/components/Grid/index.d.ts +8 -0
- package/lib/components/Grid/index.js +30 -0
- package/lib/components/Grid/style/index.d.ts +2 -0
- package/lib/components/Grid/style/index.js +143 -0
- package/lib/components/Icon/Icon.d.ts +11 -0
- package/lib/components/Icon/Icon.js +65 -0
- package/lib/components/Icon/index.d.ts +2 -0
- package/lib/components/Icon/index.js +13 -0
- package/lib/components/Icon/style/index.d.ts +7 -0
- package/lib/components/Icon/style/index.js +34 -0
- package/lib/components/Input/.recodo/interaction.js +96 -0
- package/lib/components/Input/Input.d.ts +45 -0
- package/lib/components/Input/Input.js +173 -0
- package/lib/components/Input/Search.d.ts +8 -0
- package/lib/components/Input/Search.js +82 -0
- package/lib/components/Input/index.d.ts +12 -0
- package/lib/components/Input/index.js +37 -0
- package/lib/components/Input/style/index.d.ts +34 -0
- package/lib/components/Input/style/index.js +169 -0
- package/lib/components/Link/Button.d.ts +24 -0
- package/lib/components/Link/Button.js +114 -0
- package/lib/components/Link/Link.d.ts +9 -0
- package/lib/components/Link/Link.js +30 -0
- package/lib/components/Link/index.d.ts +9 -0
- package/lib/components/Link/index.js +20 -0
- package/lib/components/Link/style/index.d.ts +3 -0
- package/lib/components/Link/style/index.js +35 -0
- package/lib/components/Loading/Loading.d.ts +27 -0
- package/lib/components/Loading/Loading.js +108 -0
- package/lib/components/Loading/index.d.ts +2 -0
- package/lib/components/Loading/index.js +13 -0
- package/lib/components/Loading/style/index.d.ts +8 -0
- package/lib/components/Loading/style/index.js +89 -0
- package/lib/components/LocaleProvider/LocaleContext.d.ts +9 -0
- package/lib/components/LocaleProvider/LocaleContext.js +15 -0
- package/lib/components/LocaleProvider/LocaleProvider.d.ts +7 -0
- package/lib/components/LocaleProvider/LocaleProvider.js +44 -0
- package/lib/components/LocaleProvider/index.d.ts +12 -0
- package/lib/components/LocaleProvider/index.js +20 -0
- package/lib/components/LocaleProvider/locale/en_US.js +55 -0
- package/lib/components/LocaleProvider/locale/zh_CN.js +55 -0
- package/lib/components/LocaleProvider/localeConsumerDecorator.d.ts +11 -0
- package/lib/components/LocaleProvider/localeConsumerDecorator.js +78 -0
- package/lib/components/LocaleProvider/runtime.d.ts +4 -0
- package/lib/components/LocaleProvider/runtime.js +28 -0
- package/lib/components/LocaleProvider/useLocale.d.ts +6 -0
- package/lib/components/LocaleProvider/useLocale.js +44 -0
- package/lib/components/Menu/Item.d.ts +20 -0
- package/lib/components/Menu/Item.js +107 -0
- package/lib/components/Menu/Menu.d.ts +59 -0
- package/lib/components/Menu/Menu.js +386 -0
- package/lib/components/Menu/MenuContext.d.ts +8 -0
- package/lib/components/Menu/MenuContext.js +27 -0
- package/lib/components/Menu/SubMenu.d.ts +20 -0
- package/lib/components/Menu/SubMenu.js +128 -0
- package/lib/components/Menu/index.d.ts +19 -0
- package/lib/components/Menu/index.js +35 -0
- package/lib/components/Menu/locale/en_US.js +10 -0
- package/lib/components/Menu/locale/zh_CN.d.ts +4 -0
- package/lib/components/Menu/locale/zh_CN.js +10 -0
- package/lib/components/Menu/style/index.d.ts +36 -0
- package/lib/components/Menu/style/index.js +117 -0
- package/lib/components/Message/Message.js +158 -0
- package/lib/components/Message/MessageContainer.js +145 -0
- package/lib/components/Message/index.js +22 -0
- package/lib/components/Message/method.js +232 -0
- package/lib/components/Message/style/index.js +141 -0
- package/lib/components/Modal/Content.js +57 -0
- package/lib/components/Modal/Modal.js +287 -0
- package/lib/components/Modal/index.js +25 -0
- package/lib/components/Modal/locale/en_US.js +11 -0
- package/lib/components/Modal/locale/zh_CN.js +11 -0
- package/lib/components/Modal/method.js +436 -0
- package/lib/components/Modal/style/index.js +137 -0
- package/lib/components/Notice/Notice.d.ts +16 -0
- package/lib/components/Notice/Notice.js +126 -0
- package/lib/components/Notice/index.d.ts +16 -0
- package/lib/components/Notice/index.js +23 -0
- package/lib/components/Notice/style/index.d.ts +12 -0
- package/lib/components/Notice/style/index.js +90 -0
- package/lib/components/NumberInput/NumberInput.d.ts +149 -0
- package/lib/components/NumberInput/NumberInput.js +936 -0
- package/lib/components/NumberInput/index.d.ts +2 -0
- package/lib/components/NumberInput/index.js +13 -0
- package/lib/components/NumberInput/style/index.d.ts +9 -0
- package/lib/components/NumberInput/style/index.js +92 -0
- package/lib/components/Pagination/Options.js +205 -0
- package/lib/components/Pagination/Pager.js +65 -0
- package/lib/components/Pagination/Pagination.js +664 -0
- package/lib/components/Pagination/index.js +13 -0
- package/lib/components/Pagination/locale/en_US.js +23 -0
- package/lib/components/Pagination/locale/zh_CN.js +23 -0
- package/lib/components/Pagination/style/index.js +40 -0
- package/lib/components/PopConfirm/PopConfirm.d.ts +11 -0
- package/lib/components/PopConfirm/PopConfirm.js +119 -0
- package/lib/components/PopConfirm/index.d.ts +2 -0
- package/lib/components/PopConfirm/index.js +13 -0
- package/lib/components/PopConfirm/locale/en_US.js +11 -0
- package/lib/components/PopConfirm/locale/zh_CN.d.ts +5 -0
- package/lib/components/PopConfirm/locale/zh_CN.js +11 -0
- package/lib/components/PopConfirm/style/index.d.ts +10 -0
- package/lib/components/PopConfirm/style/index.js +70 -0
- package/lib/components/Popover/ContainerContext.d.ts +8 -0
- package/lib/components/Popover/ContainerContext.js +52 -0
- package/lib/components/Popover/Popover.d.ts +187 -0
- package/lib/components/Popover/Popover.js +380 -0
- package/lib/components/Popover/index.d.ts +3 -0
- package/lib/components/Popover/index.js +51 -0
- package/lib/components/Popover/placements.d.ts +183 -0
- package/lib/components/Popover/placements.js +96 -0
- package/lib/components/Popover/style/index.d.ts +17 -0
- package/lib/components/Popover/style/index.js +96 -0
- package/lib/components/Progress/Progress.js +95 -0
- package/lib/components/Progress/index.js +13 -0
- package/lib/components/Progress/style/index.js +75 -0
- package/lib/components/Radio/Button.js +30 -0
- package/lib/components/Radio/Card.d.ts +12 -0
- package/lib/components/Radio/Card.js +58 -0
- package/lib/components/Radio/Group.js +181 -0
- package/lib/components/Radio/Radio.js +380 -0
- package/lib/components/Radio/RadioIcon.d.ts +6 -0
- package/lib/components/Radio/RadioIcon.js +37 -0
- package/lib/components/Radio/Tag.js +30 -0
- package/lib/components/Radio/index.js +22 -0
- package/lib/components/Radio/style/index.d.ts +26 -0
- package/lib/components/Radio/style/index.js +260 -0
- package/lib/components/Row/index.js +14 -0
- package/lib/components/Select/Extra.d.ts +11 -0
- package/lib/components/Select/Extra.js +56 -0
- package/lib/components/Select/Group.d.ts +20 -0
- package/lib/components/Select/Group.js +46 -0
- package/lib/components/Select/Option.d.ts +24 -0
- package/lib/components/Select/Option.js +64 -0
- package/lib/components/Select/Overflow.d.ts +19 -0
- package/lib/components/Select/Overflow.js +114 -0
- package/lib/components/Select/Select.d.ts +126 -0
- package/lib/components/Select/Select.js +1452 -0
- package/lib/components/Select/SelectContext.d.ts +8 -0
- package/lib/components/Select/SelectContext.js +33 -0
- package/lib/components/Select/index.d.ts +21 -0
- package/lib/components/Select/index.js +27 -0
- package/lib/components/Select/locale/en_US.js +14 -0
- package/lib/components/Select/locale/zh_CN.d.ts +8 -0
- package/lib/components/Select/locale/zh_CN.js +14 -0
- package/lib/components/Select/style/index.d.ts +85 -0
- package/lib/components/Select/style/index.js +254 -0
- package/lib/components/Skeleton/Skeleton.d.ts +11 -0
- package/lib/components/Skeleton/Skeleton.js +64 -0
- package/lib/components/Skeleton/index.d.ts +2 -0
- package/lib/components/Skeleton/index.js +13 -0
- package/lib/components/Skeleton/style/index.d.ts +9 -0
- package/lib/components/Skeleton/style/index.js +41 -0
- package/lib/components/Slider/Slider.js +781 -0
- package/lib/components/Slider/index.js +13 -0
- package/lib/components/Slider/locale/en_US.js +19 -0
- package/lib/components/Slider/locale/zh_CN.js +19 -0
- package/lib/components/Slider/style/index.js +45 -0
- package/lib/components/Spin/Spin.js +29 -0
- package/lib/components/Spin/index.js +13 -0
- package/lib/components/Spin/style/index.js +18 -0
- package/lib/components/Steps/Link.js +71 -0
- package/lib/components/Steps/Step.js +80 -0
- package/lib/components/Steps/StepIcon.js +115 -0
- package/lib/components/Steps/Steps.js +147 -0
- package/lib/components/Steps/index.js +13 -0
- package/lib/components/Steps/style/index.js +141 -0
- package/lib/components/SvgIcon/SvgIcon.d.ts +29 -0
- package/lib/components/SvgIcon/SvgIcon.js +248 -0
- package/lib/components/SvgIcon/SvgIconWrap.d.ts +21 -0
- package/lib/components/SvgIcon/SvgIconWrap.js +83 -0
- package/lib/components/SvgIcon/icons/ArrowDown.d.ts +3 -0
- package/lib/components/SvgIcon/icons/ArrowDown.js +24 -0
- package/lib/components/SvgIcon/icons/ArrowLeft.d.ts +3 -0
- package/lib/components/SvgIcon/icons/ArrowLeft.js +25 -0
- package/lib/components/SvgIcon/icons/ArrowRight.d.ts +3 -0
- package/lib/components/SvgIcon/icons/ArrowRight.js +24 -0
- package/lib/components/SvgIcon/icons/ArrowUp.d.ts +3 -0
- package/lib/components/SvgIcon/icons/ArrowUp.js +24 -0
- package/lib/components/SvgIcon/icons/Calendar.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Calendar.js +23 -0
- package/lib/components/SvgIcon/icons/Circle.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Circle.js +25 -0
- package/lib/components/SvgIcon/icons/CircleCrossFill.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CircleCrossFill.js +23 -0
- package/lib/components/SvgIcon/icons/CircleMarkFill.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CircleMarkFill.js +23 -0
- package/lib/components/SvgIcon/icons/CircleYesMdFill.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CircleYesMdFill.js +23 -0
- package/lib/components/SvgIcon/icons/Clock.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Clock.js +23 -0
- package/lib/components/SvgIcon/icons/Cog.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Cog.js +24 -0
- package/lib/components/SvgIcon/icons/Cross.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Cross.js +23 -0
- package/lib/components/SvgIcon/icons/CrossBold.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CrossBold.js +23 -0
- package/lib/components/SvgIcon/icons/CrossCircle.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CrossCircle.js +23 -0
- package/lib/components/SvgIcon/icons/CrossCircleFilled.d.ts +3 -0
- package/lib/components/SvgIcon/icons/CrossCircleFilled.js +23 -0
- package/lib/components/SvgIcon/icons/DottedLineArrowRight.d.ts +3 -0
- package/lib/components/SvgIcon/icons/DottedLineArrowRight.js +23 -0
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.d.ts +3 -0
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.js +24 -0
- package/lib/components/SvgIcon/icons/DoubleArrowRight.d.ts +3 -0
- package/lib/components/SvgIcon/icons/DoubleArrowRight.js +24 -0
- package/lib/components/SvgIcon/icons/Dragger.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Dragger.js +23 -0
- package/lib/components/SvgIcon/icons/Ellipsis.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Ellipsis.js +23 -0
- package/lib/components/SvgIcon/icons/ExclamationCircleFilled.d.ts +3 -0
- package/lib/components/SvgIcon/icons/ExclamationCircleFilled.js +24 -0
- package/lib/components/SvgIcon/icons/Eye.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Eye.js +23 -0
- package/lib/components/SvgIcon/icons/Filter.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Filter.js +23 -0
- package/lib/components/SvgIcon/icons/Horz.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Horz.js +27 -0
- package/lib/components/SvgIcon/icons/InfoCircleFilled.d.ts +3 -0
- package/lib/components/SvgIcon/icons/InfoCircleFilled.js +24 -0
- package/lib/components/SvgIcon/icons/LineArrowDown.d.ts +3 -0
- package/lib/components/SvgIcon/icons/LineArrowDown.js +23 -0
- package/lib/components/SvgIcon/icons/LineArrowUp.d.ts +3 -0
- package/lib/components/SvgIcon/icons/LineArrowUp.js +23 -0
- package/lib/components/SvgIcon/icons/LoadingLIne.js +24 -0
- package/lib/components/SvgIcon/icons/LoadingLine.d.ts +3 -0
- package/lib/components/SvgIcon/icons/LoadingLine.js +24 -0
- package/lib/components/SvgIcon/icons/Minus.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Minus.js +24 -0
- package/lib/components/SvgIcon/icons/Plus.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Plus.js +23 -0
- package/lib/components/SvgIcon/icons/QuestionCircle.d.ts +3 -0
- package/lib/components/SvgIcon/icons/QuestionCircle.js +24 -0
- package/lib/components/SvgIcon/icons/Refresh.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Refresh.js +23 -0
- package/lib/components/SvgIcon/icons/RingLoading.d.ts +3 -0
- package/lib/components/SvgIcon/icons/RingLoading.js +23 -0
- package/lib/components/SvgIcon/icons/Search.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Search.js +23 -0
- package/lib/components/SvgIcon/icons/Sort.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Sort.js +23 -0
- package/lib/components/SvgIcon/icons/Tick.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Tick.js +23 -0
- package/lib/components/SvgIcon/icons/TickCircleFilled.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TickCircleFilled.js +23 -0
- package/lib/components/SvgIcon/icons/TickSmall.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TickSmall.js +23 -0
- package/lib/components/SvgIcon/icons/Trash.d.ts +3 -0
- package/lib/components/SvgIcon/icons/Trash.js +23 -0
- package/lib/components/SvgIcon/icons/TriangleDown.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TriangleDown.js +23 -0
- package/lib/components/SvgIcon/icons/TriangleLeft.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TriangleLeft.js +24 -0
- package/lib/components/SvgIcon/icons/TriangleRight.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TriangleRight.js +23 -0
- package/lib/components/SvgIcon/icons/TriangleUp.d.ts +3 -0
- package/lib/components/SvgIcon/icons/TriangleUp.js +23 -0
- package/lib/components/SvgIcon/index.d.ts +2 -0
- package/lib/components/SvgIcon/index.js +13 -0
- package/lib/components/SvgIcon/style/index.d.ts +1 -0
- package/lib/components/SvgIcon/style/index.js +35 -0
- package/lib/components/Switch/Switch.d.ts +19 -0
- package/lib/components/Switch/Switch.js +93 -0
- package/lib/components/Switch/index.d.ts +3 -0
- package/lib/components/Switch/index.js +15 -0
- package/lib/components/Switch/style/index.d.ts +16 -0
- package/lib/components/Switch/style/index.js +77 -0
- package/lib/components/Table/ActionList.js +14 -0
- package/lib/components/Table/ColumnConfigButton.js +267 -0
- package/lib/components/Table/DragWrap.d.ts +42 -0
- package/lib/components/Table/DragWrap.js +64 -0
- package/lib/components/Table/ExpandedRowContent.js +55 -0
- package/lib/components/Table/HoverDisplayArea.js +69 -0
- package/lib/components/Table/ResizableTH.js +214 -0
- package/lib/components/Table/SearchInput.js +69 -0
- package/lib/components/Table/Table.js +1808 -0
- package/lib/components/Table/TableRow.d.ts +9 -0
- package/lib/components/Table/TableRow.js +98 -0
- package/lib/components/Table/index.js +37 -0
- package/lib/components/Table/locale/en_US.js +23 -0
- package/lib/components/Table/locale/zh_CN.js +23 -0
- package/lib/components/Table/style/index.js +200 -0
- package/lib/components/Table/utils.js +53 -0
- package/lib/components/Tabs/Pane.d.ts +30 -0
- package/lib/components/Tabs/Pane.js +75 -0
- package/lib/components/Tabs/RefContext.d.ts +8 -0
- package/lib/components/Tabs/RefContext.js +33 -0
- package/lib/components/Tabs/TabBar.d.ts +13 -0
- package/lib/components/Tabs/TabBar.js +663 -0
- package/lib/components/Tabs/TabContent.d.ts +12 -0
- package/lib/components/Tabs/TabContent.js +77 -0
- package/lib/components/Tabs/Tabs.d.ts +27 -0
- package/lib/components/Tabs/Tabs.js +238 -0
- package/lib/components/Tabs/index.d.ts +23 -0
- package/lib/components/Tabs/index.js +28 -0
- package/lib/components/Tabs/shared.d.ts +12 -0
- package/lib/components/Tabs/shared.js +19 -0
- package/lib/components/Tabs/style/index.d.ts +6 -0
- package/lib/components/Tabs/style/index.js +67 -0
- package/lib/components/Tabs/utils.d.ts +5 -0
- package/lib/components/Tabs/utils.js +36 -0
- package/lib/components/Tag/Group.d.ts +16 -0
- package/lib/components/Tag/Group.js +68 -0
- package/lib/components/Tag/Icon.d.ts +33 -0
- package/lib/components/Tag/Icon.js +102 -0
- package/lib/components/Tag/Tag.d.ts +52 -0
- package/lib/components/Tag/Tag.js +132 -0
- package/lib/components/Tag/index.d.ts +8 -0
- package/lib/components/Tag/index.js +23 -0
- package/lib/components/Tag/style/index.d.ts +110 -0
- package/lib/components/Tag/style/index.js +241 -0
- package/lib/components/Textarea/Textarea.d.ts +12 -0
- package/lib/components/Textarea/Textarea.js +64 -0
- package/lib/components/Textarea/index.d.ts +2 -0
- package/lib/components/Textarea/index.js +13 -0
- package/lib/components/Textarea/style/index.d.ts +1 -0
- package/lib/components/Textarea/style/index.js +32 -0
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +21 -0
- package/lib/components/ThemeProvider/ThemeProvider.js +145 -0
- package/lib/components/ThemeProvider/dark.js +15 -0
- package/lib/components/ThemeProvider/designTokens.d.ts +269 -0
- package/lib/components/ThemeProvider/designTokens.js +543 -0
- package/lib/components/ThemeProvider/designTokensDark.d.ts +269 -0
- package/lib/components/ThemeProvider/designTokensDark.js +543 -0
- package/lib/components/ThemeProvider/green.js +9 -0
- package/lib/components/ThemeProvider/index.d.ts +2 -0
- package/lib/components/ThemeProvider/index.js +16 -0
- package/lib/components/ThemeProvider/material.js +20 -0
- package/lib/components/ThemeProvider/ocean.js +9 -0
- package/lib/components/ThemeProvider/runtime.d.ts +2 -0
- package/lib/components/ThemeProvider/runtime.js +30 -0
- package/lib/components/ThemeProvider/theme.d.ts +6 -0
- package/lib/components/ThemeProvider/theme.js +115 -0
- package/lib/components/ThemeProvider/useDesignTokens.d.ts +2 -0
- package/lib/components/ThemeProvider/useDesignTokens.js +26 -0
- package/lib/components/TimePicker/Time.d.ts +11 -0
- package/lib/components/TimePicker/Time.js +39 -0
- package/lib/components/TimePicker/TimePicker.d.ts +27 -0
- package/lib/components/TimePicker/TimePicker.js +282 -0
- package/lib/components/TimePicker/index.d.ts +2 -0
- package/lib/components/TimePicker/index.js +13 -0
- package/lib/components/TimePicker/locale/en_US.js +10 -0
- package/lib/components/TimePicker/locale/zh_CN.d.ts +4 -0
- package/lib/components/TimePicker/locale/zh_CN.js +10 -0
- package/lib/components/TimePicker/style/index.d.ts +14 -0
- package/lib/components/TimePicker/style/index.js +81 -0
- package/lib/components/TimePicker/util.d.ts +1 -0
- package/lib/components/TimePicker/util.js +49 -0
- package/lib/components/Tooltip/Tooltip.d.ts +13 -0
- package/lib/components/Tooltip/Tooltip.js +96 -0
- package/lib/components/Tooltip/index.d.ts +2 -0
- package/lib/components/Tooltip/index.js +13 -0
- package/lib/components/Tooltip/style/index.d.ts +19 -0
- package/lib/components/Tooltip/style/index.js +103 -0
- package/lib/components/Transfer/Transfer.js +578 -0
- package/lib/components/Transfer/index.js +13 -0
- package/lib/components/Transfer/locale/en_US.js +15 -0
- package/lib/components/Transfer/locale/zh_CN.js +15 -0
- package/lib/components/Transfer/style/index.js +55 -0
- package/lib/components/TransferMenu/TransferMenu.js +115 -0
- package/lib/components/TransferMenu/index.js +13 -0
- package/lib/components/TransferMenu/style/index.js +23 -0
- package/lib/components/TransferTable/TransferTable.js +148 -0
- package/lib/components/TransferTable/index.js +13 -0
- package/lib/components/TransferTable/style/index.js +38 -0
- package/lib/components/Tree/Item.d.ts +27 -0
- package/lib/components/Tree/Item.js +305 -0
- package/lib/components/Tree/Items.d.ts +14 -0
- package/lib/components/Tree/Items.js +105 -0
- package/lib/components/Tree/Tree.d.ts +49 -0
- package/lib/components/Tree/Tree.js +580 -0
- package/lib/components/Tree/TreeContext.d.ts +7 -0
- package/lib/components/Tree/TreeContext.js +18 -0
- package/lib/components/Tree/index.d.ts +4 -0
- package/lib/components/Tree/index.js +14 -0
- package/lib/components/Tree/interface.d.ts +19 -0
- package/lib/components/Tree/interface.js +5 -0
- package/lib/components/Tree/style/index.d.ts +22 -0
- package/lib/components/Tree/style/index.js +63 -0
- package/lib/components/Tree/util.d.ts +2 -0
- package/lib/components/Tree/util.js +44 -0
- package/lib/components/Upload/CardItem.js +214 -0
- package/lib/components/Upload/Dropzone.js +187 -0
- package/lib/components/Upload/Item.js +209 -0
- package/lib/components/Upload/List.js +200 -0
- package/lib/components/Upload/Progress.js +115 -0
- package/lib/components/Upload/Selector.js +152 -0
- package/lib/components/Upload/Thumbnail.js +110 -0
- package/lib/components/Upload/Upload.js +556 -0
- package/lib/components/Upload/icons/Archive.js +18 -0
- package/lib/components/Upload/icons/Docs.js +18 -0
- package/lib/components/Upload/icons/Dropzone.js +18 -0
- package/lib/components/Upload/icons/Image.js +18 -0
- package/lib/components/Upload/icons/PDF.js +18 -0
- package/lib/components/Upload/icons/Text.js +18 -0
- package/lib/components/Upload/icons/Unknown.js +18 -0
- package/lib/components/Upload/icons/Upload.js +18 -0
- package/lib/components/Upload/index.js +16 -0
- package/lib/components/Upload/locale/en_US.js +22 -0
- package/lib/components/Upload/locale/zh_CN.js +22 -0
- package/lib/components/Upload/style/index.js +177 -0
- package/lib/components/Upload/utils.js +143 -0
- package/lib/components/ZForm/ZForm.js +79 -0
- package/lib/components/ZForm/controllerDecorator.js +90 -0
- package/lib/components/ZForm/index.js +16 -0
- package/lib/config.d.ts +6 -0
- package/lib/config.js +28 -0
- package/lib/decorators/selectableWithStore/item.js +170 -0
- package/lib/decorators/selectableWithStore/store.js +424 -0
- package/lib/decorators/uncontrolled.d.ts +7 -0
- package/lib/decorators/uncontrolled.js +122 -0
- package/lib/hooks/group.d.ts +42 -0
- package/lib/hooks/group.js +403 -0
- package/lib/hooks/selectable.d.ts +22 -0
- package/lib/hooks/selectable.js +127 -0
- package/lib/hooks/useConfig.d.ts +2 -0
- package/lib/hooks/useConfig.js +30 -0
- package/lib/hooks/useConstructor.d.ts +2 -0
- package/lib/hooks/useConstructor.js +31 -0
- package/lib/hooks/useDidMount.d.ts +2 -0
- package/lib/hooks/useDidMount.js +34 -0
- package/lib/hooks/useInitial.d.ts +2 -0
- package/lib/hooks/useInitial.js +23 -0
- package/lib/hooks/useIsInitial.d.ts +2 -0
- package/lib/hooks/useIsInitial.js +40 -0
- package/lib/hooks/useOverflow.d.ts +24 -0
- package/lib/hooks/useOverflow.js +159 -0
- package/lib/hooks/usePopoverConfig.d.ts +27 -0
- package/lib/hooks/usePopoverConfig.js +78 -0
- package/lib/hooks/useSearch.d.ts +23 -0
- package/lib/hooks/useSearch.js +387 -0
- package/lib/hooks/useSimpleVirtualList.d.ts +6 -0
- package/lib/hooks/useSimpleVirtualList.js +128 -0
- package/lib/hooks/useUncontrolled.d.ts +4 -0
- package/lib/hooks/useUncontrolled.js +85 -0
- package/lib/hooks/useVirtualList.d.ts +6 -0
- package/lib/hooks/useVirtualList.js +196 -0
- package/lib/index.js +241 -0
- package/lib/interfaces/Color.js +9 -0
- package/lib/interfaces/Size.js +8 -0
- package/lib/libs/dom-align/adjustForViewport.js +55 -0
- package/lib/libs/dom-align/align/align.js +244 -0
- package/lib/libs/dom-align/align/alignElement.js +34 -0
- package/lib/libs/dom-align/align/alignPoint.js +67 -0
- package/lib/libs/dom-align/getAlignOffset.js +38 -0
- package/lib/libs/dom-align/getElFuturePos.js +23 -0
- package/lib/libs/dom-align/getOffsetParent.js +63 -0
- package/lib/libs/dom-align/getRegion.js +38 -0
- package/lib/libs/dom-align/getVisibleRectForElement.js +118 -0
- package/lib/libs/dom-align/index.js +27 -0
- package/lib/libs/dom-align/isAncestorFixed.js +34 -0
- package/lib/libs/dom-align/propertyUtils.js +138 -0
- package/lib/libs/dom-align/utils.js +657 -0
- package/lib/libs/rc-align/index.d.ts +42 -0
- package/lib/libs/rc-align/index.js +275 -0
- package/lib/libs/rc-align/util.d.ts +8 -0
- package/lib/libs/rc-align/util.js +67 -0
- package/lib/libs/rc-drawer/Drawer.js +831 -0
- package/lib/libs/rc-drawer/index.js +14 -0
- package/lib/libs/rc-drawer/utils.js +87 -0
- package/lib/libs/rc-table/BaseTable.d.ts +2 -0
- package/lib/libs/rc-table/BaseTable.js +221 -0
- package/lib/libs/rc-table/BodyTable.d.ts +18 -0
- package/lib/libs/rc-table/BodyTable.js +82 -0
- package/lib/libs/rc-table/ColGroup.d.ts +10 -0
- package/lib/libs/rc-table/ColGroup.js +47 -0
- package/lib/libs/rc-table/ColumnManager.d.ts +10 -0
- package/lib/libs/rc-table/ColumnManager.js +206 -0
- package/lib/libs/rc-table/ExpandIcon.d.ts +11 -0
- package/lib/libs/rc-table/ExpandIcon.js +65 -0
- package/lib/libs/rc-table/ExpandableRow.d.ts +2 -0
- package/lib/libs/rc-table/ExpandableRow.js +191 -0
- package/lib/libs/rc-table/ExpandableTable.d.ts +2 -0
- package/lib/libs/rc-table/ExpandableTable.js +304 -0
- package/lib/libs/rc-table/HeadTable.d.ts +18 -0
- package/lib/libs/rc-table/HeadTable.js +76 -0
- package/lib/libs/rc-table/Table.d.ts +81 -0
- package/lib/libs/rc-table/Table.js +452 -0
- package/lib/libs/rc-table/TableCell.d.ts +17 -0
- package/lib/libs/rc-table/TableCell.js +168 -0
- package/lib/libs/rc-table/TableHeader.d.ts +16 -0
- package/lib/libs/rc-table/TableHeader.js +109 -0
- package/lib/libs/rc-table/TableHeaderRow.d.ts +2 -0
- package/lib/libs/rc-table/TableHeaderRow.js +146 -0
- package/lib/libs/rc-table/TableRow.d.ts +2 -0
- package/lib/libs/rc-table/TableRow.js +301 -0
- package/lib/libs/rc-table/index.d.ts +2 -0
- package/lib/libs/rc-table/index.js +13 -0
- package/lib/libs/rc-table/utils.d.ts +7 -0
- package/lib/libs/rc-table/utils.js +117 -0
- package/lib/libs/rc-trigger/index.js +14 -0
- package/lib/libs/rc-trigger/src/LazyRenderBox.js +82 -0
- package/lib/libs/rc-trigger/src/Popup.js +383 -0
- package/lib/libs/rc-trigger/src/PopupInner.js +85 -0
- package/lib/libs/rc-trigger/src/index.js +867 -0
- package/lib/libs/rc-trigger/src/mock.js +33 -0
- package/lib/libs/rc-trigger/src/utils.js +48 -0
- package/lib/sharedComponents/InputWrap.d.ts +16 -0
- package/lib/sharedComponents/InputWrap.js +66 -0
- package/lib/sharedComponents/Search/Highlight.d.ts +5 -0
- package/lib/sharedComponents/Search/Highlight.js +20 -0
- package/lib/sharedComponents/Search/Search.d.ts +19 -0
- package/lib/sharedComponents/Search/Search.js +72 -0
- package/lib/sharedComponents/Search/SearchInput.d.ts +4 -0
- package/lib/sharedComponents/Search/SearchInput.js +51 -0
- package/lib/sharedComponents/Search/index.d.ts +5 -0
- package/lib/sharedComponents/Search/index.js +29 -0
- package/lib/sharedComponents/Search/locale/en_US.js +11 -0
- package/lib/sharedComponents/Search/locale/zh_CN.d.ts +5 -0
- package/lib/sharedComponents/Search/locale/zh_CN.js +11 -0
- package/lib/sharedComponents/Search/style.d.ts +14 -0
- package/lib/sharedComponents/Search/style.js +56 -0
- package/lib/sharedComponents/VirtualScrollList.d.ts +7 -0
- package/lib/sharedComponents/VirtualScrollList.js +68 -0
- package/lib/stores/SimpleStore.js +73 -0
- package/lib/style/animation.d.ts +17 -0
- package/lib/style/animation.js +49 -0
- package/lib/style/globalAnimation.d.ts +1 -0
- package/lib/style/globalAnimation.js +20 -0
- package/lib/style/index.d.ts +10 -0
- package/lib/style/index.js +114 -0
- package/lib/style/interface.d.ts +8 -0
- package/lib/style/interface.js +13 -0
- package/lib/style/sWrap.d.ts +18 -0
- package/lib/style/sWrap.js +110 -0
- package/lib/style/utils.d.ts +14 -0
- package/lib/style/utils.js +171 -0
- package/lib/type.d.ts +9 -0
- package/lib/type.js +118 -0
- package/lib/utils/KeyCode.d.ts +15 -0
- package/lib/utils/KeyCode.js +21 -0
- package/lib/utils/attrs.d.ts +5 -0
- package/lib/utils/attrs.js +39 -0
- package/lib/utils/checkStickySupport.d.ts +2 -0
- package/lib/utils/checkStickySupport.js +38 -0
- package/lib/utils/deprecatedLog.d.ts +2 -0
- package/lib/utils/deprecatedLog.js +27 -0
- package/lib/utils/each.d.ts +1 -0
- package/lib/utils/each.js +15 -0
- package/lib/utils/generateError.js +27 -0
- package/lib/utils/hoistStatics.d.ts +1 -0
- package/lib/utils/hoistStatics.js +14 -0
- package/lib/utils/isArray.d.ts +2 -0
- package/lib/utils/isArray.js +19 -0
- package/lib/utils/isEmpty.d.ts +2 -0
- package/lib/utils/isEmpty.js +26 -0
- package/lib/utils/isFirefox.d.ts +2 -0
- package/lib/utils/isFirefox.js +12 -0
- package/lib/utils/isFunction.d.ts +2 -0
- package/lib/utils/isFunction.js +20 -0
- package/lib/utils/isIE.d.ts +2 -0
- package/lib/utils/isIE.js +12 -0
- package/lib/utils/isNumber.d.ts +2 -0
- package/lib/utils/isNumber.js +19 -0
- package/lib/utils/isObject.d.ts +2 -0
- package/lib/utils/isObject.js +19 -0
- package/lib/utils/isSafari.d.ts +2 -0
- package/lib/utils/isSafari.js +10 -0
- package/lib/utils/memo.d.ts +2 -0
- package/lib/utils/memo.js +32 -0
- package/lib/utils/noop.d.ts +2 -0
- package/lib/utils/noop.js +20 -0
- package/lib/utils/once.d.ts +2 -0
- package/lib/utils/once.js +29 -0
- package/lib/utils/pick.d.ts +2 -0
- package/lib/utils/pick.js +29 -0
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/string.js +24 -0
- package/lib/utils/styledWrap.d.ts +22 -0
- package/lib/utils/styledWrap.js +98 -0
- package/lib/utils/typeMemo.d.ts +2 -0
- package/lib/utils/typeMemo.js +18 -0
- package/lib/utils/wait.d.ts +2 -0
- package/lib/utils/wait.js +23 -0
- package/lib/utils/warning.d.ts +4 -0
- package/lib/utils/warning.js +34 -0
- package/lib/utils/withProps.d.ts +3 -0
- package/lib/utils/withProps.js +86 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1808 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "prefixCls", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _style.prefixCls;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
exports.default = exports.TableContext = exports.placeholderKey = exports.deprecatedLogForOnRowSelect = void 0;
|
|
17
|
+
|
|
18
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
+
|
|
20
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
21
|
+
|
|
22
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
27
|
+
|
|
28
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
29
|
+
|
|
30
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
|
+
|
|
32
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
33
|
+
|
|
34
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
35
|
+
|
|
36
|
+
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
37
|
+
|
|
38
|
+
var _extend2 = _interopRequireDefault(require("lodash/extend"));
|
|
39
|
+
|
|
40
|
+
var _findLastIndex2 = _interopRequireDefault(require("lodash/findLastIndex"));
|
|
41
|
+
|
|
42
|
+
var _forEach2 = _interopRequireDefault(require("lodash/forEach"));
|
|
43
|
+
|
|
44
|
+
var _isEmpty2 = _interopRequireDefault(require("lodash/isEmpty"));
|
|
45
|
+
|
|
46
|
+
var _filter2 = _interopRequireDefault(require("lodash/filter"));
|
|
47
|
+
|
|
48
|
+
var _isString2 = _interopRequireDefault(require("lodash/isString"));
|
|
49
|
+
|
|
50
|
+
var _isNumber2 = _interopRequireDefault(require("lodash/isNumber"));
|
|
51
|
+
|
|
52
|
+
var _clone2 = _interopRequireDefault(require("lodash/clone"));
|
|
53
|
+
|
|
54
|
+
var _pick2 = _interopRequireDefault(require("lodash/pick"));
|
|
55
|
+
|
|
56
|
+
var _find2 = _interopRequireDefault(require("lodash/find"));
|
|
57
|
+
|
|
58
|
+
var _map2 = _interopRequireDefault(require("lodash/map"));
|
|
59
|
+
|
|
60
|
+
var _each2 = _interopRequireDefault(require("lodash/each"));
|
|
61
|
+
|
|
62
|
+
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
|
63
|
+
|
|
64
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
65
|
+
|
|
66
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
67
|
+
|
|
68
|
+
var _createReactContext = _interopRequireDefault(require("create-react-context"));
|
|
69
|
+
|
|
70
|
+
var _rcTable = _interopRequireDefault(require("../../libs/rc-table"));
|
|
71
|
+
|
|
72
|
+
var _deprecatedLog = _interopRequireDefault(require("../../utils/deprecatedLog"));
|
|
73
|
+
|
|
74
|
+
var _warning = _interopRequireWildcard(require("../../utils/warning"));
|
|
75
|
+
|
|
76
|
+
var _Pagination = _interopRequireDefault(require("../../components/Pagination"));
|
|
77
|
+
|
|
78
|
+
var _Notice = _interopRequireDefault(require("../../components/Notice"));
|
|
79
|
+
|
|
80
|
+
var _Checkbox = _interopRequireDefault(require("../../components/Checkbox"));
|
|
81
|
+
|
|
82
|
+
var _SvgIcon = _interopRequireDefault(require("../../components/SvgIcon"));
|
|
83
|
+
|
|
84
|
+
var _Radio = _interopRequireDefault(require("../../components/Radio"));
|
|
85
|
+
|
|
86
|
+
var _Select = _interopRequireDefault(require("../../components/Select"));
|
|
87
|
+
|
|
88
|
+
var _Tooltip = _interopRequireDefault(require("../../components/Tooltip"));
|
|
89
|
+
|
|
90
|
+
var _localeConsumerDecorator = _interopRequireDefault(require("../../components/LocaleProvider/localeConsumerDecorator"));
|
|
91
|
+
|
|
92
|
+
var _ContainerContext = require("../../components/Popover/ContainerContext");
|
|
93
|
+
|
|
94
|
+
var _style = require("./style");
|
|
95
|
+
|
|
96
|
+
var _zh_CN = _interopRequireDefault(require("./locale/zh_CN"));
|
|
97
|
+
|
|
98
|
+
var _DragWrap = _interopRequireDefault(require("./DragWrap"));
|
|
99
|
+
|
|
100
|
+
var _TableRow = _interopRequireDefault(require("./TableRow"));
|
|
101
|
+
|
|
102
|
+
var _ResizableTH = _interopRequireDefault(require("./ResizableTH"));
|
|
103
|
+
|
|
104
|
+
var _excluded = ["options", "multiple", "onChange"],
|
|
105
|
+
_excluded2 = ["pagination", "dataSource", "columns", "rowSelection", "onRowSelect", "contextMenu", "emptyContent", "errorContent", "className", "style", "expandedRowRender", "expandIconAsCell", "expandIconColumnIndex", "defaultExpandAllRows", "title", "footer", "columnResizable", "locale", "hideExpandIcon", "onRow", "components", "onExpand", "zebraCrossing", "columnPlaceholder", "tableLayout", "scroll", "customStyle", "dragSorting"];
|
|
106
|
+
|
|
107
|
+
var _this = void 0,
|
|
108
|
+
_dec,
|
|
109
|
+
_class,
|
|
110
|
+
_class2,
|
|
111
|
+
_temp;
|
|
112
|
+
|
|
113
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
114
|
+
|
|
115
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
116
|
+
|
|
117
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
118
|
+
|
|
119
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
120
|
+
|
|
121
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
122
|
+
|
|
123
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
124
|
+
|
|
125
|
+
var noop = function noop() {
|
|
126
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
127
|
+
}.bind(void 0);
|
|
128
|
+
|
|
129
|
+
var deprecatedLogForOnRowSelect = (0, _deprecatedLog.default)('Table onRowSelect', 'rowSelection.onChange');
|
|
130
|
+
exports.deprecatedLogForOnRowSelect = deprecatedLogForOnRowSelect;
|
|
131
|
+
var placeholderKey = 'table_column_width_placeholder';
|
|
132
|
+
exports.placeholderKey = placeholderKey;
|
|
133
|
+
var TableContext = (0, _createReactContext.default)();
|
|
134
|
+
exports.TableContext = TableContext;
|
|
135
|
+
|
|
136
|
+
var missingColumnKeyWarn = function missingColumnKeyWarn() {
|
|
137
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
138
|
+
return (0, _warning.default)('Table column need a unique key');
|
|
139
|
+
}.bind(void 0);
|
|
140
|
+
|
|
141
|
+
var dragSortingWarning = (0, _warning.onceWarning)("Can't use dragSorting with expandedRowRender or column.children");
|
|
142
|
+
var uid = 0;
|
|
143
|
+
var Table = (_dec = (0, _localeConsumerDecorator.default)({
|
|
144
|
+
defaultLocale: _zh_CN.default,
|
|
145
|
+
localeName: 'Table'
|
|
146
|
+
}), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
147
|
+
(0, _inherits2.default)(Table, _Component);
|
|
148
|
+
|
|
149
|
+
var _super = _createSuper(Table);
|
|
150
|
+
|
|
151
|
+
function Table(_props) {
|
|
152
|
+
var _this3 = this;
|
|
153
|
+
|
|
154
|
+
var _this2;
|
|
155
|
+
|
|
156
|
+
(0, _classCallCheck2.default)(this, Table);
|
|
157
|
+
_this2 = _super.call(this, _props);
|
|
158
|
+
|
|
159
|
+
_this2.check = function (props) {
|
|
160
|
+
var _this4 = this;
|
|
161
|
+
|
|
162
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
163
|
+
var columns = props.columns;
|
|
164
|
+
(0, _each2.default)(columns, function (column) {
|
|
165
|
+
(0, _newArrowCheck2.default)(this, _this4);
|
|
166
|
+
if (column.key === undefined) missingColumnKeyWarn();
|
|
167
|
+
}.bind(this));
|
|
168
|
+
}.bind(this);
|
|
169
|
+
|
|
170
|
+
_this2.componentWillReceiveProps = function (nextProps) {
|
|
171
|
+
var _this5 = this;
|
|
172
|
+
|
|
173
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
174
|
+
var rowSelection = nextProps.rowSelection;
|
|
175
|
+
|
|
176
|
+
if ((0, _isObject2.default)(rowSelection) && 'selectedRowKeys' in rowSelection) {
|
|
177
|
+
var selectedRowKeyMap = {};
|
|
178
|
+
(0, _each2.default)(rowSelection.selectedRowKeys, function (key) {
|
|
179
|
+
(0, _newArrowCheck2.default)(this, _this5);
|
|
180
|
+
return selectedRowKeyMap[key] = true;
|
|
181
|
+
}.bind(this));
|
|
182
|
+
|
|
183
|
+
_this2.setState({
|
|
184
|
+
selectedRowKeyMap: selectedRowKeyMap
|
|
185
|
+
});
|
|
186
|
+
} // pick controlled filter value
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
_this2.setState({
|
|
190
|
+
filtersFromProps: _this2.calFiltersFromProps(nextProps)
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
if ('order' in nextProps) {
|
|
194
|
+
var order = _this2.getOrder(nextProps.order, nextProps.columns);
|
|
195
|
+
|
|
196
|
+
_this2.setState({
|
|
197
|
+
order: order
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}.bind(this);
|
|
201
|
+
|
|
202
|
+
_this2.getOrder = function (order, columns) {
|
|
203
|
+
var _this6 = this;
|
|
204
|
+
|
|
205
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
206
|
+
if (!order || !columns) return null;
|
|
207
|
+
var key = order.key,
|
|
208
|
+
state = order.state;
|
|
209
|
+
if (!key || !state) return null;
|
|
210
|
+
var column = (0, _find2.default)(columns, function (column) {
|
|
211
|
+
(0, _newArrowCheck2.default)(this, _this6);
|
|
212
|
+
return column.key === key;
|
|
213
|
+
}.bind(this));
|
|
214
|
+
if (!column) return null;
|
|
215
|
+
var columnOrder = column.order,
|
|
216
|
+
dataIndex = column.dataIndex;
|
|
217
|
+
if (!columnOrder) return null;
|
|
218
|
+
var handleOrder = columnOrder.handleOrder;
|
|
219
|
+
return {
|
|
220
|
+
key: key,
|
|
221
|
+
state: state,
|
|
222
|
+
dataIndex: dataIndex,
|
|
223
|
+
handleOrder: handleOrder
|
|
224
|
+
};
|
|
225
|
+
}.bind(this);
|
|
226
|
+
|
|
227
|
+
_this2.calFiltersFromProps = function (_ref2) {
|
|
228
|
+
var _this7 = this;
|
|
229
|
+
|
|
230
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
231
|
+
var _ref2$columns = _ref2.columns,
|
|
232
|
+
columns = _ref2$columns === void 0 ? [] : _ref2$columns;
|
|
233
|
+
var filters = {}; // pick filter controlled value
|
|
234
|
+
|
|
235
|
+
columns.forEach(function (column, i) {
|
|
236
|
+
(0, _newArrowCheck2.default)(this, _this7);
|
|
237
|
+
var filter = column.filter;
|
|
238
|
+
|
|
239
|
+
var columnKey = _this2.getColumnKey(column, i);
|
|
240
|
+
|
|
241
|
+
if (!filter) return;
|
|
242
|
+
var filterValue;
|
|
243
|
+
|
|
244
|
+
if ('value' in filter) {
|
|
245
|
+
filterValue = filter.value;
|
|
246
|
+
filters[columnKey] = {
|
|
247
|
+
value: filterValue
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}.bind(this));
|
|
251
|
+
return filters;
|
|
252
|
+
}.bind(this);
|
|
253
|
+
|
|
254
|
+
_this2.calDefaultFilters = function (_ref3) {
|
|
255
|
+
var _this8 = this;
|
|
256
|
+
|
|
257
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
258
|
+
var _ref3$columns = _ref3.columns,
|
|
259
|
+
columns = _ref3$columns === void 0 ? [] : _ref3$columns;
|
|
260
|
+
var filters = {}; // pick filter controlled value
|
|
261
|
+
|
|
262
|
+
columns.forEach(function (column, i) {
|
|
263
|
+
(0, _newArrowCheck2.default)(this, _this8);
|
|
264
|
+
var filter = column.filter;
|
|
265
|
+
if (!filter) return;
|
|
266
|
+
|
|
267
|
+
var columnKey = _this2.getColumnKey(column, i);
|
|
268
|
+
|
|
269
|
+
var filterValue; // pick default value
|
|
270
|
+
|
|
271
|
+
if ('defaultValue' in filter) {
|
|
272
|
+
filterValue = filter.defaultValue;
|
|
273
|
+
filters[columnKey] = {
|
|
274
|
+
value: filterValue
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}.bind(this));
|
|
278
|
+
return filters;
|
|
279
|
+
}.bind(this);
|
|
280
|
+
|
|
281
|
+
_this2.mergeFilters = function (stateFilters, propsFilters, columns) {
|
|
282
|
+
var _this9 = this;
|
|
283
|
+
|
|
284
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
285
|
+
|
|
286
|
+
var filters = _objectSpread(_objectSpread({}, stateFilters), propsFilters);
|
|
287
|
+
|
|
288
|
+
(0, _each2.default)(filters, function (filter, key) {
|
|
289
|
+
var _this10 = this;
|
|
290
|
+
|
|
291
|
+
(0, _newArrowCheck2.default)(this, _this9);
|
|
292
|
+
var column = (0, _find2.default)(columns, function (column, i) {
|
|
293
|
+
(0, _newArrowCheck2.default)(this, _this10);
|
|
294
|
+
return _this2.getColumnKey(column, i) === key;
|
|
295
|
+
}.bind(this));
|
|
296
|
+
|
|
297
|
+
if (!column || filter.value == null || column.filter.multiple && !filter.value.length) {
|
|
298
|
+
delete filters[key];
|
|
299
|
+
} else {
|
|
300
|
+
filter.column = column;
|
|
301
|
+
}
|
|
302
|
+
}.bind(this));
|
|
303
|
+
return filters;
|
|
304
|
+
}.bind(this);
|
|
305
|
+
|
|
306
|
+
_this2.getExpandedRowKeys = function (dataSource, changedUnExpandedRowKeys) {
|
|
307
|
+
var _this11 = this;
|
|
308
|
+
|
|
309
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
310
|
+
|
|
311
|
+
var flatDataSource = _this2.flatDataSource(dataSource);
|
|
312
|
+
|
|
313
|
+
var expandedRowKeys = [];
|
|
314
|
+
(0, _each2.default)(flatDataSource, function (item) {
|
|
315
|
+
(0, _newArrowCheck2.default)(this, _this11);
|
|
316
|
+
var key = item.key;
|
|
317
|
+
|
|
318
|
+
if (!changedUnExpandedRowKeys[key]) {
|
|
319
|
+
expandedRowKeys.push(key);
|
|
320
|
+
}
|
|
321
|
+
}.bind(this));
|
|
322
|
+
return expandedRowKeys;
|
|
323
|
+
}.bind(this);
|
|
324
|
+
|
|
325
|
+
_this2.deprecatedOnRowSelect = function (selectedRowKeys) {
|
|
326
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
327
|
+
|
|
328
|
+
if ('onRowSelect' in _this2.props) {
|
|
329
|
+
deprecatedLogForOnRowSelect();
|
|
330
|
+
|
|
331
|
+
_this2.props.onRowSelect(selectedRowKeys);
|
|
332
|
+
}
|
|
333
|
+
}.bind(this);
|
|
334
|
+
|
|
335
|
+
_this2.onSelectedRowKeysChange = function (selectedRowKeyMap) {
|
|
336
|
+
var _this12 = this;
|
|
337
|
+
|
|
338
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
339
|
+
var rowSelection = _this2.props.rowSelection;
|
|
340
|
+
if (!rowSelection) return;
|
|
341
|
+
var selectedRowKeys = [];
|
|
342
|
+
(0, _each2.default)(selectedRowKeyMap, function (selected, key) {
|
|
343
|
+
(0, _newArrowCheck2.default)(this, _this12);
|
|
344
|
+
selected && selectedRowKeys.push(key);
|
|
345
|
+
}.bind(this));
|
|
346
|
+
|
|
347
|
+
if ((0, _isObject2.default)(rowSelection)) {
|
|
348
|
+
if (rowSelection.onChange) {
|
|
349
|
+
rowSelection.onChange(selectedRowKeys);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (!('selectedRowKeys' in rowSelection)) {
|
|
353
|
+
_this2.setState({
|
|
354
|
+
selectedRowKeyMap: selectedRowKeyMap
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
_this2.setState({
|
|
359
|
+
selectedRowKeyMap: selectedRowKeyMap
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
_this2.deprecatedOnRowSelect(selectedRowKeys);
|
|
364
|
+
}.bind(this);
|
|
365
|
+
|
|
366
|
+
_this2.onColumnConfigChange = function (config) {
|
|
367
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
368
|
+
var onColumnConfigChange = _this2.props.onColumnConfigChange;
|
|
369
|
+
|
|
370
|
+
_this2.setState({
|
|
371
|
+
columnConfig: config
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
onColumnConfigChange(config);
|
|
375
|
+
}.bind(this);
|
|
376
|
+
|
|
377
|
+
_this2.handleSearch = function (v) {
|
|
378
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
379
|
+
|
|
380
|
+
if (v !== _this2.state.searchValue) {
|
|
381
|
+
_this2.setState({
|
|
382
|
+
pagination: _objectSpread(_objectSpread({}, _this2.state.pagination), {}, {
|
|
383
|
+
current: 1
|
|
384
|
+
})
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
_this2.handleConditionChange({
|
|
388
|
+
searchValue: v
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}.bind(this);
|
|
392
|
+
|
|
393
|
+
_this2.handleConditionChange = function (stateCondition) {
|
|
394
|
+
var _this13 = this;
|
|
395
|
+
|
|
396
|
+
var callbackCondition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
397
|
+
stateCondition = _objectSpread(_objectSpread({}, (0, _pick2.default)(_this2.state, ['order', 'filters', 'searchValue'])), stateCondition);
|
|
398
|
+
|
|
399
|
+
_this2.setState(_objectSpread({}, stateCondition));
|
|
400
|
+
|
|
401
|
+
var onConditionChange = _this2.props.onConditionChange;
|
|
402
|
+
var order = callbackCondition.order,
|
|
403
|
+
filters = callbackCondition.filters,
|
|
404
|
+
searchValue = callbackCondition.searchValue;
|
|
405
|
+
|
|
406
|
+
if (!('order' in callbackCondition)) {
|
|
407
|
+
order = stateCondition.order;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (!('filters' in callbackCondition)) {
|
|
411
|
+
filters = stateCondition.filters;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (!('searchValue' in callbackCondition)) {
|
|
415
|
+
searchValue = stateCondition.searchValue;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
onConditionChange && onConditionChange({
|
|
419
|
+
order: order ? (0, _pick2.default)(order, ['key', 'state']) : null,
|
|
420
|
+
filters: (0, _map2.default)(filters, function (filter, key) {
|
|
421
|
+
(0, _newArrowCheck2.default)(this, _this13);
|
|
422
|
+
return {
|
|
423
|
+
key: key,
|
|
424
|
+
value: filter.value
|
|
425
|
+
};
|
|
426
|
+
}.bind(this)),
|
|
427
|
+
searchValue: searchValue
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
_this2.renderFilter = function (column) {
|
|
432
|
+
var _this14 = this;
|
|
433
|
+
|
|
434
|
+
var filterInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
435
|
+
var index = arguments.length > 2 ? arguments[2] : undefined;
|
|
436
|
+
var filter = column.filter;
|
|
437
|
+
|
|
438
|
+
if (!filter) {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
var columnKey = _this2.getColumnKey(column, index);
|
|
443
|
+
|
|
444
|
+
var options = filter.options,
|
|
445
|
+
multiple = filter.multiple,
|
|
446
|
+
_filter$onChange = filter.onChange,
|
|
447
|
+
onChange = _filter$onChange === void 0 ? function () {
|
|
448
|
+
(0, _newArrowCheck2.default)(this, _this14);
|
|
449
|
+
}.bind(this) : _filter$onChange,
|
|
450
|
+
rest = (0, _objectWithoutProperties2.default)(filter, _excluded);
|
|
451
|
+
var newOptions = (0, _map2.default)(options, function (option) {
|
|
452
|
+
(0, _newArrowCheck2.default)(this, _this14);
|
|
453
|
+
return (0, _isObject2.default)(option) ? option : {
|
|
454
|
+
value: option
|
|
455
|
+
};
|
|
456
|
+
}.bind(this));
|
|
457
|
+
var value = filterInfo.value;
|
|
458
|
+
var finalValue = value == null || multiple && !value.length ? null : value;
|
|
459
|
+
return /*#__PURE__*/_react.default.createElement(_Select.default, (0, _extends2.default)({
|
|
460
|
+
options: newOptions,
|
|
461
|
+
value: finalValue,
|
|
462
|
+
onChange: function (value) {
|
|
463
|
+
(0, _newArrowCheck2.default)(this, _this14);
|
|
464
|
+
|
|
465
|
+
_this2.handleFilter(columnKey, value == null || multiple && !value.length ? null : value);
|
|
466
|
+
|
|
467
|
+
onChange(value);
|
|
468
|
+
}.bind(this),
|
|
469
|
+
className: "".concat(_style.prefixCls, "-filter"),
|
|
470
|
+
renderSelector: function (content, active) {
|
|
471
|
+
(0, _newArrowCheck2.default)(this, _this14);
|
|
472
|
+
return /*#__PURE__*/_react.default.createElement(_style.FilterIcon, {
|
|
473
|
+
key: "icon",
|
|
474
|
+
type: "filter",
|
|
475
|
+
active: active
|
|
476
|
+
});
|
|
477
|
+
}.bind(this),
|
|
478
|
+
multiple: multiple
|
|
479
|
+
}, rest));
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
_this2.handleFilter = function (key, value) {
|
|
483
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
484
|
+
|
|
485
|
+
var finalFilters = _this2.mergeFilters(_this2.state.filters, _objectSpread(_objectSpread({}, _this2.state.filtersFromProps), {}, (0, _defineProperty2.default)({}, key, {
|
|
486
|
+
value: value
|
|
487
|
+
})), _this2.props.columns);
|
|
488
|
+
|
|
489
|
+
_this2.setState({
|
|
490
|
+
pagination: _objectSpread(_objectSpread({}, _this2.state.pagination), {}, {
|
|
491
|
+
current: 1
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
_this2.handleConditionChange({
|
|
496
|
+
filters: finalFilters
|
|
497
|
+
});
|
|
498
|
+
}.bind(this);
|
|
499
|
+
|
|
500
|
+
_this2.clearFilter = function () {
|
|
501
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
502
|
+
|
|
503
|
+
_this2.handleConditionChange({
|
|
504
|
+
filters: {},
|
|
505
|
+
searchValue: ''
|
|
506
|
+
}, {
|
|
507
|
+
filters: {}
|
|
508
|
+
});
|
|
509
|
+
}.bind(this);
|
|
510
|
+
|
|
511
|
+
_this2.renderOrder = function (order, key, dataIndex) {
|
|
512
|
+
var _this15 = this;
|
|
513
|
+
|
|
514
|
+
var state = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'none';
|
|
515
|
+
|
|
516
|
+
if (!order) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var handleOrder = order.handleOrder;
|
|
521
|
+
return /*#__PURE__*/_react.default.createElement(_style.SortIcon, {
|
|
522
|
+
type: {
|
|
523
|
+
none: 'sort',
|
|
524
|
+
desc: 'line-arrow-down',
|
|
525
|
+
asc: 'line-arrow-up'
|
|
526
|
+
}[state],
|
|
527
|
+
onClick: function () {
|
|
528
|
+
(0, _newArrowCheck2.default)(this, _this15);
|
|
529
|
+
|
|
530
|
+
_this2.handleOrder(key, {
|
|
531
|
+
dataIndex: dataIndex,
|
|
532
|
+
handleOrder: handleOrder,
|
|
533
|
+
state: state
|
|
534
|
+
});
|
|
535
|
+
}.bind(this)
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
_this2.handleOrder = function (key, _ref4) {
|
|
540
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
541
|
+
var dataIndex = _ref4.dataIndex,
|
|
542
|
+
handleOrder = _ref4.handleOrder,
|
|
543
|
+
state = _ref4.state;
|
|
544
|
+
var order = state === 'asc' ? null : {
|
|
545
|
+
key: key,
|
|
546
|
+
dataIndex: dataIndex,
|
|
547
|
+
handleOrder: handleOrder,
|
|
548
|
+
state: {
|
|
549
|
+
none: 'desc',
|
|
550
|
+
desc: 'asc'
|
|
551
|
+
}[state]
|
|
552
|
+
}; // controlled
|
|
553
|
+
|
|
554
|
+
if ('order' in _this2.props) {
|
|
555
|
+
_this2.handleConditionChange({}, {
|
|
556
|
+
order: order
|
|
557
|
+
});
|
|
558
|
+
} else {
|
|
559
|
+
_this2.handleConditionChange({
|
|
560
|
+
order: order
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
}.bind(this);
|
|
564
|
+
|
|
565
|
+
_this2.flatDataSource = function () {
|
|
566
|
+
var _this16 = this;
|
|
567
|
+
|
|
568
|
+
var dataSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
569
|
+
var childrenName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'children';
|
|
570
|
+
var result = [];
|
|
571
|
+
|
|
572
|
+
var push = function push(record) {
|
|
573
|
+
(0, _newArrowCheck2.default)(this, _this16);
|
|
574
|
+
var index = result.length;
|
|
575
|
+
result.push({
|
|
576
|
+
record: record,
|
|
577
|
+
index: index,
|
|
578
|
+
key: _this2.getRowKey(record, index)
|
|
579
|
+
});
|
|
580
|
+
}.bind(this);
|
|
581
|
+
|
|
582
|
+
var _loop = function loop(array) {
|
|
583
|
+
var _this17 = this;
|
|
584
|
+
|
|
585
|
+
(0, _newArrowCheck2.default)(this, _this16);
|
|
586
|
+
array.forEach(function (record) {
|
|
587
|
+
(0, _newArrowCheck2.default)(this, _this17);
|
|
588
|
+
|
|
589
|
+
if (record[childrenName]) {
|
|
590
|
+
var newRecord = _objectSpread({}, record);
|
|
591
|
+
|
|
592
|
+
delete newRecord[childrenName];
|
|
593
|
+
push(newRecord);
|
|
594
|
+
|
|
595
|
+
if (record[childrenName].length > 0) {
|
|
596
|
+
_loop(record[childrenName]);
|
|
597
|
+
}
|
|
598
|
+
} else {
|
|
599
|
+
push(record);
|
|
600
|
+
}
|
|
601
|
+
}.bind(this));
|
|
602
|
+
}.bind(this);
|
|
603
|
+
|
|
604
|
+
_loop(dataSource);
|
|
605
|
+
|
|
606
|
+
return result;
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
_this2.getDataSource = function (filters) {
|
|
610
|
+
var _this18 = this;
|
|
611
|
+
|
|
612
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
613
|
+
var _this2$props = _this2.props,
|
|
614
|
+
dataSource = _this2$props.dataSource,
|
|
615
|
+
handleSearch = _this2$props.handleSearch,
|
|
616
|
+
doNotHandleCondition = _this2$props.doNotHandleCondition;
|
|
617
|
+
var _this2$state = _this2.state,
|
|
618
|
+
order = _this2$state.order,
|
|
619
|
+
searchValue = _this2$state.searchValue;
|
|
620
|
+
var data = (0, _clone2.default)(dataSource);
|
|
621
|
+
|
|
622
|
+
var doFilter = function doFilter(dataSource, filter) {
|
|
623
|
+
var _this19 = this;
|
|
624
|
+
|
|
625
|
+
(0, _newArrowCheck2.default)(this, _this18);
|
|
626
|
+
var value = filter.value,
|
|
627
|
+
columnInfo = filter.column;
|
|
628
|
+
var dataIndex = columnInfo.dataIndex,
|
|
629
|
+
_columnInfo$filter = columnInfo.filter,
|
|
630
|
+
multiple = _columnInfo$filter.multiple,
|
|
631
|
+
_columnInfo$filter$ha = _columnInfo$filter.handleFilter,
|
|
632
|
+
handleFilter = _columnInfo$filter$ha === void 0 ? function (value, record, filterValue, multiple) {
|
|
633
|
+
(0, _newArrowCheck2.default)(this, _this19);
|
|
634
|
+
|
|
635
|
+
if (value == null) {
|
|
636
|
+
return false;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
if ((0, _isNumber2.default)(value)) {
|
|
640
|
+
value = '' + value;
|
|
641
|
+
} else if (!(0, _isString2.default)(value)) {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if (!multiple) {
|
|
646
|
+
return value.indexOf(filterValue) >= 0;
|
|
647
|
+
} else {
|
|
648
|
+
for (var i = 0; i < filterValue.length; i++) {
|
|
649
|
+
var v = filterValue[i];
|
|
650
|
+
|
|
651
|
+
if (value.indexOf(v) >= 0) {
|
|
652
|
+
return true;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}.bind(this) : _columnInfo$filter$ha;
|
|
657
|
+
return (0, _filter2.default)(dataSource, function (record) {
|
|
658
|
+
(0, _newArrowCheck2.default)(this, _this19);
|
|
659
|
+
return handleFilter(record[dataIndex], record, value, multiple);
|
|
660
|
+
}.bind(this));
|
|
661
|
+
}.bind(this);
|
|
662
|
+
|
|
663
|
+
if (!doNotHandleCondition && !(0, _isEmpty2.default)(filters)) {
|
|
664
|
+
(0, _forEach2.default)(filters, function (filter, key) {
|
|
665
|
+
(0, _newArrowCheck2.default)(this, _this18);
|
|
666
|
+
return data = doFilter(data, filter, key);
|
|
667
|
+
}.bind(this));
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
var doSearch = function doSearch(dataSource, searchValue) {
|
|
671
|
+
var _this20 = this;
|
|
672
|
+
|
|
673
|
+
(0, _newArrowCheck2.default)(this, _this18);
|
|
674
|
+
return dataSource.filter(function (record) {
|
|
675
|
+
(0, _newArrowCheck2.default)(this, _this20);
|
|
676
|
+
return handleSearch(record, searchValue);
|
|
677
|
+
}.bind(this));
|
|
678
|
+
}.bind(this);
|
|
679
|
+
|
|
680
|
+
if (!doNotHandleCondition && searchValue && searchValue.trim()) {
|
|
681
|
+
data = doSearch(data, searchValue.trim());
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
var doOrder = function doOrder(dataSource, order) {
|
|
685
|
+
var _this21 = this;
|
|
686
|
+
|
|
687
|
+
(0, _newArrowCheck2.default)(this, _this18);
|
|
688
|
+
var dataIndex = order.dataIndex,
|
|
689
|
+
handleOrder = order.handleOrder,
|
|
690
|
+
state = order.state;
|
|
691
|
+
return dataSource.sort(handleOrder ? function () {
|
|
692
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
693
|
+
args[_key] = arguments[_key];
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
return handleOrder.apply(void 0, [state].concat(args));
|
|
697
|
+
} : {
|
|
698
|
+
desc: function desc(a, b) {
|
|
699
|
+
(0, _newArrowCheck2.default)(this, _this21);
|
|
700
|
+
return a[dataIndex] > b[dataIndex] ? -1 : a[dataIndex] < b[dataIndex] ? 1 : 0;
|
|
701
|
+
}.bind(this),
|
|
702
|
+
asc: function asc(a, b) {
|
|
703
|
+
(0, _newArrowCheck2.default)(this, _this21);
|
|
704
|
+
return a[dataIndex] < b[dataIndex] ? -1 : a[dataIndex] > b[dataIndex] ? 1 : 0;
|
|
705
|
+
}.bind(this)
|
|
706
|
+
}[state]);
|
|
707
|
+
}.bind(this);
|
|
708
|
+
|
|
709
|
+
if (!doNotHandleCondition && order) {
|
|
710
|
+
data = doOrder(data, order);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
var total = data.length;
|
|
714
|
+
|
|
715
|
+
var pagination = _this2.getPagination();
|
|
716
|
+
|
|
717
|
+
if (!doNotHandleCondition && pagination !== null) {
|
|
718
|
+
var current = pagination.current,
|
|
719
|
+
pageSize = pagination.pageSize;
|
|
720
|
+
var from = (current - 1) * pageSize;
|
|
721
|
+
var to = from + pageSize;
|
|
722
|
+
data = data.slice(from, to);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return {
|
|
726
|
+
dataSource: data,
|
|
727
|
+
total: total
|
|
728
|
+
};
|
|
729
|
+
}.bind(this);
|
|
730
|
+
|
|
731
|
+
_this2.handleToggleCurrentPage = function (enableKeysOfCurrentPage, checked) {
|
|
732
|
+
var _this22 = this;
|
|
733
|
+
|
|
734
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
735
|
+
var selectedRowKeyMap = _this2.state.selectedRowKeyMap;
|
|
736
|
+
var extendSelectedRowKeyMap = {};
|
|
737
|
+
(0, _each2.default)(enableKeysOfCurrentPage, function (key) {
|
|
738
|
+
(0, _newArrowCheck2.default)(this, _this22);
|
|
739
|
+
extendSelectedRowKeyMap[key] = checked;
|
|
740
|
+
}.bind(this));
|
|
741
|
+
|
|
742
|
+
_this2.onSelectedRowKeysChange(_objectSpread(_objectSpread({}, selectedRowKeyMap), extendSelectedRowKeyMap));
|
|
743
|
+
}.bind(this);
|
|
744
|
+
|
|
745
|
+
_this2.handleSelectRecord = function (key, checked) {
|
|
746
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
747
|
+
var rowSelection = _this2.props.rowSelection;
|
|
748
|
+
var selectedRowKeyMap = _this2.state.selectedRowKeyMap;
|
|
749
|
+
|
|
750
|
+
if (rowSelection.multiple === false) {
|
|
751
|
+
_this2.onSelectedRowKeysChange((0, _defineProperty2.default)({}, key, true));
|
|
752
|
+
} else {
|
|
753
|
+
_this2.onSelectedRowKeysChange(_objectSpread(_objectSpread({}, selectedRowKeyMap), {}, (0, _defineProperty2.default)({}, key, checked)));
|
|
754
|
+
}
|
|
755
|
+
}.bind(this);
|
|
756
|
+
|
|
757
|
+
_this2.getRowKey = function (record, index) {
|
|
758
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
759
|
+
var rowKey = _this2.props.rowKey;
|
|
760
|
+
var key = typeof rowKey === 'function' ? rowKey(record, index) : record[rowKey];
|
|
761
|
+
return key === undefined ? index : key;
|
|
762
|
+
}.bind(this);
|
|
763
|
+
|
|
764
|
+
_this2.getColumnKey = function () {
|
|
765
|
+
var column = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
766
|
+
var index = arguments.length > 1 ? arguments[1] : undefined;
|
|
767
|
+
var key = column.key;
|
|
768
|
+
return (key === undefined ? index : key) + '';
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
_this2.getDragSorting = function () {
|
|
772
|
+
var _this23 = this;
|
|
773
|
+
|
|
774
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
775
|
+
var _this2$props2 = _this2.props,
|
|
776
|
+
dragSorting = _this2$props2.dragSorting,
|
|
777
|
+
expandedRowRender = _this2$props2.expandedRowRender,
|
|
778
|
+
columns = _this2$props2.columns;
|
|
779
|
+
if (!dragSorting) return false;
|
|
780
|
+
|
|
781
|
+
if (expandedRowRender || columns && columns.findIndex(function (column) {
|
|
782
|
+
(0, _newArrowCheck2.default)(this, _this23);
|
|
783
|
+
return !!column.children;
|
|
784
|
+
}.bind(this)) >= 0) {
|
|
785
|
+
dragSortingWarning();
|
|
786
|
+
return false;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return dragSorting;
|
|
790
|
+
}.bind(this);
|
|
791
|
+
|
|
792
|
+
_this2.getColumns = function (dataSourceOfCurrentPage, filters) {
|
|
793
|
+
var _this24 = this;
|
|
794
|
+
|
|
795
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
796
|
+
var _this2$props3 = _this2.props,
|
|
797
|
+
columns = _this2$props3.columns,
|
|
798
|
+
rowSelection = _this2$props3.rowSelection,
|
|
799
|
+
columnPlaceholder = _this2$props3.columnPlaceholder,
|
|
800
|
+
locale = _this2$props3.locale,
|
|
801
|
+
dataSource = _this2$props3.dataSource,
|
|
802
|
+
columnResizable = _this2$props3.columnResizable;
|
|
803
|
+
var _this2$state2 = _this2.state,
|
|
804
|
+
_this2$state2$order = _this2$state2.order,
|
|
805
|
+
currentOrder = _this2$state2$order === void 0 ? {} : _this2$state2$order,
|
|
806
|
+
selectedRowKeyMap = _this2$state2.selectedRowKeyMap,
|
|
807
|
+
columnConfig = _this2$state2.columnConfig;
|
|
808
|
+
var cloneColumns = columns.map(function (column, index) {
|
|
809
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
810
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
811
|
+
index: index
|
|
812
|
+
});
|
|
813
|
+
}.bind(this));
|
|
814
|
+
var newColumns = cloneColumns.filter(function (column) {
|
|
815
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
816
|
+
var key = column.key;
|
|
817
|
+
return !columnConfig[key] || !columnConfig[key].hidden;
|
|
818
|
+
}.bind(this));
|
|
819
|
+
|
|
820
|
+
var _generateColumnTitle = function generateColumnTitle(column) {
|
|
821
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
822
|
+
var dataIndex = column.dataIndex,
|
|
823
|
+
title = column.title,
|
|
824
|
+
renderTitle = column.renderTitle,
|
|
825
|
+
order = column.order,
|
|
826
|
+
children = column.children,
|
|
827
|
+
index = column.index;
|
|
828
|
+
|
|
829
|
+
var columnKey = _this2.getColumnKey(column, index);
|
|
830
|
+
|
|
831
|
+
if (children) {
|
|
832
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
833
|
+
children: children.map(_generateColumnTitle)
|
|
834
|
+
});
|
|
835
|
+
} else {
|
|
836
|
+
return _objectSpread(_objectSpread({}, column), {}, {
|
|
837
|
+
title: /*#__PURE__*/_react.default.createElement("div", null, renderTitle ? renderTitle(title) : title, _this2.renderFilter(column, filters[columnKey], index), _this2.renderOrder(order, columnKey, dataIndex, currentOrder && currentOrder.key === columnKey ? currentOrder.state : 'none'))
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
}.bind(this);
|
|
841
|
+
|
|
842
|
+
newColumns = newColumns.map(_generateColumnTitle);
|
|
843
|
+
|
|
844
|
+
if (columnResizable) {
|
|
845
|
+
newColumns.forEach(function (column) {
|
|
846
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
847
|
+
column.resizable = true;
|
|
848
|
+
}.bind(this));
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if (rowSelection) {
|
|
852
|
+
var flatDataSourceOfCurrentPage = _this2.flatDataSource(dataSourceOfCurrentPage);
|
|
853
|
+
|
|
854
|
+
var enableDataSourceOfCurrentPage = flatDataSourceOfCurrentPage;
|
|
855
|
+
|
|
856
|
+
var flatDataSource = _this2.flatDataSource(dataSource);
|
|
857
|
+
|
|
858
|
+
var enableDataSource = flatDataSource;
|
|
859
|
+
var selectionDisabled = rowSelection.disabled;
|
|
860
|
+
|
|
861
|
+
if (rowSelection.getDisabledOfRow) {
|
|
862
|
+
enableDataSourceOfCurrentPage = (0, _filter2.default)(flatDataSourceOfCurrentPage, function (item) {
|
|
863
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
864
|
+
return !rowSelection.getDisabledOfRow(item.record);
|
|
865
|
+
}.bind(this));
|
|
866
|
+
enableDataSource = (0, _filter2.default)(flatDataSource, function (item) {
|
|
867
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
868
|
+
return !rowSelection.getDisabledOfRow(item.record);
|
|
869
|
+
}.bind(this));
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
var selectedEnableDataSourceOfCurrentPage = (0, _filter2.default)(enableDataSourceOfCurrentPage, function (item) {
|
|
873
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
874
|
+
return selectedRowKeyMap[item.key];
|
|
875
|
+
}.bind(this));
|
|
876
|
+
var selectedEnableDataSource = (0, _filter2.default)(enableDataSource, function (item) {
|
|
877
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
878
|
+
return selectedRowKeyMap[item.key];
|
|
879
|
+
}.bind(this));
|
|
880
|
+
var selectedEnableDataSourceOfCurrentPageCount = selectedEnableDataSourceOfCurrentPage.length;
|
|
881
|
+
var isAllSelected = selectedEnableDataSourceOfCurrentPageCount === enableDataSourceOfCurrentPage.length && selectedEnableDataSourceOfCurrentPageCount > 0;
|
|
882
|
+
var selectedCount = (0, _filter2.default)(selectedRowKeyMap, function (v) {
|
|
883
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
884
|
+
return v;
|
|
885
|
+
}.bind(this)).length;
|
|
886
|
+
|
|
887
|
+
var renderSelectedAllCheckbox = function renderSelectedAllCheckbox() {
|
|
888
|
+
var _this25 = this;
|
|
889
|
+
|
|
890
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
891
|
+
return /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
892
|
+
disabled: selectionDisabled,
|
|
893
|
+
onChange: function () {
|
|
894
|
+
var _this26 = this;
|
|
895
|
+
|
|
896
|
+
(0, _newArrowCheck2.default)(this, _this25);
|
|
897
|
+
var enableKeysOfCurrentPage = enableDataSourceOfCurrentPage.map(function (item) {
|
|
898
|
+
(0, _newArrowCheck2.default)(this, _this26);
|
|
899
|
+
return item.key;
|
|
900
|
+
}.bind(this));
|
|
901
|
+
|
|
902
|
+
_this2.handleToggleCurrentPage(enableKeysOfCurrentPage, !isAllSelected);
|
|
903
|
+
}.bind(this),
|
|
904
|
+
checked: isAllSelected,
|
|
905
|
+
indeterminate: !isAllSelected && selectedEnableDataSourceOfCurrentPageCount > 0
|
|
906
|
+
});
|
|
907
|
+
}.bind(this);
|
|
908
|
+
|
|
909
|
+
newColumns.unshift({
|
|
910
|
+
title: rowSelection.multiple === false ? null : rowSelection.selectedTip === false ? renderSelectedAllCheckbox() : /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
911
|
+
visible: selectedCount > 0,
|
|
912
|
+
getPopupContainer: _this2.getPopupContainer,
|
|
913
|
+
popup: /*#__PURE__*/_react.default.createElement("span", null, locale.selected, " ", selectedCount, ' ', /*#__PURE__*/_react.default.createElement(_style.CancelSelect, {
|
|
914
|
+
onClick: function () {
|
|
915
|
+
var _this27 = this;
|
|
916
|
+
|
|
917
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
918
|
+
var enableKeys = selectedEnableDataSource.map(function (item) {
|
|
919
|
+
(0, _newArrowCheck2.default)(this, _this27);
|
|
920
|
+
return item.key;
|
|
921
|
+
}.bind(this));
|
|
922
|
+
|
|
923
|
+
_this2.handleToggleCurrentPage(enableKeys, false);
|
|
924
|
+
}.bind(this)
|
|
925
|
+
}, locale.cancelSelect)),
|
|
926
|
+
placement: rowSelection.selectedTip === 'bottom' ? 'bottomLeft' : 'topLeft',
|
|
927
|
+
align: {
|
|
928
|
+
offset: [-8, 0]
|
|
929
|
+
}
|
|
930
|
+
}, renderSelectedAllCheckbox()),
|
|
931
|
+
key: 'table_row_selection',
|
|
932
|
+
width: 32,
|
|
933
|
+
fixed: rowSelection.fixed,
|
|
934
|
+
onHeaderCell: function onHeaderCell() {
|
|
935
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
936
|
+
return {
|
|
937
|
+
className: _style.selectIconHeaderCls
|
|
938
|
+
};
|
|
939
|
+
}.bind(this),
|
|
940
|
+
onCell: function onCell() {
|
|
941
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
942
|
+
return {
|
|
943
|
+
className: _style.selectIconCellCls
|
|
944
|
+
};
|
|
945
|
+
}.bind(this),
|
|
946
|
+
render: function render(value, record, index) {
|
|
947
|
+
var _this28 = this;
|
|
948
|
+
|
|
949
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
950
|
+
|
|
951
|
+
var rowKey = _this2.getRowKey(record, index);
|
|
952
|
+
|
|
953
|
+
var disabled = false;
|
|
954
|
+
|
|
955
|
+
if (selectionDisabled) {
|
|
956
|
+
disabled = true;
|
|
957
|
+
} else if (rowSelection.getDisabledOfRow) {
|
|
958
|
+
disabled = rowSelection.getDisabledOfRow(record);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
return rowSelection.multiple === false ? /*#__PURE__*/_react.default.createElement(_Radio.default, {
|
|
962
|
+
disabled: disabled,
|
|
963
|
+
onChange: function () {
|
|
964
|
+
(0, _newArrowCheck2.default)(this, _this28);
|
|
965
|
+
return _this2.handleSelectRecord(rowKey);
|
|
966
|
+
}.bind(this),
|
|
967
|
+
checked: !!selectedRowKeyMap[rowKey]
|
|
968
|
+
}) : /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
969
|
+
disabled: disabled,
|
|
970
|
+
onChange: function () {
|
|
971
|
+
(0, _newArrowCheck2.default)(this, _this28);
|
|
972
|
+
return _this2.handleSelectRecord(rowKey, !selectedRowKeyMap[rowKey]);
|
|
973
|
+
}.bind(this),
|
|
974
|
+
checked: !!selectedRowKeyMap[rowKey]
|
|
975
|
+
});
|
|
976
|
+
}.bind(this)
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
var dragSorting = _this2.getDragSorting();
|
|
981
|
+
|
|
982
|
+
if (dragSorting) {
|
|
983
|
+
newColumns.unshift({
|
|
984
|
+
title: null,
|
|
985
|
+
key: 'table_row_drag_sorting',
|
|
986
|
+
width: 40,
|
|
987
|
+
fixed: dragSorting === null || dragSorting === void 0 ? void 0 : dragSorting.fixed,
|
|
988
|
+
onHeaderCell: function onHeaderCell() {
|
|
989
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
990
|
+
return {
|
|
991
|
+
className: _style.draggerHeaderCls
|
|
992
|
+
};
|
|
993
|
+
}.bind(this),
|
|
994
|
+
onCell: function onCell() {
|
|
995
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
996
|
+
return {
|
|
997
|
+
className: _style.draggerCellCls
|
|
998
|
+
};
|
|
999
|
+
}.bind(this),
|
|
1000
|
+
render: function render(value, record, index) {
|
|
1001
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
1002
|
+
|
|
1003
|
+
var rowKey = _this2.getRowKey(record, index);
|
|
1004
|
+
|
|
1005
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
1006
|
+
"data-row-key": rowKey,
|
|
1007
|
+
onMouseEnter: _this2.setDraggable,
|
|
1008
|
+
onMouseLeave: _this2.unsetDraggable,
|
|
1009
|
+
className: _style.draggerCls
|
|
1010
|
+
}, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
|
|
1011
|
+
type: "dragger",
|
|
1012
|
+
size: "16px"
|
|
1013
|
+
}));
|
|
1014
|
+
}.bind(this)
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if (columnPlaceholder) {
|
|
1019
|
+
var lastUnFixedIndex = (0, _findLastIndex2.default)(newColumns, function (columnConfig) {
|
|
1020
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
1021
|
+
return !columnConfig.fixed;
|
|
1022
|
+
}.bind(this));
|
|
1023
|
+
newColumns.splice(lastUnFixedIndex + 1, 0, {
|
|
1024
|
+
title: '',
|
|
1025
|
+
key: placeholderKey,
|
|
1026
|
+
onHeaderCell: function onHeaderCell() {
|
|
1027
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
1028
|
+
return {
|
|
1029
|
+
className: _style.placeholderHeaderCls
|
|
1030
|
+
};
|
|
1031
|
+
}.bind(this),
|
|
1032
|
+
onCell: function onCell() {
|
|
1033
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
1034
|
+
return {
|
|
1035
|
+
className: _style.placeholderCellCls
|
|
1036
|
+
};
|
|
1037
|
+
}.bind(this),
|
|
1038
|
+
render: function render() {
|
|
1039
|
+
(0, _newArrowCheck2.default)(this, _this24);
|
|
1040
|
+
return null;
|
|
1041
|
+
}.bind(this)
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
return newColumns;
|
|
1046
|
+
}.bind(this);
|
|
1047
|
+
|
|
1048
|
+
_this2.getTableDom = function () {
|
|
1049
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1050
|
+
return document.querySelector("[data-table-id=\"".concat(_this2.tableId, "\"]"));
|
|
1051
|
+
}.bind(this);
|
|
1052
|
+
|
|
1053
|
+
_this2.getContentDom = function () {
|
|
1054
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1055
|
+
return _this2.getTableDom().querySelector(".".concat(_style.contentCls));
|
|
1056
|
+
}.bind(this);
|
|
1057
|
+
|
|
1058
|
+
_this2.getBodyDom = function () {
|
|
1059
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1060
|
+
return _this2.getTableDom().querySelector(".".concat(_style.bodyCls));
|
|
1061
|
+
}.bind(this);
|
|
1062
|
+
|
|
1063
|
+
_this2.getRowDom = function (rowKey) {
|
|
1064
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1065
|
+
return _this2.getTableDom().querySelector("tr[data-row-key=\"".concat(rowKey, "\"]"));
|
|
1066
|
+
}.bind(this);
|
|
1067
|
+
|
|
1068
|
+
_this2.getRowDomByIndex = function (rowIndex) {
|
|
1069
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1070
|
+
return _this2.getTableDom().querySelector("tr[data-row-index=\"".concat(rowIndex, "\"]"));
|
|
1071
|
+
}.bind(this);
|
|
1072
|
+
|
|
1073
|
+
_this2.__dragEnterCounter = null;
|
|
1074
|
+
|
|
1075
|
+
_this2.initDrag = function (source) {
|
|
1076
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1077
|
+
_this2.__dragEnterCounter = 0;
|
|
1078
|
+
|
|
1079
|
+
_this2.unsetDragOver(source, source);
|
|
1080
|
+
}.bind(this);
|
|
1081
|
+
|
|
1082
|
+
_this2.setDraggable = function (e) {
|
|
1083
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1084
|
+
var rowKey = e.currentTarget.dataset['rowKey'];
|
|
1085
|
+
|
|
1086
|
+
_this2.getRowDom(rowKey).setAttribute('draggable', true);
|
|
1087
|
+
}.bind(this);
|
|
1088
|
+
|
|
1089
|
+
_this2.unsetDraggable = function (e) {
|
|
1090
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1091
|
+
var rowKey = e.currentTarget.dataset['rowKey'];
|
|
1092
|
+
|
|
1093
|
+
_this2.getRowDom(rowKey).setAttribute('draggable', false);
|
|
1094
|
+
}.bind(this);
|
|
1095
|
+
|
|
1096
|
+
_this2.setDragOver = function (source, target) {
|
|
1097
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1098
|
+
|
|
1099
|
+
var _this2$transformDomIn = _this2.transformDomIndex(source, target),
|
|
1100
|
+
_this2$transformDomIn2 = (0, _slicedToArray2.default)(_this2$transformDomIn, 2),
|
|
1101
|
+
sourceIndex = _this2$transformDomIn2[0],
|
|
1102
|
+
targetIndex = _this2$transformDomIn2[1];
|
|
1103
|
+
|
|
1104
|
+
if (sourceIndex > targetIndex) targetIndex--;
|
|
1105
|
+
|
|
1106
|
+
if (targetIndex >= 0) {
|
|
1107
|
+
var _this2$getRowDomByInd;
|
|
1108
|
+
|
|
1109
|
+
(_this2$getRowDomByInd = _this2.getRowDomByIndex(targetIndex)) === null || _this2$getRowDomByInd === void 0 ? void 0 : _this2$getRowDomByInd.classList.add(_style.dragOverDownCls);
|
|
1110
|
+
} else {
|
|
1111
|
+
_this2.getRowDomByIndex(0).classList.add(_style.dragOverUpCls);
|
|
1112
|
+
}
|
|
1113
|
+
}.bind(this);
|
|
1114
|
+
|
|
1115
|
+
_this2.unsetDragOver = function (source, target) {
|
|
1116
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1117
|
+
|
|
1118
|
+
var _this2$transformDomIn3 = _this2.transformDomIndex(source, target),
|
|
1119
|
+
_this2$transformDomIn4 = (0, _slicedToArray2.default)(_this2$transformDomIn3, 2),
|
|
1120
|
+
sourceIndex = _this2$transformDomIn4[0],
|
|
1121
|
+
targetIndex = _this2$transformDomIn4[1];
|
|
1122
|
+
|
|
1123
|
+
if (sourceIndex > targetIndex) targetIndex--;
|
|
1124
|
+
|
|
1125
|
+
if (targetIndex >= 0) {
|
|
1126
|
+
var _this2$getRowDomByInd2;
|
|
1127
|
+
|
|
1128
|
+
(_this2$getRowDomByInd2 = _this2.getRowDomByIndex(targetIndex)) === null || _this2$getRowDomByInd2 === void 0 ? void 0 : _this2$getRowDomByInd2.classList.remove(_style.dragOverDownCls);
|
|
1129
|
+
} else {
|
|
1130
|
+
_this2.getRowDomByIndex(0).classList.remove(_style.dragOverUpCls);
|
|
1131
|
+
}
|
|
1132
|
+
}.bind(this);
|
|
1133
|
+
|
|
1134
|
+
_this2.onDragStart = function (source) {
|
|
1135
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1136
|
+
|
|
1137
|
+
_this2.initDrag(source);
|
|
1138
|
+
}.bind(this);
|
|
1139
|
+
|
|
1140
|
+
_this2.onDragEnd = function (source) {
|
|
1141
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1142
|
+
|
|
1143
|
+
_this2.initDrag(source);
|
|
1144
|
+
}.bind(this);
|
|
1145
|
+
|
|
1146
|
+
_this2.onDragEnter = function (source, target) {
|
|
1147
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1148
|
+
_this2.__dragEnterCounter++;
|
|
1149
|
+
|
|
1150
|
+
_this2.unsetDragOver(source, source);
|
|
1151
|
+
|
|
1152
|
+
_this2.setDragOver(source, target);
|
|
1153
|
+
}.bind(this);
|
|
1154
|
+
|
|
1155
|
+
_this2.onDragLeave = function (source, target) {
|
|
1156
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1157
|
+
_this2.__dragEnterCounter--;
|
|
1158
|
+
|
|
1159
|
+
_this2.unsetDragOver(source, target); // drag out the table
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
if (!_this2.__dragEnterCounter) _this2.setDragOver(source, source);
|
|
1163
|
+
}.bind(this);
|
|
1164
|
+
|
|
1165
|
+
_this2.onDrop = function (source, target) {
|
|
1166
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1167
|
+
if (source === target) return;
|
|
1168
|
+
|
|
1169
|
+
var _this2$transformDomIn5 = _this2.transformDomIndex(source, target),
|
|
1170
|
+
_this2$transformDomIn6 = (0, _slicedToArray2.default)(_this2$transformDomIn5, 2),
|
|
1171
|
+
sourceIndex = _this2$transformDomIn6[0],
|
|
1172
|
+
targetIndex = _this2$transformDomIn6[1];
|
|
1173
|
+
|
|
1174
|
+
var dragSorting = _this2.getDragSorting();
|
|
1175
|
+
|
|
1176
|
+
dragSorting === null || dragSorting === void 0 ? void 0 : dragSorting.onChange(sourceIndex, targetIndex);
|
|
1177
|
+
|
|
1178
|
+
_this2.initDrag(source);
|
|
1179
|
+
}.bind(this);
|
|
1180
|
+
|
|
1181
|
+
_this2.transformDomIndex = function (source, target) {
|
|
1182
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1183
|
+
return [+source.dataset['rowIndex'], +target.dataset['rowIndex']];
|
|
1184
|
+
}.bind(this);
|
|
1185
|
+
|
|
1186
|
+
_this2.getPagination = function () {
|
|
1187
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1188
|
+
var paginationS = _this2.state.pagination,
|
|
1189
|
+
paginationP = _this2.props.pagination;
|
|
1190
|
+
return paginationP === null ? null : _objectSpread(_objectSpread({}, paginationS), paginationP);
|
|
1191
|
+
}.bind(this);
|
|
1192
|
+
|
|
1193
|
+
_this2.renderSearchInfo = function (option) {
|
|
1194
|
+
var _this29 = this;
|
|
1195
|
+
|
|
1196
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1197
|
+
var filters = option.filters,
|
|
1198
|
+
searchValue = option.searchValue,
|
|
1199
|
+
total = option.total,
|
|
1200
|
+
locale = option.locale;
|
|
1201
|
+
var first = true;
|
|
1202
|
+
|
|
1203
|
+
var renderLabel = function renderLabel(_ref5) {
|
|
1204
|
+
var _this30 = this;
|
|
1205
|
+
|
|
1206
|
+
(0, _newArrowCheck2.default)(this, _this29);
|
|
1207
|
+
var value = _ref5.value,
|
|
1208
|
+
_ref5$column$filter = _ref5.column.filter,
|
|
1209
|
+
multiple = _ref5$column$filter.multiple,
|
|
1210
|
+
options = _ref5$column$filter.options;
|
|
1211
|
+
options = options.map(function (option) {
|
|
1212
|
+
(0, _newArrowCheck2.default)(this, _this30);
|
|
1213
|
+
return !(0, _isObject2.default)(option) ? {
|
|
1214
|
+
value: option,
|
|
1215
|
+
label: option
|
|
1216
|
+
} : option;
|
|
1217
|
+
}.bind(this));
|
|
1218
|
+
|
|
1219
|
+
if (multiple) {
|
|
1220
|
+
var label = (0, _map2.default)(value, function (v) {
|
|
1221
|
+
var _this31 = this;
|
|
1222
|
+
|
|
1223
|
+
(0, _newArrowCheck2.default)(this, _this30);
|
|
1224
|
+
var option = (0, _find2.default)(options, function (option) {
|
|
1225
|
+
(0, _newArrowCheck2.default)(this, _this31);
|
|
1226
|
+
return v === option.value;
|
|
1227
|
+
}.bind(this));
|
|
1228
|
+
return option && option.label;
|
|
1229
|
+
}.bind(this));
|
|
1230
|
+
var _first = true;
|
|
1231
|
+
return (0, _map2.default)(label, function (_label) {
|
|
1232
|
+
(0, _newArrowCheck2.default)(this, _this30);
|
|
1233
|
+
return _first ? [_first = false, _label] : [' | ', _label];
|
|
1234
|
+
}.bind(this));
|
|
1235
|
+
} else {
|
|
1236
|
+
var _option = (0, _find2.default)(options, function (option) {
|
|
1237
|
+
(0, _newArrowCheck2.default)(this, _this30);
|
|
1238
|
+
return value === option.value;
|
|
1239
|
+
}.bind(this));
|
|
1240
|
+
|
|
1241
|
+
return _option && _option.label;
|
|
1242
|
+
}
|
|
1243
|
+
}.bind(this);
|
|
1244
|
+
|
|
1245
|
+
return !(0, _isEmpty2.default)(filters) || searchValue ? /*#__PURE__*/_react.default.createElement("div", {
|
|
1246
|
+
key: "search-info",
|
|
1247
|
+
className: "".concat(_style.prefixCls, "-search-tip-wrap")
|
|
1248
|
+
}, /*#__PURE__*/_react.default.createElement(_Notice.default, {
|
|
1249
|
+
icon: null,
|
|
1250
|
+
closable: false,
|
|
1251
|
+
className: "".concat(_style.prefixCls, "-filter-notice")
|
|
1252
|
+
}, searchValue && /*#__PURE__*/_react.default.createElement("span", null, locale.search, locale.colon, searchValue, locale.semicolon), !(0, _isEmpty2.default)(filters) && /*#__PURE__*/_react.default.createElement("span", null, locale.filter, locale.colon, (0, _map2.default)(filters, function (filterInfo) {
|
|
1253
|
+
(0, _newArrowCheck2.default)(this, _this29);
|
|
1254
|
+
return first ? [first = false, renderLabel(filterInfo)] : [', ', renderLabel(filterInfo)];
|
|
1255
|
+
}.bind(this)), locale.semicolon), /*#__PURE__*/_react.default.createElement("span", null, locale.searchResult, locale.colon, total, locale.items, locale.semicolon), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("a", {
|
|
1256
|
+
className: "".concat(_style.prefixCls, "-reset-link"),
|
|
1257
|
+
onClick: _this2.clearFilter
|
|
1258
|
+
}, locale.reset)))) : null;
|
|
1259
|
+
}.bind(this);
|
|
1260
|
+
|
|
1261
|
+
_this2.renderEmptyAndErrorInfo = function (option) {
|
|
1262
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1263
|
+
var dataSource = option.dataSource,
|
|
1264
|
+
emptyContent = option.emptyContent,
|
|
1265
|
+
errorContent = option.errorContent;
|
|
1266
|
+
|
|
1267
|
+
if (errorContent) {
|
|
1268
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1269
|
+
key: "tip-info",
|
|
1270
|
+
className: "".concat(_style.prefixCls, "-tip-wrap")
|
|
1271
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1272
|
+
className: "".concat(_style.prefixCls, "-error-content-wrap")
|
|
1273
|
+
}, errorContent));
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
if ((!dataSource || !dataSource.length) && emptyContent) {
|
|
1277
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
1278
|
+
key: "tip-info",
|
|
1279
|
+
className: "".concat(_style.prefixCls, "-tip-wrap")
|
|
1280
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
1281
|
+
className: "".concat(_style.prefixCls, "-empty-content-wrap")
|
|
1282
|
+
}, emptyContent));
|
|
1283
|
+
}
|
|
1284
|
+
}.bind(this);
|
|
1285
|
+
|
|
1286
|
+
_this2.renderTitle = function (option) {
|
|
1287
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1288
|
+
var title = _this2.props.title;
|
|
1289
|
+
return [title && /*#__PURE__*/_react.default.createElement("div", {
|
|
1290
|
+
className: "".concat(_style.prefixCls, "-custom-title"),
|
|
1291
|
+
key: "custom"
|
|
1292
|
+
}, title()), _this2.renderSearchInfo(option)];
|
|
1293
|
+
}.bind(this);
|
|
1294
|
+
|
|
1295
|
+
_this2.renderFooter = function (option) {
|
|
1296
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1297
|
+
return /*#__PURE__*/_react.default.createElement("div", null, _this2.renderEmptyAndErrorInfo(option));
|
|
1298
|
+
}.bind(this);
|
|
1299
|
+
|
|
1300
|
+
_this2.onExpandHandler = function (expanded, record) {
|
|
1301
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1302
|
+
var _this2$state$changedU = _this2.state.changedUnExpandedRowKeys,
|
|
1303
|
+
changedUnExpandedRowKeys = _this2$state$changedU === void 0 ? {} : _this2$state$changedU;
|
|
1304
|
+
var onExpand = _this2.props.onExpand;
|
|
1305
|
+
|
|
1306
|
+
var rowKey = _this2.getRowKey(record);
|
|
1307
|
+
|
|
1308
|
+
if (expanded) {
|
|
1309
|
+
delete changedUnExpandedRowKeys[rowKey];
|
|
1310
|
+
} else {
|
|
1311
|
+
changedUnExpandedRowKeys[rowKey] = true;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
_this2.setState({
|
|
1315
|
+
changedUnExpandedRowKeys: changedUnExpandedRowKeys
|
|
1316
|
+
});
|
|
1317
|
+
|
|
1318
|
+
if (onExpand) {
|
|
1319
|
+
onExpand(expanded, record);
|
|
1320
|
+
}
|
|
1321
|
+
}.bind(this);
|
|
1322
|
+
|
|
1323
|
+
_this2.onRow = function (record, index) {
|
|
1324
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1325
|
+
var _this2$props4 = _this2.props,
|
|
1326
|
+
_this2$props4$onRow = _this2$props4.onRow,
|
|
1327
|
+
onRow = _this2$props4$onRow === void 0 ? noop : _this2$props4$onRow,
|
|
1328
|
+
contextMenu = _this2$props4.contextMenu;
|
|
1329
|
+
return _objectSpread(_objectSpread({}, onRow(record, index)), {}, {
|
|
1330
|
+
record: record,
|
|
1331
|
+
contextMenu: contextMenu
|
|
1332
|
+
});
|
|
1333
|
+
}.bind(this);
|
|
1334
|
+
|
|
1335
|
+
_this2.savePopupContainer = function (_ref) {
|
|
1336
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1337
|
+
_this2.popupContainer = _ref;
|
|
1338
|
+
}.bind(this);
|
|
1339
|
+
|
|
1340
|
+
_this2.getPopupContainer = function () {
|
|
1341
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1342
|
+
return _this2.popupContainer;
|
|
1343
|
+
}.bind(this);
|
|
1344
|
+
|
|
1345
|
+
_this2.state = {
|
|
1346
|
+
filters: _this2.calDefaultFilters(_props),
|
|
1347
|
+
filtersFromProps: _this2.calFiltersFromProps(_props),
|
|
1348
|
+
order: null,
|
|
1349
|
+
selectedRowKeyMap: {},
|
|
1350
|
+
columnConfig: _props.defaultColumnConfig,
|
|
1351
|
+
searchValue: ''
|
|
1352
|
+
};
|
|
1353
|
+
_this2.tableId = "uc_table_uid_".concat(uid++); // init pagination
|
|
1354
|
+
|
|
1355
|
+
var _pagination = _props.pagination;
|
|
1356
|
+
|
|
1357
|
+
if ((0, _isObject2.default)(_pagination)) {
|
|
1358
|
+
_this2.state.pagination = {
|
|
1359
|
+
current: 'defaultCurrent' in _pagination ? _pagination.defaultCurrent : 1,
|
|
1360
|
+
pageSize: 'defaultPageSize' in _pagination ? _pagination.defaultPageSize : 10
|
|
1361
|
+
};
|
|
1362
|
+
} else {
|
|
1363
|
+
_this2.state.pagination = {
|
|
1364
|
+
current: 1,
|
|
1365
|
+
pageSize: 10
|
|
1366
|
+
};
|
|
1367
|
+
} // init selectedRowKeyMap from rowSelection
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
var _rowSelection = _props.rowSelection;
|
|
1371
|
+
var _selectedRowKeyMap = _this2.state.selectedRowKeyMap;
|
|
1372
|
+
|
|
1373
|
+
if ((0, _isObject2.default)(_rowSelection)) {
|
|
1374
|
+
if ('selectedRowKeys' in _rowSelection) {
|
|
1375
|
+
(0, _each2.default)(_rowSelection.selectedRowKeys, function (key) {
|
|
1376
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1377
|
+
return _selectedRowKeyMap[key] = true;
|
|
1378
|
+
}.bind(this));
|
|
1379
|
+
} else if ('defaultSelectedRowKeys' in _rowSelection) {
|
|
1380
|
+
(0, _each2.default)(_rowSelection.defaultSelectedRowKeys, function (key) {
|
|
1381
|
+
(0, _newArrowCheck2.default)(this, _this3);
|
|
1382
|
+
return _selectedRowKeyMap[key] = true;
|
|
1383
|
+
}.bind(this));
|
|
1384
|
+
}
|
|
1385
|
+
} // init order
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
if ('order' in _props) {
|
|
1389
|
+
var order = _this2.getOrder(_props.order, _props.columns);
|
|
1390
|
+
|
|
1391
|
+
_this2.state.order = order;
|
|
1392
|
+
} else if ('defaultOrder' in _props) {
|
|
1393
|
+
var _order = _this2.getOrder(_props.defaultOrder, _props.columns);
|
|
1394
|
+
|
|
1395
|
+
_this2.state.order = _order;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
_this2.check(_props);
|
|
1399
|
+
|
|
1400
|
+
return _this2;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
(0, _createClass2.default)(Table, [{
|
|
1404
|
+
key: "render",
|
|
1405
|
+
value: function render() {
|
|
1406
|
+
var _this32 = this;
|
|
1407
|
+
|
|
1408
|
+
/* eslint-disable no-unused-vars */
|
|
1409
|
+
var _this$props = this.props,
|
|
1410
|
+
_p = _this$props.pagination,
|
|
1411
|
+
_d = _this$props.dataSource,
|
|
1412
|
+
_c = _this$props.columns,
|
|
1413
|
+
rowSelection = _this$props.rowSelection,
|
|
1414
|
+
onRowSelect = _this$props.onRowSelect,
|
|
1415
|
+
contextMenu = _this$props.contextMenu,
|
|
1416
|
+
emptyContent = _this$props.emptyContent,
|
|
1417
|
+
errorContent = _this$props.errorContent,
|
|
1418
|
+
className = _this$props.className,
|
|
1419
|
+
style = _this$props.style,
|
|
1420
|
+
expandedRowRender = _this$props.expandedRowRender,
|
|
1421
|
+
expandIconAsCell = _this$props.expandIconAsCell,
|
|
1422
|
+
expandIconColumnIndex = _this$props.expandIconColumnIndex,
|
|
1423
|
+
defaultExpandAllRows = _this$props.defaultExpandAllRows,
|
|
1424
|
+
_this$props$title = _this$props.title,
|
|
1425
|
+
title = _this$props$title === void 0 ? noop : _this$props$title,
|
|
1426
|
+
_this$props$footer = _this$props.footer,
|
|
1427
|
+
footer = _this$props$footer === void 0 ? noop : _this$props$footer,
|
|
1428
|
+
columnResizable = _this$props.columnResizable,
|
|
1429
|
+
locale = _this$props.locale,
|
|
1430
|
+
hideExpandIcon = _this$props.hideExpandIcon,
|
|
1431
|
+
_this$props$onRow = _this$props.onRow,
|
|
1432
|
+
onRow = _this$props$onRow === void 0 ? noop : _this$props$onRow,
|
|
1433
|
+
components = _this$props.components,
|
|
1434
|
+
onExpand = _this$props.onExpand,
|
|
1435
|
+
zebraCrossing = _this$props.zebraCrossing,
|
|
1436
|
+
columnPlaceholder = _this$props.columnPlaceholder,
|
|
1437
|
+
tableLayout = _this$props.tableLayout,
|
|
1438
|
+
scroll = _this$props.scroll,
|
|
1439
|
+
customStyle = _this$props.customStyle,
|
|
1440
|
+
_dragSorting = _this$props.dragSorting,
|
|
1441
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded2);
|
|
1442
|
+
|
|
1443
|
+
if (emptyContent === undefined) {
|
|
1444
|
+
emptyContent = /*#__PURE__*/_react.default.createElement(_Notice.default, {
|
|
1445
|
+
closable: false
|
|
1446
|
+
}, locale.emptyTip);
|
|
1447
|
+
}
|
|
1448
|
+
/* eslint-enable no-unused-vars */
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
var pagination = this.getPagination();
|
|
1452
|
+
var _this$state = this.state,
|
|
1453
|
+
filters = _this$state.filters,
|
|
1454
|
+
filtersFromProps = _this$state.filtersFromProps,
|
|
1455
|
+
searchValue = _this$state.searchValue,
|
|
1456
|
+
columnConfig = _this$state.columnConfig;
|
|
1457
|
+
var finalFilters = this.mergeFilters(filters, filtersFromProps, _c);
|
|
1458
|
+
|
|
1459
|
+
var _this$getDataSource = this.getDataSource(finalFilters),
|
|
1460
|
+
dataSource = _this$getDataSource.dataSource,
|
|
1461
|
+
total = _this$getDataSource.total;
|
|
1462
|
+
|
|
1463
|
+
if (pagination && 'total' in pagination) {
|
|
1464
|
+
total = pagination.total;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
var columns = this.getColumns(dataSource, finalFilters);
|
|
1468
|
+
var defaultExpandAllRowsProps = !defaultExpandAllRows ? null : function () {
|
|
1469
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1470
|
+
var _this$state$changedUn = this.state.changedUnExpandedRowKeys,
|
|
1471
|
+
changedUnExpandedRowKeys = _this$state$changedUn === void 0 ? {} : _this$state$changedUn;
|
|
1472
|
+
var expandedRowKeys = this.getExpandedRowKeys(dataSource, changedUnExpandedRowKeys);
|
|
1473
|
+
return {
|
|
1474
|
+
expandedRowKeys: expandedRowKeys
|
|
1475
|
+
};
|
|
1476
|
+
}.bind(this)();
|
|
1477
|
+
var dragSorting = this.getDragSorting();
|
|
1478
|
+
return /*#__PURE__*/_react.default.createElement(_DragWrap.default, {
|
|
1479
|
+
draggable: !!dragSorting,
|
|
1480
|
+
onDragStart: this.onDragStart,
|
|
1481
|
+
onDragEnd: this.onDragEnd,
|
|
1482
|
+
onDrop: this.onDrop,
|
|
1483
|
+
onDragEnter: this.onDragEnter,
|
|
1484
|
+
onDragLeave: this.onDragLeave
|
|
1485
|
+
}, /*#__PURE__*/_react.default.createElement(_ContainerContext.InheritProvider, {
|
|
1486
|
+
value: {
|
|
1487
|
+
getPopupContainer: this.getPopupContainer
|
|
1488
|
+
}
|
|
1489
|
+
}, /*#__PURE__*/_react.default.createElement(TableContext.Provider, {
|
|
1490
|
+
value: {
|
|
1491
|
+
columns: _c,
|
|
1492
|
+
columnConfig: columnConfig,
|
|
1493
|
+
onColumnConfigChange: this.onColumnConfigChange,
|
|
1494
|
+
handleSearch: this.handleSearch,
|
|
1495
|
+
locale: locale
|
|
1496
|
+
}
|
|
1497
|
+
}, /*#__PURE__*/_react.default.createElement(_style.TableWrap, {
|
|
1498
|
+
className: className,
|
|
1499
|
+
style: style,
|
|
1500
|
+
hideExpandIcon: hideExpandIcon,
|
|
1501
|
+
zebraCrossing: zebraCrossing,
|
|
1502
|
+
customStyle: customStyle,
|
|
1503
|
+
"data-table-id": this.tableId
|
|
1504
|
+
}, /*#__PURE__*/_react.default.createElement(_style.PopupContainer, {
|
|
1505
|
+
ref: this.savePopupContainer
|
|
1506
|
+
}), /*#__PURE__*/_react.default.createElement(_rcTable.default, (0, _extends2.default)({}, defaultExpandAllRowsProps, {
|
|
1507
|
+
onExpand: this.onExpandHandler
|
|
1508
|
+
}, rest, {
|
|
1509
|
+
scroll: scroll,
|
|
1510
|
+
tableLayout: tableLayout ? tableLayout : scroll && scroll.x ? 'fixed' : undefined,
|
|
1511
|
+
prefixCls: _style.prefixCls,
|
|
1512
|
+
data: dataSource,
|
|
1513
|
+
columns: columns,
|
|
1514
|
+
onRow: this.onRow,
|
|
1515
|
+
components: (0, _extend2.default)({}, components, _objectSpread({
|
|
1516
|
+
body: {
|
|
1517
|
+
row: _TableRow.default
|
|
1518
|
+
}
|
|
1519
|
+
}, columnResizable ? {
|
|
1520
|
+
header: {
|
|
1521
|
+
cell: _ResizableTH.default
|
|
1522
|
+
}
|
|
1523
|
+
} : {})),
|
|
1524
|
+
emptyText: null,
|
|
1525
|
+
expandIconAsCell: !!expandedRowRender || expandIconAsCell,
|
|
1526
|
+
expandedRowRender: expandedRowRender,
|
|
1527
|
+
expandIconColumnIndex: expandIconColumnIndex === undefined ? columns[0] && columns[0].key === 'table_row_selection' ? 1 : 0 : expandIconColumnIndex,
|
|
1528
|
+
title: function () {
|
|
1529
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1530
|
+
return this.renderTitle({
|
|
1531
|
+
filters: finalFilters,
|
|
1532
|
+
searchValue: searchValue,
|
|
1533
|
+
total: total,
|
|
1534
|
+
locale: locale
|
|
1535
|
+
});
|
|
1536
|
+
}.bind(this),
|
|
1537
|
+
footer: function () {
|
|
1538
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1539
|
+
return this.renderFooter({
|
|
1540
|
+
dataSource: _d,
|
|
1541
|
+
emptyContent: emptyContent,
|
|
1542
|
+
errorContent: errorContent
|
|
1543
|
+
});
|
|
1544
|
+
}.bind(this)
|
|
1545
|
+
})), footer(), pagination === null ? null : /*#__PURE__*/_react.default.createElement(_Pagination.default, (0, _extends2.default)({
|
|
1546
|
+
size: "sm",
|
|
1547
|
+
total: total,
|
|
1548
|
+
hideOnSinglePage: false,
|
|
1549
|
+
showQuickJumper: true,
|
|
1550
|
+
showSizeChanger: true
|
|
1551
|
+
}, pagination, {
|
|
1552
|
+
className: "".concat(_style.prefixCls, "-pagination"),
|
|
1553
|
+
onChange: function (current, pageSize) {
|
|
1554
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1555
|
+
this.setState({
|
|
1556
|
+
pagination: {
|
|
1557
|
+
current: current,
|
|
1558
|
+
pageSize: pageSize
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
pagination.onChange && pagination.onChange(current, pageSize);
|
|
1562
|
+
}.bind(this),
|
|
1563
|
+
onPageSizeChange: function (current, pageSize) {
|
|
1564
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1565
|
+
this.setState({
|
|
1566
|
+
pagination: {
|
|
1567
|
+
current: current,
|
|
1568
|
+
pageSize: pageSize
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
pagination.onPageSizeChange && pagination.onPageSizeChange(current, pageSize);
|
|
1572
|
+
}.bind(this),
|
|
1573
|
+
onAdvise: function (current, pageSize) {
|
|
1574
|
+
(0, _newArrowCheck2.default)(this, _this32);
|
|
1575
|
+
this.setState({
|
|
1576
|
+
pagination: {
|
|
1577
|
+
current: current,
|
|
1578
|
+
pageSize: pageSize
|
|
1579
|
+
}
|
|
1580
|
+
});
|
|
1581
|
+
pagination.onAdvise && pagination.onAdvise(current, pageSize);
|
|
1582
|
+
}.bind(this)
|
|
1583
|
+
}))))));
|
|
1584
|
+
}
|
|
1585
|
+
}]);
|
|
1586
|
+
return Table;
|
|
1587
|
+
}(_react.Component), _class2.propTypes = {
|
|
1588
|
+
/** 分页组件的配置,传入null为隐藏分页 */
|
|
1589
|
+
pagination: _propTypes.default.object,
|
|
1590
|
+
|
|
1591
|
+
/** 数据源 */
|
|
1592
|
+
dataSource: _propTypes.default.array,
|
|
1593
|
+
|
|
1594
|
+
/** 表列信息,具体属性参考 columns 事例 */
|
|
1595
|
+
columns: _propTypes.default.array.isRequired,
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* 启用后会创建一个无宽度的空列,用作宽度占位,占位后宽度溢出便不会导致表格列被压缩,多出的宽度会被空列占用。
|
|
1599
|
+
* 占位列 column.key 为 table\_column\_width\_placeholder,使用中需注意避免重复 key
|
|
1600
|
+
*/
|
|
1601
|
+
columnPlaceholder: _propTypes.default.bool,
|
|
1602
|
+
|
|
1603
|
+
/** 表列配置项,非受控 */
|
|
1604
|
+
defaultColumnConfig: _propTypes.default.object,
|
|
1605
|
+
|
|
1606
|
+
/** 表列配置修改回调 */
|
|
1607
|
+
onColumnConfigChange: _propTypes.default.func,
|
|
1608
|
+
|
|
1609
|
+
/** 额外表信息渲染 */
|
|
1610
|
+
expandedRowRender: _propTypes.default.func,
|
|
1611
|
+
|
|
1612
|
+
/** 额外表展开按钮是否独立占据一格,data有children时有效 */
|
|
1613
|
+
expandIconAsCell: _propTypes.default.bool,
|
|
1614
|
+
|
|
1615
|
+
/** 展开按钮的塞入的column index,expandIconAsCell为false时生效 */
|
|
1616
|
+
expandIconColumnIndex: _propTypes.default.number,
|
|
1617
|
+
|
|
1618
|
+
/** 隐藏扩展列按钮 */
|
|
1619
|
+
hideExpandIcon: _propTypes.default.bool,
|
|
1620
|
+
|
|
1621
|
+
/** 默认展开项,非受控 */
|
|
1622
|
+
defaultExpandedRowKeys: _propTypes.default.array,
|
|
1623
|
+
|
|
1624
|
+
/** 展开项,受控 */
|
|
1625
|
+
expandedRowKeys: _propTypes.default.array,
|
|
1626
|
+
|
|
1627
|
+
/** 是否默认展开所有列 */
|
|
1628
|
+
defaultExpandAllRows: _propTypes.default.bool,
|
|
1629
|
+
|
|
1630
|
+
/** 展开事件 */
|
|
1631
|
+
onExpandedRowsChange: _propTypes.default.func,
|
|
1632
|
+
|
|
1633
|
+
/** 展开按钮点击事件 */
|
|
1634
|
+
onExpand: _propTypes.default.func,
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* 设置行props
|
|
1638
|
+
* @argument record - 行数据
|
|
1639
|
+
* @argument index - 行当前翻页中的index 不可作为key使用 不建议使用
|
|
1640
|
+
*/
|
|
1641
|
+
onRow: _propTypes.default.func,
|
|
1642
|
+
|
|
1643
|
+
/** 设置表头props
|
|
1644
|
+
* @argument record - 行数据
|
|
1645
|
+
* @argument index - 表头行的index 表示存在分组时(column.children)的表头层级
|
|
1646
|
+
*/
|
|
1647
|
+
onHeaderRow: _propTypes.default.func,
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* 列表可选选项配置.
|
|
1651
|
+
* column.key 为 table\_row\_selection,使用中需注意避免重复 key
|
|
1652
|
+
*/
|
|
1653
|
+
rowSelection: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
1654
|
+
/** 选框是否为 fixed */
|
|
1655
|
+
fixed: _propTypes.default.bool,
|
|
1656
|
+
|
|
1657
|
+
/** 选中项变化回调 */
|
|
1658
|
+
onChange: _propTypes.default.func,
|
|
1659
|
+
|
|
1660
|
+
/** 默认当前选中项,uncontrolled */
|
|
1661
|
+
defaultSelectedRowKeys: _propTypes.default.array,
|
|
1662
|
+
|
|
1663
|
+
/** 当前选中项,controlled */
|
|
1664
|
+
selectedRowKeys: _propTypes.default.array,
|
|
1665
|
+
|
|
1666
|
+
/** 获取当前行选中禁用状态 */
|
|
1667
|
+
getDisabledOfRow: _propTypes.default.func,
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* 是否多选
|
|
1671
|
+
* @default true
|
|
1672
|
+
*/
|
|
1673
|
+
multiple: _propTypes.default.bool,
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* 多选选中时的提示,bottom 为显示在下方
|
|
1677
|
+
* @default true
|
|
1678
|
+
*/
|
|
1679
|
+
selectedTip: _propTypes.default.oneOf([true, false, 'bottom']),
|
|
1680
|
+
|
|
1681
|
+
/** 是否禁用 */
|
|
1682
|
+
disabled: _propTypes.default.bool
|
|
1683
|
+
}), _propTypes.default.oneOf([true])]),
|
|
1684
|
+
|
|
1685
|
+
/** 拖拽排序 */
|
|
1686
|
+
dragSorting: _propTypes.default.oneOfType([_propTypes.default.oneOf([true]), _propTypes.default.shape({
|
|
1687
|
+
fixed: _propTypes.default.bool,
|
|
1688
|
+
// (record, fromIndex, toIndex) => void
|
|
1689
|
+
onChange: _propTypes.default.func
|
|
1690
|
+
})]),
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* 列表选项变化回调
|
|
1694
|
+
* @deprecated - 请使用rowSelection.onChange来替换
|
|
1695
|
+
*/
|
|
1696
|
+
onRowSelect: _propTypes.default.func,
|
|
1697
|
+
|
|
1698
|
+
/** 是否显示表头 */
|
|
1699
|
+
showHeader: _propTypes.default.bool,
|
|
1700
|
+
|
|
1701
|
+
/** 是否可拖拽调节表格列大小 */
|
|
1702
|
+
columnResizable: _propTypes.default.bool,
|
|
1703
|
+
|
|
1704
|
+
/** 头部内容 */
|
|
1705
|
+
title: _propTypes.default.func,
|
|
1706
|
+
|
|
1707
|
+
/** 底部内容 */
|
|
1708
|
+
footer: _propTypes.default.func,
|
|
1709
|
+
|
|
1710
|
+
/** 无数据时的展示内容 */
|
|
1711
|
+
emptyContent: _propTypes.default.node,
|
|
1712
|
+
|
|
1713
|
+
/** 报错信息 */
|
|
1714
|
+
errorContent: _propTypes.default.node,
|
|
1715
|
+
|
|
1716
|
+
/** 如何搜索 */
|
|
1717
|
+
handleSearch: _propTypes.default.func,
|
|
1718
|
+
|
|
1719
|
+
/** 自定义样式 */
|
|
1720
|
+
customStyle: _propTypes.default.shape({
|
|
1721
|
+
outerPadding: _propTypes.default.string
|
|
1722
|
+
}),
|
|
1723
|
+
|
|
1724
|
+
/** 滚动配置 */
|
|
1725
|
+
scroll: _propTypes.default.shape({
|
|
1726
|
+
/** x轴滚动配置,为true自动展开并滚动,为数字时设定表单的宽度 */
|
|
1727
|
+
x: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.number]),
|
|
1728
|
+
|
|
1729
|
+
/** y轴滚动配置,为数字时设定表单的高度 */
|
|
1730
|
+
y: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.number]),
|
|
1731
|
+
|
|
1732
|
+
/** table body 滚动时的回调 */
|
|
1733
|
+
onScroll: _propTypes.default.func
|
|
1734
|
+
}),
|
|
1735
|
+
|
|
1736
|
+
/** 表格布局,当 scroll.x 有值时为 fixed,其它时候默认为 auto,可自行覆盖 */
|
|
1737
|
+
tableLayout: _propTypes.default.oneOf(['auto', 'fixed']),
|
|
1738
|
+
|
|
1739
|
+
/** 定义如何获取每行的键值 */
|
|
1740
|
+
rowKey: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
1741
|
+
|
|
1742
|
+
/** 是否有斑马线,存在子表格时,斑马线样式可能会错乱 */
|
|
1743
|
+
zebraCrossing: _propTypes.default.bool,
|
|
1744
|
+
|
|
1745
|
+
/** 自定义表格组件,慎用 */
|
|
1746
|
+
components: _propTypes.default.shape({
|
|
1747
|
+
header: _propTypes.default.shape({
|
|
1748
|
+
cell: _propTypes.default.any
|
|
1749
|
+
})
|
|
1750
|
+
}),
|
|
1751
|
+
|
|
1752
|
+
/** 默认排序设置,key 为 column key,state 为升序(asc)或降序(desc) */
|
|
1753
|
+
defaultOrder: _propTypes.default.shape({
|
|
1754
|
+
key: _propTypes.default.string,
|
|
1755
|
+
state: _propTypes.default.oneOf(['desc', 'asc'])
|
|
1756
|
+
}),
|
|
1757
|
+
|
|
1758
|
+
/** 受控排序设置,key 为 column key,state 为升序(asc)或降序(desc) */
|
|
1759
|
+
order: _propTypes.default.shape({
|
|
1760
|
+
key: _propTypes.default.string,
|
|
1761
|
+
state: _propTypes.default.oneOf(['desc', 'asc'])
|
|
1762
|
+
}),
|
|
1763
|
+
|
|
1764
|
+
/**
|
|
1765
|
+
* 表格的筛选等条件变更时的回调
|
|
1766
|
+
* @param condition - 变更的数据
|
|
1767
|
+
* @param condition.order - 排序
|
|
1768
|
+
* @param condition.filter - 筛选
|
|
1769
|
+
* @param condition.searchValue - 搜索
|
|
1770
|
+
*/
|
|
1771
|
+
onConditionChange: _propTypes.default.func,
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* order、filter、searchValue、pagination变化时表格内部不处理
|
|
1775
|
+
*/
|
|
1776
|
+
doNotHandleCondition: _propTypes.default.bool,
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* 右键菜单
|
|
1780
|
+
* @param record - 该行的记录值
|
|
1781
|
+
*/
|
|
1782
|
+
contextMenu: _propTypes.default.func,
|
|
1783
|
+
|
|
1784
|
+
/** @ignore */
|
|
1785
|
+
className: _propTypes.default.string,
|
|
1786
|
+
|
|
1787
|
+
/** @ignore */
|
|
1788
|
+
style: _propTypes.default.object,
|
|
1789
|
+
|
|
1790
|
+
/** @ignore */
|
|
1791
|
+
locale: _propTypes.default.object
|
|
1792
|
+
}, _class2.defaultProps = {
|
|
1793
|
+
pagination: {},
|
|
1794
|
+
dataSource: [],
|
|
1795
|
+
columns: [],
|
|
1796
|
+
defaultColumnConfig: {},
|
|
1797
|
+
onColumnConfigChange: function onColumnConfigChange() {
|
|
1798
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
1799
|
+
}.bind(void 0),
|
|
1800
|
+
handleSearch: function handleSearch(record, searchValue) {
|
|
1801
|
+
(0, _newArrowCheck2.default)(this, _this);
|
|
1802
|
+
return (0, _map2.default)(record).join('').indexOf(searchValue) >= 0;
|
|
1803
|
+
}.bind(void 0),
|
|
1804
|
+
customStyle: {},
|
|
1805
|
+
rowKey: 'key'
|
|
1806
|
+
}, _temp)) || _class);
|
|
1807
|
+
var _default = Table;
|
|
1808
|
+
exports.default = _default;
|