@servicetitan/dte-pdf-editor 1.62.0 → 1.63.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/dist/components/pdf-view/pdf-view-field-container.d.ts.map +1 -1
- package/dist/components/pdf-view/pdf-view-field-container.js +8 -7
- package/dist/components/pdf-view/pdf-view-field-container.js.map +1 -1
- package/package.json +1 -1
- package/src/components/pdf-view/pdf-view-field-container.tsx +15 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-view-field-container.d.ts","sourceRoot":"","sources":["../../../src/components/pdf-view/pdf-view-field-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"pdf-view-field-container.d.ts","sourceRoot":"","sources":["../../../src/components/pdf-view/pdf-view-field-container.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQlE,UAAU,qBAAqB;IAC3B,aAAa,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,QAAQ,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAED,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CA4C9E,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from 'react';
|
|
2
3
|
import { evaluateDisplayCondition, getFieldBackgroundColor, getFieldBoundsStyle, getPagePosition, } from '../../utils';
|
|
3
4
|
export const PdfViewFieldContainer = ({ children, data, error, field, pdfWrapperRef, recipientsColors, }) => {
|
|
4
5
|
const visible = !field.displayCondition || evaluateDisplayCondition(field.displayCondition, data);
|
|
@@ -7,14 +8,14 @@ export const PdfViewFieldContainer = ({ children, data, error, field, pdfWrapper
|
|
|
7
8
|
}
|
|
8
9
|
const pagePos = getPagePosition(field.page, pdfWrapperRef);
|
|
9
10
|
const bgColor = getFieldBackgroundColor(field.recipient, recipientsColors);
|
|
10
|
-
return (_jsxs("div", { className: "dte-pdf-field-view", style: getFieldBoundsStyle(field, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
top: '100%',
|
|
11
|
+
return (_jsxs(Fragment, { children: [_jsx("div", { className: "dte-pdf-field-view", style: getFieldBoundsStyle(field, {
|
|
12
|
+
pageOffset: pagePos,
|
|
13
|
+
backgroundColor: bgColor,
|
|
14
|
+
borderColor: error ? 'red' : undefined,
|
|
15
|
+
}), children: children }), error && (_jsx("span", { style: {
|
|
16
16
|
color: 'red',
|
|
17
|
-
|
|
17
|
+
top: pagePos.top + field.y + field.height + 8,
|
|
18
|
+
left: pagePos.left + field.x,
|
|
18
19
|
minWidth: '100px',
|
|
19
20
|
position: 'absolute',
|
|
20
21
|
}, children: error }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-view-field-container.js","sourceRoot":"","sources":["../../../src/components/pdf-view/pdf-view-field-container.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"pdf-view-field-container.js","sourceRoot":"","sources":["../../../src/components/pdf-view/pdf-view-field-container.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAgC,MAAM,OAAO,CAAC;AAEnE,OAAO,EACH,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,GAClB,MAAM,aAAa,CAAC;AAUrB,MAAM,CAAC,MAAM,qBAAqB,GAAiD,CAAC,EAChF,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,KAAK,EACL,aAAa,EACb,gBAAgB,GACnB,EAAE,EAAE;IACD,MAAM,OAAO,GACT,CAAC,KAAK,CAAC,gBAAgB,IAAI,wBAAwB,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;IAEtF,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,uBAAuB,CAAC,KAAK,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAC3E,OAAO,CACH,MAAC,QAAQ,eACL,cACI,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE;oBAC9B,UAAU,EAAE,OAAO;oBACnB,eAAe,EAAE,OAAO;oBACxB,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;iBACzC,CAAC,YAED,QAAQ,GACP,EACL,KAAK,IAAI,CACN,eACI,KAAK,EAAE;oBACH,KAAK,EAAE,KAAK;oBACZ,GAAG,EAAE,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC;oBAC7C,IAAI,EAAE,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;oBAC5B,QAAQ,EAAE,OAAO;oBACjB,QAAQ,EAAE,UAAU;iBACvB,YAEA,KAAK,GACH,CACV,IACM,CACd,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, PropsWithChildren, RefObject } from 'react';
|
|
1
|
+
import { FC, Fragment, PropsWithChildren, RefObject } from 'react';
|
|
2
2
|
import { DataModelValues, PdfField } from '../../interface/types';
|
|
3
3
|
import {
|
|
4
4
|
evaluateDisplayCondition,
|
|
@@ -33,21 +33,23 @@ export const PdfViewFieldContainer: FC<PropsWithChildren<PdfViewFieldContainer>>
|
|
|
33
33
|
const pagePos = getPagePosition(field.page, pdfWrapperRef);
|
|
34
34
|
const bgColor = getFieldBackgroundColor(field.recipient, recipientsColors);
|
|
35
35
|
return (
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
<Fragment>
|
|
37
|
+
<div
|
|
38
|
+
className="dte-pdf-field-view"
|
|
39
|
+
style={getFieldBoundsStyle(field, {
|
|
40
|
+
pageOffset: pagePos,
|
|
41
|
+
backgroundColor: bgColor,
|
|
42
|
+
borderColor: error ? 'red' : undefined,
|
|
43
|
+
})}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</div>
|
|
45
47
|
{error && (
|
|
46
48
|
<span
|
|
47
49
|
style={{
|
|
48
|
-
top: '100%',
|
|
49
50
|
color: 'red',
|
|
50
|
-
|
|
51
|
+
top: pagePos.top + field.y + field.height + 8,
|
|
52
|
+
left: pagePos.left + field.x,
|
|
51
53
|
minWidth: '100px',
|
|
52
54
|
position: 'absolute',
|
|
53
55
|
}}
|
|
@@ -55,6 +57,6 @@ export const PdfViewFieldContainer: FC<PropsWithChildren<PdfViewFieldContainer>>
|
|
|
55
57
|
{error}
|
|
56
58
|
</span>
|
|
57
59
|
)}
|
|
58
|
-
</
|
|
60
|
+
</Fragment>
|
|
59
61
|
);
|
|
60
62
|
};
|