) {
return (
<>
{this.renderChildren()}
>
);
}
getDirection(): LayoutDirection {
return this.props.positioning === Positioning.Vertical
? LayoutDirection.Vertical
: LayoutDirection.Horizontal;
}
getPageView() {
let height = 0;
const snapRows = getCanvasSnapRows(
this.props.bottomRow,
this.props.mobileBottomRow,
this.props.isMobile,
this.props.appPositioningType === AppPositioningTypes.AUTO,
);
height = snapRows * GridDefaults.DEFAULT_GRID_ROW_HEIGHT;
const style: CSSProperties = {
width: "100%",
height: this.props.isListWidgetCanvas ? "auto" : `${height}px`,
background: "none",
position: "relative",
};
// This div is the DropTargetComponent alternative for the page view
// DropTargetComponent and this div are responsible for the canvas height
return (
{this.renderAsContainerComponent(this.getCanvasProps())}
);
}
getCanvasView() {
if (!this.props.dropDisabled) {
return this.renderAsDropTarget();
}
return this.getPageView();
}
static getDerivedPropertiesMap(): DerivedPropertiesMap {
return {};
}
static getDefaultPropertiesMap(): Record {
return {};
}
// TODO Find a way to enforce this, (dont let it be set)
static getMetaPropertiesMap(): Record {
return {};
}
}
export const CONFIG = {
type: CanvasWidget.getWidgetType(),
name: "Canvas",
hideCard: true,
eagerRender: true,
defaults: {
rows: 0,
columns: 0,
widgetName: "Canvas",
version: 1,
detachFromLayout: true,
flexLayers: [],
responsiveBehavior: ResponsiveBehavior.Fill,
minWidth: FILL_WIDGET_MIN_WIDTH,
},
properties: {
derived: CanvasWidget.getDerivedPropertiesMap(),
default: CanvasWidget.getDefaultPropertiesMap(),
meta: CanvasWidget.getMetaPropertiesMap(),
config: CanvasWidget.getPropertyPaneConfig(),
},
};
export default CanvasWidget;