@fto-consult/expo-ui 6.90.0 → 6.90.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.90.0",
3
+ "version": "6.90.2",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -246,6 +246,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
246
246
  clone,
247
247
  isArchivable,clonable,isPrintable,print,data:customData,getRowKey,
248
248
  save2newAction,
249
+ newAction,
249
250
  save2cloneAction,
250
251
  saveAction,
251
252
  save2closeAction,
@@ -324,13 +325,15 @@ export default class TableDataScreenComponent extends FormDataScreen{
324
325
  isUpdated,
325
326
  fields,
326
327
  });
327
- const cCloneAction = this.isClonable() && this.canCreateNew() && clonable !== false && cloneAction !== false && true || false;
328
+ const canNew = this.canCreateNew() && newAction !== false;
329
+ const cCloneAction = this.isClonable() && canNew && clonable !== false && cloneAction !== false && true || false;
328
330
  const rActionsArg = this.currentRenderingProps = {
329
331
  ...rest,
330
332
  ...formProps,
331
333
  context,
334
+ newAction,
332
335
  cloneAction : cCloneAction,
333
- save2newAction : this.canCreateNew() && save2newAction !== false ? typeof save2cloneAction =="boolean"? save2cloneAction : saveAction !== false : false,
336
+ save2newAction : canNew ? typeof save2newAction =="boolean"? save2newAction : saveAction !== false : false,
334
337
  save2cloneAction : cCloneAction && save2cloneAction !== false ? true : false,
335
338
  isMobile : isMobOrTab,
336
339
  saveAction,
@@ -358,15 +361,20 @@ export default class TableDataScreenComponent extends FormDataScreen{
358
361
  archivedPermsFilter : this.archivedPermsFilter.bind(this),
359
362
  onPressCopyToClipboard : this.copyToClipboard.bind(this)
360
363
  }
361
- if(isUpdated){
362
- fields.approved = this.isApprovable()? {
363
- text : 'Approuvé',
364
- type : 'switch',
365
- defaultValue : 0,
366
- checkedTooltip: 'Oui',
367
- disabled : Auth.isTableDataAllowed({table:tableName,action:'updateapproved'})? false:true,
368
- uncheckedTooltip : 'Non'
369
- } : null;
364
+ if(Object.size(fields,true)){
365
+ if(isUpdated){
366
+ fields.approved = this.isApprovable()? {
367
+ text : 'Approuvé',
368
+ type : 'switch',
369
+ defaultValue : 0,
370
+ checkedTooltip: 'Oui',
371
+ disabled : Auth.isTableDataAllowed({table:tableName,action:'updateapproved'})? false:true,
372
+ uncheckedTooltip : 'Non',
373
+ ...Object.assign({},fields.approved)
374
+ } : null;
375
+ }
376
+ } else {
377
+ formProps.style = [theme.styles.noPadding,formProps.style]
370
378
  }
371
379
  rActionsArg.contentProps = Object.assign({},customContentProps);
372
380
  rActionsArg.containerProps = Object.assign({},customContainerProps);
@@ -651,11 +659,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
651
659
  return this.doSave(args);
652
660
  }
653
661
  canCreateNew(){
654
- const editingProps = this.getCurrentRenderingProps();
655
- if("newAction" in editingProps){
656
- return !!editingProps.newAction;
657
- }
658
- return this.props.newAction !== false ? true : false;
662
+ return this.props.newAction !== false;
659
663
  }
660
664
  isMobileOrTabletMedia(){
661
665
  const r = this.getRenderTabsType();