import { Meta, Preview, Props, Story } from "@storybook/addon-docs/blocks";
import { boolean, number, select, text, withKnobs } from "@storybook/addon-knobs";
import TextareaNoValidation from "../../TextareaNoValidation";
import StorybookContainer from "../../../shared/StorybookContainer";

<Meta title="Forms/Textarea no validation" component={TextareaNoValidation} decorators={[withKnobs]} />

# Textarea no validation

## Demo

<Preview>
  <Story name="Demo" parameters={{options:{showPanel:true}}}>
    {{
      components: {
        "h-textarea-no-validation": TextareaNoValidation,
        StorybookContainer,
      },
      props: {
        id: {
          default: text("id", "textarea-id"),
        },
        name: {
          default: text("name", "textarea-name"),
        },
        label: {
          default: text("label", "Label text"),
        },
        disabled: {
          default: boolean("disabled", false),
        },
        rows: {
          default: number("rows", 4),
        },
        cols: {
          default: number("columns", 32),
        },
        placeholder: {
          default: text("placeholder", "Enter your message here"),
        },
        readonly: {
          default: boolean("readonly", false),
        },
        required: {
          default: boolean("required", false),
        },
        spellcheck: {
          default: select(
            "spellcheck",
            {
              True: "true",
              False: "false",
              Default: "default",
            },
            "default",
          ),
        },
        wrap: {
          default: select(
            "wrap",
            {
              Hard: "hard",
              Soft: "soft",
              Off: "off",
            },
            "soft",
          ),
        },
      },
      data() {
        return {
          value: "",
          rulesProps: {
            required: true,
          },
        };
      },
      template: `
        <h-textarea-no-validation
          v-model="value"
          :id="id"
          :name="name"
          :label="label"
          :disabled="disabled"
          :rows="rows"
          :cols="cols"
          :placeholder="placeholder"
          :readonly="readonly"
          :required="required"
          :spellcheck="spellcheck"
          :wrap="wrap"
          :rules="rulesProps"
        />
      `,
    }}
  </Story>
</Preview>


## Props
<Props of={TextareaNoValidation} />
