chore: fix Surface story, add prefilled story

feat/type-attributes
Tomáš Mládek 2023-01-24 19:15:34 +01:00
parent d501395387
commit 9c8b05f041
2 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import type { Meta, StoryObj } from "@storybook/svelte"; import type { Meta, StoryObj } from "@storybook/svelte";
import Surface from "../views/Surface.svelte"; import Surface from "../views/Surface.svelte";
import FullscreenDecorator from "./FullscreenDecorator.svelte"; import FullscreenDecorator from "./FullscreenDecorator.svelte";
import RouterDecorator from "./RouterDecorator.svelte";
const meta: Meta<Surface> = { const meta: Meta<Surface> = {
title: "Views/Surface", title: "Views/Surface",
@ -9,10 +10,17 @@ const meta: Meta<Surface> = {
parameters: { parameters: {
layout: "fullscreen", layout: "fullscreen",
}, },
decorators: [() => FullscreenDecorator], decorators: [() => FullscreenDecorator, () => RouterDecorator],
}; };
export default meta; export default meta;
type Story = StoryObj<Surface>; type Story = StoryObj<Surface>;
export const Default: Story = {}; export const Empty: Story = {};
export const Prefilled: Story = {
args: {
x: "X_AXIS_ATTR",
y: "Y_AXIS_ATTR"
}
}

View File

@ -14,8 +14,8 @@
); );
const urlParams = new URLSearchParams(urlSearch); const urlParams = new URLSearchParams(urlSearch);
let x: string = urlParams.get("x"); export let x: string = urlParams.get("x");
let y: string = urlParams.get("y"); export let y: string = urlParams.get("y");
let viewMode = "link"; let viewMode = "link";
let currentX = NaN; let currentX = NaN;