awing-library 2.1.2-dev.560 → 2.1.2-dev.562
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/dist/AWING/DataForm/container.test.js +4 -4
- package/dist/AWING/DataGridGroups/Container.d.ts.map +1 -1
- package/dist/AWING/DataGridGroups/Container.js +20 -7
- package/dist/AWING/EnhancedAsyncAutoComplete/Container.d.ts.map +1 -1
- package/dist/AWING/EnhancedAsyncAutoComplete/Container.js +2 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ var __webpack_modules__ = {
|
|
|
9
9
|
"AWING/DataInput": function(module) {
|
|
10
10
|
module.exports = __WEBPACK_EXTERNAL_MODULE__DataInput_index_js_c7933a4f__;
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"../helper": function(module) {
|
|
13
13
|
module.exports = __WEBPACK_EXTERNAL_MODULE__helper_js_663c9e82__;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -92,9 +92,9 @@ jest.mock('@mui/material', ()=>({
|
|
|
92
92
|
})
|
|
93
93
|
}));
|
|
94
94
|
const mockInputFactory = __webpack_require__("AWING/DataInput")["default"];
|
|
95
|
-
const mockCalculateValue = __webpack_require__("
|
|
96
|
-
const mockConvertFormulaToBinaryTree = __webpack_require__("
|
|
97
|
-
const mockReplaceFieldsValue = __webpack_require__("
|
|
95
|
+
const mockCalculateValue = __webpack_require__("../helper").calculateValue;
|
|
96
|
+
const mockConvertFormulaToBinaryTree = __webpack_require__("../helper").convertFormulaToBinaryTree;
|
|
97
|
+
const mockReplaceFieldsValue = __webpack_require__("../helper").replaceFieldsValue;
|
|
98
98
|
describe('DataForm Component', ()=>{
|
|
99
99
|
const mockFields = [
|
|
100
100
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/AWING/DataGridGroups/Container.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI9C,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,IAAI;IACxD,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IACzB,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC,CAAC;AAEF,iBAAS,SAAS,CAAC,SAAS,SAAS,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/AWING/DataGridGroups/Container.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI9C,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,IAAI;IACxD,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IACzB,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC,CAAC;AAEF,iBAAS,SAAS,CAAC,SAAS,SAAS,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAAC,SAAS,CAAC,2CAkGjF;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
4
4
|
import { Grid } from "@mui/material";
|
|
5
5
|
import { CircularProgress } from "../index.js";
|
|
@@ -7,7 +7,7 @@ import TableCollaped from "./TableCollaped/index.js";
|
|
|
7
7
|
import PanelGroup from "./PanelGroup/index.js";
|
|
8
8
|
import { initializeAtoms } from "./Atoms.js";
|
|
9
9
|
import { initPage } from "./Constants.js";
|
|
10
|
-
function
|
|
10
|
+
function Container_Container(props) {
|
|
11
11
|
const atoms = initializeAtoms();
|
|
12
12
|
const { defaultFieldGroups = [], onFilter, onRowClick, handleExportExcel } = props;
|
|
13
13
|
const pageList = useAtomValue(atoms.pageList);
|
|
@@ -19,6 +19,8 @@ function Container(props) {
|
|
|
19
19
|
const [rows, setRows] = useState([]);
|
|
20
20
|
const [loading, setLoading] = useState(false);
|
|
21
21
|
const [totalCount, setTotalCount] = useState(0);
|
|
22
|
+
const [filterVersion, setFilterVersion] = useState(0);
|
|
23
|
+
const isInitialMount = useRef(true);
|
|
22
24
|
const fetchData = async (groups)=>{
|
|
23
25
|
setLoading(true);
|
|
24
26
|
if (onFilter) await onFilter(pageList, groups[0]).then((res)=>{
|
|
@@ -40,6 +42,15 @@ function Container(props) {
|
|
|
40
42
|
setGroupFields(defaultFieldGroups.filter((g)=>fieldNames.includes(g)));
|
|
41
43
|
fetchData(defaultFieldGroups);
|
|
42
44
|
}, []);
|
|
45
|
+
useEffect(()=>{
|
|
46
|
+
if (isInitialMount.current) {
|
|
47
|
+
isInitialMount.current = false;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
fetchData(groupFields);
|
|
51
|
+
}, [
|
|
52
|
+
pageList
|
|
53
|
+
]);
|
|
43
54
|
useEffect(()=>{
|
|
44
55
|
setCells(props.cells);
|
|
45
56
|
}, [
|
|
@@ -56,8 +67,10 @@ function Container(props) {
|
|
|
56
67
|
...cells.filter((c)=>!groupFields.includes(c.fieldName))
|
|
57
68
|
]);
|
|
58
69
|
setRootFilters([]);
|
|
59
|
-
setPageList(
|
|
60
|
-
|
|
70
|
+
setPageList({
|
|
71
|
+
...initPage
|
|
72
|
+
});
|
|
73
|
+
setFilterVersion((v)=>v + 1);
|
|
61
74
|
};
|
|
62
75
|
return /*#__PURE__*/ jsxs(Grid, {
|
|
63
76
|
container: true,
|
|
@@ -71,9 +84,9 @@ function Container(props) {
|
|
|
71
84
|
onRowClick: onRowClick,
|
|
72
85
|
totalCount: totalCount,
|
|
73
86
|
rows: rows
|
|
74
|
-
})
|
|
87
|
+
}, filterVersion)
|
|
75
88
|
]
|
|
76
89
|
});
|
|
77
90
|
}
|
|
78
|
-
const
|
|
79
|
-
export {
|
|
91
|
+
const Container = Container_Container;
|
|
92
|
+
export { Container as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/AWING/EnhancedAsyncAutoComplete/Container.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAWzD,iBAAS,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/AWING/EnhancedAsyncAutoComplete/Container.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAWzD,iBAAS,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,8BAA8B,CAAC,CAAC,CAAC,2CA6L7D;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -25,7 +25,8 @@ function Container_Container(props) {
|
|
|
25
25
|
else value && 'string' != typeof value && !Array.isArray(value) ? setPendingValue(value) : setPendingValue(null);
|
|
26
26
|
setAnchorEl(event.currentTarget);
|
|
27
27
|
};
|
|
28
|
-
const handleClose = ()=>{
|
|
28
|
+
const handleClose = (_event, reason)=>{
|
|
29
|
+
if ('toggleInput' === reason) return;
|
|
29
30
|
if (anchorEl) anchorEl.focus();
|
|
30
31
|
if (multiple && null !== pendingValue) onChangeValue?.(pendingValue);
|
|
31
32
|
setAnchorEl(null);
|