@alfresco/adf-core 8.4.0-19664991220 → 8.4.0-19669771598
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/fesm2022/adf-core.mjs
CHANGED
|
@@ -20567,12 +20567,31 @@ const ROW_ID_PREFIX = '-Row';
|
|
|
20567
20567
|
* See the License for the specific language governing permissions and
|
|
20568
20568
|
* limitations under the License.
|
|
20569
20569
|
*/
|
|
20570
|
-
const getRule = (id, rule, parent) => rule && parent
|
|
20570
|
+
const getRule = (id, rule, parent) => rule?.ruleOn && parent?.fields
|
|
20571
20571
|
? {
|
|
20572
20572
|
...rule,
|
|
20573
|
-
ruleOn:
|
|
20573
|
+
ruleOn: getRuleOn(id, rule.ruleOn, parent.fields)
|
|
20574
20574
|
}
|
|
20575
20575
|
: rule;
|
|
20576
|
+
const getRuleOn = (id, ruleOn, fields) => {
|
|
20577
|
+
for (const column of Object.values(fields)) {
|
|
20578
|
+
for (const field of column) {
|
|
20579
|
+
if (field.type === FormFieldTypes.SECTION) {
|
|
20580
|
+
for (const sectionColumn of Object.values(field.fields)) {
|
|
20581
|
+
for (const sectionField of sectionColumn) {
|
|
20582
|
+
if (sectionField.id === ruleOn) {
|
|
20583
|
+
return getRepeatableSectionChildRuleOn(id, ruleOn);
|
|
20584
|
+
}
|
|
20585
|
+
}
|
|
20586
|
+
}
|
|
20587
|
+
}
|
|
20588
|
+
if (field.id === ruleOn) {
|
|
20589
|
+
return getRepeatableSectionChildRuleOn(id, ruleOn);
|
|
20590
|
+
}
|
|
20591
|
+
}
|
|
20592
|
+
}
|
|
20593
|
+
return ruleOn;
|
|
20594
|
+
};
|
|
20576
20595
|
const getRepeatableSectionChildRuleOn = (id, ruleOn) => ruleOn + ROW_ID_PREFIX + getRowId(id);
|
|
20577
20596
|
const getRowId = (id) => {
|
|
20578
20597
|
const split = id.split(ROW_ID_PREFIX);
|