@worksafevictoria/wcl7.5 1.17.1 → 1.18.0-beta.2
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/assets/icons/chevron-right-icon.svg +14 -0
- package/src/assets/icons/notepad.svg +93 -0
- package/src/assets/icons/question.svg +7 -0
- package/src/components/Common/CardGrid/index.vue +83 -74
- package/src/components/Common/CardGridItem/index.vue +31 -4
- package/src/components/Containers/Carousel/index.vue +24 -4
- package/src/components/Containers/SectionGroup/index.stories.js +28 -27
- package/src/components/Containers/SectionGroup/index.vue +5 -0
- package/src/components/Global/AppHeaderNew/index.vue +9 -1
- package/src/components/Global/AppHeaderNew/mobile.scss +4 -2
- package/src/components/Global/HeroHeader/index.vue +74 -57
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +69 -62
- package/src/components/Paragraphs/Calculator/CardContainer/styles.scss +72 -68
- package/src/components/Paragraphs/Calculator/index.vue +61 -44
- package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +134 -0
- package/src/components/Paragraphs/RTWPlanner/Constants.js +433 -0
- package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +32 -0
- package/src/components/Paragraphs/RTWPlanner/{NavBar → Header}/index.vue +20 -9
- package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +72 -0
- package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +231 -0
- package/src/components/Paragraphs/RTWPlanner/Planners/PlanTasks.vue +9 -8
- package/src/components/Paragraphs/RTWPlanner/Planners/PlannerNameModal.vue +97 -0
- package/src/components/Paragraphs/RTWPlanner/Planners/index.vue +367 -175
- package/src/components/Paragraphs/RTWPlanner/index.stories.js +82 -15
- package/src/components/Paragraphs/RTWPlanner/index.vue +109 -31
- package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +32 -11
- package/src/components/Paragraphs/SelectableCards/cardbody.vue +9 -10
- package/src/components/Paragraphs/SelectableCards/cardtop.vue +23 -16
- package/src/components/Paragraphs/SelectableCards/index.stories.js +29 -8
- package/src/components/Paragraphs/SelectableCards/index.vue +124 -50
- package/src/components/Paragraphs/TextMedia/index.vue +4 -0
- package/src/components/SubComponents/Breadcrumb/index.vue +40 -7
- package/src/components/SubComponents/FormInstance/models/base-form-element.js +4 -3
- package/src/components/SubComponents/FormInstance/services/form-render-parser.js +51 -16
- package/src/components/SubComponents/FormInstance/services/logic-parser.js +122 -18
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +52 -50
- package/src/components/SubComponents/FormInstance/stories/mocks/checkboxesother.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/emailconfirm.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/jahd.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/quad.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/radiosother.json +1 -9
- package/src/components/SubComponents/FormInstance/stories/mocks/sameas.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/selectother.json +1 -10
- package/src/components/SubComponents/FormInstance/stories/mocks/styles.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/table-select.json +1 -15
- package/src/components/SubComponents/FormInstance/stories/mocks/token.json +1 -5
- package/src/components/SubComponents/FormInstance/stories/mocks/twig.json +1 -13
- package/src/components/SubComponents/FormInstance/stories/mocks/wizard.json +1 -13
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +3 -0
- package/src/components/SubComponents/FormInstance/tests/form.test.js +2 -1
- package/src/components/SubComponents/FormInstance/tests/radiosother.test.js +12 -11
- package/src/components/SubComponents/FormInstance/tests/rule-disabled.test.js +13 -45
- package/src/components/SubComponents/FormInstance/tests/rule-enabled-value.test.js +8 -24
- package/src/components/SubComponents/FormInstance/tests/rule-hidden.test.js +13 -45
- package/src/components/SubComponents/FormInstance/tests/rule-required-value.test.js +15 -55
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +0 -413
- package/src/components/SubComponents/FormInstance/tests/sameas.test.js +9 -25
- package/src/components/SubComponents/FormInstance/tests/twig.test.js +7 -5
- package/src/components/SubComponents/ResourceGroup/index.vue +1 -1
- package/src/includes/scss/vars/src/colors.module.scss +3 -0
- package/src/includes/scss/vars/src/colors.scss +3 -0
- package/src/index.js +6 -0
- package/src/mock/control-selectable-cards.js +68 -25
- package/src/components/Paragraphs/RTWPlanner/Home/index.vue +0 -83
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
convertStringWithDotNotationToObject,
|
|
3
3
|
generateUniqueId,
|
|
4
|
-
isEmpty
|
|
4
|
+
isEmpty,
|
|
5
5
|
} from '../models/form-utils'
|
|
6
6
|
|
|
7
|
-
export function parseElementStates(webformElement) {
|
|
7
|
+
export function parseElementStates(webformElement, elementInstance) {
|
|
8
8
|
const states = webformElement['#states'] || {}
|
|
9
9
|
let logicList = []
|
|
10
10
|
Object.keys(states)
|
|
@@ -21,9 +21,13 @@ export function parseElementStates(webformElement) {
|
|
|
21
21
|
const state = states[sourceKey]
|
|
22
22
|
let conditonal = `result = (`
|
|
23
23
|
if (Array.isArray(state)) {
|
|
24
|
-
|
|
24
|
+
// Pass instance to ruleToString
|
|
25
|
+
state.forEach((rule) => {
|
|
26
|
+
return (conditonal += ruleToString(rule, elementInstance, conditonal))
|
|
27
|
+
})
|
|
25
28
|
} else {
|
|
26
|
-
|
|
29
|
+
// Pass instance to ruleToString
|
|
30
|
+
conditonal += ruleToString(state, elementInstance, conditonal)
|
|
27
31
|
}
|
|
28
32
|
conditonal += ')'
|
|
29
33
|
logic.trigger.javascript = conditonal
|
|
@@ -54,10 +58,14 @@ function getLogicBasedOnCondition(elementCondition) {
|
|
|
54
58
|
return null
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
function ruleToString(rule) {
|
|
61
|
+
function ruleToString(rule, elementInstance) {
|
|
58
62
|
if (typeof rule === 'object') {
|
|
59
63
|
const conditions = Object.keys(rule).reduce((items, ruleKey) => {
|
|
60
|
-
const condition = ruleItemToString(
|
|
64
|
+
const condition = ruleItemToString(
|
|
65
|
+
rule[ruleKey],
|
|
66
|
+
ruleKey,
|
|
67
|
+
elementInstance,
|
|
68
|
+
)
|
|
61
69
|
if (!isEmpty(condition)) {
|
|
62
70
|
items.push(condition)
|
|
63
71
|
}
|
|
@@ -74,18 +82,45 @@ function ruleToString(rule) {
|
|
|
74
82
|
return ''
|
|
75
83
|
}
|
|
76
84
|
|
|
77
|
-
function ruleItemToString(ruleItem, itemKey) {
|
|
78
|
-
|
|
79
|
-
const
|
|
85
|
+
function ruleItemToString(ruleItem, itemKey, elementInstance) {
|
|
86
|
+
// Regex 1: Matches standard selectors (name="foo"). Captures 'foo'.
|
|
87
|
+
const standardMatch = itemKey.match(/name="([^"]+)"/)
|
|
88
|
+
// Regex 2: Matches array selectors (name="foo[bar]"). Captures 'foo' and 'bar'.
|
|
89
|
+
const arrayMatch = itemKey.match(/name="([^"]+)\[([^\]]+)\]"/)
|
|
90
|
+
|
|
91
|
+
let formComponentID = null // The Formio component key (e.g., 'checkboxes')
|
|
92
|
+
let checkboxOptionKey = null // The specific option key (e.g., 'foo bar')
|
|
93
|
+
|
|
94
|
+
if (arrayMatch && arrayMatch[1] && arrayMatch[2]) {
|
|
95
|
+
// Array Notation found (e.g., name="checkboxes[foo bar]")
|
|
96
|
+
formComponentID = arrayMatch[1]
|
|
97
|
+
checkboxOptionKey = arrayMatch[2]
|
|
98
|
+
} else if (standardMatch && standardMatch[1]) {
|
|
99
|
+
// Standard Notation found (e.g., name="foobar")
|
|
100
|
+
formComponentID = standardMatch[1]
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ... (rest of the function)
|
|
104
|
+
|
|
105
|
+
// Now pass BOTH keys to getTrigger for array-based lookups
|
|
80
106
|
const conditions = Object.keys(ruleItem)
|
|
81
107
|
.map((elementProp) =>
|
|
82
|
-
|
|
108
|
+
formComponentID
|
|
109
|
+
? getTrigger(
|
|
110
|
+
formComponentID,
|
|
111
|
+
ruleItem,
|
|
112
|
+
elementProp,
|
|
113
|
+
checkboxOptionKey,
|
|
114
|
+
elementInstance,
|
|
115
|
+
)
|
|
116
|
+
: null,
|
|
83
117
|
)
|
|
84
118
|
.filter((trigger) => !!trigger)
|
|
85
119
|
.reduce((triggers, trigger) => {
|
|
86
120
|
triggers.push(trigger)
|
|
87
121
|
return triggers
|
|
88
122
|
}, [])
|
|
123
|
+
|
|
89
124
|
return conditions.join('')
|
|
90
125
|
}
|
|
91
126
|
|
|
@@ -95,7 +130,7 @@ function createNewLogic(actionName, actionValue) {
|
|
|
95
130
|
convertStringWithDotNotationToObject(
|
|
96
131
|
defaultProps,
|
|
97
132
|
actionName,
|
|
98
|
-
!!!actionValue
|
|
133
|
+
!!!actionValue,
|
|
99
134
|
)
|
|
100
135
|
} else {
|
|
101
136
|
defaultProps[actionName] = !!!actionValue
|
|
@@ -104,7 +139,7 @@ function createNewLogic(actionName, actionValue) {
|
|
|
104
139
|
name: generateUniqueId(),
|
|
105
140
|
trigger: {
|
|
106
141
|
type: 'javascript',
|
|
107
|
-
javascript: ''
|
|
142
|
+
javascript: '',
|
|
108
143
|
},
|
|
109
144
|
defaultProps,
|
|
110
145
|
actions: [
|
|
@@ -114,20 +149,48 @@ function createNewLogic(actionName, actionValue) {
|
|
|
114
149
|
property: {
|
|
115
150
|
label: generateUniqueId(),
|
|
116
151
|
value: actionName,
|
|
117
|
-
type: 'boolean'
|
|
152
|
+
type: 'boolean',
|
|
118
153
|
},
|
|
119
|
-
state: actionValue
|
|
120
|
-
}
|
|
121
|
-
]
|
|
154
|
+
state: actionValue,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
122
157
|
}
|
|
123
158
|
}
|
|
124
159
|
|
|
125
|
-
function getTrigger(
|
|
160
|
+
function getTrigger(
|
|
161
|
+
formComponentID,
|
|
162
|
+
ruleItem,
|
|
163
|
+
prop,
|
|
164
|
+
checkboxOptionKey = null,
|
|
165
|
+
elementInstance,
|
|
166
|
+
) {
|
|
126
167
|
if (ruleItem.hasOwnProperty(prop)) {
|
|
127
168
|
const value = ruleItem[prop] ?? ''
|
|
169
|
+
|
|
170
|
+
let variable = `data.{${formComponentID}}`
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
if (elementInstance && Array.isArray(elementInstance.tree)) {
|
|
174
|
+
const path = findPathInTree(elementInstance.tree, formComponentID)
|
|
175
|
+
if (path && path.length > 0) {
|
|
176
|
+
variable = buildDataAccessor(path, 'data')
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
let variable = `data.{${formComponentID}}`
|
|
181
|
+
}
|
|
182
|
+
|
|
128
183
|
let valueDelimeter = typeof value === 'string' ? "'" : ''
|
|
129
184
|
let expression = `${valueDelimeter}${value}${valueDelimeter}`
|
|
130
|
-
|
|
185
|
+
|
|
186
|
+
if (checkboxOptionKey && prop === 'checked' && value === true) {
|
|
187
|
+
return `(${variable}['${checkboxOptionKey}']===true)`
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (checkboxOptionKey && prop === 'unchecked' && value === true) {
|
|
191
|
+
return `(!(${variable}['${checkboxOptionKey}']===true))`
|
|
192
|
+
}
|
|
193
|
+
|
|
131
194
|
if (typeof value !== 'object' && prop === 'value') {
|
|
132
195
|
return `${variable} === ${expression}`
|
|
133
196
|
} else if (typeof value === 'object' && prop === 'value') {
|
|
@@ -171,3 +234,44 @@ function getTrigger(formElementID, ruleItem, prop) {
|
|
|
171
234
|
}
|
|
172
235
|
return null
|
|
173
236
|
}
|
|
237
|
+
|
|
238
|
+
function findPathInTree(tree, targetKey) {
|
|
239
|
+
if (!Array.isArray(tree) || !targetKey) return null
|
|
240
|
+
|
|
241
|
+
function dfs(nodes, path) {
|
|
242
|
+
for (const node of nodes) {
|
|
243
|
+
if (!node) continue
|
|
244
|
+
const nodeKey = node.key
|
|
245
|
+
const newPath =
|
|
246
|
+
nodeKey && node.type !== 'webform_wizard_page'
|
|
247
|
+
? path.concat(nodeKey)
|
|
248
|
+
: path
|
|
249
|
+
if (nodeKey === targetKey) return newPath
|
|
250
|
+
if (Array.isArray(node.children) && node.children.length > 0) {
|
|
251
|
+
const found = dfs(node.children, newPath)
|
|
252
|
+
if (found) return found
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return null
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return dfs(tree, [])
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function isIdentifier(key) {
|
|
262
|
+
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(String(key))
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function buildDataAccessor(pathArray, rootName = 'data') {
|
|
266
|
+
if (!Array.isArray(pathArray) || pathArray.length === 0) return rootName
|
|
267
|
+
const parts = []
|
|
268
|
+
for (const key of pathArray) {
|
|
269
|
+
if (isIdentifier(key)) {
|
|
270
|
+
parts.push('.' + key)
|
|
271
|
+
} else {
|
|
272
|
+
const escaped = String(key).replace(/'/g, "\\'")
|
|
273
|
+
parts.push(`['${escaped}']`)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return rootName + parts.join('')
|
|
277
|
+
}
|
|
@@ -44,197 +44,197 @@ import { UnknownFormElement } from '../models/overrides/unknown'
|
|
|
44
44
|
import { URLFormElement } from '../models/overrides/url'
|
|
45
45
|
|
|
46
46
|
export class RegisterFactory {
|
|
47
|
-
static getFormIOElement(webformElement, formSettingsMeta, parent) {
|
|
47
|
+
static getFormIOElement(webformElement, formSettingsMeta, parent, tree) {
|
|
48
48
|
const matchingElements = [
|
|
49
49
|
{
|
|
50
50
|
isApplicable: (webformElement, type) =>
|
|
51
51
|
type === 'textfield' &&
|
|
52
52
|
webformElement['#input_mask']?.includes(`'alias': 'currency`),
|
|
53
|
-
factory: CurrencyFormElement
|
|
53
|
+
factory: CurrencyFormElement,
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
isApplicable: (webformElement, type) =>
|
|
57
57
|
type === 'email' ||
|
|
58
58
|
webformElement['#input_mask']?.includes(`'alias': 'email`),
|
|
59
|
-
factory: EmailFormElement
|
|
59
|
+
factory: EmailFormElement,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
isApplicable: 'tel',
|
|
63
|
-
factory: PhoneNumberFormElement
|
|
63
|
+
factory: PhoneNumberFormElement,
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
isApplicable: 'select',
|
|
67
|
-
factory: SelectFormElement
|
|
67
|
+
factory: SelectFormElement,
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
isApplicable: [
|
|
71
71
|
'webform_select_other',
|
|
72
72
|
'webform_checkboxes_other',
|
|
73
|
-
'webform_radios_other'
|
|
73
|
+
'webform_radios_other',
|
|
74
74
|
],
|
|
75
|
-
factory: OptionsOtherFormElement
|
|
75
|
+
factory: OptionsOtherFormElement,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
isApplicable: 'radios',
|
|
79
|
-
factory: RadioFormElement
|
|
79
|
+
factory: RadioFormElement,
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
isApplicable: ['datelist'],
|
|
83
|
-
factory: DateListFormElement
|
|
83
|
+
factory: DateListFormElement,
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
isApplicable: ['date', 'datetime'],
|
|
87
|
-
factory: DateFormElement
|
|
87
|
+
factory: DateFormElement,
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
isApplicable: 'webform_time',
|
|
91
|
-
factory: TimeFormElement
|
|
91
|
+
factory: TimeFormElement,
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
isApplicable: 'number',
|
|
95
|
-
factory: NumberFormElement
|
|
95
|
+
factory: NumberFormElement,
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
isApplicable: 'range',
|
|
99
|
-
factory: RangeFormElement
|
|
99
|
+
factory: RangeFormElement,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
isApplicable: 'webform_likert',
|
|
103
|
-
factory: LikertFormElement
|
|
103
|
+
factory: LikertFormElement,
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
isApplicable: 'tableselect',
|
|
107
|
-
factory: TableSelectFormElement
|
|
107
|
+
factory: TableSelectFormElement,
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
isApplicable: 'webform_multiple',
|
|
111
|
-
factory: MultipleFormElement
|
|
111
|
+
factory: MultipleFormElement,
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
isApplicable: 'webform_custom_composite',
|
|
115
|
-
factory: CustomCompositeFormElement
|
|
115
|
+
factory: CustomCompositeFormElement,
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
isApplicable: 'webform_signature',
|
|
119
|
-
factory: SignatureFormElement
|
|
119
|
+
factory: SignatureFormElement,
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
isApplicable: ['webform_message'],
|
|
123
|
-
factory: MessageFormElement
|
|
123
|
+
factory: MessageFormElement,
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
isApplicable: [
|
|
127
127
|
'webform_markup',
|
|
128
128
|
'processed_text',
|
|
129
129
|
'webform_horizontal_rule',
|
|
130
|
-
'label'
|
|
130
|
+
'label',
|
|
131
131
|
],
|
|
132
|
-
factory: MarkupFormElement
|
|
132
|
+
factory: MarkupFormElement,
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
isApplicable: ['managed_file'],
|
|
136
|
-
factory: FileFormElement
|
|
136
|
+
factory: FileFormElement,
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
isApplicable: ['textformat'],
|
|
140
|
-
factory: TextFormatFormElement
|
|
140
|
+
factory: TextFormatFormElement,
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
isApplicable: 'url',
|
|
144
|
-
factory: URLFormElement
|
|
144
|
+
factory: URLFormElement,
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
isApplicable: ['checkbox', 'webform_same'],
|
|
148
|
-
factory: CheckboxFormElement
|
|
148
|
+
factory: CheckboxFormElement,
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
isApplicable: ['checkboxes'],
|
|
152
|
-
factory: CheckboxesFormElement
|
|
152
|
+
factory: CheckboxesFormElement,
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
isApplicable: 'webform_autocomplete',
|
|
156
|
-
factory: AutoCompleteFormElement
|
|
156
|
+
factory: AutoCompleteFormElement,
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
isApplicable: 'webform_more',
|
|
160
|
-
factory: MoreTextFormElement
|
|
160
|
+
factory: MoreTextFormElement,
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
isApplicable: ['hidden'],
|
|
164
|
-
factory: HiddenFormElement
|
|
164
|
+
factory: HiddenFormElement,
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
isApplicable: 'webform_address',
|
|
168
|
-
factory: AddresseFormElement
|
|
168
|
+
factory: AddresseFormElement,
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
171
|
isApplicable: ['textfield'],
|
|
172
|
-
factory: TextFormElement
|
|
172
|
+
factory: TextFormElement,
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
isApplicable: ['value', 'textarea'],
|
|
176
|
-
factory: TextAreaFormElement
|
|
176
|
+
factory: TextAreaFormElement,
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
isApplicable: 'webform_rating',
|
|
180
|
-
factory: RatingFormElement
|
|
180
|
+
factory: RatingFormElement,
|
|
181
181
|
},
|
|
182
182
|
// Matt testing
|
|
183
183
|
{
|
|
184
184
|
isApplicable: 'webform_testing',
|
|
185
|
-
factory: TestingFormElement
|
|
185
|
+
factory: TestingFormElement,
|
|
186
186
|
},
|
|
187
187
|
|
|
188
188
|
// end Matt testing
|
|
189
189
|
{
|
|
190
190
|
isApplicable: 'webform_scale',
|
|
191
|
-
factory: ScaleFormElement
|
|
191
|
+
factory: ScaleFormElement,
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
isApplicable: 'webform_actions',
|
|
195
|
-
factory: SubmitFormElement
|
|
195
|
+
factory: SubmitFormElement,
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
isApplicable: (webformElement) =>
|
|
199
199
|
webformElement['#webform_plugin_id'] === 'webform_wizard_page',
|
|
200
|
-
factory: PageFormElement
|
|
200
|
+
factory: PageFormElement,
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
isApplicable: 'details',
|
|
204
|
-
factory: DetailFormElement
|
|
204
|
+
factory: DetailFormElement,
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
isApplicable: 'container',
|
|
208
|
-
factory: ContainerFormElement
|
|
208
|
+
factory: ContainerFormElement,
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
isApplicable: 'webform_table',
|
|
212
|
-
factory: TableFormElement
|
|
212
|
+
factory: TableFormElement,
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
isApplicable: 'webform_table_row',
|
|
216
|
-
factory: TableRowFormElement
|
|
216
|
+
factory: TableRowFormElement,
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
219
|
isApplicable: 'item',
|
|
220
|
-
factory: TwigFormElement
|
|
220
|
+
factory: TwigFormElement,
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
isApplicable: ['fieldset', 'webform_section'],
|
|
224
|
-
factory: SectionFormElement
|
|
224
|
+
factory: SectionFormElement,
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
227
|
isApplicable: 'webform_flexbox',
|
|
228
|
-
factory: FlexboxFormElement
|
|
228
|
+
factory: FlexboxFormElement,
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
isApplicable: 'webform_email_confirm',
|
|
232
|
-
factory: EmailConfirmFormElement
|
|
232
|
+
factory: EmailConfirmFormElement,
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
isApplicable: 'webform_codemirror',
|
|
236
|
-
factory: CodeFormElement
|
|
237
|
-
}
|
|
236
|
+
factory: CodeFormElement,
|
|
237
|
+
},
|
|
238
238
|
]
|
|
239
239
|
|
|
240
240
|
const matchingElement = matchingElements.find((item) => {
|
|
@@ -252,7 +252,7 @@ export class RegisterFactory {
|
|
|
252
252
|
const ElementFactory = matchingElement?.factory
|
|
253
253
|
const moreElement = RegisterFactory.getMoreTextInstance(
|
|
254
254
|
webformElement,
|
|
255
|
-
parent
|
|
255
|
+
parent,
|
|
256
256
|
)
|
|
257
257
|
const elementInstance = matchingElement
|
|
258
258
|
? new ElementFactory(webformElement, parent, moreElement)
|
|
@@ -263,6 +263,8 @@ export class RegisterFactory {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
elementInstance.setFormSettingsMeta(formSettingsMeta)
|
|
266
|
+
// Set the tree for logic parsing
|
|
267
|
+
elementInstance.tree = tree
|
|
266
268
|
return elementInstance
|
|
267
269
|
}
|
|
268
270
|
|
|
@@ -274,9 +276,9 @@ export class RegisterFactory {
|
|
|
274
276
|
...webFormElement,
|
|
275
277
|
'#type': 'webform_more',
|
|
276
278
|
'#webform_id': 'webform_more' + webFormElement['#webform_id'],
|
|
277
|
-
'#webform_key': 'webform_more' + webFormElement['#webform_key']
|
|
279
|
+
'#webform_key': 'webform_more' + webFormElement['#webform_key'],
|
|
278
280
|
},
|
|
279
|
-
parent
|
|
281
|
+
parent,
|
|
280
282
|
)
|
|
281
283
|
}
|
|
282
284
|
return moreElement
|
|
@@ -184,14 +184,5 @@
|
|
|
184
184
|
"#ajax_processed": false,
|
|
185
185
|
"#sorted": true,
|
|
186
186
|
"#after_build_done": true
|
|
187
|
-
}
|
|
188
|
-
"#tree": false,
|
|
189
|
-
"#weight": 0.001,
|
|
190
|
-
"#processed": false,
|
|
191
|
-
"#required": false,
|
|
192
|
-
"#title_display": "before",
|
|
193
|
-
"#description_display": "after",
|
|
194
|
-
"#errors": null,
|
|
195
|
-
"#id": "edit-elements",
|
|
196
|
-
"#sorted": true
|
|
187
|
+
}
|
|
197
188
|
}
|
|
@@ -97,14 +97,5 @@
|
|
|
97
97
|
},
|
|
98
98
|
"#sorted": true,
|
|
99
99
|
"#after_build_done": true
|
|
100
|
-
}
|
|
101
|
-
"#tree": false,
|
|
102
|
-
"#weight": 0.001,
|
|
103
|
-
"#processed": false,
|
|
104
|
-
"#required": false,
|
|
105
|
-
"#title_display": "before",
|
|
106
|
-
"#description_display": "after",
|
|
107
|
-
"#errors": null,
|
|
108
|
-
"#id": "edit-elements",
|
|
109
|
-
"#sorted": true
|
|
100
|
+
}
|
|
110
101
|
}
|
|
@@ -1351,9 +1351,5 @@
|
|
|
1351
1351
|
"#title_display": "before",
|
|
1352
1352
|
"#description_display": "after",
|
|
1353
1353
|
"#id": "edit-enter-details"
|
|
1354
|
-
}
|
|
1355
|
-
"#required": false,
|
|
1356
|
-
"#title_display": "before",
|
|
1357
|
-
"#description_display": "after",
|
|
1358
|
-
"#id": "kitchen_sink_formio_v1"
|
|
1354
|
+
}
|
|
1359
1355
|
}
|
|
@@ -164,13 +164,5 @@
|
|
|
164
164
|
"#ajax_processed": false,
|
|
165
165
|
"#sorted": true,
|
|
166
166
|
"#after_build_done": true
|
|
167
|
-
}
|
|
168
|
-
"#tree": false,
|
|
169
|
-
"#processed": false,
|
|
170
|
-
"#required": false,
|
|
171
|
-
"#title_display": "before",
|
|
172
|
-
"#description_display": "after",
|
|
173
|
-
"#errors": null,
|
|
174
|
-
"#id": "edit-elements",
|
|
175
|
-
"#sorted": true
|
|
167
|
+
}
|
|
176
168
|
}
|
|
@@ -102,14 +102,5 @@
|
|
|
102
102
|
"#ajax_processed": false,
|
|
103
103
|
"#sorted": true,
|
|
104
104
|
"#after_build_done": true
|
|
105
|
-
}
|
|
106
|
-
"#tree": false,
|
|
107
|
-
"#weight": 0.001,
|
|
108
|
-
"#processed": false,
|
|
109
|
-
"#required": false,
|
|
110
|
-
"#title_display": "before",
|
|
111
|
-
"#description_display": "after",
|
|
112
|
-
"#errors": null,
|
|
113
|
-
"#id": "edit-elements",
|
|
114
|
-
"#sorted": true
|
|
105
|
+
}
|
|
115
106
|
}
|
|
@@ -454,19 +454,5 @@
|
|
|
454
454
|
},
|
|
455
455
|
"#sorted": true,
|
|
456
456
|
"#after_build_done": true
|
|
457
|
-
}
|
|
458
|
-
"#tree": false,
|
|
459
|
-
"#parents": ["elements"],
|
|
460
|
-
"#array_parents": ["elements"],
|
|
461
|
-
"#weight": 0.001,
|
|
462
|
-
"#processed": false,
|
|
463
|
-
"#required": false,
|
|
464
|
-
"#attributes": {
|
|
465
|
-
"data-drupal-selector": "edit-elements"
|
|
466
|
-
},
|
|
467
|
-
"#title_display": "before",
|
|
468
|
-
"#description_display": "after",
|
|
469
|
-
"#errors": null,
|
|
470
|
-
"#id": "edit-elements",
|
|
471
|
-
"#sorted": true
|
|
457
|
+
}
|
|
472
458
|
}
|
|
@@ -138,17 +138,5 @@
|
|
|
138
138
|
},
|
|
139
139
|
"#sorted": true,
|
|
140
140
|
"#after_build_done": true
|
|
141
|
-
}
|
|
142
|
-
"#tree": false,
|
|
143
|
-
"#weight": 0.001,
|
|
144
|
-
"#processed": false,
|
|
145
|
-
"#required": false,
|
|
146
|
-
"#attributes": {
|
|
147
|
-
"data-drupal-selector": "edit-elements"
|
|
148
|
-
},
|
|
149
|
-
"#title_display": "before",
|
|
150
|
-
"#description_display": "after",
|
|
151
|
-
"#errors": null,
|
|
152
|
-
"#id": "edit-elements",
|
|
153
|
-
"#sorted": true
|
|
141
|
+
}
|
|
154
142
|
}
|
|
@@ -337,17 +337,5 @@
|
|
|
337
337
|
},
|
|
338
338
|
"#theme": "webform_actions",
|
|
339
339
|
"#after_build_done": true
|
|
340
|
-
}
|
|
341
|
-
"#tree": false,
|
|
342
|
-
"#weight": 0.002,
|
|
343
|
-
"#processed": false,
|
|
344
|
-
"#required": false,
|
|
345
|
-
"#attributes": {
|
|
346
|
-
"data-drupal-selector": "edit-elements"
|
|
347
|
-
},
|
|
348
|
-
"#title_display": "before",
|
|
349
|
-
"#description_display": "after",
|
|
350
|
-
"#errors": null,
|
|
351
|
-
"#id": "edit-elements",
|
|
352
|
-
"#sorted": true
|
|
340
|
+
}
|
|
353
341
|
}
|