@sanity/assist 4.4.7 → 4.4.8
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.esm.js +3 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/helpers/conditionalMembers.test.ts +43 -0
- package/src/helpers/conditionalMembers.ts +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1370,8 +1370,9 @@ function conditionalState(memberState) {
|
|
|
1370
1370
|
return {
|
|
1371
1371
|
path: pathToString(memberState.path),
|
|
1372
1372
|
readOnly: !!memberState.readOnly,
|
|
1373
|
+
// Use actual form state readOnly value
|
|
1373
1374
|
hidden: !1,
|
|
1374
|
-
//
|
|
1375
|
+
// If it's in form state members, it's not hidden
|
|
1375
1376
|
conditional: isConditional(memberState.schemaType)
|
|
1376
1377
|
};
|
|
1377
1378
|
}
|
|
@@ -1406,7 +1407,7 @@ function extractConditionalPaths(node, maxDepth2) {
|
|
|
1406
1407
|
), innerFields = extractConditionalPaths(member.fieldSet, maxDepth2).map((f) => ({
|
|
1407
1408
|
...f,
|
|
1408
1409
|
// if fieldset is conditional, visible fields must also be considered conditional
|
|
1409
|
-
conditional: conditionalFieldset
|
|
1410
|
+
conditional: conditionalFieldset || f.conditional
|
|
1410
1411
|
}));
|
|
1411
1412
|
return [...acc, ...innerFields];
|
|
1412
1413
|
}
|