@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
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["prefixCls", "allowClear", "value", "disabledAlpha", "onChange", "onClear", "onChangeComplete"];
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
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; }
|
|
9
|
-
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; }
|
|
10
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import React, { useContext } from 'react';
|
|
12
|
-
import RcColorPicker from '@rc-component/color-picker';
|
|
13
|
-
import { PanelPickerContext } from '../context';
|
|
14
|
-
import { generateColor } from '../util';
|
|
15
|
-
import ColorClear from './ColorClear';
|
|
16
|
-
import ColorInput from './ColorInput';
|
|
17
|
-
var PanelPicker = function PanelPicker() {
|
|
18
|
-
var _useContext = useContext(PanelPickerContext),
|
|
19
|
-
prefixCls = _useContext.prefixCls,
|
|
20
|
-
allowClear = _useContext.allowClear,
|
|
21
|
-
value = _useContext.value,
|
|
22
|
-
disabledAlpha = _useContext.disabledAlpha,
|
|
23
|
-
_onChange = _useContext.onChange,
|
|
24
|
-
onClear = _useContext.onClear,
|
|
25
|
-
_onChangeComplete = _useContext.onChangeComplete,
|
|
26
|
-
injectProps = _objectWithoutProperties(_useContext, _excluded);
|
|
27
|
-
return _jsxs(_Fragment, {
|
|
28
|
-
children: [allowClear && _jsx(ColorClear, _objectSpread({
|
|
29
|
-
prefixCls: prefixCls,
|
|
30
|
-
value: value,
|
|
31
|
-
onChange: function onChange(clearColor) {
|
|
32
|
-
_onChange === null || _onChange === void 0 || _onChange(clearColor);
|
|
33
|
-
onClear === null || onClear === void 0 || onClear();
|
|
34
|
-
}
|
|
35
|
-
}, injectProps)), _jsx(RcColorPicker, {
|
|
36
|
-
prefixCls: prefixCls,
|
|
37
|
-
value: value === null || value === void 0 ? void 0 : value.toHsb(),
|
|
38
|
-
disabledAlpha: disabledAlpha,
|
|
39
|
-
onChange: function onChange(colorValue, type) {
|
|
40
|
-
_onChange === null || _onChange === void 0 || _onChange(generateColor(colorValue), type, true);
|
|
41
|
-
},
|
|
42
|
-
onChangeComplete: function onChangeComplete(colorValue) {
|
|
43
|
-
_onChangeComplete === null || _onChangeComplete === void 0 || _onChangeComplete(generateColor(colorValue));
|
|
44
|
-
}
|
|
45
|
-
}), _jsx(ColorInput, _objectSpread({
|
|
46
|
-
value: value,
|
|
47
|
-
onChange: _onChange,
|
|
48
|
-
prefixCls: prefixCls,
|
|
49
|
-
disabledAlpha: disabledAlpha
|
|
50
|
-
}, injectProps))]
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
export default PanelPicker;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
import { useEffect, useRef, useState } from 'react';
|
|
8
|
-
import { generateColor } from '../util';
|
|
9
|
-
var INIT_COLOR_REF = {};
|
|
10
|
-
function hasValue(value) {
|
|
11
|
-
return value !== undefined;
|
|
12
|
-
}
|
|
13
|
-
var useColorState = function useColorState(defaultStateValue, option) {
|
|
14
|
-
var defaultValue = option.defaultValue,
|
|
15
|
-
value = option.value;
|
|
16
|
-
var prevColor = useRef(generateColor(''));
|
|
17
|
-
var _useState = useState(function () {
|
|
18
|
-
var mergedState;
|
|
19
|
-
if (hasValue(value)) {
|
|
20
|
-
mergedState = value;
|
|
21
|
-
} else if (hasValue(defaultValue)) {
|
|
22
|
-
mergedState = defaultValue;
|
|
23
|
-
} else {
|
|
24
|
-
mergedState = defaultStateValue;
|
|
25
|
-
}
|
|
26
|
-
var color = generateColor(mergedState || '');
|
|
27
|
-
prevColor.current = color;
|
|
28
|
-
return color;
|
|
29
|
-
}),
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
colorValue = _useState2[0],
|
|
32
|
-
_setColorValue = _useState2[1];
|
|
33
|
-
var setColorValue = function setColorValue(color) {
|
|
34
|
-
_setColorValue(color);
|
|
35
|
-
prevColor.current = color;
|
|
36
|
-
};
|
|
37
|
-
var prevValue = useRef(INIT_COLOR_REF);
|
|
38
|
-
useEffect(function () {
|
|
39
|
-
// `useEffect` will be executed twice in strict mode even if the deps are the same
|
|
40
|
-
// So we compare the value manually to avoid unnecessary update
|
|
41
|
-
if (prevValue.current === value) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
prevValue.current = value;
|
|
45
|
-
var newColor = generateColor(hasValue(value) ? value || '' : prevColor.current);
|
|
46
|
-
if (prevColor.current.cleared === true) {
|
|
47
|
-
newColor.cleared = 'controlled';
|
|
48
|
-
}
|
|
49
|
-
setColorValue(newColor);
|
|
50
|
-
}, [value]);
|
|
51
|
-
return [colorValue, setColorValue, prevColor];
|
|
52
|
-
};
|
|
53
|
-
export default useColorState;
|
|
@@ -1,24 +0,0 @@
|
|
|
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 _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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
|
-
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
|
-
var genLayoutLightStyle = function genLayoutLightStyle(token) {
|
|
6
|
-
var componentCls = token.componentCls,
|
|
7
|
-
bodyBg = token.bodyBg,
|
|
8
|
-
lightSiderBg = token.lightSiderBg,
|
|
9
|
-
lightTriggerBg = token.lightTriggerBg,
|
|
10
|
-
lightTriggerColor = token.lightTriggerColor;
|
|
11
|
-
return _defineProperty({}, "".concat(componentCls, "-sider-light"), _defineProperty(_defineProperty({
|
|
12
|
-
background: lightSiderBg
|
|
13
|
-
}, "".concat(componentCls, "-sider-trigger"), {
|
|
14
|
-
color: lightTriggerColor,
|
|
15
|
-
background: lightTriggerBg
|
|
16
|
-
}), "".concat(componentCls, "-sider-zero-width-trigger"), {
|
|
17
|
-
color: lightTriggerColor,
|
|
18
|
-
background: lightTriggerBg,
|
|
19
|
-
border: "1px solid ".concat(bodyBg),
|
|
20
|
-
// Safe to modify to any other color
|
|
21
|
-
borderInlineStart: 0
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
export default genLayoutLightStyle;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
-
export var operationUnit = function operationUnit(token) {
|
|
3
|
-
return {
|
|
4
|
-
// FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
|
|
5
|
-
// And Typography use this to generate link style which should not do this.
|
|
6
|
-
color: token.colorLink,
|
|
7
|
-
textDecoration: 'none',
|
|
8
|
-
outline: 'none',
|
|
9
|
-
cursor: 'pointer',
|
|
10
|
-
transition: "color ".concat(token.motionDurationSlow),
|
|
11
|
-
'&:focus, &:hover': {
|
|
12
|
-
color: token.colorLinkHover
|
|
13
|
-
},
|
|
14
|
-
'&:active': {
|
|
15
|
-
color: token.colorLinkActive
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
-
import AbstractCalculator from './calculator';
|
|
15
|
-
var CALC_UNIT = 'CALC_UNIT';
|
|
16
|
-
var regexp = new RegExp(CALC_UNIT, 'g');
|
|
17
|
-
function unit(value) {
|
|
18
|
-
if (typeof value === 'number') {
|
|
19
|
-
return "".concat(value).concat(CALC_UNIT);
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
var CSSCalculator = /*#__PURE__*/function (_AbstractCalculator) {
|
|
24
|
-
function CSSCalculator(num) {
|
|
25
|
-
var _this;
|
|
26
|
-
_classCallCheck(this, CSSCalculator);
|
|
27
|
-
_this = _callSuper(this, CSSCalculator);
|
|
28
|
-
Object.defineProperty(_this, "result", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: ''
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(_this, "lowPriority", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: void 0
|
|
39
|
-
});
|
|
40
|
-
if (num instanceof CSSCalculator) {
|
|
41
|
-
_this.result = "(".concat(num.result, ")");
|
|
42
|
-
} else if (typeof num === 'number') {
|
|
43
|
-
_this.result = unit(num);
|
|
44
|
-
} else if (typeof num === 'string') {
|
|
45
|
-
_this.result = num;
|
|
46
|
-
}
|
|
47
|
-
return _this;
|
|
48
|
-
}
|
|
49
|
-
_inherits(CSSCalculator, _AbstractCalculator);
|
|
50
|
-
return _createClass(CSSCalculator, [{
|
|
51
|
-
key: "add",
|
|
52
|
-
value: function add(num) {
|
|
53
|
-
if (num instanceof CSSCalculator) {
|
|
54
|
-
this.result = "".concat(this.result, " + ").concat(num.getResult());
|
|
55
|
-
} else if (typeof num === 'number' || typeof num === 'string') {
|
|
56
|
-
this.result = "".concat(this.result, " + ").concat(unit(num));
|
|
57
|
-
}
|
|
58
|
-
this.lowPriority = true;
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "sub",
|
|
63
|
-
value: function sub(num) {
|
|
64
|
-
if (num instanceof CSSCalculator) {
|
|
65
|
-
this.result = "".concat(this.result, " - ").concat(num.getResult());
|
|
66
|
-
} else if (typeof num === 'number' || typeof num === 'string') {
|
|
67
|
-
this.result = "".concat(this.result, " - ").concat(unit(num));
|
|
68
|
-
}
|
|
69
|
-
this.lowPriority = true;
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "mul",
|
|
74
|
-
value: function mul(num) {
|
|
75
|
-
if (this.lowPriority) {
|
|
76
|
-
this.result = "(".concat(this.result, ")");
|
|
77
|
-
}
|
|
78
|
-
if (num instanceof CSSCalculator) {
|
|
79
|
-
this.result = "".concat(this.result, " * ").concat(num.getResult(true));
|
|
80
|
-
} else if (typeof num === 'number' || typeof num === 'string') {
|
|
81
|
-
this.result = "".concat(this.result, " * ").concat(num);
|
|
82
|
-
}
|
|
83
|
-
this.lowPriority = false;
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
key: "div",
|
|
88
|
-
value: function div(num) {
|
|
89
|
-
if (this.lowPriority) {
|
|
90
|
-
this.result = "(".concat(this.result, ")");
|
|
91
|
-
}
|
|
92
|
-
if (num instanceof CSSCalculator) {
|
|
93
|
-
this.result = "".concat(this.result, " / ").concat(num.getResult(true));
|
|
94
|
-
} else if (typeof num === 'number' || typeof num === 'string') {
|
|
95
|
-
this.result = "".concat(this.result, " / ").concat(num);
|
|
96
|
-
}
|
|
97
|
-
this.lowPriority = false;
|
|
98
|
-
return this;
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
key: "getResult",
|
|
102
|
-
value: function getResult(force) {
|
|
103
|
-
return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
key: "equal",
|
|
107
|
-
value: function equal(options) {
|
|
108
|
-
var _ref = options || {},
|
|
109
|
-
_ref$unit = _ref.unit,
|
|
110
|
-
cssUnit = _ref$unit === void 0 ? true : _ref$unit;
|
|
111
|
-
this.result = this.result.replace(regexp, cssUnit ? 'px' : '');
|
|
112
|
-
if (typeof this.lowPriority !== 'undefined') {
|
|
113
|
-
return "calc(".concat(this.result, ")");
|
|
114
|
-
}
|
|
115
|
-
return this.result;
|
|
116
|
-
}
|
|
117
|
-
}]);
|
|
118
|
-
}(AbstractCalculator);
|
|
119
|
-
export { CSSCalculator as default };
|
|
@@ -1,81 +0,0 @@
|
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
-
import AbstractCalculator from './calculator';
|
|
15
|
-
var NumCalculator = /*#__PURE__*/function (_AbstractCalculator) {
|
|
16
|
-
function NumCalculator(num) {
|
|
17
|
-
var _this;
|
|
18
|
-
_classCallCheck(this, NumCalculator);
|
|
19
|
-
_this = _callSuper(this, NumCalculator);
|
|
20
|
-
Object.defineProperty(_this, "result", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: 0
|
|
25
|
-
});
|
|
26
|
-
if (num instanceof NumCalculator) {
|
|
27
|
-
_this.result = num.result;
|
|
28
|
-
} else if (typeof num === 'number') {
|
|
29
|
-
_this.result = num;
|
|
30
|
-
}
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
_inherits(NumCalculator, _AbstractCalculator);
|
|
34
|
-
return _createClass(NumCalculator, [{
|
|
35
|
-
key: "add",
|
|
36
|
-
value: function add(num) {
|
|
37
|
-
if (num instanceof NumCalculator) {
|
|
38
|
-
this.result += num.result;
|
|
39
|
-
} else if (typeof num === 'number') {
|
|
40
|
-
this.result += num;
|
|
41
|
-
}
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
}, {
|
|
45
|
-
key: "sub",
|
|
46
|
-
value: function sub(num) {
|
|
47
|
-
if (num instanceof NumCalculator) {
|
|
48
|
-
this.result -= num.result;
|
|
49
|
-
} else if (typeof num === 'number') {
|
|
50
|
-
this.result -= num;
|
|
51
|
-
}
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "mul",
|
|
56
|
-
value: function mul(num) {
|
|
57
|
-
if (num instanceof NumCalculator) {
|
|
58
|
-
this.result *= num.result;
|
|
59
|
-
} else if (typeof num === 'number') {
|
|
60
|
-
this.result *= num;
|
|
61
|
-
}
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
}, {
|
|
65
|
-
key: "div",
|
|
66
|
-
value: function div(num) {
|
|
67
|
-
if (num instanceof NumCalculator) {
|
|
68
|
-
this.result /= num.result;
|
|
69
|
-
} else if (typeof num === 'number') {
|
|
70
|
-
this.result /= num;
|
|
71
|
-
}
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
}, {
|
|
75
|
-
key: "equal",
|
|
76
|
-
value: function equal() {
|
|
77
|
-
return this.result;
|
|
78
|
-
}
|
|
79
|
-
}]);
|
|
80
|
-
}(AbstractCalculator);
|
|
81
|
-
export { NumCalculator as default };
|
|
@@ -1,10 +0,0 @@
|
|
|
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 _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
-
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); }
|
|
6
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7
|
-
var AbstractCalculator = /*#__PURE__*/_createClass(function AbstractCalculator() {
|
|
8
|
-
_classCallCheck(this, AbstractCalculator);
|
|
9
|
-
});
|
|
10
|
-
export default AbstractCalculator;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import CSSCalculator from './CSSCalculator';
|
|
2
|
-
import NumCalculator from './NumCalculator';
|
|
3
|
-
var genCalc = function genCalc(type) {
|
|
4
|
-
var Calculator = type === 'css' ? CSSCalculator : NumCalculator;
|
|
5
|
-
return function (num) {
|
|
6
|
-
return new Calculator(num);
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default genCalc;
|
|
@@ -1,243 +0,0 @@
|
|
|
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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
|
-
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; }
|
|
9
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
-
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); }
|
|
13
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import React, { useContext } from 'react';
|
|
15
|
-
import { token2CSSVar, useCSSVarRegister, useStyleRegister } from '@ant-design/cssinjs';
|
|
16
|
-
import { warning } from 'rc-util';
|
|
17
|
-
import { ConfigContext } from '../../config-provider/context';
|
|
18
|
-
import { genCommonStyle, genLinkStyle } from '../../style';
|
|
19
|
-
import useToken, { ignore, unitless } from '../useToken';
|
|
20
|
-
import genCalc from './calc';
|
|
21
|
-
import genMaxMin from './maxmin';
|
|
22
|
-
import statisticToken, { merge as mergeToken } from './statistic';
|
|
23
|
-
import useResetIconStyle from './useResetIconStyle';
|
|
24
|
-
var getDefaultComponentToken = function getDefaultComponentToken(component, token, getDefaultToken) {
|
|
25
|
-
if (typeof getDefaultToken === 'function') {
|
|
26
|
-
var _token$component;
|
|
27
|
-
return getDefaultToken(mergeToken(token, (_token$component = token[component]) !== null && _token$component !== void 0 ? _token$component : {}));
|
|
28
|
-
}
|
|
29
|
-
return getDefaultToken !== null && getDefaultToken !== void 0 ? getDefaultToken : {};
|
|
30
|
-
};
|
|
31
|
-
var getComponentToken = function getComponentToken(component, token, defaultToken, options) {
|
|
32
|
-
var customToken = _objectSpread({}, token[component]);
|
|
33
|
-
if (options !== null && options !== void 0 && options.deprecatedTokens) {
|
|
34
|
-
var deprecatedTokens = options.deprecatedTokens;
|
|
35
|
-
deprecatedTokens.forEach(function (_ref) {
|
|
36
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
37
|
-
oldTokenKey = _ref2[0],
|
|
38
|
-
newTokenKey = _ref2[1];
|
|
39
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
-
warning(!(customToken !== null && customToken !== void 0 && customToken[oldTokenKey]), "Component Token `".concat(String(oldTokenKey), "` of ").concat(component, " is deprecated. Please use `").concat(String(newTokenKey), "` instead."));
|
|
41
|
-
}
|
|
42
|
-
// Should wrap with `if` clause, or there will be `undefined` in object.
|
|
43
|
-
if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {
|
|
44
|
-
var _customToken$newToken;
|
|
45
|
-
(_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 ? _customToken$newToken : customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
var mergedToken = _objectSpread(_objectSpread({}, defaultToken), customToken);
|
|
50
|
-
// Remove same value as global token to minimize size
|
|
51
|
-
Object.keys(mergedToken).forEach(function (key) {
|
|
52
|
-
if (mergedToken[key] === token[key]) {
|
|
53
|
-
delete mergedToken[key];
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return mergedToken;
|
|
57
|
-
};
|
|
58
|
-
var getCompVarPrefix = function getCompVarPrefix(component, prefix) {
|
|
59
|
-
return "".concat([prefix, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, '$1-$2').replace(/([a-z])([A-Z])/g, '$1-$2')].filter(Boolean).join('-'));
|
|
60
|
-
};
|
|
61
|
-
export default function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
|
|
62
|
-
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
63
|
-
var cells = Array.isArray(componentName) ? componentName : [componentName, componentName];
|
|
64
|
-
var _cells = _slicedToArray(cells, 1),
|
|
65
|
-
component = _cells[0];
|
|
66
|
-
var concatComponent = cells.join('-');
|
|
67
|
-
return function (prefixCls) {
|
|
68
|
-
var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
|
|
69
|
-
var _useToken = useToken(),
|
|
70
|
-
_useToken2 = _slicedToArray(_useToken, 5),
|
|
71
|
-
theme = _useToken2[0],
|
|
72
|
-
realToken = _useToken2[1],
|
|
73
|
-
hashId = _useToken2[2],
|
|
74
|
-
token = _useToken2[3],
|
|
75
|
-
cssVar = _useToken2[4];
|
|
76
|
-
var _useContext = useContext(ConfigContext),
|
|
77
|
-
getPrefixCls = _useContext.getPrefixCls,
|
|
78
|
-
iconPrefixCls = _useContext.iconPrefixCls,
|
|
79
|
-
csp = _useContext.csp;
|
|
80
|
-
var rootPrefixCls = getPrefixCls();
|
|
81
|
-
var type = cssVar ? 'css' : 'js';
|
|
82
|
-
var calc = genCalc(type);
|
|
83
|
-
var _genMaxMin = genMaxMin(type),
|
|
84
|
-
max = _genMaxMin.max,
|
|
85
|
-
min = _genMaxMin.min;
|
|
86
|
-
// Shared config
|
|
87
|
-
var sharedConfig = {
|
|
88
|
-
theme: theme,
|
|
89
|
-
token: token,
|
|
90
|
-
hashId: hashId,
|
|
91
|
-
nonce: function nonce() {
|
|
92
|
-
return csp === null || csp === void 0 ? void 0 : csp.nonce;
|
|
93
|
-
},
|
|
94
|
-
clientOnly: options.clientOnly,
|
|
95
|
-
layer: {
|
|
96
|
-
name: 'antd'
|
|
97
|
-
},
|
|
98
|
-
// antd is always at top of styles
|
|
99
|
-
order: options.order || -999
|
|
100
|
-
};
|
|
101
|
-
// Generate style for all a tags in antd component.
|
|
102
|
-
useStyleRegister(_objectSpread(_objectSpread({}, sharedConfig), {}, {
|
|
103
|
-
clientOnly: false,
|
|
104
|
-
path: ['Shared', rootPrefixCls]
|
|
105
|
-
}), function () {
|
|
106
|
-
return [{
|
|
107
|
-
// Link
|
|
108
|
-
'&': genLinkStyle(token)
|
|
109
|
-
}];
|
|
110
|
-
});
|
|
111
|
-
// Generate style for icons
|
|
112
|
-
useResetIconStyle(iconPrefixCls, csp);
|
|
113
|
-
var wrapSSR = useStyleRegister(_objectSpread(_objectSpread({}, sharedConfig), {}, {
|
|
114
|
-
path: [concatComponent, prefixCls, iconPrefixCls]
|
|
115
|
-
}), function () {
|
|
116
|
-
if (options.injectStyle === false) {
|
|
117
|
-
return [];
|
|
118
|
-
}
|
|
119
|
-
var _statisticToken = statisticToken(token),
|
|
120
|
-
proxyToken = _statisticToken.token,
|
|
121
|
-
flush = _statisticToken.flush;
|
|
122
|
-
var defaultComponentToken = getDefaultComponentToken(component, realToken, getDefaultToken);
|
|
123
|
-
var componentCls = ".".concat(prefixCls);
|
|
124
|
-
var componentToken = getComponentToken(component, realToken, defaultComponentToken, {
|
|
125
|
-
deprecatedTokens: options.deprecatedTokens
|
|
126
|
-
});
|
|
127
|
-
if (cssVar) {
|
|
128
|
-
Object.keys(defaultComponentToken).forEach(function (key) {
|
|
129
|
-
defaultComponentToken[key] = "var(".concat(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)), ")");
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
var mergedToken = mergeToken(proxyToken, {
|
|
133
|
-
componentCls: componentCls,
|
|
134
|
-
prefixCls: prefixCls,
|
|
135
|
-
iconCls: ".".concat(iconPrefixCls),
|
|
136
|
-
antCls: ".".concat(rootPrefixCls),
|
|
137
|
-
calc: calc,
|
|
138
|
-
// @ts-ignore
|
|
139
|
-
max: max,
|
|
140
|
-
// @ts-ignore
|
|
141
|
-
min: min
|
|
142
|
-
}, cssVar ? defaultComponentToken : componentToken);
|
|
143
|
-
var styleInterpolation = styleFn(mergedToken, {
|
|
144
|
-
hashId: hashId,
|
|
145
|
-
prefixCls: prefixCls,
|
|
146
|
-
rootPrefixCls: rootPrefixCls,
|
|
147
|
-
iconPrefixCls: iconPrefixCls
|
|
148
|
-
});
|
|
149
|
-
flush(component, componentToken);
|
|
150
|
-
return [options.resetStyle === false ? null : genCommonStyle(mergedToken, prefixCls, rootCls, options.resetFont), styleInterpolation];
|
|
151
|
-
});
|
|
152
|
-
return [wrapSSR, hashId];
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
export var genSubStyleComponent = function genSubStyleComponent(componentName, styleFn, getDefaultToken, options) {
|
|
156
|
-
var useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, _objectSpread({
|
|
157
|
-
resetStyle: false,
|
|
158
|
-
// Sub Style should default after root one
|
|
159
|
-
order: -998
|
|
160
|
-
}, options));
|
|
161
|
-
var StyledComponent = function StyledComponent(_ref3) {
|
|
162
|
-
var prefixCls = _ref3.prefixCls,
|
|
163
|
-
_ref3$rootCls = _ref3.rootCls,
|
|
164
|
-
rootCls = _ref3$rootCls === void 0 ? prefixCls : _ref3$rootCls;
|
|
165
|
-
useStyle(prefixCls, rootCls);
|
|
166
|
-
return null;
|
|
167
|
-
};
|
|
168
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
169
|
-
StyledComponent.displayName = "SubStyle_".concat(Array.isArray(componentName) ? componentName.join('.') : componentName);
|
|
170
|
-
}
|
|
171
|
-
return StyledComponent;
|
|
172
|
-
};
|
|
173
|
-
var genCSSVarRegister = function genCSSVarRegister(component, getDefaultToken, options) {
|
|
174
|
-
function prefixToken(key) {
|
|
175
|
-
return "".concat(component).concat(key.slice(0, 1).toUpperCase()).concat(key.slice(1));
|
|
176
|
-
}
|
|
177
|
-
var _ref4 = options !== null && options !== void 0 ? options : {},
|
|
178
|
-
_ref4$unitless = _ref4.unitless,
|
|
179
|
-
originUnitless = _ref4$unitless === void 0 ? {} : _ref4$unitless,
|
|
180
|
-
_ref4$injectStyle = _ref4.injectStyle,
|
|
181
|
-
injectStyle = _ref4$injectStyle === void 0 ? true : _ref4$injectStyle;
|
|
182
|
-
var compUnitless = _defineProperty({}, prefixToken('zIndexPopup'), true);
|
|
183
|
-
Object.keys(originUnitless).forEach(function (key) {
|
|
184
|
-
compUnitless[prefixToken(key)] = originUnitless[key];
|
|
185
|
-
});
|
|
186
|
-
var CSSVarRegister = function CSSVarRegister(_ref5) {
|
|
187
|
-
var rootCls = _ref5.rootCls,
|
|
188
|
-
cssVar = _ref5.cssVar;
|
|
189
|
-
var _useToken3 = useToken(),
|
|
190
|
-
_useToken4 = _slicedToArray(_useToken3, 2),
|
|
191
|
-
realToken = _useToken4[1];
|
|
192
|
-
useCSSVarRegister({
|
|
193
|
-
path: [component],
|
|
194
|
-
prefix: cssVar.prefix,
|
|
195
|
-
key: cssVar === null || cssVar === void 0 ? void 0 : cssVar.key,
|
|
196
|
-
unitless: _objectSpread(_objectSpread({}, unitless), compUnitless),
|
|
197
|
-
ignore: ignore,
|
|
198
|
-
token: realToken,
|
|
199
|
-
scope: rootCls
|
|
200
|
-
}, function () {
|
|
201
|
-
var defaultToken = getDefaultComponentToken(component, realToken, getDefaultToken);
|
|
202
|
-
var componentToken = getComponentToken(component, realToken, defaultToken, {
|
|
203
|
-
deprecatedTokens: options === null || options === void 0 ? void 0 : options.deprecatedTokens
|
|
204
|
-
});
|
|
205
|
-
Object.keys(defaultToken).forEach(function (key) {
|
|
206
|
-
componentToken[prefixToken(key)] = componentToken[key];
|
|
207
|
-
delete componentToken[key];
|
|
208
|
-
});
|
|
209
|
-
return componentToken;
|
|
210
|
-
});
|
|
211
|
-
return null;
|
|
212
|
-
};
|
|
213
|
-
var useCSSVar = function useCSSVar(rootCls) {
|
|
214
|
-
var _useToken5 = useToken(),
|
|
215
|
-
_useToken6 = _slicedToArray(_useToken5, 5),
|
|
216
|
-
cssVar = _useToken6[4];
|
|
217
|
-
return [function (node) {
|
|
218
|
-
return injectStyle && cssVar ? _jsxs(_Fragment, {
|
|
219
|
-
children: [_jsx(CSSVarRegister, {
|
|
220
|
-
rootCls: rootCls,
|
|
221
|
-
cssVar: cssVar,
|
|
222
|
-
component: component
|
|
223
|
-
}), node]
|
|
224
|
-
}) : node;
|
|
225
|
-
}, cssVar === null || cssVar === void 0 ? void 0 : cssVar.key];
|
|
226
|
-
};
|
|
227
|
-
return useCSSVar;
|
|
228
|
-
};
|
|
229
|
-
export var genStyleHooks = function genStyleHooks(component, styleFn, getDefaultToken, options) {
|
|
230
|
-
var useStyle = genComponentStyleHook(component, styleFn, getDefaultToken, options);
|
|
231
|
-
var useCSSVar = genCSSVarRegister(Array.isArray(component) ? component[0] : component, getDefaultToken, options);
|
|
232
|
-
return function (prefixCls) {
|
|
233
|
-
var rootCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefixCls;
|
|
234
|
-
var _useStyle = useStyle(prefixCls, rootCls),
|
|
235
|
-
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
236
|
-
hashId = _useStyle2[1];
|
|
237
|
-
var _useCSSVar = useCSSVar(rootCls),
|
|
238
|
-
_useCSSVar2 = _slicedToArray(_useCSSVar, 2),
|
|
239
|
-
wrapCSSVar = _useCSSVar2[0],
|
|
240
|
-
cssVarCls = _useCSSVar2[1];
|
|
241
|
-
return [wrapCSSVar, hashId, cssVarCls];
|
|
242
|
-
};
|
|
243
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { unit } from '@ant-design/cssinjs';
|
|
2
|
-
export default function genMaxMin(type) {
|
|
3
|
-
if (type === 'js') {
|
|
4
|
-
return {
|
|
5
|
-
max: Math.max,
|
|
6
|
-
min: Math.min
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
max: function max() {
|
|
11
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
-
args[_key] = arguments[_key];
|
|
13
|
-
}
|
|
14
|
-
return "max(".concat(args.map(function (value) {
|
|
15
|
-
return unit(value);
|
|
16
|
-
}).join(','), ")");
|
|
17
|
-
},
|
|
18
|
-
min: function min() {
|
|
19
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
20
|
-
args[_key2] = arguments[_key2];
|
|
21
|
-
}
|
|
22
|
-
return "min(".concat(args.map(function (value) {
|
|
23
|
-
return unit(value);
|
|
24
|
-
}).join(','), ")");
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
}
|