chore: fix Surface story, add prefilled story
parent
d501395387
commit
9c8b05f041
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue