@fto-consult/expo-ui 6.71.2 → 6.71.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/package.json
CHANGED
@@ -213,24 +213,22 @@ const FabGroupComponent = React.forwardRef((props,innerRef)=>{
|
|
213
213
|
MANAGER.active = null;
|
214
214
|
}
|
215
215
|
},[display]);
|
216
|
-
return <
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
/>
|
233
|
-
</Portal>
|
216
|
+
return <Group
|
217
|
+
{...rest}
|
218
|
+
color = {color}
|
219
|
+
style = {[rest.style,styles.container]}
|
220
|
+
fabStyle = {[styles.fab,fabStyle,{backgroundColor},!display && styles.hidden]}
|
221
|
+
open={open ?true : false}
|
222
|
+
icon={open ? openedIcon : closedIcon}
|
223
|
+
actions={actions}
|
224
|
+
onStateChange={onStateChange}
|
225
|
+
onPress={(e) => {
|
226
|
+
context.opened = open;
|
227
|
+
if (open && onOpen) {
|
228
|
+
onOpen(e);
|
229
|
+
}
|
230
|
+
}}
|
231
|
+
/>
|
234
232
|
});
|
235
233
|
const actionType = PropTypes.shape({
|
236
234
|
icon : PropTypes.string,
|
@@ -23,7 +23,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,foreignKeyLabel
|
|
23
23
|
props.data = defaultObj(props.data);
|
24
24
|
const type = defaultStr(props.type)?.toLowerCase();
|
25
25
|
isStructData = isStructData || type?.replaceAll("-","").replaceAll("_","").trim().contains("structdata");
|
26
|
-
const {getTableData:appGetForeignKeyTable,getStructData
|
26
|
+
const {getTableData:appGetForeignKeyTable,getStructData} = useApp();
|
27
27
|
if(!foreignKeyColumn && isNonNullString(props.field)){
|
28
28
|
foreignKeyColumn = props.field;
|
29
29
|
}
|
@@ -37,7 +37,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,foreignKeyLabel
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
const getForeignKeyTable = typeof cGetForeignKeyTable =='function'? cGetForeignKeyTable : isStructData ? getStructData: appGetForeignKeyTable;
|
40
|
-
convertFiltersToSQL = defaultVal(convertFiltersToSQL
|
40
|
+
convertFiltersToSQL = defaultVal(convertFiltersToSQL);
|
41
41
|
const foreignKeyTableStr = defaultStr(foreignKeyTable,props.tableName,props.table);
|
42
42
|
if(typeof getForeignKeyTable !=='function'){
|
43
43
|
console.error("la fonction getTableData non définie des les paramètres d'initialisation de l'application!!! Rassurez vous d'avoir définier cette fonction!!, options : foreignKeyTable:",foreignKeyTable,"foreignKeyColumn:",foreignKeyColumn,props)
|
@@ -145,7 +145,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,foreignKeyLabel
|
|
145
145
|
const context = {
|
146
146
|
refresh : (force,cb)=>{
|
147
147
|
if(!isMounted()) return;
|
148
|
-
if(typeof beforeFetchItems ==='function' && beforeFetchItems(fetchOptions) === false) return;
|
148
|
+
if(typeof beforeFetchItems ==='function' && beforeFetchItems({fetchOptions}) === false) return;
|
149
149
|
let opts = Object.clone(fetchOptions);
|
150
150
|
if(cPrepareFilters !== false){
|
151
151
|
opts.selector = prepareFilters(fetchOptions.selector,{convertToSQL:convertFiltersToSQL});
|
@@ -233,9 +233,11 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,foreignKeyLabel
|
|
233
233
|
itv = t =='money'? itv.formatMoney() : itv.formatNumber();
|
234
234
|
}
|
235
235
|
} else {
|
236
|
-
|
237
|
-
itv
|
238
|
-
|
236
|
+
/***
|
237
|
+
if(typeof itv =='string' && itv && DateLib.isIsoDateStr(itv)){
|
238
|
+
itv = DateLib.format(itv,DateLib.defaultDateFormat);
|
239
|
+
}
|
240
|
+
*/
|
239
241
|
}
|
240
242
|
}
|
241
243
|
itl+= (itl?" ":"")+ (itv || defaultStr(itv))
|
package/src/context/TableData.js
CHANGED
@@ -54,6 +54,7 @@ export function prepareScreens ({tables,screens:screensProps,TableDataScreen,Tab
|
|
54
54
|
TableDataScreenComponentRef.current = React.isComponent(TableDataScreen)? TableDataScreen : TableDataScreenComponentRef.current;
|
55
55
|
TableDataScreenComponentRef.List = React.isComponent(TableDataScreenList)? TableDataScreenList : TableDataScreenComponentRef.List;
|
56
56
|
const Modal = defaultBool(TableDataScreenComponentRef.current?.Modal,TableDataScreenComponentRef.current?.modal,true)
|
57
|
+
const withFab = typeof TableDataScreenComponentRef.current?.withFab =="boolean"? TableDataScreenComponentRef.current?.withFab : false;
|
57
58
|
loopForScreen(screensProps,screens,foundTables);
|
58
59
|
Object.map(tables,(table,i)=>{
|
59
60
|
if(!isObj(table) || !isNonNullString(i)) return;
|
@@ -63,16 +64,19 @@ export function prepareScreens ({tables,screens:screensProps,TableDataScreen,Tab
|
|
63
64
|
screens.push({
|
64
65
|
Component : TableDataScreenItem,
|
65
66
|
screenName,
|
67
|
+
withFab,
|
66
68
|
Modal
|
67
69
|
})
|
68
70
|
foundTables[screenName] = TableDataScreenItem;
|
69
71
|
} else if(React.isComponent(foundTables[screenName])){
|
70
72
|
foundTables[screenName].Modal = defaultBool(foundTables[screenName]?.Modal,foundTables[screenName].modal,Modal)
|
73
|
+
foundTables[screenName].withFab = typeof foundTables[screenName]?.withFab ==="boolean" ? foundTables[screenName]?.withFab : withFab;
|
71
74
|
}
|
72
75
|
if(!foundTables[listScreenName] && table.datagrid !== false){
|
73
76
|
screens.push({
|
74
77
|
Component : TableDataListScreen,
|
75
78
|
screenName : listScreenName,
|
79
|
+
withFab,
|
76
80
|
});
|
77
81
|
foundTables[listScreenName] = TableDataListScreen;
|
78
82
|
}
|
package/src/layouts/Fab/index.js
CHANGED
@@ -14,7 +14,6 @@ const FabLayoutComponent = React.forwardRef((p,ref)=>{
|
|
14
14
|
const {components:{fabPropsMutator},tablesData} = useExpoUI();
|
15
15
|
const {style,actions:fabActions,...props} = typeof fabPropsMutator == 'function'? extendObj({},p,fabPropsMutator({...p,isLoggedIn})) : p;
|
16
16
|
const isLoggedIn = useIsSignedIn();
|
17
|
-
const isMounted = React.useIsMounted();
|
18
17
|
const tables = isObjOrArray(fabActions)? fabActions : tablesData;
|
19
18
|
const actions = React.useMemo(()=>{
|
20
19
|
if(Array.isArray(fabActions)) return fabActions;
|
@@ -63,7 +63,7 @@ export default function ScreenWrapperNavComponent(_props){
|
|
63
63
|
},[]);
|
64
64
|
setScreenOptions(options);
|
65
65
|
const allowDrawer = typeof options.allowDrawer ==='boolean'? options.allowDrawer : typeof options.withDrawer =='boolean'? options.withDrawer : typeof Screen.allowDrawer =='boolean'? Screen.allowDrawer : typeof Screen.withDrawer =='boolean' ? Screen.withDrawer : Screen.isModalScreen == true ? false : true;
|
66
|
-
const withFab = typeof options.withFab ==='boolean' ? options.withFab : typeof Screen.withFab =='boolean'? Screen.withFab :
|
66
|
+
const withFab = typeof options.withFab ==='boolean' ? options.withFab : typeof Screen.withFab =='boolean'? Screen.withFab : false;
|
67
67
|
return <Screen
|
68
68
|
withFab = {withFab}
|
69
69
|
groupName = {groupName}
|