synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
33 lines (32 loc) • 1.43 kB
TypeScript
/// <reference types="react" />
import { FieldProps } from '@sage-bionetworks/rjsf-core';
export declare enum PropertyType {
STRING = "String",
INTEGER = "Integer",
FLOAT = "Float",
BOOLEAN = "Boolean",
DATETIME = "Datetime"
}
export declare enum AdditionalPropertyWidget {
TextWidget = "TextWidget",
DateTimeWidget = "DateTimeWidget",
CheckboxWidget = "CheckboxWidget"
}
export declare function guessPropertyType(list: Array<any>): PropertyType;
export declare function transformDataFromPropertyType(list: Array<any>, propertyType: PropertyType): (string | number)[] | boolean[] | (string | undefined)[] | (number | undefined)[];
export declare function getWidgetFromPropertyType(propertyType: PropertyType): AdditionalPropertyWidget;
/**
* react-jsonschema-form SchemaField override for "additionalProperties" only.
* Modifies the data to provide full compatibility with Synapse annotations features.
*
* This component provides these enhancements to the SchemaField:
* - Supports selecting a type, and changing the input widget appropriately
* - Identifying the type on mount
* - Treat all field values as arrays
* - When the last array value is removed, remove the entire key from the form.
* @param props
* @returns
*/
export declare function AdditionalPropertiesSchemaField<T>(props: FieldProps<T> & {
onDropPropertyClick: (key: string) => (event: any) => void;
}): JSX.Element;