@fto-consult/expo-ui 6.49.1 → 6.51.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.
@@ -0,0 +1,22 @@
1
+ const {writeFile} = require("./electron/utils");
2
+ const fs = require("fs"), path = require("path");
3
+ module.exports = function({config,transpileModules}){
4
+ transpileModules = Array.isArray(transpileModules)? transpileModules : [];
5
+ if(!transpileModules.includes('@fto-consult')){
6
+ transpileModules.unshift('@fto-consult');
7
+ }
8
+ const transpilePath = path.resolve("./metro-exotic-transformer.js");
9
+ try {
10
+ writeFile(transpilePath,`
11
+ module.exports = require('@expo/metro-config/transformer').createExoticTransformer({
12
+ transpileModules : ${JSON.stringify(transpileModules)},
13
+ })
14
+ `);
15
+ } catch(e) {
16
+ console.log(e," generating metro-exotic-transformer on path ",transpilePath)
17
+ }
18
+ if(fs.existsSync(transpilePath)){
19
+ config.transformer.babelTransformerPath = transpilePath;
20
+ }
21
+ return config;
22
+ }
@@ -0,0 +1,5 @@
1
+ const { createExoticTransformer } = require('@expo/metro-config/transformer');
2
+
3
+ module.exports = createExoticTransformer({
4
+ transpileModules: ['@fto-consult']
5
+ });
package/metro.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require("path");
2
2
  const fs = require("fs");
3
- const { getDefaultConfig } = require('expo/metro-config');
3
+ const { getDefaultConfig } = require('@expo/metro-config');
4
4
  module.exports = function(opts){
5
5
  //require("./create-expo-ui-package");
6
6
  const isDev = 'development' === process.env.NODE_ENV;
@@ -39,6 +39,8 @@ module.exports = function(opts){
39
39
  ...sourceExts,"txt",
40
40
  'jsx', 'js','tsx',
41
41
  ]
42
+ const transpileModules = [...(Array.isArray(opts.transpileModules)? opts.transpileModules : [])];
43
+ require("./create-transpile-module-transformer")({config,transpileModules});
42
44
  // Remove all console logs in production...
43
45
  config.transformer.minifierConfig.compress.drop_console = false;
44
46
  /*config.platforms = Array.isArray(config.platforms) && config.platforms || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.49.1",
3
+ "version": "6.51.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -70,7 +70,7 @@
70
70
  "@expo/html-elements": "^0.5.1",
71
71
  "@expo/vector-icons": "^13.0.0",
72
72
  "@faker-js/faker": "^8.0.2",
73
- "@fto-consult/common": "^3.44.0",
73
+ "@fto-consult/common": "^3.45.2",
74
74
  "@pchmn/expo-material3-theme": "^1.3.1",
75
75
  "@react-native-async-storage/async-storage": "1.18.2",
76
76
  "@react-native-community/datetimepicker": "7.2.0",
@@ -81,7 +81,7 @@
81
81
  "@react-navigation/stack": "^6.3.18",
82
82
  "@shopify/flash-list": "1.4.3",
83
83
  "apexcharts": "^3.42.0",
84
- "expo": "^49.0.11",
84
+ "expo": "^49.0.13",
85
85
  "expo-camera": "~13.4.4",
86
86
  "expo-clipboard": "~4.3.1",
87
87
  "expo-font": "~11.4.0",
@@ -8,7 +8,7 @@ import Auth,{login,getLoginId} from "$cauth";
8
8
  import View from "$ecomponents/View";
9
9
  import { StyleSheet } from "react-native";
10
10
  import defaultTheme,{getColors} from "$theme/defaultTheme";
11
- import theme,{defaultDarkTheme,Colors,defaultLightTheme} from "$theme";
11
+ import theme,{defaultDarkTheme,Colors,defaultLightTheme,lightColors,darkColors} from "$theme";
12
12
  import Provider from "$ecomponents/Form/FormData/DialogProvider";
13
13
  import Dropdown from "$ecomponents/Dropdown";
14
14
  import {defaultObj} from "$cutils";
@@ -16,6 +16,27 @@ import Icon from "$ecomponents/Icon";
16
16
  import {open,close} from "$preloader";
17
17
  import {fields,getThemeData} from "$theme/utils";
18
18
  import {modes} from "$ecomponents/TextField/utils";
19
+ import {createMaterial3Theme,getMaterial3Theme} from "@pchmn/expo-material3-theme";
20
+ import notify from "$cnotify";
21
+
22
+ const mColors = [
23
+ {
24
+ light: '#FFE082',
25
+ dark: '#FFE082',
26
+ },
27
+ {
28
+ light: '#3E8260',
29
+ dark: '#ADF2C7',
30
+ },
31
+ {
32
+ light: '#756FAB',
33
+ dark: '#E5DFFF',
34
+ },
35
+ {
36
+ light: '#9F6C2C',
37
+ dark: '#FDDDB9',
38
+ },
39
+ ]
19
40
 
20
41
  const getStyle = (color)=>{
21
42
  if(!Colors.isValid(color)) return {};
@@ -47,7 +68,26 @@ export const getThemeFieldProps = (props,ref)=>{
47
68
  const userThemeName = defaultStr(userTheme.name,defaultTheme.name);
48
69
  const isDark = theme.isDark() || theme.isDarkUI();
49
70
  const defTheme = isDark ? {...defaultDarkTheme.colors,dark:true} : {...defaultLightTheme.colors,dark:false};
50
- const itemsRef = React.useRef({...defaultObj(user.customThemes),...getColors()});
71
+ const customColors = React.useMemo(()=>{
72
+ const colors = getColors();
73
+ if(false && userThemeName){
74
+ const t = `${userThemeName}`;
75
+ const c = Colors.isValid(defaultTheme?.colors?.primary)? createMaterial3Theme(defaultTheme.colors.primary) : null,
76
+ c2 = Colors.isValid(defaultTheme?.colors.secondary)? createMaterial3Theme(defaultTheme?.colors.secondary) :null;
77
+ ['light','dark'].map((l)=>{
78
+ if(c && c[l]){
79
+ const name = `${t}-primary-${l}`;
80
+ colors[name] = {name,primaryName:userThemeName,secondaryName:`primary-${l}`,...c[l]};
81
+ }
82
+ if(c2 && c2[l]){
83
+ const name2 = `${t}-secondary-${l}`;
84
+ colors[name2] = {name:name2,primaryName:userThemeName,secondaryName:`secondary-${l}`,...c2[l]};
85
+ }
86
+ })
87
+ }
88
+ return colors;
89
+ },[]);
90
+ const itemsRef = React.useRef({...defaultObj(user.customThemes),...customColors});
51
91
  fields.textFieldMode = {
52
92
  type : 'select',
53
93
  items : {...modes,none:{code:'',label:'Dynamique'}},
@@ -90,7 +130,7 @@ export const getThemeFieldProps = (props,ref)=>{
90
130
  }
91
131
  data.custom = true;
92
132
  customThemes[data.name] = data;
93
- itemsRef.current = {...customThemes,...getColors()};
133
+ itemsRef.current = {...customThemes,...customColors};
94
134
  user.customThemes = customThemes;
95
135
  open((isEditing?"Modification ":"Enregistrement ")+"du thème...");
96
136
  Auth.upsertUser(user,false).then(()=>{
@@ -118,7 +158,43 @@ export const getThemeFieldProps = (props,ref)=>{
118
158
  showAdd : typeof showAdd =='boolean'? showAdd : isUserActive || Auth.isTableDataAllowed({table:'users',action:'"changeTheme"'}),
119
159
  addIconTooltip : "Cliquez pour ajouter un nouveau thème",
120
160
  onAdd : ()=>{
121
- showThemeExplorer();
161
+ return Provider.open({
162
+ title : "Ajouter un theme personnalisé",
163
+ fields : {
164
+ color : {
165
+ type :"color",
166
+ text : 'A partir de la couleur',
167
+ required : true,
168
+ },
169
+ name : fields.name,
170
+ dark : fields.dark,
171
+ },
172
+ onSuccess : ({data})=>{
173
+ try {
174
+ const theme = createMaterial3Theme(data.color)
175
+ const dat = {...data,...Object.assign({},(data.dark? theme.dark : theme?.light))};
176
+ dat.text = Colors.isValid(dat.text)? dat.text : dat.onBackground || dat.onSurface;
177
+ const cols = dat.dark ? darkColors : lightColors;
178
+ ["warning","error","info","success","divider"].map((c)=>{
179
+ if(!Colors.isValid(dat[c])){
180
+ dat[c] = cols[c];
181
+ const onKey = `on${c.ucFirst()}`;
182
+ dat[onKey] = dat[onKey] || cols[onKey];
183
+ }
184
+ })
185
+ if(isObj(dat)){
186
+ delete dat.color;
187
+ //Provider.close();
188
+ setTimeout(()=>{
189
+ showThemeExplorer(dat);
190
+ },500);
191
+ }
192
+ } catch(e){
193
+ notify.error(e);
194
+ Provider.close();
195
+ }
196
+ }
197
+ })
122
198
  },
123
199
  onChange : (args)=>{
124
200
  args = defaultObj(args);
@@ -200,7 +200,7 @@ const ChipComponent = React.forwardRef(({
200
200
  // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
201
201
  accessibilityTraits="button"
202
202
  accessibilityComponentType="button"
203
- role="button"
203
+ //role="button"
204
204
  accessibilityLabel={closeIconAccessibilityLabel}
205
205
  testID={testID+"_CloseButtonRipple"}
206
206
  >
@@ -69,7 +69,7 @@ const ColorPickerComponent = React.forwardRef ((props,ref)=>{
69
69
  return <>
70
70
  <Pressable
71
71
  {...containerProp}
72
- role="button"
72
+ //role="button"
73
73
  disabled = {!isEditable}
74
74
  pointerEvents = {pointerEvents}
75
75
  accessibilityLabel={defaultStr(label,text)}
@@ -261,12 +261,7 @@ const DatagridFactory = (Factory)=>{
261
261
  getMaxSelectedRows(){
262
262
  return isMobileMedia()? 30 : 50;
263
263
  }
264
- toggleFilterColumnVisibility(field,visible){
265
- if(!isNonNullString(field)) return;
266
- let filteredColumns = {...this.state.filteredColumns};
267
- filteredColumns[field] = visible;
268
- this.setSessionData("filteredColumns"+this.getSessionNameKey(),filteredColumns);
269
- }
264
+
270
265
  /*** affiche les infos de l'item */
271
266
  onToggleExpandItem({item,index,rowIndex,rowKey,...rest}){
272
267
  if(!isObj(this.bottomSheetContext) || typeof this.bottomSheetContext.open !=='function') return;
@@ -410,7 +405,7 @@ const DatagridFactory = (Factory)=>{
410
405
  visibleColumnsNames,
411
406
  filteredColumns,
412
407
  filters :headerFilters,
413
- } = this.preparedColumns;
408
+ } = this.getPreparedColumns();
414
409
  const hasFootersFields = this.hasFootersFields();
415
410
  const datagridHeader = <View testID={testID+"_HeaderContainer"} pointerEvents={pointerEvents} style={[styles.datagridHeader]}>
416
411
  <ScrollView testID={testID+"_HeaderScrollView"} horizontal contentContainerStyle={StyleSheet.flatten([styles.contentContainerStyle,styles.minW100])}>
@@ -1188,11 +1188,11 @@ export default class CommonDatagridComponent extends AppComponent {
1188
1188
  return defaultStr(this.props.table,this.props.tableName,this.props.sessionName);
1189
1189
  }
1190
1190
  /*** affiche ou masque une colonne filtrée */
1191
- toggleFilterColumnVisibility(field){
1191
+ toggleFilterColumnVisibility1(field){
1192
1192
  if(!isNonNullString(field)) return;
1193
1193
  setTimeout(()=>{
1194
1194
  this.setIsLoading(true,()=>{
1195
- let filteredColumns = {...this.state.filteredColumns};
1195
+ const filteredColumns = {...this.state.filteredColumns};
1196
1196
  filteredColumns[field] = defaultBool(filteredColumns[field],false) == false ? true : false;
1197
1197
  this.prepareColumns({filteredColumns});
1198
1198
  this.setState({filteredColumns},()=>{
@@ -1204,8 +1204,16 @@ export default class CommonDatagridComponent extends AppComponent {
1204
1204
  }
1205
1205
  });
1206
1206
  },true)
1207
- },TIMEOUT)
1207
+ },TIMEOUT);
1208
+ }
1209
+ toggleFilterColumnVisibility(field,visible){
1210
+ if(!isNonNullString(field)) return;
1211
+ const filteredColumns = {...this.state.filteredColumns};
1212
+ filteredColumns[field] = visible;
1213
+ this.setSessionData("filteredColumns"+this.getSessionNameKey(),filteredColumns);
1214
+ return visible;
1208
1215
  }
1216
+
1209
1217
  /*** affiche ou masque une colonne
1210
1218
  @param {string} field
1211
1219
  */
@@ -2370,7 +2378,7 @@ export default class CommonDatagridComponent extends AppComponent {
2370
2378
  return this.state.showFooters || this.hasSectionListData() && this.state.displayOnlySectionListHeaders;
2371
2379
  }
2372
2380
  canShowFilters(){
2373
- return this.state.showFilters
2381
+ return this.isFilterable() && this.state.showFilters
2374
2382
  }
2375
2383
  toggleDisplayOnlySectionListHeaders(){
2376
2384
  if(!this.canDisplayOnlySectionListHeaders()) return
@@ -2718,6 +2726,9 @@ export default class CommonDatagridComponent extends AppComponent {
2718
2726
  isValidRowKey(rowKey){
2719
2727
  return !!(isNonNullString(rowKey) || typeof rowKey =='number');
2720
2728
  }
2729
+ getPreparedColumns(){
2730
+ return this.preparedColumns;
2731
+ }
2721
2732
  prepareData(args,cb){
2722
2733
  let {pagination,config,aggregatorFunction:customAggregatorFunction,displayOnlySectionListHeaders:cdisplayOnlySectionListHeaders,data,force,sectionListColumns,sectionListCollapsedStates,updateFooters} = defaultObj(args);
2723
2734
  cb = typeof cb ==='function'? cb : typeof args.cb == 'function'? args.cb : undefined;
@@ -2962,7 +2973,7 @@ export default class CommonDatagridComponent extends AppComponent {
2962
2973
  const footer = footers[column];
2963
2974
  const canD = renderSectionListHeaderOnFirstCell && !hasAlreadRenderMainHeaderOnFirstCell;
2964
2975
  const cProps = canD ? sectionListHeaderContainerProps : {};
2965
- cells.push(<Cell {...cellProps} {...cProps} key={key2} width={width} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,!isA?{alignItems:'flex-start',justifyContent:'flex-start'}:{marginLeft:0,paddingLeft:0,marginRight:5},cellProps.style,cProps.style]}>
2976
+ cells.push(<Cell {...cellProps} {...cProps} key={key2} width={width} testID={testID+"_FooterCellContainer_"+key2} style={[tableStyles.headerItemOrCell,!isA?{alignItems:'flex-start',justifyContent:'flex-start'}:{marginLeft:0,paddingLeft:0,marginRight:5,paddingTop:5,paddingBottom:5},cellProps.style,cProps.style]}>
2966
2977
  {canD ? headerContent:null}
2967
2978
  <Footer
2968
2979
  key = {key2}
@@ -0,0 +1,7 @@
1
+ import React from "$react";
2
+ import View from "$ecomponents/View";
3
+ import Label from "$ecomponents/Label";
4
+
5
+ export default function DatagridTableFilterComponent({}){
6
+ return null;
7
+ }
@@ -0,0 +1,27 @@
1
+
2
+ import Icon from "$ecomponents/Icon";
3
+ import Menu from "$ecomponents/Menu";
4
+ import { useDatagrid } from "./hooks";
5
+ import React from "$react";
6
+ import { getMenuStyle } from "./styles";
7
+
8
+ export default function DatagridTableFilterMenuComponent({filterKey,filteredColumns,context,...props}){
9
+ const cVisible = !!filteredColumns[filterKey];
10
+ const [visible,setVisible] = React.useState(cVisible);
11
+ React.useEffect(()=>{
12
+ if(false && visible !== cVisible){
13
+ setVisible(cVisible);
14
+ }
15
+ },[cVisible])
16
+ return <Menu.Item
17
+ {...props}
18
+ icon = {visible ? "check" : null}
19
+ onPress={(e)=>{
20
+ const nVisible = context?.toggleFilterColumnVisibility? context.toggleFilterColumnVisibility(filterKey,!!!filteredColumns[filterKey]) : visible;
21
+ if(nVisible !== visible){
22
+ setVisible(nVisible);
23
+ }
24
+ }}
25
+ />
26
+ return null;
27
+ }
@@ -0,0 +1,71 @@
1
+ import React from "$react";
2
+ import View from "$ecomponents/View";
3
+ import {defaultStr,defaultBool,defaultArray,isObj} from "$cutils";
4
+ import theme from "$theme";
5
+ import { StyleSheet,ScrollView } from "react-native";
6
+ import Label from "$ecomponents/Label";
7
+ import Filter from "./Filter";
8
+ import FiltersMenu from "./FiltersMenu";
9
+ import FilterMenu from "./FilterMenu";
10
+ import {useDatagrid} from "./hooks";
11
+
12
+ export default function DatagridTableFiltersComponent({orOperator,andOperator,testID}){
13
+ testID = defaultStr(testID,"RN_DatagridTableFiltersComponent")
14
+ const {visible,isLoading,visibleColumnsNames,filters,filteredColumns,context} = useDatagrid();
15
+ const valuesRefs = React.useRef({});
16
+ const filteredRef = React.useRef({});
17
+ const {content,colMenus} = React.useStableMemo(()=>{
18
+ const content = [];
19
+ Object.map(filters,(filter,index)=>{
20
+ if(isObj(filter)){
21
+ const {onChange,filter:isFiltered,...rest} = filter;
22
+ if(isFiltered === false) return null;
23
+ const key = defaultStr(filter.key,filter.field,filter.columnField,filter.index,index+"");
24
+ content.push(<Filter
25
+ {...rest}
26
+ {...(isObj(valuesRefs.current[key]) ? valuesRefs.current[key] : {})}
27
+ dynamicRendered
28
+ orOperator = {defaultBool(orOperator,filter.orOperator,true)}
29
+ andOperator = {defaultBool(andOperator,filter.andOperator,true)}
30
+ onChange = {(arg)=>{
31
+ if(!arg.action && !arg.operator || !arg.field) return;
32
+ const canHandle = canHandleFilter(arg);
33
+ valuesRefs.current[key] = arg;
34
+ if(filteredRef.current[key] !== canHandle){
35
+ if(canHandle){
36
+ canHandlerFilterRef.current++;
37
+ } else {
38
+ canHandlerFilterRef.current = Math.max(0,canHandlerFilterRef.current-1);
39
+ }
40
+ }
41
+ filteredRef.current[key] = canHandle;
42
+ if(onChange){
43
+ onChange(arg);
44
+ }
45
+ }}
46
+ />)
47
+ }
48
+ })
49
+ return {content};
50
+ },[filters])
51
+ return <ScrollView horizontal testID={testID+"_FiltersScrollView"}>
52
+ <View testID={testID} style = {[theme.styles.row,styles.container,theme.styles.rowWrap,theme.styles.justifyStart,theme.styles.alignItemsCenter]}>
53
+ {<FiltersMenu/>}
54
+ {content}
55
+ </View>
56
+ </ScrollView>
57
+ }
58
+
59
+ const styles = StyleSheet.create({
60
+ hidden : {
61
+ opacity : 0,
62
+ display : "none",
63
+ },
64
+ container : {
65
+ paddingLeft : 10,
66
+ paddingRight : 10,
67
+ },
68
+ isLoading : {
69
+ pointerEvents : "none",
70
+ },
71
+ });
@@ -0,0 +1,45 @@
1
+ import Menu from "$ecomponents/Menu";
2
+ import Icon from "$ecomponents/Icon";
3
+ import { useDatagrid } from "./hooks";
4
+ import {Pressable} from "react-native";
5
+ import {defaultStr} from "$cutils";
6
+ import theme from "$theme";
7
+ import Label from "$ecomponents/Label";
8
+ import React from "$react";
9
+ import { getMenuStyle } from "./styles";
10
+
11
+ export default function DatagridFiltersMenuComponent({testID,...props}){
12
+ const {filteredColumns,filterableColumnsNames,...rest} = useDatagrid();
13
+ const isFiltered = !!Object.size(filteredColumns,true);
14
+ testID = defaultStr(testID,"RN_DatagridFiltersMenuComponent")
15
+ console.log(props," is props heeein");
16
+ const items = React.useStableMemo(()=>{
17
+ const items = [];
18
+ console.log(rest," is ressss",filterableColumnsNames);
19
+ Object.map(filterableColumnsNames,(field)=>{
20
+
21
+ });
22
+ return;
23
+ colMenus.push(<FilterMenu
24
+ key = {key}
25
+ filterKey={key}
26
+ {...filter}
27
+ context={context}
28
+ filteredColumns={filteredColumns}
29
+ />)
30
+ },[filterableColumnsNames]);
31
+ return <Menu
32
+ testID={testID}
33
+ {...props}
34
+ anchor={(p)=>{
35
+ return <Pressable {...p} testID={testID+"_FilterPressableContainer"} style={[theme.styles.row,theme.styles.justifyContentStart,theme.styles.alignItemsCenter,getMenuStyle()]}>
36
+ <Icon
37
+ name={isFiltered?"filter-menu":"filter-plus"}
38
+ primary = {isFiltered}
39
+ size={20}
40
+ />
41
+ <Label primary={isFiltered} textBold={isFiltered}>Filtres</Label>
42
+ </Pressable>
43
+ }}
44
+ />
45
+ }
@@ -0,0 +1,8 @@
1
+ import { useDatagrid as ud } from "../hooks";
2
+ export const useDatagrid = ()=>{
3
+ const {context} = ud();
4
+ const visible = context && typeof context?.canShowFilters =='function' && context.canShowFilters()|| false;
5
+ const isLoading = context && context.isLoading() || false;
6
+ const r = typeof context?.getPreparedColumns =='function'? context?.getPreparedColumns() : {};
7
+ return {...r,visible,isLoading,context};
8
+ }
@@ -15,6 +15,7 @@ import Footer from "../Footer/Footer";
15
15
  import theme from "$theme";
16
16
  import Table,{styles as tableStyles} from "$ecomponents/Table";
17
17
  import DatagridProvider from "../hooks/Provider";
18
+ import Filters from "./Filters";
18
19
 
19
20
 
20
21
  const DatagridFactory = (Factory)=>{
@@ -114,6 +115,7 @@ const DatagridFactory = (Factory)=>{
114
115
  this.listRef.current.scrollToIndex({index});
115
116
  }
116
117
  }
118
+
117
119
  getTestID(){
118
120
  return defaultStr(this.props.testID,"RN_DatagridTable");
119
121
  }
@@ -288,9 +290,7 @@ const DatagridFactory = (Factory)=>{
288
290
  </View> : null;
289
291
  return <DatagridProvider context={this}>
290
292
  <View style={[styles.container,{flex:1}]} testID={testID+"_TableContainer"} pointerEvents={pointerEvents}>
291
- <View ref={(el)=>{
292
- this.layoutRef.current = el;
293
- }} testID={testID+"_LayoutContainer"}>
293
+ <View ref={(el)=>{this.layoutRef.current = el;}} testID={testID+"_LayoutContainer"}>
294
294
  {this.props.showActions !== false ? <DatagridActions
295
295
  pointerEvents = {pointerEvents}
296
296
  title = {this.renderDataSourceSelector()}
@@ -298,6 +298,11 @@ const DatagridFactory = (Factory)=>{
298
298
  /> : null}
299
299
  {rPagination}
300
300
  {progressBar}
301
+ <Filters
302
+ testID={testID+"_DatagridTableHeaderFilters"}
303
+ orOperator = {this.props.filterOrOperator}
304
+ andOperator = {this.props.filterAndOperator}
305
+ />
301
306
  </View>
302
307
  {canRenderChart ?
303
308
  <View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,chartContainerProps.style]}>
@@ -315,7 +320,7 @@ const DatagridFactory = (Factory)=>{
315
320
  renderItem = {this.renderFlashListItem.bind(this)}
316
321
  renderSectionHeader = {this.renderFlashListItem.bind(this)}
317
322
  hasFooters = {hasFootersFields && !canRenderChart ? true : false}
318
- showFilters = {showFilters}
323
+ showFilters = {false}
319
324
  showFooters = {showFooters && !canRenderChart ? true : false}
320
325
  showHeaders = { canRenderChart ? !!showFilters : true}
321
326
  headerCellContainerProps = {{
@@ -335,7 +340,7 @@ const DatagridFactory = (Factory)=>{
335
340
  data = {this.state.data}
336
341
  footers = {this.getFooterValues()}
337
342
  renderHeaderCell={this.renderHeaderCell.bind(this)}
338
- renderFilterCell={this.renderFilterCell.bind(this)}
343
+ //renderFilterCell={this.renderFilterCell.bind(this)}
339
344
  renderFooterCell={this.renderFooterCell.bind(this)}
340
345
  renderEmpty = {this.renderEmpty.bind(this)}
341
346
  />}
@@ -0,0 +1,16 @@
1
+ import { StyleSheet } from "react-native";
2
+ import theme from '$theme';
3
+
4
+ const styles = StyleSheet.create({
5
+ menuItem : {
6
+ borderRadius : 10,
7
+ }
8
+ });
9
+
10
+ export const getMenuStyle = (style)=>([
11
+ styles.menuItem,
12
+ {backgroundColor:theme.surfaceBackground},
13
+ style,
14
+ ]);
15
+
16
+ export default styles;
@@ -110,7 +110,7 @@ const ExpandableComponent = React.forwardRef(({
110
110
  borderless = {false}
111
111
  accessibilityTraits="button"
112
112
  accessibilityComponentType="button"
113
- role="button"
113
+ //role="button"
114
114
  style={[styles.container,props.style]}
115
115
  onPress={handlePressAction}
116
116
  onLongPress={onLongPress}
@@ -174,7 +174,7 @@ const FABGroup = ({
174
174
  // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
175
175
  accessibilityTraits="button"
176
176
  accessibilityComponentType="button"
177
- role="button"
177
+ //role="button"
178
178
  accessibilityState={{ expanded: open }}
179
179
  style={StyleSheet.flatten([styles.fab, fabStyle])}
180
180
  visible={visible}
@@ -310,7 +310,7 @@ const _FabItem = function({children,label,disabled:customDisabled,pointerEvents,
310
310
  }
311
311
  accessibilityTraits="button"
312
312
  accessibilityComponentType="button"
313
- role="button"
313
+ //role="button"
314
314
  >
315
315
  <Text testID={testID+"_Label"} style={StyleSheet.flatten([{ color},cursorStyle])}>
316
316
  {label}
@@ -345,7 +345,7 @@ const _FabItem = function({children,label,disabled:customDisabled,pointerEvents,
345
345
  // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
346
346
  accessibilityTraits="button"
347
347
  accessibilityComponentType="button"
348
- role="button"
348
+ //role="button"
349
349
  testID={testID}
350
350
  visible={open}
351
351
  />
@@ -60,9 +60,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,ge
60
60
  }
61
61
  const isMounted = React.useIsMounted();
62
62
 
63
- const [state,setState] = React.useState({
64
- items : [],
65
- });
63
+ const [stateItems,setItems] = React.useState([]);
66
64
  const [isLoading,setIsLoading] = React.useState(true);
67
65
  fetchOptions = Object.clone(defaultObj(fetchOptions));
68
66
  const queryPath = fetchItemsPath || typeof fKeyTable.queryPath =='string' && fKeyTable.queryPath || typeof fKeyTable.fetchPath =='string' && fKeyTable.fetchPath || '';
@@ -185,7 +183,7 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,ge
185
183
  }
186
184
  }
187
185
  }
188
- setState({...state,items});
186
+ setItems(items);
189
187
  if(onFetchItems){
190
188
  onFetchItems({data:items,items,context,props});
191
189
  }
@@ -256,9 +254,9 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,isStructData,ge
256
254
  },[isFilter,foreignKeyTable,customShowAdd]);
257
255
  return <Dropdown
258
256
  {...props}
257
+ items = {stateItems}
259
258
  isFilter = {isFilter}
260
259
  showAdd = {showAdd}
261
- {...state}
262
260
  isLoading = {isLoading}
263
261
  dialogProps = {dialogProps}
264
262
  ref = {ref}
@@ -19,7 +19,7 @@ export default function Logo (props) {
19
19
  if(LogoComponent){
20
20
  hasTwice = React.isComponent(LogoComponent.Image) && React.isComponent(LogoComponent.Text);
21
21
  if(!hasTwice){
22
- logoImage = React.isValidElement(LogoComponent)? LogoComponent : React.isComponent(LogoComponent)? <LogoComponent {...props} style={styles.logoContent} testID={testID+"_Content"} styles={styles}/> : null;
22
+ logoImage = React.isValidElement(LogoComponent)? LogoComponent : React.isComponent(LogoComponent)? <LogoComponent {...props} style={[styles.logoContent,props.style]} testID={testID+"_Content"} styles={styles}/> : null;
23
23
  } else {
24
24
  img = icon !== false ? <View testID={testID+"_ContentContainer"} style={styles.logoImage}>
25
25
  <LogoComponent.Image styles={styles}/>
@@ -474,7 +474,7 @@ class _Menu extends AppComponent {
474
474
  {rendered ? <TouchableWithoutFeedback
475
475
  testID={testID+"_Menu_TouchableWithoutFeedBack"}
476
476
  accessibilityLabel={overlayAccessibilityLabel}
477
- role="button"
477
+ //role="button"
478
478
  onPress={onDismiss}
479
479
  style = {[hiddenStyle]}
480
480
  >
@@ -122,7 +122,7 @@ const ModalComponent = React.forwardRef((props,ref)=>{
122
122
  >
123
123
  <TouchableWithoutFeedback
124
124
  accessibilityLabel={overlayAccessibilityLabel}
125
- role="button"
125
+ //role="button"
126
126
  disabled={!dismissable}
127
127
  onPress={dismissable ? hideModal : undefined}
128
128
  importantForAccessibility="no"
@@ -163,7 +163,7 @@ export default function PhoneInputComponent(props){
163
163
  pointerEvents = {pointerEvents}
164
164
  left = {
165
165
  <Pressable testID={testID+"_Left"} style={[styles.flag,disabledStyle,!isFlatMode && styles.notFlatModeFlag]}
166
- role="button"
166
+ //role="button"
167
167
  disabled = {props.disabled}
168
168
  pointerEvents = {pointerEvents}
169
169
  onPress={onPressFlag}
@@ -278,7 +278,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
278
278
  const autoFocus = canAutoFocusSearchField({visible,items:renderingItems});
279
279
  testID = defaultStr(testID, "RN_SimpleSelectComponent");
280
280
  anchor = <Pressable
281
- role="button"
281
+ //role="button"
282
282
  activeOpacity={0.3}
283
283
  testID = {testID}
284
284
  {...defaultObj(anchorContainerProps)}
@@ -24,10 +24,9 @@ import { prepareScreens } from "./TableData";
24
24
  handleHelpScreen : {boolean}, //si l'écran d'aide sera pris en compte, l'écran d'aide ainsi que les écrans des termes d'utilisations et autres
25
25
  convertFiltersToSQL : {boolean}, si les filtres de datagrid ou filtres seront convertis au format SQL
26
26
  components : {
27
- logo : {
28
- object |
29
- ReactNode,
30
- ReactComponent
27
+ logo : ReactNode | ReactComponent | object {
28
+ image{ReactComponent} :,
29
+ text {ReactComponent}
31
30
  },
32
31
  loginPropsMutator : ({object})=><{object}>, la fonction permettant de muter les props du composant Login,
33
32
  tableLinkPropsMutator : ({object})=><{object}>, la fonction permettant de muter les props du composant TableLink,
@@ -1 +1 @@
1
- module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.49.0","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.44.0","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.8","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.14","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@react-navigation/stack":{"version":"6.3.18","url":"https://reactnavigation.org/docs/stack-navigator/","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.42.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.11","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.4","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sqlite":{"version":"11.3.3","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"is-plain-obj":{"version":"4.1.0","license":"MIT"},"js-base64":{"version":"3.7.5","license":"BSD-3-Clause"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.5","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.10.6","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.19.7","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.9","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.6.0","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"4.1.1","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"uninstall":{"version":"0.0.0","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};
1
+ module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.49.2","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.44.0","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.8","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.14","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@react-navigation/stack":{"version":"6.3.18","url":"https://reactnavigation.org/docs/stack-navigator/","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.42.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.13","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.4","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sqlite":{"version":"11.3.3","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"is-plain-obj":{"version":"4.1.0","license":"MIT"},"js-base64":{"version":"3.7.5","license":"BSD-3-Clause"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.5","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.10.6","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.19.7","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.9","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.6.0","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"2.1.0","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"uninstall":{"version":"0.0.0","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};