@bpmn-io/form-js-viewer 2.0.0 → 2.1.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/dist/index.cjs CHANGED
@@ -211,7 +211,7 @@ const _linearizePathExpression = root => {
211
211
 
212
212
  // Traverse the tree and collect path components
213
213
  while (node.name === 'PathExpression') {
214
- parts.push(node.children[1]);
214
+ parts.push(node.children[node.children.length - 1]);
215
215
  node = node.children[0];
216
216
  }
217
217
 
@@ -243,7 +243,7 @@ const _buildSimpleFeelStructureTree = (parseTree, feelString) => {
243
243
  if (node.type.name === 'VariableName') {
244
244
  nodeRepresentation.variableName = feelString.slice(node.from, node.to);
245
245
  }
246
- if (node.type.name === 'Name') {
246
+ if (['Name', 'PathName'].includes(node.type.name)) {
247
247
  nodeRepresentation.variableName = feelString.slice(node.from, node.to);
248
248
  }
249
249
  stack.push(nodeRepresentation);
@@ -1428,10 +1428,11 @@ function useFilteredFormData() {
1428
1428
  const conditionChecker = useService('conditionChecker', false);
1429
1429
  return hooks.useMemo(() => {
1430
1430
  const newData = conditionChecker ? conditionChecker.applyConditions(data, data) : data;
1431
- return {
1432
- ...initialData,
1433
- ...newData
1434
- };
1431
+
1432
+ // deep-merge newData over a clone of initialData, so keys pruned from
1433
+ // newData (e.g. by a hidden group) fall back to their initial value
1434
+ // instead of the whole branch disappearing
1435
+ return minDash.merge(clone(initialData || {}), newData);
1435
1436
  }, [conditionChecker, data, initialData]);
1436
1437
  }
1437
1438