2021-09-09 15:10:22 +00:00
|
|
|
import Widget from "./widget";
|
|
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import { GRID_DENSITY_MIGRATION_V1 } from "widgets/constants";
|
2021-09-23 15:14:24 +00:00
|
|
|
import { ButtonVariantTypes } from "components/constants";
|
|
|
|
|
import { Colors } from "constants/Colors";
|
2021-09-09 15:10:22 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Form",
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
needsMeta: true,
|
|
|
|
|
isCanvas: true,
|
|
|
|
|
defaults: {
|
2021-09-20 10:43:44 +00:00
|
|
|
rows: 10 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
columns: 6 * GRID_DENSITY_MIGRATION_V1,
|
2021-09-09 15:10:22 +00:00
|
|
|
widgetName: "Form",
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
children: [],
|
|
|
|
|
blueprint: {
|
|
|
|
|
view: [
|
|
|
|
|
{
|
|
|
|
|
type: "CANVAS_WIDGET",
|
|
|
|
|
position: { top: 0, left: 0 },
|
|
|
|
|
props: {
|
|
|
|
|
containerStyle: "none",
|
|
|
|
|
canExtend: false,
|
|
|
|
|
detachFromLayout: true,
|
|
|
|
|
children: [],
|
|
|
|
|
version: 1,
|
|
|
|
|
blueprint: {
|
|
|
|
|
view: [
|
|
|
|
|
{
|
|
|
|
|
type: "TEXT_WIDGET",
|
|
|
|
|
size: {
|
|
|
|
|
rows: 1 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
cols: 6 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
},
|
|
|
|
|
position: { top: 1, left: 1.5 },
|
|
|
|
|
props: {
|
|
|
|
|
text: "Form",
|
|
|
|
|
fontSize: "HEADING1",
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "FORM_BUTTON_WIDGET",
|
|
|
|
|
size: {
|
|
|
|
|
rows: 1 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
cols: 4 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
},
|
|
|
|
|
position: {
|
2021-09-20 10:43:44 +00:00
|
|
|
top: 8.25 * GRID_DENSITY_MIGRATION_V1,
|
2021-09-09 15:10:22 +00:00
|
|
|
left: 11.6 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
text: "Submit",
|
2021-10-12 08:04:51 +00:00
|
|
|
buttonVariant: ButtonVariantTypes.PRIMARY,
|
2021-09-23 15:14:24 +00:00
|
|
|
buttonColor: Colors.GREEN,
|
2021-09-09 15:10:22 +00:00
|
|
|
disabledWhenInvalid: true,
|
|
|
|
|
resetFormOnClick: true,
|
|
|
|
|
recaptchaV2: false,
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "FORM_BUTTON_WIDGET",
|
|
|
|
|
size: {
|
|
|
|
|
rows: 1 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
cols: 4 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
},
|
|
|
|
|
position: {
|
2021-09-20 10:43:44 +00:00
|
|
|
top: 8.25 * GRID_DENSITY_MIGRATION_V1,
|
2021-09-09 15:10:22 +00:00
|
|
|
left: 7.5 * GRID_DENSITY_MIGRATION_V1,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
text: "Reset",
|
2021-10-12 08:04:51 +00:00
|
|
|
buttonVariant: ButtonVariantTypes.SECONDARY,
|
2021-09-23 15:14:24 +00:00
|
|
|
buttonColor: Colors.GREEN,
|
2021-09-09 15:10:22 +00:00
|
|
|
disabledWhenInvalid: false,
|
|
|
|
|
resetFormOnClick: true,
|
|
|
|
|
recaptchaV2: false,
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|