@pdfme/schemas 3.1.5-dev.9 → 3.2.0-dev.1

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.
Files changed (173) hide show
  1. package/dist/cjs/__tests__/{renderUtils.test.js → utils.test.js} +38 -12
  2. package/dist/cjs/__tests__/utils.test.js.map +1 -0
  3. package/dist/cjs/src/barcodes/constants.js +2 -1
  4. package/dist/cjs/src/barcodes/constants.js.map +1 -1
  5. package/dist/cjs/src/barcodes/helper.js +1 -2
  6. package/dist/cjs/src/barcodes/helper.js.map +1 -1
  7. package/dist/cjs/src/barcodes/index.js +2 -2
  8. package/dist/cjs/src/barcodes/index.js.map +1 -1
  9. package/dist/cjs/src/barcodes/pdfRender.js +3 -3
  10. package/dist/cjs/src/barcodes/pdfRender.js.map +1 -1
  11. package/dist/cjs/src/barcodes/propPanel.js +19 -2
  12. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  13. package/dist/cjs/src/barcodes/uiRender.js +9 -32
  14. package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
  15. package/dist/cjs/src/graphics/helper.js +115 -0
  16. package/dist/cjs/src/graphics/helper.js.map +1 -0
  17. package/dist/cjs/src/graphics/image.js +179 -0
  18. package/dist/cjs/src/graphics/image.js.map +1 -0
  19. package/dist/cjs/src/graphics/svg.js +96 -0
  20. package/dist/cjs/src/graphics/svg.js.map +1 -0
  21. package/dist/cjs/src/index.js +42 -11
  22. package/dist/cjs/src/index.js.map +1 -1
  23. package/dist/cjs/src/shapes/line.js +57 -0
  24. package/dist/cjs/src/shapes/line.js.map +1 -0
  25. package/dist/cjs/src/shapes/rectAndEllipse.js +100 -0
  26. package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -0
  27. package/dist/cjs/src/text/helper.js.map +1 -1
  28. package/dist/cjs/src/text/index.js +16 -2
  29. package/dist/cjs/src/text/index.js.map +1 -1
  30. package/dist/cjs/src/text/pdfRender.js +5 -5
  31. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  32. package/dist/cjs/src/text/uiRender.js +3 -3
  33. package/dist/cjs/src/text/uiRender.js.map +1 -1
  34. package/dist/cjs/src/{renderUtils.js → utils.js} +55 -7
  35. package/dist/cjs/src/utils.js.map +1 -0
  36. package/dist/esm/__tests__/{renderUtils.test.js → utils.test.js} +34 -8
  37. package/dist/esm/__tests__/utils.test.js.map +1 -0
  38. package/dist/esm/src/barcodes/constants.js +1 -0
  39. package/dist/esm/src/barcodes/constants.js.map +1 -1
  40. package/dist/esm/src/barcodes/helper.js +2 -3
  41. package/dist/esm/src/barcodes/helper.js.map +1 -1
  42. package/dist/esm/src/barcodes/index.js +2 -2
  43. package/dist/esm/src/barcodes/index.js.map +1 -1
  44. package/dist/esm/src/barcodes/pdfRender.js +2 -2
  45. package/dist/esm/src/barcodes/pdfRender.js.map +1 -1
  46. package/dist/esm/src/barcodes/propPanel.js +20 -3
  47. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  48. package/dist/esm/src/barcodes/uiRender.js +9 -32
  49. package/dist/esm/src/barcodes/uiRender.js.map +1 -1
  50. package/dist/esm/src/graphics/helper.js +111 -0
  51. package/dist/esm/src/graphics/helper.js.map +1 -0
  52. package/dist/esm/src/graphics/image.js +176 -0
  53. package/dist/esm/src/graphics/image.js.map +1 -0
  54. package/dist/esm/src/graphics/svg.js +93 -0
  55. package/dist/esm/src/graphics/svg.js.map +1 -0
  56. package/dist/esm/src/index.js +7 -5
  57. package/dist/esm/src/index.js.map +1 -1
  58. package/dist/esm/src/shapes/line.js +55 -0
  59. package/dist/esm/src/shapes/line.js.map +1 -0
  60. package/dist/esm/src/shapes/rectAndEllipse.js +97 -0
  61. package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -0
  62. package/dist/esm/src/text/helper.js.map +1 -1
  63. package/dist/esm/src/text/index.js +15 -2
  64. package/dist/esm/src/text/index.js.map +1 -1
  65. package/dist/esm/src/text/pdfRender.js +1 -1
  66. package/dist/esm/src/text/pdfRender.js.map +1 -1
  67. package/dist/esm/src/text/uiRender.js +2 -2
  68. package/dist/esm/src/text/uiRender.js.map +1 -1
  69. package/dist/esm/src/{renderUtils.js → utils.js} +52 -6
  70. package/dist/esm/src/utils.js.map +1 -0
  71. package/dist/types/src/barcodes/constants.d.ts +1 -0
  72. package/dist/types/src/barcodes/helper.d.ts +1 -0
  73. package/dist/types/src/barcodes/index.d.ts +2 -2
  74. package/dist/types/src/barcodes/types.d.ts +1 -0
  75. package/dist/types/src/graphics/helper.d.ts +5 -0
  76. package/dist/types/src/graphics/image.d.ts +7 -0
  77. package/dist/types/src/graphics/svg.d.ts +6 -0
  78. package/dist/types/src/index.d.ts +7 -5
  79. package/dist/types/src/shapes/line.d.ts +6 -0
  80. package/dist/types/src/shapes/rectAndEllipse.d.ts +144 -0
  81. package/dist/types/src/text/index.d.ts +3 -2
  82. package/dist/types/src/text/pdfRender.d.ts +1 -1
  83. package/dist/types/src/{renderUtils.d.ts → utils.d.ts} +3 -1
  84. package/package.json +4 -3
  85. package/src/barcodes/constants.ts +2 -0
  86. package/src/barcodes/helper.ts +12 -3
  87. package/src/barcodes/index.ts +2 -2
  88. package/src/barcodes/pdfRender.ts +2 -2
  89. package/src/barcodes/propPanel.ts +25 -3
  90. package/src/barcodes/types.ts +1 -0
  91. package/src/barcodes/uiRender.ts +9 -36
  92. package/src/graphics/helper.ts +147 -0
  93. package/src/graphics/image.ts +207 -0
  94. package/src/graphics/svg.ts +98 -0
  95. package/src/index.ts +21 -5
  96. package/src/shapes/line.ts +67 -0
  97. package/src/shapes/rectAndEllipse.ts +110 -0
  98. package/src/text/helper.ts +0 -1
  99. package/src/text/index.ts +17 -2
  100. package/src/text/pdfRender.ts +2 -2
  101. package/src/text/uiRender.ts +2 -2
  102. package/src/{renderUtils.ts → utils.ts} +61 -5
  103. package/dist/cjs/__tests__/renderUtils.test.js.map +0 -1
  104. package/dist/cjs/src/image/index.js +0 -8
  105. package/dist/cjs/src/image/index.js.map +0 -1
  106. package/dist/cjs/src/image/pdfRender.js +0 -22
  107. package/dist/cjs/src/image/pdfRender.js.map +0 -1
  108. package/dist/cjs/src/image/propPanel.js +0 -19
  109. package/dist/cjs/src/image/propPanel.js.map +0 -1
  110. package/dist/cjs/src/image/types.js +0 -3
  111. package/dist/cjs/src/image/types.js.map +0 -1
  112. package/dist/cjs/src/image/uiRender.js +0 -111
  113. package/dist/cjs/src/image/uiRender.js.map +0 -1
  114. package/dist/cjs/src/line/constants.js +0 -5
  115. package/dist/cjs/src/line/constants.js.map +0 -1
  116. package/dist/cjs/src/line/index.js +0 -8
  117. package/dist/cjs/src/line/index.js.map +0 -1
  118. package/dist/cjs/src/line/pdfRender.js +0 -20
  119. package/dist/cjs/src/line/pdfRender.js.map +0 -1
  120. package/dist/cjs/src/line/propPanel.js +0 -35
  121. package/dist/cjs/src/line/propPanel.js.map +0 -1
  122. package/dist/cjs/src/line/types.js +0 -3
  123. package/dist/cjs/src/line/types.js.map +0 -1
  124. package/dist/cjs/src/line/uiRender.js +0 -14
  125. package/dist/cjs/src/line/uiRender.js.map +0 -1
  126. package/dist/cjs/src/renderUtils.js.map +0 -1
  127. package/dist/esm/__tests__/renderUtils.test.js.map +0 -1
  128. package/dist/esm/src/image/index.js +0 -6
  129. package/dist/esm/src/image/index.js.map +0 -1
  130. package/dist/esm/src/image/pdfRender.js +0 -18
  131. package/dist/esm/src/image/pdfRender.js.map +0 -1
  132. package/dist/esm/src/image/propPanel.js +0 -16
  133. package/dist/esm/src/image/propPanel.js.map +0 -1
  134. package/dist/esm/src/image/types.js +0 -2
  135. package/dist/esm/src/image/types.js.map +0 -1
  136. package/dist/esm/src/image/uiRender.js +0 -107
  137. package/dist/esm/src/image/uiRender.js.map +0 -1
  138. package/dist/esm/src/line/constants.js +0 -2
  139. package/dist/esm/src/line/constants.js.map +0 -1
  140. package/dist/esm/src/line/index.js +0 -6
  141. package/dist/esm/src/line/index.js.map +0 -1
  142. package/dist/esm/src/line/pdfRender.js +0 -16
  143. package/dist/esm/src/line/pdfRender.js.map +0 -1
  144. package/dist/esm/src/line/propPanel.js +0 -32
  145. package/dist/esm/src/line/propPanel.js.map +0 -1
  146. package/dist/esm/src/line/types.js +0 -2
  147. package/dist/esm/src/line/types.js.map +0 -1
  148. package/dist/esm/src/line/uiRender.js +0 -10
  149. package/dist/esm/src/line/uiRender.js.map +0 -1
  150. package/dist/esm/src/renderUtils.js.map +0 -1
  151. package/dist/types/src/image/index.d.ts +0 -4
  152. package/dist/types/src/image/pdfRender.d.ts +0 -3
  153. package/dist/types/src/image/propPanel.d.ts +0 -3
  154. package/dist/types/src/image/types.d.ts +0 -3
  155. package/dist/types/src/image/uiRender.d.ts +0 -3
  156. package/dist/types/src/line/constants.d.ts +0 -1
  157. package/dist/types/src/line/index.d.ts +0 -4
  158. package/dist/types/src/line/pdfRender.d.ts +0 -3
  159. package/dist/types/src/line/propPanel.d.ts +0 -3
  160. package/dist/types/src/line/types.d.ts +0 -4
  161. package/dist/types/src/line/uiRender.d.ts +0 -3
  162. package/src/image/index.ts +0 -8
  163. package/src/image/pdfRender.ts +0 -29
  164. package/src/image/propPanel.ts +0 -19
  165. package/src/image/types.ts +0 -3
  166. package/src/image/uiRender.ts +0 -121
  167. package/src/line/constants.ts +0 -1
  168. package/src/line/index.ts +0 -8
  169. package/src/line/pdfRender.ts +0 -24
  170. package/src/line/propPanel.ts +0 -34
  171. package/src/line/types.ts +0 -5
  172. package/src/line/uiRender.ts +0 -12
  173. /package/dist/types/__tests__/{renderUtils.test.d.ts → utils.test.d.ts} +0 -0
@@ -4,7 +4,7 @@ exports.pdfRender = void 0;
4
4
  const common_1 = require("@pdfme/common");
5
5
  const constants_js_1 = require("./constants.js");
6
6
  const helper_js_1 = require("./helper.js");
7
- const renderUtils_js_1 = require("../renderUtils.js");
7
+ const utils_js_1 = require("../utils.js");
8
8
  const embedAndGetFontObj = async (arg) => {
9
9
  const { pdfDoc, font, _cache } = arg;
10
10
  if (_cache.has(pdfDoc)) {
@@ -27,7 +27,7 @@ const getFontProp = async ({ value, font, schema, _cache, }) => {
27
27
  const fontSize = schema.dynamicFontSize
28
28
  ? await (0, helper_js_1.calculateDynamicFontSize)({ textSchema: schema, font, value, _cache })
29
29
  : schema.fontSize ?? constants_js_1.DEFAULT_FONT_SIZE;
30
- const color = (0, renderUtils_js_1.hex2RgbColor)(schema.fontColor || constants_js_1.DEFAULT_FONT_COLOR);
30
+ const color = (0, utils_js_1.hex2RgbColor)(schema.fontColor || constants_js_1.DEFAULT_FONT_COLOR);
31
31
  return {
32
32
  alignment: schema.alignment ?? constants_js_1.DEFAULT_ALIGNMENT,
33
33
  verticalAlignment: schema.verticalAlignment ?? constants_js_1.DEFAULT_VERTICAL_ALIGNMENT,
@@ -51,9 +51,9 @@ const pdfRender = async (arg) => {
51
51
  const fontName = (schema.fontName ? schema.fontName : (0, common_1.getFallbackFontName)(font));
52
52
  const pdfFontValue = pdfFontObj && pdfFontObj[fontName];
53
53
  const pageHeight = page.getHeight();
54
- const { width, height, rotate, position: { x, y }, opacity, } = (0, renderUtils_js_1.convertForPdfLayoutProps)({ schema, pageHeight, applyRotateTranslate: false });
54
+ const { width, height, rotate, position: { x, y }, opacity, } = (0, utils_js_1.convertForPdfLayoutProps)({ schema, pageHeight, applyRotateTranslate: false });
55
55
  if (schema.backgroundColor) {
56
- const color = (0, renderUtils_js_1.hex2RgbColor)(schema.backgroundColor);
56
+ const color = (0, utils_js_1.hex2RgbColor)(schema.backgroundColor);
57
57
  page.drawRectangle({ x, y, width, height, rotate, color });
58
58
  }
59
59
  page.pushOperators(pdfLib.setCharacterSpacing(characterSpacing ?? constants_js_1.DEFAULT_CHARACTER_SPACING));
@@ -100,7 +100,7 @@ const pdfRender = async (arg) => {
100
100
  if (rotate.angle !== 0) {
101
101
  // As we draw each line individually from different points, we must translate each lines position
102
102
  // relative to the UI rotation pivot point. see comments in convertForPdfLayoutProps() for more info.
103
- const rotatedPoint = (0, renderUtils_js_1.rotatePoint)({ x: xLine, y: yLine }, pivotPoint, rotate.angle);
103
+ const rotatedPoint = (0, utils_js_1.rotatePoint)({ x: xLine, y: yLine }, pivotPoint, rotate.angle);
104
104
  xLine = rotatedPoint.x;
105
105
  yLine = rotatedPoint.y;
106
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pdfRender.js","sourceRoot":"","sources":["../../../../src/text/pdfRender.ts"],"names":[],"mappings":";;;AACA,0CAAiG;AAEjG,iDAUwB;AACxB,2CAOqB;AACrB,sDAAwF;AAExF,MAAM,kBAAkB,GAAG,KAAK,EAAE,GAIjC,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACrC,IAAI,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACtB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAA+B,CAAC;KACzD;IAED,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,GAAG,CAClC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAClC,IAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC;QACtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAC/D,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;SACnE;QACD,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;YAChC,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM;SAC1D,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC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IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YAClB,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,KAAK;YACR,MAAM;YACN,IAAI,EAAE,QAAQ;YACd,KAAK;YACL,UAAU,EAAE,UAAU,GAAG,QAAQ;YACjC,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,YAAY;YAClB,UAAU,EAAE,CAAC,EAAE,CAAC;YAChB,OAAO;SACR,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAtGW,QAAA,SAAS,aAsGpB"}
@@ -4,7 +4,7 @@ exports.uiRender = void 0;
4
4
  const common_1 = require("@pdfme/common");
5
5
  const constants_js_1 = require("./constants.js");
6
6
  const helper_js_1 = require("./helper.js");
7
- const renderUtils_js_1 = require("../renderUtils.js");
7
+ const utils_js_1 = require("../utils.js");
8
8
  const mapVerticalAlignToFlex = (verticalAlignmentValue) => {
9
9
  switch (verticalAlignmentValue) {
10
10
  case constants_js_1.VERTICAL_ALIGN_TOP:
@@ -47,7 +47,7 @@ const uiRender = async (arg) => {
47
47
  const containerStyle = {
48
48
  padding: 0,
49
49
  resize: 'none',
50
- backgroundColor: getBackgroundColor(value, schema, (0, renderUtils_js_1.addAlphaToHex)(theme.colorPrimaryBg, 30)),
50
+ backgroundColor: getBackgroundColor(value, schema, (0, utils_js_1.addAlphaToHex)(theme.colorPrimaryBg, 30)),
51
51
  border: 'none',
52
52
  display: 'flex',
53
53
  flexDirection: 'column',
@@ -78,7 +78,7 @@ const uiRender = async (arg) => {
78
78
  };
79
79
  const textBlock = document.createElement('div');
80
80
  Object.assign(textBlock.style, textBlockStyle);
81
- if ((0, renderUtils_js_1.isEditable)(mode)) {
81
+ if ((0, utils_js_1.isEditable)(mode, schema)) {
82
82
  textBlock.contentEditable = 'plaintext-only';
83
83
  textBlock.tabIndex = tabIndex || 0;
84
84
  textBlock.innerText = value;
@@ -1 +1 @@
1
- {"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../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,EAAE;YACvB,SAAS,CAAC,KAAK,EAAE,CAAC;YAElB,8FAA8F;YAC9F,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;YACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;YACrC,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACpC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,4BAA4B;YACnD,SAAS,EAAE,eAAe,EAAE,CAAC;YAC7B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC5B;KACF;SAAM;QACL,SAAS,CAAC,SAAS,GAAG,KAAK;aACxB,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CACF,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CACvB,+BACE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SACvC,MAAM,CAAC,SAAS,CACnB;aACA,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAClC;AACH,CAAC,CAAC;AAvJW,QAAA,QAAQ,YAuJnB"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hex2RgbColor = exports.isEditable = exports.addAlphaToHex = exports.rotatePoint = exports.convertForPdfLayoutProps = void 0;
3
+ exports.createErrorElm = exports.readFile = exports.hex2RgbColor = exports.isEditable = exports.addAlphaToHex = exports.rotatePoint = exports.convertForPdfLayoutProps = void 0;
4
4
  const pdf_lib_1 = require("@pdfme/pdf-lib");
5
5
  const common_1 = require("@pdfme/common");
6
6
  const convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = true, }) => {
@@ -23,10 +23,7 @@ const convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = t
23
23
  y = rotatedPoint.y;
24
24
  }
25
25
  return {
26
- position: {
27
- x: x,
28
- y: y,
29
- },
26
+ position: { x, y },
30
27
  height: height,
31
28
  width: width,
32
29
  rotate: (0, pdf_lib_1.degrees)(rotateDegrees),
@@ -56,7 +53,7 @@ const addAlphaToHex = (hex, alphaPercentage) => {
56
53
  return hex + alphaHex;
57
54
  };
58
55
  exports.addAlphaToHex = addAlphaToHex;
59
- const isEditable = (mode) => mode === 'form' || mode === 'designer';
56
+ const isEditable = (mode, schema) => mode === 'designer' || (mode === 'form' && schema.readOnly !== true);
60
57
  exports.isEditable = isEditable;
61
58
  const hex2rgb = (hex) => {
62
59
  if (hex.slice(0, 1) === '#')
@@ -83,4 +80,55 @@ const hex2RgbColor = (hexString) => {
83
80
  return undefined;
84
81
  };
85
82
  exports.hex2RgbColor = hex2RgbColor;
86
- //# sourceMappingURL=renderUtils.js.map
83
+ const readFile = (input) => new Promise((resolve, reject) => {
84
+ const fileReader = new FileReader();
85
+ fileReader.onload = (e) => {
86
+ if (e.target?.result) {
87
+ resolve(e.target.result);
88
+ }
89
+ };
90
+ fileReader.onerror = (e) => {
91
+ reject(new Error('[@pdfme/schemas] File reading failed'));
92
+ };
93
+ let file = null;
94
+ if (input instanceof FileList && input.length > 0) {
95
+ file = input[0];
96
+ }
97
+ else if (input instanceof File) {
98
+ file = input;
99
+ }
100
+ if (file) {
101
+ fileReader.readAsDataURL(file);
102
+ }
103
+ else {
104
+ reject(new Error('[@pdfme/schemas] No files provided'));
105
+ }
106
+ });
107
+ exports.readFile = readFile;
108
+ const createErrorElm = () => {
109
+ const container = document.createElement('div');
110
+ const containerStyle = {
111
+ display: 'flex',
112
+ alignItems: 'center',
113
+ justifyContent: 'center',
114
+ width: '100%',
115
+ height: '100%',
116
+ };
117
+ Object.assign(container.style, containerStyle);
118
+ const span = document.createElement('span');
119
+ const spanStyle = {
120
+ color: 'white',
121
+ background: 'red',
122
+ padding: '0.25rem',
123
+ fontSize: '12pt',
124
+ fontWeight: 'bold',
125
+ borderRadius: '2px',
126
+ fontFamily: "'Open Sans', sans-serif",
127
+ };
128
+ Object.assign(span.style, spanStyle);
129
+ span.textContent = 'ERROR';
130
+ container.appendChild(span);
131
+ return container;
132
+ };
133
+ exports.createErrorElm = createErrorElm;
134
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":";;;AACA,4CAAgE;AAChE,0CAAgE;AAEzD,MAAM,wBAAwB,GAAG,CAAC,EACvC,MAAM,EACN,UAAU,EACV,oBAAoB,GAAG,IAAI,GAK5B,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAC/E,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC;IAEpC,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAA,cAAK,EAAC,GAAG,CAAC,CAAC;IACnB,2FAA2F;IAC3F,IAAI,CAAC,GAAG,UAAU,GAAG,IAAA,cAAK,EAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IAEzC,IAAI,aAAa,IAAI,oBAAoB,EAAE;QACzC,mFAAmF;QACnF,oFAAoF;QACpF,8DAA8D;QAC9D,+FAA+F;QAC/F,MAAM,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,IAAA,cAAK,EAAC,GAAG,CAAC,GAAG,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C3B,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AA3BW,QAAA,cAAc,kBA2BzB"}
@@ -1,5 +1,31 @@
1
1
  import { mm2pt, pt2mm } from '@pdfme/common';
2
- import { convertForPdfLayoutProps, rotatePoint } from '../src/renderUtils';
2
+ import { convertForPdfLayoutProps, rotatePoint, hex2RgbColor } from '../src/utils';
3
+ describe('hex2RgbColor', () => {
4
+ it('should convert hex to rgb', () => {
5
+ const hex = '#000000';
6
+ const rgbValue = hex2RgbColor(hex);
7
+ expect(rgbValue).toEqual({ red: 0, green: 0, blue: 0, type: 'RGB' });
8
+ });
9
+ it('should convert hex to rgb with a short hex', () => {
10
+ const hex = '#fff';
11
+ const rgbValue = hex2RgbColor(hex);
12
+ expect(rgbValue).toEqual({ red: 1, green: 1, blue: 1, type: 'RGB' });
13
+ });
14
+ it('should convert hex to rgb for non-trivial color', () => {
15
+ const hex = '#33af5a';
16
+ const rgbValue = hex2RgbColor(hex);
17
+ expect(rgbValue).toEqual({
18
+ red: 0.2,
19
+ green: 0.6862745098039216,
20
+ blue: 0.35294117647058826,
21
+ type: 'RGB',
22
+ });
23
+ });
24
+ it('should throw an error if hex is invalid', () => {
25
+ const hex = '#fffee';
26
+ expect(() => hex2RgbColor(hex)).toThrowError('Invalid hex color value #ff');
27
+ });
28
+ });
3
29
  describe('rotatePoint', () => {
4
30
  it('should rotate one point round another by 90 degrees', () => {
5
31
  const point = { x: 5, y: 5 };
@@ -42,10 +68,10 @@ describe('convertForPdfLayoutProps', () => {
42
68
  height: 100,
43
69
  position: { x: 100, y: 100 },
44
70
  rotate: 0,
45
- opacity: 1
71
+ opacity: 1,
46
72
  };
47
73
  const pageHeight = 1000;
48
- const { position: { x, y }, height, width, rotate, opacity } = convertForPdfLayoutProps({ schema, pageHeight });
74
+ const { position: { x, y }, height, width, rotate, opacity, } = convertForPdfLayoutProps({ schema, pageHeight });
49
75
  expect(opacity).toEqual(schema.opacity);
50
76
  expect(height).toEqual(mm2pt(schema.height));
51
77
  expect(width).toEqual(mm2pt(schema.width));
@@ -60,10 +86,10 @@ describe('convertForPdfLayoutProps', () => {
60
86
  height: 120,
61
87
  position: { x: 100, y: 100 },
62
88
  rotate: 90,
63
- opacity: 1
89
+ opacity: 1,
64
90
  };
65
91
  const pageHeight = 1000;
66
- const { position: { x, y }, height, width, rotate, opacity } = convertForPdfLayoutProps({ schema, pageHeight });
92
+ const { position: { x, y }, height, width, rotate, opacity, } = convertForPdfLayoutProps({ schema, pageHeight });
67
93
  expect(opacity).toBeCloseTo(1);
68
94
  expect(pt2mm(width)).toBeCloseTo(50);
69
95
  expect(pt2mm(height)).toBeCloseTo(120.005);
@@ -78,10 +104,10 @@ describe('convertForPdfLayoutProps', () => {
78
104
  height: 120,
79
105
  position: { x: 100, y: 100 },
80
106
  rotate: 90,
81
- opacity: 1
107
+ opacity: 1,
82
108
  };
83
109
  const pageHeight = 1000;
84
- const { position: { x, y }, height, width, rotate, opacity } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
110
+ const { position: { x, y }, height, width, rotate, opacity, } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
85
111
  expect(opacity).toBeCloseTo(1);
86
112
  expect(pt2mm(width)).toBeCloseTo(50);
87
113
  expect(pt2mm(height)).toBeCloseTo(120.005);
@@ -90,4 +116,4 @@ describe('convertForPdfLayoutProps', () => {
90
116
  expect(rotate).toEqual({ angle: -90, type: 'degrees' });
91
117
  });
92
118
  });
93
- //# sourceMappingURL=renderUtils.test.js.map
119
+ //# sourceMappingURL=utils.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../../__tests__/utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,YAAY,EAAE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MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;QAC1E,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -13,4 +13,5 @@ export const BARCODE_TYPES = [
13
13
  ];
14
14
  export const DEFAULT_BARCODE_BG_COLOR = '#ffffff';
15
15
  export const DEFAULT_BARCODE_COLOR = '#000000';
16
+ export const DEFAULT_BARCODE_INCLUDETEXT = true;
16
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/barcodes/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,WAAW;IACX,OAAO;IACP,MAAM;IACN,QAAQ;IACR,SAAS;IACT,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,eAAe;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/barcodes/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,WAAW;IACX,OAAO;IACP,MAAM;IACN,QAAQ;IACR,SAAS;IACT,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,eAAe;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { b64toUint8Array } from '@pdfme/common';
2
2
  import bwipjs from 'bwip-js';
3
- import { BARCODE_TYPES } from './constants.js';
3
+ import { BARCODE_TYPES, DEFAULT_BARCODE_INCLUDETEXT } from './constants.js';
4
4
  // GTIN-13, GTIN-8, GTIN-12, GTIN-14
5
5
  const validateCheckDigit = (input, checkDigitPos) => {
6
6
  let passCheckDigit = true;
@@ -101,9 +101,8 @@ export const barCodeType2Bcid = (type) => type === 'nw7' ? 'rationalizedCodabar'
101
101
  */
102
102
  export const mapHexColorForBwipJsLib = (color, fallback) => color ? color.replace('#', '') : fallback ? fallback.replace('#', '') : '000000';
103
103
  export const createBarCode = async (arg) => {
104
- const { type, input, width, height, backgroundColor, barColor, textColor } = arg;
104
+ const { type, input, width, height, backgroundColor, barColor, textColor, includetext = DEFAULT_BARCODE_INCLUDETEXT, } = arg;
105
105
  const bcid = barCodeType2Bcid(type);
106
- const includetext = true;
107
106
  const scale = 5;
108
107
  const bwipjsArg = { bcid, text: input, width, height, scale, includetext };
109
108
  if (backgroundColor)
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../src/barcodes/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,MAAyB,MAAM,SAAS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,GAAkB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAE1F,IAAI,eAAe;QAAE,SAAS,CAAC,eAAe,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;IAC1F,IAAI,QAAQ;QAAE,SAAS,CAAC,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACrE,IAAI,SAAS;QAAE,SAAS,CAAC,SAAS,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAExE,IAAI,GAAW,CAAC;IAEhB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,aAAa;QACb,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9C,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,MAAgB,CAAC;KACjD;SAAM;QACL,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;KACxC;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -2,8 +2,8 @@ import { pdfRender } from './pdfRender.js';
2
2
  import { getPropPanelByBarcodeType } from './propPanel.js';
3
3
  import { uiRender } from './uiRender.js';
4
4
  import { BARCODE_TYPES } from './constants.js';
5
- const schemas = BARCODE_TYPES.reduce((acc, type) => Object.assign(acc, {
5
+ const barcodes = BARCODE_TYPES.reduce((acc, type) => Object.assign(acc, {
6
6
  [type]: { pdf: pdfRender, ui: uiRender, propPanel: getPropPanelByBarcodeType(type) },
7
7
  }), {});
8
- export default schemas;
8
+ export default barcodes;
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/barcodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;IACjB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAyB,CAAC,IAAI,CAAC,EAAE;CACrF,CAAC,EACJ,EAAiD,CAClD,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/barcodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CACnC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;IACjB,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAyB,CAAC,IAAI,CAAC,EAAE;CACrF,CAAC,EACJ,EAAiD,CAClD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,7 +1,7 @@
1
- import { convertForPdfLayoutProps } from '../renderUtils.js';
1
+ import { convertForPdfLayoutProps } from '../utils.js';
2
2
  import { createBarCode, validateBarcodeInput } from './helper.js';
3
3
  const getBarcodeCacheKey = (schema, value) => {
4
- return `${schema.type}${schema.backgroundColor}${schema.barColor}${schema.textColor}${value}`;
4
+ return `${schema.type}${schema.backgroundColor}${schema.barColor}${schema.textColor}${value}${schema.includetext}`;
5
5
  };
6
6
  export const pdfRender = async (arg) => {
7
7
  const { value, schema, pdfDoc, page, _cache } = arg;
@@ -1 +1 @@
1
- {"version":3,"file":"pdfRender.js","sourceRoot":"","sources":["../../../../src/barcodes/pdfRender.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,kBAAkB,GAAG,CAAC,MAAqB,EAAE,KAAa,EAAE,EAAE;IAClE,OAAO,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS,GAAG,KAAK,EAAE,CAAC;AAChG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,GAAkC,EAAE,EAAE;IACpE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACpD,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO;IAEtD,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/D,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,QAAQ,GAAG,MAAM,aAAa,CAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EA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,OAAO;IAEtD,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/D,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,QAAQ,GAAG,MAAM,aAAa,CAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAC3D,CAAC;QACF,KAAK,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;KACzC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IACpC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAClB,OAAO,GACR,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAErD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
- import { DEFAULT_BARCODE_COLOR, DEFAULT_BARCODE_BG_COLOR } from './constants.js';
1
+ import { DEFAULT_BARCODE_COLOR, DEFAULT_BARCODE_BG_COLOR, DEFAULT_BARCODE_INCLUDETEXT, } from './constants.js';
2
2
  import { DEFAULT_OPACITY, HEX_COLOR_PATTERN } from '../constants.js';
3
3
  const defaultColors = {
4
4
  backgroundColor: DEFAULT_BARCODE_BG_COLOR,
5
5
  barColor: DEFAULT_BARCODE_COLOR,
6
6
  };
7
7
  const defaultTextColors = { textColor: DEFAULT_BARCODE_COLOR };
8
+ const defaultIncludetext = { includetext: DEFAULT_BARCODE_INCLUDETEXT };
8
9
  const position = { x: 0, y: 0 };
9
10
  const default40x20 = { width: 40, height: 20 };
10
11
  const barcodeDefaults = [
@@ -27,6 +28,7 @@ const barcodeDefaults = [
27
28
  position,
28
29
  ...defaultColors,
29
30
  ...defaultTextColors,
31
+ ...defaultIncludetext,
30
32
  width: 80,
31
33
  height: 7.2,
32
34
  rotate: 0,
@@ -40,6 +42,7 @@ const barcodeDefaults = [
40
42
  position,
41
43
  ...defaultColors,
42
44
  ...defaultTextColors,
45
+ ...defaultIncludetext,
43
46
  ...default40x20,
44
47
  height: 16,
45
48
  rotate: 0,
@@ -53,6 +56,7 @@ const barcodeDefaults = [
53
56
  position,
54
57
  ...defaultColors,
55
58
  ...defaultTextColors,
59
+ ...defaultIncludetext,
56
60
  ...default40x20,
57
61
  rotate: 0,
58
62
  opacity: DEFAULT_OPACITY,
@@ -65,6 +69,7 @@ const barcodeDefaults = [
65
69
  position,
66
70
  ...defaultColors,
67
71
  ...defaultTextColors,
72
+ ...defaultIncludetext,
68
73
  ...default40x20,
69
74
  opacity: DEFAULT_OPACITY,
70
75
  },
@@ -76,6 +81,7 @@ const barcodeDefaults = [
76
81
  position,
77
82
  ...defaultColors,
78
83
  ...defaultTextColors,
84
+ ...defaultIncludetext,
79
85
  ...default40x20,
80
86
  rotate: 0,
81
87
  opacity: DEFAULT_OPACITY,
@@ -88,6 +94,7 @@ const barcodeDefaults = [
88
94
  position,
89
95
  ...defaultColors,
90
96
  ...defaultTextColors,
97
+ ...defaultIncludetext,
91
98
  ...default40x20,
92
99
  rotate: 0,
93
100
  opacity: DEFAULT_OPACITY,
@@ -100,6 +107,7 @@ const barcodeDefaults = [
100
107
  position,
101
108
  ...defaultColors,
102
109
  ...defaultTextColors,
110
+ ...defaultIncludetext,
103
111
  ...default40x20,
104
112
  height: 12,
105
113
  rotate: 0,
@@ -113,6 +121,7 @@ const barcodeDefaults = [
113
121
  position,
114
122
  ...defaultColors,
115
123
  ...defaultTextColors,
124
+ ...defaultIncludetext,
116
125
  ...default40x20,
117
126
  height: 16,
118
127
  rotate: 0,
@@ -126,6 +135,7 @@ const barcodeDefaults = [
126
135
  position,
127
136
  ...defaultColors,
128
137
  ...defaultTextColors,
138
+ ...defaultIncludetext,
129
139
  ...default40x20,
130
140
  rotate: 0,
131
141
  opacity: DEFAULT_OPACITY,
@@ -148,7 +158,7 @@ export const getPropPanelByBarcodeType = (barcodeType) => {
148
158
  const barcodeHasText = barcodeType !== 'qrcode' && barcodeType !== 'gs1datamatrix';
149
159
  const defaults = barcodeDefaults.find(({ defaultSchema }) => defaultSchema.type === barcodeType);
150
160
  if (!defaults)
151
- throw new Error(`[@pdfme/schemas] No default for barcode type ${barcodeType}`);
161
+ throw new Error(`[@pdfme/schemas/barcodes] No default for barcode type ${barcodeType}`);
152
162
  return {
153
163
  schema: ({ i18n }) => ({
154
164
  barColor: {
@@ -174,7 +184,14 @@ export const getPropPanelByBarcodeType = (barcodeType) => {
174
184
  ],
175
185
  },
176
186
  ...(barcodeHasText
177
- ? { textColor: { title: i18n('schemas.textColor'), type: 'string', widget: 'color' } }
187
+ ? {
188
+ textColor: { title: i18n('schemas.textColor'), type: 'string', widget: 'color' },
189
+ includetext: {
190
+ title: i18n('schemas.barcodes.includetext'),
191
+ type: 'boolean',
192
+ widget: 'switch',
193
+ },
194
+ }
178
195
  : {}),
179
196
  }),
180
197
  ...defaults,
@@ -1 +1 @@
1
- {"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/barcodes/propPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,wBAAwB;IACzC,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AACF,MAAM,iBAAiB,G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YACD,eAAe,EAAE;gBACf,KAAK,EAAE,IAAI,CAAC,iBAAiB,CAAC;gBAC9B,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE;oBACL;wBACE,OAAO,EAAE,iBAAiB;wBAC1B,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC;qBAChC;iBACF;aACF;YACD,GAAG,CAAC,cAAc;gBAChB,CAAC,CAAC;oBACE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;oBAChF,WAAW,EAAE;wBACX,KAAK,EAAE,IAAI,CAAC,8BAA8B,CAAC;wBAC3C,IAAI,EAAE,SAAS;wBACf,MAAM,EAAE,QAAQ;qBACjB;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;QACF,GAAG,QAAQ;KACZ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,29 +1,6 @@
1
1
  import { validateBarcodeInput, createBarCode } from './helper.js';
2
- import { addAlphaToHex, isEditable } from '../renderUtils.js';
2
+ import { addAlphaToHex, isEditable, createErrorElm } from '../utils.js';
3
3
  const fullSize = { width: '100%', height: '100%' };
4
- const createErrorBarcodeElm = () => {
5
- const container = document.createElement('div');
6
- const containerStyle = {
7
- display: 'flex',
8
- alignItems: 'center',
9
- justifyContent: 'center',
10
- ...fullSize,
11
- };
12
- Object.assign(container.style, containerStyle);
13
- const span = document.createElement('span');
14
- const spanStyle = {
15
- color: 'white',
16
- background: 'red',
17
- padding: '0.25rem',
18
- fontSize: '12pt',
19
- fontWeight: 'bold',
20
- borderRadius: '2px',
21
- };
22
- Object.assign(span.style, spanStyle);
23
- span.textContent = 'ERROR';
24
- container.appendChild(span);
25
- return container;
26
- };
27
4
  const blobToDataURL = (blob) => new Promise((resolve, reject) => {
28
5
  const reader = new FileReader();
29
6
  reader.onloadend = () => resolve(reader.result);
@@ -59,16 +36,17 @@ export const uiRender = async (arg) => {
59
36
  };
60
37
  Object.assign(container.style, containerStyle);
61
38
  rootElement.appendChild(container);
62
- const editable = isEditable(mode);
39
+ const editable = isEditable(mode, schema);
63
40
  if (editable) {
64
41
  const input = document.createElement('input');
65
42
  const inputStyle = {
66
- ...fullSize,
43
+ width: '100%',
67
44
  position: 'absolute',
68
45
  textAlign: 'center',
69
- fontSize: '1rem',
70
- color: '#000',
71
- backgroundColor: editable || value ? addAlphaToHex(theme.colorPrimaryBg, 30) : 'none',
46
+ fontSize: '12pt',
47
+ fontWeight: 'bold',
48
+ color: theme.colorWhite,
49
+ backgroundColor: editable || value ? addAlphaToHex('#000000', 80) : 'none',
72
50
  border: 'none',
73
51
  display: 'flex',
74
52
  alignItems: 'center',
@@ -93,14 +71,13 @@ export const uiRender = async (arg) => {
93
71
  return;
94
72
  try {
95
73
  if (!validateBarcodeInput(schema.type, value))
96
- throw new Error('[@pdfme/schemas] Invalid barcode input');
74
+ throw new Error('[@pdfme/schemas/barcodes] Invalid barcode input');
97
75
  const imgElm = await createBarcodeImageElm(schema, value);
98
76
  container.appendChild(imgElm);
99
77
  }
100
78
  catch (err) {
101
79
  console.error(`[@pdfme/ui] ${err}`);
102
- const errorBarcodeElm = createErrorBarcodeElm();
103
- container.appendChild(errorBarcodeElm);
80
+ container.appendChild(createErrorElm());
104
81
  }
105
82
  };
106
83
  //# sourceMappingURL=uiRender.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/barcodes/uiRender.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAEnD,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,MA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