datastake-daf 0.6.426 → 0.6.427
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/components/index.js
CHANGED
|
@@ -13302,11 +13302,10 @@ DAFFooter.propTypes = {
|
|
|
13302
13302
|
isViewMode: PropTypes__default["default"].bool
|
|
13303
13303
|
};
|
|
13304
13304
|
|
|
13305
|
-
const
|
|
13305
|
+
const PAGE_HEIGHT = 1587;
|
|
13306
|
+
// margin-top: 20, bottom: 20;
|
|
13306
13307
|
const FOOTER_HEIGHT = 70;
|
|
13307
13308
|
const HEADER_HEIGHT = 100;
|
|
13308
|
-
const PAGE_HEIGHT = CONTENT_HEIGHT + FOOTER_HEIGHT + HEADER_HEIGHT;
|
|
13309
|
-
const SECTION_GAP = 24;
|
|
13310
13309
|
const Row = _ref => {
|
|
13311
13310
|
let {
|
|
13312
13311
|
widgets,
|
|
@@ -13331,70 +13330,70 @@ const Row = _ref => {
|
|
|
13331
13330
|
ref
|
|
13332
13331
|
});
|
|
13333
13332
|
}
|
|
13334
|
-
}, [height
|
|
13333
|
+
}, [height]);
|
|
13335
13334
|
return /*#__PURE__*/jsxRuntime.jsx("section", {
|
|
13336
13335
|
ref: ref,
|
|
13337
|
-
style:
|
|
13338
|
-
|
|
13339
|
-
}),
|
|
13340
|
-
children: typeof widgets.render === "function" ? widgets.render() : null
|
|
13336
|
+
style: widgets.style,
|
|
13337
|
+
children: typeof widgets.render === 'function' ? widgets.render() : null
|
|
13341
13338
|
});
|
|
13342
13339
|
};
|
|
13343
13340
|
function PdfView(_ref2) {
|
|
13344
13341
|
let {
|
|
13345
13342
|
config = [],
|
|
13346
13343
|
customClassName,
|
|
13347
|
-
title =
|
|
13348
|
-
imgSrc =
|
|
13349
|
-
userId =
|
|
13350
|
-
accountId =
|
|
13351
|
-
documentId =
|
|
13352
|
-
downloadId =
|
|
13344
|
+
title = 'Title',
|
|
13345
|
+
imgSrc = '',
|
|
13346
|
+
userId = 'IDD-0000000',
|
|
13347
|
+
accountId = 'IDD-0000000',
|
|
13348
|
+
documentId = 'IDD-0000000',
|
|
13349
|
+
downloadId = 'DWL-00000123'
|
|
13353
13350
|
} = _ref2;
|
|
13354
13351
|
const [sectionsConfig, setSectionsConfig] = React.useState({});
|
|
13355
13352
|
const [pages, setPages] = React.useState([1]);
|
|
13356
13353
|
const doSizing = React.useCallback(() => {
|
|
13357
13354
|
const keys = Object.keys(sectionsConfig);
|
|
13358
|
-
if (keys.length !== config.length) return;
|
|
13359
13355
|
let _pages = [1];
|
|
13360
|
-
let
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13356
|
+
let _page = 1;
|
|
13357
|
+
if (keys.length === config.length) {
|
|
13358
|
+
let incrHeight = 0;
|
|
13359
|
+
keys.forEach(k => {
|
|
13360
|
+
const {
|
|
13361
|
+
ref
|
|
13362
|
+
} = sectionsConfig[k];
|
|
13363
|
+
ref.current.style.marginBottom = '0px';
|
|
13364
|
+
// ref.current.style.marginTop = '15px';
|
|
13365
|
+
});
|
|
13366
|
+
keys.forEach((k, i) => {
|
|
13367
|
+
const {
|
|
13368
|
+
height,
|
|
13369
|
+
ref
|
|
13370
|
+
} = sectionsConfig[k];
|
|
13371
|
+
if (i === 0) {
|
|
13372
|
+
ref.current.style.marginTop = "".concat(HEADER_HEIGHT, "px");
|
|
13373
|
+
incrHeight += HEADER_HEIGHT;
|
|
13374
|
+
}
|
|
13375
|
+
const newHeight = incrHeight + height;
|
|
13376
|
+
if (i === keys.length - 1) {
|
|
13377
|
+
ref.current.style.paddingBottom = '30px';
|
|
13378
|
+
}
|
|
13379
|
+
if (newHeight > PAGE_HEIGHT - 30 - FOOTER_HEIGHT - HEADER_HEIGHT) {
|
|
13380
|
+
ref.current.style.marginTop = '30px';
|
|
13381
|
+
_page += 1;
|
|
13382
|
+
_pages.push(_page);
|
|
13383
|
+
if (sectionsConfig[keys[i - 1]]) {
|
|
13384
|
+
sectionsConfig[keys[i - 1]];
|
|
13385
|
+
// topRef.current.style.marginBottom = `${dif + HEADER_HEIGHT - 24}px`;
|
|
13386
|
+
incrHeight = height + 24 + HEADER_HEIGHT;
|
|
13387
|
+
// console.log('margin', dif);
|
|
13388
|
+
}
|
|
13389
|
+
} else {
|
|
13390
|
+
incrHeight = newHeight + 24;
|
|
13391
|
+
}
|
|
13392
|
+
// console.groupEnd();
|
|
13393
|
+
});
|
|
13394
|
+
setPages(_pages);
|
|
13395
|
+
}
|
|
13396
|
+
}, [sectionsConfig]);
|
|
13398
13397
|
React.useEffect(() => {
|
|
13399
13398
|
doSizing();
|
|
13400
13399
|
}, [doSizing]);
|
|
@@ -13403,7 +13402,7 @@ function PdfView(_ref2) {
|
|
|
13403
13402
|
[index]: conf
|
|
13404
13403
|
}));
|
|
13405
13404
|
}, []);
|
|
13406
|
-
const contClassName = formatClassname([
|
|
13405
|
+
const contClassName = formatClassname(['daf-analysis daf-pdf-view', customClassName]);
|
|
13407
13406
|
const renderDashboard = React.useCallback(() => {
|
|
13408
13407
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13409
13408
|
className: "view-content",
|
|
@@ -13415,29 +13414,35 @@ function PdfView(_ref2) {
|
|
|
13415
13414
|
widgets: widgets,
|
|
13416
13415
|
i: i,
|
|
13417
13416
|
onChangeHeight: onChangeHeight
|
|
13418
|
-
}, "dashboard-
|
|
13417
|
+
}, "dashboard-sections=".concat(i + 1)))
|
|
13419
13418
|
})
|
|
13420
13419
|
})
|
|
13421
13420
|
});
|
|
13422
13421
|
}, [config, onChangeHeight]);
|
|
13422
|
+
|
|
13423
|
+
// <div className="daf-analysis">
|
|
13424
|
+
// <Header title={t('Dashboard Title')} />
|
|
13425
|
+
|
|
13426
|
+
// <div className="content">
|
|
13427
|
+
// <div className="view-content">
|
|
13428
|
+
// <div className="daf-analysis-layout">
|
|
13429
|
+
// <div className='sections-cont w-pt'>
|
|
13430
|
+
// <section>
|
|
13431
|
+
|
|
13423
13432
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13424
13433
|
className: contClassName,
|
|
13425
13434
|
style: {
|
|
13426
|
-
position:
|
|
13435
|
+
position: 'relative'
|
|
13427
13436
|
},
|
|
13428
|
-
children: [renderDashboard(), pages.map(page => /*#__PURE__*/jsxRuntime.jsxs(
|
|
13437
|
+
children: [renderDashboard(), pages.map(page => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13429
13438
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13430
13439
|
style: {
|
|
13431
13440
|
top: (page - 1) * PAGE_HEIGHT,
|
|
13432
|
-
width:
|
|
13441
|
+
width: '100%',
|
|
13433
13442
|
height: HEADER_HEIGHT - 24,
|
|
13434
|
-
position:
|
|
13443
|
+
position: 'absolute',
|
|
13435
13444
|
left: 0,
|
|
13436
|
-
zIndex: 1000000
|
|
13437
|
-
display: "flex",
|
|
13438
|
-
justifyContent: "space-between",
|
|
13439
|
-
alignItems: "center",
|
|
13440
|
-
padding: "0 32px"
|
|
13445
|
+
zIndex: 1000000
|
|
13441
13446
|
},
|
|
13442
13447
|
className: "flex-row dashboard-header",
|
|
13443
13448
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -13447,52 +13452,44 @@ function PdfView(_ref2) {
|
|
|
13447
13452
|
})
|
|
13448
13453
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13449
13454
|
className: "flex flex-column justify-center",
|
|
13450
|
-
children:
|
|
13455
|
+
children: /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
13451
13456
|
src: imgSrc,
|
|
13452
|
-
alt: "logo"
|
|
13453
|
-
style: {
|
|
13454
|
-
height: 60,
|
|
13455
|
-
objectFit: "contain"
|
|
13456
|
-
}
|
|
13457
|
+
alt: "logo"
|
|
13457
13458
|
})
|
|
13458
13459
|
})]
|
|
13459
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13460
|
+
}, "headers-".concat(page)), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13460
13461
|
style: {
|
|
13461
13462
|
top: page * PAGE_HEIGHT - FOOTER_HEIGHT,
|
|
13462
|
-
width:
|
|
13463
|
+
width: '100%',
|
|
13463
13464
|
height: FOOTER_HEIGHT,
|
|
13464
|
-
position:
|
|
13465
|
+
position: 'absolute',
|
|
13465
13466
|
left: 0,
|
|
13466
|
-
zIndex: 1000000
|
|
13467
|
-
display: "flex",
|
|
13468
|
-
justifyContent: "space-between",
|
|
13469
|
-
alignItems: "center",
|
|
13470
|
-
padding: "0 32px"
|
|
13467
|
+
zIndex: 1000000
|
|
13471
13468
|
},
|
|
13472
13469
|
className: "dashboard-footer flex-row",
|
|
13473
13470
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13474
13471
|
className: "flex flex-column justify-center",
|
|
13475
13472
|
children: /*#__PURE__*/jsxRuntime.jsx("h5", {
|
|
13476
|
-
children: moment__default["default"]().format(
|
|
13473
|
+
children: moment__default["default"]().format('DD MMM YYYY')
|
|
13477
13474
|
})
|
|
13478
13475
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13479
13476
|
className: "flex flex-column justify-center",
|
|
13480
13477
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13481
13478
|
className: "flex gap-2",
|
|
13482
13479
|
children: [/*#__PURE__*/jsxRuntime.jsxs("h5", {
|
|
13483
|
-
children: ["User ID:
|
|
13480
|
+
children: ["User ID:", ' ', /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
13484
13481
|
children: userId
|
|
13485
13482
|
})]
|
|
13486
13483
|
}), /*#__PURE__*/jsxRuntime.jsxs("h5", {
|
|
13487
|
-
children: ["Account ID:
|
|
13484
|
+
children: ["Account ID:", ' ', /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
13488
13485
|
children: accountId
|
|
13489
13486
|
})]
|
|
13490
13487
|
}), /*#__PURE__*/jsxRuntime.jsxs("h5", {
|
|
13491
|
-
children: ["Document ID:
|
|
13488
|
+
children: ["Document ID:", ' ', /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
13492
13489
|
children: documentId
|
|
13493
13490
|
})]
|
|
13494
13491
|
}), /*#__PURE__*/jsxRuntime.jsxs("h5", {
|
|
13495
|
-
children: ["Download ID:
|
|
13492
|
+
children: ["Download ID:", ' ', /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
13496
13493
|
children: downloadId
|
|
13497
13494
|
})]
|
|
13498
13495
|
})]
|
|
@@ -13503,8 +13500,8 @@ function PdfView(_ref2) {
|
|
|
13503
13500
|
children: page
|
|
13504
13501
|
})
|
|
13505
13502
|
})]
|
|
13506
|
-
})]
|
|
13507
|
-
}
|
|
13503
|
+
}, "footers-".concat(page))]
|
|
13504
|
+
}))]
|
|
13508
13505
|
});
|
|
13509
13506
|
}
|
|
13510
13507
|
PdfView.propTypes = {
|
|
@@ -13514,8 +13511,7 @@ PdfView.propTypes = {
|
|
|
13514
13511
|
imgSrc: PropTypes__default["default"].string,
|
|
13515
13512
|
userId: PropTypes__default["default"].string,
|
|
13516
13513
|
accountId: PropTypes__default["default"].string,
|
|
13517
|
-
documentId: PropTypes__default["default"].string
|
|
13518
|
-
downloadId: PropTypes__default["default"].string
|
|
13514
|
+
documentId: PropTypes__default["default"].string
|
|
13519
13515
|
};
|
|
13520
13516
|
|
|
13521
13517
|
const ajaxSelectFieldData = async (value, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, formValues = {}) => {
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import moment from "moment";
|
|
2
|
-
import PropTypes from
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { formatClassname } from "../../../../../helpers/ClassesHelper";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const PAGE_HEIGHT = 1587;
|
|
7
|
+
// margin-top: 20, bottom: 20;
|
|
7
8
|
const FOOTER_HEIGHT = 70;
|
|
8
9
|
const HEADER_HEIGHT = 100;
|
|
9
|
-
const PAGE_HEIGHT = CONTENT_HEIGHT + FOOTER_HEIGHT + HEADER_HEIGHT;
|
|
10
|
-
const SECTION_GAP = 24;
|
|
11
10
|
|
|
12
|
-
const Row = ({ widgets, i, onChangeHeight = () => {} }) => {
|
|
11
|
+
const Row = ({ widgets, i, onChangeHeight = () => { } }) => {
|
|
13
12
|
const ref = useRef();
|
|
14
13
|
const [height, setHeight] = useState(0);
|
|
15
14
|
|
|
@@ -19,7 +18,9 @@ const Row = ({ widgets, i, onChangeHeight = () => {} }) => {
|
|
|
19
18
|
setHeight(entry.contentRect.height);
|
|
20
19
|
}
|
|
21
20
|
});
|
|
21
|
+
|
|
22
22
|
observer.observe(ref.current);
|
|
23
|
+
|
|
23
24
|
return () => observer.disconnect();
|
|
24
25
|
}, []);
|
|
25
26
|
|
|
@@ -27,98 +28,96 @@ const Row = ({ widgets, i, onChangeHeight = () => {} }) => {
|
|
|
27
28
|
if (height) {
|
|
28
29
|
onChangeHeight(i, { height, ref });
|
|
29
30
|
}
|
|
30
|
-
}, [height
|
|
31
|
+
}, [height])
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
|
-
<section
|
|
34
|
-
|
|
35
|
-
style={{
|
|
36
|
-
...widgets.style,
|
|
37
|
-
marginBottom: SECTION_GAP,
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
{typeof widgets.render === "function" ? widgets.render() : null}
|
|
34
|
+
<section ref={ref} style={widgets.style}>
|
|
35
|
+
{typeof widgets.render === 'function' ? widgets.render() : null}
|
|
41
36
|
</section>
|
|
42
|
-
)
|
|
37
|
+
)
|
|
43
38
|
};
|
|
44
39
|
|
|
45
40
|
export default function PdfView({
|
|
46
41
|
config = [],
|
|
47
42
|
customClassName,
|
|
48
|
-
title =
|
|
49
|
-
imgSrc =
|
|
50
|
-
userId =
|
|
51
|
-
accountId =
|
|
52
|
-
documentId =
|
|
53
|
-
downloadId =
|
|
43
|
+
title = 'Title',
|
|
44
|
+
imgSrc = '',
|
|
45
|
+
userId = 'IDD-0000000',
|
|
46
|
+
accountId = 'IDD-0000000',
|
|
47
|
+
documentId = 'IDD-0000000',
|
|
48
|
+
downloadId = 'DWL-00000123',
|
|
54
49
|
}) {
|
|
55
50
|
const [sectionsConfig, setSectionsConfig] = useState({});
|
|
56
51
|
const [pages, setPages] = useState([1]);
|
|
57
52
|
|
|
58
53
|
const doSizing = useCallback(() => {
|
|
59
54
|
const keys = Object.keys(sectionsConfig);
|
|
60
|
-
if (keys.length !== config.length) return;
|
|
61
|
-
|
|
62
55
|
let _pages = [1];
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
ref.current.style.
|
|
71
|
-
ref.current.style.
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
56
|
+
let _page = 1;
|
|
57
|
+
|
|
58
|
+
if (keys.length === config.length) {
|
|
59
|
+
let incrHeight = 0;
|
|
60
|
+
|
|
61
|
+
keys.forEach(k => {
|
|
62
|
+
const { ref } = sectionsConfig[k];
|
|
63
|
+
ref.current.style.marginBottom = '0px';
|
|
64
|
+
// ref.current.style.marginTop = '15px';
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
keys.forEach((k, i) => {
|
|
68
|
+
const { height, ref } = sectionsConfig[k];
|
|
69
|
+
|
|
70
|
+
if (i === 0) {
|
|
71
|
+
ref.current.style.marginTop = `${HEADER_HEIGHT}px`;
|
|
72
|
+
incrHeight += HEADER_HEIGHT;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const newHeight = incrHeight + height;
|
|
76
|
+
|
|
77
|
+
if (i === keys.length - 1) {
|
|
78
|
+
ref.current.style.paddingBottom = '30px';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (newHeight > PAGE_HEIGHT - 30 - FOOTER_HEIGHT - HEADER_HEIGHT) {
|
|
82
|
+
const dif = Math.abs(PAGE_HEIGHT - incrHeight);
|
|
83
|
+
ref.current.style.marginTop = '30px';
|
|
84
|
+
_page += 1;
|
|
85
|
+
_pages.push(_page);
|
|
86
|
+
|
|
87
|
+
if (sectionsConfig[keys[i - 1]]) {
|
|
88
|
+
const { ref: topRef } = sectionsConfig[keys[i - 1]];
|
|
89
|
+
// topRef.current.style.marginBottom = `${dif + HEADER_HEIGHT - 24}px`;
|
|
90
|
+
incrHeight = height + 24 + HEADER_HEIGHT;
|
|
91
|
+
// console.log('margin', dif);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
incrHeight = newHeight + 24;
|
|
95
|
+
}
|
|
96
|
+
// console.groupEnd();
|
|
97
|
+
})
|
|
98
|
+
setPages(_pages);
|
|
99
|
+
}
|
|
100
|
+
}, [sectionsConfig]);
|
|
99
101
|
|
|
100
102
|
useEffect(() => {
|
|
101
103
|
doSizing();
|
|
102
104
|
}, [doSizing]);
|
|
103
105
|
|
|
104
106
|
const onChangeHeight = useCallback((index, conf) => {
|
|
105
|
-
setSectionsConfig((prev) => ({ ...prev, [index]: conf }))
|
|
107
|
+
setSectionsConfig((prev) => ({ ...prev, [index]: conf }))
|
|
106
108
|
}, []);
|
|
107
109
|
|
|
108
|
-
const contClassName = formatClassname([
|
|
109
|
-
"daf-analysis daf-pdf-view",
|
|
110
|
-
customClassName,
|
|
111
|
-
]);
|
|
110
|
+
const contClassName = formatClassname(['daf-analysis daf-pdf-view', customClassName]);
|
|
112
111
|
|
|
113
112
|
const renderDashboard = useCallback(() => {
|
|
114
113
|
return (
|
|
115
114
|
<div className="view-content">
|
|
116
115
|
<div className="daf-analysis-layout">
|
|
117
|
-
<div className=
|
|
116
|
+
<div className='sections-cont'>
|
|
118
117
|
{config.map((widgets, i) => (
|
|
119
118
|
<Row
|
|
120
119
|
widgets={widgets}
|
|
121
|
-
key={`dashboard-
|
|
120
|
+
key={`dashboard-sections=${i + 1}`}
|
|
122
121
|
i={i}
|
|
123
122
|
onChangeHeight={onChangeHeight}
|
|
124
123
|
/>
|
|
@@ -129,74 +128,61 @@ export default function PdfView({
|
|
|
129
128
|
);
|
|
130
129
|
}, [config, onChangeHeight]);
|
|
131
130
|
|
|
131
|
+
// <div className="daf-analysis">
|
|
132
|
+
// <Header title={t('Dashboard Title')} />
|
|
133
|
+
|
|
134
|
+
// <div className="content">
|
|
135
|
+
// <div className="view-content">
|
|
136
|
+
// <div className="daf-analysis-layout">
|
|
137
|
+
// <div className='sections-cont w-pt'>
|
|
138
|
+
// <section>
|
|
139
|
+
|
|
132
140
|
return (
|
|
133
|
-
<div className={contClassName} style={{ position:
|
|
141
|
+
<div className={contClassName} style={{ position: 'relative' }}>
|
|
134
142
|
{renderDashboard()}
|
|
135
|
-
|
|
136
143
|
{pages.map((page) => (
|
|
137
|
-
|
|
138
|
-
{/* Header */}
|
|
144
|
+
<>
|
|
139
145
|
<div
|
|
140
|
-
style={{
|
|
141
|
-
|
|
142
|
-
width: "100%",
|
|
143
|
-
height: HEADER_HEIGHT - 24,
|
|
144
|
-
position: "absolute",
|
|
145
|
-
left: 0,
|
|
146
|
-
zIndex: 1000000,
|
|
147
|
-
display: "flex",
|
|
148
|
-
justifyContent: "space-between",
|
|
149
|
-
alignItems: "center",
|
|
150
|
-
padding: "0 32px",
|
|
151
|
-
}}
|
|
146
|
+
style={{ top: ((page - 1) * PAGE_HEIGHT), width: '100%', height: HEADER_HEIGHT - 24, position: 'absolute', left: 0, zIndex: 1000000 }}
|
|
147
|
+
key={`headers-${page}`}
|
|
152
148
|
className="flex-row dashboard-header"
|
|
153
149
|
>
|
|
154
150
|
<div className="flex flex-column justify-center flex-1">
|
|
155
151
|
<h2>{title}</h2>
|
|
156
152
|
</div>
|
|
157
153
|
<div className="flex flex-column justify-center">
|
|
158
|
-
{imgSrc
|
|
159
|
-
<img
|
|
160
|
-
src={imgSrc}
|
|
161
|
-
alt="logo"
|
|
162
|
-
style={{ height: 60, objectFit: "contain" }}
|
|
163
|
-
/>
|
|
164
|
-
)}
|
|
154
|
+
<img src={imgSrc} alt="logo" />
|
|
165
155
|
</div>
|
|
166
156
|
</div>
|
|
167
|
-
|
|
168
|
-
{/* Footer */}
|
|
169
157
|
<div
|
|
170
|
-
style={{
|
|
171
|
-
|
|
172
|
-
width: "100%",
|
|
173
|
-
height: FOOTER_HEIGHT,
|
|
174
|
-
position: "absolute",
|
|
175
|
-
left: 0,
|
|
176
|
-
zIndex: 1000000,
|
|
177
|
-
display: "flex",
|
|
178
|
-
justifyContent: "space-between",
|
|
179
|
-
alignItems: "center",
|
|
180
|
-
padding: "0 32px",
|
|
181
|
-
}}
|
|
158
|
+
style={{ top: (page * PAGE_HEIGHT) - FOOTER_HEIGHT, width: '100%', height: FOOTER_HEIGHT, position: 'absolute', left: 0, zIndex: 1000000 }}
|
|
159
|
+
key={`footers-${page}`}
|
|
182
160
|
className="dashboard-footer flex-row"
|
|
183
161
|
>
|
|
184
162
|
<div className="flex flex-column justify-center">
|
|
185
|
-
<h5>{moment().format(
|
|
163
|
+
<h5>{moment().format('DD MMM YYYY')}</h5>
|
|
186
164
|
</div>
|
|
187
165
|
<div className="flex flex-column justify-center">
|
|
188
166
|
<div className="flex gap-2">
|
|
189
167
|
<h5>
|
|
190
|
-
User ID:
|
|
168
|
+
User ID:
|
|
169
|
+
{' '}
|
|
170
|
+
<strong>{userId}</strong>
|
|
191
171
|
</h5>
|
|
192
172
|
<h5>
|
|
193
|
-
Account ID:
|
|
173
|
+
Account ID:
|
|
174
|
+
{' '}
|
|
175
|
+
<strong>{accountId}</strong>
|
|
194
176
|
</h5>
|
|
195
177
|
<h5>
|
|
196
|
-
Document ID:
|
|
178
|
+
Document ID:
|
|
179
|
+
{' '}
|
|
180
|
+
<strong>{documentId}</strong>
|
|
197
181
|
</h5>
|
|
198
182
|
<h5>
|
|
199
|
-
Download ID:
|
|
183
|
+
Download ID:
|
|
184
|
+
{' '}
|
|
185
|
+
<strong>{downloadId}</strong>
|
|
200
186
|
</h5>
|
|
201
187
|
</div>
|
|
202
188
|
</div>
|
|
@@ -204,7 +190,7 @@ export default function PdfView({
|
|
|
204
190
|
<h5>{page}</h5>
|
|
205
191
|
</div>
|
|
206
192
|
</div>
|
|
207
|
-
|
|
193
|
+
</>
|
|
208
194
|
))}
|
|
209
195
|
</div>
|
|
210
196
|
);
|
|
@@ -218,5 +204,4 @@ PdfView.propTypes = {
|
|
|
218
204
|
userId: PropTypes.string,
|
|
219
205
|
accountId: PropTypes.string,
|
|
220
206
|
documentId: PropTypes.string,
|
|
221
|
-
|
|
222
|
-
};
|
|
207
|
+
}
|