@chaoswise/ui 3.1.6 → 3.1.8
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/lib/Antd5/_util/PurePanel.js +9 -1
- package/lib/Antd5/_util/convertToTooltipProps.js +15 -0
- package/lib/Antd5/_util/extendsObject.js +14 -23
- package/lib/Antd5/_util/hooks/useClosable.js +25 -31
- package/lib/Antd5/_util/hooks/useMergeSemantic/index.js +89 -0
- package/lib/Antd5/_util/hooks/useMergeSemantic/interface.js +1 -0
- package/lib/Antd5/_util/isPrimitive.js +5 -0
- package/lib/Antd5/_util/mediaQueryUtil.js +16 -0
- package/lib/Antd5/_util/responsiveObserver.js +41 -33
- package/lib/Antd5/_util/toList.js +6 -3
- package/lib/Antd5/_util/warning.js +0 -1
- package/lib/Antd5/_util/wave/WaveEffect.js +29 -16
- package/lib/Antd5/_util/wave/index.js +2 -2
- package/lib/Antd5/_util/wave/useWave.js +1 -1
- package/lib/Antd5/affix/index.js +13 -11
- package/lib/Antd5/alert/Alert.js +19 -18
- package/lib/Antd5/anchor/Anchor.js +9 -7
- package/lib/Antd5/anchor/AnchorLink.js +16 -3
- package/lib/Antd5/app/App.js +90 -0
- package/lib/Antd5/app/index.js +3 -92
- package/lib/Antd5/app/useApp.js +6 -0
- package/lib/Antd5/auto-complete/AutoComplete.js +142 -0
- package/lib/Antd5/auto-complete/index.js +8 -106
- package/lib/Antd5/avatar/{avatar.js → Avatar.js} +25 -29
- package/lib/Antd5/avatar/{group.js → AvatarGroup.js} +14 -9
- package/lib/Antd5/avatar/index.js +3 -4
- package/lib/Antd5/breadcrumb/Breadcrumb.js +1 -0
- package/lib/Antd5/breadcrumb/style/index.js +1 -1
- package/lib/Antd5/button/{LoadingIcon.js → DefaultLoadingIcon.js} +12 -9
- package/lib/Antd5/button/button-group.js +11 -11
- package/lib/Antd5/button/button.js +60 -26
- package/lib/Antd5/button/buttonHelpers.js +8 -1
- package/lib/Antd5/button/style/compact.js +9 -10
- package/lib/Antd5/button/style/index.js +127 -41
- package/lib/Antd5/button/style/token.js +19 -8
- package/lib/Antd5/calendar/Header.js +4 -4
- package/lib/Antd5/calendar/generateCalendar.js +17 -12
- package/lib/Antd5/calendar/style/index.js +8 -2
- package/lib/Antd5/card/Card.js +9 -5
- package/lib/Antd5/card/style/index.js +22 -15
- package/lib/Antd5/carousel/index.js +21 -11
- package/lib/Antd5/carousel/style/index.js +39 -12
- package/lib/Antd5/cascader/index.js +54 -18
- package/lib/Antd5/cascader/style/columns.js +4 -2
- package/lib/Antd5/cascader/style/index.js +2 -1
- package/lib/Antd5/collapse/Collapse.js +32 -25
- package/lib/Antd5/collapse/style/index.js +14 -10
- package/lib/Antd5/color-picker/ColorPicker.js +13 -8
- package/lib/Antd5/color-picker/components/ColorAlphaInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorHexInput.js +1 -1
- package/lib/Antd5/color-picker/components/ColorHsbInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorInput.js +7 -7
- package/lib/Antd5/color-picker/components/ColorPresets.js +15 -12
- package/lib/Antd5/color-picker/components/ColorRgbInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorSteppers.js +6 -13
- package/lib/Antd5/color-picker/interface.js +3 -6
- package/lib/Antd5/color-picker/style/color-block.js +2 -1
- package/lib/Antd5/config-provider/MotionWrapper.js +12 -4
- package/lib/Antd5/config-provider/UnstableContext.js +29 -0
- package/lib/Antd5/config-provider/context.js +32 -2
- package/lib/Antd5/config-provider/cssVariables.js +7 -7
- package/lib/Antd5/config-provider/hooks/useSize.js +1 -1
- package/lib/Antd5/config-provider/index.js +12 -3
- package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +33 -12
- package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +32 -13
- package/lib/Antd5/date-picker/hooks/useMergedPickerSemantic.js +47 -0
- package/lib/Antd5/date-picker/index.js +2 -2
- package/lib/Antd5/date-picker/locale/ar_EG.js +1 -8
- package/lib/Antd5/date-picker/locale/example.json +5 -8
- package/lib/Antd5/date-picker/locale/ko_KR.js +11 -1
- package/lib/Antd5/date-picker/locale/pl_PL.js +0 -3
- package/lib/Antd5/date-picker/locale/pt_PT.js +0 -3
- package/lib/Antd5/date-picker/locale/sl_SI.js +1 -3
- package/lib/Antd5/date-picker/style/index.js +9 -6
- package/lib/Antd5/date-picker/style/panel.js +12 -8
- package/lib/Antd5/date-picker/style/token.js +3 -3
- package/lib/Antd5/date-picker/style/variants.js +6 -2
- package/lib/Antd5/descriptions/Cell.js +14 -8
- package/lib/Antd5/descriptions/Item.js +2 -0
- package/lib/Antd5/descriptions/Row.js +10 -6
- package/lib/Antd5/descriptions/hooks/useRow.js +1 -1
- package/lib/Antd5/descriptions/index.js +45 -18
- package/lib/Antd5/descriptions/style/index.js +11 -2
- package/lib/Antd5/divider/index.js +32 -15
- package/lib/Antd5/divider/style/index.js +20 -7
- package/lib/Antd5/drawer/DrawerPanel.js +8 -10
- package/lib/Antd5/drawer/index.js +20 -17
- package/lib/Antd5/dropdown/dropdown-button.js +9 -3
- package/lib/Antd5/dropdown/dropdown.js +33 -35
- package/lib/Antd5/dropdown/style/index.js +1 -1
- package/lib/Antd5/empty/empty.js +2 -2
- package/lib/Antd5/empty/index.js +41 -23
- package/lib/Antd5/empty/simple.js +4 -4
- package/lib/Antd5/flex/style/index.js +2 -0
- package/lib/Antd5/float-button/FloatButton.js +12 -15
- package/lib/Antd5/float-button/FloatButtonContent.js +13 -7
- package/lib/Antd5/float-button/FloatButtonGroup.js +6 -6
- package/lib/Antd5/float-button/style/keyframes.js +4 -4
- package/lib/Antd5/form/ErrorList.js +1 -3
- package/lib/Antd5/form/Form.js +19 -19
- package/lib/Antd5/form/FormItem/index.js +1 -1
- package/lib/Antd5/form/FormItemLabel.js +12 -14
- package/lib/Antd5/form/context.js +3 -4
- package/lib/Antd5/form/hooks/useForm.js +16 -5
- package/lib/Antd5/form/hooks/useFormInstance.js +3 -3
- package/lib/Antd5/form/hooks/useFormItemStatus.js +7 -7
- package/lib/Antd5/form/hooks/useFormWarning.js +2 -2
- package/lib/Antd5/form/hooks/useFrameState.js +3 -4
- package/lib/Antd5/form/hooks/useItemRef.js +3 -2
- package/lib/Antd5/form/hooks/useVariants.js +5 -5
- package/lib/Antd5/form/style/index.js +22 -15
- package/lib/Antd5/grid/hooks/useBreakpoint.js +2 -1
- package/lib/Antd5/grid/hooks/useGutter.js +29 -0
- package/lib/Antd5/grid/row.js +8 -63
- package/lib/Antd5/grid/style/index.js +14 -8
- package/lib/Antd5/image/PreviewGroup.js +9 -2
- package/lib/Antd5/image/index.js +26 -17
- package/lib/Antd5/image/style/index.js +10 -10
- package/lib/Antd5/index.js +3 -1
- package/lib/Antd5/input/Group.js +5 -3
- package/lib/Antd5/input/Input.js +27 -20
- package/lib/Antd5/input/OTP/OTPInput.js +36 -19
- package/lib/Antd5/input/OTP/index.js +40 -19
- package/lib/Antd5/input/Password.js +7 -9
- package/lib/Antd5/input/Search.js +16 -9
- package/lib/Antd5/input/TextArea.js +90 -33
- package/lib/Antd5/input/style/index.js +31 -82
- package/lib/Antd5/input/style/otp.js +22 -6
- package/lib/Antd5/input/style/textarea.js +80 -0
- package/lib/Antd5/input/style/token.js +16 -7
- package/lib/Antd5/input/style/variants.js +67 -12
- package/lib/Antd5/input-number/index.js +1 -1
- package/lib/Antd5/input-number/style/index.js +10 -7
- package/lib/Antd5/input-number/style/token.js +6 -4
- package/lib/Antd5/layout/Sider.js +58 -68
- package/lib/Antd5/layout/layout.js +7 -5
- package/lib/Antd5/layout/style/sider.js +33 -42
- package/lib/Antd5/list/index.js +45 -45
- package/lib/Antd5/locale/ar_EG.js +7 -1
- package/lib/Antd5/locale/az_AZ.js +3 -2
- package/lib/Antd5/locale/bg_BG.js +8 -0
- package/lib/Antd5/locale/bn_BD.js +7 -1
- package/lib/Antd5/locale/by_BY.js +8 -2
- package/lib/Antd5/locale/ca_ES.js +7 -1
- package/lib/Antd5/locale/cs_CZ.js +19 -2
- package/lib/Antd5/locale/da_DK.js +8 -0
- package/lib/Antd5/locale/de_DE.js +4 -2
- package/lib/Antd5/locale/el_GR.js +3 -2
- package/lib/Antd5/locale/en_GB.js +8 -2
- package/lib/Antd5/locale/en_US.js +3 -2
- package/lib/Antd5/locale/es_ES.js +3 -2
- package/lib/Antd5/locale/et_EE.js +8 -2
- package/lib/Antd5/locale/eu_ES.js +3 -2
- package/lib/Antd5/locale/fa_IR.js +17 -7
- package/lib/Antd5/locale/fi_FI.js +8 -0
- package/lib/Antd5/locale/fr_BE.js +4 -1
- package/lib/Antd5/locale/fr_CA.js +9 -1
- package/lib/Antd5/locale/fr_FR.js +4 -1
- package/lib/Antd5/locale/ga_IE.js +7 -1
- package/lib/Antd5/locale/gl_ES.js +7 -1
- package/lib/Antd5/locale/he_IL.js +10 -1
- package/lib/Antd5/locale/hi_IN.js +7 -1
- package/lib/Antd5/locale/hr_HR.js +7 -1
- package/lib/Antd5/locale/hu_HU.js +8 -0
- package/lib/Antd5/locale/hy_AM.js +8 -3
- package/lib/Antd5/locale/id_ID.js +3 -2
- package/lib/Antd5/locale/is_IS.js +8 -0
- package/lib/Antd5/locale/it_IT.js +3 -2
- package/lib/Antd5/locale/ja_JP.js +3 -2
- package/lib/Antd5/locale/ka_GE.js +7 -1
- package/lib/Antd5/locale/kk_KZ.js +7 -1
- package/lib/Antd5/locale/km_KH.js +3 -0
- package/lib/Antd5/locale/kmr_IQ.js +8 -0
- package/lib/Antd5/locale/kn_IN.js +8 -2
- package/lib/Antd5/locale/ko_KR.js +3 -2
- package/lib/Antd5/locale/ku_IQ.js +8 -0
- package/lib/Antd5/locale/lt_LT.js +3 -2
- package/lib/Antd5/locale/lv_LV.js +8 -0
- package/lib/Antd5/locale/mk_MK.js +7 -1
- package/lib/Antd5/locale/ml_IN.js +7 -1
- package/lib/Antd5/locale/mn_MN.js +8 -2
- package/lib/Antd5/locale/ms_MY.js +3 -2
- package/lib/Antd5/locale/my_MM.js +3 -2
- package/lib/Antd5/locale/nb_NO.js +7 -1
- package/lib/Antd5/locale/ne_NP.js +3 -2
- package/lib/Antd5/locale/nl_BE.js +2 -1
- package/lib/Antd5/locale/nl_NL.js +2 -1
- package/lib/Antd5/locale/pl_PL.js +3 -2
- package/lib/Antd5/locale/pt_BR.js +3 -2
- package/lib/Antd5/locale/pt_PT.js +3 -2
- package/lib/Antd5/locale/ro_RO.js +7 -1
- package/lib/Antd5/locale/ru_RU.js +4 -3
- package/lib/Antd5/locale/si_LK.js +8 -2
- package/lib/Antd5/locale/sk_SK.js +8 -2
- package/lib/Antd5/locale/sl_SI.js +8 -0
- package/lib/Antd5/locale/sr_RS.js +7 -1
- package/lib/Antd5/locale/sv_SE.js +3 -2
- package/lib/Antd5/locale/ta_IN.js +8 -2
- package/lib/Antd5/locale/th_TH.js +3 -2
- package/lib/Antd5/locale/tk_TK.js +7 -1
- package/lib/Antd5/locale/tr_TR.js +8 -2
- package/lib/Antd5/locale/uk_UA.js +3 -2
- package/lib/Antd5/locale/ur_PK.js +7 -1
- package/lib/Antd5/locale/uz_UZ.js +5 -4
- package/lib/Antd5/locale/vi_VN.js +3 -2
- package/lib/Antd5/locale/zh_CN.js +3 -2
- package/lib/Antd5/locale/zh_HK.js +11 -3
- package/lib/Antd5/locale/zh_TW.js +11 -3
- package/lib/Antd5/mentions/index.js +1 -1
- package/lib/Antd5/mentions/style/index.js +12 -7
- package/lib/Antd5/menu/MenuItem.js +3 -1
- package/lib/Antd5/menu/OverrideContext.js +2 -2
- package/lib/Antd5/menu/menu.js +1 -7
- package/lib/Antd5/menu/style/index.js +9 -6
- package/lib/Antd5/menu/style/theme.js +4 -3
- package/lib/Antd5/menu/style/vertical.js +1 -1
- package/lib/Antd5/message/style/index.js +4 -3
- package/lib/Antd5/modal/ConfirmDialog.js +2 -19
- package/lib/Antd5/modal/Modal.js +67 -35
- package/lib/Antd5/modal/confirm.js +5 -3
- package/lib/Antd5/modal/style/confirm.js +3 -1
- package/lib/Antd5/modal/style/index.js +21 -1
- package/lib/Antd5/modal/useModal/HookModal.js +2 -1
- package/lib/Antd5/notification/PurePanel.js +13 -6
- package/lib/Antd5/notification/index.js +3 -4
- package/lib/Antd5/notification/style/index.js +4 -3
- package/lib/Antd5/notification/style/stack.js +2 -1
- package/lib/Antd5/notification/useNotification.js +9 -4
- package/lib/Antd5/notification/util.js +9 -0
- package/lib/Antd5/pagination/Pagination.js +87 -20
- package/lib/Antd5/pagination/style/index.js +2 -10
- package/lib/Antd5/pagination/useShowSizeChanger.js +13 -0
- package/lib/Antd5/popconfirm/index.js +21 -6
- package/lib/Antd5/popover/index.js +21 -8
- package/lib/Antd5/progress/Steps.js +6 -2
- package/lib/Antd5/progress/progress.js +2 -2
- package/lib/Antd5/progress/utils.js +3 -3
- package/lib/Antd5/qr-code/style/index.js +2 -2
- package/lib/Antd5/segmented/index.js +16 -8
- package/lib/Antd5/segmented/style/index.js +14 -6
- package/lib/Antd5/select/index.js +45 -16
- package/lib/Antd5/select/style/dropdown.js +10 -9
- package/lib/Antd5/select/style/index.js +14 -10
- package/lib/Antd5/select/style/single.js +6 -3
- package/lib/Antd5/select/style/variants.js +55 -1
- package/lib/Antd5/skeleton/Paragraph.js +5 -8
- package/lib/Antd5/skeleton/Skeleton.js +8 -7
- package/lib/Antd5/slider/SliderTooltip.js +3 -2
- package/lib/Antd5/slider/index.js +43 -17
- package/lib/Antd5/slider/style/index.js +3 -3
- package/lib/Antd5/slider/useRafLock.js +1 -1
- package/lib/Antd5/space/Compact.js +8 -6
- package/lib/Antd5/space/index.js +16 -12
- package/lib/Antd5/spin/index.js +11 -9
- package/lib/Antd5/spin/style/index.js +1 -3
- package/lib/Antd5/spin/usePercent.js +1 -1
- package/lib/Antd5/splitter/SplitBar.js +56 -7
- package/lib/Antd5/splitter/Splitter.js +27 -17
- package/lib/Antd5/splitter/hooks/useResizable.js +3 -3
- package/lib/Antd5/splitter/hooks/useResize.js +17 -6
- package/lib/Antd5/splitter/style/index.js +32 -6
- package/lib/Antd5/statistic/Countdown.js +8 -61
- package/lib/Antd5/statistic/Statistic.js +17 -9
- package/lib/Antd5/statistic/Timer.js +91 -0
- package/lib/Antd5/statistic/index.js +2 -0
- package/lib/Antd5/statistic/utils.js +2 -2
- package/lib/Antd5/steps/index.js +8 -7
- package/lib/Antd5/steps/style/index.js +1 -1
- package/lib/Antd5/style/index.js +9 -4
- package/lib/Antd5/switch/style/index.js +2 -2
- package/lib/Antd5/table/InternalTable.js +6 -5
- package/lib/Antd5/table/hooks/useFilter/FilterDropdown.js +15 -11
- package/lib/Antd5/table/hooks/useFilter/FilterSearch.js +1 -1
- package/lib/Antd5/table/hooks/useFilter/index.js +3 -2
- package/lib/Antd5/table/hooks/useSelection.js +11 -3
- package/lib/Antd5/table/hooks/useSorter.js +4 -3
- package/lib/Antd5/table/style/filter.js +2 -2
- package/lib/Antd5/table/style/index.js +9 -9
- package/lib/Antd5/table/style/sorter.js +2 -1
- package/lib/Antd5/table/style/sticky.js +1 -1
- package/lib/Antd5/tabs/hooks/useLegacyItems.js +11 -4
- package/lib/Antd5/tabs/index.js +9 -2
- package/lib/Antd5/tabs/style/index.js +44 -23
- package/lib/Antd5/tag/style/index.js +3 -3
- package/lib/Antd5/theme/context.js +1 -3
- package/lib/Antd5/theme/getDesignToken.js +2 -2
- package/lib/Antd5/theme/themes/dark/colorAlgorithm.js +3 -3
- package/lib/Antd5/theme/themes/dark/index.js +13 -3
- package/lib/Antd5/theme/themes/default/colorAlgorithm.js +3 -3
- package/lib/Antd5/theme/themes/default/index.js +5 -1
- package/lib/Antd5/theme/themes/default/theme.js +4 -0
- package/lib/Antd5/theme/themes/shared/genColorMapToken.js +3 -3
- package/lib/Antd5/theme/themes/shared/genFontSizes.js +3 -1
- package/lib/Antd5/theme/util/alias.js +2 -2
- package/lib/Antd5/theme/util/genStyleUtils.js +9 -11
- package/lib/Antd5/theme/util/getAlphaColor.js +12 -12
- package/lib/Antd5/theme/util/useResetIconStyle.js +2 -10
- package/lib/Antd5/time-picker/index.js +1 -1
- package/lib/Antd5/timeline/TimelineItemList.js +1 -1
- package/lib/Antd5/tooltip/index.js +46 -31
- package/lib/Antd5/tooltip/style/index.js +13 -4
- package/lib/Antd5/tour/index.js +4 -2
- package/lib/Antd5/tour/panelRender.js +42 -27
- package/lib/Antd5/tour/style/index.js +3 -3
- package/lib/Antd5/transfer/ListItem.js +1 -1
- package/lib/Antd5/transfer/hooks/useData.js +8 -4
- package/lib/Antd5/transfer/hooks/useSelection.js +5 -4
- package/lib/Antd5/transfer/index.js +6 -2
- package/lib/Antd5/transfer/list.js +32 -13
- package/lib/Antd5/transfer/search.js +1 -1
- package/lib/Antd5/transfer/style/index.js +3 -1
- package/lib/Antd5/tree/DirectoryTree.js +2 -2
- package/lib/Antd5/tree/style/index.js +9 -3
- package/lib/Antd5/tree-select/index.js +61 -18
- package/lib/Antd5/tree-select/style/index.js +1 -1
- package/lib/Antd5/typography/Base/Ellipsis.js +3 -3
- package/lib/Antd5/typography/Base/index.js +20 -13
- package/lib/Antd5/typography/Editable.js +1 -1
- package/lib/Antd5/typography/Typography.js +8 -7
- package/lib/Antd5/typography/hooks/useCopyClick.js +24 -25
- package/lib/Antd5/typography/hooks/usePrevious.js +1 -1
- package/lib/Antd5/typography/style/index.js +5 -5
- package/lib/Antd5/typography/style/mixins.js +1 -1
- package/lib/Antd5/upload/Upload.js +22 -24
- package/lib/Antd5/version/index.js +0 -1
- package/lib/Antd5/version/token-meta.json +1 -0
- package/lib/Antd5/version/token.json +1 -0
- package/lib/Antd5/version/version.js +1 -1
- package/lib/Antd5/watermark/context.js +1 -1
- package/lib/Antd5/watermark/index.js +20 -13
- package/lib/Antd5/watermark/useClips.js +18 -16
- package/lib/Antd5/watermark/useRafDebounce.js +1 -1
- package/lib/Antd5/watermark/useSingletonCache.js +19 -0
- package/lib/Antd5/watermark/useWatermark.js +9 -18
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
- package/lib/CWMessage/MessageContent/TabList/index.js +10 -10
- package/lib/CWMessage/MessageContent/index.js +26 -28
- package/lib/CWMessage/index.js +42 -46
- package/lib/CWRangePicker/index.js +15 -15
- package/lib/CWRangePicker/utils/generate/dayjs.js +112 -23
- package/lib/CWRangePicker/utils/generate/moment.js +109 -21
- package/lib/CWSelect/index.js +423 -150
- package/lib/CWTable/CWTable.js +11 -11
- package/lib/Joyride/index.js +3 -3
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
- package/lib/QuickTransfer/index.js +13 -13
- package/lib/SearchBar/index.js +7 -7
- package/lib/SingleSpa/index.js +22 -24
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
- package/lib/TimeRangeSlider/index.js +6 -6
- package/lib/TimeRangeSlider/utils/generate/dayjs.js +109 -20
- package/lib/TimeRangeSlider/utils/generate/moment.js +109 -20
- package/lib/TimeZoneSelect/index.js +21 -22
- package/package.json +35 -34
- package/lib/Antd5/_util/isNumeric.js +0 -4
- package/lib/Antd5/pagination/Select.js +0 -24
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix"];
|
|
2
|
+
var _excluded = ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix", "dropdownRender", "popupRender", "onDropdownVisibleChange", "onOpenChange", "styles", "classNames"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import
|
|
19
|
+
import cls from 'classnames';
|
|
20
20
|
import RcSelect, { OptGroup, Option } from 'rc-select';
|
|
21
21
|
import omit from 'rc-util/lib/omit';
|
|
22
22
|
import { useZIndex } from '../_util/hooks/useZIndex';
|
|
@@ -25,6 +25,7 @@ import genPurePanel from '../_util/PurePanel';
|
|
|
25
25
|
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
|
26
26
|
import { devUseWarning } from '../_util/warning';
|
|
27
27
|
import { ConfigContext } from '../config-provider';
|
|
28
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
28
29
|
import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty';
|
|
29
30
|
import DisabledContext from '../config-provider/DisabledContext';
|
|
30
31
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
@@ -39,7 +40,7 @@ import useIcons from './useIcons';
|
|
|
39
40
|
import useShowArrow from './useShowArrow';
|
|
40
41
|
var SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
41
42
|
var InternalSelect = function InternalSelect(props, ref) {
|
|
42
|
-
var _ref;
|
|
43
|
+
var _ref, _styles$popup, _contextStyles$popup, _classNames$popup, _contextClassNames$po;
|
|
43
44
|
var customizePrefixCls = props.prefixCls,
|
|
44
45
|
bordered = props.bordered,
|
|
45
46
|
className = props.className,
|
|
@@ -67,6 +68,12 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
67
68
|
tagRender = props.tagRender,
|
|
68
69
|
maxCount = props.maxCount,
|
|
69
70
|
prefix = props.prefix,
|
|
71
|
+
dropdownRender = props.dropdownRender,
|
|
72
|
+
popupRender = props.popupRender,
|
|
73
|
+
onDropdownVisibleChange = props.onDropdownVisibleChange,
|
|
74
|
+
onOpenChange = props.onOpenChange,
|
|
75
|
+
styles = props.styles,
|
|
76
|
+
classNames = props.classNames,
|
|
70
77
|
rest = _objectWithoutProperties(props, _excluded);
|
|
71
78
|
var _React$useContext = React.useContext(ConfigContext),
|
|
72
79
|
getContextPopupContainer = _React$useContext.getPopupContainer,
|
|
@@ -75,8 +82,13 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
75
82
|
contextDirection = _React$useContext.direction,
|
|
76
83
|
virtual = _React$useContext.virtual,
|
|
77
84
|
contextPopupMatchSelectWidth = _React$useContext.popupMatchSelectWidth,
|
|
78
|
-
popupOverflow = _React$useContext.popupOverflow
|
|
79
|
-
|
|
85
|
+
popupOverflow = _React$useContext.popupOverflow;
|
|
86
|
+
var _useComponentConfig = useComponentConfig('select'),
|
|
87
|
+
showSearch = _useComponentConfig.showSearch,
|
|
88
|
+
contextStyle = _useComponentConfig.style,
|
|
89
|
+
contextStyles = _useComponentConfig.styles,
|
|
90
|
+
contextClassName = _useComponentConfig.className,
|
|
91
|
+
contextClassNames = _useComponentConfig.classNames;
|
|
80
92
|
var _useToken = useToken(),
|
|
81
93
|
_useToken2 = _slicedToArray(_useToken, 2),
|
|
82
94
|
token = _useToken2[1];
|
|
@@ -110,6 +122,9 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
110
122
|
var isMultiple = mode === 'multiple' || mode === 'tags';
|
|
111
123
|
var showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
|
|
112
124
|
var mergedPopupMatchSelectWidth = (_ref = popupMatchSelectWidth !== null && popupMatchSelectWidth !== void 0 ? popupMatchSelectWidth : dropdownMatchSelectWidth) !== null && _ref !== void 0 ? _ref : contextPopupMatchSelectWidth;
|
|
125
|
+
var mergedPopupStyle = (styles === null || styles === void 0 || (_styles$popup = styles.popup) === null || _styles$popup === void 0 ? void 0 : _styles$popup.root) || ((_contextStyles$popup = contextStyles.popup) === null || _contextStyles$popup === void 0 ? void 0 : _contextStyles$popup.root) || dropdownStyle;
|
|
126
|
+
var mergedPopupRender = popupRender || dropdownRender;
|
|
127
|
+
var mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
|
|
113
128
|
// ===================== Form Status =====================
|
|
114
129
|
var _React$useContext2 = React.useContext(FormItemInputContext),
|
|
115
130
|
contextStatus = _React$useContext2.status,
|
|
@@ -145,7 +160,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
145
160
|
clearIcon: clearIcon
|
|
146
161
|
} : allowClear;
|
|
147
162
|
var selectProps = omit(rest, ['suffixIcon', 'itemIcon']);
|
|
148
|
-
var mergedPopupClassName = classNames(popupClassName || dropdownClassName, _defineProperty({}, "".concat(prefixCls, "-dropdown-").concat(direction), direction === 'rtl'), rootClassName, cssVarCls, rootCls, hashId);
|
|
163
|
+
var mergedPopupClassName = cls((classNames === null || classNames === void 0 || (_classNames$popup = classNames.popup) === null || _classNames$popup === void 0 ? void 0 : _classNames$popup.root) || (contextClassNames === null || contextClassNames === void 0 || (_contextClassNames$po = contextClassNames.popup) === null || _contextClassNames$po === void 0 ? void 0 : _contextClassNames$po.root) || popupClassName || dropdownClassName, _defineProperty({}, "".concat(prefixCls, "-dropdown-").concat(direction), direction === 'rtl'), rootClassName, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, cssVarCls, rootCls, hashId);
|
|
149
164
|
var mergedSize = useSize(function (ctx) {
|
|
150
165
|
var _ref2;
|
|
151
166
|
return (_ref2 = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _ref2 !== void 0 ? _ref2 : ctx;
|
|
@@ -153,7 +168,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
153
168
|
// ===================== Disabled =====================
|
|
154
169
|
var disabled = React.useContext(DisabledContext);
|
|
155
170
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
156
|
-
var mergedClassName =
|
|
171
|
+
var mergedClassName = cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-").concat(variant), enableVariantCls), "".concat(prefixCls, "-in-form-item"), isFormItemInput), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, contextClassNames.root, classNames === null || classNames === void 0 ? void 0 : classNames.root, rootClassName, cssVarCls, rootCls, hashId);
|
|
157
172
|
// ===================== Placement =====================
|
|
158
173
|
var memoPlacement = React.useMemo(function () {
|
|
159
174
|
if (placement !== undefined) {
|
|
@@ -164,23 +179,35 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
164
179
|
// ====================== Warning ======================
|
|
165
180
|
if (process.env.NODE_ENV !== 'production') {
|
|
166
181
|
var warning = devUseWarning('Select');
|
|
167
|
-
|
|
168
|
-
|
|
182
|
+
var deprecatedProps = {
|
|
183
|
+
dropdownMatchSelectWidth: 'popupMatchSelectWidth',
|
|
184
|
+
dropdownStyle: 'styles.popup.root',
|
|
185
|
+
dropdownClassName: 'classNames.popup.root',
|
|
186
|
+
popupClassName: 'classNames.popup.root',
|
|
187
|
+
dropdownRender: 'popupRender',
|
|
188
|
+
onDropdownVisibleChange: 'onOpenChange',
|
|
189
|
+
bordered: 'variant'
|
|
190
|
+
};
|
|
191
|
+
Object.entries(deprecatedProps).forEach(function (_ref3) {
|
|
192
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
193
|
+
oldProp = _ref4[0],
|
|
194
|
+
newProp = _ref4[1];
|
|
195
|
+
warning.deprecated(!(oldProp in props), oldProp, newProp);
|
|
196
|
+
});
|
|
169
197
|
warning(!('showArrow' in props), 'deprecated', '`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.');
|
|
170
|
-
warning.deprecated(!('bordered' in props), 'bordered', 'variant');
|
|
171
198
|
warning(!(typeof maxCount !== 'undefined' && !isMultiple), 'usage', '`maxCount` only works with mode `multiple` or `tags`');
|
|
172
199
|
}
|
|
173
200
|
// ====================== zIndex =========================
|
|
174
|
-
var _useZIndex = useZIndex('SelectLike',
|
|
201
|
+
var _useZIndex = useZIndex('SelectLike', mergedPopupStyle === null || mergedPopupStyle === void 0 ? void 0 : mergedPopupStyle.zIndex),
|
|
175
202
|
_useZIndex2 = _slicedToArray(_useZIndex, 1),
|
|
176
203
|
zIndex = _useZIndex2[0];
|
|
177
204
|
// ====================== Render =======================
|
|
178
205
|
return wrapCSSVar(_jsx(RcSelect, _objectSpread(_objectSpread({
|
|
179
206
|
ref: ref,
|
|
180
207
|
virtual: virtual,
|
|
181
|
-
showSearch:
|
|
208
|
+
showSearch: showSearch
|
|
182
209
|
}, selectProps), {}, {
|
|
183
|
-
style: _objectSpread(_objectSpread({},
|
|
210
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), contextStyle), style),
|
|
184
211
|
dropdownMatchSelectWidth: mergedPopupMatchSelectWidth,
|
|
185
212
|
transitionName: getTransitionName(rootPrefixCls, 'slide-up', transitionName),
|
|
186
213
|
builtinPlacements: mergedBuiltinPlacements(builtinPlacements, popupOverflow),
|
|
@@ -200,11 +227,13 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
200
227
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
201
228
|
dropdownClassName: mergedPopupClassName,
|
|
202
229
|
disabled: mergedDisabled,
|
|
203
|
-
dropdownStyle: _objectSpread(_objectSpread({},
|
|
230
|
+
dropdownStyle: _objectSpread(_objectSpread({}, mergedPopupStyle), {}, {
|
|
204
231
|
zIndex: zIndex
|
|
205
232
|
}),
|
|
206
233
|
maxCount: isMultiple ? maxCount : undefined,
|
|
207
|
-
tagRender: isMultiple ? tagRender : undefined
|
|
234
|
+
tagRender: isMultiple ? tagRender : undefined,
|
|
235
|
+
dropdownRender: mergedPopupRender,
|
|
236
|
+
onDropdownVisibleChange: mergedOnOpenChange
|
|
208
237
|
})));
|
|
209
238
|
};
|
|
210
239
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -213,7 +242,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
213
242
|
var Select = /*#__PURE__*/React.forwardRef(InternalSelect);
|
|
214
243
|
// We don't care debug panel
|
|
215
244
|
/* istanbul ignore next */
|
|
216
|
-
var PurePanel = genPurePanel(Select);
|
|
245
|
+
var PurePanel = genPurePanel(Select, 'dropdownAlign');
|
|
217
246
|
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
|
|
218
247
|
Select.Option = Option;
|
|
219
248
|
Select.OptGroup = OptGroup;
|
|
@@ -31,7 +31,8 @@ var genSingleStyle = function genSingleStyle(token) {
|
|
|
31
31
|
var slideUpAppearActive = "&".concat(antCls, "-slide-up-appear").concat(antCls, "-slide-up-appear-active");
|
|
32
32
|
var slideUpLeaveActive = "&".concat(antCls, "-slide-up-leave").concat(antCls, "-slide-up-leave-active");
|
|
33
33
|
var dropdownPlacementCls = "".concat(componentCls, "-dropdown-placement-");
|
|
34
|
-
|
|
34
|
+
var selectedItemCls = "".concat(selectItemCls, "-option-selected");
|
|
35
|
+
return [_defineProperty({}, "".concat(componentCls, "-dropdown"), _objectSpread(_objectSpread({}, resetComponent(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
35
36
|
position: 'absolute',
|
|
36
37
|
top: -9999,
|
|
37
38
|
zIndex: token.zIndexPopup,
|
|
@@ -80,19 +81,13 @@ var genSingleStyle = function genSingleStyle(token) {
|
|
|
80
81
|
}
|
|
81
82
|
}, "&-active:not(".concat(selectItemCls, "-option-disabled)"), {
|
|
82
83
|
backgroundColor: token.optionActiveBg
|
|
83
|
-
}), "&-selected:not(".concat(selectItemCls, "-option-disabled)"), _defineProperty(
|
|
84
|
+
}), "&-selected:not(".concat(selectItemCls, "-option-disabled)"), _defineProperty({
|
|
84
85
|
color: token.optionSelectedColor,
|
|
85
86
|
fontWeight: token.optionSelectedFontWeight,
|
|
86
87
|
backgroundColor: token.optionSelectedBg
|
|
87
88
|
}, "".concat(selectItemCls, "-option-state"), {
|
|
88
89
|
color: token.colorPrimary
|
|
89
|
-
}),
|
|
90
|
-
borderEndStartRadius: 0,
|
|
91
|
-
borderEndEndRadius: 0
|
|
92
|
-
}, "& + ".concat(selectItemCls, "-option-selected:not(").concat(selectItemCls, "-option-disabled)"), {
|
|
93
|
-
borderStartStartRadius: 0,
|
|
94
|
-
borderStartEndRadius: 0
|
|
95
|
-
}))), '&-disabled', _defineProperty(_defineProperty(_defineProperty({}, "&".concat(selectItemCls, "-option-selected"), {
|
|
90
|
+
})), '&-disabled', _defineProperty(_defineProperty(_defineProperty({}, "&".concat(selectItemCls, "-option-selected"), {
|
|
96
91
|
backgroundColor: token.colorBgContainerDisabled
|
|
97
92
|
}), "color", token.colorTextDisabled), "cursor", 'not-allowed')), '&-grouped', {
|
|
98
93
|
paddingInlineStart: token.calc(token.controlPaddingHorizontal).mul(2).equal()
|
|
@@ -100,6 +95,12 @@ var genSingleStyle = function genSingleStyle(token) {
|
|
|
100
95
|
'&-empty': _objectSpread(_objectSpread({}, genItemStyle(token)), {}, {
|
|
101
96
|
color: token.colorTextDisabled
|
|
102
97
|
})
|
|
98
|
+
})), "".concat(selectedItemCls, ":has(+ ").concat(selectedItemCls, ")"), _defineProperty({
|
|
99
|
+
borderEndStartRadius: 0,
|
|
100
|
+
borderEndEndRadius: 0
|
|
101
|
+
}, "& + ".concat(selectedItemCls), {
|
|
102
|
+
borderStartStartRadius: 0,
|
|
103
|
+
borderStartEndRadius: 0
|
|
103
104
|
})), '&-rtl', {
|
|
104
105
|
direction: 'rtl'
|
|
105
106
|
}))),
|
|
@@ -49,7 +49,7 @@ var getSearchInputWithoutBorderStyle = function getSearchInputWithoutBorderStyle
|
|
|
49
49
|
fontFamily: 'inherit',
|
|
50
50
|
'&::-webkit-search-cancel-button': {
|
|
51
51
|
display: 'none',
|
|
52
|
-
|
|
52
|
+
appearance: 'none'
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
};
|
|
@@ -59,7 +59,12 @@ var genBaseStyle = function genBaseStyle(token) {
|
|
|
59
59
|
componentCls = token.componentCls,
|
|
60
60
|
inputPaddingHorizontalBase = token.inputPaddingHorizontalBase,
|
|
61
61
|
iconCls = token.iconCls;
|
|
62
|
-
|
|
62
|
+
var hoverShowClearStyle = _defineProperty({}, "".concat(componentCls, "-clear"), {
|
|
63
|
+
opacity: 1,
|
|
64
|
+
background: token.colorBgBase,
|
|
65
|
+
borderRadius: '50%'
|
|
66
|
+
});
|
|
67
|
+
return _defineProperty(_defineProperty({}, componentCls, _objectSpread(_objectSpread({}, resetComponent(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
63
68
|
position: 'relative',
|
|
64
69
|
display: 'inline-flex',
|
|
65
70
|
cursor: 'pointer'
|
|
@@ -105,6 +110,7 @@ var genBaseStyle = function genBaseStyle(token) {
|
|
|
105
110
|
display: 'flex',
|
|
106
111
|
width: '100%',
|
|
107
112
|
position: 'relative',
|
|
113
|
+
minWidth: 0,
|
|
108
114
|
// https://github.com/ant-design/ant-design/issues/51669
|
|
109
115
|
'&:after': {
|
|
110
116
|
content: '"\\a0"',
|
|
@@ -138,15 +144,13 @@ var genBaseStyle = function genBaseStyle(token) {
|
|
|
138
144
|
display: 'block'
|
|
139
145
|
},
|
|
140
146
|
'&:hover': {
|
|
141
|
-
color: token.
|
|
147
|
+
color: token.colorIcon
|
|
142
148
|
}
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
})
|
|
148
|
-
insetInlineEnd: token.calc(inputPaddingHorizontalBase).add(token.fontSize).add(token.paddingXS).equal()
|
|
149
|
-
}));
|
|
149
|
+
}), '@media(hover:none)', hoverShowClearStyle), '&:hover', hoverShowClearStyle))), "".concat(componentCls, "-status"), {
|
|
150
|
+
'&-error, &-warning, &-success, &-validating': _defineProperty({}, "&".concat(componentCls, "-has-feedback"), _defineProperty({}, "".concat(componentCls, "-clear"), {
|
|
151
|
+
insetInlineEnd: token.calc(inputPaddingHorizontalBase).add(token.fontSize).add(token.paddingXS).equal()
|
|
152
|
+
}))
|
|
153
|
+
});
|
|
150
154
|
};
|
|
151
155
|
// ============================== Styles ==============================
|
|
152
156
|
var genSelectStyle = function genSelectStyle(token) {
|
|
@@ -16,11 +16,13 @@ function genSizeStyle(token, suffix) {
|
|
|
16
16
|
return _defineProperty({}, "".concat(componentCls, "-single").concat(suffixCls), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
17
17
|
fontSize: token.fontSize,
|
|
18
18
|
height: token.controlHeight
|
|
19
|
-
}, "".concat(componentCls, "-selector"), _objectSpread(_objectSpread({}, resetComponent(token, true)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
19
|
+
}, "".concat(componentCls, "-selector"), _objectSpread(_objectSpread({}, resetComponent(token, true)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
20
20
|
display: 'flex',
|
|
21
21
|
borderRadius: borderRadius,
|
|
22
22
|
flex: '1 1 auto'
|
|
23
|
-
}, "".concat(componentCls, "-selection-
|
|
23
|
+
}, "".concat(componentCls, "-selection-wrap:after"), {
|
|
24
|
+
lineHeight: unit(selectHeightWithoutBorder)
|
|
25
|
+
}), "".concat(componentCls, "-selection-search"), {
|
|
24
26
|
position: 'absolute',
|
|
25
27
|
inset: 0,
|
|
26
28
|
width: '100%',
|
|
@@ -52,7 +54,8 @@ function genSizeStyle(token, suffix) {
|
|
|
52
54
|
alignItems: 'center',
|
|
53
55
|
padding: "0 ".concat(unit(inputPaddingHorizontalBase))
|
|
54
56
|
}, "".concat(componentCls, "-selection-search-input"), {
|
|
55
|
-
height: selectHeightWithoutBorder
|
|
57
|
+
height: selectHeightWithoutBorder,
|
|
58
|
+
fontSize: token.fontSize
|
|
56
59
|
}), '&:after', {
|
|
57
60
|
lineHeight: unit(selectHeightWithoutBorder)
|
|
58
61
|
}))), "&".concat(componentCls, "-customize-input"), _defineProperty({}, "".concat(componentCls, "-selector"), _defineProperty(_defineProperty({
|
|
@@ -129,7 +129,61 @@ var genBorderlessStyle = function genBorderlessStyle(token) {
|
|
|
129
129
|
}))
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
+
// =====================================================
|
|
133
|
+
// == Underlined ==
|
|
134
|
+
// =====================================================
|
|
135
|
+
var genBaseUnderlinedStyle = function genBaseUnderlinedStyle(token, options) {
|
|
136
|
+
var componentCls = token.componentCls,
|
|
137
|
+
antCls = token.antCls;
|
|
138
|
+
return _defineProperty(_defineProperty({}, "&:not(".concat(componentCls, "-customize-input) ").concat(componentCls, "-selector"), {
|
|
139
|
+
borderWidth: "0 0 ".concat(unit(token.lineWidth), " 0"),
|
|
140
|
+
borderStyle: "none none ".concat(token.lineType, " none"),
|
|
141
|
+
borderColor: options.borderColor,
|
|
142
|
+
background: token.selectorBg,
|
|
143
|
+
borderRadius: 0
|
|
144
|
+
}), "&:not(".concat(componentCls, "-disabled):not(").concat(componentCls, "-customize-input):not(").concat(antCls, "-pagination-size-changer)"), _defineProperty(_defineProperty(_defineProperty({}, "&:hover ".concat(componentCls, "-selector"), {
|
|
145
|
+
borderColor: options.hoverBorderHover
|
|
146
|
+
}), "".concat(componentCls, "-focused& ").concat(componentCls, "-selector"), {
|
|
147
|
+
borderColor: options.activeBorderColor,
|
|
148
|
+
outline: 0
|
|
149
|
+
}), "".concat(componentCls, "-prefix"), {
|
|
150
|
+
color: options.color
|
|
151
|
+
}));
|
|
152
|
+
};
|
|
153
|
+
var genUnderlinedStatusStyle = function genUnderlinedStatusStyle(token, options) {
|
|
154
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-status-").concat(options.status), _objectSpread({}, genBaseUnderlinedStyle(token, options)));
|
|
155
|
+
};
|
|
156
|
+
var genUnderlinedStyle = function genUnderlinedStyle(token) {
|
|
157
|
+
return {
|
|
158
|
+
'&-underlined': _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, genBaseUnderlinedStyle(token, {
|
|
159
|
+
borderColor: token.colorBorder,
|
|
160
|
+
hoverBorderHover: token.hoverBorderColor,
|
|
161
|
+
activeBorderColor: token.activeBorderColor,
|
|
162
|
+
activeOutlineColor: token.activeOutlineColor,
|
|
163
|
+
color: token.colorText
|
|
164
|
+
})), genUnderlinedStatusStyle(token, {
|
|
165
|
+
status: 'error',
|
|
166
|
+
borderColor: token.colorError,
|
|
167
|
+
hoverBorderHover: token.colorErrorHover,
|
|
168
|
+
activeBorderColor: token.colorError,
|
|
169
|
+
activeOutlineColor: token.colorErrorOutline,
|
|
170
|
+
color: token.colorError
|
|
171
|
+
})), genUnderlinedStatusStyle(token, {
|
|
172
|
+
status: 'warning',
|
|
173
|
+
borderColor: token.colorWarning,
|
|
174
|
+
hoverBorderHover: token.colorWarningHover,
|
|
175
|
+
activeBorderColor: token.colorWarning,
|
|
176
|
+
activeOutlineColor: token.colorWarningOutline,
|
|
177
|
+
color: token.colorWarning
|
|
178
|
+
})), {}, _defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-disabled"), _defineProperty({}, "&:not(".concat(token.componentCls, "-customize-input) ").concat(token.componentCls, "-selector"), {
|
|
179
|
+
color: token.colorTextDisabled
|
|
180
|
+
})), "&".concat(token.componentCls, "-multiple ").concat(token.componentCls, "-selection-item"), {
|
|
181
|
+
background: token.multipleItemBg,
|
|
182
|
+
border: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.multipleItemBorderColor)
|
|
183
|
+
}))
|
|
184
|
+
};
|
|
185
|
+
};
|
|
132
186
|
var genVariantsStyle = function genVariantsStyle(token) {
|
|
133
|
-
return _defineProperty({}, token.componentCls, _objectSpread(_objectSpread(_objectSpread({}, genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)));
|
|
187
|
+
return _defineProperty({}, token.componentCls, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), genUnderlinedStyle(token)));
|
|
134
188
|
};
|
|
135
189
|
export default genVariantsStyle;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
2
|
import * as React from 'react';
|
|
9
3
|
import classNames from 'classnames';
|
|
@@ -24,8 +18,11 @@ var Paragraph = function Paragraph(props) {
|
|
|
24
18
|
var prefixCls = props.prefixCls,
|
|
25
19
|
className = props.className,
|
|
26
20
|
style = props.style,
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
_props$rows2 = props.rows,
|
|
22
|
+
rows = _props$rows2 === void 0 ? 0 : _props$rows2;
|
|
23
|
+
var rowList = Array.from({
|
|
24
|
+
length: rows
|
|
25
|
+
}).map(function (_, index) {
|
|
29
26
|
return (
|
|
30
27
|
// eslint-disable-next-line react/no-array-index-key
|
|
31
28
|
_jsx("li", {
|
|
@@ -13,7 +13,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
17
17
|
import SkeletonAvatar from './Avatar';
|
|
18
18
|
import SkeletonButton from './Button';
|
|
19
19
|
import Element from './Element';
|
|
@@ -84,10 +84,11 @@ var Skeleton = function Skeleton(props) {
|
|
|
84
84
|
paragraph = _props$paragraph === void 0 ? true : _props$paragraph,
|
|
85
85
|
active = props.active,
|
|
86
86
|
round = props.round;
|
|
87
|
-
var
|
|
88
|
-
getPrefixCls =
|
|
89
|
-
direction =
|
|
90
|
-
|
|
87
|
+
var _useComponentConfig = useComponentConfig('skeleton'),
|
|
88
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
89
|
+
direction = _useComponentConfig.direction,
|
|
90
|
+
contextClassName = _useComponentConfig.className,
|
|
91
|
+
contextStyle = _useComponentConfig.style;
|
|
91
92
|
var prefixCls = getPrefixCls('skeleton', customizePrefixCls);
|
|
92
93
|
var _useStyle = useStyle(prefixCls),
|
|
93
94
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -133,10 +134,10 @@ var Skeleton = function Skeleton(props) {
|
|
|
133
134
|
children: [$title, paragraphNode]
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
|
-
var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-with-avatar"), hasAvatar), "".concat(prefixCls, "-active"), active), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-round"), round),
|
|
137
|
+
var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-with-avatar"), hasAvatar), "".concat(prefixCls, "-active"), active), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-round"), round), contextClassName, className, rootClassName, hashId, cssVarCls);
|
|
137
138
|
return wrapCSSVar(_jsxs("div", {
|
|
138
139
|
className: cls,
|
|
139
|
-
style: _objectSpread(_objectSpread({},
|
|
140
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style),
|
|
140
141
|
children: [avatarNode, contentNode]
|
|
141
142
|
}));
|
|
142
143
|
}
|
|
@@ -12,7 +12,8 @@ import { composeRef } from 'rc-util/lib/ref';
|
|
|
12
12
|
import Tooltip from '../tooltip';
|
|
13
13
|
var SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
14
|
var open = props.open,
|
|
15
|
-
draggingDelete = props.draggingDelete
|
|
15
|
+
draggingDelete = props.draggingDelete,
|
|
16
|
+
value = props.value;
|
|
16
17
|
var innerRef = useRef(null);
|
|
17
18
|
var mergedOpen = open && !draggingDelete;
|
|
18
19
|
var rafRef = useRef(null);
|
|
@@ -34,7 +35,7 @@ var SliderTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34
35
|
cancelKeepAlign();
|
|
35
36
|
}
|
|
36
37
|
return cancelKeepAlign;
|
|
37
|
-
}, [mergedOpen, props.title]);
|
|
38
|
+
}, [mergedOpen, props.title, value]);
|
|
38
39
|
return _jsx(Tooltip, _objectSpread(_objectSpread({
|
|
39
40
|
ref: composeRef(innerRef, ref)
|
|
40
41
|
}, props), {}, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["prefixCls", "range", "className", "rootClassName", "style", "disabled", "tooltipPrefixCls", "tipFormatter", "tooltipVisible", "getTooltipPopupContainer", "tooltipPlacement", "tooltip", "onChangeComplete"];
|
|
2
|
+
var _excluded = ["prefixCls", "range", "className", "rootClassName", "style", "disabled", "tooltipPrefixCls", "tipFormatter", "tooltipVisible", "getTooltipPopupContainer", "tooltipPlacement", "tooltip", "onChangeComplete", "classNames", "styles"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -20,12 +20,12 @@ import classNames from 'classnames';
|
|
|
20
20
|
import RcSlider from 'rc-slider';
|
|
21
21
|
import raf from 'rc-util/lib/raf';
|
|
22
22
|
import { devUseWarning } from '../_util/warning';
|
|
23
|
-
import { ConfigContext } from '../config-provider';
|
|
24
23
|
import DisabledContext from '../config-provider/DisabledContext';
|
|
24
|
+
import SliderInternalContext from './Context';
|
|
25
25
|
import SliderTooltip from './SliderTooltip';
|
|
26
26
|
import useStyle from './style';
|
|
27
|
-
import SliderInternalContext from './Context';
|
|
28
27
|
import useRafLock from './useRafLock';
|
|
28
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
29
29
|
function getTipFormatter(tipFormatter, legacyTipFormatter) {
|
|
30
30
|
if (tipFormatter || tipFormatter === null) {
|
|
31
31
|
return tipFormatter;
|
|
@@ -52,19 +52,24 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
52
52
|
_props$tooltip = props.tooltip,
|
|
53
53
|
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip,
|
|
54
54
|
onChangeComplete = props.onChangeComplete,
|
|
55
|
+
sliderClassNames = props.classNames,
|
|
56
|
+
styles = props.styles,
|
|
55
57
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
56
58
|
var vertical = props.vertical;
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
var _useComponentConfig = useComponentConfig('slider'),
|
|
60
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
61
|
+
contextDirection = _useComponentConfig.direction,
|
|
62
|
+
contextClassName = _useComponentConfig.className,
|
|
63
|
+
contextStyle = _useComponentConfig.style,
|
|
64
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
65
|
+
contextStyles = _useComponentConfig.styles,
|
|
66
|
+
getPopupContainer = _useComponentConfig.getPopupContainer;
|
|
62
67
|
var contextDisabled = React.useContext(DisabledContext);
|
|
63
68
|
var mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
|
|
64
69
|
// ============================= Context ==============================
|
|
65
|
-
var _React$
|
|
66
|
-
contextHandleRender = _React$
|
|
67
|
-
internalContextDirection = _React$
|
|
70
|
+
var _React$useContext = React.useContext(SliderInternalContext),
|
|
71
|
+
contextHandleRender = _React$useContext.handleRender,
|
|
72
|
+
internalContextDirection = _React$useContext.direction;
|
|
68
73
|
var mergedDirection = internalContextDirection || contextDirection;
|
|
69
74
|
var isRTL = mergedDirection === 'rtl';
|
|
70
75
|
// =============================== Open ===============================
|
|
@@ -111,7 +116,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
111
116
|
wrapCSSVar = _useStyle2[0],
|
|
112
117
|
hashId = _useStyle2[1],
|
|
113
118
|
cssVarCls = _useStyle2[2];
|
|
114
|
-
var
|
|
119
|
+
var rootClassNames = classNames(className, contextClassName, contextClassNames.root, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.root, rootClassName, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), isRTL), "".concat(prefixCls, "-lock"), dragging), hashId, cssVarCls);
|
|
115
120
|
// make reverse default on rtl direction
|
|
116
121
|
if (isRTL && !restProps.vertical) {
|
|
117
122
|
restProps.reverse = !restProps.reverse;
|
|
@@ -187,10 +192,13 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
187
192
|
return /*#__PURE__*/_createElement(SliderTooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
188
193
|
prefixCls: getPrefixCls('tooltip', customizeTooltipPrefixCls !== null && customizeTooltipPrefixCls !== void 0 ? customizeTooltipPrefixCls : legacyTooltipPrefixCls),
|
|
189
194
|
title: mergedTipFormatter ? mergedTipFormatter(info.value) : '',
|
|
195
|
+
value: info.value,
|
|
190
196
|
open: open,
|
|
191
197
|
placement: getTooltipPlacement(tooltipPlacement !== null && tooltipPlacement !== void 0 ? tooltipPlacement : legacyTooltipPlacement, vertical),
|
|
192
198
|
key: index,
|
|
193
|
-
|
|
199
|
+
classNames: {
|
|
200
|
+
root: "".concat(prefixCls, "-tooltip")
|
|
201
|
+
},
|
|
194
202
|
getPopupContainer: getTooltipPopupContainer || legacyGetTooltipPopupContainer || getPopupContainer
|
|
195
203
|
}), cloneNode);
|
|
196
204
|
}
|
|
@@ -209,20 +217,38 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
209
217
|
open: mergedTipFormatter !== null && activeOpen,
|
|
210
218
|
placement: getTooltipPlacement(tooltipPlacement !== null && tooltipPlacement !== void 0 ? tooltipPlacement : legacyTooltipPlacement, vertical),
|
|
211
219
|
key: "tooltip",
|
|
212
|
-
|
|
220
|
+
classNames: {
|
|
221
|
+
root: "".concat(prefixCls, "-tooltip")
|
|
222
|
+
},
|
|
213
223
|
getPopupContainer: getTooltipPopupContainer || legacyGetTooltipPopupContainer || getPopupContainer,
|
|
214
224
|
draggingDelete: info.draggingDelete
|
|
215
225
|
}), cloneNode);
|
|
216
226
|
} : undefined;
|
|
217
227
|
// ============================== Render ==============================
|
|
218
|
-
var
|
|
228
|
+
var rootStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, contextStyles.root), contextStyle), styles === null || styles === void 0 ? void 0 : styles.root), style);
|
|
229
|
+
var mergedTracks = _objectSpread(_objectSpread({}, contextStyles.tracks), styles === null || styles === void 0 ? void 0 : styles.tracks);
|
|
230
|
+
var mergedTracksClassNames = classNames(contextClassNames.tracks, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.tracks);
|
|
219
231
|
return wrapCSSVar(
|
|
220
232
|
// @ts-ignore
|
|
221
233
|
_jsx(RcSlider, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
234
|
+
classNames: _objectSpread({
|
|
235
|
+
handle: classNames(contextClassNames.handle, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.handle),
|
|
236
|
+
rail: classNames(contextClassNames.rail, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.rail),
|
|
237
|
+
track: classNames(contextClassNames.track, sliderClassNames === null || sliderClassNames === void 0 ? void 0 : sliderClassNames.track)
|
|
238
|
+
}, mergedTracksClassNames ? {
|
|
239
|
+
tracks: mergedTracksClassNames
|
|
240
|
+
} : {}),
|
|
241
|
+
styles: _objectSpread({
|
|
242
|
+
handle: _objectSpread(_objectSpread({}, contextStyles.handle), styles === null || styles === void 0 ? void 0 : styles.handle),
|
|
243
|
+
rail: _objectSpread(_objectSpread({}, contextStyles.rail), styles === null || styles === void 0 ? void 0 : styles.rail),
|
|
244
|
+
track: _objectSpread(_objectSpread({}, contextStyles.track), styles === null || styles === void 0 ? void 0 : styles.track)
|
|
245
|
+
}, Object.keys(mergedTracks).length ? {
|
|
246
|
+
tracks: mergedTracks
|
|
247
|
+
} : {}),
|
|
222
248
|
step: restProps.step,
|
|
223
249
|
range: range,
|
|
224
|
-
className:
|
|
225
|
-
style:
|
|
250
|
+
className: rootClassNames,
|
|
251
|
+
style: rootStyle,
|
|
226
252
|
disabled: mergedDisabled,
|
|
227
253
|
ref: ref,
|
|
228
254
|
prefixCls: prefixCls,
|
|
@@ -5,7 +5,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { unit } from '@ant-design/cssinjs';
|
|
8
|
-
import {
|
|
8
|
+
import { FastColor } from '@ant-design/fast-color';
|
|
9
9
|
import { resetComponent } from '../../style';
|
|
10
10
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
11
11
|
// =============================== Base ===============================
|
|
@@ -230,7 +230,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
230
230
|
var handleLineWidth = token.lineWidth + increaseHandleWidth;
|
|
231
231
|
var handleLineWidthHover = token.lineWidth + increaseHandleWidth * 1.5;
|
|
232
232
|
var handleActiveColor = token.colorPrimary;
|
|
233
|
-
var handleActiveOutlineColor = new
|
|
233
|
+
var handleActiveOutlineColor = new FastColor(handleActiveColor).setA(0.2).toRgbString();
|
|
234
234
|
return {
|
|
235
235
|
controlSize: controlSize,
|
|
236
236
|
railSize: 4,
|
|
@@ -246,7 +246,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
246
246
|
handleColor: token.colorPrimaryBorder,
|
|
247
247
|
handleActiveColor: handleActiveColor,
|
|
248
248
|
handleActiveOutlineColor: handleActiveOutlineColor,
|
|
249
|
-
handleColorDisabled: new
|
|
249
|
+
handleColorDisabled: new FastColor(token.colorTextDisabled).onBackground(token.colorBgContainer).toHexString(),
|
|
250
250
|
dotBorderColor: token.colorBorderSecondary,
|
|
251
251
|
dotActiveBorderColor: token.colorPrimaryBorder,
|
|
252
252
|
trackBgDisabled: token.colorBgContainerDisabled
|
|
@@ -11,7 +11,7 @@ export default function useRafLock() {
|
|
|
11
11
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12
12
|
state = _React$useState2[0],
|
|
13
13
|
setState = _React$useState2[1];
|
|
14
|
-
var rafRef = React.useRef();
|
|
14
|
+
var rafRef = React.useRef(null);
|
|
15
15
|
var cleanup = function cleanup() {
|
|
16
16
|
raf.cancel(rafRef.current);
|
|
17
17
|
};
|
|
@@ -40,18 +40,20 @@ export var useCompactItemContext = function useCompactItemContext(prefixCls, dir
|
|
|
40
40
|
compactItemClassnames: compactItemClassnames
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
export var NoCompactStyle = function NoCompactStyle(
|
|
44
|
-
var children =
|
|
43
|
+
export var NoCompactStyle = function NoCompactStyle(props) {
|
|
44
|
+
var children = props.children;
|
|
45
45
|
return _jsx(SpaceCompactItemContext.Provider, {
|
|
46
46
|
value: null,
|
|
47
47
|
children: children
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
var CompactItem = function CompactItem(
|
|
51
|
-
var children =
|
|
52
|
-
|
|
50
|
+
var CompactItem = function CompactItem(props) {
|
|
51
|
+
var children = props.children,
|
|
52
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
53
53
|
return _jsx(SpaceCompactItemContext.Provider, {
|
|
54
|
-
value:
|
|
54
|
+
value: React.useMemo(function () {
|
|
55
|
+
return others;
|
|
56
|
+
}, [others]),
|
|
55
57
|
children: children
|
|
56
58
|
});
|
|
57
59
|
};
|