@jaspersoft/jv-input-controls
Version:
Component for rendering input controls for a report or ad hoc view using visualize.js
22 lines (21 loc) • 1.45 kB
TypeScript
import { InputControlProperties } from '@jaspersoft/jv-tools';
export declare const isSelectInputControl: (props: InputControlProperties) => boolean;
/**
* Get the default value from the properties or params. The default value will be determined as follows:
* 1. Check if the "params" is defined in the properties and get the values from it. If it's a Select, then it will
* return an array. Otherwise, it will return a string.
* 2. If the IC is a Select and the "state.value.options" is defined in the properties. Then, it will return the
* values from each option that it's property selected=true.
* 3. If the "state.value" is defined in the properties. Then, it will return the value from it. If it's a boolean
* IC, then it will return a boolean. Otherwise, it will return a string.
* 4. If the code reaches here, means there is no default value set for the IC. The code will set one for it: If the
* control is a boolean, then the default value is false. Otherwise, it is an empty string.
* @param props
*/
export declare const getDefaultValueFromParamsAndProps: (props: InputControlProperties & {
params?: {
[key: string]: string[];
};
}) => string | boolean | string[];
export declare const getTheInitialValue: (initialValue: undefined | string | string[] | boolean) => string;
export declare const getTheInitialValueForSingleSelectInputControl: (initialValue: undefined | string | string[]) => string | string[];