@m4l/layouts 9.4.4 → 9.5.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefreshData.d.ts","sourceRoot":"","sources":["../../../../../../packages/layouts/src/hooks/useRefreshData/useRefreshData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAA0B,MAAM,iBAAiB,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAyB,MAAM,SAAS,CAAC;AAGhE;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAG,OAAO,cAAc,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useRefreshData.d.ts","sourceRoot":"","sources":["../../../../../../packages/layouts/src/hooks/useRefreshData/useRefreshData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAA0B,MAAM,iBAAiB,CAAC;AAIjE,OAAO,EAAE,cAAc,EAAyB,MAAM,SAAS,CAAC;AAGhE;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,IAAI,EAAG,OAAO,cAAc,CAAC,IAAI,CAAC;yBAoDvB,IAAI,GAAG,MAAM;6CAxCL,WAAW,CAAC,MAAM,CAAC;;;CAqDpE,CAAC"}
|
|
@@ -2,25 +2,25 @@ import { useState as c, useEffect as S, useCallback as O } from "react";
|
|
|
2
2
|
import { getDataGridRowsFromSet as a } from "@m4l/components";
|
|
3
3
|
import { useHostTools as h, useModuleDictionary as m } from "@m4l/core";
|
|
4
4
|
import { useMasterDetail as I } from "../useMasterDetail/index.js";
|
|
5
|
-
import { USE_REFRESH_DATA_DICTIONARY as
|
|
6
|
-
const A = (
|
|
7
|
-
const { rows:
|
|
8
|
-
n(e), f(a(e,
|
|
5
|
+
import { USE_REFRESH_DATA_DICTIONARY as _ } from "./dictionary.js";
|
|
6
|
+
const A = (l) => {
|
|
7
|
+
const { rows: o, refreshPaginate: R, rowKeyGetter: t } = l, { toast: T } = h(), { getLabel: d } = m(), { onChangeMasterSelection: f } = I(), [r, w] = c({ idRow: void 0 }), [i, n] = c(/* @__PURE__ */ new Set()), [u, p] = c(void 0), E = (e) => {
|
|
8
|
+
n(e), f(a(e, o, t));
|
|
9
9
|
};
|
|
10
10
|
return S(() => {
|
|
11
|
-
i.size > 0 && f(a(i,
|
|
12
|
-
}, [
|
|
13
|
-
r.idRow !== void 0 && !
|
|
14
|
-
title: d(
|
|
15
|
-
description: d(
|
|
16
|
-
}, { type: "info" }));
|
|
17
|
-
}, [
|
|
11
|
+
i.size > 0 && f(a(i, o, t));
|
|
12
|
+
}, [o]), S(() => {
|
|
13
|
+
r.idRow !== void 0 && !o.some((s) => i.has(t(s))) && r.idRow && (n?.(/* @__PURE__ */ new Set()), T({
|
|
14
|
+
title: d(_.TOAST_NEW_ROW_BUT_NOT_VISIBLE_TITLE),
|
|
15
|
+
description: d(_.TOAST_NEW_ROW_BUT_NOT_VISIBLE_DESCRIPTION, r.idRow)
|
|
16
|
+
}, { type: "info" }), w({ idRow: void 0 }));
|
|
17
|
+
}, [o]), { refresh: O((e) => {
|
|
18
18
|
if (e !== void 0) {
|
|
19
|
-
const s = typeof e == "string" || typeof e == "number" ? e :
|
|
20
|
-
p(s),
|
|
19
|
+
const s = typeof e == "string" || typeof e == "number" ? e : t(e);
|
|
20
|
+
p(s), w({ idRow: s }), n(/* @__PURE__ */ new Set([s]));
|
|
21
21
|
}
|
|
22
22
|
R();
|
|
23
|
-
}, [R, n,
|
|
23
|
+
}, [R, n, t]), onSelectedRowsChange: E, selectedRows: i, focusOnRowKey: u };
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
26
|
A as useRefreshData
|