@pdfme/schemas 3.4.3 → 4.0.0-dev.3

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 (138) hide show
  1. package/dist/cjs/__tests__/text.test.js +5 -4
  2. package/dist/cjs/__tests__/text.test.js.map +1 -1
  3. package/dist/cjs/__tests__/utils.test.js +3 -0
  4. package/dist/cjs/__tests__/utils.test.js.map +1 -1
  5. package/dist/cjs/src/barcodes/propPanel.js +23 -11
  6. package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
  7. package/dist/cjs/src/barcodes/uiRender.js +1 -1
  8. package/dist/cjs/src/barcodes/uiRender.js.map +1 -1
  9. package/dist/cjs/src/graphics/image.js +8 -11
  10. package/dist/cjs/src/graphics/image.js.map +1 -1
  11. package/dist/cjs/src/graphics/svg.js +4 -3
  12. package/dist/cjs/src/graphics/svg.js.map +1 -1
  13. package/dist/cjs/src/index.js +7 -1
  14. package/dist/cjs/src/index.js.map +1 -1
  15. package/dist/cjs/src/shapes/line.js +5 -8
  16. package/dist/cjs/src/shapes/line.js.map +1 -1
  17. package/dist/cjs/src/shapes/rectAndEllipse.js +12 -5
  18. package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
  19. package/dist/cjs/src/tables/cell.js +125 -0
  20. package/dist/cjs/src/tables/cell.js.map +1 -0
  21. package/dist/cjs/src/tables/classes.js +467 -0
  22. package/dist/cjs/src/tables/classes.js.map +1 -0
  23. package/dist/cjs/src/tables/dynamicTemplate.js +71 -0
  24. package/dist/cjs/src/tables/dynamicTemplate.js.map +1 -0
  25. package/dist/cjs/src/tables/helper.js +171 -0
  26. package/dist/cjs/src/tables/helper.js.map +1 -0
  27. package/dist/cjs/src/tables/index.js +12 -0
  28. package/dist/cjs/src/tables/index.js.map +1 -0
  29. package/dist/cjs/src/tables/pdfRender.js +93 -0
  30. package/dist/cjs/src/tables/pdfRender.js.map +1 -0
  31. package/dist/cjs/src/tables/propPanel.js +88 -0
  32. package/dist/cjs/src/tables/propPanel.js.map +1 -0
  33. package/dist/cjs/src/tables/tableHelper.js +231 -0
  34. package/dist/cjs/src/tables/tableHelper.js.map +1 -0
  35. package/dist/cjs/src/tables/types.js +3 -0
  36. package/dist/cjs/src/tables/types.js.map +1 -0
  37. package/dist/cjs/src/tables/uiRender.js +342 -0
  38. package/dist/cjs/src/tables/uiRender.js.map +1 -0
  39. package/dist/cjs/src/text/helper.js +21 -6
  40. package/dist/cjs/src/text/helper.js.map +1 -1
  41. package/dist/cjs/src/text/index.js +1 -1
  42. package/dist/cjs/src/text/index.js.map +1 -1
  43. package/dist/cjs/src/text/pdfRender.js +6 -9
  44. package/dist/cjs/src/text/pdfRender.js.map +1 -1
  45. package/dist/cjs/src/text/propPanel.js +7 -4
  46. package/dist/cjs/src/text/propPanel.js.map +1 -1
  47. package/dist/cjs/src/text/uiRender.js +18 -17
  48. package/dist/cjs/src/text/uiRender.js.map +1 -1
  49. package/dist/cjs/src/utils.js +3 -1
  50. package/dist/cjs/src/utils.js.map +1 -1
  51. package/dist/esm/__tests__/text.test.js +5 -4
  52. package/dist/esm/__tests__/text.test.js.map +1 -1
  53. package/dist/esm/__tests__/utils.test.js +3 -0
  54. package/dist/esm/__tests__/utils.test.js.map +1 -1
  55. package/dist/esm/src/barcodes/propPanel.js +23 -11
  56. package/dist/esm/src/barcodes/propPanel.js.map +1 -1
  57. package/dist/esm/src/barcodes/uiRender.js +1 -1
  58. package/dist/esm/src/barcodes/uiRender.js.map +1 -1
  59. package/dist/esm/src/graphics/image.js +6 -9
  60. package/dist/esm/src/graphics/image.js.map +1 -1
  61. package/dist/esm/src/graphics/svg.js +4 -3
  62. package/dist/esm/src/graphics/svg.js.map +1 -1
  63. package/dist/esm/src/index.js +4 -1
  64. package/dist/esm/src/index.js.map +1 -1
  65. package/dist/esm/src/shapes/line.js +5 -8
  66. package/dist/esm/src/shapes/line.js.map +1 -1
  67. package/dist/esm/src/shapes/rectAndEllipse.js +12 -5
  68. package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
  69. package/dist/esm/src/tables/cell.js +120 -0
  70. package/dist/esm/src/tables/cell.js.map +1 -0
  71. package/dist/esm/src/tables/classes.js +460 -0
  72. package/dist/esm/src/tables/classes.js.map +1 -0
  73. package/dist/esm/src/tables/dynamicTemplate.js +66 -0
  74. package/dist/esm/src/tables/dynamicTemplate.js.map +1 -0
  75. package/dist/esm/src/tables/helper.js +163 -0
  76. package/dist/esm/src/tables/helper.js.map +1 -0
  77. package/dist/esm/src/tables/index.js +10 -0
  78. package/dist/esm/src/tables/index.js.map +1 -0
  79. package/dist/esm/src/tables/pdfRender.js +86 -0
  80. package/dist/esm/src/tables/pdfRender.js.map +1 -0
  81. package/dist/esm/src/tables/propPanel.js +85 -0
  82. package/dist/esm/src/tables/propPanel.js.map +1 -0
  83. package/dist/esm/src/tables/tableHelper.js +226 -0
  84. package/dist/esm/src/tables/tableHelper.js.map +1 -0
  85. package/dist/esm/src/tables/types.js +2 -0
  86. package/dist/esm/src/tables/types.js.map +1 -0
  87. package/dist/esm/src/tables/uiRender.js +335 -0
  88. package/dist/esm/src/tables/uiRender.js.map +1 -0
  89. package/dist/esm/src/text/helper.js +19 -5
  90. package/dist/esm/src/text/helper.js.map +1 -1
  91. package/dist/esm/src/text/index.js +1 -1
  92. package/dist/esm/src/text/index.js.map +1 -1
  93. package/dist/esm/src/text/pdfRender.js +7 -10
  94. package/dist/esm/src/text/pdfRender.js.map +1 -1
  95. package/dist/esm/src/text/propPanel.js +7 -4
  96. package/dist/esm/src/text/propPanel.js.map +1 -1
  97. package/dist/esm/src/text/uiRender.js +19 -18
  98. package/dist/esm/src/text/uiRender.js.map +1 -1
  99. package/dist/esm/src/utils.js +1 -0
  100. package/dist/esm/src/utils.js.map +1 -1
  101. package/dist/types/src/index.d.ts +3 -1
  102. package/dist/types/src/shapes/rectAndEllipse.d.ts +19 -27
  103. package/dist/types/src/tables/cell.d.ts +4 -0
  104. package/dist/types/src/tables/classes.d.ts +68 -0
  105. package/dist/types/src/tables/dynamicTemplate.d.ts +13 -0
  106. package/dist/types/src/tables/helper.d.ts +252 -0
  107. package/dist/types/src/tables/index.d.ts +4 -0
  108. package/dist/types/src/tables/pdfRender.d.ts +3 -0
  109. package/dist/types/src/tables/propPanel.d.ts +3 -0
  110. package/dist/types/src/tables/tableHelper.d.ts +11 -0
  111. package/dist/types/src/tables/types.d.ts +91 -0
  112. package/dist/types/src/tables/uiRender.d.ts +3 -0
  113. package/dist/types/src/text/helper.d.ts +8 -1
  114. package/dist/types/src/utils.d.ts +1 -0
  115. package/package.json +1 -1
  116. package/src/barcodes/propPanel.ts +26 -12
  117. package/src/barcodes/uiRender.ts +1 -1
  118. package/src/graphics/image.ts +8 -11
  119. package/src/graphics/svg.ts +4 -3
  120. package/src/index.ts +7 -0
  121. package/src/shapes/line.ts +4 -8
  122. package/src/shapes/rectAndEllipse.ts +16 -7
  123. package/src/tables/cell.ts +157 -0
  124. package/src/tables/classes.ts +398 -0
  125. package/src/tables/dynamicTemplate.ts +81 -0
  126. package/src/tables/helper.ts +198 -0
  127. package/src/tables/index.ts +12 -0
  128. package/src/tables/pdfRender.ts +113 -0
  129. package/src/tables/propPanel.ts +91 -0
  130. package/src/tables/tableHelper.ts +322 -0
  131. package/src/tables/types.ts +88 -0
  132. package/src/tables/uiRender.ts +393 -0
  133. package/src/text/helper.ts +29 -6
  134. package/src/text/index.ts +1 -1
  135. package/src/text/pdfRender.ts +9 -13
  136. package/src/text/propPanel.ts +7 -4
  137. package/src/text/uiRender.ts +18 -18
  138. package/src/utils.ts +1 -0
@@ -8,11 +8,13 @@ const defaultTextColors = { textColor: DEFAULT_BARCODE_COLOR };
8
8
  const defaultIncludetext = { includetext: DEFAULT_BARCODE_INCLUDETEXT };
9
9
  const position = { x: 0, y: 0 };
10
10
  const default40x20 = { width: 40, height: 20 };
11
+ const barcodeIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-barcode"><path d="M3 5v14"/><path d="M8 5v14"/><path d="M12 5v14"/><path d="M17 5v14"/><path d="M21 5v14"/></svg>';
11
12
  const barcodeDefaults = [
12
13
  {
13
- defaultValue: 'https://pdfme.com/',
14
14
  defaultSchema: {
15
15
  type: 'qrcode',
16
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-qr-code"><rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/></svg>',
17
+ content: 'https://pdfme.com/',
16
18
  position,
17
19
  ...defaultColors,
18
20
  width: 30,
@@ -22,9 +24,10 @@ const barcodeDefaults = [
22
24
  },
23
25
  },
24
26
  {
25
- defaultValue: '6540123789-A-K-Z',
26
27
  defaultSchema: {
27
28
  type: 'japanpost',
29
+ icon: barcodeIcon,
30
+ content: '6540123789-A-K-Z',
28
31
  position,
29
32
  ...defaultColors,
30
33
  ...defaultTextColors,
@@ -36,9 +39,10 @@ const barcodeDefaults = [
36
39
  },
37
40
  },
38
41
  {
39
- defaultValue: '2112345678900',
40
42
  defaultSchema: {
41
43
  type: 'ean13',
44
+ icon: barcodeIcon,
45
+ content: '2112345678900',
42
46
  position,
43
47
  ...defaultColors,
44
48
  ...defaultTextColors,
@@ -50,9 +54,10 @@ const barcodeDefaults = [
50
54
  },
51
55
  },
52
56
  {
53
- defaultValue: '02345673',
54
57
  defaultSchema: {
55
58
  type: 'ean8',
59
+ icon: barcodeIcon,
60
+ content: '02345673',
56
61
  position,
57
62
  ...defaultColors,
58
63
  ...defaultTextColors,
@@ -63,9 +68,10 @@ const barcodeDefaults = [
63
68
  },
64
69
  },
65
70
  {
66
- defaultValue: 'THIS IS CODE 39',
67
71
  defaultSchema: {
68
72
  type: 'code39',
73
+ icon: barcodeIcon,
74
+ content: 'THIS IS CODE 39',
69
75
  position,
70
76
  ...defaultColors,
71
77
  ...defaultTextColors,
@@ -75,9 +81,10 @@ const barcodeDefaults = [
75
81
  },
76
82
  },
77
83
  {
78
- defaultValue: 'This is Code 128!',
79
84
  defaultSchema: {
80
85
  type: 'code128',
86
+ icon: barcodeIcon,
87
+ content: 'This is Code 128!',
81
88
  position,
82
89
  ...defaultColors,
83
90
  ...defaultTextColors,
@@ -88,9 +95,10 @@ const barcodeDefaults = [
88
95
  },
89
96
  },
90
97
  {
91
- defaultValue: 'A0123456789B',
92
98
  defaultSchema: {
93
99
  type: 'nw7',
100
+ icon: barcodeIcon,
101
+ content: 'A0123456789B',
94
102
  position,
95
103
  ...defaultColors,
96
104
  ...defaultTextColors,
@@ -101,9 +109,10 @@ const barcodeDefaults = [
101
109
  },
102
110
  },
103
111
  {
104
- defaultValue: '04601234567893',
105
112
  defaultSchema: {
106
113
  type: 'itf14',
114
+ icon: barcodeIcon,
115
+ content: '04601234567893',
107
116
  position,
108
117
  ...defaultColors,
109
118
  ...defaultTextColors,
@@ -115,9 +124,10 @@ const barcodeDefaults = [
115
124
  },
116
125
  },
117
126
  {
118
- defaultValue: '416000336108',
119
127
  defaultSchema: {
120
128
  type: 'upca',
129
+ icon: barcodeIcon,
130
+ content: '416000336108',
121
131
  position,
122
132
  ...defaultColors,
123
133
  ...defaultTextColors,
@@ -129,9 +139,10 @@ const barcodeDefaults = [
129
139
  },
130
140
  },
131
141
  {
132
- defaultValue: '00123457',
133
142
  defaultSchema: {
134
143
  type: 'upce',
144
+ icon: barcodeIcon,
145
+ content: '00123457',
135
146
  position,
136
147
  ...defaultColors,
137
148
  ...defaultTextColors,
@@ -142,9 +153,10 @@ const barcodeDefaults = [
142
153
  },
143
154
  },
144
155
  {
145
- defaultValue: '(01)03453120000011(17)191125(10)ABCD1234',
146
156
  defaultSchema: {
147
157
  type: 'gs1datamatrix',
158
+ icon: barcodeIcon,
159
+ content: '(01)03453120000011(17)191125(10)ABCD1234',
148
160
  position,
149
161
  ...defaultColors,
150
162
  width: 30,
@@ -1 +1 @@
1
- {"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/barcodes/propPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,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,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AAC/D,MAAM,kBAAkB,GAAG,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;AACxE,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAChC,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAE/C,MAAM,eAAe,GAA6D;IAChF;QACE,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ;YACR,GAAG,aAAa;YAChB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,eAAe;SACzB;KACF;IACD;QACE,YAAY,EAAE,kBAAkB;QAChC,aAAa,EAAE;YACb,IAAI,EAAE,WAAW;YACjB,QAAQ;YACR,GAAG,aAAa;YAChB,GAAG,iBAAiB;Y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IAAI,CAAC,gBAAgB,CAAC;qBAChC;iBACF;aACF;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"}
@@ -58,7 +58,7 @@ export const uiRender = async (arg) => {
58
58
  input.placeholder = placeholder || '';
59
59
  input.tabIndex = tabIndex || 0;
60
60
  input.addEventListener('change', (e) => {
61
- onChange && onChange(e.target.value);
61
+ onChange && onChange({ key: 'content', value: e.target.value });
62
62
  });
63
63
  input.addEventListener('blur', () => {
64
64
  stopEditing && stopEditing();
@@ -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,cAAc,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAEnD,MAAM,aAAa,GAAG,CAAC,IAAU,EAAmB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WAAW,CAAC,cAAc,EAAE,CAAC,CAAC;KACzC;AACH,CAAC,CAAC"}
@@ -1,12 +1,8 @@
1
+ import { px2mm } from '@pdfme/common';
1
2
  import { convertForPdfLayoutProps, addAlphaToHex, isEditable, readFile } from '../utils.js';
2
3
  import { DEFAULT_OPACITY } from '../constants.js';
3
4
  import { getImageDimension } from './imagehelper.js';
4
5
  import { isPdf, pdfToImage } from './pdfHelper.js';
5
- const px2mm = (px) => {
6
- // http://www.endmemo.com/sconvert/millimeterpixel.php
7
- const ratio = 0.26458333333333;
8
- return parseFloat(String(px)) * ratio;
9
- };
10
6
  const getCacheKey = (schema, input) => `${schema.type}${input}`;
11
7
  const fullSize = { width: '100%', height: '100%' };
12
8
  const defaultValue = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAAGQBAMAAAA+V+RCAAAAAXNSR0IArs4c6QAAABtQTFRFAAAAR3BMAAAAAAAAAAAAAAAAAAAAAAAAAAAAqmQqwQAAAAh0Uk5TDQAvVYGtxusE1uR9AAAKg0lEQVR42tTbwU7bQBDG8TWoPeOBPoBbdbhiVMGV0Kr0GChSe0RtRfccEOROnP0eu8ckTMHrjD27/h4Afvo7u4kUxZXbjuboZ+Hx9vrz+6J8eW5rJKPHhYfr46J/JHn0u/DnuHcko/eF71Ub0j6k3P1Rr0jGIHs4bkPah5RbnveHZMBQ6VKHlMqjnpCMAdfUApk8pNx91QeSMex+C2R2IYFwrkcyht6yEsjkIeXutEjG8AtnApldSGBRqJAMk10JZHYhgaZSIBlG+yWQipAGKZ0ipNmr0uUaEmiKLZEMw52tkLqQD7f6PT7iv1uskLqQV06/nQ9ffswhF+oVUhMS07KX7Xz6+8ot5BQhBVLF/Pry0XGKkAKpGp3IRz7pjmQMiSz3TvB8s85I8h2ReuWy6IpkDIws6UI8745I8oMjy10vnnc3JGN4ZPlRnO9OSPIWyL0LcZ93QTIskOXuXPz9eCR5G2R5io09dUEyjJD7c3kJudiQJkiZMtTxSIYZ8mAu/oG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Vcp+lnj14rR4t0uduge+/SvJH7zPGe+4i4+P3KexSik0McT9Hpu7s/7q7GnttrH3ylPFlFIkhBClKQghSkIAUpSEEKUpCCFKQgBSlIQQpSkIIUpCAFKUhBClKQghSkIAUpSEEKUpCCFKQgbSO7cPO35YKpKN5ryNxN5FR13ETm1cipK0hdpTTze1eQeifUkXNXkG0dubsY337B1HI68osryImO9BNct2W/zLSsFcqPIT+a/bKDUhp623Nwr7gmRecwmzs2l69I6dlxfrPuw2Q4T6SonTs2B2FKRkXd3L3hPdN3g4rC3LmREyT6OFE7SSOn9omYIlKRr7E/2SdiBiJFNHOsU6JIQbpLZ6ZynnAUHxY5M1N2NdCcSHE3deZAaLKbMkxxdF1pb/QoIordau+WxnkhIgXhXXt2jf4Mup8Cuu35vJNBwyo+MGK7Q8MmHxVIP4GV9tavXfD+pkDSOYTSmUCuqES2cgilxUDiXKPgE6sD3L+BeBVITKdxaws5gOcRlUh8hM3GSoNjAoX8iRgJ6VOeezaMmIpiykiehHiEe+aN/tmuYuMxktuby4NnxYitzchOjkrDLR6cZWCYMrIiXc7zoUnj3nX1s8ZUTbqc5eWhMeLpoibvkdJmemBejSPVeIn6V4ssr0nXo7QzNCxp+th4KVKEQXkmRvLQcaxcANKPXTO+eICkgWvIW0JkEDsWyB4hkgbuBRKRQexcIBFJA/cCichg5o5x7VUg6SCzTMN0YYikiSvIL1SNDGLnRg0i6ch2g2PeNUTSmQvIBwIknAtZLXgWiEgKY+sdckTfQ9J+Yte4eUOIhHJkQ4mJABGJSvvGeiT1F7aMyzH9KJL2biyN6zdUjUTlr6l54vZDj+qQWPrXmWEi5KUEJBa//26RGRMuP449+jEkprV8TLPGgenjx8uomkj0N73+g6V/XjknAAAAAElFTkSuQmCC';
@@ -112,7 +108,7 @@ const imageSchema = {
112
108
  };
113
109
  Object.assign(button.style, buttonStyle);
114
110
  button.addEventListener('click', () => {
115
- onChange && onChange('');
111
+ onChange && onChange({ key: 'content', value: '' });
116
112
  });
117
113
  container.appendChild(button);
118
114
  }
@@ -146,7 +142,7 @@ const imageSchema = {
146
142
  input.accept = 'image/jpeg, image/png, application/pdf';
147
143
  input.addEventListener('change', (event) => {
148
144
  const changeEvent = event;
149
- readFile(changeEvent.target.files).then((result) => onChange && onChange(result));
145
+ readFile(changeEvent.target.files).then((result) => onChange && onChange({ key: 'content', value: result }));
150
146
  });
151
147
  input.addEventListener('blur', () => stopEditing && stopEditing());
152
148
  label.appendChild(input);
@@ -154,9 +150,10 @@ const imageSchema = {
154
150
  },
155
151
  propPanel: {
156
152
  schema: {},
157
- defaultValue,
158
153
  defaultSchema: {
159
154
  type: 'image',
155
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
156
+ content: defaultValue,
160
157
  position: { x: 0, y: 0 },
161
158
  width: 40,
162
159
  height: 40,
@@ -176,8 +173,8 @@ export const readOnlyImage = {
176
173
  defaultSchema: {
177
174
  ...imageSchema.propPanel.defaultSchema,
178
175
  type: 'readOnlyImage',
176
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M10.41 10.41a2 2 0 1 1-2.83-2.83"/><line x1="13.5" x2="6" y1="13.5" y2="21"/><line x1="18" x2="21" y1="12" y2="15"/><path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"/><path d="M21 15V5a2 2 0 0 0-2-2H9"/></svg>',
179
177
  readOnly: true,
180
- readOnlyValue: defaultValue,
181
178
  },
182
179
  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,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAgB,EAAE,CAAC,CAC9E,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,IAAI,WAAW,EAAE,CAAC,CAAC;YACnE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,mWAAmW;YACzW,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,uGAAuG;YACvG,4GAA4G;YAC5G,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,eAAe;SACzB;KACF;CACF,CAAC;AAEF,eAAe,WAAW,CAAC;AAE3B,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,GAAG,EAAE,WAAW,CAAC,GAAG;IACpB,EAAE,EAAE,WAAW,CAAC,EAAE;IAClB,SAAS,EAAE;QACT,GAAG,WAAW,CAAC,SAAS;QACxB,aAAa,EAAE;YACb,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa;YACtC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,0fAA0f;YAChgB,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC"}
@@ -34,7 +34,7 @@ const svgSchema = {
34
34
  }
35
35
  textarea.addEventListener('change', (e) => {
36
36
  const newValue = e.target.value;
37
- onChange && onChange(newValue);
37
+ onChange && onChange({ key: 'content', value: newValue });
38
38
  });
39
39
  rootElement.appendChild(container);
40
40
  textarea.setSelectionRange(value.length, value.length);
@@ -67,9 +67,10 @@ const svgSchema = {
67
67
  },
68
68
  propPanel: {
69
69
  schema: {},
70
- defaultValue,
71
70
  defaultSchema: {
72
71
  type: 'svg',
72
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/></svg>',
73
+ content: defaultValue,
73
74
  position: { x: 0, y: 0 },
74
75
  width: 40,
75
76
  height: 40,
@@ -85,8 +86,8 @@ export const readOnlySvg = {
85
86
  defaultSchema: {
86
87
  ...svgSchema.propPanel.defaultSchema,
87
88
  type: 'readOnlySvg',
89
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route-off"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5c.4 0 .9-.1 1.3-.2"/><path d="M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"/><path d="m2 2 20 20"/><path d="M21 15.3a3.5 3.5 0 0 0-3.3-3.3"/><path d="M15 5h-4.3"/><circle cx="18" cy="5" r="3"/></svg>',
88
90
  readOnly: true,
89
- readOnlyValue: defaultValue,
90
91
  },
91
92
  },
92
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../../src/graphics/svg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElG,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAEpF,MAAM,YAAY,GAAG;;;;OAId,CAAC;AAIR,MAA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import svg, { readOnlySvg } from './graphics/svg.js';
4
4
  import barcodes from './barcodes/index.js';
5
5
  import line from './shapes/line.js';
6
+ import table from './tables/index.js';
7
+ import { modifyTemplateForTable, getDynamicHeightForTable } from './tables/dynamicTemplate.js';
6
8
  import { rectangle, ellipse } from './shapes/rectAndEllipse.js';
7
9
  import { convertForPdfLayoutProps, rotatePoint } from './utils.js';
10
+ const tableBeta = table;
8
11
  const builtInPlugins = { Text: text };
9
- export { text, readOnlyText, image, readOnlyImage, svg, readOnlySvg, barcodes, line, rectangle, ellipse, builtInPlugins, convertForPdfLayoutProps, rotatePoint, };
12
+ export { text, readOnlyText, image, readOnlyImage, svg, readOnlySvg, barcodes, line, tableBeta, modifyTemplateForTable, getDynamicHeightForTable, rectangle, ellipse, builtInPlugins, convertForPdfLayoutProps, rotatePoint, };
10
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,GAAG,EACH,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,cAAc,EACd,wBAAwB,EACxB,WAAW,GACZ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAEtC,OAAO,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,GAAG,EACH,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,sBAAsB,EACtB,wBAAwB,EACxB,SAAS,EACT,OAAO,EACP,cAAc,EACd,wBAAwB,EACxB,WAAW,GACZ,CAAC"}
@@ -4,6 +4,8 @@ const DEFAULT_LINE_COLOR = '#000000';
4
4
  const lineSchema = {
5
5
  pdf: (arg) => {
6
6
  const { page, schema, options } = arg;
7
+ if (schema.width === 0 || schema.height === 0 || !schema.color)
8
+ return;
7
9
  const { colorType } = options;
8
10
  const pageHeight = page.getHeight();
9
11
  const { width, height, rotate, position: { x, y }, opacity, } = convertForPdfLayoutProps({ schema, pageHeight, applyRotateTranslate: false });
@@ -19,7 +21,7 @@ const lineSchema = {
19
21
  ui: (arg) => {
20
22
  const { schema, rootElement } = arg;
21
23
  const div = document.createElement('div');
22
- div.style.backgroundColor = schema.color ?? DEFAULT_LINE_COLOR;
24
+ div.style.backgroundColor = schema.color ?? 'transparent';
23
25
  div.style.width = '100%';
24
26
  div.style.height = '100%';
25
27
  rootElement.appendChild(div);
@@ -31,17 +33,12 @@ const lineSchema = {
31
33
  type: 'string',
32
34
  widget: 'color',
33
35
  required: true,
34
- rules: [
35
- {
36
- pattern: HEX_COLOR_PATTERN,
37
- message: i18n('hexColorPrompt'),
38
- },
39
- ],
36
+ rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
40
37
  },
41
38
  }),
42
- defaultValue: '',
43
39
  defaultSchema: {
44
40
  type: 'line',
41
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-minus"><path d="M5 12h14"/></svg>',
45
42
  position: { x: 0, y: 0 },
46
43
  width: 50,
47
44
  height: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../../src/shapes/line.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAMrC,MAAM,UAAU,GAAuB;IACrC,GAAG,EAAE,CAAC,GAA+B,EAAE,EAAE;QACvC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;QACtC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,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ACT,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACrB,KAAK,EAAE;gBACL,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC;gBAC5B,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,OAAO;gBACf,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;aACzE;SACF,CAAC;QACF,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EAAC,6OAA6O;YAClP,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,kBAAkB;SAC1B;KACF;CACF,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -19,6 +19,8 @@ const shape = {
19
19
  },
20
20
  pdf: (arg) => {
21
21
  const { schema, page, options } = arg;
22
+ if (!schema.color && !schema.borderColor)
23
+ return;
22
24
  const { colorType } = options;
23
25
  const pageHeight = page.getHeight();
24
26
  const cArg = { schema, pageHeight };
@@ -58,7 +60,7 @@ const shape = {
58
60
  title: i18n('schemas.borderWidth'),
59
61
  type: 'number',
60
62
  widget: 'inputNumber',
61
- min: 0,
63
+ props: { min: 0 },
62
64
  step: 1,
63
65
  },
64
66
  borderColor: {
@@ -74,7 +76,6 @@ const shape = {
74
76
  rules: [{ pattern: HEX_COLOR_PATTERN, message: i18n('hexColorPrompt') }],
75
77
  },
76
78
  }),
77
- defaultValue: '',
78
79
  defaultSchema: {
79
80
  type: 'rectangle',
80
81
  position: { x: 0, y: 0 },
@@ -82,16 +83,22 @@ const shape = {
82
83
  height: 37.5,
83
84
  rotate: 0,
84
85
  opacity: 1,
85
- borderWidth: 5,
86
+ borderWidth: 1,
86
87
  borderColor: '#000000',
87
- color: '#ffffff',
88
+ color: '',
88
89
  readOnly: true,
89
90
  },
90
91
  },
91
92
  };
93
+ const rectangleIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square"><rect width="18" height="18" x="3" y="3" rx="2"/></svg>';
94
+ const ellipseIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle"><circle cx="12" cy="12" r="10"/></svg>';
92
95
  const getPropPanelSchema = (type) => ({
93
96
  ...shape.propPanel,
94
- defaultSchema: { ...shape.propPanel.defaultSchema, type },
97
+ defaultSchema: {
98
+ ...shape.propPanel.defaultSchema,
99
+ type,
100
+ icon: type === 'rectangle' ? rectangleIcon : ellipseIcon,
101
+ },
95
102
  });
96
103
  export const rectangle = { ...shape, propPanel: getPropPanelSchema('rectangle') };
97
104
  export const ellipse = { ...shape, propPanel: getPropPanelSchema('ellipse') };
@@ -1 +1 @@
1
- {"version":3,"file":"rectAndEllipse.js","sourceRoot":"","sources":["../../../../src/shapes/rectAndEllipse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAS1E,MAAM,KAAK,GAAkB;IAC3B,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE;QACV,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;QACpC,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,GAAG,CAAC,K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E,WAAW;YACjB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,SAAS;YACtB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC;AAEF,MAAM,aAAa,GACjB,2QAA2Q,CAAC;AAC9Q,MAAM,WAAW,GACf,0PAA0P,CAAC;AAE7P,MAAM,kBAAkB,GAAG,CAAC,IAA6B,EAAE,EAAE,CAAC,CAAC;IAC7D,GAAG,KAAK,CAAC,SAAS;IAClB,aAAa,EAAE;QACb,GAAG,KAAK,CAAC,SAAS,CAAC,aAAa;QAChC,IAAI;QACJ,IAAI,EAAE,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW;KACzD;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;AAElF,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC"}
@@ -0,0 +1,120 @@
1
+ import { DEFAULT_FONT_NAME, getFallbackFontName, } from '@pdfme/common';
2
+ import { uiRender as textUiRender } from '../text/uiRender.js';
3
+ import { pdfRender as textPdfRender } from '../text/pdfRender.js';
4
+ import line from '../shapes/line.js';
5
+ import { rectangle } from '../shapes/rectAndEllipse.js';
6
+ import { getCellPropPanelSchema, getDefaultCellStyles } from './helper.js';
7
+ const linePdfRender = line.pdf;
8
+ const rectanglePdfRender = rectangle.pdf;
9
+ const renderLine = async (arg, schema, position, width, height) => linePdfRender({
10
+ ...arg,
11
+ schema: { ...schema, type: 'line', position, width, height, color: schema.borderColor },
12
+ });
13
+ const createTextDiv = (schema) => {
14
+ const { borderWidth: bw, width, height, padding: pd } = schema;
15
+ const textDiv = document.createElement('div');
16
+ textDiv.style.position = 'absolute';
17
+ textDiv.style.zIndex = '1';
18
+ textDiv.style.width = `${width - bw.left - bw.right - pd.left - pd.right}mm`;
19
+ textDiv.style.height = `${height - bw.top - bw.bottom - pd.top - pd.bottom}mm`;
20
+ textDiv.style.top = `${bw.top + pd.top}mm`;
21
+ textDiv.style.left = `${bw.left + pd.left}mm`;
22
+ return textDiv;
23
+ };
24
+ const createLineDiv = (width, height, top, right, bottom, left, borderColor) => {
25
+ const div = document.createElement('div');
26
+ div.style.width = width;
27
+ div.style.height = height;
28
+ div.style.position = 'absolute';
29
+ if (top !== null)
30
+ div.style.top = top;
31
+ if (right !== null)
32
+ div.style.right = right;
33
+ if (bottom !== null)
34
+ div.style.bottom = bottom;
35
+ if (left !== null)
36
+ div.style.left = left;
37
+ div.style.backgroundColor = borderColor;
38
+ return div;
39
+ };
40
+ const cellSchema = {
41
+ pdf: async (arg) => {
42
+ const { schema } = arg;
43
+ const { position, width, height, borderWidth, padding } = schema;
44
+ await Promise.all([
45
+ // BACKGROUND
46
+ rectanglePdfRender({
47
+ ...arg,
48
+ schema: {
49
+ ...schema,
50
+ type: 'rectangle',
51
+ width: schema.width,
52
+ height: schema.height,
53
+ borderWidth: 0,
54
+ borderColor: '',
55
+ color: schema.backgroundColor,
56
+ },
57
+ }),
58
+ // TOP
59
+ renderLine(arg, schema, { x: position.x, y: position.y }, width, borderWidth.top),
60
+ // RIGHT
61
+ renderLine(arg, schema, { x: position.x + width - borderWidth.right, y: position.y }, borderWidth.right, height),
62
+ // BOTTOM
63
+ renderLine(arg, schema, { x: position.x, y: position.y + height - borderWidth.bottom }, width, borderWidth.bottom),
64
+ // LEFT
65
+ renderLine(arg, schema, { x: position.x, y: position.y }, borderWidth.left, height),
66
+ ]);
67
+ // TEXT
68
+ await textPdfRender({
69
+ ...arg,
70
+ schema: {
71
+ ...schema,
72
+ type: 'text',
73
+ backgroundColor: '',
74
+ position: {
75
+ x: position.x + borderWidth.left + padding.left,
76
+ y: position.y + borderWidth.top + padding.top,
77
+ },
78
+ width: width - borderWidth.left - borderWidth.right - padding.left - padding.right,
79
+ height: height - borderWidth.top - borderWidth.bottom - padding.top - padding.bottom,
80
+ },
81
+ });
82
+ },
83
+ ui: async (arg) => {
84
+ const { schema, rootElement } = arg;
85
+ const { borderWidth, width, height, borderColor, backgroundColor } = schema;
86
+ rootElement.style.backgroundColor = backgroundColor;
87
+ const textDiv = createTextDiv(schema);
88
+ await textUiRender({
89
+ ...arg,
90
+ schema: { ...schema, backgroundColor: '' },
91
+ rootElement: textDiv,
92
+ });
93
+ rootElement.appendChild(textDiv);
94
+ const lines = [
95
+ createLineDiv(`${width}mm`, `${borderWidth.top}mm`, '0mm', null, null, '0mm', borderColor),
96
+ createLineDiv(`${width}mm`, `${borderWidth.bottom}mm`, null, null, '0mm', '0mm', borderColor),
97
+ createLineDiv(`${borderWidth.left}mm`, `${height}mm`, '0mm', null, null, '0mm', borderColor),
98
+ createLineDiv(`${borderWidth.right}mm`, `${height}mm`, '0mm', '0mm', null, null, borderColor),
99
+ ];
100
+ lines.forEach((line) => rootElement.appendChild(line));
101
+ },
102
+ propPanel: {
103
+ schema: ({ options, i18n }) => {
104
+ const font = options.font || { [DEFAULT_FONT_NAME]: { data: '', fallback: true } };
105
+ const fontNames = Object.keys(font);
106
+ const fallbackFontName = getFallbackFontName(font);
107
+ return getCellPropPanelSchema({ i18n, fontNames, fallbackFontName });
108
+ },
109
+ defaultSchema: {
110
+ type: 'cell',
111
+ content: 'Type Something...',
112
+ position: { x: 0, y: 0 },
113
+ width: 50,
114
+ height: 15,
115
+ ...getDefaultCellStyles(),
116
+ },
117
+ },
118
+ };
119
+ export default cellSchema;
120
+ //# sourceMappingURL=cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cell.js","source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