@fto-consult/expo-ui 2.25.4 → 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
|
@@ -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 {
|
|
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
|
-
|
|
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 (
|