@fto-consult/expo-ui 6.15.2 → 6.15.3
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/babel.config.js
CHANGED
|
@@ -122,7 +122,7 @@ const generateTableOrStructDataStr = (tableDataPath)=>{
|
|
|
122
122
|
//on génère le fichier getTable des tables data de l'application
|
|
123
123
|
if(getTableJSContent){
|
|
124
124
|
return (`
|
|
125
|
-
|
|
125
|
+
export default function(tableName){
|
|
126
126
|
\tif(!tableName || typeof tableName !=="string") return null;
|
|
127
127
|
\ttableName = tableName.toUpperCase().trim();
|
|
128
128
|
${getTableJSContent}\treturn null;
|
package/package.json
CHANGED
|
@@ -15,12 +15,16 @@ import {navigateToTableData} from "$enavigation/utils";
|
|
|
15
15
|
import Auth from "$cauth";
|
|
16
16
|
import fetch from "$capi/fetch";
|
|
17
17
|
import useContext from "$econtext/hooks";
|
|
18
|
+
/***** la fonction fetchForeignData permet de spécifier s'il s'agit d'une données de structure où non
|
|
19
|
+
dans le champ isStructData
|
|
20
|
+
*/
|
|
18
21
|
const TableLinKComponent = React.forwardRef((props,ref)=>{
|
|
19
22
|
const {components:{tableLinkPropsMutator}} = useContext();
|
|
20
|
-
let {disabled,readOnly,labelProps,server,containerProps,perm,id,fetchForeignData,foreignKeyTable,foreignKeyColumn,data,testID,Component,routeName,routeParams,component,primary,triggerProps,onPress,children, ...rest} = tableLinkPropsMutator(props);
|
|
23
|
+
let {disabled,readOnly,labelProps,server,containerProps,isStructData,type,perm,id,fetchForeignData,foreignKeyTable,foreignKeyColumn,data,testID,Component,routeName,routeParams,component,primary,triggerProps,onPress,children, ...rest} = tableLinkPropsMutator(props);
|
|
21
24
|
testID = defaultStr(testID,"RN_TableDataLinkContainer")
|
|
22
25
|
foreignKeyTable = defaultStr(foreignKeyTable).trim();
|
|
23
26
|
foreignKeyColumn = defaultStr(foreignKeyColumn).trim();
|
|
27
|
+
isStructData = isStructData || defaultStr(type).toLowerCase().replaceAll("_","").replaceAll("-","").includes("structdata");
|
|
24
28
|
rest = defaultObj(rest);
|
|
25
29
|
containerProps = defaultObj(containerProps)
|
|
26
30
|
labelProps = defaultObj(labelProps);
|
|
@@ -32,10 +36,10 @@ const TableLinKComponent = React.forwardRef((props,ref)=>{
|
|
|
32
36
|
const pointerEvents = disabled || readOnly ? 'none' : 'auto';
|
|
33
37
|
const onPressLink = (event)=>{
|
|
34
38
|
React.stopEventPropagation(event);
|
|
35
|
-
if((isNonNullString(perm) && !Auth.isAllowedFromString(perm)) || !Auth
|
|
39
|
+
if((isNonNullString(perm) && !Auth.isAllowedFromString(perm)) || !Auth[isStructData?"isStructDataAllowed":"isTableDataAllowed"]({table:foreignKeyTable,action:'read'})){
|
|
36
40
|
return;
|
|
37
41
|
}
|
|
38
|
-
const args = {...React.getOnPressArgs(event),...rest,fetch,foreignKeyTable,foreignKeyColumn,data,id,value:id};
|
|
42
|
+
const args = {...React.getOnPressArgs(event),...rest,type,columnType:type,isStructData,fetch,foreignKeyTable,foreignKeyColumn,data,id,value:id};
|
|
39
43
|
let r = typeof onPress =='function'? onPress(args) : undefined;
|
|
40
44
|
if(r === false) return;
|
|
41
45
|
const cb = (a)=>{
|