@chaoswise/ui 3.0.23 → 3.1.1
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/ActionButton.js +4 -2
- package/lib/Antd5/_util/ContextIsolator.js +27 -0
- package/lib/Antd5/_util/easings.js +2 -2
- package/lib/Antd5/_util/getScroll.js +9 -8
- package/lib/Antd5/_util/hooks/useClosable.js +3 -2
- package/lib/Antd5/_util/hooks/useUniqueMemo.js +123 -0
- package/lib/Antd5/_util/hooks/useZIndex.js +31 -15
- package/lib/Antd5/_util/motion.js +3 -2
- package/lib/Antd5/_util/placements.js +2 -2
- package/lib/Antd5/_util/scrollTo.js +1 -1
- package/lib/Antd5/_util/statusUtils.js +1 -1
- package/lib/Antd5/_util/toList.js +5 -0
- package/lib/Antd5/_util/warning.js +0 -1
- package/lib/Antd5/_util/wave/WaveEffect.js +2 -2
- package/lib/Antd5/_util/wave/interface.js +2 -1
- package/lib/Antd5/_util/wave/useWave.js +1 -1
- package/lib/Antd5/_util/wave/util.js +1 -9
- package/lib/Antd5/alert/Alert.js +1 -2
- package/lib/Antd5/alert/ErrorBoundary.js +1 -1
- package/lib/Antd5/alert/design/behavior-pattern.js +3 -3
- package/lib/Antd5/alert/style/index.js +6 -4
- package/lib/Antd5/anchor/Anchor.js +8 -7
- package/lib/Antd5/anchor/AnchorLink.js +4 -4
- package/lib/Antd5/app/index.js +2 -1
- package/lib/Antd5/app/style/index.js +4 -2
- package/lib/Antd5/auto-complete/index.js +1 -1
- package/lib/Antd5/avatar/group.js +35 -17
- package/lib/Antd5/avatar/style/index.js +18 -13
- package/lib/Antd5/back-top/index.js +3 -2
- package/lib/Antd5/badge/ScrollNumber.js +1 -1
- package/lib/Antd5/badge/SingleNumber.js +17 -16
- package/lib/Antd5/badge/style/index.js +6 -7
- package/lib/Antd5/badge/style/ribbon.js +3 -3
- package/lib/Antd5/breadcrumb/design/behavior-pattern.js +4 -4
- package/lib/Antd5/breadcrumb/style/index.js +1 -1
- package/lib/Antd5/button/LoadingIcon.js +5 -10
- package/lib/Antd5/button/button-group.js +0 -1
- package/lib/Antd5/button/button.js +70 -41
- package/lib/Antd5/button/buttonHelpers.js +7 -5
- package/lib/Antd5/button/style/{compactCmp.js → compact.js} +20 -27
- package/lib/Antd5/button/style/group.js +9 -7
- package/lib/Antd5/button/style/index.js +150 -110
- package/lib/Antd5/button/style/token.js +8 -1
- package/lib/Antd5/calendar/generateCalendar.js +25 -28
- package/lib/Antd5/calendar/style/index.js +4 -4
- package/lib/Antd5/card/Card.js +3 -3
- package/lib/Antd5/card/style/index.js +6 -9
- package/lib/Antd5/carousel/index.js +3 -3
- package/lib/Antd5/carousel/style/index.js +1 -1
- package/lib/Antd5/cascader/Panel.js +7 -2
- package/lib/Antd5/cascader/hooks/useBase.js +3 -2
- package/lib/Antd5/cascader/hooks/useColumnIcons.js +6 -3
- package/lib/Antd5/cascader/index.js +1 -1
- package/lib/Antd5/cascader/style/columns.js +6 -4
- package/lib/Antd5/checkbox/Checkbox.js +44 -10
- package/lib/Antd5/checkbox/Group.js +7 -2
- package/lib/Antd5/checkbox/assets/duigou1.js +29 -0
- package/lib/Antd5/checkbox/assets/duigou2.js +29 -0
- package/lib/Antd5/checkbox/style/index.js +112 -6
- package/lib/Antd5/collapse/Collapse.js +2 -1
- package/lib/Antd5/collapse/style/index.js +20 -13
- package/lib/Antd5/color-picker/ColorPicker.js +120 -78
- package/lib/Antd5/color-picker/ColorPickerPanel.js +44 -26
- package/lib/Antd5/color-picker/color.js +82 -10
- package/lib/Antd5/color-picker/components/ColorAlphaInput.js +2 -2
- package/lib/Antd5/color-picker/components/ColorClear.js +2 -2
- package/lib/Antd5/color-picker/components/ColorHexInput.js +5 -4
- package/lib/Antd5/color-picker/components/ColorInput.js +4 -3
- package/lib/Antd5/color-picker/components/ColorPresets.js +1 -1
- package/lib/Antd5/color-picker/components/ColorSlider.js +139 -0
- package/lib/Antd5/color-picker/components/ColorTrigger.js +52 -26
- package/lib/Antd5/color-picker/components/PanelPicker/GradientColorBar.js +130 -0
- package/lib/Antd5/color-picker/components/PanelPicker/index.js +194 -0
- package/lib/Antd5/color-picker/context.js +1 -5
- package/lib/Antd5/color-picker/hooks/useModeColor.js +87 -0
- package/lib/Antd5/color-picker/style/color-block.js +3 -2
- package/lib/Antd5/color-picker/style/index.js +33 -15
- package/lib/Antd5/color-picker/style/input.js +1 -1
- package/lib/Antd5/color-picker/style/picker.js +6 -33
- package/lib/Antd5/color-picker/style/slider.js +87 -0
- package/lib/Antd5/color-picker/util.js +53 -7
- package/lib/Antd5/config-provider/context.js +3 -1
- package/lib/Antd5/config-provider/cssVariables.js +0 -1
- package/lib/Antd5/config-provider/defaultRenderEmpty.js +8 -1
- package/lib/Antd5/config-provider/index.js +13 -5
- package/lib/Antd5/config-provider/style/index.js +0 -1
- package/lib/Antd5/date-picker/PickerButton.js +3 -2
- package/lib/Antd5/date-picker/design/behavior-pattern.js +15 -15
- package/lib/Antd5/date-picker/generatePicker/constant.js +15 -0
- package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +16 -11
- package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +19 -15
- package/lib/Antd5/date-picker/generatePicker/index.js +2 -2
- package/lib/Antd5/date-picker/generatePicker/interface.js +1 -1
- package/lib/Antd5/date-picker/index.js +2 -17
- package/lib/Antd5/date-picker/locale/ar_EG.js +9 -1
- package/lib/Antd5/date-picker/locale/az_AZ.js +9 -1
- package/lib/Antd5/date-picker/locale/el_GR.js +9 -1
- package/lib/Antd5/date-picker/locale/ja_JP.js +11 -1
- package/lib/Antd5/date-picker/locale/kn_IN.js +9 -1
- package/lib/Antd5/date-picker/locale/pl_PL.js +9 -1
- package/lib/Antd5/date-picker/locale/uk_UA.js +10 -1
- package/lib/Antd5/date-picker/style/index.js +13 -10
- package/lib/Antd5/date-picker/style/panel.js +36 -32
- package/lib/Antd5/date-picker/style/token.js +1 -1
- package/lib/Antd5/date-picker/util.js +0 -48
- package/lib/Antd5/descriptions/hooks/useItems.js +5 -0
- package/lib/Antd5/descriptions/hooks/useRow.js +42 -34
- package/lib/Antd5/descriptions/style/index.js +20 -8
- package/lib/Antd5/divider/index.js +4 -3
- package/lib/Antd5/divider/style/index.js +19 -4
- package/lib/Antd5/drawer/DrawerPanel.js +11 -20
- package/lib/Antd5/drawer/index.js +39 -42
- package/lib/Antd5/drawer/style/index.js +10 -11
- package/lib/Antd5/dropdown/dropdown.js +5 -7
- package/lib/Antd5/dropdown/style/index.js +27 -11
- package/lib/Antd5/empty/empty.js +9 -3
- package/lib/Antd5/empty/simple.js +9 -3
- package/lib/Antd5/empty/style/index.js +1 -1
- package/lib/Antd5/float-button/BackTop.js +3 -2
- package/lib/Antd5/float-button/FloatButton.js +16 -5
- package/lib/Antd5/float-button/FloatButtonGroup.js +76 -52
- package/lib/Antd5/float-button/style/index.js +117 -76
- package/lib/Antd5/float-button/style/keyframes.js +118 -0
- package/lib/Antd5/form/ErrorList.js +14 -2
- package/lib/Antd5/form/Form.js +11 -3
- package/lib/Antd5/form/FormItem/ItemHolder.js +8 -4
- package/lib/Antd5/form/FormItem/index.js +6 -4
- package/lib/Antd5/form/FormItemInput.js +68 -28
- package/lib/Antd5/form/FormItemLabel.js +3 -3
- package/lib/Antd5/form/hooks/useForm.js +8 -1
- package/lib/Antd5/form/hooks/useVariants.js +10 -4
- package/lib/Antd5/form/style/explain.js +9 -8
- package/lib/Antd5/form/style/index.js +30 -18
- package/lib/Antd5/grid/row.js +2 -2
- package/lib/Antd5/image/index.js +3 -1
- package/lib/Antd5/image/style/index.js +17 -20
- package/lib/Antd5/index.js +2 -1
- package/lib/Antd5/input/Input.js +18 -38
- package/lib/Antd5/input/OTP/OTPInput.js +10 -5
- package/lib/Antd5/input/OTP/index.js +12 -4
- package/lib/Antd5/input/Password.js +6 -2
- package/lib/Antd5/input/Search.js +2 -4
- package/lib/Antd5/input/TextArea.js +1 -1
- package/lib/Antd5/input/style/index.js +72 -63
- package/lib/Antd5/input/style/otp.js +1 -1
- package/lib/Antd5/input/style/variants.js +38 -23
- package/lib/Antd5/input/utils.js +0 -1
- package/lib/Antd5/input-number/index.js +19 -22
- package/lib/Antd5/input-number/style/index.js +26 -16
- package/lib/Antd5/layout/Sider.js +15 -8
- package/lib/Antd5/layout/style/index.js +6 -96
- package/lib/Antd5/layout/style/sider.js +115 -0
- package/lib/Antd5/list/Item.js +18 -5
- package/lib/Antd5/list/index.js +15 -10
- package/lib/Antd5/list/style/index.js +40 -41
- package/lib/Antd5/locale/ar_EG.js +14 -1
- package/lib/Antd5/locale/az_AZ.js +78 -28
- package/lib/Antd5/locale/bn_BD.js +0 -1
- package/lib/Antd5/locale/by_BY.js +0 -1
- package/lib/Antd5/locale/ca_ES.js +0 -1
- package/lib/Antd5/locale/cs_CZ.js +0 -1
- package/lib/Antd5/locale/de_DE.js +0 -1
- package/lib/Antd5/locale/el_GR.js +104 -3
- package/lib/Antd5/locale/en_GB.js +0 -1
- package/lib/Antd5/locale/en_US.js +4 -2
- package/lib/Antd5/locale/es_ES.js +10 -6
- package/lib/Antd5/locale/et_EE.js +0 -1
- package/lib/Antd5/locale/eu_ES.js +4 -2
- package/lib/Antd5/locale/fa_IR.js +0 -1
- package/lib/Antd5/locale/fr_BE.js +5 -1
- package/lib/Antd5/locale/fr_CA.js +0 -1
- package/lib/Antd5/locale/fr_FR.js +5 -6
- package/lib/Antd5/locale/ga_IE.js +0 -1
- package/lib/Antd5/locale/gl_ES.js +0 -1
- package/lib/Antd5/locale/he_IL.js +0 -1
- package/lib/Antd5/locale/hi_IN.js +0 -1
- package/lib/Antd5/locale/hr_HR.js +0 -1
- package/lib/Antd5/locale/id_ID.js +4 -2
- package/lib/Antd5/locale/index.js +1 -1
- package/lib/Antd5/locale/it_IT.js +0 -1
- package/lib/Antd5/locale/ja_JP.js +4 -2
- package/lib/Antd5/locale/ka_GE.js +0 -1
- package/lib/Antd5/locale/kk_KZ.js +0 -1
- package/lib/Antd5/locale/km_KH.js +0 -1
- package/lib/Antd5/locale/kn_IN.js +82 -4
- package/lib/Antd5/locale/ko_KR.js +4 -2
- package/lib/Antd5/locale/lt_LT.js +4 -2
- package/lib/Antd5/locale/ml_IN.js +0 -1
- package/lib/Antd5/locale/mn_MN.js +86 -2
- package/lib/Antd5/locale/ms_MY.js +101 -18
- package/lib/Antd5/locale/my_MM.js +0 -1
- package/lib/Antd5/locale/nb_NO.js +0 -1
- package/lib/Antd5/locale/ne_NP.js +104 -2
- package/lib/Antd5/locale/nl_BE.js +5 -1
- package/lib/Antd5/locale/nl_NL.js +5 -1
- package/lib/Antd5/locale/pl_PL.js +0 -1
- package/lib/Antd5/locale/pt_BR.js +0 -1
- package/lib/Antd5/locale/pt_PT.js +55 -38
- package/lib/Antd5/locale/ro_RO.js +0 -1
- package/lib/Antd5/locale/ru_RU.js +9 -2
- package/lib/Antd5/locale/si_LK.js +0 -1
- package/lib/Antd5/locale/sk_SK.js +0 -1
- package/lib/Antd5/locale/sr_RS.js +0 -1
- package/lib/Antd5/locale/sv_SE.js +0 -1
- package/lib/Antd5/locale/th_TH.js +11 -3
- package/lib/Antd5/locale/tk_TK.js +0 -1
- package/lib/Antd5/locale/tr_TR.js +2 -1
- package/lib/Antd5/locale/uk_UA.js +1 -1
- package/lib/Antd5/locale/ur_PK.js +0 -1
- package/lib/Antd5/locale/uz_UZ.js +6 -7
- package/lib/Antd5/locale/zh_CN.js +4 -2
- package/lib/Antd5/locale/zh_HK.js +0 -1
- package/lib/Antd5/locale/zh_TW.js +0 -1
- package/lib/Antd5/mentions/index.js +4 -4
- package/lib/Antd5/menu/MenuItem.js +6 -5
- package/lib/Antd5/menu/OverrideContext.js +4 -3
- package/lib/Antd5/menu/SubMenu.js +2 -2
- package/lib/Antd5/menu/menu.js +2 -2
- package/lib/Antd5/menu/style/index.js +58 -40
- package/lib/Antd5/menu/style/theme.js +24 -20
- package/lib/Antd5/menu/style/vertical.js +10 -7
- package/lib/Antd5/modal/Modal.js +50 -38
- package/lib/Antd5/modal/PurePanel.js +0 -1
- package/lib/Antd5/modal/confirm.js +4 -5
- package/lib/Antd5/modal/style/confirm.js +1 -2
- package/lib/Antd5/modal/style/index.js +13 -3
- package/lib/Antd5/modal/useModal/HookModal.js +4 -3
- package/lib/Antd5/modal/useModal/index.js +0 -1
- package/lib/Antd5/notification/index.js +6 -3
- package/lib/Antd5/notification/style/index.js +35 -3
- package/lib/Antd5/notification/useNotification.js +6 -1
- package/lib/Antd5/pagination/Pagination.js +10 -5
- package/lib/Antd5/pagination/design/behavior-pattern.js +3 -3
- package/lib/Antd5/pagination/style/bordered.js +1 -1
- package/lib/Antd5/pagination/style/index.js +27 -18
- package/lib/Antd5/popconfirm/PurePanel.js +7 -7
- package/lib/Antd5/popover/PurePanel.js +16 -6
- package/lib/Antd5/popover/index.js +7 -19
- package/lib/Antd5/popover/style/index.js +3 -1
- package/lib/Antd5/progress/Line.js +27 -19
- package/lib/Antd5/progress/design/behavior-pattern.js +3 -3
- package/lib/Antd5/progress/progress.js +37 -11
- package/lib/Antd5/progress/style/index.js +46 -11
- package/lib/Antd5/progress/utils.js +20 -18
- package/lib/Antd5/qr-code/QrcodeStatus.js +42 -0
- package/lib/Antd5/qr-code/index.js +31 -31
- package/lib/Antd5/radio/radio.js +4 -10
- package/lib/Antd5/radio/style/index.js +65 -80
- package/lib/Antd5/rate/index.js +8 -2
- package/lib/Antd5/result/noFound.js +3 -1
- package/lib/Antd5/result/serverError.js +3 -1
- package/lib/Antd5/result/unauthorized.js +5 -3
- package/lib/Antd5/segmented/index.js +5 -3
- package/lib/Antd5/segmented/style/index.js +11 -3
- package/lib/Antd5/select/index.js +4 -2
- package/lib/Antd5/select/style/dropdown.js +1 -1
- package/lib/Antd5/select/style/index.js +21 -8
- package/lib/Antd5/select/style/multiple.js +18 -9
- package/lib/Antd5/select/style/single.js +8 -10
- package/lib/Antd5/select/style/token.js +9 -2
- package/lib/Antd5/select/style/variants.js +20 -11
- package/lib/Antd5/skeleton/Image.js +6 -4
- package/lib/Antd5/skeleton/Node.js +1 -3
- package/lib/Antd5/skeleton/Paragraph.js +1 -1
- package/lib/Antd5/skeleton/Title.js +9 -6
- package/lib/Antd5/skeleton/style/index.js +13 -13
- package/lib/Antd5/slider/Context.js +4 -0
- package/lib/Antd5/slider/SliderTooltip.js +9 -5
- package/lib/Antd5/slider/index.js +32 -31
- package/lib/Antd5/slider/style/index.js +60 -44
- package/lib/Antd5/space/Compact.js +1 -1
- package/lib/Antd5/space/index.js +3 -3
- package/lib/Antd5/spin/Indicator/Looper.js +29 -0
- package/lib/Antd5/spin/Indicator/Progress.js +78 -0
- package/lib/Antd5/spin/Indicator/index.js +21 -0
- package/lib/Antd5/spin/index.js +27 -45
- package/lib/Antd5/spin/style/index.js +54 -17
- package/lib/Antd5/spin/usePercent.js +40 -0
- package/lib/Antd5/splitter/Panel.js +36 -0
- package/lib/Antd5/splitter/SplitBar.js +124 -0
- package/lib/Antd5/splitter/Splitter.js +194 -0
- package/lib/Antd5/{_util/transButton.js → splitter/hooks/useItems.js} +28 -54
- package/lib/Antd5/splitter/hooks/useResizable.js +43 -0
- package/lib/Antd5/splitter/hooks/useResize.js +138 -0
- package/lib/Antd5/splitter/hooks/useSizes.js +109 -0
- package/lib/Antd5/splitter/index.js +5 -0
- package/lib/Antd5/splitter/interface.js +1 -0
- package/lib/Antd5/splitter/style/index.js +219 -0
- package/lib/Antd5/statistic/style/index.js +1 -1
- package/lib/Antd5/steps/style/custom-icon.js +1 -1
- package/lib/Antd5/steps/style/index.js +11 -8
- package/lib/Antd5/steps/style/inline.js +5 -4
- package/lib/Antd5/steps/style/progress-dot.js +2 -2
- package/lib/Antd5/steps/style/small.js +3 -3
- package/lib/Antd5/steps/style/vertical.js +2 -2
- package/lib/Antd5/style/index.js +37 -13
- package/lib/Antd5/style/motion/slide.js +6 -5
- package/lib/Antd5/style/placementArrow.js +15 -6
- package/lib/Antd5/switch/style/index.js +1 -1
- package/lib/Antd5/table/Column.js +2 -3
- package/lib/Antd5/table/ColumnGroup.js +2 -3
- package/lib/Antd5/table/ExpandIcon.js +6 -6
- package/lib/Antd5/table/InternalTable.js +6 -6
- package/lib/Antd5/table/RcTable/VirtualTable.js +3 -2
- package/lib/Antd5/table/RcTable/index.js +3 -2
- package/lib/Antd5/table/hooks/useFilter/FilterDropdown.js +82 -61
- package/lib/Antd5/table/hooks/useFilter/FilterSearch.js +7 -7
- package/lib/Antd5/table/hooks/useFilter/index.js +28 -26
- package/lib/Antd5/table/hooks/useLazyKVMap.js +5 -5
- package/lib/Antd5/table/hooks/useSelection.js +21 -11
- package/lib/Antd5/table/hooks/useSorter.js +66 -42
- package/lib/Antd5/table/hooks/useTitleColumns.js +9 -7
- package/lib/Antd5/table/interface.js +1 -1
- package/lib/Antd5/table/style/bordered.js +5 -3
- package/lib/Antd5/table/style/expand.js +44 -38
- package/lib/Antd5/table/style/filter.js +1 -1
- package/lib/Antd5/table/style/index.js +26 -21
- package/lib/Antd5/table/style/selection.js +3 -1
- package/lib/Antd5/table/style/sorter.js +3 -1
- package/lib/Antd5/table/style/virtual.js +2 -2
- package/lib/Antd5/table/util.js +9 -8
- package/lib/Antd5/tabs/style/index.js +2 -2
- package/lib/Antd5/tag/style/index.js +2 -2
- package/lib/Antd5/theme/index.js +12 -5
- package/lib/Antd5/theme/interface/cssinjs-utils.js +1 -0
- package/lib/Antd5/theme/internal.js +10 -5
- package/lib/Antd5/theme/themes/dark/colors.js +3 -0
- package/lib/Antd5/theme/themes/dark/index.js +1 -0
- package/lib/Antd5/theme/themes/default/colors.js +3 -0
- package/lib/Antd5/theme/themes/default/index.js +6 -2
- package/lib/Antd5/theme/themes/seed.js +5 -2
- package/lib/Antd5/theme/themes/shared/genColorMapToken.js +2 -0
- package/lib/Antd5/theme/themes/shared/genFontSizes.js +1 -1
- package/lib/Antd5/theme/useToken.js +2 -1
- package/lib/Antd5/theme/util/alias.js +1 -1
- package/lib/Antd5/theme/util/genStyleUtils.js +61 -0
- package/lib/Antd5/time-picker/index.js +15 -2
- package/lib/Antd5/time-picker/locale/az_AZ.js +2 -1
- package/lib/Antd5/time-picker/locale/it_IT.js +2 -1
- package/lib/Antd5/time-picker/locale/uk_UA.js +2 -1
- package/lib/Antd5/timeline/TimelineItemList.js +0 -1
- package/lib/Antd5/timeline/style/index.js +1 -1
- package/lib/Antd5/tooltip/index.js +3 -2
- package/lib/Antd5/tooltip/style/index.js +3 -1
- package/lib/Antd5/tooltip/util.js +0 -1
- package/lib/Antd5/tour/panelRender.js +7 -13
- package/lib/Antd5/tour/style/index.js +6 -13
- package/lib/Antd5/transfer/ListItem.js +3 -3
- package/lib/Antd5/transfer/hooks/useData.js +1 -1
- package/lib/Antd5/transfer/hooks/useSelection.js +26 -21
- package/lib/Antd5/transfer/style/index.js +12 -22
- package/lib/Antd5/tree/Tree.js +2 -0
- package/lib/Antd5/tree/style/directory.js +39 -0
- package/lib/Antd5/tree/style/index.js +115 -166
- package/lib/Antd5/tree/utils/dropIndicator.js +3 -2
- package/lib/Antd5/tree/utils/iconUtil.js +5 -1
- package/lib/Antd5/tree-select/index.js +47 -43
- package/lib/Antd5/typography/Base/CopyBtn.js +17 -17
- package/lib/Antd5/typography/Base/Ellipsis.js +48 -40
- package/lib/Antd5/typography/Base/index.js +20 -60
- package/lib/Antd5/typography/Base/util.js +31 -1
- package/lib/Antd5/typography/Editable.js +11 -10
- package/lib/Antd5/typography/Title.js +1 -6
- package/lib/Antd5/typography/Typography.js +2 -6
- package/lib/Antd5/typography/hooks/useCopyClick.js +3 -2
- package/lib/Antd5/typography/hooks/usePrevious.js +1 -1
- package/lib/Antd5/typography/hooks/useTooltipProps.js +30 -0
- package/lib/Antd5/typography/style/mixins.js +3 -9
- package/lib/Antd5/version/version.js +1 -1
- package/lib/Antd5/watermark/context.js +1 -1
- package/lib/Antd5/watermark/index.js +35 -18
- package/lib/Antd5/watermark/useClips.js +2 -1
- package/lib/Antd5/watermark/useRafDebounce.js +1 -1
- package/lib/Antd5/watermark/utils.js +1 -1
- package/lib/AppHolder/index.js +2 -1
- package/lib/CWSelect/index.js +39 -1
- package/lib/CWSelect/index.style.js +39 -0
- package/lib/CWTree/index.js +3 -9
- package/lib/CWTree/index.style.js +2 -0
- package/lib/ConfigProvider/ConfigProvider.js +11 -10
- package/lib/ConfigProvider/customTheme.js +6 -0
- package/lib/ConfigProvider/theme/common.js +140 -0
- package/lib/ConfigProvider/theme/dark.js +2 -0
- package/lib/ConfigProvider/theme/default.js +122 -0
- package/lib/ConfigProvider/theme/utils.js +49 -0
- package/lib/Header/UserSetting/TenantTree.js +0 -1
- package/lib/Pagination/index.style.js +1 -1
- package/lib/QuickTransfer/index.js +45 -59
- package/lib/SiderMenu/index.style.js +4 -2
- package/lib/Slider/index.style.js +2 -1
- package/lib/Splitter/index.js +2 -0
- package/package.json +37 -35
- package/lib/Antd5/color-picker/components/PanelPicker.js +0 -53
- package/lib/Antd5/color-picker/hooks/useColorState.js +0 -53
- package/lib/Antd5/layout/style/light.js +0 -24
- package/lib/Antd5/style/operationUnit.js +0 -18
- package/lib/Antd5/theme/util/calc/CSSCalculator.js +0 -119
- package/lib/Antd5/theme/util/calc/NumCalculator.js +0 -81
- package/lib/Antd5/theme/util/calc/calculator.js +0 -10
- package/lib/Antd5/theme/util/calc/index.js +0 -9
- package/lib/Antd5/theme/util/genComponentStyleHook.js +0 -243
- package/lib/Antd5/theme/util/maxmin.js +0 -27
- package/lib/Antd5/theme/util/statistic.js +0 -74
- package/lib/Antd5/typography/hooks/useUpdatedEffect.js +0 -13
- package/lib/Antd5/version/token-meta.json +0 -1
- package/lib/Antd5/version/token.json +0 -1
- package/lib/ConfigProvider/customTheme.json +0 -163
|
@@ -2,7 +2,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { cloneElement, isFragment } from '../_util/reactNode';
|
|
5
|
-
var rxTwoCNChar = /^[\
|
|
5
|
+
var rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
|
|
6
6
|
export var isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
|
7
7
|
export function convertLegacyProps(type) {
|
|
8
8
|
if (type === 'danger') {
|
|
@@ -17,7 +17,7 @@ export function convertLegacyProps(type) {
|
|
|
17
17
|
export function isString(str) {
|
|
18
18
|
return typeof str === 'string';
|
|
19
19
|
}
|
|
20
|
-
export function
|
|
20
|
+
export function isUnBorderedButtonVariant(type) {
|
|
21
21
|
return type === 'text' || type === 'link';
|
|
22
22
|
}
|
|
23
23
|
function splitCNCharsBySpace(child, needInserted) {
|
|
@@ -63,6 +63,8 @@ export function spaceChildren(children, needInserted) {
|
|
|
63
63
|
return splitCNCharsBySpace(child, needInserted);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
66
|
+
var _ButtonTypes = ['default', 'primary', 'dashed', 'link', 'text'];
|
|
67
|
+
var _ButtonShapes = ['default', 'circle', 'round'];
|
|
68
|
+
var _ButtonHTMLTypes = ['submit', 'button', 'reset'];
|
|
69
|
+
export var _ButtonVariantTypes = ['outlined', 'dashed', 'solid', 'filled', 'text', 'link'];
|
|
70
|
+
export var _ButtonColorTypes = ['default', 'primary', 'danger'];
|
|
@@ -1,41 +1,34 @@
|
|
|
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
|
-
// Style as inline component
|
|
6
|
-
import { unit } from '@ant-design/cssinjs';
|
|
7
7
|
import { genCompactItemStyle } from '../../style/compact-item';
|
|
8
8
|
import { genCompactItemVerticalStyle } from '../../style/compact-item-vertical';
|
|
9
9
|
import { genSubStyleComponent } from '../../theme/internal';
|
|
10
10
|
import { prepareComponentToken, prepareToken } from './token';
|
|
11
11
|
var genButtonCompactStyle = function genButtonCompactStyle(token) {
|
|
12
12
|
var componentCls = token.componentCls,
|
|
13
|
+
colorPrimaryHover = token.colorPrimaryHover,
|
|
14
|
+
lineWidth = token.lineWidth,
|
|
13
15
|
calc = token.calc;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
top: calc(token.lineWidth).mul(-1).equal(),
|
|
31
|
-
insetInlineStart: calc(token.lineWidth).mul(-1).equal(),
|
|
32
|
-
display: 'inline-block',
|
|
33
|
-
width: "calc(100% + ".concat(unit(token.lineWidth), " * 2)"),
|
|
34
|
-
height: token.lineWidth,
|
|
35
|
-
backgroundColor: token.colorPrimaryHover,
|
|
36
|
-
content: '""'
|
|
37
|
-
}
|
|
38
|
-
}))));
|
|
16
|
+
var insetOffset = calc(lineWidth).mul(-1).equal();
|
|
17
|
+
var getCompactBorderStyle = function getCompactBorderStyle(vertical) {
|
|
18
|
+
return _defineProperty({}, "".concat(componentCls, "-compact").concat(vertical ? '-vertical' : '', "-item").concat(componentCls, "-primary:not([disabled])"), {
|
|
19
|
+
'& + &::before': {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: vertical ? insetOffset : 0,
|
|
22
|
+
insetInlineStart: vertical ? 0 : insetOffset,
|
|
23
|
+
backgroundColor: colorPrimaryHover,
|
|
24
|
+
content: '""',
|
|
25
|
+
width: vertical ? '100%' : lineWidth,
|
|
26
|
+
height: vertical ? lineWidth : '100%'
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
// Special styles for Primary Button
|
|
31
|
+
return _objectSpread(_objectSpread({}, getCompactBorderStyle()), getCompactBorderStyle(true));
|
|
39
32
|
};
|
|
40
33
|
// ============================== Export ==============================
|
|
41
34
|
export default genSubStyleComponent(['Button', 'compact'], function (token) {
|
|
@@ -36,14 +36,16 @@ var genGroupStyle = function genGroupStyle(token) {
|
|
|
36
36
|
borderStartStartRadius: 0,
|
|
37
37
|
borderEndStartRadius: 0
|
|
38
38
|
})
|
|
39
|
-
}), componentCls,
|
|
39
|
+
}), componentCls, {
|
|
40
40
|
position: 'relative',
|
|
41
|
-
zIndex: 1
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
zIndex: 1,
|
|
42
|
+
'&:hover, &:focus, &:active': {
|
|
43
|
+
zIndex: 2
|
|
44
|
+
},
|
|
45
|
+
'&[disabled]': {
|
|
46
|
+
zIndex: 0
|
|
47
|
+
}
|
|
48
|
+
}), "".concat(componentCls, "-icon-only"), {
|
|
47
49
|
fontSize: fontSize
|
|
48
50
|
}),
|
|
49
51
|
// Border Color
|
|
@@ -14,10 +14,13 @@ var genSharedButtonStyle = function genSharedButtonStyle(token) {
|
|
|
14
14
|
var componentCls = token.componentCls,
|
|
15
15
|
iconCls = token.iconCls,
|
|
16
16
|
fontWeight = token.fontWeight;
|
|
17
|
-
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
|
17
|
+
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
18
18
|
outline: 'none',
|
|
19
19
|
position: 'relative',
|
|
20
|
-
display: 'inline-
|
|
20
|
+
display: 'inline-flex',
|
|
21
|
+
gap: token.marginXS,
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center',
|
|
21
24
|
fontWeight: fontWeight,
|
|
22
25
|
whiteSpace: 'nowrap',
|
|
23
26
|
textAlign: 'center',
|
|
@@ -31,29 +34,18 @@ var genSharedButtonStyle = function genSharedButtonStyle(token) {
|
|
|
31
34
|
color: token.colorText,
|
|
32
35
|
'&:disabled > *': {
|
|
33
36
|
pointerEvents: 'none'
|
|
34
|
-
},
|
|
35
|
-
'> span': {
|
|
36
|
-
display: 'inline-block'
|
|
37
37
|
}
|
|
38
|
-
}, "".concat(componentCls, "-icon"),
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
marginInlineStart: token.marginXS
|
|
42
|
-
})), "> ".concat(iconCls, " + span, > span + ").concat(iconCls), {
|
|
43
|
-
marginInlineStart: token.marginXS
|
|
44
|
-
}), "&:not(".concat(componentCls, "-icon-only) > ").concat(componentCls, "-icon"), _defineProperty(_defineProperty({}, "&".concat(componentCls, "-loading-icon, &:not(:last-child)"), {
|
|
45
|
-
marginInlineEnd: token.marginXS
|
|
46
|
-
}), "&".concat(componentCls, "-loading-icon-end"), {
|
|
47
|
-
marginInlineStart: token.marginXS
|
|
48
|
-
})), '> a', {
|
|
38
|
+
}, "> span, ".concat(componentCls, "-icon"), {
|
|
39
|
+
display: 'inline-flex'
|
|
40
|
+
}), '> a', {
|
|
49
41
|
color: 'currentColor'
|
|
50
42
|
}), '&:not(:disabled)', _objectSpread({}, genFocusStyle(token))), "&".concat(componentCls, "-two-chinese-chars::first-letter"), {
|
|
51
43
|
letterSpacing: '0.34em'
|
|
52
44
|
}), "&".concat(componentCls, "-two-chinese-chars > *:not(").concat(iconCls, ")"), {
|
|
53
45
|
marginInlineEnd: '-0.34em',
|
|
54
46
|
letterSpacing: '0.34em'
|
|
55
|
-
}),
|
|
56
|
-
|
|
47
|
+
}), '&-icon-end', {
|
|
48
|
+
flexDirection: 'row-reverse'
|
|
57
49
|
}));
|
|
58
50
|
};
|
|
59
51
|
var genHoverActiveButtonStyle = function genHoverActiveButtonStyle(btnCls, hoverStyle, activeStyle) {
|
|
@@ -78,7 +70,6 @@ var genRoundButtonStyle = function genRoundButtonStyle(token) {
|
|
|
78
70
|
paddingInlineEnd: token.calc(token.controlHeight).div(2).equal()
|
|
79
71
|
};
|
|
80
72
|
};
|
|
81
|
-
// =============================== Type ===============================
|
|
82
73
|
var genDisabledStyle = function genDisabledStyle(token) {
|
|
83
74
|
return {
|
|
84
75
|
cursor: 'not-allowed',
|
|
@@ -109,119 +100,165 @@ var genGhostButtonStyle = function genGhostButtonStyle(btnCls, background, textC
|
|
|
109
100
|
var genSolidDisabledButtonStyle = function genSolidDisabledButtonStyle(token) {
|
|
110
101
|
return _defineProperty({}, "&:disabled, &".concat(token.componentCls, "-disabled"), _objectSpread({}, genDisabledStyle(token)));
|
|
111
102
|
};
|
|
112
|
-
var genSolidButtonStyle = function genSolidButtonStyle(token) {
|
|
113
|
-
return _objectSpread({}, genSolidDisabledButtonStyle(token));
|
|
114
|
-
};
|
|
115
103
|
var genPureDisabledButtonStyle = function genPureDisabledButtonStyle(token) {
|
|
116
104
|
return _defineProperty({}, "&:disabled, &".concat(token.componentCls, "-disabled"), {
|
|
117
105
|
cursor: 'not-allowed',
|
|
118
106
|
color: token.colorTextDisabled
|
|
119
107
|
});
|
|
120
108
|
};
|
|
121
|
-
//
|
|
109
|
+
// ============================== Variant =============================
|
|
110
|
+
var genVariantButtonStyle = function genVariantButtonStyle(token, hoverStyle, activeStyle, variant) {
|
|
111
|
+
var isPureDisabled = variant && ['link', 'text'].includes(variant);
|
|
112
|
+
var genDisabledButtonStyle = isPureDisabled ? genPureDisabledButtonStyle : genSolidDisabledButtonStyle;
|
|
113
|
+
return _objectSpread(_objectSpread({}, genDisabledButtonStyle(token)), genHoverActiveButtonStyle(token.componentCls, hoverStyle, activeStyle));
|
|
114
|
+
};
|
|
115
|
+
var genSolidButtonStyle = function genSolidButtonStyle(token, textColor, background, hoverStyle, activeStyle) {
|
|
116
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-variant-solid"), _objectSpread({
|
|
117
|
+
color: textColor,
|
|
118
|
+
background: background
|
|
119
|
+
}, genVariantButtonStyle(token, hoverStyle, activeStyle)));
|
|
120
|
+
};
|
|
121
|
+
var genOutlinedDashedButtonStyle = function genOutlinedDashedButtonStyle(token, borderColor, background, hoverStyle, activeStyle) {
|
|
122
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-variant-outlined, &").concat(token.componentCls, "-variant-dashed"), _objectSpread({
|
|
123
|
+
borderColor: borderColor,
|
|
124
|
+
background: background
|
|
125
|
+
}, genVariantButtonStyle(token, hoverStyle, activeStyle)));
|
|
126
|
+
};
|
|
127
|
+
var genDashedButtonStyle = function genDashedButtonStyle(token) {
|
|
128
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-variant-dashed"), {
|
|
129
|
+
borderStyle: 'dashed'
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var genFilledButtonStyle = function genFilledButtonStyle(token, background, hoverStyle, activeStyle) {
|
|
133
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-variant-filled"), _objectSpread({
|
|
134
|
+
boxShadow: 'none',
|
|
135
|
+
background: background
|
|
136
|
+
}, genVariantButtonStyle(token, hoverStyle, activeStyle)));
|
|
137
|
+
};
|
|
138
|
+
var genTextLinkButtonStyle = function genTextLinkButtonStyle(token, textColor, variant, hoverStyle, activeStyle) {
|
|
139
|
+
return _defineProperty({}, "&".concat(token.componentCls, "-variant-").concat(variant), _objectSpread({
|
|
140
|
+
color: textColor,
|
|
141
|
+
boxShadow: 'none'
|
|
142
|
+
}, genVariantButtonStyle(token, hoverStyle, activeStyle, variant)));
|
|
143
|
+
};
|
|
144
|
+
// =============================== Color ==============================
|
|
122
145
|
var genDefaultButtonStyle = function genDefaultButtonStyle(token) {
|
|
123
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
124
|
-
background: token.defaultBg,
|
|
125
|
-
borderColor: token.defaultBorderColor,
|
|
146
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
126
147
|
color: token.defaultColor,
|
|
127
148
|
boxShadow: token.defaultShadow
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
borderColor: token.defaultHoverBorderColor,
|
|
131
|
-
background: token.defaultHoverBg
|
|
149
|
+
}, genSolidButtonStyle(token, token.solidTextColor, token.colorBgSolid, {
|
|
150
|
+
background: token.colorBgSolidHover
|
|
132
151
|
}, {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
background: token.
|
|
136
|
-
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder)), {}, _defineProperty({}, "&".concat(token.componentCls, "-dangerous"), _objectSpread(_objectSpread(_objectSpread({
|
|
137
|
-
color: token.colorError,
|
|
138
|
-
borderColor: token.colorError
|
|
139
|
-
}, genHoverActiveButtonStyle(token.componentCls, {
|
|
140
|
-
color: token.colorErrorHover,
|
|
141
|
-
borderColor: token.colorErrorBorderHover
|
|
152
|
+
background: token.colorBgSolidActive
|
|
153
|
+
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorFillTertiary, {
|
|
154
|
+
background: token.colorFillSecondary
|
|
142
155
|
}, {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
background: token.colorFill
|
|
157
|
+
})), genTextLinkButtonStyle(token, token.textTextColor, 'link', {
|
|
158
|
+
color: token.colorLinkHover,
|
|
159
|
+
background: token.linkHoverBg
|
|
160
|
+
}, {
|
|
161
|
+
color: token.colorLinkActive
|
|
162
|
+
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.defaultGhostColor, token.defaultGhostBorderColor, token.colorTextDisabled, token.colorBorder));
|
|
146
163
|
};
|
|
147
|
-
// Type: Primary
|
|
148
164
|
var genPrimaryButtonStyle = function genPrimaryButtonStyle(token) {
|
|
149
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
150
|
-
color: token.
|
|
151
|
-
background: token.colorPrimary,
|
|
165
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
166
|
+
color: token.colorPrimary,
|
|
152
167
|
boxShadow: token.primaryShadow
|
|
153
|
-
},
|
|
154
|
-
color: token.
|
|
155
|
-
|
|
168
|
+
}, genOutlinedDashedButtonStyle(token, token.colorPrimary, token.colorBgContainer, {
|
|
169
|
+
color: token.colorPrimaryTextHover,
|
|
170
|
+
borderColor: token.colorPrimaryHover,
|
|
171
|
+
background: token.colorBgContainer
|
|
172
|
+
}, {
|
|
173
|
+
color: token.colorPrimaryTextActive,
|
|
174
|
+
borderColor: token.colorPrimaryActive,
|
|
175
|
+
background: token.colorBgContainer
|
|
176
|
+
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorPrimaryBg, {
|
|
177
|
+
background: token.colorPrimaryBgHover
|
|
156
178
|
}, {
|
|
157
|
-
|
|
158
|
-
|
|
179
|
+
background: token.colorPrimaryBorder
|
|
180
|
+
})), genTextLinkButtonStyle(token, token.colorLink, 'text', {
|
|
181
|
+
color: token.colorPrimaryTextHover,
|
|
182
|
+
background: token.colorPrimaryBg
|
|
183
|
+
}, {
|
|
184
|
+
color: token.colorPrimaryTextActive,
|
|
185
|
+
background: token.colorPrimaryBorder
|
|
159
186
|
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.colorPrimary, token.colorPrimary, token.colorTextDisabled, token.colorBorder, {
|
|
160
187
|
color: token.colorPrimaryHover,
|
|
161
188
|
borderColor: token.colorPrimaryHover
|
|
162
189
|
}, {
|
|
163
190
|
color: token.colorPrimaryActive,
|
|
164
191
|
borderColor: token.colorPrimaryActive
|
|
165
|
-
}))
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
192
|
+
}));
|
|
193
|
+
};
|
|
194
|
+
var genDangerousStyle = function genDangerousStyle(token) {
|
|
195
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
196
|
+
color: token.colorError,
|
|
197
|
+
boxShadow: token.dangerShadow
|
|
198
|
+
}, genSolidButtonStyle(token, token.dangerColor, token.colorError, {
|
|
170
199
|
background: token.colorErrorHover
|
|
171
200
|
}, {
|
|
172
201
|
background: token.colorErrorActive
|
|
173
|
-
})),
|
|
202
|
+
})), genOutlinedDashedButtonStyle(token, token.colorError, token.colorBgContainer, {
|
|
174
203
|
color: token.colorErrorHover,
|
|
175
|
-
borderColor: token.
|
|
204
|
+
borderColor: token.colorErrorBorderHover
|
|
176
205
|
}, {
|
|
177
206
|
color: token.colorErrorActive,
|
|
178
207
|
borderColor: token.colorErrorActive
|
|
179
|
-
})),
|
|
180
|
-
|
|
181
|
-
// Type: Dashed
|
|
182
|
-
var genDashedButtonStyle = function genDashedButtonStyle(token) {
|
|
183
|
-
return _objectSpread(_objectSpread({}, genDefaultButtonStyle(token)), {}, {
|
|
184
|
-
borderStyle: 'dashed'
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
// Type: Link
|
|
188
|
-
var genLinkButtonStyle = function genLinkButtonStyle(token) {
|
|
189
|
-
return _objectSpread(_objectSpread(_objectSpread({
|
|
190
|
-
color: token.colorLink
|
|
191
|
-
}, genHoverActiveButtonStyle(token.componentCls, {
|
|
192
|
-
color: token.colorLinkHover,
|
|
193
|
-
background: token.linkHoverBg
|
|
208
|
+
})), genDashedButtonStyle(token)), genFilledButtonStyle(token, token.colorErrorBg, {
|
|
209
|
+
background: token.colorErrorBgFilledHover
|
|
194
210
|
}, {
|
|
195
|
-
|
|
196
|
-
})),
|
|
197
|
-
color: token.
|
|
198
|
-
|
|
211
|
+
background: token.colorErrorBgActive
|
|
212
|
+
})), genTextLinkButtonStyle(token, token.colorError, 'text', {
|
|
213
|
+
color: token.colorErrorHover,
|
|
214
|
+
background: token.colorErrorBg
|
|
215
|
+
}, {
|
|
216
|
+
color: token.colorErrorHover,
|
|
217
|
+
background: token.colorErrorBgActive
|
|
218
|
+
})), genTextLinkButtonStyle(token, token.colorError, 'link', {
|
|
199
219
|
color: token.colorErrorHover
|
|
200
220
|
}, {
|
|
201
221
|
color: token.colorErrorActive
|
|
202
|
-
})),
|
|
222
|
+
})), genGhostButtonStyle(token.componentCls, token.ghostBg, token.colorError, token.colorError, token.colorTextDisabled, token.colorBorder, {
|
|
223
|
+
color: token.colorErrorHover,
|
|
224
|
+
borderColor: token.colorErrorHover
|
|
225
|
+
}, {
|
|
226
|
+
color: token.colorErrorActive,
|
|
227
|
+
borderColor: token.colorErrorActive
|
|
228
|
+
}));
|
|
203
229
|
};
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
return
|
|
207
|
-
|
|
230
|
+
var genColorButtonStyle = function genColorButtonStyle(token) {
|
|
231
|
+
var componentCls = token.componentCls;
|
|
232
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-color-default"), genDefaultButtonStyle(token)), "".concat(componentCls, "-color-primary"), genPrimaryButtonStyle(token)), "".concat(componentCls, "-color-dangerous"), genDangerousStyle(token));
|
|
233
|
+
};
|
|
234
|
+
// =========== Compatible with versions earlier than 5.21.0 ===========
|
|
235
|
+
var genCompatibleButtonStyle = function genCompatibleButtonStyle(token) {
|
|
236
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, genOutlinedDashedButtonStyle(token, token.defaultBorderColor, token.defaultBg, {
|
|
237
|
+
color: token.defaultHoverColor,
|
|
238
|
+
borderColor: token.defaultHoverBorderColor,
|
|
239
|
+
background: token.defaultHoverBg
|
|
240
|
+
}, {
|
|
241
|
+
color: token.defaultActiveColor,
|
|
242
|
+
borderColor: token.defaultActiveBorderColor,
|
|
243
|
+
background: token.defaultActiveBg
|
|
244
|
+
})), genTextLinkButtonStyle(token, token.textTextColor, 'text', {
|
|
245
|
+
color: token.textTextHoverColor,
|
|
208
246
|
background: token.textHoverBg
|
|
209
247
|
}, {
|
|
210
|
-
color: token.
|
|
248
|
+
color: token.textTextActiveColor,
|
|
211
249
|
background: token.colorBgTextActive
|
|
212
|
-
})),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
color: token.colorErrorHover,
|
|
216
|
-
background: token.colorErrorBg
|
|
250
|
+
})), genSolidButtonStyle(token, token.primaryColor, token.colorPrimary, {
|
|
251
|
+
background: token.colorPrimaryHover,
|
|
252
|
+
color: token.primaryColor
|
|
217
253
|
}, {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}))
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
254
|
+
background: token.colorPrimaryActive,
|
|
255
|
+
color: token.primaryColor
|
|
256
|
+
})), genTextLinkButtonStyle(token, token.colorLink, 'link', {
|
|
257
|
+
color: token.colorLinkHover,
|
|
258
|
+
background: token.linkHoverBg
|
|
259
|
+
}, {
|
|
260
|
+
color: token.colorLinkActive
|
|
261
|
+
}));
|
|
225
262
|
};
|
|
226
263
|
// =============================== Size ===============================
|
|
227
264
|
var genButtonStyle = function genButtonStyle(token) {
|
|
@@ -233,30 +270,31 @@ var genButtonStyle = function genButtonStyle(token) {
|
|
|
233
270
|
borderRadius = token.borderRadius,
|
|
234
271
|
buttonPaddingHorizontal = token.buttonPaddingHorizontal,
|
|
235
272
|
iconCls = token.iconCls,
|
|
236
|
-
buttonPaddingVertical = token.buttonPaddingVertical
|
|
237
|
-
|
|
238
|
-
|
|
273
|
+
buttonPaddingVertical = token.buttonPaddingVertical,
|
|
274
|
+
motionDurationSlow = token.motionDurationSlow,
|
|
275
|
+
motionEaseInOut = token.motionEaseInOut,
|
|
276
|
+
buttonIconOnlyFontSize = token.buttonIconOnlyFontSize,
|
|
277
|
+
opacityLoading = token.opacityLoading;
|
|
278
|
+
return [_defineProperty({}, prefixCls, _defineProperty(_defineProperty(_defineProperty({
|
|
239
279
|
fontSize: fontSize,
|
|
240
280
|
lineHeight: lineHeight,
|
|
241
281
|
height: controlHeight,
|
|
242
282
|
padding: "".concat(unit(buttonPaddingVertical), " ").concat(unit(buttonPaddingHorizontal)),
|
|
243
283
|
borderRadius: borderRadius
|
|
244
|
-
}, "&".concat(
|
|
245
|
-
display: 'inline-flex',
|
|
246
|
-
alignItems: 'center',
|
|
247
|
-
justifyContent: 'center',
|
|
284
|
+
}, "&".concat(componentCls, "-icon-only"), _defineProperty(_defineProperty(_defineProperty({
|
|
248
285
|
width: controlHeight,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
286
|
+
paddingInline: 0
|
|
287
|
+
}, "&".concat(componentCls, "-compact-item"), {
|
|
288
|
+
flex: 'none'
|
|
289
|
+
}), "&".concat(componentCls, "-round"), {
|
|
252
290
|
width: 'auto'
|
|
253
291
|
}), iconCls, {
|
|
254
|
-
fontSize:
|
|
292
|
+
fontSize: buttonIconOnlyFontSize
|
|
255
293
|
})), "&".concat(componentCls, "-loading"), {
|
|
256
|
-
opacity:
|
|
294
|
+
opacity: opacityLoading,
|
|
257
295
|
cursor: 'default'
|
|
258
296
|
}), "".concat(componentCls, "-loading-icon"), {
|
|
259
|
-
transition: "width ".concat(
|
|
297
|
+
transition: "width ".concat(motionDurationSlow, " ").concat(motionEaseInOut, ", opacity ").concat(motionDurationSlow, " ").concat(motionEaseInOut)
|
|
260
298
|
})), // Shape - patch prefixCls again to override solid border radius style
|
|
261
299
|
_defineProperty({}, "".concat(componentCls).concat(componentCls, "-circle").concat(prefixCls), genCircleButtonStyle(token)), _defineProperty({}, "".concat(componentCls).concat(componentCls, "-round").concat(prefixCls), genRoundButtonStyle(token))];
|
|
262
300
|
};
|
|
@@ -308,8 +346,10 @@ export default genStyleHooks('Button', function (token) {
|
|
|
308
346
|
genSizeBaseButtonStyle(buttonToken), genSizeSmallButtonStyle(buttonToken), genSizeLargeButtonStyle(buttonToken),
|
|
309
347
|
// Block
|
|
310
348
|
genBlockButtonStyle(buttonToken),
|
|
311
|
-
//
|
|
312
|
-
|
|
349
|
+
// Color
|
|
350
|
+
genColorButtonStyle(buttonToken),
|
|
351
|
+
// https://github.com/ant-design/ant-design/issues/50969
|
|
352
|
+
genCompatibleButtonStyle(buttonToken),
|
|
313
353
|
// Button Group
|
|
314
354
|
genGroupStyle(buttonToken)];
|
|
315
355
|
}, prepareComponentToken, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AggregationColor } from '../../color-picker/color';
|
|
2
|
+
import { isBright } from '../../color-picker/components/ColorPresets';
|
|
1
3
|
import { getLineHeight, mergeToken } from '../../theme/internal';
|
|
2
4
|
export var prepareToken = function prepareToken(token) {
|
|
3
5
|
var paddingInline = token.paddingInline,
|
|
@@ -18,6 +20,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
18
20
|
var contentLineHeight = (_token$contentLineHei = token.contentLineHeight) !== null && _token$contentLineHei !== void 0 ? _token$contentLineHei : getLineHeight(contentFontSize);
|
|
19
21
|
var contentLineHeightSM = (_token$contentLineHei2 = token.contentLineHeightSM) !== null && _token$contentLineHei2 !== void 0 ? _token$contentLineHei2 : getLineHeight(contentFontSizeSM);
|
|
20
22
|
var contentLineHeightLG = (_token$contentLineHei3 = token.contentLineHeightLG) !== null && _token$contentLineHei3 !== void 0 ? _token$contentLineHei3 : getLineHeight(contentFontSizeLG);
|
|
23
|
+
var solidTextColor = isBright(new AggregationColor(token.colorBgSolid), '#fff') ? '#000' : '#fff';
|
|
21
24
|
return {
|
|
22
25
|
fontWeight: 400,
|
|
23
26
|
defaultShadow: "0 ".concat(token.controlOutlineWidth, "px 0 ").concat(token.controlTmpOutline),
|
|
@@ -37,7 +40,10 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
37
40
|
onlyIconSizeLG: token.fontSizeLG + 2,
|
|
38
41
|
groupBorderColor: token.colorPrimaryHover,
|
|
39
42
|
linkHoverBg: 'transparent',
|
|
40
|
-
|
|
43
|
+
textTextColor: token.colorText,
|
|
44
|
+
textTextHoverColor: token.colorText,
|
|
45
|
+
textTextActiveColor: token.colorText,
|
|
46
|
+
textHoverBg: token.colorFillTertiary,
|
|
41
47
|
defaultColor: token.colorText,
|
|
42
48
|
defaultBg: token.colorBgContainer,
|
|
43
49
|
defaultBorderColor: token.colorBorder,
|
|
@@ -48,6 +54,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
48
54
|
defaultActiveBg: token.colorBgContainer,
|
|
49
55
|
defaultActiveColor: token.colorPrimaryActive,
|
|
50
56
|
defaultActiveBorderColor: token.colorPrimaryActive,
|
|
57
|
+
solidTextColor: solidTextColor,
|
|
51
58
|
contentFontSize: contentFontSize,
|
|
52
59
|
contentFontSizeSM: contentFontSizeSM,
|
|
53
60
|
contentFontSizeLG: contentFontSizeLG,
|
|
@@ -21,16 +21,19 @@ import { useLocale } from '../locale';
|
|
|
21
21
|
import CalendarHeader from './Header';
|
|
22
22
|
import enUS from './locale/en_US';
|
|
23
23
|
import useStyle from './style';
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
var isSameYear = function isSameYear(date1, date2, config) {
|
|
25
|
+
var getYear = config.getYear;
|
|
26
|
+
return date1 && date2 && getYear(date1) === getYear(date2);
|
|
27
|
+
};
|
|
28
|
+
var isSameMonth = function isSameMonth(date1, date2, config) {
|
|
29
|
+
var getMonth = config.getMonth;
|
|
30
|
+
return isSameYear(date1, date2, config) && getMonth(date1) === getMonth(date2);
|
|
31
|
+
};
|
|
32
|
+
var isSameDate = function isSameDate(date1, date2, config) {
|
|
33
|
+
var getDate = config.getDate;
|
|
34
|
+
return isSameMonth(date1, date2, config) && getDate(date1) === getDate(date2);
|
|
35
|
+
};
|
|
36
|
+
var generateCalendar = function generateCalendar(generateConfig) {
|
|
34
37
|
var Calendar = function Calendar(props) {
|
|
35
38
|
var customizePrefixCls = props.prefixCls,
|
|
36
39
|
className = props.className,
|
|
@@ -105,9 +108,9 @@ function generateCalendar(generateConfig) {
|
|
|
105
108
|
};
|
|
106
109
|
var triggerChange = function triggerChange(date) {
|
|
107
110
|
setMergedValue(date);
|
|
108
|
-
if (!isSameDate(date, mergedValue)) {
|
|
111
|
+
if (!isSameDate(date, mergedValue, generateConfig)) {
|
|
109
112
|
// Trigger when month panel switch month
|
|
110
|
-
if (panelMode === 'date' && !isSameMonth(date, mergedValue) || panelMode === 'month' && !isSameYear(date, mergedValue)) {
|
|
113
|
+
if (panelMode === 'date' && !isSameMonth(date, mergedValue, generateConfig) || panelMode === 'month' && !isSameYear(date, mergedValue, generateConfig)) {
|
|
111
114
|
triggerPanelChange(date, mergedMode);
|
|
112
115
|
}
|
|
113
116
|
onChange === null || onChange === void 0 || onChange(date);
|
|
@@ -123,13 +126,6 @@ function generateCalendar(generateConfig) {
|
|
|
123
126
|
source: source
|
|
124
127
|
});
|
|
125
128
|
};
|
|
126
|
-
// ====================== Locale ======================
|
|
127
|
-
var getDefaultLocale = function getDefaultLocale() {
|
|
128
|
-
var locale = props.locale;
|
|
129
|
-
var result = _objectSpread(_objectSpread({}, enUS), locale);
|
|
130
|
-
result.lang = _objectSpread(_objectSpread({}, result.lang), (locale || {}).lang);
|
|
131
|
-
return result;
|
|
132
|
-
};
|
|
133
129
|
// ====================== Render ======================
|
|
134
130
|
var dateRender = React.useCallback(function (date, info) {
|
|
135
131
|
if (fullCellRender) {
|
|
@@ -139,13 +135,13 @@ function generateCalendar(generateConfig) {
|
|
|
139
135
|
return dateFullCellRender(date);
|
|
140
136
|
}
|
|
141
137
|
return _jsxs("div", {
|
|
142
|
-
className: classNames("".concat(prefixCls, "-cell-inner"), "".concat(calendarPrefixCls, "-date"), _defineProperty({}, "".concat(calendarPrefixCls, "-date-today"), isSameDate(today, date))),
|
|
138
|
+
className: classNames("".concat(prefixCls, "-cell-inner"), "".concat(calendarPrefixCls, "-date"), _defineProperty({}, "".concat(calendarPrefixCls, "-date-today"), isSameDate(today, date, generateConfig))),
|
|
143
139
|
children: [_jsx("div", {
|
|
144
140
|
className: "".concat(calendarPrefixCls, "-date-value"),
|
|
145
141
|
children: String(generateConfig.getDate(date)).padStart(2, '0')
|
|
146
142
|
}), _jsx("div", {
|
|
147
143
|
className: "".concat(calendarPrefixCls, "-date-content"),
|
|
148
|
-
children: cellRender ? cellRender(date, info) : dateCellRender
|
|
144
|
+
children: cellRender ? cellRender(date, info) : dateCellRender === null || dateCellRender === void 0 ? void 0 : dateCellRender(date)
|
|
149
145
|
})]
|
|
150
146
|
});
|
|
151
147
|
}, [dateFullCellRender, dateCellRender, cellRender, fullCellRender]);
|
|
@@ -158,26 +154,27 @@ function generateCalendar(generateConfig) {
|
|
|
158
154
|
}
|
|
159
155
|
var months = info.locale.shortMonths || generateConfig.locale.getShortMonths(info.locale.locale);
|
|
160
156
|
return _jsxs("div", {
|
|
161
|
-
className: classNames("".concat(prefixCls, "-cell-inner"), "".concat(calendarPrefixCls, "-date"), _defineProperty({}, "".concat(calendarPrefixCls, "-date-today"), isSameMonth(today, date))),
|
|
157
|
+
className: classNames("".concat(prefixCls, "-cell-inner"), "".concat(calendarPrefixCls, "-date"), _defineProperty({}, "".concat(calendarPrefixCls, "-date-today"), isSameMonth(today, date, generateConfig))),
|
|
162
158
|
children: [_jsx("div", {
|
|
163
159
|
className: "".concat(calendarPrefixCls, "-date-value"),
|
|
164
160
|
children: months[generateConfig.getMonth(date)]
|
|
165
161
|
}), _jsx("div", {
|
|
166
162
|
className: "".concat(calendarPrefixCls, "-date-content"),
|
|
167
|
-
children: cellRender ? cellRender(date, info) : monthCellRender
|
|
163
|
+
children: cellRender ? cellRender(date, info) : monthCellRender === null || monthCellRender === void 0 ? void 0 : monthCellRender(date)
|
|
168
164
|
})]
|
|
169
165
|
});
|
|
170
166
|
}, [monthFullCellRender, monthCellRender, cellRender, fullCellRender]);
|
|
171
|
-
var _useLocale = useLocale('Calendar',
|
|
167
|
+
var _useLocale = useLocale('Calendar', enUS),
|
|
172
168
|
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
173
169
|
contextLocale = _useLocale2[0];
|
|
170
|
+
var locale = _objectSpread(_objectSpread({}, contextLocale), props.locale);
|
|
174
171
|
var mergedCellRender = function mergedCellRender(current, info) {
|
|
175
172
|
if (info.type === 'date') {
|
|
176
173
|
return dateRender(current, info);
|
|
177
174
|
}
|
|
178
175
|
if (info.type === 'month') {
|
|
179
176
|
return monthRender(current, _objectSpread(_objectSpread({}, info), {}, {
|
|
180
|
-
locale:
|
|
177
|
+
locale: locale === null || locale === void 0 ? void 0 : locale.lang
|
|
181
178
|
}));
|
|
182
179
|
}
|
|
183
180
|
};
|
|
@@ -197,14 +194,14 @@ function generateCalendar(generateConfig) {
|
|
|
197
194
|
generateConfig: generateConfig,
|
|
198
195
|
mode: mergedMode,
|
|
199
196
|
fullscreen: fullscreen,
|
|
200
|
-
locale:
|
|
197
|
+
locale: locale === null || locale === void 0 ? void 0 : locale.lang,
|
|
201
198
|
validRange: validRange,
|
|
202
199
|
onChange: onInternalSelect,
|
|
203
200
|
onModeChange: triggerModeChange
|
|
204
201
|
}), _jsx(RCPickerPanel, {
|
|
205
202
|
value: mergedValue,
|
|
206
203
|
prefixCls: prefixCls,
|
|
207
|
-
locale:
|
|
204
|
+
locale: locale === null || locale === void 0 ? void 0 : locale.lang,
|
|
208
205
|
generateConfig: generateConfig,
|
|
209
206
|
cellRender: mergedCellRender,
|
|
210
207
|
onSelect: function onSelect(nextDate) {
|
|
@@ -221,5 +218,5 @@ function generateCalendar(generateConfig) {
|
|
|
221
218
|
Calendar.displayName = 'Calendar';
|
|
222
219
|
}
|
|
223
220
|
return Calendar;
|
|
224
|
-
}
|
|
221
|
+
};
|
|
225
222
|
export default generateCalendar;
|