UNPKG

@shopware-ag/meteor-component-library

Version:

The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).

79 lines (74 loc) 1.86 kB
import { action } from "@storybook/addon-actions"; import MtDatepicker from "./mt-datepicker.vue"; import type { StoryObj } from "@storybook/vue3"; import type { SlottedMeta } from "@/_internal/story-helper"; import { fn } from "@storybook/test"; export type MtDatepickerMeta = SlottedMeta< typeof MtDatepicker, "default" | "updateModelValue" | "modelValue" >; export default { title: "Components/mt-datepicker", component: MtDatepicker, render: (args) => ({ template: ` <mt-datepicker v-bind="args" v-model="currentValue" @update:modelValue="args.updateModelValue" ></mt-datepicker>`, components: { MtDatepicker }, data() { return { currentValue: "" }; }, watch: { "args.modelValue"(v) { this.currentValue = v; }, }, created() { this.currentValue = args.modelValue; }, setup: () => { return { args, }; }, }), argTypes: { dateType: { control: { type: "select" }, options: ["datetime", "date", "time"], }, timeZone: { control: { type: "select" }, options: [ "UTC", "America/New_York", "America/Chicago", "America/Denver", "America/Los_Angeles", "Europe/London", "Europe/Paris", "Europe/Berlin", "Europe/Rome", "Europe/Madrid", "Asia/Tokyo", "Asia/Shanghai", "Asia/Kolkata", "Australia/Sydney", "Australia/Melbourne", "Pacific/Auckland", ], }, }, args: { label: "Datepicker", updateModelValue: fn(action("update:modelValue")), modelValue: null, dateType: "datetime", timeZone: "UTC", }, } as MtDatepickerMeta; export type MtDatepickerStory = StoryObj<MtDatepickerMeta>; export const Default: MtDatepickerStory = {};