@fto-consult/expo-ui 6.16.7 → 6.17.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/package.json
CHANGED
|
@@ -21,6 +21,8 @@ import useApp from "$econtext/hooks";
|
|
|
21
21
|
*/
|
|
22
22
|
const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,getForeignKeyTable:cGetForeignKeyTable,prepareFilters:cPrepareFilters,bindUpsert2RemoveEvents,onAdd,showAdd:customShowAdd,canShowAdd,foreignKeyTable,fetchItemsPath,foreignKeyLabel,foreignKeyLabelIndex,dropdownActions,fields,fetchItems:customFetchItem,convertFiltersToSQL,mutateFetchedItems,onFetchItems,isFilter,isUpdate,isDocEditing,items,onAddProps,fetchOptions,...props},ref)=>{
|
|
23
23
|
props.data = defaultObj(props.data);
|
|
24
|
+
const type = defaultStr(props.type)?.toLowerCase();
|
|
25
|
+
isStructData = isStructData || type?.replaceAll("-","").replaceAll("_","").trim().contains("structdata");
|
|
24
26
|
const {getTableData:appGetForeignKeyTable,getStructData} = useApp();
|
|
25
27
|
if(!foreignKeyColumn && isNonNullString(props.field)){
|
|
26
28
|
foreignKeyColumn = props.field;
|
|
@@ -252,7 +254,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,ge
|
|
|
252
254
|
if(typeof canShowAdd ==='function'){
|
|
253
255
|
return canShowAdd({...props,table:foreignKeyTable,foreignKeyColumn,foreignKeyLabel,sortDir,foreignKeyTableObj:fKeyTable,foreignKeyTable})
|
|
254
256
|
}
|
|
255
|
-
if(Auth
|
|
257
|
+
if(Auth[isStructData?"isStructDataAllowed":"isTableDataAllowed"]({table:foreignKeyTable,action:'create'})){
|
|
256
258
|
return !!defaultVal(customShowAdd,true);
|
|
257
259
|
}
|
|
258
260
|
return false;
|