@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.
@@ -233,6 +233,9 @@ const INTERVALS_IN_SECONDS = {
233
233
  };
234
234
  const EXCLUDING_PRODUCTS = 'excludingProducts';
235
235
 
236
+ // TODO: apply a more robust solution to overlaying issues
237
+ const Z_INDEX_DROPDOWN = 30000;
238
+
236
239
  const formats = {
237
240
  en: [',', '.'],
238
241
  de: ['.', ','],
@@ -411,6 +414,11 @@ const messages$K = reactIntl.defineMessages({
411
414
  id: 'Validation.invalid',
412
415
  description: 'An error message to show the id is invalid',
413
416
  defaultMessage: 'The resource id is invalid'
417
+ },
418
+ uuid: {
419
+ id: 'Validation.uuid',
420
+ description: 'An error message to show the id is not a valid uuid',
421
+ defaultMessage: 'Invalid ID format. Please enter a valid ID.'
414
422
  }
415
423
  });
416
424
 
@@ -2988,7 +2996,8 @@ const ChannelPickerInput = _ref => {
2988
2996
  hasError = _ref.hasError,
2989
2997
  onError = _ref.onError,
2990
2998
  placeholder = _ref.placeholder,
2991
- roles = _ref.roles;
2999
+ roles = _ref.roles,
3000
+ hasWarning = _ref.hasWarning;
2992
3001
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
2993
3002
  const _useIntl = reactIntl.useIntl(),
2994
3003
  formatMessage = _useIntl.formatMessage;
@@ -3083,7 +3092,10 @@ const ChannelPickerInput = _ref => {
3083
3092
  onBlur: onBlur,
3084
3093
  value: currentOption.data,
3085
3094
  noOptionsMessage: handleNoOptions,
3086
- hasError: hasError || isLoadingFailed
3095
+ hasError: hasError || isLoadingFailed,
3096
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
3097
+ menuPortalTarget: document.body,
3098
+ hasWarning: hasWarning
3087
3099
  })
3088
3100
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
3089
3101
  tone: "negative",
@@ -3878,7 +3890,8 @@ const ProductTypePickerInput = _ref => {
3878
3890
  onBlur = _ref.onBlur,
3879
3891
  value = _ref.value,
3880
3892
  hasError = _ref.hasError,
3881
- onError = _ref.onError;
3893
+ onError = _ref.onError,
3894
+ hasWarning = _ref.hasWarning;
3882
3895
  const _useIntl = reactIntl.useIntl(),
3883
3896
  formatMessage = _useIntl.formatMessage;
3884
3897
  const prefixSearchFields = React.useMemo(() => ['name'], []);
@@ -3944,7 +3957,10 @@ const ProductTypePickerInput = _ref => {
3944
3957
  onBlur: onBlur,
3945
3958
  value: currentOption.data,
3946
3959
  noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
3947
- hasError: hasError || isLoadingFailed
3960
+ hasError: hasError || isLoadingFailed,
3961
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
3962
+ menuPortalTarget: document.body,
3963
+ hasWarning: hasWarning
3948
3964
  })
3949
3965
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
3950
3966
  tone: "negative",
@@ -3979,7 +3995,8 @@ const StatePickerInput = _ref => {
3979
3995
  onBlur = _ref.onBlur,
3980
3996
  value = _ref.value,
3981
3997
  hasError = _ref.hasError,
3982
- onError = _ref.onError;
3998
+ onError = _ref.onError,
3999
+ hasWarning = _ref.hasWarning;
3983
4000
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
3984
4001
  const _useIntl = reactIntl.useIntl(),
3985
4002
  formatMessage = _useIntl.formatMessage;
@@ -4065,7 +4082,10 @@ const StatePickerInput = _ref => {
4065
4082
  onBlur: onBlur,
4066
4083
  value: currentOption.data,
4067
4084
  noOptionsMessage: handleNoOptions,
4068
- hasError: hasError || isLoadingFailed
4085
+ hasError: hasError || isLoadingFailed,
4086
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
4087
+ menuPortalTarget: document.body,
4088
+ hasWarning: hasWarning
4069
4089
  }, dataLocale)
4070
4090
  }), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
4071
4091
  tone: "negative",
@@ -4445,7 +4465,6 @@ const convertAction = (actionName, actionPayload) => {
4445
4465
  }
4446
4466
  };
4447
4467
  case 'setLineItemCustomField':
4448
- case 'setCustomLineItemCustomField':
4449
4468
  return {
4450
4469
  [actionName]: {
4451
4470
  lineItemId: actionPayload.lineItemId,
@@ -4453,6 +4472,14 @@ const convertAction = (actionName, actionPayload) => {
4453
4472
  value: _JSON$stringify__default["default"](actionPayload.value)
4454
4473
  }
4455
4474
  };
4475
+ case 'setCustomLineItemCustomField':
4476
+ return {
4477
+ [actionName]: {
4478
+ customLineItemId: actionPayload.customLineItemId,
4479
+ name: actionPayload.name,
4480
+ value: _JSON$stringify__default["default"](actionPayload.value)
4481
+ }
4482
+ };
4456
4483
  case 'setCustomField':
4457
4484
  return {
4458
4485
  [actionName]: {
@@ -5204,7 +5231,7 @@ function _callSuper$4(_this, derived, args) {
5204
5231
  return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
5205
5232
  }
5206
5233
  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 } } } };
5207
- 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'];
5234
+ 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'];
5208
5235
  const emptyTypeDefinitions = {
5209
5236
  total: 0,
5210
5237
  count: 0,
@@ -5536,7 +5563,10 @@ function CustomTextInput(props) {
5536
5563
  const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
5537
5564
  const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
5538
5565
  const value = props.value || '';
5539
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue || undefined));
5566
+ const handleChange = makeChangeHandler(rawValue => {
5567
+ props.setFieldValue(props.name, rawValue || undefined);
5568
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5569
+ });
5540
5570
  const tooltipValue = isMultiLine ? '' : value;
5541
5571
  return jsxRuntime.jsx(CustomFieldTooltip, {
5542
5572
  title: tooltipValue,
@@ -5548,7 +5578,8 @@ function CustomTextInput(props) {
5548
5578
  onBlur: props.onBlur,
5549
5579
  hasError: props.hasError,
5550
5580
  isDisabled: props.isDisabled,
5551
- isReadOnly: props.isReadOnly
5581
+ isReadOnly: props.isReadOnly,
5582
+ hasWarning: props.hasWarning
5552
5583
  })
5553
5584
  });
5554
5585
  }
@@ -5583,6 +5614,7 @@ function CustomLocalizedTextInput(props) {
5583
5614
  });
5584
5615
  const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
5585
5616
  props.setFieldValue(props.name, nullifiedIfNeeded);
5617
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5586
5618
  });
5587
5619
  const InputComponent = isMultiLine ? uiKit.LocalizedMultilineTextInput : uiKit.LocalizedTextInput;
5588
5620
  const tooltipTitle = isMultiLine ? '' : value ? value[language] ?? '' : '';
@@ -5597,7 +5629,8 @@ function CustomLocalizedTextInput(props) {
5597
5629
  selectedLanguage: language,
5598
5630
  hasError: props.hasError,
5599
5631
  isDisabled: props.isDisabled,
5600
- isReadOnly: props.isReadOnly
5632
+ isReadOnly: props.isReadOnly,
5633
+ hasWarning: props.hasWarning
5601
5634
  })
5602
5635
  });
5603
5636
  }
@@ -5612,7 +5645,10 @@ const options$1 = [{
5612
5645
  }];
5613
5646
  function CustomBooleanInput(props) {
5614
5647
  const value = isNil__default["default"](props.value) ? props.value : String(props.value);
5615
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, isNil__default["default"](rawValue) ? undefined : rawValue === 'true'));
5648
+ const handleChange = makeChangeHandler(rawValue => {
5649
+ props.setFieldValue(props.name, isNil__default["default"](rawValue) ? undefined : rawValue === 'true');
5650
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5651
+ });
5616
5652
  return jsxRuntime.jsx(uiKit.SelectInput, {
5617
5653
  id: props.name,
5618
5654
  name: props.name,
@@ -5623,14 +5659,20 @@ function CustomBooleanInput(props) {
5623
5659
  isClearable: !props.fieldDefinition.required,
5624
5660
  isDisabled: props.isDisabled,
5625
5661
  isReadOnly: props.isReadOnly,
5626
- hasError: props.hasError
5662
+ hasError: props.hasError,
5663
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5664
+ menuPortalTarget: document.body,
5665
+ hasWarning: props.hasWarning
5627
5666
  });
5628
5667
  }
5629
5668
  CustomBooleanInput.displayName = 'CustomBooleanInput';
5630
5669
 
5631
5670
  function CustomNumberInput(props) {
5632
5671
  const value = props.value ?? '';
5633
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue)));
5672
+ const handleChange = makeChangeHandler(rawValue => {
5673
+ props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue));
5674
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5675
+ });
5634
5676
  return jsxRuntime.jsx(uiKit.NumberInput, {
5635
5677
  id: props.name,
5636
5678
  name: props.name,
@@ -5639,7 +5681,8 @@ function CustomNumberInput(props) {
5639
5681
  onBlur: props.onBlur,
5640
5682
  hasError: props.hasError,
5641
5683
  isDisabled: props.isDisabled,
5642
- isReadOnly: props.isReadOnly
5684
+ isReadOnly: props.isReadOnly,
5685
+ hasWarning: props.hasWarning
5643
5686
  });
5644
5687
  }
5645
5688
  CustomNumberInput.displayName = 'CustomNumberInput';
@@ -5706,6 +5749,7 @@ function CustomMoneyInput(props) {
5706
5749
  internalValue.current = fixedValue;
5707
5750
  const converted = uiKit.MoneyInput.convertToMoneyValue(fixedValue, locale);
5708
5751
  props.setFieldValue(props.name, converted || undefined);
5752
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5709
5753
  });
5710
5754
 
5711
5755
  // TODO(pa3): fix setting proper id in UIKit
@@ -5727,7 +5771,10 @@ function CustomMoneyInput(props) {
5727
5771
  isReadOnly: props.isReadOnly,
5728
5772
  isDisabled: props.isDisabled,
5729
5773
  hasError: props.hasError,
5730
- horizontalConstraint: "scale"
5774
+ horizontalConstraint: "scale",
5775
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5776
+ menuPortalTarget: document.body,
5777
+ hasWarning: props.hasWarning
5731
5778
  })]
5732
5779
  });
5733
5780
  }
@@ -5753,7 +5800,10 @@ function CustomLocalizedEnumInput(props) {
5753
5800
  languages = _useApplicationContex.languages,
5754
5801
  dataLocale = _useApplicationContex.dataLocale;
5755
5802
  const options = convertTypeValuesToOptions$1(props.fieldDefinition.type, dataLocale, languages);
5756
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue));
5803
+ const handleChange = makeChangeHandler(rawValue => {
5804
+ props.setFieldValue(props.name, rawValue);
5805
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
5806
+ });
5757
5807
  const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
5758
5808
  return jsxRuntime.jsx(CustomFieldTooltip, {
5759
5809
  title: tooltipTitle,
@@ -5767,7 +5817,10 @@ function CustomLocalizedEnumInput(props) {
5767
5817
  isClearable: !props.fieldDefinition.required,
5768
5818
  hasError: props.hasError,
5769
5819
  isDisabled: props.isDisabled,
5770
- isReadOnly: props.isReadOnly
5820
+ isReadOnly: props.isReadOnly,
5821
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
5822
+ menuPortalTarget: document.body,
5823
+ hasWarning: props.hasWarning
5771
5824
  })
5772
5825
  });
5773
5826
  }
@@ -5784,7 +5837,8 @@ function CustomRawIdReferenceInput(props) {
5784
5837
  onBlur: props.onBlur,
5785
5838
  hasError: props.hasError,
5786
5839
  isDisabled: props.isDisabled,
5787
- isReadOnly: props.isReadOnly
5840
+ isReadOnly: props.isReadOnly,
5841
+ hasWarning: props.hasWarning
5788
5842
  })
5789
5843
  });
5790
5844
  }
@@ -5969,7 +6023,10 @@ function ReferenceSearch(props) {
5969
6023
  isReadOnly: props.isReadOnly,
5970
6024
  onBlur: props.onBlur,
5971
6025
  hasError: props.hasError,
5972
- noOptionsMessage: () => props.noResultsLabel
6026
+ noOptionsMessage: () => props.noResultsLabel,
6027
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6028
+ menuPortalTarget: document.body,
6029
+ hasWarning: props.hasWarning
5973
6030
  })]
5974
6031
  })
5975
6032
  })]
@@ -6099,7 +6156,8 @@ function CategoryReferenceSearch(props) {
6099
6156
  mapItemToOption: mapItemToOption,
6100
6157
  loadItemsBySearchTerm: loadItemsBySearchTerm,
6101
6158
  loadItemsByIds: loadItemsByIds,
6102
- filterOption: filterOption$1
6159
+ filterOption: filterOption$1,
6160
+ hasWarning: props.hasWarning
6103
6161
  });
6104
6162
  }
6105
6163
 
@@ -6302,7 +6360,8 @@ function CartDiscountReferenceSearch(props) {
6302
6360
  mapItemToOption: mapItemToOption,
6303
6361
  loadItemsBySearchTerm: loadItemsBySearchTerm,
6304
6362
  loadItemsByIds: loadItemsByIds,
6305
- filterOption: filterOption
6363
+ filterOption: filterOption,
6364
+ hasWarning: props.hasWarning
6306
6365
  })
6307
6366
  });
6308
6367
  }
@@ -6329,7 +6388,8 @@ function CustomCategoryReferenceInput(props) {
6329
6388
  hasError: props.hasError,
6330
6389
  isReadOnly: props.isReadOnly,
6331
6390
  isDisabled: props.isDisabled,
6332
- isClearable: !props.fieldDefinition.required
6391
+ isClearable: !props.fieldDefinition.required,
6392
+ hasWarning: props.hasWarning
6333
6393
  });
6334
6394
  }
6335
6395
  CustomCategoryReferenceInput.displayName = 'CustomCategoryReferenceInput';
@@ -6355,7 +6415,8 @@ function CustomCartDiscountReferenceInput(props) {
6355
6415
  onBlur: handleBlur,
6356
6416
  hasError: props.hasError,
6357
6417
  isDisabled: props.isDisabled || props.isReadOnly,
6358
- isClearable: !props.fieldDefinition.required
6418
+ isClearable: !props.fieldDefinition.required,
6419
+ hasWarning: props.hasWarning
6359
6420
  });
6360
6421
  }
6361
6422
 
@@ -6388,7 +6449,8 @@ const ProductPickerInput = _ref => {
6388
6449
  value = _ref.value,
6389
6450
  hasError = _ref.hasError,
6390
6451
  onError = _ref.onError,
6391
- showLoadingErrorMessage = _ref.showLoadingErrorMessage;
6452
+ showLoadingErrorMessage = _ref.showLoadingErrorMessage,
6453
+ hasWarning = _ref.hasWarning;
6392
6454
  const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
6393
6455
  const _useIntl = reactIntl.useIntl(),
6394
6456
  formatMessage = _useIntl.formatMessage;
@@ -6471,7 +6533,10 @@ const ProductPickerInput = _ref => {
6471
6533
  onBlur: onBlur,
6472
6534
  value: currentOption.data,
6473
6535
  noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
6474
- hasError: hasError || isLoadingFailed
6536
+ hasError: hasError || isLoadingFailed,
6537
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6538
+ menuPortalTarget: document.body,
6539
+ hasWarning: hasWarning
6475
6540
  })
6476
6541
  }), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
6477
6542
  tone: "negative",
@@ -6494,7 +6559,8 @@ function CustomProductReferenceInput(props) {
6494
6559
  onChange: props.onChange,
6495
6560
  hasError: props.hasError,
6496
6561
  onError: () => null,
6497
- showLoadingErrorMessage: true
6562
+ showLoadingErrorMessage: true,
6563
+ hasWarning: props.hasWarning
6498
6564
  });
6499
6565
  }
6500
6566
  CustomProductReferenceInput.displayName = 'CustomProductReferenceInput';
@@ -6510,7 +6576,8 @@ function CustomProductTypeReferenceInput(props) {
6510
6576
  onBlur: props.onBlur,
6511
6577
  onChange: props.onChange,
6512
6578
  hasError: props.hasError,
6513
- onError: () => null
6579
+ onError: () => null,
6580
+ hasWarning: props.hasWarning
6514
6581
  });
6515
6582
  }
6516
6583
  CustomProductTypeReferenceInput.displayName = 'CustomProductTypeReferenceInput';
@@ -6526,7 +6593,8 @@ function CustomChannelReferenceInput(props) {
6526
6593
  onBlur: props.onBlur,
6527
6594
  onChange: props.onChange,
6528
6595
  hasError: props.hasError,
6529
- onError: () => null
6596
+ onError: () => null,
6597
+ hasWarning: props.hasWarning
6530
6598
  });
6531
6599
  }
6532
6600
  CustomChannelReferenceInput.displayName = 'CustomChannelReferenceInput';
@@ -6542,7 +6610,8 @@ function CustomStateReferenceInput(props) {
6542
6610
  onBlur: props.onBlur,
6543
6611
  onChange: props.onChange,
6544
6612
  hasError: props.hasError,
6545
- onError: () => null
6613
+ onError: () => null,
6614
+ hasWarning: props.hasWarning
6546
6615
  });
6547
6616
  }
6548
6617
  CustomStateReferenceInput.displayName = 'CustomStateReferenceInput';
@@ -6556,6 +6625,7 @@ function CustomReferenceInput(props) {
6556
6625
  typeId: referenceTypeId
6557
6626
  } : undefined;
6558
6627
  props.setFieldValue(props.name, nullifiedIfNeeded);
6628
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6559
6629
  });
6560
6630
  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;
6561
6631
  return jsxRuntime.jsx(ReferenceInputComponent, {
@@ -6568,7 +6638,8 @@ function CustomReferenceInput(props) {
6568
6638
  isReadOnly: props.isReadOnly,
6569
6639
  onBlur: props.onBlur,
6570
6640
  hasError: props.hasError,
6571
- onChange: handleChange
6641
+ onChange: handleChange,
6642
+ hasWarning: props.hasWarning
6572
6643
  });
6573
6644
  }
6574
6645
  CustomReferenceInput.displayName = 'CustomReferenceInput';
@@ -6579,6 +6650,7 @@ function CustomDateTimeInput(props) {
6579
6650
  const typeName = props.fieldDefinition.type.name.toLowerCase();
6580
6651
  const handleChange = makeChangeHandler(rawValue => {
6581
6652
  props.setFieldValue(props.name, rawValue || undefined);
6653
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6582
6654
  });
6583
6655
  const InputComponent = typeName === 'date' ? uiKit.DateInput : uiKit.DateTimeInput;
6584
6656
  return jsxRuntime.jsx(InputComponent, {
@@ -6590,7 +6662,8 @@ function CustomDateTimeInput(props) {
6590
6662
  timeZone: timeZone,
6591
6663
  hasError: props.hasError,
6592
6664
  isDisabled: props.isDisabled,
6593
- isReadOnly: props.isReadOnly
6665
+ isReadOnly: props.isReadOnly,
6666
+ hasWarning: props.hasWarning
6594
6667
  });
6595
6668
  }
6596
6669
  CustomDateTimeInput.displayName = 'CustomDateTimeInput';
@@ -6625,6 +6698,7 @@ function CustomTimeInput(props) {
6625
6698
  lastValueSentToFormik.current = in24hFormat;
6626
6699
  props.setFieldValue(props.name, in24hFormat);
6627
6700
  }
6701
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6628
6702
  });
6629
6703
  return jsxRuntime.jsx(uiKit.TimeInput, {
6630
6704
  id: props.name,
@@ -6635,7 +6709,8 @@ function CustomTimeInput(props) {
6635
6709
  timeZone: timeZone,
6636
6710
  hasError: props.hasError,
6637
6711
  isDisabled: props.isDisabled,
6638
- isReadOnly: props.isReadOnly
6712
+ isReadOnly: props.isReadOnly,
6713
+ hasWarning: props.hasWarning
6639
6714
  });
6640
6715
  }
6641
6716
  CustomTimeInput.displayName = 'CustomTimeInput';
@@ -6646,7 +6721,10 @@ const convertTypeValuesToOptions = reselect.defaultMemoize(typeValues => _mapIns
6646
6721
  })));
6647
6722
  function CustomEnumInput(props) {
6648
6723
  const options = convertTypeValuesToOptions(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
6649
- const handleChange = makeChangeHandler(rawValue => props.setFieldValue(props.name, rawValue));
6724
+ const handleChange = makeChangeHandler(rawValue => {
6725
+ props.setFieldValue(props.name, rawValue);
6726
+ props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
6727
+ });
6650
6728
  const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
6651
6729
  return jsxRuntime.jsx(CustomFieldTooltip, {
6652
6730
  title: tooltipTitle,
@@ -6660,7 +6738,10 @@ function CustomEnumInput(props) {
6660
6738
  options: options,
6661
6739
  hasError: props.hasError,
6662
6740
  isDisabled: props.isDisabled,
6663
- isReadOnly: props.isReadOnly
6741
+ isReadOnly: props.isReadOnly,
6742
+ hasWarning: props.hasWarning,
6743
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6744
+ menuPortalTarget: document.body
6664
6745
  })
6665
6746
  });
6666
6747
  }
@@ -6709,8 +6790,11 @@ function CustomBooleanInputSet(props) {
6709
6790
  onBlur: props.onBlur,
6710
6791
  isClearable: !props.fieldDefinition.required,
6711
6792
  hasError: props.hasError,
6793
+ hasWarning: props.hasWarning,
6712
6794
  isDisabled: props.isDisabled,
6713
- isReadOnly: props.isReadOnly
6795
+ isReadOnly: props.isReadOnly,
6796
+ menuPortalZIndex: Z_INDEX_DROPDOWN,
6797
+ menuPortalTarget: document.body
6714
6798
  });
6715
6799
  }
6716
6800
  CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
@@ -6761,7 +6845,8 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
6761
6845
  inputTip: attributeDefinition.inputTip,
6762
6846
  required: attributeDefinition.isRequired,
6763
6847
  type: attributeDefinition.type,
6764
- assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
6848
+ assignedAttributeGroups: attributeDefinition.assignedAttributeGroups,
6849
+ attributeConstraint: attributeDefinition.attributeConstraint
6765
6850
  });
6766
6851
  const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
6767
6852
  let name = _ref2.name,
@@ -6815,7 +6900,10 @@ function ProductAttributes(_ref) {
6815
6900
  fieldDefinitions: fieldDefinitions,
6816
6901
  setFieldValue: setFieldValue,
6817
6902
  inputValuesConverter: convertInputValue,
6818
- WrapperComponent: WrapperComponent
6903
+ WrapperComponent: WrapperComponent,
6904
+ renderWarnings: props.renderWarnings,
6905
+ renderCustomWarnings: props.renderCustomWarnings,
6906
+ handleWarningChange: props.handleWarningChange
6819
6907
  })
6820
6908
  })
6821
6909
  });
@@ -7423,7 +7511,10 @@ function CustomInputSet(props) {
7423
7511
  setFieldValue: setItemValue,
7424
7512
  value: fieldValue,
7425
7513
  hasError: props.hasError,
7426
- WrapperComponent: props.WrapperComponent
7514
+ hasWarning: props.hasWarning,
7515
+ WrapperComponent: props.WrapperComponent,
7516
+ renderWarnings: props.renderWarnings,
7517
+ handleWarningChange: props.handleWarningChange
7427
7518
  }), jsxRuntime.jsx(SetButtons, {
7428
7519
  index: index,
7429
7520
  isFirstItem: !isExpanded || index === 0,
@@ -7486,7 +7577,10 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
7486
7577
  isReadOnly: props.isReadOnly,
7487
7578
  onBlur: props.onBlur,
7488
7579
  setFieldValue: props.setFieldValue,
7489
- hasError: props.hasError
7580
+ hasError: props.hasError,
7581
+ hasWarning: props.hasWarning,
7582
+ handleWarningChange: props.handleWarningChange,
7583
+ renderWarnings: props.renderWarnings
7490
7584
  });
7491
7585
  });
7492
7586
  CustomFieldInput.displayName = 'CustomFieldInput';
@@ -7542,7 +7636,10 @@ function CustomNestedFieldInput(props) {
7542
7636
  isDisabled: props.isDisabled,
7543
7637
  isReadOnly: props.isReadOnly,
7544
7638
  setFieldValue: props.setFieldValue,
7545
- onBlur: props.onBlur
7639
+ onBlur: props.onBlur,
7640
+ hasWarning: props.hasWarning,
7641
+ handleWarningChange: props.handleWarningChange,
7642
+ renderWarnings: props.renderWarnings
7546
7643
  })]
7547
7644
  });
7548
7645
  }
@@ -7760,7 +7857,8 @@ const CustomFieldsInternal = _ref => {
7760
7857
  errors = _useFormikContext.errors,
7761
7858
  touched = _useFormikContext.touched,
7762
7859
  values = _valuesInstanceProperty__default["default"](_useFormikContext),
7763
- handleBlur = _useFormikContext.handleBlur;
7860
+ handleBlur = _useFormikContext.handleBlur,
7861
+ status = _useFormikContext.status;
7764
7862
  const didFormValidationFail = useDidFormValidationFail();
7765
7863
  const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
7766
7864
  const _useDnDContext = useDnDContext(),
@@ -7776,6 +7874,7 @@ const CustomFieldsInternal = _ref => {
7776
7874
  const isTouched = Boolean(formik.getIn(touched, fieldName));
7777
7875
  const fieldErrors = formik.getIn(errors, fieldName);
7778
7876
  const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
7877
+
7779
7878
  // We want to highlight fields with errors not only after a form submission,
7780
7879
  // but also after manually triggered form validation.
7781
7880
  const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
@@ -7794,7 +7893,10 @@ const CustomFieldsInternal = _ref => {
7794
7893
  isReadOnly: props.isReadOnly,
7795
7894
  onBlur: handleBlur,
7796
7895
  setFieldValue: props.setFieldValue,
7797
- hasError: hasError
7896
+ hasError: hasError,
7897
+ hasWarning: props.renderWarnings && status?.warnings[fieldName],
7898
+ handleWarningChange: props.handleWarningChange,
7899
+ renderWarnings: props.renderWarnings
7798
7900
  };
7799
7901
  const Field = jsxRuntime.jsx(FieldComponent, _objectSpread$J({}, fieldProps));
7800
7902
  return jsxRuntime.jsx(formik.FastField, {
@@ -7818,7 +7920,7 @@ const CustomFieldsInternal = _ref => {
7818
7920
  alignItems: "stretch",
7819
7921
  children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
7820
7922
  children: Field
7821
- }) : Field, jsxRuntime.jsx(CustomFieldErrors, {
7923
+ }) : Field, props.renderWarnings && status?.warnings[fieldName] && props.renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors, {
7822
7924
  isTouched: isTouched,
7823
7925
  errors: fieldErrors
7824
7926
  })]
@@ -7831,6 +7933,9 @@ const CustomFieldsInternal = _ref => {
7831
7933
  });
7832
7934
  };
7833
7935
  CustomFieldsInternal.displayName = 'CustomFieldsInternal';
7936
+ CustomFieldsInternal.defaultProps = {
7937
+ renderCustomWarnings: () => null
7938
+ };
7834
7939
 
7835
7940
  const nopConverter = (fieldName, fieldValue) => fieldValue;
7836
7941
  const CustomFields = props => {
@@ -7963,6 +8068,10 @@ function ProductSelectionBasicSelectDropdown(props) {
7963
8068
  isReadOnly: props.isReadOnly,
7964
8069
  hasWarning: props.hasWarning,
7965
8070
  hasError: props.hasError,
8071
+ errors: {
8072
+ missing: props.hasError
8073
+ },
8074
+ touched: props.touched,
7966
8075
  isClearable: props.isClearable,
7967
8076
  menuPortalTarget: props.menuPortalTarget,
7968
8077
  menuPortalZIndex: props.menuPortalZIndex,
@@ -8082,6 +8191,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
8082
8191
  defaultOptions: getDefaultOptions(),
8083
8192
  hasWarning: props.hasWarning,
8084
8193
  hasError: props.hasError,
8194
+ errors: {
8195
+ missing: props.hasError
8196
+ },
8197
+ touched: props.touched,
8085
8198
  isClearable: props.isClearable,
8086
8199
  menuPortalTarget: props.menuPortalTarget,
8087
8200
  menuPortalZIndex: props.menuPortalZIndex,
@@ -8226,6 +8339,10 @@ function ProductSelectionsSearchSelectDropdown(props) {
8226
8339
  isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
8227
8340
  isReadOnly: props.isReadOnly,
8228
8341
  hasWarning: props.hasWarning,
8342
+ errors: {
8343
+ missing: props.hasError
8344
+ },
8345
+ touched: props.touched,
8229
8346
  isClearable: props.isClearable,
8230
8347
  hasError: props.hasError,
8231
8348
  menuPortalTarget: props.menuPortalTarget,
@@ -9048,6 +9165,7 @@ const StoresSearchSelectInput = props => {
9048
9165
  maxMenuHeight: props.maxMenuHeight,
9049
9166
  menuPortalTarget: props.menuPortalTarget,
9050
9167
  menuPortalZIndex: props.menuPortalZIndex,
9168
+ menuIsOpen: props.menuIsOpen,
9051
9169
  components: props.components,
9052
9170
  controlShouldRenderValue: props.controlShouldRenderValue
9053
9171
  }, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props))), jsxRuntime.jsx(uiKit.FieldErrors, {
@@ -12690,8 +12808,10 @@ const validateMultiOptionEnum = (selectedOption, intl) => {
12690
12808
  };
12691
12809
 
12692
12810
  // eslint-disable-next-line import/prefer-default-export
12693
- const validateText = (text, intl) => {
12811
+ const validateText = function (text, intl) {
12812
+ let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
12694
12813
  if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
12814
+ if (type === 'id' && !isUUID(text.value)) return intl.formatMessage(messages$K.uuid);
12695
12815
  return null;
12696
12816
  };
12697
12817