@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
|
@@ -19,6 +19,7 @@ import * as React from 'react';
|
|
|
19
19
|
import FilterFilled from '@ant-design/icons/FilterFilled';
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import isEqual from 'rc-util/lib/isEqual';
|
|
22
|
+
import extendsObject from '../../../_util/extendsObject';
|
|
22
23
|
import useSyncState from '../../../_util/hooks/useSyncState';
|
|
23
24
|
import { devUseWarning } from '../../../_util/warning';
|
|
24
25
|
import Button from '../../../button';
|
|
@@ -103,8 +104,8 @@ function renderFilterItems(_ref3) {
|
|
|
103
104
|
function wrapStringListType(keys) {
|
|
104
105
|
return keys || [];
|
|
105
106
|
}
|
|
106
|
-
function FilterDropdown(props) {
|
|
107
|
-
var _filterState$filtered, _ref6;
|
|
107
|
+
var FilterDropdown = function FilterDropdown(props) {
|
|
108
|
+
var _filterState$filtered, _ref6, _ref7, _filterDropdownProps$2;
|
|
108
109
|
var tablePrefixCls = props.tablePrefixCls,
|
|
109
110
|
prefixCls = props.prefixCls,
|
|
110
111
|
column = props.column,
|
|
@@ -122,46 +123,56 @@ function FilterDropdown(props) {
|
|
|
122
123
|
children = props.children,
|
|
123
124
|
getPopupContainer = props.getPopupContainer,
|
|
124
125
|
rootClassName = props.rootClassName;
|
|
125
|
-
var
|
|
126
|
-
onFilterDropdownOpenChange = column.onFilterDropdownOpenChange,
|
|
127
|
-
filterResetToDefaultFilteredValue = column.filterResetToDefaultFilteredValue,
|
|
126
|
+
var filterResetToDefaultFilteredValue = column.filterResetToDefaultFilteredValue,
|
|
128
127
|
defaultFilteredValue = column.defaultFilteredValue,
|
|
128
|
+
_column$filterDropdow = column.filterDropdownProps,
|
|
129
|
+
filterDropdownProps = _column$filterDropdow === void 0 ? {} : _column$filterDropdow,
|
|
130
|
+
filterDropdownOpen = column.filterDropdownOpen,
|
|
129
131
|
filterDropdownVisible = column.filterDropdownVisible,
|
|
130
|
-
onFilterDropdownVisibleChange = column.onFilterDropdownVisibleChange
|
|
132
|
+
onFilterDropdownVisibleChange = column.onFilterDropdownVisibleChange,
|
|
133
|
+
onFilterDropdownOpenChange = column.onFilterDropdownOpenChange;
|
|
131
134
|
var _React$useState = React.useState(false),
|
|
132
135
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
133
136
|
visible = _React$useState2[0],
|
|
134
137
|
setVisible = _React$useState2[1];
|
|
135
138
|
var filtered = !!(filterState && ((_filterState$filtered = filterState.filteredKeys) !== null && _filterState$filtered !== void 0 && _filterState$filtered.length || filterState.forceFiltered));
|
|
136
139
|
var triggerVisible = function triggerVisible(newVisible) {
|
|
140
|
+
var _filterDropdownProps$;
|
|
137
141
|
setVisible(newVisible);
|
|
142
|
+
(_filterDropdownProps$ = filterDropdownProps.onOpenChange) === null || _filterDropdownProps$ === void 0 || _filterDropdownProps$.call(filterDropdownProps, newVisible);
|
|
143
|
+
// deprecated
|
|
138
144
|
onFilterDropdownOpenChange === null || onFilterDropdownOpenChange === void 0 || onFilterDropdownOpenChange(newVisible);
|
|
139
145
|
onFilterDropdownVisibleChange === null || onFilterDropdownVisibleChange === void 0 || onFilterDropdownVisibleChange(newVisible);
|
|
140
146
|
};
|
|
147
|
+
// =================Warning===================
|
|
141
148
|
if (process.env.NODE_ENV !== 'production') {
|
|
142
149
|
var warning = devUseWarning('Table');
|
|
143
|
-
[['
|
|
144
|
-
|
|
150
|
+
var deprecatedList = [['filterDropdownOpen', 'filterDropdownProps.open'], ['filterDropdownVisible', 'filterDropdownProps.open'], ['onFilterDropdownOpenChange', 'filterDropdownProps.onOpenChange'], ['onFilterDropdownVisibleChange', 'filterDropdownProps.onOpenChange']];
|
|
151
|
+
deprecatedList.forEach(function (_ref4) {
|
|
152
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
145
153
|
deprecatedName = _ref5[0],
|
|
146
|
-
newName = _ref5[1]
|
|
147
|
-
|
|
148
|
-
warning.deprecated(prop === undefined || prop === null, deprecatedName, newName);
|
|
154
|
+
newName = _ref5[1];
|
|
155
|
+
warning.deprecated(!(deprecatedName in column), deprecatedName, newName);
|
|
149
156
|
});
|
|
150
157
|
}
|
|
151
|
-
var mergedVisible = (_ref6 =
|
|
158
|
+
var mergedVisible = (_ref6 = (_ref7 = (_filterDropdownProps$2 = filterDropdownProps.open) !== null && _filterDropdownProps$2 !== void 0 ? _filterDropdownProps$2 : filterDropdownOpen) !== null && _ref7 !== void 0 ? _ref7 :
|
|
159
|
+
// deprecated
|
|
160
|
+
filterDropdownVisible) !== null && _ref6 !== void 0 ? _ref6 :
|
|
161
|
+
// deprecated
|
|
162
|
+
visible; // inner state
|
|
152
163
|
// ===================== Select Keys =====================
|
|
153
164
|
var propFilteredKeys = filterState === null || filterState === void 0 ? void 0 : filterState.filteredKeys;
|
|
154
165
|
var _useSyncState = useSyncState(wrapStringListType(propFilteredKeys)),
|
|
155
166
|
_useSyncState2 = _slicedToArray(_useSyncState, 2),
|
|
156
167
|
getFilteredKeysSync = _useSyncState2[0],
|
|
157
168
|
setFilteredKeysSync = _useSyncState2[1];
|
|
158
|
-
var onSelectKeys = function onSelectKeys(
|
|
159
|
-
var selectedKeys =
|
|
169
|
+
var onSelectKeys = function onSelectKeys(_ref8) {
|
|
170
|
+
var selectedKeys = _ref8.selectedKeys;
|
|
160
171
|
setFilteredKeysSync(selectedKeys);
|
|
161
172
|
};
|
|
162
|
-
var onCheck = function onCheck(keys,
|
|
163
|
-
var node =
|
|
164
|
-
checked =
|
|
173
|
+
var onCheck = function onCheck(keys, _ref9) {
|
|
174
|
+
var node = _ref9.node,
|
|
175
|
+
checked = _ref9.checked;
|
|
165
176
|
if (!filterMultiple) {
|
|
166
177
|
onSelectKeys({
|
|
167
178
|
selectedKeys: checked && node.key ? [node.key] : []
|
|
@@ -205,7 +216,7 @@ function FilterDropdown(props) {
|
|
|
205
216
|
}, [visible]);
|
|
206
217
|
// ======================= Submit ========================
|
|
207
218
|
var internalTriggerFilter = function internalTriggerFilter(keys) {
|
|
208
|
-
var mergedKeys = keys && keys.length ? keys : null;
|
|
219
|
+
var mergedKeys = keys !== null && keys !== void 0 && keys.length ? keys : null;
|
|
209
220
|
if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) {
|
|
210
221
|
return null;
|
|
211
222
|
}
|
|
@@ -223,12 +234,12 @@ function FilterDropdown(props) {
|
|
|
223
234
|
internalTriggerFilter(getFilteredKeysSync());
|
|
224
235
|
};
|
|
225
236
|
var onReset = function onReset() {
|
|
226
|
-
var
|
|
237
|
+
var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
227
238
|
confirm: false,
|
|
228
239
|
closeDropdown: false
|
|
229
240
|
},
|
|
230
|
-
confirm =
|
|
231
|
-
closeDropdown =
|
|
241
|
+
confirm = _ref10.confirm,
|
|
242
|
+
closeDropdown = _ref10.closeDropdown;
|
|
232
243
|
if (confirm) {
|
|
233
244
|
internalTriggerFilter([]);
|
|
234
245
|
}
|
|
@@ -245,10 +256,10 @@ function FilterDropdown(props) {
|
|
|
245
256
|
}
|
|
246
257
|
};
|
|
247
258
|
var doFilter = function doFilter() {
|
|
248
|
-
var
|
|
259
|
+
var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
249
260
|
closeDropdown: true
|
|
250
261
|
},
|
|
251
|
-
closeDropdown =
|
|
262
|
+
closeDropdown = _ref11.closeDropdown;
|
|
252
263
|
if (closeDropdown) {
|
|
253
264
|
triggerVisible(false);
|
|
254
265
|
}
|
|
@@ -278,8 +289,8 @@ function FilterDropdown(props) {
|
|
|
278
289
|
setFilteredKeysSync([]);
|
|
279
290
|
}
|
|
280
291
|
};
|
|
281
|
-
var _getTreeData = function getTreeData(
|
|
282
|
-
var filters =
|
|
292
|
+
var _getTreeData = function getTreeData(_ref12) {
|
|
293
|
+
var filters = _ref12.filters;
|
|
283
294
|
return (filters || []).map(function (filter, index) {
|
|
284
295
|
var key = String(filter.value);
|
|
285
296
|
var item = {
|
|
@@ -305,6 +316,9 @@ function FilterDropdown(props) {
|
|
|
305
316
|
});
|
|
306
317
|
};
|
|
307
318
|
var dropdownContent;
|
|
319
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
320
|
+
direction = _React$useContext.direction,
|
|
321
|
+
renderEmpty = _React$useContext.renderEmpty;
|
|
308
322
|
if (typeof column.filterDropdown === 'function') {
|
|
309
323
|
dropdownContent = column.filterDropdown({
|
|
310
324
|
prefixCls: "".concat(dropdownPrefixCls, "-custom"),
|
|
@@ -327,7 +341,8 @@ function FilterDropdown(props) {
|
|
|
327
341
|
} else {
|
|
328
342
|
var selectedKeys = getFilteredKeysSync() || [];
|
|
329
343
|
var getFilterComponent = function getFilterComponent() {
|
|
330
|
-
var
|
|
344
|
+
var _renderEmpty;
|
|
345
|
+
var empty = (_renderEmpty = renderEmpty === null || renderEmpty === void 0 ? void 0 : renderEmpty('Table.filter')) !== null && _renderEmpty !== void 0 ? _renderEmpty : _jsx(Empty, {
|
|
331
346
|
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
332
347
|
description: locale.filterEmptyText,
|
|
333
348
|
imageStyle: {
|
|
@@ -451,47 +466,53 @@ function FilterDropdown(props) {
|
|
|
451
466
|
children: dropdownContent
|
|
452
467
|
});
|
|
453
468
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
469
|
+
dropdownContent = _jsx(FilterDropdownMenuWrapper, {
|
|
470
|
+
className: "".concat(prefixCls, "-dropdown"),
|
|
471
|
+
children: dropdownContent
|
|
472
|
+
});
|
|
473
|
+
var getDropdownTrigger = function getDropdownTrigger() {
|
|
474
|
+
var filterIcon;
|
|
475
|
+
if (typeof column.filterIcon === 'function') {
|
|
476
|
+
filterIcon = column.filterIcon(filtered);
|
|
477
|
+
} else if (column.filterIcon) {
|
|
478
|
+
filterIcon = column.filterIcon;
|
|
479
|
+
} else {
|
|
480
|
+
filterIcon = _jsx(FilterFilled, {});
|
|
481
|
+
}
|
|
482
|
+
return _jsx("span", {
|
|
483
|
+
role: "button",
|
|
484
|
+
tabIndex: -1,
|
|
485
|
+
className: classNames("".concat(prefixCls, "-trigger"), {
|
|
486
|
+
active: filtered
|
|
487
|
+
}),
|
|
488
|
+
onClick: function onClick(e) {
|
|
489
|
+
e.stopPropagation();
|
|
490
|
+
},
|
|
491
|
+
children: filterIcon
|
|
458
492
|
});
|
|
459
493
|
};
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
494
|
+
var mergedDropdownProps = extendsObject({
|
|
495
|
+
trigger: ['click'],
|
|
496
|
+
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight',
|
|
497
|
+
children: getDropdownTrigger(),
|
|
498
|
+
getPopupContainer: getPopupContainer
|
|
499
|
+
}, _objectSpread(_objectSpread({}, filterDropdownProps), {}, {
|
|
500
|
+
rootClassName: classNames(rootClassName, filterDropdownProps.rootClassName),
|
|
501
|
+
open: mergedVisible,
|
|
502
|
+
onOpenChange: onVisibleChange,
|
|
503
|
+
dropdownRender: function dropdownRender() {
|
|
504
|
+
if (typeof (filterDropdownProps === null || filterDropdownProps === void 0 ? void 0 : filterDropdownProps.dropdownRender) === 'function') {
|
|
505
|
+
return filterDropdownProps.dropdownRender(dropdownContent);
|
|
506
|
+
}
|
|
507
|
+
return dropdownContent;
|
|
508
|
+
}
|
|
509
|
+
}));
|
|
470
510
|
return _jsxs("div", {
|
|
471
511
|
className: "".concat(prefixCls, "-column"),
|
|
472
512
|
children: [_jsx("span", {
|
|
473
513
|
className: "".concat(tablePrefixCls, "-column-title"),
|
|
474
514
|
children: children
|
|
475
|
-
}), _jsx(Dropdown, {
|
|
476
|
-
dropdownRender: menu,
|
|
477
|
-
trigger: ['click'],
|
|
478
|
-
open: mergedVisible,
|
|
479
|
-
onOpenChange: onVisibleChange,
|
|
480
|
-
getPopupContainer: getPopupContainer,
|
|
481
|
-
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight',
|
|
482
|
-
rootClassName: rootClassName,
|
|
483
|
-
children: _jsx("span", {
|
|
484
|
-
role: "button",
|
|
485
|
-
tabIndex: -1,
|
|
486
|
-
className: classNames("".concat(prefixCls, "-trigger"), {
|
|
487
|
-
active: filtered
|
|
488
|
-
}),
|
|
489
|
-
onClick: function onClick(e) {
|
|
490
|
-
e.stopPropagation();
|
|
491
|
-
},
|
|
492
|
-
children: filterIcon
|
|
493
|
-
})
|
|
494
|
-
})]
|
|
515
|
+
}), _jsx(Dropdown, _objectSpread({}, mergedDropdownProps))]
|
|
495
516
|
});
|
|
496
|
-
}
|
|
517
|
+
};
|
|
497
518
|
export default FilterDropdown;
|
|
@@ -2,12 +2,12 @@ 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
4
|
import Input from '../../../input';
|
|
5
|
-
function FilterSearch(
|
|
6
|
-
var value =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var FilterSearch = function FilterSearch(props) {
|
|
6
|
+
var value = props.value,
|
|
7
|
+
filterSearch = props.filterSearch,
|
|
8
|
+
tablePrefixCls = props.tablePrefixCls,
|
|
9
|
+
locale = props.locale,
|
|
10
|
+
onChange = props.onChange;
|
|
11
11
|
if (!filterSearch) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
@@ -23,5 +23,5 @@ function FilterSearch(_ref) {
|
|
|
23
23
|
className: "".concat(tablePrefixCls, "-filter-dropdown-search-input")
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
export default FilterSearch;
|
|
@@ -19,7 +19,7 @@ import * as React from 'react';
|
|
|
19
19
|
import { devUseWarning } from '../../../_util/warning';
|
|
20
20
|
import { getColumnKey, getColumnPos, renderColumnTitle } from '../../util';
|
|
21
21
|
import FilterDropdown, { flattenKeys } from './FilterDropdown';
|
|
22
|
-
function collectFilterStates(columns, init, pos) {
|
|
22
|
+
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);
|
|
@@ -48,11 +48,11 @@ function collectFilterStates(columns, init, pos) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
if ('children' in column) {
|
|
51
|
-
filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(
|
|
51
|
+
filterStates = [].concat(_toConsumableArray(filterStates), _toConsumableArray(_collectFilterStates(column.children, init, columnPos)));
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
return filterStates;
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, locale, triggerFilter, getPopupContainer, pos, rootClassName) {
|
|
57
57
|
return columns.map(function (column, index) {
|
|
58
58
|
var columnPos = getColumnPos(index, pos);
|
|
@@ -99,7 +99,7 @@ function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, local
|
|
|
99
99
|
return newColumn;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function generateFilterInfo(filterStates) {
|
|
102
|
+
var generateFilterInfo = function generateFilterInfo(filterStates) {
|
|
103
103
|
var currentFilters = {};
|
|
104
104
|
filterStates.forEach(function (_ref2) {
|
|
105
105
|
var key = _ref2.key,
|
|
@@ -120,9 +120,9 @@ function generateFilterInfo(filterStates) {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
return currentFilters;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
};
|
|
124
|
+
var _getFilterData = function getFilterData(data, filterStates, childrenColumnName) {
|
|
125
|
+
var filterDatas = filterStates.reduce(function (currentData, filterState) {
|
|
126
126
|
var _filterState$column = filterState.column,
|
|
127
127
|
onFilter = _filterState$column.onFilter,
|
|
128
128
|
filters = _filterState$column.filters,
|
|
@@ -141,7 +141,7 @@ export function getFilterData(data, filterStates, childrenColumnName) {
|
|
|
141
141
|
var realKey = keyIndex !== -1 ? keys[keyIndex] : key;
|
|
142
142
|
// filter children
|
|
143
143
|
if (record[childrenColumnName]) {
|
|
144
|
-
record[childrenColumnName] =
|
|
144
|
+
record[childrenColumnName] = _getFilterData(record[childrenColumnName], filterStates, childrenColumnName);
|
|
145
145
|
}
|
|
146
146
|
return onFilter(realKey, record);
|
|
147
147
|
});
|
|
@@ -149,7 +149,9 @@ export function getFilterData(data, filterStates, childrenColumnName) {
|
|
|
149
149
|
}
|
|
150
150
|
return currentData;
|
|
151
151
|
}, data);
|
|
152
|
-
|
|
152
|
+
return filterDatas;
|
|
153
|
+
};
|
|
154
|
+
export { _getFilterData as getFilterData };
|
|
153
155
|
var _getMergedColumns = function getMergedColumns(rawMergedColumns) {
|
|
154
156
|
return rawMergedColumns.flatMap(function (column) {
|
|
155
157
|
if ('children' in column) {
|
|
@@ -158,33 +160,33 @@ var _getMergedColumns = function getMergedColumns(rawMergedColumns) {
|
|
|
158
160
|
return [column];
|
|
159
161
|
});
|
|
160
162
|
};
|
|
161
|
-
function useFilter(
|
|
162
|
-
var prefixCls =
|
|
163
|
-
dropdownPrefixCls =
|
|
164
|
-
rawMergedColumns =
|
|
165
|
-
onFilterChange =
|
|
166
|
-
getPopupContainer =
|
|
167
|
-
tableLocale =
|
|
168
|
-
rootClassName =
|
|
163
|
+
var useFilter = function useFilter(props) {
|
|
164
|
+
var prefixCls = props.prefixCls,
|
|
165
|
+
dropdownPrefixCls = props.dropdownPrefixCls,
|
|
166
|
+
rawMergedColumns = props.mergedColumns,
|
|
167
|
+
onFilterChange = props.onFilterChange,
|
|
168
|
+
getPopupContainer = props.getPopupContainer,
|
|
169
|
+
tableLocale = props.locale,
|
|
170
|
+
rootClassName = props.rootClassName;
|
|
169
171
|
var warning = devUseWarning('Table');
|
|
170
172
|
var mergedColumns = React.useMemo(function () {
|
|
171
173
|
return _getMergedColumns(rawMergedColumns || []);
|
|
172
174
|
}, [rawMergedColumns]);
|
|
173
175
|
var _React$useState = React.useState(function () {
|
|
174
|
-
return
|
|
176
|
+
return _collectFilterStates(mergedColumns, true);
|
|
175
177
|
}),
|
|
176
178
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
177
179
|
filterStates = _React$useState2[0],
|
|
178
180
|
setFilterStates = _React$useState2[1];
|
|
179
181
|
var mergedFilterStates = React.useMemo(function () {
|
|
180
|
-
var collectedStates =
|
|
182
|
+
var collectedStates = _collectFilterStates(mergedColumns, false);
|
|
181
183
|
if (collectedStates.length === 0) {
|
|
182
184
|
return collectedStates;
|
|
183
185
|
}
|
|
184
186
|
var filteredKeysIsAllNotControlled = true;
|
|
185
187
|
var filteredKeysIsAllControlled = true;
|
|
186
|
-
collectedStates.forEach(function (
|
|
187
|
-
var filteredKeys =
|
|
188
|
+
collectedStates.forEach(function (_ref3) {
|
|
189
|
+
var filteredKeys = _ref3.filteredKeys;
|
|
188
190
|
if (filteredKeys !== undefined) {
|
|
189
191
|
filteredKeysIsAllNotControlled = false;
|
|
190
192
|
} else {
|
|
@@ -197,8 +199,8 @@ function useFilter(_ref3) {
|
|
|
197
199
|
var keyList = (mergedColumns || []).map(function (column, index) {
|
|
198
200
|
return getColumnKey(column, getColumnPos(index));
|
|
199
201
|
});
|
|
200
|
-
return filterStates.filter(function (
|
|
201
|
-
var key =
|
|
202
|
+
return filterStates.filter(function (_ref4) {
|
|
203
|
+
var key = _ref4.key;
|
|
202
204
|
return keyList.includes(key);
|
|
203
205
|
}).map(function (item) {
|
|
204
206
|
var col = mergedColumns[keyList.findIndex(function (key) {
|
|
@@ -217,8 +219,8 @@ function useFilter(_ref3) {
|
|
|
217
219
|
return generateFilterInfo(mergedFilterStates);
|
|
218
220
|
}, [mergedFilterStates]);
|
|
219
221
|
var triggerFilter = function triggerFilter(filterState) {
|
|
220
|
-
var newFilterStates = mergedFilterStates.filter(function (
|
|
221
|
-
var key =
|
|
222
|
+
var newFilterStates = mergedFilterStates.filter(function (_ref5) {
|
|
223
|
+
var key = _ref5.key;
|
|
222
224
|
return key !== filterState.key;
|
|
223
225
|
});
|
|
224
226
|
newFilterStates.push(filterState);
|
|
@@ -229,6 +231,6 @@ function useFilter(_ref3) {
|
|
|
229
231
|
return injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer, undefined, rootClassName);
|
|
230
232
|
};
|
|
231
233
|
return [transformColumns, mergedFilterStates, filters];
|
|
232
|
-
}
|
|
234
|
+
};
|
|
233
235
|
export { flattenKeys };
|
|
234
236
|
export default useFilter;
|
|
@@ -1,10 +1,10 @@
|
|
|
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
2
|
import * as React from 'react';
|
|
3
|
-
|
|
3
|
+
var useLazyKVMap = function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
4
4
|
var mapCacheRef = React.useRef({});
|
|
5
5
|
function getRecordByKey(key) {
|
|
6
|
+
var _mapCacheRef$current$;
|
|
6
7
|
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
|
|
7
|
-
/* eslint-disable no-inner-declarations */
|
|
8
8
|
var _dig = function dig(records) {
|
|
9
9
|
records.forEach(function (record, index) {
|
|
10
10
|
var rowKey = getRowKey(record, index);
|
|
@@ -14,7 +14,6 @@ export default function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
/* eslint-enable */
|
|
18
17
|
var kvMap = new Map();
|
|
19
18
|
_dig(data);
|
|
20
19
|
mapCacheRef.current = {
|
|
@@ -24,7 +23,8 @@ export default function useLazyKVMap(data, childrenColumnName, getRowKey) {
|
|
|
24
23
|
getRowKey: getRowKey
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
return mapCacheRef.current.kvMap
|
|
26
|
+
return (_mapCacheRef$current$ = mapCacheRef.current.kvMap) === null || _mapCacheRef$current$ === void 0 ? void 0 : _mapCacheRef$current$.get(key);
|
|
28
27
|
}
|
|
29
28
|
return [getRecordByKey];
|
|
30
|
-
}
|
|
29
|
+
};
|
|
30
|
+
export default useLazyKVMap;
|
|
@@ -111,6 +111,10 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
111
111
|
React.useEffect(function () {
|
|
112
112
|
updatePreserveRecordsCache(mergedSelectedKeys);
|
|
113
113
|
}, [mergedSelectedKeys]);
|
|
114
|
+
// Get flatten data
|
|
115
|
+
var flattedData = useMemo(function () {
|
|
116
|
+
return _flattenData(childrenColumnName, pageData);
|
|
117
|
+
}, [childrenColumnName, pageData]);
|
|
114
118
|
var _useMemo = useMemo(function () {
|
|
115
119
|
if (checkStrictly) {
|
|
116
120
|
return {
|
|
@@ -119,7 +123,8 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
119
123
|
}
|
|
120
124
|
var convertData = data;
|
|
121
125
|
if (preserveSelectedRowKeys) {
|
|
122
|
-
|
|
126
|
+
// use flattedData keys
|
|
127
|
+
var keysSet = new Set(flattedData.map(function (record, index) {
|
|
123
128
|
return getRowKey(record, index);
|
|
124
129
|
}));
|
|
125
130
|
// remove preserveRecords that duplicate data
|
|
@@ -135,12 +140,8 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
135
140
|
externalGetKey: getRowKey,
|
|
136
141
|
childrenPropName: childrenColumnName
|
|
137
142
|
});
|
|
138
|
-
}, [data, getRowKey, checkStrictly, childrenColumnName, preserveSelectedRowKeys]),
|
|
143
|
+
}, [data, getRowKey, checkStrictly, childrenColumnName, preserveSelectedRowKeys, flattedData]),
|
|
139
144
|
keyEntities = _useMemo.keyEntities;
|
|
140
|
-
// Get flatten data
|
|
141
|
-
var flattedData = useMemo(function () {
|
|
142
|
-
return _flattenData(childrenColumnName, pageData);
|
|
143
|
-
}, [childrenColumnName, pageData]);
|
|
144
145
|
// Get all checkbox props
|
|
145
146
|
var checkboxPropsMap = useMemo(function () {
|
|
146
147
|
var map = new Map();
|
|
@@ -409,16 +410,21 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
409
410
|
renderCell = function renderCell(_, record, index) {
|
|
410
411
|
var key = getRowKey(record, index);
|
|
411
412
|
var checked = keySet.has(key);
|
|
413
|
+
var checkboxProps = checkboxPropsMap.get(key);
|
|
412
414
|
return {
|
|
413
|
-
node: _jsx(Radio, _objectSpread(_objectSpread({},
|
|
415
|
+
node: _jsx(Radio, _objectSpread(_objectSpread({}, checkboxProps), {}, {
|
|
414
416
|
checked: checked,
|
|
415
417
|
onClick: function onClick(e) {
|
|
416
|
-
|
|
418
|
+
var _checkboxProps$onClic;
|
|
419
|
+
e.stopPropagation();
|
|
420
|
+
checkboxProps === null || checkboxProps === void 0 || (_checkboxProps$onClic = checkboxProps.onClick) === null || _checkboxProps$onClic === void 0 || _checkboxProps$onClic.call(checkboxProps, e);
|
|
417
421
|
},
|
|
418
422
|
onChange: function onChange(event) {
|
|
423
|
+
var _checkboxProps$onChan;
|
|
419
424
|
if (!keySet.has(key)) {
|
|
420
425
|
triggerSingleSelection(key, true, [key], event.nativeEvent);
|
|
421
426
|
}
|
|
427
|
+
checkboxProps === null || checkboxProps === void 0 || (_checkboxProps$onChan = checkboxProps.onChange) === null || _checkboxProps$onChan === void 0 || _checkboxProps$onChan.call(checkboxProps, event);
|
|
422
428
|
}
|
|
423
429
|
})),
|
|
424
430
|
checked: checked
|
|
@@ -445,10 +451,13 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
445
451
|
checked: checked,
|
|
446
452
|
skipGroup: true,
|
|
447
453
|
onClick: function onClick(e) {
|
|
448
|
-
|
|
454
|
+
var _checkboxProps$onClic2;
|
|
455
|
+
e.stopPropagation();
|
|
456
|
+
checkboxProps === null || checkboxProps === void 0 || (_checkboxProps$onClic2 = checkboxProps.onClick) === null || _checkboxProps$onClic2 === void 0 || _checkboxProps$onClic2.call(checkboxProps, e);
|
|
449
457
|
},
|
|
450
|
-
onChange: function onChange(
|
|
451
|
-
var
|
|
458
|
+
onChange: function onChange(event) {
|
|
459
|
+
var _checkboxProps$onChan2;
|
|
460
|
+
var nativeEvent = event.nativeEvent;
|
|
452
461
|
var shiftKey = nativeEvent.shiftKey;
|
|
453
462
|
var currentSelectedIndex = recordKeys.findIndex(function (item) {
|
|
454
463
|
return item === key;
|
|
@@ -494,6 +503,7 @@ var useSelection = function useSelection(config, rowSelection) {
|
|
|
494
503
|
} else {
|
|
495
504
|
updatePrevSelectedIndex(currentSelectedIndex);
|
|
496
505
|
}
|
|
506
|
+
checkboxProps === null || checkboxProps === void 0 || (_checkboxProps$onChan2 = checkboxProps.onChange) === null || _checkboxProps$onChan2 === void 0 || _checkboxProps$onChan2.call(checkboxProps, event);
|
|
497
507
|
}
|
|
498
508
|
})),
|
|
499
509
|
checked: checked
|