@worksafevictoria/wcl7.5 1.1.10 → 1.1.12
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.
- package/jest.config.js +9 -7
- package/package.json +6 -5
- package/src/components/Paragraphs/Accordion/index.stories.js +1 -0
- package/src/components/Paragraphs/Breakout/index.stories.js +1 -0
- package/src/components/Paragraphs/BrowseContent/index.stories.js +1 -0
- package/src/components/Paragraphs/Calculator/Constants.js +2 -2
- package/src/components/Paragraphs/Calculator/index.stories.js +1 -0
- package/src/components/Paragraphs/Directory/Records/CJ/index.vue +3 -3
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +3 -3
- package/src/components/Paragraphs/Directory/Records/PRS/index.vue +2 -2
- package/src/components/Paragraphs/Directory/Records/PRS/recordContent.vue +3 -3
- package/src/components/Paragraphs/Directory/Records/PRS/recordDetails.vue +3 -3
- package/src/components/Paragraphs/Directory/Records/index.vue +3 -3
- package/src/components/Paragraphs/Directory/index.vue +4 -4
- package/src/components/Paragraphs/ListGroup/Link/list-link.stories.js +1 -0
- package/src/components/Paragraphs/ListGroup/list-group.stories.js +1 -0
- package/src/components/Paragraphs/ListGroup/navigation-card.stories.js +1 -0
- package/src/components/Paragraphs/MarketingBanner/index.stories.js +1 -0
- package/src/components/Paragraphs/ProofPoints/index.stories.js +19 -20
- package/src/components/Paragraphs/RelatedInformation/index.stories.js +7 -0
- package/src/components/Paragraphs/Webform/index.stories.js +30 -29
- package/src/components/Paragraphs/Webform/index.vue +10 -7
- package/src/components/SubComponents/FormInstance/components/alert/index.vue +129 -0
- package/src/components/SubComponents/FormInstance/components/custom/base-formio.js +77 -0
- package/src/components/SubComponents/FormInstance/components/custom/code-formio.js +35 -0
- package/src/components/SubComponents/FormInstance/components/custom/custom-formio-registry.js +30 -0
- package/src/components/SubComponents/FormInstance/components/custom/range-formio.js +121 -0
- package/src/components/SubComponents/FormInstance/components/custom/rating-formio.js +121 -0
- package/src/components/SubComponents/FormInstance/components/custom/scale-formio.js +99 -0
- package/src/components/SubComponents/FormInstance/components/custom/tableselect-formio.js +200 -0
- package/src/components/SubComponents/FormInstance/components/handler/index.vue +208 -0
- package/src/components/SubComponents/FormInstance/components/renderer/index.vue +282 -0
- package/src/components/SubComponents/FormInstance/index.test.js +65 -0
- package/src/components/SubComponents/FormInstance/index.vue +55 -6
- package/src/components/SubComponents/FormInstance/models/base-form-element.js +338 -0
- package/src/components/SubComponents/FormInstance/models/form-callback-queue.js +45 -0
- package/src/components/SubComponents/FormInstance/models/form-utils.js +50 -0
- package/src/components/SubComponents/FormInstance/models/overrides/address.js +132 -0
- package/src/components/SubComponents/FormInstance/models/overrides/autocomplete.js +41 -0
- package/src/components/SubComponents/FormInstance/models/overrides/checkbox.js +14 -0
- package/src/components/SubComponents/FormInstance/models/overrides/checkboxes.js +49 -0
- package/src/components/SubComponents/FormInstance/models/overrides/code.js +27 -0
- package/src/components/SubComponents/FormInstance/models/overrides/composite.js +57 -0
- package/src/components/SubComponents/FormInstance/models/overrides/container.js +65 -0
- package/src/components/SubComponents/FormInstance/models/overrides/currency.js +17 -0
- package/src/components/SubComponents/FormInstance/models/overrides/customcomposite.js +41 -0
- package/src/components/SubComponents/FormInstance/models/overrides/date.js +126 -0
- package/src/components/SubComponents/FormInstance/models/overrides/datelist.js +73 -0
- package/src/components/SubComponents/FormInstance/models/overrides/detail.js +38 -0
- package/src/components/SubComponents/FormInstance/models/overrides/email-confirm.js +12 -0
- package/src/components/SubComponents/FormInstance/models/overrides/email.js +7 -0
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +56 -0
- package/src/components/SubComponents/FormInstance/models/overrides/flexbox.js +33 -0
- package/src/components/SubComponents/FormInstance/models/overrides/hidden.js +24 -0
- package/src/components/SubComponents/FormInstance/models/overrides/likert.js +40 -0
- package/src/components/SubComponents/FormInstance/models/overrides/markup.js +47 -0
- package/src/components/SubComponents/FormInstance/models/overrides/message.js +53 -0
- package/src/components/SubComponents/FormInstance/models/overrides/moretext.js +64 -0
- package/src/components/SubComponents/FormInstance/models/overrides/multiple.js +51 -0
- package/src/components/SubComponents/FormInstance/models/overrides/number.js +22 -0
- package/src/components/SubComponents/FormInstance/models/overrides/options-other.js +34 -0
- package/src/components/SubComponents/FormInstance/models/overrides/page.js +7 -0
- package/src/components/SubComponents/FormInstance/models/overrides/phonenumber.js +13 -0
- package/src/components/SubComponents/FormInstance/models/overrides/radio.js +31 -0
- package/src/components/SubComponents/FormInstance/models/overrides/range.js +19 -0
- package/src/components/SubComponents/FormInstance/models/overrides/rating.js +47 -0
- package/src/components/SubComponents/FormInstance/models/overrides/scale.js +33 -0
- package/src/components/SubComponents/FormInstance/models/overrides/section.js +39 -0
- package/src/components/SubComponents/FormInstance/models/overrides/select.js +28 -0
- package/src/components/SubComponents/FormInstance/models/overrides/signature.js +7 -0
- package/src/components/SubComponents/FormInstance/models/overrides/submit.js +23 -0
- package/src/components/SubComponents/FormInstance/models/overrides/table.js +48 -0
- package/src/components/SubComponents/FormInstance/models/overrides/tablerow.js +20 -0
- package/src/components/SubComponents/FormInstance/models/overrides/tableselect.js +66 -0
- package/src/components/SubComponents/FormInstance/models/overrides/testing.js +47 -0
- package/src/components/SubComponents/FormInstance/models/overrides/text.js +7 -0
- package/src/components/SubComponents/FormInstance/models/overrides/textarea.js +26 -0
- package/src/components/SubComponents/FormInstance/models/overrides/textformat.js +13 -0
- package/src/components/SubComponents/FormInstance/models/overrides/time.js +13 -0
- package/src/components/SubComponents/FormInstance/models/overrides/twig.js +118 -0
- package/src/components/SubComponents/FormInstance/models/overrides/unknown.js +24 -0
- package/src/components/SubComponents/FormInstance/models/overrides/url.js +13 -0
- package/src/components/SubComponents/FormInstance/services/convert-form-element.js +49 -0
- package/src/components/SubComponents/FormInstance/services/form-api.js +47 -0
- package/src/components/SubComponents/FormInstance/services/form-render-parser.js +156 -0
- package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +61 -0
- package/src/components/SubComponents/FormInstance/services/logic-linker.js +73 -0
- package/src/components/SubComponents/FormInstance/services/logic-parser.js +173 -0
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +284 -0
- package/src/components/SubComponents/FormInstance/stories/Documentation.mdx +234 -0
- package/src/components/SubComponents/FormInstance/stories/advanced.stories.js +109 -0
- package/src/components/SubComponents/FormInstance/stories/basic.stories.js +73 -0
- package/src/components/SubComponents/FormInstance/stories/build.stories.js +27 -0
- package/src/components/SubComponents/FormInstance/stories/composite.stories.js +90 -0
- package/src/components/SubComponents/FormInstance/stories/condition.stories.js +83 -0
- package/src/components/SubComponents/FormInstance/stories/custom.stories.js +69 -0
- package/src/components/SubComponents/FormInstance/stories/date.stories.js +76 -0
- package/src/components/SubComponents/FormInstance/stories/form-alert.stories.js +93 -0
- package/src/components/SubComponents/FormInstance/stories/index.stories.js +63 -0
- package/src/components/SubComponents/FormInstance/stories/layout.stories.js +85 -0
- package/src/components/SubComponents/FormInstance/stories/markup.stories.js +91 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/address.json +298 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/advancedhtml.json +23 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/autocomplete.json +34 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/basichtml.json +15 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/checkboxes.json +102 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/checkboxesother.json +197 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/container.json +134 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/customcomposite.json +469 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/date.json +19 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/datelist.json +752 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/datetime.json +89 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/details.json +63 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/email.json +18 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/emailconfirm.json +110 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/fieldset.json +62 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/flexbox.json +58 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/hidden.json +35 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/horizontalrule.json +14 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/jahd.json +1359 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/label.json +14 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/likert.json +375 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/message.json +86 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/more.json +19 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/multiple.json +142 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/number.json +35 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/quad.json +249 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/radios.json +70 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/radiosother.json +176 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/range.json +58 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rating.json +42 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rule-disabled-value.json +66 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rule-enabled-value.json +43 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rule-hidden-value.json +68 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rule-required-value.json +69 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/rule-visible-value.json +157 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/sameas.json +66 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/scale.json +200 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/section.json +63 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/select.json +41 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/selectother.json +115 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/signature.json +25 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/styles.json +81 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/table-select.json +472 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/table.json +154 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/telephone.json +18 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/textarea.json +22 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/textfield.json +66 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/time.json +20 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/token.json +260 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/twig.json +154 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/url.json +18 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/value.json +17 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/wizard.json +353 -0
- package/src/components/SubComponents/FormInstance/stories/options.stories.js +98 -0
- package/src/components/SubComponents/FormInstance/stories/style.stories.js +55 -0
- package/src/components/SubComponents/FormInstance/stories/wizard.stories.js +55 -0
- package/src/components/SubComponents/FormInstance/style.scss +173 -0
- package/src/components/SubComponents/FormInstance/tests/address.test.js +255 -0
- package/src/components/SubComponents/FormInstance/tests/advancedhtml.test.js +31 -0
- package/src/components/SubComponents/FormInstance/tests/autocomplete.test.js +38 -0
- package/src/components/SubComponents/FormInstance/tests/basichtml.test.js +31 -0
- package/src/components/SubComponents/FormInstance/tests/checkbox.test.js +29 -0
- package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +44 -0
- package/src/components/SubComponents/FormInstance/tests/checkboxesother.test.js +91 -0
- package/src/components/SubComponents/FormInstance/tests/container.test.js +66 -0
- package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +86 -0
- package/src/components/SubComponents/FormInstance/tests/date.test.js +63 -0
- package/src/components/SubComponents/FormInstance/tests/datelist.test.js +136 -0
- package/src/components/SubComponents/FormInstance/tests/datetime.test.js +54 -0
- package/src/components/SubComponents/FormInstance/tests/details.test.js +58 -0
- package/src/components/SubComponents/FormInstance/tests/email.test.js +28 -0
- package/src/components/SubComponents/FormInstance/tests/emailconfirm.test.js +79 -0
- package/src/components/SubComponents/FormInstance/tests/fieldset.test.js +63 -0
- package/src/components/SubComponents/FormInstance/tests/flexbox.test.js +71 -0
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +120 -0
- package/src/components/SubComponents/FormInstance/tests/form.test.js +26 -0
- package/src/components/SubComponents/FormInstance/tests/hidden.test.js +52 -0
- package/src/components/SubComponents/FormInstance/tests/horizontalrule.test.js +31 -0
- package/src/components/SubComponents/FormInstance/tests/label.test.js +31 -0
- package/src/components/SubComponents/FormInstance/tests/likert.test.js +38 -0
- package/src/components/SubComponents/FormInstance/tests/message.test.js +89 -0
- package/src/components/SubComponents/FormInstance/tests/more.test.js +32 -0
- package/src/components/SubComponents/FormInstance/tests/multiple.test.js +71 -0
- package/src/components/SubComponents/FormInstance/tests/number.test.js +51 -0
- package/src/components/SubComponents/FormInstance/tests/radios.test.js +34 -0
- package/src/components/SubComponents/FormInstance/tests/radiosother.test.js +79 -0
- package/src/components/SubComponents/FormInstance/tests/range.test.js +32 -0
- package/src/components/SubComponents/FormInstance/tests/rating.test.js +38 -0
- package/src/components/SubComponents/FormInstance/tests/rule-disabled.test.js +128 -0
- package/src/components/SubComponents/FormInstance/tests/rule-enabled-value.test.js +78 -0
- package/src/components/SubComponents/FormInstance/tests/rule-hidden.test.js +131 -0
- package/src/components/SubComponents/FormInstance/tests/rule-required-value.test.js +144 -0
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +619 -0
- package/src/components/SubComponents/FormInstance/tests/sameas.test.js +94 -0
- package/src/components/SubComponents/FormInstance/tests/scale.test.js +43 -0
- package/src/components/SubComponents/FormInstance/tests/section.test.js +63 -0
- package/src/components/SubComponents/FormInstance/tests/select.test.js +45 -0
- package/src/components/SubComponents/FormInstance/tests/selectother.test.js +82 -0
- package/src/components/SubComponents/FormInstance/tests/signature.test.js +32 -0
- package/src/components/SubComponents/FormInstance/tests/styles.test.js +73 -0
- package/src/components/SubComponents/FormInstance/tests/table-select.test.js +93 -0
- package/src/components/SubComponents/FormInstance/tests/table.test.js +97 -0
- package/src/components/SubComponents/FormInstance/tests/telephone.test.js +29 -0
- package/src/components/SubComponents/FormInstance/tests/textarea.test.js +29 -0
- package/src/components/SubComponents/FormInstance/tests/textfield.test.js +48 -0
- package/src/components/SubComponents/FormInstance/tests/time.test.js +29 -0
- package/src/components/SubComponents/FormInstance/tests/token.test.js +33 -0
- package/src/components/SubComponents/FormInstance/tests/twig.test.js +74 -0
- package/src/components/SubComponents/FormInstance/tests/url.test.js +45 -0
- package/src/components/SubComponents/FormInstance/tests/value.test.js +31 -0
- package/src/components/SubComponents/FormInstance/tests/wizard.test.js +145 -0
- package/src/mock/jest.fileMock.js +1 -0
- 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
|
+
}
|