Enhance ObjectProperty and ObjectChildTable components by introducing parentData prop for improved data handling in nested structures. Update related functions to utilize parentData for better context in calculations and rendering.
This commit is contained in:
parent
bdb2327aac
commit
092b9ff4e4
@ -186,6 +186,7 @@ const ObjectChildTable = ({
|
||||
{...property}
|
||||
longId={false}
|
||||
objectData={record}
|
||||
parentData={objectData}
|
||||
isEditing={isEditing}
|
||||
useFormItem={false}
|
||||
name={undefined}
|
||||
|
||||
@ -74,6 +74,7 @@ const ObjectProperty = ({
|
||||
masterFilter = {},
|
||||
language = '',
|
||||
objectData = null,
|
||||
parentData = null,
|
||||
objectType = 'unknown',
|
||||
readOnly = false,
|
||||
disabled = false,
|
||||
@ -100,50 +101,51 @@ const ObjectProperty = ({
|
||||
...rest
|
||||
}) => {
|
||||
if (value && typeof value == 'function' && objectData) {
|
||||
value = value(objectData)
|
||||
value = value(objectData, parentData)
|
||||
}
|
||||
|
||||
if (max && typeof max == 'function' && objectData) {
|
||||
max = max(objectData)
|
||||
max = max(objectData, parentData)
|
||||
}
|
||||
|
||||
if (min && typeof min == 'function' && objectData) {
|
||||
min = min(objectData)
|
||||
min = min(objectData, parentData)
|
||||
}
|
||||
|
||||
if (objectType && typeof objectType == 'function' && objectData) {
|
||||
objectType = objectType(objectData)
|
||||
objectType = objectType(objectData, parentData)
|
||||
}
|
||||
|
||||
if (disabled && typeof disabled == 'function' && objectData) {
|
||||
disabled = disabled(objectData)
|
||||
disabled = disabled(objectData, parentData)
|
||||
}
|
||||
|
||||
if (empty && typeof empty == 'function' && objectData) {
|
||||
empty = empty(objectData)
|
||||
empty = empty(objectData, parentData)
|
||||
}
|
||||
|
||||
if (difference && typeof difference == 'function' && objectData) {
|
||||
difference = difference(objectData)
|
||||
difference = difference(objectData, parentData)
|
||||
}
|
||||
|
||||
if (prefix && typeof prefix == 'function' && objectData) {
|
||||
prefix = prefix(objectData)
|
||||
prefix = prefix(objectData, parentData)
|
||||
}
|
||||
|
||||
if (suffix && typeof suffix == 'function' && objectData) {
|
||||
suffix = suffix(objectData)
|
||||
suffix = suffix(objectData, parentData)
|
||||
}
|
||||
|
||||
if (masterFilter && typeof masterFilter == 'function' && objectData) {
|
||||
masterFilter = masterFilter(objectData)
|
||||
masterFilter = masterFilter(objectData, parentData)
|
||||
}
|
||||
|
||||
if (options && typeof options == 'function' && objectData) {
|
||||
options = options(objectData)
|
||||
options = options(objectData, parentData)
|
||||
}
|
||||
|
||||
if (readOnly && typeof readOnly == 'function' && objectData) {
|
||||
readOnly = readOnly(objectData)
|
||||
readOnly = readOnly(objectData, parentData)
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user