@chaoswise/ui 3.0.22 → 3.1.0
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/Alert/index.js +48 -2
- package/lib/Alert/index.style.js +36 -0
- 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 +5 -4
- 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 +2 -2
- 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 +11 -5
- package/lib/Antd5/checkbox/style/index.js +6 -3
- 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/message/PurePanel.js +22 -40
- package/lib/Antd5/message/style/index.js +8 -47
- package/lib/Antd5/message/useMessage.js +3 -15
- 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/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/{message/assets/Close.js → typography/hooks/useTooltipProps.js} +24 -16
- package/lib/Antd5/typography/style/mixins.js +3 -9
- package/lib/Antd5/upload/Upload.js +55 -83
- package/lib/Antd5/upload/UploadList/ListItem.js +15 -9
- package/lib/Antd5/upload/UploadList/index.js +33 -47
- package/lib/Antd5/upload/style/dragger.js +5 -26
- package/lib/Antd5/upload/style/list.js +2 -7
- 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/Button/index.style.js +1 -3
- 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 +9 -10
- package/lib/ConfigProvider/customTheme.js +9 -2
- package/lib/ConfigProvider/theme/common.js +140 -0
- package/lib/ConfigProvider/theme/dark.js +2 -0
- package/lib/ConfigProvider/theme/default.js +115 -0
- package/lib/ConfigProvider/theme/utils.js +49 -0
- package/lib/QuickTransfer/index.js +44 -48
- package/lib/RangePicker/components/ExtraQuickSelect.js +1 -4
- package/lib/RangePicker/index.js +38 -26
- package/lib/RangePicker/utils/generate/dayjs.js +1 -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
|
@@ -20,14 +20,15 @@ import SlickCarousel from '@ant-design/react-slick';
|
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import { ConfigContext } from '../config-provider';
|
|
22
22
|
import useStyle from './style';
|
|
23
|
-
|
|
23
|
+
var dotsClass = 'slick-dots';
|
|
24
|
+
var ArrowButton = function ArrowButton(_ref) {
|
|
24
25
|
var currentSlide = _ref.currentSlide,
|
|
25
26
|
slideCount = _ref.slideCount,
|
|
26
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
return _jsx("button", _objectSpread({
|
|
28
29
|
type: "button"
|
|
29
30
|
}, rest));
|
|
30
|
-
}
|
|
31
|
+
};
|
|
31
32
|
var Carousel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
32
33
|
var _props$dots = props.dots,
|
|
33
34
|
dots = _props$dots === void 0 ? true : _props$dots,
|
|
@@ -88,7 +89,6 @@ var Carousel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
89
|
newProps.fade = true;
|
|
89
90
|
}
|
|
90
91
|
var prefixCls = getPrefixCls('carousel', newProps.prefixCls);
|
|
91
|
-
var dotsClass = 'slick-dots';
|
|
92
92
|
var enableDots = !!dots;
|
|
93
93
|
var dsClass = classNames(dotsClass, "".concat(dotsClass, "-").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);
|
|
94
94
|
var _useStyle = useStyle(prefixCls),
|
|
@@ -86,7 +86,7 @@ var genArrowsStyle = function genArrowsStyle(token) {
|
|
|
86
86
|
motionDurationSlow = token.motionDurationSlow,
|
|
87
87
|
arrowSize = token.arrowSize,
|
|
88
88
|
arrowOffset = token.arrowOffset;
|
|
89
|
-
var arrowLength = token.calc(arrowSize).div(
|
|
89
|
+
var arrowLength = token.calc(arrowSize).div(Math.SQRT2).equal();
|
|
90
90
|
return [_defineProperty({}, componentCls, {
|
|
91
91
|
// Arrows
|
|
92
92
|
'.slick-prev, .slick-next': {
|
|
@@ -15,6 +15,7 @@ import * as React from 'react';
|
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import { Panel } from 'rc-cascader';
|
|
17
17
|
import DefaultRenderEmpty from '../config-provider/defaultRenderEmpty';
|
|
18
|
+
import DisabledContext from '../config-provider/DisabledContext';
|
|
18
19
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
19
20
|
import useBase from './hooks/useBase';
|
|
20
21
|
import useCheckable from './hooks/useCheckable';
|
|
@@ -28,7 +29,10 @@ function CascaderPanel(props) {
|
|
|
28
29
|
rootClassName = props.rootClassName,
|
|
29
30
|
notFoundContent = props.notFoundContent,
|
|
30
31
|
direction = props.direction,
|
|
31
|
-
expandIcon = props.expandIcon
|
|
32
|
+
expandIcon = props.expandIcon,
|
|
33
|
+
customDisabled = props.disabled;
|
|
34
|
+
var disabled = React.useContext(DisabledContext);
|
|
35
|
+
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
32
36
|
var _useBase = useBase(customizePrefixCls, direction),
|
|
33
37
|
_useBase2 = _slicedToArray(_useBase, 4),
|
|
34
38
|
prefixCls = _useBase2[0],
|
|
@@ -62,7 +66,8 @@ function CascaderPanel(props) {
|
|
|
62
66
|
notFoundContent: mergedNotFoundContent,
|
|
63
67
|
direction: mergedDirection,
|
|
64
68
|
expandIcon: mergedExpandIcon,
|
|
65
|
-
loadingIcon: loadingIcon
|
|
69
|
+
loadingIcon: loadingIcon,
|
|
70
|
+
disabled: mergedDisabled
|
|
66
71
|
})));
|
|
67
72
|
}
|
|
68
73
|
export default CascaderPanel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConfigContext } from '../../config-provider';
|
|
3
|
-
|
|
3
|
+
function useBase(customizePrefixCls, direction) {
|
|
4
4
|
var _React$useContext = React.useContext(ConfigContext),
|
|
5
5
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
6
6
|
rootDirection = _React$useContext.direction,
|
|
@@ -9,4 +9,5 @@ export default function useBase(customizePrefixCls, direction) {
|
|
|
9
9
|
var prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
10
10
|
var cascaderPrefixCls = getPrefixCls('cascader', customizePrefixCls);
|
|
11
11
|
return [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty];
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export default useBase;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import LeftOutlined from '@ant-design/icons/LeftOutlined';
|
|
4
4
|
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
|
5
5
|
import RightOutlined from '@ant-design/icons/RightOutlined';
|
|
6
|
-
|
|
6
|
+
var useColumnIcons = function useColumnIcons(prefixCls, rtl, expandIcon) {
|
|
7
7
|
var mergedExpandIcon = expandIcon;
|
|
8
8
|
if (!expandIcon) {
|
|
9
9
|
mergedExpandIcon = rtl ? _jsx(LeftOutlined, {}) : _jsx(RightOutlined, {});
|
|
@@ -14,5 +14,8 @@ export default function useColumnIcons(prefixCls, rtl, expandIcon) {
|
|
|
14
14
|
spin: true
|
|
15
15
|
})
|
|
16
16
|
});
|
|
17
|
-
return
|
|
18
|
-
|
|
17
|
+
return React.useMemo(function () {
|
|
18
|
+
return [mergedExpandIcon, loadingIcon];
|
|
19
|
+
}, [mergedExpandIcon]);
|
|
20
|
+
};
|
|
21
|
+
export default useColumnIcons;
|
|
@@ -156,7 +156,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
156
156
|
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
157
157
|
compactSize = _useCompactItemContex.compactSize,
|
|
158
158
|
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
159
|
-
var _useVariant = useVariant(customVariant, bordered),
|
|
159
|
+
var _useVariant = useVariant('cascader', customVariant, bordered),
|
|
160
160
|
_useVariant2 = _slicedToArray(_useVariant, 2),
|
|
161
161
|
variant = _useVariant2[0],
|
|
162
162
|
enableVariantCls = _useVariant2[1];
|
|
@@ -69,10 +69,12 @@ var getColumnsStyle = function getColumnsStyle(token) {
|
|
|
69
69
|
}, iconCls, {
|
|
70
70
|
color: token.colorTextDisabled
|
|
71
71
|
})
|
|
72
|
-
}, "&-active:not(".concat(cascaderMenuItemCls, "-disabled)"),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
}, "&-active:not(".concat(cascaderMenuItemCls, "-disabled)"), {
|
|
73
|
+
'&, &:hover': {
|
|
74
|
+
fontWeight: token.optionSelectedFontWeight,
|
|
75
|
+
backgroundColor: token.optionSelectedBg
|
|
76
|
+
}
|
|
77
|
+
}), '&-content', {
|
|
76
78
|
flex: 'auto'
|
|
77
79
|
}), iconCls, {
|
|
78
80
|
marginInlineStart: token.paddingXXS,
|
|
@@ -17,6 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import RcCheckbox from 'rc-checkbox';
|
|
20
|
+
import { composeRef } from 'rc-util/lib/ref';
|
|
20
21
|
import { devUseWarning } from '../_util/warning';
|
|
21
22
|
import Wave from '../_util/wave';
|
|
22
23
|
import { TARGET_CLS } from '../_util/wave/interface';
|
|
@@ -51,6 +52,8 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
51
52
|
var contextDisabled = React.useContext(DisabledContext);
|
|
52
53
|
var mergedDisabled = (_ref = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _ref !== void 0 ? _ref : contextDisabled;
|
|
53
54
|
var prevValue = React.useRef(restProps.value);
|
|
55
|
+
var checkboxRef = React.useRef(null);
|
|
56
|
+
var mergedRef = composeRef(ref, checkboxRef);
|
|
54
57
|
if (process.env.NODE_ENV !== 'production') {
|
|
55
58
|
var warning = devUseWarning('Checkbox');
|
|
56
59
|
warning('checked' in restProps || !!checkboxGroup || !('value' in restProps), 'usage', '`value` is not a valid prop, do you mean `checked`?');
|
|
@@ -71,6 +74,12 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
71
74
|
return checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
72
75
|
};
|
|
73
76
|
}, [restProps.value]);
|
|
77
|
+
React.useEffect(function () {
|
|
78
|
+
var _checkboxRef$current;
|
|
79
|
+
if ((_checkboxRef$current = checkboxRef.current) !== null && _checkboxRef$current !== void 0 && _checkboxRef$current.input) {
|
|
80
|
+
checkboxRef.current.input.indeterminate = indeterminate;
|
|
81
|
+
}
|
|
82
|
+
}, [indeterminate]);
|
|
74
83
|
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
75
84
|
var rootCls = useCSSVarCls(prefixCls);
|
|
76
85
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
@@ -96,7 +105,6 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
96
105
|
}
|
|
97
106
|
var classString = classNames("".concat(prefixCls, "-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-wrapper-checked"), checkboxProps.checked), "".concat(prefixCls, "-wrapper-disabled"), mergedDisabled), "".concat(prefixCls, "-wrapper-in-form-item"), isFormItemInput), checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, cssVarCls, rootCls, hashId);
|
|
98
107
|
var checkboxClass = classNames(_defineProperty({}, "".concat(prefixCls, "-indeterminate"), indeterminate), TARGET_CLS, hashId);
|
|
99
|
-
var ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
100
108
|
return wrapCSSVar(_jsx(Wave, {
|
|
101
109
|
component: "Checkbox",
|
|
102
110
|
disabled: mergedDisabled,
|
|
@@ -105,13 +113,11 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
|
|
|
105
113
|
style: _objectSpread(_objectSpread({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
106
114
|
onMouseEnter: onMouseEnter,
|
|
107
115
|
onMouseLeave: onMouseLeave,
|
|
108
|
-
children: [_jsx(RcCheckbox, _objectSpread(_objectSpread({
|
|
109
|
-
"aria-checked": ariaChecked
|
|
110
|
-
}, checkboxProps), {}, {
|
|
116
|
+
children: [_jsx(RcCheckbox, _objectSpread(_objectSpread({}, checkboxProps), {}, {
|
|
111
117
|
prefixCls: prefixCls,
|
|
112
118
|
className: checkboxClass,
|
|
113
119
|
disabled: mergedDisabled,
|
|
114
|
-
ref:
|
|
120
|
+
ref: mergedRef
|
|
115
121
|
})), children !== undefined && _jsx("span", {
|
|
116
122
|
children: children
|
|
117
123
|
})]
|
|
@@ -108,9 +108,9 @@ export var genCheckboxStyle = function genCheckboxStyle(token) {
|
|
|
108
108
|
borderColor: 'transparent'
|
|
109
109
|
})), // ================= Indeterminate =================
|
|
110
110
|
_defineProperty({}, checkboxCls, {
|
|
111
|
-
'&-indeterminate': _defineProperty({}, "".concat(checkboxCls, "-inner"), {
|
|
112
|
-
backgroundColor: token.colorBgContainer,
|
|
113
|
-
borderColor: token.colorBorder,
|
|
111
|
+
'&-indeterminate': _defineProperty(_defineProperty({}, "".concat(checkboxCls, "-inner"), {
|
|
112
|
+
backgroundColor: "".concat(token.colorBgContainer, " !important"),
|
|
113
|
+
borderColor: "".concat(token.colorBorder, " !important"),
|
|
114
114
|
'&:after': {
|
|
115
115
|
top: '50%',
|
|
116
116
|
insetInlineStart: '50%',
|
|
@@ -122,6 +122,9 @@ export var genCheckboxStyle = function genCheckboxStyle(token) {
|
|
|
122
122
|
opacity: 1,
|
|
123
123
|
content: '""'
|
|
124
124
|
}
|
|
125
|
+
}), "&:hover ".concat(checkboxCls, "-inner"), {
|
|
126
|
+
backgroundColor: "".concat(token.colorBgContainer, " !important"),
|
|
127
|
+
borderColor: "".concat(token.colorPrimary, " !important")
|
|
125
128
|
})
|
|
126
129
|
}), // ==================== Disable ====================
|
|
127
130
|
_defineProperty(_defineProperty({}, "".concat(wrapperCls, "-disabled"), {
|
|
@@ -68,7 +68,8 @@ var Collapse = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
68
68
|
var renderExpandIcon = React.useCallback(function () {
|
|
69
69
|
var panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70
70
|
var icon = typeof mergedExpandIcon === 'function' ? mergedExpandIcon(panelProps) : _jsx(RightOutlined, {
|
|
71
|
-
rotate: panelProps.isActive ? 90 : undefined
|
|
71
|
+
rotate: panelProps.isActive ? 90 : undefined,
|
|
72
|
+
"aria-label": panelProps.isActive ? 'expanded' : 'collapsed'
|
|
72
73
|
});
|
|
73
74
|
return cloneElement(icon, function () {
|
|
74
75
|
var _icon$props;
|
|
@@ -36,17 +36,19 @@ export var genBaseStyle = function genBaseStyle(token) {
|
|
|
36
36
|
fontHeight = token.fontHeight,
|
|
37
37
|
fontHeightLG = token.fontHeightLG;
|
|
38
38
|
var borderBase = "".concat(unit(lineWidth), " ").concat(lineType, " ").concat(colorBorder);
|
|
39
|
-
return _defineProperty({}, componentCls, _objectSpread(_objectSpread({}, resetComponent(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
|
39
|
+
return _defineProperty({}, componentCls, _objectSpread(_objectSpread({}, resetComponent(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
40
40
|
backgroundColor: headerBg,
|
|
41
41
|
border: borderBase,
|
|
42
|
-
borderRadius: collapsePanelBorderRadius
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
borderRadius: collapsePanelBorderRadius,
|
|
43
|
+
'&-rtl': {
|
|
44
|
+
direction: 'rtl'
|
|
45
|
+
}
|
|
46
|
+
}, "& > ".concat(componentCls, "-item"), _defineProperty(_defineProperty(_defineProperty({
|
|
47
|
+
borderBottom: borderBase,
|
|
48
|
+
'&:last-child': _defineProperty({}, "\n &,\n & > ".concat(componentCls, "-header"), {
|
|
49
|
+
borderRadius: "0 0 ".concat(unit(collapsePanelBorderRadius), " ").concat(unit(collapsePanelBorderRadius))
|
|
50
|
+
})
|
|
51
|
+
}, "> ".concat(componentCls, "-header"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
50
52
|
position: 'relative',
|
|
51
53
|
// Compatible with old version of antd, should remove in next version
|
|
52
54
|
display: 'flex',
|
|
@@ -76,7 +78,12 @@ export var genBaseStyle = function genBaseStyle(token) {
|
|
|
76
78
|
}
|
|
77
79
|
})), "".concat(componentCls, "-header-text"), {
|
|
78
80
|
marginInlineEnd: 'auto'
|
|
79
|
-
})), "".concat(componentCls, "-
|
|
81
|
+
})), "".concat(componentCls, "-collapsible-header"), _defineProperty({
|
|
82
|
+
cursor: 'default'
|
|
83
|
+
}, "".concat(componentCls, "-header-text"), {
|
|
84
|
+
flex: 'none',
|
|
85
|
+
cursor: 'pointer'
|
|
86
|
+
})), "".concat(componentCls, "-collapsible-icon"), _defineProperty({
|
|
80
87
|
cursor: 'unset'
|
|
81
88
|
}, "".concat(componentCls, "-expand-icon"), {
|
|
82
89
|
cursor: 'pointer'
|
|
@@ -86,9 +93,9 @@ export var genBaseStyle = function genBaseStyle(token) {
|
|
|
86
93
|
borderTop: borderBase
|
|
87
94
|
}, "& > ".concat(componentCls, "-content-box"), {
|
|
88
95
|
padding: contentPadding
|
|
89
|
-
}),
|
|
96
|
+
}), '&-hidden', {
|
|
90
97
|
display: 'none'
|
|
91
|
-
})),
|
|
98
|
+
})), '&-small', _defineProperty({}, "> ".concat(componentCls, "-item"), _defineProperty(_defineProperty({}, "> ".concat(componentCls, "-header"), _defineProperty({
|
|
92
99
|
padding: collapseHeaderPaddingSM,
|
|
93
100
|
paddingInlineStart: paddingXS
|
|
94
101
|
}, "> ".concat(componentCls, "-expand-icon"), {
|
|
@@ -96,7 +103,7 @@ export var genBaseStyle = function genBaseStyle(token) {
|
|
|
96
103
|
marginInlineStart: token.calc(paddingSM).sub(paddingXS).equal()
|
|
97
104
|
})), "> ".concat(componentCls, "-content > ").concat(componentCls, "-content-box"), {
|
|
98
105
|
padding: paddingSM
|
|
99
|
-
}))),
|
|
106
|
+
}))), '&-large', _defineProperty({}, "> ".concat(componentCls, "-item"), _defineProperty(_defineProperty({
|
|
100
107
|
fontSize: fontSizeLG,
|
|
101
108
|
lineHeight: lineHeightLG
|
|
102
109
|
}, "> ".concat(componentCls, "-header"), _defineProperty({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["value", "defaultValue", "format", "defaultFormat", "allowClear", "presets", "children", "trigger", "open", "disabled", "placement", "arrow", "panelRender", "showText", "style", "className", "size", "rootClassName", "prefixCls", "styles", "disabledAlpha", "onFormatChange", "onChange", "onClear", "onOpenChange", "onChangeComplete", "getPopupContainer", "autoAdjustOverflow", "destroyTooltipOnHide"];
|
|
2
|
+
var _excluded = ["mode", "value", "defaultValue", "format", "defaultFormat", "allowClear", "presets", "children", "trigger", "open", "disabled", "placement", "arrow", "panelRender", "showText", "style", "className", "size", "rootClassName", "prefixCls", "styles", "disabledAlpha", "onFormatChange", "onChange", "onClear", "onOpenChange", "onChangeComplete", "getPopupContainer", "autoAdjustOverflow", "destroyTooltipOnHide", "disabledFormat"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -14,9 +14,10 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
14
14
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
15
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import React, { useContext, useMemo
|
|
17
|
+
import React, { useContext, useMemo } from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
20
|
+
import ContextIsolator from '../_util/ContextIsolator';
|
|
20
21
|
import genPurePanel from '../_util/PurePanel';
|
|
21
22
|
import { getStatusClassNames } from '../_util/statusUtils';
|
|
22
23
|
import { devUseWarning } from '../_util/warning';
|
|
@@ -24,15 +25,18 @@ import { ConfigContext } from '../config-provider/context';
|
|
|
24
25
|
import DisabledContext from '../config-provider/DisabledContext';
|
|
25
26
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
26
27
|
import useSize from '../config-provider/hooks/useSize';
|
|
27
|
-
import { FormItemInputContext
|
|
28
|
+
import { FormItemInputContext } from '../form/context';
|
|
28
29
|
import Popover from '../popover';
|
|
30
|
+
import { useCompactItemContext } from '../space/Compact';
|
|
31
|
+
import { AggregationColor } from './color';
|
|
29
32
|
import ColorPickerPanel from './ColorPickerPanel';
|
|
30
33
|
import ColorTrigger from './components/ColorTrigger';
|
|
31
|
-
import
|
|
34
|
+
import useModeColor from './hooks/useModeColor';
|
|
32
35
|
import useStyle from './style';
|
|
33
|
-
import { genAlphaColor, generateColor,
|
|
36
|
+
import { genAlphaColor, generateColor, getColorAlpha } from './util';
|
|
34
37
|
var ColorPicker = function ColorPicker(props) {
|
|
35
|
-
var
|
|
38
|
+
var mode = props.mode,
|
|
39
|
+
value = props.value,
|
|
36
40
|
defaultValue = props.defaultValue,
|
|
37
41
|
format = props.format,
|
|
38
42
|
defaultFormat = props.defaultFormat,
|
|
@@ -67,6 +71,7 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
67
71
|
_props$autoAdjustOver = props.autoAdjustOverflow,
|
|
68
72
|
autoAdjustOverflow = _props$autoAdjustOver === void 0 ? true : _props$autoAdjustOver,
|
|
69
73
|
destroyTooltipOnHide = props.destroyTooltipOnHide,
|
|
74
|
+
disabledFormat = props.disabledFormat,
|
|
70
75
|
rest = _objectWithoutProperties(props, _excluded);
|
|
71
76
|
var _useContext = useContext(ConfigContext),
|
|
72
77
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -74,14 +79,6 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
74
79
|
colorPicker = _useContext.colorPicker;
|
|
75
80
|
var contextDisabled = useContext(DisabledContext);
|
|
76
81
|
var mergedDisabled = disabled !== null && disabled !== void 0 ? disabled : contextDisabled;
|
|
77
|
-
var _useColorState = useColorState('', {
|
|
78
|
-
value: value,
|
|
79
|
-
defaultValue: defaultValue
|
|
80
|
-
}),
|
|
81
|
-
_useColorState2 = _slicedToArray(_useColorState, 3),
|
|
82
|
-
colorValue = _useColorState2[0],
|
|
83
|
-
setColorValue = _useColorState2[1],
|
|
84
|
-
prevValue = _useColorState2[2];
|
|
85
82
|
var _useMergedState = useMergedState(false, {
|
|
86
83
|
value: open,
|
|
87
84
|
postState: function postState(openData) {
|
|
@@ -101,14 +98,91 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
101
98
|
formatValue = _useMergedState4[0],
|
|
102
99
|
setFormatValue = _useMergedState4[1];
|
|
103
100
|
var prefixCls = getPrefixCls('color-picker', customizePrefixCls);
|
|
101
|
+
// ================== Value & Mode =================
|
|
102
|
+
var _useModeColor = useModeColor(defaultValue, value, mode),
|
|
103
|
+
_useModeColor2 = _slicedToArray(_useModeColor, 5),
|
|
104
|
+
mergedColor = _useModeColor2[0],
|
|
105
|
+
setColor = _useModeColor2[1],
|
|
106
|
+
modeState = _useModeColor2[2],
|
|
107
|
+
setModeState = _useModeColor2[3],
|
|
108
|
+
modeOptions = _useModeColor2[4];
|
|
104
109
|
var isAlphaColor = useMemo(function () {
|
|
105
|
-
return
|
|
106
|
-
}, [
|
|
107
|
-
//
|
|
110
|
+
return getColorAlpha(mergedColor) < 100;
|
|
111
|
+
}, [mergedColor]);
|
|
112
|
+
// ==================== Change =====================
|
|
113
|
+
// To enhance user experience, we cache the gradient color when switch from gradient to single
|
|
114
|
+
// If user not modify single color, we will use the cached gradient color.
|
|
115
|
+
var _React$useState = React.useState(null),
|
|
116
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
117
|
+
cachedGradientColor = _React$useState2[0],
|
|
118
|
+
setCachedGradientColor = _React$useState2[1];
|
|
119
|
+
var onInternalChangeComplete = function onInternalChangeComplete(color) {
|
|
120
|
+
if (onChangeComplete) {
|
|
121
|
+
var changeColor = generateColor(color);
|
|
122
|
+
// ignore alpha color
|
|
123
|
+
if (disabledAlpha && isAlphaColor) {
|
|
124
|
+
changeColor = genAlphaColor(color);
|
|
125
|
+
}
|
|
126
|
+
onChangeComplete(changeColor);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
var onInternalChange = function onInternalChange(data, changeFromPickerDrag) {
|
|
130
|
+
var color = generateColor(data);
|
|
131
|
+
// ignore alpha color
|
|
132
|
+
if (disabledAlpha && isAlphaColor) {
|
|
133
|
+
color = genAlphaColor(color);
|
|
134
|
+
}
|
|
135
|
+
setColor(color);
|
|
136
|
+
setCachedGradientColor(null);
|
|
137
|
+
// Trigger change event
|
|
138
|
+
if (onChange) {
|
|
139
|
+
onChange(color, color.toCssString());
|
|
140
|
+
}
|
|
141
|
+
// Only for drag-and-drop color picking
|
|
142
|
+
if (!changeFromPickerDrag) {
|
|
143
|
+
onInternalChangeComplete(color);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
// =================== Gradient ====================
|
|
147
|
+
var _React$useState3 = React.useState(0),
|
|
148
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
149
|
+
activeIndex = _React$useState4[0],
|
|
150
|
+
setActiveIndex = _React$useState4[1];
|
|
151
|
+
var _React$useState5 = React.useState(false),
|
|
152
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
153
|
+
gradientDragging = _React$useState6[0],
|
|
154
|
+
setGradientDragging = _React$useState6[1];
|
|
155
|
+
// Mode change should also trigger color change
|
|
156
|
+
var onInternalModeChange = function onInternalModeChange(newMode) {
|
|
157
|
+
setModeState(newMode);
|
|
158
|
+
if (newMode === 'single' && mergedColor.isGradient()) {
|
|
159
|
+
setActiveIndex(0);
|
|
160
|
+
onInternalChange(new AggregationColor(mergedColor.getColors()[0].color));
|
|
161
|
+
// Should after `onInternalChange` since it will clear the cached color
|
|
162
|
+
setCachedGradientColor(mergedColor);
|
|
163
|
+
} else if (newMode === 'gradient' && !mergedColor.isGradient()) {
|
|
164
|
+
var baseColor = isAlphaColor ? genAlphaColor(mergedColor) : mergedColor;
|
|
165
|
+
onInternalChange(new AggregationColor(cachedGradientColor || [{
|
|
166
|
+
percent: 0,
|
|
167
|
+
color: baseColor
|
|
168
|
+
}, {
|
|
169
|
+
percent: 100,
|
|
170
|
+
color: baseColor
|
|
171
|
+
}]));
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
// ================== Form Status ==================
|
|
108
175
|
var _React$useContext = React.useContext(FormItemInputContext),
|
|
109
176
|
contextStatus = _React$useContext.status;
|
|
177
|
+
// ==================== Compact ====================
|
|
178
|
+
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
179
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
180
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
110
181
|
// ===================== Style =====================
|
|
111
|
-
var mergedSize = useSize(
|
|
182
|
+
var mergedSize = useSize(function (ctx) {
|
|
183
|
+
var _ref;
|
|
184
|
+
return (_ref = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _ref !== void 0 ? _ref : ctx;
|
|
185
|
+
});
|
|
112
186
|
var rootCls = useCSSVarCls(prefixCls);
|
|
113
187
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
114
188
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -117,50 +191,13 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
117
191
|
cssVarCls = _useStyle2[2];
|
|
118
192
|
var rtlCls = _defineProperty({}, "".concat(prefixCls, "-rtl"), direction);
|
|
119
193
|
var mergedRootCls = classNames(rootClassName, cssVarCls, rootCls, rtlCls);
|
|
120
|
-
var mergedCls = classNames(getStatusClassNames(prefixCls, contextStatus), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), colorPicker === null || colorPicker === void 0 ? void 0 : colorPicker.className, mergedRootCls, className, hashId);
|
|
194
|
+
var mergedCls = classNames(getStatusClassNames(prefixCls, contextStatus), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), compactItemClassnames, colorPicker === null || colorPicker === void 0 ? void 0 : colorPicker.className, mergedRootCls, className, hashId);
|
|
121
195
|
var mergedPopupCls = classNames(prefixCls, mergedRootCls);
|
|
122
|
-
var popupAllowCloseRef = useRef(true);
|
|
123
196
|
// ===================== Warning ======================
|
|
124
197
|
if (process.env.NODE_ENV !== 'production') {
|
|
125
198
|
var warning = devUseWarning('ColorPicker');
|
|
126
199
|
warning(!(disabledAlpha && isAlphaColor), 'usage', '`disabledAlpha` will make the alpha to be 100% when use alpha color.');
|
|
127
200
|
}
|
|
128
|
-
var handleChange = function handleChange(data, type, pickColor) {
|
|
129
|
-
var _prevValue$current;
|
|
130
|
-
var color = generateColor(data);
|
|
131
|
-
// If color is cleared, reset alpha to 100
|
|
132
|
-
var isNull = value === null || !value && defaultValue === null;
|
|
133
|
-
if ((_prevValue$current = prevValue.current) !== null && _prevValue$current !== void 0 && _prevValue$current.cleared || isNull) {
|
|
134
|
-
// ignore alpha slider
|
|
135
|
-
if (getAlphaColor(colorValue) === 0 && type !== 'alpha') {
|
|
136
|
-
color = genAlphaColor(color);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// ignore alpha color
|
|
140
|
-
if (disabledAlpha && isAlphaColor) {
|
|
141
|
-
color = genAlphaColor(color);
|
|
142
|
-
}
|
|
143
|
-
// Only for drag-and-drop color picking
|
|
144
|
-
if (pickColor) {
|
|
145
|
-
popupAllowCloseRef.current = false;
|
|
146
|
-
} else {
|
|
147
|
-
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(color);
|
|
148
|
-
}
|
|
149
|
-
setColorValue(color);
|
|
150
|
-
onChange === null || onChange === void 0 || onChange(color, color.toHexString());
|
|
151
|
-
};
|
|
152
|
-
var handleClear = function handleClear() {
|
|
153
|
-
onClear === null || onClear === void 0 || onClear();
|
|
154
|
-
};
|
|
155
|
-
var handleChangeComplete = function handleChangeComplete(color) {
|
|
156
|
-
popupAllowCloseRef.current = true;
|
|
157
|
-
var changeColor = generateColor(color);
|
|
158
|
-
// ignore alpha color
|
|
159
|
-
if (disabledAlpha && isAlphaColor) {
|
|
160
|
-
changeColor = genAlphaColor(color);
|
|
161
|
-
}
|
|
162
|
-
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(changeColor);
|
|
163
|
-
};
|
|
164
201
|
var popoverProps = {
|
|
165
202
|
open: popupOpen,
|
|
166
203
|
trigger: trigger,
|
|
@@ -171,40 +208,45 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
171
208
|
autoAdjustOverflow: autoAdjustOverflow,
|
|
172
209
|
destroyTooltipOnHide: destroyTooltipOnHide
|
|
173
210
|
};
|
|
174
|
-
var colorBaseProps = {
|
|
175
|
-
prefixCls: prefixCls,
|
|
176
|
-
color: colorValue,
|
|
177
|
-
allowClear: allowClear,
|
|
178
|
-
disabled: mergedDisabled,
|
|
179
|
-
disabledAlpha: disabledAlpha,
|
|
180
|
-
presets: presets,
|
|
181
|
-
panelRender: panelRender,
|
|
182
|
-
format: formatValue,
|
|
183
|
-
onFormatChange: setFormatValue,
|
|
184
|
-
onChangeComplete: handleChangeComplete
|
|
185
|
-
};
|
|
186
211
|
var mergedStyle = _objectSpread(_objectSpread({}, colorPicker === null || colorPicker === void 0 ? void 0 : colorPicker.style), style);
|
|
187
212
|
// ============================ zIndex ============================
|
|
188
213
|
return wrapCSSVar(_jsx(Popover, _objectSpread(_objectSpread({
|
|
189
214
|
style: styles === null || styles === void 0 ? void 0 : styles.popup,
|
|
190
215
|
overlayInnerStyle: styles === null || styles === void 0 ? void 0 : styles.popupOverlayInner,
|
|
191
216
|
onOpenChange: function onOpenChange(visible) {
|
|
192
|
-
if (
|
|
217
|
+
if (!visible || !mergedDisabled) {
|
|
193
218
|
setPopupOpen(visible);
|
|
194
219
|
}
|
|
195
220
|
},
|
|
196
|
-
content: _jsx(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
content: _jsx(ContextIsolator, {
|
|
222
|
+
form: true,
|
|
223
|
+
children: _jsx(ColorPickerPanel, {
|
|
224
|
+
mode: modeState,
|
|
225
|
+
onModeChange: onInternalModeChange,
|
|
226
|
+
modeOptions: modeOptions,
|
|
227
|
+
prefixCls: prefixCls,
|
|
228
|
+
value: mergedColor,
|
|
229
|
+
allowClear: allowClear,
|
|
230
|
+
disabled: mergedDisabled,
|
|
231
|
+
disabledAlpha: disabledAlpha,
|
|
232
|
+
presets: presets,
|
|
233
|
+
panelRender: panelRender,
|
|
234
|
+
format: formatValue,
|
|
235
|
+
onFormatChange: setFormatValue,
|
|
236
|
+
onChange: onInternalChange,
|
|
237
|
+
onChangeComplete: onInternalChangeComplete,
|
|
238
|
+
onClear: onClear,
|
|
239
|
+
activeIndex: activeIndex,
|
|
240
|
+
onActive: setActiveIndex,
|
|
241
|
+
gradientDragging: gradientDragging,
|
|
242
|
+
onGradientDragging: setGradientDragging,
|
|
243
|
+
disabledFormat: disabledFormat
|
|
244
|
+
})
|
|
204
245
|
}),
|
|
205
246
|
overlayClassName: mergedPopupCls
|
|
206
247
|
}, popoverProps), {}, {
|
|
207
248
|
children: children || _jsx(ColorTrigger, _objectSpread(_objectSpread({
|
|
249
|
+
activeIndex: popupOpen ? activeIndex : -1,
|
|
208
250
|
open: popupOpen,
|
|
209
251
|
className: mergedCls,
|
|
210
252
|
style: mergedStyle,
|
|
@@ -213,7 +255,7 @@ var ColorPicker = function ColorPicker(props) {
|
|
|
213
255
|
showText: showText,
|
|
214
256
|
format: formatValue
|
|
215
257
|
}, rest), {}, {
|
|
216
|
-
color:
|
|
258
|
+
color: mergedColor
|
|
217
259
|
}))
|
|
218
260
|
})));
|
|
219
261
|
};
|