@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
63 lines (62 loc) • 2.15 kB
TypeScript
//@ts-ignore
import { Component } from 'react';
import { FieldRowProps } from '../FieldRow';
import { GcProps, WidgetAnnotation } from '../../Annotations/AnnotationTypes';
import { FormFieldMapping } from '../../ViewerOptions';
export type ControlBaseProps = {
gcProps: GcProps;
title: string;
} & FieldRowProps;
export type CommonInputProperties = {
key: string;
name: string;
disabled: boolean;
inputmode?: string;
placeholder: string;
value: any;
title: string;
autocomplete?: string;
/**
* The readOnly prop means we don’t intend for the input to be modified by user input.
* */
readOnly?: boolean;
/**
* The pattern attribute specifies a regular expression that the <input> or <textarea>
* element's value is checked against.
* @example
* pattern for email validation: "\S+@\S+\.\S+"
* */
pattern?: string;
/**
* The minimum value to accept for this input.
* Applicable for date or number input.
* */
min?: any;
/**
* The maximum value to accept for this input.
* Applicable for date or number input.
* */
max?: any;
/**
* The maximum number of characters the input should accept.
* */
maxLength?: number;
/**
* The minimum number of characters long the input can be and still be considered valid.
* */
minLength?: number;
/**
* The spellcheck property is an enumerated attribute defines whether the element may be checked for spelling errors.
* Note that the spellcheck property may have limited support by some browser vendors.
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text#spellcheck
* */
spellCheck?: 'true' | 'false';
};
/**
* Base class for the FormFiller UI controls.
**/
export declare class ControlBase extends Component<ControlBaseProps, any> {
onFieldValueChange(newValue: string | string[]): void;
getCommonProps(): CommonInputProperties;
getPlaceholder(field: WidgetAnnotation, mappingSettings?: FormFieldMapping): string;
}