Initial import

This commit is contained in:
how2ice
2026-04-21 03:33:23 +09:00
commit 9e4b70f1f1
495 changed files with 94680 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import type { PropsPlugin } from '../../../../../types/component-plugin';
import type { InputUIProps } from '../InputUI';
import type { InputValidator } from '../types';
export const trimInputValuePlugin =
(): PropsPlugin<InputUIProps> =>
(props) => ({
...props,
onBlur: (event) => {
event.target.value = event.target.value.trim();
props.onBlur?.(event);
},
});
export const createValidInputPlugin =
(onValid: InputValidator) =>
({ nextValue, previousValue, timing }: Parameters<InputValidator>[0]) =>
onValid({
nextValue,
previousValue,
timing,
});