@wise/dynamic-flow-client 3.16.6 → 3.16.7

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/build/main.js CHANGED
@@ -6246,7 +6246,9 @@ var reviewLayoutSchema = z.object({
6246
6246
  var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6247
6247
  var pollingSchema = z.object({
6248
6248
  url: z.string(),
6249
- interval: z.number(),
6249
+ interval: z.number().optional(),
6250
+ delay: z.number().optional(),
6251
+ timeout: z.number().optional(),
6250
6252
  maxAttempts: z.number(),
6251
6253
  onError: pollingOnErrorSchema
6252
6254
  });
@@ -6358,6 +6360,7 @@ var modalLayoutSchema = z.lazy(
6358
6360
  );
6359
6361
  var modalLayoutContentSchema = z.lazy(
6360
6362
  () => z.object({
6363
+ title: z.string().optional(),
6361
6364
  components: z.array(layoutSchema)
6362
6365
  })
6363
6366
  );
@@ -6693,6 +6696,7 @@ var import_react_intl6 = require("react-intl");
6693
6696
  var getSubmittableData = async (components) => Promise.all(components.map(async (component) => component.getSubmittableValue())).then(
6694
6697
  (values) => values.reduce((acc, value) => mergeModels(acc, value), null)
6695
6698
  );
6699
+ var getSubmittableDataSync = (components) => components.map((component) => component.getSubmittableValueSync()).reduce((acc, value) => mergeModels(acc, value), null);
6696
6700
  var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => mergeLocalValues(acc, value), null);
6697
6701
  var mergeLocalValues = (valueA, valueB) => {
6698
6702
  if (valueA === null) {
@@ -6781,6 +6785,9 @@ var createStepComponent = (stepProps) => {
6781
6785
  async getSubmittableValue() {
6782
6786
  return getSubmittableData(this.components);
6783
6787
  },
6788
+ getSubmittableValueSync() {
6789
+ return getSubmittableDataSync(this.components);
6790
+ },
6784
6791
  getSummary() {
6785
6792
  return summariseFromChildren(this.getChildren());
6786
6793
  },
@@ -6847,8 +6854,11 @@ var getStepPolling = ({
6847
6854
  pollingConfig,
6848
6855
  onAction
6849
6856
  }) => {
6850
- const { interval, maxAttempts, url, onError } = pollingConfig;
6857
+ const { interval, delay = interval, maxAttempts, url, onError } = pollingConfig;
6851
6858
  let abortController = new AbortController();
6859
+ if (delay == null) {
6860
+ throw new Error("Polling configuration must include delay or interval");
6861
+ }
6852
6862
  const onFailure = () => {
6853
6863
  stop();
6854
6864
  void onAction(onError.action);
@@ -6877,7 +6887,7 @@ var getStepPolling = ({
6877
6887
  onFailure();
6878
6888
  }
6879
6889
  };
6880
- const intervalRef = setInterval(poll, interval * 1e3);
6890
+ const intervalRef = setInterval(poll, delay * 1e3);
6881
6891
  const stop = () => {
6882
6892
  abortController.abort();
6883
6893
  clearTimeout(intervalRef);
@@ -6890,6 +6900,7 @@ var createAlertComponent = (alertProps) => __spreadProps(__spreadValues({
6890
6900
  type: "alert"
6891
6901
  }, alertProps), {
6892
6902
  getSubmittableValue: async () => null,
6903
+ getSubmittableValueSync: () => null,
6893
6904
  getLocalValue: () => null,
6894
6905
  getSummary: () => ({}),
6895
6906
  // Noop
@@ -6991,6 +7002,9 @@ var createBoxComponent = (boxProps) => __spreadProps(__spreadValues({}, boxProps
6991
7002
  async getSubmittableValue() {
6992
7003
  return getSubmittableData(this.components);
6993
7004
  },
7005
+ getSubmittableValueSync() {
7006
+ return getSubmittableDataSync(this.components);
7007
+ },
6994
7008
  getSummary() {
6995
7009
  return summariseFromChildren(this.getChildren());
6996
7010
  },
@@ -7019,6 +7033,7 @@ var createButtonComponent = (buttonProps) => __spreadProps(__spreadValues({
7019
7033
  type: "button"
7020
7034
  }, buttonProps), {
7021
7035
  getSubmittableValue: async () => null,
7036
+ getSubmittableValueSync: () => null,
7022
7037
  getLocalValue: () => null,
7023
7038
  getSummary: () => ({}),
7024
7039
  // Noop
@@ -7086,6 +7101,9 @@ var createColumnsComponent = (columnsProps) => __spreadProps(__spreadValues({},
7086
7101
  async getSubmittableValue() {
7087
7102
  return getSubmittableData(this.getChildren());
7088
7103
  },
7104
+ getSubmittableValueSync() {
7105
+ return getSubmittableDataSync(this.getChildren());
7106
+ },
7089
7107
  getSummary() {
7090
7108
  return summariseFromChildren(this.getChildren());
7091
7109
  },
@@ -7116,6 +7134,7 @@ var createDecisionComponent = (decisionProps) => __spreadProps(__spreadValues({
7116
7134
  type: "decision"
7117
7135
  }, decisionProps), {
7118
7136
  getSubmittableValue: async () => null,
7137
+ getSubmittableValueSync: () => null,
7119
7138
  getLocalValue: () => null,
7120
7139
  getSummary: () => ({}),
7121
7140
  // Noop
@@ -7144,6 +7163,7 @@ var createDividerComponent = (props) => __spreadProps(__spreadValues({
7144
7163
  type: "divider"
7145
7164
  }, props), {
7146
7165
  getSubmittableValue: async () => null,
7166
+ getSubmittableValueSync: () => null,
7147
7167
  getLocalValue: () => null,
7148
7168
  getSummary: () => ({}),
7149
7169
  // Noop
@@ -7180,15 +7200,15 @@ var abortAndResetController = (abortController) => {
7180
7200
  return new AbortController();
7181
7201
  };
7182
7202
 
7183
- // src/revamp/domain/components/utils/local-value.ts
7184
- var compareLocalValue = (valueA, valueB) => {
7203
+ // src/revamp/domain/components/utils/isExactLocalValueMatch.ts
7204
+ var isExactLocalValueMatch = (valueA, valueB) => {
7185
7205
  if (isArrayLocalValue(valueA) && isArrayLocalValue(valueB)) {
7186
- return valueA.length === valueB.length && valueA.every((value, index) => compareLocalValue(value, valueB[index]));
7206
+ return valueA.length === valueB.length && valueA.every((value, index) => isExactLocalValueMatch(value, valueB[index]));
7187
7207
  }
7188
7208
  if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
7189
7209
  const keysA = Object.keys(valueA);
7190
7210
  const keysB = Object.keys(valueB);
7191
- return keysA.length === keysB.length && keysA.every((key) => compareLocalValue(valueA[key], valueB[key]));
7211
+ return keysA.length === keysB.length && keysA.every((key) => isExactLocalValueMatch(valueA[key], valueB[key]));
7192
7212
  }
7193
7213
  return valueA === valueB;
7194
7214
  };
@@ -7201,7 +7221,7 @@ var getComponentPersistAsync = (update, performPersistAsync) => (
7201
7221
  */
7202
7222
  async (persistedState, currentValue) => {
7203
7223
  const { abortController, lastSubmitted, submission } = persistedState;
7204
- if (compareLocalValue(lastSubmitted, currentValue)) {
7224
+ if (isExactLocalValueMatch(lastSubmitted, currentValue)) {
7205
7225
  return submission;
7206
7226
  }
7207
7227
  const newAbortController = abortAndResetController(abortController);
@@ -7209,27 +7229,33 @@ var getComponentPersistAsync = (update, performPersistAsync) => (
7209
7229
  const resolvedNull = Promise.resolve(null);
7210
7230
  update((draft) => {
7211
7231
  draft.persistedState.abortController = newAbortController;
7232
+ draft.persistedState.lastResponse = null;
7212
7233
  draft.persistedState.lastSubmitted = currentValue;
7213
7234
  draft.persistedState.submission = resolvedNull;
7214
7235
  });
7215
7236
  return resolvedNull;
7216
7237
  }
7217
7238
  const { signal } = newAbortController;
7218
- const newSubmission = performPersistAsync({ value: currentValue, signal }).catch(
7219
- (error) => {
7220
- if (error instanceof DOMException && error.name === "AbortError") {
7221
- return null;
7222
- }
7223
- update((draft) => {
7224
- draft.errors = [error.message];
7225
- draft.persistedState.lastSubmitted = null;
7226
- });
7227
- throw error;
7239
+ const newSubmission = performPersistAsync({ value: currentValue, signal }).then((newValue) => {
7240
+ update((draft) => {
7241
+ draft.persistedState.lastResponse = newValue;
7242
+ });
7243
+ return newValue;
7244
+ }).catch((error) => {
7245
+ if (error instanceof DOMException && error.name === "AbortError") {
7246
+ return null;
7228
7247
  }
7229
- );
7248
+ update((draft) => {
7249
+ draft.errors = [error.message];
7250
+ draft.persistedState.lastResponse = null;
7251
+ draft.persistedState.lastSubmitted = null;
7252
+ });
7253
+ throw error;
7254
+ });
7230
7255
  update((draft) => {
7231
7256
  draft.persistedState = {
7232
7257
  abortController: newAbortController,
7258
+ lastResponse: null,
7233
7259
  lastSubmitted: currentValue,
7234
7260
  submission: newSubmission
7235
7261
  };
@@ -7248,7 +7274,13 @@ var getComponentMultiPersistAsync = (update, performPersistAsync) => (
7248
7274
  }
7249
7275
  const newAbortController = new AbortController();
7250
7276
  const { signal } = newAbortController;
7251
- const newSubmission = performPersistAsync({ value, signal }).catch((error) => {
7277
+ const newSubmission = performPersistAsync({ value, signal }).then((newValue) => {
7278
+ update((draft) => {
7279
+ const index = draft.persistedState.findIndex((state) => state.id === id);
7280
+ draft.persistedState[index].lastResponse = newValue;
7281
+ });
7282
+ return newValue;
7283
+ }).catch((error) => {
7252
7284
  update((draft) => {
7253
7285
  draft.persistedState = draft.persistedState.filter((state) => state.id !== id);
7254
7286
  });
@@ -7260,6 +7292,7 @@ var getComponentMultiPersistAsync = (update, performPersistAsync) => (
7260
7292
  {
7261
7293
  id,
7262
7294
  abortController: newAbortController,
7295
+ lastResponse: null,
7263
7296
  lastSubmitted: null,
7264
7297
  submission: newSubmission
7265
7298
  }
@@ -7420,6 +7453,9 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7420
7453
  onValueChange();
7421
7454
  },
7422
7455
  async getSubmittableValue() {
7456
+ return this.getSubmittableValueSync();
7457
+ },
7458
+ getSubmittableValueSync() {
7423
7459
  var _a2;
7424
7460
  return (_a2 = this.getLocalValue()) != null ? _a2 : null;
7425
7461
  },
@@ -7440,7 +7476,6 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7440
7476
  if (performPersistAsync) {
7441
7477
  const persist = getComponentPersistAsync(update, performPersistAsync);
7442
7478
  return __spreadProps(__spreadValues({}, numberComponent), {
7443
- isPersisted: true,
7444
7479
  onBlur() {
7445
7480
  if (this.validate()) {
7446
7481
  persist(this.persistedState, this.getLocalValue()).catch(() => {
@@ -7449,6 +7484,9 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7449
7484
  },
7450
7485
  async getSubmittableValue() {
7451
7486
  return persist(this.persistedState, this.getLocalValue());
7487
+ },
7488
+ getSubmittableValueSync() {
7489
+ return this.persistedState.lastResponse;
7452
7490
  }
7453
7491
  });
7454
7492
  }
@@ -7684,6 +7722,7 @@ var getValidationError = (param, response) => {
7684
7722
  var getInitialPersistedState = (lastSubmitted, model) => ({
7685
7723
  abortController: new AbortController(),
7686
7724
  lastSubmitted: !isNullish(model) ? lastSubmitted != null ? lastSubmitted : null : null,
7725
+ lastResponse: model != null ? model : null,
7687
7726
  submission: Promise.resolve(model != null ? model : null)
7688
7727
  });
7689
7728
 
@@ -7893,6 +7932,12 @@ var createObjectComponent = (objectProps) => {
7893
7932
  )
7894
7933
  );
7895
7934
  },
7935
+ getSubmittableValueSync() {
7936
+ return mergeChildrenValues(
7937
+ displayOrder,
7938
+ (propName) => this.componentMap[propName].getSubmittableValueSync()
7939
+ );
7940
+ },
7896
7941
  getSummary() {
7897
7942
  const summary = summariser(this.getLocalValue());
7898
7943
  const childSummary = summariseFromChildren(this.getChildren());
@@ -7989,6 +8034,9 @@ var createAllOfComponent = (allOfProps) => {
7989
8034
  async getSubmittableValue() {
7990
8035
  return getSubmittableData(this.components);
7991
8036
  },
8037
+ getSubmittableValueSync() {
8038
+ return getSubmittableDataSync(this.components);
8039
+ },
7992
8040
  getLocalValue() {
7993
8041
  return getLocalValues(this.components);
7994
8042
  },
@@ -8029,6 +8077,7 @@ var createConstComponent = (hiddenProps) => {
8029
8077
  analyticsId,
8030
8078
  getLocalValue: () => value,
8031
8079
  getSubmittableValue: async () => value,
8080
+ getSubmittableValueSync: () => value,
8032
8081
  getSummary: () => summary,
8033
8082
  validate: () => true
8034
8083
  };
@@ -8103,6 +8152,9 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8103
8152
  onValueChange();
8104
8153
  },
8105
8154
  async getSubmittableValue() {
8155
+ return this.getSubmittableValueSync();
8156
+ },
8157
+ getSubmittableValueSync() {
8106
8158
  var _a2;
8107
8159
  return (_a2 = this.getLocalValue()) != null ? _a2 : null;
8108
8160
  },
@@ -8123,7 +8175,6 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8123
8175
  if (performPersistAsync) {
8124
8176
  const persist = getComponentPersistAsync(update, performPersistAsync);
8125
8177
  return __spreadProps(__spreadValues({}, integerComponent), {
8126
- isPersisted: true,
8127
8178
  onBlur() {
8128
8179
  if (this.validate()) {
8129
8180
  persist(this.persistedState, this.getLocalValue()).catch(() => {
@@ -8132,6 +8183,9 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8132
8183
  },
8133
8184
  async getSubmittableValue() {
8134
8185
  return persist(this.persistedState, this.getLocalValue());
8186
+ },
8187
+ getSubmittableValueSync() {
8188
+ return this.persistedState.lastResponse;
8135
8189
  }
8136
8190
  });
8137
8191
  }
@@ -8210,7 +8264,7 @@ var isPartialLocalValueMatch = (partialValue, component) => {
8210
8264
  }
8211
8265
  const componentValue = component.getLocalValue();
8212
8266
  if (component.type === "const") {
8213
- return compareLocalValue(partialValue, componentValue);
8267
+ return isExactLocalValueMatch(partialValue, componentValue);
8214
8268
  }
8215
8269
  if (isObjectLocalValue(partialValue) && isObjectLocalValue(componentValue)) {
8216
8270
  return isPartialObjectMatch(partialValue, componentValue, component);
@@ -8257,25 +8311,7 @@ var getMatchingKeys = (a, b) => {
8257
8311
 
8258
8312
  // src/revamp/domain/components/SelectInputComponent.ts
8259
8313
  var createSelectInputComponent = (selectProps, updateComponent) => {
8260
- const _a = selectProps, {
8261
- uid,
8262
- checks,
8263
- initialValue,
8264
- options,
8265
- performPersistAsync,
8266
- performRefresh,
8267
- onValueChange,
8268
- summariser
8269
- } = _a, rest = __objRest(_a, [
8270
- "uid",
8271
- "checks",
8272
- "initialValue",
8273
- "options",
8274
- "performPersistAsync",
8275
- "performRefresh",
8276
- "onValueChange",
8277
- "summariser"
8278
- ]);
8314
+ const _a = selectProps, { uid, checks, initialValue, options, performRefresh, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "checks", "initialValue", "options", "performRefresh", "onValueChange", "summariser"]);
8279
8315
  const children = options.map((option) => option.component);
8280
8316
  const matchingOptions = options.map(
8281
8317
  (option) => isPartialLocalValueMatch(selectProps.initialValue, option.component)
@@ -8290,7 +8326,7 @@ var createSelectInputComponent = (selectProps, updateComponent) => {
8290
8326
  });
8291
8327
  return messages;
8292
8328
  };
8293
- const selectComponent = __spreadProps(__spreadValues({
8329
+ return __spreadProps(__spreadValues({
8294
8330
  uid,
8295
8331
  type: "select",
8296
8332
  children,
@@ -8308,6 +8344,10 @@ var createSelectInputComponent = (selectProps, updateComponent) => {
8308
8344
  var _a2, _b;
8309
8345
  return (_b = await ((_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValue())) != null ? _b : null;
8310
8346
  },
8347
+ getSubmittableValueSync() {
8348
+ var _a2, _b;
8349
+ return (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValueSync()) != null ? _b : null;
8350
+ },
8311
8351
  getSummary() {
8312
8352
  var _a2, _b;
8313
8353
  return (_b = (_a2 = this.getSelectedChild()) == null ? void 0 : _a2.getSummary()) != null ? _b : {};
@@ -8343,25 +8383,6 @@ var createSelectInputComponent = (selectProps, updateComponent) => {
8343
8383
  return messages.length === 0 && validChild;
8344
8384
  }
8345
8385
  });
8346
- if (!performPersistAsync) {
8347
- return selectComponent;
8348
- }
8349
- const persist = getComponentPersistAsync(update, performPersistAsync);
8350
- return __spreadProps(__spreadValues({}, selectComponent), {
8351
- isPersisted: true,
8352
- onSelect(updatedIndex) {
8353
- selectComponent.onSelect.call(this, updatedIndex);
8354
- const isValid2 = getValidationErrors(this.getLocalValue()).length === 0;
8355
- if (isValid2 && updatedIndex !== null) {
8356
- persist(this.persistedState, this.getLocalValue()).catch(() => {
8357
- });
8358
- onValueChange();
8359
- }
8360
- },
8361
- async getSubmittableValue() {
8362
- return persist(this.persistedState, this.getLocalValue());
8363
- }
8364
- });
8365
8386
  };
8366
8387
  var isTrue = (value) => value === true;
8367
8388
 
@@ -8402,19 +8423,13 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
8402
8423
  const { getErrorMessageFunctions, updateComponent, trackEvent, onRefresh, onValueChange } = mapperProps;
8403
8424
  const { default: defaultValue, validationMessages } = schema;
8404
8425
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
8405
- const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
8406
- schemaMapperProps,
8407
- mapperProps
8408
- );
8409
- const initialValue = performPersistAsync ? localValue : (_b = model != null ? model : defaultValue) != null ? _b : null;
8426
+ const initialValue = (_b = model != null ? model : defaultValue) != null ? _b : null;
8410
8427
  return createSelectInputComponent(
8411
8428
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
8412
8429
  autoComplete: getAutocompleteString(schema.autocompleteHint),
8413
8430
  checks: schema.hidden ? [] : [getRequiredCheck(required, errorMessageFunctions)],
8414
8431
  options,
8415
8432
  initialValue,
8416
- persistedState,
8417
- performPersistAsync,
8418
8433
  performRefresh: getPerformRefresh(schema, onRefresh),
8419
8434
  onValueChange,
8420
8435
  trackEvent
@@ -8480,6 +8495,9 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8480
8495
  onValueChange();
8481
8496
  },
8482
8497
  async getSubmittableValue() {
8498
+ return this.getSubmittableValueSync();
8499
+ },
8500
+ getSubmittableValueSync() {
8483
8501
  var _a2;
8484
8502
  return (_a2 = this.getLocalValue()) != null ? _a2 : null;
8485
8503
  },
@@ -8500,7 +8518,6 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8500
8518
  if (performPersistAsync) {
8501
8519
  const persist = getComponentPersistAsync(update, performPersistAsync);
8502
8520
  return __spreadProps(__spreadValues({}, dateInputComponent), {
8503
- isPersisted: true,
8504
8521
  onChange(updatedValue) {
8505
8522
  dateInputComponent.onChange.call(this, updatedValue);
8506
8523
  const isValid2 = getValidationErrors(updatedValue).length === 0;
@@ -8511,6 +8528,9 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8511
8528
  },
8512
8529
  async getSubmittableValue() {
8513
8530
  return persist(this.persistedState, this.getLocalValue());
8531
+ },
8532
+ getSubmittableValueSync() {
8533
+ return this.persistedState.lastResponse;
8514
8534
  }
8515
8535
  });
8516
8536
  }
@@ -8649,6 +8669,9 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
8649
8669
  const file = this.getLocalValue();
8650
8670
  return file ? toBase64(file) : null;
8651
8671
  },
8672
+ getSubmittableValueSync() {
8673
+ return null;
8674
+ },
8652
8675
  getSummary() {
8653
8676
  var _a2, _b;
8654
8677
  return summariser((_b = (_a2 = this.getLocalValue()) == null ? void 0 : _a2.name) != null ? _b : null);
@@ -8667,7 +8690,6 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
8667
8690
  const persist = getComponentPersistAsync(update, performPersistAsync);
8668
8691
  return __spreadProps(__spreadValues({}, uploadComponent), {
8669
8692
  format,
8670
- isPersisted: true,
8671
8693
  async onUpload(file) {
8672
8694
  update((draft) => {
8673
8695
  draft.errors = [];
@@ -8677,6 +8699,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
8677
8699
  const submission = format === "base64" && file ? await toBase64(file) : file;
8678
8700
  await persist(this.persistedState, submission).catch((error) => {
8679
8701
  update((draft) => {
8702
+ draft.persistedState.lastResponse = null;
8680
8703
  draft.persistedState.lastSubmitted = null;
8681
8704
  draft.persistedState.submission = Promise.resolve(null);
8682
8705
  draft.errors = [];
@@ -8687,6 +8710,9 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
8687
8710
  },
8688
8711
  async getSubmittableValue() {
8689
8712
  return this.persistedState.submission;
8713
+ },
8714
+ getSubmittableValueSync() {
8715
+ return this.persistedState.lastResponse;
8690
8716
  }
8691
8717
  });
8692
8718
  };
@@ -8775,6 +8801,9 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8775
8801
  onValueChange();
8776
8802
  },
8777
8803
  async getSubmittableValue() {
8804
+ return this.getSubmittableValueSync();
8805
+ },
8806
+ getSubmittableValueSync() {
8778
8807
  var _a2;
8779
8808
  return (_a2 = this.getLocalValue()) != null ? _a2 : null;
8780
8809
  },
@@ -8795,7 +8824,6 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8795
8824
  if (performPersistAsync) {
8796
8825
  const persist = getComponentPersistAsync(update, performPersistAsync);
8797
8826
  return __spreadProps(__spreadValues({}, inputComponent), {
8798
- isPersisted: true,
8799
8827
  onBlur() {
8800
8828
  if (this.validate()) {
8801
8829
  persist(this.persistedState, this.getLocalValue()).catch(() => {
@@ -8804,6 +8832,9 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8804
8832
  },
8805
8833
  async getSubmittableValue() {
8806
8834
  return persist(this.persistedState, this.getLocalValue());
8835
+ },
8836
+ getSubmittableValueSync() {
8837
+ return this.persistedState.lastResponse;
8807
8838
  }
8808
8839
  });
8809
8840
  }
@@ -8897,6 +8928,9 @@ var createContainerComponent = (containerProps) => __spreadProps(__spreadValues(
8897
8928
  async getSubmittableValue() {
8898
8929
  return getSubmittableData(this.components);
8899
8930
  },
8931
+ getSubmittableValueSync() {
8932
+ return getSubmittableDataSync(this.components);
8933
+ },
8900
8934
  getSummary() {
8901
8935
  return summariseFromChildren(this.getChildren());
8902
8936
  },
@@ -9001,6 +9035,9 @@ var createRepeatableComponent = (repeatableProps, updateComponent) => {
9001
9035
  async getSubmittableValue() {
9002
9036
  return Promise.all(this.components.map(async (component) => component.getSubmittableValue()));
9003
9037
  },
9038
+ getSubmittableValueSync() {
9039
+ return this.components.map((component) => component.getSubmittableValueSync());
9040
+ },
9004
9041
  getSummary() {
9005
9042
  return summariser(null);
9006
9043
  },
@@ -9136,6 +9173,9 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9136
9173
  const files = this.getLocalValue();
9137
9174
  return files ? Promise.all(files.map(toBase64)) : null;
9138
9175
  },
9176
+ getSubmittableValueSync() {
9177
+ return null;
9178
+ },
9139
9179
  getSummary() {
9140
9180
  return summariser(this.getLocalValue().map(({ name }) => name));
9141
9181
  },
@@ -9153,7 +9193,6 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9153
9193
  const persist = getComponentMultiPersistAsync(update, performPersistAsync);
9154
9194
  return __spreadProps(__spreadValues({}, uploadComponent), {
9155
9195
  format,
9156
- isPersisted: true,
9157
9196
  async onUpload(file, fileId) {
9158
9197
  await uploadComponent.onUpload.call(this, file, fileId);
9159
9198
  const submission = format === "blob" ? file : await toBase64(file);
@@ -9170,6 +9209,9 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9170
9209
  },
9171
9210
  async getSubmittableValue() {
9172
9211
  return Promise.all(this.persistedState.map(async ({ submission }) => submission));
9212
+ },
9213
+ getSubmittableValueSync() {
9214
+ return this.persistedState.map(({ lastResponse }) => lastResponse);
9173
9215
  }
9174
9216
  });
9175
9217
  };
@@ -9243,7 +9285,6 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9243
9285
  checks,
9244
9286
  options,
9245
9287
  initialValue,
9246
- performPersistAsync,
9247
9288
  performValidationAsync,
9248
9289
  performRefresh,
9249
9290
  onValueChange
@@ -9252,7 +9293,6 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9252
9293
  "checks",
9253
9294
  "options",
9254
9295
  "initialValue",
9255
- "performPersistAsync",
9256
9296
  "performValidationAsync",
9257
9297
  "performRefresh",
9258
9298
  "onValueChange"
@@ -9306,6 +9346,10 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9306
9346
  }
9307
9347
  return null;
9308
9348
  },
9349
+ getSubmittableValueSync() {
9350
+ var _a2, _b;
9351
+ return (_b = (_a2 = this.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getSubmittableValueSync())) != null ? _b : null;
9352
+ },
9309
9353
  getSummary: () => ({}),
9310
9354
  getChildren() {
9311
9355
  return this.children;
@@ -9317,23 +9361,6 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9317
9361
  if (performRefresh) {
9318
9362
  return inputComponent;
9319
9363
  }
9320
- if (performPersistAsync) {
9321
- const persist = getComponentPersistAsync(update, performPersistAsync);
9322
- return __spreadProps(__spreadValues({}, inputComponent), {
9323
- isPersisted: true,
9324
- onSelect(indices) {
9325
- inputComponent.onSelect.call(this, indices);
9326
- const isValid2 = getValidationErrors(this.getLocalValue()).length === 0;
9327
- if (isValid2 && indices != null) {
9328
- persist(this.persistedState, this.getLocalValue()).catch(() => {
9329
- });
9330
- }
9331
- },
9332
- async getSubmittableValue() {
9333
- return persist(this.persistedState, this.getLocalValue());
9334
- }
9335
- });
9336
- }
9337
9364
  if (performValidationAsync) {
9338
9365
  const validateAsync = getComponentValidationAsync(update, performValidationAsync);
9339
9366
  return __spreadProps(__spreadValues({}, inputComponent), {
@@ -9391,15 +9418,11 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9391
9418
  const { title, validationMessages } = schema;
9392
9419
  const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
9393
9420
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
9394
- const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
9395
- schemaMapperProps,
9396
- mapperProps
9397
- );
9398
9421
  const { performValidationAsync, validationState } = getValidationAsyncInitialState(
9399
9422
  schemaMapperProps,
9400
9423
  mapperProps
9401
9424
  );
9402
- const initialValue = performPersistAsync ? localValue : model != null ? model : null;
9425
+ const initialValue = model != null ? model : null;
9403
9426
  return createMultiSelectComponent(
9404
9427
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
9405
9428
  autoComplete: "off",
@@ -9411,8 +9434,6 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9411
9434
  initialValue,
9412
9435
  options,
9413
9436
  required,
9414
- persistedState,
9415
- performPersistAsync,
9416
9437
  title,
9417
9438
  validationState,
9418
9439
  performValidationAsync,
@@ -9440,7 +9461,10 @@ var createTupleComponent = (tupleProps) => {
9440
9461
  return this.components;
9441
9462
  },
9442
9463
  async getSubmittableValue() {
9443
- return Promise.all(this.components.map((child) => child.getSubmittableValue()));
9464
+ return Promise.all(this.components.map(async (child) => child.getSubmittableValue()));
9465
+ },
9466
+ getSubmittableValueSync() {
9467
+ return this.components.map((child) => child.getSubmittableValueSync());
9444
9468
  },
9445
9469
  getSummary() {
9446
9470
  const summary = summariser(this.getLocalValue());
@@ -9550,6 +9574,9 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
9550
9574
  onValueChange();
9551
9575
  },
9552
9576
  async getSubmittableValue() {
9577
+ return this.getSubmittableValueSync();
9578
+ },
9579
+ getSubmittableValueSync() {
9553
9580
  return this.getLocalValue();
9554
9581
  },
9555
9582
  getSummary() {
@@ -9566,7 +9593,6 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
9566
9593
  if (performPersistAsync) {
9567
9594
  const persist = getComponentPersistAsync(update, performPersistAsync);
9568
9595
  return __spreadProps(__spreadValues({}, booleanComponent), {
9569
- isPersisted: true,
9570
9596
  onChange(updatedValue) {
9571
9597
  booleanComponent.onChange.call(this, updatedValue);
9572
9598
  persist(this.persistedState, this.getLocalValue()).catch(() => {
@@ -9574,6 +9600,9 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
9574
9600
  },
9575
9601
  async getSubmittableValue() {
9576
9602
  return persist(this.persistedState, this.getLocalValue());
9603
+ },
9604
+ getSubmittableValueSync() {
9605
+ return this.persistedState.lastResponse;
9577
9606
  }
9578
9607
  });
9579
9608
  }
@@ -9729,6 +9758,9 @@ var createFormComponent = (formProps) => __spreadProps(__spreadValues({}, formPr
9729
9758
  async getSubmittableValue() {
9730
9759
  return getSubmittableData(this.getChildren());
9731
9760
  },
9761
+ getSubmittableValueSync() {
9762
+ return getSubmittableDataSync(this.getChildren());
9763
+ },
9732
9764
  getSummary() {
9733
9765
  return summariseFromChildren(this.getChildren());
9734
9766
  },
@@ -9774,6 +9806,7 @@ var createHeadingComponent = (headingProps) => __spreadProps(__spreadValues({
9774
9806
  type: "heading"
9775
9807
  }, headingProps), {
9776
9808
  getSubmittableValue: async () => null,
9809
+ getSubmittableValueSync: () => null,
9777
9810
  getSummary: () => ({}),
9778
9811
  // Noop
9779
9812
  getLocalValue: () => null,
@@ -9795,6 +9828,7 @@ var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
9795
9828
  type: "image"
9796
9829
  }, imageProps), {
9797
9830
  getSubmittableValue: async () => null,
9831
+ getSubmittableValueSync: () => null,
9798
9832
  getLocalValue: () => null,
9799
9833
  getSummary: () => ({}),
9800
9834
  // Noop
@@ -9816,6 +9850,7 @@ var createMarkdownComponent = (markdownProps) => __spreadProps(__spreadValues({
9816
9850
  type: "markdown"
9817
9851
  }, markdownProps), {
9818
9852
  getSubmittableValue: async () => null,
9853
+ getSubmittableValueSync: () => null,
9819
9854
  getLocalValue: () => null,
9820
9855
  getSummary: () => ({}),
9821
9856
  validate: () => true
@@ -9836,6 +9871,7 @@ var createInstructionsComponent = (instructionsProps) => __spreadProps(__spreadV
9836
9871
  }, instructionsProps), {
9837
9872
  getLocalValue: () => null,
9838
9873
  getSubmittableValue: async () => null,
9874
+ getSubmittableValueSync: () => null,
9839
9875
  getSummary: () => ({}),
9840
9876
  // Noop
9841
9877
  validate: () => true
@@ -9858,6 +9894,7 @@ var createLoadingIndicatorComponent = (loadingIndicatorProps) => __spreadProps(_
9858
9894
  type: "loading-indicator"
9859
9895
  }, loadingIndicatorProps), {
9860
9896
  getSubmittableValue: async () => null,
9897
+ getSubmittableValueSync: () => null,
9861
9898
  getLocalValue: () => null,
9862
9899
  getSummary: () => ({}),
9863
9900
  // Noop
@@ -9889,6 +9926,9 @@ var createModalComponent = (modalProps) => __spreadProps(__spreadValues({
9889
9926
  async getSubmittableValue() {
9890
9927
  return getSubmittableData(this.getChildren());
9891
9928
  },
9929
+ getSubmittableValueSync() {
9930
+ return getSubmittableDataSync(this.getChildren());
9931
+ },
9892
9932
  getSummary() {
9893
9933
  return summariseFromChildren(this.getChildren());
9894
9934
  },
@@ -9918,6 +9958,7 @@ var createParagraphComponent = (paragraphProps) => __spreadProps(__spreadValues(
9918
9958
  type: "paragraph"
9919
9959
  }, paragraphProps), {
9920
9960
  getSubmittableValue: async () => null,
9961
+ getSubmittableValueSync: () => null,
9921
9962
  getSummary: () => ({}),
9922
9963
  // Noop
9923
9964
  getLocalValue: () => null,
@@ -9939,6 +9980,7 @@ var createReviewComponent = (reviewProps) => __spreadProps(__spreadValues({
9939
9980
  }, reviewProps), {
9940
9981
  getLocalValue: () => null,
9941
9982
  getSubmittableValue: async () => null,
9983
+ getSubmittableValueSync: () => null,
9942
9984
  getSummary: () => ({}),
9943
9985
  // Noop
9944
9986
  validate: () => true
@@ -10049,6 +10091,7 @@ var createSearchComponent = (searchProps, performSearch, onAction, updateCompone
10049
10091
  query: "",
10050
10092
  results: [],
10051
10093
  getSubmittableValue: async () => null,
10094
+ getSubmittableValueSync: () => null,
10052
10095
  getLocalValue: () => null,
10053
10096
  getSummary: () => ({}),
10054
10097
  // Noop
@@ -10124,6 +10167,7 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
10124
10167
  }, statusListProps), {
10125
10168
  getLocalValue: () => null,
10126
10169
  getSubmittableValue: async () => null,
10170
+ getSubmittableValueSync: () => null,
10127
10171
  getSummary: () => ({}),
10128
10172
  // Noop,
10129
10173
  validate: () => true
@@ -14262,7 +14306,7 @@ function useExternalStepPolling(polling, onAction) {
14262
14306
  );
14263
14307
  usePolling({
14264
14308
  asyncFn,
14265
- interval: (polling == null ? void 0 : polling.interval) || 0,
14309
+ interval: (polling == null ? void 0 : polling.delay) || (polling == null ? void 0 : polling.interval) || 0,
14266
14310
  maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
14267
14311
  maxConsecutiveFails: (polling == null ? void 0 : polling.maxConsecutiveFails) || 0,
14268
14312
  onPollingResponse,