@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,10 +1,13 @@
|
|
|
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
|
+
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
|
+
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; }
|
|
2
4
|
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; }
|
|
3
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
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); }
|
|
5
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
8
|
import * as React from 'react';
|
|
7
9
|
import classNames from 'classnames';
|
|
10
|
+
import DescriptionsContext from './DescriptionsContext';
|
|
8
11
|
function notEmpty(val) {
|
|
9
12
|
return val !== undefined && val !== null;
|
|
10
13
|
}
|
|
@@ -20,18 +23,21 @@ var Cell = function Cell(props) {
|
|
|
20
23
|
label = props.label,
|
|
21
24
|
content = props.content,
|
|
22
25
|
colon = props.colon,
|
|
23
|
-
type = props.type
|
|
26
|
+
type = props.type,
|
|
27
|
+
styles = props.styles;
|
|
24
28
|
var Component = component;
|
|
29
|
+
var descContext = React.useContext(DescriptionsContext);
|
|
30
|
+
var descriptionsClassNames = descContext.classNames;
|
|
25
31
|
if (bordered) {
|
|
26
32
|
return _jsxs(Component, {
|
|
27
|
-
className: classNames(_defineProperty(_defineProperty({}, "".concat(itemPrefixCls, "-item-label"), type === 'label'), "".concat(itemPrefixCls, "-item-content"), type === 'content'), className),
|
|
33
|
+
className: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(itemPrefixCls, "-item-label"), type === 'label'), "".concat(itemPrefixCls, "-item-content"), type === 'content'), "".concat(descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label), type === 'label'), "".concat(descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content), type === 'content'), className),
|
|
28
34
|
style: style,
|
|
29
35
|
colSpan: span,
|
|
30
36
|
children: [notEmpty(label) && _jsx("span", {
|
|
31
|
-
style: labelStyle,
|
|
37
|
+
style: _objectSpread(_objectSpread({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
|
32
38
|
children: label
|
|
33
39
|
}), notEmpty(content) && _jsx("span", {
|
|
34
|
-
style:
|
|
40
|
+
style: _objectSpread(_objectSpread({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.content),
|
|
35
41
|
children: content
|
|
36
42
|
})]
|
|
37
43
|
});
|
|
@@ -43,12 +49,12 @@ var Cell = function Cell(props) {
|
|
|
43
49
|
children: _jsxs("div", {
|
|
44
50
|
className: "".concat(itemPrefixCls, "-item-container"),
|
|
45
51
|
children: [(label || label === 0) && _jsx("span", {
|
|
46
|
-
className: classNames("".concat(itemPrefixCls, "-item-label"), _defineProperty({}, "".concat(itemPrefixCls, "-item-no-colon"), !colon)),
|
|
47
|
-
style: labelStyle,
|
|
52
|
+
className: classNames("".concat(itemPrefixCls, "-item-label"), descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label, _defineProperty({}, "".concat(itemPrefixCls, "-item-no-colon"), !colon)),
|
|
53
|
+
style: _objectSpread(_objectSpread({}, labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
|
48
54
|
children: label
|
|
49
55
|
}), (content || content === 0) && _jsx("span", {
|
|
50
|
-
className: classNames("".concat(itemPrefixCls, "-item-content")),
|
|
51
|
-
style: contentStyle,
|
|
56
|
+
className: classNames("".concat(itemPrefixCls, "-item-content"), descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content),
|
|
57
|
+
style: _objectSpread(_objectSpread({}, contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
|
|
52
58
|
children: content
|
|
53
59
|
})]
|
|
54
60
|
})
|
|
@@ -17,7 +17,8 @@ function renderCells(items, _ref, _ref2) {
|
|
|
17
17
|
showLabel = _ref2.showLabel,
|
|
18
18
|
showContent = _ref2.showContent,
|
|
19
19
|
rootLabelStyle = _ref2.labelStyle,
|
|
20
|
-
rootContentStyle = _ref2.contentStyle
|
|
20
|
+
rootContentStyle = _ref2.contentStyle,
|
|
21
|
+
rootStyles = _ref2.styles;
|
|
21
22
|
return items.map(function (_ref3, index) {
|
|
22
23
|
var label = _ref3.label,
|
|
23
24
|
children = _ref3.children,
|
|
@@ -29,13 +30,16 @@ function renderCells(items, _ref, _ref2) {
|
|
|
29
30
|
contentStyle = _ref3.contentStyle,
|
|
30
31
|
_ref3$span = _ref3.span,
|
|
31
32
|
span = _ref3$span === void 0 ? 1 : _ref3$span,
|
|
32
|
-
key = _ref3.key
|
|
33
|
+
key = _ref3.key,
|
|
34
|
+
styles = _ref3.styles;
|
|
33
35
|
if (typeof component === 'string') {
|
|
34
36
|
return _jsx(Cell, {
|
|
35
37
|
className: className,
|
|
36
38
|
style: style,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
styles: {
|
|
40
|
+
label: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
|
41
|
+
content: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content)
|
|
42
|
+
},
|
|
39
43
|
span: span,
|
|
40
44
|
colon: colon,
|
|
41
45
|
component: component,
|
|
@@ -48,7 +52,7 @@ function renderCells(items, _ref, _ref2) {
|
|
|
48
52
|
}
|
|
49
53
|
return [_jsx(Cell, {
|
|
50
54
|
className: className,
|
|
51
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, rootLabelStyle), style), labelStyle),
|
|
55
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rootLabelStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.label), style), labelStyle), styles === null || styles === void 0 ? void 0 : styles.label),
|
|
52
56
|
span: 1,
|
|
53
57
|
colon: colon,
|
|
54
58
|
component: component[0],
|
|
@@ -58,7 +62,7 @@ function renderCells(items, _ref, _ref2) {
|
|
|
58
62
|
type: "label"
|
|
59
63
|
}, "label-".concat(key || index)), _jsx(Cell, {
|
|
60
64
|
className: className,
|
|
61
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, rootContentStyle), style), contentStyle),
|
|
65
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rootContentStyle), rootStyles === null || rootStyles === void 0 ? void 0 : rootStyles.content), style), contentStyle), styles === null || styles === void 0 ? void 0 : styles.content),
|
|
62
66
|
span: span * 2 - 1,
|
|
63
67
|
component: component[1],
|
|
64
68
|
itemPrefixCls: itemPrefixCls,
|
|
@@ -63,7 +63,7 @@ function getCalcRows(rowItems, mergedColumn) {
|
|
|
63
63
|
if (count < mergedColumn) {
|
|
64
64
|
// If the span of the last element in the current row is less than the column, then add its span to the remaining columns
|
|
65
65
|
var last = rows[rows.length - 1];
|
|
66
|
-
last.span = mergedColumn - count
|
|
66
|
+
last.span = mergedColumn - (count - (last.span || 1));
|
|
67
67
|
return rows;
|
|
68
68
|
}
|
|
69
69
|
return rows;
|
|
@@ -1,16 +1,16 @@
|
|
|
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", "title", "extra", "column", "colon", "bordered", "layout", "children", "className", "rootClassName", "style", "size", "labelStyle", "contentStyle", "items"];
|
|
2
|
+
var _excluded = ["prefixCls", "title", "extra", "column", "colon", "bordered", "layout", "children", "className", "rootClassName", "style", "size", "labelStyle", "contentStyle", "styles", "items", "classNames"];
|
|
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
|
+
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
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
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); }
|
|
3
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
9
|
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."); }
|
|
5
10
|
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; } }
|
|
6
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; }
|
|
7
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; } }
|
|
8
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
-
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); }
|
|
14
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
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; }
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -18,7 +18,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
20
|
import { matchScreen } from '../_util/responsiveObserver';
|
|
21
|
-
import {
|
|
21
|
+
import { devUseWarning } from '../_util/warning';
|
|
22
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
22
23
|
import useSize from '../config-provider/hooks/useSize';
|
|
23
24
|
import useBreakpoint from '../grid/hooks/useBreakpoint';
|
|
24
25
|
import DEFAULT_COLUMN_MAP from './constant';
|
|
@@ -44,14 +45,29 @@ var Descriptions = function Descriptions(props) {
|
|
|
44
45
|
customizeSize = props.size,
|
|
45
46
|
labelStyle = props.labelStyle,
|
|
46
47
|
contentStyle = props.contentStyle,
|
|
48
|
+
styles = props.styles,
|
|
47
49
|
items = props.items,
|
|
50
|
+
descriptionsClassNames = props.classNames,
|
|
48
51
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
49
|
-
var
|
|
50
|
-
getPrefixCls =
|
|
51
|
-
direction =
|
|
52
|
-
|
|
52
|
+
var _useComponentConfig = useComponentConfig('descriptions'),
|
|
53
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
54
|
+
direction = _useComponentConfig.direction,
|
|
55
|
+
contextClassName = _useComponentConfig.className,
|
|
56
|
+
contextStyle = _useComponentConfig.style,
|
|
57
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
58
|
+
contextStyles = _useComponentConfig.styles;
|
|
53
59
|
var prefixCls = getPrefixCls('descriptions', customizePrefixCls);
|
|
54
60
|
var screens = useBreakpoint();
|
|
61
|
+
// ============================== Warn ==============================
|
|
62
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
63
|
+
var warning = devUseWarning('Descriptions');
|
|
64
|
+
[['labelStyle', 'styles={{ label: {} }}'], ['contentStyle', 'styles={{ content: {} }}']].forEach(function (_ref) {
|
|
65
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
66
|
+
deprecatedName = _ref2[0],
|
|
67
|
+
newName = _ref2[1];
|
|
68
|
+
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
55
71
|
// Column count
|
|
56
72
|
var mergedColumn = React.useMemo(function () {
|
|
57
73
|
var _matchScreen;
|
|
@@ -73,22 +89,33 @@ var Descriptions = function Descriptions(props) {
|
|
|
73
89
|
var contextValue = React.useMemo(function () {
|
|
74
90
|
return {
|
|
75
91
|
labelStyle: labelStyle,
|
|
76
|
-
contentStyle: contentStyle
|
|
92
|
+
contentStyle: contentStyle,
|
|
93
|
+
styles: {
|
|
94
|
+
content: _objectSpread(_objectSpread({}, contextStyles.content), styles === null || styles === void 0 ? void 0 : styles.content),
|
|
95
|
+
label: _objectSpread(_objectSpread({}, contextStyles.label), styles === null || styles === void 0 ? void 0 : styles.label)
|
|
96
|
+
},
|
|
97
|
+
classNames: {
|
|
98
|
+
label: classNames(contextClassNames.label, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.label),
|
|
99
|
+
content: classNames(contextClassNames.content, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.content)
|
|
100
|
+
}
|
|
77
101
|
};
|
|
78
|
-
}, [labelStyle, contentStyle]);
|
|
102
|
+
}, [labelStyle, contentStyle, styles, descriptionsClassNames, contextClassNames, contextStyles]);
|
|
79
103
|
return wrapCSSVar(_jsx(DescriptionsContext.Provider, {
|
|
80
104
|
value: contextValue,
|
|
81
105
|
children: _jsxs("div", _objectSpread(_objectSpread({
|
|
82
|
-
className: classNames(prefixCls,
|
|
83
|
-
style: _objectSpread(_objectSpread({},
|
|
106
|
+
className: classNames(prefixCls, contextClassName, contextClassNames.root, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.root, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(mergedSize), mergedSize && mergedSize !== 'default'), "".concat(prefixCls, "-bordered"), !!bordered), "".concat(prefixCls, "-rtl"), direction === 'rtl'), className, rootClassName, hashId, cssVarCls),
|
|
107
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, contextStyle), contextStyles.root), styles === null || styles === void 0 ? void 0 : styles.root), style)
|
|
84
108
|
}, restProps), {}, {
|
|
85
109
|
children: [(title || extra) && _jsxs("div", {
|
|
86
|
-
className: "".concat(prefixCls, "-header"),
|
|
110
|
+
className: classNames("".concat(prefixCls, "-header"), contextClassNames.header, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.header),
|
|
111
|
+
style: _objectSpread(_objectSpread({}, contextStyles.header), styles === null || styles === void 0 ? void 0 : styles.header),
|
|
87
112
|
children: [title && _jsx("div", {
|
|
88
|
-
className: "".concat(prefixCls, "-title"),
|
|
113
|
+
className: classNames("".concat(prefixCls, "-title"), contextClassNames.title, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.title),
|
|
114
|
+
style: _objectSpread(_objectSpread({}, contextStyles.title), styles === null || styles === void 0 ? void 0 : styles.title),
|
|
89
115
|
children: title
|
|
90
116
|
}), extra && _jsx("div", {
|
|
91
|
-
className: "".concat(prefixCls, "-extra"),
|
|
117
|
+
className: classNames("".concat(prefixCls, "-extra"), contextClassNames.extra, descriptionsClassNames === null || descriptionsClassNames === void 0 ? void 0 : descriptionsClassNames.extra),
|
|
118
|
+
style: _objectSpread(_objectSpread({}, contextStyles.extra), styles === null || styles === void 0 ? void 0 : styles.extra),
|
|
92
119
|
children: extra
|
|
93
120
|
})]
|
|
94
121
|
}), _jsx("div", {
|
|
@@ -17,8 +17,16 @@ var genBorderedStyle = function genBorderedStyle(token) {
|
|
|
17
17
|
}
|
|
18
18
|
}, "".concat(componentCls, "-row"), _defineProperty(_defineProperty({
|
|
19
19
|
borderBottom: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit),
|
|
20
|
+
'&:first-child': {
|
|
21
|
+
'> th:first-child, > td:first-child': {
|
|
22
|
+
borderStartStartRadius: token.borderRadiusLG
|
|
23
|
+
}
|
|
24
|
+
},
|
|
20
25
|
'&:last-child': {
|
|
21
|
-
borderBottom: 'none'
|
|
26
|
+
borderBottom: 'none',
|
|
27
|
+
'> th:first-child, > td:first-child': {
|
|
28
|
+
borderEndStartRadius: token.borderRadiusLG
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
31
|
}, "> ".concat(componentCls, "-item-label, > ").concat(componentCls, "-item-content"), {
|
|
24
32
|
padding: "".concat(unit(token.padding), " ").concat(unit(token.paddingLG)),
|
|
@@ -88,7 +96,7 @@ var genDescriptionStyles = function genDescriptionStyles(token) {
|
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
98
|
}), "".concat(componentCls, "-item-label"), _defineProperty({
|
|
91
|
-
color: token.
|
|
99
|
+
color: token.labelColor,
|
|
92
100
|
fontWeight: 'normal',
|
|
93
101
|
fontSize: token.fontSize,
|
|
94
102
|
lineHeight: token.lineHeight,
|
|
@@ -141,6 +149,7 @@ var genDescriptionStyles = function genDescriptionStyles(token) {
|
|
|
141
149
|
export var prepareComponentToken = function prepareComponentToken(token) {
|
|
142
150
|
return {
|
|
143
151
|
labelBg: token.colorFillAlter,
|
|
152
|
+
labelColor: token.colorTextTertiary,
|
|
144
153
|
titleColor: token.colorText,
|
|
145
154
|
titleMarginBottom: token.fontSizeSM * token.lineHeightSM,
|
|
146
155
|
itemPaddingBottom: token.padding,
|
|
@@ -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", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "variant", "plain", "style"];
|
|
2
|
+
var _excluded = ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "variant", "plain", "style", "size"];
|
|
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; }
|
|
@@ -17,13 +17,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { devUseWarning } from '../_util/warning';
|
|
20
|
-
import {
|
|
20
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
21
|
+
import useSize from '../config-provider/hooks/useSize';
|
|
21
22
|
import useStyle from './style';
|
|
23
|
+
var sizeClassNameMap = {
|
|
24
|
+
small: 'sm',
|
|
25
|
+
middle: 'md'
|
|
26
|
+
};
|
|
22
27
|
var Divider = function Divider(props) {
|
|
23
|
-
var
|
|
24
|
-
getPrefixCls =
|
|
25
|
-
direction =
|
|
26
|
-
|
|
28
|
+
var _useComponentConfig = useComponentConfig('divider'),
|
|
29
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
30
|
+
direction = _useComponentConfig.direction,
|
|
31
|
+
dividerClassName = _useComponentConfig.className,
|
|
32
|
+
dividerStyle = _useComponentConfig.style;
|
|
27
33
|
var customizePrefixCls = props.prefixCls,
|
|
28
34
|
_props$type = props.type,
|
|
29
35
|
type = _props$type === void 0 ? 'horizontal' : _props$type,
|
|
@@ -38,6 +44,7 @@ var Divider = function Divider(props) {
|
|
|
38
44
|
variant = _props$variant === void 0 ? 'solid' : _props$variant,
|
|
39
45
|
plain = props.plain,
|
|
40
46
|
style = props.style,
|
|
47
|
+
customSize = props.size,
|
|
41
48
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
42
49
|
var prefixCls = getPrefixCls('divider', customizePrefixCls);
|
|
43
50
|
var _useStyle = useStyle(prefixCls),
|
|
@@ -45,10 +52,21 @@ var Divider = function Divider(props) {
|
|
|
45
52
|
wrapCSSVar = _useStyle2[0],
|
|
46
53
|
hashId = _useStyle2[1],
|
|
47
54
|
cssVarCls = _useStyle2[2];
|
|
55
|
+
var sizeFullName = useSize(customSize);
|
|
56
|
+
var sizeCls = sizeClassNameMap[sizeFullName];
|
|
48
57
|
var hasChildren = !!children;
|
|
49
|
-
var
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
var mergedOrientation = React.useMemo(function () {
|
|
59
|
+
if (orientation === 'left') {
|
|
60
|
+
return direction === 'rtl' ? 'end' : 'start';
|
|
61
|
+
}
|
|
62
|
+
if (orientation === 'right') {
|
|
63
|
+
return direction === 'rtl' ? 'start' : 'end';
|
|
64
|
+
}
|
|
65
|
+
return orientation;
|
|
66
|
+
}, [direction, orientation]);
|
|
67
|
+
var hasMarginStart = mergedOrientation === 'start' && orientationMargin != null;
|
|
68
|
+
var hasMarginEnd = mergedOrientation === 'end' && orientationMargin != null;
|
|
69
|
+
var classString = classNames(prefixCls, dividerClassName, hashId, cssVarCls, "".concat(prefixCls, "-").concat(type), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-with-text"), hasChildren), "".concat(prefixCls, "-with-text-").concat(mergedOrientation), hasChildren), "".concat(prefixCls, "-dashed"), !!dashed), "".concat(prefixCls, "-").concat(variant), variant !== 'solid'), "".concat(prefixCls, "-plain"), !!plain), "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-no-default-orientation-margin-start"), hasMarginStart), "".concat(prefixCls, "-no-default-orientation-margin-end"), hasMarginEnd), "".concat(prefixCls, "-").concat(sizeCls), !!sizeCls), className, rootClassName);
|
|
52
70
|
var memoizedOrientationMargin = React.useMemo(function () {
|
|
53
71
|
if (typeof orientationMargin === 'number') {
|
|
54
72
|
return orientationMargin;
|
|
@@ -58,11 +76,10 @@ var Divider = function Divider(props) {
|
|
|
58
76
|
}
|
|
59
77
|
return orientationMargin;
|
|
60
78
|
}, [orientationMargin]);
|
|
61
|
-
var innerStyle =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
79
|
+
var innerStyle = {
|
|
80
|
+
marginInlineStart: hasMarginStart ? memoizedOrientationMargin : undefined,
|
|
81
|
+
marginInlineEnd: hasMarginEnd ? memoizedOrientationMargin : undefined
|
|
82
|
+
};
|
|
66
83
|
// Warning children not work in vertical mode
|
|
67
84
|
if (process.env.NODE_ENV !== 'production') {
|
|
68
85
|
var warning = devUseWarning('Divider');
|
|
@@ -70,7 +87,7 @@ var Divider = function Divider(props) {
|
|
|
70
87
|
}
|
|
71
88
|
return wrapCSSVar(_jsx("div", _objectSpread(_objectSpread({
|
|
72
89
|
className: classString,
|
|
73
|
-
style: _objectSpread(_objectSpread({},
|
|
90
|
+
style: _objectSpread(_objectSpread({}, dividerStyle), style)
|
|
74
91
|
}, restProps), {}, {
|
|
75
92
|
role: "separator",
|
|
76
93
|
children: children && type !== 'vertical' && _jsx("span", {
|
|
@@ -7,6 +7,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { unit } from '@ant-design/cssinjs';
|
|
8
8
|
import { resetComponent } from '../../style';
|
|
9
9
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
10
|
+
// ============================== Size ================================
|
|
11
|
+
var genSizeDividerStyle = function genSizeDividerStyle(token) {
|
|
12
|
+
var componentCls = token.componentCls;
|
|
13
|
+
return _defineProperty({}, componentCls, {
|
|
14
|
+
'&-horizontal': _defineProperty({}, "&".concat(componentCls), {
|
|
15
|
+
'&-sm': {
|
|
16
|
+
marginBlock: token.marginXS
|
|
17
|
+
},
|
|
18
|
+
'&-md': {
|
|
19
|
+
marginBlock: token.margin
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
10
24
|
// ============================== Shared ==============================
|
|
11
25
|
var genSharedDividerStyle = function genSharedDividerStyle(token) {
|
|
12
26
|
var _objectSpread2;
|
|
@@ -37,7 +51,7 @@ var genSharedDividerStyle = function genSharedDividerStyle(token) {
|
|
|
37
51
|
width: '100%',
|
|
38
52
|
minWidth: '100%',
|
|
39
53
|
// Fix https://github.com/ant-design/ant-design/issues/10914
|
|
40
|
-
margin: "".concat(unit(token.
|
|
54
|
+
margin: "".concat(unit(token.marginLG), " 0")
|
|
41
55
|
}
|
|
42
56
|
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_objectSpread2, "&-horizontal".concat(componentCls, "-with-text"), {
|
|
43
57
|
display: 'flex',
|
|
@@ -59,14 +73,14 @@ var genSharedDividerStyle = function genSharedDividerStyle(token) {
|
|
|
59
73
|
transform: 'translateY(50%)',
|
|
60
74
|
content: "''"
|
|
61
75
|
}
|
|
62
|
-
}), "&-horizontal".concat(componentCls, "-with-text-
|
|
76
|
+
}), "&-horizontal".concat(componentCls, "-with-text-start"), {
|
|
63
77
|
'&::before': {
|
|
64
78
|
width: "calc(".concat(orientationMargin, " * 100%)")
|
|
65
79
|
},
|
|
66
80
|
'&::after': {
|
|
67
81
|
width: "calc(100% - ".concat(orientationMargin, " * 100%)")
|
|
68
82
|
}
|
|
69
|
-
}), "&-horizontal".concat(componentCls, "-with-text-
|
|
83
|
+
}), "&-horizontal".concat(componentCls, "-with-text-end"), {
|
|
70
84
|
'&::before': {
|
|
71
85
|
width: "calc(100% - ".concat(orientationMargin, " * 100%)")
|
|
72
86
|
},
|
|
@@ -109,7 +123,7 @@ var genSharedDividerStyle = function genSharedDividerStyle(token) {
|
|
|
109
123
|
color: token.colorText,
|
|
110
124
|
fontWeight: 'normal',
|
|
111
125
|
fontSize: token.fontSize
|
|
112
|
-
}), "&-horizontal".concat(componentCls, "-with-text-
|
|
126
|
+
}), "&-horizontal".concat(componentCls, "-with-text-start").concat(componentCls, "-no-default-orientation-margin-start"), _defineProperty({
|
|
113
127
|
'&::before': {
|
|
114
128
|
width: 0
|
|
115
129
|
},
|
|
@@ -118,7 +132,7 @@ var genSharedDividerStyle = function genSharedDividerStyle(token) {
|
|
|
118
132
|
}
|
|
119
133
|
}, "".concat(componentCls, "-inner-text"), {
|
|
120
134
|
paddingInlineStart: sizePaddingEdgeHorizontal
|
|
121
|
-
})), "&-horizontal".concat(componentCls, "-with-text-
|
|
135
|
+
})), "&-horizontal".concat(componentCls, "-with-text-end").concat(componentCls, "-no-default-orientation-margin-end"), _defineProperty({
|
|
122
136
|
'&::before': {
|
|
123
137
|
width: '100%'
|
|
124
138
|
},
|
|
@@ -140,10 +154,9 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
140
154
|
export default genStyleHooks('Divider', function (token) {
|
|
141
155
|
var dividerToken = mergeToken(token, {
|
|
142
156
|
dividerHorizontalWithTextGutterMargin: token.margin,
|
|
143
|
-
dividerHorizontalGutterMargin: token.marginLG,
|
|
144
157
|
sizePaddingEdgeHorizontal: 0
|
|
145
158
|
});
|
|
146
|
-
return [genSharedDividerStyle(dividerToken)];
|
|
159
|
+
return [genSharedDividerStyle(dividerToken), genSizeDividerStyle(dividerToken)];
|
|
147
160
|
}, prepareComponentToken, {
|
|
148
161
|
unitless: {
|
|
149
162
|
orientationMargin: true
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import useClosable, { pickClosable } from '../_util/hooks/useClosable';
|
|
17
|
-
import {
|
|
17
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
18
18
|
import Skeleton from '../skeleton';
|
|
19
19
|
var DrawerPanel = function DrawerPanel(props) {
|
|
20
20
|
var _drawerContext$classN3, _drawerContext$styles3;
|
|
@@ -30,13 +30,11 @@ var DrawerPanel = function DrawerPanel(props) {
|
|
|
30
30
|
children = props.children,
|
|
31
31
|
drawerClassNames = props.classNames,
|
|
32
32
|
drawerStyles = props.styles;
|
|
33
|
-
var
|
|
34
|
-
drawerContext = _React$useContext.drawer;
|
|
33
|
+
var drawerContext = useComponentConfig('drawer');
|
|
35
34
|
var customCloseIconRender = React.useCallback(function (icon) {
|
|
36
35
|
return _jsx("button", {
|
|
37
36
|
type: "button",
|
|
38
37
|
onClick: onClose,
|
|
39
|
-
"aria-label": "Close",
|
|
40
38
|
className: "".concat(prefixCls, "-close"),
|
|
41
39
|
children: icon
|
|
42
40
|
});
|
|
@@ -54,8 +52,8 @@ var DrawerPanel = function DrawerPanel(props) {
|
|
|
54
52
|
return null;
|
|
55
53
|
}
|
|
56
54
|
return _jsxs("div", {
|
|
57
|
-
style: _objectSpread(_objectSpread(_objectSpread({},
|
|
58
|
-
className: classNames("".concat(prefixCls, "-header"), _defineProperty({}, "".concat(prefixCls, "-header-close-only"), mergedClosable && !title && !extra),
|
|
55
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, (_drawerContext$styles = drawerContext.styles) === null || _drawerContext$styles === void 0 ? void 0 : _drawerContext$styles.header), headerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.header),
|
|
56
|
+
className: classNames("".concat(prefixCls, "-header"), _defineProperty({}, "".concat(prefixCls, "-header-close-only"), mergedClosable && !title && !extra), (_drawerContext$classN = drawerContext.classNames) === null || _drawerContext$classN === void 0 ? void 0 : _drawerContext$classN.header, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.header),
|
|
59
57
|
children: [_jsxs("div", {
|
|
60
58
|
className: "".concat(prefixCls, "-header-title"),
|
|
61
59
|
children: [mergedCloseIcon, title && _jsx("div", {
|
|
@@ -75,15 +73,15 @@ var DrawerPanel = function DrawerPanel(props) {
|
|
|
75
73
|
}
|
|
76
74
|
var footerClassName = "".concat(prefixCls, "-footer");
|
|
77
75
|
return _jsx("div", {
|
|
78
|
-
className: classNames(footerClassName,
|
|
79
|
-
style: _objectSpread(_objectSpread(_objectSpread({},
|
|
76
|
+
className: classNames(footerClassName, (_drawerContext$classN2 = drawerContext.classNames) === null || _drawerContext$classN2 === void 0 ? void 0 : _drawerContext$classN2.footer, drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.footer),
|
|
77
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, (_drawerContext$styles2 = drawerContext.styles) === null || _drawerContext$styles2 === void 0 ? void 0 : _drawerContext$styles2.footer), footerStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.footer),
|
|
80
78
|
children: footer
|
|
81
79
|
});
|
|
82
80
|
}, [footer, footerStyle, prefixCls]);
|
|
83
81
|
return _jsxs(_Fragment, {
|
|
84
82
|
children: [headerNode, _jsx("div", {
|
|
85
|
-
className: classNames("".concat(prefixCls, "-body"), drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.body,
|
|
86
|
-
style: _objectSpread(_objectSpread(_objectSpread({},
|
|
83
|
+
className: classNames("".concat(prefixCls, "-body"), drawerClassNames === null || drawerClassNames === void 0 ? void 0 : drawerClassNames.body, (_drawerContext$classN3 = drawerContext.classNames) === null || _drawerContext$classN3 === void 0 ? void 0 : _drawerContext$classN3.body),
|
|
84
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, (_drawerContext$styles3 = drawerContext.styles) === null || _drawerContext$styles3 === void 0 ? void 0 : _drawerContext$styles3.body), bodyStyle), drawerStyles === null || drawerStyles === void 0 ? void 0 : drawerStyles.body),
|
|
87
85
|
children: loading ? _jsx(Skeleton, {
|
|
88
86
|
active: true,
|
|
89
87
|
title: false,
|
|
@@ -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 = ["rootClassName", "width", "height", "size", "mask", "push", "open", "afterOpenChange", "onClose", "prefixCls", "getContainer", "style", "className", "visible", "afterVisibleChange", "maskStyle", "drawerStyle", "contentWrapperStyle"],
|
|
2
|
+
var _excluded = ["rootClassName", "width", "height", "size", "mask", "push", "open", "afterOpenChange", "onClose", "prefixCls", "getContainer", "style", "className", "visible", "afterVisibleChange", "maskStyle", "drawerStyle", "contentWrapperStyle", "destroyOnClose", "destroyOnHidden"],
|
|
3
3
|
_excluded2 = ["prefixCls", "style", "className", "placement"];
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -24,6 +24,7 @@ import { getTransitionName } from '../_util/motion';
|
|
|
24
24
|
import { devUseWarning } from '../_util/warning';
|
|
25
25
|
import zIndexContext from '../_util/zindexContext';
|
|
26
26
|
import { ConfigContext } from '../config-provider';
|
|
27
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
27
28
|
import { usePanelRef } from '../watermark/context';
|
|
28
29
|
import DrawerPanel from './DrawerPanel';
|
|
29
30
|
import useStyle from './style';
|
|
@@ -53,12 +54,17 @@ var Drawer = function Drawer(props) {
|
|
|
53
54
|
maskStyle = props.maskStyle,
|
|
54
55
|
drawerStyle = props.drawerStyle,
|
|
55
56
|
contentWrapperStyle = props.contentWrapperStyle,
|
|
57
|
+
destroyOnClose = props.destroyOnClose,
|
|
58
|
+
destroyOnHidden = props.destroyOnHidden,
|
|
56
59
|
rest = _objectWithoutProperties(props, _excluded);
|
|
57
|
-
var
|
|
58
|
-
getPopupContainer =
|
|
59
|
-
getPrefixCls =
|
|
60
|
-
direction =
|
|
61
|
-
|
|
60
|
+
var _useComponentConfig = useComponentConfig('drawer'),
|
|
61
|
+
getPopupContainer = _useComponentConfig.getPopupContainer,
|
|
62
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
63
|
+
direction = _useComponentConfig.direction,
|
|
64
|
+
contextClassName = _useComponentConfig.className,
|
|
65
|
+
contextStyle = _useComponentConfig.style,
|
|
66
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
67
|
+
contextStyles = _useComponentConfig.styles;
|
|
62
68
|
var prefixCls = getPrefixCls('drawer', customizePrefixCls);
|
|
63
69
|
var _useStyle = useStyle(prefixCls),
|
|
64
70
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -77,7 +83,7 @@ var Drawer = function Drawer(props) {
|
|
|
77
83
|
if (process.env.NODE_ENV !== 'production') {
|
|
78
84
|
var _props$style;
|
|
79
85
|
var warning = devUseWarning('Drawer');
|
|
80
|
-
[['visible', 'open'], ['afterVisibleChange', 'afterOpenChange'], ['headerStyle', 'styles.header'], ['bodyStyle', 'styles.body'], ['footerStyle', 'styles.footer'], ['contentWrapperStyle', 'styles.wrapper'], ['maskStyle', 'styles.mask'], ['drawerStyle', 'styles.content']].forEach(function (_ref) {
|
|
86
|
+
[['visible', 'open'], ['afterVisibleChange', 'afterOpenChange'], ['headerStyle', 'styles.header'], ['bodyStyle', 'styles.body'], ['footerStyle', 'styles.footer'], ['contentWrapperStyle', 'styles.wrapper'], ['maskStyle', 'styles.mask'], ['drawerStyle', 'styles.content'], ['destroyInactivePanel', 'destroyOnHidden']].forEach(function (_ref) {
|
|
81
87
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
82
88
|
deprecatedName = _ref2[0],
|
|
83
89
|
newName = _ref2[1];
|
|
@@ -112,7 +118,7 @@ var Drawer = function Drawer(props) {
|
|
|
112
118
|
};
|
|
113
119
|
};
|
|
114
120
|
// ============================ Refs ============================
|
|
115
|
-
// Select `ant-
|
|
121
|
+
// Select `ant-drawer-content` by `panelRef`
|
|
116
122
|
var panelRef = usePanelRef();
|
|
117
123
|
// ============================ zIndex ============================
|
|
118
124
|
var _useZIndex = useZIndex('Drawer', rest.zIndex),
|
|
@@ -124,11 +130,6 @@ var Drawer = function Drawer(props) {
|
|
|
124
130
|
propClassNames = _rest$classNames === void 0 ? {} : _rest$classNames,
|
|
125
131
|
_rest$styles = rest.styles,
|
|
126
132
|
propStyles = _rest$styles === void 0 ? {} : _rest$styles;
|
|
127
|
-
var _ref3 = drawer || {},
|
|
128
|
-
_ref3$classNames = _ref3.classNames,
|
|
129
|
-
contextClassNames = _ref3$classNames === void 0 ? {} : _ref3$classNames,
|
|
130
|
-
_ref3$styles = _ref3.styles,
|
|
131
|
-
contextStyles = _ref3$styles === void 0 ? {} : _ref3$styles;
|
|
132
133
|
return wrapCSSVar(_jsx(ContextIsolator, {
|
|
133
134
|
form: true,
|
|
134
135
|
space: true,
|
|
@@ -155,13 +156,15 @@ var Drawer = function Drawer(props) {
|
|
|
155
156
|
push: push,
|
|
156
157
|
width: mergedWidth,
|
|
157
158
|
height: mergedHeight,
|
|
158
|
-
style: _objectSpread(_objectSpread({},
|
|
159
|
-
className: classNames(
|
|
159
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style),
|
|
160
|
+
className: classNames(contextClassName, className),
|
|
160
161
|
rootClassName: drawerClassName,
|
|
161
162
|
getContainer: getContainer,
|
|
162
163
|
afterOpenChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
|
|
163
164
|
panelRef: panelRef,
|
|
164
165
|
zIndex: zIndex,
|
|
166
|
+
// TODO: In the future, destroyOnClose in rc-drawer needs to be upgrade to destroyOnHidden
|
|
167
|
+
destroyOnClose: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyOnClose,
|
|
165
168
|
children: _jsx(DrawerPanel, _objectSpread(_objectSpread({
|
|
166
169
|
prefixCls: prefixCls
|
|
167
170
|
}, rest), {}, {
|
|
@@ -179,8 +182,8 @@ var PurePanel = function PurePanel(props) {
|
|
|
179
182
|
_props$placement = props.placement,
|
|
180
183
|
placement = _props$placement === void 0 ? 'right' : _props$placement,
|
|
181
184
|
restProps = _objectWithoutProperties(props, _excluded2);
|
|
182
|
-
var _React$
|
|
183
|
-
getPrefixCls = _React$
|
|
185
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
186
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
184
187
|
var prefixCls = getPrefixCls('drawer', customizePrefixCls);
|
|
185
188
|
var _useStyle3 = useStyle(prefixCls),
|
|
186
189
|
_useStyle4 = _slicedToArray(_useStyle3, 3),
|