@commercetools-frontend/experimental-components 3.2.1 → 4.0.0

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.
@@ -2191,7 +2191,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
2191
2191
  })
2192
2192
  };
2193
2193
  };
2194
- const createQueryVariables$8 = ownProps => {
2194
+ const createQueryVariables$9 = ownProps => {
2195
2195
  var _context;
2196
2196
  return _objectSpread$1h(_objectSpread$1h({
2197
2197
  limit: ownProps.limit,
@@ -2207,7 +2207,7 @@ const createQueryVariables$8 = ownProps => {
2207
2207
  const useStoresListFetcher = props => {
2208
2208
  const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
2209
2209
  const excludeProductSelections = props.excludeProductSelections || false;
2210
- const queryVariables = createQueryVariables$8({
2210
+ const queryVariables = createQueryVariables$9({
2211
2211
  limit: props.limit,
2212
2212
  offset: props.offset,
2213
2213
  sort: _sortInstanceProperty(props),
@@ -2814,8 +2814,8 @@ const convertProductSelectionsFromGraphQl = productSelections => {
2814
2814
  });
2815
2815
  };
2816
2816
 
2817
- var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ 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" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { 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: "version" }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 330, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2818
- const createQueryVariables$7 = ownProps => ({
2817
+ var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ 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" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { 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: "version" }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n type\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
2818
+ const createQueryVariables$8 = ownProps => ({
2819
2819
  limit: ownProps.limit,
2820
2820
  offset: ownProps.offset,
2821
2821
  sort: _sortInstanceProperty(ownProps)
@@ -2827,7 +2827,7 @@ const emptyProductSelections = {
2827
2827
  results: []
2828
2828
  };
2829
2829
  const useProductSelectionsFetcher = props => {
2830
- const queryVariables = createQueryVariables$7(props);
2830
+ const queryVariables = createQueryVariables$8(props);
2831
2831
  const _useQuery = useQuery$1(FetchProductSelections, {
2832
2832
  context: {
2833
2833
  target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
@@ -7846,6 +7846,11 @@ var pickerMessages = defineMessages({
7846
7846
  id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
7847
7847
  description: 'Placeholder of the search select field for product selections',
7848
7848
  defaultMessage: 'Search for product selections by entering exact key'
7849
+ },
7850
+ asyncSelectDropdownTypeAheadPrompt: {
7851
+ id: 'ProductSelectionPicker.asyncSelectDropdownTypeAheadPrompt',
7852
+ description: 'Message shown telling the user to start typing to load more product selections',
7853
+ defaultMessage: 'Start typing above to load more'
7849
7854
  }
7850
7855
  });
7851
7856
 
@@ -7878,6 +7883,10 @@ function ProductSelectionBasicSelectDropdown(props) {
7878
7883
  dataLocale = _useApplicationContex.dataLocale;
7879
7884
  if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
7880
7885
  const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
7886
+ const filteredProductSelections = _filterInstanceProperty(productSelections).call(productSelections, ps => {
7887
+ var _context;
7888
+ return !_includesInstanceProperty(_context = props.excludedProductSelectionIds).call(_context, ps.id);
7889
+ });
7881
7890
  const onOptionClick = event => {
7882
7891
  const productSelectionId = event.target.value;
7883
7892
  const currentProductSelection = _findInstanceProperty(productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
@@ -7892,12 +7901,18 @@ function ProductSelectionBasicSelectDropdown(props) {
7892
7901
  isRequired: props.isRequired,
7893
7902
  description: props.description,
7894
7903
  placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
7895
- options: mapProductSelectionsToOptions$1(productSelections, dataLocale, projectLanguages),
7904
+ options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
7896
7905
  components: props.components,
7897
7906
  onChange: onOptionClick,
7907
+ onBlur: props.onBlur,
7898
7908
  isDisabled: props.isDisabled,
7899
7909
  isReadOnly: props.isReadOnly,
7900
7910
  hasWarning: props.hasWarning,
7911
+ hasError: props.hasError,
7912
+ isClearable: props.isClearable,
7913
+ menuPortalTarget: props.menuPortalTarget,
7914
+ menuPortalZIndex: props.menuPortalZIndex,
7915
+ maxMenuHeight: props.maxMenuHeight,
7901
7916
  isSearchable: true
7902
7917
  });
7903
7918
  }
@@ -7905,6 +7920,28 @@ function ProductSelectionBasicSelectDropdown(props) {
7905
7920
  const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
7906
7921
  const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
7907
7922
 
7923
+ const getValueFromOptions$3 = _ref => {
7924
+ let currentlySelectedProductSelections = _ref.currentlySelectedProductSelections,
7925
+ allProductSelectionOptions = _ref.allProductSelectionOptions,
7926
+ isMulti = _ref.isMulti;
7927
+ // return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
7928
+ if (!currentlySelectedProductSelections) {
7929
+ return undefined;
7930
+ }
7931
+
7932
+ // handle async-select-field value transformation
7933
+ if (isMulti) {
7934
+ return _filterInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty(currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value));
7935
+ }
7936
+
7937
+ // in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
7938
+ return _findInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value);
7939
+ };
7940
+ const emptyStoreOption$1 = intl => [{
7941
+ label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
7942
+ value: undefined,
7943
+ isDisabled: true
7944
+ }];
7908
7945
  function ProductSelectionsAsyncSelectDropdown(props) {
7909
7946
  var _productSelectionsFet3;
7910
7947
  const intl = useIntl();
@@ -7922,6 +7959,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
7922
7959
  var _productSelectionsFet, _productSelectionsFet2;
7923
7960
  return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
7924
7961
  }, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
7962
+ const filteredProductSelections = _filterInstanceProperty(productSelections).call(productSelections, ps => {
7963
+ var _context;
7964
+ return !_includesInstanceProperty(_context = props.excludedProductSelectionIds).call(_context, ps.id);
7965
+ });
7925
7966
  const onOptionClick = event => {
7926
7967
  var _event$target$value;
7927
7968
  const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
@@ -7929,7 +7970,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
7929
7970
  props.onChange(currentProductSelection);
7930
7971
  };
7931
7972
  const allProductSelectionOptions = useMemo(() => {
7932
- return _mapInstanceProperty(productSelections).call(productSelections, productSelection => {
7973
+ return _mapInstanceProperty(filteredProductSelections).call(filteredProductSelections, productSelection => {
7933
7974
  const localizedName = formatLocalizedString(productSelection, {
7934
7975
  key: 'name',
7935
7976
  locale: dataLocale,
@@ -7942,17 +7983,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
7942
7983
  key: productSelection.key
7943
7984
  };
7944
7985
  });
7945
- }, [dataLocale, projectLanguages, productSelections]);
7986
+ }, [dataLocale, projectLanguages, filteredProductSelections]);
7946
7987
  const getDefaultOptions = () => {
7947
- return _sliceInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
7988
+ return [{
7989
+ options: _sliceInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
7990
+ }, {
7991
+ options: emptyStoreOption$1(intl)
7992
+ }];
7948
7993
  };
7949
7994
  const handleLoadOptions = async searchTerm => {
7950
7995
  const productSelectionOptions = allProductSelectionOptions;
7951
7996
  const filteredOptions = _filterInstanceProperty(productSelectionOptions).call(productSelectionOptions, productSelection => {
7952
- var _context, _context2;
7953
- return _includesInstanceProperty(_context = productSelection.label.toLowerCase()).call(_context, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty(_context2 = productSelection.key.toLowerCase()).call(_context2, searchTerm.toLowerCase());
7997
+ var _context2, _context3;
7998
+ return _includesInstanceProperty(_context2 = productSelection.label.toLowerCase()).call(_context2, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty(_context3 = productSelection.key.toLowerCase()).call(_context3, searchTerm.toLowerCase());
7954
7999
  });
7955
- return searchTerm ? _sliceInstanceProperty(filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty(productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
8000
+ const finalOptions = searchTerm ? _sliceInstanceProperty(filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty(productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
8001
+ return [{
8002
+ options: finalOptions
8003
+ }, {
8004
+ options: emptyStoreOption$1(intl)
8005
+ }];
7956
8006
  };
7957
8007
  if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
7958
8008
  return jsx(AsyncSelectField, {
@@ -7963,22 +8013,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
7963
8013
  isRequired: props.isRequired,
7964
8014
  placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
7965
8015
  loadOptions: handleLoadOptions,
8016
+ value: getValueFromOptions$3({
8017
+ currentlySelectedProductSelections: props.value,
8018
+ allProductSelectionOptions,
8019
+ isMulti: props.isMulti
8020
+ }),
7966
8021
  onChange: onOptionClick,
8022
+ onBlur: props.onBlur,
7967
8023
  isDisabled: props.isDisabled,
8024
+ showOptionGroupDivider: true,
7968
8025
  isReadOnly: props.isReadOnly,
7969
8026
  components: props.components,
7970
8027
  defaultOptions: getDefaultOptions(),
7971
- hasWarning: props.hasWarning
8028
+ hasWarning: props.hasWarning,
8029
+ hasError: props.hasError,
8030
+ isClearable: props.isClearable,
8031
+ menuPortalTarget: props.menuPortalTarget,
8032
+ menuPortalZIndex: props.menuPortalZIndex,
8033
+ maxMenuHeight: props.maxMenuHeight
7972
8034
  });
7973
8035
  }
7974
8036
 
8037
+ var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], 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: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
8038
+ const createQueryVariables$7 = (productSelections, predicateField) => {
8039
+ var _context;
8040
+ return {
8041
+ where: _concatInstanceProperty(_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty(productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
8042
+ limit: 500
8043
+ };
8044
+ };
8045
+ const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
8046
+ var _productSelectionsQue, _productSelectionsQue2;
8047
+ const productSelectionList = _Array$isArray(productSelections) ? productSelections : [productSelections];
8048
+ const productSelectionsQuery = useQuery(ProductSelectionsPickerFetcher$1, {
8049
+ context: {
8050
+ target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
8051
+ },
8052
+ variables: createQueryVariables$7(productSelectionList, predicateField),
8053
+ skip: productSelectionList.length === 0
8054
+ });
8055
+ return {
8056
+ productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
8057
+ isLoading: productSelectionsQuery.loading
8058
+ };
8059
+ };
8060
+
7975
8061
  var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], 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: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
7976
- const mapProductSelectionsToOptions = memoize(function () {
7977
- let productSelections = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
7978
- let dataLocale = arguments.length > 1 ? arguments[1] : undefined;
7979
- let projectLanguages = arguments.length > 2 ? arguments[2] : undefined;
8062
+ const mapProductSelectionsToOptions = memoize(_ref => {
8063
+ let _ref$productSelection = _ref.productSelections,
8064
+ productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
8065
+ dataLocale = _ref.dataLocale,
8066
+ projectLanguages = _ref.projectLanguages,
8067
+ renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField;
7980
8068
  return _mapInstanceProperty(productSelections).call(productSelections, productSelection => ({
7981
- value: productSelection.id,
8069
+ value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
7982
8070
  label: formatLocalizedString(productSelection, {
7983
8071
  key: 'name',
7984
8072
  locale: dataLocale,
@@ -7987,9 +8075,22 @@ const mapProductSelectionsToOptions = memoize(function () {
7987
8075
  key: productSelection.key
7988
8076
  }));
7989
8077
  });
7990
- const createQueryVariables$6 = _ref => {
8078
+ const getValueFromOptions$2 = _ref2 => {
8079
+ let isMulti = _ref2.isMulti,
8080
+ currentlySelectedProductSelections = _ref2.currentlySelectedProductSelections,
8081
+ productSelectionFieldOptions = _ref2.productSelectionFieldOptions;
8082
+ if (!currentlySelectedProductSelections) {
8083
+ return undefined;
8084
+ }
8085
+ if (isMulti) {
8086
+ return productSelectionFieldOptions;
8087
+ }
8088
+ // if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
8089
+ return productSelectionFieldOptions[0];
8090
+ };
8091
+ const createQueryVariables$6 = _ref3 => {
7991
8092
  var _context;
7992
- let searchText = _ref.searchText;
8093
+ let searchText = _ref3.searchText;
7993
8094
  const sanitizedSearchText = sanitize(_trimInstanceProperty(searchText).call(searchText, searchText));
7994
8095
  const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
7995
8096
  const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
@@ -7999,6 +8100,7 @@ const createQueryVariables$6 = _ref => {
7999
8100
  };
8000
8101
  };
8001
8102
  function ProductSelectionsSearchSelectDropdown(props) {
8103
+ var _context3;
8002
8104
  const intl = useIntl();
8003
8105
  const _useState = useState([]),
8004
8106
  _useState2 = _slicedToArray(_useState, 2),
@@ -8011,6 +8113,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
8011
8113
  })),
8012
8114
  projectLanguages = _useApplicationContex.projectLanguages,
8013
8115
  dataLocale = _useApplicationContex.dataLocale;
8116
+ const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
8014
8117
  const handleLoadOptions = async searchText => {
8015
8118
  var _data$productSelectio, _data$productSelectio2;
8016
8119
  const _await$client$query = await client.query({
@@ -8026,8 +8129,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
8026
8129
  data = _await$client$query.data;
8027
8130
  const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 ? void 0 : (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
8028
8131
  const updatedProductSelections = _mapInstanceProperty(matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
8029
- setProductSelectionResults(updatedProductSelections);
8030
- return mapProductSelectionsToOptions(updatedProductSelections, dataLocale, projectLanguages);
8132
+ const filteredProductSelections = _filterInstanceProperty(updatedProductSelections).call(updatedProductSelections, ps => {
8133
+ var _context2;
8134
+ return !_includesInstanceProperty(_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
8135
+ });
8136
+ setProductSelectionResults(filteredProductSelections);
8137
+ return mapProductSelectionsToOptions({
8138
+ productSelections: filteredProductSelections,
8139
+ dataLocale,
8140
+ projectLanguages,
8141
+ renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
8142
+ });
8031
8143
  };
8032
8144
  const loadOptionsDebounced = debounce(handleLoadOptions, 500);
8033
8145
  const onOptionClick = event => {
@@ -8036,33 +8148,56 @@ function ProductSelectionsSearchSelectDropdown(props) {
8036
8148
  const currentProductSelection = _findInstanceProperty(productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
8037
8149
  props.onChange(currentProductSelection);
8038
8150
  };
8151
+ if (productSelectionsByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
8039
8152
  return jsx(SearchSelectField, {
8040
8153
  id: props.id,
8041
8154
  name: props.name,
8042
8155
  title: props.title,
8156
+ value: getValueFromOptions$2({
8157
+ currentlySelectedProductSelections: props.value,
8158
+ productSelectionFieldOptions: mapProductSelectionsToOptions({
8159
+ productSelections: _mapInstanceProperty(_context3 = productSelectionsByFieldFetcher.productSelections).call(_context3, convertProductSelectionFromGraphQl),
8160
+ dataLocale,
8161
+ projectLanguages,
8162
+ renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
8163
+ }),
8164
+ isMulti: props.isMulti
8165
+ }),
8043
8166
  description: props.description,
8044
8167
  isRequired: props.isRequired,
8045
8168
  placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
8046
8169
  loadOptions: loadOptionsDebounced,
8047
8170
  onChange: onOptionClick,
8171
+ onBlur: props.onBlur,
8048
8172
  components: props.components,
8049
- isDisabled: props.isDisabled,
8173
+ isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
8050
8174
  isReadOnly: props.isReadOnly,
8051
- hasWarning: props.hasWarning
8175
+ hasWarning: props.hasWarning,
8176
+ isClearable: props.isClearable,
8177
+ hasError: props.hasError,
8178
+ menuPortalTarget: props.menuPortalTarget,
8179
+ menuPortalZIndex: props.menuPortalZIndex,
8180
+ maxMenuHeight: props.maxMenuHeight
8052
8181
  });
8053
8182
  }
8054
8183
 
8055
8184
  function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8056
8185
  function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
8057
- const components = {
8058
- // eslint-disable-next-line react/display-name
8059
- Option: optionInnerProps => jsx(CustomSelectInputOption, {
8060
- optionType: "double-property",
8061
- optionInnerProps: optionInnerProps
8062
- })
8063
- };
8064
8186
  function ProductSelectionsPicker(props) {
8065
8187
  const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
8188
+ const components = useMemo(() => {
8189
+ return {
8190
+ Option: optionInnerProps => {
8191
+ if (optionInnerProps.isDisabled) {
8192
+ return jsx(SelectInput.Option, _objectSpread$N({}, optionInnerProps));
8193
+ }
8194
+ return jsx(CustomSelectInputOption, {
8195
+ optionType: props.optionType,
8196
+ optionInnerProps: optionInnerProps
8197
+ });
8198
+ }
8199
+ };
8200
+ }, [props.optionType]);
8066
8201
  if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
8067
8202
  const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
8068
8203
  return jsx(Spacings.Stack, {
@@ -8078,7 +8213,13 @@ ProductSelectionsPicker.defaultProps = {
8078
8213
  optionType: 'double-property',
8079
8214
  isMulti: false,
8080
8215
  isRequired: false,
8081
- hasWarning: false
8216
+ hasWarning: false,
8217
+ hasError: false,
8218
+ isClearable: false,
8219
+ isReadOnly: false,
8220
+ isDisabled: false,
8221
+ excludedProductSelectionIds: [],
8222
+ title: '' // FieldLabel requires title to have some value
8082
8223
  };
8083
8224
 
8084
8225
  const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
@@ -9705,11 +9846,9 @@ const mergeOverwritten = (inherited, explicit) => {
9705
9846
  };
9706
9847
  };
9707
9848
  const mergeAssociates = businessUnit => {
9708
- var _context2;
9709
- const _businessUnit$associa = businessUnit.associates,
9710
- associates = _businessUnit$associa === void 0 ? [] : _businessUnit$associa,
9711
- _businessUnit$inherit = businessUnit.inheritedAssociates,
9712
- inheritedAssociates = _businessUnit$inherit === void 0 ? [] : _businessUnit$inherit;
9849
+ var _businessUnit$associa, _businessUnit$inherit, _context2;
9850
+ const associates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$associa = businessUnit.associates) === null || _businessUnit$associa === void 0 ? void 0 : _filterInstanceProperty(_businessUnit$associa).call(_businessUnit$associa, associate => associate === null || associate === void 0 ? void 0 : associate.customer);
9851
+ const inheritedAssociates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$inherit = businessUnit.inheritedAssociates) === null || _businessUnit$inherit === void 0 ? void 0 : _filterInstanceProperty(_businessUnit$inherit).call(_businessUnit$inherit, inheritedAssociate => inheritedAssociate === null || inheritedAssociate === void 0 ? void 0 : inheritedAssociate.customer);
9713
9852
  const overwrittenOnExplicit = intersectionBy(associates, inheritedAssociates, 'customer.id') || [];
9714
9853
  const overwrittenOnInherited = intersectionBy(inheritedAssociates, associates, 'customer.id') || [];
9715
9854
  const onlyExplicit = differenceBy(associates, inheritedAssociates, 'customer.id') || [];
@@ -9810,10 +9949,10 @@ var messages$r = defineMessages({
9810
9949
  function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9811
9950
  function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
9812
9951
  const BusinessUnitAssociatesListView = props => {
9813
- var _props$values, _props$values$associa;
9952
+ var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
9814
9953
  const intl = useIntl();
9815
9954
  const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
9816
- const totalAssociates = (_props$values = _valuesInstanceProperty(props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length;
9955
+ const totalAssociates = ((_props$values = _valuesInstanceProperty(props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length) + (((_props$values2 = _valuesInstanceProperty(props)) === null || _props$values2 === void 0 ? void 0 : (_props$values2$inheri = _props$values2.inheritedAssociates) === null || _props$values2$inheri === void 0 ? void 0 : _props$values2$inheri.length) || 0);
9817
9956
  const isBusinessUnitCreation = !isUUID(props.businessUnitId);
9818
9957
  const _usePaginationState = usePaginationState({
9819
9958
  perPage: 20
@@ -9828,8 +9967,8 @@ const BusinessUnitAssociatesListView = props => {
9828
9967
  searchValue = _useState2[0],
9829
9968
  setSearchValue = _useState2[1];
9830
9969
  const associates = useMemo(() => {
9831
- var _props$values2, _context, _context2;
9832
- return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty(props)) : (_props$values2 = _valuesInstanceProperty(props)) === null || _props$values2 === void 0 ? void 0 : _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _props$values2.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
9970
+ var _props$values3, _context, _context2;
9971
+ return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty(props)) : (_props$values3 = _valuesInstanceProperty(props)) === null || _props$values3 === void 0 ? void 0 : _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _props$values3.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
9833
9972
  id: associate.customer.id
9834
9973
  }));
9835
9974
  }, [_valuesInstanceProperty(props), businessUnitsAssociateRolesFeatureEnabled]);
@@ -9953,7 +10092,7 @@ const BusinessUnitAssociatesListView = props => {
9953
10092
  };
9954
10093
  BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
9955
10094
 
9956
- var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 577, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
10095
+ var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "inheritedAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 831, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n inheritedAssociates {\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
9957
10096
  const useBusinessUnitAssociatesFetcher = _ref => {
9958
10097
  let id = _ref.id,
9959
10098
  shouldExcludeRoles = _ref.shouldExcludeRoles,
@@ -12529,6 +12668,7 @@ const SelectableFieldSearchInput = props => {
12529
12668
  return jsx("div", {
12530
12669
  className: styles$4.container,
12531
12670
  children: jsx(SelectableSearchInput, {
12671
+ menuHorizontalConstraint: 5,
12532
12672
  options: props.options,
12533
12673
  value: {
12534
12674
  text: searchText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/experimental-components",
3
- "version": "3.2.1",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "dist/commercetools-frontend-experimental-components.cjs.js",
6
6
  "module": "dist/commercetools-frontend-experimental-components.esm.js",
@@ -11,21 +11,21 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@babel/core": "^7.21.0",
14
- "@babel/runtime": "^7.21.0",
15
14
  "@babel/runtime-corejs3": "^7.21.0",
16
- "@commercetools-frontend/actions-global": "21.24.3",
17
- "@commercetools-frontend/application-components": "21.24.3",
18
- "@commercetools-frontend/application-shell": "21.24.3",
19
- "@commercetools-frontend/application-shell-connectors": "21.24.3",
20
- "@commercetools-frontend/constants": "21.24.3",
21
- "@commercetools-frontend/l10n": "21.24.3",
22
- "@commercetools-frontend/sdk": "21.24.3",
23
- "@commercetools-frontend/sentry": "21.24.3",
24
- "@commercetools-frontend/ui-kit": "15.14.3",
25
- "@commercetools-uikit/design-system": "15.14.3",
26
- "@commercetools-uikit/select-utils": "15.14.3",
27
- "@commercetools-uikit/utils": "15.14.3",
28
- "@emotion/react": "11.10.6",
15
+ "@babel/runtime": "^7.21.0",
16
+ "@commercetools-frontend/actions-global": "^21.25.2",
17
+ "@commercetools-frontend/application-components": "^21.25.2",
18
+ "@commercetools-frontend/application-shell-connectors": "^21.25.2",
19
+ "@commercetools-frontend/application-shell": "^21.25.2",
20
+ "@commercetools-frontend/constants": "^21.25.2",
21
+ "@commercetools-frontend/l10n": "^21.25.2",
22
+ "@commercetools-frontend/sdk": "^21.25.2",
23
+ "@commercetools-frontend/sentry": "^21.25.2",
24
+ "@commercetools-frontend/ui-kit": "^15.15.0",
25
+ "@commercetools-uikit/design-system": "^15.15.0",
26
+ "@commercetools-uikit/select-utils": "^15.15.0",
27
+ "@commercetools-uikit/utils": "^15.15.0",
28
+ "@emotion/react": "^11.10.6",
29
29
  "classnames": "2.3.2",
30
30
  "cleave.js": "1.5.10",
31
31
  "common-tags": "1.8.2",
@@ -35,51 +35,53 @@
35
35
  "hoist-non-react-statics": "3.3.2",
36
36
  "lodash": "4.17.21",
37
37
  "memoize-one": "6.0.0",
38
+ "moment-timezone": "0.5.43",
38
39
  "moment": "2.29.4",
39
- "moment-timezone": "0.5.42",
40
- "msw": "^1.1.0",
41
40
  "omit-deep": "0.3.0",
42
41
  "omit-empty-es": "1.1.3",
43
- "prop-types": "15.8.1",
44
- "react": "17.0.2",
45
- "react-intl": "5.25.1",
46
- "react-redux": "7.2.9",
47
- "react-required-if": "1.0.3",
48
- "react-router-dom": "5.3.4",
42
+ "prop-types": "^15.8.1",
49
43
  "react-textarea-autosize": "8.4.1",
50
- "reselect": "4.1.7",
44
+ "reselect": "4.1.8",
51
45
  "tiny-invariant": "1.3.1",
52
46
  "tiny-warning": "1.0.3",
53
47
  "uuid": "8.3.2"
54
48
  },
55
49
  "devDependencies": {
56
- "@apollo/client": "3.7.10",
57
- "@babel/core": "^7.21.0",
58
- "@commercetools-test-data/channel": "4.11.1",
59
- "@commercetools-test-data/commons": "4.11.1",
60
- "@commercetools-test-data/core": "4.11.1",
61
- "@testing-library/react": "12.1.5",
62
- "@testing-library/react-hooks": "8.0.1",
63
- "enzyme": "3.11.0",
64
- "graphql": "16.6.0",
65
- "graphql-tag": "2.12.6",
66
- "msw": "1.2.1",
67
- "react": "17.0.2",
68
- "react-dom": "17.0.2",
69
- "react-intl": "5.25.1",
70
- "react-redux": "7.2.9",
71
- "react-router-dom": "5.3.4",
72
- "react-test-renderer": "17.0.2",
73
- "redux": "4.2.1",
74
- "typescript": "4.9.5",
75
- "xhr-mock": "2.5.1",
50
+ "@apollo/client": "^3.7.10",
51
+ "@commercetools-test-data/channel": "^4.11.1",
52
+ "@commercetools-test-data/commons": "^4.11.1",
53
+ "@commercetools-test-data/core": "^4.11.1",
54
+ "@testing-library/react-hooks": "^8.0.1",
55
+ "@testing-library/react": "^12.1.5",
56
+ "enzyme": "^3.11.0",
57
+ "graphql-tag": "^2.12.6",
58
+ "graphql": "^16.6.0",
59
+ "msw": "^1.2.1",
60
+ "react-dom": "^17.0.2",
61
+ "react-intl": "^5.25.1",
62
+ "react-redux": "^7.2.9",
63
+ "react-required-if": "^1.0.3",
64
+ "react-router-dom": "^5.3.4",
65
+ "react-test-renderer": "^17.0.2",
66
+ "react": "^17.0.2",
67
+ "redux": "^4.2.1",
68
+ "typescript": "^4.9.5",
69
+ "xhr-mock": "^2.5.1",
76
70
  "@commercetools-local/test-data": "1.0.8",
77
71
  "@commercetools-local/test-utils": "1.0.2"
78
72
  },
79
73
  "peerDependencies": {
80
74
  "@apollo/client": "3.x",
81
75
  "@testing-library/react": "12.x",
82
- "@testing-library/react-hooks": "8.x"
76
+ "@testing-library/react-hooks": "8.x",
77
+ "react": "17.x",
78
+ "react-dom": "17.x",
79
+ "react-intl": "5.x",
80
+ "react-redux": "7.x",
81
+ "react-router-dom": "5.x",
82
+ "redux": "4.x",
83
+ "msw": "1.x.x",
84
+ "react-required-if": "1.x.x"
83
85
  },
84
86
  "publishConfig": {
85
87
  "access": "public"