@fto-consult/expo-ui 8.74.2 → 8.76.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/bin/create-app/src/database/tables/index.js +1 -1
- package/package.json +108 -108
- package/src/components/Chart/appexChart/appexChart.html +3 -3
- package/src/components/Datagrid/Accordion/index.js +529 -545
- package/src/components/Datagrid/Common/Common.js +109 -13
- package/src/components/Datagrid/Common/index.js +0 -4
- package/src/components/Datagrid/Dashboard/index.js +3 -4
- package/src/components/Datagrid/IndexComponent.js +8 -9
- package/src/components/Datagrid/Table/index.js +311 -327
- package/src/components/Dropdown/index.js +20 -10
- package/src/layouts/Screen/TableData.js +9 -3
- package/src/pdf/index.js +1 -1
- package/src/screens/Help/openLibraries.js +76 -123
- package/src/components/Datagrid/Common/TableData.js +0 -66
- package/src/components/Datagrid/Common/factory.js +0 -9
- package/src/components/Datagrid/factory.js +0 -12
@@ -15,14 +15,13 @@ import Icon,{MENU_ICON} from "$ecomponents/Icon";
|
|
15
15
|
import Dropdown from "$ecomponents/Dropdown";
|
16
16
|
import React from "$react";
|
17
17
|
import Footer from "../Footer/Footer";
|
18
|
-
import
|
19
|
-
import CommonTableDatagrid from "../Common/TableData";
|
18
|
+
import Datagrid from "../Common";
|
20
19
|
import BackToTop from "$ecomponents/BackToTop";
|
21
20
|
import FiltersAccordionComponent from "./Filters";
|
22
21
|
import RenderType from "../RenderType";
|
23
22
|
import { flatMode} from "$ecomponents/TextField";
|
24
|
-
import List from "$ecomponents/Table/List";
|
25
|
-
|
23
|
+
//import List from "$ecomponents/Table/List";
|
24
|
+
import List from "$ecomponents/List/FlashList";
|
26
25
|
import theme,{Colors} from "$theme";
|
27
26
|
import {styles as rStyles} from "../utils";
|
28
27
|
import Avatar from "$ecomponents/Avatar";
|
@@ -30,566 +29,562 @@ import {defaultObj,isOb,isNonNullString} from "$cutils";
|
|
30
29
|
import PropTypes from "prop-types";
|
31
30
|
import DatagridProvider from "../hooks/Provider";
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
32
|
+
export default class DatagridAccordionComponent extends Datagrid {
|
33
|
+
constructor(props) {
|
34
|
+
super(props);
|
35
|
+
this.autobind();
|
36
|
+
this.frozenItems = 0;
|
37
|
+
Object.defineProperties(this,{
|
38
|
+
listRef : {
|
39
|
+
value : React.createRef(),
|
40
|
+
},
|
41
|
+
backToTopRef : {
|
42
|
+
value : React.createRef(),
|
43
|
+
},
|
44
|
+
});
|
45
|
+
this.state.refreshing = false;
|
46
|
+
}
|
47
|
+
componentDidUpdate(){
|
48
|
+
super.componentDidUpdate();
|
49
|
+
const p = this.expandedRef;
|
50
|
+
if(!p || !p?.ref) return;
|
51
|
+
const ref = p.ref;
|
52
|
+
ref?.toggleExpand && ref?.toggleExpand(false);
|
53
|
+
}
|
54
|
+
isDatagrid(){
|
55
|
+
return true;
|
56
|
+
}
|
57
|
+
canHandleIndexColumn(){
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
canPaginateData(){
|
61
|
+
return false;
|
62
|
+
}
|
63
|
+
isAccordion(){
|
64
|
+
return true;
|
65
|
+
}
|
66
|
+
renderRowCell (arg){
|
67
|
+
if(arg.renderRowCell === false || arg.isSectionListHeader === true) return super.renderRowCell(arg);
|
68
|
+
const {columnDef,columnField} = arg;
|
69
|
+
if(!columnDef.visible || columnDef.accordion === false || this.isSelectableColumn(columnDef,columnField)) return null;
|
70
|
+
arg.isAccordion = true;
|
71
|
+
const {render,key,style} = super.renderRowCell(arg);
|
72
|
+
if(render===null || !React.isValidElement(render)) return null;
|
73
|
+
return <Label testID={`${arg?.testID?arg.testID:""}_LabelContainer`} style={[style,{paddingTop:10,paddingBottom:10}]} key={key}>
|
74
|
+
{render}
|
75
|
+
</Label>
|
76
|
+
}
|
77
|
+
rangeChanged(state){
|
78
|
+
if(this.startEndIndexCounterElt && this.startEndIndexCounterElt.update){
|
79
|
+
this.startEndIndexCounterElt.update(state);
|
65
80
|
}
|
66
|
-
|
67
|
-
|
81
|
+
}
|
82
|
+
|
83
|
+
isScrolling(){
|
84
|
+
if(this.listRef.current && typeof this.listRef.current.isScrolling =='boolean'){
|
85
|
+
return this.listRef.current.isScrolling;
|
68
86
|
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
return <Label testID={`${arg?.testID?arg.testID:""}_LabelContainer`} style={[style,{paddingTop:10,paddingBottom:10}]} key={key}>
|
77
|
-
{render}
|
78
|
-
</Label>
|
87
|
+
}
|
88
|
+
onAllRowsToggle(selected){
|
89
|
+
if(!selected){
|
90
|
+
this.scrollToIndex(this.getMaxSelectedRows());
|
91
|
+
//this.scrollToIndex(0);
|
92
|
+
} else {
|
93
|
+
this.scrollToIndex(selected?Math.max(this.getMaxSelectedRows()-1,0):0)
|
79
94
|
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
95
|
+
}
|
96
|
+
getItemCallArgs({item,index}){
|
97
|
+
const rowIndexCount = index+1;
|
98
|
+
const formatValue = this.formatValue.bind(this);
|
99
|
+
return {...this.getActionsArgs(),valueFormatter:formatValue,formatValue,abreviateValues:this.state.abreviateValues,row:item,items:this.state.data,item,rowData:item,index,rowIndex:index,rowCounterIndex:rowIndexCount,rowIndexCount};
|
100
|
+
}
|
101
|
+
getRenderingItemProps ({item,rowKey,index}){
|
102
|
+
this.renderingItemsProps = isObj(this.renderingItemsProps)? this.renderingItemsProps : {};
|
103
|
+
if(this.renderingItemsProps[rowKey] && isObj(this.renderingItemsProps[rowKey].rowProps)){
|
104
|
+
return this.renderingItemsProps[rowKey];
|
84
105
|
}
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
106
|
+
const callArgs = this.getItemCallArgs({item,index});
|
107
|
+
const accordion = this.props.accordion;
|
108
|
+
const accordionProps = defaultObj(this.props.accordionProps);
|
109
|
+
const testID = "RN_DatagridAccordionRow_"+rowKey;
|
110
|
+
let renderedContent = isFunction(accordion) ? accordion(callArgs) : isFunction(accordionProps.accordion) ? accordionProps.accordion(callArgs) : isObj(accordion) && accordion ? accordion : isObj(accordionProps.accordion) ? accordionProps.accordion : undefined;;
|
111
|
+
let title = null, avatarContent = null,right = null,rightProps={},description = null,rowProps = {},avatarProps = {};
|
112
|
+
let descriptionProps = Object.assign({},this.accordionDescriptionProps)
|
113
|
+
let color = undefined;
|
114
|
+
let titleProps = Object.assign({},this.accordionTitleProps);
|
115
|
+
if(React.isValidElement(renderedContent) || isNonNullString(renderedContent)){
|
116
|
+
title = renderedContent;
|
117
|
+
} else if(isObj(renderedContent)){
|
118
|
+
title = renderedContent.title
|
119
|
+
if(isObj(renderedContent.titleProps)){
|
120
|
+
titleProps = {...titleProps,...renderedContent.titleProps,style:[titleProps.style,renderedContent.titleProps.style]};
|
89
121
|
}
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
122
|
+
right = renderedContent.right;
|
123
|
+
rightProps = Object.assign({},renderedContent.rightProps);
|
124
|
+
description = defaultVal(renderedContent.description,renderedContent.content);
|
125
|
+
avatarContent = renderedContent.avatar;
|
126
|
+
avatarProps = Object.assign({},renderedContent.avatarProps);
|
127
|
+
color = Colors.isValid(renderedContent.avatarColor)?renderedContent.avatarColor:Colors.isValid(renderedContent.color)? renderedContent.color:undefined;
|
128
|
+
if(isObj(renderedContent.descriptionProps)){
|
129
|
+
descriptionProps = {...descriptionProps,...renderedContent.descriptionProps,style:[descriptionProps.style,renderedContent.descriptionProps.style]}
|
130
|
+
} else if(isObj(renderedContent.contentProps)){
|
131
|
+
descriptionProps = {...descriptionProps,...renderedContent.contentProps,style:[descriptionProps.style,renderedContent.contentProps.style]}
|
97
132
|
}
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
return {...this.getActionsArgs(),valueFormatter:formatValue,formatValue,abreviateValues:this.state.abreviateValues,row:item,items:this.state.data,item,rowData:item,index,rowIndex:index,rowCounterIndex:rowIndexCount,rowIndexCount};
|
103
|
-
}
|
104
|
-
getRenderingItemProps ({item,rowKey,index}){
|
105
|
-
this.renderingItemsProps = isObj(this.renderingItemsProps)? this.renderingItemsProps : {};
|
106
|
-
if(this.renderingItemsProps[rowKey] && isObj(this.renderingItemsProps[rowKey].rowProps)){
|
107
|
-
return this.renderingItemsProps[rowKey];
|
133
|
+
rowProps = defaultObj(renderedContent.rowProps);
|
134
|
+
avatarProps.color = color;
|
135
|
+
if(typeof avatarContent =='function'){
|
136
|
+
avatarContent = avatarContent({...avatarProps,suffix:index,testID:testID+"_Avatar"})
|
108
137
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
let color = undefined;
|
117
|
-
let titleProps = Object.assign({},this.accordionTitleProps);
|
118
|
-
if(React.isValidElement(renderedContent) || isNonNullString(renderedContent)){
|
119
|
-
title = renderedContent;
|
120
|
-
} else if(isObj(renderedContent)){
|
121
|
-
title = renderedContent.title
|
122
|
-
if(isObj(renderedContent.titleProps)){
|
123
|
-
titleProps = {...titleProps,...renderedContent.titleProps,style:[titleProps.style,renderedContent.titleProps.style]};
|
138
|
+
if(isNonNullString(avatarContent)){
|
139
|
+
let src = undefined;
|
140
|
+
let avatarSuffix = index;
|
141
|
+
if(isValidUrl(avatarContent) || isDataURL(avatarContent)){
|
142
|
+
avatarSuffix = undefined;
|
143
|
+
src = avatarContent;
|
144
|
+
avatarContent = undefined;
|
124
145
|
}
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
descriptionProps = {...descriptionProps,...renderedContent.contentProps,style:[descriptionProps.style,renderedContent.contentProps.style]}
|
135
|
-
}
|
136
|
-
rowProps = defaultObj(renderedContent.rowProps);
|
137
|
-
avatarProps.color = color;
|
138
|
-
if(typeof avatarContent =='function'){
|
139
|
-
avatarContent = avatarContent({...avatarProps,suffix:index,testID:testID+"_Avatar"})
|
140
|
-
}
|
141
|
-
if(isNonNullString(avatarContent)){
|
142
|
-
let src = undefined;
|
143
|
-
let avatarSuffix = index;
|
144
|
-
if(isValidUrl(avatarContent) || isDataURL(avatarContent)){
|
145
|
-
avatarSuffix = undefined;
|
146
|
-
src = avatarContent;
|
147
|
-
avatarContent = undefined;
|
148
|
-
}
|
149
|
-
avatarContent = <Avatar
|
150
|
-
src = {src}
|
151
|
-
testID={testID+"_Avatar"}
|
152
|
-
color = {color}
|
153
|
-
image = {src?true :false}
|
154
|
-
suffix = {avatarSuffix}
|
155
|
-
{...avatarProps}
|
156
|
-
>{avatarContent}</Avatar>
|
157
|
-
}
|
158
|
-
}
|
159
|
-
if(typeof description === 'function'){
|
160
|
-
description = description(descriptionProps);
|
161
|
-
}
|
162
|
-
if(typeof description ==='string' || typeof description =='number'){
|
163
|
-
description = <Paragraph ellipsizeMode="tail" numberOfLines={2} {...descriptionProps} >{description+""}</Paragraph>
|
164
|
-
} else if(!React.isValidElement(description)){
|
165
|
-
description = null;
|
166
|
-
}
|
167
|
-
if(typeof title === 'function'){
|
168
|
-
title = title(titleProps);
|
169
|
-
}
|
170
|
-
if(typeof title =='string' || typeof title =='number'){
|
171
|
-
title = <Paragraph testID={testID+"_Title"} ellipsizeMode="tail" numberOfLines={1} {...titleProps}>{title+""}</Paragraph>
|
172
|
-
} else if(!React.isValidElement(title)){
|
173
|
-
title = null;
|
174
|
-
}
|
175
|
-
this.renderingItemsProps[rowKey] = {
|
176
|
-
testID,
|
177
|
-
title,right,rightProps,description,avatarContent,rowProps,avatarProps,
|
178
|
-
bottomSheetTitlePrefix : defaultStr(renderedContent?.bottomSheetTitlePrefix,accordionProps.bottomSheetTitlePrefix,accordion?.bottomSheetTitlePrefix)
|
179
|
-
}
|
180
|
-
return this.renderingItemsProps[rowKey];
|
146
|
+
avatarContent = <Avatar
|
147
|
+
src = {src}
|
148
|
+
testID={testID+"_Avatar"}
|
149
|
+
color = {color}
|
150
|
+
image = {src?true :false}
|
151
|
+
suffix = {avatarSuffix}
|
152
|
+
{...avatarProps}
|
153
|
+
>{avatarContent}</Avatar>
|
154
|
+
}
|
181
155
|
}
|
182
|
-
|
183
|
-
|
184
|
-
args.isAccordion = true;
|
185
|
-
if(isSectionListHeader || item.isSectionListHeader){
|
186
|
-
const rowStyle = style ? [style] : [];
|
187
|
-
const rowProps = {};
|
188
|
-
const it = this.renderFlashListItem({...args,rowProps,rowStyle});
|
189
|
-
if(!React.isValidElement(it)){
|
190
|
-
return null;
|
191
|
-
}
|
192
|
-
const rowKey = defaultVal(args.rowIndex,args.index,args.rowCounterIndex);
|
193
|
-
return <View {...rowProps} testID={defaultStr(rowProps.testID,"RNDatagridAccordionSectionHeader")+rowKey} style={[theme.styles.w100,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,rowProps.style,rowStyle,theme.styles.w100]}>
|
194
|
-
{it}
|
195
|
-
</View>;
|
196
|
-
}
|
197
|
-
if(!(item) || typeof item !== 'object') return null;
|
198
|
-
const canHandleRow = typeof this.props.filter =='function' ? this.props.filter(this.getItemCallArgs({item,index})) : true;
|
199
|
-
if(canHandleRow === false || canHandleRow === null) return null;
|
200
|
-
const rowKey = this.getRowKeyByIndex(index);
|
201
|
-
return <DatagridAccordionRow
|
202
|
-
item = {item}
|
203
|
-
index = {index}
|
204
|
-
rowKey = {rowKey}
|
205
|
-
selectable = {this.props.selectable}
|
206
|
-
{...defaultObj(this.props.accordionProps)}
|
207
|
-
accordion = {this.props.accordion}
|
208
|
-
{...this.getRenderingItemProps({item,index,rowKey})}
|
209
|
-
numColumns = {numColumns}
|
210
|
-
key = {index}
|
211
|
-
ref = {(el)=>{
|
212
|
-
this.renderingItemsProps = defaultObj(this.renderingItemsProps);
|
213
|
-
this.renderingItemsProps[rowKey] = defaultObj(this.renderingItemsProps[rowKey]);
|
214
|
-
this.renderingItemsProps[rowKey].ref = el;
|
215
|
-
}}
|
216
|
-
style = {[style,this.props.accordionProps?.style]}
|
217
|
-
callArgs = {this.getItemCallArgs({item,index})}
|
218
|
-
onRowPress = {this.props.onRowPress}
|
219
|
-
onRowLongPress = {this.props.onRowLongPress}
|
220
|
-
onToggleExpand = {this.onToggleExpandItem.bind(this)}
|
221
|
-
/>
|
156
|
+
if(typeof description === 'function'){
|
157
|
+
description = description(descriptionProps);
|
222
158
|
}
|
223
|
-
|
224
|
-
|
159
|
+
if(typeof description ==='string' || typeof description =='number'){
|
160
|
+
description = <Paragraph ellipsizeMode="tail" numberOfLines={2} {...descriptionProps} >{description+""}</Paragraph>
|
161
|
+
} else if(!React.isValidElement(description)){
|
162
|
+
description = null;
|
225
163
|
}
|
226
|
-
|
227
|
-
|
164
|
+
if(typeof title === 'function'){
|
165
|
+
title = title(titleProps);
|
228
166
|
}
|
229
|
-
|
230
|
-
|
167
|
+
if(typeof title =='string' || typeof title =='number'){
|
168
|
+
title = <Paragraph testID={testID+"_Title"} ellipsizeMode="tail" numberOfLines={1} {...titleProps}>{title+""}</Paragraph>
|
169
|
+
} else if(!React.isValidElement(title)){
|
170
|
+
title = null;
|
231
171
|
}
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
}
|
172
|
+
this.renderingItemsProps[rowKey] = {
|
173
|
+
testID,
|
174
|
+
title,right,rightProps,description,avatarContent,rowProps,avatarProps,
|
175
|
+
bottomSheetTitlePrefix : defaultStr(renderedContent?.bottomSheetTitlePrefix,accordionProps.bottomSheetTitlePrefix,accordion?.bottomSheetTitlePrefix)
|
237
176
|
}
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
177
|
+
return this.renderingItemsProps[rowKey];
|
178
|
+
}
|
179
|
+
renderItem(args){
|
180
|
+
const {index,numColumns,item,isSectionListHeader,isScrolling:_isScrolling,style} = args;
|
181
|
+
args.isAccordion = true;
|
182
|
+
if(isSectionListHeader || item.isSectionListHeader){
|
183
|
+
const rowStyle = style ? [style] : [];
|
184
|
+
const rowProps = {};
|
185
|
+
const it = this.renderFlashListItem({...args,rowProps,rowStyle});
|
186
|
+
if(!React.isValidElement(it)){
|
187
|
+
return null;
|
242
188
|
}
|
189
|
+
const rowKey = defaultVal(args.rowIndex,args.index,args.rowCounterIndex);
|
190
|
+
return <View {...rowProps} testID={defaultStr(rowProps.testID,"RNDatagridAccordionSectionHeader")+rowKey} style={[theme.styles.w100,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,rowProps.style,rowStyle,theme.styles.w100]}>
|
191
|
+
{it}
|
192
|
+
</View>;
|
243
193
|
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
}
|
194
|
+
if(!(item) || typeof item !== 'object') return null;
|
195
|
+
const canHandleRow = typeof this.props.filter =='function' ? this.props.filter(this.getItemCallArgs({item,index})) : true;
|
196
|
+
if(canHandleRow === false || canHandleRow === null) return null;
|
197
|
+
const rowKey = this.getRowKey(item);
|
198
|
+
return <DatagridAccordionRow
|
199
|
+
item = {item}
|
200
|
+
index = {index}
|
201
|
+
rowKey = {rowKey}
|
202
|
+
selectable = {this.props.selectable}
|
203
|
+
{...defaultObj(this.props.accordionProps)}
|
204
|
+
accordion = {this.props.accordion}
|
205
|
+
{...this.getRenderingItemProps({item,index,rowKey})}
|
206
|
+
numColumns = {numColumns}
|
207
|
+
key = {index}
|
208
|
+
ref = {(el)=>{
|
209
|
+
this.renderingItemsProps = defaultObj(this.renderingItemsProps);
|
210
|
+
this.renderingItemsProps[rowKey] = defaultObj(this.renderingItemsProps[rowKey]);
|
211
|
+
this.renderingItemsProps[rowKey].ref = el;
|
212
|
+
}}
|
213
|
+
style = {[style,this.props.accordionProps?.style]}
|
214
|
+
callArgs = {this.getItemCallArgs({item,index})}
|
215
|
+
onRowPress = {this.props.onRowPress}
|
216
|
+
onRowLongPress = {this.props.onRowLongPress}
|
217
|
+
onToggleExpand = {this.onToggleExpandItem.bind(this)}
|
218
|
+
/>
|
219
|
+
}
|
220
|
+
hasScrollViewParent(){
|
221
|
+
return this.props.hasScrollViewParent ? true : false;
|
222
|
+
}
|
223
|
+
bindResizeEvents(){
|
224
|
+
return true;
|
225
|
+
}
|
226
|
+
getPageSize (){
|
227
|
+
return INFINITE_SCROLL_PAGE_SIZE;
|
228
|
+
}
|
229
|
+
scrollToEnd(){
|
230
|
+
if(!this._isMounted() || !this.canScrollTo()) return;
|
231
|
+
if(this.listRef.current && this.listRef.current.scrollToEnd){
|
232
|
+
this.listRef.current.scrollToEnd();
|
250
233
|
}
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
234
|
+
}
|
235
|
+
scrollToTop(opts){
|
236
|
+
if(!this._isMounted() || !this.canScrollTo()) return;
|
237
|
+
if(this.listRef.current && this.listRef.current.scrollToTop){
|
238
|
+
this.listRef.current.scrollToTop(defaultObj(opts));
|
256
239
|
}
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
240
|
+
}
|
241
|
+
scrollToIndex(index){
|
242
|
+
if(!this._isMounted() || !this.canScrollTo()) return;
|
243
|
+
index = typeof index =='number'? index : 0;
|
244
|
+
if(this.listRef.current && this.listRef.current.scrollToIndex){
|
245
|
+
this.listRef.current.scrollToIndex({index});
|
261
246
|
}
|
262
|
-
|
263
|
-
|
247
|
+
}
|
248
|
+
getVirtualListContext(){
|
249
|
+
if(isObj(this.listRef) && isObj(this.listRef.current)){
|
250
|
+
return this.listRef.current;
|
264
251
|
}
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
252
|
+
return null;
|
253
|
+
}
|
254
|
+
getItem(index){
|
255
|
+
return this.getRowByIndex(index);
|
256
|
+
if(typeof index !=='number') return null;
|
257
|
+
return isObj(this.state.data[index])? this.state.data[index] : null;
|
258
|
+
}
|
259
|
+
getMaxSelectedRows(){
|
260
|
+
return isMobileMedia()? 30 : 50;
|
261
|
+
}
|
262
|
+
|
263
|
+
/*** affiche les infos de l'item */
|
264
|
+
onToggleExpandItem({item,index,rowIndex,rowKey,...rest}){
|
265
|
+
if(!isObj(this.bottomSheetContext) || typeof this.bottomSheetContext.open !=='function') return;
|
266
|
+
if(!isObj(this.renderingItemsProps) || !isObj(this.renderingItemsProps[rowKey])) return;
|
267
|
+
const callArgs = this.getItemCallArgs({item,index})
|
268
|
+
this.expandedRef = this.renderingItemsProps[rowKey];
|
269
|
+
return this.bottomSheetContext.open({
|
270
|
+
...rest,
|
271
|
+
onDismiss : ()=>{
|
272
|
+
const ref = this.renderingItemsProps[rowKey].ref;
|
273
|
+
ref?.toggleExpand && ref?.toggleExpand(false);
|
274
|
+
},
|
275
|
+
children : <View style={[styles.expandedItemContent]} testID={'RN_DatagridAccordionExpanded'}>
|
276
|
+
{Object.mapToArray(this.state.columns,(columnDef,columnField,index)=>{
|
277
|
+
callArgs.columnDef = columnDef;
|
278
|
+
callArgs.columnField = columnField;
|
279
|
+
let ret = this.renderRowCell(callArgs);
|
280
|
+
if(typeof ret =='number'){
|
281
|
+
ret = ret+"";
|
282
|
+
}
|
283
|
+
if(isNonNullString(ret)){
|
284
|
+
ret = ret.trim();
|
285
|
+
}
|
286
|
+
if(ret !== null && ret !== ""){
|
287
|
+
let text = defaultStr(columnDef.text,columnDef.label,columnField);
|
288
|
+
return <React.Fragment key={rowKey+defaultStr(columnField,index)}>
|
289
|
+
<View style={[styles.expandedItemRowCell,styles.expandedItemRowCellContainer]}>
|
290
|
+
<Label style={[styles.expandedItemRowCellLabel,styles.bold]}>{text.rtrim(":")+" : "}</Label>
|
291
|
+
<Label style={[styles.expandedItemRowCellLabel]}>{ret}</Label>
|
292
|
+
</View>
|
293
|
+
<Divider/>
|
294
|
+
</React.Fragment>
|
295
|
+
}
|
296
|
+
return null;
|
297
|
+
})}
|
298
|
+
</View>
|
299
|
+
})
|
300
|
+
}
|
301
|
+
renderEmpty(){
|
302
|
+
if(isObj(this.currentAccordionProps) && typeof this.currentAccordionProps.renderEmpty =='function'){
|
303
|
+
return this.currentAccordionProps.renderEmpty();
|
303
304
|
}
|
304
|
-
renderEmpty()
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
305
|
+
return super.renderEmpty();
|
306
|
+
}
|
307
|
+
getTestID(){
|
308
|
+
return defaultStr(this.props.testID,"RN_DatagridAccordion");
|
309
|
+
}
|
310
|
+
render (){
|
311
|
+
let {
|
312
|
+
filters:customFilters,
|
313
|
+
filter,
|
314
|
+
actions,
|
315
|
+
sortable,
|
316
|
+
autoSort,
|
317
|
+
exportable,
|
318
|
+
filterOrOperator,
|
319
|
+
filterAndOperator,
|
320
|
+
accordionProps,
|
321
|
+
responsive,
|
322
|
+
isLoading:customIsLoading,
|
323
|
+
cacheHeight,
|
324
|
+
toggleFilters,
|
325
|
+
dataSourceSelector,
|
326
|
+
progressBarProps,
|
327
|
+
accordion,
|
328
|
+
preloaderProps,
|
329
|
+
backToTopRef,
|
330
|
+
backToTopProps,
|
331
|
+
testID,
|
332
|
+
renderEmpty,
|
333
|
+
chartContainerProps,
|
334
|
+
...rest
|
335
|
+
} = this.props
|
336
|
+
chartContainerProps = defaultObj(chartContainerProps);
|
337
|
+
const canRenderChart = this.canRenderChart();
|
338
|
+
const hasData = this.getStateDataSize(false) ? true : false;
|
339
|
+
testID = this.getTestID();
|
340
|
+
backToTopProps = defaultObj(backToTopProps);
|
341
|
+
accordionProps = defaultObj(accordionProps);
|
342
|
+
this.renderingItemsProps = {};
|
343
|
+
this.cachedItemsHeights = {};
|
344
|
+
if(isObj(accordion)){
|
345
|
+
accordionProps = {...accordion,...accordionProps};
|
309
346
|
}
|
310
|
-
|
311
|
-
|
347
|
+
this.currentAccordionProps = accordionProps;
|
348
|
+
backToTopRef = defaultVal(backToTopRef,accordionProps.backToTopRef,true);
|
349
|
+
|
350
|
+
let descOrContentProps = isObj(accordionProps.descriptionProps)? Object.assign({},accordionProps.descriptionProps) : isObj(accordionProps.contentProps)? Object.assign({},accordionProps.contentProps) : {};
|
351
|
+
const descriptionStyle = Object.assign({},StyleSheet.flatten(descOrContentProps.style));
|
352
|
+
const descriptionColor = Colors.isValid(descriptionStyle.color) ? descriptionStyle.color : Colors.isValid(descOrContentProps.color)? descOrContentProps.color : Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
353
|
+
this.accordionDescriptionProps = {
|
354
|
+
ellipsizeMode: EllipsizeMode.tail,
|
355
|
+
numberOfLines : 3,
|
356
|
+
...descOrContentProps,
|
357
|
+
color : descriptionColor,
|
358
|
+
style : [styles.description,rStyles.lineHeight,descriptionStyle],
|
312
359
|
}
|
313
|
-
render (){
|
314
|
-
let {
|
315
|
-
filters:customFilters,
|
316
|
-
filter,
|
317
|
-
actions,
|
318
|
-
sortable,
|
319
|
-
autoSort,
|
320
|
-
exportable,
|
321
|
-
filterOrOperator,
|
322
|
-
filterAndOperator,
|
323
|
-
accordionProps,
|
324
|
-
responsive,
|
325
|
-
isLoading:customIsLoading,
|
326
|
-
cacheHeight,
|
327
|
-
toggleFilters,
|
328
|
-
dataSourceSelector,
|
329
|
-
progressBarProps,
|
330
|
-
accordion,
|
331
|
-
preloaderProps,
|
332
|
-
backToTopRef,
|
333
|
-
backToTopProps,
|
334
|
-
testID,
|
335
|
-
renderEmpty,
|
336
|
-
chartContainerProps,
|
337
|
-
...rest
|
338
|
-
} = this.props
|
339
|
-
chartContainerProps = defaultObj(chartContainerProps);
|
340
|
-
const canRenderChart = this.canRenderChart();
|
341
|
-
const hasData = this.getStateDataSize(false) ? true : false;
|
342
|
-
testID = this.getTestID();
|
343
|
-
backToTopProps = defaultObj(backToTopProps);
|
344
|
-
accordionProps = defaultObj(accordionProps);
|
345
|
-
this.renderingItemsProps = {};
|
346
|
-
this.cachedItemsHeights = {};
|
347
|
-
if(isObj(accordion)){
|
348
|
-
accordionProps = {...accordion,...accordionProps};
|
349
|
-
}
|
350
|
-
this.currentAccordionProps = accordionProps;
|
351
|
-
backToTopRef = defaultVal(backToTopRef,accordionProps.backToTopRef,true);
|
352
|
-
|
353
|
-
let descOrContentProps = isObj(accordionProps.descriptionProps)? Object.assign({},accordionProps.descriptionProps) : isObj(accordionProps.contentProps)? Object.assign({},accordionProps.contentProps) : {};
|
354
|
-
const descriptionStyle = Object.assign({},StyleSheet.flatten(descOrContentProps.style));
|
355
|
-
const descriptionColor = Colors.isValid(descriptionStyle.color) ? descriptionStyle.color : Colors.isValid(descOrContentProps.color)? descOrContentProps.color : Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
356
|
-
this.accordionDescriptionProps = {
|
357
|
-
ellipsizeMode: EllipsizeMode.tail,
|
358
|
-
numberOfLines : 3,
|
359
|
-
...descOrContentProps,
|
360
|
-
color : descriptionColor,
|
361
|
-
style : [styles.description,rStyles.lineHeight,descriptionStyle],
|
362
|
-
}
|
363
360
|
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
}
|
387
|
-
},
|
388
|
-
{
|
389
|
-
text : "Tout désélectionner",
|
390
|
-
onPress : ()=>{
|
391
|
-
this.handleAllRowsToggle(false);
|
392
|
-
},
|
393
|
-
icon :"select"
|
361
|
+
const titleProps = isObj(accordionProps.titleProps)? Object.assign({},accordionProps.titleProps) : {};
|
362
|
+
const labelStyle = Object.assign({},StyleSheet.flatten(titleProps.style));
|
363
|
+
const titleColor = Colors.isValid(labelStyle.color)? labelStyle.color : Colors.isValid(titleProps.color)? titleProps.color : Colors.setAlpha(theme.colors.text,0.87);
|
364
|
+
this.accordionTitleProps = {
|
365
|
+
ellipsizeMode: EllipsizeMode.tail,
|
366
|
+
numberOfLines : 1,
|
367
|
+
...titleProps,
|
368
|
+
color: titleColor,
|
369
|
+
style : [styles.title,{userSelect:"all"},rStyles.lineHeight,titleProps.style]
|
370
|
+
}
|
371
|
+
filter = defaultFunc(filter,x=>true);
|
372
|
+
const showFooters = this.canShowFooters();
|
373
|
+
let restItems = [];
|
374
|
+
let max = this.getMaxSelectableRows();
|
375
|
+
if(max && this.isSelectableMultiple() && this.canRenderActions()){
|
376
|
+
max = max.formatNumber();
|
377
|
+
restItems = [
|
378
|
+
{
|
379
|
+
text : "Sélectionner "+max,
|
380
|
+
icon : "select-all",
|
381
|
+
onPress : ()=>{
|
382
|
+
this.handleAllRowsToggle(true);
|
394
383
|
}
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
384
|
+
},
|
385
|
+
{
|
386
|
+
text : "Tout désélectionner",
|
387
|
+
onPress : ()=>{
|
388
|
+
this.handleAllRowsToggle(false);
|
389
|
+
},
|
390
|
+
icon :"select"
|
391
|
+
}
|
392
|
+
]
|
393
|
+
}
|
394
|
+
const isLoading = this.isLoading();
|
395
|
+
const pointerEvents = this.getPointerEvents();
|
396
|
+
const {
|
397
|
+
sortedColumns:sortColumns,
|
398
|
+
sortedColumnsLength,
|
399
|
+
sortedColumn,
|
400
|
+
visibleColumns,
|
401
|
+
visibleColumnsNames,
|
402
|
+
filteredColumns,
|
403
|
+
filters :headerFilters,
|
404
|
+
} = this.getPreparedColumns();
|
405
|
+
const hasFootersFields = this.hasFootersFields();
|
406
|
+
const datagridHeader = <View testID={testID+"_HeaderContainer"} pointerEvents={pointerEvents} style={[styles.datagridHeader]}>
|
407
|
+
<ScrollView testID={testID+"_HeaderScrollView"} horizontal contentContainerStyle={StyleSheet.flatten([styles.contentContainerStyle,styles.minW100])}>
|
408
|
+
<View testID={testID+"_HeaderContentContainer"} style={[styles.table,theme.styles.ph1,styles.pullRight]}>
|
409
|
+
{/*this.renderDataSourceSelector()*/}
|
410
|
+
{this.renderCustomPagination()}
|
411
|
+
<View testID={testID+"_HeaderQueryLimit"} style={[styles.paginationItem]}>
|
412
|
+
{this.renderQueryLimit(this.getStateDataSize().formatNumber())}
|
413
|
+
</View>
|
414
|
+
{sortedColumnsLength ? <View testID={testID+"_HeaderSortedColumns"} style={[styles.sortableItems,styles.paginationItem,{paddingRight:10}]}>
|
415
|
+
<Icon
|
416
|
+
testID={testID+"_HeaderSortIcon"}
|
417
|
+
{...sortedColumn}
|
418
|
+
name={defaultVal(sortedColumn.icon,"sort")}
|
419
|
+
primary = {!!sortedColumn.field}
|
420
|
+
onPress = {sortedColumn.field?(event) =>{React.stopEventPropagation(event);this.sort(sortedColumn.field);}:undefined}
|
421
|
+
/>
|
422
|
+
<Dropdown
|
423
|
+
testID={testID+"_HeaderSortableColumns"}
|
424
|
+
withBottomSheet
|
425
|
+
dialogProps = {{title:'Trier par le champ'}}
|
426
|
+
mode = {flatMode}
|
427
|
+
inputProps = {{
|
428
|
+
enableCopy : false,
|
429
|
+
outlined : false,
|
430
|
+
autoHeight : false,
|
431
|
+
contentContainerProps : {style : {backgroundColor:'transparent'}},
|
432
|
+
containerProps : {
|
433
|
+
style : {width : 100,marginLeft:5,paddingVertical:0}
|
434
|
+
},
|
435
|
+
labelProps : {
|
436
|
+
style : {top:0}
|
437
|
+
}
|
438
|
+
}}
|
439
|
+
label = {"Trier par"}
|
440
|
+
items = {sortColumns}
|
441
|
+
defaultValue = {sortedColumn.field}
|
442
|
+
onChange = {({value})=>{
|
443
|
+
setTimeout(()=>{
|
444
|
+
if(isNonNullString(value)){
|
445
|
+
this.sort(value,"asc");
|
440
446
|
}
|
441
|
-
}
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
onPress : this.scrollToTop.bind(this)
|
494
|
-
},
|
495
|
-
!canRenderChart && this.canScrollTo() && {
|
496
|
-
text : 'Aller à la dernière ligne',
|
497
|
-
icon : "arrow-down-bold",
|
498
|
-
onPress : this.scrollToEnd.bind(this)
|
499
|
-
},
|
500
|
-
]}
|
501
|
-
/>
|
502
|
-
</View>
|
503
|
-
{this.renderSectionListMenu()}
|
504
|
-
{this.renderDisplayTypes()}
|
505
|
-
{this.renderAggregatorFunctionsMenu()}
|
506
|
-
{this.renderExportableMenu()}
|
507
|
-
{!canRenderChart ? <RenderType /> : null}
|
508
|
-
{/*filters !== false && <td ><LocalFilter title = {this.props.title} fields ={this.state.columns} onChange={this.onLocalFiltersChange.bind(this)}/></td>*/}
|
447
|
+
},100)
|
448
|
+
}}
|
449
|
+
/>
|
450
|
+
</View> : null}
|
451
|
+
|
452
|
+
{this.isFilterable() ? <View>
|
453
|
+
<FiltersAccordionComponent
|
454
|
+
testID={testID+"_HeaderFilters"}
|
455
|
+
isLoading = {isLoading}
|
456
|
+
filters = {headerFilters}
|
457
|
+
visibleColumns = {visibleColumnsNames}
|
458
|
+
orOperator = {filterOrOperator}
|
459
|
+
andOperator = {filterAndOperator}
|
460
|
+
filteredColumns = {filteredColumns}
|
461
|
+
context = {this}
|
462
|
+
/>
|
463
|
+
</View> : null}
|
464
|
+
<View pointerEvents={pointerEvents} testID={testID+"_HeaderPagination"} style = {styles.paginationItem}>
|
465
|
+
<Menu
|
466
|
+
testID={testID+"_HeaderMenus"}
|
467
|
+
anchor={(props)=>(<Icon {...props} icon={MENU_ICON}/>)}
|
468
|
+
items = {[
|
469
|
+
{
|
470
|
+
text : 'Rafraichir',
|
471
|
+
icon : "refresh",
|
472
|
+
onPress : this.refresh.bind(this)
|
473
|
+
},
|
474
|
+
!canRenderChart && visibleColumns.length ? {
|
475
|
+
text : 'colonnes',
|
476
|
+
icon : "view-column",
|
477
|
+
items : visibleColumns,
|
478
|
+
closeOnPress : false,
|
479
|
+
} : null,
|
480
|
+
!canRenderChart && hasFootersFields ? {
|
481
|
+
onPress : ()=>{this.toggleFooters(!showFooters)}
|
482
|
+
,icon : showFooters?'view-column':'view-module'
|
483
|
+
,text : (showFooters?'Masquer les totaux':'Afficher les totaux')
|
484
|
+
}:null,
|
485
|
+
...this.renderCustomMenu(),
|
486
|
+
...restItems,
|
487
|
+
!canRenderChart && this.canScrollTo() && {
|
488
|
+
text : 'Retour en haut',
|
489
|
+
icon : "arrow-up-bold",
|
490
|
+
onPress : this.scrollToTop.bind(this)
|
491
|
+
},
|
492
|
+
!canRenderChart && this.canScrollTo() && {
|
493
|
+
text : 'Aller à la dernière ligne',
|
494
|
+
icon : "arrow-down-bold",
|
495
|
+
onPress : this.scrollToEnd.bind(this)
|
496
|
+
},
|
497
|
+
]}
|
498
|
+
/>
|
509
499
|
</View>
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
{this.
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
{
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
500
|
+
{this.renderSectionListMenu()}
|
501
|
+
{this.renderDisplayTypes()}
|
502
|
+
{this.renderAggregatorFunctionsMenu()}
|
503
|
+
{this.renderExportableMenu()}
|
504
|
+
{!canRenderChart ? <RenderType /> : null}
|
505
|
+
{/*filters !== false && <td ><LocalFilter title = {this.props.title} fields ={this.state.columns} onChange={this.onLocalFiltersChange.bind(this)}/></td>*/}
|
506
|
+
</View>
|
507
|
+
</ScrollView>
|
508
|
+
</View>
|
509
|
+
return <DatagridProvider context={this}>
|
510
|
+
<View testID={testID+"_Container"} pointerEvents={pointerEvents} style={[styles.container,this.props.style]} collapsable={false}>
|
511
|
+
<View testID={testID+"_AccordionHeader"} style={[styles.accordionHeader]}>
|
512
|
+
{this.canRenderActions() ? <DatagridActions
|
513
|
+
testID={testID+"_Actions"}
|
514
|
+
pointerEvents = {pointerEvents}
|
515
|
+
title = {this.renderDataSourceSelector()}
|
516
|
+
actions = {actions}
|
517
|
+
/> : null}
|
518
|
+
{datagridHeader}
|
519
|
+
{this.renderProgressBar()}
|
520
|
+
{!canRenderChart && showFooters ? (
|
521
|
+
<View testID={testID+"_FooterContainer"} pointerEvents={pointerEvents} style={[theme.styles.justifyContentCenter,theme.styles.pv1]}>
|
522
|
+
<View testID={testID+"_FooterContentContainer"} style={[styles.footersContainer]}>
|
523
|
+
<ScrollView testID={testID+"_FooterScrollView"} horizontal contentContainerStyle={[styles.contentContainerStyle]}>
|
524
|
+
<View testID={testID+"_FooterContent"} style={[styles.table,theme.styles.p1]}>
|
525
|
+
{Object.mapToArray(this.getFooterValues(),(footer,field)=>{
|
526
|
+
return <Footer
|
527
|
+
key = {field}
|
528
|
+
testID={testID+"_FooterItem_"+field}
|
529
|
+
{...footer}
|
530
|
+
abreviate = {this.state.abreviateValues}
|
531
|
+
aggregatorFunction = {this.getActiveAggregatorFunction().code}
|
532
|
+
aggregatorFunctions = {this.aggregatorFunctions}
|
533
|
+
anchorProps = {{style:[theme.styles.ph1,theme.styles.mh05]}}
|
534
|
+
/>
|
535
|
+
})}
|
536
|
+
</View>
|
537
|
+
</ScrollView>
|
542
538
|
</View>
|
543
|
-
|
544
|
-
|
545
|
-
{hasData && !canRenderChart ? <List
|
546
|
-
estimatedItemSize = {150}
|
547
|
-
{...rest}
|
548
|
-
{...accordionProps}
|
549
|
-
prepareItems = {false}
|
550
|
-
onRender = {this.onRender.bind(this)}
|
551
|
-
testID = {testID}
|
552
|
-
extraData = {this.state.refresh}
|
553
|
-
contentInset={{ right: 10, top: 10, left: 10, bottom: 10 }}
|
554
|
-
itemHeight = {undefined}
|
555
|
-
responsive = {defaultBool(this.hasSectionListData()? false : undefined,responsive,rest.responsive,accordionProps.responsive,true)}
|
556
|
-
filter = {filter}
|
557
|
-
getItemType = {this.getFlashListItemType.bind(this)}
|
558
|
-
renderItem = {this.renderItem.bind(this)}
|
559
|
-
items = {this.state.data}
|
560
|
-
isLoading = {isLoading}
|
561
|
-
ref = {(el)=>{
|
562
|
-
this.listRef.current = el;
|
563
|
-
}}
|
564
|
-
style = {[styles.list,rest.style]}
|
565
|
-
backToTopRef = {backToTopRef?(e)=>{
|
566
|
-
return this.backToTopRef.current;
|
567
|
-
}:false}
|
568
|
-
keyExtractor = {this.getRowKey.bind(this)}
|
569
|
-
/> : canRenderChart ?<View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,chartContainerProps.style]}>
|
570
|
-
{this.renderChart()}
|
571
|
-
</View> : <View onRender = {this.onRender.bind(this)} style={styles.hasNotData}>
|
572
|
-
{this.renderEmpty()}
|
573
|
-
</View>}
|
574
|
-
{!canRenderChart && backToTopRef ? <BackToTop testID={testID+"_BackToTop"} {...backToTopProps} ref={this.backToTopRef} style={[styles.backToTop,backToTopProps.style]} onPress={this.scrollToTop.bind(this)}/>:null}
|
575
|
-
<BottomSheet
|
576
|
-
testID = {testID+"_BottomSheet"}
|
577
|
-
renderMenuContent = {false}
|
578
|
-
ref = {(el)=>{
|
579
|
-
this.bottomSheetContext = el;
|
580
|
-
}}
|
581
|
-
/>
|
539
|
+
</View>
|
540
|
+
) : null}
|
582
541
|
</View>
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
542
|
+
{hasData && !canRenderChart ? <List
|
543
|
+
estimatedItemSize = {150}
|
544
|
+
{...rest}
|
545
|
+
{...accordionProps}
|
546
|
+
prepareItems = {false}
|
547
|
+
onRender = {this.onRender.bind(this)}
|
548
|
+
testID = {testID}
|
549
|
+
extraData = {this.state.refresh}
|
550
|
+
contentInset={{ right: 10, top: 10, left: 10, bottom: 10 }}
|
551
|
+
itemHeight = {undefined}
|
552
|
+
responsive = {defaultBool(this.hasSectionListData()? false : undefined,responsive,rest.responsive,accordionProps.responsive,true)}
|
553
|
+
filter = {filter}
|
554
|
+
getItemType = {this.getFlashListItemType.bind(this)}
|
555
|
+
renderItem = {this.renderItem.bind(this)}
|
556
|
+
items = {this.state.data}
|
557
|
+
isLoading = {isLoading}
|
558
|
+
ref = {(el)=>{
|
559
|
+
this.listRef.current = el;
|
560
|
+
}}
|
561
|
+
style = {[styles.list,rest.style]}
|
562
|
+
backToTopRef = {backToTopRef?(e)=>{
|
563
|
+
return this.backToTopRef.current;
|
564
|
+
}:false}
|
565
|
+
keyExtractor = {this.getRowKey.bind(this)}
|
566
|
+
/> : canRenderChart ?<View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,chartContainerProps.style]}>
|
567
|
+
{this.renderChart()}
|
568
|
+
</View> : <View onRender = {this.onRender.bind(this)} style={styles.hasNotData}>
|
569
|
+
{this.renderEmpty()}
|
570
|
+
</View>}
|
571
|
+
{!canRenderChart && backToTopRef ? <BackToTop testID={testID+"_BackToTop"} {...backToTopProps} ref={this.backToTopRef} style={[styles.backToTop,backToTopProps.style]} onPress={this.scrollToTop.bind(this)}/>:null}
|
572
|
+
<BottomSheet
|
573
|
+
testID = {testID+"_BottomSheet"}
|
574
|
+
renderMenuContent = {false}
|
575
|
+
ref = {(el)=>{
|
576
|
+
this.bottomSheetContext = el;
|
577
|
+
}}
|
578
|
+
/>
|
579
|
+
</View>
|
580
|
+
</DatagridProvider>
|
589
581
|
}
|
590
|
-
return clx;
|
591
582
|
}
|
592
|
-
|
583
|
+
|
584
|
+
DatagridAccordionComponent.propTypes = {
|
585
|
+
...Datagrid.propTypes,
|
586
|
+
hasScrollViewParent : PropTypes.bool,//si la liste est rendu dans un ScrollView ie a un parent de type scrollView
|
587
|
+
}
|
593
588
|
const styles = StyleSheet.create({
|
594
589
|
datagridHeader : {
|
595
590
|
width : '100%',
|
@@ -694,15 +689,4 @@ const styles = StyleSheet.create({
|
|
694
689
|
justifyContent : 'center',
|
695
690
|
alignItems : 'center'
|
696
691
|
}
|
697
|
-
})
|
698
|
-
|
699
|
-
|
700
|
-
const DatagridAccordionComponent = DatagridFactory();
|
701
|
-
|
702
|
-
export default DatagridAccordionComponent;
|
703
|
-
|
704
|
-
DatagridAccordionComponent.displayName ="DatagridAccordionComponent";
|
705
|
-
|
706
|
-
export const TableData = DatagridFactory(CommonTableDatagrid);
|
707
|
-
|
708
|
-
TableData.displayName = "DatagridTableDataAccordion";
|
692
|
+
});
|