mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 03:03:37 +02:00
Work required to support the JWT plugin
This commit is contained in:
@@ -29,7 +29,7 @@ export function PlainInput({
|
||||
onChange,
|
||||
onFocus,
|
||||
onPaste,
|
||||
require,
|
||||
required,
|
||||
rightSlot,
|
||||
size = 'md',
|
||||
type = 'text',
|
||||
@@ -72,11 +72,11 @@ export function PlainInput({
|
||||
);
|
||||
|
||||
const isValid = useMemo(() => {
|
||||
if (require && !validateRequire(currentValue)) return false;
|
||||
if (required && !validateRequire(currentValue)) return false;
|
||||
if (typeof validate === 'boolean') return validate;
|
||||
if (typeof validate === 'function' && !validate(currentValue)) return false;
|
||||
return true;
|
||||
}, [require, currentValue, validate]);
|
||||
}, [required, currentValue, validate]);
|
||||
|
||||
const handleChange = useCallback(
|
||||
(value: string) => {
|
||||
@@ -137,7 +137,7 @@ export function PlainInput({
|
||||
className={classNames(commonClassName, 'h-auto')}
|
||||
onFocus={handleFocus}
|
||||
onBlur={handleBlur}
|
||||
required={require}
|
||||
required={required}
|
||||
autoFocus={autoFocus}
|
||||
placeholder={placeholder}
|
||||
onKeyDownCapture={onKeyDownCapture}
|
||||
|
||||
Reference in New Issue
Block a user