@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,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", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant"];
|
|
2
|
+
var _excluded = ["prefixCls", "bordered", "size", "disabled", "status", "allowClear", "classNames", "rootClassName", "className", "style", "styles", "variant", "showCount", "onMouseDown", "onResize"];
|
|
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; }
|
|
@@ -21,16 +21,18 @@ import RcTextArea from 'rc-textarea';
|
|
|
21
21
|
import getAllowClear from '../_util/getAllowClear';
|
|
22
22
|
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
|
|
23
23
|
import { devUseWarning } from '../_util/warning';
|
|
24
|
-
import {
|
|
24
|
+
import { useComponentConfig } from '../config-provider/context';
|
|
25
25
|
import DisabledContext from '../config-provider/DisabledContext';
|
|
26
26
|
import useCSSVarCls from '../config-provider/hooks/useCSSVarCls';
|
|
27
27
|
import useSize from '../config-provider/hooks/useSize';
|
|
28
28
|
import { FormItemInputContext } from '../form/context';
|
|
29
29
|
import useVariant from '../form/hooks/useVariants';
|
|
30
|
+
import { useCompactItemContext } from '../space/Compact';
|
|
30
31
|
import { triggerFocus } from './Input';
|
|
31
|
-
import
|
|
32
|
+
import { useSharedStyle } from './style';
|
|
33
|
+
import useStyle from './style/textarea';
|
|
32
34
|
var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
|
-
var
|
|
35
|
+
var _props$count;
|
|
34
36
|
var customizePrefixCls = props.prefixCls,
|
|
35
37
|
_props$bordered = props.bordered,
|
|
36
38
|
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
@@ -44,28 +46,34 @@ var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
44
46
|
style = props.style,
|
|
45
47
|
styles = props.styles,
|
|
46
48
|
customVariant = props.variant,
|
|
49
|
+
showCount = props.showCount,
|
|
50
|
+
onMouseDown = props.onMouseDown,
|
|
51
|
+
onResize = props.onResize,
|
|
47
52
|
rest = _objectWithoutProperties(props, _excluded);
|
|
48
53
|
if (process.env.NODE_ENV !== 'production') {
|
|
49
54
|
var _devUseWarning = devUseWarning('TextArea'),
|
|
50
55
|
deprecated = _devUseWarning.deprecated;
|
|
51
56
|
deprecated(!('bordered' in props), 'bordered', 'variant');
|
|
52
57
|
}
|
|
53
|
-
var
|
|
54
|
-
getPrefixCls =
|
|
55
|
-
direction =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
var _useComponentConfig = useComponentConfig('textArea'),
|
|
59
|
+
getPrefixCls = _useComponentConfig.getPrefixCls,
|
|
60
|
+
direction = _useComponentConfig.direction,
|
|
61
|
+
contextAllowClear = _useComponentConfig.allowClear,
|
|
62
|
+
contextAutoComplete = _useComponentConfig.autoComplete,
|
|
63
|
+
contextClassName = _useComponentConfig.className,
|
|
64
|
+
contextStyle = _useComponentConfig.style,
|
|
65
|
+
contextClassNames = _useComponentConfig.classNames,
|
|
66
|
+
contextStyles = _useComponentConfig.styles;
|
|
67
|
+
// =================== Disabled ===================
|
|
60
68
|
var disabled = React.useContext(DisabledContext);
|
|
61
69
|
var mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
62
|
-
//
|
|
63
|
-
var _React$
|
|
64
|
-
contextStatus = _React$
|
|
65
|
-
hasFeedback = _React$
|
|
66
|
-
feedbackIcon = _React$
|
|
70
|
+
// ==================== Status ====================
|
|
71
|
+
var _React$useContext = React.useContext(FormItemInputContext),
|
|
72
|
+
contextStatus = _React$useContext.status,
|
|
73
|
+
hasFeedback = _React$useContext.hasFeedback,
|
|
74
|
+
feedbackIcon = _React$useContext.feedbackIcon;
|
|
67
75
|
var mergedStatus = getMergedStatus(contextStatus, customStatus);
|
|
68
|
-
// ===================== Ref
|
|
76
|
+
// ===================== Ref ======================
|
|
69
77
|
var innerRef = React.useRef(null);
|
|
70
78
|
React.useImperativeHandle(ref, function () {
|
|
71
79
|
var _innerRef$current;
|
|
@@ -82,37 +90,86 @@ var TextArea = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
82
90
|
};
|
|
83
91
|
});
|
|
84
92
|
var prefixCls = getPrefixCls('input', customizePrefixCls);
|
|
85
|
-
//
|
|
93
|
+
// ==================== Style =====================
|
|
86
94
|
var rootCls = useCSSVarCls(prefixCls);
|
|
95
|
+
var _useSharedStyle = useSharedStyle(prefixCls, rootClassName),
|
|
96
|
+
_useSharedStyle2 = _slicedToArray(_useSharedStyle, 3),
|
|
97
|
+
wrapSharedCSSVar = _useSharedStyle2[0],
|
|
98
|
+
hashId = _useSharedStyle2[1],
|
|
99
|
+
cssVarCls = _useSharedStyle2[2];
|
|
87
100
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
88
|
-
_useStyle2 = _slicedToArray(_useStyle,
|
|
89
|
-
wrapCSSVar = _useStyle2[0]
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
_useStyle2 = _slicedToArray(_useStyle, 1),
|
|
102
|
+
wrapCSSVar = _useStyle2[0];
|
|
103
|
+
// ================= Compact Item =================
|
|
104
|
+
var _useCompactItemContex = useCompactItemContext(prefixCls, direction),
|
|
105
|
+
compactSize = _useCompactItemContex.compactSize,
|
|
106
|
+
compactItemClassnames = _useCompactItemContex.compactItemClassnames;
|
|
107
|
+
// ===================== Size =====================
|
|
108
|
+
var mergedSize = useSize(function (ctx) {
|
|
109
|
+
var _ref;
|
|
110
|
+
return (_ref = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _ref !== void 0 ? _ref : ctx;
|
|
111
|
+
});
|
|
92
112
|
var _useVariant = useVariant('textArea', customVariant, bordered),
|
|
93
113
|
_useVariant2 = _slicedToArray(_useVariant, 2),
|
|
94
114
|
variant = _useVariant2[0],
|
|
95
115
|
enableVariantCls = _useVariant2[1];
|
|
96
|
-
var mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear :
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
var mergedAllowClear = getAllowClear(allowClear !== null && allowClear !== void 0 ? allowClear : contextAllowClear);
|
|
117
|
+
// ==================== Resize ====================
|
|
118
|
+
// https://github.com/ant-design/ant-design/issues/51594
|
|
119
|
+
var _React$useState = React.useState(false),
|
|
120
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
121
|
+
isMouseDown = _React$useState2[0],
|
|
122
|
+
setIsMouseDown = _React$useState2[1];
|
|
123
|
+
// When has wrapper, resize will make as dirty for `resize: both` style
|
|
124
|
+
var _React$useState3 = React.useState(false),
|
|
125
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
126
|
+
resizeDirty = _React$useState4[0],
|
|
127
|
+
setResizeDirty = _React$useState4[1];
|
|
128
|
+
var onInternalMouseDown = function onInternalMouseDown(e) {
|
|
129
|
+
setIsMouseDown(true);
|
|
130
|
+
onMouseDown === null || onMouseDown === void 0 || onMouseDown(e);
|
|
131
|
+
var _onMouseUp = function onMouseUp() {
|
|
132
|
+
setIsMouseDown(false);
|
|
133
|
+
document.removeEventListener('mouseup', _onMouseUp);
|
|
134
|
+
};
|
|
135
|
+
document.addEventListener('mouseup', _onMouseUp);
|
|
136
|
+
};
|
|
137
|
+
var onInternalResize = function onInternalResize(size) {
|
|
138
|
+
onResize === null || onResize === void 0 || onResize(size);
|
|
139
|
+
// Change to dirty since this maybe from the `resize: both` style
|
|
140
|
+
if (isMouseDown && typeof getComputedStyle === 'function') {
|
|
141
|
+
var _innerRef$current4;
|
|
142
|
+
var ele = (_innerRef$current4 = innerRef.current) === null || _innerRef$current4 === void 0 || (_innerRef$current4 = _innerRef$current4.nativeElement) === null || _innerRef$current4 === void 0 ? void 0 : _innerRef$current4.querySelector('textarea');
|
|
143
|
+
if (ele && getComputedStyle(ele).resize === 'both') {
|
|
144
|
+
setResizeDirty(true);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
// ==================== Render ====================
|
|
149
|
+
return wrapSharedCSSVar(wrapCSSVar(_jsx(RcTextArea, _objectSpread(_objectSpread({
|
|
150
|
+
autoComplete: contextAutoComplete
|
|
99
151
|
}, rest), {}, {
|
|
100
|
-
style: _objectSpread(_objectSpread({},
|
|
101
|
-
styles: _objectSpread(_objectSpread({},
|
|
152
|
+
style: _objectSpread(_objectSpread({}, contextStyle), style),
|
|
153
|
+
styles: _objectSpread(_objectSpread({}, contextStyles), styles),
|
|
102
154
|
disabled: mergedDisabled,
|
|
103
155
|
allowClear: mergedAllowClear,
|
|
104
|
-
className: classNames(cssVarCls, rootCls, className, rootClassName,
|
|
105
|
-
|
|
106
|
-
|
|
156
|
+
className: classNames(cssVarCls, rootCls, className, rootClassName, compactItemClassnames, contextClassName,
|
|
157
|
+
// Only for wrapper
|
|
158
|
+
resizeDirty && "".concat(prefixCls, "-textarea-affix-wrapper-resize-dirty")),
|
|
159
|
+
classNames: _objectSpread(_objectSpread(_objectSpread({}, classes), contextClassNames), {}, {
|
|
160
|
+
textarea: classNames(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-sm"), mergedSize === 'small'), "".concat(prefixCls, "-lg"), mergedSize === 'large'), hashId, classes === null || classes === void 0 ? void 0 : classes.textarea, contextClassNames.textarea, isMouseDown && "".concat(prefixCls, "-mouse-active")),
|
|
107
161
|
variant: classNames(_defineProperty({}, "".concat(prefixCls, "-").concat(variant), enableVariantCls), getStatusClassNames(prefixCls, mergedStatus)),
|
|
108
|
-
affixWrapper: classNames("".concat(prefixCls, "-textarea-affix-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-affix-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-textarea-show-count"),
|
|
162
|
+
affixWrapper: classNames("".concat(prefixCls, "-textarea-affix-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-affix-wrapper-rtl"), direction === 'rtl'), "".concat(prefixCls, "-affix-wrapper-sm"), mergedSize === 'small'), "".concat(prefixCls, "-affix-wrapper-lg"), mergedSize === 'large'), "".concat(prefixCls, "-textarea-show-count"), showCount || ((_props$count = props.count) === null || _props$count === void 0 ? void 0 : _props$count.show)), hashId)
|
|
109
163
|
}),
|
|
110
164
|
prefixCls: prefixCls,
|
|
111
165
|
suffix: hasFeedback && _jsx("span", {
|
|
112
166
|
className: "".concat(prefixCls, "-textarea-suffix"),
|
|
113
167
|
children: feedbackIcon
|
|
114
168
|
}),
|
|
115
|
-
|
|
116
|
-
|
|
169
|
+
showCount: showCount,
|
|
170
|
+
ref: innerRef,
|
|
171
|
+
onResize: onInternalResize,
|
|
172
|
+
onMouseDown: onInternalMouseDown
|
|
173
|
+
}))));
|
|
117
174
|
});
|
|
118
175
|
export default TextArea;
|
|
@@ -9,7 +9,7 @@ import { clearFix, resetComponent } from '../../style';
|
|
|
9
9
|
import { genCompactItemStyle } from '../../style/compact-item';
|
|
10
10
|
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
11
11
|
import { initComponentToken, initInputToken } from './token';
|
|
12
|
-
import { genBorderlessStyle, genFilledGroupStyle, genFilledStyle, genOutlinedGroupStyle, genOutlinedStyle } from './variants';
|
|
12
|
+
import { genBorderlessStyle, genFilledGroupStyle, genFilledStyle, genOutlinedGroupStyle, genOutlinedStyle, genUnderlinedStyle } from './variants';
|
|
13
13
|
export { initComponentToken, initInputToken };
|
|
14
14
|
export var genPlaceholderStyle = function genPlaceholderStyle(color) {
|
|
15
15
|
return {
|
|
@@ -66,17 +66,6 @@ export var genBasicInputStyle = function genBasicInputStyle(token) {
|
|
|
66
66
|
borderRadius: token.borderRadius,
|
|
67
67
|
transition: "all ".concat(token.motionDurationMid)
|
|
68
68
|
}, genPlaceholderStyle(token.colorTextPlaceholder)), {}, {
|
|
69
|
-
// Reset height for `textarea`s
|
|
70
|
-
'textarea&': {
|
|
71
|
-
maxWidth: '100%',
|
|
72
|
-
// prevent textarea resize from coming out of its container
|
|
73
|
-
height: 'auto',
|
|
74
|
-
minHeight: token.controlHeight,
|
|
75
|
-
lineHeight: token.lineHeight,
|
|
76
|
-
verticalAlign: 'bottom',
|
|
77
|
-
transition: "all ".concat(token.motionDurationSlow, ", height 0s"),
|
|
78
|
-
resize: 'vertical'
|
|
79
|
-
},
|
|
80
69
|
// Size
|
|
81
70
|
'&-lg': _objectSpread({}, genInputLargeStyle(token)),
|
|
82
71
|
'&-sm': _objectSpread({}, genInputSmallStyle(token)),
|
|
@@ -247,14 +236,14 @@ export var genInputGroupStyle = function genInputGroupStyle(token) {
|
|
|
247
236
|
borderEndStartRadius: token.borderRadius
|
|
248
237
|
}))))));
|
|
249
238
|
};
|
|
250
|
-
var genInputStyle = function genInputStyle(token) {
|
|
239
|
+
export var genInputStyle = function genInputStyle(token) {
|
|
251
240
|
var componentCls = token.componentCls,
|
|
252
241
|
controlHeightSM = token.controlHeightSM,
|
|
253
242
|
lineWidth = token.lineWidth,
|
|
254
243
|
calc = token.calc;
|
|
255
244
|
var FIXED_CHROME_COLOR_HEIGHT = 16;
|
|
256
245
|
var colorSmallPadding = calc(controlHeightSM).sub(calc(lineWidth).mul(2)).sub(FIXED_CHROME_COLOR_HEIGHT).div(2).equal();
|
|
257
|
-
return _defineProperty({}, componentCls, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, resetComponent(token)), genBasicInputStyle(token)), genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), {}, {
|
|
246
|
+
return _defineProperty({}, componentCls, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, resetComponent(token)), genBasicInputStyle(token)), genOutlinedStyle(token)), genFilledStyle(token)), genBorderlessStyle(token)), genUnderlinedStyle(token)), {}, {
|
|
258
247
|
'&[type="color"]': _defineProperty(_defineProperty({
|
|
259
248
|
height: token.controlHeight
|
|
260
249
|
}, "&".concat(componentCls, "-lg"), {
|
|
@@ -265,7 +254,7 @@ var genInputStyle = function genInputStyle(token) {
|
|
|
265
254
|
paddingBottom: colorSmallPadding
|
|
266
255
|
}),
|
|
267
256
|
'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration': {
|
|
268
|
-
|
|
257
|
+
appearance: 'none'
|
|
269
258
|
}
|
|
270
259
|
}));
|
|
271
260
|
};
|
|
@@ -273,6 +262,7 @@ var genAllowClearStyle = function genAllowClearStyle(token) {
|
|
|
273
262
|
var componentCls = token.componentCls;
|
|
274
263
|
return _defineProperty({}, "".concat(componentCls, "-clear-icon"), {
|
|
275
264
|
margin: 0,
|
|
265
|
+
padding: 0,
|
|
276
266
|
lineHeight: 0,
|
|
277
267
|
color: token.colorTextQuaternary,
|
|
278
268
|
fontSize: token.fontSizeIcon,
|
|
@@ -281,8 +271,11 @@ var genAllowClearStyle = function genAllowClearStyle(token) {
|
|
|
281
271
|
// https://codesandbox.io/s/wizardly-sun-u10br
|
|
282
272
|
cursor: 'pointer',
|
|
283
273
|
transition: "color ".concat(token.motionDurationSlow),
|
|
274
|
+
border: 'none',
|
|
275
|
+
outline: 'none',
|
|
276
|
+
backgroundColor: 'transparent',
|
|
284
277
|
'&:hover': {
|
|
285
|
-
color: token.
|
|
278
|
+
color: token.colorIcon
|
|
286
279
|
},
|
|
287
280
|
'&:active': {
|
|
288
281
|
color: token.colorText
|
|
@@ -295,7 +288,7 @@ var genAllowClearStyle = function genAllowClearStyle(token) {
|
|
|
295
288
|
}
|
|
296
289
|
});
|
|
297
290
|
};
|
|
298
|
-
var genAffixStyle = function genAffixStyle(token) {
|
|
291
|
+
export var genAffixStyle = function genAffixStyle(token) {
|
|
299
292
|
var componentCls = token.componentCls,
|
|
300
293
|
inputAffixPadding = token.inputAffixPadding,
|
|
301
294
|
colorTextDescription = token.colorTextDescription,
|
|
@@ -305,7 +298,7 @@ var genAffixStyle = function genAffixStyle(token) {
|
|
|
305
298
|
iconCls = token.iconCls;
|
|
306
299
|
var affixCls = "".concat(componentCls, "-affix-wrapper");
|
|
307
300
|
var affixClsDisabled = "".concat(componentCls, "-affix-wrapper-disabled");
|
|
308
|
-
return _defineProperty(_defineProperty({}, affixCls, _objectSpread(_objectSpread(_objectSpread({}, genBasicInputStyle(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
301
|
+
return _defineProperty(_defineProperty(_defineProperty({}, affixCls, _objectSpread(_objectSpread(_objectSpread({}, genBasicInputStyle(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
309
302
|
display: 'inline-flex'
|
|
310
303
|
}, "&:not(".concat(componentCls, "-disabled):hover"), _defineProperty({
|
|
311
304
|
zIndex: 1
|
|
@@ -343,7 +336,8 @@ var genAffixStyle = function genAffixStyle(token) {
|
|
|
343
336
|
}
|
|
344
337
|
},
|
|
345
338
|
'&-show-count-suffix': {
|
|
346
|
-
color: colorTextDescription
|
|
339
|
+
color: colorTextDescription,
|
|
340
|
+
direction: 'ltr'
|
|
347
341
|
},
|
|
348
342
|
'&-show-count-has-suffix': {
|
|
349
343
|
marginInlineEnd: token.paddingXXS
|
|
@@ -361,7 +355,9 @@ var genAffixStyle = function genAffixStyle(token) {
|
|
|
361
355
|
'&:hover': {
|
|
362
356
|
color: colorIconHover
|
|
363
357
|
}
|
|
364
|
-
}))),
|
|
358
|
+
}))), "".concat(componentCls, "-underlined"), {
|
|
359
|
+
borderRadius: 0
|
|
360
|
+
}), affixClsDisabled, _defineProperty({}, "".concat(iconCls).concat(componentCls, "-password-icon"), {
|
|
365
361
|
color: colorIcon,
|
|
366
362
|
cursor: 'not-allowed',
|
|
367
363
|
'&:hover': {
|
|
@@ -394,7 +390,7 @@ var genGroupStyle = function genGroupStyle(token) {
|
|
|
394
390
|
'&-sm': _defineProperty({}, "".concat(componentCls, "-group-addon"), {
|
|
395
391
|
borderRadius: borderRadiusSM
|
|
396
392
|
})
|
|
397
|
-
}, genOutlinedGroupStyle(token)), genFilledGroupStyle(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&:not(".concat(componentCls, "-compact-first-item):not(").concat(componentCls, "-compact-last-item)").concat(componentCls, "-compact-item"), _defineProperty({}, "".concat(componentCls, ", ").concat(componentCls, "-group-addon"), {
|
|
393
|
+
}, genOutlinedGroupStyle(token)), genFilledGroupStyle(token)), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&:not(".concat(componentCls, "-compact-first-item):not(").concat(componentCls, "-compact-last-item)").concat(componentCls, "-compact-item"), _defineProperty({}, "".concat(componentCls, ", ").concat(componentCls, "-group-addon"), {
|
|
398
394
|
borderRadius: 0
|
|
399
395
|
})), "&:not(".concat(componentCls, "-compact-last-item)").concat(componentCls, "-compact-first-item"), _defineProperty({}, "".concat(componentCls, ", ").concat(componentCls, "-group-addon"), {
|
|
400
396
|
borderStartEndRadius: 0,
|
|
@@ -405,6 +401,9 @@ var genGroupStyle = function genGroupStyle(token) {
|
|
|
405
401
|
})), "&:not(".concat(componentCls, "-compact-last-item)").concat(componentCls, "-compact-item"), _defineProperty({}, "".concat(componentCls, "-affix-wrapper"), {
|
|
406
402
|
borderStartEndRadius: 0,
|
|
407
403
|
borderEndEndRadius: 0
|
|
404
|
+
})), "&:not(".concat(componentCls, "-compact-first-item)").concat(componentCls, "-compact-item"), _defineProperty({}, "".concat(componentCls, "-affix-wrapper"), {
|
|
405
|
+
borderStartStartRadius: 0,
|
|
406
|
+
borderEndStartRadius: 0
|
|
408
407
|
})))
|
|
409
408
|
}));
|
|
410
409
|
};
|
|
@@ -413,7 +412,7 @@ var genSearchInputStyle = function genSearchInputStyle(token) {
|
|
|
413
412
|
antCls = token.antCls;
|
|
414
413
|
var searchPrefixCls = "".concat(componentCls, "-search");
|
|
415
414
|
return _defineProperty({}, searchPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentCls, {
|
|
416
|
-
'&:hover, &:focus': _defineProperty({}, "+ ".concat(componentCls, "-group-addon ").concat(searchPrefixCls, "-button:not(").concat(antCls, "-btn-primary)"), {
|
|
415
|
+
'&:hover, &:focus': _defineProperty({}, "+ ".concat(componentCls, "-group-addon ").concat(searchPrefixCls, "-button:not(").concat(antCls, "-btn-color-primary):not(").concat(antCls, "-btn-variant-text)"), {
|
|
417
416
|
borderInlineStartColor: token.colorPrimaryHover
|
|
418
417
|
})
|
|
419
418
|
}), "".concat(componentCls, "-affix-wrapper"), {
|
|
@@ -428,12 +427,10 @@ var genSearchInputStyle = function genSearchInputStyle(token) {
|
|
|
428
427
|
}, "".concat(searchPrefixCls, "-button"), {
|
|
429
428
|
// Fix https://github.com/ant-design/ant-design/issues/47150
|
|
430
429
|
marginInlineEnd: -1,
|
|
431
|
-
paddingTop: 0,
|
|
432
|
-
paddingBottom: 0,
|
|
433
430
|
borderStartStartRadius: 0,
|
|
434
431
|
borderEndStartRadius: 0,
|
|
435
432
|
boxShadow: 'none'
|
|
436
|
-
}), "".concat(searchPrefixCls, "-button:not(").concat(antCls, "-btn-primary)"), _defineProperty({
|
|
433
|
+
}), "".concat(searchPrefixCls, "-button:not(").concat(antCls, "-btn-color-primary)"), _defineProperty({
|
|
437
434
|
color: token.colorTextDescription,
|
|
438
435
|
'&:hover': {
|
|
439
436
|
color: token.colorPrimaryHover
|
|
@@ -442,10 +439,7 @@ var genSearchInputStyle = function genSearchInputStyle(token) {
|
|
|
442
439
|
color: token.colorPrimaryActive
|
|
443
440
|
}
|
|
444
441
|
}, "&".concat(antCls, "-btn-loading::before"), {
|
|
445
|
-
|
|
446
|
-
insetInlineEnd: 0,
|
|
447
|
-
insetBlockStart: 0,
|
|
448
|
-
insetBlockEnd: 0
|
|
442
|
+
inset: 0
|
|
449
443
|
})))), "".concat(searchPrefixCls, "-button"), {
|
|
450
444
|
height: token.controlHeight,
|
|
451
445
|
'&:hover, &:focus': {
|
|
@@ -470,57 +464,6 @@ var genSearchInputStyle = function genSearchInputStyle(token) {
|
|
|
470
464
|
zIndex: 2
|
|
471
465
|
})));
|
|
472
466
|
};
|
|
473
|
-
var genTextAreaStyle = function genTextAreaStyle(token) {
|
|
474
|
-
var componentCls = token.componentCls,
|
|
475
|
-
paddingLG = token.paddingLG;
|
|
476
|
-
var textareaPrefixCls = "".concat(componentCls, "-textarea");
|
|
477
|
-
return _defineProperty({}, textareaPrefixCls, _defineProperty(_defineProperty(_defineProperty({
|
|
478
|
-
position: 'relative',
|
|
479
|
-
'&-show-count': _defineProperty(_defineProperty({}, "> ".concat(componentCls), {
|
|
480
|
-
height: '100%'
|
|
481
|
-
}), "".concat(componentCls, "-data-count"), {
|
|
482
|
-
position: 'absolute',
|
|
483
|
-
bottom: token.calc(token.fontSize).mul(token.lineHeight).mul(-1).equal(),
|
|
484
|
-
insetInlineEnd: 0,
|
|
485
|
-
color: token.colorTextDescription,
|
|
486
|
-
whiteSpace: 'nowrap',
|
|
487
|
-
pointerEvents: 'none'
|
|
488
|
-
})
|
|
489
|
-
}, "\n &-allow-clear > ".concat(componentCls, ",\n &-affix-wrapper").concat(textareaPrefixCls, "-has-feedback ").concat(componentCls, "\n "), {
|
|
490
|
-
paddingInlineEnd: paddingLG
|
|
491
|
-
}), "&-affix-wrapper".concat(componentCls, "-affix-wrapper"), _defineProperty(_defineProperty({
|
|
492
|
-
padding: 0
|
|
493
|
-
}, "> textarea".concat(componentCls), {
|
|
494
|
-
fontSize: 'inherit',
|
|
495
|
-
border: 'none',
|
|
496
|
-
outline: 'none',
|
|
497
|
-
background: 'transparent',
|
|
498
|
-
'&:focus': {
|
|
499
|
-
boxShadow: 'none !important'
|
|
500
|
-
}
|
|
501
|
-
}), "".concat(componentCls, "-suffix"), _defineProperty(_defineProperty({
|
|
502
|
-
margin: 0,
|
|
503
|
-
'> *:not(:last-child)': {
|
|
504
|
-
marginInline: 0
|
|
505
|
-
}
|
|
506
|
-
}, "".concat(componentCls, "-clear-icon"), {
|
|
507
|
-
position: 'absolute',
|
|
508
|
-
insetInlineEnd: token.paddingInline,
|
|
509
|
-
insetBlockStart: token.paddingXS
|
|
510
|
-
}), "".concat(textareaPrefixCls, "-suffix"), {
|
|
511
|
-
position: 'absolute',
|
|
512
|
-
top: 0,
|
|
513
|
-
insetInlineEnd: token.paddingInline,
|
|
514
|
-
bottom: 0,
|
|
515
|
-
zIndex: 1,
|
|
516
|
-
display: 'inline-flex',
|
|
517
|
-
alignItems: 'center',
|
|
518
|
-
margin: 'auto',
|
|
519
|
-
pointerEvents: 'none'
|
|
520
|
-
}))), "&-affix-wrapper".concat(componentCls, "-affix-wrapper-sm"), _defineProperty({}, "".concat(componentCls, "-suffix"), _defineProperty({}, "".concat(componentCls, "-clear-icon"), {
|
|
521
|
-
insetInlineEnd: token.paddingInlineSM
|
|
522
|
-
}))));
|
|
523
|
-
};
|
|
524
467
|
// ============================== Range ===============================
|
|
525
468
|
var genRangeStyle = function genRangeStyle(token) {
|
|
526
469
|
var componentCls = token.componentCls;
|
|
@@ -529,9 +472,15 @@ var genRangeStyle = function genRangeStyle(token) {
|
|
|
529
472
|
}));
|
|
530
473
|
};
|
|
531
474
|
// ============================== Export ==============================
|
|
532
|
-
export
|
|
475
|
+
export var useSharedStyle = genStyleHooks(['Input', 'Shared'], function (token) {
|
|
476
|
+
var inputToken = mergeToken(token, initInputToken(token));
|
|
477
|
+
return [genInputStyle(inputToken), genAffixStyle(inputToken)];
|
|
478
|
+
}, initComponentToken, {
|
|
479
|
+
resetFont: false
|
|
480
|
+
});
|
|
481
|
+
export default genStyleHooks(['Input', 'Component'], function (token) {
|
|
533
482
|
var inputToken = mergeToken(token, initInputToken(token));
|
|
534
|
-
return [
|
|
483
|
+
return [genGroupStyle(inputToken), genSearchInputStyle(inputToken), genRangeStyle(inputToken),
|
|
535
484
|
// =====================================================
|
|
536
485
|
// == Space Compact ==
|
|
537
486
|
// =====================================================
|
|
@@ -8,15 +8,31 @@ import { initComponentToken, initInputToken } from './token';
|
|
|
8
8
|
var genOTPStyle = function genOTPStyle(token) {
|
|
9
9
|
var componentCls = token.componentCls,
|
|
10
10
|
paddingXS = token.paddingXS;
|
|
11
|
-
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty({
|
|
11
|
+
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
12
12
|
display: 'inline-flex',
|
|
13
13
|
alignItems: 'center',
|
|
14
14
|
flexWrap: 'nowrap',
|
|
15
|
-
columnGap: paddingXS
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
columnGap: paddingXS
|
|
16
|
+
}, "".concat(componentCls, "-input-wrapper"), _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
17
|
+
position: 'relative'
|
|
18
|
+
}, "".concat(componentCls, "-mask-icon"), {
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
zIndex: '1',
|
|
21
|
+
top: '50%',
|
|
22
|
+
right: '50%',
|
|
23
|
+
transform: 'translate(50%, -50%)',
|
|
24
|
+
pointerEvents: 'none'
|
|
25
|
+
}), "".concat(componentCls, "-mask-input"), {
|
|
26
|
+
color: 'transparent',
|
|
27
|
+
caretColor: 'var(--ant-color-text)'
|
|
28
|
+
}), "".concat(componentCls, "-mask-input[type=number]::-webkit-inner-spin-button"), {
|
|
29
|
+
'-webkit-appearance': 'none',
|
|
30
|
+
margin: 0
|
|
31
|
+
}), "".concat(componentCls, "-mask-input[type=number]"), {
|
|
32
|
+
'-moz-appearance': 'textfield'
|
|
33
|
+
})), '&-rtl', {
|
|
34
|
+
direction: 'rtl'
|
|
35
|
+
}), "".concat(componentCls, "-input"), {
|
|
20
36
|
textAlign: 'center',
|
|
21
37
|
paddingInline: token.paddingXXS
|
|
22
38
|
}), "&".concat(componentCls, "-sm ").concat(componentCls, "-input"), {
|
|
@@ -0,0 +1,80 @@
|
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
|
+
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); }
|
|
5
|
+
import { genStyleHooks, mergeToken } from '../../theme/internal';
|
|
6
|
+
import { initComponentToken, initInputToken } from './token';
|
|
7
|
+
export { initComponentToken, initInputToken };
|
|
8
|
+
var genTextAreaStyle = function genTextAreaStyle(token) {
|
|
9
|
+
var componentCls = token.componentCls,
|
|
10
|
+
paddingLG = token.paddingLG;
|
|
11
|
+
var textareaPrefixCls = "".concat(componentCls, "-textarea");
|
|
12
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "textarea".concat(componentCls), _defineProperty({
|
|
13
|
+
maxWidth: '100%',
|
|
14
|
+
// prevent textarea resize from coming out of its container
|
|
15
|
+
height: 'auto',
|
|
16
|
+
minHeight: token.controlHeight,
|
|
17
|
+
lineHeight: token.lineHeight,
|
|
18
|
+
verticalAlign: 'bottom',
|
|
19
|
+
transition: "all ".concat(token.motionDurationSlow),
|
|
20
|
+
resize: 'vertical'
|
|
21
|
+
}, "&".concat(componentCls, "-mouse-active"), {
|
|
22
|
+
transition: "all ".concat(token.motionDurationSlow, ", height 0s, width 0s")
|
|
23
|
+
})), "".concat(componentCls, "-textarea-affix-wrapper-resize-dirty"), {
|
|
24
|
+
width: 'auto'
|
|
25
|
+
}), textareaPrefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
'&-show-count': _defineProperty({}, "".concat(componentCls, "-data-count"), {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
bottom: token.calc(token.fontSize).mul(token.lineHeight).mul(-1).equal(),
|
|
30
|
+
insetInlineEnd: 0,
|
|
31
|
+
color: token.colorTextDescription,
|
|
32
|
+
whiteSpace: 'nowrap',
|
|
33
|
+
pointerEvents: 'none'
|
|
34
|
+
})
|
|
35
|
+
}, "\n &-allow-clear > ".concat(componentCls, ",\n &-affix-wrapper").concat(textareaPrefixCls, "-has-feedback ").concat(componentCls, "\n "), {
|
|
36
|
+
paddingInlineEnd: paddingLG
|
|
37
|
+
}), "&-affix-wrapper".concat(componentCls, "-affix-wrapper"), _defineProperty(_defineProperty({
|
|
38
|
+
padding: 0
|
|
39
|
+
}, "> textarea".concat(componentCls), {
|
|
40
|
+
fontSize: 'inherit',
|
|
41
|
+
border: 'none',
|
|
42
|
+
outline: 'none',
|
|
43
|
+
background: 'transparent',
|
|
44
|
+
minHeight: token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal(),
|
|
45
|
+
'&:focus': {
|
|
46
|
+
boxShadow: 'none !important'
|
|
47
|
+
}
|
|
48
|
+
}), "".concat(componentCls, "-suffix"), _defineProperty(_defineProperty({
|
|
49
|
+
margin: 0,
|
|
50
|
+
'> *:not(:last-child)': {
|
|
51
|
+
marginInline: 0
|
|
52
|
+
}
|
|
53
|
+
}, "".concat(componentCls, "-clear-icon"), {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
insetInlineEnd: token.paddingInline,
|
|
56
|
+
insetBlockStart: token.paddingXS
|
|
57
|
+
}), "".concat(textareaPrefixCls, "-suffix"), {
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: 0,
|
|
60
|
+
insetInlineEnd: token.paddingInline,
|
|
61
|
+
bottom: 0,
|
|
62
|
+
zIndex: 1,
|
|
63
|
+
display: 'inline-flex',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
margin: 'auto',
|
|
66
|
+
pointerEvents: 'none'
|
|
67
|
+
}))), "&-affix-wrapper".concat(componentCls, "-affix-wrapper-rtl"), _defineProperty({}, "".concat(componentCls, "-suffix"), _defineProperty({}, "".concat(componentCls, "-data-count"), {
|
|
68
|
+
direction: 'ltr',
|
|
69
|
+
insetInlineStart: 0
|
|
70
|
+
}))), "&-affix-wrapper".concat(componentCls, "-affix-wrapper-sm"), _defineProperty({}, "".concat(componentCls, "-suffix"), _defineProperty({}, "".concat(componentCls, "-clear-icon"), {
|
|
71
|
+
insetInlineEnd: token.paddingInlineSM
|
|
72
|
+
}))));
|
|
73
|
+
};
|
|
74
|
+
// ============================== Export ==============================
|
|
75
|
+
export default genStyleHooks(['Input', 'TextArea'], function (token) {
|
|
76
|
+
var inputToken = mergeToken(token, initInputToken(token));
|
|
77
|
+
return [genTextAreaStyle(inputToken)];
|
|
78
|
+
}, initComponentToken, {
|
|
79
|
+
resetFont: false
|
|
80
|
+
});
|
|
@@ -23,11 +23,20 @@ export var initComponentToken = function initComponentToken(token) {
|
|
|
23
23
|
controlOutline = token.controlOutline,
|
|
24
24
|
colorErrorOutline = token.colorErrorOutline,
|
|
25
25
|
colorWarningOutline = token.colorWarningOutline,
|
|
26
|
-
colorBgContainer = token.colorBgContainer
|
|
26
|
+
colorBgContainer = token.colorBgContainer,
|
|
27
|
+
inputFontSize = token.inputFontSize,
|
|
28
|
+
inputFontSizeLG = token.inputFontSizeLG,
|
|
29
|
+
inputFontSizeSM = token.inputFontSizeSM;
|
|
30
|
+
var mergedFontSize = inputFontSize || fontSize;
|
|
31
|
+
var mergedFontSizeSM = inputFontSizeSM || mergedFontSize;
|
|
32
|
+
var mergedFontSizeLG = inputFontSizeLG || fontSizeLG;
|
|
33
|
+
var paddingBlock = Math.round((controlHeight - mergedFontSize * lineHeight) / 2 * 10) / 10 - lineWidth;
|
|
34
|
+
var paddingBlockSM = Math.round((controlHeightSM - mergedFontSizeSM * lineHeight) / 2 * 10) / 10 - lineWidth;
|
|
35
|
+
var paddingBlockLG = Math.ceil((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2 * 10) / 10 - lineWidth;
|
|
27
36
|
return {
|
|
28
|
-
paddingBlock: Math.max(
|
|
29
|
-
paddingBlockSM: Math.max(
|
|
30
|
-
paddingBlockLG: Math.
|
|
37
|
+
paddingBlock: Math.max(paddingBlock, 0),
|
|
38
|
+
paddingBlockSM: Math.max(paddingBlockSM, 0),
|
|
39
|
+
paddingBlockLG: Math.max(paddingBlockLG, 0),
|
|
31
40
|
paddingInline: paddingSM - lineWidth,
|
|
32
41
|
paddingInlineSM: controlPaddingHorizontalSM - lineWidth,
|
|
33
42
|
paddingInlineLG: controlPaddingHorizontal - lineWidth,
|
|
@@ -39,8 +48,8 @@ export var initComponentToken = function initComponentToken(token) {
|
|
|
39
48
|
warningActiveShadow: "0 0 0 ".concat(controlOutlineWidth, "px ").concat(colorWarningOutline),
|
|
40
49
|
hoverBg: colorBgContainer,
|
|
41
50
|
activeBg: colorBgContainer,
|
|
42
|
-
inputFontSize:
|
|
43
|
-
inputFontSizeLG:
|
|
44
|
-
inputFontSizeSM:
|
|
51
|
+
inputFontSize: mergedFontSize,
|
|
52
|
+
inputFontSizeLG: mergedFontSizeLG,
|
|
53
|
+
inputFontSizeSM: mergedFontSizeSM
|
|
45
54
|
};
|
|
46
55
|
};
|