@worksafevictoria/wcl7.5 1.1.0-beta.7 → 1.1.0-beta.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/.env +1 -3
  2. package/.storybook/preview.js +2 -2
  3. package/README.md +4 -4
  4. package/ci/build/build_validation.yml +2 -2
  5. package/ci/release/beta.yml +4 -3
  6. package/ci/release/master.yml +4 -3
  7. package/jest.config.js +10 -8
  8. package/lib/utility.js +1 -1
  9. package/package.json +13 -12
  10. package/src/assets/icons/AppFooter/x-ws-footer.svg +10 -0
  11. package/src/assets/icons/AppFooter/x-ww-footer.svg +28 -0
  12. package/src/assets/icons/SocialShare/x-icon-white.svg +28 -0
  13. package/src/assets/icons/WSV-reversed.svg +20 -0
  14. package/src/assets/icons/contrast.svg +4 -0
  15. package/src/assets/icons/lang.svg +13 -0
  16. package/src/assets/icons/login.svg +4 -0
  17. package/src/components/Common/CardGrid/cardgrid.stories.js +4 -57
  18. package/src/components/Common/CardGrid/index.vue +23 -3
  19. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  20. package/src/components/Common/CardGridItem/index.vue +21 -5
  21. package/src/components/Containers/Carousel/index.stories.js +30 -0
  22. package/src/components/Containers/Carousel/index.vue +165 -0
  23. package/src/components/Containers/HomepageHeader/index.vue +26 -12
  24. package/src/components/Containers/HomepageHeaderNew/index.stories.js +75 -0
  25. package/src/components/Containers/HomepageHeaderNew/index.vue +198 -0
  26. package/src/components/Containers/SectionGroup/index.vue +4 -4
  27. package/src/components/Containers/Subheader/index.vue +25 -19
  28. package/src/components/Global/AlertStrip/index.stories.js +1 -0
  29. package/src/components/Global/AppFooter/FooterSocialShare/index.vue +1 -1
  30. package/src/components/Global/AppFooter/index.stories.js +1 -0
  31. package/src/components/Global/AppFooter/index.vue +30 -28
  32. package/src/components/Global/AppHeader/index.vue +49 -52
  33. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +71 -0
  34. package/src/components/Global/AppHeaderNew/ModalSearch/styles.scss +43 -0
  35. package/src/components/Global/AppHeaderNew/includes.scss +71 -0
  36. package/src/components/Global/AppHeaderNew/index.stories.js +74 -0
  37. package/src/components/Global/AppHeaderNew/index.vue +1176 -0
  38. package/src/components/Global/AppHeaderNew/mobile.scss +269 -0
  39. package/src/components/Global/AppHeaderNew/styles.scss +647 -0
  40. package/src/components/Global/ContrastMode/index.stories.js +1 -0
  41. package/src/components/Global/ContrastMode/index.vue +1 -1
  42. package/src/components/Global/Cookies/index.vue +141 -141
  43. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +2 -1
  44. package/src/components/Global/GlobalNotice/index.stories.js +7 -1
  45. package/src/components/Global/GlobalNotice/index.vue +23 -2
  46. package/src/components/Global/HeroHeader/index.stories.js +3 -4
  47. package/src/components/Global/HeroHeader/index.vue +28 -29
  48. package/src/components/Global/ProgressBar/index.stories.js +6 -16
  49. package/src/components/Global/SocialShare/index.vue +3 -2
  50. package/src/components/Global/Strip/index.stories.js +1 -17
  51. package/src/components/Global/Strip/index.vue +8 -4
  52. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -17
  53. package/src/components/Paragraphs/Accordion/index.stories.js +1 -0
  54. package/src/components/Paragraphs/Breakout/index.stories.js +1 -0
  55. package/src/components/Paragraphs/BrowseContent/index.stories.js +1 -0
  56. package/src/components/Paragraphs/BrowseContent/index.vue +42 -31
  57. package/src/components/Paragraphs/Calculator/Constants.js +2 -2
  58. package/src/components/Paragraphs/Calculator/index.stories.js +1 -0
  59. package/src/components/Paragraphs/Directory/Records/CJ/index.vue +3 -3
  60. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +5 -5
  61. package/src/components/Paragraphs/Directory/Records/PRS/index.vue +2 -2
  62. package/src/components/Paragraphs/Directory/Records/PRS/recordContent.vue +3 -3
  63. package/src/components/Paragraphs/Directory/Records/PRS/recordDetails.vue +3 -3
  64. package/src/components/Paragraphs/Directory/Records/index.vue +3 -3
  65. package/src/components/Paragraphs/Directory/index.vue +42 -31
  66. package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +35 -39
  67. package/src/components/Paragraphs/ListGroup/index.vue +55 -46
  68. package/src/components/Paragraphs/ListGroup/list-group.stories.js +35 -31
  69. package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +34 -30
  70. package/src/components/Paragraphs/MarketingBanner/index.stories.js +4 -18
  71. package/src/components/Paragraphs/ProofPoints/index.stories.js +19 -20
  72. package/src/components/Paragraphs/RelatedInformation/index.stories.js +11 -21
  73. package/src/components/Paragraphs/RelatedInformation/index.vue +12 -6
  74. package/src/components/Paragraphs/RelatedInformation/styles.scss +1 -3
  75. package/src/components/Paragraphs/RichText/index.stories.js +2 -1
  76. package/src/components/Paragraphs/ScrollSpy/index.stories.js +20 -26
  77. package/src/components/Paragraphs/ScrollSpy/index.vue +27 -12
  78. package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +1 -0
  79. package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
  80. package/src/components/Paragraphs/Statistics/index.stories.js +1 -0
  81. package/src/components/Paragraphs/Statistics/index.vue +1 -0
  82. package/src/components/Paragraphs/TabbedCards/index.stories.js +8 -27
  83. package/src/components/Paragraphs/TabbedCards/index.vue +58 -92
  84. package/src/components/Paragraphs/Tabs/index.stories.js +1 -0
  85. package/src/components/Paragraphs/TabulatedData/index.stories.js +6 -5
  86. package/src/components/Paragraphs/TabulatedData/index.vue +63 -35
  87. package/src/components/Paragraphs/TaskFinder/index.stories.js +9 -32
  88. package/src/components/Paragraphs/TaskFinder/index.vue +3 -3
  89. package/src/components/Paragraphs/TaskFinder/pdf/index.vue +1 -1
  90. package/src/components/Paragraphs/TaskFinder/task-finder-column.vue +1 -1
  91. package/src/components/Paragraphs/TextMedia/index.stories.js +1 -0
  92. package/src/components/Paragraphs/TextMedia/index.vue +5 -1
  93. package/src/components/Paragraphs/VideoGrid/index.stories.js +1 -0
  94. package/src/components/Paragraphs/VideoPlayer/index.stories.js +1 -13
  95. package/src/components/Paragraphs/Webform/index.stories.js +94 -57
  96. package/src/components/Paragraphs/Webform/index.vue +11 -8
  97. package/src/components/SubComponents/Breadcrumb/index.stories.js +3 -11
  98. package/src/components/SubComponents/CardGroup/index.stories.js +1 -30
  99. package/src/components/SubComponents/CardGroup/index.vue +33 -27
  100. package/src/components/SubComponents/CtaButton/index.stories.js +1 -24
  101. package/src/components/SubComponents/CtaButton/index.vue +27 -25
  102. package/src/components/SubComponents/FormAddressPostcode/index.stories.js +3 -28
  103. package/src/components/SubComponents/FormInstance/components/alert/index.vue +129 -0
  104. package/src/components/SubComponents/FormInstance/components/custom/base-formio.js +77 -0
  105. package/src/components/SubComponents/FormInstance/components/custom/code-formio.js +35 -0
  106. package/src/components/SubComponents/FormInstance/components/custom/custom-formio-registry.js +30 -0
  107. package/src/components/SubComponents/FormInstance/components/custom/range-formio.js +121 -0
  108. package/src/components/SubComponents/FormInstance/components/custom/rating-formio.js +121 -0
  109. package/src/components/SubComponents/FormInstance/components/custom/scale-formio.js +99 -0
  110. package/src/components/SubComponents/FormInstance/components/custom/tableselect-formio.js +200 -0
  111. package/src/components/SubComponents/FormInstance/components/handler/index.vue +208 -0
  112. package/src/components/SubComponents/FormInstance/components/renderer/index.vue +282 -0
  113. package/src/components/SubComponents/FormInstance/index.test.js +65 -0
  114. package/src/components/SubComponents/FormInstance/index.vue +55 -6
  115. package/src/components/SubComponents/FormInstance/models/base-form-element.js +338 -0
  116. package/src/components/SubComponents/FormInstance/models/form-callback-queue.js +45 -0
  117. package/src/components/SubComponents/FormInstance/models/form-utils.js +50 -0
  118. package/src/components/SubComponents/FormInstance/models/overrides/address.js +141 -0
  119. package/src/components/SubComponents/FormInstance/models/overrides/autocomplete.js +41 -0
  120. package/src/components/SubComponents/FormInstance/models/overrides/checkbox.js +14 -0
  121. package/src/components/SubComponents/FormInstance/models/overrides/checkboxes.js +49 -0
  122. package/src/components/SubComponents/FormInstance/models/overrides/code.js +27 -0
  123. package/src/components/SubComponents/FormInstance/models/overrides/composite.js +57 -0
  124. package/src/components/SubComponents/FormInstance/models/overrides/container.js +65 -0
  125. package/src/components/SubComponents/FormInstance/models/overrides/currency.js +17 -0
  126. package/src/components/SubComponents/FormInstance/models/overrides/customcomposite.js +41 -0
  127. package/src/components/SubComponents/FormInstance/models/overrides/date.js +126 -0
  128. package/src/components/SubComponents/FormInstance/models/overrides/datelist.js +73 -0
  129. package/src/components/SubComponents/FormInstance/models/overrides/detail.js +38 -0
  130. package/src/components/SubComponents/FormInstance/models/overrides/email-confirm.js +12 -0
  131. package/src/components/SubComponents/FormInstance/models/overrides/email.js +7 -0
  132. package/src/components/SubComponents/FormInstance/models/overrides/file.js +56 -0
  133. package/src/components/SubComponents/FormInstance/models/overrides/flexbox.js +33 -0
  134. package/src/components/SubComponents/FormInstance/models/overrides/hidden.js +24 -0
  135. package/src/components/SubComponents/FormInstance/models/overrides/likert.js +40 -0
  136. package/src/components/SubComponents/FormInstance/models/overrides/markup.js +47 -0
  137. package/src/components/SubComponents/FormInstance/models/overrides/message.js +53 -0
  138. package/src/components/SubComponents/FormInstance/models/overrides/moretext.js +64 -0
  139. package/src/components/SubComponents/FormInstance/models/overrides/multiple.js +51 -0
  140. package/src/components/SubComponents/FormInstance/models/overrides/number.js +22 -0
  141. package/src/components/SubComponents/FormInstance/models/overrides/options-other.js +34 -0
  142. package/src/components/SubComponents/FormInstance/models/overrides/page.js +7 -0
  143. package/src/components/SubComponents/FormInstance/models/overrides/phonenumber.js +13 -0
  144. package/src/components/SubComponents/FormInstance/models/overrides/radio.js +31 -0
  145. package/src/components/SubComponents/FormInstance/models/overrides/range.js +19 -0
  146. package/src/components/SubComponents/FormInstance/models/overrides/rating.js +47 -0
  147. package/src/components/SubComponents/FormInstance/models/overrides/scale.js +33 -0
  148. package/src/components/SubComponents/FormInstance/models/overrides/section.js +39 -0
  149. package/src/components/SubComponents/FormInstance/models/overrides/select.js +28 -0
  150. package/src/components/SubComponents/FormInstance/models/overrides/signature.js +7 -0
  151. package/src/components/SubComponents/FormInstance/models/overrides/submit.js +23 -0
  152. package/src/components/SubComponents/FormInstance/models/overrides/table.js +48 -0
  153. package/src/components/SubComponents/FormInstance/models/overrides/tablerow.js +20 -0
  154. package/src/components/SubComponents/FormInstance/models/overrides/tableselect.js +66 -0
  155. package/src/components/SubComponents/FormInstance/models/overrides/testing.js +47 -0
  156. package/src/components/SubComponents/FormInstance/models/overrides/text.js +7 -0
  157. package/src/components/SubComponents/FormInstance/models/overrides/textarea.js +26 -0
  158. package/src/components/SubComponents/FormInstance/models/overrides/textformat.js +13 -0
  159. package/src/components/SubComponents/FormInstance/models/overrides/time.js +13 -0
  160. package/src/components/SubComponents/FormInstance/models/overrides/twig.js +118 -0
  161. package/src/components/SubComponents/FormInstance/models/overrides/unknown.js +24 -0
  162. package/src/components/SubComponents/FormInstance/models/overrides/url.js +13 -0
  163. package/src/components/SubComponents/FormInstance/services/convert-form-element.js +49 -0
  164. package/src/components/SubComponents/FormInstance/services/form-api.js +47 -0
  165. package/src/components/SubComponents/FormInstance/services/form-render-parser.js +156 -0
  166. package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +61 -0
  167. package/src/components/SubComponents/FormInstance/services/logic-linker.js +73 -0
  168. package/src/components/SubComponents/FormInstance/services/logic-parser.js +173 -0
  169. package/src/components/SubComponents/FormInstance/services/registry-factory.js +284 -0
  170. package/src/components/SubComponents/FormInstance/stories/Documentation.mdx +234 -0
  171. package/src/components/SubComponents/FormInstance/stories/advanced.stories.js +109 -0
  172. package/src/components/SubComponents/FormInstance/stories/basic.stories.js +73 -0
  173. package/src/components/SubComponents/FormInstance/stories/build.stories.js +27 -0
  174. package/src/components/SubComponents/FormInstance/stories/composite.stories.js +90 -0
  175. package/src/components/SubComponents/FormInstance/stories/condition.stories.js +83 -0
  176. package/src/components/SubComponents/FormInstance/stories/custom.stories.js +69 -0
  177. package/src/components/SubComponents/FormInstance/stories/date.stories.js +76 -0
  178. package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
  179. package/src/components/SubComponents/FormInstance/stories/form-alert.stories.js +93 -0
  180. package/src/components/SubComponents/FormInstance/stories/index.stories.js +63 -0
  181. package/src/components/SubComponents/FormInstance/stories/layout.stories.js +85 -0
  182. package/src/components/SubComponents/FormInstance/stories/markup.stories.js +91 -0
  183. package/src/components/SubComponents/FormInstance/stories/mocks/address.json +298 -0
  184. package/src/components/SubComponents/FormInstance/stories/mocks/advancedhtml.json +23 -0
  185. package/src/components/SubComponents/FormInstance/stories/mocks/autocomplete.json +34 -0
  186. package/src/components/SubComponents/FormInstance/stories/mocks/basichtml.json +15 -0
  187. package/src/components/SubComponents/FormInstance/stories/mocks/checkboxes.json +102 -0
  188. package/src/components/SubComponents/FormInstance/stories/mocks/checkboxesother.json +197 -0
  189. package/src/components/SubComponents/FormInstance/stories/mocks/container.json +134 -0
  190. package/src/components/SubComponents/FormInstance/stories/mocks/customcomposite.json +469 -0
  191. package/src/components/SubComponents/FormInstance/stories/mocks/date.json +19 -0
  192. package/src/components/SubComponents/FormInstance/stories/mocks/datelist.json +752 -0
  193. package/src/components/SubComponents/FormInstance/stories/mocks/datetime.json +89 -0
  194. package/src/components/SubComponents/FormInstance/stories/mocks/details.json +63 -0
  195. package/src/components/SubComponents/FormInstance/stories/mocks/email.json +18 -0
  196. package/src/components/SubComponents/FormInstance/stories/mocks/emailconfirm.json +110 -0
  197. package/src/components/SubComponents/FormInstance/stories/mocks/fieldset.json +62 -0
  198. package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
  199. package/src/components/SubComponents/FormInstance/stories/mocks/flexbox.json +58 -0
  200. package/src/components/SubComponents/FormInstance/stories/mocks/hidden.json +35 -0
  201. package/src/components/SubComponents/FormInstance/stories/mocks/horizontalrule.json +14 -0
  202. package/src/components/SubComponents/FormInstance/stories/mocks/jahd.json +1359 -0
  203. package/src/components/SubComponents/FormInstance/stories/mocks/label.json +14 -0
  204. package/src/components/SubComponents/FormInstance/stories/mocks/likert.json +375 -0
  205. package/src/components/SubComponents/FormInstance/stories/mocks/message.json +86 -0
  206. package/src/components/SubComponents/FormInstance/stories/mocks/more.json +19 -0
  207. package/src/components/SubComponents/FormInstance/stories/mocks/multiple.json +142 -0
  208. package/src/components/SubComponents/FormInstance/stories/mocks/number.json +35 -0
  209. package/src/components/SubComponents/FormInstance/stories/mocks/quad.json +249 -0
  210. package/src/components/SubComponents/FormInstance/stories/mocks/radios.json +70 -0
  211. package/src/components/SubComponents/FormInstance/stories/mocks/radiosother.json +176 -0
  212. package/src/components/SubComponents/FormInstance/stories/mocks/range.json +58 -0
  213. package/src/components/SubComponents/FormInstance/stories/mocks/rating.json +42 -0
  214. package/src/components/SubComponents/FormInstance/stories/mocks/rule-disabled-value.json +66 -0
  215. package/src/components/SubComponents/FormInstance/stories/mocks/rule-enabled-value.json +43 -0
  216. package/src/components/SubComponents/FormInstance/stories/mocks/rule-hidden-value.json +68 -0
  217. package/src/components/SubComponents/FormInstance/stories/mocks/rule-required-value.json +69 -0
  218. package/src/components/SubComponents/FormInstance/stories/mocks/rule-visible-value.json +157 -0
  219. package/src/components/SubComponents/FormInstance/stories/mocks/sameas.json +66 -0
  220. package/src/components/SubComponents/FormInstance/stories/mocks/scale.json +200 -0
  221. package/src/components/SubComponents/FormInstance/stories/mocks/section.json +63 -0
  222. package/src/components/SubComponents/FormInstance/stories/mocks/select.json +41 -0
  223. package/src/components/SubComponents/FormInstance/stories/mocks/selectother.json +115 -0
  224. package/src/components/SubComponents/FormInstance/stories/mocks/signature.json +25 -0
  225. package/src/components/SubComponents/FormInstance/stories/mocks/styles.json +81 -0
  226. package/src/components/SubComponents/FormInstance/stories/mocks/table-select.json +472 -0
  227. package/src/components/SubComponents/FormInstance/stories/mocks/table.json +154 -0
  228. package/src/components/SubComponents/FormInstance/stories/mocks/telephone.json +18 -0
  229. package/src/components/SubComponents/FormInstance/stories/mocks/textarea.json +22 -0
  230. package/src/components/SubComponents/FormInstance/stories/mocks/textfield.json +66 -0
  231. package/src/components/SubComponents/FormInstance/stories/mocks/time.json +20 -0
  232. package/src/components/SubComponents/FormInstance/stories/mocks/token.json +260 -0
  233. package/src/components/SubComponents/FormInstance/stories/mocks/twig.json +154 -0
  234. package/src/components/SubComponents/FormInstance/stories/mocks/url.json +18 -0
  235. package/src/components/SubComponents/FormInstance/stories/mocks/value.json +17 -0
  236. package/src/components/SubComponents/FormInstance/stories/mocks/wizard.json +353 -0
  237. package/src/components/SubComponents/FormInstance/stories/options.stories.js +98 -0
  238. package/src/components/SubComponents/FormInstance/stories/style.stories.js +55 -0
  239. package/src/components/SubComponents/FormInstance/stories/wizard.stories.js +55 -0
  240. package/src/components/SubComponents/FormInstance/style.scss +185 -0
  241. package/src/components/SubComponents/FormInstance/tests/address.test.js +255 -0
  242. package/src/components/SubComponents/FormInstance/tests/advancedhtml.test.js +31 -0
  243. package/src/components/SubComponents/FormInstance/tests/autocomplete.test.js +38 -0
  244. package/src/components/SubComponents/FormInstance/tests/basichtml.test.js +31 -0
  245. package/src/components/SubComponents/FormInstance/tests/checkbox.test.js +29 -0
  246. package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +44 -0
  247. package/src/components/SubComponents/FormInstance/tests/checkboxesother.test.js +91 -0
  248. package/src/components/SubComponents/FormInstance/tests/container.test.js +66 -0
  249. package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +86 -0
  250. package/src/components/SubComponents/FormInstance/tests/date.test.js +63 -0
  251. package/src/components/SubComponents/FormInstance/tests/datelist.test.js +136 -0
  252. package/src/components/SubComponents/FormInstance/tests/datetime.test.js +54 -0
  253. package/src/components/SubComponents/FormInstance/tests/details.test.js +58 -0
  254. package/src/components/SubComponents/FormInstance/tests/email.test.js +28 -0
  255. package/src/components/SubComponents/FormInstance/tests/emailconfirm.test.js +79 -0
  256. package/src/components/SubComponents/FormInstance/tests/fieldset.test.js +63 -0
  257. package/src/components/SubComponents/FormInstance/tests/flexbox.test.js +71 -0
  258. package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +120 -0
  259. package/src/components/SubComponents/FormInstance/tests/form.test.js +26 -0
  260. package/src/components/SubComponents/FormInstance/tests/hidden.test.js +52 -0
  261. package/src/components/SubComponents/FormInstance/tests/horizontalrule.test.js +31 -0
  262. package/src/components/SubComponents/FormInstance/tests/label.test.js +31 -0
  263. package/src/components/SubComponents/FormInstance/tests/likert.test.js +38 -0
  264. package/src/components/SubComponents/FormInstance/tests/message.test.js +89 -0
  265. package/src/components/SubComponents/FormInstance/tests/more.test.js +32 -0
  266. package/src/components/SubComponents/FormInstance/tests/multiple.test.js +71 -0
  267. package/src/components/SubComponents/FormInstance/tests/number.test.js +51 -0
  268. package/src/components/SubComponents/FormInstance/tests/radios.test.js +34 -0
  269. package/src/components/SubComponents/FormInstance/tests/radiosother.test.js +79 -0
  270. package/src/components/SubComponents/FormInstance/tests/range.test.js +32 -0
  271. package/src/components/SubComponents/FormInstance/tests/rating.test.js +38 -0
  272. package/src/components/SubComponents/FormInstance/tests/rule-disabled.test.js +128 -0
  273. package/src/components/SubComponents/FormInstance/tests/rule-enabled-value.test.js +78 -0
  274. package/src/components/SubComponents/FormInstance/tests/rule-hidden.test.js +131 -0
  275. package/src/components/SubComponents/FormInstance/tests/rule-required-value.test.js +144 -0
  276. package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +619 -0
  277. package/src/components/SubComponents/FormInstance/tests/sameas.test.js +94 -0
  278. package/src/components/SubComponents/FormInstance/tests/scale.test.js +43 -0
  279. package/src/components/SubComponents/FormInstance/tests/section.test.js +63 -0
  280. package/src/components/SubComponents/FormInstance/tests/select.test.js +45 -0
  281. package/src/components/SubComponents/FormInstance/tests/selectother.test.js +82 -0
  282. package/src/components/SubComponents/FormInstance/tests/signature.test.js +32 -0
  283. package/src/components/SubComponents/FormInstance/tests/styles.test.js +73 -0
  284. package/src/components/SubComponents/FormInstance/tests/table-select.test.js +93 -0
  285. package/src/components/SubComponents/FormInstance/tests/table.test.js +97 -0
  286. package/src/components/SubComponents/FormInstance/tests/telephone.test.js +29 -0
  287. package/src/components/SubComponents/FormInstance/tests/textarea.test.js +29 -0
  288. package/src/components/SubComponents/FormInstance/tests/textfield.test.js +48 -0
  289. package/src/components/SubComponents/FormInstance/tests/time.test.js +29 -0
  290. package/src/components/SubComponents/FormInstance/tests/token.test.js +33 -0
  291. package/src/components/SubComponents/FormInstance/tests/twig.test.js +74 -0
  292. package/src/components/SubComponents/FormInstance/tests/url.test.js +45 -0
  293. package/src/components/SubComponents/FormInstance/tests/value.test.js +31 -0
  294. package/src/components/SubComponents/FormInstance/tests/wizard.test.js +145 -0
  295. package/src/components/SubComponents/Icon/index.stories.js +1 -6
  296. package/src/components/SubComponents/MediaPlayer/index.stories.js +1 -6
  297. package/src/components/SubComponents/Pagination/index.stories.js +3 -8
  298. package/src/components/SubComponents/ResourceGroup/List/index.stories.js +3 -2
  299. package/src/components/SubComponents/ResourceGroup/index.vue +206 -173
  300. package/src/components/SubComponents/Search/index.vue +4 -4
  301. package/src/components/SubComponents/SingleImage/index.stories.js +2 -16
  302. package/src/components/SubComponents/VideoThumbnail/index.stories.js +1 -0
  303. package/src/components/SubComponents/VideoThumbnail/index.vue +4 -7
  304. package/src/includes/scss/mixins/src/grid.scss +4 -2
  305. package/src/includes/scss/mixins/src/units.scss +25 -4
  306. package/src/main.js +2 -10
  307. package/src/mock/app-header-new.js +715 -0
  308. package/src/mock/carousel-items.js +57 -0
  309. package/src/mock/jest.fileMock.js +1 -0
  310. package/vite.config.js +28 -15
  311. package/src/components/SubComponents/FormInstance/index.stories.js +0 -8
@@ -0,0 +1,234 @@
1
+ import { Canvas, Meta } from '@storybook/blocks';
2
+ import * as FormStories from './build.stories';
3
+
4
+ <Meta of={FormStories} />
5
+
6
+ ## Purpose
7
+
8
+ This guide describes the process of creating forms by an administrator for accepting data from end-users.
9
+
10
+ ## Components
11
+
12
+ - Drupal
13
+ - Back-end CMS product for managing content. [link](https://www.drupal.org/)
14
+
15
+ - Drupal WebForms
16
+ - Third-party extension to Drupal which allows administrators to create forms and view submissions. [link](https://www.drupal.org/project/webform)
17
+
18
+ - Front-End site
19
+ - End-user site where forms are rendered for end-user to provide data.
20
+
21
+ - <span>Form.io</span>
22
+ - Third-party library used by the front-end that takes in forms defined in Drupal WebForms and renders them as regular HTML in the browser. No knowledge of formio is required to be known by the administrator. [link](https://www.form.io/)
23
+
24
+
25
+ ## Technical Architecture
26
+
27
+ A drupal webform is created either by manually building a form or asking a drupal developer to create the form via code/git.
28
+
29
+ A user requests the form from the browser which invokes a REST call to the drupal webform json-api endpoint called the elements api. What comes back will be a nested JSON structure describing the various fields of the form and their properties.
30
+
31
+ Custom front-end code is then used to transform this webform json into Form.io library compatible json [link](https://formio.github.io/formio.js/app/builder).
32
+
33
+ Form.io offers an open source JS library wherein a JSON data set is inputted and a ready-to-use html form is outputted.
34
+
35
+ On submitting the formio form in the browser, an api payload is then sent to the drupal webform backend using the submit api.
36
+
37
+ ## User groups
38
+
39
+ - End-user
40
+ - The user who view the form on the browser and can submit a form
41
+ - Administrator
42
+ - Staff member with drupal CMS access. Can build forms andd view submissions using the Drupal CMS interface. It is discouraged to change forms manually using the interface
43
+ - Drupal Developer
44
+ - Can programatically add, update and delete forms. This is the preferred way of working with forms so as to allow replication to different environments.
45
+ - Front-end Developer
46
+ - Deals with formio form component rendering. Can configure the look and feel of the form to end-users
47
+
48
+
49
+ ## Tutorials
50
+
51
+ You can google for Drupal WebForms tutorial. There are also plenty of good tutorial for it on Youtube. Just ensure that you are viewing it for the right drupal version.
52
+
53
+ ## Form Creation Lifecycle
54
+
55
+ ### Administrator - Create Form
56
+ 1. Login to Drupal CMS
57
+ 2. Open `Webforms` (Top Menu -> Structure -> webforms)
58
+ 3. Click `Add WebForm`
59
+ 4. Provide a unique name (key) to the webform
60
+ 5. Drag and Drop form elements to new form e.g. textfield, radio, drop-down.
61
+ 6. Configure each element by click the edit icon on that row. It should open a sidebar with tabs.
62
+ 7. Save form
63
+
64
+ ### End User - View Form
65
+ 8. Vist the forms page on the front-end website by going to `http://<public-website>/forms/<form key from step 4>` e.g. https://ws-ui.wsvdigital.com.au/forms/kitchen_sink_formio_v1
66
+ 9. Fill up form fields and click submit
67
+
68
+
69
+ ### Administrator - View Submission
70
+ 10. Login to Drupal CMS
71
+ 11. Open `Webforms` (Top Menu -> Structure -> webforms)
72
+ 12. Locate the row related to the existing form defined in step 3
73
+ 13. Click on `results` column link
74
+
75
+
76
+ ## Form Elements
77
+
78
+ ### Basic Elements
79
+
80
+ | Name | Example | Description |
81
+ |---|---|---|
82
+ | Checkbox | [link](/?path=/story/form-basic-controls--checkbox) | A single checkbox for Yes/No responses |
83
+ | Hidden | [link](/?path=/story/form-basic-controls--hidden) | A hidden field for storing invisible values such as calculations. The `default value` can be configured to contain drupal tokens such as current date by clicking on `Browse available tokens` or you can supply dynamic values with references to other form elements such as `hey {{ data.number1}} is {{ 1 + 2 }}` which when submitted will appear as `hey 100 is 3`. In this example, `number1` is the key of a number element and `data` is the parent form object |
84
+ | Textfield | [link](/?path=/story/form-basic-controls--text-field) | A textbox for alpha numeric text |
85
+ | Textarea | [link](/?path=/story/form-basic-controls--text-area) | A large textbox for multi-line text |
86
+
87
+ ### Advanced Elements
88
+
89
+ | Name | Example | Description |
90
+ |---|---|---|
91
+ | Autocomplete | [link](/?path=/story/form-advanced-controls--autocomplete) | A dropdown that matches data from an external api as you type |
92
+ | Codemirror | | A hidden control where developer code can be inserted. Custom HTML, CSS and JS code must be added under the description field in source view |
93
+ | Email | [link](/?path=/story/form-advanced-controls--email) | A textfield that only allows email-pattern text |
94
+ | Email Confirm | [link](/?path=/story/form-composite--email-confirm) | Two textfields which asks the user to provide an email and then confirm that email again |
95
+ | Number | [link](/?path=/story/form-advanced-controls--number) | A numeric field. Configure the `step` field with decimal places. A step of 2 allows decimals with two places while empty step will only allow integers |
96
+ | Range | [link](/?path=/story/form-custom-controls--range) | A sliding numeric scale along with a textbox for manual entry |
97
+ | Rating | [link](/?path=/story/form-custom-controls--rating) | A rating scaled comprised of stars |
98
+ | Same As | [link](/?path=/story/form-advanced-controls--same-as) | Allows the user to display a checkbox to ask if one form value (`source element`) is the same as another (`destination element`). e.g. is home address the same as postal address |
99
+ | Scale | [link](/?path=/story/form-custom-controls--scale) | A rating scaled comprised of numbers |
100
+ | Signature | [link](/?path=/story/form-advanced-controls--signature) | Allows the user to sign the form by using their mouse to draw a pattern |
101
+ | Telephone | [link](/?path=/story/form-advanced-controls--telephone) | A textfield which allows 10 digit phone numbers |
102
+ | URL | [link](/?path=/story/form-advanced-controls--url) | A textfield that accepts urls with or without http(s) prefix |
103
+ | Value | [link](/?path=/story/form-advanced-controls--value) | Allows the end user to enter rich text such as headings, paragraphs and bolding. Submits it as HTML and which then can be sent in a submission email |
104
+
105
+ ### Composite Elements
106
+
107
+ | Name | Example | Description |
108
+ |---|---|---|
109
+ | Address | [link](/?path=/story/form-composite--address) | Allows you to select an address via google maps. It also allows you to manually enter an address. Disable fields in drupal that are not needed in manual mode. If you disable the address manual field, it will then only match postcode suburbs from Google|
110
+ | Custom Composite | [link](/?path=/story/form-composite--custom-composite) | Allows the end-user to create an 'entity' list. An entity can be comprised of one or more form elements defined under `CUSTOM COMPOSITE SETTINGS`. e.g. Entity of `Persons` is comprised of `first name` (textbox) and `is coming?` (checkbox). This control would allow the end-user to add multiple persons as rows in a table.
111
+
112
+ ### Markup Elements
113
+
114
+ | Name | Example | Description |
115
+ |---|---|---|
116
+ | Advanced HTML | [link](/?path=/story/form-markup-controls--advanced-html) | Allows the administrator to enter rich text under `PROCESSED TEXT SETTINGS` such as headings, paragraphs and bolding. |
117
+ | Basic HTML | [link](/?path=/story/form-markup-controls--basic-html) | Same as advanced HTML |
118
+ | Horizontal Rule | [link](/?path=/story/form-markup-controls--horizontal-rule) | A horizontal line is inserted on the form |
119
+ | Label | [link](/?path=/story/form-markup-controls--label) | Creates a new label on the form with some basic text. You can also include HTML |
120
+ | Message | [link](/?path=/story/form-markup-controls--message) | Show alert messages. Set the message status to info, error or warn to render different alert colours.
121
+ | More | [link](/?path=/story/form-markup-controls--more) | Show collapsible help text
122
+
123
+ ### Options Elements
124
+
125
+ | Name | Example | Description |
126
+ |---|---|---|
127
+ | Checkboxes | [link](/?path=/story/form-options-controls--checkboxes) | Create a bunch of tickable checkboxes for multiple selection |
128
+ | Checkboxes other | [link](/?path=/story/form-options-controls--checkboxes-other) | Same as checkbox but allows end-user to select `other` option and manually enter value |
129
+ | Likert | [link](/?path=/story/form-options-controls--likert) | Creates a table with rows and columns. For each row, the user must select a column. Good for surveys where row is question and columns are a score from 1 to 10 |
130
+ | Radios | [link](/?path=/story/form-options-controls--radios) | Create a list of radio buttons for single selection |
131
+ | Radios other | [link](/?path=/story/form-options-controls--radios-other) | Same as radios but allows end-user to select `other` option and manually enter value |
132
+ | Select | [link](/?path=/story/form-options-controls--select) | Create a dropdown of for single selection |
133
+ | Select other | [link](/?path=/story/form-options-controls--select-other) | Same as Select but allows end-user to select `other` option and manually enter value |
134
+ | Table Select | [link](/?path=/story/form-options-controls--table-select) | Same as likert but with one column containing a toggle button |
135
+
136
+ ### Computed Elements
137
+
138
+ | Name | Example | Description |
139
+ |---|---|---|
140
+ | Computed token | [link](/?path=/story/form-composite--token) | Read-only display of all the entered values in the form. No configuration necessary beyond label text. Good for showing a page where end-user can review selections before submission |
141
+ | Computed Twig | [link](/?path=/story/form-composite--twig) | Read-only display of computations or dynamic text. Text can be specifiedf under `Computed value/markup`. Anything within the curly braces `{{` `}}` is a javascript computation. All form control values are stored under the `data` object. For example, given two number controls `n1` and `n2`, a twig can have a template of `the sum of two numbers is {{ data.n2 + data.n1 }}`. On render, it will appear as `the sum of two numbers is 5` |
142
+
143
+ ### Container Elements
144
+
145
+ | Name | Example | Description |
146
+ |---|---|---|
147
+ | Container | [link](/?path=/story/form-layout-controls--container) | A container is just an invisible grouping of controls. It allows you to show/hide the group without having to show/hide each control in that group |
148
+ | Details | [link](/?path=/story/form-layout-controls--details) | Similar to container but controls are wrapped in a collapsible accordion |
149
+ | Fieldset | [link](/?path=/story/form-layout-controls--fieldset) | Similar to container but allows you to set a title and description for the group |
150
+ | Flexbox | [link](/?path=/story/form-layout-controls--flexbox) | Allows you to create a column-based layout. Add a flexbox and then add elements to the flexbox. Each row is a new column |
151
+ | Section | [link](/?path=/story/form-layout-controls--section) | Similar to container but has a Heading |
152
+ | Table | [link](/?path=/story/form-layout-controls--table) | Similar to Flexbox but in the form of a table with a table header and bordered table columns |
153
+
154
+ ### Date Elements
155
+
156
+ | Name | Example | Description |
157
+ |---|---|---|
158
+ | Date | [link](/?path=/story/form-date-controls--date) | Simple date control with a calendar widget and/or manual textbox entry. Weekends can be disabled as well min/max date set. You can set a min or max date using the format dd/mm/yyyy or dd-mm-yyyy. You can also words like 'today', '+2 months', '-10 days' or '+1 years' for dynamic date validation. |
159
+ | Date Time | [link](/?path=/story/form-date-controls--date-time) | Similar to Date control but also provides an option to select time |
160
+ | Time | [link](/?path=/story/form-date-controls--time) | A simple time widget |
161
+ | Date List | [link](/?path=/story/form-date-controls--date-list) | Similar to Date control but uses dropdown for each part of the date. Useful if you want to collect a date without a year or month or day |
162
+
163
+ ## Conditional Rules
164
+
165
+ Conditional rules allow you to dynamically change the state of form elements. The following actions are available when you configure an element and open the `Conditions` tab
166
+
167
+ ### State
168
+
169
+ | Name | Example | Description |
170
+ |---|---|---|
171
+ | Hidden | [link](/?path=/story/form-conditions--hidden) | Will hide a visible element. The element's existing value will still be submitted. If you want to clear the element's value on hide, select the checkbox `Clear value(s) when hidden?`
172
+ | Visible | [link](/?path=/story/form-conditions--visible) | Will make visible an element hidden by default. An element can be made to be hidden by default if you configure an element and click on the `Access` tab and at the bottom unselect `Display element` |
173
+ | Disabled | [link](/?path=/story/form-conditions--disabled) | Will make an element read-only. Read-only values are not submitted`
174
+ | Enabled | [link](/?path=/story/form-conditions--enabled) | Will un-make an element read-only. Read-only values are not submitted`
175
+ | Required | [link](/?path=/story/form-conditions--required) | Will make an element required for submission
176
+ | Optional | [link](/?path=/story/form-conditions--required) | Will make an element optional for submission
177
+
178
+
179
+ ## Validation and Behaviour
180
+
181
+ You can configure an element to have client-side validation. Configure an elemenet and at the bottom of an element, you can find the following common validators
182
+
183
+ - Required
184
+ - Will make a field required for submission. You can add a custom required message
185
+ - Unique
186
+ - The field value must be unique in relation to previous submissions. This will show an error only on submission
187
+ - Pattern
188
+ - A javascript pattern for regular expression. This can dynamically apply validation on text strings. e.g. `^[A-Z9]{5}\d{6}[A-Z9]{2}\d[A-Z]{2}$` is drivers license validation with an example accetable value of `FARME100165AB5EW`
189
+ - Disabled and ReadOnly
190
+ - This will grey out the element and the value will not be included in submission.
191
+ - Display (checkbox at the bttom of the Access tab)
192
+ - This will hide the element when it loads
193
+ - Default Value (first element under Advanced tab)
194
+ - You can set a default value here for when the element first renders
195
+ - Multiple
196
+ - You can configure for a form element to be a list instead of a single component. Under `ELEMENT SETTINGS` in the general tab, set the `Allowed number of values` to be a number. [example](/?path=/story/form-composite--multiple)
197
+
198
+ ## Custom Styling
199
+
200
+ - Adding HTML, JS and CSS?
201
+ - Add a `code mirror` form element. Open source accordion view in form builder. and add your html to the #description property
202
+ ```
203
+ '#type': codemirror
204
+ '#title': global
205
+ '#description': |-
206
+ <style>
207
+ .task__card {
208
+ position: relative;
209
+ width: 100%;
210
+ }
211
+ </style>
212
+ <script>
213
+ window.reload()
214
+ </script>
215
+ <div>
216
+ test
217
+ </div>
218
+ ```
219
+
220
+ - Adding minor CSS styles
221
+ - Confiuge an element and click on the `Advanced tab`. You can prvovide CSS styles tot the wrapper, element or label. A sample CSS style for a yellow background with extra padding is `background: yellow; padding: 10px;`. [example](/?path=/story/form-custom-style--default)
222
+
223
+ ## Multi-page
224
+
225
+ - To create a multi-step form, click on `Add page` button on the form builder. Make sure every new page is the root container element in the form. All controls for a page can be added below the page's row. [example](/?path=/story/form-wizard--default)
226
+
227
+
228
+ ## Submission handling
229
+
230
+ - View Submissions
231
+ - You can view form submissions under the `Results` tab in form builder
232
+
233
+ - Email Submissions
234
+ - You can configure webforms to send you an email everytime a form is submitted. Go to the `Settings` in form builder and click on Emails/Handlers. Add your email here. Make sure your email is whitelisted in Mailgun (speak to your Drupal Developer about it).
@@ -0,0 +1,109 @@
1
+ import FormInstance from '../index.vue'
2
+ import autocomplete from './mocks/autocomplete.json'
3
+ import email from './mocks/email.json'
4
+ import number from './mocks/number.json'
5
+ import signature from './mocks/signature.json'
6
+ import telephone from './mocks/telephone.json'
7
+ import url from './mocks/url.json'
8
+ import value from './mocks/value.json'
9
+ import sameas from './mocks/sameas.json'
10
+
11
+ export default {
12
+ title: 'Form/Advanced Controls',
13
+ component: FormInstance,
14
+ argTypes: {
15
+ preview: {
16
+ control: 'boolean',
17
+ defaultValue: true,
18
+ table: {
19
+ disable: true
20
+ }
21
+ },
22
+ contentApiUrl: {
23
+ control: 'text',
24
+ defaultValue: process.env.CONTENT_API_URL
25
+ },
26
+ processID: {
27
+ control: 'text',
28
+ defaultValue: 'proc-id-form-advanced-controls',
29
+ table: {
30
+ disable: true
31
+ }
32
+ },
33
+ formid: {
34
+ control: 'string',
35
+ defaultValue: '',
36
+ table: {
37
+ disable: true
38
+ }
39
+ },
40
+ type: {
41
+ control: 'text',
42
+ defaultValue: '',
43
+ table: {
44
+ disable: true
45
+ }
46
+ },
47
+ webFormJson: {
48
+ control: 'object'
49
+ }
50
+ },
51
+ args: {
52
+ processID: 'proc-id-form-advanced-controls',
53
+ preview: true,
54
+ contentApiUrl:process.env.CONTENT_API_URL
55
+
56
+ }
57
+ }
58
+
59
+ export const Autocomplete = {args : {
60
+ type: 'webform_autocomplete',
61
+ webFormJson: autocomplete,
62
+
63
+ }
64
+ }
65
+
66
+ export const Email = {args : {
67
+ type: 'email',
68
+ webFormJson: email
69
+ }
70
+ }
71
+
72
+ export const Number = {args : {
73
+ type: 'number',
74
+ webFormJson: number
75
+ }
76
+ }
77
+
78
+ export const Signature = {args : {
79
+ type: 'webform_signature',
80
+ webFormJson: signature
81
+ }
82
+ }
83
+
84
+ export const Telephone = {args : {
85
+ type: 'tel',
86
+ webFormJson: telephone
87
+ }
88
+ }
89
+
90
+ export const URL = {args : {
91
+ type: 'url',
92
+ webFormJson: url
93
+ }
94
+ }
95
+
96
+ export const Value = {
97
+ args : {
98
+ type: 'value',
99
+ webFormJson: value
100
+ }
101
+ }
102
+
103
+ export const SameAs = {
104
+ args : {
105
+ type: 'sameas',
106
+ webFormJson: sameas
107
+ }
108
+ }
109
+
@@ -0,0 +1,73 @@
1
+ import FormInstance from '../index.vue'
2
+ import textfield from './mocks/textfield.json'
3
+ import textarea from './mocks/textarea.json'
4
+ import hidden from './mocks/hidden.json'
5
+ import checkbox from './mocks/checkbox.json'
6
+
7
+ export default {
8
+ title: 'Form/Basic Controls',
9
+ component: FormInstance,
10
+ argTypes: {
11
+ preview: {
12
+ control: 'boolean',
13
+ defaultValue: true,
14
+ table: {
15
+ disable: true
16
+ }
17
+ },
18
+ contentApiUrl: {
19
+ control: 'text',
20
+ defaultValue: process.env.CONTENT_API_URL
21
+ },
22
+ processID: {
23
+ control: 'text',
24
+ defaultValue: 'proc-id-form-basic-controls',
25
+ table: {
26
+ disable: true
27
+ }
28
+ },
29
+ formid: {
30
+ control: 'string',
31
+ defaultValue: '',
32
+ table: {
33
+ disable: true
34
+ }
35
+ },
36
+ type: {
37
+ control: 'text',
38
+ defaultValue: '',
39
+ table: {
40
+ disable: true
41
+ }
42
+ },
43
+ webFormJson: {
44
+ control: 'object'
45
+ }
46
+ },
47
+ args: {
48
+ processID: 'proc-id-form-basic-controls',
49
+ preview: true,
50
+ contentApiUrl:process.env.CONTENT_API_URL
51
+ }
52
+ }
53
+
54
+ export const TextField = {
55
+ args : {
56
+ webFormJson: textfield
57
+ }
58
+ }
59
+
60
+ export const TextArea = {}
61
+ TextArea.args = {
62
+ webFormJson: textarea
63
+ }
64
+
65
+ export const Hidden = {}
66
+ Hidden.args = {
67
+ webFormJson: hidden
68
+ }
69
+
70
+ export const Checkbox = {}
71
+ Checkbox.args = {
72
+ webFormJson: checkbox
73
+ }
@@ -0,0 +1,27 @@
1
+ import { FormBuilder } from '@formio/vue'
2
+
3
+ export default {
4
+ title: 'Form',
5
+ component: FormBuilder,
6
+ }
7
+
8
+ const Template = (args) => ({
9
+ components: { FormBuilder },
10
+ setup () {
11
+ return { args }
12
+ },
13
+ template:
14
+ ` <div>
15
+ <div>
16
+ <h3>{{args.heading}}</h3>
17
+ <form-builder v-bind="args" v-on:change="(schema) => args.message=schema"></form-builder>
18
+ </div>
19
+ <textarea class="form-control" rows="20">{{args.message}}</textarea>
20
+ </div>
21
+ `
22
+ })
23
+
24
+ export const Builder = Template.bind({})
25
+ Builder.args = {
26
+ message:'No form content'
27
+ }
@@ -0,0 +1,90 @@
1
+ import FormInstance from '../index.vue'
2
+ import address from './mocks/address.json'
3
+ import emailconfirm from './mocks/emailconfirm.json'
4
+ import multiple from './mocks/multiple.json'
5
+ import customcomposite from './mocks/customcomposite.json'
6
+ import twig from './mocks/twig.json'
7
+ import token from './mocks/token.json'
8
+
9
+ export default {
10
+ title: 'Form/Composite',
11
+ component: FormInstance,
12
+ argTypes: {
13
+ preview: {
14
+ control: 'boolean',
15
+ defaultValue: true,
16
+ table: {
17
+ disable: true
18
+ }
19
+ },
20
+ contentApiUrl: {
21
+ control: 'text',
22
+ defaultValue: process.env.CONTENT_API_URL
23
+ },
24
+ processID: {
25
+ control: 'text',
26
+ defaultValue: 'proc-id-form-composite',
27
+ table: {
28
+ disable: true
29
+ }
30
+ },
31
+ formid: {
32
+ control: 'string',
33
+ defaultValue: '',
34
+ table: {
35
+ disable: true
36
+ }
37
+ },
38
+ type: {
39
+ control: 'text',
40
+ defaultValue: '',
41
+ table: {
42
+ disable: true
43
+ }
44
+ },
45
+ webFormJson: {
46
+ control: 'object'
47
+ }
48
+ },
49
+ args: {
50
+ processID: 'proc-id-form-composite',
51
+ preview: true,
52
+ contentApiUrl:process.env.CONTENT_API_URL
53
+ }
54
+ }
55
+
56
+ export const Address = {}
57
+ Address.args = {
58
+ type: 'address',
59
+ webFormJson: address
60
+ }
61
+
62
+ export const EmailConfirm = {}
63
+ EmailConfirm.args = {
64
+ type: 'webform_email_confirm',
65
+ webFormJson: emailconfirm
66
+ }
67
+
68
+ export const Multiple = {}
69
+ Multiple.args = {
70
+ type: 'multiple',
71
+ webFormJson: multiple
72
+ }
73
+
74
+ export const CustomComposite = {}
75
+ CustomComposite.args = {
76
+ type: 'webform_custom_composite',
77
+ webFormJson: customcomposite
78
+ }
79
+
80
+ export const Twig = {}
81
+ Twig.args = {
82
+ type: 'twig',
83
+ webFormJson: twig
84
+ }
85
+
86
+ export const Token = {}
87
+ Token.args = {
88
+ type: 'token',
89
+ webFormJson: token
90
+ }
@@ -0,0 +1,83 @@
1
+ import FormInstance from '../index.vue'
2
+ import rulehiddenvalue from './mocks/rule-hidden-value.json'
3
+ import rulevisiblevalue from './mocks/rule-visible-value.json'
4
+ import ruleDisabledvalue from './mocks/rule-disabled-value.json'
5
+ import ruleEnabledvalue from './mocks/rule-enabled-value.json'
6
+ import ruleRequiredvalue from './mocks/rule-required-value.json'
7
+
8
+ export default {
9
+ title: 'Form/Conditions',
10
+ component: FormInstance,
11
+ argTypes: {
12
+ preview: {
13
+ control: 'boolean',
14
+ defaultValue: true,
15
+ table: {
16
+ disable: true
17
+ }
18
+ },
19
+ contentApiUrl: {
20
+ control: 'text',
21
+ defaultValue: process.env.CONTENT_API_URL
22
+ },
23
+ processID: {
24
+ control: 'text',
25
+ defaultValue: 'proc-id-form-conditions',
26
+ table: {
27
+ disable: true
28
+ }
29
+ },
30
+ formid: {
31
+ control: 'string',
32
+ defaultValue: '',
33
+ table: {
34
+ disable: true
35
+ }
36
+ },
37
+ type: {
38
+ control: 'text',
39
+ defaultValue: '',
40
+ table: {
41
+ disable: true
42
+ }
43
+ },
44
+ webFormJson: {
45
+ control: 'object'
46
+ }
47
+ },
48
+ args: {
49
+ processID: 'proc-id-form-conditions',
50
+ preview: true,
51
+ contentApiUrl:process.env.CONTENT_API_URL
52
+ }
53
+ }
54
+
55
+ export const Hidden = {}
56
+ Hidden.args = {
57
+ type: 'Hidden',
58
+ webFormJson: rulehiddenvalue
59
+ }
60
+
61
+ export const Visible = {}
62
+ Visible.args = {
63
+ type: 'Visible',
64
+ webFormJson: rulevisiblevalue
65
+ }
66
+
67
+ export const Disabled = {}
68
+ Disabled.args = {
69
+ type: 'Disabled',
70
+ webFormJson: ruleDisabledvalue
71
+ }
72
+
73
+ export const Enabled = {}
74
+ Enabled.args = {
75
+ type: 'Enabled',
76
+ webFormJson: ruleEnabledvalue
77
+ }
78
+
79
+ export const Required = {}
80
+ Required.args = {
81
+ type: 'Required',
82
+ webFormJson: ruleRequiredvalue
83
+ }
@@ -0,0 +1,69 @@
1
+ import FormInstance from '../index.vue'
2
+ import rating from './mocks/rating.json'
3
+ import scale from './mocks/scale.json'
4
+ import range from './mocks/range.json'
5
+
6
+ export default {
7
+ title: 'Form/Custom Controls',
8
+ component: FormInstance,
9
+ argTypes: {
10
+ preview: {
11
+ control: 'boolean',
12
+ defaultValue: true,
13
+ table: {
14
+ disable: true
15
+ }
16
+ },
17
+ contentApiUrl: {
18
+ control: 'text',
19
+ defaultValue: process.env.CONTENT_API_URL
20
+ },
21
+ processID: {
22
+ control: 'text',
23
+ defaultValue: 'proc-id-form-custom-controls',
24
+ table: {
25
+ disable: true
26
+ }
27
+ },
28
+ formid: {
29
+ control: 'string',
30
+ defaultValue: '',
31
+ table: {
32
+ disable: true
33
+ }
34
+ },
35
+ type: {
36
+ control: 'text',
37
+ defaultValue: '',
38
+ table: {
39
+ disable: true
40
+ }
41
+ },
42
+ webFormJson: {
43
+ control: 'object'
44
+ }
45
+ },
46
+ args: {
47
+ processID: 'proc-id-form-custom-controls',
48
+ preview: true,
49
+ contentApiUrl:process.env.CONTENT_API_URL
50
+ }
51
+ }
52
+
53
+ export const Rating = {}
54
+ Rating.args = {
55
+ type: 'rating',
56
+ webFormJson: rating
57
+ }
58
+
59
+ export const Scale = {}
60
+ Scale.args = {
61
+ type: 'scale',
62
+ webFormJson: scale
63
+ }
64
+
65
+ export const Range = {}
66
+ Range.args = {
67
+ type: 'range',
68
+ webFormJson: range
69
+ }