@pdfme/ui 3.1.5-dev.7 → 3.1.5-dev.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/ui",
3
- "version": "3.1.5-dev.7",
3
+ "version": "3.1.5-dev.8",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -35,6 +35,7 @@ const Wrapper = ({
35
35
  top: schema.position.y * ZOOM,
36
36
  left: schema.position.x * ZOOM,
37
37
  transform: `rotate(${schema.rotate ?? 0}deg)`,
38
+ opacity: schema.opacity ?? 1,
38
39
  outline,
39
40
  }}
40
41
  >
package/src/helper.ts CHANGED
@@ -312,13 +312,16 @@ export const templateSchemas2SchemasList = async (_template: Template) => {
312
312
  export const generateColumnsAndSampledataIfNeeded = (template: Template) => {
313
313
  const { schemas, columns, sampledata } = template;
314
314
 
315
- const flatSchemaLength = schemas
315
+ const flatSchemaLengthForColumns = schemas
316
316
  .map((schema) => Object.keys(schema).length)
317
317
  .reduce((acc, cur) => acc + cur, 0);
318
+ const needColumns = !columns || flatSchemaLengthForColumns !== columns.length;
318
319
 
319
- const needColumns = !columns || flatSchemaLength !== columns.length;
320
-
321
- const needSampledata = !sampledata || flatSchemaLength !== Object.keys(sampledata[0]).length;
320
+ const flatSchemaLengthForSampleData = schemas
321
+ .map((schema) => Object.keys(schema).filter((key) => !schema[key].readOnly).length)
322
+ .reduce((acc, cur) => acc + cur, 0);
323
+ const needSampledata =
324
+ !sampledata || flatSchemaLengthForSampleData !== Object.keys(sampledata[0]).length;
322
325
 
323
326
  // columns
324
327
  if (needColumns) {