@wise/dynamic-flow-client 3.9.2 → 3.9.4

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
@@ -319,16 +319,10 @@ var applyBaseUrl = (input, baseUrl) => typeof input === "string" && isRelativePa
319
319
  var mergeRequestInit = (init, additionalInit) => __spreadProps(__spreadValues(__spreadValues({}, init), additionalInit), {
320
320
  headers: mergeHeaders(init == null ? void 0 : init.headers, additionalInit == null ? void 0 : additionalInit.headers)
321
321
  });
322
- var mergeHeaders = (initHeaders, additionalHeaders) => {
323
- if (!initHeaders && !additionalHeaders) {
324
- return {};
325
- }
326
- const headers2 = new Headers(initHeaders);
327
- for (const [key, value] of Object.entries(additionalHeaders != null ? additionalHeaders : {})) {
328
- headers2.set(key, value);
329
- }
330
- return headers2;
331
- };
322
+ var mergeHeaders = (...headersInits) => headersInits.reduce(
323
+ (acc, headers2) => __spreadValues(__spreadValues({}, acc), Object.fromEntries(new Headers(headers2).entries())),
324
+ {}
325
+ );
332
326
 
333
327
  // src/i18n/de.json
334
328
  var de_default = {
@@ -7783,7 +7777,7 @@ var isPartialLocalValueMatch = (partialValue, component) => {
7783
7777
  const matchingKeys = allKeys.filter(
7784
7778
  (key) => !isNullish(partialValue[key]) && !isNullish(componentValue[key])
7785
7779
  );
7786
- return matchingKeys.every((key) => {
7780
+ return matchingKeys.length > 0 && matchingKeys.every((key) => {
7787
7781
  const componentForKey = getComponentForLocalValueKey(key, component);
7788
7782
  return componentForKey ? isPartialLocalValueMatch(partialValue[key], componentForKey) : false;
7789
7783
  });
@@ -11674,6 +11668,7 @@ function SelectInputRendererComponent(props) {
11674
11668
  label,
11675
11669
  options,
11676
11670
  placeholder,
11671
+ required,
11677
11672
  selectedIndex,
11678
11673
  onSelect
11679
11674
  } = props;
@@ -11716,7 +11711,7 @@ function SelectInputRendererComponent(props) {
11716
11711
  renderValue,
11717
11712
  filterable: items.length >= 8,
11718
11713
  onChange: onSelect,
11719
- onClear: () => onSelect(null)
11714
+ onClear: required ? void 0 : () => onSelect(null)
11720
11715
  }
11721
11716
  ) }),
11722
11717
  children
@@ -15342,7 +15337,7 @@ var _FormControl = class _FormControl extends import_react37.PureComponent {
15342
15337
  onFilterChange: search && onSearchChange ? ({ query }) => {
15343
15338
  onSearchChange(query);
15344
15339
  } : void 0,
15345
- onClear: () => {
15340
+ onClear: required ? void 0 : () => {
15346
15341
  this.setState({ selectedOption: null });
15347
15342
  this.props.onChange(null);
15348
15343
  }
@@ -15680,7 +15675,18 @@ var getOptions = (schema, controlType) => {
15680
15675
  return null;
15681
15676
  };
15682
15677
  function SchemaFormControl(props) {
15683
- const { id, schema, value, disabled, onChange, onFocus, onBlur, onSearchChange, describedBy } = props;
15678
+ const {
15679
+ id,
15680
+ schema,
15681
+ value,
15682
+ disabled,
15683
+ required,
15684
+ onChange,
15685
+ onFocus,
15686
+ onBlur,
15687
+ onSearchChange,
15688
+ describedBy
15689
+ } = props;
15684
15690
  const log = useLogger();
15685
15691
  const getSanitisedValue = (value2) => isNativeInput(schema.type) && (isNull3(value2) || isUndefined3(value2)) ? "" : value2;
15686
15692
  const onModelChange = (value2, type, metadata) => {
@@ -15711,7 +15717,8 @@ function SchemaFormControl(props) {
15711
15717
  displayPattern: schema.displayFormat,
15712
15718
  // TODO: LOW avoid type assertion below
15713
15719
  uploadProps: mapSchemaToUploadOptions(schema),
15714
- describedBy
15720
+ describedBy,
15721
+ required
15715
15722
  };
15716
15723
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
15717
15724
  }
@@ -15831,6 +15838,7 @@ function OneOfSchema(props) {
15831
15838
  value: schemaIndex,
15832
15839
  disabled: props.disabled,
15833
15840
  describedBy: feedbackId,
15841
+ required: props.required,
15834
15842
  onChange: onChooseNewSchema,
15835
15843
  onFocus,
15836
15844
  onBlur,