diff --git a/package.json b/package.json index 862ec59afa..08d7d74bd4 100644 --- a/package.json +++ b/package.json @@ -183,6 +183,7 @@ "rollup-plugin-styles": "^4.0.0", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.31.2", + "semver": "^7.6.3", "standard-changelog": "^2.0.27", "start-server-and-test": "^1.14.0", "tdesign-icons-view": "^0.3.0", diff --git a/site/src/App.jsx b/site/src/App.jsx index 3797519ca2..4032359a81 100644 --- a/site/src/App.jsx +++ b/site/src/App.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState, lazy, Suspense } from 'react'; import { BrowserRouter, Routes, Navigate, Route, useLocation, useNavigate, Outlet } from 'react-router-dom'; +import semver from 'semver'; import Loading from 'tdesign-react/loading'; import ConfigProvider from 'tdesign-react/config-provider'; import zhConfig from 'tdesign-react/es/locale/zh_CN'; @@ -19,7 +20,7 @@ const docsMap = { en: enDocs, }; -const registryUrl = 'https://mirrors.tencent.com/npm/tdesign-react'; +const registryUrl = 'https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/npm/versions/tdesign-react'; const currentVersion = packageJson.version.replace(/\./g, '_'); const docRoutes = [...getRoute(siteConfig.docs, []), ...getRoute(siteConfig.enDocs, [])]; @@ -65,7 +66,8 @@ function Components() { options.unshift({ label: v, value: v.replace(/\./g, '_') }); }); - tdSelectRef.current.options = options; + + tdSelectRef.current.options = options.sort((a, b) => (semver.gt(a.label, b.label) ? -1 : 1)); }); } @@ -95,7 +97,6 @@ function Components() { }; initHistoryVersions(); - }, []); useEffect(() => { diff --git a/src/textarea/Textarea.tsx b/src/textarea/Textarea.tsx index 4fcef82859..5e29dcb019 100644 --- a/src/textarea/Textarea.tsx +++ b/src/textarea/Textarea.tsx @@ -13,7 +13,7 @@ import useDefaultProps from '../hooks/useDefaultProps'; export interface TextareaProps extends Omit< React.TextareaHTMLAttributes, - 'value' | 'defaultValue' | 'onBlur' | 'onChange' | 'onFocus' + 'value' | 'defaultValue' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' >, TdTextareaProps, StyledProps {}