@fto-consult/expo-ui 6.42.1 → 6.42.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
CHANGED
@@ -189,7 +189,7 @@ const DatagridFactory = (Factory)=>{
|
|
189
189
|
return null;
|
190
190
|
}
|
191
191
|
const rowKey = defaultVal(args.rowIndex,args.index,args.rowCounterIndex);
|
192
|
-
return <View {...rowProps} testID={defaultStr(rowProps.testID,"RNDatagridAccordionSectionHeader")+rowKey} style={[theme.styles.w100,theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,rowProps.style,rowStyle]}>
|
192
|
+
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]}>
|
193
193
|
{it}
|
194
194
|
</View>;
|
195
195
|
}
|
@@ -2984,7 +2984,7 @@ export default class CommonDatagridComponent extends AppComponent {
|
|
2984
2984
|
}
|
2985
2985
|
return <View testID={testID+"_ContentContainer"} style={[theme.styles.w100,isA && this.state.displayOnlySectionListHeaders && {borderTopColor:theme.colors.divider,borderTopWidth:1},isA ? [theme.styles.ph2,theme.styles.pt1] : [theme.styles.pt1,theme.styles.noPadding,theme.styles.noMargin],theme.styles.justifyContentCenter,theme.styles.alignItemsCenter,theme.styles.pb1,!cells && theme.styles.ml1,theme.styles.mr1,cStyle]}>
|
2986
2986
|
{headerContent}
|
2987
|
-
{cells ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,isA && theme.styles.pt1,theme.styles.alignItemsFlexStart,this.isAccordion() && theme.styles.rowWrap]}
|
2987
|
+
{cells.length ? <View testID={testID+"_TableRow"} style = {[theme.styles.w100,theme.styles.row,isA && theme.styles.pt1,theme.styles.alignItemsFlexStart,this.isAccordion() && theme.styles.rowWrap]}
|
2988
2988
|
>{cells}</View> : null}
|
2989
2989
|
</View>
|
2990
2990
|
}
|
@@ -152,6 +152,12 @@ const VirtuosoListComponent = React.forwardRef(({onRender,id,fixedHeaderContent,
|
|
152
152
|
},
|
153
153
|
defaultItemHeight : typeof estimatedItemSize=='number' && estimatedItemSize || undefined,
|
154
154
|
};
|
155
|
+
const getItemData = (index)=>{
|
156
|
+
if(typeof index =='number'){
|
157
|
+
return context.items[index] || null;
|
158
|
+
}
|
159
|
+
return null;
|
160
|
+
}
|
155
161
|
return <View {...containerProps} {...props} id={containerId} className={classNames("virtuoso-list-container",renderTable&& "virtuoso-list-container-render-table")} style={[{flex:1},containerProps.style,style,autoSizedStyle,{minWidth:'100%',height:'100%',maxWidth:'100%'}]} onLayout={onLayout} testID={testID}>
|
156
162
|
<Component
|
157
163
|
{...r2}
|
@@ -178,7 +184,7 @@ const VirtuosoListComponent = React.forwardRef(({onRender,id,fixedHeaderContent,
|
|
178
184
|
if(!renderTable) return;
|
179
185
|
}}
|
180
186
|
components = {{
|
181
|
-
Item : renderTable ? undefined : responsive ? function(props){return <ItemContainer {...props} style={[itemProps.style,props.style]} numColumns={numColumns}/>} : undefined,
|
187
|
+
Item : renderTable ? undefined : responsive ? function(props){return <ItemContainer {...props} getItemData={getItemData} style={[itemProps.style,props.style]} numColumns={numColumns}/>} : undefined,
|
182
188
|
...(renderTable ? {
|
183
189
|
TableRow: TableRowComponent,
|
184
190
|
}:{}),
|
@@ -243,17 +249,19 @@ const normalizeEvent = (e)=>{
|
|
243
249
|
};
|
244
250
|
}
|
245
251
|
|
246
|
-
function ItemContainer({numColumns,responsive,windowWidth,...props}){
|
252
|
+
function ItemContainer({numColumns,getItemData,responsive,windowWidth,...props}){
|
253
|
+
const dataIntex = "index" in props ? props.index : "data-index" in props ? props["data-index"] : ""
|
254
|
+
const item = getItemData(dataIntex);
|
247
255
|
const width = React.useMemo(()=>{
|
256
|
+
if(item?.isSectionListHeader) return "100%";
|
248
257
|
if(!numColumns || numColumns <= 1) return undefined;
|
249
258
|
if(typeof windowWidth =='number' && windowWidth <=600) return "100%";
|
250
259
|
if(Dimensions.isMobileMedia()){
|
251
260
|
return "100%";
|
252
261
|
}
|
253
262
|
return (100/numColumns)+"%";
|
254
|
-
},[windowWidth,numColumns]);
|
263
|
+
},[windowWidth,numColumns,item?.isSectionListHeader]);
|
255
264
|
const style = width && {width} || grid.col(windowWidth);
|
256
|
-
const dataIntex = "index" in props ? props.index : "data-index" in props ? props["data-index"] : ""
|
257
265
|
const dataItemIndex = "data-item-index" in props ? props["data-item-index"] : "";
|
258
266
|
if(isObj(style)){
|
259
267
|
style.paddingRight = style.paddingLeft = style.paddingHorizontal = undefined;
|