@worksafevictoria/wcl7.5 1.4.0 → 1.6.0
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/.storybook/preview.js +20 -13
- package/bin/deploy.sh +1 -1
- package/lib/utility.js +10 -8
- package/package.json +4 -5
- package/src/assets/icons/AppFooter/x-ws-footer.svg +10 -0
- package/src/assets/icons/AppFooter/x-ww-footer.svg +28 -0
- package/src/assets/icons/SocialShare/x-icon-white.svg +28 -0
- package/src/assets/styles/modal.scss +51 -0
- package/src/components/Common/CardGrid/index.vue +69 -49
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +7 -4
- package/src/components/Common/CardGridItem/index.vue +95 -71
- package/src/components/Containers/Carousel/index.vue +14 -7
- package/src/components/Containers/HomepageHeader/index.stories.js +60 -36
- package/src/components/Containers/HomepageHeader/index.vue +2 -26
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +15 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +97 -68
- package/src/components/Containers/SectionGroup/index.vue +1 -1
- package/src/components/Containers/Subheader/index.vue +5 -1
- package/src/components/Global/AppFooter/FooterSocialShare/index.vue +1 -1
- package/src/components/Global/AppFooter/index.vue +14 -7
- package/src/components/Global/AppHeaderNew/index.vue +304 -233
- package/src/components/Global/AppHeaderNew/styles.scss +29 -8
- package/src/components/Global/BackToTop/index.vue +8 -8
- package/src/components/Global/ContrastMode/index.vue +1 -1
- package/src/components/Global/Cookies/index.stories.js +16 -10
- package/src/components/Global/Cookies/index.vue +281 -237
- package/src/components/Global/Cookies/styles.scss +54 -54
- package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +50 -133
- package/src/components/Global/GlobalNotice/index.vue +79 -100
- package/src/components/Global/SocialShare/index.vue +1 -1
- package/src/components/Global/Strip/index.vue +1 -1
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +8 -4
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +23 -23
- package/src/components/Paragraphs/Accordion/index.stories.js +21 -18
- package/src/components/Paragraphs/Accordion/index.vue +52 -48
- package/src/components/Paragraphs/BrowseContent/index.vue +1 -1
- package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
- package/src/components/Paragraphs/Chart/Constants.js +485 -485
- package/src/components/Paragraphs/Chart/index.vue +232 -241
- package/src/components/Paragraphs/Directory/Records/HSCP/index.stories.js +33 -0
- package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +334 -0
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +2 -2
- package/src/components/Paragraphs/Directory/Records/index.vue +63 -27
- package/src/components/Paragraphs/Directory/Records/styles.scss +1 -0
- package/src/components/Paragraphs/Directory/constants.js +23 -5
- package/src/components/Paragraphs/Directory/index.vue +14 -14
- package/src/components/Paragraphs/ListGroup/index.vue +5 -1
- package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
- package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
- package/src/components/Paragraphs/TabbedCards/index.vue +13 -14
- package/src/components/Paragraphs/Tabs/index.vue +19 -17
- package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +9 -9
- package/src/components/Paragraphs/TextMedia/index.vue +20 -16
- package/src/components/Paragraphs/VideoGrid/index.stories.js +43 -19
- package/src/components/Paragraphs/VideoGrid/index.vue +13 -13
- package/src/components/Paragraphs/Webform/index.stories.js +82 -69
- package/src/components/SubComponents/CardGroup/index.vue +5 -1
- package/src/components/SubComponents/FormAddressPostcode/index.vue +35 -37
- package/src/components/SubComponents/FormInstance/components/handler/index.vue +25 -29
- package/src/components/SubComponents/FormInstance/components/renderer/index.vue +63 -28
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +33 -40
- package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +22 -15
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +1 -1
- package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
- package/src/components/SubComponents/FormInstance/style.scss +2 -2
- package/src/components/SubComponents/FormInstance/tests/address.test.js +4 -4
- package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +7 -7
- package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +15 -15
- package/src/components/SubComponents/FormInstance/tests/date.test.js +8 -8
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +9 -9
- package/src/components/SubComponents/FormInstance/tests/multiple.test.js +13 -13
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +120 -120
- package/src/components/SubComponents/FormInstance/tests/scale.test.js +6 -6
- package/src/components/SubComponents/FormInstance/tests/url.test.js +13 -10
- package/src/components/SubComponents/Pagination/index.vue +19 -18
- package/src/components/SubComponents/ResourceGroup/index.vue +5 -1
- package/src/components/SubComponents/Search/SearchListing/index.vue +20 -20
- package/src/components/SubComponents/Search/index.vue +35 -33
- package/src/components/SubComponents/VideoThumbnail/index.vue +48 -133
- package/src/includes/scss/mixins/src/units.scss +25 -4
- package/src/includes/scss/vars/src/colors.module.scss +28 -1
- package/src/index.js +21 -3
- package/src/main.js +2 -10
- package/src/mock/app-header-new.js +27 -15
- package/src/mock/carousel-items.js +71 -46
|
@@ -17,7 +17,7 @@ export class FormTestUtils {
|
|
|
17
17
|
static getParsedComponentsFromJSON = (json) => {
|
|
18
18
|
const formIOform = FormTestUtils.getParsedFormFromJSON(json)
|
|
19
19
|
const components = JSON.parse(
|
|
20
|
-
JSON.stringify(formIOform.definition.components)
|
|
20
|
+
JSON.stringify(formIOform.definition.components),
|
|
21
21
|
)
|
|
22
22
|
components.splice(-1)
|
|
23
23
|
return components
|
|
@@ -35,21 +35,21 @@ export class FormTestUtils {
|
|
|
35
35
|
formioform,
|
|
36
36
|
{
|
|
37
37
|
components: formioform.definition.components.map((cmp) => ({
|
|
38
|
-
originalComponent: cmp
|
|
39
|
-
}))
|
|
40
|
-
}
|
|
38
|
+
originalComponent: cmp,
|
|
39
|
+
})),
|
|
40
|
+
},
|
|
41
41
|
)
|
|
42
42
|
delete submissionValue['webform_id']
|
|
43
43
|
return submissionValue
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
static handleSubmission = (json, componentValue) => {
|
|
46
|
+
static handleSubmission = async (json, componentValue) => {
|
|
47
47
|
const formioform = FormTestUtils.getParsedFormFromJSON(json)
|
|
48
48
|
const submissionMap = Object.keys(formioform.tree).reduce((prev, key) => {
|
|
49
49
|
prev[formioform.tree[key].getKey()] = componentValue
|
|
50
50
|
return prev
|
|
51
51
|
}, {})
|
|
52
|
-
return FormTestUtils.getSubmissionValue(submissionMap, formioform)
|
|
52
|
+
return await FormTestUtils.getSubmissionValue(submissionMap, formioform)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
static getComparisonJSON = (json) => {
|
|
@@ -57,11 +57,11 @@ export class FormTestUtils {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
static cleanUpWebformJSON = (json) => {
|
|
60
|
-
const cleanup = function(obj) {
|
|
60
|
+
const cleanup = function (obj) {
|
|
61
61
|
if (obj === null || obj === undefined || typeof obj !== 'object') {
|
|
62
62
|
return obj
|
|
63
63
|
}
|
|
64
|
-
Object.keys(obj).forEach(function(key) {
|
|
64
|
+
Object.keys(obj).forEach(function (key) {
|
|
65
65
|
if (
|
|
66
66
|
[
|
|
67
67
|
'#after_build',
|
|
@@ -105,7 +105,7 @@ export class FormTestUtils {
|
|
|
105
105
|
'#cache',
|
|
106
106
|
'#attached',
|
|
107
107
|
'#_element_validate',
|
|
108
|
-
'#summary_attributes'
|
|
108
|
+
'#summary_attributes',
|
|
109
109
|
].includes(key)
|
|
110
110
|
) {
|
|
111
111
|
obj[key] = undefined
|
|
@@ -25,8 +25,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
25
25
|
labelPosition: 'top',
|
|
26
26
|
mask: false,
|
|
27
27
|
type: 'textfield',
|
|
28
|
-
validate: { maxLength: 255 }
|
|
29
|
-
}
|
|
28
|
+
validate: { maxLength: 255 },
|
|
29
|
+
},
|
|
30
30
|
],
|
|
31
31
|
customClass: 'custom-formio-1',
|
|
32
32
|
defaultValue: {},
|
|
@@ -43,29 +43,29 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
43
43
|
mask: false,
|
|
44
44
|
reorder: true,
|
|
45
45
|
type: 'datagrid',
|
|
46
|
-
validate: { maxLength: 3, minLength: 0 }
|
|
47
|
-
}
|
|
48
|
-
])
|
|
46
|
+
validate: { maxLength: 3, minLength: 0 },
|
|
47
|
+
},
|
|
48
|
+
]),
|
|
49
49
|
)
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
it(`should return a submission value`, () => {
|
|
52
|
+
it(`should return a submission value`, async () => {
|
|
53
53
|
const formioform = FormTestUtils.getParsedFormFromJSON(json)
|
|
54
|
-
const submission = FormTestUtils.getSubmissionValue(
|
|
54
|
+
const submission = await FormTestUtils.getSubmissionValue(
|
|
55
55
|
{
|
|
56
56
|
tx1: [
|
|
57
57
|
{
|
|
58
|
-
tx1: 'as'
|
|
58
|
+
tx1: 'as',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
tx1: 'sdsds'
|
|
62
|
-
}
|
|
63
|
-
]
|
|
61
|
+
tx1: 'sdsds',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
64
|
},
|
|
65
|
-
formioform
|
|
65
|
+
formioform,
|
|
66
66
|
)
|
|
67
67
|
expect(submission).toEqual({
|
|
68
|
-
tx1: ['as', 'sdsds']
|
|
68
|
+
tx1: ['as', 'sdsds'],
|
|
69
69
|
})
|
|
70
70
|
})
|
|
71
71
|
})
|
|
@@ -23,7 +23,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
23
23
|
placeholder:
|
|
24
24
|
"type 'show' to show textfield2 and hide container with textbox",
|
|
25
25
|
type: 'textfield',
|
|
26
|
-
validate: { maxLength: 255, required: false }
|
|
26
|
+
validate: { maxLength: 255, required: false },
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
attributes: { counter: 2 },
|
|
@@ -44,15 +44,15 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
44
44
|
name: 0,
|
|
45
45
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
46
46
|
state: false,
|
|
47
|
-
type: 'property'
|
|
48
|
-
}
|
|
47
|
+
type: 'property',
|
|
48
|
+
},
|
|
49
49
|
],
|
|
50
50
|
defaultProps: { hidden: true },
|
|
51
51
|
name: 0,
|
|
52
52
|
trigger: {
|
|
53
53
|
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
54
|
-
type: 'javascript'
|
|
55
|
-
}
|
|
54
|
+
type: 'javascript',
|
|
55
|
+
},
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
actions: [
|
|
@@ -60,20 +60,20 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
60
60
|
name: 0,
|
|
61
61
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
62
62
|
state: false,
|
|
63
|
-
type: 'property'
|
|
64
|
-
}
|
|
63
|
+
type: 'property',
|
|
64
|
+
},
|
|
65
65
|
],
|
|
66
66
|
defaultProps: { hidden: true },
|
|
67
67
|
name: 0,
|
|
68
68
|
trigger: {
|
|
69
69
|
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
70
|
-
type: 'javascript'
|
|
71
|
-
}
|
|
72
|
-
}
|
|
70
|
+
type: 'javascript',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
73
|
],
|
|
74
74
|
mask: false,
|
|
75
75
|
type: 'textfield',
|
|
76
|
-
validate: { maxLength: 255, required: false }
|
|
76
|
+
validate: { maxLength: 255, required: false },
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
attributes: { counter: 3 },
|
|
@@ -93,8 +93,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
93
93
|
mask: false,
|
|
94
94
|
placeholder: 'type anything to show textbox3',
|
|
95
95
|
type: 'textfield',
|
|
96
|
-
validate: { maxLength: 255, required: false }
|
|
97
|
-
}
|
|
96
|
+
validate: { maxLength: 255, required: false },
|
|
97
|
+
},
|
|
98
98
|
],
|
|
99
99
|
customClass: 'custom-formio-3',
|
|
100
100
|
disabled: false,
|
|
@@ -112,15 +112,15 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
112
112
|
name: 0,
|
|
113
113
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
114
114
|
state: false,
|
|
115
|
-
type: 'property'
|
|
116
|
-
}
|
|
115
|
+
type: 'property',
|
|
116
|
+
},
|
|
117
117
|
],
|
|
118
118
|
defaultProps: { hidden: true },
|
|
119
119
|
name: 0,
|
|
120
120
|
trigger: {
|
|
121
121
|
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
122
|
-
type: 'javascript'
|
|
123
|
-
}
|
|
122
|
+
type: 'javascript',
|
|
123
|
+
},
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
actions: [
|
|
@@ -128,20 +128,20 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
128
128
|
name: 0,
|
|
129
129
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
130
130
|
state: false,
|
|
131
|
-
type: 'property'
|
|
132
|
-
}
|
|
131
|
+
type: 'property',
|
|
132
|
+
},
|
|
133
133
|
],
|
|
134
134
|
defaultProps: { hidden: true },
|
|
135
135
|
name: 0,
|
|
136
136
|
trigger: {
|
|
137
137
|
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
138
|
-
type: 'javascript'
|
|
139
|
-
}
|
|
140
|
-
}
|
|
138
|
+
type: 'javascript',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
141
|
],
|
|
142
142
|
mask: false,
|
|
143
143
|
type: 'container',
|
|
144
|
-
validate: {}
|
|
144
|
+
validate: {},
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
attributes: { counter: 4 },
|
|
@@ -162,16 +162,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
162
162
|
name: 0,
|
|
163
163
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
164
164
|
state: false,
|
|
165
|
-
type: 'property'
|
|
166
|
-
}
|
|
165
|
+
type: 'property',
|
|
166
|
+
},
|
|
167
167
|
],
|
|
168
168
|
defaultProps: { hidden: true },
|
|
169
169
|
name: 0,
|
|
170
170
|
trigger: {
|
|
171
171
|
javascript:
|
|
172
172
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
173
|
-
type: 'javascript'
|
|
174
|
-
}
|
|
173
|
+
type: 'javascript',
|
|
174
|
+
},
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
actions: [
|
|
@@ -179,16 +179,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
179
179
|
name: 0,
|
|
180
180
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
181
181
|
state: false,
|
|
182
|
-
type: 'property'
|
|
183
|
-
}
|
|
182
|
+
type: 'property',
|
|
183
|
+
},
|
|
184
184
|
],
|
|
185
185
|
defaultProps: { hidden: true },
|
|
186
186
|
name: 0,
|
|
187
187
|
trigger: {
|
|
188
188
|
javascript:
|
|
189
189
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
190
|
-
type: 'javascript'
|
|
191
|
-
}
|
|
190
|
+
type: 'javascript',
|
|
191
|
+
},
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
actions: [
|
|
@@ -196,16 +196,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
196
196
|
name: 0,
|
|
197
197
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
198
198
|
state: false,
|
|
199
|
-
type: 'property'
|
|
200
|
-
}
|
|
199
|
+
type: 'property',
|
|
200
|
+
},
|
|
201
201
|
],
|
|
202
202
|
defaultProps: { hidden: true },
|
|
203
203
|
name: 0,
|
|
204
204
|
trigger: {
|
|
205
205
|
javascript:
|
|
206
206
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
207
|
-
type: 'javascript'
|
|
208
|
-
}
|
|
207
|
+
type: 'javascript',
|
|
208
|
+
},
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
actions: [
|
|
@@ -213,22 +213,22 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
213
213
|
name: 0,
|
|
214
214
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
215
215
|
state: false,
|
|
216
|
-
type: 'property'
|
|
217
|
-
}
|
|
216
|
+
type: 'property',
|
|
217
|
+
},
|
|
218
218
|
],
|
|
219
219
|
defaultProps: { hidden: true },
|
|
220
220
|
name: 0,
|
|
221
221
|
trigger: {
|
|
222
222
|
javascript:
|
|
223
223
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
224
|
-
type: 'javascript'
|
|
225
|
-
}
|
|
226
|
-
}
|
|
224
|
+
type: 'javascript',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
227
|
],
|
|
228
228
|
mask: false,
|
|
229
229
|
placeholder: "type a pattern ending with 'text4' to show textbox4",
|
|
230
230
|
type: 'textfield',
|
|
231
|
-
validate: { maxLength: 255, required: false }
|
|
231
|
+
validate: { maxLength: 255, required: false },
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
attributes: { counter: 5 },
|
|
@@ -249,16 +249,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
249
249
|
name: 0,
|
|
250
250
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
251
251
|
state: false,
|
|
252
|
-
type: 'property'
|
|
253
|
-
}
|
|
252
|
+
type: 'property',
|
|
253
|
+
},
|
|
254
254
|
],
|
|
255
255
|
defaultProps: { hidden: true },
|
|
256
256
|
name: 0,
|
|
257
257
|
trigger: {
|
|
258
258
|
javascript:
|
|
259
259
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
260
|
-
type: 'javascript'
|
|
261
|
-
}
|
|
260
|
+
type: 'javascript',
|
|
261
|
+
},
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
actions: [
|
|
@@ -266,16 +266,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
266
266
|
name: 0,
|
|
267
267
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
268
268
|
state: false,
|
|
269
|
-
type: 'property'
|
|
270
|
-
}
|
|
269
|
+
type: 'property',
|
|
270
|
+
},
|
|
271
271
|
],
|
|
272
272
|
defaultProps: { hidden: true },
|
|
273
273
|
name: 0,
|
|
274
274
|
trigger: {
|
|
275
275
|
javascript:
|
|
276
276
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
277
|
-
type: 'javascript'
|
|
278
|
-
}
|
|
277
|
+
type: 'javascript',
|
|
278
|
+
},
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
actions: [
|
|
@@ -283,23 +283,23 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
283
283
|
name: 0,
|
|
284
284
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
285
285
|
state: false,
|
|
286
|
-
type: 'property'
|
|
287
|
-
}
|
|
286
|
+
type: 'property',
|
|
287
|
+
},
|
|
288
288
|
],
|
|
289
289
|
defaultProps: { hidden: true },
|
|
290
290
|
name: 0,
|
|
291
291
|
trigger: {
|
|
292
292
|
javascript:
|
|
293
293
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
294
|
-
type: 'javascript'
|
|
295
|
-
}
|
|
296
|
-
}
|
|
294
|
+
type: 'javascript',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
297
|
],
|
|
298
298
|
mask: false,
|
|
299
299
|
type: 'textfield',
|
|
300
|
-
validate: { maxLength: 255, required: false }
|
|
301
|
-
}
|
|
302
|
-
])
|
|
300
|
+
validate: { maxLength: 255, required: false },
|
|
301
|
+
},
|
|
302
|
+
]),
|
|
303
303
|
)
|
|
304
304
|
expect(components).toEqual(
|
|
305
305
|
FormTestUtils.getComparisonJSON([
|
|
@@ -318,7 +318,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
318
318
|
placeholder:
|
|
319
319
|
"type 'show' to show textfield2 and hide container with textbox",
|
|
320
320
|
type: 'textfield',
|
|
321
|
-
validate: { maxLength: 255, required: false }
|
|
321
|
+
validate: { maxLength: 255, required: false },
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
324
|
attributes: { counter: 2 },
|
|
@@ -339,15 +339,15 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
339
339
|
name: 0,
|
|
340
340
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
341
341
|
state: false,
|
|
342
|
-
type: 'property'
|
|
343
|
-
}
|
|
342
|
+
type: 'property',
|
|
343
|
+
},
|
|
344
344
|
],
|
|
345
345
|
defaultProps: { hidden: true },
|
|
346
346
|
name: 0,
|
|
347
347
|
trigger: {
|
|
348
348
|
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
349
|
-
type: 'javascript'
|
|
350
|
-
}
|
|
349
|
+
type: 'javascript',
|
|
350
|
+
},
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
353
|
actions: [
|
|
@@ -355,20 +355,20 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
355
355
|
name: 0,
|
|
356
356
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
357
357
|
state: false,
|
|
358
|
-
type: 'property'
|
|
359
|
-
}
|
|
358
|
+
type: 'property',
|
|
359
|
+
},
|
|
360
360
|
],
|
|
361
361
|
defaultProps: { hidden: true },
|
|
362
362
|
name: 0,
|
|
363
363
|
trigger: {
|
|
364
364
|
javascript: "result = (Boolean(data.textbox1 === 'show'))",
|
|
365
|
-
type: 'javascript'
|
|
366
|
-
}
|
|
367
|
-
}
|
|
365
|
+
type: 'javascript',
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
368
|
],
|
|
369
369
|
mask: false,
|
|
370
370
|
type: 'textfield',
|
|
371
|
-
validate: { maxLength: 255, required: false }
|
|
371
|
+
validate: { maxLength: 255, required: false },
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
attributes: { counter: 3 },
|
|
@@ -388,8 +388,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
388
388
|
mask: false,
|
|
389
389
|
placeholder: 'type anything to show textbox3',
|
|
390
390
|
type: 'textfield',
|
|
391
|
-
validate: { maxLength: 255, required: false }
|
|
392
|
-
}
|
|
391
|
+
validate: { maxLength: 255, required: false },
|
|
392
|
+
},
|
|
393
393
|
],
|
|
394
394
|
customClass: 'custom-formio-3',
|
|
395
395
|
disabled: false,
|
|
@@ -407,15 +407,15 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
407
407
|
name: 0,
|
|
408
408
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
409
409
|
state: false,
|
|
410
|
-
type: 'property'
|
|
411
|
-
}
|
|
410
|
+
type: 'property',
|
|
411
|
+
},
|
|
412
412
|
],
|
|
413
413
|
defaultProps: { hidden: true },
|
|
414
414
|
name: 0,
|
|
415
415
|
trigger: {
|
|
416
416
|
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
417
|
-
type: 'javascript'
|
|
418
|
-
}
|
|
417
|
+
type: 'javascript',
|
|
418
|
+
},
|
|
419
419
|
},
|
|
420
420
|
{
|
|
421
421
|
actions: [
|
|
@@ -423,20 +423,20 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
423
423
|
name: 0,
|
|
424
424
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
425
425
|
state: false,
|
|
426
|
-
type: 'property'
|
|
427
|
-
}
|
|
426
|
+
type: 'property',
|
|
427
|
+
},
|
|
428
428
|
],
|
|
429
429
|
defaultProps: { hidden: true },
|
|
430
430
|
name: 0,
|
|
431
431
|
trigger: {
|
|
432
432
|
javascript: "result = (Boolean(data.textbox1 !== 'show'))",
|
|
433
|
-
type: 'javascript'
|
|
434
|
-
}
|
|
435
|
-
}
|
|
433
|
+
type: 'javascript',
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
436
|
],
|
|
437
437
|
mask: false,
|
|
438
438
|
type: 'container',
|
|
439
|
-
validate: {}
|
|
439
|
+
validate: {},
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
442
|
attributes: { counter: 4 },
|
|
@@ -457,16 +457,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
457
457
|
name: 0,
|
|
458
458
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
459
459
|
state: false,
|
|
460
|
-
type: 'property'
|
|
461
|
-
}
|
|
460
|
+
type: 'property',
|
|
461
|
+
},
|
|
462
462
|
],
|
|
463
463
|
defaultProps: { hidden: true },
|
|
464
464
|
name: 0,
|
|
465
465
|
trigger: {
|
|
466
466
|
javascript:
|
|
467
467
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
468
|
-
type: 'javascript'
|
|
469
|
-
}
|
|
468
|
+
type: 'javascript',
|
|
469
|
+
},
|
|
470
470
|
},
|
|
471
471
|
{
|
|
472
472
|
actions: [
|
|
@@ -474,16 +474,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
474
474
|
name: 0,
|
|
475
475
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
476
476
|
state: false,
|
|
477
|
-
type: 'property'
|
|
478
|
-
}
|
|
477
|
+
type: 'property',
|
|
478
|
+
},
|
|
479
479
|
],
|
|
480
480
|
defaultProps: { hidden: true },
|
|
481
481
|
name: 0,
|
|
482
482
|
trigger: {
|
|
483
483
|
javascript:
|
|
484
484
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
485
|
-
type: 'javascript'
|
|
486
|
-
}
|
|
485
|
+
type: 'javascript',
|
|
486
|
+
},
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
actions: [
|
|
@@ -491,16 +491,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
491
491
|
name: 0,
|
|
492
492
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
493
493
|
state: false,
|
|
494
|
-
type: 'property'
|
|
495
|
-
}
|
|
494
|
+
type: 'property',
|
|
495
|
+
},
|
|
496
496
|
],
|
|
497
497
|
defaultProps: { hidden: true },
|
|
498
498
|
name: 0,
|
|
499
499
|
trigger: {
|
|
500
500
|
javascript:
|
|
501
501
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
502
|
-
type: 'javascript'
|
|
503
|
-
}
|
|
502
|
+
type: 'javascript',
|
|
503
|
+
},
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
506
|
actions: [
|
|
@@ -508,22 +508,22 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
508
508
|
name: 0,
|
|
509
509
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
510
510
|
state: false,
|
|
511
|
-
type: 'property'
|
|
512
|
-
}
|
|
511
|
+
type: 'property',
|
|
512
|
+
},
|
|
513
513
|
],
|
|
514
514
|
defaultProps: { hidden: true },
|
|
515
515
|
name: 0,
|
|
516
516
|
trigger: {
|
|
517
517
|
javascript:
|
|
518
518
|
"result = (Boolean((data.c31.textboxContainer !== null && data.c31.textboxContainer !== undefined && data.c31.textboxContainer !== '')))",
|
|
519
|
-
type: 'javascript'
|
|
520
|
-
}
|
|
521
|
-
}
|
|
519
|
+
type: 'javascript',
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
522
|
],
|
|
523
523
|
mask: false,
|
|
524
524
|
placeholder: "type a pattern ending with 'text4' to show textbox4",
|
|
525
525
|
type: 'textfield',
|
|
526
|
-
validate: { maxLength: 255, required: false }
|
|
526
|
+
validate: { maxLength: 255, required: false },
|
|
527
527
|
},
|
|
528
528
|
{
|
|
529
529
|
attributes: { counter: 5 },
|
|
@@ -544,16 +544,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
544
544
|
name: 0,
|
|
545
545
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
546
546
|
state: false,
|
|
547
|
-
type: 'property'
|
|
548
|
-
}
|
|
547
|
+
type: 'property',
|
|
548
|
+
},
|
|
549
549
|
],
|
|
550
550
|
defaultProps: { hidden: true },
|
|
551
551
|
name: 0,
|
|
552
552
|
trigger: {
|
|
553
553
|
javascript:
|
|
554
554
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
555
|
-
type: 'javascript'
|
|
556
|
-
}
|
|
555
|
+
type: 'javascript',
|
|
556
|
+
},
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
559
|
actions: [
|
|
@@ -561,16 +561,16 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
561
561
|
name: 0,
|
|
562
562
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
563
563
|
state: false,
|
|
564
|
-
type: 'property'
|
|
565
|
-
}
|
|
564
|
+
type: 'property',
|
|
565
|
+
},
|
|
566
566
|
],
|
|
567
567
|
defaultProps: { hidden: true },
|
|
568
568
|
name: 0,
|
|
569
569
|
trigger: {
|
|
570
570
|
javascript:
|
|
571
571
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
572
|
-
type: 'javascript'
|
|
573
|
-
}
|
|
572
|
+
type: 'javascript',
|
|
573
|
+
},
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
576
|
actions: [
|
|
@@ -578,42 +578,42 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
578
578
|
name: 0,
|
|
579
579
|
property: { label: 0, type: 'boolean', value: 'hidden' },
|
|
580
580
|
state: false,
|
|
581
|
-
type: 'property'
|
|
582
|
-
}
|
|
581
|
+
type: 'property',
|
|
582
|
+
},
|
|
583
583
|
],
|
|
584
584
|
defaultProps: { hidden: true },
|
|
585
585
|
name: 0,
|
|
586
586
|
trigger: {
|
|
587
587
|
javascript:
|
|
588
588
|
'result = (Boolean((/text4$/.test(data.textbox1))) || Boolean((/text4$/.test(data.textbox3))))',
|
|
589
|
-
type: 'javascript'
|
|
590
|
-
}
|
|
591
|
-
}
|
|
589
|
+
type: 'javascript',
|
|
590
|
+
},
|
|
591
|
+
},
|
|
592
592
|
],
|
|
593
593
|
mask: false,
|
|
594
594
|
type: 'textfield',
|
|
595
|
-
validate: { maxLength: 255, required: false }
|
|
596
|
-
}
|
|
597
|
-
])
|
|
595
|
+
validate: { maxLength: 255, required: false },
|
|
596
|
+
},
|
|
597
|
+
]),
|
|
598
598
|
)
|
|
599
599
|
})
|
|
600
600
|
|
|
601
|
-
it(`should return a submission value`, () => {
|
|
601
|
+
it(`should return a submission value`, async () => {
|
|
602
602
|
const formioform = FormTestUtils.getParsedFormFromJSON(json)
|
|
603
|
-
const submission = FormTestUtils.getSubmissionValue(
|
|
603
|
+
const submission = await FormTestUtils.getSubmissionValue(
|
|
604
604
|
{
|
|
605
605
|
textbox1: 'asa',
|
|
606
606
|
c31: {
|
|
607
|
-
textboxContainer: 'ssdsd'
|
|
607
|
+
textboxContainer: 'ssdsd',
|
|
608
608
|
},
|
|
609
|
-
textbox3: 'dsds'
|
|
609
|
+
textbox3: 'dsds',
|
|
610
610
|
},
|
|
611
|
-
formioform
|
|
611
|
+
formioform,
|
|
612
612
|
)
|
|
613
613
|
expect(submission).toEqual({
|
|
614
614
|
textbox1: 'asa',
|
|
615
615
|
textboxContainer: 'ssdsd',
|
|
616
|
-
textbox3: 'dsds'
|
|
616
|
+
textbox3: 'dsds',
|
|
617
617
|
})
|
|
618
618
|
})
|
|
619
619
|
})
|