@fto-consult/expo-ui 6.31.2 → 6.31.6
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 +5 -5
- package/src/components/Datagrid/Accordion/index.js +1 -1
- package/src/components/Datagrid/Actions/index.js +6 -3
- package/src/components/Datagrid/Common/Common.js +3 -5
- package/src/components/Datagrid/SWRDatagrid.js +4 -3
- package/src/components/Datagrid/hooks/index.js +3 -3
- package/src/components/Form/List/List.js +2 -0
- package/src/components/TextField/index.js +1 -1
- package/src/layouts/Screen/TableData.js +74 -40
- package/src/layouts/Screen/utils.js +1 -2
- package/src/screens/Help/openLibraries.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.6",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@expo/html-elements": "^0.5.1",
|
|
69
69
|
"@expo/vector-icons": "^13.0.0",
|
|
70
70
|
"@faker-js/faker": "^8.0.2",
|
|
71
|
-
"@fto-consult/common": "^3.
|
|
71
|
+
"@fto-consult/common": "^3.32.9",
|
|
72
72
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
|
73
73
|
"@react-native-async-storage/async-storage": "1.18.2",
|
|
74
74
|
"@react-native-community/datetimepicker": "7.2.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"@react-navigation/native-stack": "^6.9.13",
|
|
79
79
|
"@shopify/flash-list": "1.4.3",
|
|
80
80
|
"apexcharts": "^3.42.0",
|
|
81
|
-
"expo": "^49.0.
|
|
81
|
+
"expo": "^49.0.9",
|
|
82
82
|
"expo-camera": "~13.4.2",
|
|
83
83
|
"expo-clipboard": "~4.3.1",
|
|
84
84
|
"expo-font": "~11.4.0",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"react-native-gesture-handler": "^2.12.1",
|
|
105
105
|
"react-native-iphone-x-helper": "^1.3.1",
|
|
106
106
|
"react-native-mime-types": "^2.4.0",
|
|
107
|
-
"react-native-paper": "^5.10.
|
|
108
|
-
"react-native-paper-dates": "^0.18.
|
|
107
|
+
"react-native-paper": "^5.10.4",
|
|
108
|
+
"react-native-paper-dates": "^0.18.24",
|
|
109
109
|
"react-native-reanimated": "~3.3.0",
|
|
110
110
|
"react-native-safe-area-context": "4.6.3",
|
|
111
111
|
"react-native-screens": "~3.22.0",
|
|
@@ -359,7 +359,7 @@ const DatagridFactory = (Factory)=>{
|
|
|
359
359
|
const descriptionColor = Colors.isValid(descriptionStyle.color) ? descriptionStyle.color : Colors.isValid(descOrContentProps.color)? descOrContentProps.color : Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
|
360
360
|
this.accordionDescriptionProps = {
|
|
361
361
|
ellipsizeMode: EllipsizeMode.tail,
|
|
362
|
-
numberOfLines :
|
|
362
|
+
numberOfLines : 3,
|
|
363
363
|
...descOrContentProps,
|
|
364
364
|
color : descriptionColor,
|
|
365
365
|
style : [styles.description,rStyles.lineHeight,descriptionStyle],
|
|
@@ -11,11 +11,12 @@ import { StyleSheet } from "react-native";
|
|
|
11
11
|
import Label from "$ecomponents/Label";
|
|
12
12
|
import { useWindowDimensions } from "react-native";
|
|
13
13
|
import {useDatagrid,useGetSelectedRowsCount} from "../hooks";
|
|
14
|
-
export default function DatagridActions ({actions,actionProps,...props}){
|
|
14
|
+
export default function DatagridActions ({actions,title,actionProps,...props}){
|
|
15
15
|
const {context} = useDatagrid();
|
|
16
|
+
const forceRender = React.useForceRender();
|
|
16
17
|
const selectedRowsCount = useGetSelectedRowsCount();
|
|
17
18
|
useWindowDimensions();
|
|
18
|
-
const selected =
|
|
19
|
+
const selected = selectedRowsCount>0;
|
|
19
20
|
actions = selected ? context?.renderSelectedRowsActions.call(context,{}) : actions;
|
|
20
21
|
if(selected){
|
|
21
22
|
actionProps = Object.assign({},actionProps);
|
|
@@ -36,9 +37,11 @@ export default function DatagridActions ({actions,actionProps,...props}){
|
|
|
36
37
|
}
|
|
37
38
|
const splitedActions = isObjOrArray(actions)? splitActions({...props,...sArg,actionProps,actions,isAppBarAction:false,alwaysSplitOnMobile:true}) : undefined;
|
|
38
39
|
let contextualTitle = "";
|
|
39
|
-
if(
|
|
40
|
+
if(selected){
|
|
40
41
|
let sLetter = (selectedRowsCount>1?'s':'');
|
|
41
42
|
contextualTitle = (selectedRowsCount<10?'0':'')+selectedRowsCount+(' ligne'+sLetter+' sélectionnée'+sLetter),1;
|
|
43
|
+
} else if(React.isValidElement(title,true)){
|
|
44
|
+
contextualTitle = title;
|
|
42
45
|
}
|
|
43
46
|
const children = renderSplitedActions(splitedActions,{
|
|
44
47
|
anchor : (props)=>{
|
|
@@ -1011,7 +1011,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1011
1011
|
return null;
|
|
1012
1012
|
}
|
|
1013
1013
|
renderDataSourceSelector(){
|
|
1014
|
-
const t = isNonNullString(this.props.title)? <Label testID={"RN_DatagridTitleProp"}>{this.props.title}</Label> : React.isValidElement(this.props.title)? this.props.title : null;
|
|
1014
|
+
const t = !this.props.handleTitle ? null : isNonNullString(this.props.title) || typeof this.props.title ==='number' ? <Label textBold primary style={[theme.styles.fs14]} testID={"RN_DatagridTitleProp"}>{this.props.title}</Label> : React.isValidElement(this.props.title)? this.props.title : null;
|
|
1015
1015
|
const table = defaultStr(this.props.table,this.props.tableName);
|
|
1016
1016
|
const dS = dS === false ? null : typeof this.props.dataSourceSelector ==='function'? this.props.dataSourceSelector({
|
|
1017
1017
|
defaultValue : this.currentDataSources,
|
|
@@ -3273,10 +3273,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
3273
3273
|
arg.data = d.data;
|
|
3274
3274
|
arg.total = defaultNumber(arg.total,arg.data.total);
|
|
3275
3275
|
}
|
|
3276
|
-
|
|
3277
|
-
arg.total = Object.size(arg.data);
|
|
3278
|
-
}*/
|
|
3279
|
-
const {cb,total,data} = arg;
|
|
3276
|
+
const {cb,data} = arg;
|
|
3280
3277
|
return new Promise((resolve)=>{
|
|
3281
3278
|
this.prepareData(arg,(state)=>{
|
|
3282
3279
|
state.data = Array.isArray(state.data)? state.data : [];
|
|
@@ -4090,6 +4087,7 @@ CommonDatagridComponent.propTypes = {
|
|
|
4090
4087
|
canFetchOnlyVisibleColumns : PropTypes.bool,//si l'on peut modifier le type d'affichage lié à la possibilité de récupérer uniquement les données reletives aux colonnes visibles
|
|
4091
4088
|
useLinesProgressBar : PropTypes.bool,//si le progress bar lignes horizontale seront utilisés
|
|
4092
4089
|
abreviateValues : PropTypes.bool, //si les valeurs numériques seront abregées
|
|
4090
|
+
handleTitle : PropTypes.bool,//si le titre du datagrid, props title, sera pris en compte dans les actions du datagrid, pour le rendu du DataSourceSelector, fonction renderDataSourceSelector
|
|
4093
4091
|
checkPerms : PropTypes.func,//la fonction utilisée pour vérifier les permissions de l'utilisateur
|
|
4094
4092
|
}
|
|
4095
4093
|
|
|
@@ -76,7 +76,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
76
76
|
table,
|
|
77
77
|
data:customData,
|
|
78
78
|
saveButton,
|
|
79
|
-
title,
|
|
79
|
+
title:customTitle,
|
|
80
80
|
fab,
|
|
81
81
|
rowKey,
|
|
82
82
|
actions,
|
|
@@ -125,7 +125,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
125
125
|
const isExportable = !!Auth.isTableDataAllowed({table:tableName,action:'export'});
|
|
126
126
|
rest.exportable = isExportable;
|
|
127
127
|
rowKey = defaultStr(rowKey,table.rowKey,table.primaryKeyColumnName);
|
|
128
|
-
title = defaultStr(
|
|
128
|
+
const title = React.isValidElement(customTitle,true) && customTitle || defaultStr(table.label,table.text)
|
|
129
129
|
columns = table.fields;
|
|
130
130
|
const fetchFields = [];
|
|
131
131
|
Object.map(columns,(column,i)=>{
|
|
@@ -149,7 +149,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
149
149
|
rest.exportTableProps.pdf = defaultObj(rest.exportTableProps.pdf);
|
|
150
150
|
rest.exportTableProps.pdf = extendObj(true,{},{
|
|
151
151
|
fileName : rest.exportTableProps.fileName,
|
|
152
|
-
title
|
|
152
|
+
title : React.getTextContent(title),
|
|
153
153
|
},rest.exportTableProps.pdf);
|
|
154
154
|
const fetchOptionsRef = React.useRef(defaultObj(customFetchOptions));
|
|
155
155
|
const fPathRef = React.useRef(defaultStr(fetchPathKey,uniqid("fetchPath")));
|
|
@@ -297,6 +297,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
297
297
|
testID = {testID}
|
|
298
298
|
{...defaultObj(table.datagrid)}
|
|
299
299
|
{...rest}
|
|
300
|
+
title = {customTitle || title || undefined}
|
|
300
301
|
sort = {sort}
|
|
301
302
|
onSort = {({sort})=>{
|
|
302
303
|
sortRef.current = sort;
|
|
@@ -87,18 +87,18 @@ export const useBindEvent = (event,onEvent)=>{
|
|
|
87
87
|
return onEvent;
|
|
88
88
|
}
|
|
89
89
|
export const useIsRowSelected = (...args)=>{
|
|
90
|
-
return useOnEvent([events.ON_ROW_TOGGLE,events.ON_ALL_ROWS_TOGGLE],(context)=>{
|
|
90
|
+
return useOnEvent([events.ON_ROW_TOGGLE,'componentDidUpdate',events.ON_ALL_ROWS_TOGGLE],(context)=>{
|
|
91
91
|
return context.isRowSelected(...args);
|
|
92
92
|
});
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
export const useGetSelectedRowsCount = ()=>{
|
|
96
|
-
return useOnEvent([events.ON_ROW_TOGGLE,events.ON_ALL_ROWS_TOGGLE],(context)=>{
|
|
96
|
+
return useOnEvent([events.ON_ROW_TOGGLE,'componentDidUpdate',events.ON_ALL_ROWS_TOGGLE],(context,...rest)=>{
|
|
97
97
|
return context.getSelectedRowsCount();
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
export const useIsAllRowsSelected = ()=>{
|
|
101
|
-
return useOnEvent([events.ON_ROW_TOGGLE,events.ON_ALL_ROWS_TOGGLE],(context)=>{
|
|
101
|
+
return useOnEvent([events.ON_ROW_TOGGLE,'componentDidUpdate',events.ON_ALL_ROWS_TOGGLE],(context)=>{
|
|
102
102
|
return context.isAllRowsSelected();
|
|
103
103
|
});
|
|
104
104
|
};
|
|
@@ -281,6 +281,7 @@ export default class FormListComponent extends AppComponent {
|
|
|
281
281
|
upsertEltProps,
|
|
282
282
|
newElementLabel,
|
|
283
283
|
parentData,
|
|
284
|
+
routeParams,
|
|
284
285
|
...rest
|
|
285
286
|
} = this.props;
|
|
286
287
|
rest = defaultObj(rest);
|
|
@@ -301,6 +302,7 @@ export default class FormListComponent extends AppComponent {
|
|
|
301
302
|
formName,
|
|
302
303
|
//fields,
|
|
303
304
|
data,
|
|
305
|
+
...defaultObj(routeParams)
|
|
304
306
|
}
|
|
305
307
|
if(typeof upsertEltProps =='function'){
|
|
306
308
|
params = {...params,...defaultObj(upsertEltProps(params)),allData:this.state.allData,onSave : this.onSave.bind(this),show : this.show.bind(this),currentIndex : index,routeName,data:params.data,indexField}
|
|
@@ -542,7 +542,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
|
542
542
|
{label}
|
|
543
543
|
</Label> : null}
|
|
544
544
|
<>
|
|
545
|
-
<Surface testID={testID+"_TextFieldContentContainer"} {...contentContainerProps}
|
|
545
|
+
<Surface elevation={isShadowMode?5:0} testID={testID+"_TextFieldContentContainer"} {...contentContainerProps} style={[styles.contentContainer,{pointerEvents},!left? styles.paddingLeft:null,styles.row,contentContainerStyle,contentContainerProps.style]}>
|
|
546
546
|
{left ? (<View testID={testID+"_Left"} {...leftContainerProps} style={[styles.AdornmentContainer,styles.leftAdornment,leftContainerProps.style,disabledStyle]}>
|
|
547
547
|
{left}
|
|
548
548
|
</View>) : null}
|
|
@@ -24,6 +24,7 @@ import { generatedColumnsProperties,defaultArchivedPermsFilter } from "./utils";
|
|
|
24
24
|
import {isDocEditing,checkPrimaryKey} from "$ecomponents/Form";
|
|
25
25
|
import i18n from "$i18n";
|
|
26
26
|
import fetch from "$capi/fetch";
|
|
27
|
+
import appConfig from "$capp/config";
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
const HIDE_PRELOADER_TIMEOUT = 300;
|
|
@@ -36,9 +37,31 @@ const TIMEOUT = 50;
|
|
|
36
37
|
export default class TableDataScreenComponent extends FormDataScreen{
|
|
37
38
|
constructor(props){
|
|
38
39
|
super(props);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
extendObj(this.state,this.prepareStateData(this.props));
|
|
41
|
+
this.hidePreloader = this.hidePreloader.bind(this);
|
|
42
|
+
this.showPreloader = this.showPreloader.bind(this);
|
|
43
|
+
const table = this.getTableObj();
|
|
44
|
+
Object.defineProperties(this,{
|
|
45
|
+
tableName : { value : defaultStr(table.table,table.tableName)},
|
|
46
|
+
table : {value : table},
|
|
47
|
+
})
|
|
48
|
+
this.init();
|
|
49
|
+
};
|
|
50
|
+
/**** retourne l'objet table, associé à la tableName */
|
|
51
|
+
getTableObj(){
|
|
52
|
+
const table = defaultObj(this.props.table);
|
|
53
|
+
if(Object.size(table,true)) return table;
|
|
54
|
+
if(typeof appConfig.getTable ==='function'){
|
|
55
|
+
return appConfig.getTable(defaultStr(this.props.tableName,this.props.table));
|
|
56
|
+
}
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
getNewElementLabel(...args){
|
|
60
|
+
const tableObj = this.getTableObj();
|
|
61
|
+
return tableObj?.newElementLabel ? tableObj?.newElementLabel : super.getNewElementLabel(...args);
|
|
62
|
+
}
|
|
63
|
+
init(){
|
|
64
|
+
const table = this.getTableObj();
|
|
42
65
|
const fields = {},primaryKeyFields = {};
|
|
43
66
|
Object.map(table.fields,(field,i)=>{
|
|
44
67
|
if(isObj(field) && field.form !== false){
|
|
@@ -49,33 +72,34 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
49
72
|
if((f.type =='id' || f.type =='piece' || f.primaryKey || f.unique === true) && f.unique !== false && f.disabled !== true && f.readOnly !== true){
|
|
50
73
|
const {onBlur} = f;
|
|
51
74
|
f.onBlur = (args)=>{
|
|
75
|
+
if(isNonNullString(args.value)){
|
|
76
|
+
args.value = args.value.trim();
|
|
77
|
+
}
|
|
52
78
|
args = {...f,...args,fetch,columnField:name,fieldName:name,id:args.value};
|
|
53
79
|
const {context} = args;
|
|
54
80
|
const r = typeof onBlur =='function'? onBlur (args) : undefined;
|
|
55
81
|
if(r === false || (!args.value && typeof args.value != 'number')) return r;
|
|
56
82
|
//on applique la validation seulement en cas de non mise à jour
|
|
57
83
|
if(!this.isCurrentDocEditingUpdate() && context && typeof context.onNoValidate =='function'){
|
|
58
|
-
const cb = typeof field.fetchUniqueId =='function'? field.fetchUniqueId :
|
|
84
|
+
const cb = typeof field.fetchUniqueId =='function'? field.fetchUniqueId : this.fetchUniqueId.bind(this);
|
|
59
85
|
if(cb){
|
|
60
86
|
const r2 = cb(args);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
}
|
|
87
|
+
(isPromise(r2)? r2 : Promise.resolve(r2)).then((data)=>{
|
|
88
|
+
let message = data;
|
|
89
|
+
if(isObj(data) && Object.size(data,true)){
|
|
90
|
+
message = i18n.lang('validate_rule_field_must_be_unique')+ defaultStr(f.label,f.text);
|
|
91
|
+
}
|
|
92
|
+
if(isNonNullString(message)){
|
|
93
|
+
context.onNoValidate({...args,msg:message,message,context,validRule:context.getValidRule()});
|
|
94
|
+
}
|
|
95
|
+
}).catch((e)=>{
|
|
96
|
+
if(e && e.status?.toString() == '404') return;
|
|
97
|
+
console.log(e," fetching unique id on table data element id : ",args)
|
|
98
|
+
const message = defaultStr(e?.message,e?.msg);
|
|
99
|
+
if(message){
|
|
100
|
+
context.onNoValidate({...args,msg:message,message,error:e,context,validRule:context.getValidRule()});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
79
103
|
}
|
|
80
104
|
}
|
|
81
105
|
return r;
|
|
@@ -89,19 +113,15 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
89
113
|
}
|
|
90
114
|
});
|
|
91
115
|
Object.defineProperties(this,{
|
|
92
|
-
tableName : { value : defaultStr(table.table,table.tableName)},
|
|
93
116
|
fields : {value : fields},
|
|
94
|
-
|
|
95
|
-
archivedPermsFilterFunc : {value : typeof mainProps.archivedPermsFilter =='function'? mainProps.archivedPermsFilter:defaultArchivedPermsFilter},
|
|
117
|
+
archivedPermsFilterFunc : {value : typeof this.props.archivedPermsFilter =='function'? this.props.archivedPermsFilter:defaultArchivedPermsFilter},
|
|
96
118
|
isDocEditingRef : {value : {current:false}},
|
|
97
|
-
closeOnSaveProp : {value :
|
|
119
|
+
closeOnSaveProp : {value : this.props.closeOnSave || this.props.closeAfterSave },
|
|
98
120
|
//la liste des champ de type clé primaire associés à la table
|
|
99
121
|
primaryKeyFields : {value : primaryKeyFields},
|
|
100
|
-
showPreloaderOnUpsert : {value :
|
|
122
|
+
showPreloaderOnUpsert : {value : this.props.showPreloaderOnUpsert},
|
|
101
123
|
});
|
|
102
|
-
|
|
103
|
-
this.showPreloader = this.showPreloader.bind(this);
|
|
104
|
-
};
|
|
124
|
+
}
|
|
105
125
|
prepareStateData(props){
|
|
106
126
|
const mainProps = defaultObj(props,this.props);
|
|
107
127
|
const hasManyData = isObjOrArray(mainProps.datas) && Object.size(mainProps.datas,true) > 0 ? true : false;
|
|
@@ -116,6 +136,13 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
116
136
|
data : hasManyData ? defaultObj(cDatas[0]) : isObj(mainProps.data)? mainProps.data : {}
|
|
117
137
|
};
|
|
118
138
|
}
|
|
139
|
+
fetchUniqueId(...args){
|
|
140
|
+
const fetch = typeof this.props.fetchUniqueId =='function'? this.props.fetchUniqueId : undefined;
|
|
141
|
+
if(fetch){
|
|
142
|
+
return fetch(...args);
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
119
146
|
isCurrentDocEditingUpdate(){
|
|
120
147
|
return this.isDocEditingRef.current === true ? true : false;
|
|
121
148
|
}
|
|
@@ -178,6 +205,12 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
178
205
|
getSessionName (){
|
|
179
206
|
return defaultStr(this.props.sessionName,"table-form-data"+this.getTableName())
|
|
180
207
|
}
|
|
208
|
+
prepareField(a,...args){
|
|
209
|
+
if(typeof this.props.prepareField =='function'){
|
|
210
|
+
return this.props.prepareField(a,...args);
|
|
211
|
+
}
|
|
212
|
+
return a;
|
|
213
|
+
}
|
|
181
214
|
getComponentProps(props){
|
|
182
215
|
const table = this.table;
|
|
183
216
|
const {datas,currentIndex,data} = this.state;
|
|
@@ -219,7 +252,6 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
219
252
|
...rest
|
|
220
253
|
} = this.prepareComponentProps({...props,tableName,context:this,fields:extendObj({},true,this.fields,props.fields),isUpdated,isUpdate:isUpdated,data,datas,currentIndex});
|
|
221
254
|
const sessionName = this.getSessionName();
|
|
222
|
-
const prepareCb = typeof prepareField =='function'? prepareField : x=> x;
|
|
223
255
|
///on effectue une mutator sur le champ en cours de modification
|
|
224
256
|
Object.map(preparedFields,(field,i,counterIndex)=>{
|
|
225
257
|
const currentField = isObj(field)?Object.clone(field):field;
|
|
@@ -259,7 +291,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
259
291
|
this.primaryKeyFields[columnField] = true;
|
|
260
292
|
}
|
|
261
293
|
const isPrimary = this.primaryKeyFields[columnField] && true || false;
|
|
262
|
-
const f =
|
|
294
|
+
const f = this.prepareField(cArgs);
|
|
263
295
|
if(f === false) {
|
|
264
296
|
delete fields[i];
|
|
265
297
|
return;
|
|
@@ -343,7 +375,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
343
375
|
handleCustomRender(){
|
|
344
376
|
return true;
|
|
345
377
|
}
|
|
346
|
-
componentWillRender(rActionsArg){
|
|
378
|
+
componentWillRender({...rActionsArg}){
|
|
347
379
|
rActionsArg.context = this;
|
|
348
380
|
const rActions = renderActions.call(this,rActionsArg);
|
|
349
381
|
const renderedActs = this.renderActions(rActionsArg);
|
|
@@ -354,7 +386,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
354
386
|
rActions[iPrefix+i] = a;
|
|
355
387
|
});
|
|
356
388
|
}
|
|
357
|
-
rActionsArg.actions = rActions;
|
|
389
|
+
rActionsArg.actions = this.buttonsActions = rActions;
|
|
358
390
|
return rActionsArg;
|
|
359
391
|
}
|
|
360
392
|
_render ({header,content,context}){
|
|
@@ -589,7 +621,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
589
621
|
return Object.assign({},this.getCurrentData());
|
|
590
622
|
}
|
|
591
623
|
getAppBarActionsProps(props){
|
|
592
|
-
return {...super.getAppBarActionsProps(props),data:this.getCurrentData()}
|
|
624
|
+
return {...super.getAppBarActionsProps(props),actions:this.buttonsActions,data:this.getCurrentData()}
|
|
593
625
|
}
|
|
594
626
|
/**** cette fonction est appelée immédiatement lorsque l'on clique sur le bouton enregistrer de l'un des actions du formulaire */
|
|
595
627
|
onPressToSaveFormData(args){
|
|
@@ -756,6 +788,13 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
756
788
|
getTableName(){
|
|
757
789
|
return this.tableName;
|
|
758
790
|
}
|
|
791
|
+
getTableText(){
|
|
792
|
+
const tableObj = this.getTableObj();
|
|
793
|
+
return defaultStr(tableObj?.text,tableObj?.label);
|
|
794
|
+
}
|
|
795
|
+
getTableLabel(){
|
|
796
|
+
return this.getTableText();
|
|
797
|
+
}
|
|
759
798
|
getMakePhoneCallProps (){
|
|
760
799
|
const table = this.table;
|
|
761
800
|
const makePhoneCallProps = defaultVal(this.props.makePhoneCallProps,table.makePhoneCallProps);
|
|
@@ -818,11 +857,6 @@ TableDataScreenComponent.propTypes = {
|
|
|
818
857
|
...defaultObj(FormData.propTypes),
|
|
819
858
|
prepareComponentProps : PropTypes.func, //permet d'appreter les components props à utiliser pour le rendu des données
|
|
820
859
|
prepareField : PropTypes.func,//La fonction permettant de faire des mutations sur le champ field à passer au formulaire form. si elle retourne false alors la field ne sera pas pris een compte
|
|
821
|
-
table : PropTypes.shape({
|
|
822
|
-
tableName : PropTypes.string,
|
|
823
|
-
table : PropTypes.string,
|
|
824
|
-
fields : PropTypes.object,
|
|
825
|
-
}),
|
|
826
860
|
unique : PropTypes.bool,//si la validation de type unique sur le champ sera effective
|
|
827
861
|
fetchUniqueId : PropTypes.func,//la fonction permettant de fetch un élément unique pour la validation de type uniqueID, liée aux champs de type piece et id
|
|
828
862
|
validateData : PropTypes.func,// la fonction permettant de valider les données à enregistrer
|
|
@@ -134,7 +134,7 @@ export function renderActions({context,isUpdate,newElementLabel,readablePerms:c
|
|
|
134
134
|
flat : true,
|
|
135
135
|
onPress : createCallback({context:self,action:'save2new',callback:onPressToSave})
|
|
136
136
|
} : null;
|
|
137
|
-
|
|
137
|
+
return {
|
|
138
138
|
print : (isUpdate && permsObj.canPrint)?{
|
|
139
139
|
text : 'Imprimer',
|
|
140
140
|
shortcut : 'print',
|
|
@@ -217,7 +217,6 @@ export function renderActions({context,isUpdate,newElementLabel,readablePerms:c
|
|
|
217
217
|
onPress: createCallback({context:self,action:'copyToClipboard',callback:onPressCopyToClipboard})
|
|
218
218
|
} : null,
|
|
219
219
|
}
|
|
220
|
-
return self.buttonsActions;
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.31.
|
|
1
|
+
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.31.2","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.30.19","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.7","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.13","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.42.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.9","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.2","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sqlite":{"version":"11.3.2","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.4","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.10.3","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.18.22","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.7","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.5.0","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"4.1.1","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"uninstall":{"version":"0.0.0","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};
|