@fto-consult/expo-ui 2.14.0 → 2.14.2
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 +1 -1
- package/src/components/Countries/Flag.js +1 -0
- package/src/components/Countries/SelectCountry.js +1 -1
- package/src/components/Datagrid/Accordion/index.js +1 -0
- package/src/components/Datagrid/Common/Common.js +40 -25
- package/src/components/Datagrid/Common/TableData.js +1 -1
- package/src/components/Datagrid/RenderType.js +4 -4
- package/src/components/Datagrid/SWRDatagrid.js +18 -2
- package/src/components/Datagrid/Table/index.js +4 -2
- package/src/components/TableLink/index.js +13 -8
- package/src/layouts/Screen/TableData.js +1 -1
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ export const getCountryFieldProps = (props)=>{
|
|
|
27
27
|
},
|
|
28
28
|
renderItem : ({item})=>{
|
|
29
29
|
return <View style={[styles.renderedImage]}>
|
|
30
|
-
{(isNonNullString(item.image) || isNumber(item.image)) && <Image accessibilityIgnoresInvertColors {...imageProps} style={[styles.flagImage,{marginRight:10},imageProps.style]} source={isNumber(item.image)?item.image:{uri:item.image}}/>}
|
|
30
|
+
{(isNonNullString(item.image) || isNumber(item.image)) && <Image editable = {false} accessibilityIgnoresInvertColors {...imageProps} style={[styles.flagImage,{marginRight:10},imageProps.style]} source={isNumber(item.image)?item.image:{uri:item.image}}/>}
|
|
31
31
|
<Label>{item.label}</Label>
|
|
32
32
|
</View>
|
|
33
33
|
},
|
|
@@ -78,7 +78,6 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
78
78
|
sData.fixedTable = defaultBool(sData.fixedTable,false);
|
|
79
79
|
extendObj(this.state, {
|
|
80
80
|
data,
|
|
81
|
-
sort :defaultObj(props.sort),
|
|
82
81
|
showFilters : defaultBool(props.showFilters,(sData.showFilter? true : this.isPivotDatagrid())),
|
|
83
82
|
showFooters : defaultBool(props.showFooters,(sData.showFooters? true : false)),
|
|
84
83
|
fixedTable : sData.fixedTable
|
|
@@ -87,6 +86,9 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
87
86
|
layoutRef : {
|
|
88
87
|
value : React.createRef(null),
|
|
89
88
|
},
|
|
89
|
+
sortRef : {
|
|
90
|
+
value : {current : defaultObj(props.sort)}
|
|
91
|
+
},
|
|
90
92
|
preparedColumns : {
|
|
91
93
|
value : {},override:false, writable:false,
|
|
92
94
|
},
|
|
@@ -109,17 +111,15 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
109
111
|
})
|
|
110
112
|
this.isLoading = this.isLoading.bind(this);
|
|
111
113
|
this.getProgressBar = this.getProgressBar.bind(this);
|
|
112
|
-
this.
|
|
114
|
+
this.sortRef.current.dir = defaultStr(this.sortRef.current.dir,this.sortRef.current.column == "date"?"desc":'asc')
|
|
113
115
|
this.hasColumnsHalreadyInitialized = false;
|
|
114
116
|
this.initColumns(props.columns);
|
|
115
|
-
if(!isNonNullString(this.
|
|
116
|
-
this.
|
|
117
|
+
if(!isNonNullString(this.sortRef.current.column) && "date" in this.state.columns){
|
|
118
|
+
this.sortRef.current.column = "date";
|
|
117
119
|
}
|
|
118
120
|
this.INITIAL_STATE = {
|
|
119
121
|
data,
|
|
120
|
-
sort : this.state.sort
|
|
121
122
|
}
|
|
122
|
-
this._sort = this.state.sort;
|
|
123
123
|
this._datagridId = isNonNullString(this.props.id)? this.props.id : uniqid("datagrid-id")
|
|
124
124
|
this.canDoFilter = true;
|
|
125
125
|
this.filters = {}
|
|
@@ -309,7 +309,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
309
309
|
}
|
|
310
310
|
canPaginateData(){
|
|
311
311
|
if(this.props.handlePagination === false) return false;
|
|
312
|
-
return
|
|
312
|
+
return this.isDatagrid();
|
|
313
313
|
}
|
|
314
314
|
getFiltersProps(){
|
|
315
315
|
return this.props.filters;
|
|
@@ -689,11 +689,11 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
689
689
|
}
|
|
690
690
|
*/
|
|
691
691
|
sort (column,dir){
|
|
692
|
-
|
|
692
|
+
const sort = extendObj({},{
|
|
693
693
|
dir: '',
|
|
694
694
|
column : '',
|
|
695
695
|
ignoreCase : true
|
|
696
|
-
}, this.
|
|
696
|
+
}, this.sortRef.current);
|
|
697
697
|
if(isNonNullString(column)){
|
|
698
698
|
sort.column = column;
|
|
699
699
|
}
|
|
@@ -703,8 +703,8 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
703
703
|
if(isNonNullString(dir)){
|
|
704
704
|
sort.dir = dir;
|
|
705
705
|
}
|
|
706
|
-
if(this.
|
|
707
|
-
switch(this.
|
|
706
|
+
if(this.sortRef.current.column === sort.column){
|
|
707
|
+
switch(this.sortRef.current.dir){
|
|
708
708
|
case 'asc':
|
|
709
709
|
sort.dir = 'desc';
|
|
710
710
|
break;
|
|
@@ -720,9 +720,12 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
720
720
|
sort.dir = sort.dir.trim().toLowerCase();
|
|
721
721
|
}
|
|
722
722
|
if(sort.dir !== "asc" && sort.dir !== "desc") sort.dir = 'asc';
|
|
723
|
-
this._previousSortObj = this.
|
|
724
|
-
this.
|
|
725
|
-
this.prepareColumns({sortedColumn : this.
|
|
723
|
+
this._previousSortObj = Object.clone(this.sortRef.current);
|
|
724
|
+
this.sortRef.current = sort;
|
|
725
|
+
this.prepareColumns({sortedColumn : this.sortRef.current});
|
|
726
|
+
if(typeof this.props.onSort =='function' && this.props.onSort({...sort,context:this,sort,data:this.INITIAL_STATE.data,fields:this.state.columns,columns:this.state.columns}) === false){
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
726
729
|
this.prepareData({data:this.state.data,updateFooters:false},(state)=>{
|
|
727
730
|
this.setState(state);
|
|
728
731
|
});
|
|
@@ -948,7 +951,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
948
951
|
args = defaultObj(args);
|
|
949
952
|
const filteredColumns = isObjOrArray(args.filteredColumns)?args.filteredColumns : isObjOrArray(this.state.filteredColumns) ? this.state.filteredColumns : {};
|
|
950
953
|
const columns = args.columns || this.state.columns;
|
|
951
|
-
const currentSortedColumn = isObj(args.sortedColumn) && args.sortedColumn.column? args.sortedColumn : defaultObj(this.
|
|
954
|
+
const currentSortedColumn = isObj(args.sortedColumn) && args.sortedColumn.column? args.sortedColumn : defaultObj(this.sortRef.current);
|
|
952
955
|
const visibleColumns = [],headerFilters = [],visibleColumnsNames={};
|
|
953
956
|
const sortable = defaultBool(this.props.sortable,true);
|
|
954
957
|
const sortedColumns = {};
|
|
@@ -1107,7 +1110,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1107
1110
|
}
|
|
1108
1111
|
getPaginatedSelectedRows(data){
|
|
1109
1112
|
data = isArray(data)? data : this.INITIAL_STATE.data;
|
|
1110
|
-
if(JSON.stringify(this._previousSortObj) !== JSON.stringify(this.
|
|
1113
|
+
if(JSON.stringify(this._previousSortObj) !== JSON.stringify(this.sortRef.current) || JSON.stringify(this._previousPagination) !== JSON.stringify(this._pagination) && this.getPaginatedData().length !== data.length){
|
|
1111
1114
|
return {};
|
|
1112
1115
|
}
|
|
1113
1116
|
return this.selectedRows;
|
|
@@ -1142,10 +1145,10 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1142
1145
|
});
|
|
1143
1146
|
data = newData;
|
|
1144
1147
|
}
|
|
1145
|
-
if(this.
|
|
1146
|
-
if(isObj(this.state.columns) && this.state.columns[this.
|
|
1147
|
-
let field = this.state.columns[this.
|
|
1148
|
-
const cfg = Object.assign({},this.
|
|
1148
|
+
if(this.canAutoSort() && isNonNullString(this.sortRef.current.column)){
|
|
1149
|
+
if(isObj(this.state.columns) && this.state.columns[this.sortRef.current.column]){
|
|
1150
|
+
let field = this.state.columns[this.sortRef.current.column];
|
|
1151
|
+
const cfg = Object.assign({},this.sortRef.current);
|
|
1149
1152
|
cfg.getItem = (item,columnName,{getItem})=>{
|
|
1150
1153
|
if(isObj(item) && (field.type =='decimal' || field.type =="number")){
|
|
1151
1154
|
const v = item[columnName];
|
|
@@ -1166,7 +1169,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1166
1169
|
} else if(force){
|
|
1167
1170
|
this.setSelectedRows();
|
|
1168
1171
|
}
|
|
1169
|
-
const state = {data
|
|
1172
|
+
const state = {data};
|
|
1170
1173
|
if((cb)){
|
|
1171
1174
|
cb(state);
|
|
1172
1175
|
}
|
|
@@ -1571,9 +1574,19 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1571
1574
|
getLinesProgressBar(){
|
|
1572
1575
|
return CommonDatagridComponent.LinesProgressBar(this.props);
|
|
1573
1576
|
}
|
|
1577
|
+
/*** si le datagrid sera sortable */
|
|
1578
|
+
isSortable(){
|
|
1579
|
+
return this.isDatagrid() && this.props.sortable !== false? true : false;
|
|
1580
|
+
}
|
|
1581
|
+
canAutoSort(){
|
|
1582
|
+
return this.isSortable() && this.props.autoSort !==false ? true : false;
|
|
1583
|
+
}
|
|
1574
1584
|
isSelectableMultiple(){
|
|
1575
1585
|
return defaultBool(this.props.selectableMultiple,true)
|
|
1576
1586
|
}
|
|
1587
|
+
getSort(){
|
|
1588
|
+
return defaultObj(this.sortRef.current);
|
|
1589
|
+
}
|
|
1577
1590
|
renderHeaderCell({columnDef,columnField}){
|
|
1578
1591
|
if(this.isSelectableColumn(columnDef,columnField)){
|
|
1579
1592
|
return <Checkbox
|
|
@@ -1705,11 +1718,13 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1705
1718
|
_render = <Flag withCode {...columnDef} length={undefined} width={undefined} height={undefined} code={defaultValue}/>
|
|
1706
1719
|
}
|
|
1707
1720
|
///le lien vers le table data se fait via la colonne ayant la propriété foreignKeyTable de type chaine de caractère non nulle
|
|
1708
|
-
else if(isNonNullString(columnDef.foreignKeyTable)){
|
|
1721
|
+
else if(isNonNullString(columnDef.foreignKeyTable) || columnDef.primaryKey === true || arrayValueExists(['id','piece'],_type)){
|
|
1709
1722
|
const id = rowData[columnField]?.toString();
|
|
1710
1723
|
if(isNonNullString(id)){
|
|
1711
1724
|
_render = <TableLink
|
|
1712
1725
|
id = {id}
|
|
1726
|
+
foreignKeyTable = {defaultStr(columnDef.foreignKeyTable,columnDef.table,columnDef.tableName)}
|
|
1727
|
+
foreignKeyColumn = {defaultStr(columnDef.foreignKeyColumn,columnDef.field)}
|
|
1713
1728
|
{...columnDef}
|
|
1714
1729
|
data = {rowData}
|
|
1715
1730
|
columnField = {columnField}
|
|
@@ -1806,9 +1821,9 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1806
1821
|
let fmat = defaultStr(columnDef.format).toLowerCase();
|
|
1807
1822
|
if(fmat == "money"){
|
|
1808
1823
|
_render = _render.formatMoney();
|
|
1809
|
-
} else if(fmat =="number") {
|
|
1824
|
+
} else //if(fmat =="number") {
|
|
1810
1825
|
_render = _render.formatNumber();
|
|
1811
|
-
}
|
|
1826
|
+
//}
|
|
1812
1827
|
}
|
|
1813
1828
|
if(_render && isObj(renderProps)){
|
|
1814
1829
|
let Component = defaultVal(renderProps.Component,Label);
|
|
@@ -1818,7 +1833,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
|
1818
1833
|
if(typeof _render =='boolean'){
|
|
1819
1834
|
_render = _render ? "Oui" : "Non";
|
|
1820
1835
|
}
|
|
1821
|
-
if(typeof _render ==='string' || typeof _render =='
|
|
1836
|
+
if(typeof _render ==='string' || typeof _render =='number'){
|
|
1822
1837
|
_render = <Label selectable>{_render}</Label>
|
|
1823
1838
|
}
|
|
1824
1839
|
_render = React.isValidElement(_render)|| Array.isArray(_render)?_render:null;
|
|
@@ -82,7 +82,7 @@ export default class CommonTableDatagrid extends CommonDatagrid{
|
|
|
82
82
|
fetchOptions.dataSources = this.currentDataSources;
|
|
83
83
|
fetchOptions = extendObj(true,true,{},fetchOptions,{selector : fetchFilters});
|
|
84
84
|
fetchOptions.dataSources = this.currentDataSources;
|
|
85
|
-
fetchOptions.sort = this.
|
|
85
|
+
fetchOptions.sort = this.getSort();
|
|
86
86
|
let limit = this.getQueryLimit();
|
|
87
87
|
if(limit > 0 && !this.isPivotDatagrid()){
|
|
88
88
|
fetchOptions.limit = limit;
|
|
@@ -17,8 +17,8 @@ const DatagridRenderTypeComponent = (props)=>{
|
|
|
17
17
|
const isDesk = isDesktopMedia();
|
|
18
18
|
let type = defaultStr(get(typeKey),isDesk? "fixed":'accordion').toLowerCase().trim();
|
|
19
19
|
const rTypes = [
|
|
20
|
-
{...getActiveProps(type,'accordion'),
|
|
21
|
-
{...getActiveProps(type,'table'),
|
|
20
|
+
{...getActiveProps(type,'accordion'),tooltip:"Les éléments de liste s'affichent de manière optimisé pour téléphone mobile",code:'accordion',icon:accordionIcon,label:'Mobile',labelText:'environnement optimisé pour téléphone mobile'},
|
|
21
|
+
{...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau rééel",code:'table',icon:tableIcon,label:'Tableau réel avec pagination'}
|
|
22
22
|
]
|
|
23
23
|
Object.map(rendersTypes,(t,i)=>{
|
|
24
24
|
if(isObj(t)){
|
|
@@ -37,10 +37,10 @@ const DatagridRenderTypeComponent = (props)=>{
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
return <Menu
|
|
40
|
-
|
|
40
|
+
tooltip = {"Type d'affichage du tableau"}
|
|
41
41
|
sheet
|
|
42
42
|
items = {rTypes}
|
|
43
|
-
anchor = {(props)=><Icon {...props} name = {typeObj.icon}
|
|
43
|
+
anchor = {(props)=><Icon {...props} name = {typeObj.icon} tooltip={typeObj.tooltip}/>}
|
|
44
44
|
onPressItem = {({item})=>{
|
|
45
45
|
if(isObj(item) && item.code){
|
|
46
46
|
set(typeKey,item.code);
|
|
@@ -62,6 +62,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
62
62
|
fetcher,
|
|
63
63
|
ListFooterComponent,
|
|
64
64
|
testID,
|
|
65
|
+
autoSort,
|
|
65
66
|
...rest
|
|
66
67
|
} = props;
|
|
67
68
|
rest = defaultObj(rest);
|
|
@@ -123,6 +124,9 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
123
124
|
opts.queryParams.withTotal = true;
|
|
124
125
|
opts.queryParams.limit = limitRef.current;
|
|
125
126
|
opts.queryParams.page = pageRef.current -1;
|
|
127
|
+
if(isObj(opts.sort)){
|
|
128
|
+
opts.queryParams.sort = opts.sort;
|
|
129
|
+
}
|
|
126
130
|
const fetchCB = ({data,total})=>{
|
|
127
131
|
totalRef.current = total;
|
|
128
132
|
/***
|
|
@@ -203,6 +207,10 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
203
207
|
return false;
|
|
204
208
|
}
|
|
205
209
|
return pPage;
|
|
210
|
+
}, canSortRemotely = ()=>{
|
|
211
|
+
if(!canPagninate() || autoSort === true) return false;
|
|
212
|
+
///si le nombre total d'élements est inférieur au nombre limite alors le trie peut être fait localement
|
|
213
|
+
return totalRef.current > limitRef.current && true || false;
|
|
206
214
|
}
|
|
207
215
|
React.useEffect(()=>{
|
|
208
216
|
const upsert = cAction.upsert(tableName);
|
|
@@ -224,6 +232,13 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
224
232
|
testID = {testID}
|
|
225
233
|
{...rest}
|
|
226
234
|
{...defaultObj(table.datagrid)}
|
|
235
|
+
onSort = {({sort})=>{
|
|
236
|
+
if(!canSortRemotely()) return;
|
|
237
|
+
fetchOptionsRef.current.sort = sort;
|
|
238
|
+
pageRef.current = firstPage;
|
|
239
|
+
doRefresh(true);
|
|
240
|
+
return false;
|
|
241
|
+
}}
|
|
227
242
|
renderCustomPagination = {({context})=>{
|
|
228
243
|
if(!canPagninate()) return null;
|
|
229
244
|
const page = pageRef.current, totalPages = getTotalPages(), prevPage = getPrevPage(),nextPage = getNextPage();
|
|
@@ -324,7 +339,7 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
324
339
|
</View>
|
|
325
340
|
</View>
|
|
326
341
|
}}
|
|
327
|
-
ListFooterComponent = {(props)=>{
|
|
342
|
+
/*ListFooterComponent = {(props)=>{
|
|
328
343
|
const r = typeof ListFooterComponent =='function'? ListFooterComponent(props) : null;
|
|
329
344
|
if(!loading) return r;
|
|
330
345
|
const aContent = <View testID={testID+"_ListHeaderActivityIndicator"} style={[theme.styles.w100,theme.styles.justifyContentCenter]}>
|
|
@@ -337,9 +352,10 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
|
|
|
337
352
|
</View>
|
|
338
353
|
}
|
|
339
354
|
return aContent;
|
|
340
|
-
}}
|
|
355
|
+
}}*/
|
|
341
356
|
handleQueryLimit = {false}
|
|
342
357
|
handlePagination = {false}
|
|
358
|
+
autoSort = {canSortRemotely()? false : true}
|
|
343
359
|
isLoading = {loading && !error && showProgressRef.current && true || false}
|
|
344
360
|
beforeFetchData = {({fetchOptions:opts,force})=>{
|
|
345
361
|
opts.fields = fetchFields;
|
|
@@ -111,7 +111,10 @@ const DatagridFactory = (Factory)=>{
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
render(){
|
|
114
|
-
let {title,testID,actions,selectableMultiple,
|
|
114
|
+
let {title,testID,actions,selectableMultiple,
|
|
115
|
+
sortable,
|
|
116
|
+
autoSort,
|
|
117
|
+
exportable,
|
|
115
118
|
selectable,pagin,showPagination,
|
|
116
119
|
sessionName,onMount,onUnmount,onFetchData,dataSourceSelector,dataSourceSelectorProps,queryLimit,
|
|
117
120
|
filters,
|
|
@@ -138,7 +141,6 @@ const DatagridFactory = (Factory)=>{
|
|
|
138
141
|
_dataSourceSelector = null;
|
|
139
142
|
}
|
|
140
143
|
exportable = defaultBool(exportable,true);
|
|
141
|
-
sortable = defaultVal(sortable,true);
|
|
142
144
|
let isMobile = isMobileOrTabletMedia();
|
|
143
145
|
selectable = defaultVal(selectable,true);
|
|
144
146
|
selectableMultiple = defaultBool(selectableMultiple,true);
|
|
@@ -12,9 +12,11 @@ import {open as openPreloader,close as closePreloader} from "$preloader";
|
|
|
12
12
|
import {styles as _styles} from "$theme";
|
|
13
13
|
import Tooltip from "$ecomponents/Tooltip";
|
|
14
14
|
import {navigateToTableData} from "$enavigation/utils";
|
|
15
|
+
import Auth from "$cauth";
|
|
16
|
+
import fetch from "$capi/fetch";
|
|
15
17
|
|
|
16
18
|
const TableLinKComponent = React.forwardRef((props,ref)=>{
|
|
17
|
-
let {disabled,labelProps,server,containerProps,id,fetchForeignData,foreignKeyTable,foreignKeyColumn,data,testID,Component,routeName,routeParams,component,primary,triggerProps,onPress,children, ...rest} = props;
|
|
19
|
+
let {disabled,readOnly,labelProps,server,containerProps,perm,id,fetchForeignData,foreignKeyTable,foreignKeyColumn,data,testID,Component,routeName,routeParams,component,primary,triggerProps,onPress,children, ...rest} = props;
|
|
18
20
|
testID = defaultStr(testID,"RN_TableDataLinkContainer")
|
|
19
21
|
foreignKeyTable = defaultStr(foreignKeyTable).trim();
|
|
20
22
|
foreignKeyColumn = defaultStr(foreignKeyColumn).trim();
|
|
@@ -23,13 +25,16 @@ const TableLinKComponent = React.forwardRef((props,ref)=>{
|
|
|
23
25
|
labelProps = defaultObj(labelProps);
|
|
24
26
|
data = defaultObj(data);
|
|
25
27
|
id = defaultStr(id);
|
|
26
|
-
if(!id){
|
|
27
|
-
|
|
28
|
+
if(!id || !foreignKeyTable){
|
|
29
|
+
readOnly = true;
|
|
28
30
|
}
|
|
29
|
-
const pointerEvents = disabled || !id? 'none' : 'auto';
|
|
31
|
+
const pointerEvents = disabled || readOnly || !id? 'none' : 'auto';
|
|
30
32
|
const onPressLink = (event)=>{
|
|
31
33
|
React.stopEventPropagation(event);
|
|
32
|
-
|
|
34
|
+
if((isNonNullString(perm) && !Auth.isAllowedFromString(perm)) || !Auth.isTableDataAllowed({table:foreignKeyTable,action:'read'})){
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const args = {...React.getOnPressArgs(event),...rest,fetch,foreignKeyTable,foreignKeyColumn,data,id,value:id};
|
|
33
38
|
let r = typeof onPress =='function'? onPress(args) : undefined;
|
|
34
39
|
if(r === false) return;
|
|
35
40
|
const cb = (a)=>{
|
|
@@ -51,10 +56,10 @@ const TableLinKComponent = React.forwardRef((props,ref)=>{
|
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
rest.style = [rest.style,_styles.cursorPointer];
|
|
54
|
-
const CP = disabled ? View : TouchableOpacity;
|
|
59
|
+
const CP = disabled || readOnly ? View : TouchableOpacity;
|
|
55
60
|
return <CP testID={testID} onLongPres={(e)=>React.stopEventPropagation(e)} {...containerProps} onPress={disabled? undefined : onPressLink} style={[styles.container,containerProps.style]}>
|
|
56
|
-
<Tooltip testID={testID+"_Tooltip"} {...rest} Component={Component} onPress={disabled?undefined:onPressLink} ref={ref} pointerEvents={pointerEvents} disabled = {disabled}>
|
|
57
|
-
<Label testID={testID+"_Label"} underlined primary {...labelProps} style={[_styles.lh15,labelProps.style]} disabled={disabled}>{children}</Label>
|
|
61
|
+
<Tooltip testID={testID+"_Tooltip"} {...rest} Component={Component} onPress={disabled || readOnly?undefined:onPressLink} ref={ref} pointerEvents={pointerEvents} readOnly={readOnly} disabled = {disabled}>
|
|
62
|
+
<Label testID={testID+"_Label"} underlined primary {...labelProps} style={[_styles.lh15,labelProps.style]} disabled={disabled} readOnly={readOnly}>{children}</Label>
|
|
58
63
|
</Tooltip>
|
|
59
64
|
</CP>
|
|
60
65
|
});
|
|
@@ -477,7 +477,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
|
477
477
|
if(this.cloneProp && this.cloneProp(data,this) === false) return data;
|
|
478
478
|
this.showPreloader();
|
|
479
479
|
delete data.approved;
|
|
480
|
-
Object.map(['_rev',...generatedColumnsProperties,'_id','code','updateBy','updatedDate','createBy','updatedHour','createdHour','createdDate'],(idx)=>{
|
|
480
|
+
Object.map(['_rev',...generatedColumnsProperties,...Object.keys(this.primaryKeyFields),'_id','code','updateBy','updatedDate','createBy','updatedHour','createdHour','createdDate'],(idx)=>{
|
|
481
481
|
data[idx] = undefined;
|
|
482
482
|
delete data[idx];
|
|
483
483
|
});
|