@omnia/fx-models
Version:
Provide Omnia Fx Models Stuffs.
46 lines (45 loc) • 2.18 kB
TypeScript
import { ScopedSlots } from "../../ux";
import { MultilingualContext } from "../../ux/MultilingualContext";
import { PropertyConfiguration } from "./PropertyConfiguration";
import { PropertyDefinition, PropertyDisplaySettingsType, PropertyEditorSettingsType, PropertySetupSettingsType, PropertyValueType } from "./PropertyDefinition";
/**
* Interface for webcomponent rendering a property value belonging to a property definition
* */
export interface IPropertyDisplayRenderer<TPropertyDef extends PropertyDefinition<any, any, any>> {
valueBind: PropertyValueType<TPropertyDef>;
displaySettings: PropertyDisplaySettingsType<TPropertyDef>;
setupSettings?: PropertySetupSettingsType<TPropertyDef>;
renderTextOnly?: boolean;
persistentLabels?: boolean;
scopedSlots?: ScopedSlots<IPropertyRendererScopedSlots>;
}
export interface IPropertyRendererScopedSlots {
empty?: JSX.Element;
}
export interface IPropertyEditorRenderer<TPropertyDef extends PropertyDefinition<any, any, any>> {
valueBind: PropertyValueType<TPropertyDef>;
editorSettings: PropertyEditorSettingsType<TPropertyDef>;
displaySettings: PropertyDisplaySettingsType<TPropertyDef>;
setupSettings?: PropertySetupSettingsType<TPropertyDef>;
onValueBindChanged(newValue: PropertyValueType<TPropertyDef>): void;
disabled?: boolean;
propertyStyles?: PropertyStyles;
}
export interface IPropertyConfigurationRenderer<TPropertyDef extends PropertyDefinition<any, any, any>> {
valueBind: PropertyConfiguration<TPropertyDef>;
/**
* Call each time the configuration is considered valid, i.e. the values of the configuration is good
* Also called when no longer valid, but with value null
* @param newValue null for invalid config state, value matching a complete configuration
*/
onConfigurationValid(validConfig?: PropertyConfiguration<TPropertyDef>): void;
showLockConfiguration?: boolean;
renderEditSettings?: boolean;
defaultConfiguration?: PropertyConfiguration<TPropertyDef>;
multilingualContext?: MultilingualContext;
}
export interface PropertyStyles {
outlined: boolean;
rounded: boolean;
filled: boolean;
}