BulkTextarea
BulkTextarea
jsx
import BulkTextarea from '@semcore/ui/bulk-textarea';
<BulkTextarea>
<BulkTextarea.InputField/>
</BulkTextarea>;InputFieldProps
{...} & {...}| Name | Type | Description |
|---|---|---|
| id | string | Unique id |
| placeholder | string | Placeholder for field |
| value | string | string[] | String to render in textarea. OnChanging value, it will go throw paste pipeline |
| onBlur | (value: string | string[], e: ) => void | This component doesn't have default onChange callback, because we think that you need only the result after every changes/fixes |
| size | "m" | "l" | Size of component |
| state | "normal" | "valid" | "invalid" | State for show errors or valid(green) borders |
| disabled | boolean | Flag for disabling field |
| readonly | boolean | Flag for readonly field |
| minRows | number | Min rows |
| maxRows | number | Max rows |
| validateOn | ("blur" | "blurLine" | "paste")[] | List of available points to validate value |
| lineValidation | (line: string, lines: string[]) => {isValid: boolean; errorMessage: string } | Function to validate line |
| commonErrorMessage | string | Message for display error about whole field, not only one line. If set empty string, field will not have invalid state. |
| linesDelimiters | string[] | Delimiters (event.key) for lines |
| maxLines | number | Count of max lines in badge |
| pasteProps | Paste props | |
| lineProcessing | (line: string, lines: string[]) => string | Function for process line after it was blurred |
| onImmediatelyChange | (lines: string[], value: string) => void | Return lines from textarea immediately they changed (uses mutation observer on textarea node under the hood) Throttling may be required during processing this cb Internal |
BulkTextareaProps
| Name | Type | Description |
|---|---|---|
| value | InputFieldProps<string | string[]>["value"] | The current value |
| onChange | InputFieldProps<string | string[]>["onBlur"] | Callback triggered when the onBlur event is emmited |
| placeholder | InputFieldProps<string | string[]>["placeholder"] | Placeholder text |
| size | InputFieldProps<string | string[]>["size"] | Component size |
| state | InputFieldProps<string | string[]>["state"] | State for show errors or valid(green) borders |
| disabled | InputFieldProps<string | string[]>["disabled"] | Defines whether the textarea is disabled |
| readonly | InputFieldProps<string | string[]>["readonly"] | Defines whether the textarea is readonly |
| minRows | InputFieldProps<string | string[]>["minRows"] | Minimum number of rows to display |
| maxRows | InputFieldProps<string | string[]>["maxRows"] | Maximum number of rows to display |
| validateOn | InputFieldProps<string | string[]>["validateOn"] | An event when a validation occurs |
| lineValidation | InputFieldProps<string | string[]>["lineValidation"] | A function to valide the line |
| linesDelimiters | InputFieldProps<string | string[]>["linesDelimiters"] | Line delimeters |
| pasteProps | InputFieldProps<string | string[]>["pasteProps"] | Defines the props for paste action |
| maxLines | InputFieldProps<string | string[]>["maxLines"] | Maximum number of allowed lines/values |
| lineProcessing | InputFieldProps<string | string[]>["lineProcessing"] | Function to process individual lines during input |
| errors | InputFieldProps<string | string[]>["errors"] | List of errors |
| showErrors | boolean | Defines whether to show errors or not |