@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
|
@@ -16,7 +16,6 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
16
16
|
import { gold } from '@ant-design/colors';
|
|
17
17
|
import { unit } from '@ant-design/cssinjs';
|
|
18
18
|
import { operationUnit } from '../../style';
|
|
19
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
20
19
|
var getTitleStyle = function getTitleStyle(fontSize, lineHeight, color, token) {
|
|
21
20
|
var titleMarginBottom = token.titleMarginBottom,
|
|
22
21
|
fontWeightStrong = token.fontWeightStrong;
|
|
@@ -28,7 +27,6 @@ var getTitleStyle = function getTitleStyle(fontSize, lineHeight, color, token) {
|
|
|
28
27
|
lineHeight: lineHeight
|
|
29
28
|
};
|
|
30
29
|
};
|
|
31
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
32
30
|
export var getTitleStyles = function getTitleStyles(token) {
|
|
33
31
|
var headings = [1, 2, 3, 4, 5];
|
|
34
32
|
var styles = {};
|
|
@@ -41,10 +39,7 @@ export var getLinkStyles = function getLinkStyles(token) {
|
|
|
41
39
|
var componentCls = token.componentCls;
|
|
42
40
|
return {
|
|
43
41
|
'a&, a': _objectSpread(_objectSpread({}, operationUnit(token)), {}, _defineProperty({
|
|
44
|
-
|
|
45
|
-
'&:active, &:hover': {
|
|
46
|
-
textDecoration: token.linkHoverDecoration
|
|
47
|
-
}
|
|
42
|
+
userSelect: 'text'
|
|
48
43
|
}, "&[disabled], &".concat(componentCls, "-disabled"), {
|
|
49
44
|
color: token.colorTextDisabled,
|
|
50
45
|
cursor: 'not-allowed',
|
|
@@ -185,12 +180,11 @@ export var getCopyableStyles = function getCopyableStyles(token) {
|
|
|
185
180
|
});
|
|
186
181
|
};
|
|
187
182
|
export var getEllipsisStyles = function getEllipsisStyles() {
|
|
188
|
-
return _defineProperty(_defineProperty(_defineProperty(
|
|
183
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "\n a&-ellipsis,\n span&-ellipsis\n ", {
|
|
189
184
|
display: 'inline-block',
|
|
190
185
|
maxWidth: '100%'
|
|
191
|
-
}), '&-single-line', {
|
|
192
|
-
whiteSpace: 'nowrap'
|
|
193
186
|
}), '&-ellipsis-single-line', {
|
|
187
|
+
whiteSpace: 'nowrap',
|
|
194
188
|
overflow: 'hidden',
|
|
195
189
|
textOverflow: 'ellipsis',
|
|
196
190
|
// https://blog.csdn.net/iefreer/article/details/50421025
|
|
@@ -18,42 +18,20 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
18
18
|
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; } }
|
|
19
19
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
import * as React from
|
|
22
|
-
import { flushSync } from
|
|
23
|
-
import classNames from
|
|
24
|
-
import RcUpload from
|
|
25
|
-
import useMergedState from
|
|
26
|
-
import { devUseWarning } from
|
|
27
|
-
import { ConfigContext } from
|
|
28
|
-
import DisabledContext from
|
|
29
|
-
import { useLocale } from
|
|
30
|
-
import defaultLocale from
|
|
31
|
-
import useStyle from
|
|
32
|
-
import UploadList from
|
|
33
|
-
import { file2Obj, getFileItem, removeFileItem, updateFileList } from
|
|
34
|
-
import { CloudUploadOutlined } from "@ant-design/icons";
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
import { useIntl } from "../../locales";
|
|
21
|
+
import * as React from 'react';
|
|
22
|
+
import { flushSync } from 'react-dom';
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import RcUpload from 'rc-upload';
|
|
25
|
+
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
|
26
|
+
import { devUseWarning } from '../_util/warning';
|
|
27
|
+
import { ConfigContext } from '../config-provider';
|
|
28
|
+
import DisabledContext from '../config-provider/DisabledContext';
|
|
29
|
+
import { useLocale } from '../locale';
|
|
30
|
+
import defaultLocale from '../locale/en_US';
|
|
31
|
+
import useStyle from './style';
|
|
32
|
+
import UploadList from './UploadList';
|
|
33
|
+
import { file2Obj, getFileItem, removeFileItem, updateFileList } from './utils';
|
|
37
34
|
export var LIST_IGNORE = "__LIST_IGNORE_".concat(Date.now(), "__");
|
|
38
|
-
var DefaultChildren = function DefaultChildren(props) {
|
|
39
|
-
var title = props.title,
|
|
40
|
-
description = props.description,
|
|
41
|
-
prefixCls = props.prefixCls;
|
|
42
|
-
var intl = useIntl();
|
|
43
|
-
return _jsxs("div", {
|
|
44
|
-
className: "".concat(prefixCls, "-drag-wrapper"),
|
|
45
|
-
children: [_jsx("p", {
|
|
46
|
-
className: "".concat(prefixCls, "-drag-icon-wrapper"),
|
|
47
|
-
children: _jsx(CloudUploadOutlined, {})
|
|
48
|
-
}), _jsx("div", {
|
|
49
|
-
className: "".concat(prefixCls, "-drag-text"),
|
|
50
|
-
children: title !== null && title !== void 0 ? title : intl.get("dda16720-d447-4d73-9e71-b5af7b5bbcfd").d("单击或拖动文件到此区域")
|
|
51
|
-
}), description && _jsx("div", {
|
|
52
|
-
className: "".concat(prefixCls, "-drag-desc"),
|
|
53
|
-
children: description
|
|
54
|
-
})]
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
35
|
var InternalUpload = function InternalUpload(props, ref) {
|
|
58
36
|
var fileList = props.fileList,
|
|
59
37
|
defaultFileList = props.defaultFileList,
|
|
@@ -61,7 +39,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
61
39
|
_props$showUploadList = props.showUploadList,
|
|
62
40
|
showUploadList = _props$showUploadList === void 0 ? true : _props$showUploadList,
|
|
63
41
|
_props$listType = props.listType,
|
|
64
|
-
listType = _props$listType === void 0 ?
|
|
42
|
+
listType = _props$listType === void 0 ? 'text' : _props$listType,
|
|
65
43
|
onPreview = props.onPreview,
|
|
66
44
|
onDownload = props.onDownload,
|
|
67
45
|
onChange = props.onChange,
|
|
@@ -75,7 +53,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
75
53
|
customizePrefixCls = props.prefixCls,
|
|
76
54
|
className = props.className,
|
|
77
55
|
_props$type = props.type,
|
|
78
|
-
type = _props$type === void 0 ?
|
|
56
|
+
type = _props$type === void 0 ? 'select' : _props$type,
|
|
79
57
|
children = props.children,
|
|
80
58
|
style = props.style,
|
|
81
59
|
itemRender = props.itemRender,
|
|
@@ -87,15 +65,12 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
87
65
|
_props$hasControlInsi = props.hasControlInside,
|
|
88
66
|
hasControlInside = _props$hasControlInsi === void 0 ? true : _props$hasControlInsi,
|
|
89
67
|
_props$action = props.action,
|
|
90
|
-
action = _props$action === void 0 ?
|
|
68
|
+
action = _props$action === void 0 ? '' : _props$action,
|
|
91
69
|
_props$accept = props.accept,
|
|
92
|
-
accept = _props$accept === void 0 ?
|
|
70
|
+
accept = _props$accept === void 0 ? '' : _props$accept,
|
|
93
71
|
_props$supportServerR = props.supportServerRender,
|
|
94
72
|
supportServerRender = _props$supportServerR === void 0 ? true : _props$supportServerR,
|
|
95
|
-
rootClassName = props.rootClassName
|
|
96
|
-
title = props.title,
|
|
97
|
-
description = props.description,
|
|
98
|
-
dropSingleFileUpload = props.dropSingleFileUpload;
|
|
73
|
+
rootClassName = props.rootClassName;
|
|
99
74
|
// ===================== Disabled =====================
|
|
100
75
|
var disabled = React.useContext(DisabledContext);
|
|
101
76
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
@@ -108,16 +83,16 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
108
83
|
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
109
84
|
mergedFileList = _useMergedState2[0],
|
|
110
85
|
setMergedFileList = _useMergedState2[1];
|
|
111
|
-
var _React$useState = React.useState(
|
|
86
|
+
var _React$useState = React.useState('drop'),
|
|
112
87
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
113
88
|
dragState = _React$useState2[0],
|
|
114
89
|
setDragState = _React$useState2[1];
|
|
115
90
|
var upload = React.useRef(null);
|
|
116
91
|
var wrapRef = React.useRef(null);
|
|
117
|
-
if (process.env.NODE_ENV !==
|
|
118
|
-
var warning = devUseWarning(
|
|
119
|
-
warning(
|
|
120
|
-
warning.deprecated(!(
|
|
92
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
93
|
+
var warning = devUseWarning('Upload');
|
|
94
|
+
warning('fileList' in props || !('value' in props), 'usage', '`value` is not a valid prop, do you mean `fileList`?');
|
|
95
|
+
warning.deprecated(!('transformFile' in props), 'transformFile', 'beforeUpload');
|
|
121
96
|
}
|
|
122
97
|
// Control mode will auto fill file uid if not provided
|
|
123
98
|
React.useMemo(function () {
|
|
@@ -132,7 +107,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
132
107
|
var cloneList = _toConsumableArray(changedFileList);
|
|
133
108
|
var exceedMaxCount = false;
|
|
134
109
|
// Cut to match count
|
|
135
|
-
if (maxCount === 1
|
|
110
|
+
if (maxCount === 1) {
|
|
136
111
|
cloneList = cloneList.slice(-1);
|
|
137
112
|
} else if (maxCount) {
|
|
138
113
|
exceedMaxCount = cloneList.length > maxCount;
|
|
@@ -150,7 +125,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
150
125
|
if (event) {
|
|
151
126
|
changeInfo.event = event;
|
|
152
127
|
}
|
|
153
|
-
if (!exceedMaxCount || file.status ===
|
|
128
|
+
if (!exceedMaxCount || file.status === 'removed' ||
|
|
154
129
|
// We should ignore event if current file is exceed `maxCount`
|
|
155
130
|
cloneList.some(function (f) {
|
|
156
131
|
return f.uid === file.uid;
|
|
@@ -194,7 +169,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
194
169
|
});
|
|
195
170
|
return _context.abrupt("return", false);
|
|
196
171
|
case 12:
|
|
197
|
-
if (_typeof(result) ===
|
|
172
|
+
if (_typeof(result) === 'object' && result) {
|
|
198
173
|
parsedFile = result;
|
|
199
174
|
}
|
|
200
175
|
case 13:
|
|
@@ -247,7 +222,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
247
222
|
clone = new File([originFileObj], originFileObj.name, {
|
|
248
223
|
type: originFileObj.type
|
|
249
224
|
});
|
|
250
|
-
} catch (
|
|
225
|
+
} catch (_unused) {
|
|
251
226
|
clone = new Blob([originFileObj], {
|
|
252
227
|
type: originFileObj.type
|
|
253
228
|
});
|
|
@@ -259,17 +234,18 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
259
234
|
triggerFileObj = clone;
|
|
260
235
|
} else {
|
|
261
236
|
// Inject `uploading` status
|
|
262
|
-
fileObj.status =
|
|
237
|
+
fileObj.status = 'uploading';
|
|
263
238
|
}
|
|
264
239
|
onInternalChange(triggerFileObj, newFileList);
|
|
265
240
|
});
|
|
266
241
|
};
|
|
267
242
|
var onSuccess = function onSuccess(response, file, xhr) {
|
|
268
243
|
try {
|
|
269
|
-
if (typeof response ===
|
|
244
|
+
if (typeof response === 'string') {
|
|
245
|
+
// biome-ignore lint/style/noParameterAssign: we need to modify response
|
|
270
246
|
response = JSON.parse(response);
|
|
271
247
|
}
|
|
272
|
-
} catch (
|
|
248
|
+
} catch (_unused2) {
|
|
273
249
|
/* do nothing */
|
|
274
250
|
}
|
|
275
251
|
// removed
|
|
@@ -277,7 +253,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
277
253
|
return;
|
|
278
254
|
}
|
|
279
255
|
var targetItem = file2Obj(file);
|
|
280
|
-
targetItem.status =
|
|
256
|
+
targetItem.status = 'done';
|
|
281
257
|
targetItem.percent = 100;
|
|
282
258
|
targetItem.response = response;
|
|
283
259
|
targetItem.xhr = xhr;
|
|
@@ -290,7 +266,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
290
266
|
return;
|
|
291
267
|
}
|
|
292
268
|
var targetItem = file2Obj(file);
|
|
293
|
-
targetItem.status =
|
|
269
|
+
targetItem.status = 'uploading';
|
|
294
270
|
targetItem.percent = e.percent;
|
|
295
271
|
var nextFileList = updateFileList(targetItem, mergedFileList);
|
|
296
272
|
onInternalChange(targetItem, nextFileList, e);
|
|
@@ -303,13 +279,13 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
303
279
|
var targetItem = file2Obj(file);
|
|
304
280
|
targetItem.error = error;
|
|
305
281
|
targetItem.response = response;
|
|
306
|
-
targetItem.status =
|
|
282
|
+
targetItem.status = 'error';
|
|
307
283
|
var nextFileList = updateFileList(targetItem, mergedFileList);
|
|
308
284
|
onInternalChange(targetItem, nextFileList);
|
|
309
285
|
};
|
|
310
286
|
var handleRemove = function handleRemove(file) {
|
|
311
287
|
var currentFile;
|
|
312
|
-
Promise.resolve(typeof onRemove ===
|
|
288
|
+
Promise.resolve(typeof onRemove === 'function' ? onRemove(file) : onRemove).then(function (ret) {
|
|
313
289
|
// Prevent removing file
|
|
314
290
|
if (ret === false) {
|
|
315
291
|
return;
|
|
@@ -318,12 +294,12 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
318
294
|
if (removedFileList) {
|
|
319
295
|
var _upload$current;
|
|
320
296
|
currentFile = _objectSpread(_objectSpread({}, file), {}, {
|
|
321
|
-
status:
|
|
297
|
+
status: 'removed'
|
|
322
298
|
});
|
|
323
299
|
mergedFileList === null || mergedFileList === void 0 || mergedFileList.forEach(function (item) {
|
|
324
|
-
var matchKey = currentFile.uid !== undefined ?
|
|
300
|
+
var matchKey = currentFile.uid !== undefined ? 'uid' : 'name';
|
|
325
301
|
if (item[matchKey] === currentFile[matchKey] && !Object.isFrozen(item)) {
|
|
326
|
-
item.status =
|
|
302
|
+
item.status = 'removed';
|
|
327
303
|
}
|
|
328
304
|
});
|
|
329
305
|
(_upload$current = upload.current) === null || _upload$current === void 0 || _upload$current.abort(currentFile);
|
|
@@ -333,7 +309,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
333
309
|
};
|
|
334
310
|
var onFileDrop = function onFileDrop(e) {
|
|
335
311
|
setDragState(e.type);
|
|
336
|
-
if (e.type ===
|
|
312
|
+
if (e.type === 'drop') {
|
|
337
313
|
onDrop === null || onDrop === void 0 || onDrop(e);
|
|
338
314
|
}
|
|
339
315
|
};
|
|
@@ -353,7 +329,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
353
329
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
354
330
|
direction = _React$useContext.direction,
|
|
355
331
|
ctxUpload = _React$useContext.upload;
|
|
356
|
-
var prefixCls = getPrefixCls(
|
|
332
|
+
var prefixCls = getPrefixCls('upload', customizePrefixCls);
|
|
357
333
|
var rcUploadProps = _objectSpread(_objectSpread({
|
|
358
334
|
onBatchStart: onBatchStart,
|
|
359
335
|
onError: onError,
|
|
@@ -373,8 +349,6 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
373
349
|
});
|
|
374
350
|
delete rcUploadProps.className;
|
|
375
351
|
delete rcUploadProps.style;
|
|
376
|
-
rcUploadProps === null || rcUploadProps === void 0 || delete rcUploadProps.title;
|
|
377
|
-
rcUploadProps === null || rcUploadProps === void 0 || delete rcUploadProps.description;
|
|
378
352
|
// Remove id to avoid open by label when trigger is hidden
|
|
379
353
|
// !children: https://github.com/ant-design/ant-design/issues/14298
|
|
380
354
|
// disabled: https://github.com/ant-design/ant-design/issues/16478
|
|
@@ -388,18 +362,19 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
388
362
|
wrapCSSVar = _useStyle2[0],
|
|
389
363
|
hashId = _useStyle2[1],
|
|
390
364
|
cssVarCls = _useStyle2[2];
|
|
391
|
-
var _useLocale = useLocale(
|
|
365
|
+
var _useLocale = useLocale('Upload', defaultLocale.Upload),
|
|
392
366
|
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
393
367
|
contextLocale = _useLocale2[0];
|
|
394
|
-
var _ref2 = typeof showUploadList ===
|
|
368
|
+
var _ref2 = typeof showUploadList === 'boolean' ? {} : showUploadList,
|
|
395
369
|
showRemoveIcon = _ref2.showRemoveIcon,
|
|
396
370
|
showPreviewIcon = _ref2.showPreviewIcon,
|
|
397
371
|
showDownloadIcon = _ref2.showDownloadIcon,
|
|
398
372
|
removeIcon = _ref2.removeIcon,
|
|
399
373
|
previewIcon = _ref2.previewIcon,
|
|
400
|
-
downloadIcon = _ref2.downloadIcon
|
|
374
|
+
downloadIcon = _ref2.downloadIcon,
|
|
375
|
+
extra = _ref2.extra;
|
|
401
376
|
// use showRemoveIcon if it is specified explicitly
|
|
402
|
-
var realShowRemoveIcon = typeof showRemoveIcon ===
|
|
377
|
+
var realShowRemoveIcon = typeof showRemoveIcon === 'undefined' ? !mergedDisabled : showRemoveIcon;
|
|
403
378
|
var renderUploadList = function renderUploadList(button, buttonVisible) {
|
|
404
379
|
if (!showUploadList) {
|
|
405
380
|
return button;
|
|
@@ -419,6 +394,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
419
394
|
previewIcon: previewIcon,
|
|
420
395
|
downloadIcon: downloadIcon,
|
|
421
396
|
iconRender: iconRender,
|
|
397
|
+
extra: extra,
|
|
422
398
|
locale: _objectSpread(_objectSpread({}, contextLocale), propLocale),
|
|
423
399
|
isImageUrl: isImageUrl,
|
|
424
400
|
progress: progress,
|
|
@@ -428,13 +404,13 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
428
404
|
disabled: mergedDisabled
|
|
429
405
|
});
|
|
430
406
|
};
|
|
431
|
-
var mergedCls = classNames(wrapperCls, className, rootClassName, hashId, cssVarCls, ctxUpload === null || ctxUpload === void 0 ? void 0 : ctxUpload.className, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), direction ===
|
|
407
|
+
var mergedCls = classNames(wrapperCls, className, rootClassName, hashId, cssVarCls, ctxUpload === null || ctxUpload === void 0 ? void 0 : ctxUpload.className, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), "".concat(prefixCls, "-picture-card-wrapper"), listType === 'picture-card'), "".concat(prefixCls, "-picture-circle-wrapper"), listType === 'picture-circle'));
|
|
432
408
|
var mergedStyle = _objectSpread(_objectSpread({}, ctxUpload === null || ctxUpload === void 0 ? void 0 : ctxUpload.style), style);
|
|
433
409
|
// ======================== Render ========================
|
|
434
|
-
if (type ===
|
|
410
|
+
if (type === 'drag') {
|
|
435
411
|
var dragCls = classNames(hashId, prefixCls, "".concat(prefixCls, "-drag"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-drag-uploading"), mergedFileList.some(function (file) {
|
|
436
|
-
return file.status ===
|
|
437
|
-
})), "".concat(prefixCls, "-drag-hover"), dragState ===
|
|
412
|
+
return file.status === 'uploading';
|
|
413
|
+
})), "".concat(prefixCls, "-drag-hover"), dragState === 'dragover'), "".concat(prefixCls, "-disabled"), mergedDisabled), "".concat(prefixCls, "-rtl"), direction === 'rtl'));
|
|
438
414
|
return wrapCSSVar(_jsxs("span", {
|
|
439
415
|
className: mergedCls,
|
|
440
416
|
ref: wrapRef,
|
|
@@ -449,11 +425,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
449
425
|
className: "".concat(prefixCls, "-btn"),
|
|
450
426
|
children: _jsx("div", {
|
|
451
427
|
className: "".concat(prefixCls, "-drag-container"),
|
|
452
|
-
children: children
|
|
453
|
-
title: title,
|
|
454
|
-
description: description,
|
|
455
|
-
prefixCls: prefixCls
|
|
456
|
-
})
|
|
428
|
+
children: children
|
|
457
429
|
})
|
|
458
430
|
}))
|
|
459
431
|
}), renderUploadList()]
|
|
@@ -463,13 +435,13 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
463
435
|
var uploadButton = _jsx("div", {
|
|
464
436
|
className: uploadButtonCls,
|
|
465
437
|
style: children ? undefined : {
|
|
466
|
-
display:
|
|
438
|
+
display: 'none'
|
|
467
439
|
},
|
|
468
440
|
children: _jsx(RcUpload, _objectSpread(_objectSpread({}, rcUploadProps), {}, {
|
|
469
441
|
ref: upload
|
|
470
442
|
}))
|
|
471
443
|
});
|
|
472
|
-
if (listType ===
|
|
444
|
+
if (listType === 'picture-card' || listType === 'picture-circle') {
|
|
473
445
|
return wrapCSSVar(_jsx("span", {
|
|
474
446
|
className: mergedCls,
|
|
475
447
|
ref: wrapRef,
|
|
@@ -483,7 +455,7 @@ var InternalUpload = function InternalUpload(props, ref) {
|
|
|
483
455
|
}));
|
|
484
456
|
};
|
|
485
457
|
var Upload = /*#__PURE__*/React.forwardRef(InternalUpload);
|
|
486
|
-
if (process.env.NODE_ENV !==
|
|
487
|
-
Upload.displayName =
|
|
458
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
459
|
+
Upload.displayName = 'Upload';
|
|
488
460
|
}
|
|
489
461
|
export default Upload;
|
|
@@ -40,6 +40,7 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
40
40
|
customPreviewIcon = _ref.previewIcon,
|
|
41
41
|
customRemoveIcon = _ref.removeIcon,
|
|
42
42
|
customDownloadIcon = _ref.downloadIcon,
|
|
43
|
+
customExtra = _ref.extra,
|
|
43
44
|
onPreview = _ref.onPreview,
|
|
44
45
|
onDownload = _ref.onDownload,
|
|
45
46
|
onClose = _ref.onClose;
|
|
@@ -101,13 +102,13 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
101
102
|
}
|
|
102
103
|
var listItemClassName = classNames("".concat(prefixCls, "-list-item"), "".concat(prefixCls, "-list-item-").concat(mergedStatus));
|
|
103
104
|
var linkProps = typeof file.linkProps === 'string' ? JSON.parse(file.linkProps) : file.linkProps;
|
|
104
|
-
var removeIcon = showRemoveIcon ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || _jsx(DeleteOutlined, {}), function () {
|
|
105
|
+
var removeIcon = (typeof showRemoveIcon === 'function' ? showRemoveIcon(file) : showRemoveIcon) ? actionIconRender((typeof customRemoveIcon === 'function' ? customRemoveIcon(file) : customRemoveIcon) || _jsx(DeleteOutlined, {}), function () {
|
|
105
106
|
return onClose(file);
|
|
106
107
|
}, prefixCls, locale.removeFile,
|
|
107
108
|
// acceptUploadDisabled is true, only remove icon will follow Upload disabled prop
|
|
108
109
|
// https://github.com/ant-design/ant-design/issues/46171
|
|
109
110
|
true) : null;
|
|
110
|
-
var downloadIcon = showDownloadIcon && mergedStatus === 'done' ? actionIconRender((typeof customDownloadIcon === 'function' ? customDownloadIcon(file) : customDownloadIcon) || _jsx(DownloadOutlined, {}), function () {
|
|
111
|
+
var downloadIcon = (typeof showDownloadIcon === 'function' ? showDownloadIcon(file) : showDownloadIcon) && mergedStatus === 'done' ? actionIconRender((typeof customDownloadIcon === 'function' ? customDownloadIcon(file) : customDownloadIcon) || _jsx(DownloadOutlined, {}), function () {
|
|
111
112
|
return onDownload(file);
|
|
112
113
|
}, prefixCls, locale.downloadFile) : null;
|
|
113
114
|
var downloadOrDelete = listType !== 'picture-card' && listType !== 'picture-circle' && _jsxs("span", {
|
|
@@ -116,8 +117,13 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
116
117
|
}),
|
|
117
118
|
children: [downloadIcon, removeIcon]
|
|
118
119
|
}, "download-delete");
|
|
120
|
+
var extraContent = typeof customExtra === 'function' ? customExtra(file) : customExtra;
|
|
121
|
+
var extra = extraContent && _jsx("span", {
|
|
122
|
+
className: "".concat(prefixCls, "-list-item-extra"),
|
|
123
|
+
children: extraContent
|
|
124
|
+
});
|
|
119
125
|
var listItemNameClass = classNames("".concat(prefixCls, "-list-item-name"));
|
|
120
|
-
var fileName = file.url ?
|
|
126
|
+
var fileName = file.url ? _jsxs("a", _objectSpread(_objectSpread({
|
|
121
127
|
target: "_blank",
|
|
122
128
|
rel: "noopener noreferrer",
|
|
123
129
|
className: listItemNameClass,
|
|
@@ -127,16 +133,16 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
127
133
|
onClick: function onClick(e) {
|
|
128
134
|
return onPreview(file, e);
|
|
129
135
|
},
|
|
130
|
-
children: file.name
|
|
131
|
-
}), "view")
|
|
136
|
+
children: [file.name, extra]
|
|
137
|
+
}), "view") : _jsxs("span", {
|
|
132
138
|
className: listItemNameClass,
|
|
133
139
|
onClick: function onClick(e) {
|
|
134
140
|
return onPreview(file, e);
|
|
135
141
|
},
|
|
136
142
|
title: file.name,
|
|
137
|
-
children: file.name
|
|
138
|
-
}, "view")
|
|
139
|
-
var previewIcon = showPreviewIcon && (file.url || file.thumbUrl) ? _jsx("a", {
|
|
143
|
+
children: [file.name, extra]
|
|
144
|
+
}, "view");
|
|
145
|
+
var previewIcon = (typeof showPreviewIcon === 'function' ? showPreviewIcon(file) : showPreviewIcon) && (file.url || file.thumbUrl) ? _jsx("a", {
|
|
140
146
|
href: file.url || file.thumbUrl,
|
|
141
147
|
target: "_blank",
|
|
142
148
|
rel: "noopener noreferrer",
|
|
@@ -155,7 +161,7 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
155
161
|
var rootPrefixCls = getPrefixCls();
|
|
156
162
|
var dom = _jsxs("div", {
|
|
157
163
|
className: listItemClassName,
|
|
158
|
-
children: [icon, fileName, pictureCardActions, showProgress && _jsx(CSSMotion, {
|
|
164
|
+
children: [icon, fileName, downloadOrDelete, pictureCardActions, showProgress && _jsx(CSSMotion, {
|
|
159
165
|
motionName: "".concat(rootPrefixCls, "-fade"),
|
|
160
166
|
visible: mergedStatus === 'uploading',
|
|
161
167
|
motionDeadline: 2000,
|
|
@@ -22,6 +22,7 @@ import PaperClipOutlined from '@ant-design/icons/PaperClipOutlined';
|
|
|
22
22
|
import PictureTwoTone from '@ant-design/icons/PictureTwoTone';
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import CSSMotion, { CSSMotionList } from 'rc-motion';
|
|
25
|
+
import omit from 'rc-util/lib/omit';
|
|
25
26
|
import useForceUpdate from '../../_util/hooks/useForceUpdate';
|
|
26
27
|
import initCollapseMotion from '../../_util/motion';
|
|
27
28
|
import { cloneElement } from '../../_util/reactNode';
|
|
@@ -53,6 +54,7 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
53
54
|
removeIcon = props.removeIcon,
|
|
54
55
|
previewIcon = props.previewIcon,
|
|
55
56
|
downloadIcon = props.downloadIcon,
|
|
57
|
+
extra = props.extra,
|
|
56
58
|
_props$progress = props.progress,
|
|
57
59
|
progress = _props$progress === void 0 ? {
|
|
58
60
|
size: [-1, 2],
|
|
@@ -68,22 +70,22 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
68
70
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
69
71
|
motionAppear = _React$useState2[0],
|
|
70
72
|
setMotionAppear = _React$useState2[1];
|
|
73
|
+
var isPictureCardOrCirle = ['picture-card', 'picture-circle'].includes(listType);
|
|
71
74
|
// ============================= Effect =============================
|
|
72
75
|
React.useEffect(function () {
|
|
73
|
-
if (listType
|
|
76
|
+
if (!listType.startsWith('picture')) {
|
|
74
77
|
return;
|
|
75
78
|
}
|
|
76
79
|
(items || []).forEach(function (file) {
|
|
77
|
-
if (
|
|
80
|
+
if (!(file.originFileObj instanceof File || file.originFileObj instanceof Blob) || file.thumbUrl !== undefined) {
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
83
|
+
file.thumbUrl = '';
|
|
84
|
+
previewFile === null || previewFile === void 0 || previewFile(file.originFileObj).then(function (previewDataUrl) {
|
|
85
|
+
// Need append '' to avoid dead loop
|
|
86
|
+
file.thumbUrl = previewDataUrl || '';
|
|
87
|
+
forceUpdate();
|
|
88
|
+
});
|
|
87
89
|
});
|
|
88
90
|
}, [listType, items, previewFile]);
|
|
89
91
|
React.useEffect(function () {
|
|
@@ -112,14 +114,12 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
112
114
|
return iconRender(file, listType);
|
|
113
115
|
}
|
|
114
116
|
var isLoading = file.status === 'uploading';
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} else if (listType === 'picture-card' || listType === 'picture-circle') {
|
|
120
|
-
icon = isLoading ? locale.uploading : fileIcon;
|
|
117
|
+
if (listType.startsWith('picture')) {
|
|
118
|
+
var loadingIcon = listType === 'picture' ? _jsx(LoadingOutlined, {}) : locale.uploading;
|
|
119
|
+
var fileIcon = isImgUrl !== null && isImgUrl !== void 0 && isImgUrl(file) ? _jsx(PictureTwoTone, {}) : _jsx(FileTwoTone, {});
|
|
120
|
+
return isLoading ? loadingIcon : fileIcon;
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return isLoading ? _jsx(LoadingOutlined, {}) : _jsx(PaperClipOutlined, {});
|
|
123
123
|
};
|
|
124
124
|
var actionIconRender = function actionIconRender(customIcon, callback, prefixCls, title, acceptUploadDisabled) {
|
|
125
125
|
var btnProps = {
|
|
@@ -138,15 +138,11 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
138
138
|
if (acceptUploadDisabled) {
|
|
139
139
|
btnProps.disabled = disabled;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
return /*#__PURE__*/React.isValidElement(customIcon) ? _jsx(Button, _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
142
|
+
icon: cloneElement(customIcon, _objectSpread(_objectSpread({}, customIcon.props), {}, {
|
|
143
143
|
onClick: function onClick() {}
|
|
144
|
-
}))
|
|
145
|
-
|
|
146
|
-
icon: btnIcon
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
|
-
return _jsx(Button, _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
144
|
+
}))
|
|
145
|
+
})) : _jsx(Button, _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
150
146
|
children: _jsx("span", {
|
|
151
147
|
children: customIcon
|
|
152
148
|
})
|
|
@@ -166,31 +162,20 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
166
162
|
var prefixCls = getPrefixCls('upload', customizePrefixCls);
|
|
167
163
|
var rootPrefixCls = getPrefixCls();
|
|
168
164
|
var listClassNames = classNames("".concat(prefixCls, "-list"), "".concat(prefixCls, "-list-").concat(listType));
|
|
169
|
-
// >>> Motion config
|
|
170
|
-
var motionKeyList = _toConsumableArray(items.map(function (file) {
|
|
171
|
-
return {
|
|
172
|
-
key: file.uid,
|
|
173
|
-
file: file
|
|
174
|
-
};
|
|
175
|
-
}));
|
|
176
|
-
var animationDirection = listType === 'picture-card' || listType === 'picture-circle' ? 'animate-inline' : 'animate';
|
|
177
|
-
// const transitionName = list.length === 0 ? '' : `${prefixCls}-${animationDirection}`;
|
|
178
|
-
var motionConfig = {
|
|
179
|
-
motionDeadline: 2000,
|
|
180
|
-
motionName: "".concat(prefixCls, "-").concat(animationDirection),
|
|
181
|
-
keys: motionKeyList,
|
|
182
|
-
motionAppear: motionAppear
|
|
183
|
-
};
|
|
184
165
|
var listItemMotion = React.useMemo(function () {
|
|
185
|
-
|
|
186
|
-
delete motion.onAppearEnd;
|
|
187
|
-
delete motion.onEnterEnd;
|
|
188
|
-
delete motion.onLeaveEnd;
|
|
189
|
-
return motion;
|
|
166
|
+
return omit(initCollapseMotion(rootPrefixCls), ['onAppearEnd', 'onEnterEnd', 'onLeaveEnd']);
|
|
190
167
|
}, [rootPrefixCls]);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
168
|
+
var motionConfig = _objectSpread(_objectSpread({}, isPictureCardOrCirle ? {} : listItemMotion), {}, {
|
|
169
|
+
motionDeadline: 2000,
|
|
170
|
+
motionName: "".concat(prefixCls, "-").concat(isPictureCardOrCirle ? 'animate-inline' : 'animate'),
|
|
171
|
+
keys: _toConsumableArray(items.map(function (file) {
|
|
172
|
+
return {
|
|
173
|
+
key: file.uid,
|
|
174
|
+
file: file
|
|
175
|
+
};
|
|
176
|
+
})),
|
|
177
|
+
motionAppear: motionAppear
|
|
178
|
+
});
|
|
194
179
|
return _jsxs("div", {
|
|
195
180
|
className: listClassNames,
|
|
196
181
|
children: [_jsx(CSSMotionList, _objectSpread(_objectSpread({}, motionConfig), {}, {
|
|
@@ -216,6 +201,7 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
216
201
|
removeIcon: removeIcon,
|
|
217
202
|
previewIcon: previewIcon,
|
|
218
203
|
downloadIcon: downloadIcon,
|
|
204
|
+
extra: extra,
|
|
219
205
|
iconRender: internalIconRender,
|
|
220
206
|
actionIconRender: actionIconRender,
|
|
221
207
|
itemRender: itemRender,
|
|
@@ -17,7 +17,7 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
17
17
|
cursor: 'pointer',
|
|
18
18
|
transition: "border-color ".concat(token.motionDurationSlow)
|
|
19
19
|
}, componentCls, {
|
|
20
|
-
|
|
20
|
+
padding: token.padding
|
|
21
21
|
}), "".concat(componentCls, "-btn"), {
|
|
22
22
|
display: 'table',
|
|
23
23
|
width: '100%',
|
|
@@ -27,23 +27,10 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
27
27
|
'&:focus-visible': {
|
|
28
28
|
outline: "".concat(unit(token.lineWidthFocus), " solid ").concat(token.colorPrimaryBorder)
|
|
29
29
|
}
|
|
30
|
-
}), "".concat(componentCls, "-drag-container"),
|
|
30
|
+
}), "".concat(componentCls, "-drag-container"), {
|
|
31
31
|
display: 'table-cell',
|
|
32
32
|
verticalAlign: 'middle'
|
|
33
|
-
}, "".concat(componentCls, "-
|
|
34
|
-
padding: "39px 0"
|
|
35
|
-
}, "".concat(componentCls, "-drag-icon-wrapper"), _defineProperty({
|
|
36
|
-
marginBottom: "8px"
|
|
37
|
-
}, iconCls, {
|
|
38
|
-
color: token.colorPrimaryHover,
|
|
39
|
-
fontSize: "48px"
|
|
40
|
-
})), "".concat(componentCls, "-drag-text"), {
|
|
41
|
-
lineHeight: "20px"
|
|
42
|
-
}), "".concat(componentCls, "-drag-desc"), {
|
|
43
|
-
color: token.colorTextTertiary,
|
|
44
|
-
marginTop: "8px",
|
|
45
|
-
lineHeight: "20px"
|
|
46
|
-
}))), "\n &:not(".concat(componentCls, "-disabled):hover,\n &-hover:not(").concat(componentCls, "-disabled)\n "), {
|
|
33
|
+
}), "\n &:not(".concat(componentCls, "-disabled):hover,\n &-hover:not(").concat(componentCls, "-disabled)\n "), {
|
|
47
34
|
borderColor: token.colorPrimaryHover
|
|
48
35
|
}), "p".concat(componentCls, "-drag-icon"), _defineProperty({
|
|
49
36
|
marginBottom: token.margin
|
|
@@ -57,16 +44,8 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
57
44
|
}), "p".concat(componentCls, "-hint"), {
|
|
58
45
|
color: token.colorTextDescription,
|
|
59
46
|
fontSize: token.fontSize
|
|
60
|
-
}), "&".concat(componentCls, "-disabled"), _defineProperty(
|
|
61
|
-
background: token.colorBgContainerDisabled
|
|
62
|
-
}, "p".concat(componentCls, "-drag-icon ").concat(iconCls, ",\n p").concat(componentCls, "-text,\n p").concat(componentCls, "-hint,\n "), {
|
|
63
|
-
color: token.colorTextDisabled
|
|
64
|
-
}), "".concat(componentCls, "-drag-wrapper"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-drag-icon-wrapper"), _defineProperty({}, iconCls, {
|
|
65
|
-
color: token.colorTextDisabled
|
|
66
|
-
})), "".concat(componentCls, "-drag-text"), {
|
|
67
|
-
color: token.colorTextDisabled
|
|
68
|
-
}), "".concat(componentCls, "-drag-desc"), {
|
|
47
|
+
}), "&".concat(componentCls, "-disabled"), _defineProperty({}, "p".concat(componentCls, "-drag-icon ").concat(iconCls, ",\n p").concat(componentCls, "-text,\n p").concat(componentCls, "-hint\n "), {
|
|
69
48
|
color: token.colorTextDisabled
|
|
70
|
-
}))))
|
|
49
|
+
}))));
|
|
71
50
|
};
|
|
72
51
|
export default genDraggerStyle;
|