mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
Perf workflow (#1492)
* perf: handle edge check * search model * feat: plugin input can render all input; fix: plugin default value * fix ts * feat: plugin input support required
This commit is contained in:
36
packages/web/components/common/Input/NumberInput/index.tsx
Normal file
36
packages/web/components/common/Input/NumberInput/index.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
NumberInput,
|
||||
NumberIncrementStepper,
|
||||
NumberInputField,
|
||||
NumberInputStepper,
|
||||
NumberDecrementStepper,
|
||||
NumberInputProps
|
||||
} from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
|
||||
type Props = Omit<NumberInputProps, 'onChange'> & {
|
||||
onChange: (e: number | '') => any;
|
||||
};
|
||||
|
||||
const MyNumberInput = (props: Props) => {
|
||||
return (
|
||||
<NumberInput
|
||||
{...props}
|
||||
onChange={(e) => {
|
||||
if (isNaN(Number(e))) {
|
||||
props?.onChange('');
|
||||
} else {
|
||||
props?.onChange(Number(e));
|
||||
}
|
||||
}}
|
||||
>
|
||||
<NumberInputField />
|
||||
<NumberInputStepper>
|
||||
<NumberIncrementStepper />
|
||||
<NumberDecrementStepper />
|
||||
</NumberInputStepper>
|
||||
</NumberInput>
|
||||
);
|
||||
};
|
||||
|
||||
export default MyNumberInput;
|
@@ -67,7 +67,7 @@ const MyRightDrawer = ({
|
||||
<DrawerCloseButton position={'relative'} fontSize={'sm'} top={0} right={0} />
|
||||
</Flex>
|
||||
|
||||
<DrawerBody>
|
||||
<DrawerBody overflow={'unset'} px={props?.px}>
|
||||
{children}
|
||||
<Loading loading={isLoading} fixed={false} />
|
||||
</DrawerBody>
|
||||
|
Reference in New Issue
Block a user