@fto-consult/expo-ui 2.30.0 → 2.31.0
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": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@emotion/native": "^11.10.0",
|
|
62
62
|
"@expo/html-elements": "^0.2.0",
|
|
63
63
|
"@expo/vector-icons": "^13.0.0",
|
|
64
|
-
"@fto-consult/common": "^1.25.
|
|
64
|
+
"@fto-consult/common": "^1.25.17",
|
|
65
65
|
"@gorhom/portal": "^1.0.14",
|
|
66
66
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
67
67
|
"@react-native-community/datetimepicker": "6.5.2",
|
|
@@ -273,10 +273,10 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
273
273
|
if(isPlainObject(f)){
|
|
274
274
|
this.filters[v] = {...f};
|
|
275
275
|
this.filters[v].field = defaultStr(f.field,v);
|
|
276
|
-
this.filters[v].
|
|
276
|
+
this.filters[v].defaultValue = defaultVal(f.defaultValue,f.value)
|
|
277
277
|
} else {
|
|
278
278
|
this.filters[v] = {
|
|
279
|
-
|
|
279
|
+
defaultValue : f,
|
|
280
280
|
field : v
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -355,6 +355,8 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
355
355
|
(Array.isArray(props.sectionListColumns) ? props.sectionListColumns : defaultArray(this.getSessionData("sectionListColumns"))).map((col)=>{
|
|
356
356
|
if(isNonNullString(col)){
|
|
357
357
|
l[col.trim()] = {};
|
|
358
|
+
} else if(isObj(col) && isNonNullString(col.field)){
|
|
359
|
+
l[col.field] = col;
|
|
358
360
|
}
|
|
359
361
|
})
|
|
360
362
|
return l;
|
|
@@ -2044,7 +2046,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
2044
2046
|
andOperator : filterAndOperator,
|
|
2045
2047
|
searchIconTooltip : 'Filtre',
|
|
2046
2048
|
searchIcon : 'filter_list',
|
|
2047
|
-
defaultValue : fCol.
|
|
2049
|
+
defaultValue : defaultVal(fCol.defaultValue,restCol.defaultValue),
|
|
2048
2050
|
name : header.field,
|
|
2049
2051
|
onClearFilter : this.onClearFilter.bind(this),
|
|
2050
2052
|
onChange : this.onFilterChange.bind(this),
|
|
@@ -2457,7 +2459,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
2457
2459
|
if(!isObj(f)) return;
|
|
2458
2460
|
defValue = undefined;
|
|
2459
2461
|
if(f.type =="select") defValue = [];
|
|
2460
|
-
filters[i] = {...f,value:defValue,defaultValue:defValue
|
|
2462
|
+
filters[i] = {...f,value:defValue,defaultValue:defValue}
|
|
2461
2463
|
})
|
|
2462
2464
|
this.filters = filters;
|
|
2463
2465
|
this.refresh(true);
|
|
@@ -2483,7 +2485,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
2483
2485
|
field = defaultStr(field,name);
|
|
2484
2486
|
if(field){
|
|
2485
2487
|
let v = defaultStr(type).toLowerCase() == "select"? []:undefined
|
|
2486
|
-
this.filters[field] = {value:v,defaultValue:v
|
|
2488
|
+
this.filters[field] = {value:v,defaultValue:v}
|
|
2487
2489
|
this.doFilter({value:v,field,force:true})
|
|
2488
2490
|
}
|
|
2489
2491
|
}
|
|
@@ -2500,7 +2502,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
2500
2502
|
this.filteredValues[field] = {
|
|
2501
2503
|
operator,action,value,field
|
|
2502
2504
|
}
|
|
2503
|
-
filter.
|
|
2505
|
+
filter.defaultValue = arg.defaultValue;
|
|
2504
2506
|
filter.operator = operator;
|
|
2505
2507
|
filter.action = defaultStr(originAction,action);
|
|
2506
2508
|
}
|
|
@@ -3317,6 +3319,11 @@ CommonDatagridComponent.propTypes = {
|
|
|
3317
3319
|
PropTypes.arrayOf(PropTypes.object),
|
|
3318
3320
|
PropTypes.objectOf(PropTypes.object),
|
|
3319
3321
|
]),
|
|
3322
|
+
/****les colonnes via lesquelles le tableau est groupé par defaut */
|
|
3323
|
+
sectionListColumns : PropTypes.oneOfType([
|
|
3324
|
+
PropTypes.arrayOf(PropTypes.object),
|
|
3325
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
3326
|
+
]),
|
|
3320
3327
|
sectionListHeaderEmptyValue : PropTypes.string, //la valeur vide par défaut à afficher dans les entêtes du table
|
|
3321
3328
|
ignoreCaseOnSectionListHeader : PropTypes.bool,//si l'on ignorera la casse dans le sectionlISThEADER
|
|
3322
3329
|
sectoonListHeaderUpperCase : PropTypes.bool, //si le sectionListHeader sera en majuscule
|
|
@@ -96,7 +96,6 @@ export default class CommonTableDatagrid extends CommonDatagrid{
|
|
|
96
96
|
fetchOptions.selector = defaultObj(fetchOptions.selector);
|
|
97
97
|
fetchOptions.dataSources = this.currentDataSources;
|
|
98
98
|
fetchOptions = extendObj(true,true,{},fetchOptions,{selector : fetchFilters});
|
|
99
|
-
console.log(fetchOptions," is fetchOptions ",this.getFiltersProps(),fetchFilters)
|
|
100
99
|
fetchOptions.dataSources = this.currentDataSources;
|
|
101
100
|
fetchOptions.sort = this.getSort();
|
|
102
101
|
let limit = this.getQueryLimit();
|
|
@@ -10,7 +10,6 @@ import {defaultObj,isNumber,defaultNumber,defaultStr,defaultBool,isNonNullString
|
|
|
10
10
|
import theme,{flattenStyle} from "$theme";
|
|
11
11
|
import DateLib from "$date";
|
|
12
12
|
import { toDateObj } from "./utils";
|
|
13
|
-
import TextField from "$components/TextField";
|
|
14
13
|
import PeriodActionComponent from "./PeriodAction";
|
|
15
14
|
|
|
16
15
|
export default function DateTimePickerComponent({left,isPeriodAction,contentProps,withSeconds,right,format,dateFormat,timeFormat,defaultValue,onChange,testID,dateProps,disabled,readOnly,timeProps,...rest}){
|
|
@@ -8,7 +8,7 @@ import DateLib from "$date";
|
|
|
8
8
|
|
|
9
9
|
const PeriodActionComponent = React.forwardRef(({defaultValue,label,isDateTime,...props},ref)=>{
|
|
10
10
|
if(isNonNullString(label)){
|
|
11
|
-
label+=" [
|
|
11
|
+
label+=" [Période]";
|
|
12
12
|
}
|
|
13
13
|
const datePeriod= DateLib.formatPeriod(defaultValue,isDateTime);
|
|
14
14
|
if(datePeriod){
|
|
@@ -178,7 +178,6 @@ export default class Filter extends AppComponent {
|
|
|
178
178
|
if(!isObjOrArray(value) && (isNullOrEmpty(value,true) || value ==='undefined') ){
|
|
179
179
|
value = undefined;
|
|
180
180
|
}
|
|
181
|
-
let originValue = value;
|
|
182
181
|
if(action =="$today" || action =='$yesterday'){
|
|
183
182
|
force = true;
|
|
184
183
|
}
|
|
@@ -230,7 +229,7 @@ export default class Filter extends AppComponent {
|
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
231
|
}
|
|
233
|
-
this.props.onChange({...this.getStateValues(),value,
|
|
232
|
+
this.props.onChange({...this.getStateValues(),value,field:this.props.field,action,operator,selector,originAction,context:this});
|
|
234
233
|
}
|
|
235
234
|
}
|
|
236
235
|
componentDidUpdate (){
|