react-pdf-levelup 3.1.7 → 3.1.17

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.cjs CHANGED
@@ -192,8 +192,12 @@ var LayoutPDF = ({
192
192
  const transformOrientation = (orientation2) => {
193
193
  switch (orientation2) {
194
194
  case "vertical":
195
+ case "portrait":
196
+ case "v":
195
197
  return "portrait";
196
198
  case "horizontal":
199
+ case "landscape":
200
+ case "h":
197
201
  return "landscape";
198
202
  default:
199
203
  console.warn(`Unrecognized orientation: ${orientation2}. Using portrait as default.`);
@@ -449,25 +453,25 @@ var styles5 = import_renderer5.StyleSheet.create({
449
453
  fontWeight: "bold",
450
454
  paddingLeft: 8,
451
455
  paddingRight: 8,
452
- justifyContent: "center",
453
- alignItems: "flex-start"
454
- // Changed from "left" to "flex-start"
456
+ justifyContent: "center"
455
457
  },
456
458
  text: {
457
459
  fontSize: 10,
458
460
  fontFamily: "Helvetica",
459
461
  paddingLeft: 8,
460
462
  paddingRight: 8,
461
- justifyContent: "center",
462
- alignItems: "flex-start"
463
- // Changed from "left" to "flex-start"
463
+ justifyContent: "center"
464
464
  },
465
465
  zebraOdd: {
466
466
  backgroundColor: "#eeeeee"
467
467
  }
468
468
  });
469
469
  var Table = ({ children, style, cellHeight = 22 }) => /* @__PURE__ */ import_react5.default.createElement(TableContext.Provider, { value: { cellHeight, textAlign: "left" } }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.table, style] }, children));
470
- var Thead = ({ children, style, textAlign = "left" }) => {
470
+ var Thead = ({
471
+ children,
472
+ style,
473
+ textAlign = "left"
474
+ }) => {
471
475
  const { cellHeight } = (0, import_react5.useContext)(TableContext);
472
476
  return /* @__PURE__ */ import_react5.default.createElement(TableContext.Provider, { value: { cellHeight, textAlign } }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.thead, style] }, children));
473
477
  };
@@ -487,7 +491,9 @@ var Tr = ({
487
491
  isLastRow = false,
488
492
  isOdd = false
489
493
  }) => {
490
- const elements = import_react5.default.Children.toArray(children);
494
+ const elements = import_react5.default.Children.toArray(
495
+ children
496
+ );
491
497
  const count = elements.length;
492
498
  return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [styles5.tr, style] }, elements.map((child, idx) => {
493
499
  const isLast = idx === count - 1;
@@ -515,14 +521,20 @@ var Th = ({
515
521
  borderColor: "#000",
516
522
  minHeight: cellHeightValue
517
523
  };
518
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [
519
- styles5.textBold,
524
+ return /* @__PURE__ */ import_react5.default.createElement(
525
+ import_renderer5.View,
520
526
  {
521
- width: baseWidth
527
+ style: [
528
+ styles5.textBold,
529
+ {
530
+ width: baseWidth
531
+ },
532
+ borders,
533
+ style
534
+ ]
522
535
  },
523
- borders,
524
- style
525
- ] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, { style: { textAlign: finalTextAlign } }, children));
536
+ /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, { style: { textAlign: finalTextAlign } }, children)
537
+ );
526
538
  };
527
539
  var Td = ({
528
540
  children,
@@ -545,15 +557,21 @@ var Td = ({
545
557
  borderColor: "#000",
546
558
  minHeight: cellHeightValue
547
559
  };
548
- return /* @__PURE__ */ import_react5.default.createElement(import_renderer5.View, { style: [
549
- styles5.text,
550
- isOdd && styles5.zebraOdd,
560
+ return /* @__PURE__ */ import_react5.default.createElement(
561
+ import_renderer5.View,
551
562
  {
552
- width: baseWidth
563
+ style: [
564
+ styles5.text,
565
+ isOdd && styles5.zebraOdd,
566
+ {
567
+ width: baseWidth
568
+ },
569
+ borders,
570
+ style
571
+ ]
553
572
  },
554
- borders,
555
- style
556
- ] }, /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, { style: { textAlign: finalTextAlign } }, children));
573
+ /* @__PURE__ */ import_react5.default.createElement(import_renderer5.Text, { style: { textAlign: finalTextAlign } }, children)
574
+ );
557
575
  };
558
576
 
559
577
  // src/components/core/Grid.tsx
package/dist/index.d.cts CHANGED
@@ -4,7 +4,7 @@ export { Font, StyleSheet, Text, View } from '@react-pdf/renderer';
4
4
  interface LayoutPDFProps {
5
5
  children: React$1.ReactNode;
6
6
  size?: string;
7
- orientation?: "vertical" | "horizontal";
7
+ orientation?: "vertical" | "horizontal" | "h" | "v" | "portrait" | "landscape";
8
8
  backgroundColor?: string;
9
9
  padding?: number;
10
10
  margen?: "apa" | "normal" | "estrecho" | "ancho";
@@ -66,7 +66,7 @@ interface TableProps {
66
66
  interface TheadProps {
67
67
  children: React$1.ReactNode;
68
68
  style?: any;
69
- textAlign?: 'left' | 'center' | 'right';
69
+ textAlign?: "left" | "center" | "right" | any;
70
70
  }
71
71
  interface CellProps {
72
72
  children?: React$1.ReactNode;
@@ -77,7 +77,7 @@ interface CellProps {
77
77
  isLast?: boolean;
78
78
  isLastRow?: boolean;
79
79
  isOdd?: boolean;
80
- textAlign?: 'left' | 'center' | 'right';
80
+ textAlign?: "left" | "center" | "right" | any;
81
81
  }
82
82
  declare const Table: React$1.FC<TableProps>;
83
83
  declare const Thead: React$1.FC<TheadProps>;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { Font, StyleSheet, Text, View } from '@react-pdf/renderer';
4
4
  interface LayoutPDFProps {
5
5
  children: React$1.ReactNode;
6
6
  size?: string;
7
- orientation?: "vertical" | "horizontal";
7
+ orientation?: "vertical" | "horizontal" | "h" | "v" | "portrait" | "landscape";
8
8
  backgroundColor?: string;
9
9
  padding?: number;
10
10
  margen?: "apa" | "normal" | "estrecho" | "ancho";
@@ -66,7 +66,7 @@ interface TableProps {
66
66
  interface TheadProps {
67
67
  children: React$1.ReactNode;
68
68
  style?: any;
69
- textAlign?: 'left' | 'center' | 'right';
69
+ textAlign?: "left" | "center" | "right" | any;
70
70
  }
71
71
  interface CellProps {
72
72
  children?: React$1.ReactNode;
@@ -77,7 +77,7 @@ interface CellProps {
77
77
  isLast?: boolean;
78
78
  isLastRow?: boolean;
79
79
  isOdd?: boolean;
80
- textAlign?: 'left' | 'center' | 'right';
80
+ textAlign?: "left" | "center" | "right" | any;
81
81
  }
82
82
  declare const Table: React$1.FC<TableProps>;
83
83
  declare const Thead: React$1.FC<TheadProps>;
package/dist/index.js CHANGED
@@ -105,8 +105,12 @@ var LayoutPDF = ({
105
105
  const transformOrientation = (orientation2) => {
106
106
  switch (orientation2) {
107
107
  case "vertical":
108
+ case "portrait":
109
+ case "v":
108
110
  return "portrait";
109
111
  case "horizontal":
112
+ case "landscape":
113
+ case "h":
110
114
  return "landscape";
111
115
  default:
112
116
  console.warn(`Unrecognized orientation: ${orientation2}. Using portrait as default.`);
@@ -362,25 +366,25 @@ var styles5 = StyleSheet5.create({
362
366
  fontWeight: "bold",
363
367
  paddingLeft: 8,
364
368
  paddingRight: 8,
365
- justifyContent: "center",
366
- alignItems: "flex-start"
367
- // Changed from "left" to "flex-start"
369
+ justifyContent: "center"
368
370
  },
369
371
  text: {
370
372
  fontSize: 10,
371
373
  fontFamily: "Helvetica",
372
374
  paddingLeft: 8,
373
375
  paddingRight: 8,
374
- justifyContent: "center",
375
- alignItems: "flex-start"
376
- // Changed from "left" to "flex-start"
376
+ justifyContent: "center"
377
377
  },
378
378
  zebraOdd: {
379
379
  backgroundColor: "#eeeeee"
380
380
  }
381
381
  });
382
382
  var Table = ({ children, style, cellHeight = 22 }) => /* @__PURE__ */ React5.createElement(TableContext.Provider, { value: { cellHeight, textAlign: "left" } }, /* @__PURE__ */ React5.createElement(View4, { style: [styles5.table, style] }, children));
383
- var Thead = ({ children, style, textAlign = "left" }) => {
383
+ var Thead = ({
384
+ children,
385
+ style,
386
+ textAlign = "left"
387
+ }) => {
384
388
  const { cellHeight } = useContext(TableContext);
385
389
  return /* @__PURE__ */ React5.createElement(TableContext.Provider, { value: { cellHeight, textAlign } }, /* @__PURE__ */ React5.createElement(View4, { style: [styles5.thead, style] }, children));
386
390
  };
@@ -400,7 +404,9 @@ var Tr = ({
400
404
  isLastRow = false,
401
405
  isOdd = false
402
406
  }) => {
403
- const elements = React5.Children.toArray(children);
407
+ const elements = React5.Children.toArray(
408
+ children
409
+ );
404
410
  const count = elements.length;
405
411
  return /* @__PURE__ */ React5.createElement(View4, { style: [styles5.tr, style] }, elements.map((child, idx) => {
406
412
  const isLast = idx === count - 1;
@@ -428,14 +434,20 @@ var Th = ({
428
434
  borderColor: "#000",
429
435
  minHeight: cellHeightValue
430
436
  };
431
- return /* @__PURE__ */ React5.createElement(View4, { style: [
432
- styles5.textBold,
437
+ return /* @__PURE__ */ React5.createElement(
438
+ View4,
433
439
  {
434
- width: baseWidth
440
+ style: [
441
+ styles5.textBold,
442
+ {
443
+ width: baseWidth
444
+ },
445
+ borders,
446
+ style
447
+ ]
435
448
  },
436
- borders,
437
- style
438
- ] }, /* @__PURE__ */ React5.createElement(Text3, { style: { textAlign: finalTextAlign } }, children));
449
+ /* @__PURE__ */ React5.createElement(Text3, { style: { textAlign: finalTextAlign } }, children)
450
+ );
439
451
  };
440
452
  var Td = ({
441
453
  children,
@@ -458,15 +470,21 @@ var Td = ({
458
470
  borderColor: "#000",
459
471
  minHeight: cellHeightValue
460
472
  };
461
- return /* @__PURE__ */ React5.createElement(View4, { style: [
462
- styles5.text,
463
- isOdd && styles5.zebraOdd,
473
+ return /* @__PURE__ */ React5.createElement(
474
+ View4,
464
475
  {
465
- width: baseWidth
476
+ style: [
477
+ styles5.text,
478
+ isOdd && styles5.zebraOdd,
479
+ {
480
+ width: baseWidth
481
+ },
482
+ borders,
483
+ style
484
+ ]
466
485
  },
467
- borders,
468
- style
469
- ] }, /* @__PURE__ */ React5.createElement(Text3, { style: { textAlign: finalTextAlign } }, children));
486
+ /* @__PURE__ */ React5.createElement(Text3, { style: { textAlign: finalTextAlign } }, children)
487
+ );
470
488
  };
471
489
 
472
490
  // src/components/core/Grid.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-pdf-levelup",
3
- "version": "3.1.7",
3
+ "version": "3.1.17",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -22,8 +22,8 @@
22
22
  "peerDependencies": {
23
23
  "@react-pdf/renderer": "^4.3.0",
24
24
  "qrcode": "^1.5.4",
25
- "react": "^18",
26
- "react-dom": "^18"
25
+ "react": "^19",
26
+ "react-dom": "^19"
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/standalone": "^7.23.10",
@@ -43,8 +43,8 @@
43
43
  "@react-pdf/types": "^2.9.0",
44
44
  "@types/jsdom": "^21.1.7",
45
45
  "@types/qrcode": "^1.5.5",
46
- "@types/react": "^18.2.56",
47
- "@types/react-dom": "^18.2.19",
46
+ "@types/react": "^19",
47
+ "@types/react-dom": "^19",
48
48
  "@vitejs/plugin-react": "^4.3.4",
49
49
  "eslint": "^9.21.0",
50
50
  "eslint-plugin-react-hooks": "^5.1.0",