From a43780719ea3b6b42ffc821c458c68e5b87dc5b6 Mon Sep 17 00:00:00 2001 From: ajnart Date: Thu, 5 Jan 2023 22:43:27 +0900 Subject: [PATCH] Add new types of options --- src/widgets/widgets.d.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets.d.ts b/src/widgets/widgets.d.ts index 729ed2e07..19e41ed12 100644 --- a/src/widgets/widgets.d.ts +++ b/src/widgets/widgets.d.ts @@ -1,6 +1,5 @@ -import { IconSun, TablerIcon } from '@tabler/icons'; +import { TablerIcon } from '@tabler/icons'; import React from 'react'; -import { BaseTileProps } from '../components/Dashboard/Tiles/type'; // Type of widgets which are safed to config export type IWidget = { @@ -32,6 +31,7 @@ export type IWidgetOptionValue = | IMultiSelectOptionValue | ISwitchOptionValue | ITextInputOptionValue + | ISliderInputOptionValue | INumberInputOptionValue; // will show a multi-select with specified data @@ -56,7 +56,16 @@ export type ITextInputOptionValue = { // will show a number-input export type INumberInputOptionValue = { type: 'number'; - defaultValue: string; + defaultValue: number; +}; + +// will show a slider-input +export type ISliderInputOptionValue = { + type: 'slider'; + defaultValue: number; + min: number; + max: number; + step: number; }; // is used to type the widget definitions which will be used to display all widgets