@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
|
@@ -28,7 +28,7 @@ export function withPureRenderTheme(Component) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
/* istanbul ignore next */
|
|
31
|
-
var genPurePanel = function genPurePanel(Component, defaultPrefixCls, getDropdownCls
|
|
31
|
+
var genPurePanel = function genPurePanel(Component, alignPropName, postProps, defaultPrefixCls, getDropdownCls) {
|
|
32
32
|
var PurePanel = function PurePanel(props) {
|
|
33
33
|
var customizePrefixCls = props.prefixCls,
|
|
34
34
|
style = props.style;
|
|
@@ -87,6 +87,14 @@ var genPurePanel = function genPurePanel(Component, defaultPrefixCls, getDropdow
|
|
|
87
87
|
if (postProps) {
|
|
88
88
|
mergedProps = postProps(mergedProps);
|
|
89
89
|
}
|
|
90
|
+
if (alignPropName) {
|
|
91
|
+
Object.assign(mergedProps, _defineProperty({}, alignPropName, {
|
|
92
|
+
overflow: {
|
|
93
|
+
adjustX: false,
|
|
94
|
+
adjustY: false
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
90
98
|
var mergedStyle = {
|
|
91
99
|
paddingBottom: popupHeight,
|
|
92
100
|
position: 'relative',
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
import { isValidElement } from 'react';
|
|
3
|
+
function convertToTooltipProps(tooltip) {
|
|
4
|
+
// isNil
|
|
5
|
+
if (tooltip === undefined || tooltip === null) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
if (_typeof(tooltip) === 'object' && ! /*#__PURE__*/isValidElement(tooltip)) {
|
|
9
|
+
return tooltip;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
title: tooltip
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default convertToTooltipProps;
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var obj = i < 0 || _arguments.length <= i ? undefined : _arguments[i];
|
|
12
|
-
if (obj) {
|
|
13
|
-
Object.keys(obj).forEach(function (key) {
|
|
14
|
-
var val = obj[key];
|
|
15
|
-
if (val !== undefined) {
|
|
16
|
-
result[key] = val;
|
|
1
|
+
function mergeProps() {
|
|
2
|
+
var ret = {};
|
|
3
|
+
for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4
|
+
items[_key] = arguments[_key];
|
|
5
|
+
}
|
|
6
|
+
items.forEach(function (item) {
|
|
7
|
+
if (item) {
|
|
8
|
+
Object.keys(item).forEach(function (key) {
|
|
9
|
+
if (item[key] !== undefined) {
|
|
10
|
+
ret[key] = item[key];
|
|
17
11
|
}
|
|
18
12
|
});
|
|
19
13
|
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
export default extendsObject;
|
|
14
|
+
});
|
|
15
|
+
return ret;
|
|
16
|
+
}
|
|
17
|
+
export default mergeProps;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure 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 _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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
1
7
|
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; }
|
|
2
8
|
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; }
|
|
3
9
|
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; }
|
|
@@ -8,6 +14,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
14
|
import React from 'react';
|
|
9
15
|
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
|
10
16
|
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
17
|
+
import { useLocale } from '../../locale';
|
|
18
|
+
import defaultLocale from '../../locale/en_US';
|
|
19
|
+
import extendsObject from '../extendsObject';
|
|
11
20
|
export function pickClosable(context) {
|
|
12
21
|
if (!context) {
|
|
13
22
|
return undefined;
|
|
@@ -40,26 +49,6 @@ function useClosableConfig(closableCollection) {
|
|
|
40
49
|
return closableConfig;
|
|
41
50
|
}, [closable, closeIcon]);
|
|
42
51
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Assign object without `undefined` field. Will skip if is `false`.
|
|
45
|
-
* This helps to handle both closableConfig or false
|
|
46
|
-
*/
|
|
47
|
-
function assignWithoutUndefined() {
|
|
48
|
-
var target = {};
|
|
49
|
-
for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
|
-
objList[_key] = arguments[_key];
|
|
51
|
-
}
|
|
52
|
-
objList.forEach(function (obj) {
|
|
53
|
-
if (obj) {
|
|
54
|
-
Object.keys(obj).forEach(function (key) {
|
|
55
|
-
if (obj[key] !== undefined) {
|
|
56
|
-
target[key] = obj[key];
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return target;
|
|
62
|
-
}
|
|
63
52
|
/** Use same object to support `useMemo` optimization */
|
|
64
53
|
var EmptyFallbackCloseCollection = {};
|
|
65
54
|
export default function useClosable(propCloseCollection, contextCloseCollection) {
|
|
@@ -67,6 +56,9 @@ export default function useClosable(propCloseCollection, contextCloseCollection)
|
|
|
67
56
|
// Align the `props`, `context` `fallback` to config object first
|
|
68
57
|
var propCloseConfig = useClosableConfig(propCloseCollection);
|
|
69
58
|
var contextCloseConfig = useClosableConfig(contextCloseCollection);
|
|
59
|
+
var _useLocale = useLocale('global', defaultLocale.global),
|
|
60
|
+
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
61
|
+
contextLocale = _useLocale2[0];
|
|
70
62
|
var closeBtnIsDisabled = typeof propCloseConfig !== 'boolean' ? !!(propCloseConfig !== null && propCloseConfig !== void 0 && propCloseConfig.disabled) : false;
|
|
71
63
|
var mergedFallbackCloseCollection = React.useMemo(function () {
|
|
72
64
|
return _objectSpread({
|
|
@@ -81,7 +73,7 @@ export default function useClosable(propCloseCollection, contextCloseCollection)
|
|
|
81
73
|
return false;
|
|
82
74
|
}
|
|
83
75
|
if (propCloseConfig) {
|
|
84
|
-
return
|
|
76
|
+
return extendsObject(mergedFallbackCloseCollection, contextCloseConfig, propCloseConfig);
|
|
85
77
|
}
|
|
86
78
|
// =============== Context Second ==============
|
|
87
79
|
// Skip if context is disabled
|
|
@@ -89,7 +81,7 @@ export default function useClosable(propCloseCollection, contextCloseCollection)
|
|
|
89
81
|
return false;
|
|
90
82
|
}
|
|
91
83
|
if (contextCloseConfig) {
|
|
92
|
-
return
|
|
84
|
+
return extendsObject(mergedFallbackCloseCollection, contextCloseConfig);
|
|
93
85
|
}
|
|
94
86
|
// ============= Fallback Default ==============
|
|
95
87
|
return !mergedFallbackCloseCollection.closable ? false : mergedFallbackCloseCollection;
|
|
@@ -97,24 +89,26 @@ export default function useClosable(propCloseCollection, contextCloseCollection)
|
|
|
97
89
|
// Calculate the final closeIcon
|
|
98
90
|
return React.useMemo(function () {
|
|
99
91
|
if (mergedClosableConfig === false) {
|
|
100
|
-
return [false, null, closeBtnIsDisabled];
|
|
92
|
+
return [false, null, closeBtnIsDisabled, {}];
|
|
101
93
|
}
|
|
102
94
|
var closeIconRender = mergedFallbackCloseCollection.closeIconRender;
|
|
103
95
|
var closeIcon = mergedClosableConfig.closeIcon;
|
|
104
96
|
var mergedCloseIcon = closeIcon;
|
|
97
|
+
// Wrap the closeIcon with aria props
|
|
98
|
+
var ariaOrDataProps = pickAttrs(mergedClosableConfig, true);
|
|
105
99
|
if (mergedCloseIcon !== null && mergedCloseIcon !== undefined) {
|
|
106
100
|
// Wrap the closeIcon if needed
|
|
107
101
|
if (closeIconRender) {
|
|
108
102
|
mergedCloseIcon = closeIconRender(closeIcon);
|
|
109
103
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
104
|
+
mergedCloseIcon = /*#__PURE__*/React.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/React.cloneElement(mergedCloseIcon, _objectSpread({
|
|
105
|
+
'aria-label': contextLocale.close
|
|
106
|
+
}, ariaOrDataProps))) : _jsx("span", _objectSpread(_objectSpread({
|
|
107
|
+
"aria-label": contextLocale.close
|
|
108
|
+
}, ariaOrDataProps), {}, {
|
|
109
|
+
children: mergedCloseIcon
|
|
110
|
+
}));
|
|
117
111
|
}
|
|
118
|
-
return [true, mergedCloseIcon, closeBtnIsDisabled];
|
|
112
|
+
return [true, mergedCloseIcon, closeBtnIsDisabled, ariaOrDataProps];
|
|
119
113
|
}, [mergedClosableConfig, mergedFallbackCloseCollection]);
|
|
120
114
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
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); }
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import classnames from 'classnames';
|
|
15
|
+
// ========================= ClassNames =========================
|
|
16
|
+
export function mergeClassNames(schema) {
|
|
17
|
+
var mergedSchema = schema || {};
|
|
18
|
+
for (var _len = arguments.length, classNames = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
19
|
+
classNames[_key - 1] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
return classNames.reduce(function (acc, cur) {
|
|
22
|
+
// Loop keys of the current classNames
|
|
23
|
+
Object.keys(cur || {}).forEach(function (key) {
|
|
24
|
+
var keySchema = mergedSchema[key];
|
|
25
|
+
var curVal = cur[key];
|
|
26
|
+
if (keySchema && _typeof(keySchema) === 'object') {
|
|
27
|
+
if (curVal && _typeof(curVal) === 'object') {
|
|
28
|
+
// Loop fill
|
|
29
|
+
acc[key] = mergeClassNames(keySchema, acc[key], curVal);
|
|
30
|
+
} else {
|
|
31
|
+
// Covert string to object structure
|
|
32
|
+
var defaultField = keySchema._default;
|
|
33
|
+
acc[key] = acc[key] || {};
|
|
34
|
+
acc[key][defaultField] = classnames(acc[key][defaultField], curVal);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
// Flatten fill
|
|
38
|
+
acc[key] = classnames(acc[key], curVal);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return acc;
|
|
42
|
+
}, {});
|
|
43
|
+
}
|
|
44
|
+
function useSemanticClassNames(schema) {
|
|
45
|
+
for (var _len2 = arguments.length, classNames = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
46
|
+
classNames[_key2 - 1] = arguments[_key2];
|
|
47
|
+
}
|
|
48
|
+
return React.useMemo(function () {
|
|
49
|
+
return mergeClassNames.apply(void 0, [schema].concat(classNames));
|
|
50
|
+
}, [classNames]);
|
|
51
|
+
}
|
|
52
|
+
// =========================== Styles ===========================
|
|
53
|
+
function useSemanticStyles() {
|
|
54
|
+
for (var _len3 = arguments.length, styles = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
55
|
+
styles[_key3] = arguments[_key3];
|
|
56
|
+
}
|
|
57
|
+
return React.useMemo(function () {
|
|
58
|
+
return styles.reduce(function (acc) {
|
|
59
|
+
var cur = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
60
|
+
Object.keys(cur).forEach(function (key) {
|
|
61
|
+
acc[key] = _objectSpread(_objectSpread({}, acc[key]), cur[key]);
|
|
62
|
+
});
|
|
63
|
+
return acc;
|
|
64
|
+
}, {});
|
|
65
|
+
}, [styles]);
|
|
66
|
+
}
|
|
67
|
+
// =========================== Export ===========================
|
|
68
|
+
function fillObjectBySchema(obj, schema) {
|
|
69
|
+
var newObj = _objectSpread({}, obj);
|
|
70
|
+
Object.keys(schema).forEach(function (key) {
|
|
71
|
+
if (key !== '_default') {
|
|
72
|
+
var nestSchema = schema[key];
|
|
73
|
+
var nextValue = newObj[key] || {};
|
|
74
|
+
newObj[key] = nestSchema ? fillObjectBySchema(nextValue, nestSchema) : nextValue;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return newObj;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Merge classNames and styles from multiple sources.
|
|
81
|
+
* When `schema` is provided, it will **must** provide the nest object structure.
|
|
82
|
+
*/
|
|
83
|
+
export default function useMergeSemantic(classNamesList, stylesList, schema) {
|
|
84
|
+
var mergedClassNames = useSemanticClassNames.apply(void 0, [schema].concat(_toConsumableArray(classNamesList)));
|
|
85
|
+
var mergedStyles = useSemanticStyles.apply(void 0, _toConsumableArray(stylesList));
|
|
86
|
+
return React.useMemo(function () {
|
|
87
|
+
return [fillObjectBySchema(mergedClassNames, schema), fillObjectBySchema(mergedStyles, schema)];
|
|
88
|
+
}, [mergedClassNames, mergedStyles]);
|
|
89
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
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 isPrimitive = function isPrimitive(value) {
|
|
3
|
+
return _typeof(value) !== 'object' && typeof value !== 'function' || value === null;
|
|
4
|
+
};
|
|
5
|
+
export default isPrimitive;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var addMediaQueryListener = function addMediaQueryListener(mql, handler) {
|
|
2
|
+
// Don't delete here, please keep the code compatible
|
|
3
|
+
if (typeof (mql === null || mql === void 0 ? void 0 : mql.addEventListener) !== 'undefined') {
|
|
4
|
+
mql.addEventListener('change', handler);
|
|
5
|
+
} else if (typeof (mql === null || mql === void 0 ? void 0 : mql.addListener) !== 'undefined') {
|
|
6
|
+
mql.addListener(handler);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export var removeMediaQueryListener = function removeMediaQueryListener(mql, handler) {
|
|
10
|
+
// Don't delete here, please keep the code compatible
|
|
11
|
+
if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeEventListener) !== 'undefined') {
|
|
12
|
+
mql.removeEventListener('change', handler);
|
|
13
|
+
} else if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeListener) !== 'undefined') {
|
|
14
|
+
mql.removeListener(handler);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -12,6 +12,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { useToken } from '../theme/internal';
|
|
15
|
+
import { addMediaQueryListener, removeMediaQueryListener } from './mediaQueryUtil';
|
|
15
16
|
export var responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
16
17
|
var getResponsiveMap = function getResponsiveMap(token) {
|
|
17
18
|
return {
|
|
@@ -51,7 +52,18 @@ var validateBreakpoints = function validateBreakpoints(token) {
|
|
|
51
52
|
});
|
|
52
53
|
return token;
|
|
53
54
|
};
|
|
54
|
-
export
|
|
55
|
+
export var matchScreen = function matchScreen(screens, screenSizes) {
|
|
56
|
+
if (!screenSizes) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
for (var _i = 0, _responsiveArray = responsiveArray; _i < _responsiveArray.length; _i++) {
|
|
60
|
+
var breakpoint = _responsiveArray[_i];
|
|
61
|
+
if (screens[breakpoint] && (screenSizes === null || screenSizes === void 0 ? void 0 : screenSizes[breakpoint]) !== undefined) {
|
|
62
|
+
return screenSizes[breakpoint];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var useResponsiveObserver = function useResponsiveObserver() {
|
|
55
67
|
var _useToken = useToken(),
|
|
56
68
|
_useToken2 = _slicedToArray(_useToken, 2),
|
|
57
69
|
token = _useToken2[1];
|
|
@@ -62,6 +74,7 @@ export default function useResponsiveObserver() {
|
|
|
62
74
|
var subUid = -1;
|
|
63
75
|
var screens = {};
|
|
64
76
|
return {
|
|
77
|
+
responsiveMap: responsiveMap,
|
|
65
78
|
matchHandlers: {},
|
|
66
79
|
dispatch: function dispatch(pointMap) {
|
|
67
80
|
screens = pointMap;
|
|
@@ -71,7 +84,9 @@ export default function useResponsiveObserver() {
|
|
|
71
84
|
return subscribers.size >= 1;
|
|
72
85
|
},
|
|
73
86
|
subscribe: function subscribe(func) {
|
|
74
|
-
if (!subscribers.size)
|
|
87
|
+
if (!subscribers.size) {
|
|
88
|
+
this.register();
|
|
89
|
+
}
|
|
75
90
|
subUid += 1;
|
|
76
91
|
subscribers.set(subUid, func);
|
|
77
92
|
func(screens);
|
|
@@ -79,45 +94,38 @@ export default function useResponsiveObserver() {
|
|
|
79
94
|
},
|
|
80
95
|
unsubscribe: function unsubscribe(paramToken) {
|
|
81
96
|
subscribers["delete"](paramToken);
|
|
82
|
-
if (!subscribers.size)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var _this = this;
|
|
86
|
-
Object.keys(responsiveMap).forEach(function (screen) {
|
|
87
|
-
var matchMediaQuery = responsiveMap[screen];
|
|
88
|
-
var handler = _this.matchHandlers[matchMediaQuery];
|
|
89
|
-
handler === null || handler === void 0 || handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);
|
|
90
|
-
});
|
|
91
|
-
subscribers.clear();
|
|
97
|
+
if (!subscribers.size) {
|
|
98
|
+
this.unregister();
|
|
99
|
+
}
|
|
92
100
|
},
|
|
93
101
|
register: function register() {
|
|
94
|
-
var
|
|
95
|
-
Object.
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
var _this = this;
|
|
103
|
+
Object.entries(responsiveMap).forEach(function (_ref) {
|
|
104
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
105
|
+
screen = _ref2[0],
|
|
106
|
+
mediaQuery = _ref2[1];
|
|
107
|
+
var listener = function listener(_ref3) {
|
|
108
|
+
var matches = _ref3.matches;
|
|
109
|
+
_this.dispatch(_objectSpread(_objectSpread({}, screens), {}, _defineProperty({}, screen, matches)));
|
|
100
110
|
};
|
|
101
|
-
var mql = window.matchMedia(
|
|
102
|
-
mql
|
|
103
|
-
|
|
111
|
+
var mql = window.matchMedia(mediaQuery);
|
|
112
|
+
addMediaQueryListener(mql, listener);
|
|
113
|
+
_this.matchHandlers[mediaQuery] = {
|
|
104
114
|
mql: mql,
|
|
105
115
|
listener: listener
|
|
106
116
|
};
|
|
107
117
|
listener(mql);
|
|
108
118
|
});
|
|
109
119
|
},
|
|
110
|
-
|
|
120
|
+
unregister: function unregister() {
|
|
121
|
+
var _this2 = this;
|
|
122
|
+
Object.values(responsiveMap).forEach(function (mediaQuery) {
|
|
123
|
+
var handler = _this2.matchHandlers[mediaQuery];
|
|
124
|
+
removeMediaQueryListener(handler === null || handler === void 0 ? void 0 : handler.mql, handler === null || handler === void 0 ? void 0 : handler.listener);
|
|
125
|
+
});
|
|
126
|
+
subscribers.clear();
|
|
127
|
+
}
|
|
111
128
|
};
|
|
112
129
|
}, [token]);
|
|
113
|
-
}
|
|
114
|
-
export
|
|
115
|
-
if (screenSizes && _typeof(screenSizes) === 'object') {
|
|
116
|
-
for (var i = 0; i < responsiveArray.length; i++) {
|
|
117
|
-
var breakpoint = responsiveArray[i];
|
|
118
|
-
if (screens[breakpoint] && screenSizes[breakpoint] !== undefined) {
|
|
119
|
-
return screenSizes[breakpoint];
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
130
|
+
};
|
|
131
|
+
export default useResponsiveObserver;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var toList = function toList(candidate) {
|
|
2
2
|
var skipEmpty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3
|
-
if (skipEmpty && (candidate === undefined || candidate === null))
|
|
3
|
+
if (skipEmpty && (candidate === undefined || candidate === null)) {
|
|
4
|
+
return [];
|
|
5
|
+
}
|
|
4
6
|
return Array.isArray(candidate) ? candidate : [candidate];
|
|
5
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export default toList;
|
|
@@ -6,7 +6,6 @@ export function resetWarned() {
|
|
|
6
6
|
deprecatedWarnList = null;
|
|
7
7
|
rcResetWarned();
|
|
8
8
|
}
|
|
9
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
10
9
|
var warning = noop;
|
|
11
10
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
11
|
warning = function warning(valid, component, message) {
|
|
@@ -15,8 +15,8 @@ import * as React from 'react';
|
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import CSSMotion from 'rc-motion';
|
|
17
17
|
import raf from 'rc-util/lib/raf';
|
|
18
|
-
import { render, unmount } from 'rc-util/lib/React/render';
|
|
19
18
|
import { composeRef } from 'rc-util/lib/ref';
|
|
19
|
+
import { unstableSetRender } from '../../config-provider/UnstableContext';
|
|
20
20
|
import { TARGET_CLS } from './interface';
|
|
21
21
|
import { getTargetWaveColor } from './util';
|
|
22
22
|
function validateNum(value) {
|
|
@@ -25,8 +25,15 @@ function validateNum(value) {
|
|
|
25
25
|
var WaveEffect = function WaveEffect(props) {
|
|
26
26
|
var className = props.className,
|
|
27
27
|
target = props.target,
|
|
28
|
-
component = props.component
|
|
28
|
+
component = props.component,
|
|
29
|
+
registerUnmount = props.registerUnmount;
|
|
29
30
|
var divRef = React.useRef(null);
|
|
31
|
+
// ====================== Refs ======================
|
|
32
|
+
var unmountRef = React.useRef(null);
|
|
33
|
+
React.useEffect(function () {
|
|
34
|
+
unmountRef.current = registerUnmount();
|
|
35
|
+
}, []);
|
|
36
|
+
// ===================== Effect =====================
|
|
30
37
|
var _React$useState = React.useState(null),
|
|
31
38
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
32
39
|
color = _React$useState2[0],
|
|
@@ -44,17 +51,17 @@ var WaveEffect = function WaveEffect(props) {
|
|
|
44
51
|
top = _React$useState8[0],
|
|
45
52
|
setTop = _React$useState8[1];
|
|
46
53
|
var _React$useState9 = React.useState(0),
|
|
47
|
-
_React$
|
|
48
|
-
width = _React$
|
|
49
|
-
setWidth = _React$
|
|
50
|
-
var _React$
|
|
54
|
+
_React$useState0 = _slicedToArray(_React$useState9, 2),
|
|
55
|
+
width = _React$useState0[0],
|
|
56
|
+
setWidth = _React$useState0[1];
|
|
57
|
+
var _React$useState1 = React.useState(0),
|
|
58
|
+
_React$useState10 = _slicedToArray(_React$useState1, 2),
|
|
59
|
+
height = _React$useState10[0],
|
|
60
|
+
setHeight = _React$useState10[1];
|
|
61
|
+
var _React$useState11 = React.useState(false),
|
|
51
62
|
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _React$useState13 = React.useState(false),
|
|
55
|
-
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
56
|
-
enabled = _React$useState14[0],
|
|
57
|
-
setEnabled = _React$useState14[1];
|
|
63
|
+
enabled = _React$useState12[0],
|
|
64
|
+
setEnabled = _React$useState12[1];
|
|
58
65
|
var waveStyle = {
|
|
59
66
|
left: left,
|
|
60
67
|
top: top,
|
|
@@ -120,9 +127,9 @@ var WaveEffect = function WaveEffect(props) {
|
|
|
120
127
|
motionDeadline: 5000,
|
|
121
128
|
onAppearEnd: function onAppearEnd(_, event) {
|
|
122
129
|
if (event.deadline || event.propertyName === 'opacity') {
|
|
123
|
-
var _divRef$current;
|
|
130
|
+
var _divRef$current, _unmountRef$current;
|
|
124
131
|
var holder = (_divRef$current = divRef.current) === null || _divRef$current === void 0 ? void 0 : _divRef$current.parentElement;
|
|
125
|
-
|
|
132
|
+
(_unmountRef$current = unmountRef.current) === null || _unmountRef$current === void 0 || _unmountRef$current.call(unmountRef).then(function () {
|
|
126
133
|
holder === null || holder === void 0 || holder.remove();
|
|
127
134
|
});
|
|
128
135
|
}
|
|
@@ -153,8 +160,14 @@ var showWaveEffect = function showWaveEffect(target, info) {
|
|
|
153
160
|
holder.style.left = '0px';
|
|
154
161
|
holder.style.top = '0px';
|
|
155
162
|
target === null || target === void 0 || target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild);
|
|
156
|
-
|
|
157
|
-
|
|
163
|
+
var reactRender = unstableSetRender();
|
|
164
|
+
var unmountCallback = null;
|
|
165
|
+
function registerUnmount() {
|
|
166
|
+
return unmountCallback;
|
|
167
|
+
}
|
|
168
|
+
unmountCallback = reactRender(_jsx(WaveEffect, _objectSpread(_objectSpread({}, info), {}, {
|
|
169
|
+
target: target,
|
|
170
|
+
registerUnmount: registerUnmount
|
|
158
171
|
})), holder);
|
|
159
172
|
};
|
|
160
173
|
export default showWaveEffect;
|
|
@@ -7,7 +7,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
7
7
|
import React, { useContext, useRef } from 'react';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import isVisible from 'rc-util/lib/Dom/isVisible';
|
|
10
|
-
import { composeRef, supportRef } from 'rc-util/lib/ref';
|
|
10
|
+
import { composeRef, getNodeRef, supportRef } from 'rc-util/lib/ref';
|
|
11
11
|
import { ConfigContext } from '../../config-provider';
|
|
12
12
|
import { cloneElement } from '../reactNode';
|
|
13
13
|
import useStyle from './style';
|
|
@@ -52,7 +52,7 @@ var Wave = function Wave(props) {
|
|
|
52
52
|
if (! /*#__PURE__*/React.isValidElement(children)) {
|
|
53
53
|
return children !== null && children !== void 0 ? children : null;
|
|
54
54
|
}
|
|
55
|
-
var ref = supportRef(children) ? composeRef(children
|
|
55
|
+
var ref = supportRef(children) ? composeRef(getNodeRef(children), containerRef) : containerRef;
|
|
56
56
|
return cloneElement(children, {
|
|
57
57
|
ref: ref
|
|
58
58
|
});
|
|
@@ -35,7 +35,7 @@ var useWave = function useWave(nodeRef, className, component) {
|
|
|
35
35
|
hashId: hashId
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
|
-
var rafId = React.useRef();
|
|
38
|
+
var rafId = React.useRef(null);
|
|
39
39
|
// Merge trigger event into one for each frame
|
|
40
40
|
var showDebounceWave = function showDebounceWave(event) {
|
|
41
41
|
raf.cancel(rafId.current);
|
package/lib/Antd5/affix/index.js
CHANGED
|
@@ -1,4 +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 = ["style", "offsetTop", "offsetBottom", "prefixCls", "className", "rootClassName", "children", "target", "onChange", "onTestUpdatePosition"];
|
|
2
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; }
|
|
3
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; }
|
|
4
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; }
|
|
@@ -10,11 +11,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
10
11
|
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; }
|
|
11
12
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
13
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
17
|
import React from 'react';
|
|
15
18
|
import classNames from 'classnames';
|
|
16
19
|
import ResizeObserver from 'rc-resize-observer';
|
|
17
|
-
import omit from 'rc-util/lib/omit';
|
|
18
20
|
import throttleByAnimationFrame from '../_util/throttleByAnimationFrame';
|
|
19
21
|
import { ConfigContext } from '../config-provider';
|
|
20
22
|
import useStyle from './style';
|
|
@@ -35,7 +37,9 @@ var Affix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
35
37
|
rootClassName = props.rootClassName,
|
|
36
38
|
children = props.children,
|
|
37
39
|
target = props.target,
|
|
38
|
-
onChange = props.onChange
|
|
40
|
+
onChange = props.onChange,
|
|
41
|
+
onTestUpdatePosition = props.onTestUpdatePosition,
|
|
42
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
39
43
|
var _React$useContext = React.useContext(ConfigContext),
|
|
40
44
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
41
45
|
getTargetContainer = _React$useContext.getTargetContainer;
|
|
@@ -54,7 +58,7 @@ var Affix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
54
58
|
setPlaceholderStyle = _React$useState6[1];
|
|
55
59
|
var status = React.useRef(AFFIX_STATUS_NONE);
|
|
56
60
|
var prevTarget = React.useRef(null);
|
|
57
|
-
var prevListener = React.useRef();
|
|
61
|
+
var prevListener = React.useRef(null);
|
|
58
62
|
var placeholderNodeRef = React.useRef(null);
|
|
59
63
|
var fixedNodeRef = React.useRef(null);
|
|
60
64
|
var timer = React.useRef(null);
|
|
@@ -114,8 +118,7 @@ var Affix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
114
118
|
status.current = AFFIX_STATUS_PREPARE;
|
|
115
119
|
measure();
|
|
116
120
|
if (process.env.NODE_ENV === 'test') {
|
|
117
|
-
|
|
118
|
-
props === null || props === void 0 || (_props$onTestUpdatePo = props.onTestUpdatePosition) === null || _props$onTestUpdatePo === void 0 || _props$onTestUpdatePo.call(props);
|
|
121
|
+
onTestUpdatePosition === null || onTestUpdatePosition === void 0 || onTestUpdatePosition();
|
|
119
122
|
}
|
|
120
123
|
};
|
|
121
124
|
var updatePosition = throttleByAnimationFrame(function () {
|
|
@@ -185,7 +188,10 @@ var Affix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
185
188
|
}, []);
|
|
186
189
|
React.useEffect(function () {
|
|
187
190
|
addListeners();
|
|
188
|
-
|
|
191
|
+
return function () {
|
|
192
|
+
return removeListeners();
|
|
193
|
+
};
|
|
194
|
+
}, [target, affixStyle, lastAffix, offsetTop, offsetBottom]);
|
|
189
195
|
React.useEffect(function () {
|
|
190
196
|
updatePosition();
|
|
191
197
|
}, [target, offsetTop, offsetBottom]);
|
|
@@ -196,17 +202,13 @@ var Affix = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
196
202
|
cssVarCls = _useStyle2[2];
|
|
197
203
|
var rootCls = classNames(rootClassName, hashId, affixPrefixCls, cssVarCls);
|
|
198
204
|
var mergedCls = classNames(_defineProperty({}, rootCls, affixStyle));
|
|
199
|
-
var otherProps = omit(props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange', 'rootClassName']);
|
|
200
|
-
if (process.env.NODE_ENV === 'test') {
|
|
201
|
-
otherProps = omit(otherProps, ['onTestUpdatePosition']);
|
|
202
|
-
}
|
|
203
205
|
return wrapCSSVar(_jsx(ResizeObserver, {
|
|
204
206
|
onResize: updatePosition,
|
|
205
207
|
children: _jsxs("div", _objectSpread(_objectSpread({
|
|
206
208
|
style: style,
|
|
207
209
|
className: className,
|
|
208
210
|
ref: placeholderNodeRef
|
|
209
|
-
},
|
|
211
|
+
}, restProps), {}, {
|
|
210
212
|
children: [affixStyle && _jsx("div", {
|
|
211
213
|
style: placeholderStyle,
|
|
212
214
|
"aria-hidden": "true"
|