34 lines
867 B
TypeScript
34 lines
867 B
TypeScript
import React from "react";
|
|
import BaseWidget, { WidgetProps, WidgetState } from "./BaseWidget";
|
|
import { WidgetType } from "../constants/WidgetConstants";
|
|
import { Intent } from "@blueprintjs/core";
|
|
import SpinnerComponent from "../editorComponents/SpinnerComponent";
|
|
|
|
class SpinnerWidget extends BaseWidget<SpinnerWidgetProps, WidgetState> {
|
|
getPageView() {
|
|
return (
|
|
<SpinnerComponent
|
|
style={this.getPositionStyle()}
|
|
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";
|
|
}
|
|
}
|
|
|
|
export interface SpinnerWidgetProps extends WidgetProps {
|
|
size?: number;
|
|
value?: number;
|
|
ellipsize?: boolean;
|
|
intent?: Intent;
|
|
}
|
|
|
|
export default SpinnerWidget;
|