2019-02-11 18:22:23 +00:00
|
|
|
import { Component } from "react"
|
|
|
|
|
import React from "react"
|
|
|
|
|
import { PositionType, CSSUnit } from "../constants/WidgetConstants"
|
2019-02-10 13:06:05 +00:00
|
|
|
/***
|
|
|
|
|
* Components are responsible for binding render inputs to corresponding UI SDKs
|
|
|
|
|
*/
|
2019-02-11 18:22:23 +00:00
|
|
|
abstract class BaseComponent<T extends IComponentProps> extends Component<T> {
|
2019-02-10 13:06:05 +00:00
|
|
|
|
|
|
|
|
constructor(componentProps: T) {
|
|
|
|
|
super(componentProps)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface BaseStyle {
|
|
|
|
|
height?: number
|
|
|
|
|
width?: number
|
2019-02-11 18:22:23 +00:00
|
|
|
positionType: PositionType
|
|
|
|
|
xPosition: number
|
|
|
|
|
yPosition: number
|
|
|
|
|
xPositionUnit: CSSUnit
|
|
|
|
|
yPositionUnit: CSSUnit
|
|
|
|
|
heightUnit?: CSSUnit
|
|
|
|
|
widthUnit?: CSSUnit
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IComponentProps {
|
|
|
|
|
widgetId: string
|
2019-02-11 18:22:23 +00:00
|
|
|
style: BaseStyle
|
2019-02-10 13:06:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default BaseComponent
|