@chaoswise/ui 3.1.6 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Antd5/_util/PurePanel.js +9 -1
- package/lib/Antd5/_util/convertToTooltipProps.js +15 -0
- package/lib/Antd5/_util/extendsObject.js +14 -23
- package/lib/Antd5/_util/hooks/useClosable.js +25 -31
- package/lib/Antd5/_util/hooks/useMergeSemantic/index.js +89 -0
- package/lib/Antd5/_util/hooks/useMergeSemantic/interface.js +1 -0
- package/lib/Antd5/_util/isPrimitive.js +5 -0
- package/lib/Antd5/_util/mediaQueryUtil.js +16 -0
- package/lib/Antd5/_util/responsiveObserver.js +41 -33
- package/lib/Antd5/_util/toList.js +6 -3
- package/lib/Antd5/_util/warning.js +0 -1
- package/lib/Antd5/_util/wave/WaveEffect.js +29 -16
- package/lib/Antd5/_util/wave/index.js +2 -2
- package/lib/Antd5/_util/wave/useWave.js +1 -1
- package/lib/Antd5/affix/index.js +13 -11
- package/lib/Antd5/alert/Alert.js +19 -18
- package/lib/Antd5/anchor/Anchor.js +9 -7
- package/lib/Antd5/anchor/AnchorLink.js +16 -3
- package/lib/Antd5/app/App.js +90 -0
- package/lib/Antd5/app/index.js +3 -92
- package/lib/Antd5/app/useApp.js +6 -0
- package/lib/Antd5/auto-complete/AutoComplete.js +142 -0
- package/lib/Antd5/auto-complete/index.js +8 -106
- package/lib/Antd5/avatar/{avatar.js → Avatar.js} +25 -29
- package/lib/Antd5/avatar/{group.js → AvatarGroup.js} +14 -9
- package/lib/Antd5/avatar/index.js +3 -4
- package/lib/Antd5/breadcrumb/Breadcrumb.js +1 -0
- package/lib/Antd5/breadcrumb/style/index.js +1 -1
- package/lib/Antd5/button/{LoadingIcon.js → DefaultLoadingIcon.js} +12 -9
- package/lib/Antd5/button/button-group.js +11 -11
- package/lib/Antd5/button/button.js +60 -26
- package/lib/Antd5/button/buttonHelpers.js +8 -1
- package/lib/Antd5/button/style/compact.js +9 -10
- package/lib/Antd5/button/style/index.js +127 -41
- package/lib/Antd5/button/style/token.js +19 -8
- package/lib/Antd5/calendar/Header.js +4 -4
- package/lib/Antd5/calendar/generateCalendar.js +17 -12
- package/lib/Antd5/calendar/style/index.js +8 -2
- package/lib/Antd5/card/Card.js +9 -5
- package/lib/Antd5/card/style/index.js +22 -15
- package/lib/Antd5/carousel/index.js +21 -11
- package/lib/Antd5/carousel/style/index.js +39 -12
- package/lib/Antd5/cascader/index.js +54 -18
- package/lib/Antd5/cascader/style/columns.js +4 -2
- package/lib/Antd5/cascader/style/index.js +2 -1
- package/lib/Antd5/collapse/Collapse.js +32 -25
- package/lib/Antd5/collapse/style/index.js +14 -10
- package/lib/Antd5/color-picker/ColorPicker.js +13 -8
- package/lib/Antd5/color-picker/components/ColorAlphaInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorHexInput.js +1 -1
- package/lib/Antd5/color-picker/components/ColorHsbInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorInput.js +7 -7
- package/lib/Antd5/color-picker/components/ColorPresets.js +15 -12
- package/lib/Antd5/color-picker/components/ColorRgbInput.js +8 -13
- package/lib/Antd5/color-picker/components/ColorSteppers.js +6 -13
- package/lib/Antd5/color-picker/interface.js +3 -6
- package/lib/Antd5/color-picker/style/color-block.js +2 -1
- package/lib/Antd5/config-provider/MotionWrapper.js +12 -4
- package/lib/Antd5/config-provider/UnstableContext.js +29 -0
- package/lib/Antd5/config-provider/context.js +32 -2
- package/lib/Antd5/config-provider/cssVariables.js +7 -7
- package/lib/Antd5/config-provider/hooks/useSize.js +1 -1
- package/lib/Antd5/config-provider/index.js +12 -3
- package/lib/Antd5/date-picker/generatePicker/generateRangePicker.js +33 -12
- package/lib/Antd5/date-picker/generatePicker/generateSinglePicker.js +32 -13
- package/lib/Antd5/date-picker/hooks/useMergedPickerSemantic.js +47 -0
- package/lib/Antd5/date-picker/index.js +2 -2
- package/lib/Antd5/date-picker/locale/ar_EG.js +1 -8
- package/lib/Antd5/date-picker/locale/example.json +5 -8
- package/lib/Antd5/date-picker/locale/ko_KR.js +11 -1
- package/lib/Antd5/date-picker/locale/pl_PL.js +0 -3
- package/lib/Antd5/date-picker/locale/pt_PT.js +0 -3
- package/lib/Antd5/date-picker/locale/sl_SI.js +1 -3
- package/lib/Antd5/date-picker/style/index.js +9 -6
- package/lib/Antd5/date-picker/style/panel.js +12 -8
- package/lib/Antd5/date-picker/style/token.js +3 -3
- package/lib/Antd5/date-picker/style/variants.js +6 -2
- package/lib/Antd5/descriptions/Cell.js +14 -8
- package/lib/Antd5/descriptions/Item.js +2 -0
- package/lib/Antd5/descriptions/Row.js +10 -6
- package/lib/Antd5/descriptions/hooks/useRow.js +1 -1
- package/lib/Antd5/descriptions/index.js +45 -18
- package/lib/Antd5/descriptions/style/index.js +11 -2
- package/lib/Antd5/divider/index.js +32 -15
- package/lib/Antd5/divider/style/index.js +20 -7
- package/lib/Antd5/drawer/DrawerPanel.js +8 -10
- package/lib/Antd5/drawer/index.js +20 -17
- package/lib/Antd5/dropdown/dropdown-button.js +9 -3
- package/lib/Antd5/dropdown/dropdown.js +33 -35
- package/lib/Antd5/dropdown/style/index.js +1 -1
- package/lib/Antd5/empty/empty.js +2 -2
- package/lib/Antd5/empty/index.js +41 -23
- package/lib/Antd5/empty/simple.js +4 -4
- package/lib/Antd5/flex/style/index.js +2 -0
- package/lib/Antd5/float-button/FloatButton.js +12 -15
- package/lib/Antd5/float-button/FloatButtonContent.js +13 -7
- package/lib/Antd5/float-button/FloatButtonGroup.js +6 -6
- package/lib/Antd5/float-button/style/keyframes.js +4 -4
- package/lib/Antd5/form/ErrorList.js +1 -3
- package/lib/Antd5/form/Form.js +19 -19
- package/lib/Antd5/form/FormItem/index.js +1 -1
- package/lib/Antd5/form/FormItemLabel.js +12 -14
- package/lib/Antd5/form/context.js +3 -4
- package/lib/Antd5/form/hooks/useForm.js +16 -5
- package/lib/Antd5/form/hooks/useFormInstance.js +3 -3
- package/lib/Antd5/form/hooks/useFormItemStatus.js +7 -7
- package/lib/Antd5/form/hooks/useFormWarning.js +2 -2
- package/lib/Antd5/form/hooks/useFrameState.js +3 -4
- package/lib/Antd5/form/hooks/useItemRef.js +3 -2
- package/lib/Antd5/form/hooks/useVariants.js +5 -5
- package/lib/Antd5/form/style/index.js +22 -15
- package/lib/Antd5/grid/hooks/useBreakpoint.js +2 -1
- package/lib/Antd5/grid/hooks/useGutter.js +29 -0
- package/lib/Antd5/grid/row.js +8 -63
- package/lib/Antd5/grid/style/index.js +14 -8
- package/lib/Antd5/image/PreviewGroup.js +9 -2
- package/lib/Antd5/image/index.js +26 -17
- package/lib/Antd5/image/style/index.js +10 -10
- package/lib/Antd5/index.js +3 -1
- package/lib/Antd5/input/Group.js +5 -3
- package/lib/Antd5/input/Input.js +27 -20
- package/lib/Antd5/input/OTP/OTPInput.js +36 -19
- package/lib/Antd5/input/OTP/index.js +40 -19
- package/lib/Antd5/input/Password.js +7 -9
- package/lib/Antd5/input/Search.js +16 -9
- package/lib/Antd5/input/TextArea.js +90 -33
- package/lib/Antd5/input/style/index.js +31 -82
- package/lib/Antd5/input/style/otp.js +22 -6
- package/lib/Antd5/input/style/textarea.js +80 -0
- package/lib/Antd5/input/style/token.js +16 -7
- package/lib/Antd5/input/style/variants.js +67 -12
- package/lib/Antd5/input-number/index.js +1 -1
- package/lib/Antd5/input-number/style/index.js +10 -7
- package/lib/Antd5/input-number/style/token.js +6 -4
- package/lib/Antd5/layout/Sider.js +58 -68
- package/lib/Antd5/layout/layout.js +7 -5
- package/lib/Antd5/layout/style/sider.js +33 -42
- package/lib/Antd5/list/index.js +45 -45
- package/lib/Antd5/locale/ar_EG.js +7 -1
- package/lib/Antd5/locale/az_AZ.js +3 -2
- package/lib/Antd5/locale/bg_BG.js +8 -0
- package/lib/Antd5/locale/bn_BD.js +7 -1
- package/lib/Antd5/locale/by_BY.js +8 -2
- package/lib/Antd5/locale/ca_ES.js +7 -1
- package/lib/Antd5/locale/cs_CZ.js +19 -2
- package/lib/Antd5/locale/da_DK.js +8 -0
- package/lib/Antd5/locale/de_DE.js +4 -2
- package/lib/Antd5/locale/el_GR.js +3 -2
- package/lib/Antd5/locale/en_GB.js +8 -2
- package/lib/Antd5/locale/en_US.js +3 -2
- package/lib/Antd5/locale/es_ES.js +3 -2
- package/lib/Antd5/locale/et_EE.js +8 -2
- package/lib/Antd5/locale/eu_ES.js +3 -2
- package/lib/Antd5/locale/fa_IR.js +17 -7
- package/lib/Antd5/locale/fi_FI.js +8 -0
- package/lib/Antd5/locale/fr_BE.js +4 -1
- package/lib/Antd5/locale/fr_CA.js +9 -1
- package/lib/Antd5/locale/fr_FR.js +4 -1
- package/lib/Antd5/locale/ga_IE.js +7 -1
- package/lib/Antd5/locale/gl_ES.js +7 -1
- package/lib/Antd5/locale/he_IL.js +10 -1
- package/lib/Antd5/locale/hi_IN.js +7 -1
- package/lib/Antd5/locale/hr_HR.js +7 -1
- package/lib/Antd5/locale/hu_HU.js +8 -0
- package/lib/Antd5/locale/hy_AM.js +8 -3
- package/lib/Antd5/locale/id_ID.js +3 -2
- package/lib/Antd5/locale/is_IS.js +8 -0
- package/lib/Antd5/locale/it_IT.js +3 -2
- package/lib/Antd5/locale/ja_JP.js +3 -2
- package/lib/Antd5/locale/ka_GE.js +7 -1
- package/lib/Antd5/locale/kk_KZ.js +7 -1
- package/lib/Antd5/locale/km_KH.js +3 -0
- package/lib/Antd5/locale/kmr_IQ.js +8 -0
- package/lib/Antd5/locale/kn_IN.js +8 -2
- package/lib/Antd5/locale/ko_KR.js +3 -2
- package/lib/Antd5/locale/ku_IQ.js +8 -0
- package/lib/Antd5/locale/lt_LT.js +3 -2
- package/lib/Antd5/locale/lv_LV.js +8 -0
- package/lib/Antd5/locale/mk_MK.js +7 -1
- package/lib/Antd5/locale/ml_IN.js +7 -1
- package/lib/Antd5/locale/mn_MN.js +8 -2
- package/lib/Antd5/locale/ms_MY.js +3 -2
- package/lib/Antd5/locale/my_MM.js +3 -2
- package/lib/Antd5/locale/nb_NO.js +7 -1
- package/lib/Antd5/locale/ne_NP.js +3 -2
- package/lib/Antd5/locale/nl_BE.js +2 -1
- package/lib/Antd5/locale/nl_NL.js +2 -1
- package/lib/Antd5/locale/pl_PL.js +3 -2
- package/lib/Antd5/locale/pt_BR.js +3 -2
- package/lib/Antd5/locale/pt_PT.js +3 -2
- package/lib/Antd5/locale/ro_RO.js +7 -1
- package/lib/Antd5/locale/ru_RU.js +4 -3
- package/lib/Antd5/locale/si_LK.js +8 -2
- package/lib/Antd5/locale/sk_SK.js +8 -2
- package/lib/Antd5/locale/sl_SI.js +8 -0
- package/lib/Antd5/locale/sr_RS.js +7 -1
- package/lib/Antd5/locale/sv_SE.js +3 -2
- package/lib/Antd5/locale/ta_IN.js +8 -2
- package/lib/Antd5/locale/th_TH.js +3 -2
- package/lib/Antd5/locale/tk_TK.js +7 -1
- package/lib/Antd5/locale/tr_TR.js +8 -2
- package/lib/Antd5/locale/uk_UA.js +3 -2
- package/lib/Antd5/locale/ur_PK.js +7 -1
- package/lib/Antd5/locale/uz_UZ.js +5 -4
- package/lib/Antd5/locale/vi_VN.js +3 -2
- package/lib/Antd5/locale/zh_CN.js +3 -2
- package/lib/Antd5/locale/zh_HK.js +11 -3
- package/lib/Antd5/locale/zh_TW.js +11 -3
- package/lib/Antd5/mentions/index.js +1 -1
- package/lib/Antd5/mentions/style/index.js +12 -7
- package/lib/Antd5/menu/MenuItem.js +3 -1
- package/lib/Antd5/menu/OverrideContext.js +2 -2
- package/lib/Antd5/menu/menu.js +1 -7
- package/lib/Antd5/menu/style/index.js +9 -6
- package/lib/Antd5/menu/style/theme.js +4 -3
- package/lib/Antd5/menu/style/vertical.js +1 -1
- package/lib/Antd5/message/style/index.js +4 -3
- package/lib/Antd5/modal/ConfirmDialog.js +2 -19
- package/lib/Antd5/modal/Modal.js +67 -35
- package/lib/Antd5/modal/confirm.js +5 -3
- package/lib/Antd5/modal/style/confirm.js +3 -1
- package/lib/Antd5/modal/style/index.js +21 -1
- package/lib/Antd5/modal/useModal/HookModal.js +2 -1
- package/lib/Antd5/notification/PurePanel.js +13 -6
- package/lib/Antd5/notification/index.js +3 -4
- package/lib/Antd5/notification/style/index.js +4 -3
- package/lib/Antd5/notification/style/stack.js +2 -1
- package/lib/Antd5/notification/useNotification.js +9 -4
- package/lib/Antd5/notification/util.js +9 -0
- package/lib/Antd5/pagination/Pagination.js +87 -20
- package/lib/Antd5/pagination/style/index.js +2 -10
- package/lib/Antd5/pagination/useShowSizeChanger.js +13 -0
- package/lib/Antd5/popconfirm/index.js +21 -6
- package/lib/Antd5/popover/index.js +21 -8
- package/lib/Antd5/progress/Steps.js +6 -2
- package/lib/Antd5/progress/progress.js +2 -2
- package/lib/Antd5/progress/utils.js +3 -3
- package/lib/Antd5/qr-code/style/index.js +2 -2
- package/lib/Antd5/segmented/index.js +16 -8
- package/lib/Antd5/segmented/style/index.js +14 -6
- package/lib/Antd5/select/index.js +45 -16
- package/lib/Antd5/select/style/dropdown.js +10 -9
- package/lib/Antd5/select/style/index.js +14 -10
- package/lib/Antd5/select/style/single.js +6 -3
- package/lib/Antd5/select/style/variants.js +55 -1
- package/lib/Antd5/skeleton/Paragraph.js +5 -8
- package/lib/Antd5/skeleton/Skeleton.js +8 -7
- package/lib/Antd5/slider/SliderTooltip.js +3 -2
- package/lib/Antd5/slider/index.js +43 -17
- package/lib/Antd5/slider/style/index.js +3 -3
- package/lib/Antd5/slider/useRafLock.js +1 -1
- package/lib/Antd5/space/Compact.js +8 -6
- package/lib/Antd5/space/index.js +16 -12
- package/lib/Antd5/spin/index.js +11 -9
- package/lib/Antd5/spin/style/index.js +1 -3
- package/lib/Antd5/spin/usePercent.js +1 -1
- package/lib/Antd5/splitter/SplitBar.js +56 -7
- package/lib/Antd5/splitter/Splitter.js +27 -17
- package/lib/Antd5/splitter/hooks/useResizable.js +3 -3
- package/lib/Antd5/splitter/hooks/useResize.js +17 -6
- package/lib/Antd5/splitter/style/index.js +32 -6
- package/lib/Antd5/statistic/Countdown.js +8 -61
- package/lib/Antd5/statistic/Statistic.js +17 -9
- package/lib/Antd5/statistic/Timer.js +91 -0
- package/lib/Antd5/statistic/index.js +2 -0
- package/lib/Antd5/statistic/utils.js +2 -2
- package/lib/Antd5/steps/index.js +8 -7
- package/lib/Antd5/steps/style/index.js +1 -1
- package/lib/Antd5/style/index.js +9 -4
- package/lib/Antd5/switch/style/index.js +2 -2
- package/lib/Antd5/table/InternalTable.js +6 -5
- package/lib/Antd5/table/hooks/useFilter/FilterDropdown.js +15 -11
- package/lib/Antd5/table/hooks/useFilter/FilterSearch.js +1 -1
- package/lib/Antd5/table/hooks/useFilter/index.js +3 -2
- package/lib/Antd5/table/hooks/useSelection.js +11 -3
- package/lib/Antd5/table/hooks/useSorter.js +4 -3
- package/lib/Antd5/table/style/filter.js +2 -2
- package/lib/Antd5/table/style/index.js +9 -9
- package/lib/Antd5/table/style/sorter.js +2 -1
- package/lib/Antd5/table/style/sticky.js +1 -1
- package/lib/Antd5/tabs/hooks/useLegacyItems.js +11 -4
- package/lib/Antd5/tabs/index.js +9 -2
- package/lib/Antd5/tabs/style/index.js +44 -23
- package/lib/Antd5/tag/style/index.js +3 -3
- package/lib/Antd5/theme/context.js +1 -3
- package/lib/Antd5/theme/getDesignToken.js +2 -2
- package/lib/Antd5/theme/themes/dark/colorAlgorithm.js +3 -3
- package/lib/Antd5/theme/themes/dark/index.js +13 -3
- package/lib/Antd5/theme/themes/default/colorAlgorithm.js +3 -3
- package/lib/Antd5/theme/themes/default/index.js +5 -1
- package/lib/Antd5/theme/themes/default/theme.js +4 -0
- package/lib/Antd5/theme/themes/shared/genColorMapToken.js +3 -3
- package/lib/Antd5/theme/themes/shared/genFontSizes.js +3 -1
- package/lib/Antd5/theme/util/alias.js +2 -2
- package/lib/Antd5/theme/util/genStyleUtils.js +9 -11
- package/lib/Antd5/theme/util/getAlphaColor.js +12 -12
- package/lib/Antd5/theme/util/useResetIconStyle.js +2 -10
- package/lib/Antd5/time-picker/index.js +1 -1
- package/lib/Antd5/timeline/TimelineItemList.js +1 -1
- package/lib/Antd5/tooltip/index.js +46 -31
- package/lib/Antd5/tooltip/style/index.js +13 -4
- package/lib/Antd5/tour/index.js +4 -2
- package/lib/Antd5/tour/panelRender.js +42 -27
- package/lib/Antd5/tour/style/index.js +3 -3
- package/lib/Antd5/transfer/ListItem.js +1 -1
- package/lib/Antd5/transfer/hooks/useData.js +8 -4
- package/lib/Antd5/transfer/hooks/useSelection.js +5 -4
- package/lib/Antd5/transfer/index.js +6 -2
- package/lib/Antd5/transfer/list.js +32 -13
- package/lib/Antd5/transfer/search.js +1 -1
- package/lib/Antd5/transfer/style/index.js +3 -1
- package/lib/Antd5/tree/DirectoryTree.js +2 -2
- package/lib/Antd5/tree/style/index.js +9 -3
- package/lib/Antd5/tree-select/index.js +61 -18
- package/lib/Antd5/tree-select/style/index.js +1 -1
- package/lib/Antd5/typography/Base/Ellipsis.js +3 -3
- package/lib/Antd5/typography/Base/index.js +20 -13
- package/lib/Antd5/typography/Editable.js +1 -1
- package/lib/Antd5/typography/Typography.js +8 -7
- package/lib/Antd5/typography/hooks/useCopyClick.js +24 -25
- package/lib/Antd5/typography/hooks/usePrevious.js +1 -1
- package/lib/Antd5/typography/style/index.js +5 -5
- package/lib/Antd5/typography/style/mixins.js +1 -1
- package/lib/Antd5/upload/Upload.js +22 -24
- package/lib/Antd5/version/index.js +0 -1
- package/lib/Antd5/version/token-meta.json +1 -0
- package/lib/Antd5/version/token.json +1 -0
- package/lib/Antd5/version/version.js +1 -1
- package/lib/Antd5/watermark/context.js +1 -1
- package/lib/Antd5/watermark/index.js +20 -13
- package/lib/Antd5/watermark/useClips.js +18 -16
- package/lib/Antd5/watermark/useRafDebounce.js +1 -1
- package/lib/Antd5/watermark/useSingletonCache.js +19 -0
- package/lib/Antd5/watermark/useWatermark.js +9 -18
- package/lib/CWCascader/rc-cascader/OptionList/Column.js +17 -18
- package/lib/CWMessage/MessageContent/TabList/index.js +10 -10
- package/lib/CWMessage/MessageContent/index.js +26 -28
- package/lib/CWMessage/index.js +42 -46
- package/lib/CWRangePicker/index.js +15 -15
- package/lib/CWRangePicker/utils/generate/dayjs.js +112 -23
- package/lib/CWRangePicker/utils/generate/moment.js +109 -21
- package/lib/CWSelect/index.js +423 -150
- package/lib/CWTable/CWTable.js +11 -11
- package/lib/Joyride/index.js +3 -3
- package/lib/ModuleFederation/react-dynamic-remote-component/RemoteComponent.js +38 -39
- package/lib/ModuleFederation/react-dynamic-remote-component/load-module.js +22 -23
- package/lib/QuickTransfer/index.js +13 -13
- package/lib/SearchBar/index.js +7 -7
- package/lib/SingleSpa/index.js +22 -24
- package/lib/TimeRangeSlider/TimeRangeSliderCmp/hooks/useMouse.js +3 -3
- package/lib/TimeRangeSlider/index.js +6 -6
- package/lib/TimeRangeSlider/utils/generate/dayjs.js +109 -20
- package/lib/TimeRangeSlider/utils/generate/moment.js +109 -20
- package/lib/TimeZoneSelect/index.js +21 -22
- package/package.json +35 -34
- package/lib/Antd5/_util/isNumeric.js +0 -4
- package/lib/Antd5/pagination/Select.js +0 -24
|
@@ -17,11 +17,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
20
|
-
import {
|
|
20
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
21
21
|
import Skeleton from '../skeleton';
|
|
22
22
|
import StatisticNumber from './Number';
|
|
23
23
|
import useStyle from './style';
|
|
24
|
-
var Statistic = function
|
|
24
|
+
var Statistic = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
25
25
|
var customizePrefixCls = props.prefixCls,
|
|
26
26
|
className = props.className,
|
|
27
27
|
rootClassName = props.rootClassName,
|
|
@@ -44,10 +44,11 @@ var Statistic = function Statistic(props) {
|
|
|
44
44
|
onMouseEnter = props.onMouseEnter,
|
|
45
45
|
onMouseLeave = props.onMouseLeave,
|
|
46
46
|
rest = _objectWithoutProperties(props, _excluded);
|
|
47
|
-
var
|
|
48
|
-
getPrefixCls =
|
|
49
|
-
direction =
|
|
50
|
-
|
|
47
|
+
var _useComponentConfig = useComponentConfig('statistic'),
|
|
48
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
49
|
+
direction = _useComponentConfig.direction,
|
|
50
|
+
contextClassName = _useComponentConfig.className,
|
|
51
|
+
contextStyle = _useComponentConfig.style;
|
|
51
52
|
var prefixCls = getPrefixCls('statistic', customizePrefixCls);
|
|
52
53
|
var _useStyle = useStyle(prefixCls),
|
|
53
54
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -62,14 +63,21 @@ var Statistic = function Statistic(props) {
|
|
|
62
63
|
precision: precision,
|
|
63
64
|
value: value
|
|
64
65
|
});
|
|
65
|
-
var cls = classNames(prefixCls, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'),
|
|
66
|
+
var cls = classNames(prefixCls, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), contextClassName, className, rootClassName, hashId, cssVarCls);
|
|
67
|
+
var internalRef = React.useRef(null);
|
|
68
|
+
React.useImperativeHandle(ref, function () {
|
|
69
|
+
return {
|
|
70
|
+
nativeElement: internalRef.current
|
|
71
|
+
};
|
|
72
|
+
});
|
|
66
73
|
var restProps = pickAttrs(rest, {
|
|
67
74
|
aria: true,
|
|
68
75
|
data: true
|
|
69
76
|
});
|
|
70
77
|
return wrapCSSVar(_jsxs("div", _objectSpread(_objectSpread({}, restProps), {}, {
|
|
78
|
+
ref: internalRef,
|
|
71
79
|
className: cls,
|
|
72
|
-
style: _objectSpread(_objectSpread({},
|
|
80
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style),
|
|
73
81
|
onMouseEnter: onMouseEnter,
|
|
74
82
|
onMouseLeave: onMouseLeave,
|
|
75
83
|
children: [title && _jsx("div", {
|
|
@@ -92,7 +100,7 @@ var Statistic = function Statistic(props) {
|
|
|
92
100
|
})
|
|
93
101
|
})]
|
|
94
102
|
})));
|
|
95
|
-
};
|
|
103
|
+
});
|
|
96
104
|
if (process.env.NODE_ENV !== 'production') {
|
|
97
105
|
Statistic.displayName = 'Statistic';
|
|
98
106
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["value", "format", "onChange", "onFinish", "type"];
|
|
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 _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
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; } }
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import { useEvent } from 'rc-util';
|
|
19
|
+
import raf from 'rc-util/lib/raf';
|
|
20
|
+
import { cloneElement } from '../_util/reactNode';
|
|
21
|
+
import Statistic from './Statistic';
|
|
22
|
+
import { formatCounter } from './utils';
|
|
23
|
+
function getTime(value) {
|
|
24
|
+
return new Date(value).getTime();
|
|
25
|
+
}
|
|
26
|
+
var StatisticTimer = function StatisticTimer(props) {
|
|
27
|
+
var value = props.value,
|
|
28
|
+
_props$format = props.format,
|
|
29
|
+
format = _props$format === void 0 ? 'HH:mm:ss' : _props$format,
|
|
30
|
+
onChange = props.onChange,
|
|
31
|
+
onFinish = props.onFinish,
|
|
32
|
+
type = props.type,
|
|
33
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
34
|
+
var down = type === 'countdown';
|
|
35
|
+
// We reuse state here to do same as `forceUpdate`
|
|
36
|
+
var _React$useState = React.useState(null),
|
|
37
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
38
|
+
showTime = _React$useState2[0],
|
|
39
|
+
setShowTime = _React$useState2[1];
|
|
40
|
+
// ======================== Update ========================
|
|
41
|
+
var update = useEvent(function () {
|
|
42
|
+
var now = Date.now();
|
|
43
|
+
var timestamp = getTime(value);
|
|
44
|
+
setShowTime({});
|
|
45
|
+
var timeDiff = !down ? now - timestamp : timestamp - now;
|
|
46
|
+
onChange === null || onChange === void 0 || onChange(timeDiff);
|
|
47
|
+
// Only countdown will trigger `onFinish`
|
|
48
|
+
if (down && timestamp < now) {
|
|
49
|
+
onFinish === null || onFinish === void 0 || onFinish();
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
// Effect trigger
|
|
55
|
+
React.useEffect(function () {
|
|
56
|
+
var rafId;
|
|
57
|
+
var clear = function clear() {
|
|
58
|
+
return raf.cancel(rafId);
|
|
59
|
+
};
|
|
60
|
+
var _rafUpdate = function rafUpdate() {
|
|
61
|
+
rafId = raf(function () {
|
|
62
|
+
if (update()) {
|
|
63
|
+
_rafUpdate();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
_rafUpdate();
|
|
68
|
+
return clear;
|
|
69
|
+
}, [value, down]);
|
|
70
|
+
React.useEffect(function () {
|
|
71
|
+
setShowTime({});
|
|
72
|
+
}, []);
|
|
73
|
+
// ======================== Format ========================
|
|
74
|
+
var formatter = function formatter(formatValue, config) {
|
|
75
|
+
return showTime ? formatCounter(formatValue, _objectSpread(_objectSpread({}, config), {}, {
|
|
76
|
+
format: format
|
|
77
|
+
}), down) : '-';
|
|
78
|
+
};
|
|
79
|
+
var valueRender = function valueRender(node) {
|
|
80
|
+
return cloneElement(node, {
|
|
81
|
+
title: undefined
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
// ======================== Render ========================
|
|
85
|
+
return _jsx(Statistic, _objectSpread(_objectSpread({}, rest), {}, {
|
|
86
|
+
value: value,
|
|
87
|
+
valueRender: valueRender,
|
|
88
|
+
formatter: formatter
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
export default StatisticTimer;
|
|
@@ -47,11 +47,11 @@ export function formatTimeStr(duration, format) {
|
|
|
47
47
|
return match;
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
export function
|
|
50
|
+
export function formatCounter(value, config, down) {
|
|
51
51
|
var _config$format = config.format,
|
|
52
52
|
format = _config$format === void 0 ? '' : _config$format;
|
|
53
53
|
var target = new Date(value).getTime();
|
|
54
54
|
var current = Date.now();
|
|
55
|
-
var diff = Math.max(target - current, 0);
|
|
55
|
+
var diff = down ? Math.max(target - current, 0) : Math.max(current - target, 0);
|
|
56
56
|
return formatTimeStr(diff, format);
|
|
57
57
|
}
|
package/lib/Antd5/steps/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import CheckOutlined from '@ant-design/icons/CheckOutlined';
|
|
|
19
19
|
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import RcSteps from 'rc-steps';
|
|
22
|
-
import {
|
|
22
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
23
23
|
import useSize from '../config-provider/hooks/useSize';
|
|
24
24
|
import useBreakpoint from '../grid/hooks/useBreakpoint';
|
|
25
25
|
import Progress from '../progress';
|
|
@@ -42,10 +42,11 @@ var Steps = function Steps(props) {
|
|
|
42
42
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
43
43
|
var _useBreakpoint = useBreakpoint(responsive),
|
|
44
44
|
xs = _useBreakpoint.xs;
|
|
45
|
-
var
|
|
46
|
-
getPrefixCls =
|
|
47
|
-
rtlDirection =
|
|
48
|
-
|
|
45
|
+
var _useComponentConfig = useComponentConfig('steps'),
|
|
46
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
47
|
+
rtlDirection = _useComponentConfig.direction,
|
|
48
|
+
contextClassName = _useComponentConfig.className,
|
|
49
|
+
contextStyle = _useComponentConfig.style;
|
|
49
50
|
var realDirectionValue = React.useMemo(function () {
|
|
50
51
|
return responsive && xs ? 'vertical' : direction;
|
|
51
52
|
}, [xs, direction]);
|
|
@@ -60,8 +61,8 @@ var Steps = function Steps(props) {
|
|
|
60
61
|
var iconPrefix = getPrefixCls('', props.iconPrefix);
|
|
61
62
|
var mergedItems = useLegacyItems(items, children);
|
|
62
63
|
var mergedPercent = isInline ? undefined : percent;
|
|
63
|
-
var mergedStyle = _objectSpread(_objectSpread({},
|
|
64
|
-
var stepsClassName = classNames(
|
|
64
|
+
var mergedStyle = _objectSpread(_objectSpread({}, contextStyle), style);
|
|
65
|
+
var stepsClassName = classNames(contextClassName, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-rtl"), rtlDirection === 'rtl'), "".concat(prefixCls, "-with-progress"), mergedPercent !== undefined), className, rootClassName, hashId, cssVarCls);
|
|
65
66
|
var icons = {
|
|
66
67
|
finish: _jsx(CheckOutlined, {
|
|
67
68
|
className: "".concat(prefixCls, "-finish-icon")
|
|
@@ -196,7 +196,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
196
196
|
dotSize: token.controlHeight / 4,
|
|
197
197
|
dotCurrentSize: token.controlHeightLG / 4,
|
|
198
198
|
navArrowColor: token.colorTextDisabled,
|
|
199
|
-
navContentMaxWidth: '
|
|
199
|
+
navContentMaxWidth: 'unset',
|
|
200
200
|
descriptionMaxWidth: 140,
|
|
201
201
|
waitIconColor: token.wireframe ? token.colorTextDisabled : token.colorTextLabel,
|
|
202
202
|
waitIconBgColor: token.wireframe ? token.colorBgContainer : token.colorFillContent,
|
package/lib/Antd5/style/index.js
CHANGED
|
@@ -114,18 +114,23 @@ export var genCommonStyle = function genCommonStyle(token, componentPrefixCls, r
|
|
|
114
114
|
}
|
|
115
115
|
return _defineProperty({}, rootPrefixSelector, _objectSpread(_objectSpread(_objectSpread({}, resetFontStyle), resetStyle), {}, _defineProperty({}, prefixSelector, resetStyle)));
|
|
116
116
|
};
|
|
117
|
-
export var genFocusOutline = function genFocusOutline(token) {
|
|
117
|
+
export var genFocusOutline = function genFocusOutline(token, offset) {
|
|
118
118
|
return {
|
|
119
119
|
outline: "".concat(unit(token.lineWidthFocus), " solid ").concat(token.colorPrimaryBorder),
|
|
120
|
-
outlineOffset: 1,
|
|
120
|
+
outlineOffset: offset !== null && offset !== void 0 ? offset : 1,
|
|
121
121
|
transition: 'outline-offset 0s, outline 0s'
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
export var genFocusStyle = function genFocusStyle(token) {
|
|
124
|
+
export var genFocusStyle = function genFocusStyle(token, offset) {
|
|
125
125
|
return {
|
|
126
|
-
'&:focus-visible': _objectSpread({}, genFocusOutline(token))
|
|
126
|
+
'&:focus-visible': _objectSpread({}, genFocusOutline(token, offset))
|
|
127
127
|
};
|
|
128
128
|
};
|
|
129
|
+
export var genIconStyle = function genIconStyle(iconPrefixCls) {
|
|
130
|
+
return _defineProperty({}, ".".concat(iconPrefixCls), _objectSpread(_objectSpread({}, resetIcon()), {}, _defineProperty({}, ".".concat(iconPrefixCls, " .").concat(iconPrefixCls, "-icon"), {
|
|
131
|
+
display: 'block'
|
|
132
|
+
})));
|
|
133
|
+
};
|
|
129
134
|
export var operationUnit = function operationUnit(token) {
|
|
130
135
|
return _objectSpread(_objectSpread({
|
|
131
136
|
// FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
|
|
@@ -5,7 +5,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { unit } from '@ant-design/cssinjs';
|
|
8
|
-
import {
|
|
8
|
+
import { FastColor } from '@ant-design/fast-color';
|
|
9
9
|
import { genFocusStyle, resetComponent } from '../../style';
|
|
10
10
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
11
11
|
var genSwitchSmallStyle = function genSwitchSmallStyle(token) {
|
|
@@ -217,7 +217,7 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
217
217
|
handleBg: colorWhite,
|
|
218
218
|
handleSize: handleSize,
|
|
219
219
|
handleSizeSM: handleSizeSM,
|
|
220
|
-
handleShadow: "0 2px 4px 0 ".concat(new
|
|
220
|
+
handleShadow: "0 2px 4px 0 ".concat(new FastColor('#00230b').setA(0.2).toRgbString()),
|
|
221
221
|
innerMinMargin: handleSize / 2,
|
|
222
222
|
innerMaxMargin: handleSize + padding + padding * 2,
|
|
223
223
|
innerMinMarginSM: handleSizeSM / 2,
|
|
@@ -140,7 +140,7 @@ var InternalTable = function InternalTable(props, ref) {
|
|
|
140
140
|
return null;
|
|
141
141
|
}, [rawData]);
|
|
142
142
|
var internalRefs = {
|
|
143
|
-
body: React.useRef()
|
|
143
|
+
body: React.useRef(null)
|
|
144
144
|
};
|
|
145
145
|
// ============================ Width =============================
|
|
146
146
|
var getContainerWidth = useContainerWidth(prefixCls);
|
|
@@ -405,17 +405,18 @@ var InternalTable = function InternalTable(props, ref) {
|
|
|
405
405
|
var listItemHeight = React.useMemo(function () {
|
|
406
406
|
var fontSize = token.fontSize,
|
|
407
407
|
lineHeight = token.lineHeight,
|
|
408
|
+
lineWidth = token.lineWidth,
|
|
408
409
|
padding = token.padding,
|
|
409
410
|
paddingXS = token.paddingXS,
|
|
410
411
|
paddingSM = token.paddingSM;
|
|
411
412
|
var fontHeight = Math.floor(fontSize * lineHeight);
|
|
412
413
|
switch (mergedSize) {
|
|
413
|
-
case '
|
|
414
|
-
return
|
|
414
|
+
case 'middle':
|
|
415
|
+
return paddingSM * 2 + fontHeight + lineWidth;
|
|
415
416
|
case 'small':
|
|
416
|
-
return paddingXS * 2 + fontHeight;
|
|
417
|
+
return paddingXS * 2 + fontHeight + lineWidth;
|
|
417
418
|
default:
|
|
418
|
-
return
|
|
419
|
+
return padding * 2 + fontHeight + lineWidth;
|
|
419
420
|
}
|
|
420
421
|
}, [token, mergedSize]);
|
|
421
422
|
if (virtual) {
|
|
@@ -154,6 +154,7 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
154
154
|
newName = _ref5[1];
|
|
155
155
|
warning.deprecated(!(deprecatedName in column), deprecatedName, newName);
|
|
156
156
|
});
|
|
157
|
+
warning.deprecated(!('filterCheckall' in locale), 'filterCheckall', 'locale.filterCheckAll');
|
|
157
158
|
}
|
|
158
159
|
var mergedVisible = (_ref6 = (_ref7 = (_filterDropdownProps$2 = filterDropdownProps.open) !== null && _filterDropdownProps$2 !== void 0 ? _filterDropdownProps$2 : filterDropdownOpen) !== null && _ref7 !== void 0 ? _ref7 :
|
|
159
160
|
// deprecated
|
|
@@ -234,12 +235,12 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
234
235
|
internalTriggerFilter(getFilteredKeysSync());
|
|
235
236
|
};
|
|
236
237
|
var onReset = function onReset() {
|
|
237
|
-
var
|
|
238
|
+
var _ref0 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
238
239
|
confirm: false,
|
|
239
240
|
closeDropdown: false
|
|
240
241
|
},
|
|
241
|
-
confirm =
|
|
242
|
-
closeDropdown =
|
|
242
|
+
confirm = _ref0.confirm,
|
|
243
|
+
closeDropdown = _ref0.closeDropdown;
|
|
243
244
|
if (confirm) {
|
|
244
245
|
internalTriggerFilter([]);
|
|
245
246
|
}
|
|
@@ -256,10 +257,10 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
256
257
|
}
|
|
257
258
|
};
|
|
258
259
|
var doFilter = function doFilter() {
|
|
259
|
-
var
|
|
260
|
+
var _ref1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
260
261
|
closeDropdown: true
|
|
261
262
|
},
|
|
262
|
-
closeDropdown =
|
|
263
|
+
closeDropdown = _ref1.closeDropdown;
|
|
263
264
|
if (closeDropdown) {
|
|
264
265
|
triggerVisible(false);
|
|
265
266
|
}
|
|
@@ -289,8 +290,8 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
289
290
|
setFilteredKeysSync([]);
|
|
290
291
|
}
|
|
291
292
|
};
|
|
292
|
-
var _getTreeData = function getTreeData(
|
|
293
|
-
var filters =
|
|
293
|
+
var _getTreeData = function getTreeData(_ref10) {
|
|
294
|
+
var filters = _ref10.filters;
|
|
294
295
|
return (filters || []).map(function (filter, index) {
|
|
295
296
|
var key = String(filter.value);
|
|
296
297
|
var item = {
|
|
@@ -345,8 +346,10 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
345
346
|
var empty = (_renderEmpty = renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Table.filter')) !== null && _renderEmpty !== void 0 ? _renderEmpty : _jsx(Empty, {
|
|
346
347
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
347
348
|
description: locale.filterEmptyText,
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
styles: {
|
|
350
|
+
image: {
|
|
351
|
+
height: 24
|
|
352
|
+
}
|
|
350
353
|
},
|
|
351
354
|
style: {
|
|
352
355
|
margin: 0,
|
|
@@ -357,6 +360,7 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
357
360
|
return empty;
|
|
358
361
|
}
|
|
359
362
|
if (filterMode === 'tree') {
|
|
363
|
+
var _locale$filterCheckal;
|
|
360
364
|
return _jsxs(_Fragment, {
|
|
361
365
|
children: [_jsx(FilterSearch, {
|
|
362
366
|
filterSearch: filterSearch,
|
|
@@ -371,7 +375,7 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
371
375
|
indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys(column.filters).length,
|
|
372
376
|
className: "".concat(tablePrefixCls, "-filter-dropdown-checkall"),
|
|
373
377
|
onChange: onCheckAll,
|
|
374
|
-
children: locale.filterCheckall
|
|
378
|
+
children: (_locale$filterCheckal = locale === null || locale === void 0 ? void 0 : locale.filterCheckall) !== null && _locale$filterCheckal !== void 0 ? _locale$filterCheckal : locale === null || locale === void 0 ? void 0 : locale.filterCheckAll
|
|
375
379
|
}) : null, _jsx(Tree, {
|
|
376
380
|
checkable: true,
|
|
377
381
|
selectable: false,
|
|
@@ -500,7 +504,7 @@ var FilterDropdown = function FilterDropdown(props) {
|
|
|
500
504
|
rootClassName: classNames(rootClassName, filterDropdownProps.rootClassName),
|
|
501
505
|
open: mergedVisible,
|
|
502
506
|
onOpenChange: onVisibleChange,
|
|
503
|
-
|
|
507
|
+
popupRender: function popupRender() {
|
|
504
508
|
if (typeof (filterDropdownProps === null || filterDropdownProps === void 0 ? void 0 : filterDropdownProps.dropdownRender) === 'function') {
|
|
505
509
|
return filterDropdownProps.dropdownRender(dropdownContent);
|
|
506
510
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import SearchOutlined from '@ant-design/icons/SearchOutlined';
|
|
4
|
-
import Input from '../../../input';
|
|
4
|
+
import Input from '../../../input/Input';
|
|
5
5
|
var FilterSearch = function FilterSearch(props) {
|
|
6
6
|
var value = props.value,
|
|
7
7
|
filterSearch = props.filterSearch,
|
|
@@ -23,11 +23,12 @@ var _collectFilterStates = function collectFilterStates(columns, init, pos) {
|
|
|
23
23
|
var filterStates = [];
|
|
24
24
|
(columns || []).forEach(function (column, index) {
|
|
25
25
|
var columnPos = getColumnPos(index, pos);
|
|
26
|
-
|
|
26
|
+
var filterDropdownIsDefined = column.filterDropdown !== undefined;
|
|
27
|
+
if (column.filters || filterDropdownIsDefined || 'onFilter' in column) {
|
|
27
28
|
if ('filteredValue' in column) {
|
|
28
29
|
// Controlled
|
|
29
30
|
var filteredValues = column.filteredValue;
|
|
30
|
-
if (!
|
|
31
|
+
if (!filterDropdownIsDefined) {
|
|
31
32
|
var _filteredValues$map, _filteredValues;
|
|
32
33
|
filteredValues = (_filteredValues$map = (_filteredValues = filteredValues) === null || _filteredValues === void 0 ? void 0 : _filteredValues.map(String)) !== null && _filteredValues$map !== void 0 ? _filteredValues$map : filteredValues;
|
|
33
34
|
}
|
|
@@ -154,8 +154,15 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
154
154
|
return map;
|
|
155
155
|
}, [flattedData, getRowKey, getCheckboxProps]);
|
|
156
156
|
var isCheckboxDisabled = useCallback(function (r) {
|
|
157
|
-
var
|
|
158
|
-
|
|
157
|
+
var _checkboxProps;
|
|
158
|
+
var rowKey = getRowKey(r);
|
|
159
|
+
var checkboxProps;
|
|
160
|
+
if (checkboxPropsMap.has(rowKey)) {
|
|
161
|
+
checkboxProps = checkboxPropsMap.get(getRowKey(r));
|
|
162
|
+
} else {
|
|
163
|
+
checkboxProps = getCheckboxProps ? getCheckboxProps(r) : undefined;
|
|
164
|
+
}
|
|
165
|
+
return !!((_checkboxProps = checkboxProps) !== null && _checkboxProps !== void 0 && _checkboxProps.disabled);
|
|
159
166
|
}, [checkboxPropsMap, getRowKey]);
|
|
160
167
|
var _useMemo2 = useMemo(function () {
|
|
161
168
|
if (checkStrictly) {
|
|
@@ -575,7 +582,8 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
575
582
|
className: "".concat(prefixCls, "-selection-column"),
|
|
576
583
|
title: renderColumnTitle(),
|
|
577
584
|
render: renderSelectionCell,
|
|
578
|
-
onCell: rowSelection.onCell
|
|
585
|
+
onCell: rowSelection.onCell,
|
|
586
|
+
align: rowSelection.align
|
|
579
587
|
}, INTERNAL_COL_DEFINE, {
|
|
580
588
|
className: columnCls
|
|
581
589
|
});
|
|
@@ -191,9 +191,8 @@ var _injectSorter = function injectSorter(prefixCls, columns, sorterStates, trig
|
|
|
191
191
|
// Inform the screen-reader so it can tell the visually impaired user which column is sorted
|
|
192
192
|
if (sortOrder) {
|
|
193
193
|
cell['aria-sort'] = sortOrder === 'ascend' ? 'ascending' : 'descending';
|
|
194
|
-
} else {
|
|
195
|
-
cell['aria-label'] = displayTitle || '';
|
|
196
194
|
}
|
|
195
|
+
cell['aria-label'] = displayTitle || '';
|
|
197
196
|
cell.className = classNames(cell.className, "".concat(prefixCls, "-column-has-sorters"));
|
|
198
197
|
cell.tabIndex = 0;
|
|
199
198
|
if (column.ellipsis) {
|
|
@@ -287,7 +286,9 @@ var useFilterSorter = function useFilterSorter(props) {
|
|
|
287
286
|
tableLocale = props.tableLocale,
|
|
288
287
|
showSorterTooltip = props.showSorterTooltip,
|
|
289
288
|
onSorterChange = props.onSorterChange;
|
|
290
|
-
var _React$useState = React.useState(
|
|
289
|
+
var _React$useState = React.useState(function () {
|
|
290
|
+
return _collectSortStates(mergedColumns, true);
|
|
291
|
+
}),
|
|
291
292
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
292
293
|
sortStates = _React$useState2[0],
|
|
293
294
|
setSortStates = _React$useState2[1];
|
|
@@ -23,7 +23,7 @@ var genFilterStyle = function genFilterStyle(token) {
|
|
|
23
23
|
tablePaddingHorizontal = token.tablePaddingHorizontal,
|
|
24
24
|
borderRadius = token.borderRadius,
|
|
25
25
|
motionDurationSlow = token.motionDurationSlow,
|
|
26
|
-
|
|
26
|
+
colorIcon = token.colorIcon,
|
|
27
27
|
colorPrimary = token.colorPrimary,
|
|
28
28
|
tableHeaderFilterActiveBg = token.tableHeaderFilterActiveBg,
|
|
29
29
|
colorTextDisabled = token.colorTextDisabled,
|
|
@@ -54,7 +54,7 @@ var genFilterStyle = function genFilterStyle(token) {
|
|
|
54
54
|
cursor: 'pointer',
|
|
55
55
|
transition: "all ".concat(motionDurationSlow),
|
|
56
56
|
'&:hover': {
|
|
57
|
-
color:
|
|
57
|
+
color: colorIcon,
|
|
58
58
|
background: tableHeaderFilterActiveBg
|
|
59
59
|
},
|
|
60
60
|
'&.active': {
|
|
@@ -5,7 +5,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { unit } from '@ant-design/cssinjs';
|
|
8
|
-
import {
|
|
8
|
+
import { FastColor } from '@ant-design/fast-color';
|
|
9
9
|
import { clearFix, resetComponent } from '../../style';
|
|
10
10
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
11
11
|
import genBorderedStyle from './bordered';
|
|
@@ -96,7 +96,7 @@ var genTableStyle = function genTableStyle(token) {
|
|
|
96
96
|
marginBlock: unit(calc(tablePaddingVertical).mul(-1).equal()),
|
|
97
97
|
marginInline: "".concat(unit(calc(tableExpandColumnWidth).sub(tablePaddingHorizontal).equal()), "\n ").concat(unit(calc(tablePaddingHorizontal).mul(-1).equal()))
|
|
98
98
|
}, "".concat(componentCls, "-tbody > tr:last-child > td"), {
|
|
99
|
-
|
|
99
|
+
borderBottomWidth: 0,
|
|
100
100
|
'&:first-child, &:last-child': {
|
|
101
101
|
borderRadius: 0
|
|
102
102
|
}
|
|
@@ -140,11 +140,11 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
140
140
|
colorIconHover = token.colorIconHover,
|
|
141
141
|
opacityLoading = token.opacityLoading,
|
|
142
142
|
controlInteractiveSize = token.controlInteractiveSize;
|
|
143
|
-
var colorFillSecondarySolid = new
|
|
144
|
-
var colorFillContentSolid = new
|
|
145
|
-
var colorFillAlterSolid = new
|
|
146
|
-
var baseColorAction = new
|
|
147
|
-
var baseColorActionHover = new
|
|
143
|
+
var colorFillSecondarySolid = new FastColor(colorFillSecondary).onBackground(colorBgContainer).toHexString();
|
|
144
|
+
var colorFillContentSolid = new FastColor(colorFillContent).onBackground(colorBgContainer).toHexString();
|
|
145
|
+
var colorFillAlterSolid = new FastColor(colorFillAlter).onBackground(colorBgContainer).toHexString();
|
|
146
|
+
var baseColorAction = new FastColor(colorIcon);
|
|
147
|
+
var baseColorActionHover = new FastColor(colorIconHover);
|
|
148
148
|
var expandIconHalfInner = controlInteractiveSize / 2 - lineWidth;
|
|
149
149
|
var expandIconSize = expandIconHalfInner * 2 + lineWidth * 3;
|
|
150
150
|
return {
|
|
@@ -180,8 +180,8 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
180
180
|
stickyScrollBarBg: colorTextPlaceholder,
|
|
181
181
|
stickyScrollBarBorderRadius: 100,
|
|
182
182
|
expandIconMarginTop: (fontSize * lineHeight - lineWidth * 3) / 2 - Math.ceil((fontSizeSM * 1.4 - lineWidth * 3) / 2),
|
|
183
|
-
headerIconColor: baseColorAction.clone().
|
|
184
|
-
headerIconHoverColor: baseColorActionHover.clone().
|
|
183
|
+
headerIconColor: baseColorAction.clone().setA(baseColorAction.a * opacityLoading).toRgbString(),
|
|
184
|
+
headerIconHoverColor: baseColorActionHover.clone().setA(baseColorActionHover.a * opacityLoading).toRgbString(),
|
|
185
185
|
expandIconHalfInner: expandIconHalfInner,
|
|
186
186
|
expandIconSize: expandIconSize,
|
|
187
187
|
expandIconScale: controlInteractiveSize / expandIconSize
|
|
@@ -35,7 +35,8 @@ var genSorterStyle = function genSorterStyle(token) {
|
|
|
35
35
|
}), "".concat(componentCls, "-column-title"), {
|
|
36
36
|
position: 'relative',
|
|
37
37
|
zIndex: 1,
|
|
38
|
-
flex: 1
|
|
38
|
+
flex: 1,
|
|
39
|
+
minWidth: 0
|
|
39
40
|
}), "".concat(componentCls, "-column-sorters"), {
|
|
40
41
|
display: 'flex',
|
|
41
42
|
flex: 'auto',
|
|
@@ -40,7 +40,7 @@ var genStickyStyle = function genStickyStyle(token) {
|
|
|
40
40
|
height: tableScrollThumbSize,
|
|
41
41
|
backgroundColor: tableScrollThumbBg,
|
|
42
42
|
borderRadius: stickyScrollBarBorderRadius,
|
|
43
|
-
transition: "all ".concat(token.motionDurationSlow, ", transform
|
|
43
|
+
transition: "all ".concat(token.motionDurationSlow, ", transform 0s"),
|
|
44
44
|
position: 'absolute',
|
|
45
45
|
bottom: 0,
|
|
46
46
|
'&:hover, &-active': {
|
|
@@ -1,12 +1,12 @@
|
|
|
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
1
|
var _excluded = ["tab"];
|
|
2
|
+
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); }
|
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3
5
|
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
6
|
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
7
|
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
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
9
|
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 n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import toArray from 'rc-util/lib/Children/toArray';
|
|
12
12
|
import { devUseWarning } from '../../_util/warning';
|
|
@@ -21,7 +21,14 @@ export default function useLegacyItems(items, children) {
|
|
|
21
21
|
warning.deprecated(!children, 'Tabs.TabPane', 'items');
|
|
22
22
|
}
|
|
23
23
|
if (items) {
|
|
24
|
-
return items
|
|
24
|
+
return items.map(function (item) {
|
|
25
|
+
var _item$destroyOnHidden;
|
|
26
|
+
var mergedDestroyOnHidden = (_item$destroyOnHidden = item.destroyOnHidden) !== null && _item$destroyOnHidden !== void 0 ? _item$destroyOnHidden : item.destroyInactiveTabPane;
|
|
27
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
28
|
+
// TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
|
|
29
|
+
destroyInactiveTabPane: mergedDestroyOnHidden
|
|
30
|
+
});
|
|
31
|
+
});
|
|
25
32
|
}
|
|
26
33
|
var childrenItems = toArray(children).map(function (node) {
|
|
27
34
|
if (/*#__PURE__*/React.isValidElement(node)) {
|
package/lib/Antd5/tabs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator"];
|
|
2
|
+
var _excluded = ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator", "destroyInactiveTabPane", "destroyOnHidden"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -48,6 +48,8 @@ var Tabs = function Tabs(props) {
|
|
|
48
48
|
style = props.style,
|
|
49
49
|
indicatorSize = props.indicatorSize,
|
|
50
50
|
indicator = props.indicator,
|
|
51
|
+
destroyInactiveTabPane = props.destroyInactiveTabPane,
|
|
52
|
+
destroyOnHidden = props.destroyOnHidden,
|
|
51
53
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
52
54
|
var customizePrefixCls = otherProps.prefixCls;
|
|
53
55
|
var _React$useContext = React.useContext(ConfigContext),
|
|
@@ -81,6 +83,9 @@ var Tabs = function Tabs(props) {
|
|
|
81
83
|
var warning = devUseWarning('Tabs');
|
|
82
84
|
warning(!('onPrevClick' in props) && !('onNextClick' in props), 'breaking', '`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.');
|
|
83
85
|
warning(!(indicatorSize || tabs !== null && tabs !== void 0 && tabs.indicatorSize), 'deprecated', '`indicatorSize` has been deprecated. Please use `indicator={{ size: ... }}` instead.');
|
|
86
|
+
warning.deprecated(!('destroyInactiveTabPane' in props || items !== null && items !== void 0 && items.some(function (item) {
|
|
87
|
+
return 'destroyInactiveTabPane' in item;
|
|
88
|
+
})), 'destroyInactiveTabPane', 'destroyOnHidden');
|
|
84
89
|
}
|
|
85
90
|
var size = useSize(customSize);
|
|
86
91
|
var mergedItems = useLegacyItems(items, children);
|
|
@@ -105,7 +110,9 @@ var Tabs = function Tabs(props) {
|
|
|
105
110
|
}, more),
|
|
106
111
|
prefixCls: prefixCls,
|
|
107
112
|
animated: mergedAnimated,
|
|
108
|
-
indicator: mergedIndicator
|
|
113
|
+
indicator: mergedIndicator,
|
|
114
|
+
// TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
|
|
115
|
+
destroyInactiveTabPane: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyInactiveTabPane
|
|
109
116
|
})));
|
|
110
117
|
};
|
|
111
118
|
Tabs.TabPane = TabPane;
|