Merge pull request #1212 from Tagaishi/widget-option-tooltips

 InfoCard
This commit is contained in:
Meier Lukas
2023-08-05 23:57:22 +02:00
committed by GitHub
9 changed files with 904 additions and 69 deletions

View File

@@ -15,7 +15,6 @@ import {
Title,
createStyles,
useMantineTheme,
InputProps,
} from '@mantine/core';
import { useForm } from '@mantine/form';
import {
@@ -54,6 +53,8 @@ const definition = defineWidget({
name: {
type: 'text',
defaultValue: '',
info: true,
infoLink: "https://homarr.dev/docs/widgets/bookmarks/",
},
items: {
type: 'draggable-editable-list',

View File

@@ -31,7 +31,7 @@ export type IWidget<TKey extends string, TDefinition extends IWidgetDefinition>
type MakeLessSpecific<T> = T extends boolean ? boolean : T;
// Types of options that can be specified for the widget edit modal
export type IWidgetOptionValue =
export type IWidgetOptionValue = (
| IMultiSelectOptionValue
| ISwitchOptionValue
| ITextInputOptionValue
@@ -41,7 +41,8 @@ export type IWidgetOptionValue =
| IDraggableListInputValue
| IDraggableEditableListInputValue<any>
| IMultipleTextInputOptionValue
| ILocationOptionValue;
| ILocationOptionValue
) & ICommonWidgetOptions;
// Interface for data type
interface DataType {
@@ -49,6 +50,11 @@ interface DataType {
value: string;
}
interface ICommonWidgetOptions {
info?: boolean;
infoLink?: string;
};
// will show a multi-select with specified data
export type IMultiSelectOptionValue = {
type: 'multi-select';
@@ -96,6 +102,7 @@ export type ISliderInputOptionValue = {
inputProps?: Partial<SliderProps>;
};
// will show a custom location selector
type ILocationOptionValue = {
type: 'location';
defaultValue: { latitude: number; longitude: number };