@commercetools-frontend/experimental-components 6.0.0 → 6.0.2

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.
@@ -234,6 +234,9 @@ const INTERVALS_IN_SECONDS = {
234
234
  };
235
235
  const EXCLUDING_PRODUCTS = 'excludingProducts';
236
236
 
237
+ // TODO: apply a more robust solution to overlaying issues
238
+ const Z_INDEX_DROPDOWN = 30000;
239
+
237
240
  const formats = {
238
241
  en: [',', '.'],
239
242
  de: ['.', ','],
@@ -412,6 +415,11 @@ const messages$K = reactIntl.defineMessages({
412
415
  id: 'Validation.invalid',
413
416
  description: 'An error message to show the id is invalid',
414
417
  defaultMessage: 'The resource id is invalid'
418
+ },
419
+ uuid: {
420
+ id: 'Validation.uuid',
421
+ description: 'An error message to show the id is not a valid uuid',
422
+ defaultMessage: 'Invalid ID format. Please enter a valid ID.'
415
423
  }
416
424
  });
417
425
 
@@ -2989,7 +2997,8 @@ const ChannelPickerInput = _ref => {
2989
2997
  hasError = _ref.hasError,
2990
2998
  onError = _ref.onError,
2991
2999
  placeholder = _ref.placeholder,
2992
- roles = _ref.roles;
3000
+ roles = _ref.roles,
3001
+ hasWarning = _ref.hasWarning;
2993
3002
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
2994
3003
  const _useIntl = reactIntl.useIntl(),
2995
3004
  formatMessage = _useIntl.formatMessage;
@@ -3084,7 +3093,10 @@ const ChannelPickerInput = _ref => {
3084
3093
  onBlur: onBlur,
3085
3094
  value: currentOption.data,
3086
3095
  noOptionsMessage: handleNoOptions,
3087
- hasError: hasError || isLoadingFailed
3096
+ hasError: hasError || isLoadingFailed,
3097
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
3098
+ menuPortalTarget: document.body,
3099
+ hasWarning: hasWarning
3088
3100
  })
3089
3101
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
3090
3102
  tone: "negative",
@@ -3879,7 +3891,8 @@ const ProductTypePickerInput = _ref => {
3879
3891
  onBlur = _ref.onBlur,
3880
3892
  value = _ref.value,
3881
3893
  hasError = _ref.hasError,
3882
- onError = _ref.onError;
3894
+ onError = _ref.onError,
3895
+ hasWarning = _ref.hasWarning;
3883
3896
  const _useIntl = reactIntl.useIntl(),
3884
3897
  formatMessage = _useIntl.formatMessage;
3885
3898
  const prefixSearchFields = React.useMemo(() => ['name'], []);
@@ -3945,7 +3958,10 @@ const ProductTypePickerInput = _ref => {
3945
3958
  onBlur: onBlur,
3946
3959
  value: currentOption.data,
3947
3960
  noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
3948
- hasError: hasError || isLoadingFailed
3961
+ hasError: hasError || isLoadingFailed,
3962
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
3963
+ menuPortalTarget: document.body,
3964
+ hasWarning: hasWarning
3949
3965
  })
3950
3966
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
3951
3967
  tone: "negative",
@@ -3980,7 +3996,8 @@ const StatePickerInput = _ref => {
3980
3996
  onBlur = _ref.onBlur,
3981
3997
  value = _ref.value,
3982
3998
  hasError = _ref.hasError,
3983
- onError = _ref.onError;
3999
+ onError = _ref.onError,
4000
+ hasWarning = _ref.hasWarning;
3984
4001
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
3985
4002
  const _useIntl = reactIntl.useIntl(),
3986
4003
  formatMessage = _useIntl.formatMessage;
@@ -4066,7 +4083,10 @@ const StatePickerInput = _ref => {
4066
4083
  onBlur: onBlur,
4067
4084
  value: currentOption.data,
4068
4085
  noOptionsMessage: handleNoOptions,
4069
- hasError: hasError || isLoadingFailed
4086
+ hasError: hasError || isLoadingFailed,
4087
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
4088
+ menuPortalTarget: document.body,
4089
+ hasWarning: hasWarning
4070
4090
  }, dataLocale)
4071
4091
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
4072
4092
  tone: "negative",
@@ -4446,7 +4466,6 @@ const convertAction = (actionName, actionPayload) => {
4446
4466
  }
4447
4467
  };
4448
4468
  case 'setLineItemCustomField':
4449
- case 'setCustomLineItemCustomField':
4450
4469
  return {
4451
4470
  [actionName]: {
4452
4471
  lineItemId: actionPayload.lineItemId,
@@ -4454,6 +4473,14 @@ const convertAction = (actionName, actionPayload) => {
4454
4473
  value: _JSON$stringify__default["default"](actionPayload.value)
4455
4474
  }
4456
4475
  };
4476
+ case 'setCustomLineItemCustomField':
4477
+ return {
4478
+ [actionName]: {
4479
+ customLineItemId: actionPayload.customLineItemId,
4480
+ name: actionPayload.name,
4481
+ value: _JSON$stringify__default["default"](actionPayload.value)
4482
+ }
4483
+ };
4457
4484
  case 'setCustomField':
4458
4485
  return {
4459
4486
  [actionName]: {
@@ -5205,7 +5232,7 @@ function _callSuper$4(_this, derived, args) {
5205
5232
  return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
5206
5233
  }
5207
5234
  var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
5208
- const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel'];
5235
+ const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection', 'order-return-item', 'order-parcel'];
5209
5236
  const emptyTypeDefinitions = {
5210
5237
  total: 0,
5211
5238
  count: 0,
@@ -5543,7 +5570,10 @@ function CustomTextInput(props) {
5543
5570
  const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
5544
5571
  const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
5545
5572
  const value = props.value || '';
5546
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue || undefined));
5573
+ const handleChange = makeChangeHandler(rawValue => {
5574
+ props.setFieldValue(props.name, rawValue || undefined);
5575
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5576
+ });
5547
5577
  const tooltipValue = isMultiLine ? '' : value;
5548
5578
  return jsxRuntime.jsx(CustomFieldTooltip, {
5549
5579
  title: tooltipValue,
@@ -5555,7 +5585,8 @@ function CustomTextInput(props) {
5555
5585
  onBlur: props.onBlur,
5556
5586
  hasError: props.hasError,
5557
5587
  isDisabled: props.isDisabled,
5558
- isReadOnly: props.isReadOnly
5588
+ isReadOnly: props.isReadOnly,
5589
+ hasWarning: props.hasWarning
5559
5590
  })
5560
5591
  });
5561
5592
  }
@@ -5590,6 +5621,7 @@ function CustomLocalizedTextInput(props) {
5590
5621
  });
5591
5622
  const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
5592
5623
  props.setFieldValue(props.name, nullifiedIfNeeded);
5624
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5593
5625
  });
5594
5626
  const InputComponent = isMultiLine ? uiKit.LocalizedMultilineTextInput : uiKit.LocalizedTextInput;
5595
5627
  const tooltipTitle = isMultiLine ? '' : value ? value[language] ?? '' : '';
@@ -5604,7 +5636,8 @@ function CustomLocalizedTextInput(props) {
5604
5636
  selectedLanguage: language,
5605
5637
  hasError: props.hasError,
5606
5638
  isDisabled: props.isDisabled,
5607
- isReadOnly: props.isReadOnly
5639
+ isReadOnly: props.isReadOnly,
5640
+ hasWarning: props.hasWarning
5608
5641
  })
5609
5642
  });
5610
5643
  }
@@ -5619,7 +5652,10 @@ const options$1 = [{
5619
5652
  }];
5620
5653
  function CustomBooleanInput(props) {
5621
5654
  const value = isNil__default["default"](props.value) ? props.value : String(props.value);
5622
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, isNil__default["default"](rawValue) ? undefined : rawValue === 'true'));
5655
+ const handleChange = makeChangeHandler(rawValue => {
5656
+ props.setFieldValue(props.name, isNil__default["default"](rawValue) ? undefined : rawValue === 'true');
5657
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5658
+ });
5623
5659
  return jsxRuntime.jsx(uiKit.SelectInput, {
5624
5660
  id: props.name,
5625
5661
  name: props.name,
@@ -5630,14 +5666,20 @@ function CustomBooleanInput(props) {
5630
5666
  isClearable: !props.fieldDefinition.required,
5631
5667
  isDisabled: props.isDisabled,
5632
5668
  isReadOnly: props.isReadOnly,
5633
- hasError: props.hasError
5669
+ hasError: props.hasError,
5670
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5671
+ menuPortalTarget: document.body,
5672
+ hasWarning: props.hasWarning
5634
5673
  });
5635
5674
  }
5636
5675
  CustomBooleanInput.displayName = 'CustomBooleanInput';
5637
5676
 
5638
5677
  function CustomNumberInput(props) {
5639
5678
  const value = props.value ?? '';
5640
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue)));
5679
+ const handleChange = makeChangeHandler(rawValue => {
5680
+ props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue));
5681
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5682
+ });
5641
5683
  return jsxRuntime.jsx(uiKit.NumberInput, {
5642
5684
  id: props.name,
5643
5685
  name: props.name,
@@ -5646,7 +5688,8 @@ function CustomNumberInput(props) {
5646
5688
  onBlur: props.onBlur,
5647
5689
  hasError: props.hasError,
5648
5690
  isDisabled: props.isDisabled,
5649
- isReadOnly: props.isReadOnly
5691
+ isReadOnly: props.isReadOnly,
5692
+ hasWarning: props.hasWarning
5650
5693
  });
5651
5694
  }
5652
5695
  CustomNumberInput.displayName = 'CustomNumberInput';
@@ -5713,6 +5756,7 @@ function CustomMoneyInput(props) {
5713
5756
  internalValue.current = fixedValue;
5714
5757
  const converted = uiKit.MoneyInput.convertToMoneyValue(fixedValue, locale);
5715
5758
  props.setFieldValue(props.name, converted || undefined);
5759
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5716
5760
  });
5717
5761
 
5718
5762
  // TODO(pa3): fix setting proper id in UIKit
@@ -5734,7 +5778,10 @@ function CustomMoneyInput(props) {
5734
5778
  isReadOnly: props.isReadOnly,
5735
5779
  isDisabled: props.isDisabled,
5736
5780
  hasError: props.hasError,
5737
- horizontalConstraint: "scale"
5781
+ horizontalConstraint: "scale",
5782
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5783
+ menuPortalTarget: document.body,
5784
+ hasWarning: props.hasWarning
5738
5785
  })]
5739
5786
  });
5740
5787
  }
@@ -5760,7 +5807,10 @@ function CustomLocalizedEnumInput(props) {
5760
5807
  languages = _useApplicationContex.languages,
5761
5808
  dataLocale = _useApplicationContex.dataLocale;
5762
5809
  const options = convertTypeValuesToOptions$1(props.fieldDefinition.type, dataLocale, languages);
5763
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue));
5810
+ const handleChange = makeChangeHandler(rawValue => {
5811
+ props.setFieldValue(props.name, rawValue);
5812
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5813
+ });
5764
5814
  const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
5765
5815
  return jsxRuntime.jsx(CustomFieldTooltip, {
5766
5816
  title: tooltipTitle,
@@ -5774,7 +5824,10 @@ function CustomLocalizedEnumInput(props) {
5774
5824
  isClearable: !props.fieldDefinition.required,
5775
5825
  hasError: props.hasError,
5776
5826
  isDisabled: props.isDisabled,
5777
- isReadOnly: props.isReadOnly
5827
+ isReadOnly: props.isReadOnly,
5828
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5829
+ menuPortalTarget: document.body,
5830
+ hasWarning: props.hasWarning
5778
5831
  })
5779
5832
  });
5780
5833
  }
@@ -5791,7 +5844,8 @@ function CustomRawIdReferenceInput(props) {
5791
5844
  onBlur: props.onBlur,
5792
5845
  hasError: props.hasError,
5793
5846
  isDisabled: props.isDisabled,
5794
- isReadOnly: props.isReadOnly
5847
+ isReadOnly: props.isReadOnly,
5848
+ hasWarning: props.hasWarning
5795
5849
  })
5796
5850
  });
5797
5851
  }
@@ -5976,7 +6030,10 @@ function ReferenceSearch(props) {
5976
6030
  isReadOnly: props.isReadOnly,
5977
6031
  onBlur: props.onBlur,
5978
6032
  hasError: props.hasError,
5979
- noOptionsMessage: () => props.noResultsLabel
6033
+ noOptionsMessage: () => props.noResultsLabel,
6034
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6035
+ menuPortalTarget: document.body,
6036
+ hasWarning: props.hasWarning
5980
6037
  })]
5981
6038
  })
5982
6039
  })]
@@ -6106,7 +6163,8 @@ function CategoryReferenceSearch(props) {
6106
6163
  mapItemToOption: mapItemToOption,
6107
6164
  loadItemsBySearchTerm: loadItemsBySearchTerm,
6108
6165
  loadItemsByIds: loadItemsByIds,
6109
- filterOption: filterOption$1
6166
+ filterOption: filterOption$1,
6167
+ hasWarning: props.hasWarning
6110
6168
  });
6111
6169
  }
6112
6170
 
@@ -6309,7 +6367,8 @@ function CartDiscountReferenceSearch(props) {
6309
6367
  mapItemToOption: mapItemToOption,
6310
6368
  loadItemsBySearchTerm: loadItemsBySearchTerm,
6311
6369
  loadItemsByIds: loadItemsByIds,
6312
- filterOption: filterOption
6370
+ filterOption: filterOption,
6371
+ hasWarning: props.hasWarning
6313
6372
  })
6314
6373
  });
6315
6374
  }
@@ -6336,7 +6395,8 @@ function CustomCategoryReferenceInput(props) {
6336
6395
  hasError: props.hasError,
6337
6396
  isReadOnly: props.isReadOnly,
6338
6397
  isDisabled: props.isDisabled,
6339
- isClearable: !props.fieldDefinition.required
6398
+ isClearable: !props.fieldDefinition.required,
6399
+ hasWarning: props.hasWarning
6340
6400
  });
6341
6401
  }
6342
6402
  CustomCategoryReferenceInput.displayName = 'CustomCategoryReferenceInput';
@@ -6362,7 +6422,8 @@ function CustomCartDiscountReferenceInput(props) {
6362
6422
  onBlur: handleBlur,
6363
6423
  hasError: props.hasError,
6364
6424
  isDisabled: props.isDisabled || props.isReadOnly,
6365
- isClearable: !props.fieldDefinition.required
6425
+ isClearable: !props.fieldDefinition.required,
6426
+ hasWarning: props.hasWarning
6366
6427
  });
6367
6428
  }
6368
6429
 
@@ -6395,7 +6456,8 @@ const ProductPickerInput = _ref => {
6395
6456
  value = _ref.value,
6396
6457
  hasError = _ref.hasError,
6397
6458
  onError = _ref.onError,
6398
- showLoadingErrorMessage = _ref.showLoadingErrorMessage;
6459
+ showLoadingErrorMessage = _ref.showLoadingErrorMessage,
6460
+ hasWarning = _ref.hasWarning;
6399
6461
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
6400
6462
  const _useIntl = reactIntl.useIntl(),
6401
6463
  formatMessage = _useIntl.formatMessage;
@@ -6478,7 +6540,10 @@ const ProductPickerInput = _ref => {
6478
6540
  onBlur: onBlur,
6479
6541
  value: currentOption.data,
6480
6542
  noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
6481
- hasError: hasError || isLoadingFailed
6543
+ hasError: hasError || isLoadingFailed,
6544
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6545
+ menuPortalTarget: document.body,
6546
+ hasWarning: hasWarning
6482
6547
  })
6483
6548
  }), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
6484
6549
  tone: "negative",
@@ -6501,7 +6566,8 @@ function CustomProductReferenceInput(props) {
6501
6566
  onChange: props.onChange,
6502
6567
  hasError: props.hasError,
6503
6568
  onError: () => null,
6504
- showLoadingErrorMessage: true
6569
+ showLoadingErrorMessage: true,
6570
+ hasWarning: props.hasWarning
6505
6571
  });
6506
6572
  }
6507
6573
  CustomProductReferenceInput.displayName = 'CustomProductReferenceInput';
@@ -6517,7 +6583,8 @@ function CustomProductTypeReferenceInput(props) {
6517
6583
  onBlur: props.onBlur,
6518
6584
  onChange: props.onChange,
6519
6585
  hasError: props.hasError,
6520
- onError: () => null
6586
+ onError: () => null,
6587
+ hasWarning: props.hasWarning
6521
6588
  });
6522
6589
  }
6523
6590
  CustomProductTypeReferenceInput.displayName = 'CustomProductTypeReferenceInput';
@@ -6533,7 +6600,8 @@ function CustomChannelReferenceInput(props) {
6533
6600
  onBlur: props.onBlur,
6534
6601
  onChange: props.onChange,
6535
6602
  hasError: props.hasError,
6536
- onError: () => null
6603
+ onError: () => null,
6604
+ hasWarning: props.hasWarning
6537
6605
  });
6538
6606
  }
6539
6607
  CustomChannelReferenceInput.displayName = 'CustomChannelReferenceInput';
@@ -6549,7 +6617,8 @@ function CustomStateReferenceInput(props) {
6549
6617
  onBlur: props.onBlur,
6550
6618
  onChange: props.onChange,
6551
6619
  hasError: props.hasError,
6552
- onError: () => null
6620
+ onError: () => null,
6621
+ hasWarning: props.hasWarning
6553
6622
  });
6554
6623
  }
6555
6624
  CustomStateReferenceInput.displayName = 'CustomStateReferenceInput';
@@ -6563,6 +6632,7 @@ function CustomReferenceInput(props) {
6563
6632
  typeId: referenceTypeId
6564
6633
  } : undefined;
6565
6634
  props.setFieldValue(props.name, nullifiedIfNeeded);
6635
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6566
6636
  });
6567
6637
  const ReferenceInputComponent = referenceTypeId === SEARCHABLE_REFERENCES.category ? CustomCategoryReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount ? CustomCartDiscountReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.product ? CustomProductReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.productType ? CustomProductTypeReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.channel ? CustomChannelReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.state ? CustomStateReferenceInput : CustomRawIdReferenceInput;
6568
6638
  return jsxRuntime.jsx(ReferenceInputComponent, {
@@ -6575,7 +6645,8 @@ function CustomReferenceInput(props) {
6575
6645
  isReadOnly: props.isReadOnly,
6576
6646
  onBlur: props.onBlur,
6577
6647
  hasError: props.hasError,
6578
- onChange: handleChange
6648
+ onChange: handleChange,
6649
+ hasWarning: props.hasWarning
6579
6650
  });
6580
6651
  }
6581
6652
  CustomReferenceInput.displayName = 'CustomReferenceInput';
@@ -6586,6 +6657,7 @@ function CustomDateTimeInput(props) {
6586
6657
  const typeName = props.fieldDefinition.type.name.toLowerCase();
6587
6658
  const handleChange = makeChangeHandler(rawValue => {
6588
6659
  props.setFieldValue(props.name, rawValue || undefined);
6660
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6589
6661
  });
6590
6662
  const InputComponent = typeName === 'date' ? uiKit.DateInput : uiKit.DateTimeInput;
6591
6663
  return jsxRuntime.jsx(InputComponent, {
@@ -6597,7 +6669,8 @@ function CustomDateTimeInput(props) {
6597
6669
  timeZone: timeZone,
6598
6670
  hasError: props.hasError,
6599
6671
  isDisabled: props.isDisabled,
6600
- isReadOnly: props.isReadOnly
6672
+ isReadOnly: props.isReadOnly,
6673
+ hasWarning: props.hasWarning
6601
6674
  });
6602
6675
  }
6603
6676
  CustomDateTimeInput.displayName = 'CustomDateTimeInput';
@@ -6632,6 +6705,7 @@ function CustomTimeInput(props) {
6632
6705
  lastValueSentToFormik.current = in24hFormat;
6633
6706
  props.setFieldValue(props.name, in24hFormat);
6634
6707
  }
6708
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6635
6709
  });
6636
6710
  return jsxRuntime.jsx(uiKit.TimeInput, {
6637
6711
  id: props.name,
@@ -6642,7 +6716,8 @@ function CustomTimeInput(props) {
6642
6716
  timeZone: timeZone,
6643
6717
  hasError: props.hasError,
6644
6718
  isDisabled: props.isDisabled,
6645
- isReadOnly: props.isReadOnly
6719
+ isReadOnly: props.isReadOnly,
6720
+ hasWarning: props.hasWarning
6646
6721
  });
6647
6722
  }
6648
6723
  CustomTimeInput.displayName = 'CustomTimeInput';
@@ -6653,7 +6728,10 @@ const convertTypeValuesToOptions = reselect.defaultMemoize(typeValues => _mapIns
6653
6728
  })));
6654
6729
  function CustomEnumInput(props) {
6655
6730
  const options = convertTypeValuesToOptions(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
6656
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue));
6731
+ const handleChange = makeChangeHandler(rawValue => {
6732
+ props.setFieldValue(props.name, rawValue);
6733
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6734
+ });
6657
6735
  const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
6658
6736
  return jsxRuntime.jsx(CustomFieldTooltip, {
6659
6737
  title: tooltipTitle,
@@ -6667,7 +6745,10 @@ function CustomEnumInput(props) {
6667
6745
  options: options,
6668
6746
  hasError: props.hasError,
6669
6747
  isDisabled: props.isDisabled,
6670
- isReadOnly: props.isReadOnly
6748
+ isReadOnly: props.isReadOnly,
6749
+ hasWarning: props.hasWarning,
6750
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6751
+ menuPortalTarget: document.body
6671
6752
  })
6672
6753
  });
6673
6754
  }
@@ -6716,8 +6797,11 @@ function CustomBooleanInputSet(props) {
6716
6797
  onBlur: props.onBlur,
6717
6798
  isClearable: !props.fieldDefinition.required,
6718
6799
  hasError: props.hasError,
6800
+ hasWarning: props.hasWarning,
6719
6801
  isDisabled: props.isDisabled,
6720
- isReadOnly: props.isReadOnly
6802
+ isReadOnly: props.isReadOnly,
6803
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6804
+ menuPortalTarget: document.body
6721
6805
  });
6722
6806
  }
6723
6807
  CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
@@ -6768,7 +6852,8 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
6768
6852
  inputTip: attributeDefinition.inputTip,
6769
6853
  required: attributeDefinition.isRequired,
6770
6854
  type: attributeDefinition.type,
6771
- assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
6855
+ assignedAttributeGroups: attributeDefinition.assignedAttributeGroups,
6856
+ attributeConstraint: attributeDefinition.attributeConstraint
6772
6857
  });
6773
6858
  const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
6774
6859
  let name = _ref2.name,
@@ -6822,7 +6907,10 @@ function ProductAttributes(_ref) {
6822
6907
  fieldDefinitions: fieldDefinitions,
6823
6908
  setFieldValue: setFieldValue,
6824
6909
  inputValuesConverter: convertInputValue,
6825
- WrapperComponent: WrapperComponent
6910
+ WrapperComponent: WrapperComponent,
6911
+ renderWarnings: props.renderWarnings,
6912
+ renderCustomWarnings: props.renderCustomWarnings,
6913
+ handleWarningChange: props.handleWarningChange
6826
6914
  })
6827
6915
  })
6828
6916
  });
@@ -7430,7 +7518,10 @@ function CustomInputSet(props) {
7430
7518
  setFieldValue: setItemValue,
7431
7519
  value: fieldValue,
7432
7520
  hasError: props.hasError,
7433
- WrapperComponent: props.WrapperComponent
7521
+ hasWarning: props.hasWarning,
7522
+ WrapperComponent: props.WrapperComponent,
7523
+ renderWarnings: props.renderWarnings,
7524
+ handleWarningChange: props.handleWarningChange
7434
7525
  }), jsxRuntime.jsx(SetButtons, {
7435
7526
  index: index,
7436
7527
  isFirstItem: !isExpanded || index === 0,
@@ -7493,7 +7584,10 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
7493
7584
  isReadOnly: props.isReadOnly,
7494
7585
  onBlur: props.onBlur,
7495
7586
  setFieldValue: props.setFieldValue,
7496
- hasError: props.hasError
7587
+ hasError: props.hasError,
7588
+ hasWarning: props.hasWarning,
7589
+ handleWarningChange: props.handleWarningChange,
7590
+ renderWarnings: props.renderWarnings
7497
7591
  });
7498
7592
  });
7499
7593
  CustomFieldInput.displayName = 'CustomFieldInput';
@@ -7549,7 +7643,10 @@ function CustomNestedFieldInput(props) {
7549
7643
  isDisabled: props.isDisabled,
7550
7644
  isReadOnly: props.isReadOnly,
7551
7645
  setFieldValue: props.setFieldValue,
7552
- onBlur: props.onBlur
7646
+ onBlur: props.onBlur,
7647
+ hasWarning: props.hasWarning,
7648
+ handleWarningChange: props.handleWarningChange,
7649
+ renderWarnings: props.renderWarnings
7553
7650
  })]
7554
7651
  });
7555
7652
  }
@@ -7773,7 +7870,8 @@ const CustomFieldsInternal = _ref => {
7773
7870
  errors = _useFormikContext.errors,
7774
7871
  touched = _useFormikContext.touched,
7775
7872
  values = _valuesInstanceProperty__default["default"](_useFormikContext),
7776
- handleBlur = _useFormikContext.handleBlur;
7873
+ handleBlur = _useFormikContext.handleBlur,
7874
+ status = _useFormikContext.status;
7777
7875
  const didFormValidationFail = useDidFormValidationFail();
7778
7876
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7779
7877
  const _useDnDContext = useDnDContext(),
@@ -7789,6 +7887,7 @@ const CustomFieldsInternal = _ref => {
7789
7887
  const isTouched = Boolean(formik.getIn(touched, fieldName));
7790
7888
  const fieldErrors = formik.getIn(errors, fieldName);
7791
7889
  const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
7890
+
7792
7891
  // We want to highlight fields with errors not only after a form submission,
7793
7892
  // but also after manually triggered form validation.
7794
7893
  const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
@@ -7807,7 +7906,10 @@ const CustomFieldsInternal = _ref => {
7807
7906
  isReadOnly: props.isReadOnly,
7808
7907
  onBlur: handleBlur,
7809
7908
  setFieldValue: props.setFieldValue,
7810
- hasError: hasError
7909
+ hasError: hasError,
7910
+ hasWarning: props.renderWarnings && status?.warnings[fieldName],
7911
+ handleWarningChange: props.handleWarningChange,
7912
+ renderWarnings: props.renderWarnings
7811
7913
  };
7812
7914
  const Field = jsxRuntime.jsx(FieldComponent, _objectSpread$J({}, fieldProps));
7813
7915
  return jsxRuntime.jsx(formik.FastField, {
@@ -7831,7 +7933,7 @@ const CustomFieldsInternal = _ref => {
7831
7933
  alignItems: "stretch",
7832
7934
  children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
7833
7935
  children: Field
7834
- }) : Field, jsxRuntime.jsx(CustomFieldErrors, {
7936
+ }) : Field, props.renderWarnings && status?.warnings[fieldName] && props.renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors, {
7835
7937
  isTouched: isTouched,
7836
7938
  errors: fieldErrors
7837
7939
  })]
@@ -7844,6 +7946,9 @@ const CustomFieldsInternal = _ref => {
7844
7946
  });
7845
7947
  };
7846
7948
  CustomFieldsInternal.displayName = 'CustomFieldsInternal';
7949
+ CustomFieldsInternal.defaultProps = {
7950
+ renderCustomWarnings: () => null
7951
+ };
7847
7952
 
7848
7953
  const nopConverter = (fieldName, fieldValue) => fieldValue;
7849
7954
  const CustomFields = props => {
@@ -7976,6 +8081,10 @@ function ProductSelectionBasicSelectDropdown(props) {
7976
8081
  isReadOnly: props.isReadOnly,
7977
8082
  hasWarning: props.hasWarning,
7978
8083
  hasError: props.hasError,
8084
+ errors: {
8085
+ missing: props.hasError
8086
+ },
8087
+ touched: props.touched,
7979
8088
  isClearable: props.isClearable,
7980
8089
  menuPortalTarget: props.menuPortalTarget,
7981
8090
  menuPortalZIndex: props.menuPortalZIndex,
@@ -8095,6 +8204,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
8095
8204
  defaultOptions: getDefaultOptions(),
8096
8205
  hasWarning: props.hasWarning,
8097
8206
  hasError: props.hasError,
8207
+ errors: {
8208
+ missing: props.hasError
8209
+ },
8210
+ touched: props.touched,
8098
8211
  isClearable: props.isClearable,
8099
8212
  menuPortalTarget: props.menuPortalTarget,
8100
8213
  menuPortalZIndex: props.menuPortalZIndex,
@@ -8239,6 +8352,10 @@ function ProductSelectionsSearchSelectDropdown(props) {
8239
8352
  isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
8240
8353
  isReadOnly: props.isReadOnly,
8241
8354
  hasWarning: props.hasWarning,
8355
+ errors: {
8356
+ missing: props.hasError
8357
+ },
8358
+ touched: props.touched,
8242
8359
  isClearable: props.isClearable,
8243
8360
  hasError: props.hasError,
8244
8361
  menuPortalTarget: props.menuPortalTarget,
@@ -9061,6 +9178,7 @@ const StoresSearchSelectInput = props => {
9061
9178
  maxMenuHeight: props.maxMenuHeight,
9062
9179
  menuPortalTarget: props.menuPortalTarget,
9063
9180
  menuPortalZIndex: props.menuPortalZIndex,
9181
+ menuIsOpen: props.menuIsOpen,
9064
9182
  components: props.components,
9065
9183
  controlShouldRenderValue: props.controlShouldRenderValue
9066
9184
  }, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props))), jsxRuntime.jsx(uiKit.FieldErrors, {
@@ -12711,8 +12829,10 @@ const validateMultiOptionEnum = (selectedOption, intl) => {
12711
12829
  };
12712
12830
 
12713
12831
  // eslint-disable-next-line import/prefer-default-export
12714
- const validateText = (text, intl) => {
12832
+ const validateText = function (text, intl) {
12833
+ let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
12715
12834
  if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
12835
+ if (type === 'id' && !isUUID(text.value)) return intl.formatMessage(messages$K.uuid);
12716
12836
  return null;
12717
12837
  };
12718
12838