form-tool
Version:
Create quickly and robustly with form hooks
340 lines (339 loc) • 12.7 kB
TypeScript
import { ChangeEvent, FocusEvent, MouseEvent, RefObject } from 'react';
import { CSSObject } from 'styled-components';
import * as CSS from 'csstype';
import { TDefaultTextAreaStyle } from './settings';
export declare interface TOnChangeTextArea {
value?: any;
name: string;
index?: number;
error: boolean;
dataExtra?: any;
range?: number[];
required?: boolean;
nameArray?: string;
nameObject?: string;
event: ChangeEvent<HTMLTextAreaElement>;
}
export declare type TTextArea = {
value: any;
name?: string;
form?: string;
rows?: number;
title?: string;
dataExtra?: any;
error?: boolean;
focus?: boolean;
dataCy?: string;
symbol?: string;
range?: number[];
disabled?: boolean;
dataIndex?: number;
required?: boolean;
nameArray?: string;
dataObject?: string;
mediaTable?: boolean;
mediaPhone?: boolean;
validation?: boolean;
placeholder?: string;
sizeLoading?: string;
autoCorrect?: 'off' | 'on';
loadingContainer?: Node;
widthTable?: CSS.Property.Width;
widthPhone?: CSS.Property.Width;
rightLoading?: CSS.Property.Right;
colorLoading?: CSS.Property.Color;
bottomLoading?: CSS.Property.Bottom;
autoComplete?: 'off' | 'on' | 'nope';
maxWidthTable?: CSS.Property.MaxWidth;
maxWidthPhone?: CSS.Property.MaxWidth;
onChange?: (args: TOnChangeTextArea) => void;
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
onBlur?: (e: FocusEvent<HTMLTextAreaElement>) => void;
reference?: ((instance: HTMLTextAreaElement | null) => void) | RefObject<HTMLTextAreaElement> | null | undefined;
click?: boolean;
cStyles?: CSSObject;
cWidth?: CSS.Property.Width;
cMargin?: CSS.Property.Margin;
cDisplay?: CSS.Property.Display;
cMinWidth?: CSS.Property.MinWidth;
cMaxWidth?: CSS.Property.MaxWidth;
cPosition?: CSS.Property.Position;
cFlexDirection?: CSS.Property.FlexDirection;
cHoverDisplayTooltip?: CSS.Property.Display;
lTitle?: string;
lNotValue?: boolean;
lStyles?: CSSObject;
lActiveTitle?: boolean;
lColor?: CSS.Property.Color;
lBorder?: CSS.Property.Border;
lMargin?: CSS.Property.Margin;
lPadding?: CSS.Property.Padding;
lErrorColor?: CSS.Property.Color;
lFontSize?: CSS.Property.FontSize;
lOverflow?: CSS.Property.Overflow;
lNotValueColor?: CSS.Property.Color;
lTextAlign?: CSS.Property.TextAlign;
lFontFamily?: CSS.Property.FontFamily;
lWhiteSpace?: CSS.Property.WhiteSpace;
lTextOverflow?: CSS.Property.TextOverflow;
lHoverDisplayTooltip?: CSS.Property.Display;
taTitle?: string;
isLoading?: boolean;
taStyles?: CSSObject;
taActiveTitle?: boolean;
taColor?: CSS.Property.Color;
taWidth?: CSS.Property.Width;
taBorder?: CSS.Property.Border;
taPadding?: CSS.Property.Padding;
taOutline?: CSS.Property.Outline;
taFontSize?: CSS.Property.FontSize;
taBorderError?: CSS.Property.Border;
taBorderFocus?: CSS.Property.Border;
taMinHeight?: CSS.Property.MinHeight;
taColorDisabled?: CSS.Property.Color;
taTextAlign?: CSS.Property.TextAlign;
taBorderSuccess?: CSS.Property.Border;
taFontFamily?: CSS.Property.FontFamily;
taCursorDisabled?: CSS.Property.Cursor;
taTransform?: CSS.Property.TextTransform;
taColorDisabledClick?: CSS.Property.Color;
taBorderRadius?: CSS.Property.BorderRadius;
taCursorDisabledClick?: CSS.Property.Cursor;
taHoverDisplayTooltip?: CSS.Property.Display;
taFontFamilyDisabled?: CSS.Property.FontFamily;
taBackgroundColor?: CSS.Property.BackgroundColor;
taFontFamilyDisabledClick?: CSS.Property.FontFamily;
taBackgroundColorDisabled?: CSS.Property.BackgroundColor;
taBackgroundColorDisabledClick?: CSS.Property.BackgroundColor;
sStyles?: CSSObject;
sLeft?: CSS.Property.Left;
sColor?: CSS.Property.Color;
sBottom?: CSS.Property.Bottom;
sPosition?: CSS.Property.Position;
sFontSize?: CSS.Property.FontSize;
sColorDisabled?: CSS.Property.Color;
sFontFamily?: CSS.Property.FontFamily;
sColorDisabledClick?: CSS.Property.Color;
sFontFamilyDisabled?: CSS.Property.FontFamily;
sFontFamilyDisabledClick?: CSS.Property.FontFamily;
tStyles?: CSSObject;
tTop?: CSS.Property.Top;
tLeft?: CSS.Property.Left;
tColor?: CSS.Property.Color;
tZIndex?: CSS.Property.ZIndex;
tBorder?: CSS.Property.Border;
tBottom?: CSS.Property.Bottom;
tPadding?: CSS.Property.Padding;
tDisplay?: CSS.Property.Display;
tPosition?: CSS.Property.Position;
tFontSize?: CSS.Property.FontSize;
tTopAfterBefore?: CSS.Property.Top;
tBoxShadow?: CSS.Property.BoxShadow;
tLeftAfterBefore?: CSS.Property.Left;
tFontFamily?: CSS.Property.FontFamily;
tBorderAfterBefore?: CSS.Property.Border;
tBottomAfterBefore?: CSS.Property.Bottom;
tBorderRadius?: CSS.Property.BorderRadius;
tContentAfterBefore?: CSS.Property.Content;
tPositionAfterBefore?: CSS.Property.Position;
tBackgroundColor?: CSS.Property.BackgroundColor;
tPointerEventsAfterBefore?: CSS.Property.PointerEvents;
errorMessageRequired?: string;
errorMessageRange?: (min: number, max: number) => string;
tiStyles?: CSSObject;
tiColor?: CSS.Property.Color;
tiZIndex?: CSS.Property.ZIndex;
tiOpacity?: CSS.Property.Opacity;
tiPadding?: CSS.Property.Padding;
tiFontSize?: CSS.Property.FontSize;
tiMaxWidth?: CSS.Property.MaxWidth;
tiPosition?: CSS.Property.Position;
tiOverflow?: CSS.Property.Overflow;
tiMaxHeight?: CSS.Property.MaxHeight;
tiWhiteSpace?: CSS.Property.WhiteSpace;
tiFontFamily?: CSS.Property.FontFamily;
tiBorderRadius?: CSS.Property.BorderRadius;
tiTextOverflow?: CSS.Property.TextOverflow;
tiBackgroundColor?: CSS.Property.BackgroundColor;
tlStyles?: CSSObject;
tlColor?: CSS.Property.Color;
tlZIndex?: CSS.Property.ZIndex;
tlOpacity?: CSS.Property.Opacity;
tlPadding?: CSS.Property.Padding;
tlFontSize?: CSS.Property.FontSize;
tlMaxWidth?: CSS.Property.MaxWidth;
tlPosition?: CSS.Property.Position;
tlOverflow?: CSS.Property.Overflow;
tlMaxHeight?: CSS.Property.MaxHeight;
tlFontFamily?: CSS.Property.FontFamily;
tlWhiteSpace?: CSS.Property.WhiteSpace;
tlBorderRadius?: CSS.Property.BorderRadius;
tlTextOverflow?: CSS.Property.TextOverflow;
tlBackgroundColor?: CSS.Property.BackgroundColor;
bStyles?: CSSObject;
};
export declare type TTooltip = {
tStyles?: CSSObject;
tTop?: CSS.Property.Top;
tLeft?: CSS.Property.Left;
gs?: TDefaultTextAreaStyle;
tColor?: CSS.Property.Color;
tZIndex?: CSS.Property.ZIndex;
tBorder?: CSS.Property.Border;
tBottom?: CSS.Property.Bottom;
tPadding?: CSS.Property.Padding;
tFontSize?: CSS.Property.FontSize;
tDisplay?: CSS.Property.Display;
tPosition?: CSS.Property.Position;
tTopAfterBefore?: CSS.Property.Top;
tBoxShadow?: CSS.Property.BoxShadow;
tLeftAfterBefore?: CSS.Property.Left;
tFontFamily?: CSS.Property.FontFamily;
tBorderAfterBefore?: CSS.Property.Border;
tBottomAfterBefore?: CSS.Property.Bottom;
tBorderRadius?: CSS.Property.BorderRadius;
tContentAfterBefore?: CSS.Property.Content;
tPositionAfterBefore?: CSS.Property.Position;
tBackgroundColor?: CSS.Property.BackgroundColor;
tPointerEventsAfterBefore?: CSS.Property.PointerEvents;
};
export declare type TContainerTextArea = {
cStyles?: CSSObject;
mediaTable?: boolean;
mediaPhone?: boolean;
stylesTable?: CSSObject;
stylesPhone?: CSSObject;
gs?: TDefaultTextAreaStyle;
cWidth?: CSS.Property.Width;
cMargin?: CSS.Property.Margin;
widthTable?: CSS.Property.Width;
widthPhone?: CSS.Property.Width;
cDisplay?: CSS.Property.Display;
cMinWidth?: CSS.Property.MinWidth;
cMaxWidth?: CSS.Property.MaxWidth;
cPosition?: CSS.Property.Position;
maxWidthTable?: CSS.Property.MaxWidth;
maxWidthPhone?: CSS.Property.MaxWidth;
cHoverDisplayTooltip?: CSS.Property.Display;
cFlexDirection?: CSS.Property.FlexDirection;
};
export declare type TLabelTextArea = {
error?: boolean;
loading?: boolean;
lStyles?: CSSObject;
val?: string | number;
lActiveTitle?: boolean;
gs?: TDefaultTextAreaStyle;
valLabel?: string | number;
lColor?: CSS.Property.Color;
lBorder?: CSS.Property.Border;
lMargin?: CSS.Property.Margin;
lPadding?: CSS.Property.Padding;
axis: {
x?: number;
y?: number;
};
lErrorColor?: CSS.Property.Color;
lFontSize?: CSS.Property.FontSize;
lOverflow?: CSS.Property.Overflow;
lNotValueColor?: CSS.Property.Color;
lTextAlign?: CSS.Property.TextAlign;
lFontFamily?: CSS.Property.FontFamily;
lWhiteSpace?: CSS.Property.WhiteSpace;
lTextOverflow?: CSS.Property.TextOverflow;
lHoverDisplayTooltip?: CSS.Property.Display;
tlStyles?: CSSObject;
tlColor?: CSS.Property.Color;
tlZIndex?: CSS.Property.ZIndex;
tlOpacity?: CSS.Property.Opacity;
tlPadding?: CSS.Property.Padding;
tlFontSize?: CSS.Property.FontSize;
tlMaxWidth?: CSS.Property.MaxWidth;
tlPosition?: CSS.Property.Position;
tlOverflow?: CSS.Property.Overflow;
tlMaxHeight?: CSS.Property.MaxHeight;
tlFontFamily?: CSS.Property.FontFamily;
tlVisibility?: CSS.Property.Visibility;
tlWhiteSpace?: CSS.Property.WhiteSpace;
tlBorderRadius?: CSS.Property.BorderRadius;
tlTextOverflow?: CSS.Property.TextOverflow;
tlBackgroundColor?: CSS.Property.BackgroundColor;
};
export declare type TTextAreaV = {
click?: boolean;
error?: boolean;
taStyles?: CSSObject;
taActiveTitle?: boolean;
gs?: TDefaultTextAreaStyle;
valLabel?: string | number;
taColor?: CSS.Property.Color;
taWidth?: CSS.Property.Width;
taBorder?: CSS.Property.Border;
axis: {
x?: number;
y?: number;
};
taPadding?: CSS.Property.Padding;
taOutline?: CSS.Property.Outline;
taFontSize?: CSS.Property.FontSize;
taBorderFocus?: CSS.Property.Border;
taBorderError?: CSS.Property.Border;
taMinHeight?: CSS.Property.MinHeight;
taColorDisabled?: CSS.Property.Color;
taTextAlign?: CSS.Property.TextAlign;
taBorderSuccess?: CSS.Property.Border;
taCursorDisabled?: CSS.Property.Cursor;
taFontFamily?: CSS.Property.FontFamily;
taTransform?: CSS.Property.TextTransform;
taColorDisabledClick?: CSS.Property.Color;
taBorderRadius?: CSS.Property.BorderRadius;
taCursorDisabledClick?: CSS.Property.Cursor;
taHoverDisplayTooltip?: CSS.Property.Display;
taFontFamilyDisabled?: CSS.Property.FontFamily;
taBackgroundColor?: CSS.Property.BackgroundColor;
taFontFamilyDisabledClick?: CSS.Property.FontFamily;
taBackgroundColorDisabled?: CSS.Property.BackgroundColor;
taBackgroundColorDisabledClick?: CSS.Property.BackgroundColor;
};
export declare type TSymbolSpan = {
click?: boolean;
disabled?: boolean;
sStyles?: CSSObject;
sLeft?: CSS.Property.Left;
gs?: TDefaultTextAreaStyle;
sColor?: CSS.Property.Color;
sBottom?: CSS.Property.Bottom;
sFontSize?: CSS.Property.FontSize;
sPosition?: CSS.Property.Position;
sColorDisabled?: CSS.Property.Color;
sFontFamily?: CSS.Property.FontFamily;
sColorDisabledClick?: CSS.Property.Color;
sFontFamilyDisabled?: CSS.Property.FontFamily;
sFontFamilyDisabledClick?: CSS.Property.FontFamily;
};
export declare type TBoxTextArea = {
bStyles?: CSSObject;
tiStyles?: CSSObject;
val?: string | number;
taActiveTitle?: boolean;
gs?: TDefaultTextAreaStyle;
tiColor?: CSS.Property.Color;
tiZIndex?: CSS.Property.ZIndex;
tiOpacity?: CSS.Property.Opacity;
tiPadding?: CSS.Property.Padding;
axis?: {
x?: number;
y?: number;
};
tiFontSize?: CSS.Property.FontSize;
tiMaxWidth?: CSS.Property.MaxWidth;
tiMaxHeight?: CSS.Property.MaxHeight;
tiPosition?: CSS.Property.Position;
tiOverflow?: CSS.Property.Overflow;
tiFontFamily?: CSS.Property.FontFamily;
tiVisibility?: CSS.Property.Visibility;
tiWhiteSpace?: CSS.Property.WhiteSpace;
tiBorderRadius?: CSS.Property.BorderRadius;
tiTextOverflow?: CSS.Property.TextOverflow;
tiBackgroundColor?: CSS.Property.BackgroundColor;
};