UNPKG

goobs-frontend

Version:

A comprehensive React-based libary for building modern web applications

48 lines 2.02 kB
import { default as React } from 'react'; import { FieldStyleOverrides } from '../../Shell'; export interface MACAddressFieldProps { initialValue?: string; /** * Emits the formatted MAC string. Was previously a synthetic * ChangeEvent — collapsed to the value alone during the FieldShell * migration. */ onChange?: (value: string) => void; label?: React.ReactNode; helperText?: string; /** Error message rendered below the input; sets aria-invalid. */ error?: string | boolean; /** Stable test selector — emitted as `data-field` on the wrapper. */ dataField?: string; /** Stable test selector — emitted as `data-field-name` on the wrapper. */ dataFieldName?: string; required?: boolean; disabled?: boolean; styles?: FieldStyleOverrides; onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void; onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void; onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void; onClick?: (event: React.MouseEvent<HTMLInputElement>) => void; onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void; placeholder?: string; id?: string; /** * Form-engine binding key. Inside a `<Form>` with `name` set, the formatted * MAC string is written into the engine on change and the field is marked * touched on blur; the shell auto-derives error/required for this name. * Outside a form this is inert and behaviour is byte-for-byte unchanged. */ name?: string; autoComplete?: string; } /** * A specialized text field for MAC address management * - Validates MAC addresses in proper format * - Automatically adds colons after every 2 hex digits * - Only allows valid MAC address format (XX:XX:XX:XX:XX:XX) * - Converts all inputs to uppercase * - Requires complete MAC addresses */ declare const MACAddressField: React.FC<MACAddressFieldProps>; export default MACAddressField; //# sourceMappingURL=index.d.ts.map