import React from "react"; import { ControlConfig, FormHTMLElement, ControlTemplateUtilitiesProps } from "./template.control.utilities.props"; import { BadgeType, ControlType, OnChangeConfig } from "./types"; import { FormStrings } from "../form.props"; /** * Custom templates can make use of the available utility functions */ export interface RenderRemoveProps { className: string; required: boolean; remove?: boolean; type: ControlType; disabled?: boolean; data: boolean; dataLocation: string; dictionaryId: string; onChange: (config: OnChangeConfig) => void; } export declare function renderRemove(props: RenderRemoveProps): JSX.Element; export interface RenderBadgeProps { className: string; badge?: BadgeType; badgeDescription?: string; } export declare function renderBadge(props: RenderBadgeProps): React.ReactNode; export interface RenderConstValueIndicatorProps { const?: boolean; data: any; className: string; disabled?: boolean; strings: FormStrings; dataLocation: string; dictionaryId: string; onChange: (config: OnChangeConfig) => void; } export declare function renderConstValueIndicator(props: RenderConstValueIndicatorProps): React.ReactNode; export interface RenderDefaultValueIndicatorProps { default?: any; data: any; className: string; disabled?: boolean; strings: FormStrings; dataLocation: string; dictionaryId: string; onChange: (config: OnChangeConfig) => void; } /** * Renders an indicator that signifies that the value * displayed is a default value */ export declare function renderDefaultValueIndicator(props: RenderDefaultValueIndicatorProps): React.ReactNode; export interface HandleChangeProps { onChange: (config: OnChangeConfig) => void; dataLocation: string; dictionaryId: string; } export declare function handleChange(props: HandleChangeProps): (config: OnChangeConfig) => void; export interface HandleSetDefaultValueProps { onChange: (config: OnChangeConfig) => void; dataLocation: string; dictionaryId: string; default?: any; } export declare function handleSetDefaultValue(props: HandleSetDefaultValueProps): () => void; export interface HandleSetConstValueProps { onChange: (config: OnChangeConfig) => void; dataLocation: string; dictionaryId: string; const?: any; } export declare function handleSetConstValue(props: HandleSetConstValueProps): () => void; export interface HandleRemoveProps { onChange: (config: OnChangeConfig) => void; dataLocation: string; dictionaryId: string; data: any; } export interface RenderInvalidMessageProps { className: string; invalidMessage: string; displayValidationInline?: boolean; } /** * Renders an invalid message */ export declare function renderInvalidMessage(props: RenderInvalidMessageProps): React.ReactNode; export interface RenderRequiredProps { required: boolean; className: string; } /** * Renders an indicator that a field is required */ export declare function renderRequired(props: RenderRequiredProps): React.ReactNode; export interface UpdateValidityProps { ref: React.MutableRefObject; invalidMessage: string; } /** * updates the validity * * Use: * useEffect(() => { * updateValidity(); * }); */ export declare function updateValidity(props: UpdateValidityProps): (refs?: React.RefObject[]) => void; export interface ReportValidityProps { ref: React.MutableRefObject; invalidMessage: string; displayValidationBrowserDefault?: boolean; } export interface GetConfigProps extends ControlTemplateUtilitiesProps { /** * The form element React ref */ ref: React.MutableRefObject; } export declare function getConfig(props: GetConfigProps): ControlConfig; export interface HandleUpdateValueToDefaultValueProps { onChange: (config: OnChangeConfig) => void; dataLocation: string; dictionaryId: string; default: any; } /** * Explicitly updates the default value as the value */ export declare function handleUpdateValueToDefaultValue(props: HandleUpdateValueToDefaultValueProps): () => void;