@fto-consult/expo-ui 7.2.0 → 7.2.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 +2 -2
- package/src/components/Datagrid/Accordion/Row.js +3 -0
- package/src/components/Datagrid/Common/Common.js +1 -21
- package/src/components/Filter/index.js +7 -4
- package/src/components/Form/FormData/FormDataActions.js +3 -3
- package/src/layouts/Screen/TableData.js +6 -3
- package/src/pdf/index.js +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "7.2.
|
3
|
+
"version": "7.2.1",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"main": "main",
|
6
6
|
"scripts": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"@expo/html-elements": "^0.5.1",
|
72
72
|
"@expo/vector-icons": "^13.0.0",
|
73
73
|
"@faker-js/faker": "^8.0.2",
|
74
|
-
"@fto-consult/common": "^3.72.
|
74
|
+
"@fto-consult/common": "^3.72.15",
|
75
75
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
76
76
|
"@react-native-async-storage/async-storage": "1.18.2",
|
77
77
|
"@react-native-community/datetimepicker": "7.2.0",
|
@@ -826,7 +826,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
826
826
|
* ou pas.
|
827
827
|
*/
|
828
828
|
renderSelectedRowsActions(sActions){
|
829
|
-
let {
|
829
|
+
let {makePhoneCallProps,canMakePhoneCall,archivable} = this.props;
|
830
830
|
const size = this.getSelectedRowsCount();
|
831
831
|
let r = [];
|
832
832
|
let endActs = [];
|
@@ -841,20 +841,6 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
841
841
|
if(isFunction(selectedR)) {
|
842
842
|
selectedR = selectedR.call(this,sArgs)
|
843
843
|
}
|
844
|
-
if(isFunction(print)){
|
845
|
-
if(isFunction(printable)){
|
846
|
-
printable = printable({context:this,tableName:defaultStr(this.props.tableName,this.props.table),props:this.props});
|
847
|
-
}
|
848
|
-
if(printable !== false){
|
849
|
-
r.push({
|
850
|
-
icon : defaultVal(this.props.printButtonIcon,'printer'),
|
851
|
-
text : defaultVal(this.props.printButtonText,this.props.printButtonLabel,'Imprimer'),
|
852
|
-
onPress : ()=>{
|
853
|
-
print({title:defaultStr(this.props.title),...defaultObj(printOptions),...sArgs});
|
854
|
-
},
|
855
|
-
})
|
856
|
-
}
|
857
|
-
}
|
858
844
|
Object.map(sActions,(o,i)=>{
|
859
845
|
if(isObj(o)){
|
860
846
|
let {onPress, ...rest} = o;
|
@@ -4010,12 +3996,6 @@ CommonDatagridComponent.propTypes = {
|
|
4010
3996
|
]),
|
4011
3997
|
/*** fonction permettant de retourner l'unique clé des éléments du tableau */
|
4012
3998
|
getRowKey : PropTypes.func,
|
4013
|
-
///la fonction utilisée pour l'impression du datagrid
|
4014
|
-
print : PropTypes.func,
|
4015
|
-
printButtonIcon : PropTypes.oneOfType([PropTypes.string,PropTypes.element]),
|
4016
|
-
printButtonLabel : PropTypes.oneOfType([PropTypes.string,PropTypes.element]),
|
4017
|
-
printButtonText : PropTypes.oneOfType([PropTypes.string,PropTypes.element]),
|
4018
|
-
printOptions: PropTypes.object,
|
4019
3999
|
/*** si le datagrid est imprimable */
|
4020
4000
|
printable : PropTypes.oneOfType([
|
4021
4001
|
PropTypes.func,
|
@@ -18,6 +18,7 @@ import { ActivityIndicator } from "react-native-paper";
|
|
18
18
|
import DialogProvider from "$ecomponents/Form/FormData/DialogProvider";
|
19
19
|
import FilterBetweenComponent from "./BetweenComponent";
|
20
20
|
|
21
|
+
export const dateTypes = ["date","time","datetime","date2time"]
|
21
22
|
|
22
23
|
const manualRunKey = "manual-run";
|
23
24
|
|
@@ -137,7 +138,9 @@ export default class Filter extends AppComponent {
|
|
137
138
|
type = defaultStr(type,this.type,this.props.type).toLowerCase();
|
138
139
|
if(type.contains('select')){
|
139
140
|
return "$in";
|
140
|
-
}
|
141
|
+
}
|
142
|
+
if(dateTypes.includes(type)) return "$eq";
|
143
|
+
if(type !== 'number' && type !== 'decimal'){
|
141
144
|
return '$regexcontains';
|
142
145
|
}
|
143
146
|
return '$eq';
|
@@ -161,16 +164,16 @@ export default class Filter extends AppComponent {
|
|
161
164
|
action = '$eq';
|
162
165
|
} else if(type.contains('select')){
|
163
166
|
actions = _inActions;
|
164
|
-
} else if(type
|
167
|
+
} else if(dateTypes.includes(type)) {
|
165
168
|
actions = {...periodActions, ...actions}
|
166
169
|
delete actions.$between;
|
167
|
-
} else if(type !== '
|
170
|
+
} else if(type !== 'number' && type !== 'decimal'){
|
168
171
|
actions = {...betweenActions,...regexActions};
|
169
172
|
isTextFilter = true;
|
170
173
|
}
|
171
174
|
if(!action){
|
172
175
|
action = this.getDefaultAction(type);
|
173
|
-
}
|
176
|
+
}
|
174
177
|
let defaultValue = defaultVal(this.props.defaultValue);
|
175
178
|
operator = defaultVal(operator,"$and");
|
176
179
|
if(actions == _inActions || type.contains("select")){
|
@@ -103,7 +103,7 @@ export default class FormDataActionComponent extends FormData {
|
|
103
103
|
}
|
104
104
|
getAppBarActionsProps(props){
|
105
105
|
props = defaultObj(props,this.props);
|
106
|
-
let {actions,save2NewAction,save2printAction,save2closeAction,saveAction,newAction} = props;
|
106
|
+
let {actions,save2NewAction,save2printAction,isPrintingForm,save2closeAction,saveAction,newAction} = props;
|
107
107
|
const sArg = {context:this};
|
108
108
|
save2NewAction = typeof save2NewAction =='function' ? save2NewAction (sArg) : save2NewAction;
|
109
109
|
save2closeAction = typeof save2closeAction ==='function'? save2closeAction(sArg) : save2closeAction;
|
@@ -113,7 +113,7 @@ export default class FormDataActionComponent extends FormData {
|
|
113
113
|
const appBarProps = this.getAppBarProps();
|
114
114
|
const data = this.getDataProp();
|
115
115
|
const isEditing = this.isDocEditing(data);
|
116
|
-
let textSave = isEditing ? "Modifier": 'Enregistrer';
|
116
|
+
let textSave = isPrintingForm ? "Imprimer" : isEditing ? "Modifier": 'Enregistrer';
|
117
117
|
const newElementLabel = defaultStr(props.newElementLabel,this.props.newElementLabel,"Nouvel Element");
|
118
118
|
if(isEditing){
|
119
119
|
const t = this.getPrimaryKeysFieldsValueText(data);
|
@@ -142,7 +142,7 @@ export default class FormDataActionComponent extends FormData {
|
|
142
142
|
save : saveAction !== false ? {
|
143
143
|
isAction : true,
|
144
144
|
text : textSave,
|
145
|
-
icon : 'check',
|
145
|
+
icon : isPrintingForm ? 'printer':'check',
|
146
146
|
title : textSave,
|
147
147
|
onPress : (a)=>{
|
148
148
|
context.clickedAction = 'save';
|
@@ -350,7 +350,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
350
350
|
saveButton : isUpdated?'Modifier':'Enregistrer',
|
351
351
|
currentData:data,
|
352
352
|
hasManyData : this.hasManyData(),
|
353
|
-
|
353
|
+
onPressToPrint : this.print.bind(this),
|
354
354
|
datas,
|
355
355
|
currentDataIndex:currentIndex,
|
356
356
|
onPressToPrevious:this.goToPreviousData.bind(this),
|
@@ -581,9 +581,12 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
581
581
|
return super.isDocEditing(data);
|
582
582
|
}
|
583
583
|
print(data){
|
584
|
-
if(!this.isPrintable()
|
584
|
+
if(!this.isPrintable()) return;
|
585
585
|
data = this.isDocEditing(data)? data : isObj(data) && this.isDocEditing(data.data)? data.data : {};
|
586
|
-
|
586
|
+
if(typeof this.props.print ==='function'){
|
587
|
+
return this.props.print.call(this,data);
|
588
|
+
}
|
589
|
+
return data;
|
587
590
|
}
|
588
591
|
isClonable(){
|
589
592
|
return !!(this.props.clonable !==false);
|
package/src/pdf/index.js
CHANGED
@@ -128,6 +128,7 @@ export const getPrintSettings = ({multiple,sessionName,formDataProps,...rest})=>
|
|
128
128
|
return DialogProvider.open({
|
129
129
|
title : "Options d'impression",
|
130
130
|
...formDataProps,
|
131
|
+
isPrintingForm : true,
|
131
132
|
data : config,
|
132
133
|
fields,
|
133
134
|
onSuccess : (opts)=>{
|