From b7f45497197276d0e04dbce42654bbab75e33568 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 10 Sep 2022 17:19:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=A7=A6=E5=8F=91=E6=97=B6=E6=9C=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/WebMetaForm/types/Checkbox.tsx | 2 +- .../components/WebMetaForm/types/Password.tsx | 13 +++++-- .../components/WebMetaForm/types/Select.tsx | 9 +++-- .../components/WebMetaForm/types/Text.tsx | 13 +++++-- .../components/WebMetaForm/types/TextArea.tsx | 13 +++++-- client/packages/design/package.json | 2 +- client/web/src/styles/antd/dark.less | 34 +++++++++++++------ pnpm-lock.yaml | 8 ++--- 8 files changed, 70 insertions(+), 24 deletions(-) diff --git a/client/packages/design/components/WebMetaForm/types/Checkbox.tsx b/client/packages/design/components/WebMetaForm/types/Checkbox.tsx index ba7501f3..1fe4470a 100644 --- a/client/packages/design/components/WebMetaForm/types/Checkbox.tsx +++ b/client/packages/design/components/WebMetaForm/types/Checkbox.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { Form, Checkbox } from 'antd'; import type { FastifyFormFieldComponent } from 'react-fastify-form'; import { getValidateStatus } from '../utils'; diff --git a/client/packages/design/components/WebMetaForm/types/Password.tsx b/client/packages/design/components/WebMetaForm/types/Password.tsx index a169a69a..a8a230e5 100644 --- a/client/packages/design/components/WebMetaForm/types/Password.tsx +++ b/client/packages/design/components/WebMetaForm/types/Password.tsx @@ -5,8 +5,16 @@ import { getValidateStatus } from '../utils'; export const FastifyFormPassword: FastifyFormFieldComponent = React.memo( (props) => { - const { name, label, value, onChange, error, maxLength, placeholder } = - props; + const { + name, + label, + value, + onChange, + onBlur, + error, + maxLength, + placeholder, + } = props; return ( onChange(e.target.value)} + onBlur={onBlur} /> ); diff --git a/client/packages/design/components/WebMetaForm/types/Select.tsx b/client/packages/design/components/WebMetaForm/types/Select.tsx index bed1961c..19bafb29 100644 --- a/client/packages/design/components/WebMetaForm/types/Select.tsx +++ b/client/packages/design/components/WebMetaForm/types/Select.tsx @@ -14,7 +14,7 @@ interface FastifyFormSelectOptionsItem { export const FastifyFormSelect: FastifyFormFieldComponent<{ options: FastifyFormSelectOptionsItem[]; }> = React.memo((props) => { - const { name, label, value, onChange, options } = props; + const { name, label, value, onChange, onBlur, options } = props; useEffect(() => { if (_isNil(value) || value === '') { @@ -25,7 +25,12 @@ export const FastifyFormSelect: FastifyFormFieldComponent<{ return ( - onChange(value)} + onBlur={onBlur} + > {options.map((option, i) => (