catreact
Version:
Catavolt Core React Components
74 lines (73 loc) • 2.38 kB
TypeScript
/**
* Created by rburson on 1/14/16.
*/
import * as React from 'react';
import { CvState, CvProps } from './catreact-core';
import { Prop, EntityRec, PaneContext, Binary } from 'catavolt-sdk';
export interface CvPropState extends CvState {
binary: Binary;
}
export interface CvPropProps extends CvProps {
/**
* If supplied, this is called when the property is boolean, to allow custom rendering
*/
booleanRenderer?: (boolVal: boolean) => {};
/**
* If supplied, this is called when the property is a binary property, to allow custom rendering
* The given url may be a 'data' url with image data inline, or it may be a 'remote' url
*
*/
binaryRenderer?: (binaryUrl: string) => {};
/**
* className to apply to the property. wrapperElemProps will override this value
*/
className?: string;
/**
* style to apply to the property. wrapperElemProps will override this value
*/
style?: {};
handler?: (o: Prop) => {};
/**
* Function that allows for visibility control. Accepts sinlge param of sdk {Prop} object. Should return true
* if the component should be rendered, false if the component should be hidden.
*/
isVisible?: (o: Prop) => boolean;
/**
* The name of this property. The given (or enclosing) sdk {EnityRec} will be searched for the sdk {Prop} of this name
*/
propName: string;
/**
* Default to be used if this sdk {Prop} value is null or undefined
*/
defaultValue?: string;
/**
* The sdk {EntityRec} that owns this sdk {Prop}
*/
entityRec?: EntityRec;
/**
* The containing PaneContext
*/
paneContext?: PaneContext;
/**
* The wrapper element name for this prop value (should be html)
*/
wrapperElemName?: any;
/**
* The wrapper element props
*/
wrapperElemProps?: any;
/**
* Force the value of this prop to be the given value
*/
overrideValue?: string;
/**
* Set the named properties' values to the property's final resolved value
* i.e. 'title' on an html element for a tooltip
*/
dataPropNames?: Array<string>;
/**
* Class name to be set on the image control, if this is for an image.
*/
imageClassName?: string;
}
export declare var CvProp: React.ClassicComponentClass<CvPropProps>;