@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
package/lib/Antd5/image/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var _excluded = ["prefixCls", "preview", "className", "rootClassName", "style"],
|
|
2
|
-
_excluded2 = ["getContainer", "closeIcon", "rootClassName"];
|
|
2
|
+
_excluded2 = ["getContainer", "closeIcon", "rootClassName", "destroyOnClose", "destroyOnHidden"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _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); }
|
|
9
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
10
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."); }
|
|
11
10
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
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; }
|
|
13
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; } }
|
|
14
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
+
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); }
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -21,28 +21,34 @@ import classNames from 'classnames';
|
|
|
21
21
|
import RcImage from 'rc-image';
|
|
22
22
|
import { useZIndex } from '../_util/hooks/useZIndex';
|
|
23
23
|
import { getTransitionName } from '../_util/motion';
|
|
24
|
-
import {
|
|
24
|
+
import { devUseWarning } from '../_util/warning';
|
|
25
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
25
26
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
26
|
-
import
|
|
27
|
+
import { useLocale } from '../locale';
|
|
27
28
|
import PreviewGroup, { icons } from './PreviewGroup';
|
|
28
29
|
import useStyle from './style';
|
|
29
30
|
var Image = function Image(props) {
|
|
30
|
-
var _image$preview2;
|
|
31
31
|
var customizePrefixCls = props.prefixCls,
|
|
32
32
|
preview = props.preview,
|
|
33
33
|
className = props.className,
|
|
34
34
|
rootClassName = props.rootClassName,
|
|
35
35
|
style = props.style,
|
|
36
36
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
+
var warning = devUseWarning('Image');
|
|
39
|
+
warning.deprecated(!(preview && _typeof(preview) === 'object' && 'destroyOnClose' in preview), 'destroyOnClose', 'destroyOnHidden');
|
|
40
|
+
}
|
|
41
|
+
var _useComponentConfig = useComponentConfig('image'),
|
|
42
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
43
|
+
getContextPopupContainer = _useComponentConfig.getPopupContainer,
|
|
44
|
+
contextClassName = _useComponentConfig.className,
|
|
45
|
+
contextStyle = _useComponentConfig.style,
|
|
46
|
+
contextPreview = _useComponentConfig.preview;
|
|
47
|
+
var _useLocale = useLocale('Image'),
|
|
48
|
+
_useLocale2 = _slicedToArray(_useLocale, 1),
|
|
49
|
+
imageLocale = _useLocale2[0];
|
|
43
50
|
var prefixCls = getPrefixCls('image', customizePrefixCls);
|
|
44
51
|
var rootPrefixCls = getPrefixCls();
|
|
45
|
-
var imageLocale = contextLocale.Image || defaultLocale.Image;
|
|
46
52
|
// Style
|
|
47
53
|
var rootCls = useCSSVarCls(prefixCls);
|
|
48
54
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
@@ -51,12 +57,11 @@ var Image = function Image(props) {
|
|
|
51
57
|
hashId = _useStyle2[1],
|
|
52
58
|
cssVarCls = _useStyle2[2];
|
|
53
59
|
var mergedRootClassName = classNames(rootClassName, hashId, cssVarCls, rootCls);
|
|
54
|
-
var mergedClassName = classNames(className, hashId,
|
|
60
|
+
var mergedClassName = classNames(className, hashId, contextClassName);
|
|
55
61
|
var _useZIndex = useZIndex('ImagePreview', _typeof(preview) === 'object' ? preview.zIndex : undefined),
|
|
56
62
|
_useZIndex2 = _slicedToArray(_useZIndex, 1),
|
|
57
63
|
zIndex = _useZIndex2[0];
|
|
58
64
|
var mergedPreview = React.useMemo(function () {
|
|
59
|
-
var _image$preview;
|
|
60
65
|
if (preview === false) {
|
|
61
66
|
return preview;
|
|
62
67
|
}
|
|
@@ -64,6 +69,8 @@ var Image = function Image(props) {
|
|
|
64
69
|
var getContainer = _preview.getContainer,
|
|
65
70
|
closeIcon = _preview.closeIcon,
|
|
66
71
|
rootClassName = _preview.rootClassName,
|
|
72
|
+
destroyOnClose = _preview.destroyOnClose,
|
|
73
|
+
destroyOnHidden = _preview.destroyOnHidden,
|
|
67
74
|
restPreviewProps = _objectWithoutProperties(_preview, _excluded2);
|
|
68
75
|
return _objectSpread(_objectSpread({
|
|
69
76
|
mask: _jsxs("div", {
|
|
@@ -72,15 +79,17 @@ var Image = function Image(props) {
|
|
|
72
79
|
}),
|
|
73
80
|
icons: icons
|
|
74
81
|
}, restPreviewProps), {}, {
|
|
82
|
+
// TODO: In the future, destroyOnClose in rc-image needs to be upgrade to destroyOnHidden
|
|
83
|
+
destroyOnClose: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyOnClose,
|
|
75
84
|
rootClassName: classNames(mergedRootClassName, rootClassName),
|
|
76
85
|
getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : getContextPopupContainer,
|
|
77
86
|
transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),
|
|
78
87
|
maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName),
|
|
79
88
|
zIndex: zIndex,
|
|
80
|
-
closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon :
|
|
89
|
+
closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : contextPreview === null || contextPreview === void 0 ? void 0 : contextPreview.closeIcon
|
|
81
90
|
});
|
|
82
|
-
}, [preview, imageLocale,
|
|
83
|
-
var mergedStyle = _objectSpread(_objectSpread({},
|
|
91
|
+
}, [preview, imageLocale, contextPreview === null || contextPreview === void 0 ? void 0 : contextPreview.closeIcon]);
|
|
92
|
+
var mergedStyle = _objectSpread(_objectSpread({}, contextStyle), style);
|
|
84
93
|
return wrapCSSVar(_jsx(RcImage, _objectSpread({
|
|
85
94
|
prefixCls: prefixCls,
|
|
86
95
|
preview: mergedPreview,
|
|
@@ -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 { genModalMaskStyle } from '../../modal/style';
|
|
10
10
|
import { textEllipsis } from '../../style';
|
|
11
11
|
import { initFadeMotion, initZoomMotion } from '../../style/motion';
|
|
@@ -30,7 +30,7 @@ export var genImageMaskStyle = function genImageMaskStyle(token) {
|
|
|
30
30
|
alignItems: 'center',
|
|
31
31
|
justifyContent: 'center',
|
|
32
32
|
color: colorTextLightSolid,
|
|
33
|
-
background: new
|
|
33
|
+
background: new FastColor('#000').setA(0.5).toRgbString(),
|
|
34
34
|
cursor: 'pointer',
|
|
35
35
|
opacity: 0,
|
|
36
36
|
transition: "opacity ".concat(motionDurationSlow)
|
|
@@ -55,8 +55,8 @@ export var genPreviewOperationsStyle = function genPreviewOperationsStyle(token)
|
|
|
55
55
|
motionDurationSlow = token.motionDurationSlow,
|
|
56
56
|
iconCls = token.iconCls,
|
|
57
57
|
colorTextLightSolid = token.colorTextLightSolid;
|
|
58
|
-
var operationBg = new
|
|
59
|
-
var operationBgHover = operationBg.clone().
|
|
58
|
+
var operationBg = new FastColor(modalMaskBg).setA(0.1);
|
|
59
|
+
var operationBgHover = operationBg.clone().setA(0.2);
|
|
60
60
|
return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(previewCls, "-footer"), {
|
|
61
61
|
position: 'fixed',
|
|
62
62
|
bottom: marginXL,
|
|
@@ -123,8 +123,8 @@ export var genPreviewSwitchStyle = function genPreviewSwitchStyle(token) {
|
|
|
123
123
|
previewCls = token.previewCls,
|
|
124
124
|
zIndexPopup = token.zIndexPopup,
|
|
125
125
|
motionDurationSlow = token.motionDurationSlow;
|
|
126
|
-
var operationBg = new
|
|
127
|
-
var operationBgHover = operationBg.clone().
|
|
126
|
+
var operationBg = new FastColor(modalMaskBg).setA(0.1);
|
|
127
|
+
var operationBgHover = operationBg.clone().setA(0.2);
|
|
128
128
|
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(previewCls, "-switch-left, ").concat(previewCls, "-switch-right"), _defineProperty({
|
|
129
129
|
position: 'fixed',
|
|
130
130
|
insetBlockStart: '50%',
|
|
@@ -241,9 +241,9 @@ var genPreviewMotion = function genPreviewMotion(token) {
|
|
|
241
241
|
export var prepareComponentToken = function prepareComponentToken(token) {
|
|
242
242
|
return {
|
|
243
243
|
zIndexPopup: token.zIndexPopupBase + 80,
|
|
244
|
-
previewOperationColor: new
|
|
245
|
-
previewOperationHoverColor: new
|
|
246
|
-
previewOperationColorDisabled: new
|
|
244
|
+
previewOperationColor: new FastColor(token.colorTextLightSolid).setA(0.65).toRgbString(),
|
|
245
|
+
previewOperationHoverColor: new FastColor(token.colorTextLightSolid).setA(0.85).toRgbString(),
|
|
246
|
+
previewOperationColorDisabled: new FastColor(token.colorTextLightSolid).setA(0.25).toRgbString(),
|
|
247
247
|
previewOperationSize: token.fontSizeIcon * 1.5 // FIXME: fontSizeIconLG
|
|
248
248
|
};
|
|
249
249
|
};
|
|
@@ -251,7 +251,7 @@ export default genStyleHooks('Image', function (token) {
|
|
|
251
251
|
var previewCls = "".concat(token.componentCls, "-preview");
|
|
252
252
|
var imageToken = mergeToken(token, {
|
|
253
253
|
previewCls: previewCls,
|
|
254
|
-
modalMaskBg: new
|
|
254
|
+
modalMaskBg: new FastColor('#000').setA(0.45).toRgbString(),
|
|
255
255
|
// FIXME: Shared Token
|
|
256
256
|
imagePreviewSwitchSize: token.controlHeightLG
|
|
257
257
|
});
|
package/lib/Antd5/index.js
CHANGED
|
@@ -70,4 +70,6 @@ export { default as Typography } from './typography';
|
|
|
70
70
|
export { default as Upload } from './upload';
|
|
71
71
|
export { default as version } from './version';
|
|
72
72
|
export { default as Watermark } from './watermark';
|
|
73
|
-
export { default as Splitter } from './splitter';
|
|
73
|
+
export { default as Splitter } from './splitter';
|
|
74
|
+
// TODO: Remove in v6
|
|
75
|
+
export { unstableSetRender } from './config-provider/UnstableContext';
|
package/lib/Antd5/input/Group.js
CHANGED
|
@@ -18,6 +18,7 @@ import { devUseWarning } from '../_util/warning';
|
|
|
18
18
|
import { ConfigContext } from '../config-provider';
|
|
19
19
|
import { FormItemInputContext } from '../form/context';
|
|
20
20
|
import useStyle from './style';
|
|
21
|
+
/** @deprecated Please use `Space.Compact` */
|
|
21
22
|
var Group = function Group(props) {
|
|
22
23
|
var _useContext = useContext(ConfigContext),
|
|
23
24
|
getPrefixCls = _useContext.getPrefixCls,
|
|
@@ -27,10 +28,11 @@ var Group = function Group(props) {
|
|
|
27
28
|
var prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
28
29
|
var inputPrefixCls = getPrefixCls('input');
|
|
29
30
|
var _useStyle = useStyle(inputPrefixCls),
|
|
30
|
-
_useStyle2 = _slicedToArray(_useStyle,
|
|
31
|
+
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
31
32
|
wrapCSSVar = _useStyle2[0],
|
|
32
|
-
hashId = _useStyle2[1]
|
|
33
|
-
|
|
33
|
+
hashId = _useStyle2[1],
|
|
34
|
+
cssVarCls = _useStyle2[2];
|
|
35
|
+
var cls = classNames(prefixCls, cssVarCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-lg"), props.size === 'large'), "".concat(prefixCls, "-sm"), props.size === 'small'), "".concat(prefixCls, "-compact"), props.compact), "".concat(prefixCls, "-rtl"), direction === 'rtl'), hashId, className);
|
|
34
36
|
var formItemContext = useContext(FormItemInputContext);
|
|
35
37
|
var groupFormItemContext = useMemo(function () {
|
|
36
38
|
return _objectSpread(_objectSpread({}, formItemContext), {}, {
|
package/lib/Antd5/input/Input.js
CHANGED
|
@@ -23,7 +23,7 @@ import ContextIsolator from '../_util/ContextIsolator';
|
|
|
23
23
|
import getAllowClear from '../_util/getAllowClear';
|
|
24
24
|
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
|
25
25
|
import { devUseWarning } from '../_util/warning';
|
|
26
|
-
import {
|
|
26
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
27
27
|
import DisabledContext from '../config-provider/DisabledContext';
|
|
28
28
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
29
29
|
import useSize from '../config-provider/hooks/useSize';
|
|
@@ -31,11 +31,10 @@ import { FormItemInputContext } from '../form/context';
|
|
|
31
31
|
import useVariant from '../form/hooks/useVariants';
|
|
32
32
|
import { useCompactItemContext } from '../space/Compact';
|
|
33
33
|
import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';
|
|
34
|
-
import useStyle from './style';
|
|
34
|
+
import useStyle, { useSharedStyle } from './style';
|
|
35
35
|
import { hasPrefixSuffix } from './utils';
|
|
36
36
|
export { triggerFocus };
|
|
37
37
|
var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
38
|
-
var _input$classNames;
|
|
39
38
|
var customizePrefixCls = props.prefixCls,
|
|
40
39
|
_props$bordered = props.bordered,
|
|
41
40
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
@@ -61,19 +60,27 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
61
60
|
deprecated = _devUseWarning.deprecated;
|
|
62
61
|
deprecated(!('bordered' in props), 'bordered', 'variant');
|
|
63
62
|
}
|
|
64
|
-
var
|
|
65
|
-
getPrefixCls =
|
|
66
|
-
direction =
|
|
67
|
-
|
|
63
|
+
var _useComponentConfig = useComponentConfig('input'),
|
|
64
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
65
|
+
direction = _useComponentConfig.direction,
|
|
66
|
+
contextAllowClear = _useComponentConfig.allowClear,
|
|
67
|
+
contextAutoComplete = _useComponentConfig.autoComplete,
|
|
68
|
+
contextClassName = _useComponentConfig.className,
|
|
69
|
+
contextStyle = _useComponentConfig.style,
|
|
70
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
71
|
+
contextStyles = _useComponentConfig.styles;
|
|
68
72
|
var prefixCls = getPrefixCls('input', customizePrefixCls);
|
|
69
73
|
var inputRef = useRef(null);
|
|
70
74
|
// Style
|
|
71
75
|
var rootCls = useCSSVarCls(prefixCls);
|
|
76
|
+
var _useSharedStyle = useSharedStyle(prefixCls, rootClassName),
|
|
77
|
+
_useSharedStyle2 = _slicedToArray(_useSharedStyle, 3),
|
|
78
|
+
wrapSharedCSSVar = _useSharedStyle2[0],
|
|
79
|
+
hashId = _useSharedStyle2[1],
|
|
80
|
+
cssVarCls = _useSharedStyle2[2];
|
|
72
81
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
73
|
-
_useStyle2 = _slicedToArray(_useStyle,
|
|
74
|
-
wrapCSSVar = _useStyle2[0]
|
|
75
|
-
hashId = _useStyle2[1],
|
|
76
|
-
cssVarCls = _useStyle2[2];
|
|
82
|
+
_useStyle2 = _slicedToArray(_useStyle, 1),
|
|
83
|
+
wrapCSSVar = _useStyle2[0];
|
|
77
84
|
// ===================== Compact Item =====================
|
|
78
85
|
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
79
86
|
compactSize = _useCompactItemContex.compactSize,
|
|
@@ -124,24 +131,24 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
124
131
|
var suffixNode = (hasFeedback || suffix) && _jsxs(_Fragment, {
|
|
125
132
|
children: [suffix, hasFeedback && feedbackIcon]
|
|
126
133
|
});
|
|
127
|
-
var mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear :
|
|
134
|
+
var mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
|
|
128
135
|
var _useVariant = useVariant('input', customVariant, bordered),
|
|
129
136
|
_useVariant2 = _slicedToArray(_useVariant, 2),
|
|
130
137
|
variant = _useVariant2[0],
|
|
131
138
|
enableVariantCls = _useVariant2[1];
|
|
132
|
-
return wrapCSSVar(_jsx(RcInput, _objectSpread(_objectSpread({
|
|
139
|
+
return wrapSharedCSSVar(wrapCSSVar(_jsx(RcInput, _objectSpread(_objectSpread({
|
|
133
140
|
ref: composeRef(ref, inputRef),
|
|
134
141
|
prefixCls: prefixCls,
|
|
135
|
-
autoComplete:
|
|
142
|
+
autoComplete: contextAutoComplete
|
|
136
143
|
}, rest), {}, {
|
|
137
144
|
disabled: mergedDisabled,
|
|
138
145
|
onBlur: handleBlur,
|
|
139
146
|
onFocus: handleFocus,
|
|
140
|
-
style: _objectSpread(_objectSpread({},
|
|
141
|
-
styles: _objectSpread(_objectSpread({},
|
|
147
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style),
|
|
148
|
+
styles: _objectSpread(_objectSpread({}, contextStyles), styles),
|
|
142
149
|
suffix: suffixNode,
|
|
143
150
|
allowClear: mergedAllowClear,
|
|
144
|
-
className: classNames(className, rootClassName, cssVarCls, rootCls, compactItemClassnames,
|
|
151
|
+
className: classNames(className, rootClassName, cssVarCls, rootCls, compactItemClassnames, contextClassName),
|
|
145
152
|
onChange: handleChange,
|
|
146
153
|
addonBefore: addonBefore && _jsx(ContextIsolator, {
|
|
147
154
|
form: true,
|
|
@@ -153,14 +160,14 @@ var Input = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
153
160
|
space: true,
|
|
154
161
|
children: addonAfter
|
|
155
162
|
}),
|
|
156
|
-
classNames: _objectSpread(_objectSpread(_objectSpread({}, classes),
|
|
157
|
-
input: classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-rtl"), direction === 'rtl'), classes === null || classes === void 0 ? void 0 : classes.input,
|
|
163
|
+
classNames: _objectSpread(_objectSpread(_objectSpread({}, classes), contextClassNames), {}, {
|
|
164
|
+
input: classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-rtl"), direction === 'rtl'), classes === null || classes === void 0 ? void 0 : classes.input, contextClassNames.input, hashId),
|
|
158
165
|
variant: classNames(_defineProperty({}, "".concat(prefixCls, "-").concat(variant), enableVariantCls), getStatusClassNames(prefixCls, mergedStatus)),
|
|
159
166
|
affixWrapper: classNames(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-affix-wrapper-rtl"), direction === 'rtl'), hashId),
|
|
160
167
|
wrapper: classNames(_defineProperty({}, "".concat(prefixCls, "-group-rtl"), direction === 'rtl'), hashId),
|
|
161
168
|
groupWrapper: classNames(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-group-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-group-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-group-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-group-wrapper-").concat(variant), enableVariantCls), getStatusClassNames("".concat(prefixCls, "-group-wrapper"), mergedStatus, hasFeedback), hashId)
|
|
162
169
|
})
|
|
163
|
-
})));
|
|
170
|
+
}))));
|
|
164
171
|
});
|
|
165
172
|
if (process.env.NODE_ENV !== 'production') {
|
|
166
173
|
Input.displayName = 'Input';
|
|
@@ -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 = ["value", "onChange", "onActiveChange", "index", "mask"];
|
|
2
|
+
var _excluded = ["className", "value", "onChange", "onActiveChange", "index", "mask"];
|
|
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; }
|
|
@@ -7,26 +7,33 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import * as React from 'react';
|
|
12
|
+
import classNames from 'classnames';
|
|
12
13
|
import raf from 'rc-util/lib/raf';
|
|
14
|
+
import { ConfigContext } from '../../config-provider';
|
|
13
15
|
import Input from '../Input';
|
|
14
16
|
var OTPInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
|
-
var
|
|
17
|
+
var className = props.className,
|
|
18
|
+
value = props.value,
|
|
16
19
|
onChange = props.onChange,
|
|
17
20
|
onActiveChange = props.onActiveChange,
|
|
18
21
|
index = props.index,
|
|
19
22
|
mask = props.mask,
|
|
20
23
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
25
|
+
getPrefixCls = _React$useContext.getPrefixCls;
|
|
26
|
+
var prefixCls = getPrefixCls('otp');
|
|
27
|
+
var maskValue = typeof mask === 'string' ? mask : value;
|
|
25
28
|
// ========================== Ref ===========================
|
|
26
29
|
var inputRef = React.useRef(null);
|
|
27
30
|
React.useImperativeHandle(ref, function () {
|
|
28
31
|
return inputRef.current;
|
|
29
32
|
});
|
|
33
|
+
// ========================= Input ==========================
|
|
34
|
+
var onInternalChange = function onInternalChange(e) {
|
|
35
|
+
onChange(index, e.target.value);
|
|
36
|
+
};
|
|
30
37
|
// ========================= Focus ==========================
|
|
31
38
|
var syncSelection = function syncSelection() {
|
|
32
39
|
raf(function () {
|
|
@@ -58,17 +65,27 @@ var OTPInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
58
65
|
syncSelection();
|
|
59
66
|
};
|
|
60
67
|
// ========================= Render =========================
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
return _jsxs("span", {
|
|
69
|
+
className: "".concat(prefixCls, "-input-wrapper"),
|
|
70
|
+
role: "presentation",
|
|
71
|
+
children: [mask && value !== '' && value !== undefined && _jsx("span", {
|
|
72
|
+
className: "".concat(prefixCls, "-mask-icon"),
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
children: maskValue
|
|
75
|
+
}), _jsx(Input, _objectSpread(_objectSpread({
|
|
76
|
+
"aria-label": "OTP Input ".concat(index + 1),
|
|
77
|
+
type: mask === true ? 'password' : 'text'
|
|
78
|
+
}, restProps), {}, {
|
|
79
|
+
ref: inputRef,
|
|
80
|
+
value: value,
|
|
81
|
+
onInput: onInternalChange,
|
|
82
|
+
onFocus: syncSelection,
|
|
83
|
+
onKeyDown: onInternalKeyDown,
|
|
84
|
+
onKeyUp: onInternalKeyUp,
|
|
85
|
+
onMouseDown: syncSelection,
|
|
86
|
+
onMouseUp: syncSelection,
|
|
87
|
+
className: classNames(className, _defineProperty({}, "".concat(prefixCls, "-mask-input"), mask))
|
|
88
|
+
}))]
|
|
89
|
+
});
|
|
73
90
|
});
|
|
74
91
|
export default OTPInput;
|
|
@@ -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", "length", "size", "defaultValue", "value", "onChange", "formatter", "variant", "disabled", "status", "autoFocus", "mask", "type", "onInput", "inputMode"];
|
|
2
|
+
var _excluded = ["prefixCls", "length", "size", "defaultValue", "value", "onChange", "formatter", "separator", "variant", "disabled", "status", "autoFocus", "mask", "type", "onInput", "inputMode"];
|
|
3
3
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
4
4
|
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."); }
|
|
5
5
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
@@ -17,7 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
17
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import classNames from 'classnames';
|
|
23
23
|
import useEvent from 'rc-util/lib/hooks/useEvent';
|
|
@@ -25,7 +25,6 @@ import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
|
25
25
|
import { getMergedStatus } from '../../_util/statusUtils';
|
|
26
26
|
import { devUseWarning } from '../../_util/warning';
|
|
27
27
|
import { ConfigContext } from '../../config-provider';
|
|
28
|
-
import useCSSVarCls from '../../config-provider/hooks/useCSSVarCls';
|
|
29
28
|
import useSize from '../../config-provider/hooks/useSize';
|
|
30
29
|
import { FormItemInputContext } from '../../form/context';
|
|
31
30
|
import useStyle from '../style/otp';
|
|
@@ -33,6 +32,19 @@ import OTPInput from './OTPInput';
|
|
|
33
32
|
function strToArr(str) {
|
|
34
33
|
return (str || '').split('');
|
|
35
34
|
}
|
|
35
|
+
var Separator = function Separator(props) {
|
|
36
|
+
var index = props.index,
|
|
37
|
+
prefixCls = props.prefixCls,
|
|
38
|
+
separator = props.separator;
|
|
39
|
+
var separatorNode = typeof separator === 'function' ? separator(index) : separator;
|
|
40
|
+
if (!separatorNode) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return _jsx("span", {
|
|
44
|
+
className: "".concat(prefixCls, "-separator"),
|
|
45
|
+
children: separatorNode
|
|
46
|
+
});
|
|
47
|
+
};
|
|
36
48
|
var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
37
49
|
var customizePrefixCls = props.prefixCls,
|
|
38
50
|
_props$length = props.length,
|
|
@@ -42,6 +54,7 @@ var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
42
54
|
value = props.value,
|
|
43
55
|
onChange = props.onChange,
|
|
44
56
|
formatter = props.formatter,
|
|
57
|
+
separator = props.separator,
|
|
45
58
|
variant = props.variant,
|
|
46
59
|
disabled = props.disabled,
|
|
47
60
|
customStatus = props.status,
|
|
@@ -66,8 +79,7 @@ var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
79
|
});
|
|
67
80
|
// ========================= Root =========================
|
|
68
81
|
// Style
|
|
69
|
-
var
|
|
70
|
-
var _useStyle = useStyle(prefixCls, rootCls),
|
|
82
|
+
var _useStyle = useStyle(prefixCls),
|
|
71
83
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
72
84
|
wrapCSSVar = _useStyle2[0],
|
|
73
85
|
hashId = _useStyle2[1],
|
|
@@ -109,7 +121,9 @@ var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
109
121
|
return formatter ? formatter(txt) : txt;
|
|
110
122
|
};
|
|
111
123
|
// ======================== Values ========================
|
|
112
|
-
var _React$useState = React.useState(
|
|
124
|
+
var _React$useState = React.useState(function () {
|
|
125
|
+
return strToArr(internalFormatter(defaultValue || ''));
|
|
126
|
+
}),
|
|
113
127
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
114
128
|
valueCells = _React$useState2[0],
|
|
115
129
|
setValueCells = _React$useState2[1];
|
|
@@ -191,6 +205,7 @@ var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
191
205
|
return wrapCSSVar(_jsx("div", _objectSpread(_objectSpread({}, domAttrs), {}, {
|
|
192
206
|
ref: containerRef,
|
|
193
207
|
className: classNames(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), "".concat(prefixCls, "-rtl"), direction === 'rtl'), cssVarCls, hashId),
|
|
208
|
+
role: "group",
|
|
194
209
|
children: _jsx(FormItemInputContext.Provider, {
|
|
195
210
|
value: proxyFormContext,
|
|
196
211
|
children: Array.from({
|
|
@@ -198,19 +213,25 @@ var OTP = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
198
213
|
}).map(function (_, index) {
|
|
199
214
|
var key = "otp-".concat(index);
|
|
200
215
|
var singleValue = valueCells[index] || '';
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
216
|
+
return _jsxs(React.Fragment, {
|
|
217
|
+
children: [_jsx(OTPInput, _objectSpread({
|
|
218
|
+
ref: function ref(inputEle) {
|
|
219
|
+
refs.current[index] = inputEle;
|
|
220
|
+
},
|
|
221
|
+
index: index,
|
|
222
|
+
size: mergedSize,
|
|
223
|
+
htmlSize: 1,
|
|
224
|
+
className: "".concat(prefixCls, "-input"),
|
|
225
|
+
onChange: onInputChange,
|
|
226
|
+
value: singleValue,
|
|
227
|
+
onActiveChange: onInputActiveChange,
|
|
228
|
+
autoFocus: index === 0 && autoFocus
|
|
229
|
+
}, inputSharedProps)), index < length - 1 && _jsx(Separator, {
|
|
230
|
+
separator: separator,
|
|
231
|
+
index: index,
|
|
232
|
+
prefixCls: prefixCls
|
|
233
|
+
})]
|
|
234
|
+
}, key);
|
|
214
235
|
})
|
|
215
236
|
})
|
|
216
237
|
})));
|
|
@@ -22,9 +22,9 @@ import classNames from 'classnames';
|
|
|
22
22
|
import omit from 'rc-util/lib/omit';
|
|
23
23
|
import { composeRef } from 'rc-util/lib/ref';
|
|
24
24
|
import { ConfigContext } from '../config-provider';
|
|
25
|
+
import DisabledContext from '../config-provider/DisabledContext';
|
|
25
26
|
import useRemovePasswordTimeout from './hooks/useRemovePasswordTimeout';
|
|
26
27
|
import Input from './Input';
|
|
27
|
-
import DisabledContext from '../config-provider/DisabledContext';
|
|
28
28
|
var defaultIconRender = function defaultIconRender(visible) {
|
|
29
29
|
return visible ? _jsx(EyeOutlined, {}) : _jsx(EyeInvisibleOutlined, {});
|
|
30
30
|
};
|
|
@@ -65,14 +65,12 @@ var Password = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
65
65
|
if (visible) {
|
|
66
66
|
removePasswordTimeout();
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return newState;
|
|
75
|
-
});
|
|
68
|
+
var nextVisible = !visible;
|
|
69
|
+
setVisible(nextVisible);
|
|
70
|
+
if (_typeof(visibilityToggle) === 'object') {
|
|
71
|
+
var _visibilityToggle$onV;
|
|
72
|
+
(_visibilityToggle$onV = visibilityToggle.onVisibleChange) === null || _visibilityToggle$onV === void 0 || _visibilityToggle$onV.call(visibilityToggle, nextVisible);
|
|
73
|
+
}
|
|
76
74
|
};
|
|
77
75
|
var getIcon = function getIcon(prefixCls) {
|
|
78
76
|
var iconTrigger = actionMap[action] || '';
|
|
@@ -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", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"];
|
|
2
|
+
var _excluded = ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd", "variant", "onPressEnter"];
|
|
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; }
|
|
@@ -33,6 +33,8 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
33
33
|
customOnChange = props.onChange,
|
|
34
34
|
onCompositionStart = props.onCompositionStart,
|
|
35
35
|
onCompositionEnd = props.onCompositionEnd,
|
|
36
|
+
variant = props.variant,
|
|
37
|
+
customOnPressEnter = props.onPressEnter,
|
|
36
38
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
37
39
|
var _React$useContext = React.useContext(ConfigContext),
|
|
38
40
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -73,6 +75,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
73
75
|
if (composedRef.current || loading) {
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
78
|
+
customOnPressEnter === null || customOnPressEnter === void 0 || customOnPressEnter(e);
|
|
76
79
|
onSearch(e);
|
|
77
80
|
};
|
|
78
81
|
var searchIcon = typeof enterButton === 'boolean' ? _jsx(SearchOutlined, {}) : null;
|
|
@@ -96,13 +99,14 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
96
99
|
} else {
|
|
97
100
|
button = _jsx(Button, {
|
|
98
101
|
className: btnClassName,
|
|
99
|
-
|
|
102
|
+
color: enterButton ? 'primary' : 'default',
|
|
100
103
|
size: size,
|
|
101
104
|
disabled: disabled,
|
|
102
105
|
onMouseDown: onMouseDown,
|
|
103
106
|
onClick: onSearch,
|
|
104
107
|
loading: loading,
|
|
105
108
|
icon: searchIcon,
|
|
109
|
+
variant: variant === 'borderless' || variant === 'filled' || variant === 'underlined' ? 'text' : enterButton ? 'solid' : undefined,
|
|
106
110
|
children: enterButton
|
|
107
111
|
}, "enterButton");
|
|
108
112
|
}
|
|
@@ -120,20 +124,23 @@ var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
120
124
|
composedRef.current = false;
|
|
121
125
|
onCompositionEnd === null || onCompositionEnd === void 0 || onCompositionEnd(e);
|
|
122
126
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
var inputProps = _objectSpread(_objectSpread({}, restProps), {}, {
|
|
128
|
+
className: cls,
|
|
129
|
+
prefixCls: inputPrefixCls,
|
|
130
|
+
type: 'search',
|
|
127
131
|
size: size,
|
|
132
|
+
variant: variant,
|
|
133
|
+
onPressEnter: onPressEnter,
|
|
128
134
|
onCompositionStart: handleOnCompositionStart,
|
|
129
135
|
onCompositionEnd: handleOnCompositionEnd,
|
|
130
|
-
prefixCls: inputPrefixCls,
|
|
131
136
|
addonAfter: button,
|
|
132
137
|
suffix: suffix,
|
|
133
138
|
onChange: onChange,
|
|
134
|
-
className: cls,
|
|
135
139
|
disabled: disabled
|
|
136
|
-
})
|
|
140
|
+
});
|
|
141
|
+
return _jsx(Input, _objectSpread({
|
|
142
|
+
ref: composeRef(inputRef, ref)
|
|
143
|
+
}, inputProps));
|
|
137
144
|
});
|
|
138
145
|
if (process.env.NODE_ENV !== 'production') {
|
|
139
146
|
Search.displayName = 'Search';
|