@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
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
var _excluded = ["getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName"];
|
|
1
|
+
var _excluded = ["prefixCls", "openClassName", "getTooltipContainer", "color", "overlayInnerStyle", "children", "afterOpenChange", "afterVisibleChange", "destroyTooltipOnHide", "destroyOnHidden", "arrow", "title", "overlay", "builtinPlacements", "arrowPointAtCenter", "autoAdjustOverflow", "motion", "getPopupContainer", "placement", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "rootClassName", "overlayClassName", "styles", "classNames"];
|
|
2
2
|
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; }
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
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
|
-
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; }
|
|
8
|
-
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; }
|
|
9
7
|
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); }
|
|
10
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
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."); }
|
|
@@ -13,6 +11,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
13
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; }
|
|
14
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; } }
|
|
15
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
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import * as React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
@@ -25,7 +25,7 @@ import getPlacements from '../_util/placements';
|
|
|
25
25
|
import { cloneElement, isFragment } from '../_util/reactNode';
|
|
26
26
|
import { devUseWarning } from '../_util/warning';
|
|
27
27
|
import zIndexContext from '../_util/zindexContext';
|
|
28
|
-
import {
|
|
28
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
29
29
|
import { useToken } from '../theme/internal';
|
|
30
30
|
import PurePanel from './PurePanel';
|
|
31
31
|
import useStyle from './style';
|
|
@@ -35,13 +35,13 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
35
35
|
var customizePrefixCls = props.prefixCls,
|
|
36
36
|
openClassName = props.openClassName,
|
|
37
37
|
getTooltipContainer = props.getTooltipContainer,
|
|
38
|
-
overlayClassName = props.overlayClassName,
|
|
39
38
|
color = props.color,
|
|
40
39
|
overlayInnerStyle = props.overlayInnerStyle,
|
|
41
40
|
children = props.children,
|
|
42
41
|
afterOpenChange = props.afterOpenChange,
|
|
43
42
|
afterVisibleChange = props.afterVisibleChange,
|
|
44
43
|
destroyTooltipOnHide = props.destroyTooltipOnHide,
|
|
44
|
+
destroyOnHidden = props.destroyOnHidden,
|
|
45
45
|
_props$arrow = props.arrow,
|
|
46
46
|
arrow = _props$arrow === void 0 ? true : _props$arrow,
|
|
47
47
|
title = props.title,
|
|
@@ -50,15 +50,33 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
50
50
|
_props$arrowPointAtCe = props.arrowPointAtCenter,
|
|
51
51
|
arrowPointAtCenter = _props$arrowPointAtCe === void 0 ? false : _props$arrowPointAtCe,
|
|
52
52
|
_props$autoAdjustOver = props.autoAdjustOverflow,
|
|
53
|
-
autoAdjustOverflow = _props$autoAdjustOver === void 0 ? true : _props$autoAdjustOver
|
|
53
|
+
autoAdjustOverflow = _props$autoAdjustOver === void 0 ? true : _props$autoAdjustOver,
|
|
54
|
+
motion = props.motion,
|
|
55
|
+
getPopupContainer = props.getPopupContainer,
|
|
56
|
+
_props$placement = props.placement,
|
|
57
|
+
placement = _props$placement === void 0 ? 'top' : _props$placement,
|
|
58
|
+
_props$mouseEnterDela = props.mouseEnterDelay,
|
|
59
|
+
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,
|
|
60
|
+
_props$mouseLeaveDela = props.mouseLeaveDelay,
|
|
61
|
+
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
|
|
62
|
+
overlayStyle = props.overlayStyle,
|
|
63
|
+
rootClassName = props.rootClassName,
|
|
64
|
+
overlayClassName = props.overlayClassName,
|
|
65
|
+
styles = props.styles,
|
|
66
|
+
tooltipClassNames = props.classNames,
|
|
67
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
54
68
|
var mergedShowArrow = !!arrow;
|
|
55
69
|
var _useToken = useToken(),
|
|
56
70
|
_useToken2 = _slicedToArray(_useToken, 2),
|
|
57
71
|
token = _useToken2[1];
|
|
58
|
-
var
|
|
59
|
-
getContextPopupContainer =
|
|
60
|
-
getPrefixCls =
|
|
61
|
-
direction =
|
|
72
|
+
var _useComponentConfig = useComponentConfig('tooltip'),
|
|
73
|
+
getContextPopupContainer = _useComponentConfig.getPopupContainer,
|
|
74
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
75
|
+
direction = _useComponentConfig.direction,
|
|
76
|
+
contextClassName = _useComponentConfig.className,
|
|
77
|
+
contextStyle = _useComponentConfig.style,
|
|
78
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
79
|
+
contextStyles = _useComponentConfig.styles;
|
|
62
80
|
// ============================== Ref ===============================
|
|
63
81
|
var warning = devUseWarning('Tooltip');
|
|
64
82
|
var tooltipRef = React.useRef(null);
|
|
@@ -67,19 +85,20 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
67
85
|
(_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 || _tooltipRef$current.forceAlign();
|
|
68
86
|
};
|
|
69
87
|
React.useImperativeHandle(ref, function () {
|
|
70
|
-
var _tooltipRef$current2;
|
|
88
|
+
var _tooltipRef$current2, _tooltipRef$current3;
|
|
71
89
|
return {
|
|
72
90
|
forceAlign: forceAlign,
|
|
73
91
|
forcePopupAlign: function forcePopupAlign() {
|
|
74
92
|
warning.deprecated(false, 'forcePopupAlign', 'forceAlign');
|
|
75
93
|
forceAlign();
|
|
76
94
|
},
|
|
77
|
-
nativeElement: (_tooltipRef$current2 = tooltipRef.current) === null || _tooltipRef$current2 === void 0 ? void 0 : _tooltipRef$current2.nativeElement
|
|
95
|
+
nativeElement: (_tooltipRef$current2 = tooltipRef.current) === null || _tooltipRef$current2 === void 0 ? void 0 : _tooltipRef$current2.nativeElement,
|
|
96
|
+
popupElement: (_tooltipRef$current3 = tooltipRef.current) === null || _tooltipRef$current3 === void 0 ? void 0 : _tooltipRef$current3.popupElement
|
|
78
97
|
};
|
|
79
98
|
});
|
|
80
99
|
// ============================== Warn ==============================
|
|
81
100
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
|
-
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}']].forEach(function (_ref) {
|
|
101
|
+
[['visible', 'open'], ['defaultVisible', 'defaultOpen'], ['onVisibleChange', 'onOpenChange'], ['afterVisibleChange', 'afterOpenChange'], ['destroyTooltipOnHide', 'destroyOnHidden'], ['arrowPointAtCenter', 'arrow={{ pointAtCenter: true }}'], ['overlayStyle', 'styles={{ root: {} }}'], ['overlayInnerStyle', 'styles={{ body: {} }}'], ['overlayClassName', 'classNames={{ root: "" }}']].forEach(function (_ref) {
|
|
83
102
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
84
103
|
deprecatedName = _ref2[0],
|
|
85
104
|
newName = _ref2[1];
|
|
@@ -130,16 +149,6 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
130
149
|
space: true,
|
|
131
150
|
children: typeof memoOverlay === 'function' ? memoOverlay() : memoOverlay
|
|
132
151
|
});
|
|
133
|
-
var getPopupContainer = props.getPopupContainer,
|
|
134
|
-
_props$placement = props.placement,
|
|
135
|
-
placement = _props$placement === void 0 ? 'top' : _props$placement,
|
|
136
|
-
_props$mouseEnterDela = props.mouseEnterDelay,
|
|
137
|
-
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,
|
|
138
|
-
_props$mouseLeaveDela = props.mouseLeaveDelay,
|
|
139
|
-
mouseLeaveDelay = _props$mouseLeaveDela === void 0 ? 0.1 : _props$mouseLeaveDela,
|
|
140
|
-
overlayStyle = props.overlayStyle,
|
|
141
|
-
rootClassName = props.rootClassName,
|
|
142
|
-
otherProps = _objectWithoutProperties(props, _excluded);
|
|
143
152
|
var prefixCls = getPrefixCls('tooltip', customizePrefixCls);
|
|
144
153
|
var rootPrefixCls = getPrefixCls();
|
|
145
154
|
var injectFromPopover = props['data-popover-inject'];
|
|
@@ -163,22 +172,28 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
163
172
|
// Color
|
|
164
173
|
var colorInfo = parseColor(prefixCls, color);
|
|
165
174
|
var arrowContentStyle = colorInfo.arrowStyle;
|
|
166
|
-
var
|
|
167
|
-
var
|
|
175
|
+
var rootClassNames = classNames(overlayClassName, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), colorInfo.className, rootClassName, hashId, cssVarCls, contextClassName, contextClassNames.root, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.root);
|
|
176
|
+
var bodyClassNames = classNames(contextClassNames.body, tooltipClassNames === null || tooltipClassNames === void 0 ? void 0 : tooltipClassNames.body);
|
|
168
177
|
// ============================ zIndex ============================
|
|
169
|
-
var _useZIndex = useZIndex('Tooltip',
|
|
178
|
+
var _useZIndex = useZIndex('Tooltip', restProps.zIndex),
|
|
170
179
|
_useZIndex2 = _slicedToArray(_useZIndex, 2),
|
|
171
180
|
zIndex = _useZIndex2[0],
|
|
172
181
|
contextZIndex = _useZIndex2[1];
|
|
173
|
-
var content = _jsx(RcTooltip, _objectSpread(_objectSpread({},
|
|
182
|
+
var content = _jsx(RcTooltip, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
174
183
|
zIndex: zIndex,
|
|
175
184
|
showArrow: mergedShowArrow,
|
|
176
185
|
placement: placement,
|
|
177
186
|
mouseEnterDelay: mouseEnterDelay,
|
|
178
187
|
mouseLeaveDelay: mouseLeaveDelay,
|
|
179
188
|
prefixCls: prefixCls,
|
|
180
|
-
|
|
181
|
-
|
|
189
|
+
classNames: {
|
|
190
|
+
root: rootClassNames,
|
|
191
|
+
body: bodyClassNames
|
|
192
|
+
},
|
|
193
|
+
styles: {
|
|
194
|
+
root: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, arrowContentStyle), contextStyles.root), contextStyle), overlayStyle), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
195
|
+
body: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, contextStyles.body), overlayInnerStyle), styles === null || styles === void 0 ? void 0 : styles.body), colorInfo.overlayStyle)
|
|
196
|
+
},
|
|
182
197
|
getTooltipContainer: getPopupContainer || getTooltipContainer || getContextPopupContainer,
|
|
183
198
|
ref: tooltipRef,
|
|
184
199
|
builtinPlacements: tooltipPlacements,
|
|
@@ -186,7 +201,6 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
186
201
|
visible: tempOpen,
|
|
187
202
|
onVisibleChange: onOpenChange,
|
|
188
203
|
afterVisibleChange: afterOpenChange !== null && afterOpenChange !== void 0 ? afterOpenChange : afterVisibleChange,
|
|
189
|
-
overlayInnerStyle: formattedOverlayInnerStyle,
|
|
190
204
|
arrowContent: _jsx("span", {
|
|
191
205
|
className: "".concat(prefixCls, "-arrow-content")
|
|
192
206
|
}),
|
|
@@ -194,7 +208,8 @@ var InternalTooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
194
208
|
motionName: getTransitionName(rootPrefixCls, 'zoom-big-fast', props.transitionName),
|
|
195
209
|
motionDeadline: 1000
|
|
196
210
|
},
|
|
197
|
-
|
|
211
|
+
// TODO: In the future, destroyTooltipOnHide in rc-tooltip needs to be upgrade to destroyOnHidden
|
|
212
|
+
destroyTooltipOnHide: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : !!destroyTooltipOnHide,
|
|
198
213
|
children: tempOpen ? cloneElement(child, {
|
|
199
214
|
className: childCls
|
|
200
215
|
}) : child
|
|
@@ -11,7 +11,8 @@ import getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS } from
|
|
|
11
11
|
import { getArrowToken } from '../../style/roundedArrow';
|
|
12
12
|
import { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal';
|
|
13
13
|
var genTooltipStyle = function genTooltipStyle(token) {
|
|
14
|
-
var
|
|
14
|
+
var calc = token.calc,
|
|
15
|
+
componentCls = token.componentCls,
|
|
15
16
|
tooltipMaxWidth = token.tooltipMaxWidth,
|
|
16
17
|
tooltipColor = token.tooltipColor,
|
|
17
18
|
tooltipBg = token.tooltipBg,
|
|
@@ -20,8 +21,14 @@ var genTooltipStyle = function genTooltipStyle(token) {
|
|
|
20
21
|
controlHeight = token.controlHeight,
|
|
21
22
|
boxShadowSecondary = token.boxShadowSecondary,
|
|
22
23
|
paddingSM = token.paddingSM,
|
|
23
|
-
paddingXS = token.paddingXS
|
|
24
|
-
|
|
24
|
+
paddingXS = token.paddingXS,
|
|
25
|
+
arrowOffsetHorizontal = token.arrowOffsetHorizontal,
|
|
26
|
+
sizePopupArrow = token.sizePopupArrow;
|
|
27
|
+
// arrowOffsetHorizontal + arrowWidth + borderRadius
|
|
28
|
+
var edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();
|
|
29
|
+
// borderRadius * 2 + arrowWidth
|
|
30
|
+
var centerAlignMinWidth = calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal();
|
|
31
|
+
return [_defineProperty({}, componentCls, _objectSpread(_objectSpread(_objectSpread({}, resetComponent(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
25
32
|
position: 'absolute',
|
|
26
33
|
zIndex: zIndexPopup,
|
|
27
34
|
display: 'block',
|
|
@@ -36,7 +43,7 @@ var genTooltipStyle = function genTooltipStyle(token) {
|
|
|
36
43
|
},
|
|
37
44
|
'--antd-arrow-background-color': tooltipBg
|
|
38
45
|
}, "".concat(componentCls, "-inner"), {
|
|
39
|
-
minWidth:
|
|
46
|
+
minWidth: centerAlignMinWidth,
|
|
40
47
|
minHeight: controlHeight,
|
|
41
48
|
padding: "".concat(unit(token.calc(paddingSM).div(2).equal()), " ").concat(unit(paddingXS)),
|
|
42
49
|
color: tooltipColor,
|
|
@@ -47,6 +54,8 @@ var genTooltipStyle = function genTooltipStyle(token) {
|
|
|
47
54
|
borderRadius: tooltipBorderRadius,
|
|
48
55
|
boxShadow: boxShadowSecondary,
|
|
49
56
|
boxSizing: 'border-box'
|
|
57
|
+
}), ["&-placement-topLeft", "&-placement-topRight", "&-placement-bottomLeft", "&-placement-bottomRight"].join(','), {
|
|
58
|
+
minWidth: edgeAlignMinWidth
|
|
50
59
|
}), ["&-placement-left", "&-placement-leftTop", "&-placement-leftBottom", "&-placement-right", "&-placement-rightTop", "&-placement-rightBottom"].join(','), _defineProperty({}, "".concat(componentCls, "-inner"), {
|
|
51
60
|
borderRadius: token.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)
|
|
52
61
|
})), "".concat(componentCls, "-content"), {
|
package/lib/Antd5/tour/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 = ["prefixCls", "type", "rootClassName", "indicatorsRender", "steps", "closeIcon"];
|
|
2
|
+
var _excluded = ["prefixCls", "type", "rootClassName", "indicatorsRender", "actionsRender", "steps", "closeIcon"];
|
|
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; }
|
|
@@ -30,6 +30,7 @@ var Tour = function Tour(props) {
|
|
|
30
30
|
type = props.type,
|
|
31
31
|
rootClassName = props.rootClassName,
|
|
32
32
|
indicatorsRender = props.indicatorsRender,
|
|
33
|
+
actionsRender = props.actionsRender,
|
|
33
34
|
steps = props.steps,
|
|
34
35
|
closeIcon = props.closeIcon,
|
|
35
36
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
@@ -70,7 +71,8 @@ var Tour = function Tour(props) {
|
|
|
70
71
|
type: type,
|
|
71
72
|
stepProps: stepProps,
|
|
72
73
|
current: stepCurrent,
|
|
73
|
-
indicatorsRender: indicatorsRender
|
|
74
|
+
indicatorsRender: indicatorsRender,
|
|
75
|
+
actionsRender: actionsRender
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
78
|
// ============================ zIndex ============================
|
|
@@ -1,4 +1,8 @@
|
|
|
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
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
2
6
|
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; }
|
|
3
7
|
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; }
|
|
4
8
|
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,18 +10,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
10
|
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
11
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
12
|
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."); }
|
|
9
|
-
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; } }
|
|
10
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
11
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
12
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
13
|
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; } }
|
|
14
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
15
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
16
14
|
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; }
|
|
17
|
-
|
|
15
|
+
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; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
17
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
|
20
20
|
import classNames from 'classnames';
|
|
21
|
+
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
21
22
|
import Button from '../button';
|
|
22
23
|
import { useLocale } from '../locale';
|
|
23
24
|
import defaultLocale from '../locale/en_US';
|
|
@@ -31,7 +32,8 @@ var TourPanel = function TourPanel(props) {
|
|
|
31
32
|
var stepProps = props.stepProps,
|
|
32
33
|
current = props.current,
|
|
33
34
|
type = props.type,
|
|
34
|
-
indicatorsRender = props.indicatorsRender
|
|
35
|
+
indicatorsRender = props.indicatorsRender,
|
|
36
|
+
actionsRender = props.actionsRender;
|
|
35
37
|
var prefixCls = stepProps.prefixCls,
|
|
36
38
|
_stepProps$total = stepProps.total,
|
|
37
39
|
total = _stepProps$total === void 0 ? 1 : _stepProps$total,
|
|
@@ -47,14 +49,23 @@ var TourPanel = function TourPanel(props) {
|
|
|
47
49
|
stepType = stepProps.type,
|
|
48
50
|
closable = stepProps.closable;
|
|
49
51
|
var mergedType = stepType !== null && stepType !== void 0 ? stepType : type;
|
|
50
|
-
var
|
|
52
|
+
var ariaProps = pickAttrs(closable !== null && closable !== void 0 ? closable : {}, true);
|
|
53
|
+
var _useLocale = useLocale('global', defaultLocale.global),
|
|
54
|
+
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
55
|
+
contextLocaleGlobal = _useLocale2[0];
|
|
56
|
+
var _useLocale3 = useLocale('Tour', defaultLocale.Tour),
|
|
57
|
+
_useLocale4 = _slicedToArray(_useLocale3, 1),
|
|
58
|
+
contextLocaleTour = _useLocale4[0];
|
|
59
|
+
var mergedCloseIcon = _jsx("button", _objectSpread(_objectSpread({
|
|
51
60
|
type: "button",
|
|
52
61
|
onClick: onClose,
|
|
53
62
|
className: "".concat(prefixCls, "-close"),
|
|
63
|
+
"aria-label": contextLocaleGlobal === null || contextLocaleGlobal === void 0 ? void 0 : contextLocaleGlobal.close
|
|
64
|
+
}, ariaProps), {}, {
|
|
54
65
|
children: (closable === null || closable === void 0 ? void 0 : closable.closeIcon) || _jsx(CloseOutlined, {
|
|
55
66
|
className: "".concat(prefixCls, "-close-icon")
|
|
56
67
|
})
|
|
57
|
-
});
|
|
68
|
+
}));
|
|
58
69
|
var isLastStep = current === total - 1;
|
|
59
70
|
var prevBtnClick = function prevBtnClick() {
|
|
60
71
|
var _prevButtonProps$onCl;
|
|
@@ -102,9 +113,22 @@ var TourPanel = function TourPanel(props) {
|
|
|
102
113
|
type: 'default',
|
|
103
114
|
ghost: mergedType === 'primary'
|
|
104
115
|
};
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
var defaultActionsNode = _jsxs(_Fragment, {
|
|
117
|
+
children: [current !== 0 ? _jsx(Button, _objectSpread(_objectSpread(_objectSpread({
|
|
118
|
+
size: "small"
|
|
119
|
+
}, secondaryBtnProps), prevButtonProps), {}, {
|
|
120
|
+
onClick: prevBtnClick,
|
|
121
|
+
className: classNames("".concat(prefixCls, "-prev-btn"), prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.className),
|
|
122
|
+
children: (_prevButtonProps$chil = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.children) !== null && _prevButtonProps$chil !== void 0 ? _prevButtonProps$chil : contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Previous
|
|
123
|
+
})) : null, _jsx(Button, _objectSpread(_objectSpread({
|
|
124
|
+
size: "small",
|
|
125
|
+
type: mainBtnType
|
|
126
|
+
}, nextButtonProps), {}, {
|
|
127
|
+
onClick: nextBtnClick,
|
|
128
|
+
className: classNames("".concat(prefixCls, "-next-btn"), nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.className),
|
|
129
|
+
children: (_nextButtonProps$chil = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.children) !== null && _nextButtonProps$chil !== void 0 ? _nextButtonProps$chil : isLastStep ? contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Finish : contextLocaleTour === null || contextLocaleTour === void 0 ? void 0 : contextLocaleTour.Next
|
|
130
|
+
}))]
|
|
131
|
+
});
|
|
108
132
|
return _jsx("div", {
|
|
109
133
|
className: "".concat(prefixCls, "-content"),
|
|
110
134
|
children: _jsxs("div", {
|
|
@@ -114,21 +138,12 @@ var TourPanel = function TourPanel(props) {
|
|
|
114
138
|
children: [total > 1 && _jsx("div", {
|
|
115
139
|
className: "".concat(prefixCls, "-indicators"),
|
|
116
140
|
children: mergedIndicatorNode
|
|
117
|
-
}),
|
|
141
|
+
}), _jsx("div", {
|
|
118
142
|
className: "".concat(prefixCls, "-buttons"),
|
|
119
|
-
children:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
children: (_prevButtonProps$chil = prevButtonProps === null || prevButtonProps === void 0 ? void 0 : prevButtonProps.children) !== null && _prevButtonProps$chil !== void 0 ? _prevButtonProps$chil : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Previous
|
|
124
|
-
})) : null, _jsx(Button, _objectSpread(_objectSpread({
|
|
125
|
-
type: mainBtnType
|
|
126
|
-
}, nextButtonProps), {}, {
|
|
127
|
-
onClick: nextBtnClick,
|
|
128
|
-
size: "small",
|
|
129
|
-
className: classNames("".concat(prefixCls, "-next-btn"), nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.className),
|
|
130
|
-
children: (_nextButtonProps$chil = nextButtonProps === null || nextButtonProps === void 0 ? void 0 : nextButtonProps.children) !== null && _nextButtonProps$chil !== void 0 ? _nextButtonProps$chil : isLastStep ? contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Finish : contextLocale === null || contextLocale === void 0 ? void 0 : contextLocale.Next
|
|
131
|
-
}))]
|
|
143
|
+
children: actionsRender ? actionsRender(defaultActionsNode, {
|
|
144
|
+
current: current,
|
|
145
|
+
total: total
|
|
146
|
+
}) : defaultActionsNode
|
|
132
147
|
})]
|
|
133
148
|
})]
|
|
134
149
|
})
|
|
@@ -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 getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS } from '../../style/placementArrow';
|
|
11
11
|
import { getArrowToken } from '../../style/roundedArrow';
|
|
@@ -162,8 +162,8 @@ export var prepareComponentToken = function prepareComponentToken(token) {
|
|
|
162
162
|
return _objectSpread(_objectSpread({
|
|
163
163
|
zIndexPopup: token.zIndexPopupBase + 70,
|
|
164
164
|
closeBtnSize: token.fontSize * token.lineHeight,
|
|
165
|
-
primaryPrevBtnBg: new
|
|
166
|
-
primaryNextBtnHoverBg: new
|
|
165
|
+
primaryPrevBtnBg: new FastColor(token.colorTextLightSolid).setA(0.15).toRgbString(),
|
|
166
|
+
primaryNextBtnHoverBg: new FastColor(token.colorBgTextHover).onBackground(token.colorWhite).toRgbString()
|
|
167
167
|
}, getArrowOffsetToken({
|
|
168
168
|
contentRadius: token.borderRadiusLG,
|
|
169
169
|
limitVerticalRadius: true
|
|
@@ -27,7 +27,7 @@ var ListItem = function ListItem(props) {
|
|
|
27
27
|
onClick = props.onClick,
|
|
28
28
|
onRemove = props.onRemove,
|
|
29
29
|
showRemove = props.showRemove;
|
|
30
|
-
var className = classNames("".concat(prefixCls, "-content-item"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-content-item-disabled"), disabled || item.disabled), "".concat(prefixCls, "-content-item-checked"), checked));
|
|
30
|
+
var className = classNames("".concat(prefixCls, "-content-item"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-content-item-disabled"), disabled || item.disabled), "".concat(prefixCls, "-content-item-checked"), checked && !item.disabled));
|
|
31
31
|
var title;
|
|
32
32
|
if (typeof renderedText === 'string' || typeof renderedText === 'number') {
|
|
33
33
|
title = String(renderedText);
|
|
@@ -24,23 +24,27 @@ var useData = function useData(dataSource, rowKey, targetKeys) {
|
|
|
24
24
|
});
|
|
25
25
|
}, [dataSource, rowKey]);
|
|
26
26
|
var _React$useMemo = React.useMemo(function () {
|
|
27
|
+
var _targetKeys$length;
|
|
27
28
|
var leftData = [];
|
|
28
|
-
var rightData =
|
|
29
|
+
var rightData = Array.from({
|
|
30
|
+
length: (_targetKeys$length = targetKeys === null || targetKeys === void 0 ? void 0 : targetKeys.length) !== null && _targetKeys$length !== void 0 ? _targetKeys$length : 0
|
|
31
|
+
});
|
|
29
32
|
var targetKeysMap = groupKeysMap(targetKeys || []);
|
|
30
33
|
mergedDataSource.forEach(function (record) {
|
|
31
34
|
// rightData should be ordered by targetKeys
|
|
32
35
|
// leftData should be ordered by dataSource
|
|
33
36
|
if (targetKeysMap.has(record.key)) {
|
|
34
|
-
|
|
37
|
+
var idx = targetKeysMap.get(record.key);
|
|
38
|
+
rightData[idx] = record;
|
|
35
39
|
} else {
|
|
36
40
|
leftData.push(record);
|
|
37
41
|
}
|
|
38
42
|
});
|
|
39
43
|
return [leftData, rightData];
|
|
40
|
-
}, [mergedDataSource, targetKeys
|
|
44
|
+
}, [mergedDataSource, targetKeys]),
|
|
41
45
|
_React$useMemo2 = _slicedToArray(_React$useMemo, 2),
|
|
42
46
|
leftDataSource = _React$useMemo2[0],
|
|
43
47
|
rightDataSource = _React$useMemo2[1];
|
|
44
|
-
return [mergedDataSource, leftDataSource, rightDataSource];
|
|
48
|
+
return [mergedDataSource, leftDataSource.filter(Boolean), rightDataSource.filter(Boolean)];
|
|
45
49
|
};
|
|
46
50
|
export default useData;
|
|
@@ -20,13 +20,13 @@ function filterKeys(keys, dataKeys) {
|
|
|
20
20
|
function flattenKeys(keys) {
|
|
21
21
|
return Array.from(keys).join(';');
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
function useSelection(leftDataSource, rightDataSource, selectedKeys) {
|
|
24
24
|
// Prepare `dataSource` keys
|
|
25
25
|
var _React$useMemo = React.useMemo(function () {
|
|
26
26
|
return [new Set(leftDataSource.map(function (src) {
|
|
27
|
-
return src.key;
|
|
27
|
+
return src === null || src === void 0 ? void 0 : src.key;
|
|
28
28
|
})), new Set(rightDataSource.map(function (src) {
|
|
29
|
-
return src.key;
|
|
29
|
+
return src === null || src === void 0 ? void 0 : src.key;
|
|
30
30
|
}))];
|
|
31
31
|
}, [leftDataSource, rightDataSource]),
|
|
32
32
|
_React$useMemo2 = _slicedToArray(_React$useMemo, 2),
|
|
@@ -61,4 +61,5 @@ export default function useSelection(leftDataSource, rightDataSource, selectedKe
|
|
|
61
61
|
sourceSelectedKeys, targetSelectedKeys,
|
|
62
62
|
// Updater
|
|
63
63
|
setSourceSelectedKeys, setTargetSelectedKeys];
|
|
64
|
-
}
|
|
64
|
+
}
|
|
65
|
+
export default useSelection;
|
|
@@ -276,8 +276,12 @@ var Transfer = function Transfer(props) {
|
|
|
276
276
|
};
|
|
277
277
|
var mergedStatus = getMergedStatus(status, customStatus);
|
|
278
278
|
var mergedPagination = !children && pagination;
|
|
279
|
-
var leftActive =
|
|
280
|
-
|
|
279
|
+
var leftActive = rightDataSource.filter(function (d) {
|
|
280
|
+
return targetSelectedKeys.includes(d.key) && !d.disabled;
|
|
281
|
+
}).length > 0;
|
|
282
|
+
var rightActive = leftDataSource.filter(function (d) {
|
|
283
|
+
return sourceSelectedKeys.includes(d.key) && !d.disabled;
|
|
284
|
+
}).length > 0;
|
|
281
285
|
var cls = classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-customize-list"), !!children), "".concat(prefixCls, "-rtl"), dir === 'rtl'), getStatusClassNames(prefixCls, mergedStatus, hasFeedback), transfer === null || transfer === void 0 ? void 0 : transfer.className, className, rootClassName, hashId, cssVarCls);
|
|
282
286
|
var _useLocale = useLocale('Transfer', defaultLocale.Transfer),
|
|
283
287
|
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function 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; }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
1
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
8
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
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); }
|
|
12
|
+
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); }
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import React, { useMemo, useRef, useState } from 'react';
|
|
15
15
|
import DownOutlined from '@ant-design/icons/DownOutlined';
|
|
@@ -36,6 +36,17 @@ function getEnabledItemKeys(items) {
|
|
|
36
36
|
var isValidIcon = function isValidIcon(icon) {
|
|
37
37
|
return icon !== undefined;
|
|
38
38
|
};
|
|
39
|
+
var getShowSearchOption = function getShowSearchOption(showSearch) {
|
|
40
|
+
if (showSearch && _typeof(showSearch) === 'object') {
|
|
41
|
+
return _objectSpread(_objectSpread({}, showSearch), {}, {
|
|
42
|
+
defaultValue: showSearch.defaultValue || ''
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
defaultValue: '',
|
|
47
|
+
placeholder: ''
|
|
48
|
+
};
|
|
49
|
+
};
|
|
39
50
|
var TransferList = function TransferList(props) {
|
|
40
51
|
var prefixCls = props.prefixCls,
|
|
41
52
|
_props$dataSource = props.dataSource,
|
|
@@ -73,7 +84,8 @@ var TransferList = function TransferList(props) {
|
|
|
73
84
|
filterOption = props.filterOption,
|
|
74
85
|
_props$render = props.render,
|
|
75
86
|
render = _props$render === void 0 ? defaultRender : _props$render;
|
|
76
|
-
var
|
|
87
|
+
var searchOptions = getShowSearchOption(showSearch);
|
|
88
|
+
var _useState = useState(searchOptions.defaultValue),
|
|
77
89
|
_useState2 = _slicedToArray(_useState, 2),
|
|
78
90
|
filterValue = _useState2[0],
|
|
79
91
|
setFilterValue = _useState2[1];
|
|
@@ -138,8 +150,13 @@ var TransferList = function TransferList(props) {
|
|
|
138
150
|
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
139
151
|
filteredItems = _useMemo2[0],
|
|
140
152
|
filteredRenderItems = _useMemo2[1];
|
|
153
|
+
var checkedActiveItems = useMemo(function () {
|
|
154
|
+
return filteredItems.filter(function (item) {
|
|
155
|
+
return checkedKeys.includes(item.key) && !item.disabled;
|
|
156
|
+
});
|
|
157
|
+
}, [checkedKeys, filteredItems]);
|
|
141
158
|
var checkStatus = useMemo(function () {
|
|
142
|
-
if (
|
|
159
|
+
if (checkedActiveItems.length === 0) {
|
|
143
160
|
return 'none';
|
|
144
161
|
}
|
|
145
162
|
var checkedKeysMap = groupKeysMap(checkedKeys);
|
|
@@ -149,7 +166,7 @@ var TransferList = function TransferList(props) {
|
|
|
149
166
|
return 'all';
|
|
150
167
|
}
|
|
151
168
|
return 'part';
|
|
152
|
-
}, [checkedKeys,
|
|
169
|
+
}, [checkedKeys, checkedActiveItems]);
|
|
153
170
|
var listBody = useMemo(function () {
|
|
154
171
|
var search = showSearch ? _jsx("div", {
|
|
155
172
|
className: "".concat(prefixCls, "-body-search-wrapper"),
|
|
@@ -157,7 +174,7 @@ var TransferList = function TransferList(props) {
|
|
|
157
174
|
prefixCls: "".concat(prefixCls, "-search"),
|
|
158
175
|
onChange: internalHandleFilter,
|
|
159
176
|
handleClear: internalHandleClear,
|
|
160
|
-
placeholder: searchPlaceholder,
|
|
177
|
+
placeholder: searchOptions.placeholder || searchPlaceholder,
|
|
161
178
|
value: filterValue,
|
|
162
179
|
disabled: disabled
|
|
163
180
|
})
|
|
@@ -183,12 +200,14 @@ var TransferList = function TransferList(props) {
|
|
|
183
200
|
});
|
|
184
201
|
}
|
|
185
202
|
return _jsxs("div", {
|
|
186
|
-
className: classNames(
|
|
203
|
+
className: classNames("".concat(prefixCls, "-body"), _defineProperty({}, "".concat(prefixCls, "-body-with-search"), showSearch)),
|
|
187
204
|
children: [search, bodyNode]
|
|
188
205
|
});
|
|
189
206
|
}, [showSearch, prefixCls, searchPlaceholder, filterValue, disabled, checkedKeys, filteredItems, filteredRenderItems, notFoundContentEle]);
|
|
190
207
|
var checkBox = _jsx(Checkbox, {
|
|
191
|
-
disabled: dataSource.
|
|
208
|
+
disabled: dataSource.filter(function (d) {
|
|
209
|
+
return !d.disabled;
|
|
210
|
+
}).length === 0 || disabled,
|
|
192
211
|
checked: checkStatus === 'all',
|
|
193
212
|
indeterminate: checkStatus === 'part',
|
|
194
213
|
className: "".concat(prefixCls, "-checkbox"),
|
|
@@ -302,7 +321,7 @@ var TransferList = function TransferList(props) {
|
|
|
302
321
|
children: [checkAllCheckbox, dropdown]
|
|
303
322
|
}) : null, _jsx("span", {
|
|
304
323
|
className: "".concat(prefixCls, "-header-selected"),
|
|
305
|
-
children: getSelectAllLabel(
|
|
324
|
+
children: getSelectAllLabel(checkedActiveItems.length, filteredItems.length)
|
|
306
325
|
}), _jsx("span", {
|
|
307
326
|
className: "".concat(prefixCls, "-header-title"),
|
|
308
327
|
children: titleText
|
|
@@ -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 Search = function Search(props) {
|
|
6
6
|
var _props$placeholder = props.placeholder,
|
|
7
7
|
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|