generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
163 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,111 @@ | ||
import type { FormDefinition } from "./core/formDefinition"; | ||
|
||
export const exampleModalDefinition: FormDefinition = { | ||
title: "Example form", | ||
name: "example-form", | ||
fields: [ | ||
{ | ||
name: "Name", | ||
description: "It is named how?", | ||
input: { type: "text" }, | ||
}, | ||
{ | ||
name: "age", | ||
label: "Age", | ||
description: "How old", | ||
input: { type: "number" }, | ||
}, | ||
{ | ||
name: "dateOfBirth", | ||
label: "Date of Birth", | ||
description: "When were you born?", | ||
input: { type: "date" }, | ||
}, | ||
{ | ||
name: "timeOfDay", | ||
label: "Time of day", | ||
description: "The time you can do this", | ||
input: { type: "time" }, | ||
}, | ||
{ | ||
name: "is_family", | ||
label: "Is family", | ||
description: "If it is part of the family", | ||
input: { type: "toggle" }, | ||
}, | ||
{ | ||
name: "favorite_book", | ||
label: "Favorite book", | ||
description: "Pick one", | ||
input: { type: "note", folder: "Books" }, | ||
}, | ||
{ | ||
name: "multi_example", | ||
label: "Multi select folder", | ||
description: "Allows to pick many notes from a folder", | ||
input: { type: "multiselect", source: "notes", folder: "Books" }, | ||
}, | ||
{ | ||
name: "multi_example_2", | ||
label: "Multi select fixed", | ||
description: "Allows to pick many notes from a fixed list", | ||
input: { type: "multiselect", source: "fixed", options: ['Android', 'iOS', 'Windows', 'MacOS', 'Linux', 'Solaris', 'MS2'] }, | ||
}, | ||
{ | ||
name: "best_fried", | ||
label: "Best friend", | ||
description: "Pick one", | ||
input: { | ||
type: 'select', | ||
source: 'notes', | ||
folder: 'People' | ||
} | ||
}, | ||
{ | ||
name: 'dataview_example', | ||
label: 'Dataview example', | ||
description: 'Only people matching the dataview query will be shown', | ||
input: { | ||
type: 'dataview', | ||
query: 'dv.pages("#person").filter(p => p.age < 30).map(p => p.file.name)' | ||
} | ||
}, | ||
{ | ||
name: "friendship_level", | ||
label: "Friendship level", | ||
description: "How good friends are you?", | ||
input: { | ||
type: 'slider', | ||
min: 0, | ||
max: 10 | ||
} | ||
}, | ||
{ | ||
name: "favorite_meal", | ||
label: "Favorite meal", | ||
description: "Pick one option", | ||
input: { | ||
type: "select", source: "fixed", options: [ | ||
{ value: "pizza", label: "🍕 Pizza" }, | ||
{ value: "pasta", label: "🍝 Pasta" }, | ||
{ value: "burger", label: "🍔 Burger" }, | ||
{ value: "salad", label: "🥗 Salad" }, | ||
{ value: "steak", label: "🥩 Steak" }, | ||
{ value: "sushi", label: "🍣 Sushi" }, | ||
{ value: "ramen", label: "🍜 Ramen" }, | ||
{ value: "tacos", label: "🌮 Tacos" }, | ||
{ value: "fish", label: "🐟 Fish" }, | ||
{ value: "chicken", label: "🍗 Chicken" } | ||
] | ||
}, | ||
}, | ||
|
||
|
||
], | ||
title: "Example form", | ||
name: "example-form", | ||
fields: [ | ||
{ | ||
name: "Name", | ||
description: "It is named how?", | ||
input: { type: "text" }, | ||
}, | ||
{ | ||
name: "age", | ||
label: "Age", | ||
description: "How old", | ||
input: { type: "number" }, | ||
}, | ||
{ | ||
name: "dateOfBirth", | ||
label: "Date of Birth", | ||
description: "When were you born?", | ||
input: { type: "date" }, | ||
}, | ||
{ | ||
name: "timeOfDay", | ||
label: "Time of day", | ||
description: "The time you can do this", | ||
input: { type: "time" }, | ||
}, | ||
{ | ||
name: "is_family", | ||
label: "Is family", | ||
description: "If it is part of the family", | ||
input: { type: "toggle" }, | ||
}, | ||
{ | ||
name: "favorite_book", | ||
label: "Favorite book", | ||
description: "Pick one", | ||
input: { type: "note", folder: "Books" }, | ||
}, | ||
{ | ||
name: "multi_example", | ||
label: "Multi select folder", | ||
description: "Allows to pick many notes from a folder", | ||
input: { type: "multiselect", source: "notes", folder: "Books" }, | ||
}, | ||
{ | ||
name: "multi_example_2", | ||
label: "Multi select fixed", | ||
description: "Allows to pick many notes from a fixed list", | ||
input: { type: "multiselect", source: "fixed", options: ['Android', 'iOS', 'Windows', 'MacOS', 'Linux', 'Solaris', 'MS2'] }, | ||
}, | ||
{ | ||
name: "best_fried", | ||
label: "Best friend", | ||
description: "Pick one", | ||
input: { | ||
type: 'select', | ||
source: 'notes', | ||
folder: 'People' | ||
} | ||
}, | ||
{ | ||
name: 'dataview_example', | ||
label: 'Dataview example', | ||
description: 'Only people matching the dataview query will be shown', | ||
input: { | ||
type: 'dataview', | ||
query: 'dv.pages("#person").filter(p => p.age < 30).map(p => p.file.name)' | ||
} | ||
}, | ||
{ | ||
name: "friendship_level", | ||
label: "Friendship level", | ||
description: "How good friends are you?", | ||
input: { | ||
type: 'slider', | ||
min: 0, | ||
max: 10 | ||
} | ||
}, | ||
{ | ||
name: "favorite_meal", | ||
label: "Favorite meal", | ||
description: "Pick one option", | ||
input: { | ||
type: "select", source: "fixed", options: [ | ||
{ value: "pizza", label: "🍕 Pizza" }, | ||
{ value: "pasta", label: "🍝 Pasta" }, | ||
{ value: "burger", label: "🍔 Burger" }, | ||
{ value: "salad", label: "🥗 Salad" }, | ||
{ value: "steak", label: "🥩 Steak" }, | ||
{ value: "sushi", label: "🍣 Sushi" }, | ||
{ value: "ramen", label: "🍜 Ramen" }, | ||
{ value: "tacos", label: "🌮 Tacos" }, | ||
{ value: "fish", label: "🐟 Fish" }, | ||
{ value: "chicken", label: "🍗 Chicken" } | ||
] | ||
}, | ||
}, | ||
{ | ||
name: "some notes", | ||
label: "Multi line notes", | ||
description: "Put your thouhts here", | ||
input: { | ||
type: "textarea", | ||
} | ||
} | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters