@ucloud-fe/react-components 1.5.16 → 1.5.17
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/package.json +1 -1
- package/CHANGELOG.md +0 -1926
- package/dist/assets/ucicon.eot +0 -0
- package/dist/assets/ucicon.svg +0 -1569
- package/dist/assets/ucicon.ttf +0 -0
- package/dist/assets/ucicon.woff +0 -0
- package/dist/icon.min.css +0 -1
- package/dist/icon.min.js +0 -1
- package/dist/main.min.js +0 -19
- package/lib/__index.js +0 -228
- package/lib/components/ActionList/ActionList.d.ts +0 -40
- package/lib/components/ActionList/ActionList.js +0 -349
- package/lib/components/ActionList/index.d.ts +0 -10
- package/lib/components/ActionList/index.js +0 -23
- package/lib/components/ActionList/style/index.d.ts +0 -3
- package/lib/components/ActionList/style/index.js +0 -45
- package/lib/components/AutoComplete/AutoComplete.d.ts +0 -40
- package/lib/components/AutoComplete/AutoComplete.js +0 -181
- package/lib/components/AutoComplete/Popup.d.ts +0 -19
- package/lib/components/AutoComplete/Popup.js +0 -123
- package/lib/components/AutoComplete/index.d.ts +0 -2
- package/lib/components/AutoComplete/index.js +0 -13
- package/lib/components/AutoComplete/style/index.d.ts +0 -17
- package/lib/components/AutoComplete/style/index.js +0 -55
- package/lib/components/Badge/Badge.d.ts +0 -43
- package/lib/components/Badge/Badge.js +0 -175
- package/lib/components/Badge/Bubble.d.ts +0 -47
- package/lib/components/Badge/Bubble.js +0 -152
- package/lib/components/Badge/index.d.ts +0 -7
- package/lib/components/Badge/index.js +0 -20
- package/lib/components/Badge/placements.d.ts +0 -35
- package/lib/components/Badge/placements.js +0 -43
- package/lib/components/Badge/style/index.d.ts +0 -54
- package/lib/components/Badge/style/index.js +0 -143
- package/lib/components/Box/Box.d.ts +0 -47
- package/lib/components/Box/Box.js +0 -135
- package/lib/components/Box/index.d.ts +0 -2
- package/lib/components/Box/index.js +0 -13
- package/lib/components/Box/style/index.d.ts +0 -1
- package/lib/components/Box/style/index.js +0 -136
- package/lib/components/Breadcrumb/BackButton.d.ts +0 -4
- package/lib/components/Breadcrumb/BackButton.js +0 -24
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +0 -10
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -60
- package/lib/components/Breadcrumb/Item.d.ts +0 -16
- package/lib/components/Breadcrumb/Item.js +0 -62
- package/lib/components/Breadcrumb/index.d.ts +0 -11
- package/lib/components/Breadcrumb/index.js +0 -27
- package/lib/components/Breadcrumb/interface.d.ts +0 -2
- package/lib/components/Breadcrumb/interface.js +0 -11
- package/lib/components/Breadcrumb/style/index.d.ts +0 -20
- package/lib/components/Breadcrumb/style/index.js +0 -104
- package/lib/components/Button/.recodo/interaction.js +0 -64
- package/lib/components/Button/Button.d.ts +0 -54
- package/lib/components/Button/Button.js +0 -132
- package/lib/components/Button/index.d.ts +0 -2
- package/lib/components/Button/index.js +0 -13
- package/lib/components/Button/shared.d.ts +0 -3
- package/lib/components/Button/shared.js +0 -15
- package/lib/components/Button/style/index.d.ts +0 -22
- package/lib/components/Button/style/index.js +0 -240
- package/lib/components/Calendar/Calendar.d.ts +0 -37
- package/lib/components/Calendar/Calendar.js +0 -113
- package/lib/components/Calendar/Cell.d.ts +0 -8
- package/lib/components/Calendar/Cell.js +0 -55
- package/lib/components/Calendar/HeaderButton.d.ts +0 -8
- package/lib/components/Calendar/HeaderButton.js +0 -75
- package/lib/components/Calendar/HeaderSwitcher.d.ts +0 -17
- package/lib/components/Calendar/HeaderSwitcher.js +0 -64
- package/lib/components/Calendar/Month.d.ts +0 -5
- package/lib/components/Calendar/Month.js +0 -93
- package/lib/components/Calendar/TwoSide.d.ts +0 -4
- package/lib/components/Calendar/TwoSide.js +0 -155
- package/lib/components/Calendar/index.d.ts +0 -10
- package/lib/components/Calendar/index.js +0 -26
- package/lib/components/Calendar/locale/en_US.js +0 -30
- package/lib/components/Calendar/locale/zh_CN.d.ts +0 -11
- package/lib/components/Calendar/locale/zh_CN.js +0 -27
- package/lib/components/Calendar/style/index.d.ts +0 -25
- package/lib/components/Calendar/style/index.js +0 -82
- package/lib/components/Calendar/utils.d.ts +0 -16
- package/lib/components/Calendar/utils.js +0 -162
- package/lib/components/Card/Action.js +0 -27
- package/lib/components/Card/Card.js +0 -109
- package/lib/components/Card/Content.js +0 -28
- package/lib/components/Card/Footer.js +0 -28
- package/lib/components/Card/Header.js +0 -40
- package/lib/components/Card/SubArea.js +0 -43
- package/lib/components/Card/index.js +0 -30
- package/lib/components/Card/style/index.js +0 -131
- package/lib/components/Cascader/Cascade.d.ts +0 -24
- package/lib/components/Cascader/Cascade.js +0 -280
- package/lib/components/Cascader/CascadeContext.d.ts +0 -7
- package/lib/components/Cascader/CascadeContext.js +0 -20
- package/lib/components/Cascader/Cascader.d.ts +0 -41
- package/lib/components/Cascader/Cascader.js +0 -359
- package/lib/components/Cascader/Item.d.ts +0 -14
- package/lib/components/Cascader/Item.js +0 -97
- package/lib/components/Cascader/Items.d.ts +0 -11
- package/lib/components/Cascader/Items.js +0 -175
- package/lib/components/Cascader/index.d.ts +0 -2
- package/lib/components/Cascader/index.js +0 -13
- package/lib/components/Cascader/interface.d.ts +0 -12
- package/lib/components/Cascader/interface.js +0 -5
- package/lib/components/Cascader/locale/en_US.js +0 -11
- package/lib/components/Cascader/locale/zh_CN.d.ts +0 -5
- package/lib/components/Cascader/locale/zh_CN.js +0 -11
- package/lib/components/Cascader/style/cascade.d.ts +0 -15
- package/lib/components/Cascader/style/cascade.js +0 -55
- package/lib/components/Cascader/style/index.d.ts +0 -11
- package/lib/components/Cascader/style/index.js +0 -49
- package/lib/components/Checkbox/.recodo/interaction.js +0 -100
- package/lib/components/Checkbox/Checkbox.d.ts +0 -29
- package/lib/components/Checkbox/Checkbox.js +0 -177
- package/lib/components/Checkbox/CheckboxContext.d.ts +0 -8
- package/lib/components/Checkbox/CheckboxContext.js +0 -21
- package/lib/components/Checkbox/CheckboxIcon.d.ts +0 -7
- package/lib/components/Checkbox/CheckboxIcon.js +0 -42
- package/lib/components/Checkbox/Group.d.ts +0 -26
- package/lib/components/Checkbox/Group.js +0 -108
- package/lib/components/Checkbox/index.d.ts +0 -13
- package/lib/components/Checkbox/index.js +0 -28
- package/lib/components/Checkbox/interface.d.ts +0 -8
- package/lib/components/Checkbox/interface.js +0 -17
- package/lib/components/Checkbox/style/index.d.ts +0 -31
- package/lib/components/Checkbox/style/index.js +0 -81
- package/lib/components/Col/index.js +0 -14
- package/lib/components/Collapse/Collapse.d.ts +0 -19
- package/lib/components/Collapse/Collapse.js +0 -63
- package/lib/components/Collapse/CollapseContext.d.ts +0 -4
- package/lib/components/Collapse/CollapseContext.js +0 -17
- package/lib/components/Collapse/Panel.d.ts +0 -29
- package/lib/components/Collapse/Panel.js +0 -98
- package/lib/components/Collapse/hooks.d.ts +0 -29
- package/lib/components/Collapse/hooks.js +0 -103
- package/lib/components/Collapse/index.d.ts +0 -9
- package/lib/components/Collapse/index.js +0 -26
- package/lib/components/Collapse/style/index.d.ts +0 -6
- package/lib/components/Collapse/style/index.js +0 -39
- package/lib/components/Combine/Combine.d.ts +0 -19
- package/lib/components/Combine/Combine.js +0 -80
- package/lib/components/Combine/index.d.ts +0 -3
- package/lib/components/Combine/index.js +0 -13
- package/lib/components/Combine/style/index.d.ts +0 -6
- package/lib/components/Combine/style/index.js +0 -60
- package/lib/components/Compact/Compact.js +0 -108
- package/lib/components/Compact/index.js +0 -13
- package/lib/components/Compact/style/index.js +0 -16
- package/lib/components/ConfigProvider/ConfigContext.d.ts +0 -9
- package/lib/components/ConfigProvider/ConfigContext.js +0 -24
- package/lib/components/ConfigProvider/ConfigProvider.d.ts +0 -40
- package/lib/components/ConfigProvider/ConfigProvider.js +0 -75
- package/lib/components/ConfigProvider/index.d.ts +0 -4
- package/lib/components/ConfigProvider/index.js +0 -20
- package/lib/components/DatePicker/DatePicker.d.ts +0 -73
- package/lib/components/DatePicker/DatePicker.js +0 -168
- package/lib/components/DatePicker/Footer.d.ts +0 -23
- package/lib/components/DatePicker/Footer.js +0 -96
- package/lib/components/DatePicker/Month.d.ts +0 -5
- package/lib/components/DatePicker/Month.js +0 -88
- package/lib/components/DatePicker/Range.d.ts +0 -101
- package/lib/components/DatePicker/Range.js +0 -549
- package/lib/components/DatePicker/index.d.ts +0 -11
- package/lib/components/DatePicker/index.js +0 -23
- package/lib/components/DatePicker/locale/en_US.js +0 -26
- package/lib/components/DatePicker/locale/zh_CN.d.ts +0 -20
- package/lib/components/DatePicker/locale/zh_CN.js +0 -26
- package/lib/components/DatePicker/style/index.d.ts +0 -62
- package/lib/components/DatePicker/style/index.js +0 -193
- package/lib/components/DatePicker/usePicker.d.ts +0 -11
- package/lib/components/DatePicker/usePicker.js +0 -424
- package/lib/components/DatePicker/useRangePicker.d.ts +0 -18
- package/lib/components/DatePicker/useRangePicker.js +0 -111
- package/lib/components/DatePicker/utils.d.ts +0 -18
- package/lib/components/DatePicker/utils.js +0 -143
- package/lib/components/Drawer/Drawer.js +0 -252
- package/lib/components/Drawer/index.js +0 -13
- package/lib/components/Drawer/style/index.js +0 -82
- package/lib/components/EditableList/EditableList.js +0 -277
- package/lib/components/EditableList/index.js +0 -13
- package/lib/components/EditableList/locale/en_US.js +0 -10
- package/lib/components/EditableList/locale/zh_CN.js +0 -10
- package/lib/components/EditableList/style/index.js +0 -28
- package/lib/components/EditableTable/EditableTable.js +0 -227
- package/lib/components/EditableTable/index.js +0 -13
- package/lib/components/EditableTable/style/index.js +0 -60
- package/lib/components/Form/ControllerContext.d.ts +0 -5
- package/lib/components/Form/ControllerContext.js +0 -15
- package/lib/components/Form/Form.js +0 -95
- package/lib/components/Form/Group.js +0 -89
- package/lib/components/Form/Item.d.ts +0 -37
- package/lib/components/Form/Item.js +0 -243
- package/lib/components/Form/ItemContext.d.ts +0 -3
- package/lib/components/Form/ItemContext.js +0 -15
- package/lib/components/Form/ItemPropsWrap.js +0 -44
- package/lib/components/Form/SubArea.js +0 -48
- package/lib/components/Form/index.js +0 -22
- package/lib/components/Form/style/index.d.ts +0 -59
- package/lib/components/Form/style/index.js +0 -229
- package/lib/components/Grid/Col.d.ts +0 -16
- package/lib/components/Grid/Col.js +0 -51
- package/lib/components/Grid/Row.d.ts +0 -17
- package/lib/components/Grid/Row.js +0 -68
- package/lib/components/Grid/index.d.ts +0 -8
- package/lib/components/Grid/index.js +0 -30
- package/lib/components/Grid/style/index.d.ts +0 -2
- package/lib/components/Grid/style/index.js +0 -143
- package/lib/components/Icon/Icon.d.ts +0 -11
- package/lib/components/Icon/Icon.js +0 -65
- package/lib/components/Icon/index.d.ts +0 -2
- package/lib/components/Icon/index.js +0 -13
- package/lib/components/Icon/style/index.d.ts +0 -7
- package/lib/components/Icon/style/index.js +0 -34
- package/lib/components/Input/.recodo/interaction.js +0 -96
- package/lib/components/Input/Input.d.ts +0 -45
- package/lib/components/Input/Input.js +0 -173
- package/lib/components/Input/Search.d.ts +0 -8
- package/lib/components/Input/Search.js +0 -82
- package/lib/components/Input/index.d.ts +0 -12
- package/lib/components/Input/index.js +0 -37
- package/lib/components/Input/style/index.d.ts +0 -34
- package/lib/components/Input/style/index.js +0 -169
- package/lib/components/Link/Button.d.ts +0 -24
- package/lib/components/Link/Button.js +0 -114
- package/lib/components/Link/Link.d.ts +0 -9
- package/lib/components/Link/Link.js +0 -30
- package/lib/components/Link/index.d.ts +0 -9
- package/lib/components/Link/index.js +0 -20
- package/lib/components/Link/style/index.d.ts +0 -3
- package/lib/components/Link/style/index.js +0 -35
- package/lib/components/Loading/Loading.d.ts +0 -27
- package/lib/components/Loading/Loading.js +0 -108
- package/lib/components/Loading/index.d.ts +0 -2
- package/lib/components/Loading/index.js +0 -13
- package/lib/components/Loading/style/index.d.ts +0 -8
- package/lib/components/Loading/style/index.js +0 -89
- package/lib/components/LocaleProvider/LocaleContext.d.ts +0 -9
- package/lib/components/LocaleProvider/LocaleContext.js +0 -15
- package/lib/components/LocaleProvider/LocaleProvider.d.ts +0 -7
- package/lib/components/LocaleProvider/LocaleProvider.js +0 -44
- package/lib/components/LocaleProvider/index.d.ts +0 -12
- package/lib/components/LocaleProvider/index.js +0 -20
- package/lib/components/LocaleProvider/locale/en_US.js +0 -55
- package/lib/components/LocaleProvider/locale/zh_CN.js +0 -55
- package/lib/components/LocaleProvider/localeConsumerDecorator.d.ts +0 -11
- package/lib/components/LocaleProvider/localeConsumerDecorator.js +0 -78
- package/lib/components/LocaleProvider/runtime.d.ts +0 -4
- package/lib/components/LocaleProvider/runtime.js +0 -28
- package/lib/components/LocaleProvider/useLocale.d.ts +0 -6
- package/lib/components/LocaleProvider/useLocale.js +0 -44
- package/lib/components/Menu/Item.d.ts +0 -20
- package/lib/components/Menu/Item.js +0 -107
- package/lib/components/Menu/Menu.d.ts +0 -59
- package/lib/components/Menu/Menu.js +0 -386
- package/lib/components/Menu/MenuContext.d.ts +0 -8
- package/lib/components/Menu/MenuContext.js +0 -27
- package/lib/components/Menu/SubMenu.d.ts +0 -20
- package/lib/components/Menu/SubMenu.js +0 -128
- package/lib/components/Menu/index.d.ts +0 -19
- package/lib/components/Menu/index.js +0 -35
- package/lib/components/Menu/locale/en_US.js +0 -10
- package/lib/components/Menu/locale/zh_CN.d.ts +0 -4
- package/lib/components/Menu/locale/zh_CN.js +0 -10
- package/lib/components/Menu/style/index.d.ts +0 -36
- package/lib/components/Menu/style/index.js +0 -117
- package/lib/components/Message/Message.js +0 -158
- package/lib/components/Message/MessageContainer.js +0 -145
- package/lib/components/Message/index.js +0 -22
- package/lib/components/Message/method.js +0 -232
- package/lib/components/Message/style/index.js +0 -141
- package/lib/components/Modal/Content.js +0 -57
- package/lib/components/Modal/Modal.js +0 -287
- package/lib/components/Modal/index.js +0 -25
- package/lib/components/Modal/locale/en_US.js +0 -11
- package/lib/components/Modal/locale/zh_CN.js +0 -11
- package/lib/components/Modal/method.js +0 -436
- package/lib/components/Modal/style/index.js +0 -137
- package/lib/components/Notice/Notice.d.ts +0 -16
- package/lib/components/Notice/Notice.js +0 -126
- package/lib/components/Notice/index.d.ts +0 -16
- package/lib/components/Notice/index.js +0 -23
- package/lib/components/Notice/style/index.d.ts +0 -12
- package/lib/components/Notice/style/index.js +0 -90
- package/lib/components/NumberInput/NumberInput.d.ts +0 -149
- package/lib/components/NumberInput/NumberInput.js +0 -936
- package/lib/components/NumberInput/index.d.ts +0 -2
- package/lib/components/NumberInput/index.js +0 -13
- package/lib/components/NumberInput/style/index.d.ts +0 -9
- package/lib/components/NumberInput/style/index.js +0 -92
- package/lib/components/Pagination/Options.js +0 -205
- package/lib/components/Pagination/Pager.js +0 -65
- package/lib/components/Pagination/Pagination.js +0 -664
- package/lib/components/Pagination/index.js +0 -13
- package/lib/components/Pagination/locale/en_US.js +0 -23
- package/lib/components/Pagination/locale/zh_CN.js +0 -23
- package/lib/components/Pagination/style/index.js +0 -40
- package/lib/components/PopConfirm/PopConfirm.d.ts +0 -11
- package/lib/components/PopConfirm/PopConfirm.js +0 -119
- package/lib/components/PopConfirm/index.d.ts +0 -2
- package/lib/components/PopConfirm/index.js +0 -13
- package/lib/components/PopConfirm/locale/en_US.js +0 -11
- package/lib/components/PopConfirm/locale/zh_CN.d.ts +0 -5
- package/lib/components/PopConfirm/locale/zh_CN.js +0 -11
- package/lib/components/PopConfirm/style/index.d.ts +0 -10
- package/lib/components/PopConfirm/style/index.js +0 -70
- package/lib/components/Popover/ContainerContext.d.ts +0 -8
- package/lib/components/Popover/ContainerContext.js +0 -52
- package/lib/components/Popover/Popover.d.ts +0 -187
- package/lib/components/Popover/Popover.js +0 -380
- package/lib/components/Popover/index.d.ts +0 -3
- package/lib/components/Popover/index.js +0 -51
- package/lib/components/Popover/placements.d.ts +0 -183
- package/lib/components/Popover/placements.js +0 -96
- package/lib/components/Popover/style/index.d.ts +0 -17
- package/lib/components/Popover/style/index.js +0 -96
- package/lib/components/Progress/Progress.js +0 -95
- package/lib/components/Progress/index.js +0 -13
- package/lib/components/Progress/style/index.js +0 -75
- package/lib/components/Radio/Button.js +0 -30
- package/lib/components/Radio/Card.d.ts +0 -12
- package/lib/components/Radio/Card.js +0 -58
- package/lib/components/Radio/Group.js +0 -181
- package/lib/components/Radio/Radio.js +0 -380
- package/lib/components/Radio/RadioIcon.d.ts +0 -6
- package/lib/components/Radio/RadioIcon.js +0 -37
- package/lib/components/Radio/Tag.js +0 -30
- package/lib/components/Radio/index.js +0 -22
- package/lib/components/Radio/style/index.d.ts +0 -26
- package/lib/components/Radio/style/index.js +0 -260
- package/lib/components/Row/index.js +0 -14
- package/lib/components/Select/Extra.d.ts +0 -11
- package/lib/components/Select/Extra.js +0 -56
- package/lib/components/Select/Group.d.ts +0 -20
- package/lib/components/Select/Group.js +0 -46
- package/lib/components/Select/Option.d.ts +0 -24
- package/lib/components/Select/Option.js +0 -64
- package/lib/components/Select/Overflow.d.ts +0 -19
- package/lib/components/Select/Overflow.js +0 -114
- package/lib/components/Select/Select.d.ts +0 -126
- package/lib/components/Select/Select.js +0 -1449
- package/lib/components/Select/SelectContext.d.ts +0 -8
- package/lib/components/Select/SelectContext.js +0 -33
- package/lib/components/Select/index.d.ts +0 -21
- package/lib/components/Select/index.js +0 -27
- package/lib/components/Select/locale/en_US.js +0 -14
- package/lib/components/Select/locale/zh_CN.d.ts +0 -8
- package/lib/components/Select/locale/zh_CN.js +0 -14
- package/lib/components/Select/style/index.d.ts +0 -85
- package/lib/components/Select/style/index.js +0 -254
- package/lib/components/Skeleton/Skeleton.d.ts +0 -11
- package/lib/components/Skeleton/Skeleton.js +0 -64
- package/lib/components/Skeleton/index.d.ts +0 -2
- package/lib/components/Skeleton/index.js +0 -13
- package/lib/components/Skeleton/style/index.d.ts +0 -9
- package/lib/components/Skeleton/style/index.js +0 -41
- package/lib/components/Slider/Slider.js +0 -781
- package/lib/components/Slider/index.js +0 -13
- package/lib/components/Slider/locale/en_US.js +0 -19
- package/lib/components/Slider/locale/zh_CN.js +0 -19
- package/lib/components/Slider/style/index.js +0 -45
- package/lib/components/Spin/Spin.js +0 -29
- package/lib/components/Spin/index.js +0 -13
- package/lib/components/Spin/style/index.js +0 -18
- package/lib/components/Steps/Link.js +0 -71
- package/lib/components/Steps/Step.js +0 -80
- package/lib/components/Steps/StepIcon.js +0 -115
- package/lib/components/Steps/Steps.js +0 -147
- package/lib/components/Steps/index.js +0 -13
- package/lib/components/Steps/style/index.js +0 -141
- package/lib/components/SvgIcon/SvgIcon.d.ts +0 -29
- package/lib/components/SvgIcon/SvgIcon.js +0 -248
- package/lib/components/SvgIcon/SvgIconWrap.d.ts +0 -21
- package/lib/components/SvgIcon/SvgIconWrap.js +0 -83
- package/lib/components/SvgIcon/icons/ArrowDown.d.ts +0 -3
- package/lib/components/SvgIcon/icons/ArrowDown.js +0 -24
- package/lib/components/SvgIcon/icons/ArrowLeft.d.ts +0 -3
- package/lib/components/SvgIcon/icons/ArrowLeft.js +0 -25
- package/lib/components/SvgIcon/icons/ArrowRight.d.ts +0 -3
- package/lib/components/SvgIcon/icons/ArrowRight.js +0 -24
- package/lib/components/SvgIcon/icons/ArrowUp.d.ts +0 -3
- package/lib/components/SvgIcon/icons/ArrowUp.js +0 -24
- package/lib/components/SvgIcon/icons/Calendar.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Calendar.js +0 -23
- package/lib/components/SvgIcon/icons/Circle.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Circle.js +0 -25
- package/lib/components/SvgIcon/icons/CircleCrossFill.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CircleCrossFill.js +0 -23
- package/lib/components/SvgIcon/icons/CircleMarkFill.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CircleMarkFill.js +0 -23
- package/lib/components/SvgIcon/icons/CircleYesMdFill.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CircleYesMdFill.js +0 -23
- package/lib/components/SvgIcon/icons/Clock.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Clock.js +0 -23
- package/lib/components/SvgIcon/icons/Cog.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Cog.js +0 -24
- package/lib/components/SvgIcon/icons/Cross.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Cross.js +0 -23
- package/lib/components/SvgIcon/icons/CrossBold.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CrossBold.js +0 -23
- package/lib/components/SvgIcon/icons/CrossCircle.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CrossCircle.js +0 -23
- package/lib/components/SvgIcon/icons/CrossCircleFilled.d.ts +0 -3
- package/lib/components/SvgIcon/icons/CrossCircleFilled.js +0 -23
- package/lib/components/SvgIcon/icons/DottedLineArrowRight.d.ts +0 -3
- package/lib/components/SvgIcon/icons/DottedLineArrowRight.js +0 -23
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.d.ts +0 -3
- package/lib/components/SvgIcon/icons/DoubleArrowLeft.js +0 -24
- package/lib/components/SvgIcon/icons/DoubleArrowRight.d.ts +0 -3
- package/lib/components/SvgIcon/icons/DoubleArrowRight.js +0 -24
- package/lib/components/SvgIcon/icons/Dragger.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Dragger.js +0 -23
- package/lib/components/SvgIcon/icons/Ellipsis.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Ellipsis.js +0 -23
- package/lib/components/SvgIcon/icons/ExclamationCircleFilled.d.ts +0 -3
- package/lib/components/SvgIcon/icons/ExclamationCircleFilled.js +0 -24
- package/lib/components/SvgIcon/icons/Eye.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Eye.js +0 -23
- package/lib/components/SvgIcon/icons/Filter.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Filter.js +0 -23
- package/lib/components/SvgIcon/icons/Horz.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Horz.js +0 -27
- package/lib/components/SvgIcon/icons/InfoCircleFilled.d.ts +0 -3
- package/lib/components/SvgIcon/icons/InfoCircleFilled.js +0 -24
- package/lib/components/SvgIcon/icons/LineArrowDown.d.ts +0 -3
- package/lib/components/SvgIcon/icons/LineArrowDown.js +0 -23
- package/lib/components/SvgIcon/icons/LineArrowUp.d.ts +0 -3
- package/lib/components/SvgIcon/icons/LineArrowUp.js +0 -23
- package/lib/components/SvgIcon/icons/LoadingLIne.js +0 -24
- package/lib/components/SvgIcon/icons/LoadingLine.d.ts +0 -3
- package/lib/components/SvgIcon/icons/LoadingLine.js +0 -24
- package/lib/components/SvgIcon/icons/Minus.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Minus.js +0 -24
- package/lib/components/SvgIcon/icons/Plus.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Plus.js +0 -23
- package/lib/components/SvgIcon/icons/QuestionCircle.d.ts +0 -3
- package/lib/components/SvgIcon/icons/QuestionCircle.js +0 -24
- package/lib/components/SvgIcon/icons/Refresh.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Refresh.js +0 -23
- package/lib/components/SvgIcon/icons/RingLoading.d.ts +0 -3
- package/lib/components/SvgIcon/icons/RingLoading.js +0 -23
- package/lib/components/SvgIcon/icons/Search.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Search.js +0 -23
- package/lib/components/SvgIcon/icons/Sort.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Sort.js +0 -23
- package/lib/components/SvgIcon/icons/Tick.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Tick.js +0 -23
- package/lib/components/SvgIcon/icons/TickCircleFilled.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TickCircleFilled.js +0 -23
- package/lib/components/SvgIcon/icons/TickSmall.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TickSmall.js +0 -23
- package/lib/components/SvgIcon/icons/Trash.d.ts +0 -3
- package/lib/components/SvgIcon/icons/Trash.js +0 -23
- package/lib/components/SvgIcon/icons/TriangleDown.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TriangleDown.js +0 -23
- package/lib/components/SvgIcon/icons/TriangleLeft.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TriangleLeft.js +0 -24
- package/lib/components/SvgIcon/icons/TriangleRight.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TriangleRight.js +0 -23
- package/lib/components/SvgIcon/icons/TriangleUp.d.ts +0 -3
- package/lib/components/SvgIcon/icons/TriangleUp.js +0 -23
- package/lib/components/SvgIcon/index.d.ts +0 -2
- package/lib/components/SvgIcon/index.js +0 -13
- package/lib/components/SvgIcon/style/index.d.ts +0 -1
- package/lib/components/SvgIcon/style/index.js +0 -35
- package/lib/components/Switch/Switch.d.ts +0 -19
- package/lib/components/Switch/Switch.js +0 -93
- package/lib/components/Switch/index.d.ts +0 -3
- package/lib/components/Switch/index.js +0 -15
- package/lib/components/Switch/style/index.d.ts +0 -16
- package/lib/components/Switch/style/index.js +0 -77
- package/lib/components/Table/ActionList.js +0 -14
- package/lib/components/Table/ColumnConfigButton.js +0 -267
- package/lib/components/Table/DragWrap.d.ts +0 -42
- package/lib/components/Table/DragWrap.js +0 -64
- package/lib/components/Table/ExpandedRowContent.js +0 -55
- package/lib/components/Table/HoverDisplayArea.js +0 -69
- package/lib/components/Table/ResizableTH.js +0 -214
- package/lib/components/Table/SearchInput.js +0 -69
- package/lib/components/Table/Table.js +0 -1808
- package/lib/components/Table/TableRow.d.ts +0 -9
- package/lib/components/Table/TableRow.js +0 -98
- package/lib/components/Table/index.js +0 -37
- package/lib/components/Table/locale/en_US.js +0 -23
- package/lib/components/Table/locale/zh_CN.js +0 -23
- package/lib/components/Table/style/index.js +0 -200
- package/lib/components/Table/utils.js +0 -53
- package/lib/components/Tabs/Pane.d.ts +0 -30
- package/lib/components/Tabs/Pane.js +0 -75
- package/lib/components/Tabs/RefContext.d.ts +0 -8
- package/lib/components/Tabs/RefContext.js +0 -33
- package/lib/components/Tabs/TabBar.d.ts +0 -13
- package/lib/components/Tabs/TabBar.js +0 -663
- package/lib/components/Tabs/TabContent.d.ts +0 -12
- package/lib/components/Tabs/TabContent.js +0 -77
- package/lib/components/Tabs/Tabs.d.ts +0 -27
- package/lib/components/Tabs/Tabs.js +0 -238
- package/lib/components/Tabs/index.d.ts +0 -23
- package/lib/components/Tabs/index.js +0 -28
- package/lib/components/Tabs/shared.d.ts +0 -12
- package/lib/components/Tabs/shared.js +0 -19
- package/lib/components/Tabs/style/index.d.ts +0 -6
- package/lib/components/Tabs/style/index.js +0 -67
- package/lib/components/Tabs/utils.d.ts +0 -5
- package/lib/components/Tabs/utils.js +0 -36
- package/lib/components/Tag/Group.d.ts +0 -16
- package/lib/components/Tag/Group.js +0 -68
- package/lib/components/Tag/Icon.d.ts +0 -33
- package/lib/components/Tag/Icon.js +0 -102
- package/lib/components/Tag/Tag.d.ts +0 -52
- package/lib/components/Tag/Tag.js +0 -132
- package/lib/components/Tag/index.d.ts +0 -8
- package/lib/components/Tag/index.js +0 -23
- package/lib/components/Tag/style/index.d.ts +0 -110
- package/lib/components/Tag/style/index.js +0 -241
- package/lib/components/Textarea/Textarea.d.ts +0 -12
- package/lib/components/Textarea/Textarea.js +0 -64
- package/lib/components/Textarea/index.d.ts +0 -2
- package/lib/components/Textarea/index.js +0 -13
- package/lib/components/Textarea/style/index.d.ts +0 -1
- package/lib/components/Textarea/style/index.js +0 -32
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +0 -21
- package/lib/components/ThemeProvider/ThemeProvider.js +0 -145
- package/lib/components/ThemeProvider/dark.js +0 -15
- package/lib/components/ThemeProvider/designTokens.d.ts +0 -269
- package/lib/components/ThemeProvider/designTokens.js +0 -543
- package/lib/components/ThemeProvider/designTokensDark.d.ts +0 -269
- package/lib/components/ThemeProvider/designTokensDark.js +0 -543
- package/lib/components/ThemeProvider/green.js +0 -9
- package/lib/components/ThemeProvider/index.d.ts +0 -2
- package/lib/components/ThemeProvider/index.js +0 -16
- package/lib/components/ThemeProvider/material.js +0 -20
- package/lib/components/ThemeProvider/ocean.js +0 -9
- package/lib/components/ThemeProvider/runtime.d.ts +0 -2
- package/lib/components/ThemeProvider/runtime.js +0 -30
- package/lib/components/ThemeProvider/theme.d.ts +0 -6
- package/lib/components/ThemeProvider/theme.js +0 -115
- package/lib/components/ThemeProvider/useDesignTokens.d.ts +0 -2
- package/lib/components/ThemeProvider/useDesignTokens.js +0 -26
- package/lib/components/TimePicker/Time.d.ts +0 -11
- package/lib/components/TimePicker/Time.js +0 -39
- package/lib/components/TimePicker/TimePicker.d.ts +0 -27
- package/lib/components/TimePicker/TimePicker.js +0 -282
- package/lib/components/TimePicker/index.d.ts +0 -2
- package/lib/components/TimePicker/index.js +0 -13
- package/lib/components/TimePicker/locale/en_US.js +0 -10
- package/lib/components/TimePicker/locale/zh_CN.d.ts +0 -4
- package/lib/components/TimePicker/locale/zh_CN.js +0 -10
- package/lib/components/TimePicker/style/index.d.ts +0 -14
- package/lib/components/TimePicker/style/index.js +0 -81
- package/lib/components/TimePicker/util.d.ts +0 -1
- package/lib/components/TimePicker/util.js +0 -49
- package/lib/components/Tooltip/Tooltip.d.ts +0 -13
- package/lib/components/Tooltip/Tooltip.js +0 -96
- package/lib/components/Tooltip/index.d.ts +0 -2
- package/lib/components/Tooltip/index.js +0 -13
- package/lib/components/Tooltip/style/index.d.ts +0 -19
- package/lib/components/Tooltip/style/index.js +0 -103
- package/lib/components/Transfer/Transfer.js +0 -578
- package/lib/components/Transfer/index.js +0 -13
- package/lib/components/Transfer/locale/en_US.js +0 -15
- package/lib/components/Transfer/locale/zh_CN.js +0 -15
- package/lib/components/Transfer/style/index.js +0 -55
- package/lib/components/TransferMenu/TransferMenu.js +0 -115
- package/lib/components/TransferMenu/index.js +0 -13
- package/lib/components/TransferMenu/style/index.js +0 -23
- package/lib/components/TransferTable/TransferTable.js +0 -148
- package/lib/components/TransferTable/index.js +0 -13
- package/lib/components/TransferTable/style/index.js +0 -38
- package/lib/components/Tree/Item.d.ts +0 -27
- package/lib/components/Tree/Item.js +0 -305
- package/lib/components/Tree/Items.d.ts +0 -14
- package/lib/components/Tree/Items.js +0 -105
- package/lib/components/Tree/Tree.d.ts +0 -49
- package/lib/components/Tree/Tree.js +0 -580
- package/lib/components/Tree/TreeContext.d.ts +0 -7
- package/lib/components/Tree/TreeContext.js +0 -18
- package/lib/components/Tree/index.d.ts +0 -4
- package/lib/components/Tree/index.js +0 -14
- package/lib/components/Tree/interface.d.ts +0 -19
- package/lib/components/Tree/interface.js +0 -5
- package/lib/components/Tree/style/index.d.ts +0 -22
- package/lib/components/Tree/style/index.js +0 -63
- package/lib/components/Tree/util.d.ts +0 -2
- package/lib/components/Tree/util.js +0 -44
- package/lib/components/Upload/CardItem.js +0 -214
- package/lib/components/Upload/Dropzone.js +0 -187
- package/lib/components/Upload/Item.js +0 -209
- package/lib/components/Upload/List.js +0 -200
- package/lib/components/Upload/Progress.js +0 -115
- package/lib/components/Upload/Selector.js +0 -152
- package/lib/components/Upload/Thumbnail.js +0 -110
- package/lib/components/Upload/Upload.js +0 -556
- package/lib/components/Upload/icons/Archive.js +0 -18
- package/lib/components/Upload/icons/Docs.js +0 -18
- package/lib/components/Upload/icons/Dropzone.js +0 -18
- package/lib/components/Upload/icons/Image.js +0 -18
- package/lib/components/Upload/icons/PDF.js +0 -18
- package/lib/components/Upload/icons/Text.js +0 -18
- package/lib/components/Upload/icons/Unknown.js +0 -18
- package/lib/components/Upload/icons/Upload.js +0 -18
- package/lib/components/Upload/index.js +0 -16
- package/lib/components/Upload/locale/en_US.js +0 -22
- package/lib/components/Upload/locale/zh_CN.js +0 -22
- package/lib/components/Upload/style/index.js +0 -177
- package/lib/components/Upload/utils.js +0 -143
- package/lib/components/ZForm/ZForm.js +0 -79
- package/lib/components/ZForm/controllerDecorator.js +0 -90
- package/lib/components/ZForm/index.js +0 -16
- package/lib/config.d.ts +0 -6
- package/lib/config.js +0 -28
- package/lib/decorators/selectableWithStore/item.js +0 -170
- package/lib/decorators/selectableWithStore/store.js +0 -424
- package/lib/decorators/uncontrolled.d.ts +0 -7
- package/lib/decorators/uncontrolled.js +0 -122
- package/lib/hooks/group.d.ts +0 -42
- package/lib/hooks/group.js +0 -403
- package/lib/hooks/selectable.d.ts +0 -22
- package/lib/hooks/selectable.js +0 -127
- package/lib/hooks/useConfig.d.ts +0 -2
- package/lib/hooks/useConfig.js +0 -30
- package/lib/hooks/useConstructor.d.ts +0 -2
- package/lib/hooks/useConstructor.js +0 -31
- package/lib/hooks/useDidMount.d.ts +0 -2
- package/lib/hooks/useDidMount.js +0 -34
- package/lib/hooks/useInitial.d.ts +0 -2
- package/lib/hooks/useInitial.js +0 -23
- package/lib/hooks/useIsInitial.d.ts +0 -2
- package/lib/hooks/useIsInitial.js +0 -40
- package/lib/hooks/useOverflow.d.ts +0 -24
- package/lib/hooks/useOverflow.js +0 -159
- package/lib/hooks/usePopoverConfig.d.ts +0 -27
- package/lib/hooks/usePopoverConfig.js +0 -78
- package/lib/hooks/useSearch.d.ts +0 -23
- package/lib/hooks/useSearch.js +0 -387
- package/lib/hooks/useSimpleVirtualList.d.ts +0 -6
- package/lib/hooks/useSimpleVirtualList.js +0 -128
- package/lib/hooks/useUncontrolled.d.ts +0 -4
- package/lib/hooks/useUncontrolled.js +0 -85
- package/lib/hooks/useVirtualList.d.ts +0 -6
- package/lib/hooks/useVirtualList.js +0 -196
- package/lib/index.js +0 -241
- package/lib/interfaces/Color.js +0 -9
- package/lib/interfaces/Size.js +0 -8
- package/lib/libs/dom-align/adjustForViewport.js +0 -55
- package/lib/libs/dom-align/align/align.js +0 -244
- package/lib/libs/dom-align/align/alignElement.js +0 -34
- package/lib/libs/dom-align/align/alignPoint.js +0 -67
- package/lib/libs/dom-align/getAlignOffset.js +0 -38
- package/lib/libs/dom-align/getElFuturePos.js +0 -23
- package/lib/libs/dom-align/getOffsetParent.js +0 -63
- package/lib/libs/dom-align/getRegion.js +0 -38
- package/lib/libs/dom-align/getVisibleRectForElement.js +0 -118
- package/lib/libs/dom-align/index.js +0 -27
- package/lib/libs/dom-align/isAncestorFixed.js +0 -34
- package/lib/libs/dom-align/propertyUtils.js +0 -138
- package/lib/libs/dom-align/utils.js +0 -657
- package/lib/libs/rc-align/index.d.ts +0 -42
- package/lib/libs/rc-align/index.js +0 -275
- package/lib/libs/rc-align/util.d.ts +0 -8
- package/lib/libs/rc-align/util.js +0 -67
- package/lib/libs/rc-drawer/Drawer.js +0 -831
- package/lib/libs/rc-drawer/index.js +0 -14
- package/lib/libs/rc-drawer/utils.js +0 -87
- package/lib/libs/rc-table/BaseTable.d.ts +0 -2
- package/lib/libs/rc-table/BaseTable.js +0 -221
- package/lib/libs/rc-table/BodyTable.d.ts +0 -18
- package/lib/libs/rc-table/BodyTable.js +0 -82
- package/lib/libs/rc-table/ColGroup.d.ts +0 -10
- package/lib/libs/rc-table/ColGroup.js +0 -47
- package/lib/libs/rc-table/ColumnManager.d.ts +0 -10
- package/lib/libs/rc-table/ColumnManager.js +0 -206
- package/lib/libs/rc-table/ExpandIcon.d.ts +0 -11
- package/lib/libs/rc-table/ExpandIcon.js +0 -65
- package/lib/libs/rc-table/ExpandableRow.d.ts +0 -2
- package/lib/libs/rc-table/ExpandableRow.js +0 -191
- package/lib/libs/rc-table/ExpandableTable.d.ts +0 -2
- package/lib/libs/rc-table/ExpandableTable.js +0 -304
- package/lib/libs/rc-table/HeadTable.d.ts +0 -18
- package/lib/libs/rc-table/HeadTable.js +0 -76
- package/lib/libs/rc-table/Table.d.ts +0 -81
- package/lib/libs/rc-table/Table.js +0 -452
- package/lib/libs/rc-table/TableCell.d.ts +0 -17
- package/lib/libs/rc-table/TableCell.js +0 -168
- package/lib/libs/rc-table/TableHeader.d.ts +0 -16
- package/lib/libs/rc-table/TableHeader.js +0 -109
- package/lib/libs/rc-table/TableHeaderRow.d.ts +0 -2
- package/lib/libs/rc-table/TableHeaderRow.js +0 -146
- package/lib/libs/rc-table/TableRow.d.ts +0 -2
- package/lib/libs/rc-table/TableRow.js +0 -301
- package/lib/libs/rc-table/index.d.ts +0 -2
- package/lib/libs/rc-table/index.js +0 -13
- package/lib/libs/rc-table/utils.d.ts +0 -7
- package/lib/libs/rc-table/utils.js +0 -117
- package/lib/libs/rc-trigger/index.js +0 -14
- package/lib/libs/rc-trigger/src/LazyRenderBox.js +0 -82
- package/lib/libs/rc-trigger/src/Popup.js +0 -383
- package/lib/libs/rc-trigger/src/PopupInner.js +0 -85
- package/lib/libs/rc-trigger/src/index.js +0 -867
- package/lib/libs/rc-trigger/src/mock.js +0 -33
- package/lib/libs/rc-trigger/src/utils.js +0 -48
- package/lib/sharedComponents/InputWrap.d.ts +0 -16
- package/lib/sharedComponents/InputWrap.js +0 -66
- package/lib/sharedComponents/Search/Highlight.d.ts +0 -5
- package/lib/sharedComponents/Search/Highlight.js +0 -20
- package/lib/sharedComponents/Search/Search.d.ts +0 -19
- package/lib/sharedComponents/Search/Search.js +0 -72
- package/lib/sharedComponents/Search/SearchInput.d.ts +0 -4
- package/lib/sharedComponents/Search/SearchInput.js +0 -51
- package/lib/sharedComponents/Search/index.d.ts +0 -5
- package/lib/sharedComponents/Search/index.js +0 -29
- package/lib/sharedComponents/Search/locale/en_US.js +0 -11
- package/lib/sharedComponents/Search/locale/zh_CN.d.ts +0 -5
- package/lib/sharedComponents/Search/locale/zh_CN.js +0 -11
- package/lib/sharedComponents/Search/style.d.ts +0 -14
- package/lib/sharedComponents/Search/style.js +0 -56
- package/lib/sharedComponents/VirtualScrollList.d.ts +0 -7
- package/lib/sharedComponents/VirtualScrollList.js +0 -68
- package/lib/stores/SimpleStore.js +0 -73
- package/lib/style/animation.d.ts +0 -17
- package/lib/style/animation.js +0 -49
- package/lib/style/globalAnimation.d.ts +0 -1
- package/lib/style/globalAnimation.js +0 -20
- package/lib/style/index.d.ts +0 -10
- package/lib/style/index.js +0 -114
- package/lib/style/interface.d.ts +0 -8
- package/lib/style/interface.js +0 -13
- package/lib/style/sWrap.d.ts +0 -18
- package/lib/style/sWrap.js +0 -110
- package/lib/style/utils.d.ts +0 -14
- package/lib/style/utils.js +0 -171
- package/lib/type.d.ts +0 -9
- package/lib/type.js +0 -118
- package/lib/utils/KeyCode.d.ts +0 -15
- package/lib/utils/KeyCode.js +0 -21
- package/lib/utils/attrs.d.ts +0 -5
- package/lib/utils/attrs.js +0 -39
- package/lib/utils/checkStickySupport.d.ts +0 -2
- package/lib/utils/checkStickySupport.js +0 -38
- package/lib/utils/deprecatedLog.d.ts +0 -2
- package/lib/utils/deprecatedLog.js +0 -27
- package/lib/utils/each.d.ts +0 -1
- package/lib/utils/each.js +0 -15
- package/lib/utils/generateError.js +0 -27
- package/lib/utils/hoistStatics.d.ts +0 -1
- package/lib/utils/hoistStatics.js +0 -14
- package/lib/utils/isArray.d.ts +0 -2
- package/lib/utils/isArray.js +0 -19
- package/lib/utils/isEmpty.d.ts +0 -2
- package/lib/utils/isEmpty.js +0 -26
- package/lib/utils/isFirefox.d.ts +0 -2
- package/lib/utils/isFirefox.js +0 -12
- package/lib/utils/isFunction.d.ts +0 -2
- package/lib/utils/isFunction.js +0 -20
- package/lib/utils/isIE.d.ts +0 -2
- package/lib/utils/isIE.js +0 -12
- package/lib/utils/isNumber.d.ts +0 -2
- package/lib/utils/isNumber.js +0 -19
- package/lib/utils/isObject.d.ts +0 -2
- package/lib/utils/isObject.js +0 -19
- package/lib/utils/isSafari.d.ts +0 -2
- package/lib/utils/isSafari.js +0 -10
- package/lib/utils/memo.d.ts +0 -2
- package/lib/utils/memo.js +0 -32
- package/lib/utils/noop.d.ts +0 -2
- package/lib/utils/noop.js +0 -20
- package/lib/utils/once.d.ts +0 -2
- package/lib/utils/once.js +0 -29
- package/lib/utils/pick.d.ts +0 -2
- package/lib/utils/pick.js +0 -29
- package/lib/utils/string.d.ts +0 -1
- package/lib/utils/string.js +0 -24
- package/lib/utils/styledWrap.d.ts +0 -22
- package/lib/utils/styledWrap.js +0 -98
- package/lib/utils/typeMemo.d.ts +0 -2
- package/lib/utils/typeMemo.js +0 -18
- package/lib/utils/wait.d.ts +0 -2
- package/lib/utils/wait.js +0 -23
- package/lib/utils/warning.d.ts +0 -4
- package/lib/utils/warning.js +0 -34
- package/lib/utils/withProps.d.ts +0 -3
- package/lib/utils/withProps.js +0 -86
|
@@ -1,1449 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = exports.deprecatedLogForPopover = void 0;
|
|
11
|
-
|
|
12
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
-
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
|
|
18
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
|
-
|
|
20
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _newArrowCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/newArrowCheck"));
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
29
|
-
|
|
30
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
31
|
-
|
|
32
|
-
var _Popover = _interopRequireDefault(require("../../components/Popover"));
|
|
33
|
-
|
|
34
|
-
var _Tag = _interopRequireDefault(require("../../components/Tag"));
|
|
35
|
-
|
|
36
|
-
var _Tooltip = _interopRequireDefault(require("../../components/Tooltip"));
|
|
37
|
-
|
|
38
|
-
var _Search = require("../../sharedComponents/Search");
|
|
39
|
-
|
|
40
|
-
var _useLocale = _interopRequireDefault(require("../../components/LocaleProvider/useLocale"));
|
|
41
|
-
|
|
42
|
-
var _SvgIcon = _interopRequireDefault(require("../../components/SvgIcon"));
|
|
43
|
-
|
|
44
|
-
var _usePopoverConfig = _interopRequireDefault(require("../../hooks/usePopoverConfig"));
|
|
45
|
-
|
|
46
|
-
var _useUncontrolled5 = _interopRequireDefault(require("../../hooks/useUncontrolled"));
|
|
47
|
-
|
|
48
|
-
var _useInitial = _interopRequireDefault(require("../../hooks/useInitial"));
|
|
49
|
-
|
|
50
|
-
var _noop = _interopRequireDefault(require("../../utils/noop"));
|
|
51
|
-
|
|
52
|
-
var _deprecatedLog = _interopRequireDefault(require("../../utils/deprecatedLog"));
|
|
53
|
-
|
|
54
|
-
var _warning = require("../../utils/warning");
|
|
55
|
-
|
|
56
|
-
var _isObject = _interopRequireDefault(require("../../utils/isObject"));
|
|
57
|
-
|
|
58
|
-
var _isEmpty = _interopRequireDefault(require("../../utils/isEmpty"));
|
|
59
|
-
|
|
60
|
-
var _style = require("../../components/Input/style");
|
|
61
|
-
|
|
62
|
-
var _VirtualScrollList = _interopRequireDefault(require("../../sharedComponents/VirtualScrollList"));
|
|
63
|
-
|
|
64
|
-
var _Option = require("./Option");
|
|
65
|
-
|
|
66
|
-
var _Group = _interopRequireDefault(require("./Group"));
|
|
67
|
-
|
|
68
|
-
var _Extra = _interopRequireDefault(require("./Extra"));
|
|
69
|
-
|
|
70
|
-
var _style2 = require("./style");
|
|
71
|
-
|
|
72
|
-
var _SelectContext = _interopRequireDefault(require("./SelectContext"));
|
|
73
|
-
|
|
74
|
-
var _zh_CN = _interopRequireDefault(require("./locale/zh_CN"));
|
|
75
|
-
|
|
76
|
-
var _Overflow = _interopRequireWildcard(require("./Overflow"));
|
|
77
|
-
|
|
78
|
-
var _excluded = ["v1"],
|
|
79
|
-
_excluded2 = ["content"],
|
|
80
|
-
_excluded3 = ["content"],
|
|
81
|
-
_excluded4 = ["v1", "size", "disabled", "multiple", "placeholder", "renderContent", "renderSelector", "renderPopup", "value", "onChange", "visible", "setVisible", "locale", "dataSource", "search", "searchValue", "setSearchValue", "wrapRef", "clearable", "styleType", "block"],
|
|
82
|
-
_excluded5 = ["items", "onClose", "disabled"],
|
|
83
|
-
_excluded6 = ["size", "value", "defaultValue", "onChange", "onVisibleChange", "disabled", "search", "multiple", "renderContent", "renderSelector", "placeholder", "locale", "options", "children", "emptyContent", "showSelectAll", "extra", "clearable", "customStyle", "popover", "popoverProps", "renderPopup", "virtualList", "block", "styleType"];
|
|
84
|
-
|
|
85
|
-
var _this = void 0;
|
|
86
|
-
|
|
87
|
-
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); }
|
|
88
|
-
|
|
89
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
90
|
-
|
|
91
|
-
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; }
|
|
92
|
-
|
|
93
|
-
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; }
|
|
94
|
-
|
|
95
|
-
var deprecatedLogForPopover = (0, _deprecatedLog.default)('Select popover', 'popoverProps');
|
|
96
|
-
exports.deprecatedLogForPopover = deprecatedLogForPopover;
|
|
97
|
-
var warnLogForVirtualList = (0, _warning.onceWarning)('Select virtualList only valid when use options');
|
|
98
|
-
var warnLogForCustomHeight = (0, _warning.onceWarning)('CustomStyle.optionListMaxHeight is invalid when use virtualList, please use virtualList.height');
|
|
99
|
-
var warnLogForSearchProps = (0, _warning.onceWarning)("Don't use item.props in custom search, just use item as props.");
|
|
100
|
-
var warnLogForSubGroup = (0, _deprecatedLog.default)('Select.Group', 'Cascader');
|
|
101
|
-
var popoverStretch = ['minWidth'];
|
|
102
|
-
var blockPopoverStretch = ['width'];
|
|
103
|
-
var groupOptions = {
|
|
104
|
-
itemTag: 'isMenuItem',
|
|
105
|
-
subGroupTag: 'isMenuSubMenu',
|
|
106
|
-
itemKeyName: 'value',
|
|
107
|
-
subGroupKeyName: 'groupKey',
|
|
108
|
-
displayName: 'label',
|
|
109
|
-
subGroupName: 'children',
|
|
110
|
-
ItemComponent: _Option.PureOption,
|
|
111
|
-
SubGroupComponent: _Group.default
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var isValidKey = function isValidKey(v) {
|
|
115
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
116
|
-
return typeof v === 'string' || typeof v === 'number';
|
|
117
|
-
}.bind(void 0);
|
|
118
|
-
|
|
119
|
-
var groupChildrenAsDataSource = function groupChildrenAsDataSource(children) {
|
|
120
|
-
var _this2 = this;
|
|
121
|
-
|
|
122
|
-
var globalDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
123
|
-
|
|
124
|
-
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
125
|
-
itemTag: 'isItem',
|
|
126
|
-
subGroupTag: 'isSubGroup',
|
|
127
|
-
itemKeyName: 'itemKey',
|
|
128
|
-
subGroupKeyName: 'subGroupKey'
|
|
129
|
-
},
|
|
130
|
-
itemTag = _ref.itemTag,
|
|
131
|
-
subGroupTag = _ref.subGroupTag,
|
|
132
|
-
itemKeyName = _ref.itemKeyName,
|
|
133
|
-
subGroupKeyName = _ref.subGroupKeyName;
|
|
134
|
-
|
|
135
|
-
var searchValue = arguments.length > 3 ? arguments[3] : undefined;
|
|
136
|
-
var handleSearch = arguments.length > 4 ? arguments[4] : undefined;
|
|
137
|
-
var subGroupMap = new Map();
|
|
138
|
-
var childrenMap = new Map();
|
|
139
|
-
|
|
140
|
-
var _group = function group(children, disabled, prefix) {
|
|
141
|
-
var _this3 = this;
|
|
142
|
-
|
|
143
|
-
(0, _newArrowCheck2.default)(this, _this2);
|
|
144
|
-
var validKeys = [];
|
|
145
|
-
var disabledKeys = [];
|
|
146
|
-
|
|
147
|
-
var l = _react.default.Children.count(children);
|
|
148
|
-
|
|
149
|
-
var renderChildren = [];
|
|
150
|
-
|
|
151
|
-
_react.default.Children.forEach(children, function (child, i) {
|
|
152
|
-
(0, _newArrowCheck2.default)(this, _this3);
|
|
153
|
-
var isFirst = i === 0;
|
|
154
|
-
var isLast = i === l - 1;
|
|
155
|
-
|
|
156
|
-
if ( /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
157
|
-
var _child$type, _child$type2;
|
|
158
|
-
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
|
-
if ((_child$type = child.type) !== null && _child$type !== void 0 && _child$type[itemTag]) {
|
|
161
|
-
var _props = child.props;
|
|
162
|
-
|
|
163
|
-
var _key = _props[itemKeyName] === undefined ? child.key : _props[itemKeyName];
|
|
164
|
-
|
|
165
|
-
var _visible = searchValue ? handleSearch(_key, child.props) : true;
|
|
166
|
-
|
|
167
|
-
if (_visible) {
|
|
168
|
-
var _ref2, _React$cloneElement;
|
|
169
|
-
|
|
170
|
-
var isDisabled = disabled || _props.disabled;
|
|
171
|
-
|
|
172
|
-
if (isDisabled) {
|
|
173
|
-
disabledKeys.push(_key);
|
|
174
|
-
} else {
|
|
175
|
-
validKeys.push(_key);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
var display = Array.isArray(_visible) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, _visible[0], /*#__PURE__*/_react.default.createElement(_Search.Highlight, null, _visible[1]), _visible[2]) : (_ref2 = _props.children) !== null && _ref2 !== void 0 ? _ref2 : _key;
|
|
179
|
-
renderChildren.push( /*#__PURE__*/_react.default.cloneElement(child, (_React$cloneElement = {}, (0, _defineProperty2.default)(_React$cloneElement, itemKeyName, _key), (0, _defineProperty2.default)(_React$cloneElement, "disabled", globalDisabled || isDisabled), (0, _defineProperty2.default)(_React$cloneElement, "isFirst", isFirst), (0, _defineProperty2.default)(_React$cloneElement, "isLast", isLast), (0, _defineProperty2.default)(_React$cloneElement, "key", isValidKey(_key) ? _key : child.key || "".concat(i)), (0, _defineProperty2.default)(_React$cloneElement, "children", display), _React$cloneElement)));
|
|
180
|
-
childrenMap.set(_key, display);
|
|
181
|
-
} else {
|
|
182
|
-
childrenMap.set(_key, _props.children);
|
|
183
|
-
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
184
|
-
|
|
185
|
-
} else if (subGroupTag && subGroupKeyName && (_child$type2 = child.type) !== null && _child$type2 !== void 0 && _child$type2[subGroupTag]) {
|
|
186
|
-
var _React$cloneElement2;
|
|
187
|
-
|
|
188
|
-
var _props2 = child.props;
|
|
189
|
-
|
|
190
|
-
var _key2 = _props2[subGroupKeyName] || child.key || "".concat(prefix, "-").concat(i);
|
|
191
|
-
|
|
192
|
-
var _isDisabled = disabled || _props2.disabled;
|
|
193
|
-
|
|
194
|
-
var _group2 = _group(child.props.children, _isDisabled, _key2),
|
|
195
|
-
_group3 = (0, _slicedToArray2.default)(_group2, 3),
|
|
196
|
-
subValidKeys = _group3[0],
|
|
197
|
-
subDisabledKeys = _group3[1],
|
|
198
|
-
subRenderChildren = _group3[2];
|
|
199
|
-
|
|
200
|
-
subGroupMap.set(_key2, {
|
|
201
|
-
validKeys: subValidKeys,
|
|
202
|
-
disabledKeys: subDisabledKeys
|
|
203
|
-
});
|
|
204
|
-
validKeys.push.apply(validKeys, (0, _toConsumableArray2.default)(subValidKeys));
|
|
205
|
-
disabledKeys.push.apply(disabledKeys, (0, _toConsumableArray2.default)(subDisabledKeys));
|
|
206
|
-
renderChildren.push( /*#__PURE__*/_react.default.cloneElement(child, (_React$cloneElement2 = {
|
|
207
|
-
disabled: globalDisabled || _isDisabled
|
|
208
|
-
}, (0, _defineProperty2.default)(_React$cloneElement2, subGroupKeyName, _key2), (0, _defineProperty2.default)(_React$cloneElement2, "isFirst", isFirst), (0, _defineProperty2.default)(_React$cloneElement2, "isLast", isLast), (0, _defineProperty2.default)(_React$cloneElement2, "key", _key2), _React$cloneElement2), subRenderChildren));
|
|
209
|
-
} else {
|
|
210
|
-
renderChildren.push(child);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}.bind(this));
|
|
214
|
-
|
|
215
|
-
return [validKeys, disabledKeys, renderChildren];
|
|
216
|
-
}.bind(this);
|
|
217
|
-
|
|
218
|
-
return [].concat((0, _toConsumableArray2.default)(_group(children, false, 'group-root')), [subGroupMap, childrenMap]);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
var groupOptionsAsDataSource = function groupOptionsAsDataSource(options) {
|
|
222
|
-
var _this4 = this;
|
|
223
|
-
|
|
224
|
-
var globalDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
225
|
-
|
|
226
|
-
var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
227
|
-
subGroupName: 'children',
|
|
228
|
-
displayName: 'label',
|
|
229
|
-
itemKeyName: 'itemKey',
|
|
230
|
-
subGroupKeyName: 'subGroupKey',
|
|
231
|
-
ItemComponent: function ItemComponent() {
|
|
232
|
-
(0, _newArrowCheck2.default)(this, _this4);
|
|
233
|
-
return null;
|
|
234
|
-
}.bind(this),
|
|
235
|
-
SubGroupComponent: function SubGroupComponent() {
|
|
236
|
-
(0, _newArrowCheck2.default)(this, _this4);
|
|
237
|
-
return null;
|
|
238
|
-
}.bind(this)
|
|
239
|
-
},
|
|
240
|
-
subGroupName = _ref3.subGroupName,
|
|
241
|
-
displayName = _ref3.displayName,
|
|
242
|
-
itemKeyName = _ref3.itemKeyName,
|
|
243
|
-
subGroupKeyName = _ref3.subGroupKeyName,
|
|
244
|
-
ItemComponent = _ref3.ItemComponent,
|
|
245
|
-
SubGroupComponent = _ref3.SubGroupComponent;
|
|
246
|
-
|
|
247
|
-
var searchValue = arguments.length > 3 ? arguments[3] : undefined;
|
|
248
|
-
var handleSearch = arguments.length > 4 ? arguments[4] : undefined;
|
|
249
|
-
var subGroupMap = new Map();
|
|
250
|
-
var childrenMap = new Map();
|
|
251
|
-
|
|
252
|
-
var group = function group(options) {
|
|
253
|
-
var _this5 = this;
|
|
254
|
-
|
|
255
|
-
var disabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
256
|
-
var prefixKey = arguments.length > 2 ? arguments[2] : undefined;
|
|
257
|
-
var validKeys = [];
|
|
258
|
-
var disabledKeys = [];
|
|
259
|
-
var renderChildren = [];
|
|
260
|
-
options.forEach(function (child, i) {
|
|
261
|
-
(0, _newArrowCheck2.default)(this, _this5);
|
|
262
|
-
var subChildren = child[subGroupName];
|
|
263
|
-
|
|
264
|
-
if (subChildren) {
|
|
265
|
-
var _key3 = child[subGroupKeyName] || child.key || "".concat(prefixKey, "-").concat(i);
|
|
266
|
-
|
|
267
|
-
var reactKey = child.key || isValidKey(child[subGroupKeyName]) ? child[subGroupKeyName] : "".concat(prefixKey, "-").concat(i);
|
|
268
|
-
var isDisabled = disabled || child.disabled;
|
|
269
|
-
|
|
270
|
-
var _group4 = group(subChildren, isDisabled, _key3),
|
|
271
|
-
_group5 = (0, _slicedToArray2.default)(_group4, 3),
|
|
272
|
-
subValidKeys = _group5[0],
|
|
273
|
-
subDisabledKeys = _group5[1],
|
|
274
|
-
subRenderChildren = _group5[2];
|
|
275
|
-
|
|
276
|
-
subGroupMap.set(_key3, {
|
|
277
|
-
validKeys: subValidKeys,
|
|
278
|
-
disabledKeys: subDisabledKeys
|
|
279
|
-
});
|
|
280
|
-
validKeys.push.apply(validKeys, (0, _toConsumableArray2.default)(subValidKeys));
|
|
281
|
-
disabledKeys.push.apply(disabledKeys, (0, _toConsumableArray2.default)(subDisabledKeys));
|
|
282
|
-
|
|
283
|
-
var _visible2 = searchValue ? !!subRenderChildren.length : true;
|
|
284
|
-
|
|
285
|
-
if (_visible2) {
|
|
286
|
-
renderChildren.push( /*#__PURE__*/_react.default.createElement(SubGroupComponent, (0, _extends2.default)({
|
|
287
|
-
key: reactKey
|
|
288
|
-
}, child, (0, _defineProperty2.default)({
|
|
289
|
-
disabled: globalDisabled || isDisabled
|
|
290
|
-
}, subGroupKeyName, _key3)), subRenderChildren));
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
var _key4 = child[itemKeyName] === undefined ? child.key : child[itemKeyName];
|
|
294
|
-
|
|
295
|
-
var _reactKey = child.key || isValidKey(child[itemKeyName]) ? child[itemKeyName] : "".concat(prefixKey, "-").concat(i);
|
|
296
|
-
|
|
297
|
-
var _isDisabled2 = disabled || child.disabled;
|
|
298
|
-
|
|
299
|
-
var _visible3 = searchValue ? handleSearch(_key4, child) : true;
|
|
300
|
-
|
|
301
|
-
if (_visible3) {
|
|
302
|
-
var _ref5;
|
|
303
|
-
|
|
304
|
-
if (_isDisabled2) {
|
|
305
|
-
disabledKeys.push(_key4);
|
|
306
|
-
} else {
|
|
307
|
-
validKeys.push(_key4);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
var display = Array.isArray(_visible3) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, _visible3[0], /*#__PURE__*/_react.default.createElement(_Search.Highlight, null, _visible3[1]), _visible3[2]) : (_ref5 = child[displayName]) !== null && _ref5 !== void 0 ? _ref5 : _key4;
|
|
311
|
-
renderChildren.push( /*#__PURE__*/_react.default.createElement(ItemComponent, (0, _extends2.default)({
|
|
312
|
-
key: _reactKey
|
|
313
|
-
}, child, (0, _defineProperty2.default)({
|
|
314
|
-
disabled: globalDisabled || _isDisabled2
|
|
315
|
-
}, itemKeyName, _key4)), display));
|
|
316
|
-
childrenMap.set(_key4, display);
|
|
317
|
-
} else {
|
|
318
|
-
var _ref7;
|
|
319
|
-
|
|
320
|
-
childrenMap.set(_key4, (_ref7 = child[displayName]) !== null && _ref7 !== void 0 ? _ref7 : child[itemKeyName]);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}.bind(this));
|
|
324
|
-
return [validKeys, disabledKeys, renderChildren];
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
return [].concat((0, _toConsumableArray2.default)(group(options, false, 'group-root')), [subGroupMap, childrenMap]);
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
var Popup = /*#__PURE__*/_react.default.memo(function Popup(_ref8) {
|
|
331
|
-
var v1 = _ref8.v1,
|
|
332
|
-
props = (0, _objectWithoutProperties2.default)(_ref8, _excluded);
|
|
333
|
-
var PopupComponent = props.renderPopup ? CustomPopup : v1 ? PopupV1 : PopupV2;
|
|
334
|
-
return /*#__PURE__*/_react.default.createElement(PopupComponent, props);
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
var CustomPopup = /*#__PURE__*/_react.default.memo(function CustomPopup(props) {
|
|
338
|
-
var onChange = props.onChange,
|
|
339
|
-
value = props.value,
|
|
340
|
-
multiple = props.multiple,
|
|
341
|
-
extra = props.extra,
|
|
342
|
-
search = props.search,
|
|
343
|
-
children = props.children,
|
|
344
|
-
options = props.options,
|
|
345
|
-
handleVisibleChange = props.handleVisibleChange,
|
|
346
|
-
renderPopup = props.renderPopup;
|
|
347
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderPopup === null || renderPopup === void 0 ? void 0 : renderPopup({
|
|
348
|
-
handleVisible: handleVisibleChange,
|
|
349
|
-
onChange: onChange,
|
|
350
|
-
value: value,
|
|
351
|
-
multiple: multiple,
|
|
352
|
-
extra: extra,
|
|
353
|
-
search: search,
|
|
354
|
-
children: children,
|
|
355
|
-
options: options
|
|
356
|
-
}));
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
var PopupV1 = /*#__PURE__*/_react.default.memo(function PopupV1(_ref9) {
|
|
360
|
-
var _this6 = this;
|
|
361
|
-
|
|
362
|
-
var extra = _ref9.extra,
|
|
363
|
-
_ref9$customStyle = _ref9.customStyle,
|
|
364
|
-
customStyle = _ref9$customStyle === void 0 ? {} : _ref9$customStyle,
|
|
365
|
-
search = _ref9.search,
|
|
366
|
-
multiple = _ref9.multiple,
|
|
367
|
-
_emptyContent = _ref9.emptyContent,
|
|
368
|
-
showSelectAll = _ref9.showSelectAll,
|
|
369
|
-
value = _ref9.value,
|
|
370
|
-
options = _ref9.options,
|
|
371
|
-
children = _ref9.children,
|
|
372
|
-
onChange = _ref9.onChange,
|
|
373
|
-
locale = _ref9.locale,
|
|
374
|
-
handleVisibleChange = _ref9.handleVisibleChange,
|
|
375
|
-
hidePopup = _ref9.hidePopup,
|
|
376
|
-
dataSource = _ref9.dataSource,
|
|
377
|
-
searchValue = _ref9.searchValue,
|
|
378
|
-
setSearchValue = _ref9.setSearchValue,
|
|
379
|
-
virtualList = _ref9.virtualList;
|
|
380
|
-
var handleChange = (0, _react.useCallback)(function (value) {
|
|
381
|
-
(0, _newArrowCheck2.default)(this, _this6);
|
|
382
|
-
|
|
383
|
-
if (!multiple) {
|
|
384
|
-
handleVisibleChange(false);
|
|
385
|
-
onChange(value[0]);
|
|
386
|
-
} else {
|
|
387
|
-
onChange(value);
|
|
388
|
-
}
|
|
389
|
-
}.bind(this), [multiple, onChange, handleVisibleChange]);
|
|
390
|
-
var handleSearchInput = (0, _react.useCallback)(function (e) {
|
|
391
|
-
(0, _newArrowCheck2.default)(this, _this6);
|
|
392
|
-
setSearchValue(e.target.value);
|
|
393
|
-
}.bind(this), [setSearchValue]);
|
|
394
|
-
var finalExtra = (0, _react.useMemo)(function () {
|
|
395
|
-
(0, _newArrowCheck2.default)(this, _this6);
|
|
396
|
-
|
|
397
|
-
if (typeof extra === 'function') {
|
|
398
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra(hidePopup));
|
|
399
|
-
} else if (!(0, _isEmpty.default)(extra)) {
|
|
400
|
-
if ( /*#__PURE__*/_react.default.isValidElement(extra)) {
|
|
401
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra);
|
|
402
|
-
} else if ((0, _isObject.default)(extra)) {
|
|
403
|
-
var _ref10 = extra,
|
|
404
|
-
_content = _ref10.content,
|
|
405
|
-
rest = (0, _objectWithoutProperties2.default)(_ref10, _excluded2);
|
|
406
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, rest, _content);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}.bind(this), [extra, hidePopup]);
|
|
410
|
-
var maxWidth = customStyle.popupMaxWidth ? customStyle.popupMaxWidth : 'none';
|
|
411
|
-
|
|
412
|
-
var newCustomStyle = _objectSpread({}, customStyle);
|
|
413
|
-
|
|
414
|
-
if (virtualList) {
|
|
415
|
-
if ('optionListMaxHeight' in newCustomStyle) {
|
|
416
|
-
warnLogForCustomHeight();
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
newCustomStyle.optionListMaxHeight = 'none';
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
var emptyContent = (0, _react.useMemo)(function () {
|
|
423
|
-
(0, _newArrowCheck2.default)(this, _this6);
|
|
424
|
-
return _emptyContent || /*#__PURE__*/_react.default.createElement(_style2.EmptyContentWrapper, null, locale.emptyTip);
|
|
425
|
-
}.bind(this), [_emptyContent, locale]);
|
|
426
|
-
return /*#__PURE__*/_react.default.createElement(_style2.MenuWrap, {
|
|
427
|
-
maxWidth: maxWidth
|
|
428
|
-
}, search && /*#__PURE__*/_react.default.createElement(_style2.SelectSearchInput, {
|
|
429
|
-
block: true,
|
|
430
|
-
onChange: handleSearchInput,
|
|
431
|
-
value: searchValue,
|
|
432
|
-
status: "default"
|
|
433
|
-
}), children || options !== null && options !== void 0 && options.length ? /*#__PURE__*/_react.default.createElement(_style2.BlockMenu, {
|
|
434
|
-
onChange: handleChange,
|
|
435
|
-
customStyle: newCustomStyle,
|
|
436
|
-
menuCustomStyle: {
|
|
437
|
-
maxWidth: 'none'
|
|
438
|
-
},
|
|
439
|
-
dataSource: dataSource,
|
|
440
|
-
multiple: multiple,
|
|
441
|
-
showSelectAll: showSelectAll,
|
|
442
|
-
selectedKeys: multiple ? value : [value],
|
|
443
|
-
virtualList: options ? virtualList : false
|
|
444
|
-
}) : /*#__PURE__*/_react.default.createElement(_style2.BlockMenu, {
|
|
445
|
-
customStyle: newCustomStyle,
|
|
446
|
-
menuCustomStyle: {
|
|
447
|
-
maxWidth: 'none'
|
|
448
|
-
}
|
|
449
|
-
}, emptyContent), finalExtra ? /*#__PURE__*/_react.default.createElement(_style2.FooterWrap, null, finalExtra) : null);
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
var PopupV2 = /*#__PURE__*/_react.default.memo(function PopupV2(_ref11) {
|
|
453
|
-
var _this7 = this,
|
|
454
|
-
_dataSource$;
|
|
455
|
-
|
|
456
|
-
var extra = _ref11.extra,
|
|
457
|
-
_ref11$customStyle = _ref11.customStyle,
|
|
458
|
-
customStyle = _ref11$customStyle === void 0 ? {} : _ref11$customStyle,
|
|
459
|
-
multiple = _ref11.multiple,
|
|
460
|
-
_emptyContent = _ref11.emptyContent,
|
|
461
|
-
showSelectAll = _ref11.showSelectAll,
|
|
462
|
-
value = _ref11.value,
|
|
463
|
-
options = _ref11.options,
|
|
464
|
-
children = _ref11.children,
|
|
465
|
-
onChange = _ref11.onChange,
|
|
466
|
-
locale = _ref11.locale,
|
|
467
|
-
handleVisibleChange = _ref11.handleVisibleChange,
|
|
468
|
-
hidePopup = _ref11.hidePopup,
|
|
469
|
-
dataSource = _ref11.dataSource,
|
|
470
|
-
virtualList = _ref11.virtualList,
|
|
471
|
-
searchValue = _ref11.searchValue;
|
|
472
|
-
var menuRef = (0, _react.useRef)(null);
|
|
473
|
-
var handleChange = (0, _react.useCallback)(function (value) {
|
|
474
|
-
(0, _newArrowCheck2.default)(this, _this7);
|
|
475
|
-
|
|
476
|
-
if (!multiple) {
|
|
477
|
-
handleVisibleChange(false);
|
|
478
|
-
onChange(value[0]);
|
|
479
|
-
} else {
|
|
480
|
-
onChange(value);
|
|
481
|
-
}
|
|
482
|
-
}.bind(this), [multiple, onChange, handleVisibleChange]);
|
|
483
|
-
var handleSelectAll = (0, _react.useCallback)(function () {
|
|
484
|
-
(0, _newArrowCheck2.default)(this, _this7);
|
|
485
|
-
var validKeys = dataSource[0];
|
|
486
|
-
var newValue = Array.from(new Set([].concat((0, _toConsumableArray2.default)(value || []), (0, _toConsumableArray2.default)(validKeys))));
|
|
487
|
-
onChange(newValue);
|
|
488
|
-
}.bind(this), [dataSource, onChange, value]);
|
|
489
|
-
var emptyContent = (0, _react.useMemo)(function () {
|
|
490
|
-
(0, _newArrowCheck2.default)(this, _this7);
|
|
491
|
-
return _emptyContent || /*#__PURE__*/_react.default.createElement(_style2.EmptyContentWrapper, null, locale.emptyTip);
|
|
492
|
-
}.bind(this), [_emptyContent, locale]);
|
|
493
|
-
var finalExtra = (0, _react.useMemo)(function () {
|
|
494
|
-
(0, _newArrowCheck2.default)(this, _this7);
|
|
495
|
-
|
|
496
|
-
if (typeof extra === 'function') {
|
|
497
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra(hidePopup));
|
|
498
|
-
} else if (!(0, _isEmpty.default)(extra)) {
|
|
499
|
-
if ( /*#__PURE__*/_react.default.isValidElement(extra)) {
|
|
500
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, null, extra);
|
|
501
|
-
} else if ((0, _isObject.default)(extra)) {
|
|
502
|
-
var _ref12 = extra,
|
|
503
|
-
_content2 = _ref12.content,
|
|
504
|
-
rest = (0, _objectWithoutProperties2.default)(_ref12, _excluded3);
|
|
505
|
-
return /*#__PURE__*/_react.default.createElement(_Extra.default, rest, _content2);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}.bind(this), [extra, hidePopup]);
|
|
509
|
-
var maxWidth = customStyle.popupMaxWidth ? customStyle.popupMaxWidth : 'none';
|
|
510
|
-
|
|
511
|
-
var newCustomStyle = _objectSpread({}, customStyle);
|
|
512
|
-
|
|
513
|
-
if (virtualList) {
|
|
514
|
-
if ('optionListMaxHeight' in newCustomStyle) {
|
|
515
|
-
warnLogForCustomHeight();
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
newCustomStyle.optionListMaxHeight = 'none';
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
var hasContent = (children || (options === null || options === void 0 ? void 0 : options.length)) && (Array.isArray(dataSource[2]) ? (_dataSource$ = dataSource[2]) === null || _dataSource$ === void 0 ? void 0 : _dataSource$.length : dataSource[2]);
|
|
522
|
-
return /*#__PURE__*/_react.default.createElement(_style2.MenuWrap, {
|
|
523
|
-
maxWidth: maxWidth
|
|
524
|
-
}, hasContent ? /*#__PURE__*/_react.default.createElement(_style2.BlockMenu, {
|
|
525
|
-
showSelectAll: showSelectAll && multiple && /*#__PURE__*/_react.default.createElement("div", {
|
|
526
|
-
className: _style2.selectAllBtnWrapCls,
|
|
527
|
-
key: "__select_select_all",
|
|
528
|
-
onClick: handleSelectAll
|
|
529
|
-
}, locale.selectAll, searchValue ? " (".concat(searchValue, ")") : ''),
|
|
530
|
-
onChange: handleChange,
|
|
531
|
-
customStyle: newCustomStyle,
|
|
532
|
-
menuCustomStyle: {
|
|
533
|
-
maxWidth: 'none'
|
|
534
|
-
},
|
|
535
|
-
dataSource: dataSource,
|
|
536
|
-
multiple: multiple,
|
|
537
|
-
selectedKeys: multiple ? value : [value],
|
|
538
|
-
virtualList: options ? virtualList : false,
|
|
539
|
-
ref: menuRef,
|
|
540
|
-
_selectStyle: multiple
|
|
541
|
-
}) : /*#__PURE__*/_react.default.createElement(_style2.BlockMenu, {
|
|
542
|
-
customStyle: newCustomStyle,
|
|
543
|
-
menuCustomStyle: {
|
|
544
|
-
maxWidth: 'none'
|
|
545
|
-
}
|
|
546
|
-
}, emptyContent), finalExtra ? /*#__PURE__*/_react.default.createElement(_style2.FooterWrap, null, finalExtra) : null);
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
var Selector = /*#__PURE__*/_react.default.memo(function Selector(_ref13) {
|
|
550
|
-
var v1 = _ref13.v1,
|
|
551
|
-
size = _ref13.size,
|
|
552
|
-
disabled = _ref13.disabled,
|
|
553
|
-
multiple = _ref13.multiple,
|
|
554
|
-
placeholder = _ref13.placeholder,
|
|
555
|
-
renderContent = _ref13.renderContent,
|
|
556
|
-
renderSelector = _ref13.renderSelector,
|
|
557
|
-
renderPopup = _ref13.renderPopup,
|
|
558
|
-
value = _ref13.value,
|
|
559
|
-
onChange = _ref13.onChange,
|
|
560
|
-
visible = _ref13.visible,
|
|
561
|
-
setVisible = _ref13.setVisible,
|
|
562
|
-
locale = _ref13.locale,
|
|
563
|
-
dataSource = _ref13.dataSource,
|
|
564
|
-
search = _ref13.search,
|
|
565
|
-
searchValue = _ref13.searchValue,
|
|
566
|
-
setSearchValue = _ref13.setSearchValue,
|
|
567
|
-
wrapRef = _ref13.wrapRef,
|
|
568
|
-
clearable = _ref13.clearable,
|
|
569
|
-
styleType = _ref13.styleType,
|
|
570
|
-
block = _ref13.block,
|
|
571
|
-
_popupProps = (0, _objectWithoutProperties2.default)(_ref13, _excluded4);
|
|
572
|
-
|
|
573
|
-
var props = {
|
|
574
|
-
size: size,
|
|
575
|
-
disabled: disabled,
|
|
576
|
-
multiple: multiple,
|
|
577
|
-
placeholder: placeholder,
|
|
578
|
-
renderContent: renderContent,
|
|
579
|
-
renderSelector: renderSelector,
|
|
580
|
-
renderPopup: renderPopup,
|
|
581
|
-
value: value,
|
|
582
|
-
onChange: onChange,
|
|
583
|
-
visible: visible,
|
|
584
|
-
setVisible: setVisible,
|
|
585
|
-
locale: locale,
|
|
586
|
-
dataSource: dataSource,
|
|
587
|
-
search: search,
|
|
588
|
-
searchValue: searchValue,
|
|
589
|
-
setSearchValue: setSearchValue,
|
|
590
|
-
wrapRef: wrapRef,
|
|
591
|
-
clearable: clearable,
|
|
592
|
-
block: block,
|
|
593
|
-
_popupProps: _popupProps
|
|
594
|
-
};
|
|
595
|
-
var SelectorComponent = renderSelector ? CustomSelector : v1 ? SelectorV1 : multiple ? styleType === 'list' ? MultipleListSelector : MultipleSelector : SingleSelector;
|
|
596
|
-
return /*#__PURE__*/_react.default.createElement(SelectorComponent, props);
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
var useOldContent = function useOldContent(_ref14) {
|
|
600
|
-
var _this8 = this;
|
|
601
|
-
|
|
602
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
603
|
-
var locale = _ref14.locale,
|
|
604
|
-
placeholder = _ref14.placeholder,
|
|
605
|
-
multiple = _ref14.multiple,
|
|
606
|
-
dataSource = _ref14.dataSource,
|
|
607
|
-
value = _ref14.value,
|
|
608
|
-
renderContent = _ref14.renderContent,
|
|
609
|
-
renderPopup = _ref14.renderPopup;
|
|
610
|
-
placeholder = (0, _react.useMemo)(function () {
|
|
611
|
-
(0, _newArrowCheck2.default)(this, _this8);
|
|
612
|
-
return placeholder || locale.placeholder;
|
|
613
|
-
}.bind(this), [locale.placeholder, placeholder]);
|
|
614
|
-
var defaultRenderContent = (0, _react.useCallback)(function (value, valueChild) {
|
|
615
|
-
(0, _newArrowCheck2.default)(this, _this8);
|
|
616
|
-
|
|
617
|
-
if (!multiple) {
|
|
618
|
-
if (value === undefined) {
|
|
619
|
-
return placeholder;
|
|
620
|
-
} else {
|
|
621
|
-
return valueChild;
|
|
622
|
-
}
|
|
623
|
-
} else {
|
|
624
|
-
if (value && value.length) {
|
|
625
|
-
return "".concat(locale.selected).concat(value.length).concat(locale.items);
|
|
626
|
-
} else {
|
|
627
|
-
return placeholder;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}.bind(this), [locale.items, locale.selected, multiple, placeholder]);
|
|
631
|
-
var getContent = (0, _react.useCallback)(function () {
|
|
632
|
-
var _this9 = this;
|
|
633
|
-
|
|
634
|
-
(0, _newArrowCheck2.default)(this, _this8);
|
|
635
|
-
|
|
636
|
-
var _dataSource = (0, _slicedToArray2.default)(dataSource, 5),
|
|
637
|
-
_dataSource$2 = _dataSource[4],
|
|
638
|
-
childrenMap = _dataSource$2 === void 0 ? new Map() : _dataSource$2;
|
|
639
|
-
|
|
640
|
-
var valueChild;
|
|
641
|
-
|
|
642
|
-
var getValueChild = function getValueChild(v) {
|
|
643
|
-
(0, _newArrowCheck2.default)(this, _this9);
|
|
644
|
-
return childrenMap.has(v) ? childrenMap.get(v) : v;
|
|
645
|
-
}.bind(this);
|
|
646
|
-
|
|
647
|
-
if (!multiple) {
|
|
648
|
-
valueChild = getValueChild(value);
|
|
649
|
-
} else {
|
|
650
|
-
var _value = value ? (0, _toConsumableArray2.default)(value) : []; // only get the top twenty item child for better performance
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
if (_value.length > 20) {
|
|
654
|
-
_value.length = 20;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
valueChild = _value.map(getValueChild);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
if (renderContent) {
|
|
661
|
-
return renderContent(value, valueChild);
|
|
662
|
-
} else {
|
|
663
|
-
return defaultRenderContent(value, valueChild);
|
|
664
|
-
}
|
|
665
|
-
}.bind(this), [dataSource, defaultRenderContent, multiple, renderContent, value]);
|
|
666
|
-
var content = (0, _react.useMemo)(getContent, [getContent]); // 自定义渲染弹层时,开发者可能不传入 options 和 children,导致 content memo deps 不触发变更,故强制更新
|
|
667
|
-
|
|
668
|
-
if (renderPopup) content = getContent();
|
|
669
|
-
return content;
|
|
670
|
-
}.bind(void 0);
|
|
671
|
-
|
|
672
|
-
var CustomSelector = /*#__PURE__*/_react.default.memo(function CustomSelector(props) {
|
|
673
|
-
var content = useOldContent(props); // eslint-disable-next-line react/prop-types
|
|
674
|
-
|
|
675
|
-
var renderSelector = props.renderSelector,
|
|
676
|
-
visible = props.visible,
|
|
677
|
-
_popupProps = props._popupProps;
|
|
678
|
-
|
|
679
|
-
var selector = (renderSelector === null || renderSelector === void 0 ? void 0 : renderSelector(content, visible)) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
680
|
-
|
|
681
|
-
return /*#__PURE__*/_react.default.isValidElement(selector) ? /*#__PURE__*/_react.default.cloneElement(selector, _popupProps) : null;
|
|
682
|
-
});
|
|
683
|
-
|
|
684
|
-
var SelectorV1 = /*#__PURE__*/_react.default.memo(function SelectorV1(props) {
|
|
685
|
-
var size = props.size,
|
|
686
|
-
disabled = props.disabled,
|
|
687
|
-
visible = props.visible,
|
|
688
|
-
_popupProps = props._popupProps;
|
|
689
|
-
var content = useOldContent(props);
|
|
690
|
-
var title = typeof content === 'string' ? content : undefined;
|
|
691
|
-
return /*#__PURE__*/_react.default.createElement(_style2.SSelector, (0, _extends2.default)({
|
|
692
|
-
styleType: "border",
|
|
693
|
-
size: size,
|
|
694
|
-
disabled: disabled,
|
|
695
|
-
title: title
|
|
696
|
-
}, _popupProps), /*#__PURE__*/_react.default.createElement("div", {
|
|
697
|
-
className: _style2.selectorContentCls,
|
|
698
|
-
key: "content"
|
|
699
|
-
}, content), /*#__PURE__*/_react.default.createElement(_style2.Arrow, {
|
|
700
|
-
key: "icon",
|
|
701
|
-
type: visible ? 'arrow-up' : 'arrow-down'
|
|
702
|
-
}));
|
|
703
|
-
});
|
|
704
|
-
|
|
705
|
-
var RestListItem = /*#__PURE__*/_react.default.memo(function RestListItem(_ref15) {
|
|
706
|
-
var _this10 = this;
|
|
707
|
-
|
|
708
|
-
var item = _ref15.item,
|
|
709
|
-
disabled = _ref15.disabled,
|
|
710
|
-
onClose = _ref15.onClose;
|
|
711
|
-
var handleClose = (0, _react.useCallback)(function () {
|
|
712
|
-
(0, _newArrowCheck2.default)(this, _this10);
|
|
713
|
-
onClose(item.key);
|
|
714
|
-
}.bind(this), [item.key, onClose]);
|
|
715
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
716
|
-
key: item.key,
|
|
717
|
-
className: _style2.restItemCls
|
|
718
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
719
|
-
"data-role": "label"
|
|
720
|
-
}, item.children), !disabled && /*#__PURE__*/_react.default.createElement("span", {
|
|
721
|
-
"data-role": "close",
|
|
722
|
-
onClick: handleClose
|
|
723
|
-
}, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
|
|
724
|
-
type: "cross"
|
|
725
|
-
})));
|
|
726
|
-
});
|
|
727
|
-
|
|
728
|
-
var RestList = /*#__PURE__*/_react.default.memo(function RestList(_ref16) {
|
|
729
|
-
var _this11 = this;
|
|
730
|
-
|
|
731
|
-
var items = _ref16.items,
|
|
732
|
-
onClose = _ref16.onClose,
|
|
733
|
-
disabled = _ref16.disabled,
|
|
734
|
-
rest = (0, _objectWithoutProperties2.default)(_ref16, _excluded5);
|
|
735
|
-
var prevent = (0, _react.useCallback)(function (e) {
|
|
736
|
-
(0, _newArrowCheck2.default)(this, _this11);
|
|
737
|
-
e.preventDefault();
|
|
738
|
-
e.stopPropagation();
|
|
739
|
-
}.bind(this), []);
|
|
740
|
-
return /*#__PURE__*/_react.default.createElement(_style2.SRestList, (0, _extends2.default)({}, rest, {
|
|
741
|
-
onClick: prevent,
|
|
742
|
-
onContextMenu: prevent
|
|
743
|
-
}), /*#__PURE__*/_react.default.createElement(_VirtualScrollList.default, {
|
|
744
|
-
width: 160,
|
|
745
|
-
height: 180
|
|
746
|
-
}, items.map(function (item) {
|
|
747
|
-
(0, _newArrowCheck2.default)(this, _this11);
|
|
748
|
-
return /*#__PURE__*/_react.default.createElement(RestListItem, {
|
|
749
|
-
item: item,
|
|
750
|
-
key: item.key,
|
|
751
|
-
onClose: onClose,
|
|
752
|
-
disabled: disabled
|
|
753
|
-
});
|
|
754
|
-
}.bind(this))));
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
var TagItem = /*#__PURE__*/_react.default.memo(function TagItem(_ref17) {
|
|
758
|
-
var _this12 = this;
|
|
759
|
-
|
|
760
|
-
var item = _ref17.item,
|
|
761
|
-
disabled = _ref17.disabled,
|
|
762
|
-
onClose = _ref17.onClose;
|
|
763
|
-
var handleClose = (0, _react.useCallback)(function () {
|
|
764
|
-
(0, _newArrowCheck2.default)(this, _this12);
|
|
765
|
-
onClose(item.key);
|
|
766
|
-
}.bind(this), [item.key, onClose]);
|
|
767
|
-
return /*#__PURE__*/_react.default.createElement(_Tag.default, {
|
|
768
|
-
key: item.key,
|
|
769
|
-
closable: true,
|
|
770
|
-
disabled: disabled,
|
|
771
|
-
onClose: handleClose
|
|
772
|
-
}, item.children);
|
|
773
|
-
});
|
|
774
|
-
|
|
775
|
-
var restAlign = {
|
|
776
|
-
points: ['tl', 'br'],
|
|
777
|
-
overflow: {
|
|
778
|
-
adjustX: 1,
|
|
779
|
-
adjustY: 1
|
|
780
|
-
},
|
|
781
|
-
offset: [10, 10],
|
|
782
|
-
targetOffset: [0, 0]
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
var MultipleListSelector = /*#__PURE__*/_react.default.memo(function MultipleSelector(props) {
|
|
786
|
-
var _this13 = this;
|
|
787
|
-
|
|
788
|
-
var size = props.size,
|
|
789
|
-
disabled = props.disabled,
|
|
790
|
-
visible = props.visible,
|
|
791
|
-
setVisible = props.setVisible,
|
|
792
|
-
dataSource = props.dataSource,
|
|
793
|
-
value = props.value,
|
|
794
|
-
onChange = props.onChange,
|
|
795
|
-
placeholder = props.placeholder,
|
|
796
|
-
search = props.search,
|
|
797
|
-
_props$searchValue = props.searchValue,
|
|
798
|
-
searchValue = _props$searchValue === void 0 ? '' : _props$searchValue,
|
|
799
|
-
setSearchValue = props.setSearchValue,
|
|
800
|
-
clearable = props.clearable,
|
|
801
|
-
locale = props.locale,
|
|
802
|
-
block = props.block,
|
|
803
|
-
_popupProps = props._popupProps;
|
|
804
|
-
|
|
805
|
-
var _dataSource2 = (0, _slicedToArray2.default)(dataSource, 5),
|
|
806
|
-
_dataSource2$ = _dataSource2[4],
|
|
807
|
-
childrenMap = _dataSource2$ === void 0 ? new Map() : _dataSource2$;
|
|
808
|
-
|
|
809
|
-
var inputRef = (0, _react.useRef)(null);
|
|
810
|
-
var items = (0, _react.useMemo)(function () {
|
|
811
|
-
var _this14 = this;
|
|
812
|
-
|
|
813
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
814
|
-
return (value || []).map(function (v) {
|
|
815
|
-
(0, _newArrowCheck2.default)(this, _this14);
|
|
816
|
-
return {
|
|
817
|
-
key: v,
|
|
818
|
-
children: childrenMap.has(v) ? childrenMap.get(v) : v
|
|
819
|
-
};
|
|
820
|
-
}.bind(this));
|
|
821
|
-
}.bind(this), [childrenMap, value]);
|
|
822
|
-
var handleClose = (0, _react.useCallback)(function (key) {
|
|
823
|
-
var _this15 = this;
|
|
824
|
-
|
|
825
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
826
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value.filter(function (v) {
|
|
827
|
-
(0, _newArrowCheck2.default)(this, _this15);
|
|
828
|
-
return v !== key;
|
|
829
|
-
}.bind(this)));
|
|
830
|
-
}.bind(this), [onChange, value]);
|
|
831
|
-
var renderItem = (0, _react.useCallback)(function (item) {
|
|
832
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
833
|
-
return /*#__PURE__*/_react.default.createElement(TagItem, {
|
|
834
|
-
key: item.key,
|
|
835
|
-
disabled: disabled,
|
|
836
|
-
onClose: handleClose,
|
|
837
|
-
item: item
|
|
838
|
-
});
|
|
839
|
-
}.bind(this), [disabled, handleClose]);
|
|
840
|
-
var handleInput = (0, _react.useCallback)(function (e) {
|
|
841
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
842
|
-
setSearchValue(e.target.value);
|
|
843
|
-
}.bind(this), [setSearchValue]);
|
|
844
|
-
(0, _react.useEffect)(function () {
|
|
845
|
-
var _inputRef$current;
|
|
846
|
-
|
|
847
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
848
|
-
if (visible) (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
849
|
-
}.bind(this), [visible]);
|
|
850
|
-
var handleClear = (0, _react.useCallback)(function (e) {
|
|
851
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
852
|
-
e.stopPropagation();
|
|
853
|
-
e.preventDefault();
|
|
854
|
-
|
|
855
|
-
if (!disabled) {
|
|
856
|
-
onChange === null || onChange === void 0 ? void 0 : onChange([]); // inputRef.current?.focus();
|
|
857
|
-
|
|
858
|
-
setVisible(false);
|
|
859
|
-
}
|
|
860
|
-
}.bind(this), [disabled, onChange, setVisible]);
|
|
861
|
-
var empty = (0, _react.useMemo)(function () {
|
|
862
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
863
|
-
return !(value !== null && value !== void 0 && value.length);
|
|
864
|
-
}.bind(this), [value]);
|
|
865
|
-
var handleSelectorClick = (0, _react.useCallback)(function (e) {
|
|
866
|
-
var _inputRef$current2, _popupProps$onClick;
|
|
867
|
-
|
|
868
|
-
(0, _newArrowCheck2.default)(this, _this13);
|
|
869
|
-
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
870
|
-
(_popupProps$onClick = _popupProps.onClick) === null || _popupProps$onClick === void 0 ? void 0 : _popupProps$onClick.call(_popupProps, e);
|
|
871
|
-
}.bind(this), [_popupProps]);
|
|
872
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_style2.SSelectorMultiple, (0, _extends2.default)({
|
|
873
|
-
focused: visible,
|
|
874
|
-
empty: empty
|
|
875
|
-
}, _popupProps, {
|
|
876
|
-
onClick: handleSelectorClick,
|
|
877
|
-
block: block,
|
|
878
|
-
size: size,
|
|
879
|
-
disabled: disabled
|
|
880
|
-
}), /*#__PURE__*/_react.default.createElement(_style.InputPart, {
|
|
881
|
-
stretch: true,
|
|
882
|
-
className: _style2.measureWrapCls
|
|
883
|
-
}, placeholder && empty && !searchValue && /*#__PURE__*/_react.default.createElement("div", {
|
|
884
|
-
className: _style2.placeholderCls
|
|
885
|
-
}, placeholder), !searchValue && !empty && /*#__PURE__*/_react.default.createElement("div", {
|
|
886
|
-
className: (0, _classnames.default)(_style2.placeholderCls, _style2.contentCls)
|
|
887
|
-
}, locale.selected, items.length, locale.items), search ? /*#__PURE__*/_react.default.createElement("input", {
|
|
888
|
-
value: searchValue,
|
|
889
|
-
ref: inputRef,
|
|
890
|
-
onChange: handleInput,
|
|
891
|
-
disabled: disabled
|
|
892
|
-
}) : null), /*#__PURE__*/_react.default.createElement(_style.Clear, {
|
|
893
|
-
clearable: clearable && !empty,
|
|
894
|
-
onClick: handleClear
|
|
895
|
-
}), /*#__PURE__*/_react.default.createElement(_style.InputPart, null, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
|
|
896
|
-
type: visible ? 'arrow-up' : 'arrow-down'
|
|
897
|
-
}))), items.length ? /*#__PURE__*/_react.default.createElement(_Tag.default.Group, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
898
|
-
className: _style2.listCls
|
|
899
|
-
}, items.map(renderItem))) : null);
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
var MultipleSelector = /*#__PURE__*/_react.default.memo(function MultipleSelector(props) {
|
|
903
|
-
var _this16 = this;
|
|
904
|
-
|
|
905
|
-
var size = props.size,
|
|
906
|
-
disabled = props.disabled,
|
|
907
|
-
visible = props.visible,
|
|
908
|
-
setVisible = props.setVisible,
|
|
909
|
-
dataSource = props.dataSource,
|
|
910
|
-
value = props.value,
|
|
911
|
-
onChange = props.onChange,
|
|
912
|
-
placeholder = props.placeholder,
|
|
913
|
-
search = props.search,
|
|
914
|
-
_props$searchValue2 = props.searchValue,
|
|
915
|
-
searchValue = _props$searchValue2 === void 0 ? '' : _props$searchValue2,
|
|
916
|
-
setSearchValue = props.setSearchValue,
|
|
917
|
-
wrapRef = props.wrapRef,
|
|
918
|
-
clearable = props.clearable,
|
|
919
|
-
block = props.block,
|
|
920
|
-
_popupProps = props._popupProps;
|
|
921
|
-
|
|
922
|
-
var _dataSource3 = (0, _slicedToArray2.default)(dataSource, 5),
|
|
923
|
-
_dataSource3$ = _dataSource3[4],
|
|
924
|
-
childrenMap = _dataSource3$ === void 0 ? new Map() : _dataSource3$;
|
|
925
|
-
|
|
926
|
-
var inputRef = (0, _react.useRef)(null);
|
|
927
|
-
var items = (0, _react.useMemo)(function () {
|
|
928
|
-
var _this17 = this;
|
|
929
|
-
|
|
930
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
931
|
-
return (value || []).map(function (v) {
|
|
932
|
-
(0, _newArrowCheck2.default)(this, _this17);
|
|
933
|
-
return {
|
|
934
|
-
key: v,
|
|
935
|
-
children: childrenMap.has(v) ? childrenMap.get(v) : v
|
|
936
|
-
};
|
|
937
|
-
}.bind(this));
|
|
938
|
-
}.bind(this), [childrenMap, value]);
|
|
939
|
-
var handleClose = (0, _react.useCallback)(function (key) {
|
|
940
|
-
var _this18 = this;
|
|
941
|
-
|
|
942
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
943
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value.filter(function (v) {
|
|
944
|
-
(0, _newArrowCheck2.default)(this, _this18);
|
|
945
|
-
return v !== key;
|
|
946
|
-
}.bind(this)));
|
|
947
|
-
}.bind(this), [onChange, value]);
|
|
948
|
-
var popoverConfigProps = (0, _usePopoverConfig.default)();
|
|
949
|
-
var renderItem = (0, _react.useCallback)(function (item) {
|
|
950
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
951
|
-
return /*#__PURE__*/_react.default.createElement(TagItem, {
|
|
952
|
-
key: item.key,
|
|
953
|
-
disabled: disabled,
|
|
954
|
-
onClose: handleClose,
|
|
955
|
-
item: item
|
|
956
|
-
});
|
|
957
|
-
}.bind(this), [disabled, handleClose]);
|
|
958
|
-
var getRestPopupContainer = (0, _react.useCallback)(function () {
|
|
959
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
960
|
-
return wrapRef === null || wrapRef === void 0 ? void 0 : wrapRef.current;
|
|
961
|
-
}.bind(this), [wrapRef]);
|
|
962
|
-
var renderRest = (0, _react.useCallback)(function (items) {
|
|
963
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
964
|
-
if (!items.length) return null;
|
|
965
|
-
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, (0, _extends2.default)({
|
|
966
|
-
key: "rest",
|
|
967
|
-
popup: /*#__PURE__*/_react.default.createElement(RestList, {
|
|
968
|
-
onClose: handleClose,
|
|
969
|
-
disabled: disabled,
|
|
970
|
-
items: items
|
|
971
|
-
}),
|
|
972
|
-
arrow: false,
|
|
973
|
-
getPopupContainer: getRestPopupContainer,
|
|
974
|
-
customStyle: {
|
|
975
|
-
popupWrapperPadding: '0'
|
|
976
|
-
},
|
|
977
|
-
align: restAlign
|
|
978
|
-
}, popoverConfigProps), /*#__PURE__*/_react.default.createElement(_Tag.default, {
|
|
979
|
-
disabled: disabled
|
|
980
|
-
}, "+", items.length));
|
|
981
|
-
}.bind(this), [disabled, getRestPopupContainer, handleClose, popoverConfigProps]);
|
|
982
|
-
var handleInput = (0, _react.useCallback)(function (e) {
|
|
983
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
984
|
-
setSearchValue(e.target.value);
|
|
985
|
-
}.bind(this), [setSearchValue]);
|
|
986
|
-
(0, _react.useEffect)(function () {
|
|
987
|
-
var _inputRef$current3;
|
|
988
|
-
|
|
989
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
990
|
-
if (visible) (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.focus();
|
|
991
|
-
}.bind(this), [visible]);
|
|
992
|
-
var handleClear = (0, _react.useCallback)(function (e) {
|
|
993
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
994
|
-
e.stopPropagation();
|
|
995
|
-
e.preventDefault();
|
|
996
|
-
|
|
997
|
-
if (!disabled) {
|
|
998
|
-
onChange === null || onChange === void 0 ? void 0 : onChange([]); // inputRef.current?.focus();
|
|
999
|
-
|
|
1000
|
-
setVisible(false);
|
|
1001
|
-
}
|
|
1002
|
-
}.bind(this), [disabled, onChange, setVisible]);
|
|
1003
|
-
var empty = (0, _react.useMemo)(function () {
|
|
1004
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
1005
|
-
return !(value !== null && value !== void 0 && value.length);
|
|
1006
|
-
}.bind(this), [value]);
|
|
1007
|
-
var handleSelectorClick = (0, _react.useCallback)(function (e) {
|
|
1008
|
-
var _inputRef$current4, _popupProps$onClick2;
|
|
1009
|
-
|
|
1010
|
-
(0, _newArrowCheck2.default)(this, _this16);
|
|
1011
|
-
(_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
|
|
1012
|
-
(_popupProps$onClick2 = _popupProps.onClick) === null || _popupProps$onClick2 === void 0 ? void 0 : _popupProps$onClick2.call(_popupProps, e);
|
|
1013
|
-
}.bind(this), [_popupProps]);
|
|
1014
|
-
|
|
1015
|
-
var _useState = (0, _react.useState)(0),
|
|
1016
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
1017
|
-
count = _useState2[0],
|
|
1018
|
-
setCount = _useState2[1];
|
|
1019
|
-
|
|
1020
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_style2.SSelectorMultiple, (0, _extends2.default)({
|
|
1021
|
-
focused: visible,
|
|
1022
|
-
empty: empty
|
|
1023
|
-
}, _popupProps, {
|
|
1024
|
-
onClick: handleSelectorClick,
|
|
1025
|
-
block: block,
|
|
1026
|
-
size: size,
|
|
1027
|
-
disabled: disabled
|
|
1028
|
-
}), /*#__PURE__*/_react.default.createElement(_style.InputPart, {
|
|
1029
|
-
stretch: true,
|
|
1030
|
-
className: _style2.measureWrapCls
|
|
1031
|
-
}, placeholder && empty && !searchValue && /*#__PURE__*/_react.default.createElement("div", {
|
|
1032
|
-
className: _style2.placeholderCls
|
|
1033
|
-
}, placeholder), items.length ? /*#__PURE__*/_react.default.createElement(_Overflow.Static, (0, _extends2.default)({
|
|
1034
|
-
items: items,
|
|
1035
|
-
renderItem: renderItem,
|
|
1036
|
-
renderRest: renderRest,
|
|
1037
|
-
static: true,
|
|
1038
|
-
count: count
|
|
1039
|
-
}, _popupProps)) : null, search ? /*#__PURE__*/_react.default.createElement("input", {
|
|
1040
|
-
value: searchValue,
|
|
1041
|
-
ref: inputRef,
|
|
1042
|
-
onChange: handleInput,
|
|
1043
|
-
disabled: disabled
|
|
1044
|
-
}) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
1045
|
-
className: _style2.measureCls
|
|
1046
|
-
}, items.length ? /*#__PURE__*/_react.default.createElement(_Overflow.default, {
|
|
1047
|
-
items: items,
|
|
1048
|
-
renderItem: renderItem,
|
|
1049
|
-
renderRest: renderRest,
|
|
1050
|
-
onMeasure: setCount,
|
|
1051
|
-
changeContent: searchValue
|
|
1052
|
-
}) : null, search ? /*#__PURE__*/_react.default.createElement("span", {
|
|
1053
|
-
className: _style2.measureContentCls
|
|
1054
|
-
}, searchValue) : null)), /*#__PURE__*/_react.default.createElement(_style.Clear, {
|
|
1055
|
-
clearable: clearable && !empty,
|
|
1056
|
-
onClick: handleClear
|
|
1057
|
-
}), /*#__PURE__*/_react.default.createElement(_style.InputPart, null, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
|
|
1058
|
-
type: visible ? 'arrow-up' : 'arrow-down'
|
|
1059
|
-
}))));
|
|
1060
|
-
}); // 单选下的选择器
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
var SingleSelector = /*#__PURE__*/_react.default.memo(function SingleSelector(_ref18) {
|
|
1064
|
-
var _this19 = this;
|
|
1065
|
-
|
|
1066
|
-
var size = _ref18.size,
|
|
1067
|
-
disabled = _ref18.disabled,
|
|
1068
|
-
placeholder = _ref18.placeholder,
|
|
1069
|
-
renderContent = _ref18.renderContent,
|
|
1070
|
-
renderPopup = _ref18.renderPopup,
|
|
1071
|
-
value = _ref18.value,
|
|
1072
|
-
onChange = _ref18.onChange,
|
|
1073
|
-
visible = _ref18.visible,
|
|
1074
|
-
setVisible = _ref18.setVisible,
|
|
1075
|
-
dataSource = _ref18.dataSource,
|
|
1076
|
-
search = _ref18.search,
|
|
1077
|
-
_ref18$searchValue = _ref18.searchValue,
|
|
1078
|
-
searchValue = _ref18$searchValue === void 0 ? '' : _ref18$searchValue,
|
|
1079
|
-
setSearchValue = _ref18.setSearchValue,
|
|
1080
|
-
clearable = _ref18.clearable,
|
|
1081
|
-
_popupProps = _ref18._popupProps;
|
|
1082
|
-
var inputRef = (0, _react.useRef)(null);
|
|
1083
|
-
var getContent = (0, _react.useCallback)(function () {
|
|
1084
|
-
var _this20 = this;
|
|
1085
|
-
|
|
1086
|
-
(0, _newArrowCheck2.default)(this, _this19);
|
|
1087
|
-
|
|
1088
|
-
var _dataSource4 = (0, _slicedToArray2.default)(dataSource, 5),
|
|
1089
|
-
_dataSource4$ = _dataSource4[4],
|
|
1090
|
-
childrenMap = _dataSource4$ === void 0 ? new Map() : _dataSource4$;
|
|
1091
|
-
|
|
1092
|
-
var getValueChild = function getValueChild(v) {
|
|
1093
|
-
(0, _newArrowCheck2.default)(this, _this20);
|
|
1094
|
-
return childrenMap.has(v) ? childrenMap.get(v) : v;
|
|
1095
|
-
}.bind(this);
|
|
1096
|
-
|
|
1097
|
-
var valueChild = getValueChild(value);
|
|
1098
|
-
|
|
1099
|
-
if (renderContent) {
|
|
1100
|
-
return renderContent(value, valueChild);
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
return value === undefined ? undefined : valueChild;
|
|
1104
|
-
}.bind(this), [dataSource, renderContent, value]);
|
|
1105
|
-
var content = (0, _react.useMemo)(getContent, [getContent]); // 自定义渲染弹层时,开发者可能不传入 options 和 children,导致 content memo deps 不触发变更,故强制更新
|
|
1106
|
-
|
|
1107
|
-
if (renderPopup) content = getContent();
|
|
1108
|
-
var handleInput = (0, _react.useCallback)(function (e) {
|
|
1109
|
-
(0, _newArrowCheck2.default)(this, _this19);
|
|
1110
|
-
setSearchValue(e.target.value);
|
|
1111
|
-
}.bind(this), [setSearchValue]);
|
|
1112
|
-
var empty = value === undefined;
|
|
1113
|
-
|
|
1114
|
-
var sharedProps = _objectSpread({
|
|
1115
|
-
className: _style2.selectInputCls,
|
|
1116
|
-
size: size,
|
|
1117
|
-
disabled: disabled,
|
|
1118
|
-
block: true,
|
|
1119
|
-
cursor: search ? 'text' : 'pointer',
|
|
1120
|
-
focused: visible,
|
|
1121
|
-
empty: empty,
|
|
1122
|
-
search: search
|
|
1123
|
-
}, _popupProps);
|
|
1124
|
-
|
|
1125
|
-
(0, _react.useEffect)(function () {
|
|
1126
|
-
var _inputRef$current5;
|
|
1127
|
-
|
|
1128
|
-
(0, _newArrowCheck2.default)(this, _this19);
|
|
1129
|
-
if (visible) (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.focus();
|
|
1130
|
-
}.bind(this), [visible]);
|
|
1131
|
-
var handleClear = (0, _react.useCallback)(function (e) {
|
|
1132
|
-
(0, _newArrowCheck2.default)(this, _this19);
|
|
1133
|
-
e.preventDefault();
|
|
1134
|
-
e.stopPropagation();
|
|
1135
|
-
|
|
1136
|
-
if (!disabled) {
|
|
1137
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(undefined); // inputRef.current?.focus();
|
|
1138
|
-
|
|
1139
|
-
setVisible(false);
|
|
1140
|
-
}
|
|
1141
|
-
}.bind(this), [disabled, onChange, setVisible]);
|
|
1142
|
-
return /*#__PURE__*/_react.default.createElement(_style2.SSelectorSingle, sharedProps, /*#__PURE__*/_react.default.createElement(_style.InputPart, {
|
|
1143
|
-
stretch: true,
|
|
1144
|
-
className: _style2.inputWrapCls
|
|
1145
|
-
}, content ? /*#__PURE__*/_react.default.createElement("span", {
|
|
1146
|
-
className: (0, _classnames.default)(_style2.placeholderCls, _style2.contentCls),
|
|
1147
|
-
style: {
|
|
1148
|
-
visibility: searchValue ? 'hidden' : 'visible'
|
|
1149
|
-
}
|
|
1150
|
-
}, content) : /*#__PURE__*/_react.default.createElement("span", {
|
|
1151
|
-
className: _style2.placeholderCls,
|
|
1152
|
-
style: {
|
|
1153
|
-
visibility: searchValue ? 'hidden' : 'visible'
|
|
1154
|
-
}
|
|
1155
|
-
}, placeholder), search && /*#__PURE__*/_react.default.createElement("input", {
|
|
1156
|
-
className: _style2.inputCls,
|
|
1157
|
-
value: searchValue,
|
|
1158
|
-
onChange: handleInput,
|
|
1159
|
-
disabled: disabled,
|
|
1160
|
-
ref: inputRef
|
|
1161
|
-
})), /*#__PURE__*/_react.default.createElement(_style.Clear, {
|
|
1162
|
-
clearable: clearable && !empty,
|
|
1163
|
-
onClick: handleClear
|
|
1164
|
-
}), /*#__PURE__*/_react.default.createElement(_style.InputPart, null, /*#__PURE__*/_react.default.createElement(_SvgIcon.default, {
|
|
1165
|
-
type: visible ? 'arrow-up' : 'arrow-down'
|
|
1166
|
-
})));
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
|
-
var Select = function Select(_ref19) {
|
|
1170
|
-
var _search,
|
|
1171
|
-
_search2,
|
|
1172
|
-
_search3,
|
|
1173
|
-
_this21 = this;
|
|
1174
|
-
|
|
1175
|
-
(0, _newArrowCheck2.default)(this, _this);
|
|
1176
|
-
var _ref19$size = _ref19.size,
|
|
1177
|
-
size = _ref19$size === void 0 ? 'md' : _ref19$size,
|
|
1178
|
-
_value = _ref19.value,
|
|
1179
|
-
defaultValue = _ref19.defaultValue,
|
|
1180
|
-
_onChange = _ref19.onChange,
|
|
1181
|
-
_ref19$onVisibleChang = _ref19.onVisibleChange,
|
|
1182
|
-
onVisibleChange = _ref19$onVisibleChang === void 0 ? _noop.default : _ref19$onVisibleChang,
|
|
1183
|
-
disabled = _ref19.disabled,
|
|
1184
|
-
search = _ref19.search,
|
|
1185
|
-
multiple = _ref19.multiple,
|
|
1186
|
-
renderContent = _ref19.renderContent,
|
|
1187
|
-
renderSelector = _ref19.renderSelector,
|
|
1188
|
-
placeholder = _ref19.placeholder,
|
|
1189
|
-
_locale = _ref19.locale,
|
|
1190
|
-
options = _ref19.options,
|
|
1191
|
-
children = _ref19.children,
|
|
1192
|
-
emptyContent = _ref19.emptyContent,
|
|
1193
|
-
showSelectAll = _ref19.showSelectAll,
|
|
1194
|
-
extra = _ref19.extra,
|
|
1195
|
-
clearable = _ref19.clearable,
|
|
1196
|
-
customStyle = _ref19.customStyle,
|
|
1197
|
-
popover = _ref19.popover,
|
|
1198
|
-
popoverProps = _ref19.popoverProps,
|
|
1199
|
-
renderPopup = _ref19.renderPopup,
|
|
1200
|
-
virtualList = _ref19.virtualList,
|
|
1201
|
-
block = _ref19.block,
|
|
1202
|
-
styleType = _ref19.styleType,
|
|
1203
|
-
htmlProps = (0, _objectWithoutProperties2.default)(_ref19, _excluded6);
|
|
1204
|
-
if (multiple) clearable = true;
|
|
1205
|
-
|
|
1206
|
-
var _useUncontrolled = (0, _useUncontrolled5.default)(_value, defaultValue, _onChange),
|
|
1207
|
-
_useUncontrolled2 = (0, _slicedToArray2.default)(_useUncontrolled, 2),
|
|
1208
|
-
value = _useUncontrolled2[0],
|
|
1209
|
-
onChange = _useUncontrolled2[1];
|
|
1210
|
-
|
|
1211
|
-
var _useState3 = (0, _react.useState)(false),
|
|
1212
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
1213
|
-
visible = _useState4[0],
|
|
1214
|
-
setVisible = _useState4[1];
|
|
1215
|
-
|
|
1216
|
-
var locale = (0, _useLocale.default)(_zh_CN.default, 'Select', _locale);
|
|
1217
|
-
var wrapRef = (0, _react.useRef)(null);
|
|
1218
|
-
if (search === true) search = {};
|
|
1219
|
-
|
|
1220
|
-
var _useUncontrolled3 = (0, _useUncontrolled5.default)((_search = search) === null || _search === void 0 ? void 0 : _search.searchValue, ((_search2 = search) === null || _search2 === void 0 ? void 0 : _search2.defaultSearchValue) || '', (_search3 = search) === null || _search3 === void 0 ? void 0 : _search3.onSearchValueChange),
|
|
1221
|
-
_useUncontrolled4 = (0, _slicedToArray2.default)(_useUncontrolled3, 2),
|
|
1222
|
-
searchValue = _useUncontrolled4[0],
|
|
1223
|
-
setSearchValue = _useUncontrolled4[1];
|
|
1224
|
-
|
|
1225
|
-
(0, _useInitial.default)(function () {
|
|
1226
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1227
|
-
if (popover) deprecatedLogForPopover();
|
|
1228
|
-
if (virtualList && !options) warnLogForVirtualList();
|
|
1229
|
-
}.bind(this));
|
|
1230
|
-
var handleSearch = (0, _react.useCallback)(function (value, props) {
|
|
1231
|
-
var _this22 = this;
|
|
1232
|
-
|
|
1233
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1234
|
-
|
|
1235
|
-
if (!search || !searchValue) {
|
|
1236
|
-
return true;
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
if ((0, _typeof2.default)(search) === 'object' && search.handleSearch) {
|
|
1240
|
-
var _beforeProps$label;
|
|
1241
|
-
|
|
1242
|
-
// assign props for forward compatible
|
|
1243
|
-
var beforeProps = _objectSpread({}, props);
|
|
1244
|
-
|
|
1245
|
-
if (options) beforeProps.children = (_beforeProps$label = beforeProps.label) !== null && _beforeProps$label !== void 0 ? _beforeProps$label : beforeProps.value;
|
|
1246
|
-
|
|
1247
|
-
var itemInfo = _objectSpread({}, props);
|
|
1248
|
-
|
|
1249
|
-
if (!('props' in itemInfo)) {
|
|
1250
|
-
Object.defineProperty(itemInfo, 'props', {
|
|
1251
|
-
get: function get() {
|
|
1252
|
-
(0, _newArrowCheck2.default)(this, _this22);
|
|
1253
|
-
warnLogForSearchProps();
|
|
1254
|
-
return beforeProps;
|
|
1255
|
-
}.bind(this)
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
return search.handleSearch(searchValue, value, itemInfo);
|
|
1260
|
-
} else {
|
|
1261
|
-
var _props$label;
|
|
1262
|
-
|
|
1263
|
-
// use label for options case
|
|
1264
|
-
var _children = options ? (_props$label = props.label) !== null && _props$label !== void 0 ? _props$label : props.value : props.children;
|
|
1265
|
-
|
|
1266
|
-
if (_children && typeof _children === 'string') {
|
|
1267
|
-
var i = _children.indexOf(searchValue);
|
|
1268
|
-
|
|
1269
|
-
if (i >= 0) {
|
|
1270
|
-
var l = searchValue.length;
|
|
1271
|
-
return [_children.substring(0, i), _children.substring(i, i + l), _children.substring(i + l)];
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
return (value + '').indexOf(searchValue) >= 0;
|
|
1276
|
-
}
|
|
1277
|
-
}.bind(this), [options, search, searchValue]);
|
|
1278
|
-
var childrenDataSource = (0, _react.useMemo)(function () {
|
|
1279
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1280
|
-
return options ? [] : groupChildrenAsDataSource(children, disabled, groupOptions, searchValue, handleSearch);
|
|
1281
|
-
}.bind(this), [children, disabled, handleSearch, options, searchValue]);
|
|
1282
|
-
var optionsDataSource = (0, _react.useMemo)(function () {
|
|
1283
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1284
|
-
return options ? groupOptionsAsDataSource(options, disabled, groupOptions, searchValue, handleSearch) : [];
|
|
1285
|
-
}.bind(this), [disabled, handleSearch, options, searchValue]);
|
|
1286
|
-
var dataSource = (0, _react.useMemo)(function () {
|
|
1287
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1288
|
-
|
|
1289
|
-
if (options) {
|
|
1290
|
-
return optionsDataSource;
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
return childrenDataSource;
|
|
1294
|
-
}.bind(this), [options, childrenDataSource, optionsDataSource]);
|
|
1295
|
-
virtualList = (0, _react.useMemo)(function () {
|
|
1296
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1297
|
-
return options ? virtualList : false;
|
|
1298
|
-
}.bind(this), [options, virtualList]);
|
|
1299
|
-
var handleVisibleChange = (0, _react.useCallback)(function (open) {
|
|
1300
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1301
|
-
if (disabled) return;
|
|
1302
|
-
setVisible(open);
|
|
1303
|
-
onVisibleChange(open);
|
|
1304
|
-
if (!open) setSearchValue('');
|
|
1305
|
-
}.bind(this), [disabled, onVisibleChange, setSearchValue]);
|
|
1306
|
-
var hidePopup = (0, _react.useCallback)(function () {
|
|
1307
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1308
|
-
return handleVisibleChange(false);
|
|
1309
|
-
}.bind(this), [handleVisibleChange]);
|
|
1310
|
-
var hasSubGroup = (0, _react.useMemo)(function () {
|
|
1311
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1312
|
-
var hasSubGroup = dataSource[3].size > 0;
|
|
1313
|
-
warnLogForSubGroup();
|
|
1314
|
-
return hasSubGroup;
|
|
1315
|
-
}.bind(this), [dataSource]); // 多层数据/搜索且自定义 selector/自定义渲染内容时,无法兼容,回滚到老版本
|
|
1316
|
-
|
|
1317
|
-
var _useState5 = (0, _react.useState)(function () {
|
|
1318
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1319
|
-
return hasSubGroup || !!(search && (renderContent || renderSelector));
|
|
1320
|
-
}.bind(this)),
|
|
1321
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 1),
|
|
1322
|
-
v1 = _useState6[0];
|
|
1323
|
-
|
|
1324
|
-
var handleOnChange = (0, _react.useCallback)(function (v) {
|
|
1325
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1326
|
-
onChange(v);
|
|
1327
|
-
setSearchValue('');
|
|
1328
|
-
}.bind(this), [onChange, setSearchValue]);
|
|
1329
|
-
|
|
1330
|
-
var popup = /*#__PURE__*/_react.default.createElement(Popup, {
|
|
1331
|
-
v1: v1,
|
|
1332
|
-
extra: extra,
|
|
1333
|
-
customStyle: customStyle,
|
|
1334
|
-
search: search,
|
|
1335
|
-
multiple: multiple,
|
|
1336
|
-
emptyContent: emptyContent,
|
|
1337
|
-
showSelectAll: showSelectAll,
|
|
1338
|
-
value: value,
|
|
1339
|
-
renderPopup: renderPopup,
|
|
1340
|
-
handleVisibleChange: handleVisibleChange,
|
|
1341
|
-
options: options,
|
|
1342
|
-
onChange: handleOnChange,
|
|
1343
|
-
locale: locale,
|
|
1344
|
-
hidePopup: hidePopup,
|
|
1345
|
-
dataSource: dataSource,
|
|
1346
|
-
searchValue: searchValue,
|
|
1347
|
-
setSearchValue: setSearchValue,
|
|
1348
|
-
virtualList: virtualList
|
|
1349
|
-
}, children);
|
|
1350
|
-
|
|
1351
|
-
var selector = /*#__PURE__*/_react.default.createElement(Selector, {
|
|
1352
|
-
v1: v1,
|
|
1353
|
-
size: size,
|
|
1354
|
-
disabled: disabled,
|
|
1355
|
-
multiple: multiple,
|
|
1356
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locale.placeholder,
|
|
1357
|
-
renderContent: renderContent,
|
|
1358
|
-
renderSelector: renderSelector,
|
|
1359
|
-
renderPopup: renderPopup,
|
|
1360
|
-
value: value,
|
|
1361
|
-
onChange: onChange,
|
|
1362
|
-
visible: visible,
|
|
1363
|
-
setVisible: setVisible,
|
|
1364
|
-
locale: locale,
|
|
1365
|
-
dataSource: dataSource,
|
|
1366
|
-
clearable: clearable,
|
|
1367
|
-
search: search,
|
|
1368
|
-
searchValue: searchValue,
|
|
1369
|
-
setSearchValue: setSearchValue,
|
|
1370
|
-
styleType: styleType,
|
|
1371
|
-
wrapRef: wrapRef,
|
|
1372
|
-
block: block
|
|
1373
|
-
});
|
|
1374
|
-
|
|
1375
|
-
var popoverTriggerAttrs = (0, _react.useMemo)(function () {
|
|
1376
|
-
(0, _newArrowCheck2.default)(this, _this21);
|
|
1377
|
-
return v1 ? {
|
|
1378
|
-
trigger: ['click']
|
|
1379
|
-
} : {
|
|
1380
|
-
trigger: [],
|
|
1381
|
-
showAction: ['click', 'contextMenu', 'focus']
|
|
1382
|
-
};
|
|
1383
|
-
}.bind(this), [v1]);
|
|
1384
|
-
var popoverConfigProps = (0, _usePopoverConfig.default)();
|
|
1385
|
-
return /*#__PURE__*/_react.default.createElement(_SelectContext.default.Provider, {
|
|
1386
|
-
value: {
|
|
1387
|
-
hidePopup: hidePopup,
|
|
1388
|
-
handleSearch: handleSearch,
|
|
1389
|
-
searchValue: searchValue
|
|
1390
|
-
}
|
|
1391
|
-
}, /*#__PURE__*/_react.default.createElement(_style2.SelectWrap, (0, _extends2.default)({
|
|
1392
|
-
ref: wrapRef,
|
|
1393
|
-
disabled: disabled,
|
|
1394
|
-
multiple: multiple,
|
|
1395
|
-
block: block
|
|
1396
|
-
}, htmlProps), /*#__PURE__*/_react.default.createElement(_Popover.default, (0, _extends2.default)({
|
|
1397
|
-
visible: visible,
|
|
1398
|
-
onVisibleChange: handleVisibleChange,
|
|
1399
|
-
placement: "bottomLeft",
|
|
1400
|
-
stretch: block ? blockPopoverStretch : popoverStretch
|
|
1401
|
-
}, popoverTriggerAttrs, popoverConfigProps, popover, popoverProps, {
|
|
1402
|
-
popup: popup,
|
|
1403
|
-
forceRender: false
|
|
1404
|
-
}), selector)));
|
|
1405
|
-
}.bind(void 0);
|
|
1406
|
-
|
|
1407
|
-
Select.propTypes = {
|
|
1408
|
-
placeholder: _propTypes.default.node,
|
|
1409
|
-
onChange: _propTypes.default.func,
|
|
1410
|
-
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
1411
|
-
label: _propTypes.default.node
|
|
1412
|
-
})),
|
|
1413
|
-
extra: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
1414
|
-
content: _propTypes.default.node.isRequired
|
|
1415
|
-
}), _propTypes.default.node, _propTypes.default.func]),
|
|
1416
|
-
multiple: _propTypes.default.bool,
|
|
1417
|
-
showSelectAll: _propTypes.default.bool,
|
|
1418
|
-
disabled: _propTypes.default.bool,
|
|
1419
|
-
styleType: _propTypes.default.oneOf(['list']),
|
|
1420
|
-
renderContent: _propTypes.default.func,
|
|
1421
|
-
renderSelector: _propTypes.default.func,
|
|
1422
|
-
renderPopup: _propTypes.default.func,
|
|
1423
|
-
search: _propTypes.default.oneOfType([_propTypes.default.oneOf([true]), _propTypes.default.shape({
|
|
1424
|
-
handleSearch: _propTypes.default.func,
|
|
1425
|
-
searchValue: _propTypes.default.string,
|
|
1426
|
-
defaultSearchValue: _propTypes.default.string,
|
|
1427
|
-
onSearchValueChange: _propTypes.default.func
|
|
1428
|
-
})]),
|
|
1429
|
-
block: _propTypes.default.bool,
|
|
1430
|
-
clearable: _propTypes.default.bool,
|
|
1431
|
-
popover: _propTypes.default.any,
|
|
1432
|
-
popoverProps: _propTypes.default.any,
|
|
1433
|
-
onVisibleChange: _propTypes.default.func,
|
|
1434
|
-
locale: _propTypes.default.any,
|
|
1435
|
-
customStyle: _propTypes.default.shape({
|
|
1436
|
-
optionListMaxHeight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
1437
|
-
popupMaxWidth: _propTypes.default.string,
|
|
1438
|
-
popupWidth: _propTypes.default.string
|
|
1439
|
-
}),
|
|
1440
|
-
emptyContent: _propTypes.default.node,
|
|
1441
|
-
virtualList: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.shape({
|
|
1442
|
-
simple: _propTypes.default.oneOf([true]),
|
|
1443
|
-
height: _propTypes.default.number
|
|
1444
|
-
})])
|
|
1445
|
-
};
|
|
1446
|
-
|
|
1447
|
-
var _default = /*#__PURE__*/_react.default.memo(Select);
|
|
1448
|
-
|
|
1449
|
-
exports.default = _default;
|