@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
|
@@ -135,13 +135,14 @@ export var genBorderlessStyle = function genBorderlessStyle(token, extraStyles)
|
|
|
135
135
|
};
|
|
136
136
|
/* ============== Filled ============== */
|
|
137
137
|
var genBaseFilledStyle = function genBaseFilledStyle(token, options) {
|
|
138
|
+
var _options$inputColor;
|
|
138
139
|
return {
|
|
139
140
|
background: options.bg,
|
|
140
141
|
borderWidth: token.lineWidth,
|
|
141
142
|
borderStyle: token.lineType,
|
|
142
143
|
borderColor: 'transparent',
|
|
143
144
|
'input&, & input, textarea&, & textarea': {
|
|
144
|
-
color: options === null || options === void 0 ? void 0 : options.inputColor
|
|
145
|
+
color: (_options$inputColor = options === null || options === void 0 ? void 0 : options.inputColor) !== null && _options$inputColor !== void 0 ? _options$inputColor : 'unset'
|
|
145
146
|
},
|
|
146
147
|
'&:hover': {
|
|
147
148
|
background: options.hoverBg
|
|
@@ -189,18 +190,12 @@ var genFilledGroupStatusStyle = function genFilledGroupStatusStyle(token, option
|
|
|
189
190
|
};
|
|
190
191
|
export var genFilledGroupStyle = function genFilledGroupStyle(token) {
|
|
191
192
|
return {
|
|
192
|
-
'&-filled': _objectSpread(_objectSpread(_objectSpread(_defineProperty({}, "".concat(token.componentCls, "-group"),
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}, "".concat(token.componentCls, "-filled:not(:focus):not(:focus-within)"), {
|
|
197
|
-
'&:not(:first-child)': {
|
|
198
|
-
borderInlineStart: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit)
|
|
199
|
-
},
|
|
200
|
-
'&:not(:last-child)': {
|
|
201
|
-
borderInlineEnd: "".concat(unit(token.lineWidth), " ").concat(token.lineType, " ").concat(token.colorSplit)
|
|
193
|
+
'&-filled': _objectSpread(_objectSpread(_objectSpread(_defineProperty({}, "".concat(token.componentCls, "-group-addon"), {
|
|
194
|
+
background: token.colorFillTertiary,
|
|
195
|
+
'&:last-child': {
|
|
196
|
+
position: 'static'
|
|
202
197
|
}
|
|
203
|
-
})
|
|
198
|
+
}), genFilledGroupStatusStyle(token, {
|
|
204
199
|
status: 'error',
|
|
205
200
|
addonBg: token.colorErrorBg,
|
|
206
201
|
addonColor: token.colorErrorText
|
|
@@ -225,4 +220,64 @@ export var genFilledGroupStyle = function genFilledGroupStyle(token) {
|
|
|
225
220
|
}
|
|
226
221
|
})))
|
|
227
222
|
};
|
|
223
|
+
};
|
|
224
|
+
/* ============== Underlined ============== */
|
|
225
|
+
// https://github.com/ant-design/ant-design/issues/51379
|
|
226
|
+
export var genBaseUnderlinedStyle = function genBaseUnderlinedStyle(token, options) {
|
|
227
|
+
return {
|
|
228
|
+
background: token.colorBgContainer,
|
|
229
|
+
borderWidth: "".concat(unit(token.lineWidth), " 0"),
|
|
230
|
+
borderStyle: "".concat(token.lineType, " none"),
|
|
231
|
+
borderColor: "transparent transparent ".concat(options.borderColor, " transparent"),
|
|
232
|
+
borderRadius: 0,
|
|
233
|
+
'&:hover': {
|
|
234
|
+
borderColor: "transparent transparent ".concat(options.borderColor, " transparent"),
|
|
235
|
+
backgroundColor: token.hoverBg
|
|
236
|
+
},
|
|
237
|
+
'&:focus, &:focus-within': {
|
|
238
|
+
borderColor: "transparent transparent ".concat(options.borderColor, " transparent"),
|
|
239
|
+
outline: 0,
|
|
240
|
+
backgroundColor: token.activeBg
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
var genUnderlinedStatusStyle = function genUnderlinedStatusStyle(token, options) {
|
|
245
|
+
return _defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-status-").concat(options.status, ":not(").concat(token.componentCls, "-disabled)"), _objectSpread(_objectSpread({}, genBaseUnderlinedStyle(token, options)), {}, _defineProperty({}, "".concat(token.componentCls, "-prefix, ").concat(token.componentCls, "-suffix"), {
|
|
246
|
+
color: options.affixColor
|
|
247
|
+
}))), "&".concat(token.componentCls, "-status-").concat(options.status).concat(token.componentCls, "-disabled"), {
|
|
248
|
+
borderColor: "transparent transparent ".concat(options.borderColor, " transparent")
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
export var genUnderlinedStyle = function genUnderlinedStyle(token, extraStyles) {
|
|
252
|
+
return {
|
|
253
|
+
'&-underlined': _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, genBaseUnderlinedStyle(token, {
|
|
254
|
+
borderColor: token.colorBorder,
|
|
255
|
+
hoverBorderColor: token.hoverBorderColor,
|
|
256
|
+
activeBorderColor: token.activeBorderColor,
|
|
257
|
+
activeShadow: token.activeShadow
|
|
258
|
+
})), {}, _defineProperty(_defineProperty({}, "&".concat(token.componentCls, "-disabled, &[disabled]"), {
|
|
259
|
+
color: token.colorTextDisabled,
|
|
260
|
+
boxShadow: 'none',
|
|
261
|
+
cursor: 'not-allowed',
|
|
262
|
+
'&:hover': {
|
|
263
|
+
borderColor: "transparent transparent ".concat(token.colorBorder, " transparent")
|
|
264
|
+
}
|
|
265
|
+
}), 'input[disabled], textarea[disabled]', {
|
|
266
|
+
cursor: 'not-allowed'
|
|
267
|
+
}), genUnderlinedStatusStyle(token, {
|
|
268
|
+
status: 'error',
|
|
269
|
+
borderColor: token.colorError,
|
|
270
|
+
hoverBorderColor: token.colorErrorBorderHover,
|
|
271
|
+
activeBorderColor: token.colorError,
|
|
272
|
+
activeShadow: token.errorActiveShadow,
|
|
273
|
+
affixColor: token.colorError
|
|
274
|
+
})), genUnderlinedStatusStyle(token, {
|
|
275
|
+
status: 'warning',
|
|
276
|
+
borderColor: token.colorWarning,
|
|
277
|
+
hoverBorderColor: token.colorWarningBorderHover,
|
|
278
|
+
activeBorderColor: token.colorWarning,
|
|
279
|
+
activeShadow: token.warningActiveShadow,
|
|
280
|
+
affixColor: token.colorWarning
|
|
281
|
+
})), extraStyles)
|
|
282
|
+
};
|
|
228
283
|
};
|
|
@@ -132,7 +132,7 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
132
132
|
classNames: {
|
|
133
133
|
input: inputNumberClass,
|
|
134
134
|
variant: classNames(_defineProperty({}, "".concat(prefixCls, "-").concat(variant), enableVariantCls), getStatusClassNames(prefixCls, mergedStatus, hasFeedback)),
|
|
135
|
-
affixWrapper: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-affix-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-affix-wrapper-without-controls"), controls === false), hashId),
|
|
135
|
+
affixWrapper: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-affix-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-affix-wrapper-without-controls"), controls === false || mergedDisabled), hashId),
|
|
136
136
|
wrapper: classNames(_defineProperty({}, "".concat(wrapperClassName, "-rtl"), direction === 'rtl'), hashId),
|
|
137
137
|
groupWrapper: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-group-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-group-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-group-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-group-wrapper-").concat(variant), enableVariantCls), getStatusClassNames("".concat(prefixCls, "-group-wrapper"), mergedStatus, hasFeedback), hashId)
|
|
138
138
|
}
|
|
@@ -6,7 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { unit } from '@ant-design/cssinjs';
|
|
8
8
|
import { genBasicInputStyle, genInputGroupStyle, genPlaceholderStyle, initInputToken } from '../../input/style';
|
|
9
|
-
import { genBorderlessStyle, genFilledGroupStyle, genFilledStyle, genOutlinedGroupStyle, genOutlinedStyle } from '../../input/style/variants';
|
|
9
|
+
import { genBorderlessStyle, genFilledGroupStyle, genFilledStyle, genOutlinedGroupStyle, genOutlinedStyle, genUnderlinedStyle } from '../../input/style/variants';
|
|
10
10
|
import { resetComponent, resetIcon } from '../../style';
|
|
11
11
|
import { genCompactItemStyle } from '../../style/compact-item';
|
|
12
12
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
@@ -39,7 +39,7 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
39
39
|
paddingBlockSM = token.paddingBlockSM,
|
|
40
40
|
paddingBlockLG = token.paddingBlockLG,
|
|
41
41
|
paddingInlineLG = token.paddingInlineLG,
|
|
42
|
-
|
|
42
|
+
colorIcon = token.colorIcon,
|
|
43
43
|
motionDurationMid = token.motionDurationMid,
|
|
44
44
|
handleHoverColor = token.handleHoverColor,
|
|
45
45
|
handleOpacity = token.handleOpacity,
|
|
@@ -55,7 +55,7 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
55
55
|
filledHandleBg = token.filledHandleBg,
|
|
56
56
|
lineHeightLG = token.lineHeightLG,
|
|
57
57
|
calc = token.calc;
|
|
58
|
-
return [_defineProperty({}, componentCls, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, resetComponent(token)), genBasicInputStyle(token)), {}, {
|
|
58
|
+
return [_defineProperty({}, componentCls, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, resetComponent(token)), genBasicInputStyle(token)), {}, {
|
|
59
59
|
display: 'inline-block',
|
|
60
60
|
width: controlWidth,
|
|
61
61
|
margin: 0,
|
|
@@ -71,6 +71,10 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
71
71
|
borderBlockStart: "".concat(unit(lineWidth), " ").concat(lineType, " ").concat(handleBorderColor)
|
|
72
72
|
})), '&:focus-within', _defineProperty({}, "".concat(componentCls, "-handler-wrap"), {
|
|
73
73
|
background: handleBg
|
|
74
|
+
})))), genUnderlinedStyle(token, _defineProperty({}, "".concat(componentCls, "-handler-wrap"), _defineProperty({
|
|
75
|
+
background: handleBg
|
|
76
|
+
}, "".concat(componentCls, "-handler-down"), {
|
|
77
|
+
borderBlockStart: "".concat(unit(lineWidth), " ").concat(lineType, " ").concat(handleBorderColor)
|
|
74
78
|
})))), genBorderlessStyle(token)), {}, _defineProperty(_defineProperty(_defineProperty({
|
|
75
79
|
'&-rtl': _defineProperty({
|
|
76
80
|
direction: 'rtl'
|
|
@@ -140,7 +144,6 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
140
144
|
}, genPlaceholderStyle(token.colorTextPlaceholder)), {}, {
|
|
141
145
|
'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button': {
|
|
142
146
|
margin: 0,
|
|
143
|
-
webkitAppearance: 'none',
|
|
144
147
|
appearance: 'none'
|
|
145
148
|
}
|
|
146
149
|
})
|
|
@@ -152,7 +155,7 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
152
155
|
position: 'absolute',
|
|
153
156
|
insetBlockStart: 0,
|
|
154
157
|
insetInlineEnd: 0,
|
|
155
|
-
width:
|
|
158
|
+
width: token.handleVisibleWidth,
|
|
156
159
|
opacity: handleOpacity,
|
|
157
160
|
height: '100%',
|
|
158
161
|
borderStartStartRadius: 0,
|
|
@@ -176,7 +179,7 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
176
179
|
}))), "".concat(componentCls, "-handler"), {
|
|
177
180
|
height: '50%',
|
|
178
181
|
overflow: 'hidden',
|
|
179
|
-
color:
|
|
182
|
+
color: colorIcon,
|
|
180
183
|
fontWeight: 'bold',
|
|
181
184
|
lineHeight: 0,
|
|
182
185
|
textAlign: 'center',
|
|
@@ -193,7 +196,7 @@ var genInputNumberStyles = function genInputNumberStyles(token) {
|
|
|
193
196
|
color: handleHoverColor
|
|
194
197
|
}),
|
|
195
198
|
'&-up-inner, &-down-inner': _objectSpread(_objectSpread({}, resetIcon()), {}, {
|
|
196
|
-
color:
|
|
199
|
+
color: colorIcon,
|
|
197
200
|
transition: "all ".concat(motionDurationMid, " linear"),
|
|
198
201
|
userSelect: 'none'
|
|
199
202
|
})
|
|
@@ -4,21 +4,23 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
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; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import {
|
|
7
|
+
import { FastColor } from '@ant-design/fast-color';
|
|
8
8
|
import { initComponentToken } from '../../input/style/token';
|
|
9
9
|
export var prepareComponentToken = function prepareComponentToken(token) {
|
|
10
10
|
var _token$handleVisible;
|
|
11
11
|
var handleVisible = (_token$handleVisible = token.handleVisible) !== null && _token$handleVisible !== void 0 ? _token$handleVisible : 'auto';
|
|
12
|
+
var handleWidth = token.controlHeightSM - token.lineWidth * 2;
|
|
12
13
|
return _objectSpread(_objectSpread({}, initComponentToken(token)), {}, {
|
|
13
14
|
controlWidth: 90,
|
|
14
|
-
handleWidth:
|
|
15
|
+
handleWidth: handleWidth,
|
|
15
16
|
handleFontSize: token.fontSize / 2,
|
|
16
17
|
handleVisible: handleVisible,
|
|
17
18
|
handleActiveBg: token.colorFillAlter,
|
|
18
19
|
handleBg: token.colorBgContainer,
|
|
19
|
-
filledHandleBg: new
|
|
20
|
+
filledHandleBg: new FastColor(token.colorFillSecondary).onBackground(token.colorBgContainer).toHexString(),
|
|
20
21
|
handleHoverColor: token.colorPrimary,
|
|
21
22
|
handleBorderColor: token.colorBorder,
|
|
22
|
-
handleOpacity: handleVisible === true ? 1 : 0
|
|
23
|
+
handleOpacity: handleVisible === true ? 1 : 0,
|
|
24
|
+
handleVisibleWidth: handleVisible === true ? handleWidth : 0
|
|
23
25
|
});
|
|
24
26
|
};
|
|
@@ -21,7 +21,7 @@ import LeftOutlined from '@ant-design/icons/LeftOutlined';
|
|
|
21
21
|
import RightOutlined from '@ant-design/icons/RightOutlined';
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
import omit from 'rc-util/lib/omit';
|
|
24
|
-
import
|
|
24
|
+
import { addMediaQueryListener, removeMediaQueryListener } from '../_util/mediaQueryUtil';
|
|
25
25
|
import { ConfigContext } from '../config-provider';
|
|
26
26
|
import { LayoutContext } from './context';
|
|
27
27
|
import useStyle from './style/sider';
|
|
@@ -33,6 +33,9 @@ var dimensionMaxMap = {
|
|
|
33
33
|
xl: '1199.98px',
|
|
34
34
|
xxl: '1599.98px'
|
|
35
35
|
};
|
|
36
|
+
var isNumeric = function isNumeric(value) {
|
|
37
|
+
return !Number.isNaN(Number.parseFloat(value)) && isFinite(value);
|
|
38
|
+
};
|
|
36
39
|
export var SiderContext = /*#__PURE__*/React.createContext({});
|
|
37
40
|
var generateId = function () {
|
|
38
41
|
var i = 0;
|
|
@@ -89,7 +92,8 @@ var Sider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
92
|
};
|
|
90
93
|
// =========================== Prefix ===========================
|
|
91
94
|
var _useContext2 = useContext(ConfigContext),
|
|
92
|
-
getPrefixCls = _useContext2.getPrefixCls
|
|
95
|
+
getPrefixCls = _useContext2.getPrefixCls,
|
|
96
|
+
direction = _useContext2.direction;
|
|
93
97
|
var prefixCls = getPrefixCls('layout-sider', customizePrefixCls);
|
|
94
98
|
var _useStyle = useStyle(prefixCls),
|
|
95
99
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -97,7 +101,7 @@ var Sider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
97
101
|
hashId = _useStyle2[1],
|
|
98
102
|
cssVarCls = _useStyle2[2];
|
|
99
103
|
// ========================= Responsive =========================
|
|
100
|
-
var responsiveHandlerRef = useRef();
|
|
104
|
+
var responsiveHandlerRef = useRef(null);
|
|
101
105
|
responsiveHandlerRef.current = function (mql) {
|
|
102
106
|
setBelow(mql.matches);
|
|
103
107
|
onBreakpoint === null || onBreakpoint === void 0 || onBreakpoint(mql.matches);
|
|
@@ -106,31 +110,19 @@ var Sider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
106
110
|
}
|
|
107
111
|
};
|
|
108
112
|
useEffect(function () {
|
|
113
|
+
var _window;
|
|
109
114
|
function responsiveHandler(mql) {
|
|
110
|
-
|
|
115
|
+
var _responsiveHandlerRef;
|
|
116
|
+
return (_responsiveHandlerRef = responsiveHandlerRef.current) === null || _responsiveHandlerRef === void 0 ? void 0 : _responsiveHandlerRef.call(responsiveHandlerRef, mql);
|
|
111
117
|
}
|
|
112
118
|
var mql;
|
|
113
|
-
if (typeof window !== 'undefined') {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
mql = matchMedia("screen and (max-width: ".concat(dimensionMaxMap[breakpoint], ")"));
|
|
118
|
-
try {
|
|
119
|
-
mql.addEventListener('change', responsiveHandler);
|
|
120
|
-
} catch (_unused) {
|
|
121
|
-
mql.addListener(responsiveHandler);
|
|
122
|
-
}
|
|
123
|
-
responsiveHandler(mql);
|
|
124
|
-
}
|
|
119
|
+
if (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.matchMedia) !== 'undefined' && breakpoint && breakpoint in dimensionMaxMap) {
|
|
120
|
+
mql = window.matchMedia("screen and (max-width: ".concat(dimensionMaxMap[breakpoint], ")"));
|
|
121
|
+
addMediaQueryListener(mql, responsiveHandler);
|
|
122
|
+
responsiveHandler(mql);
|
|
125
123
|
}
|
|
126
124
|
return function () {
|
|
127
|
-
|
|
128
|
-
var _mql;
|
|
129
|
-
(_mql = mql) === null || _mql === void 0 || _mql.removeEventListener('change', responsiveHandler);
|
|
130
|
-
} catch (_unused2) {
|
|
131
|
-
var _mql2;
|
|
132
|
-
(_mql2 = mql) === null || _mql2 === void 0 || _mql2.removeListener(responsiveHandler);
|
|
133
|
-
}
|
|
125
|
+
removeMediaQueryListener(mql, responsiveHandler);
|
|
134
126
|
};
|
|
135
127
|
}, [breakpoint]); // in order to accept dynamic 'breakpoint' property, we need to add 'breakpoint' into dependency array.
|
|
136
128
|
useEffect(function () {
|
|
@@ -143,42 +135,49 @@ var Sider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
143
135
|
var toggle = function toggle() {
|
|
144
136
|
handleSetCollapsed(!collapsed, 'clickTrigger');
|
|
145
137
|
};
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
width: siderWidth
|
|
169
|
-
},
|
|
170
|
-
children: trigger || defaultTrigger
|
|
171
|
-
}) : null;
|
|
172
|
-
var divStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
173
|
-
flex: "0 0 ".concat(siderWidth),
|
|
174
|
-
maxWidth: siderWidth,
|
|
175
|
-
// Fix width transition bug in IE11
|
|
176
|
-
minWidth: siderWidth,
|
|
177
|
-
// https://github.com/ant-design/ant-design/issues/6349
|
|
138
|
+
var divProps = omit(otherProps, ['collapsed']);
|
|
139
|
+
var rawWidth = collapsed ? collapsedWidth : width;
|
|
140
|
+
// use "px" as fallback unit for width
|
|
141
|
+
var siderWidth = isNumeric(rawWidth) ? "".concat(rawWidth, "px") : String(rawWidth);
|
|
142
|
+
// special trigger when collapsedWidth == 0
|
|
143
|
+
var zeroWidthTrigger = parseFloat(String(collapsedWidth || 0)) === 0 ? _jsx("span", {
|
|
144
|
+
onClick: toggle,
|
|
145
|
+
className: classNames("".concat(prefixCls, "-zero-width-trigger"), "".concat(prefixCls, "-zero-width-trigger-").concat(reverseArrow ? 'right' : 'left')),
|
|
146
|
+
style: zeroWidthTriggerStyle,
|
|
147
|
+
children: trigger || _jsx(BarsOutlined, {})
|
|
148
|
+
}) : null;
|
|
149
|
+
var reverseIcon = direction === 'rtl' === !reverseArrow;
|
|
150
|
+
var iconObj = {
|
|
151
|
+
expanded: reverseIcon ? _jsx(RightOutlined, {}) : _jsx(LeftOutlined, {}),
|
|
152
|
+
collapsed: reverseIcon ? _jsx(LeftOutlined, {}) : _jsx(RightOutlined, {})
|
|
153
|
+
};
|
|
154
|
+
var status = collapsed ? 'collapsed' : 'expanded';
|
|
155
|
+
var defaultTrigger = iconObj[status];
|
|
156
|
+
var triggerDom = trigger !== null ? zeroWidthTrigger || _jsx("div", {
|
|
157
|
+
className: "".concat(prefixCls, "-trigger"),
|
|
158
|
+
onClick: toggle,
|
|
159
|
+
style: {
|
|
178
160
|
width: siderWidth
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
161
|
+
},
|
|
162
|
+
children: trigger || defaultTrigger
|
|
163
|
+
}) : null;
|
|
164
|
+
var divStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
165
|
+
flex: "0 0 ".concat(siderWidth),
|
|
166
|
+
maxWidth: siderWidth,
|
|
167
|
+
// Fix width transition bug in IE11
|
|
168
|
+
minWidth: siderWidth,
|
|
169
|
+
// https://github.com/ant-design/ant-design/issues/6349
|
|
170
|
+
width: siderWidth
|
|
171
|
+
});
|
|
172
|
+
var siderCls = classNames(prefixCls, "".concat(prefixCls, "-").concat(theme), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-collapsed"), !!collapsed), "".concat(prefixCls, "-has-trigger"), collapsible && trigger !== null && !zeroWidthTrigger), "".concat(prefixCls, "-below"), !!below), "".concat(prefixCls, "-zero-width"), parseFloat(siderWidth) === 0), className, hashId, cssVarCls);
|
|
173
|
+
var contextValue = React.useMemo(function () {
|
|
174
|
+
return {
|
|
175
|
+
siderCollapsed: collapsed
|
|
176
|
+
};
|
|
177
|
+
}, [collapsed]);
|
|
178
|
+
return wrapCSSVar(_jsx(SiderContext.Provider, {
|
|
179
|
+
value: contextValue,
|
|
180
|
+
children: _jsxs("aside", _objectSpread(_objectSpread({
|
|
182
181
|
className: siderCls
|
|
183
182
|
}, divProps), {}, {
|
|
184
183
|
style: divStyle,
|
|
@@ -187,16 +186,7 @@ var Sider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
187
186
|
className: "".concat(prefixCls, "-children"),
|
|
188
187
|
children: children
|
|
189
188
|
}), collapsible || below && zeroWidthTrigger ? triggerDom : null]
|
|
190
|
-
}))
|
|
191
|
-
};
|
|
192
|
-
var contextValue = React.useMemo(function () {
|
|
193
|
-
return {
|
|
194
|
-
siderCollapsed: collapsed
|
|
195
|
-
};
|
|
196
|
-
}, [collapsed]);
|
|
197
|
-
return wrapCSSVar(_jsx(SiderContext.Provider, {
|
|
198
|
-
value: contextValue,
|
|
199
|
-
children: renderSider()
|
|
189
|
+
}))
|
|
200
190
|
}));
|
|
201
191
|
});
|
|
202
192
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -23,6 +23,7 @@ import * as React from 'react';
|
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import omit from 'rc-util/lib/omit';
|
|
25
25
|
import { ConfigContext } from '../config-provider';
|
|
26
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
26
27
|
import { LayoutContext } from './context';
|
|
27
28
|
import useHasSider from './hooks/useHasSider';
|
|
28
29
|
import useStyle from './style';
|
|
@@ -80,9 +81,10 @@ var BasicLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
80
81
|
style = props.style,
|
|
81
82
|
others = _objectWithoutProperties(props, _excluded2);
|
|
82
83
|
var passedProps = omit(others, ['suffixCls']);
|
|
83
|
-
var
|
|
84
|
-
getPrefixCls =
|
|
85
|
-
|
|
84
|
+
var _useComponentConfig = useComponentConfig('layout'),
|
|
85
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
86
|
+
contextClassName = _useComponentConfig.className,
|
|
87
|
+
contextStyle = _useComponentConfig.style;
|
|
86
88
|
var prefixCls = getPrefixCls('layout', customizePrefixCls);
|
|
87
89
|
var mergedHasSider = useHasSider(siders, children, hasSider);
|
|
88
90
|
var _useStyle3 = useStyle(prefixCls),
|
|
@@ -90,7 +92,7 @@ var BasicLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
90
92
|
wrapCSSVar = _useStyle4[0],
|
|
91
93
|
hashId = _useStyle4[1],
|
|
92
94
|
cssVarCls = _useStyle4[2];
|
|
93
|
-
var classString = classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-sider"), mergedHasSider), "".concat(prefixCls, "-rtl"), direction === 'rtl'),
|
|
95
|
+
var classString = classNames(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-has-sider"), mergedHasSider), "".concat(prefixCls, "-rtl"), direction === 'rtl'), contextClassName, className, rootClassName, hashId, cssVarCls);
|
|
94
96
|
var contextValue = React.useMemo(function () {
|
|
95
97
|
return {
|
|
96
98
|
siderHook: {
|
|
@@ -114,7 +116,7 @@ var BasicLayout = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
114
116
|
children: _jsx(Tag, _objectSpread(_objectSpread({
|
|
115
117
|
ref: ref,
|
|
116
118
|
className: classString,
|
|
117
|
-
style: _objectSpread(_objectSpread({},
|
|
119
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style)
|
|
118
120
|
}, passedProps), {}, {
|
|
119
121
|
children: children
|
|
120
122
|
}))
|
|
@@ -17,12 +17,12 @@ var genSiderStyle = function genSiderStyle(token) {
|
|
|
17
17
|
headerHeight = token.headerHeight,
|
|
18
18
|
zeroTriggerWidth = token.zeroTriggerWidth,
|
|
19
19
|
zeroTriggerHeight = token.zeroTriggerHeight,
|
|
20
|
-
|
|
20
|
+
borderRadiusLG = token.borderRadiusLG,
|
|
21
21
|
lightSiderBg = token.lightSiderBg,
|
|
22
22
|
lightTriggerColor = token.lightTriggerColor,
|
|
23
23
|
lightTriggerBg = token.lightTriggerBg,
|
|
24
24
|
bodyBg = token.bodyBg;
|
|
25
|
-
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
25
|
+
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
26
26
|
position: 'relative',
|
|
27
27
|
// fix firefox can't set width smaller than content on flex item
|
|
28
28
|
minWidth: 0,
|
|
@@ -43,7 +43,9 @@ var genSiderStyle = function genSiderStyle(token) {
|
|
|
43
43
|
paddingTop: 0.1
|
|
44
44
|
}, "".concat(antCls, "-menu").concat(antCls, "-menu-inline-collapsed"), {
|
|
45
45
|
width: 'auto'
|
|
46
|
-
})), "".concat(componentCls, "-
|
|
46
|
+
})), "&-zero-width ".concat(componentCls, "-children"), {
|
|
47
|
+
overflow: 'hidden'
|
|
48
|
+
}), "".concat(componentCls, "-trigger"), {
|
|
47
49
|
position: 'fixed',
|
|
48
50
|
bottom: 0,
|
|
49
51
|
zIndex: 1,
|
|
@@ -54,46 +56,35 @@ var genSiderStyle = function genSiderStyle(token) {
|
|
|
54
56
|
background: triggerBg,
|
|
55
57
|
cursor: 'pointer',
|
|
56
58
|
transition: "all ".concat(motionDurationMid)
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
}), "".concat(componentCls, "-zero-width-trigger"), {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
top: headerHeight,
|
|
62
|
+
insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
|
63
|
+
zIndex: 1,
|
|
64
|
+
width: zeroTriggerWidth,
|
|
65
|
+
height: zeroTriggerHeight,
|
|
66
|
+
color: triggerColor,
|
|
67
|
+
fontSize: token.fontSizeXL,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
background: siderBg,
|
|
72
|
+
borderRadius: "0 ".concat(unit(borderRadiusLG), " ").concat(unit(borderRadiusLG), " 0"),
|
|
73
|
+
cursor: 'pointer',
|
|
74
|
+
transition: "background ".concat(motionDurationSlow, " ease"),
|
|
75
|
+
'&::after': {
|
|
62
76
|
position: 'absolute',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
borderStartStartRadius: 0,
|
|
75
|
-
borderStartEndRadius: borderRadius,
|
|
76
|
-
borderEndEndRadius: borderRadius,
|
|
77
|
-
borderEndStartRadius: 0,
|
|
78
|
-
cursor: 'pointer',
|
|
79
|
-
transition: "background ".concat(motionDurationSlow, " ease"),
|
|
80
|
-
'&::after': {
|
|
81
|
-
position: 'absolute',
|
|
82
|
-
inset: 0,
|
|
83
|
-
background: 'transparent',
|
|
84
|
-
transition: "all ".concat(motionDurationSlow),
|
|
85
|
-
content: '""'
|
|
86
|
-
},
|
|
87
|
-
'&:hover::after': {
|
|
88
|
-
background: "rgba(255, 255, 255, 0.2)"
|
|
89
|
-
},
|
|
90
|
-
'&-right': {
|
|
91
|
-
insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
|
92
|
-
borderStartStartRadius: borderRadius,
|
|
93
|
-
borderStartEndRadius: 0,
|
|
94
|
-
borderEndEndRadius: 0,
|
|
95
|
-
borderEndStartRadius: borderRadius
|
|
96
|
-
}
|
|
77
|
+
inset: 0,
|
|
78
|
+
background: 'transparent',
|
|
79
|
+
transition: "all ".concat(motionDurationSlow),
|
|
80
|
+
content: '""'
|
|
81
|
+
},
|
|
82
|
+
'&:hover::after': {
|
|
83
|
+
background: "rgba(255, 255, 255, 0.2)"
|
|
84
|
+
},
|
|
85
|
+
'&-right': {
|
|
86
|
+
insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
|
|
87
|
+
borderRadius: "".concat(unit(borderRadiusLG), " 0 0 ").concat(unit(borderRadiusLG))
|
|
97
88
|
}
|
|
98
89
|
}), '&-light', _defineProperty(_defineProperty({
|
|
99
90
|
background: lightSiderBg
|