diff --git a/components/color-picker/components/ColorPresets.tsx b/components/color-picker/components/ColorPresets.tsx index 37df7f55ad..6131bf36a2 100644 --- a/components/color-picker/components/ColorPresets.tsx +++ b/components/color-picker/components/ColorPresets.tsx @@ -51,10 +51,10 @@ const ColorPresets: FC = ({ prefixCls, presets, value: color, const activeKeys = useMemo( () => - presetsValue.reduce((acc, preset, i) => { + presetsValue.reduce((acc, preset, index) => { const { defaultOpen = true } = preset; if (defaultOpen) { - acc.push(genCollapsePanelKey(preset, i)); + acc.push(genCollapsePanelKey(preset, index)); } return acc; }, []), @@ -65,8 +65,8 @@ const ColorPresets: FC = ({ prefixCls, presets, value: color, onChange?.(colorValue); }; - const items = presetsValue.map[number]>((preset, i) => ({ - key: genCollapsePanelKey(preset, i), + const items = presetsValue.map[number]>((preset, index) => ({ + key: genCollapsePanelKey(preset, index), label:
{preset?.label}
, children: (
diff --git a/components/input-number/style/index.ts b/components/input-number/style/index.ts index 14851c8e0a..3f498baf10 100644 --- a/components/input-number/style/index.ts +++ b/components/input-number/style/index.ts @@ -250,7 +250,7 @@ const genInputNumberStyles: GenerateStyle = (token: InputNumbe position: 'absolute', insetBlockStart: 0, insetInlineEnd: 0, - width: 0, + width: token.handleVisibleWidth, opacity: handleOpacity, height: '100%', borderStartStartRadius: 0, diff --git a/components/input-number/style/token.ts b/components/input-number/style/token.ts index 67fba8d885..75bf39ef52 100644 --- a/components/input-number/style/token.ts +++ b/components/input-number/style/token.ts @@ -55,17 +55,22 @@ export interface ComponentToken extends SharedComponentToken { * @internal */ handleOpacity: number; + /** + * @internal + */ + handleVisibleWidth: number; } export type InputNumberToken = FullToken<'InputNumber'> & SharedInputToken; export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) => { const handleVisible = token.handleVisible ?? 'auto'; + const handleWidth = token.controlHeightSM - token.lineWidth * 2; return { ...initComponentToken(token), controlWidth: 90, - handleWidth: token.controlHeightSM - token.lineWidth * 2, + handleWidth, handleFontSize: token.fontSize / 2, handleVisible, handleActiveBg: token.colorFillAlter, @@ -76,5 +81,6 @@ export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) => handleHoverColor: token.colorPrimary, handleBorderColor: token.colorBorder, handleOpacity: handleVisible === true ? 1 : 0, + handleVisibleWidth: handleVisible === true ? handleWidth : 0, }; }; diff --git a/package.json b/package.json index a797296d91..232042c1ed 100644 --- a/package.json +++ b/package.json @@ -106,11 +106,11 @@ }, "dependencies": { "@ant-design/colors": "^7.1.0", - "@ant-design/cssinjs": "^1.21.1", + "@ant-design/cssinjs": "^1.22.0", "@ant-design/cssinjs-utils": "^1.1.1", "@ant-design/icons": "^5.5.1", "@ant-design/react-slick": "~1.1.2", - "@babel/runtime": "^7.25.7", + "@babel/runtime": "^7.26.0", "@ctrl/tinycolor": "^3.6.1", "@rc-component/color-picker": "~2.0.1", "@rc-component/mutate-observer": "^1.1.0", @@ -159,21 +159,21 @@ "@ant-design/compatible": "^5.1.3", "@ant-design/happy-work-theme": "^1.0.0", "@ant-design/tools": "^18.0.2", - "@antfu/eslint-config": "^3.8.0", + "@antfu/eslint-config": "^3.11.2", "@antv/g6": "^4.8.24", "@biomejs/biome": "^1.9.4", - "@codecov/webpack-plugin": "^1.2.1", - "@codesandbox/sandpack-react": "^2.19.9", + "@codecov/webpack-plugin": "^1.4.0", + "@codesandbox/sandpack-react": "^2.19.10", "@dnd-kit/core": "^6.2.0", "@dnd-kit/modifiers": "^8.0.0", "@dnd-kit/sortable": "^9.0.0", "@dnd-kit/utilities": "^3.2.2", - "@emotion/css": "^11.13.4", - "@emotion/react": "^11.13.3", + "@emotion/css": "^11.13.5", + "@emotion/react": "^11.13.5", "@emotion/server": "^11.11.0", - "@eslint-react/eslint-plugin": "^1.15.0", - "@ianvs/prettier-plugin-sort-imports": "^4.3.1", - "@inquirer/prompts": "^7.0.0", + "@eslint-react/eslint-plugin": "^1.17.1", + "@ianvs/prettier-plugin-sort-imports": "^4.4.0", + "@inquirer/prompts": "^7.1.0", "@madccc/duplicate-package-checker-webpack-plugin": "^1.0.0", "@microflash/rehype-figure": "^2.1.1", "@npmcli/run-script": "^9.0.1", @@ -182,10 +182,10 @@ "@size-limit/file": "^11.1.6", "@stackblitz/sdk": "^1.11.0", "@testing-library/dom": "^10.4.0", - "@testing-library/jest-dom": "^6.6.2", + "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.5.2", - "@types/adm-zip": "^0.5.5", + "@types/adm-zip": "^0.5.6", "@types/ali-oss": "^6.16.11", "@types/cli-progress": "^3.11.6", "@types/fs-extra": "^11.0.4", @@ -200,7 +200,7 @@ "@types/jsdom": "^21.1.7", "@types/lodash": "^4.17.12", "@types/minimist": "^1.2.5", - "@types/node": "^22.7.7", + "@types/node": "^22.10.1", "@types/nprogress": "^0.2.3", "@types/pixelmatch": "^5.2.6", "@types/pngjs": "^6.0.5", @@ -220,7 +220,7 @@ "adm-zip": "^0.5.16", "ali-oss": "^6.21.0", "antd-img-crop": "^4.23.0", - "antd-style": "^3.7.0", + "antd-style": "^3.7.1", "antd-token-previewer": "^2.0.8", "axios": "^1.7.7", "chalk": "^4.1.2", @@ -231,14 +231,14 @@ "cross-fetch": "^4.0.0", "dekko": "^0.2.1", "dotenv": "^16.4.5", - "dumi": "~2.4.13", + "dumi": "~2.4.14", "dumi-plugin-color-chunk": "^1.1.2", - "eslint": "^9.13.0", + "eslint": "^9.15.0", "eslint-plugin-compat": "^6.0.1", - "eslint-plugin-jest": "^28.8.3", + "eslint-plugin-jest": "^28.9.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react-hooks": "^5.0.0", - "eslint-plugin-react-refresh": "^0.4.13", + "eslint-plugin-react-refresh": "^0.4.14", "fast-glob": "^3.3.2", "fetch-jsonp": "^1.3.0", "fs-extra": "^11.2.0", @@ -257,7 +257,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-environment-node": "^29.7.0", "jest-image-snapshot": "^6.4.0", - "jest-puppeteer": "^10.1.2", + "jest-puppeteer": "^10.1.4", "jquery": "^3.7.1", "jsdom": "^25.0.1", "jsonml-to-react-element": "^1.1.11", @@ -276,10 +276,10 @@ "p-all": "^5.0.0", "pixelmatch": "^6.0.0", "pngjs": "^7.0.0", - "prettier": "^3.3.3", + "prettier": "^3.4.1", "pretty-format": "^29.7.0", "prismjs": "^1.29.0", - "puppeteer": "^23.6.0", + "puppeteer": "^23.9.0", "qs": "^6.13.0", "rc-footer": "^0.6.8", "rc-tween-one": "^3.0.6", @@ -317,11 +317,11 @@ "tar-fs": "^3.0.6", "terser": "^5.36.0", "tsx": "4.11.2", - "typedoc": "^0.26.10", - "typescript": "~5.7.0", - "vanilla-jsoneditor": "^2.0.0", + "typedoc": "^0.27.1", + "typescript": "~5.7.2", + "vanilla-jsoneditor": "^2.3.1", "vanilla-tilt": "^1.8.1", - "webpack": "^5.95.0", + "webpack": "^5.96.1", "webpack-bundle-analyzer": "^4.10.2", "xhr-mock": "^2.5.1" },