@fto-consult/expo-ui 7.16.0 → 7.16.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.16.0",
3
+ "version": "7.16.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -169,7 +169,6 @@ de l'objet rowData de cette propriété
169
169
  export default class CommonDatagridComponent extends AppComponent {
170
170
  constructor(props){
171
171
  super(props);
172
- this.initSession();
173
172
  this.autobind();
174
173
  let {
175
174
  data,
@@ -409,55 +408,38 @@ export default class CommonDatagridComponent extends AppComponent {
409
408
  canHandleColumnResize(){
410
409
  return false;
411
410
  }
412
- initSession (){
413
- let sessionName = this.props.sessionName;
414
- let isDatagrid = this.isDatagrid()
415
- if(!isNonNullString(sessionName)){
416
- //sessionName = 'datagrid';
411
+ getSessionKey (){
412
+ const sessionName = this.props.sessionName;
413
+ const userCode = Auth.getLoggedUserCode();
414
+ if(!isNonNullString(sessionName) || (!isNonNullString(userCode) && !this.isDatagrid())) return false;
415
+ return this.getSessionPrefix()+sessionName.ltrim(this.getSessionPrefix()).replaceAll(" ",'_')+userCode;
416
+ }
417
+ getSessionData (sessionKey){
418
+ const key = this.getSessionKey();
419
+ const dat = this.props.session !== false && isNonNullString(key) ? defaultObj($session.get(key)) : {}
420
+ if(isNonNullString(sessionKey)){
421
+ return dat[sessionKey];
417
422
  }
418
- let userCode = Auth.getLoggedUserCode();
419
- Object.defineProperties(this,{
420
- getSessionKey : {
421
- value : ()=>{
422
- if(!isNonNullString(sessionName) || (!isNonNullString(userCode) && !isDatagrid)) return false;
423
- return this.getSessionPrefix()+sessionName.ltrim(this.getSessionPrefix()).replaceAll(" ",'_')+userCode;
424
- }
425
- },
426
- getSessionData : {
427
- value : (sessionKey)=>{
428
- let key = this.getSessionKey();
429
- let dat = {}
430
- if(isNonNullString(key)){
431
- dat = defaultObj($session.get(key));
432
- }
433
- if(isNonNullString(sessionKey)){
434
- return dat[sessionKey]
435
- }
436
- return dat;
437
- }
438
- },
439
- setSessionData : {
440
- value : (sessionKey,sessionValue,reset)=>{
441
- if(this.props.session === false) return;
442
- let key = this.getSessionKey();
443
- if(!isNonNullString(key)) return false;
444
- if(reset === true){
445
- $session.set(key,{});
446
- return {};
447
- }
448
- let dat = defaultObj(this.getSessionData());
449
- if(isNonNullString(sessionKey)){
450
- dat[sessionKey] = sessionValue;
451
- } else if(isObj(sessionKey)){
452
- extendObj(dat,sessionKey);
453
- } else {
454
- return dat;
455
- }
456
- $session.set(key,dat);
457
- return dat;
458
- }
459
- }
460
- })
423
+ return dat;
424
+ }
425
+ setSessionData (sessionKey,sessionValue,reset){
426
+ if(this.props.session === false) return;
427
+ const key = this.getSessionKey();
428
+ if(!isNonNullString(key)) return false;
429
+ if(reset === true){
430
+ $session.set(key,{});
431
+ return {};
432
+ }
433
+ const dat = defaultObj(this.getSessionData());
434
+ if(isNonNullString(sessionKey)){
435
+ dat[sessionKey] = sessionValue;
436
+ } else if(isObj(sessionKey)){
437
+ extendObj(dat,sessionKey);
438
+ } else {
439
+ return dat;
440
+ }
441
+ $session.set(key,dat);
442
+ return dat;
461
443
  }
462
444
  resetSessionData(){
463
445
  return this.setSessionData(null,null,true);
@@ -2430,7 +2412,6 @@ export default class CommonDatagridComponent extends AppComponent {
2430
2412
  }
2431
2413
  const sparkline = !!(typeof config.sparkline !==undefined ? (isObj(config.sparkline)? config.sparkline.enabled : config.sparkline) : (isObj(chartOptions.chart.sparkline)? chartOptions.chart.sparkline.enabled:chartOptions.chart.sparkline));
2432
2414
  chartOptions.chart.sparkline = {enabled: sparkline}
2433
-
2434
2415
  chartOptions.xaxis = defaultObj(chartOptions.xaxis,config.xaxis);
2435
2416
  chartOptions.xaxis.labels = defaultObj(chartOptions.xaxis.labels);
2436
2417
  const xLabels = chartOptions.xaxis.labels;