@aehrc/smart-forms-renderer 1.2.12 → 1.2.14
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/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js +1 -1
- package/lib/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.js.map +1 -1
- package/lib/components/FormComponents/GridGroup/GridGroup.js +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.styles.js +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItem.styles.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/GroupItemView.js +2 -2
- package/lib/components/FormComponents/GroupItem/GroupItemView.js.map +1 -1
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js +1 -1
- package/lib/components/FormComponents/GroupItem/TabButtonsWrapper.js.map +1 -1
- package/lib/components/FormComponents/ItemParts/CheckboxSingle.js +2 -1
- package/lib/components/FormComponents/ItemParts/CheckboxSingle.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js +1 -1
- package/lib/components/FormComponents/RepeatGroup/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatGroup/RepeatGroupView.js +1 -1
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js +1 -1
- package/lib/components/FormComponents/RepeatItem/AddItemButton.js.map +1 -1
- package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js +2 -4
- package/lib/components/FormComponents/RepeatItem/RepeatItem.styles.js.map +1 -1
- package/lib/components/FormComponents/Tables/GroupTableView.js +1 -1
- package/lib/components/Renderer/FormBodySingleCollapsible.js +1 -1
- package/lib/components/Renderer/FormBodySingleCollapsible.js.map +1 -1
- package/lib/components/Tabs/FormBodyTabList.js +1 -1
- package/lib/components/Tabs/FormBodyTabList.js.map +1 -1
- package/lib/hooks/useCalculatedExpressionAnimating.d.ts +1 -0
- package/lib/hooks/useCalculatedExpressionAnimating.js +18 -0
- package/lib/hooks/useCalculatedExpressionAnimating.js.map +1 -0
- package/lib/hooks/useShowFeedback.d.ts +11 -0
- package/lib/hooks/useShowFeedback.js +33 -0
- package/lib/hooks/useShowFeedback.js.map +1 -0
- package/lib/interfaces/itemPath.interface.d.ts +31 -0
- package/lib/interfaces/itemPath.interface.js +2 -0
- package/lib/interfaces/itemPath.interface.js.map +1 -0
- package/lib/stores/rendererStylingStore.d.ts +144 -0
- package/lib/stores/rendererStylingStore.js +68 -0
- package/lib/stores/rendererStylingStore.js.map +1 -0
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.d.ts +2 -3
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js +4 -25
- package/lib/stories/storybookWrappers/InitialiseFormWrapperForStorybook.js.map +1 -1
- package/lib/stories/storybookWrappers/index.js +1 -1
- package/lib/utils/calculatedExpression.js +10 -6
- package/lib/utils/calculatedExpression.js.map +1 -1
- package/lib/utils/itemPath.d.ts +57 -0
- package/lib/utils/itemPath.js +75 -0
- package/lib/utils/itemPath.js.map +1 -0
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js +1 -1
- package/lib/utils/questionnaireStoreUtils/addAdditionalVariables.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FormComponents/ChoiceItems/ChoiceSelectAnswerValueSetFields.tsx +1 -0
- package/src/components/FormComponents/GridGroup/GridGroup.tsx +1 -1
- package/src/components/FormComponents/GroupItem/GroupItem.styles.ts +1 -1
- package/src/components/FormComponents/GroupItem/GroupItemView.tsx +4 -0
- package/src/components/FormComponents/GroupItem/TabButtonsWrapper.tsx +1 -1
- package/src/components/FormComponents/ItemParts/CheckboxSingle.tsx +3 -0
- package/src/components/FormComponents/RepeatGroup/AddItemButton.tsx +1 -1
- package/src/components/FormComponents/RepeatGroup/RepeatGroupView.tsx +1 -1
- package/src/components/FormComponents/RepeatItem/AddItemButton.tsx +1 -1
- package/src/components/FormComponents/RepeatItem/RepeatItem.styles.tsx +2 -4
- package/src/components/FormComponents/Tables/GroupTableView.tsx +1 -1
- package/src/components/Renderer/FormBodySingleCollapsible.tsx +2 -0
- package/src/components/Tabs/FormBodyTabList.tsx +5 -1
- package/src/utils/calculatedExpression.ts +10 -11
|
@@ -373,10 +373,6 @@ function applyCalculatedExpressionValuesRecursive(
|
|
|
373
373
|
let qrItem = qrItemOrItems;
|
|
374
374
|
const childQItems = qItem.item;
|
|
375
375
|
if (childQItems && childQItems.length > 0) {
|
|
376
|
-
// If item.type is 'group', create empty group qrItem
|
|
377
|
-
if (qItem.type === 'group') {
|
|
378
|
-
qrItem = qrItemOrItems ?? structuredClone(createEmptyQrGroup(qItem));
|
|
379
|
-
}
|
|
380
376
|
const childQrItems = qrItem?.item ?? [];
|
|
381
377
|
|
|
382
378
|
const indexMap = mapQItemsIndex(qItem);
|
|
@@ -395,13 +391,17 @@ function applyCalculatedExpressionValuesRecursive(
|
|
|
395
391
|
// Update QR items in repeating group
|
|
396
392
|
if (Array.isArray(updatedChildQRItemOrItems)) {
|
|
397
393
|
if (updatedChildQRItemOrItems.length > 0) {
|
|
394
|
+
// Lazily initialise qrItem so all children are added to the same group object
|
|
395
|
+
if (!qrItem) {
|
|
396
|
+
qrItem = structuredClone(createEmptyQrGroup(qItem));
|
|
397
|
+
}
|
|
398
398
|
updateQrItemsInGroup(
|
|
399
399
|
null,
|
|
400
400
|
{
|
|
401
401
|
linkId: childQItem.linkId,
|
|
402
402
|
qrItems: updatedChildQRItemOrItems
|
|
403
403
|
},
|
|
404
|
-
qrItem
|
|
404
|
+
qrItem,
|
|
405
405
|
indexMap
|
|
406
406
|
);
|
|
407
407
|
}
|
|
@@ -411,12 +411,11 @@ function applyCalculatedExpressionValuesRecursive(
|
|
|
411
411
|
// Update QR items in non-repeating group
|
|
412
412
|
const updatedChildQRItem = updatedChildQRItemOrItems;
|
|
413
413
|
if (updatedChildQRItem) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
);
|
|
414
|
+
// Lazily initialise qrItem so all children are added to the same group object
|
|
415
|
+
if (!qrItem) {
|
|
416
|
+
qrItem = structuredClone(createEmptyQrGroup(qItem));
|
|
417
|
+
}
|
|
418
|
+
updateQrItemsInGroup(updatedChildQRItem, null, qrItem, indexMap);
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
|