Form.story.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!-- Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import Form from './Form.vue'
  4. </script>
  5. <template>
  6. <Story title="Form" group="form">
  7. <Variant title="Default">
  8. <Form
  9. :schema="[
  10. {
  11. type: 'text',
  12. name: 'title',
  13. label: 'Title',
  14. },
  15. {
  16. type: 'textarea',
  17. name: 'text',
  18. label: 'Text',
  19. },
  20. ]"
  21. />
  22. </Variant>
  23. <Variant title="Login">
  24. <Form
  25. :schema="[
  26. {
  27. type: 'text',
  28. name: 'login',
  29. label: 'Username / Email',
  30. placeholder: 'Please enter your username or email address',
  31. inputClass: 'block mt-1 w-1/2 h-14 text-sm rounded',
  32. validation: 'required',
  33. },
  34. {
  35. type: 'password',
  36. label: 'Password',
  37. name: 'password',
  38. placeholder: 'Please enter your password',
  39. inputClass: 'block mt-1 w-1/2 h-14 text-sm rounded',
  40. validation: 'required',
  41. },
  42. {
  43. isLayout: true,
  44. element: 'div',
  45. attrs: {
  46. class: 'mt-2 w-1/2 flex grow items-center justify-between',
  47. },
  48. children: [
  49. {
  50. type: 'checkbox',
  51. label: 'Remember me',
  52. name: 'remember_me',
  53. wrapperClass: 'inline-flex items-center',
  54. innerClass: 'mr-2',
  55. },
  56. {
  57. isLayout: true,
  58. component: 'CommonLink',
  59. props: {
  60. class: 'text-right',
  61. link: '#',
  62. },
  63. children: 'Forgot password?',
  64. },
  65. ],
  66. },
  67. ]"
  68. />
  69. </Variant>
  70. </Story>
  71. </template>