@apia/execution 4.0.27 → 4.0.29

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.d.ts CHANGED
@@ -1897,7 +1897,6 @@ declare class Execution extends EventEmitter$1<{
1897
1897
  P: Map<string, Form>;
1898
1898
  };
1899
1899
  state: {
1900
- formsReady: ReturnType<Execution['getAllForms']>;
1901
1900
  executionState: ExecutionState;
1902
1901
  locked: boolean;
1903
1902
  hasChangedAnything: boolean;
package/dist/index.js CHANGED
@@ -2122,8 +2122,12 @@ class UploaderModalController {
2122
2122
  }
2123
2123
  deleteMetadata(indices) {
2124
2124
  const deleteSet = new Set(indices);
2125
+ const offset = this.state.metadata.metadataArray.length;
2125
2126
  this.state.metadata.freeMetadataArray = this.state.metadata.freeMetadataArray.filter(
2126
- (c, index) => c.free !== "Y" || !deleteSet.has(index)
2127
+ (_, localIndex) => (
2128
+ // conservamos sólo los que NO estén en deleteSet
2129
+ !deleteSet.has(localIndex + offset)
2130
+ )
2127
2131
  );
2128
2132
  }
2129
2133
  deletePermission(item) {
@@ -8994,7 +8998,6 @@ class Execution extends EventEmitter$1 {
8994
8998
  P: /* @__PURE__ */ new Map()
8995
8999
  });
8996
9000
  __publicField(this, "state", {
8997
- formsReady: [],
8998
9001
  executionState: ExecutionState.LOADING,
8999
9002
  locked: true,
9000
9003
  hasChangedAnything: false
@@ -9108,7 +9111,8 @@ class Execution extends EventEmitter$1 {
9108
9111
  const res = await InitialData.getFormsDefinition(this);
9109
9112
  try {
9110
9113
  for await (const formDefinition of res) {
9111
- if (!parseFakeJSON$1(formDefinition.properties).frmTab && !parseFakeJSON$1(formDefinition.properties).frmHidden) {
9114
+ const props = parseFakeJSON$1(formDefinition.properties);
9115
+ if (!props.frmTab && !props.frmHidden && (arrayOrArray(formDefinition.field).length > 0 || arrayOrArray(formDefinition.customField).length > 0)) {
9112
9116
  this.mustRenderForms.push(
9113
9117
  formDefinition.frmParent + "_" + formDefinition.formName
9114
9118
  );
@@ -9125,7 +9129,6 @@ class Execution extends EventEmitter$1 {
9125
9129
  this.formsById.P.set(String(formDefinition.id), newForm);
9126
9130
  }
9127
9131
  }
9128
- this.state.formsReady = this.getAllForms();
9129
9132
  this.state.executionState = this.mustRenderForms.length === 0 ? ExecutionState.RUNNING : ExecutionState.RENDERING;
9130
9133
  this.state.locked = false;
9131
9134
  this.fireEvents("onLoad");
@@ -9356,6 +9359,11 @@ class Execution extends EventEmitter$1 {
9356
9359
  );
9357
9360
  const canClose = response?.data?.load?.canClose;
9358
9361
  if (canClose) {
9362
+ getWindow(this).location.assign(
9363
+ makeApiaUrl(this, {
9364
+ action: "refreshPage"
9365
+ })
9366
+ );
9359
9367
  return response;
9360
9368
  }
9361
9369
  }