@fto-consult/expo-ui 2.25.3 → 2.26.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "2.25.3",
3
+ "version": "2.26.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ import $session from "$session";
7
7
  import Auth from "$cauth";
8
8
  import Tooltip from "$ecomponents/Tooltip";
9
9
  import setQueryLimit from "./setQueryLimit";
10
- import {notify,showConfirm} from "$ecomponents/Dialog";
10
+ import {showConfirm} from "$ecomponents/Dialog";
11
11
  import Label from "$ecomponents/Label";
12
12
  import Image from "$ecomponents/Image";
13
13
  import Icon,{COPY_ICON} from "$ecomponents/Icon";
@@ -39,6 +39,7 @@ import {Menu} from "$ecomponents/BottomSheet";
39
39
  import {styles as tableStyles} from "$ecomponents/Table";
40
40
  import {DialogProvider} from "$ecomponents/Form/FormData";
41
41
  import Chart,{getMaxSupportedSeriesSize} from "$ecomponents/Chart";
42
+ import notify from "$cnotify";
42
43
 
43
44
  export const donutChart = {
44
45
  isChart : true,
@@ -710,6 +711,9 @@ export default class CommonDatagridComponent extends AppComponent {
710
711
  const r = isObj(selected)? selected : {};
711
712
  const ret = {
712
713
  ...dataSourceArgs,
714
+ showConfirm,
715
+ Preloader,
716
+ notify,
713
717
  selected : defaultBool(selected,false),
714
718
  ...r,
715
719
  isMobile : isMobileOrTabletMedia(),
@@ -2,6 +2,7 @@ import CommonDatagrid from "./Common";
2
2
  import {defaultObj,extendObj,defaultStr,isNonNullString,isFunction,isPromise} from "$utils";
3
3
  import PropTypes from "prop-types";
4
4
  import {convertToSQL} from "$ecomponents/Filter";
5
+ import actions from "$actions";
5
6
  /****
6
7
  * 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
8
  * est appelée avant que la fonction convertToSQL ne soit appelée, bien évidemement si la props convertToSQL est active pour le datagrid
@@ -41,11 +42,20 @@ export default class CommonTableDatagrid extends CommonDatagrid{
41
42
  extendObj(this._events,{
42
43
  onUpsertData : this.onUpsertData.bind(this),
43
44
  });
45
+ if(isNonNullString(this.tableName)){
46
+ APP.on(actions.upsert(this.tableName),this._events.onUpsertData)
47
+ APP.on(actions.remove(this.tableName),this._events.onUpsertData)
48
+ }
44
49
  this.fetchData({force:true});
45
50
  }
46
51
 
47
52
  componentWillUnmount(){
48
53
  super.componentWillUnmount();
54
+ if(isNonNullString(this.tableName)){
55
+ unmountDatabaseTable(this.tableName);
56
+ APP.off(actions.upsert(this.tableName),this._events.onUpsertData);
57
+ APP.off(actions.remove(this.tableName),this._events.onUpsertData);
58
+ }
49
59
  this.clearEvents();
50
60
  this.setSelectedRows();
51
61
  }
@@ -22,7 +22,7 @@ import theme from "$theme";
22
22
  import useSWR,{useInfinite} from "$swr";
23
23
  import appConfig from "$capp/config";
24
24
  import APP from "$capp/instance";
25
- import cAction from "$cactions";
25
+
26
26
  import PropTypes from "prop-types";
27
27
  import {isDesktopMedia} from "$dimensions";
28
28
  import ActivityIndicator from "$ecomponents/ActivityIndicator";
@@ -246,19 +246,6 @@ const SWRDatagridComponent = React.forwardRef((props,ref)=>{
246
246
  ///si le nombre total d'élements est inférieur au nombre limite alors le trie peut être fait localement
247
247
  return totalRef.current > limitRef.current && true || false;
248
248
  }
249
- React.useEffect(()=>{
250
- const upsert = cAction.upsert(tableName);
251
- const remove = cAction.remove(tableName);
252
- const onUpsert = ()=>{
253
- doRefresh(false);
254
- }
255
- APP.on(remove,onUpsert);
256
- APP.on(upsert,onUpsert);
257
- return ()=>{
258
- APP.off(upsert,onUpsert);
259
- APP.off(remove,onUpsert);
260
- }
261
- },[]);
262
249
  const loading = (isLoading|| isValidating);
263
250
  const pointerEvents = loading ?"node" : "auto";
264
251
  return (
@@ -226,7 +226,6 @@ export default class FormDataComponent extends AppComponent{
226
226
  rest.defaultValue = new Date();
227
227
  } else if(!isDate && isNonNullString(rest.appConfigDefaultValueKey)){
228
228
  rest.defaultValue = appConfig.get(rest.appConfigDefaultValueKey);
229
- console.log(rest.defaultValue,rest.appConfigDefaultValueKey," is defa value and ",rest,appConfig.activePeriod,appConfig);
230
229
  }
231
230
  }
232
231
  customResponsiveProps = defaultObj(customResponsiveProps);