@fto-consult/expo-ui 6.73.15 → 6.74.1
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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.74.1",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"main": "main",
|
6
6
|
"scripts": {
|
@@ -82,7 +82,7 @@
|
|
82
82
|
"@react-navigation/stack": "^6.3.20",
|
83
83
|
"@shopify/flash-list": "1.4.3",
|
84
84
|
"apexcharts": "^3.44.0",
|
85
|
-
"expo": "^49.0.
|
85
|
+
"expo": "^49.0.17",
|
86
86
|
"expo-camera": "~13.4.4",
|
87
87
|
"expo-clipboard": "~4.3.1",
|
88
88
|
"expo-font": "~11.4.0",
|
@@ -99,7 +99,7 @@
|
|
99
99
|
"htmlparser2-without-node-native": "^3.9.2",
|
100
100
|
"is-plain-obj": "^4.1.0",
|
101
101
|
"js-base64": "^3.7.5",
|
102
|
-
"pdfmake": "^0.2.
|
102
|
+
"pdfmake": "^0.2.8",
|
103
103
|
"process": "^0.11.10",
|
104
104
|
"prop-types": "^15.8.1",
|
105
105
|
"react": "^18.2.0",
|
@@ -101,15 +101,16 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
101
101
|
defaultSortColumn,
|
102
102
|
defaultSortOrder,
|
103
103
|
isLoading : customIsLoading,
|
104
|
+
icon : cIcon,
|
104
105
|
...rest
|
105
106
|
} = props;
|
106
107
|
const {swrConfig} = useContext();
|
107
108
|
rest = defaultObj(rest);
|
108
109
|
rest.exportTableProps = defaultObj(rest.exportTableProps)
|
109
110
|
const firstPage = 1;
|
110
|
-
const tableName = defaultStr(table
|
111
|
-
defaultSortColumn = defaultStr(defaultSortColumn,table
|
112
|
-
defaultSortOrder = defaultStr(defaultSortOrder,table
|
111
|
+
const tableName = defaultStr(table?.tableName,table?.table).trim().toUpperCase();
|
112
|
+
defaultSortColumn = defaultStr(defaultSortColumn,table?.defaultSortColumn);
|
113
|
+
defaultSortOrder = defaultStr(defaultSortOrder,table?.defaultSortOrder).toLowerCase().trim();
|
113
114
|
sort = isNonNullString(sort)? {column:sort} : isObj(sort)?sort : {};
|
114
115
|
const sColumn = defaultStr(sort.column,defaultSortColumn);
|
115
116
|
if(sColumn){
|
@@ -120,26 +121,28 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
120
121
|
} else {
|
121
122
|
delete sort.column;
|
122
123
|
}
|
123
|
-
canMakePhoneCall = defaultBool(canMakePhoneCall,table
|
124
|
-
makePhoneCallProps = isValidMakePhoneCallProps(makePhoneCallProps) && makePhoneCallProps || isValidMakePhoneCallProps(rest.makePhoneCallProps) && rest.makePhoneCallProps || isValidMakePhoneCallProps(table
|
125
|
-
rowKey = defaultStr(rowKey,table
|
126
|
-
const title = React.isValidElement(customTitle,true) && customTitle || defaultStr(table
|
127
|
-
columns = table
|
124
|
+
canMakePhoneCall = defaultBool(canMakePhoneCall,table?.canMakePhoneCall);
|
125
|
+
makePhoneCallProps = isValidMakePhoneCallProps(makePhoneCallProps) && makePhoneCallProps || isValidMakePhoneCallProps(rest.makePhoneCallProps) && rest.makePhoneCallProps || isValidMakePhoneCallProps(table?.makePhoneCallProps) && table?.makePhoneCallProps || {};
|
126
|
+
rowKey = defaultStr(rowKey,table?.rowKey,table?.primaryKeyColumnName);
|
127
|
+
const title = React.isValidElement(customTitle,true) && customTitle || defaultStr(table?.label,table?.text)
|
128
|
+
columns = (isObj(columns) || Array.isArray(columns)) && Object.size(columns,true) && columns || table?.fields;
|
128
129
|
const fetchFields = [];
|
129
130
|
Object.map(columns,(column,i)=>{
|
130
131
|
if(isObj(column)){
|
131
132
|
fetchFields.push(defaultStr(column.field,i));
|
132
133
|
}
|
133
|
-
})
|
134
|
-
actions = defaultVal(table
|
135
|
-
|
136
|
-
|
137
|
-
|
134
|
+
});
|
135
|
+
actions = defaultVal(table?.actions,actions);
|
136
|
+
if(isObj(table) && isObj(table?.datagrid)){
|
137
|
+
for(let i in Datagrid.propTypes){
|
138
|
+
if(i in table){
|
139
|
+
rest[i] = isObj(rest[i])? extendObj({},rest[i],table[i]) : table[i];
|
140
|
+
}
|
138
141
|
}
|
139
142
|
}
|
140
143
|
rest.actions = actions;
|
141
144
|
rest.columns = columns || [];
|
142
|
-
const icon = defaultStr(table
|
145
|
+
const icon = defaultStr(cIcon,table?.icon);
|
143
146
|
rest.tableName = tableName;
|
144
147
|
rest.canMakePhoneCall = canMakePhoneCall;
|
145
148
|
rest.makePhoneCallProps = makePhoneCallProps;
|
@@ -151,7 +154,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
151
154
|
},rest.exportTableProps.pdf);
|
152
155
|
const fetchOptionsRef = React.useRef(defaultObj(customFetchOptions));
|
153
156
|
const fPathRef = React.useRef(defaultStr(fetchPathKey,uniqid("fetchPath")));
|
154
|
-
fetchPath = defaultStr(fetchPath,table
|
157
|
+
fetchPath = defaultStr(fetchPath,table?.queryPath,tableName.toLowerCase()).trim();
|
155
158
|
if(fetchPath){
|
156
159
|
fetchPath = setQueryParams(fetchPath,"SWRFetchPathKey",fPathRef.current)
|
157
160
|
}
|
@@ -292,7 +295,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
292
295
|
return (
|
293
296
|
<Datagrid
|
294
297
|
testID = {testID}
|
295
|
-
{...defaultObj(table
|
298
|
+
{...defaultObj(table?.datagrid)}
|
296
299
|
{...rest}
|
297
300
|
title = {customTitle || title || undefined}
|
298
301
|
sort = {sort}
|
@@ -448,7 +451,7 @@ SWRDatagridComponent.propTypes = {
|
|
448
451
|
PropTypes.objectOf(PropTypes.object),
|
449
452
|
PropTypes.arrayOf(PropTypes.object),
|
450
453
|
])
|
451
|
-
})
|
454
|
+
}),
|
452
455
|
}
|
453
456
|
|
454
457
|
const styles = StyleSheet.create({
|