PromucFlow_constructor/app/client/src/widgets/SpinnerWidget.tsx

34 lines
867 B
TypeScript
Raw Normal View History

2019-08-29 11:22:09 +00:00
import React from "react";
2019-09-09 09:08:54 +00:00
import BaseWidget, { WidgetProps, WidgetState } from "./BaseWidget";
2019-08-29 11:22:09 +00:00
import { WidgetType } from "../constants/WidgetConstants";
import { Intent } from "@blueprintjs/core";
2019-03-15 12:53:45 +00:00
import SpinnerComponent from "../editorComponents/SpinnerComponent";
2019-09-09 09:08:54 +00:00
class SpinnerWidget extends BaseWidget<SpinnerWidgetProps, WidgetState> {
getPageView() {
2019-03-15 12:53:45 +00:00
return (
<SpinnerComponent
2019-03-19 14:05:48 +00:00
style={this.getPositionStyle()}
2019-03-15 12:53:45 +00:00
widgetId={this.props.widgetId}
key={this.props.widgetId}
size={this.props.size}
value={this.props.value}
intent={this.props.intent}
/>
);
}
getWidgetType(): WidgetType {
return "SPINNER_WIDGET";
}
}
2019-09-09 09:08:54 +00:00
export interface SpinnerWidgetProps extends WidgetProps {
2019-03-15 12:53:45 +00:00
size?: number;
value?: number;
ellipsize?: boolean;
intent?: Intent;
}
export default SpinnerWidget;