PromucFlow_constructor/app/client/src/utils/PropertyControlRegistry.tsx

34 lines
1.1 KiB
TypeScript
Raw Normal View History

import React from "react";
import PropertyControlFactory from "./PropertyControlFactory";
import InputTextControl, {
InputControlProps,
2019-09-24 12:11:32 +00:00
} from "../propertyControls/InputTextControl";
import DropDownControl, {
DropDownControlProps,
2019-09-24 12:11:32 +00:00
} from "../propertyControls/DropDownControl";
import SwitchControl, {
SwitchControlProps,
} from "../propertyControls/SwitchControl";
class PropertyControlRegistry {
static registerPropertyControlBuilders() {
PropertyControlFactory.registerControlBuilder("INPUT_TEXT", {
buildPropertyControl(controlProps: InputControlProps): JSX.Element {
return <InputTextControl {...controlProps} />;
},
});
PropertyControlFactory.registerControlBuilder("DROP_DOWN", {
buildPropertyControl(controlProps: DropDownControlProps): JSX.Element {
return <DropDownControl {...controlProps} />;
},
});
PropertyControlFactory.registerControlBuilder("SWITCH", {
buildPropertyControl(controlProps: SwitchControlProps): JSX.Element {
return <SwitchControl {...controlProps} />;
},
});
}
}
export default PropertyControlRegistry;