@dataverse-kit/export-engine 1.3.0 → 1.4.0

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
@@ -20278,7 +20278,7 @@ function walkForm(form, entities, gridById) {
20278
20278
  for (const section of sections) {
20279
20279
  for (const row of section.rows ?? []) {
20280
20280
  for (const cell of row.cells ?? []) {
20281
- for (const control of cell.controls ?? []) {
20281
+ for (const control of cellControls(cell)) {
20282
20282
  absorbControl(control, primary, entities, gridById);
20283
20283
  }
20284
20284
  }
@@ -20286,11 +20286,17 @@ function walkForm(form, entities, gridById) {
20286
20286
  }
20287
20287
  const headerCells = form.header?.cells ?? [];
20288
20288
  for (const cell of headerCells) {
20289
- for (const control of cell.controls ?? []) {
20289
+ for (const control of cellControls(cell)) {
20290
20290
  absorbControl(control, primary, entities, gridById);
20291
20291
  }
20292
20292
  }
20293
20293
  }
20294
+ function cellControls(cell) {
20295
+ return [
20296
+ ...cell.control ? [cell.control] : [],
20297
+ ...cell.controls ?? []
20298
+ ];
20299
+ }
20294
20300
  function absorbControl(control, primary, entities, gridById) {
20295
20301
  if (control.dataBinding && primary) {
20296
20302
  absorbBinding(control.dataBinding, primary);
@@ -20816,7 +20822,11 @@ function anyFormHasBindings(forms) {
20816
20822
  for (const section of sections) {
20817
20823
  for (const row of section.rows ?? []) {
20818
20824
  for (const cell of row.cells ?? []) {
20819
- for (const control of cell.controls ?? []) {
20825
+ const controls = [
20826
+ ...cell.control ? [cell.control] : [],
20827
+ ...cell.controls ?? []
20828
+ ];
20829
+ for (const control of controls) {
20820
20830
  if (control.dataBinding) return true;
20821
20831
  if (control.type === "subgrid" && typeof control.properties?.entityName === "string" && control.properties.entityName) {
20822
20832
  return true;
package/dist/index.mjs CHANGED
@@ -20258,7 +20258,7 @@ function walkForm(form, entities, gridById) {
20258
20258
  for (const section of sections) {
20259
20259
  for (const row of section.rows ?? []) {
20260
20260
  for (const cell of row.cells ?? []) {
20261
- for (const control of cell.controls ?? []) {
20261
+ for (const control of cellControls(cell)) {
20262
20262
  absorbControl(control, primary, entities, gridById);
20263
20263
  }
20264
20264
  }
@@ -20266,11 +20266,17 @@ function walkForm(form, entities, gridById) {
20266
20266
  }
20267
20267
  const headerCells = form.header?.cells ?? [];
20268
20268
  for (const cell of headerCells) {
20269
- for (const control of cell.controls ?? []) {
20269
+ for (const control of cellControls(cell)) {
20270
20270
  absorbControl(control, primary, entities, gridById);
20271
20271
  }
20272
20272
  }
20273
20273
  }
20274
+ function cellControls(cell) {
20275
+ return [
20276
+ ...cell.control ? [cell.control] : [],
20277
+ ...cell.controls ?? []
20278
+ ];
20279
+ }
20274
20280
  function absorbControl(control, primary, entities, gridById) {
20275
20281
  if (control.dataBinding && primary) {
20276
20282
  absorbBinding(control.dataBinding, primary);
@@ -20796,7 +20802,11 @@ function anyFormHasBindings(forms) {
20796
20802
  for (const section of sections) {
20797
20803
  for (const row of section.rows ?? []) {
20798
20804
  for (const cell of row.cells ?? []) {
20799
- for (const control of cell.controls ?? []) {
20805
+ const controls = [
20806
+ ...cell.control ? [cell.control] : [],
20807
+ ...cell.controls ?? []
20808
+ ];
20809
+ for (const control of controls) {
20800
20810
  if (control.dataBinding) return true;
20801
20811
  if (control.type === "subgrid" && typeof control.properties?.entityName === "string" && control.properties.entityName) {
20802
20812
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataverse-kit/export-engine",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",