2021-10-12 08:04:51 +00:00
|
|
|
import { ButtonVariantTypes } from "components/constants";
|
2022-01-21 10:19:10 +00:00
|
|
|
import { Colors } from "constants/Colors";
|
2022-05-04 09:45:57 +00:00
|
|
|
import { THEMEING_TEXT_SIZES } from "constants/ThemeConstants";
|
2022-01-21 10:19:10 +00:00
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import Widget from "./widget";
|
2021-09-09 15:10:22 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Stats Box",
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
needsMeta: true,
|
|
|
|
|
isCanvas: true,
|
|
|
|
|
defaults: {
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 14,
|
|
|
|
|
columns: 16,
|
2021-12-14 07:55:58 +00:00
|
|
|
animateLoading: true,
|
2021-09-09 15:10:22 +00:00
|
|
|
widgetName: "Statbox",
|
|
|
|
|
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: {
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 4,
|
|
|
|
|
cols: 36,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
position: { top: 0, left: 1 },
|
|
|
|
|
props: {
|
|
|
|
|
text: "Page Views",
|
2022-05-04 09:45:57 +00:00
|
|
|
fontSize: "0.75rem",
|
2021-09-09 15:10:22 +00:00
|
|
|
textColor: "#999999",
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "TEXT_WIDGET",
|
|
|
|
|
size: {
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 4,
|
|
|
|
|
cols: 36,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
position: {
|
2022-01-21 10:19:10 +00:00
|
|
|
top: 4,
|
2021-09-09 15:10:22 +00:00
|
|
|
left: 1,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
text: "2.6 M",
|
2022-05-04 09:45:57 +00:00
|
|
|
fontSize: THEMEING_TEXT_SIZES.lg,
|
2021-09-09 15:10:22 +00:00
|
|
|
fontStyle: "BOLD",
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "TEXT_WIDGET",
|
|
|
|
|
size: {
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 4,
|
|
|
|
|
cols: 36,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
position: {
|
2022-01-21 10:19:10 +00:00
|
|
|
top: 8,
|
2021-09-09 15:10:22 +00:00
|
|
|
left: 1,
|
|
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
text: "21% more than last month",
|
2022-05-04 09:45:57 +00:00
|
|
|
fontSize: "0.75rem",
|
2021-09-09 15:10:22 +00:00
|
|
|
textColor: Colors.GREEN,
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: "ICON_BUTTON_WIDGET",
|
|
|
|
|
size: {
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 8,
|
|
|
|
|
cols: 16,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
position: {
|
|
|
|
|
top: 2,
|
2022-01-21 10:19:10 +00:00
|
|
|
left: 46,
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
|
|
|
|
props: {
|
|
|
|
|
iconName: "arrow-top-right",
|
|
|
|
|
buttonStyle: "PRIMARY",
|
2021-10-12 08:04:51 +00:00
|
|
|
buttonVariant: ButtonVariantTypes.PRIMARY,
|
2021-09-09 15:10:22 +00:00
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|