@pdfme/ui 1.0.10 → 1.0.13
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/index.js +1 -1
- package/dist/index.js.LICENSE.txt +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CtlBar/Pager.tsx +2 -8
- package/src/components/CtlBar/Zoom.tsx +5 -3
- package/src/components/CtlBar/index.tsx +1 -1
- package/src/components/Designer/Main/index.tsx +1 -4
- package/src/components/Designer/Sidebar/index.tsx +1 -1
- package/src/components/Paper.tsx +2 -1
- package/src/components/Preview.tsx +8 -2
package/package.json
CHANGED
@@ -21,13 +21,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
|
|
21
21
|
const i18n = useContext(I18nContext);
|
22
22
|
|
23
23
|
return (
|
24
|
-
<div
|
25
|
-
style={{
|
26
|
-
display: 'flex',
|
27
|
-
alignItems: 'center',
|
28
|
-
justifyContent: 'center',
|
29
|
-
}}
|
30
|
-
>
|
24
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
31
25
|
<button
|
32
26
|
style={{
|
33
27
|
paddingLeft: '0.5rem',
|
@@ -39,7 +33,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
|
|
39
33
|
>
|
40
34
|
<img src={left} alt={i18n('goToPrevious')} style={{ width: 20 }} />
|
41
35
|
</button>
|
42
|
-
<strong style={{ color: 'white', fontSize: '0.9rem' }}>
|
36
|
+
<strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
|
43
37
|
{pageCursor + 1}/{pageNum}
|
44
38
|
</strong>
|
45
39
|
<button
|
@@ -33,20 +33,22 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
|
|
33
33
|
...btnStyle,
|
34
34
|
cursor: minZoom >= nextZoomOut ? 'not-allowed' : 'pointer',
|
35
35
|
}}
|
36
|
-
onClick={() => setZoomLevel(nextZoomOut)}
|
37
36
|
disabled={minZoom >= nextZoomOut}
|
37
|
+
onClick={() => setZoomLevel(nextZoomOut)}
|
38
38
|
>
|
39
39
|
<img src={remove} alt={i18n('zoomOut')} style={{ width: 20 }} />
|
40
40
|
</button>
|
41
|
-
<strong style={{ color: 'white', fontSize: '0.9rem'
|
41
|
+
<strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
|
42
|
+
{Math.round(zoomLevel * 100)}%
|
43
|
+
</strong>
|
42
44
|
<button
|
43
45
|
style={{
|
44
46
|
paddingRight: '0.5rem',
|
45
47
|
...btnStyle,
|
46
48
|
cursor: maxZoom < nextZoomIn ? 'not-allowed' : 'pointer',
|
47
49
|
}}
|
48
|
-
onClick={() => setZoomLevel(nextZoomIn)}
|
49
50
|
disabled={maxZoom < nextZoomIn}
|
51
|
+
onClick={() => setZoomLevel(nextZoomIn)}
|
50
52
|
>
|
51
53
|
<img src={add} alt={i18n('zoomIn')} style={{ width: 20 }} />
|
52
54
|
</button>
|
@@ -277,10 +277,7 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => {
|
|
277
277
|
}}
|
278
278
|
/>
|
279
279
|
{pageCursor !== index ? (
|
280
|
-
<Mask
|
281
|
-
width={paperSize.width + RULER_HEIGHT}
|
282
|
-
height={paperSize.height + RULER_HEIGHT * scale}
|
283
|
-
/>
|
280
|
+
<Mask width={paperSize.width + RULER_HEIGHT} height={paperSize.height} />
|
284
281
|
) : (
|
285
282
|
!editing && (
|
286
283
|
<Moveable
|
package/src/components/Paper.tsx
CHANGED
@@ -56,7 +56,8 @@ const Paper = (porps: {
|
|
56
56
|
}}
|
57
57
|
style={{
|
58
58
|
fontFamily: `'${getFallbackFontName(font)}'`,
|
59
|
-
|
59
|
+
top: `${RULER_HEIGHT}px`,
|
60
|
+
margin: '0 auto',
|
60
61
|
position: 'relative',
|
61
62
|
backgroundImage: `url(${background})`,
|
62
63
|
backgroundSize: `${paperSize.width}px ${paperSize.height}px`,
|
@@ -61,7 +61,10 @@ const Preview = ({ template, inputs, size, onChangeInput }: PreviewReactProps) =
|
|
61
61
|
return (
|
62
62
|
<Root ref={rootRef} size={size} scale={scale}>
|
63
63
|
<CtlBar
|
64
|
-
size={{
|
64
|
+
size={{
|
65
|
+
height: Math.max(size.height, pageSizesHeightSum),
|
66
|
+
width: Math.max(size.width, pageSizesMaxWidth),
|
67
|
+
}}
|
65
68
|
pageCursor={pageCursor}
|
66
69
|
pageNum={schemasList.length}
|
67
70
|
setPageCursor={(p) => {
|
@@ -78,7 +81,10 @@ const Preview = ({ template, inputs, size, onChangeInput }: PreviewReactProps) =
|
|
78
81
|
}}
|
79
82
|
/>
|
80
83
|
<UnitPager
|
81
|
-
size={{
|
84
|
+
size={{
|
85
|
+
height: Math.max(size.height, pageSizesHeightSum),
|
86
|
+
width: Math.max(size.width, pageSizesMaxWidth),
|
87
|
+
}}
|
82
88
|
unitCursor={unitCursor}
|
83
89
|
unitNum={inputs.length}
|
84
90
|
setUnitCursor={setUnitCursor}
|