@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.
@@ -147,7 +147,7 @@ class DropdownComponent extends AppComponent {
147
147
  nState = defaultObj(nState);
148
148
  //this.countEee = defaultNumber(this.countEee)+1;
149
149
  if(!("selectedText" in nState)){
150
- nState.selectedText = this.getSelectedText(nState.selected,nState.selectedValuesKeys);
150
+ nState.selectedText = this.getSelectedText(nState);
151
151
  }
152
152
  const previousSelected = this.state.selected;
153
153
  const prevValueKey = this.getValueKey(previousSelected);
@@ -290,11 +290,19 @@ class DropdownComponent extends AppComponent {
290
290
  content,
291
291
  }
292
292
  }
293
- getSelectedText (selectedValues,selectedValuesKeys,valuesKeys){
293
+ /****
294
+ @param {object {
295
+ selected, la nouvelle valeur sélectionnée
296
+ selectedKeys {object}, les clés des valeurs sélectionnées
297
+
298
+ }}
299
+ */
300
+ getSelectedText (opts){
301
+ if(!isObj(opts)) return this.state.selectedText;
302
+ let selectedValues = "selected" in opts ? opts.selected : this.state.selected;
303
+ let selectedValuesKeys = isObj(opts.selectedValuesKeys) ? opts.selectedValuesKeys : isObj(this.state.selectedValuesKeys) ? this.state.selectedValuesKeys: {};
304
+ const valuesKeys = isObj(opts.valuesKeys) && Object.size(opts.valuesKeys,true)? opts.valuesKeys : isObj(this.state.valuesKeys)? this.state.valuesKeys: {};
294
305
  let counter = 0,sDText = "";
295
- selectedValuesKeys = isObj(selectedValuesKeys)? selectedValuesKeys : isObj(this.state.selectedValuesKeys) ? this.state.selectedValuesKeys: {};
296
- selectedValues = selectedValues !== undefined ? selectedValues : this.state.selected;
297
- valuesKeys = isObj(valuesKeys) && Object.size(valuesKeys,true)? valuesKeys : isObj(this.state.valuesKeys)? this.state.valuesKeys: {};
298
306
  const maxCount = MAX_SELECTED_ITEMS;
299
307
  for(let valueKey in selectedValuesKeys){
300
308
  if(isObj(valuesKeys[valueKey])){
@@ -391,7 +399,7 @@ class DropdownComponent extends AppComponent {
391
399
  data.push(item);
392
400
  keys.push(key);
393
401
  });
394
- return ({selected,selectedValuesKeys,currentSelected,selectedText:this.getSelectedText(selected,selectedValuesKeys,valuesKeys),valuesKeys,nodes,valuesKeys,data,keys,initialized:true});
402
+ return ({selected,selectedValuesKeys,currentSelected,selectedText:this.getSelectedText({selected,selectedValuesKeys,valuesKeys}),valuesKeys,nodes,valuesKeys,data,keys,initialized:true});
395
403
  }
396
404
  getDefaultValue(){
397
405
  return this.state.currentSelected;
@@ -446,14 +454,14 @@ class DropdownComponent extends AppComponent {
446
454
 
447
455
  selectAll (){
448
456
  if(!this.canHandleMultiple()) return;
449
- const newSelected = [],selectedValuesKeys={};
457
+ const selected = [],selectedValuesKeys={};
450
458
  this.state.data.map((item,_index)=>{
451
459
  const key = this.keysRefs[_index];
452
460
  if(!this.state.nodes[key]) return;
453
- newSelected.push(this.state.nodes[key].value);
461
+ selected.push(this.state.nodes[key].value);
454
462
  selectedValuesKeys[this.state.nodes[key].valueKey] = true;
455
463
  });
456
- this.updateSelected({selected:newSelected,selectedValuesKeys,selectedText:this.getSelectedText(newSelected,selectedValuesKeys)});
464
+ this.updateSelected({selected,selectedValuesKeys,selectedText:this.getSelectedText({selected,selectedValuesKeys})});
457
465
  }
458
466
  unselectAll() {
459
467
  if(!this.canHandleMultiple()) return;
@@ -664,6 +672,7 @@ class DropdownComponent extends AppComponent {
664
672
  const {items,defaultValue,selected} = nextProps;
665
673
  const isFunc = typeof nextProps.items == "function";
666
674
  if(nextProps.isLoading === true) return;
675
+ const isThirdParty = this.props.name == "thirdParty";
667
676
  if(isFunc || !React.areEquals(items,this.props.items)){
668
677
  const nState = this.prepareItems({items,defaultValue,selected});
669
678
  return this.updateSelected(nState,!isFunc);
@@ -707,7 +716,7 @@ class DropdownComponent extends AppComponent {
707
716
  this.updateSelected({
708
717
  selectedValuesKeys,
709
718
  selected:newSelected,
710
- selectedText : this.getSelectedText(newSelected,selectedValuesKeys)
719
+ selectedText : this.getSelectedText({selected:newSelected,selectedValuesKeys})
711
720
  });
712
721
  }
713
722
  isVisible(){
@@ -909,6 +918,7 @@ class DropdownComponent extends AppComponent {
909
918
  error = error || this.hasNoValidSelectedValue() || false;
910
919
  if(error && selectedText && (!helperText || !React.isValidElement(helperText,true))){
911
920
  helperText = `Ce champ admet des valeurs par défaut invalide où innexistant dans la liste des éléments à sélectionner`;
921
+ console.warn("dropdown has invalid value for items ",error,", selectedText = ",selectedText," selected from state = ",this.state.selected,", state is ",this.state,", props is ",this.props);
912
922
  }
913
923
  helperText = <HelperText disabled={disabled} error={error}>{helperText}</HelperText>
914
924
  let labelTextField = defaultVal(label,text);
@@ -25,6 +25,7 @@ import i18n from "$i18n";
25
25
  import fetch from "$capi/fetch";
26
26
  import appConfig from "$capp/config";
27
27
  import {Vertical} from "$ecomponents/AutoSizer";
28
+ import {printTableData} from "$epdf";
28
29
 
29
30
 
30
31
  const HIDE_PRELOADER_TIMEOUT = 300;
@@ -566,6 +567,9 @@ export default class TableDataScreenComponent extends FormDataScreen{
566
567
  return true;
567
568
  }
568
569
  isPrintable(){
570
+ if(typeof this.props.printable ==='function'){
571
+ return !!this.props.printable({context:this,tableName:this.getTableName(),isTableData:true,table:this.getTableName()})
572
+ }
569
573
  return !!(this.props.printable);
570
574
  }
571
575
  /*** retourne la liste des valeurs de clé primarire associés à la table data pour la données en cours de modification
@@ -596,10 +600,11 @@ export default class TableDataScreenComponent extends FormDataScreen{
596
600
  print(data){
597
601
  if(!this.isPrintable()) return;
598
602
  data = this.isDocEditing(data)? data : isObj(data) && this.isDocEditing(data.data)? data.data : {};
603
+ const opts = {tableName:this.getTableName(),table:this.getTableName(),isTableData:true,fromTableData:true,context:this};
599
604
  if(typeof this.props.print ==='function'){
600
- return this.props.print.call(this,data);
601
- }
602
- return data;
605
+ return this.props.print.call(this,data,opts);
606
+ }
607
+ return printTableData(data,opts);
603
608
  }
604
609
  isClonable(){
605
610
  return !!(this.props.clonable !==false);
@@ -961,6 +966,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
961
966
 
962
967
  TableDataScreenComponent.propTypes = {
963
968
  ...defaultObj(FormData.propTypes),
969
+ printable : PropTypes.oneOfType([PropTypes.func,PropTypes.bool]),//si la table data est imprimable
964
970
  renderTabsType : PropTypes.oneOf([...defaultRendersTypes,undefined,"responsive"]),//spécifie le type de rendue : mobile, alors le tab sera rendu en mobile, desktop, ce sera rendu en desktop, responsible ou undefined, alors les deux rendu seront possible
965
971
  prepareComponentProps : PropTypes.func, //permet d'appreter les components props à utiliser pour le rendu des données
966
972
  prepareField : PropTypes.func,//La fonction permettant de faire des mutations sur le champ field à passer au formulaire form. si elle retourne false alors la field ne sera pas pris een compte
package/src/pdf/index.js CHANGED
@@ -277,9 +277,9 @@ export function printTableData(data,options){
277
277
  } else if(!Auth.isTableDataAllowed({table,action:'print'})){
278
278
  return Promise.reject({message:'Vous n\'etes pas autorisé à imprimer ce type de document'});
279
279
  }
280
- const printOptions = typeof tableObj.printOptions =="function"? tableObj.printOptions({...options,table,data}) : tableObj.printOptions;
281
280
  return print(data,{
282
281
  getSettings : (options)=>{
282
+ const printOptions = typeof tableObj.printOptions =="function"? tableObj.printOptions({...options,table}) : tableObj.printOptions;
283
283
  return getPrintSettings(extendObj(true,{},{sessionName:`print-${table}`,isTableData:true,tableDataFields:defaultObj(options.tableDataFields,tableObj.printableFields,tableObj.fields)},options,printOptions)).then(({data})=>{
284
284
  return data;
285
285
  });
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  "@fto-consult/expo-ui": {
3
- "version": "8.73.0",
3
+ "version": "8.73.1",
4
4
  "url": "https://github.com/borispipo/expo-ui#readme",
5
5
  "license": "ISC"
6
6
  },
@@ -9,64 +9,34 @@ module.exports = {
9
9
  "url": "https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from",
10
10
  "license": "MIT"
11
11
  },
12
- "@emotion/native": {
13
- "version": "11.11.0",
14
- "url": "https://emotion.sh",
15
- "license": "MIT"
16
- },
17
- "@expo/html-elements": {
18
- "version": "0.5.1",
19
- "url": "https://github.com/expo/expo/tree/main/packages/html-elements",
12
+ "@emotion/react": {
13
+ "version": "11.11.4",
14
+ "url": "https://github.com/emotion-js/emotion/tree/main/packages/react",
20
15
  "license": "MIT"
21
16
  },
22
17
  "@expo/metro-config": {
23
- "version": "0.17.7",
18
+ "version": "0.17.6",
24
19
  "url": "https://github.com/expo/expo.git",
25
20
  "license": "MIT"
26
21
  },
27
- "@expo/vector-icons": {
28
- "version": "14.0.0",
29
- "url": "https://expo.github.io/vector-icons",
30
- "license": "MIT"
31
- },
32
22
  "@expo/webpack-config": {
33
23
  "version": "19.0.1",
34
24
  "url": "https://github.com/expo/expo-webpack-integrations/tree/main/packages/webpack-config#readme",
35
25
  "license": "MIT"
36
26
  },
37
- "@pchmn/expo-material3-theme": {
38
- "version": "1.3.2",
39
- "url": "https://github.com/pchmn/expo-material3-theme#readme",
40
- "license": "MIT"
41
- },
42
- "@react-native-community/netinfo": {
43
- "version": "11.1.0",
44
- "url": "https://github.com/react-native-netinfo/react-native-netinfo#readme",
45
- "license": "MIT"
46
- },
47
- "@react-native/assets-registry": {
48
- "version": "0.72.0",
49
- "url": "git@github.com:facebook/react-native.git",
27
+ "@faker-js/faker": {
28
+ "version": "8.4.1",
29
+ "url": "https://github.com/faker-js/faker.git",
50
30
  "license": "MIT"
51
31
  },
52
- "@react-navigation/native": {
53
- "version": "6.1.17",
54
- "url": "https://reactnavigation.org",
55
- "license": "MIT"
56
- },
57
- "@react-navigation/native-stack": {
58
- "version": "6.9.26",
59
- "url": "https://github.com/software-mansion/react-native-screens#readme",
60
- "license": "MIT"
61
- },
62
- "@react-navigation/stack": {
63
- "version": "6.3.29",
64
- "url": "https://reactnavigation.org/docs/stack-navigator/",
65
- "license": "MIT"
32
+ "@fto-consult/common": {
33
+ "version": "4.46.7",
34
+ "url": "https://github.com/borispipo/common#readme",
35
+ "license": "ISC"
66
36
  },
67
- "@shopify/flash-list": {
68
- "version": "1.6.3",
69
- "url": "https://shopify.github.io/flash-list/",
37
+ "apexcharts": {
38
+ "version": "3.49.0",
39
+ "url": "https://apexcharts.com",
70
40
  "license": "MIT"
71
41
  },
72
42
  "babel-plugin-inline-dotenv": {
@@ -84,74 +54,48 @@ module.exports = {
84
54
  "url": "https://github.com/crypto-browserify/crypto-browserify",
85
55
  "license": "MIT"
86
56
  },
87
- "expo": {
88
- "version": "50.0.17",
89
- "url": "https://github.com/expo/expo/tree/main/packages/expo",
57
+ "file-saver": {
58
+ "version": "2.0.5",
59
+ "url": "https://github.com/eligrey/FileSaver.js#readme",
90
60
  "license": "MIT"
91
61
  },
92
- "expo-camera": {
93
- "version": "14.1.3",
94
- "url": "https://docs.expo.dev/versions/latest/sdk/camera/",
95
- "license": "MIT"
62
+ "google-libphonenumber": {
63
+ "version": "3.2.34",
64
+ "url": "https://ruimarinho.github.io/google-libphonenumber/",
65
+ "license": "(MIT AND Apache-2.0)"
96
66
  },
97
- "expo-clipboard": {
98
- "version": "5.0.1",
99
- "url": "https://docs.expo.dev/versions/latest/sdk/clipboard",
67
+ "html2canvas": {
68
+ "version": "1.4.1",
69
+ "url": "https://html2canvas.hertzen.com",
100
70
  "license": "MIT"
101
71
  },
102
- "expo-document-picker": {
103
- "version": "11.10.1",
104
- "url": "https://docs.expo.dev/versions/latest/sdk/document-picker/",
72
+ "htmlparser2-without-node-native": {
73
+ "version": "3.9.2",
74
+ "url": "git://github.com/fb55/htmlparser2.git",
105
75
  "license": "MIT"
106
76
  },
107
- "expo-font": {
108
- "version": "11.10.3",
109
- "url": "https://docs.expo.dev/versions/latest/sdk/font/",
77
+ "is-plain-obj": {
78
+ "version": "4.1.0",
110
79
  "license": "MIT"
111
80
  },
112
- "expo-image-picker": {
113
- "version": "14.7.1",
114
- "url": "https://docs.expo.dev/versions/latest/sdk/imagepicker/",
81
+ "jsbarcode": {
82
+ "version": "3.11.6",
83
+ "url": "https://github.com/lindell/JsBarcode#readme",
115
84
  "license": "MIT"
116
85
  },
117
- "expo-intent-launcher": {
118
- "version": "10.11.0",
119
- "url": "https://docs.expo.dev/versions/latest/sdk/intent-launcher/",
86
+ "prop-types": {
87
+ "version": "15.8.1",
88
+ "url": "https://facebook.github.io/react/",
120
89
  "license": "MIT"
121
90
  },
122
- "expo-linking": {
123
- "version": "6.2.2",
124
- "url": "https://docs.expo.dev/versions/latest/sdk/linking",
91
+ "react-content-loader": {
92
+ "version": "6.2.1",
93
+ "url": "https://github.com/danilowoz/react-content-loader",
125
94
  "license": "MIT"
126
95
  },
127
- "expo-sharing": {
128
- "version": "11.10.0",
129
- "url": "https://docs.expo.dev/versions/latest/sdk/sharing/",
130
- "license": "MIT"
131
- },
132
- "expo-sqlite": {
133
- "version": "13.4.0",
134
- "url": "https://docs.expo.dev/versions/latest/sdk/sqlite/",
135
- "license": "MIT"
136
- },
137
- "expo-status-bar": {
138
- "version": "1.11.1",
139
- "url": "https://docs.expo.dev/versions/latest/sdk/status-bar/",
140
- "license": "MIT"
141
- },
142
- "expo-system-ui": {
143
- "version": "2.9.4",
144
- "url": "https://docs.expo.dev/versions/latest/sdk/system-ui",
145
- "license": "MIT"
146
- },
147
- "expo-web-browser": {
148
- "version": "12.8.2",
149
- "url": "https://docs.expo.dev/versions/latest/sdk/webbrowser/",
150
- "license": "MIT"
151
- },
152
- "react-native": {
153
- "version": "0.73.6",
154
- "url": "https://reactnative.dev/",
96
+ "react-dom": {
97
+ "version": "18.2.0",
98
+ "url": "https://reactjs.org/",
155
99
  "license": "MIT"
156
100
  },
157
101
  "react-native-big-list": {
@@ -159,45 +103,44 @@ module.exports = {
159
103
  "url": "https://marcocesarato.github.io/react-native-big-list-docs/",
160
104
  "license": "GPL-3.0-or-later"
161
105
  },
162
- "react-native-blob-util": {
163
- "version": "0.18.6",
164
- "url": "https://github.com/RonRadtke/react-native-blob-util",
106
+ "react-native-iphone-x-helper": {
107
+ "version": "1.3.1",
108
+ "url": "https://github.com/ptelad/react-native-iphone-x-helper#readme",
165
109
  "license": "MIT"
166
110
  },
167
- "react-native-gesture-handler": {
168
- "version": "2.14.1",
169
- "url": "https://github.com/software-mansion/react-native-gesture-handler#readme",
111
+ "react-native-mime-types": {
112
+ "version": "2.5.0",
170
113
  "license": "MIT"
171
114
  },
172
- "react-native-reanimated": {
173
- "version": "3.6.2",
174
- "url": "https://github.com/software-mansion/react-native-reanimated#readme",
115
+ "react-native-paper": {
116
+ "version": "5.12.3",
117
+ "url": "https://callstack.github.io/react-native-paper",
175
118
  "license": "MIT"
176
119
  },
177
- "react-native-safe-area-context": {
178
- "version": "4.8.2",
179
- "url": "https://github.com/th3rdwave/react-native-safe-area-context#readme",
120
+ "react-native-paper-dates": {
121
+ "version": "0.22.7",
122
+ "url": "https://github.com/web-ridge/react-native-paper-dates#readme",
180
123
  "license": "MIT"
181
124
  },
182
- "react-native-screens": {
183
- "version": "3.29.0",
184
- "url": "https://github.com/software-mansion/react-native-screens#readme",
125
+ "react-native-web": {
126
+ "version": "0.19.11",
127
+ "url": "git://github.com/necolas/react-native-web.git",
185
128
  "license": "MIT"
186
129
  },
187
- "react-native-svg": {
188
- "version": "14.1.0",
189
- "url": "https://github.com/react-native-community/react-native-svg",
130
+ "react-virtuoso": {
131
+ "version": "4.7.10",
132
+ "url": "https://virtuoso.dev/",
190
133
  "license": "MIT"
191
134
  },
192
- "react-native-view-shot": {
193
- "version": "3.8.0",
194
- "url": "https://github.com/gre/react-native-view-shot",
135
+ "readable-stream": {
136
+ "version": "4.5.2",
137
+ "url": "https://github.com/nodejs/readable-stream",
195
138
  "license": "MIT"
196
139
  },
197
- "react-native-webview": {
198
- "version": "13.6.4",
199
- "url": "https://github.com/react-native-webview/react-native-webview#readme",
200
- "license": "MIT"
140
+ "sanitize-filename": {
141
+ "version": "1.6.3",
142
+ "url": "git@github.com:parshap/node-sanitize-filename.git",
143
+ "license": "WTFPL OR ISC"
201
144
  },
202
145
  "sharp-cli": {
203
146
  "version": "2.1.1",
@@ -209,9 +152,19 @@ module.exports = {
209
152
  "url": "https://github.com/browserify/stream-browserify",
210
153
  "license": "MIT"
211
154
  },
155
+ "tippy.js": {
156
+ "version": "6.3.7",
157
+ "url": "https://atomiks.github.io/tippyjs/",
158
+ "license": "MIT"
159
+ },
212
160
  "vm": {
213
161
  "version": "0.1.0",
214
162
  "url": "https://github.com/DiegoRBaquero/node-vm#readme",
215
163
  "license": "MIT"
164
+ },
165
+ "xlsx": {
166
+ "version": "0.18.5",
167
+ "url": "https://sheetjs.com/",
168
+ "license": "Apache-2.0"
216
169
  }
217
170
  };
@@ -1,66 +0,0 @@
1
- import CommonDatagrid from "./Common";
2
- import {defaultObj,extendObj,defaultStr,isNonNullString,isFunction,isPromise} from "$cutils";
3
- import PropTypes from "prop-types";
4
- import actions from "$actions";
5
- /****
6
- * la fonction fetchOptionsMutator permet éventuellemnt de faire une mutations sur les options fetchOptions avant qu'elle ne soit appliquée pour la recherche. elle
7
- * est appelée avant que la fonction parseMangoQueriesToSQL ne soit appelée, bien évidemement si la props parseMangoQueriesToSQL est active pour le datagrid
8
- * la fonction beforeFetchData est appelée immédiatement avant l'execution de la requête fetch et après que la fonction parseMangoQueriestoSQL soit appelée
9
- */
10
- export default class CommonTableDatagrid extends CommonDatagrid{
11
- constructor(props){
12
- super(props);
13
- let {
14
- tableName,
15
- table,
16
- dataSource,
17
- } = props;
18
- dataSource = CommonDatagrid.getDataSource({...props,dataSource,context:this});
19
- tableName = defaultStr(tableName,table).toUpperCase();
20
- if(tableName){
21
- Object.defineProperties(this,{
22
- tableName : {value:tableName,override:false,writable:false}
23
- })
24
- }
25
- }
26
-
27
- /*** lorsque la données est modifiée */
28
- onUpsertData =(arg) =>{
29
- return this.refresh({force:true,renderProgressBar:false});
30
- }
31
-
32
- componentDidMount(){
33
- super.componentDidMount();
34
- extendObj(this._events,{
35
- onUpsertData : this.onUpsertData.bind(this),
36
- });
37
- if(isNonNullString(this.tableName)){
38
- APP.on(actions.upsert(this.tableName),this._events.onUpsertData)
39
- APP.on(actions.remove(this.tableName),this._events.onUpsertData)
40
- }
41
- this.fetchData({force:true});
42
- }
43
-
44
- componentWillUnmount(){
45
- super.componentWillUnmount();
46
- if(isNonNullString(this.tableName)){
47
- APP.off(actions.upsert(this.tableName),this._events.onUpsertData);
48
- APP.off(actions.remove(this.tableName),this._events.onUpsertData);
49
- }
50
- this.clearEvents();
51
- this.setSelectedRows();
52
- }
53
- isTableData(){
54
- return true;
55
- }
56
- }
57
-
58
- CommonTableDatagrid.propTypes = {
59
- ...CommonDatagrid.propTypes,
60
- data : PropTypes.oneOfType([
61
- PropTypes.func,
62
- PropTypes.string,
63
- PropTypes.objectOf(PropTypes.any),
64
- PropTypes.arrayOf(PropTypes.any)
65
- ])
66
- }
@@ -1,9 +0,0 @@
1
- import Common from "./Common";
2
- import TableDatagrid from "./TableData";
3
-
4
- export default function FactoryComponent(Factory) {
5
- if(typeof Factory ==='string' && Factory.toLowerCase().trim() === 'table'){
6
- return TableDatagrid;
7
- }
8
- return Common;
9
- }
@@ -1,12 +0,0 @@
1
- import CommonDatagrid from "./Common/Common";
2
- import TableDatagrid from "./Common/TableData"
3
- import {defaultStr} from "$cutils";
4
-
5
-
6
- export default function Factory(type) {
7
- type = defaultStr(type).toLowerCase();
8
- if(type.contains('table')){
9
- TableDatagrid;
10
- }
11
- return CommonDatagrid;
12
- }