@worksafevictoria/wcl7.5 1.1.0-beta.61 → 1.1.0-beta.62
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/package.json +1 -1
- package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
- package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
- package/src/components/Paragraphs/Webform/index.stories.js +83 -69
- 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/package.json
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section-group class="sticky-top">
|
|
3
3
|
<b-navbar class="paragraph--scrollspy" :class="{ rtl: rtl }">
|
|
4
|
-
<b-list-group
|
|
5
|
-
v-b-scrollspy="scrollSpy"
|
|
6
|
-
class="flex-column"
|
|
7
|
-
>
|
|
4
|
+
<b-list-group v-b-scrollspy="scrollSpy" class="flex-column">
|
|
8
5
|
<div class="scrollspy__title">{{ title }}</div>
|
|
9
6
|
<b-list-group-item
|
|
10
7
|
v-for="(item, index) in itemList"
|
|
@@ -22,29 +19,41 @@
|
|
|
22
19
|
|
|
23
20
|
<script>
|
|
24
21
|
import SectionGroup from '../../Containers/SectionGroup/index.vue'
|
|
25
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
BNavbar,
|
|
24
|
+
BListGroup,
|
|
25
|
+
BListGroupItem,
|
|
26
|
+
vBScrollspy,
|
|
27
|
+
} from 'bootstrap-vue-next'
|
|
26
28
|
|
|
27
29
|
export default {
|
|
28
30
|
name: 'ScrollSpy',
|
|
29
31
|
components: { SectionGroup, BNavbar, BListGroup, BListGroupItem },
|
|
30
|
-
directives: { 'b-scrollspy':vBScrollspy },
|
|
32
|
+
directives: { 'b-scrollspy': vBScrollspy },
|
|
31
33
|
props: {
|
|
32
34
|
title: {
|
|
33
35
|
type: String,
|
|
34
|
-
default: 'On this page'
|
|
36
|
+
default: 'On this page',
|
|
35
37
|
},
|
|
36
38
|
itemList: {
|
|
37
39
|
type: Array,
|
|
38
|
-
required: true
|
|
40
|
+
required: true,
|
|
39
41
|
},
|
|
40
42
|
rtl: {
|
|
41
43
|
type: Boolean,
|
|
42
|
-
default: false
|
|
44
|
+
default: false,
|
|
43
45
|
},
|
|
44
46
|
scrollSpy: {
|
|
45
47
|
type: Object,
|
|
46
|
-
default: () => {
|
|
47
|
-
|
|
48
|
+
default: () => {
|
|
49
|
+
return {
|
|
50
|
+
element: 'body',
|
|
51
|
+
offset: 100,
|
|
52
|
+
method: 'auto',
|
|
53
|
+
contentQuery: '[id]',
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
48
57
|
},
|
|
49
58
|
methods: {
|
|
50
59
|
scrollToAnchor(anchor) {
|
|
@@ -52,11 +61,11 @@ export default {
|
|
|
52
61
|
if (anchorElement) {
|
|
53
62
|
anchorElement.focus()
|
|
54
63
|
anchorElement.scrollIntoView({
|
|
55
|
-
behavior: 'smooth'
|
|
64
|
+
behavior: 'smooth',
|
|
56
65
|
})
|
|
57
66
|
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
67
|
+
},
|
|
68
|
+
},
|
|
60
69
|
}
|
|
61
70
|
</script>
|
|
62
71
|
|
|
@@ -67,42 +67,45 @@ export default {
|
|
|
67
67
|
CardGrid,
|
|
68
68
|
CardGridItem,
|
|
69
69
|
CardBody,
|
|
70
|
-
CardTop
|
|
70
|
+
CardTop,
|
|
71
|
+
},
|
|
72
|
+
emits: {
|
|
73
|
+
selected: false,
|
|
71
74
|
},
|
|
72
75
|
props: {
|
|
73
76
|
cards: {
|
|
74
77
|
type: Array,
|
|
75
78
|
required: true,
|
|
76
|
-
default: () => []
|
|
79
|
+
default: () => [],
|
|
77
80
|
},
|
|
78
81
|
title: {
|
|
79
82
|
type: String,
|
|
80
|
-
default: null
|
|
83
|
+
default: null,
|
|
81
84
|
},
|
|
82
85
|
headingTag: {
|
|
83
86
|
type: String,
|
|
84
|
-
default: 'h2'
|
|
87
|
+
default: 'h2',
|
|
85
88
|
},
|
|
86
89
|
subHeading: {
|
|
87
90
|
type: String,
|
|
88
|
-
default: null
|
|
91
|
+
default: null,
|
|
89
92
|
},
|
|
90
93
|
iconIsBordered: {
|
|
91
94
|
type: Boolean,
|
|
92
|
-
default: true
|
|
95
|
+
default: true,
|
|
93
96
|
},
|
|
94
97
|
columns: {
|
|
95
98
|
type: Number,
|
|
96
|
-
default: 4
|
|
99
|
+
default: 4,
|
|
97
100
|
},
|
|
98
101
|
cardType: {
|
|
99
102
|
type: String,
|
|
100
|
-
default: null
|
|
103
|
+
default: null,
|
|
101
104
|
},
|
|
102
105
|
cardTextAlign: {
|
|
103
106
|
type: String,
|
|
104
|
-
default: null
|
|
105
|
-
}
|
|
107
|
+
default: null,
|
|
108
|
+
},
|
|
106
109
|
},
|
|
107
110
|
methods: {
|
|
108
111
|
selectedCardChangeFocus(card) {
|
|
@@ -110,7 +113,7 @@ export default {
|
|
|
110
113
|
},
|
|
111
114
|
clearCard() {
|
|
112
115
|
this.$refs.cardgrid.clearCards()
|
|
113
|
-
}
|
|
114
|
-
}
|
|
116
|
+
},
|
|
117
|
+
},
|
|
115
118
|
}
|
|
116
119
|
</script>
|
|
@@ -1,84 +1,84 @@
|
|
|
1
1
|
import WebformPara from './index.vue'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
4
|
+
title: 'Paragraphs/Webform',
|
|
5
|
+
component: WebformPara,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
preview: {
|
|
9
|
+
control: 'boolean',
|
|
10
|
+
table: {
|
|
11
|
+
disable: true,
|
|
13
12
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
},
|
|
14
|
+
processID: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
table: {
|
|
17
|
+
disable: true,
|
|
19
18
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
},
|
|
20
|
+
formid: {
|
|
21
|
+
control: 'string',
|
|
22
|
+
table: {
|
|
23
|
+
disable: true,
|
|
25
24
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
},
|
|
26
|
+
type: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
table: {
|
|
29
|
+
disable: true,
|
|
31
30
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
},
|
|
32
|
+
webFormJson: {
|
|
33
|
+
control: 'object',
|
|
34
|
+
table: {
|
|
35
|
+
disable: true,
|
|
37
36
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
},
|
|
38
|
+
changed: {
|
|
39
|
+
table: {
|
|
40
|
+
disable: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
submitted: {
|
|
44
|
+
table: {
|
|
45
|
+
disable: true,
|
|
42
46
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
},
|
|
48
|
+
rendered: {
|
|
49
|
+
table: {
|
|
50
|
+
disable: true,
|
|
47
51
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
},
|
|
53
|
+
nextPage: {
|
|
54
|
+
table: {
|
|
55
|
+
disable: true,
|
|
52
56
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
},
|
|
58
|
+
prevPage: {
|
|
59
|
+
table: {
|
|
60
|
+
disable: true,
|
|
57
61
|
},
|
|
58
|
-
prevPage: {
|
|
59
|
-
table: {
|
|
60
|
-
disable: true
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
62
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
},
|
|
64
|
+
args: {
|
|
65
|
+
preview: true,
|
|
66
|
+
type: 'api',
|
|
67
|
+
formid: 'review_of_an_agent_decision',
|
|
68
|
+
contentApiUrl: process.env.CONTENT_API_URL,
|
|
69
|
+
processID: `proc-id-form-api
|
|
70
70
|
.toLowerCase()
|
|
71
71
|
.split(' ')
|
|
72
|
-
.join('-')}
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
.join('-')}`,
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
const Template = (args) => ({
|
|
77
|
+
components: { WebformPara },
|
|
78
|
+
setup() {
|
|
79
|
+
return { args }
|
|
80
|
+
},
|
|
81
|
+
template: `
|
|
82
82
|
<div>
|
|
83
83
|
<h2>This is a web page with embedded webform</h2>
|
|
84
84
|
<p> Below is an example webform</p>
|
|
@@ -87,8 +87,22 @@ export default {
|
|
|
87
87
|
<div style="background-color: lightgrey">
|
|
88
88
|
<webform-para v-bind="args" />
|
|
89
89
|
</div>
|
|
90
|
+
<b>Change contentApiUrl from "staging" to "dev" if form not found (file form may only exist in dev)</b>
|
|
90
91
|
</div>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
`,
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const Default = Template.bind({})
|
|
96
|
+
|
|
97
|
+
export const Files = Template.bind()
|
|
98
|
+
// export const Files = {}
|
|
99
|
+
Files.args = {
|
|
100
|
+
preview: false,
|
|
101
|
+
type: 'api',
|
|
102
|
+
formid: 'bbtest_webform_file_upload',
|
|
103
|
+
contentApiUrl: process.env.CONTENT_API_URL,
|
|
104
|
+
processID: `proc-id-form-api
|
|
105
|
+
.toLowerCase()
|
|
106
|
+
.split(' ')
|
|
107
|
+
.join('-')}`,
|
|
108
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import FormInstance from '../index.vue'
|
|
2
|
+
import fileupload from './mocks/fileupload.json'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/File Upload',
|
|
6
|
+
component: FormInstance,
|
|
7
|
+
argTypes: {
|
|
8
|
+
preview: {
|
|
9
|
+
control: 'boolean',
|
|
10
|
+
defaultValue: true,
|
|
11
|
+
table: {
|
|
12
|
+
disable: true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
contentApiUrl: {
|
|
16
|
+
control: 'text',
|
|
17
|
+
defaultValue: process.env.CONTENT_API_URL
|
|
18
|
+
},
|
|
19
|
+
processID: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
defaultValue: 'proc-id-form-advanced-controls',
|
|
22
|
+
table: {
|
|
23
|
+
disable: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
formid: {
|
|
27
|
+
control: 'string',
|
|
28
|
+
defaultValue: '',
|
|
29
|
+
table: {
|
|
30
|
+
disable: true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
type: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
defaultValue: '',
|
|
36
|
+
table: {
|
|
37
|
+
disable: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
webFormJson: {
|
|
41
|
+
control: 'object'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
args: {
|
|
45
|
+
processID: 'proc-id-form-advanced-controls',
|
|
46
|
+
preview: true,
|
|
47
|
+
contentApiUrl:process.env.CONTENT_API_URL
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const FileUpload = {args : {
|
|
53
|
+
type: 'managed_file',
|
|
54
|
+
webFormJson: fileupload,
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"c1": {
|
|
3
|
+
"#type": "managed_file",
|
|
4
|
+
"#title": "file1",
|
|
5
|
+
"#webform": "kitchen_sink_formio_v1",
|
|
6
|
+
"#webform_id": "kitchen_sink_formio_v1--file1",
|
|
7
|
+
"#webform_key": "file1",
|
|
8
|
+
"#description": {
|
|
9
|
+
"#theme": "webform_html_editor_markup",
|
|
10
|
+
"#markup": "Sign above"
|
|
11
|
+
},
|
|
12
|
+
"#description_display": "after",
|
|
13
|
+
"#webform_element": true,
|
|
14
|
+
"#input": true,
|
|
15
|
+
"#markup": "",
|
|
16
|
+
"#required": false,
|
|
17
|
+
"#title_display": "before",
|
|
18
|
+
"#id": "edit-file1",
|
|
19
|
+
"#name": "file1",
|
|
20
|
+
"#value": "",
|
|
21
|
+
"#label_attributes": {
|
|
22
|
+
"webform-remove-for-attribute": true
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|