upend/webui/src/stories/Selector.stories.ts

73 lines
1.3 KiB
TypeScript

import type { Meta, StoryObj } from "@storybook/svelte";
import Selector from "../components/utils/Selector.svelte";
import RouterDecorator from "./RouterDecorator.svelte";
const meta: Meta<Selector> = {
title: "Widgets/Selector",
component: Selector,
tags: ["autodocs"],
argTypes: {
onInput: {
action: "input",
},
onFocus: {
action: "focus",
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
decorators: [() => RouterDecorator as any], // due to upobject link in selected state
};
export default meta;
type Story = StoryObj<Selector>;
export const Attribute: Story = {
args: {
types: ["Attribute", "NewAttribute"],
},
};
export const AllValues: Story = {
args: {
types: [
"Attribute",
"NewAttribute",
"Address",
"NewAddress",
"String",
"Number",
],
},
};
export const Entities: Story = {
args: {
types: ["Address", "NewAddress"],
},
};
export const ExistingEntities: Story = {
args: {
types: ["Address"],
},
};
export const Strings: Story = {
args: {
types: ["String"],
},
};
export const Numbers: Story = {
args: {
types: ["Number"],
},
};
export const MultipleValues: Story = {
args: {
types: ["String", "Number"],
},
};