@commercetools-frontend/experimental-components 3.2.0 → 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.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +1061 -344
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +1061 -344
- package/dist/commercetools-frontend-experimental-components.esm.js +1056 -343
- package/dist/styles.css +47 -47
- package/package.json +47 -45
|
@@ -41,11 +41,11 @@ import { NO_VALUE_FALLBACK, GRAPHQL_TARGETS, DOMAINS, MC_API_PROXY_TARGETS, SUPP
|
|
|
41
41
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
42
42
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
43
43
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
44
|
-
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput,
|
|
44
|
+
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, SelectableSearchInput, DataTable, Pagination, Stamp, ContentNotification, ListIcon, CheckboxInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
|
|
45
45
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
46
46
|
import { useShowNotification, useShowApiErrorNotification, useOnActionError, useHideAllPageNotifications } from '@commercetools-frontend/actions-global';
|
|
47
47
|
import PropTypes from 'prop-types';
|
|
48
|
-
import { useModalState, CustomFormModalPage, PageContentNarrow, ConfirmationDialog, InfoDialog } from '@commercetools-frontend/application-components';
|
|
48
|
+
import { useModalState, CustomFormModalPage, PageContentNarrow, ConfirmationDialog, PageContentFull, InfoDialog } from '@commercetools-frontend/application-components';
|
|
49
49
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
50
50
|
import { useApplicationContext, ApplicationContext, withApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
51
51
|
import { GtmContext, useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/application-shell';
|
|
@@ -72,7 +72,6 @@ import _reverseInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
72
72
|
import { useAsyncDispatch, actions } from '@commercetools-frontend/sdk';
|
|
73
73
|
import { useApolloClient as useApolloClient$1, useQuery as useQuery$2 } from '@apollo/client';
|
|
74
74
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
75
|
-
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
76
75
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
77
76
|
import omit from 'lodash/omit';
|
|
78
77
|
import isEmpty$3 from 'lodash/isEmpty';
|
|
@@ -80,6 +79,7 @@ import _Object$freeze from '@babel/runtime-corejs3/core-js-stable/object/freeze'
|
|
|
80
79
|
import originalOmitDeep from 'omit-deep';
|
|
81
80
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
82
81
|
import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
|
|
82
|
+
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
83
83
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
84
84
|
import omitBy from 'lodash/omitBy';
|
|
85
85
|
import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
@@ -98,6 +98,8 @@ import { ErrorMessage } from '@commercetools-frontend/ui-kit/';
|
|
|
98
98
|
import { CustomSelectInputOption } from '@commercetools-uikit/select-utils';
|
|
99
99
|
import memoize from 'memoize-one';
|
|
100
100
|
import { filterAriaAttributes, filterDataAttributes as filterDataAttributes$1 } from '@commercetools-uikit/utils';
|
|
101
|
+
import differenceBy from 'lodash/differenceBy';
|
|
102
|
+
import intersectionBy from 'lodash/intersectionBy';
|
|
101
103
|
import _parseFloat from '@babel/runtime-corejs3/core-js-stable/parse-float';
|
|
102
104
|
import flatMap from 'lodash/flatMap';
|
|
103
105
|
import { connect } from 'react-redux';
|
|
@@ -217,7 +219,7 @@ function filterDataAttributes(obj) {
|
|
|
217
219
|
}, {});
|
|
218
220
|
}
|
|
219
221
|
|
|
220
|
-
const messages$
|
|
222
|
+
const messages$O = defineMessages({
|
|
221
223
|
unique: {
|
|
222
224
|
id: 'Validation.unique',
|
|
223
225
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1614,8 +1616,8 @@ const getData = (code, field) => {
|
|
|
1614
1616
|
};
|
|
1615
1617
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1616
1618
|
|
|
1617
|
-
function ownKeys$
|
|
1618
|
-
function _objectSpread$
|
|
1619
|
+
function ownKeys$1q(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; }
|
|
1620
|
+
function _objectSpread$1q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1q(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1619
1621
|
function formatMoneyRangeValue(value, intl) {
|
|
1620
1622
|
var _context;
|
|
1621
1623
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1625,7 +1627,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1625
1627
|
return '';
|
|
1626
1628
|
}
|
|
1627
1629
|
function formatMoneyValue(amount, currency, intl) {
|
|
1628
|
-
return formatMoney$1(_objectSpread$
|
|
1630
|
+
return formatMoney$1(_objectSpread$1q({
|
|
1629
1631
|
centAmount: amount,
|
|
1630
1632
|
fractionDigits: getFractionDigit(currency)
|
|
1631
1633
|
}, currency ? {
|
|
@@ -1642,14 +1644,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1642
1644
|
}
|
|
1643
1645
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1644
1646
|
var _moneyValue$fractione;
|
|
1645
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1647
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1q({
|
|
1646
1648
|
style: 'currency',
|
|
1647
1649
|
currency: moneyValue.currencyCode,
|
|
1648
1650
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1649
1651
|
}, options));
|
|
1650
1652
|
}
|
|
1651
1653
|
|
|
1652
|
-
var messages$
|
|
1654
|
+
var messages$N = defineMessages({
|
|
1653
1655
|
booleanYes: {
|
|
1654
1656
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1655
1657
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1732,7 +1734,7 @@ const formatDateTime = _ref7 => {
|
|
|
1732
1734
|
const formatBoolean = _ref8 => {
|
|
1733
1735
|
let value = _ref8.value,
|
|
1734
1736
|
intl = _ref8.intl;
|
|
1735
|
-
return value ? intl.formatMessage(messages$
|
|
1737
|
+
return value ? intl.formatMessage(messages$N.booleanYes) : intl.formatMessage(messages$N.booleanNo);
|
|
1736
1738
|
};
|
|
1737
1739
|
const formatNilType = _ref9 => {
|
|
1738
1740
|
let value = _ref9.value,
|
|
@@ -1894,8 +1896,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1894
1896
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1895
1897
|
};
|
|
1896
1898
|
|
|
1897
|
-
function ownKeys$
|
|
1898
|
-
function _objectSpread$
|
|
1899
|
+
function ownKeys$1p(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; }
|
|
1900
|
+
function _objectSpread$1p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1p(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1899
1901
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1900
1902
|
const WithDataTablePaginationState = props => {
|
|
1901
1903
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1909,7 +1911,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1909
1911
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1910
1912
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1911
1913
|
});
|
|
1912
|
-
return jsx(Component, _objectSpread$
|
|
1914
|
+
return jsx(Component, _objectSpread$1p(_objectSpread$1p({}, props), {}, {
|
|
1913
1915
|
dataTablePaginationState: {
|
|
1914
1916
|
page,
|
|
1915
1917
|
perPage,
|
|
@@ -1921,8 +1923,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1921
1923
|
return WithDataTablePaginationState;
|
|
1922
1924
|
};
|
|
1923
1925
|
|
|
1924
|
-
function ownKeys$
|
|
1925
|
-
function _objectSpread$
|
|
1926
|
+
function ownKeys$1o(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; }
|
|
1927
|
+
function _objectSpread$1o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1o(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1926
1928
|
const injectNotifications = function () {
|
|
1927
1929
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1928
1930
|
return Component => {
|
|
@@ -1937,7 +1939,7 @@ const injectNotifications = function () {
|
|
|
1937
1939
|
onActionError,
|
|
1938
1940
|
hideAllPageNotifications
|
|
1939
1941
|
};
|
|
1940
|
-
return jsx(Component, _objectSpread$
|
|
1942
|
+
return jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1941
1943
|
[propName]: notifications
|
|
1942
1944
|
}));
|
|
1943
1945
|
};
|
|
@@ -1946,22 +1948,22 @@ const injectNotifications = function () {
|
|
|
1946
1948
|
};
|
|
1947
1949
|
};
|
|
1948
1950
|
|
|
1949
|
-
function ownKeys$
|
|
1950
|
-
function _objectSpread$
|
|
1951
|
+
function ownKeys$1n(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; }
|
|
1952
|
+
function _objectSpread$1n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1n(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1951
1953
|
function isPropsMapper(mapProps) {
|
|
1952
1954
|
return typeof mapProps === 'function';
|
|
1953
1955
|
}
|
|
1954
1956
|
const withProps = mapProps => Component => {
|
|
1955
1957
|
const EnhancedWithProps = ownProps => {
|
|
1956
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1957
|
-
return jsx(Component, _objectSpread$
|
|
1958
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps(ownProps)) : _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps);
|
|
1959
|
+
return jsx(Component, _objectSpread$1n({}, enhancedProps));
|
|
1958
1960
|
};
|
|
1959
1961
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1960
1962
|
return EnhancedWithProps;
|
|
1961
1963
|
};
|
|
1962
1964
|
|
|
1963
|
-
function ownKeys$
|
|
1964
|
-
function _objectSpread$
|
|
1965
|
+
function ownKeys$1m(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; }
|
|
1966
|
+
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1m(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1965
1967
|
const useRedirectEffect = _ref => {
|
|
1966
1968
|
let goTo = _ref.goTo;
|
|
1967
1969
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1981,30 +1983,30 @@ const defaultOptions$5 = {
|
|
|
1981
1983
|
skip: () => false
|
|
1982
1984
|
};
|
|
1983
1985
|
const withRedirectTo = options => Component => {
|
|
1984
|
-
const mergedOptions = _objectSpread$
|
|
1986
|
+
const mergedOptions = _objectSpread$1m(_objectSpread$1m({}, defaultOptions$5), options);
|
|
1985
1987
|
const WithRedirectTo = props => {
|
|
1986
1988
|
if (!mergedOptions.skip(props)) {
|
|
1987
1989
|
return jsx(RedirectTo, {
|
|
1988
1990
|
goTo: options.selectGoTo(props)
|
|
1989
1991
|
});
|
|
1990
1992
|
}
|
|
1991
|
-
return jsx(Component, _objectSpread$
|
|
1993
|
+
return jsx(Component, _objectSpread$1m({}, props));
|
|
1992
1994
|
};
|
|
1993
1995
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1994
1996
|
return WithRedirectTo;
|
|
1995
1997
|
};
|
|
1996
1998
|
|
|
1997
|
-
function ownKeys$
|
|
1998
|
-
function _objectSpread$
|
|
1999
|
+
function ownKeys$1l(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; }
|
|
2000
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1l(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1999
2001
|
const defaultOptions$4 = {
|
|
2000
2002
|
propName: 'modalState',
|
|
2001
2003
|
isInitiallyOpen: false
|
|
2002
2004
|
};
|
|
2003
2005
|
const injectModalState$1 = options => Component => {
|
|
2004
|
-
const mergedOptions = _objectSpread$
|
|
2006
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$4), options);
|
|
2005
2007
|
const WithModalState = props => {
|
|
2006
2008
|
const modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
2007
|
-
return jsx(Component, _objectSpread$
|
|
2009
|
+
return jsx(Component, _objectSpread$1l(_objectSpread$1l({}, props), {}, {
|
|
2008
2010
|
[mergedOptions.propName]: modalState
|
|
2009
2011
|
}));
|
|
2010
2012
|
};
|
|
@@ -2012,17 +2014,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2012
2014
|
return WithModalState;
|
|
2013
2015
|
};
|
|
2014
2016
|
|
|
2015
|
-
function ownKeys$
|
|
2016
|
-
function _objectSpread$
|
|
2017
|
+
function ownKeys$1k(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; }
|
|
2018
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2017
2019
|
const defaultOptions$3 = {
|
|
2018
2020
|
propName: 'toggleState',
|
|
2019
2021
|
isInitiallyOpen: false
|
|
2020
2022
|
};
|
|
2021
2023
|
const injectModalState = options => Component => {
|
|
2022
|
-
const mergedOptions = _objectSpread$
|
|
2024
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$3), options);
|
|
2023
2025
|
const WithToggleState = props => {
|
|
2024
2026
|
const toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2025
|
-
return jsx(Component, _objectSpread$
|
|
2027
|
+
return jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2026
2028
|
[mergedOptions.propName]: toggleState
|
|
2027
2029
|
}));
|
|
2028
2030
|
};
|
|
@@ -2030,8 +2032,8 @@ const injectModalState = options => Component => {
|
|
|
2030
2032
|
return WithToggleState;
|
|
2031
2033
|
};
|
|
2032
2034
|
|
|
2033
|
-
function ownKeys$
|
|
2034
|
-
function _objectSpread$
|
|
2035
|
+
function ownKeys$1j(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; }
|
|
2036
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1j(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1j(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2035
2037
|
const defaultOptions$2 = {
|
|
2036
2038
|
storageType: 'local',
|
|
2037
2039
|
segregateByUser: true
|
|
@@ -2049,7 +2051,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2049
2051
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2050
2052
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2051
2053
|
var _context;
|
|
2052
|
-
const mergedOptions = _objectSpread$
|
|
2054
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$2), options);
|
|
2053
2055
|
const userId = useApplicationContext(context => {
|
|
2054
2056
|
var _context$user;
|
|
2055
2057
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2097,8 +2099,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2097
2099
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2098
2100
|
};
|
|
2099
2101
|
|
|
2100
|
-
function ownKeys$
|
|
2101
|
-
function _objectSpread$
|
|
2102
|
+
function ownKeys$1i(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; }
|
|
2103
|
+
function _objectSpread$1i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1i(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2102
2104
|
const defaultOptions$1 = {
|
|
2103
2105
|
propName: 'storage',
|
|
2104
2106
|
storageKey: '',
|
|
@@ -2111,7 +2113,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2111
2113
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2112
2114
|
* argument position does not allow passing specification of option(s).
|
|
2113
2115
|
*/
|
|
2114
|
-
const mergedOptions = _objectSpread$
|
|
2116
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$1), options);
|
|
2115
2117
|
const WithStorage = props => {
|
|
2116
2118
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2117
2119
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2125,7 +2127,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2125
2127
|
readFromStorage
|
|
2126
2128
|
}
|
|
2127
2129
|
};
|
|
2128
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2130
|
+
return jsx(WrappedComponent, _objectSpread$1i(_objectSpread$1i({}, props), storageProp));
|
|
2129
2131
|
};
|
|
2130
2132
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2131
2133
|
return WithStorage;
|
|
@@ -2171,8 +2173,8 @@ const usePrevious = value => {
|
|
|
2171
2173
|
return ref.current;
|
|
2172
2174
|
};
|
|
2173
2175
|
|
|
2174
|
-
function ownKeys$
|
|
2175
|
-
function _objectSpread$
|
|
2176
|
+
function ownKeys$1h(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; }
|
|
2177
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1h(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1h(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2176
2178
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, 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: [] }, { 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: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, 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" } } }, { 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: "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: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, 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: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, 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: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1074, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2177
2179
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2178
2180
|
var _storesQueryResult$re;
|
|
@@ -2183,15 +2185,15 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2183
2185
|
offset: storesQueryResult.offset,
|
|
2184
2186
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2185
2187
|
var _store$productSelecti;
|
|
2186
|
-
return _objectSpread$
|
|
2188
|
+
return _objectSpread$1h(_objectSpread$1h({}, store), {}, {
|
|
2187
2189
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2188
2190
|
});
|
|
2189
2191
|
})
|
|
2190
2192
|
};
|
|
2191
2193
|
};
|
|
2192
|
-
const createQueryVariables$
|
|
2194
|
+
const createQueryVariables$9 = ownProps => {
|
|
2193
2195
|
var _context;
|
|
2194
|
-
return _objectSpread$
|
|
2196
|
+
return _objectSpread$1h(_objectSpread$1h({
|
|
2195
2197
|
limit: ownProps.limit,
|
|
2196
2198
|
offset: ownProps.offset,
|
|
2197
2199
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2205,7 +2207,7 @@ const createQueryVariables$8 = ownProps => {
|
|
|
2205
2207
|
const useStoresListFetcher = props => {
|
|
2206
2208
|
const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
|
|
2207
2209
|
const excludeProductSelections = props.excludeProductSelections || false;
|
|
2208
|
-
const queryVariables = createQueryVariables$
|
|
2210
|
+
const queryVariables = createQueryVariables$9({
|
|
2209
2211
|
limit: props.limit,
|
|
2210
2212
|
offset: props.offset,
|
|
2211
2213
|
sort: _sortInstanceProperty(props),
|
|
@@ -2346,8 +2348,8 @@ function useDidFormValidationFail() {
|
|
|
2346
2348
|
return Boolean(didFormValidationFail);
|
|
2347
2349
|
}
|
|
2348
2350
|
|
|
2349
|
-
function ownKeys$
|
|
2350
|
-
function _objectSpread$
|
|
2351
|
+
function ownKeys$1g(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; }
|
|
2352
|
+
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2351
2353
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2352
2354
|
const defaultOptions = {
|
|
2353
2355
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2375,7 +2377,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2375
2377
|
};
|
|
2376
2378
|
const usePersistedReminder = function () {
|
|
2377
2379
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2378
|
-
const mergedOptions = _objectSpread$
|
|
2380
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions), options);
|
|
2379
2381
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2380
2382
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2381
2383
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2421,7 +2423,7 @@ const usePersistedReminder = function () {
|
|
|
2421
2423
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2422
2424
|
};
|
|
2423
2425
|
|
|
2424
|
-
var messages$
|
|
2426
|
+
var messages$M = defineMessages({
|
|
2425
2427
|
profileUpdated: {
|
|
2426
2428
|
id: 'NotificationText.profileUpdated',
|
|
2427
2429
|
description: 'Label for the notification header',
|
|
@@ -2439,8 +2441,8 @@ var messages$I = defineMessages({
|
|
|
2439
2441
|
}
|
|
2440
2442
|
});
|
|
2441
2443
|
|
|
2442
|
-
function ownKeys$
|
|
2443
|
-
function _objectSpread$
|
|
2444
|
+
function ownKeys$1f(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; }
|
|
2445
|
+
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2444
2446
|
const LinkToProfile = props => {
|
|
2445
2447
|
const _useTrackingShared = useTrackingShared(),
|
|
2446
2448
|
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
@@ -2461,9 +2463,9 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2461
2463
|
children: [jsx(Text.Body, {
|
|
2462
2464
|
as: "p",
|
|
2463
2465
|
isBold: true,
|
|
2464
|
-
intlMessage: messages$
|
|
2466
|
+
intlMessage: messages$M.profileUpdated
|
|
2465
2467
|
}), jsx(Text.Body, {
|
|
2466
|
-
intlMessage: _objectSpread$
|
|
2468
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.addMoreInformation), {}, {
|
|
2467
2469
|
values: {
|
|
2468
2470
|
newline: getNewLine
|
|
2469
2471
|
}
|
|
@@ -2472,7 +2474,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2472
2474
|
}), jsx(Spacings.Stack, {
|
|
2473
2475
|
scale: "xs",
|
|
2474
2476
|
children: jsx(Text.Body, {
|
|
2475
|
-
intlMessage: _objectSpread$
|
|
2477
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$M.informationAndProfileLink), {}, {
|
|
2476
2478
|
values: {
|
|
2477
2479
|
newline: getNewLine,
|
|
2478
2480
|
link: getLinkToProfile
|
|
@@ -2634,7 +2636,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2634
2636
|
}, [ref]);
|
|
2635
2637
|
};
|
|
2636
2638
|
|
|
2637
|
-
var messages$
|
|
2639
|
+
var messages$L = defineMessages({
|
|
2638
2640
|
fallbackHint: {
|
|
2639
2641
|
id: 'KeyFallback.fallbackHint',
|
|
2640
2642
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2658,7 +2660,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2658
2660
|
return values => {
|
|
2659
2661
|
if (!values.resource) return null;
|
|
2660
2662
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2661
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2663
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2662
2664
|
key: values.resource.key
|
|
2663
2665
|
});
|
|
2664
2666
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2670,8 +2672,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2670
2672
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2671
2673
|
useCallback(debounce(promiseCallback, wait), [promiseCallback]);
|
|
2672
2674
|
|
|
2673
|
-
function ownKeys$
|
|
2674
|
-
function _objectSpread$
|
|
2675
|
+
function ownKeys$1e(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; }
|
|
2676
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1e(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2675
2677
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2676
2678
|
const updatedColumnProps = {};
|
|
2677
2679
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2691,14 +2693,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2691
2693
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2692
2694
|
return _mapInstanceProperty(_context = _filterInstanceProperty(cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2693
2695
|
const initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2694
|
-
return _objectSpread$
|
|
2696
|
+
return _objectSpread$1e(_objectSpread$1e({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2695
2697
|
});
|
|
2696
2698
|
};
|
|
2697
2699
|
const handleCacheUpdate = _ref2 => {
|
|
2698
2700
|
let update = _ref2.update,
|
|
2699
2701
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2700
2702
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2701
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2703
|
+
return updateCachedTableConfiguration(_objectSpread$1e(_objectSpread$1e({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2702
2704
|
};
|
|
2703
2705
|
|
|
2704
2706
|
// Signature:
|
|
@@ -2727,7 +2729,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2727
2729
|
return {
|
|
2728
2730
|
columnsConfig: _mapInstanceProperty(initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2729
2731
|
const visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2730
|
-
return _objectSpread$
|
|
2732
|
+
return _objectSpread$1e({
|
|
2731
2733
|
key: visibleColumnKey
|
|
2732
2734
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2733
2735
|
}),
|
|
@@ -2798,22 +2800,22 @@ const handlers$6 = {
|
|
|
2798
2800
|
}
|
|
2799
2801
|
};
|
|
2800
2802
|
|
|
2801
|
-
function ownKeys$
|
|
2802
|
-
function _objectSpread$
|
|
2803
|
+
function ownKeys$1d(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; }
|
|
2804
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2803
2805
|
|
|
2804
2806
|
// eslint-disable-next-line import/prefer-default-export
|
|
2805
2807
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2806
2808
|
var _context;
|
|
2807
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2808
|
-
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2809
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1d(_objectSpread$1d({}, productSelections), {}, {
|
|
2810
|
+
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$1d({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2809
2811
|
from: 'nameAllLocales',
|
|
2810
2812
|
to: 'name'
|
|
2811
2813
|
}])))
|
|
2812
2814
|
});
|
|
2813
2815
|
};
|
|
2814
2816
|
|
|
2815
|
-
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:
|
|
2816
|
-
const createQueryVariables$
|
|
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 => ({
|
|
2817
2819
|
limit: ownProps.limit,
|
|
2818
2820
|
offset: ownProps.offset,
|
|
2819
2821
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2825,7 +2827,7 @@ const emptyProductSelections = {
|
|
|
2825
2827
|
results: []
|
|
2826
2828
|
};
|
|
2827
2829
|
const useProductSelectionsFetcher = props => {
|
|
2828
|
-
const queryVariables = createQueryVariables$
|
|
2830
|
+
const queryVariables = createQueryVariables$8(props);
|
|
2829
2831
|
const _useQuery = useQuery$1(FetchProductSelections, {
|
|
2830
2832
|
context: {
|
|
2831
2833
|
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
@@ -2955,7 +2957,7 @@ const CenteredLoadingSpinner = () => jsx("div", {
|
|
|
2955
2957
|
});
|
|
2956
2958
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2957
2959
|
|
|
2958
|
-
var messages$
|
|
2960
|
+
var messages$K = defineMessages({
|
|
2959
2961
|
noChannelsFound: {
|
|
2960
2962
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2961
2963
|
description: 'The message to display when no channels were found',
|
|
@@ -3004,8 +3006,8 @@ const trackingEvents$4 = {
|
|
|
3004
3006
|
}
|
|
3005
3007
|
};
|
|
3006
3008
|
|
|
3007
|
-
function ownKeys$
|
|
3008
|
-
function _objectSpread$
|
|
3009
|
+
function ownKeys$1c(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; }
|
|
3010
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3009
3011
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, 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: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3010
3012
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, 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: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3011
3013
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -3033,7 +3035,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3033
3035
|
const _useIntl = useIntl(),
|
|
3034
3036
|
formatMessage = _useIntl.formatMessage;
|
|
3035
3037
|
const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3036
|
-
const variables = useMemo(() => _objectSpread$
|
|
3038
|
+
const variables = useMemo(() => _objectSpread$1c({
|
|
3037
3039
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3038
3040
|
}, role && {
|
|
3039
3041
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3094,7 +3096,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3094
3096
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3095
3097
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3096
3098
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3097
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3099
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$K.noChannelsFound), [loadingError, formatMessage]);
|
|
3098
3100
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3099
3101
|
return jsx(Constraints.Horizontal, {
|
|
3100
3102
|
max: "scale",
|
|
@@ -3105,7 +3107,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3105
3107
|
children: jsx(AsyncSelectInput, {
|
|
3106
3108
|
id: name,
|
|
3107
3109
|
name: name,
|
|
3108
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3110
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$K.placeholder),
|
|
3109
3111
|
loadOptions: loadOptionsDebounced,
|
|
3110
3112
|
defaultOptions: true,
|
|
3111
3113
|
showOptionGroupDivider: true,
|
|
@@ -3162,8 +3164,8 @@ var FormattedDateTime$1 = injectIntl(FormattedDateTime);
|
|
|
3162
3164
|
|
|
3163
3165
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3164
3166
|
|
|
3165
|
-
function ownKeys$
|
|
3166
|
-
function _objectSpread$
|
|
3167
|
+
function ownKeys$1b(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; }
|
|
3168
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3167
3169
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3168
3170
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3169
3171
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3195,7 +3197,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3195
3197
|
handleMouseOver: this.handleMouseOver,
|
|
3196
3198
|
handleMouseOut: this.handleMouseOut
|
|
3197
3199
|
};
|
|
3198
|
-
return jsx(BaseComponent, _objectSpread$
|
|
3200
|
+
return jsx(BaseComponent, _objectSpread$1b({}, _objectSpread$1b(_objectSpread$1b({}, this.props), injectedProps)));
|
|
3199
3201
|
}
|
|
3200
3202
|
}]);
|
|
3201
3203
|
return WithMouseOverState;
|
|
@@ -3204,8 +3206,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3204
3206
|
return WithMouseOverState;
|
|
3205
3207
|
};
|
|
3206
3208
|
|
|
3207
|
-
function ownKeys$
|
|
3208
|
-
function _objectSpread$
|
|
3209
|
+
function ownKeys$1a(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; }
|
|
3210
|
+
function _objectSpread$1a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3209
3211
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3210
3212
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3211
3213
|
var styles$i = {
|
|
@@ -3316,7 +3318,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3316
3318
|
}, {
|
|
3317
3319
|
key: "render",
|
|
3318
3320
|
value: function render() {
|
|
3319
|
-
const commonProps = _objectSpread$
|
|
3321
|
+
const commonProps = _objectSpread$1a(_objectSpread$1a({
|
|
3320
3322
|
value: this.state.draftValue,
|
|
3321
3323
|
autoComplete: this.props.autoComplete,
|
|
3322
3324
|
onChange: this.handleChange,
|
|
@@ -3335,7 +3337,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3335
3337
|
htmlFor: inputId,
|
|
3336
3338
|
children: this.props.label
|
|
3337
3339
|
})
|
|
3338
|
-
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$
|
|
3340
|
+
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3339
3341
|
id: inputId,
|
|
3340
3342
|
className: classnames(styles$i.textarea, styles$i["textarea-".concat(this.props.style)], {
|
|
3341
3343
|
[styles$i.invalid]: !this.props.isValid,
|
|
@@ -3344,7 +3346,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3344
3346
|
rows: 1,
|
|
3345
3347
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3346
3348
|
cacheMeasurements: true
|
|
3347
|
-
})) : jsx("input", _objectSpread$
|
|
3349
|
+
})) : jsx("input", _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3348
3350
|
id: inputId,
|
|
3349
3351
|
ref: this.props.inputRef,
|
|
3350
3352
|
type: this.props.as,
|
|
@@ -3371,7 +3373,7 @@ ThrottledField.defaultProps = {
|
|
|
3371
3373
|
label: 'Throttled field'
|
|
3372
3374
|
};
|
|
3373
3375
|
|
|
3374
|
-
var messages$
|
|
3376
|
+
var messages$J = defineMessages({
|
|
3375
3377
|
buttonLabel: {
|
|
3376
3378
|
id: 'SearchInput.buttonLabel',
|
|
3377
3379
|
description: 'Label for "Search" button.',
|
|
@@ -3479,7 +3481,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3479
3481
|
"data-testid": this.props.testId || 'search-input',
|
|
3480
3482
|
value: this.state.text,
|
|
3481
3483
|
label: this.props.label,
|
|
3482
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3484
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$J.placeholder),
|
|
3483
3485
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3484
3486
|
"data-track-component": "Text",
|
|
3485
3487
|
"data-track-event": "change",
|
|
@@ -3698,7 +3700,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3698
3700
|
};
|
|
3699
3701
|
};
|
|
3700
3702
|
|
|
3701
|
-
var messages$
|
|
3703
|
+
var messages$I = defineMessages({
|
|
3702
3704
|
bottomOption: {
|
|
3703
3705
|
id: 'Products.Pickers.bottomOption',
|
|
3704
3706
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3706,11 +3708,11 @@ var messages$E = defineMessages({
|
|
|
3706
3708
|
}
|
|
3707
3709
|
});
|
|
3708
3710
|
|
|
3709
|
-
function ownKeys$
|
|
3710
|
-
function _objectSpread$
|
|
3711
|
+
function ownKeys$19(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; }
|
|
3712
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$19(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$19(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3711
3713
|
const getBottomOption = () => ({
|
|
3712
3714
|
options: [{
|
|
3713
|
-
label: messages$
|
|
3715
|
+
label: messages$I.bottomOption,
|
|
3714
3716
|
isBottomOption: true,
|
|
3715
3717
|
isDisabled: true
|
|
3716
3718
|
}]
|
|
@@ -3718,7 +3720,7 @@ const getBottomOption = () => ({
|
|
|
3718
3720
|
const Option$2 = props => {
|
|
3719
3721
|
const _useIntl = useIntl(),
|
|
3720
3722
|
formatMessage = _useIntl.formatMessage;
|
|
3721
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
3723
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$19(_objectSpread$19({}, props), {}, {
|
|
3722
3724
|
children: props.data.isBottomOption ? jsx(Text.Detail, {
|
|
3723
3725
|
tone: "secondary",
|
|
3724
3726
|
children: formatMessage(props.data.label)
|
|
@@ -3735,8 +3737,8 @@ const Option$2 = props => {
|
|
|
3735
3737
|
};
|
|
3736
3738
|
Option$2.displayName = 'Option';
|
|
3737
3739
|
|
|
3738
|
-
function ownKeys$
|
|
3739
|
-
function _objectSpread$
|
|
3740
|
+
function ownKeys$18(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; }
|
|
3741
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3740
3742
|
const useHandlers = (onChange, getTrackingEvent) => {
|
|
3741
3743
|
const _useTracking = useTracking(),
|
|
3742
3744
|
track = _useTracking.track;
|
|
@@ -3761,8 +3763,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3761
3763
|
if (event.target.value) {
|
|
3762
3764
|
doTrack();
|
|
3763
3765
|
}
|
|
3764
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3765
|
-
target: _objectSpread$
|
|
3766
|
+
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3767
|
+
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3766
3768
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3767
3769
|
})
|
|
3768
3770
|
});
|
|
@@ -3771,8 +3773,8 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3771
3773
|
return [handleInputChange, handleChange];
|
|
3772
3774
|
};
|
|
3773
3775
|
|
|
3774
|
-
function ownKeys$
|
|
3775
|
-
function _objectSpread$
|
|
3776
|
+
function ownKeys$17(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; }
|
|
3777
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$17(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$17(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3776
3778
|
const constructPrefixSearchPredicate = function () {
|
|
3777
3779
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3778
3780
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3815,7 +3817,7 @@ const useLoadOptions = _ref => {
|
|
|
3815
3817
|
}();
|
|
3816
3818
|
return client.query({
|
|
3817
3819
|
query,
|
|
3818
|
-
variables: _objectSpread$
|
|
3820
|
+
variables: _objectSpread$17({
|
|
3819
3821
|
where
|
|
3820
3822
|
}, variables),
|
|
3821
3823
|
context: {
|
|
@@ -3869,7 +3871,7 @@ function useCurrentOption(_ref) {
|
|
|
3869
3871
|
};
|
|
3870
3872
|
}
|
|
3871
3873
|
|
|
3872
|
-
var messages$
|
|
3874
|
+
var messages$H = defineMessages({
|
|
3873
3875
|
noProductTypesFound: {
|
|
3874
3876
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3875
3877
|
description: 'The message to display when no product types were found',
|
|
@@ -3978,7 +3980,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3978
3980
|
children: jsx(AsyncSelectInput, {
|
|
3979
3981
|
id: name,
|
|
3980
3982
|
name: name,
|
|
3981
|
-
placeholder: formatMessage(messages$
|
|
3983
|
+
placeholder: formatMessage(messages$H.placeholder),
|
|
3982
3984
|
loadOptions: loadOptionsDebounced,
|
|
3983
3985
|
defaultOptions: [],
|
|
3984
3986
|
isClearable: isClearable,
|
|
@@ -3991,7 +3993,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3991
3993
|
onInputChange: handleInputChange,
|
|
3992
3994
|
onBlur: onBlur,
|
|
3993
3995
|
value: currentOption.data,
|
|
3994
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3996
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$H.noProductTypesFound),
|
|
3995
3997
|
hasError: hasError || isLoadingFailed
|
|
3996
3998
|
})
|
|
3997
3999
|
}), isLoadingFailed && jsx(Text.Body, {
|
|
@@ -4003,7 +4005,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4003
4005
|
};
|
|
4004
4006
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
4005
4007
|
|
|
4006
|
-
var messages$
|
|
4008
|
+
var messages$G = defineMessages({
|
|
4007
4009
|
noStatesFound: {
|
|
4008
4010
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
4009
4011
|
description: 'The message to display when no states were found',
|
|
@@ -4117,7 +4119,7 @@ const StatePickerInput = _ref => {
|
|
|
4117
4119
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4118
4120
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4119
4121
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4120
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4122
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$G.noStatesFound), [loadingError, formatMessage]);
|
|
4121
4123
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
4122
4124
|
return jsx(Constraints.Horizontal, {
|
|
4123
4125
|
max: "scale",
|
|
@@ -4129,7 +4131,7 @@ const StatePickerInput = _ref => {
|
|
|
4129
4131
|
id: name,
|
|
4130
4132
|
name: name,
|
|
4131
4133
|
horizontalConstraint: "scale",
|
|
4132
|
-
placeholder: formatMessage(messages$
|
|
4134
|
+
placeholder: formatMessage(messages$G.placeholder),
|
|
4133
4135
|
loadOptions: loadOptionsDebounced,
|
|
4134
4136
|
defaultOptions: true,
|
|
4135
4137
|
showOptionGroupDivider: true,
|
|
@@ -4155,9 +4157,9 @@ const StatePickerInput = _ref => {
|
|
|
4155
4157
|
};
|
|
4156
4158
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4157
4159
|
|
|
4158
|
-
function ownKeys$
|
|
4159
|
-
function _objectSpread$
|
|
4160
|
-
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$
|
|
4160
|
+
function ownKeys$16(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; }
|
|
4161
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$16(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$16(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4162
|
+
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$16({
|
|
4161
4163
|
ref: ref,
|
|
4162
4164
|
style: {
|
|
4163
4165
|
display: 'block',
|
|
@@ -4295,8 +4297,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4295
4297
|
};
|
|
4296
4298
|
|
|
4297
4299
|
const _excluded = ["action"];
|
|
4298
|
-
function ownKeys$
|
|
4299
|
-
function _objectSpread$
|
|
4300
|
+
function ownKeys$15(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; }
|
|
4301
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys$15(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys$15(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4300
4302
|
|
|
4301
4303
|
/**
|
|
4302
4304
|
* Checks if a value is a LocalizedString
|
|
@@ -4318,7 +4320,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4318
4320
|
*/
|
|
4319
4321
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4320
4322
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4321
|
-
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4323
|
+
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$15(_objectSpread$15({}, customFields), {}, {
|
|
4322
4324
|
[customField.name]: customField.value
|
|
4323
4325
|
}), {});
|
|
4324
4326
|
};
|
|
@@ -4342,7 +4344,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4342
4344
|
const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
|
|
4343
4345
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4344
4346
|
const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4345
|
-
return _objectSpread$
|
|
4347
|
+
return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, transformedData), parent ? {
|
|
4346
4348
|
parent
|
|
4347
4349
|
} : {}), ancestors ? {
|
|
4348
4350
|
ancestors
|
|
@@ -4484,9 +4486,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4484
4486
|
};
|
|
4485
4487
|
case 'setName':
|
|
4486
4488
|
return {
|
|
4487
|
-
[actionName]:
|
|
4488
|
-
name: _Array$isArray(actionPayload.name) ? actionPayload.name : transformLocalizedStringToLocalizedField(actionPayload.name)
|
|
4489
|
-
}
|
|
4489
|
+
[actionName]: getNameFromPayload(actionPayload)
|
|
4490
4490
|
};
|
|
4491
4491
|
case 'setLocalizedName':
|
|
4492
4492
|
return {
|
|
@@ -4558,7 +4558,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4558
4558
|
case 'addAttributeDefinition':
|
|
4559
4559
|
return {
|
|
4560
4560
|
[actionName]: {
|
|
4561
|
-
attributeDefinition: _objectSpread$
|
|
4561
|
+
attributeDefinition: _objectSpread$15(_objectSpread$15({}, actionPayload.attribute), {}, {
|
|
4562
4562
|
label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4563
4563
|
inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4564
4564
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4574,6 +4574,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4574
4574
|
includedInPrice: actionPayload.taxRate.includedInPrice,
|
|
4575
4575
|
amount: actionPayload.taxRate.amount,
|
|
4576
4576
|
state: actionPayload.taxRate.state,
|
|
4577
|
+
key: actionPayload.taxRate.key,
|
|
4577
4578
|
subRates: actionPayload.taxRate.subRates
|
|
4578
4579
|
},
|
|
4579
4580
|
taxRateId: actionPayload.taxRateId
|
|
@@ -4653,7 +4654,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4653
4654
|
return {
|
|
4654
4655
|
[actionName]: {
|
|
4655
4656
|
attributeName: actionPayload.attributeName,
|
|
4656
|
-
value: _objectSpread$
|
|
4657
|
+
value: _objectSpread$15(_objectSpread$15({}, actionPayload.value), {}, {
|
|
4657
4658
|
label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4658
4659
|
})
|
|
4659
4660
|
}
|
|
@@ -4662,7 +4663,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4662
4663
|
return {
|
|
4663
4664
|
[actionName]: {
|
|
4664
4665
|
attributeName: actionPayload.attributeName,
|
|
4665
|
-
newValue: _objectSpread$
|
|
4666
|
+
newValue: _objectSpread$15(_objectSpread$15({}, actionPayload.newValue), {}, {
|
|
4666
4667
|
label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4667
4668
|
})
|
|
4668
4669
|
}
|
|
@@ -4689,7 +4690,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4689
4690
|
name: transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4690
4691
|
taxCategory: actionPayload.taxCategory,
|
|
4691
4692
|
money: {
|
|
4692
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4693
|
+
[actionPayload.money.type]: _objectSpread$15({
|
|
4693
4694
|
centAmount: actionPayload.money.centAmount,
|
|
4694
4695
|
currencyCode: actionPayload.money.currencyCode
|
|
4695
4696
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4744,8 +4745,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4744
4745
|
fields: customFields
|
|
4745
4746
|
} : null;
|
|
4746
4747
|
return {
|
|
4747
|
-
[actionName]: _objectSpread$
|
|
4748
|
-
address: _objectSpread$
|
|
4748
|
+
[actionName]: _objectSpread$15(_objectSpread$15({}, actionPayload), {}, {
|
|
4749
|
+
address: _objectSpread$15(_objectSpread$15({}, omit(actionPayload.address, ['__typename'])), {}, {
|
|
4749
4750
|
custom
|
|
4750
4751
|
})
|
|
4751
4752
|
})
|
|
@@ -4821,8 +4822,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4821
4822
|
return originalOmitDeep(obj, fieldsToOmit);
|
|
4822
4823
|
}
|
|
4823
4824
|
|
|
4824
|
-
function ownKeys$
|
|
4825
|
-
function _objectSpread$
|
|
4825
|
+
function ownKeys$14(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; }
|
|
4826
|
+
function _objectSpread$14(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$14(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$14(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4826
4827
|
function getPriceChannelName(price) {
|
|
4827
4828
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4828
4829
|
return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -4836,11 +4837,11 @@ function getDiscountValue(price) {
|
|
|
4836
4837
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 ? void 0 : (_price$discounted$val = _price$discounted.value) === null || _price$discounted$val === void 0 ? void 0 : _price$discounted$val.type) === PRECISION_TYPES.centPrecision) {
|
|
4837
4838
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4838
4839
|
}
|
|
4839
|
-
return price.discounted ? _objectSpread$
|
|
4840
|
+
return price.discounted ? _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4840
4841
|
fractionedAmount,
|
|
4841
4842
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4842
4843
|
preciseAmount
|
|
4843
|
-
}) : _objectSpread$
|
|
4844
|
+
}) : _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4844
4845
|
centAmount: 0
|
|
4845
4846
|
});
|
|
4846
4847
|
}
|
|
@@ -4861,7 +4862,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4861
4862
|
}
|
|
4862
4863
|
let preciseAmount;
|
|
4863
4864
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4864
|
-
return _objectSpread$
|
|
4865
|
+
return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4865
4866
|
centAmount,
|
|
4866
4867
|
preciseAmount
|
|
4867
4868
|
});
|
|
@@ -4873,7 +4874,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4873
4874
|
const currencyCode = price.value.currencyCode;
|
|
4874
4875
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4875
4876
|
if (currencyCode && !isNil$1(fractionedAmount)) {
|
|
4876
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4877
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$14(_objectSpread$14({}, minPrices), {}, {
|
|
4877
4878
|
[currencyCode]: price.value
|
|
4878
4879
|
});
|
|
4879
4880
|
}
|
|
@@ -4882,8 +4883,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4882
4883
|
return _Object$values(minPricesByCurrency);
|
|
4883
4884
|
}
|
|
4884
4885
|
|
|
4885
|
-
function ownKeys$
|
|
4886
|
-
function _objectSpread$
|
|
4886
|
+
function ownKeys$13(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; }
|
|
4887
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$13(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$13(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4887
4888
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4888
4889
|
var _context, _context4;
|
|
4889
4890
|
return {
|
|
@@ -4898,14 +4899,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4898
4899
|
return {
|
|
4899
4900
|
name: fieldDefinition.name,
|
|
4900
4901
|
required: fieldDefinition.required,
|
|
4901
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4902
|
-
elementType: _objectSpread$
|
|
4902
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4903
|
+
elementType: _objectSpread$13(_objectSpread$13({}, fieldDefinition.type.elementType), {}, {
|
|
4903
4904
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4904
4905
|
key: value.key,
|
|
4905
4906
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4906
4907
|
}))
|
|
4907
4908
|
})
|
|
4908
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4909
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4909
4910
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
4910
4911
|
key: value.key,
|
|
4911
4912
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4916,7 +4917,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4916
4917
|
})
|
|
4917
4918
|
}
|
|
4918
4919
|
},
|
|
4919
|
-
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4920
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$13(_objectSpread$13({}, fields), {}, {
|
|
4920
4921
|
[customField.name]: customField.value
|
|
4921
4922
|
}), {})
|
|
4922
4923
|
};
|
|
@@ -4928,7 +4929,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4928
4929
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4929
4930
|
// in either case we return null
|
|
4930
4931
|
if (!productSelection) return null;
|
|
4931
|
-
return _objectSpread$
|
|
4932
|
+
return _objectSpread$13(_objectSpread$13({}, applyTransformedLocalizedFields(productSelection, [{
|
|
4932
4933
|
from: 'nameAllLocales',
|
|
4933
4934
|
to: 'name'
|
|
4934
4935
|
}])), {}, {
|
|
@@ -4951,8 +4952,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4951
4952
|
return _mapInstanceProperty(_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4952
4953
|
};
|
|
4953
4954
|
|
|
4954
|
-
function ownKeys$
|
|
4955
|
-
function _objectSpread$
|
|
4955
|
+
function ownKeys$12(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; }
|
|
4956
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$12(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$12(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4956
4957
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4957
4958
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4958
4959
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4969,7 +4970,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4969
4970
|
if (updateAction.action === 'setCustomField' && _Array$isArray(updateAction.value)) {
|
|
4970
4971
|
const definition = _findInstanceProperty(fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4971
4972
|
const definitionName = definition.type.elementType.name;
|
|
4972
|
-
return _objectSpread$
|
|
4973
|
+
return _objectSpread$12(_objectSpread$12({}, updateAction), {}, {
|
|
4973
4974
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4974
4975
|
});
|
|
4975
4976
|
}
|
|
@@ -5043,8 +5044,8 @@ function omitSetsOfSets() {
|
|
|
5043
5044
|
|
|
5044
5045
|
var GetProductTypesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductTypesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productTypes" }, 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: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query GetProductTypesQuery($where: String) {\n productTypes(where: $where) {\n results {\n id\n name\n }\n }\n}\n\nquery GetProductTypeQuery($id: String) {\n productType(id: $id) {\n id\n name\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5045
5046
|
|
|
5046
|
-
function ownKeys
|
|
5047
|
-
function _objectSpread
|
|
5047
|
+
function ownKeys$11(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; }
|
|
5048
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$11(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$11(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5048
5049
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5049
5050
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5050
5051
|
var FetchTypeDefinitionsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsQuery" }, 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: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: "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: "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: "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: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, 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: "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: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, 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: "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: [] }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1172, source: { body: "query FetchTypeDefinitionsQuery($where: String, $limit: Int, $offset: Int) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n fieldDefinitions {\n type {\n name\n ... on SetType {\n elementType {\n name\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n ... on ReferenceType {\n referenceTypeId\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -5104,7 +5105,7 @@ const mapDataToProps = _ref => {
|
|
|
5104
5105
|
return {
|
|
5105
5106
|
fetchTypeDefinitionsQuery: {
|
|
5106
5107
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5107
|
-
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread
|
|
5108
|
+
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$11({}, applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5108
5109
|
isImmutable: true
|
|
5109
5110
|
}), [{
|
|
5110
5111
|
from: 'labelAllLocales',
|
|
@@ -5132,12 +5133,12 @@ const handlers$4 = {
|
|
|
5132
5133
|
}
|
|
5133
5134
|
};
|
|
5134
5135
|
|
|
5135
|
-
function ownKeys$
|
|
5136
|
-
function _objectSpread$
|
|
5136
|
+
function ownKeys$10(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; }
|
|
5137
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$10(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$10(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5137
5138
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5138
5139
|
return {
|
|
5139
5140
|
fields: customFieldsFromRestResponse.fields,
|
|
5140
|
-
type: _objectSpread$
|
|
5141
|
+
type: _objectSpread$10({
|
|
5141
5142
|
id: customFieldsFromRestResponse.type.id
|
|
5142
5143
|
}, customFieldsFromRestResponse.type.obj)
|
|
5143
5144
|
};
|
|
@@ -5156,14 +5157,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5156
5157
|
name: fieldDefinition.name,
|
|
5157
5158
|
required: fieldDefinition.required,
|
|
5158
5159
|
inputHint: fieldDefinition.inputHint,
|
|
5159
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5160
|
-
elementType: _objectSpread$
|
|
5160
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5161
|
+
elementType: _objectSpread$10(_objectSpread$10({}, fieldDefinition.type.elementType), {}, {
|
|
5161
5162
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5162
5163
|
key: value.key,
|
|
5163
5164
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5164
5165
|
}))
|
|
5165
5166
|
})
|
|
5166
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5167
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5167
5168
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
5168
5169
|
key: value.key,
|
|
5169
5170
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5179,7 +5180,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5179
5180
|
type: {
|
|
5180
5181
|
id: formCustomFields.type.id,
|
|
5181
5182
|
typeId: 'type',
|
|
5182
|
-
obj: _objectSpread$
|
|
5183
|
+
obj: _objectSpread$10({}, formCustomFields.type)
|
|
5183
5184
|
},
|
|
5184
5185
|
fields: formCustomFields.fields
|
|
5185
5186
|
});
|
|
@@ -5187,7 +5188,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5187
5188
|
type: {
|
|
5188
5189
|
id: formCustomFields.type.id,
|
|
5189
5190
|
typeId: 'type',
|
|
5190
|
-
obj: _objectSpread$
|
|
5191
|
+
obj: _objectSpread$10({}, omit(formCustomFields.type, ['id']))
|
|
5191
5192
|
},
|
|
5192
5193
|
fields: omitBy(formCustomFields.fields || {}, isNil$1)
|
|
5193
5194
|
});
|
|
@@ -5318,8 +5319,8 @@ const REFERENCED_TYPES = {
|
|
|
5318
5319
|
zone: 'zone'
|
|
5319
5320
|
};
|
|
5320
5321
|
|
|
5321
|
-
function ownKeys
|
|
5322
|
-
function _objectSpread
|
|
5322
|
+
function ownKeys$$(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; }
|
|
5323
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$$(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$$(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5323
5324
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5324
5325
|
let validatedValues = [];
|
|
5325
5326
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5386,8 +5387,8 @@ function validations (formValues, language, languages) {
|
|
|
5386
5387
|
var _context2;
|
|
5387
5388
|
// Collect all required and set type fields
|
|
5388
5389
|
const fieldDefinitionsToValidate = _filterInstanceProperty(_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5389
|
-
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread
|
|
5390
|
-
[fieldDefinition.name]: _objectSpread
|
|
5390
|
+
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$$(_objectSpread$$({}, acc), {}, {
|
|
5391
|
+
[fieldDefinition.name]: _objectSpread$$(_objectSpread$$({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5391
5392
|
}), {});
|
|
5392
5393
|
return withoutEmptyErrorsByField(errors);
|
|
5393
5394
|
}
|
|
@@ -5414,8 +5415,8 @@ function CustomTextInput(props) {
|
|
|
5414
5415
|
}
|
|
5415
5416
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5416
5417
|
|
|
5417
|
-
function ownKeys$
|
|
5418
|
-
function _objectSpread$
|
|
5418
|
+
function ownKeys$_(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; }
|
|
5419
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5419
5420
|
const getSubfieldLanguage = subfieldName => {
|
|
5420
5421
|
const lastDotIndex = _lastIndexOfInstanceProperty(subfieldName).call(subfieldName, '.');
|
|
5421
5422
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5439,7 +5440,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5439
5440
|
// as a whole.
|
|
5440
5441
|
|
|
5441
5442
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5442
|
-
const newValue = _objectSpread$
|
|
5443
|
+
const newValue = _objectSpread$_(_objectSpread$_({}, props.value), {}, {
|
|
5443
5444
|
[fieldLanguage]: rawValue
|
|
5444
5445
|
});
|
|
5445
5446
|
const nullifiedIfNeeded = LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5506,21 +5507,21 @@ function CustomNumberInput(props) {
|
|
|
5506
5507
|
}
|
|
5507
5508
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5508
5509
|
|
|
5509
|
-
function ownKeys$
|
|
5510
|
-
function _objectSpread$
|
|
5510
|
+
function ownKeys$Z(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; }
|
|
5511
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$Z(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$Z(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5511
5512
|
var styles$g = {
|
|
5512
5513
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5513
5514
|
};
|
|
5514
5515
|
const fixCurrencyCode = (value, currencies) => {
|
|
5515
5516
|
if (value.currencyCode) return value;
|
|
5516
5517
|
const firstCurrency = currencies[0];
|
|
5517
|
-
return _objectSpread$
|
|
5518
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5518
5519
|
currencyCode: firstCurrency
|
|
5519
5520
|
});
|
|
5520
5521
|
};
|
|
5521
5522
|
const fixAmount = value => {
|
|
5522
5523
|
if (!value.amount) {
|
|
5523
|
-
return _objectSpread$
|
|
5524
|
+
return _objectSpread$Z(_objectSpread$Z({}, value), {}, {
|
|
5524
5525
|
amount: '0'
|
|
5525
5526
|
});
|
|
5526
5527
|
}
|
|
@@ -5562,7 +5563,7 @@ function CustomMoneyInput(props) {
|
|
|
5562
5563
|
}
|
|
5563
5564
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5564
5565
|
const isAmount = _endsWithInstanceProperty(subfieldName).call(subfieldName, 'amount');
|
|
5565
|
-
const newValue = _objectSpread$
|
|
5566
|
+
const newValue = _objectSpread$Z({}, internalValue.current);
|
|
5566
5567
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5567
5568
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5568
5569
|
internalValue.current = fixedValue;
|
|
@@ -5843,7 +5844,7 @@ function ReferenceSearch(props) {
|
|
|
5843
5844
|
});
|
|
5844
5845
|
}
|
|
5845
5846
|
|
|
5846
|
-
const messages$
|
|
5847
|
+
const messages$F = defineMessages({
|
|
5847
5848
|
placeholder: {
|
|
5848
5849
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5849
5850
|
description: 'Placeholder for search for a category',
|
|
@@ -5876,8 +5877,8 @@ const messages$B = defineMessages({
|
|
|
5876
5877
|
}
|
|
5877
5878
|
});
|
|
5878
5879
|
|
|
5879
|
-
function ownKeys$
|
|
5880
|
-
function _objectSpread$
|
|
5880
|
+
function ownKeys$Y(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; }
|
|
5881
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$Y(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$Y(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5881
5882
|
function Option$1(props) {
|
|
5882
5883
|
var _context, _context2;
|
|
5883
5884
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
@@ -5889,7 +5890,7 @@ function Option$1(props) {
|
|
|
5889
5890
|
const _useIntl = useIntl(),
|
|
5890
5891
|
formatMessage = _useIntl.formatMessage;
|
|
5891
5892
|
const category = props.data;
|
|
5892
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5893
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5893
5894
|
children: jsxs("div", {
|
|
5894
5895
|
"data-testid": "category-option",
|
|
5895
5896
|
children: [jsx(Text.Body, {
|
|
@@ -5900,7 +5901,7 @@ function Option$1(props) {
|
|
|
5900
5901
|
fallbackOrder: languages
|
|
5901
5902
|
})
|
|
5902
5903
|
}), category.parent && jsx(Text.Detail, {
|
|
5903
|
-
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$
|
|
5904
|
+
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$F.parentCategory), ": ")).call(_context, formatLocalizedString(category.parent, {
|
|
5904
5905
|
key: 'name',
|
|
5905
5906
|
locale: language,
|
|
5906
5907
|
fallbackOrder: languages
|
|
@@ -5912,14 +5913,14 @@ function Option$1(props) {
|
|
|
5912
5913
|
fallbackOrder: languages
|
|
5913
5914
|
}))
|
|
5914
5915
|
}), category.externalId && jsx(Text.Detail, {
|
|
5915
|
-
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$
|
|
5916
|
+
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$F.externalId), ": ")).call(_context2, category.externalId || NO_VALUE_FALLBACK)
|
|
5916
5917
|
})]
|
|
5917
5918
|
})
|
|
5918
5919
|
}));
|
|
5919
5920
|
}
|
|
5920
5921
|
|
|
5921
|
-
function ownKeys$
|
|
5922
|
-
function _objectSpread$
|
|
5922
|
+
function ownKeys$X(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; }
|
|
5923
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$X(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$X(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5923
5924
|
const filterOption$1 = () => true;
|
|
5924
5925
|
function CategoryReferenceSearch(props) {
|
|
5925
5926
|
const _useIntl = useIntl(),
|
|
@@ -5931,7 +5932,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5931
5932
|
})),
|
|
5932
5933
|
language = _useApplicationContex.language,
|
|
5933
5934
|
languages = _useApplicationContex.languages;
|
|
5934
|
-
const mapItemToOption = useCallback(category => _objectSpread$
|
|
5935
|
+
const mapItemToOption = useCallback(category => _objectSpread$X(_objectSpread$X({}, category), {}, {
|
|
5935
5936
|
value: category.id,
|
|
5936
5937
|
label: formatLocalizedString(category, {
|
|
5937
5938
|
key: 'name',
|
|
@@ -5949,7 +5950,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5949
5950
|
}), [apolloClient]);
|
|
5950
5951
|
return jsx(ReferenceSearch, {
|
|
5951
5952
|
id: props.id,
|
|
5952
|
-
components: _objectSpread$
|
|
5953
|
+
components: _objectSpread$X({
|
|
5953
5954
|
Option: Option$1
|
|
5954
5955
|
}, props.components),
|
|
5955
5956
|
isClearable: props.isClearable,
|
|
@@ -5960,10 +5961,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5960
5961
|
onBlur: props.onBlur,
|
|
5961
5962
|
onChange: props.onChange,
|
|
5962
5963
|
value: props.value,
|
|
5963
|
-
placeholderLabel: formatMessage(messages$
|
|
5964
|
-
searchPromptLabel: formatMessage(messages$
|
|
5965
|
-
noResultsLabel: formatMessage(messages$
|
|
5966
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5964
|
+
placeholderLabel: formatMessage(messages$F.placeholder),
|
|
5965
|
+
searchPromptLabel: formatMessage(messages$F.searchPrompt),
|
|
5966
|
+
noResultsLabel: formatMessage(messages$F.noResults),
|
|
5967
|
+
referenceIsMissingLabel: formatMessage(messages$F.isMissing),
|
|
5967
5968
|
mapItemToOption: mapItemToOption,
|
|
5968
5969
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5969
5970
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6039,7 +6040,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
6039
6040
|
});
|
|
6040
6041
|
}
|
|
6041
6042
|
|
|
6042
|
-
const messages$
|
|
6043
|
+
const messages$E = defineMessages({
|
|
6043
6044
|
placeholder: {
|
|
6044
6045
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
6045
6046
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6067,8 +6068,8 @@ const messages$A = defineMessages({
|
|
|
6067
6068
|
}
|
|
6068
6069
|
});
|
|
6069
6070
|
|
|
6070
|
-
function ownKeys$
|
|
6071
|
-
function _objectSpread$
|
|
6071
|
+
function ownKeys$W(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; }
|
|
6072
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$W(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$W(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6072
6073
|
function Option(props) {
|
|
6073
6074
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
6074
6075
|
language: applicationContext.dataLocale,
|
|
@@ -6079,7 +6080,7 @@ function Option(props) {
|
|
|
6079
6080
|
const _useIntl = useIntl(),
|
|
6080
6081
|
formatMessage = _useIntl.formatMessage;
|
|
6081
6082
|
const cartDiscount = props.data;
|
|
6082
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
6083
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$W(_objectSpread$W({}, props), {}, {
|
|
6083
6084
|
children: jsxs("div", {
|
|
6084
6085
|
"data-testid": "cart-discount-option",
|
|
6085
6086
|
children: [jsx(Text.Detail, {
|
|
@@ -6090,14 +6091,14 @@ function Option(props) {
|
|
|
6090
6091
|
fallbackOrder: languages
|
|
6091
6092
|
})
|
|
6092
6093
|
}), jsxs(Text.Detail, {
|
|
6093
|
-
children: [formatMessage(messages$
|
|
6094
|
+
children: [formatMessage(messages$E.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
|
|
6094
6095
|
})]
|
|
6095
6096
|
})
|
|
6096
6097
|
}));
|
|
6097
6098
|
}
|
|
6098
6099
|
|
|
6099
|
-
function ownKeys$
|
|
6100
|
-
function _objectSpread$
|
|
6100
|
+
function ownKeys$V(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; }
|
|
6101
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$V(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$V(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6101
6102
|
var CartDiscountsCount$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 425, source: { body: "query SearchCartDiscount($where: String) {\n cartDiscounts(limit: 500, where: $where) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n\nquery FetchCartDiscountById($cartDiscountId: String!) {\n cartDiscount(id: $cartDiscountId) {\n id\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6102
6103
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6103
6104
|
const filterOption = (option, text) => {
|
|
@@ -6123,7 +6124,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6123
6124
|
})),
|
|
6124
6125
|
language = _useApplicationContex.language,
|
|
6125
6126
|
languages = _useApplicationContex.languages;
|
|
6126
|
-
const mapItemToOption = useCallback(cartDiscount => _objectSpread$
|
|
6127
|
+
const mapItemToOption = useCallback(cartDiscount => _objectSpread$V(_objectSpread$V({}, cartDiscount), {}, {
|
|
6127
6128
|
value: cartDiscount.id,
|
|
6128
6129
|
key: cartDiscount.key,
|
|
6129
6130
|
label: formatLocalizedString(cartDiscount, {
|
|
@@ -6166,10 +6167,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6166
6167
|
onBlur: props.onBlur,
|
|
6167
6168
|
onChange: props.onChange,
|
|
6168
6169
|
value: returnNullIfEmpty(props.value),
|
|
6169
|
-
placeholderLabel: formatMessage(messages$
|
|
6170
|
-
searchPromptLabel: formatMessage(messages$
|
|
6171
|
-
noResultsLabel: formatMessage(messages$
|
|
6172
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6170
|
+
placeholderLabel: formatMessage(messages$E.placeholder),
|
|
6171
|
+
searchPromptLabel: formatMessage(messages$E.searchPrompt),
|
|
6172
|
+
noResultsLabel: formatMessage(messages$E.noResults),
|
|
6173
|
+
referenceIsMissingLabel: formatMessage(messages$E.isMissing),
|
|
6173
6174
|
mapItemToOption: mapItemToOption,
|
|
6174
6175
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6175
6176
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6230,7 +6231,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6230
6231
|
});
|
|
6231
6232
|
}
|
|
6232
6233
|
|
|
6233
|
-
var messages$
|
|
6234
|
+
var messages$D = defineMessages({
|
|
6234
6235
|
noProductsFound: {
|
|
6235
6236
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6236
6237
|
description: 'The message to display when no products were found',
|
|
@@ -6354,7 +6355,7 @@ const ProductPickerInput = _ref => {
|
|
|
6354
6355
|
children: jsx(AsyncSelectInput, {
|
|
6355
6356
|
id: name,
|
|
6356
6357
|
name: name,
|
|
6357
|
-
placeholder: formatMessage(messages$
|
|
6358
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
6358
6359
|
loadOptions: loadOptionsDebounced,
|
|
6359
6360
|
defaultOptions: [],
|
|
6360
6361
|
isClearable: isClearable,
|
|
@@ -6368,7 +6369,7 @@ const ProductPickerInput = _ref => {
|
|
|
6368
6369
|
onInputChange: handleInputChange,
|
|
6369
6370
|
onBlur: onBlur,
|
|
6370
6371
|
value: currentOption.data,
|
|
6371
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6372
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$D.noProductsFound),
|
|
6372
6373
|
hasError: hasError || isLoadingFailed
|
|
6373
6374
|
})
|
|
6374
6375
|
}), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
|
|
@@ -6686,8 +6687,8 @@ const SetButtons = props => {
|
|
|
6686
6687
|
};
|
|
6687
6688
|
SetButtons.displayName = 'SetButtons';
|
|
6688
6689
|
|
|
6689
|
-
function ownKeys$
|
|
6690
|
-
function _objectSpread$
|
|
6690
|
+
function ownKeys$U(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; }
|
|
6691
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$U(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$U(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6691
6692
|
const getDuplicateErrors = setValues => {
|
|
6692
6693
|
/* eslint-disable no-plusplus */
|
|
6693
6694
|
const result = [];
|
|
@@ -6744,7 +6745,7 @@ function CustomInputSet(props) {
|
|
|
6744
6745
|
touched = _useFormikContext.touched,
|
|
6745
6746
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
6746
6747
|
dirty = _useFormikContext.dirty;
|
|
6747
|
-
const itemFieldDefintion = _objectSpread$
|
|
6748
|
+
const itemFieldDefintion = _objectSpread$U(_objectSpread$U({}, props.fieldDefinition), {}, {
|
|
6748
6749
|
type: props.fieldDefinition.type.elementType
|
|
6749
6750
|
});
|
|
6750
6751
|
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -6857,7 +6858,7 @@ function CustomInputSet(props) {
|
|
|
6857
6858
|
}
|
|
6858
6859
|
CustomInputSet.displayName = 'CustomInputSet';
|
|
6859
6860
|
|
|
6860
|
-
var messages$
|
|
6861
|
+
var messages$C = defineMessages({
|
|
6861
6862
|
referencedProductType: {
|
|
6862
6863
|
id: 'NestedAttributes.referencedProductType',
|
|
6863
6864
|
description: 'Product type referenced hint',
|
|
@@ -6865,10 +6866,10 @@ var messages$y = defineMessages({
|
|
|
6865
6866
|
}
|
|
6866
6867
|
});
|
|
6867
6868
|
|
|
6868
|
-
function ownKeys$
|
|
6869
|
-
function _objectSpread$
|
|
6869
|
+
function ownKeys$T(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; }
|
|
6870
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$T(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$T(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6870
6871
|
function ProductTypeReference(props) {
|
|
6871
|
-
const productTypeMessage = _objectSpread$
|
|
6872
|
+
const productTypeMessage = _objectSpread$T(_objectSpread$T({}, messages$C.referencedProductType), {}, {
|
|
6872
6873
|
values: {
|
|
6873
6874
|
productTypeName: props.productType.name
|
|
6874
6875
|
}
|
|
@@ -6879,23 +6880,23 @@ function ProductTypeReference(props) {
|
|
|
6879
6880
|
}
|
|
6880
6881
|
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
6881
6882
|
|
|
6882
|
-
function ownKeys$
|
|
6883
|
-
function _objectSpread$
|
|
6883
|
+
function ownKeys$S(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; }
|
|
6884
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$S(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$S(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6884
6885
|
var FetchProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductTypeQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productType" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "attributeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "100" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isRequired" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputTipAllLocales" }, 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: "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: "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: "SetAttributeDefinitionType" } }, 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: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, 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: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, 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: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, 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: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, 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: [] }] } }] } }] } }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1905, source: { body: "query FetchProductTypeQuery($id: String!) {\n productType(id: $id) {\n name\n attributeDefinitions(limit: 100) {\n results {\n name\n isRequired\n inputHint\n inputTipAllLocales {\n value\n locale\n }\n labelAllLocales {\n value\n locale\n }\n type {\n name\n ... on SetAttributeDefinitionType {\n elementType {\n name\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6885
6886
|
const mapAttributeDefinition = definition => {
|
|
6886
6887
|
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6887
|
-
return _objectSpread$
|
|
6888
|
+
return _objectSpread$S(_objectSpread$S({}, definition), {}, {
|
|
6888
6889
|
required: definition.isRequired,
|
|
6889
6890
|
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6890
6891
|
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6891
|
-
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$
|
|
6892
|
-
elementType: _objectSpread$
|
|
6892
|
+
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6893
|
+
elementType: _objectSpread$S(_objectSpread$S({}, definition.type.elementType), {}, {
|
|
6893
6894
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6894
6895
|
key: value.key,
|
|
6895
6896
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6896
6897
|
}))
|
|
6897
6898
|
})
|
|
6898
|
-
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6899
|
+
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$S(_objectSpread$S({}, definition.type), {}, {
|
|
6899
6900
|
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6900
6901
|
key: value.key,
|
|
6901
6902
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6971,9 +6972,9 @@ function CustomNestedFieldInput(props) {
|
|
|
6971
6972
|
}
|
|
6972
6973
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
6973
6974
|
|
|
6974
|
-
function ownKeys$
|
|
6975
|
-
function _objectSpread$
|
|
6976
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
6975
|
+
function ownKeys$R(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; }
|
|
6976
|
+
function _objectSpread$R(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6977
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$R(_objectSpread$R({}, result), itemErrors), {});
|
|
6977
6978
|
|
|
6978
6979
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
6979
6980
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -6984,15 +6985,15 @@ const CustomFieldErrors = props => {
|
|
|
6984
6985
|
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
6985
6986
|
return jsxs(Fragment, {
|
|
6986
6987
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
6987
|
-
intlMessage: messages$
|
|
6988
|
+
intlMessage: messages$O.required
|
|
6988
6989
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
6989
|
-
intlMessage: messages$
|
|
6990
|
+
intlMessage: messages$O.unique
|
|
6990
6991
|
})]
|
|
6991
6992
|
});
|
|
6992
6993
|
};
|
|
6993
6994
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
6994
6995
|
|
|
6995
|
-
var messages$
|
|
6996
|
+
var messages$B = defineMessages({
|
|
6996
6997
|
productReferenceLabel: {
|
|
6997
6998
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
6998
6999
|
description: 'Label shown above the product picker input.',
|
|
@@ -7025,8 +7026,8 @@ var messages$x = defineMessages({
|
|
|
7025
7026
|
}
|
|
7026
7027
|
});
|
|
7027
7028
|
|
|
7028
|
-
function ownKeys$
|
|
7029
|
-
function _objectSpread$
|
|
7029
|
+
function ownKeys$Q(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; }
|
|
7030
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$Q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$Q(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7030
7031
|
var CartDiscountsCount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 61, source: { body: "query CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7031
7032
|
const CustomFieldsLabelHint = _ref => {
|
|
7032
7033
|
var _type$name;
|
|
@@ -7058,14 +7059,14 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7058
7059
|
children: [jsx(WarningIcon, {
|
|
7059
7060
|
size: "medium",
|
|
7060
7061
|
color: "warning"
|
|
7061
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7062
|
+
}), jsx(FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7062
7063
|
}) : jsx(Spacings.Inset, {
|
|
7063
7064
|
scale: "xs",
|
|
7064
7065
|
children: jsxs(Spacings.Inline, {
|
|
7065
7066
|
alignItems: "flex-start",
|
|
7066
7067
|
children: [jsx(InformationIcon, {
|
|
7067
7068
|
size: "medium"
|
|
7068
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7069
|
+
}), jsx(FormattedMessage, _objectSpread$Q({}, messages$B.cartDiscountMoreThan500))]
|
|
7069
7070
|
})
|
|
7070
7071
|
});
|
|
7071
7072
|
}
|
|
@@ -7080,8 +7081,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7080
7081
|
formatMessage = _useIntl.formatMessage;
|
|
7081
7082
|
const _usePimStatus = usePimStatus(),
|
|
7082
7083
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7083
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7084
|
-
return formatMessage(messages$
|
|
7084
|
+
if (isProjectIndexed) return formatMessage(messages$B.productTypeReferenceLabelI);
|
|
7085
|
+
return formatMessage(messages$B.productTypeReferenceLabel);
|
|
7085
7086
|
}
|
|
7086
7087
|
|
|
7087
7088
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7097,7 +7098,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7097
7098
|
const referenceTypeId = type.referenceTypeId;
|
|
7098
7099
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7099
7100
|
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7100
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7101
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$B.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$B.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$B.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7101
7102
|
}
|
|
7102
7103
|
const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
7103
7104
|
let name = _ref3.name,
|
|
@@ -7205,8 +7206,8 @@ const ThemedCustomFieldsInternal = props => {
|
|
|
7205
7206
|
};
|
|
7206
7207
|
ThemedCustomFieldsInternal.displayName = 'ThemedCustomFieldsInternal';
|
|
7207
7208
|
|
|
7208
|
-
function ownKeys$
|
|
7209
|
-
function _objectSpread$
|
|
7209
|
+
function ownKeys$P(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; }
|
|
7210
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$P(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$P(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7210
7211
|
const getTypeName = type => type.name.toLowerCase();
|
|
7211
7212
|
const findLabel = (enumType, key) => {
|
|
7212
7213
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -7255,7 +7256,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
7255
7256
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty(pairs).call(pairs, (result, _ref2) => {
|
|
7256
7257
|
let name = _ref2.name,
|
|
7257
7258
|
value = _ref2.value;
|
|
7258
|
-
return _objectSpread$
|
|
7259
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
7259
7260
|
[name]: value
|
|
7260
7261
|
});
|
|
7261
7262
|
}, {});
|
|
@@ -7362,7 +7363,7 @@ const customFieldsMessages = defineMessages({
|
|
|
7362
7363
|
}
|
|
7363
7364
|
});
|
|
7364
7365
|
|
|
7365
|
-
var messages$
|
|
7366
|
+
var messages$A = defineMessages({
|
|
7366
7367
|
updateButton: {
|
|
7367
7368
|
id: 'NestedAttributes.Details.updateButton',
|
|
7368
7369
|
description: 'Update button label',
|
|
@@ -7442,14 +7443,14 @@ var messages$w = defineMessages({
|
|
|
7442
7443
|
|
|
7443
7444
|
const NestingLevelContext = /*#__PURE__*/createContext(0);
|
|
7444
7445
|
|
|
7445
|
-
function ownKeys$
|
|
7446
|
-
function _objectSpread$
|
|
7446
|
+
function ownKeys$O(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; }
|
|
7447
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$O(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$O(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7447
7448
|
const EditButton = props => {
|
|
7448
7449
|
const _useIntl = useIntl(),
|
|
7449
7450
|
formatMessage = _useIntl.formatMessage;
|
|
7450
7451
|
return jsx(Tooltip, {
|
|
7451
7452
|
placement: "top",
|
|
7452
|
-
title: formatMessage(messages$
|
|
7453
|
+
title: formatMessage(messages$A.editTooltip),
|
|
7453
7454
|
children: jsx(IconButton, {
|
|
7454
7455
|
label: "Edit",
|
|
7455
7456
|
isDisabled: props.isDisabled,
|
|
@@ -7465,12 +7466,12 @@ const DropChangesConfirmation = props => {
|
|
|
7465
7466
|
formatMessage = _useIntl2.formatMessage;
|
|
7466
7467
|
return jsx(ConfirmationDialog, {
|
|
7467
7468
|
isOpen: props.isOpen || false,
|
|
7468
|
-
title: formatMessage(messages$
|
|
7469
|
-
labelPrimary: formatMessage(messages$
|
|
7469
|
+
title: formatMessage(messages$A.confirmationDialogTitle),
|
|
7470
|
+
labelPrimary: formatMessage(messages$A.nestedAttributesConfirmLabel),
|
|
7470
7471
|
onConfirm: props.onConfirm,
|
|
7471
7472
|
onCancel: props.onCancel,
|
|
7472
7473
|
children: jsx(Text.Body, {
|
|
7473
|
-
intlMessage: messages$
|
|
7474
|
+
intlMessage: messages$A.confirmationDialogBody
|
|
7474
7475
|
})
|
|
7475
7476
|
});
|
|
7476
7477
|
};
|
|
@@ -7499,11 +7500,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7499
7500
|
children: [jsx(SecondaryButton, {
|
|
7500
7501
|
isDisabled: !formik.dirty,
|
|
7501
7502
|
iconLeft: jsx(RevertIcon, {}),
|
|
7502
|
-
label: formatMessage(messages$
|
|
7503
|
+
label: formatMessage(messages$A.cancelButton),
|
|
7503
7504
|
onClick: formik.resetForm
|
|
7504
7505
|
}), jsx(CustomFormModalPage.FormPrimaryButton, {
|
|
7505
7506
|
isDisabled: !formik.dirty,
|
|
7506
|
-
label: formatMessage(messages$
|
|
7507
|
+
label: formatMessage(messages$A.updateButton),
|
|
7507
7508
|
onClick: formik.handleSubmit
|
|
7508
7509
|
})]
|
|
7509
7510
|
}),
|
|
@@ -7544,7 +7545,7 @@ const NestedInputControls = props => {
|
|
|
7544
7545
|
if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
|
|
7545
7546
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7546
7547
|
if (!hasAttributes) return jsx(Text.Body, {
|
|
7547
|
-
intlMessage: messages$
|
|
7548
|
+
intlMessage: messages$A.emptyProductType,
|
|
7548
7549
|
tone: "secondary"
|
|
7549
7550
|
});
|
|
7550
7551
|
return jsxs(Spacings.Inline, {
|
|
@@ -7594,13 +7595,13 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7594
7595
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7595
7596
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7596
7597
|
const openNestedAttributesForm = () => {
|
|
7597
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7598
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7598
7599
|
hideSaveToolbar: true
|
|
7599
7600
|
}));
|
|
7600
7601
|
attributesForm.openModal();
|
|
7601
7602
|
};
|
|
7602
7603
|
const closeNestedAttributesForm = () => {
|
|
7603
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7604
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7604
7605
|
hideSaveToolbar: false
|
|
7605
7606
|
}));
|
|
7606
7607
|
attributesForm.closeModal();
|
|
@@ -7620,7 +7621,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7620
7621
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7621
7622
|
kind: 'success',
|
|
7622
7623
|
domain: DOMAINS.SIDE,
|
|
7623
|
-
text: formatMessage(messages$
|
|
7624
|
+
text: formatMessage(messages$A.attributeUpdateSucceeded)
|
|
7624
7625
|
});
|
|
7625
7626
|
setSubmitting(false);
|
|
7626
7627
|
},
|
|
@@ -7845,6 +7846,11 @@ var pickerMessages = defineMessages({
|
|
|
7845
7846
|
id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
|
|
7846
7847
|
description: 'Placeholder of the search select field for product selections',
|
|
7847
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'
|
|
7848
7854
|
}
|
|
7849
7855
|
});
|
|
7850
7856
|
|
|
@@ -7877,6 +7883,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7877
7883
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7878
7884
|
if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7879
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
|
+
});
|
|
7880
7890
|
const onOptionClick = event => {
|
|
7881
7891
|
const productSelectionId = event.target.value;
|
|
7882
7892
|
const currentProductSelection = _findInstanceProperty(productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
|
|
@@ -7891,12 +7901,18 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7891
7901
|
isRequired: props.isRequired,
|
|
7892
7902
|
description: props.description,
|
|
7893
7903
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
|
|
7894
|
-
options: mapProductSelectionsToOptions$1(
|
|
7904
|
+
options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
|
|
7895
7905
|
components: props.components,
|
|
7896
7906
|
onChange: onOptionClick,
|
|
7907
|
+
onBlur: props.onBlur,
|
|
7897
7908
|
isDisabled: props.isDisabled,
|
|
7898
7909
|
isReadOnly: props.isReadOnly,
|
|
7899
7910
|
hasWarning: props.hasWarning,
|
|
7911
|
+
hasError: props.hasError,
|
|
7912
|
+
isClearable: props.isClearable,
|
|
7913
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7914
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7915
|
+
maxMenuHeight: props.maxMenuHeight,
|
|
7900
7916
|
isSearchable: true
|
|
7901
7917
|
});
|
|
7902
7918
|
}
|
|
@@ -7904,6 +7920,28 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7904
7920
|
const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
|
|
7905
7921
|
const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
|
|
7906
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
|
+
}];
|
|
7907
7945
|
function ProductSelectionsAsyncSelectDropdown(props) {
|
|
7908
7946
|
var _productSelectionsFet3;
|
|
7909
7947
|
const intl = useIntl();
|
|
@@ -7921,6 +7959,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7921
7959
|
var _productSelectionsFet, _productSelectionsFet2;
|
|
7922
7960
|
return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7923
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
|
+
});
|
|
7924
7966
|
const onOptionClick = event => {
|
|
7925
7967
|
var _event$target$value;
|
|
7926
7968
|
const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
|
|
@@ -7928,7 +7970,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7928
7970
|
props.onChange(currentProductSelection);
|
|
7929
7971
|
};
|
|
7930
7972
|
const allProductSelectionOptions = useMemo(() => {
|
|
7931
|
-
return _mapInstanceProperty(
|
|
7973
|
+
return _mapInstanceProperty(filteredProductSelections).call(filteredProductSelections, productSelection => {
|
|
7932
7974
|
const localizedName = formatLocalizedString(productSelection, {
|
|
7933
7975
|
key: 'name',
|
|
7934
7976
|
locale: dataLocale,
|
|
@@ -7941,17 +7983,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7941
7983
|
key: productSelection.key
|
|
7942
7984
|
};
|
|
7943
7985
|
});
|
|
7944
|
-
}, [dataLocale, projectLanguages,
|
|
7986
|
+
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
7945
7987
|
const getDefaultOptions = () => {
|
|
7946
|
-
return
|
|
7988
|
+
return [{
|
|
7989
|
+
options: _sliceInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
|
|
7990
|
+
}, {
|
|
7991
|
+
options: emptyStoreOption$1(intl)
|
|
7992
|
+
}];
|
|
7947
7993
|
};
|
|
7948
7994
|
const handleLoadOptions = async searchTerm => {
|
|
7949
7995
|
const productSelectionOptions = allProductSelectionOptions;
|
|
7950
7996
|
const filteredOptions = _filterInstanceProperty(productSelectionOptions).call(productSelectionOptions, productSelection => {
|
|
7951
|
-
var
|
|
7952
|
-
return _includesInstanceProperty(
|
|
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());
|
|
7953
7999
|
});
|
|
7954
|
-
|
|
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
|
+
}];
|
|
7955
8006
|
};
|
|
7956
8007
|
if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7957
8008
|
return jsx(AsyncSelectField, {
|
|
@@ -7962,22 +8013,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7962
8013
|
isRequired: props.isRequired,
|
|
7963
8014
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
|
|
7964
8015
|
loadOptions: handleLoadOptions,
|
|
8016
|
+
value: getValueFromOptions$3({
|
|
8017
|
+
currentlySelectedProductSelections: props.value,
|
|
8018
|
+
allProductSelectionOptions,
|
|
8019
|
+
isMulti: props.isMulti
|
|
8020
|
+
}),
|
|
7965
8021
|
onChange: onOptionClick,
|
|
8022
|
+
onBlur: props.onBlur,
|
|
7966
8023
|
isDisabled: props.isDisabled,
|
|
8024
|
+
showOptionGroupDivider: true,
|
|
7967
8025
|
isReadOnly: props.isReadOnly,
|
|
7968
8026
|
components: props.components,
|
|
7969
8027
|
defaultOptions: getDefaultOptions(),
|
|
7970
|
-
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
|
|
7971
8034
|
});
|
|
7972
8035
|
}
|
|
7973
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
|
+
|
|
7974
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 } } } };
|
|
7975
|
-
const mapProductSelectionsToOptions = memoize(
|
|
7976
|
-
let
|
|
7977
|
-
|
|
7978
|
-
|
|
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;
|
|
7979
8068
|
return _mapInstanceProperty(productSelections).call(productSelections, productSelection => ({
|
|
7980
|
-
value: productSelection.id,
|
|
8069
|
+
value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
|
|
7981
8070
|
label: formatLocalizedString(productSelection, {
|
|
7982
8071
|
key: 'name',
|
|
7983
8072
|
locale: dataLocale,
|
|
@@ -7986,9 +8075,22 @@ const mapProductSelectionsToOptions = memoize(function () {
|
|
|
7986
8075
|
key: productSelection.key
|
|
7987
8076
|
}));
|
|
7988
8077
|
});
|
|
7989
|
-
const
|
|
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 => {
|
|
7990
8092
|
var _context;
|
|
7991
|
-
let searchText =
|
|
8093
|
+
let searchText = _ref3.searchText;
|
|
7992
8094
|
const sanitizedSearchText = sanitize(_trimInstanceProperty(searchText).call(searchText, searchText));
|
|
7993
8095
|
const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
|
|
7994
8096
|
const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
|
|
@@ -7998,6 +8100,7 @@ const createQueryVariables$6 = _ref => {
|
|
|
7998
8100
|
};
|
|
7999
8101
|
};
|
|
8000
8102
|
function ProductSelectionsSearchSelectDropdown(props) {
|
|
8103
|
+
var _context3;
|
|
8001
8104
|
const intl = useIntl();
|
|
8002
8105
|
const _useState = useState([]),
|
|
8003
8106
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -8010,6 +8113,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8010
8113
|
})),
|
|
8011
8114
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8012
8115
|
dataLocale = _useApplicationContex.dataLocale;
|
|
8116
|
+
const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
|
|
8013
8117
|
const handleLoadOptions = async searchText => {
|
|
8014
8118
|
var _data$productSelectio, _data$productSelectio2;
|
|
8015
8119
|
const _await$client$query = await client.query({
|
|
@@ -8025,8 +8129,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8025
8129
|
data = _await$client$query.data;
|
|
8026
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 : [];
|
|
8027
8131
|
const updatedProductSelections = _mapInstanceProperty(matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
8028
|
-
|
|
8029
|
-
|
|
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
|
+
});
|
|
8030
8143
|
};
|
|
8031
8144
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8032
8145
|
const onOptionClick = event => {
|
|
@@ -8035,37 +8148,60 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8035
8148
|
const currentProductSelection = _findInstanceProperty(productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8036
8149
|
props.onChange(currentProductSelection);
|
|
8037
8150
|
};
|
|
8151
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8038
8152
|
return jsx(SearchSelectField, {
|
|
8039
8153
|
id: props.id,
|
|
8040
8154
|
name: props.name,
|
|
8041
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
|
+
}),
|
|
8042
8166
|
description: props.description,
|
|
8043
8167
|
isRequired: props.isRequired,
|
|
8044
8168
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
|
|
8045
8169
|
loadOptions: loadOptionsDebounced,
|
|
8046
8170
|
onChange: onOptionClick,
|
|
8171
|
+
onBlur: props.onBlur,
|
|
8047
8172
|
components: props.components,
|
|
8048
|
-
isDisabled: props.isDisabled,
|
|
8173
|
+
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8049
8174
|
isReadOnly: props.isReadOnly,
|
|
8050
|
-
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
|
|
8051
8181
|
});
|
|
8052
8182
|
}
|
|
8053
8183
|
|
|
8054
|
-
function ownKeys$
|
|
8055
|
-
function _objectSpread$
|
|
8056
|
-
const components = {
|
|
8057
|
-
// eslint-disable-next-line react/display-name
|
|
8058
|
-
Option: optionInnerProps => jsx(CustomSelectInputOption, {
|
|
8059
|
-
optionType: "double-property",
|
|
8060
|
-
optionInnerProps: optionInnerProps
|
|
8061
|
-
})
|
|
8062
|
-
};
|
|
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; }
|
|
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; }
|
|
8063
8186
|
function ProductSelectionsPicker(props) {
|
|
8064
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]);
|
|
8065
8201
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8066
8202
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8067
8203
|
return jsx(Spacings.Stack, {
|
|
8068
|
-
children: jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8204
|
+
children: jsx(CustomProductSelectionsPicker, _objectSpread$N(_objectSpread$N({}, props), {}, {
|
|
8069
8205
|
components: components
|
|
8070
8206
|
}))
|
|
8071
8207
|
});
|
|
@@ -8077,12 +8213,18 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8077
8213
|
optionType: 'double-property',
|
|
8078
8214
|
isMulti: false,
|
|
8079
8215
|
isRequired: false,
|
|
8080
|
-
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
|
|
8081
8223
|
};
|
|
8082
8224
|
|
|
8083
8225
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8084
8226
|
|
|
8085
|
-
var messages$
|
|
8227
|
+
var messages$z = defineMessages({
|
|
8086
8228
|
countriesBasicSelectPlaceholder: {
|
|
8087
8229
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8088
8230
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8110,7 +8252,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8110
8252
|
value: props.value,
|
|
8111
8253
|
isRequired: props.isRequired,
|
|
8112
8254
|
description: props.description,
|
|
8113
|
-
placeholder: intl.formatMessage(messages$
|
|
8255
|
+
placeholder: intl.formatMessage(messages$z.countriesBasicSelectPlaceholder),
|
|
8114
8256
|
options: props.options,
|
|
8115
8257
|
onChange: props.onChange,
|
|
8116
8258
|
isDisabled: props.isDisabled,
|
|
@@ -8120,10 +8262,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8120
8262
|
});
|
|
8121
8263
|
}
|
|
8122
8264
|
|
|
8123
|
-
function ownKeys$
|
|
8124
|
-
function _objectSpread$
|
|
8265
|
+
function ownKeys$M(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; }
|
|
8266
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$M(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$M(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8125
8267
|
const emptyCountryOption = intl => [{
|
|
8126
|
-
label: intl.formatMessage(messages$
|
|
8268
|
+
label: intl.formatMessage(messages$z.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8127
8269
|
value: undefined,
|
|
8128
8270
|
isDisabled: true
|
|
8129
8271
|
}];
|
|
@@ -8148,7 +8290,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8148
8290
|
const onOptionChange = event => {
|
|
8149
8291
|
const countries = event.target.value;
|
|
8150
8292
|
props.onChange({
|
|
8151
|
-
target: _objectSpread$
|
|
8293
|
+
target: _objectSpread$M(_objectSpread$M({}, event.target), {}, {
|
|
8152
8294
|
value: _mapInstanceProperty(countries).call(countries, country => {
|
|
8153
8295
|
var _country$value;
|
|
8154
8296
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8169,7 +8311,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8169
8311
|
var _context3;
|
|
8170
8312
|
return _findInstanceProperty(_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8171
8313
|
}),
|
|
8172
|
-
placeholder: intl.formatMessage(messages$
|
|
8314
|
+
placeholder: intl.formatMessage(messages$z.countriesAsyncSelectPlaceholder),
|
|
8173
8315
|
loadOptions: handleLoadOptions,
|
|
8174
8316
|
onChange: onOptionChange,
|
|
8175
8317
|
isDisabled: props.isDisabled,
|
|
@@ -8179,13 +8321,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8179
8321
|
});
|
|
8180
8322
|
}
|
|
8181
8323
|
|
|
8182
|
-
function ownKeys$
|
|
8183
|
-
function _objectSpread$
|
|
8324
|
+
function ownKeys$L(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; }
|
|
8325
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$L(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$L(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8184
8326
|
function CountriesPicker(props) {
|
|
8185
8327
|
var _props$options;
|
|
8186
8328
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8187
8329
|
return jsx(Spacings.Stack, {
|
|
8188
|
-
children: jsx(CustomCountriesPicker, _objectSpread$
|
|
8330
|
+
children: jsx(CustomCountriesPicker, _objectSpread$L({}, props))
|
|
8189
8331
|
});
|
|
8190
8332
|
}
|
|
8191
8333
|
CountriesPicker.defaultProps = {
|
|
@@ -8195,7 +8337,7 @@ CountriesPicker.defaultProps = {
|
|
|
8195
8337
|
hasWarning: false
|
|
8196
8338
|
};
|
|
8197
8339
|
|
|
8198
|
-
var messages$
|
|
8340
|
+
var messages$y = defineMessages({
|
|
8199
8341
|
noCustomerGroupsFound: {
|
|
8200
8342
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8201
8343
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8320,7 +8462,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8320
8462
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8321
8463
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8322
8464
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8323
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8465
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$y.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8324
8466
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8325
8467
|
return jsx(Constraints.Horizontal, {
|
|
8326
8468
|
max: "scale",
|
|
@@ -8331,7 +8473,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8331
8473
|
children: jsx(AsyncSelectInput, {
|
|
8332
8474
|
id: name,
|
|
8333
8475
|
name: name,
|
|
8334
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8476
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$y.placeholder),
|
|
8335
8477
|
loadOptions: loadOptionsDebounced,
|
|
8336
8478
|
defaultOptions: true,
|
|
8337
8479
|
showOptionGroupDivider: true,
|
|
@@ -8401,7 +8543,7 @@ const getFirst60Options$1 = (storesOptions, currentValues) => {
|
|
|
8401
8543
|
return _sliceInstanceProperty(storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8402
8544
|
};
|
|
8403
8545
|
|
|
8404
|
-
var messages$
|
|
8546
|
+
var messages$x = defineMessages({
|
|
8405
8547
|
basicSelectInputPlaceholder: {
|
|
8406
8548
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8407
8549
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8434,8 +8576,8 @@ var messages$t = defineMessages({
|
|
|
8434
8576
|
}
|
|
8435
8577
|
});
|
|
8436
8578
|
|
|
8437
|
-
function ownKeys$
|
|
8438
|
-
function _objectSpread$
|
|
8579
|
+
function ownKeys$K(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; }
|
|
8580
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$K(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$K(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8439
8581
|
const hasErrors$5 = errors => {
|
|
8440
8582
|
var _context;
|
|
8441
8583
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8460,7 +8602,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8460
8602
|
return _findInstanceProperty(mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8461
8603
|
};
|
|
8462
8604
|
const emptyStoreOption = intl => [{
|
|
8463
|
-
label: intl.formatMessage(messages$
|
|
8605
|
+
label: intl.formatMessage(messages$x.asyncSelectDropdownTypeAheadPrompt),
|
|
8464
8606
|
value: undefined,
|
|
8465
8607
|
isDisabled: true
|
|
8466
8608
|
}];
|
|
@@ -8507,10 +8649,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8507
8649
|
};
|
|
8508
8650
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8509
8651
|
return jsxs(Fragment, {
|
|
8510
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
8652
|
+
children: [jsx(AsyncSelectInput, _objectSpread$K(_objectSpread$K({
|
|
8511
8653
|
id: props.id,
|
|
8512
8654
|
name: props.name,
|
|
8513
|
-
placeholder: intl.formatMessage(messages$
|
|
8655
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8514
8656
|
horizontalConstraint: props.horizontalConstraint,
|
|
8515
8657
|
loadOptions: handleLoadOptions,
|
|
8516
8658
|
defaultOptions: true,
|
|
@@ -8549,8 +8691,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8549
8691
|
shouldFetchProductSelections: false
|
|
8550
8692
|
};
|
|
8551
8693
|
|
|
8552
|
-
function ownKeys$
|
|
8553
|
-
function _objectSpread$
|
|
8694
|
+
function ownKeys$J(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; }
|
|
8695
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$J(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$J(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8554
8696
|
const hasErrors$4 = errors => {
|
|
8555
8697
|
var _context;
|
|
8556
8698
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8598,10 +8740,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8598
8740
|
};
|
|
8599
8741
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8600
8742
|
return jsxs(Fragment, {
|
|
8601
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
8743
|
+
children: [jsx(SelectInput, _objectSpread$J(_objectSpread$J({
|
|
8602
8744
|
id: props.id,
|
|
8603
8745
|
name: props.name,
|
|
8604
|
-
placeholder: intl.formatMessage(messages$
|
|
8746
|
+
placeholder: intl.formatMessage(messages$x.basicSelectInputPlaceholder),
|
|
8605
8747
|
horizontalConstraint: props.horizontalConstraint,
|
|
8606
8748
|
options: mappedStoresListOptions,
|
|
8607
8749
|
isMulti: props.isMulti,
|
|
@@ -8693,8 +8835,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8693
8835
|
};
|
|
8694
8836
|
};
|
|
8695
8837
|
|
|
8696
|
-
function ownKeys$
|
|
8697
|
-
function _objectSpread$
|
|
8838
|
+
function ownKeys$I(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; }
|
|
8839
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$I(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$I(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8698
8840
|
var FetchStoresByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "storesByWherePredicate" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } } }] }], 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: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, 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: 525, source: { body: "query FetchStoresByWherePredicate(\n $where: String!\n $skipFetchingStores: Boolean!\n $excludeProductSelections: Boolean!\n) {\n storesByWherePredicate: stores(where: $where) @skip(if: $skipFetchingStores) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8699
8841
|
const hasErrors$3 = errors => {
|
|
8700
8842
|
var _context;
|
|
@@ -8796,10 +8938,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8796
8938
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8797
8939
|
if (storesByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8798
8940
|
return jsxs(Fragment, {
|
|
8799
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
8941
|
+
children: [jsx(SearchSelectInput, _objectSpread$I(_objectSpread$I({
|
|
8800
8942
|
id: props.id,
|
|
8801
8943
|
name: props.name,
|
|
8802
|
-
placeholder: intl.formatMessage(messages$
|
|
8944
|
+
placeholder: intl.formatMessage(messages$x.searchSelectInputPlaceholder),
|
|
8803
8945
|
horizontalConstraint: props.horizontalConstraint,
|
|
8804
8946
|
loadOptions: loadOptionsDebounced,
|
|
8805
8947
|
defaultOptions: false,
|
|
@@ -8813,8 +8955,8 @@ const StoresSearchSelectInput = props => {
|
|
|
8813
8955
|
}),
|
|
8814
8956
|
onChange: props.onChange,
|
|
8815
8957
|
onBlur: props.onBlur,
|
|
8816
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8817
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
8958
|
+
loadingMessage: intl.formatMessage(messages$x.searchSelectInputLoadingMessage),
|
|
8959
|
+
noOptionsMessage: () => intl.formatMessage(messages$x.searchSelectInputNoOptionsFoundMessage),
|
|
8818
8960
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8819
8961
|
isReadOnly: props.isReadOnly,
|
|
8820
8962
|
isClearable: props.isClearable,
|
|
@@ -8841,8 +8983,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8841
8983
|
shouldFetchProductSelections: false
|
|
8842
8984
|
};
|
|
8843
8985
|
|
|
8844
|
-
function ownKeys$
|
|
8845
|
-
function _objectSpread$
|
|
8986
|
+
function ownKeys$H(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; }
|
|
8987
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$H(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$H(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8846
8988
|
const StoreSelectInput = props => {
|
|
8847
8989
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8848
8990
|
const components = useMemo(() => {
|
|
@@ -8850,7 +8992,7 @@ const StoreSelectInput = props => {
|
|
|
8850
8992
|
// eslint-disable-next-line react/display-name
|
|
8851
8993
|
Option: optionInnerProps => {
|
|
8852
8994
|
if (optionInnerProps.isDisabled) {
|
|
8853
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
8995
|
+
return jsx(SelectInput.Option, _objectSpread$H({}, optionInnerProps));
|
|
8854
8996
|
}
|
|
8855
8997
|
return jsx(CustomSelectInputOption, {
|
|
8856
8998
|
optionType: props.optionType,
|
|
@@ -8861,7 +9003,7 @@ const StoreSelectInput = props => {
|
|
|
8861
9003
|
}, [props.optionType]);
|
|
8862
9004
|
if (totalNumberOfStoresFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8863
9005
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8864
|
-
return jsx(CustomStoreSelectInput, _objectSpread$
|
|
9006
|
+
return jsx(CustomStoreSelectInput, _objectSpread$H(_objectSpread$H({
|
|
8865
9007
|
projectKey: props.projectKey,
|
|
8866
9008
|
id: props.id,
|
|
8867
9009
|
name: props.name,
|
|
@@ -8900,12 +9042,12 @@ StoreSelectInput.defaultProps = {
|
|
|
8900
9042
|
shouldFetchProductSelections: false
|
|
8901
9043
|
};
|
|
8902
9044
|
|
|
8903
|
-
function ownKeys$
|
|
8904
|
-
function _objectSpread$
|
|
9045
|
+
function ownKeys$G(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; }
|
|
9046
|
+
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$G(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$G(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8905
9047
|
var FetchBusinessUnitsListQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsListQuery" }, 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: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnits" }, 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" } } }, { 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: "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: "FragmentSpread", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitBasicInfo" }, 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: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 340, source: { body: "query FetchBusinessUnitsListQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n) {\n businessUnits(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...BusinessUnitBasicInfo\n }\n }\n}\n\nfragment BusinessUnitBasicInfo on BusinessUnit {\n id\n key\n name\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8906
9048
|
const createQueryVariables$3 = ownProps => {
|
|
8907
9049
|
var _context;
|
|
8908
|
-
return _objectSpread$
|
|
9050
|
+
return _objectSpread$G(_objectSpread$G({
|
|
8909
9051
|
limit: ownProps.limit,
|
|
8910
9052
|
offset: ownProps.offset,
|
|
8911
9053
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -8978,7 +9120,7 @@ const getFirst60Options = (businessUnitOptions, currentValues) => {
|
|
|
8978
9120
|
return _sliceInstanceProperty(businessUnitOptions).call(businessUnitOptions, 0, LOWER_BUSINESS_UNITS_LIMIT + currentValuesLength);
|
|
8979
9121
|
};
|
|
8980
9122
|
|
|
8981
|
-
var messages$
|
|
9123
|
+
var messages$w = defineMessages({
|
|
8982
9124
|
asyncSelectInputPlaceholder: {
|
|
8983
9125
|
id: 'Shared.BusinessUnitSelectInput.asyncSelectInputPlaceholder',
|
|
8984
9126
|
description: 'The placeholder shown for async select input',
|
|
@@ -9006,8 +9148,8 @@ var messages$s = defineMessages({
|
|
|
9006
9148
|
}
|
|
9007
9149
|
});
|
|
9008
9150
|
|
|
9009
|
-
function ownKeys$
|
|
9010
|
-
function _objectSpread$
|
|
9151
|
+
function ownKeys$F(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; }
|
|
9152
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$F(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$F(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9011
9153
|
const hasErrors$2 = errors => {
|
|
9012
9154
|
var _context;
|
|
9013
9155
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -9049,10 +9191,10 @@ const BusinessUnitAsyncSelectInput = props => {
|
|
|
9049
9191
|
};
|
|
9050
9192
|
if (businessUnitsListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9051
9193
|
return jsxs(Fragment, {
|
|
9052
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
9194
|
+
children: [jsx(AsyncSelectInput, _objectSpread$F(_objectSpread$F({
|
|
9053
9195
|
id: props.id,
|
|
9054
9196
|
name: props.name,
|
|
9055
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9197
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.asyncSelectInputPlaceholder),
|
|
9056
9198
|
horizontalConstraint: props.horizontalConstraint,
|
|
9057
9199
|
loadOptions: handleLoadOptions,
|
|
9058
9200
|
defaultOptions: getDefaultOptions(),
|
|
@@ -9085,8 +9227,8 @@ BusinessUnitAsyncSelectInput.defaultProps = {
|
|
|
9085
9227
|
shouldFetchProductSelections: false
|
|
9086
9228
|
};
|
|
9087
9229
|
|
|
9088
|
-
function ownKeys$
|
|
9089
|
-
function _objectSpread$
|
|
9230
|
+
function ownKeys$E(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; }
|
|
9231
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$E(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$E(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9090
9232
|
const hasErrors$1 = errors => {
|
|
9091
9233
|
var _context;
|
|
9092
9234
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -9113,10 +9255,10 @@ const BusinessUnitBasicSelectInput = props => {
|
|
|
9113
9255
|
};
|
|
9114
9256
|
if (businessUnitsListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9115
9257
|
return jsxs(Fragment, {
|
|
9116
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
9258
|
+
children: [jsx(SelectInput, _objectSpread$E(_objectSpread$E({
|
|
9117
9259
|
id: props.id,
|
|
9118
9260
|
name: props.name,
|
|
9119
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9261
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.basicSelectInputPlaceholder),
|
|
9120
9262
|
horizontalConstraint: props.horizontalConstraint,
|
|
9121
9263
|
options: mappedBusinessUnitsOptions,
|
|
9122
9264
|
value: (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.value,
|
|
@@ -9200,8 +9342,8 @@ const handlers$1 = {
|
|
|
9200
9342
|
}
|
|
9201
9343
|
};
|
|
9202
9344
|
|
|
9203
|
-
function ownKeys$
|
|
9204
|
-
function _objectSpread$
|
|
9345
|
+
function ownKeys$D(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; }
|
|
9346
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$D(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$D(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9205
9347
|
var FetchBusinessUnitsByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchBusinessUnitsByWherePredicate" }, 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", alias: { kind: "Name", value: "businessUnitsByWherePredicate" }, name: { kind: "Name", value: "businessUnits" }, 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: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 180, source: { body: "query FetchBusinessUnitsByWherePredicate($where: String!) {\n businessUnitsByWherePredicate: businessUnits(where: $where) {\n results {\n id\n key\n name\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
9206
9348
|
const hasErrors = errors => {
|
|
9207
9349
|
var _context;
|
|
@@ -9250,18 +9392,18 @@ const BusinessUnitSearchSelectInput = props => {
|
|
|
9250
9392
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
9251
9393
|
if (businessUnitsByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9252
9394
|
return jsxs(Fragment, {
|
|
9253
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
9395
|
+
children: [jsx(SearchSelectInput, _objectSpread$D(_objectSpread$D({
|
|
9254
9396
|
id: props.id,
|
|
9255
9397
|
name: props.name,
|
|
9256
|
-
placeholder: props.placeholder || intl.formatMessage(messages$
|
|
9398
|
+
placeholder: props.placeholder || intl.formatMessage(messages$w.searchSelectInputPlaceholder),
|
|
9257
9399
|
horizontalConstraint: props.horizontalConstraint,
|
|
9258
9400
|
loadOptions: loadOptionsDebounced,
|
|
9259
9401
|
defaultOptions: false,
|
|
9260
9402
|
value: props.value,
|
|
9261
9403
|
onChange: handleChange,
|
|
9262
9404
|
onBlur: props.onBlur,
|
|
9263
|
-
loadingMessage: intl.formatMessage(messages$
|
|
9264
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
9405
|
+
loadingMessage: intl.formatMessage(messages$w.searchSelectInputLoadingMessage),
|
|
9406
|
+
noOptionsMessage: () => intl.formatMessage(messages$w.searchSelectInputNoOptionsFoundMessage),
|
|
9265
9407
|
isDisabled: props.isDisabled || businessUnitsByFieldFetcher.isLoading,
|
|
9266
9408
|
isReadOnly: props.isReadOnly,
|
|
9267
9409
|
isClearable: props.isClearable,
|
|
@@ -9288,8 +9430,8 @@ BusinessUnitSearchSelectInput.defaultProps = {
|
|
|
9288
9430
|
shouldFetchProductSelections: false
|
|
9289
9431
|
};
|
|
9290
9432
|
|
|
9291
|
-
function ownKeys$
|
|
9292
|
-
function _objectSpread$
|
|
9433
|
+
function ownKeys$C(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; }
|
|
9434
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$C(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$C(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9293
9435
|
const BusinessUnitSelectInput = props => {
|
|
9294
9436
|
const totalNumberOfBusinessUnitsFetcher = useTotalNumberOfBusinessUnitsFetcher();
|
|
9295
9437
|
const components = useMemo(() => {
|
|
@@ -9297,7 +9439,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9297
9439
|
// eslint-disable-next-line react/display-name
|
|
9298
9440
|
Option: optionInnerProps => {
|
|
9299
9441
|
if (optionInnerProps.isDisabled) {
|
|
9300
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
9442
|
+
return jsx(SelectInput.Option, _objectSpread$C({}, optionInnerProps));
|
|
9301
9443
|
}
|
|
9302
9444
|
return jsx(CustomSelectInputOption, {
|
|
9303
9445
|
optionType: props.optionType,
|
|
@@ -9308,7 +9450,7 @@ const BusinessUnitSelectInput = props => {
|
|
|
9308
9450
|
}, [props.optionType]);
|
|
9309
9451
|
if (totalNumberOfBusinessUnitsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
9310
9452
|
const CustomSelectInput = totalNumberOfBusinessUnitsFetcher.total <= props.lowerBusinessUnitsLimit ? BusinessUnitBasicSelectInput : totalNumberOfBusinessUnitsFetcher.total <= props.upperBusinessUnitsLimit ? BusinessUnitAsyncSelectInput : BusinessUnitSearchSelectInput;
|
|
9311
|
-
return jsx(CustomSelectInput, _objectSpread$
|
|
9453
|
+
return jsx(CustomSelectInput, _objectSpread$C(_objectSpread$C({
|
|
9312
9454
|
id: props.id,
|
|
9313
9455
|
name: props.name,
|
|
9314
9456
|
components: components,
|
|
@@ -9349,7 +9491,7 @@ BusinessUnitSelectInput.defaultProps = {
|
|
|
9349
9491
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
9350
9492
|
const businessRoleKeys = ['ExecutiveManagement', 'BusinessIntelligence', 'BuyingPlanningAndInventoryManagement', 'DataQualityAndContentManagement', 'CustomerService', 'FinanceAndAccounting', 'LegalAndPeople', 'LogisticsAndSupplyChain', 'FulfillmentAndOperationsManagement', 'OfflineRetailStore', 'Marketing', 'BusinessDevSalesAndAccountManagement', 'UXUIDesign', 'TechProductManagement', 'TechProjectAndProgramManagement', 'SoftwareDevelopmentAndSolutionsArchitect', 'OperationsITAndSupportEngineering', 'Other'];
|
|
9351
9493
|
|
|
9352
|
-
var messages$
|
|
9494
|
+
var messages$v = defineMessages({
|
|
9353
9495
|
ExecutiveManagement: {
|
|
9354
9496
|
id: 'Shared.businessRoles.executiveManagement',
|
|
9355
9497
|
description: 'The label for one of the selectable business roles',
|
|
@@ -9442,6 +9584,571 @@ var messages$r = defineMessages({
|
|
|
9442
9584
|
}
|
|
9443
9585
|
});
|
|
9444
9586
|
|
|
9587
|
+
const safelyAddFallback = function (string) {
|
|
9588
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NO_VALUE_FALLBACK;
|
|
9589
|
+
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
9590
|
+
};
|
|
9591
|
+
|
|
9592
|
+
const ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES = 'businessUnitsAssociateRoles';
|
|
9593
|
+
|
|
9594
|
+
const ASSOCIATE_ROLE_SOURCES = {
|
|
9595
|
+
EXPLICIT: 'Explicit',
|
|
9596
|
+
INHERITED: 'Inherited'
|
|
9597
|
+
};
|
|
9598
|
+
const SEARCH_FIELDS = {
|
|
9599
|
+
ALL_FIELDS: 'allFields',
|
|
9600
|
+
NAME: 'name',
|
|
9601
|
+
EMAIL: 'email'
|
|
9602
|
+
};
|
|
9603
|
+
|
|
9604
|
+
var messages$u = defineMessages({
|
|
9605
|
+
allFieldsFilterOption: {
|
|
9606
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.allFields',
|
|
9607
|
+
description: 'Label for the filter option all fields',
|
|
9608
|
+
defaultMessage: 'All fields'
|
|
9609
|
+
},
|
|
9610
|
+
allFieldsFilterPlaceholder: {
|
|
9611
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.allFields',
|
|
9612
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9613
|
+
defaultMessage: 'Search by name or email'
|
|
9614
|
+
},
|
|
9615
|
+
emailFilterOption: {
|
|
9616
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.email',
|
|
9617
|
+
description: 'Label for the filter option email',
|
|
9618
|
+
defaultMessage: 'Email'
|
|
9619
|
+
},
|
|
9620
|
+
emailFilterPlaceholder: {
|
|
9621
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.email',
|
|
9622
|
+
description: 'Label for the searchbar placeholder for all fields option',
|
|
9623
|
+
defaultMessage: 'Search by email'
|
|
9624
|
+
},
|
|
9625
|
+
nameFilterOption: {
|
|
9626
|
+
id: 'BusinessUnitAssociatesListSearch.filterOption.name',
|
|
9627
|
+
description: 'Label for the filter option name',
|
|
9628
|
+
defaultMessage: 'Name'
|
|
9629
|
+
},
|
|
9630
|
+
nameFilterPlaceholder: {
|
|
9631
|
+
id: 'BusinessUnitAssociatesListSearch.filterPlaceholder.name',
|
|
9632
|
+
description: 'Label for the searchbar placeholder for name option',
|
|
9633
|
+
defaultMessage: 'Search by name'
|
|
9634
|
+
}
|
|
9635
|
+
});
|
|
9636
|
+
|
|
9637
|
+
function ownKeys$B(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; }
|
|
9638
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$B(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$B(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9639
|
+
const BusinessUnitAssociatesSearchbar = props => {
|
|
9640
|
+
const intl = useIntl();
|
|
9641
|
+
const searchOptions = useMemo(() => [{
|
|
9642
|
+
value: SEARCH_FIELDS.ALL_FIELDS,
|
|
9643
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterOption")])
|
|
9644
|
+
}, {
|
|
9645
|
+
value: SEARCH_FIELDS.NAME,
|
|
9646
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterOption")])
|
|
9647
|
+
}, {
|
|
9648
|
+
value: SEARCH_FIELDS.EMAIL,
|
|
9649
|
+
label: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterOption")])
|
|
9650
|
+
}], [intl]);
|
|
9651
|
+
const seachPlaceholderMessages = useMemo(() => ({
|
|
9652
|
+
[SEARCH_FIELDS.ALL_FIELDS]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.ALL_FIELDS, "FilterPlaceholder")]),
|
|
9653
|
+
[SEARCH_FIELDS.EMAIL]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.EMAIL, "FilterPlaceholder")]),
|
|
9654
|
+
[SEARCH_FIELDS.NAME]: intl.formatMessage(messages$u["".concat(SEARCH_FIELDS.NAME, "FilterPlaceholder")])
|
|
9655
|
+
}), [intl]);
|
|
9656
|
+
const _useState = useState({
|
|
9657
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9658
|
+
text: ''
|
|
9659
|
+
}),
|
|
9660
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9661
|
+
searchValue = _useState2[0],
|
|
9662
|
+
setSearchValue = _useState2[1];
|
|
9663
|
+
return jsx(SelectableSearchInput, {
|
|
9664
|
+
horizontalConstraint: 15,
|
|
9665
|
+
isDisabled: props.isDisabled,
|
|
9666
|
+
onChange: event => {
|
|
9667
|
+
var _context;
|
|
9668
|
+
if (_endsWithInstanceProperty(_context = event.target.id).call(_context, 'dropdown')) {
|
|
9669
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9670
|
+
option: event.target.value
|
|
9671
|
+
}));
|
|
9672
|
+
} else {
|
|
9673
|
+
setSearchValue(_objectSpread$B(_objectSpread$B({}, searchValue), {}, {
|
|
9674
|
+
text: event.target.value
|
|
9675
|
+
}));
|
|
9676
|
+
}
|
|
9677
|
+
},
|
|
9678
|
+
onReset: () => {
|
|
9679
|
+
setSearchValue({
|
|
9680
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9681
|
+
text: ''
|
|
9682
|
+
});
|
|
9683
|
+
props.onSubmit({
|
|
9684
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9685
|
+
text: ''
|
|
9686
|
+
});
|
|
9687
|
+
},
|
|
9688
|
+
onSubmit: props.onSubmit,
|
|
9689
|
+
options: searchOptions,
|
|
9690
|
+
placeholder: seachPlaceholderMessages[searchValue.option],
|
|
9691
|
+
value: searchValue
|
|
9692
|
+
});
|
|
9693
|
+
};
|
|
9694
|
+
BusinessUnitAssociatesSearchbar.displayName = 'BusinessUnitAssociatesSearchbar';
|
|
9695
|
+
|
|
9696
|
+
var messages$t = defineMessages({
|
|
9697
|
+
addAnAssociate: {
|
|
9698
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.addAnAssociate',
|
|
9699
|
+
description: 'The label for add an associate link button',
|
|
9700
|
+
defaultMessage: 'Add an associate'
|
|
9701
|
+
},
|
|
9702
|
+
noAssociates: {
|
|
9703
|
+
id: 'Shared.BusinessUnitAssociates.EmptyListMessage.noAssociates',
|
|
9704
|
+
description: 'The message displayed when there are no associates available',
|
|
9705
|
+
defaultMessage: 'There are no associates.'
|
|
9706
|
+
}
|
|
9707
|
+
});
|
|
9708
|
+
|
|
9709
|
+
const EmptyListMessage = props => {
|
|
9710
|
+
const intl = useIntl();
|
|
9711
|
+
return jsxs(Spacings.Inset, {
|
|
9712
|
+
scale: "xs",
|
|
9713
|
+
children: [jsxs(Spacings.Stack, {
|
|
9714
|
+
scale: "l",
|
|
9715
|
+
children: [jsx(Divider, {
|
|
9716
|
+
size: "m"
|
|
9717
|
+
}), jsx(Text.Body, {
|
|
9718
|
+
intlMessage: messages$t.noAssociates
|
|
9719
|
+
})]
|
|
9720
|
+
}), jsx(FlatButton, {
|
|
9721
|
+
isDisabled: !props.canManageBusinessUnits,
|
|
9722
|
+
label: intl.formatMessage(messages$t.addAnAssociate),
|
|
9723
|
+
onClick: props.onAddAssociateClick,
|
|
9724
|
+
tone: "primary"
|
|
9725
|
+
})]
|
|
9726
|
+
});
|
|
9727
|
+
};
|
|
9728
|
+
EmptyListMessage.displayName = 'EmptyListMessage';
|
|
9729
|
+
|
|
9730
|
+
var messages$s = defineMessages({
|
|
9731
|
+
noResultsTitle: {
|
|
9732
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsTitle',
|
|
9733
|
+
description: 'Message for no search result for customers.',
|
|
9734
|
+
defaultMessage: 'There are no results that match your search and/or filter combination.'
|
|
9735
|
+
},
|
|
9736
|
+
noResultsSuggestionsTitle: {
|
|
9737
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestionsTitle',
|
|
9738
|
+
description: 'Suggestions title',
|
|
9739
|
+
defaultMessage: 'Suggestions:'
|
|
9740
|
+
},
|
|
9741
|
+
noResultsSuggestion1: {
|
|
9742
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion1',
|
|
9743
|
+
description: 'One of suggestions when no results are found.',
|
|
9744
|
+
defaultMessage: 'Make sure to select the search field in the dropdown next to the search input.'
|
|
9745
|
+
},
|
|
9746
|
+
noResultsSuggestion2: {
|
|
9747
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion2',
|
|
9748
|
+
description: 'One of suggestions when no results are found.',
|
|
9749
|
+
defaultMessage: 'Check the spelling, search by entering the exact value.'
|
|
9750
|
+
},
|
|
9751
|
+
noResultsSuggestion3: {
|
|
9752
|
+
id: 'Shared.BusinessUnitAssociates.emptySearchResultsMessage.noResultsSuggestion3',
|
|
9753
|
+
description: 'One of suggestions when no results are found.',
|
|
9754
|
+
defaultMessage: 'Use the filter to search for further values.'
|
|
9755
|
+
}
|
|
9756
|
+
});
|
|
9757
|
+
|
|
9758
|
+
const EmptySearchResultsMessage = () => jsx(Spacings.Inset, {
|
|
9759
|
+
scale: "xs",
|
|
9760
|
+
children: jsxs(Spacings.Stack, {
|
|
9761
|
+
scale: "s",
|
|
9762
|
+
children: [jsx(Text.Body, {
|
|
9763
|
+
tone: "secondary",
|
|
9764
|
+
intlMessage: messages$s.noResultsTitle,
|
|
9765
|
+
isBold: true
|
|
9766
|
+
}), jsx(Text.Body, {
|
|
9767
|
+
tone: "secondary",
|
|
9768
|
+
intlMessage: messages$s.noResultsSuggestionsTitle
|
|
9769
|
+
}), jsxs("ul", {
|
|
9770
|
+
children: [jsx("li", {
|
|
9771
|
+
children: jsx(Text.Body, {
|
|
9772
|
+
intlMessage: messages$s.noResultsSuggestion1,
|
|
9773
|
+
tone: "secondary"
|
|
9774
|
+
})
|
|
9775
|
+
}), jsx("li", {
|
|
9776
|
+
children: jsx(Text.Body, {
|
|
9777
|
+
intlMessage: messages$s.noResultsSuggestion2,
|
|
9778
|
+
tone: "secondary"
|
|
9779
|
+
})
|
|
9780
|
+
}), jsx("li", {
|
|
9781
|
+
children: jsx(Text.Body, {
|
|
9782
|
+
intlMessage: messages$s.noResultsSuggestion3,
|
|
9783
|
+
tone: "secondary"
|
|
9784
|
+
})
|
|
9785
|
+
})]
|
|
9786
|
+
})]
|
|
9787
|
+
})
|
|
9788
|
+
});
|
|
9789
|
+
EmptySearchResultsMessage.displayName = 'EmptySearchResultsMessage';
|
|
9790
|
+
|
|
9791
|
+
const filterByAllFields = (associates, searchValue) => {
|
|
9792
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9793
|
+
return _filterInstanceProperty(associates).call(associates, associate => {
|
|
9794
|
+
return _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9795
|
+
var _context, _context2, _context3;
|
|
9796
|
+
return _includesInstanceProperty(_context = associate.customer.firstName.toLowerCase()).call(_context, term) || _includesInstanceProperty(_context2 = associate.customer.lastName.toLowerCase()).call(_context2, term) || _includesInstanceProperty(_context3 = associate.customer.email.toLowerCase()).call(_context3, term);
|
|
9797
|
+
});
|
|
9798
|
+
});
|
|
9799
|
+
};
|
|
9800
|
+
const filterByEmail = (associates, searchValue) => {
|
|
9801
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9802
|
+
return _filterInstanceProperty(associates).call(associates, associate => _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9803
|
+
var _context4;
|
|
9804
|
+
return _includesInstanceProperty(_context4 = associate.customer.email.toLowerCase()).call(_context4, term);
|
|
9805
|
+
}));
|
|
9806
|
+
};
|
|
9807
|
+
const filterByName = (associates, searchValue) => {
|
|
9808
|
+
const searchTextTerms = searchValue.text.toLowerCase().split(' ');
|
|
9809
|
+
return _filterInstanceProperty(associates).call(associates, associate => {
|
|
9810
|
+
return _someInstanceProperty(searchTextTerms).call(searchTextTerms, term => {
|
|
9811
|
+
var _context5, _context6;
|
|
9812
|
+
return _includesInstanceProperty(_context5 = associate.customer.firstName.toLowerCase()).call(_context5, term) || _includesInstanceProperty(_context6 = associate.customer.lastName.toLowerCase()).call(_context6, term);
|
|
9813
|
+
});
|
|
9814
|
+
});
|
|
9815
|
+
};
|
|
9816
|
+
const FILTER_FUNCTIONS = {
|
|
9817
|
+
[SEARCH_FIELDS.ALL_FIELDS]: filterByAllFields,
|
|
9818
|
+
[SEARCH_FIELDS.EMAIL]: filterByEmail,
|
|
9819
|
+
[SEARCH_FIELDS.NAME]: filterByName
|
|
9820
|
+
};
|
|
9821
|
+
const filterAssociates = (associates, searchValue) => FILTER_FUNCTIONS[searchValue.option](associates, searchValue);
|
|
9822
|
+
|
|
9823
|
+
const mergeOverwritten = (inherited, explicit) => {
|
|
9824
|
+
var _context;
|
|
9825
|
+
const onlyExplicit = differenceBy(explicit.associateRoleAssignments, inherited.associateRoleAssignments, 'associateRole.key') || [];
|
|
9826
|
+
const onlyInherited = differenceBy(inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9827
|
+
const overwritten = intersectionBy(inherited.associateRoleAssignments, explicit.associateRoleAssignments, 'associateRole.key') || [];
|
|
9828
|
+
const allExplicit = _mapInstanceProperty(_context = _concatInstanceProperty(onlyExplicit).call(onlyExplicit, overwritten)).call(_context, _ref => {
|
|
9829
|
+
let associateRole = _ref.associateRole;
|
|
9830
|
+
return {
|
|
9831
|
+
name: associateRole.name || associateRole.key,
|
|
9832
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9833
|
+
};
|
|
9834
|
+
});
|
|
9835
|
+
const allInherited = _mapInstanceProperty(onlyInherited).call(onlyInherited, _ref2 => {
|
|
9836
|
+
let associateRole = _ref2.associateRole;
|
|
9837
|
+
return {
|
|
9838
|
+
name: associateRole.name || associateRole.key,
|
|
9839
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9840
|
+
};
|
|
9841
|
+
});
|
|
9842
|
+
return {
|
|
9843
|
+
id: inherited.customer.id,
|
|
9844
|
+
customer: inherited.customer,
|
|
9845
|
+
roles: _concatInstanceProperty(allExplicit).call(allExplicit, allInherited)
|
|
9846
|
+
};
|
|
9847
|
+
};
|
|
9848
|
+
const mergeAssociates = businessUnit => {
|
|
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);
|
|
9852
|
+
const overwrittenOnExplicit = intersectionBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
9853
|
+
const overwrittenOnInherited = intersectionBy(inheritedAssociates, associates, 'customer.id') || [];
|
|
9854
|
+
const onlyExplicit = differenceBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
9855
|
+
const onlyInherited = differenceBy(inheritedAssociates, associates, 'customer.id') || [];
|
|
9856
|
+
const explicit = _mapInstanceProperty(onlyExplicit).call(onlyExplicit, associate => {
|
|
9857
|
+
var _associate$associateR;
|
|
9858
|
+
return {
|
|
9859
|
+
id: associate.customer.id,
|
|
9860
|
+
customer: associate.customer,
|
|
9861
|
+
roles: (_associate$associateR = associate.associateRoleAssignments) === null || _associate$associateR === void 0 ? void 0 : _mapInstanceProperty(_associate$associateR).call(_associate$associateR, _ref3 => {
|
|
9862
|
+
let associateRole = _ref3.associateRole;
|
|
9863
|
+
return {
|
|
9864
|
+
name: associateRole.name || associateRole.key,
|
|
9865
|
+
source: ASSOCIATE_ROLE_SOURCES.EXPLICIT
|
|
9866
|
+
};
|
|
9867
|
+
})
|
|
9868
|
+
};
|
|
9869
|
+
});
|
|
9870
|
+
const inherited = _mapInstanceProperty(onlyInherited).call(onlyInherited, associate => {
|
|
9871
|
+
var _associate$associateR2;
|
|
9872
|
+
return {
|
|
9873
|
+
id: associate.customer.id,
|
|
9874
|
+
customer: associate.customer,
|
|
9875
|
+
roles: (_associate$associateR2 = associate.associateRoleAssignments) === null || _associate$associateR2 === void 0 ? void 0 : _mapInstanceProperty(_associate$associateR2).call(_associate$associateR2, _ref4 => {
|
|
9876
|
+
let associateRole = _ref4.associateRole;
|
|
9877
|
+
return {
|
|
9878
|
+
name: associateRole.name || associateRole.key,
|
|
9879
|
+
source: ASSOCIATE_ROLE_SOURCES.INHERITED
|
|
9880
|
+
};
|
|
9881
|
+
})
|
|
9882
|
+
};
|
|
9883
|
+
});
|
|
9884
|
+
const overwritten = _mapInstanceProperty(overwrittenOnInherited).call(overwrittenOnInherited, inherited => {
|
|
9885
|
+
const explicit = _findInstanceProperty(overwrittenOnExplicit).call(overwrittenOnExplicit, explicitAssociate => explicitAssociate.customer.id === inherited.customer.id);
|
|
9886
|
+
return mergeOverwritten(inherited, explicit);
|
|
9887
|
+
});
|
|
9888
|
+
return _concatInstanceProperty(_context2 = _concatInstanceProperty(explicit).call(explicit, inherited)).call(_context2, overwritten);
|
|
9889
|
+
};
|
|
9890
|
+
|
|
9891
|
+
var messages$r = defineMessages({
|
|
9892
|
+
columnFirstName: {
|
|
9893
|
+
id: 'Shared.BusinessUnitAssociates.columnFirstName',
|
|
9894
|
+
description: 'The column label (First name)',
|
|
9895
|
+
defaultMessage: 'First name'
|
|
9896
|
+
},
|
|
9897
|
+
columnLastName: {
|
|
9898
|
+
id: 'Shared.BusinessUnitAssociates.columnLastName',
|
|
9899
|
+
description: 'The column label (Last name)',
|
|
9900
|
+
defaultMessage: 'Last name'
|
|
9901
|
+
},
|
|
9902
|
+
columnRole: {
|
|
9903
|
+
id: 'Shared.BusinessUnitAssociates.columnRole',
|
|
9904
|
+
description: 'The column label (Role)',
|
|
9905
|
+
defaultMessage: 'Role'
|
|
9906
|
+
},
|
|
9907
|
+
columnEmail: {
|
|
9908
|
+
id: 'Shared.BusinessUnitAssociates.columnEmail',
|
|
9909
|
+
description: 'The column label (Email)',
|
|
9910
|
+
defaultMessage: 'Email'
|
|
9911
|
+
},
|
|
9912
|
+
companyUnitType: {
|
|
9913
|
+
id: 'Shared.BusinessUnitAssociates.unitType.company',
|
|
9914
|
+
description: 'Label for the business unit type company',
|
|
9915
|
+
defaultMessage: 'Company'
|
|
9916
|
+
},
|
|
9917
|
+
divisionUnitType: {
|
|
9918
|
+
id: 'Shared.BusinessUnitAssociates.unitType.division',
|
|
9919
|
+
description: 'Label for the business unit type division',
|
|
9920
|
+
defaultMessage: 'Division'
|
|
9921
|
+
},
|
|
9922
|
+
labelExplicit: {
|
|
9923
|
+
id: 'Shared.BusinessUnitAssociates.labelExplicit',
|
|
9924
|
+
description: 'Label for explicit roles',
|
|
9925
|
+
defaultMessage: 'Explicit'
|
|
9926
|
+
},
|
|
9927
|
+
labelInherited: {
|
|
9928
|
+
id: 'Shared.BusinessUnitAssociates.labelInherited',
|
|
9929
|
+
description: 'Label for explicit roles',
|
|
9930
|
+
defaultMessage: 'Inherited'
|
|
9931
|
+
},
|
|
9932
|
+
roleEnumAdmin: {
|
|
9933
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.admin',
|
|
9934
|
+
description: 'Label for the business unit associate rol Admin',
|
|
9935
|
+
defaultMessage: 'Admin'
|
|
9936
|
+
},
|
|
9937
|
+
roleEnumBuyer: {
|
|
9938
|
+
id: 'Shared.BusinessUnitAssociates.associateRole.buyer',
|
|
9939
|
+
description: 'Label for the business unit associate rol Buyer',
|
|
9940
|
+
defaultMessage: 'Buyer'
|
|
9941
|
+
},
|
|
9942
|
+
searchResultsCount: {
|
|
9943
|
+
id: 'Shared.BusinessUnitAssociates.searchResultsCount',
|
|
9944
|
+
description: 'Total results coming from search',
|
|
9945
|
+
defaultMessage: '{totalResults} results'
|
|
9946
|
+
}
|
|
9947
|
+
});
|
|
9948
|
+
|
|
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; }
|
|
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; }
|
|
9951
|
+
const BusinessUnitAssociatesListView = props => {
|
|
9952
|
+
var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
|
|
9953
|
+
const intl = useIntl();
|
|
9954
|
+
const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
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);
|
|
9956
|
+
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
9957
|
+
const _usePaginationState = usePaginationState({
|
|
9958
|
+
perPage: 20
|
|
9959
|
+
}),
|
|
9960
|
+
page = _usePaginationState.page,
|
|
9961
|
+
perPage = _usePaginationState.perPage;
|
|
9962
|
+
const _useState = useState({
|
|
9963
|
+
option: SEARCH_FIELDS.ALL_FIELDS,
|
|
9964
|
+
text: ''
|
|
9965
|
+
}),
|
|
9966
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9967
|
+
searchValue = _useState2[0],
|
|
9968
|
+
setSearchValue = _useState2[1];
|
|
9969
|
+
const associates = useMemo(() => {
|
|
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), {}, {
|
|
9972
|
+
id: associate.customer.id
|
|
9973
|
+
}));
|
|
9974
|
+
}, [_valuesInstanceProperty(props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
9975
|
+
const tableColumns = useMemo(() => [{
|
|
9976
|
+
key: 'firstName',
|
|
9977
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnFirstName)),
|
|
9978
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9979
|
+
}, {
|
|
9980
|
+
key: 'lastName',
|
|
9981
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnLastName)),
|
|
9982
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9983
|
+
}, {
|
|
9984
|
+
key: 'roles',
|
|
9985
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnRole)),
|
|
9986
|
+
shouldIgnoreRowClick: isBusinessUnitCreation,
|
|
9987
|
+
width: 'max-content'
|
|
9988
|
+
}, {
|
|
9989
|
+
key: 'email',
|
|
9990
|
+
label: jsx(FormattedMessage, _objectSpread$A({}, messages$r.columnEmail)),
|
|
9991
|
+
shouldIgnoreRowClick: isBusinessUnitCreation
|
|
9992
|
+
}], [isBusinessUnitCreation]);
|
|
9993
|
+
const filteredAssociates = useMemo(() => {
|
|
9994
|
+
return filterAssociates(associates, searchValue);
|
|
9995
|
+
}, [associates, searchValue]);
|
|
9996
|
+
const associatesToShow = useMemo(() => {
|
|
9997
|
+
const from = (page.value - 1) * perPage.value;
|
|
9998
|
+
const to = from + perPage.value;
|
|
9999
|
+
return _sliceInstanceProperty(filteredAssociates).call(filteredAssociates, from, to);
|
|
10000
|
+
}, [filteredAssociates, perPage.value, page.value]);
|
|
10001
|
+
const renderAssociate = (associate, _ref) => {
|
|
10002
|
+
let columnKey = _ref.key;
|
|
10003
|
+
let formattedValue;
|
|
10004
|
+
if (!(associate !== null && associate !== void 0 && associate.customer)) return null;
|
|
10005
|
+
switch (columnKey) {
|
|
10006
|
+
case 'roles':
|
|
10007
|
+
const roles = associate[columnKey];
|
|
10008
|
+
formattedValue = jsx(Fragment, {
|
|
10009
|
+
children: (roles === null || roles === void 0 ? void 0 : roles.length) > 0 ? businessUnitsAssociateRolesFeatureEnabled ? jsx(Grid, {
|
|
10010
|
+
gridGap: customProperties.spacingM,
|
|
10011
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
10012
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty(roles).call(roles, (associateRole, index) => {
|
|
10013
|
+
return jsxs(Fragment, {
|
|
10014
|
+
children: [jsx(Grid.Item, {
|
|
10015
|
+
children: jsx(Text.Detail, {
|
|
10016
|
+
children: associateRole.name
|
|
10017
|
+
}, associateRole.name)
|
|
10018
|
+
}, "role-grid-item-".concat(index)), jsx(Grid.Item, {
|
|
10019
|
+
children: jsx(Stamp, {
|
|
10020
|
+
isCondensed: true,
|
|
10021
|
+
label: intl.formatMessage(messages$r["label".concat(associateRole.source)]),
|
|
10022
|
+
tone: associateRole.source === ASSOCIATE_ROLE_SOURCES.EXPLICIT ? 'information' : 'secondary'
|
|
10023
|
+
})
|
|
10024
|
+
}, "".concat(associateRole.name, "-source"))]
|
|
10025
|
+
});
|
|
10026
|
+
})
|
|
10027
|
+
}) : jsx(Spacings.Inline, {
|
|
10028
|
+
children: roles === null || roles === void 0 ? void 0 : _mapInstanceProperty(roles).call(roles, role => jsx(Stamp, {
|
|
10029
|
+
isCondensed: true,
|
|
10030
|
+
label: intl.formatMessage(messages$r["roleEnum".concat(role)]),
|
|
10031
|
+
tone: "primary"
|
|
10032
|
+
}, role))
|
|
10033
|
+
}) : NO_VALUE_FALLBACK
|
|
10034
|
+
});
|
|
10035
|
+
break;
|
|
10036
|
+
default:
|
|
10037
|
+
formattedValue = associate.customer[columnKey] || NO_VALUE_FALLBACK;
|
|
10038
|
+
}
|
|
10039
|
+
return safelyAddFallback(formattedValue);
|
|
10040
|
+
};
|
|
10041
|
+
return jsx(PageContentFull, {
|
|
10042
|
+
children: jsx(Spacings.Stack, {
|
|
10043
|
+
scale: "m",
|
|
10044
|
+
children: totalAssociates ? jsxs(Spacings.Stack, {
|
|
10045
|
+
scale: "s",
|
|
10046
|
+
children: [jsxs(Spacings.Inline, {
|
|
10047
|
+
alignItems: "center",
|
|
10048
|
+
scale: "l",
|
|
10049
|
+
children: [jsx(BusinessUnitAssociatesSearchbar, {
|
|
10050
|
+
onSubmit: setSearchValue
|
|
10051
|
+
}), searchValue.text.length > 0 && jsx(Text.Body, {
|
|
10052
|
+
intlMessage: _objectSpread$A(_objectSpread$A({}, messages$r.searchResultsCount), {}, {
|
|
10053
|
+
values: {
|
|
10054
|
+
totalResults: filteredAssociates.length
|
|
10055
|
+
}
|
|
10056
|
+
})
|
|
10057
|
+
})]
|
|
10058
|
+
}), filteredAssociates.length ? jsxs(Spacings.Stack, {
|
|
10059
|
+
scale: "xxxl",
|
|
10060
|
+
children: [jsx(Constraints.Horizontal, {
|
|
10061
|
+
max: "scale",
|
|
10062
|
+
children: jsx(DataTable, {
|
|
10063
|
+
columns: tableColumns,
|
|
10064
|
+
itemRenderer: renderAssociate,
|
|
10065
|
+
maxHeight: "calc(100vh - (".concat(customProperties.constraint7, " + 240px))"),
|
|
10066
|
+
onRowClick: (_, rowIndex) => {
|
|
10067
|
+
var _associate$customer;
|
|
10068
|
+
const associate = associates[rowIndex];
|
|
10069
|
+
if (isBusinessUnitCreation || !(associate !== null && associate !== void 0 && associate.id) || !(associate !== null && associate !== void 0 && (_associate$customer = associate.customer) !== null && _associate$customer !== void 0 && _associate$customer.id)) return;
|
|
10070
|
+
props.onAssociateRowClick({
|
|
10071
|
+
customerId: associate.customer.id
|
|
10072
|
+
});
|
|
10073
|
+
},
|
|
10074
|
+
rows: associatesToShow,
|
|
10075
|
+
wrapHeaderLabels: false
|
|
10076
|
+
})
|
|
10077
|
+
}), jsx(Pagination, {
|
|
10078
|
+
onPageChange: page.onChange,
|
|
10079
|
+
onPerPageChange: perPage.onChange,
|
|
10080
|
+
page: page.value,
|
|
10081
|
+
perPage: perPage.value,
|
|
10082
|
+
perPageRange: "m",
|
|
10083
|
+
totalItems: filteredAssociates.length
|
|
10084
|
+
})]
|
|
10085
|
+
}) : jsx(EmptySearchResultsMessage, {})]
|
|
10086
|
+
}) : jsx(EmptyListMessage, {
|
|
10087
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
10088
|
+
onAddAssociateClick: props.onAddAssociateClick
|
|
10089
|
+
})
|
|
10090
|
+
})
|
|
10091
|
+
});
|
|
10092
|
+
};
|
|
10093
|
+
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
10094
|
+
|
|
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 } } } };
|
|
10096
|
+
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
10097
|
+
let id = _ref.id,
|
|
10098
|
+
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
10099
|
+
shouldExcludeAssociateRoleAssignmentsRoles = _ref.shouldExcludeAssociateRoleAssignmentsRoles;
|
|
10100
|
+
const _useQuery = useQuery$1(BusinessUnitAssociatesQuery, {
|
|
10101
|
+
context: {
|
|
10102
|
+
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
10103
|
+
},
|
|
10104
|
+
variables: {
|
|
10105
|
+
id,
|
|
10106
|
+
shouldExcludeRoles,
|
|
10107
|
+
shouldExcludeAssociateRoleAssignmentsRoles
|
|
10108
|
+
}
|
|
10109
|
+
}),
|
|
10110
|
+
loading = _useQuery.loading,
|
|
10111
|
+
data = _useQuery.data;
|
|
10112
|
+
return {
|
|
10113
|
+
isLoading: loading,
|
|
10114
|
+
businessUnit: data === null || data === void 0 ? void 0 : data.businessUnit
|
|
10115
|
+
};
|
|
10116
|
+
};
|
|
10117
|
+
|
|
10118
|
+
const useBusinessUnitAssociates = _ref => {
|
|
10119
|
+
let businessUnitId = _ref.businessUnitId,
|
|
10120
|
+
businessUnitsAssociateRolesFeatureEnabled = _ref.businessUnitsAssociateRolesFeatureEnabled;
|
|
10121
|
+
const businessUnitAssociatesFetcher = useBusinessUnitAssociatesFetcher({
|
|
10122
|
+
id: businessUnitId,
|
|
10123
|
+
shouldExcludeRoles: businessUnitsAssociateRolesFeatureEnabled,
|
|
10124
|
+
shouldExcludeAssociateRoleAssignmentsRoles: !businessUnitsAssociateRolesFeatureEnabled
|
|
10125
|
+
});
|
|
10126
|
+
return {
|
|
10127
|
+
businessUnitAssociatesFetcher: {
|
|
10128
|
+
isLoading: businessUnitAssociatesFetcher.isLoading,
|
|
10129
|
+
businessUnit: businessUnitAssociatesFetcher.businessUnit
|
|
10130
|
+
}
|
|
10131
|
+
};
|
|
10132
|
+
};
|
|
10133
|
+
|
|
10134
|
+
const BusinessUnitAssociatesList = props => {
|
|
10135
|
+
const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
10136
|
+
const _useBusinessUnitAssoc = useBusinessUnitAssociates({
|
|
10137
|
+
businessUnitId: props.businessUnitId,
|
|
10138
|
+
businessUnitsAssociateRolesFeatureEnabled
|
|
10139
|
+
}),
|
|
10140
|
+
businessUnitAssociatesFetcher = _useBusinessUnitAssoc.businessUnitAssociatesFetcher;
|
|
10141
|
+
if (businessUnitAssociatesFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
10142
|
+
return jsx(BusinessUnitAssociatesListView, {
|
|
10143
|
+
businessUnitId: props.businessUnitId,
|
|
10144
|
+
canManageBusinessUnits: props.canManageBusinessUnits,
|
|
10145
|
+
onAddAssociateClick: props.onAddAssociateClick,
|
|
10146
|
+
onAssociateRowClick: props.onAssociateRowClick,
|
|
10147
|
+
values: businessUnitAssociatesFetcher === null || businessUnitAssociatesFetcher === void 0 ? void 0 : businessUnitAssociatesFetcher.businessUnit
|
|
10148
|
+
});
|
|
10149
|
+
};
|
|
10150
|
+
BusinessUnitAssociatesList.displayName = 'BusinessUnitAssociatesList';
|
|
10151
|
+
|
|
9445
10152
|
function formatDiscount(discount, currencyCode, intl) {
|
|
9446
10153
|
var _context;
|
|
9447
10154
|
if (discount.type === 'relative') return "".concat(discount.permyriad / 100, "%");
|
|
@@ -9579,17 +10286,17 @@ function validateFilter(_ref, intl) {
|
|
|
9579
10286
|
_ref$allowFloat = _ref.allowFloat,
|
|
9580
10287
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9581
10288
|
if (type !== 'range') {
|
|
9582
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
10289
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$O.integer);
|
|
9583
10290
|
return null;
|
|
9584
10291
|
}
|
|
9585
10292
|
|
|
9586
10293
|
// only range types from here
|
|
9587
10294
|
|
|
9588
10295
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9589
|
-
from: intl.formatMessage(messages$
|
|
10296
|
+
from: intl.formatMessage(messages$O.integer)
|
|
9590
10297
|
};
|
|
9591
10298
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9592
|
-
to: intl.formatMessage(messages$
|
|
10299
|
+
to: intl.formatMessage(messages$O.integer)
|
|
9593
10300
|
};
|
|
9594
10301
|
if (validateSingleFilter({
|
|
9595
10302
|
value: value.from
|
|
@@ -10077,9 +10784,16 @@ function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
10077
10784
|
const PlatformLimitsStatusText = _ref => {
|
|
10078
10785
|
let intlMessage = _ref.intlMessage,
|
|
10079
10786
|
children = _ref.children;
|
|
10080
|
-
return
|
|
10081
|
-
as: "
|
|
10082
|
-
children:
|
|
10787
|
+
return jsx(Text.Headline, {
|
|
10788
|
+
as: "h2",
|
|
10789
|
+
children: jsxs(Spacings.Inline, {
|
|
10790
|
+
size: "xs",
|
|
10791
|
+
children: [jsx("span", {
|
|
10792
|
+
children: intlMessage && jsx(FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
10793
|
+
}), jsx("span", {
|
|
10794
|
+
children: children
|
|
10795
|
+
})]
|
|
10796
|
+
})
|
|
10083
10797
|
});
|
|
10084
10798
|
};
|
|
10085
10799
|
PlatformLimitsStatusText.displayName = 'PlatformLimitsStatusText';
|
|
@@ -10203,7 +10917,7 @@ var messages$k = defineMessages({
|
|
|
10203
10917
|
});
|
|
10204
10918
|
|
|
10205
10919
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
10206
|
-
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4
|
|
10920
|
+
var _platformLimits$shipp, _platformLimits$shipp2, _platformLimits$shipp3, _platformLimits$shipp4;
|
|
10207
10921
|
let total = _ref.total;
|
|
10208
10922
|
const intl = useIntl();
|
|
10209
10923
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
@@ -10211,12 +10925,13 @@ const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
|
10211
10925
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 ? void 0 : (_platformLimits$shipp2 = _platformLimits$shipp.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.current;
|
|
10212
10926
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp3 = platformLimits.shippingMethods) === null || _platformLimits$shipp3 === void 0 ? void 0 : (_platformLimits$shipp4 = _platformLimits$shipp3.total) === null || _platformLimits$shipp4 === void 0 ? void 0 : _platformLimits$shipp4.limit;
|
|
10213
10927
|
return jsx(PlatformLimitsStatusText, {
|
|
10214
|
-
|
|
10928
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
10929
|
+
children: getPlatformLimitsStatus({
|
|
10215
10930
|
limit,
|
|
10216
10931
|
current,
|
|
10217
10932
|
total,
|
|
10218
10933
|
intl
|
|
10219
|
-
})
|
|
10934
|
+
})
|
|
10220
10935
|
});
|
|
10221
10936
|
};
|
|
10222
10937
|
PlatformLimitsShippingMethodsStatus.displayName = 'PlatformLimitsShippingMethodsStatus';
|
|
@@ -10349,7 +11064,7 @@ var messages$i = defineMessages({
|
|
|
10349
11064
|
});
|
|
10350
11065
|
|
|
10351
11066
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
10352
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4
|
|
11067
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2, _platformLimits$taxCa3, _platformLimits$taxCa4;
|
|
10353
11068
|
let total = _ref.total;
|
|
10354
11069
|
const intl = useIntl();
|
|
10355
11070
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
@@ -10357,12 +11072,13 @@ const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
|
10357
11072
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 ? void 0 : (_platformLimits$taxCa2 = _platformLimits$taxCa.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.current;
|
|
10358
11073
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa3 = platformLimits.taxCategories) === null || _platformLimits$taxCa3 === void 0 ? void 0 : (_platformLimits$taxCa4 = _platformLimits$taxCa3.total) === null || _platformLimits$taxCa4 === void 0 ? void 0 : _platformLimits$taxCa4.limit;
|
|
10359
11074
|
return jsx(PlatformLimitsStatusText, {
|
|
10360
|
-
|
|
11075
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
11076
|
+
children: getPlatformLimitsStatus({
|
|
10361
11077
|
limit,
|
|
10362
11078
|
current,
|
|
10363
11079
|
total,
|
|
10364
11080
|
intl
|
|
10365
|
-
})
|
|
11081
|
+
})
|
|
10366
11082
|
});
|
|
10367
11083
|
};
|
|
10368
11084
|
PlatformLimitsTaxCategoriesStatus.displayName = 'PlatformLimitsTaxCategoriesStatus';
|
|
@@ -10490,12 +11206,12 @@ var messages$g = defineMessages({
|
|
|
10490
11206
|
zonesStatus: {
|
|
10491
11207
|
id: 'PlatformLimits.Status.zones',
|
|
10492
11208
|
description: 'The message for zones platform limit values',
|
|
10493
|
-
defaultMessage: 'Zones
|
|
11209
|
+
defaultMessage: 'Zones'
|
|
10494
11210
|
}
|
|
10495
11211
|
});
|
|
10496
11212
|
|
|
10497
11213
|
const PlatformLimitsZonesStatus = _ref => {
|
|
10498
|
-
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4
|
|
11214
|
+
var _platformLimits$zones, _platformLimits$zones2, _platformLimits$zones3, _platformLimits$zones4;
|
|
10499
11215
|
let total = _ref.total;
|
|
10500
11216
|
const intl = useIntl();
|
|
10501
11217
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
@@ -10503,12 +11219,13 @@ const PlatformLimitsZonesStatus = _ref => {
|
|
|
10503
11219
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 ? void 0 : (_platformLimits$zones2 = _platformLimits$zones.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.current;
|
|
10504
11220
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones3 = platformLimits.zones) === null || _platformLimits$zones3 === void 0 ? void 0 : (_platformLimits$zones4 = _platformLimits$zones3.total) === null || _platformLimits$zones4 === void 0 ? void 0 : _platformLimits$zones4.limit;
|
|
10505
11221
|
return jsx(PlatformLimitsStatusText, {
|
|
10506
|
-
|
|
11222
|
+
intlMessage: messages$g.zonesStatus,
|
|
11223
|
+
children: getPlatformLimitsStatus({
|
|
10507
11224
|
limit,
|
|
10508
11225
|
current,
|
|
10509
11226
|
total,
|
|
10510
11227
|
intl
|
|
10511
|
-
})
|
|
11228
|
+
})
|
|
10512
11229
|
});
|
|
10513
11230
|
};
|
|
10514
11231
|
PlatformLimitsZonesStatus.displayName = 'PlatformLimitsZonesStatus';
|
|
@@ -11951,6 +12668,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
11951
12668
|
return jsx("div", {
|
|
11952
12669
|
className: styles$4.container,
|
|
11953
12670
|
children: jsx(SelectableSearchInput, {
|
|
12671
|
+
menuHorizontalConstraint: 5,
|
|
11954
12672
|
options: props.options,
|
|
11955
12673
|
value: {
|
|
11956
12674
|
text: searchText,
|
|
@@ -12111,7 +12829,7 @@ const validateRequired = value => {
|
|
|
12111
12829
|
};
|
|
12112
12830
|
const VALIDATOR_REQUIRED = {
|
|
12113
12831
|
name: 'required',
|
|
12114
|
-
message: messages$
|
|
12832
|
+
message: messages$O.required,
|
|
12115
12833
|
permanent: true,
|
|
12116
12834
|
validators: {
|
|
12117
12835
|
change(value) {
|
|
@@ -12125,7 +12843,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
12125
12843
|
};
|
|
12126
12844
|
const VALIDATOR_NUMERIC = {
|
|
12127
12845
|
name: 'numeric',
|
|
12128
|
-
message: messages$
|
|
12846
|
+
message: messages$O.numeric,
|
|
12129
12847
|
permanent: false,
|
|
12130
12848
|
validators: {
|
|
12131
12849
|
change: v => {
|
|
@@ -12140,7 +12858,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
12140
12858
|
};
|
|
12141
12859
|
const VALIDATOR_INTEGER = {
|
|
12142
12860
|
name: 'integer',
|
|
12143
|
-
message: messages$
|
|
12861
|
+
message: messages$O.integer,
|
|
12144
12862
|
permanent: false,
|
|
12145
12863
|
validators: {
|
|
12146
12864
|
change: v => {
|
|
@@ -12155,7 +12873,7 @@ const VALIDATOR_INTEGER = {
|
|
|
12155
12873
|
};
|
|
12156
12874
|
({
|
|
12157
12875
|
name: 'email',
|
|
12158
|
-
message: messages$
|
|
12876
|
+
message: messages$O.email,
|
|
12159
12877
|
permanent: false,
|
|
12160
12878
|
validators: {
|
|
12161
12879
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -13091,17 +13809,17 @@ function isValidISODateTime(_ref3) {
|
|
|
13091
13809
|
}
|
|
13092
13810
|
|
|
13093
13811
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
13094
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
13812
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$O.required);
|
|
13095
13813
|
return null;
|
|
13096
13814
|
};
|
|
13097
13815
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
13098
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
13816
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$O.required);
|
|
13099
13817
|
return null;
|
|
13100
13818
|
};
|
|
13101
13819
|
|
|
13102
13820
|
// eslint-disable-next-line import/prefer-default-export
|
|
13103
13821
|
const validateText = (text, intl) => {
|
|
13104
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
13822
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$O.required);
|
|
13105
13823
|
return null;
|
|
13106
13824
|
};
|
|
13107
13825
|
|
|
@@ -13183,11 +13901,6 @@ const not = function () {
|
|
|
13183
13901
|
};
|
|
13184
13902
|
};
|
|
13185
13903
|
|
|
13186
|
-
const safelyAddFallback = function (string) {
|
|
13187
|
-
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NO_VALUE_FALLBACK;
|
|
13188
|
-
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
13189
|
-
};
|
|
13190
|
-
|
|
13191
13904
|
var messages = defineMessages({
|
|
13192
13905
|
booleanAttributeTrue: {
|
|
13193
13906
|
id: 'Products.ProductList.column.booleanTrue',
|
|
@@ -13577,4 +14290,4 @@ function withPendingRequests() {
|
|
|
13577
14290
|
|
|
13578
14291
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, 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: "slugAllLocales" }, 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: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
13579
14292
|
|
|
13580
|
-
export { booleanField as BooleanField, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$
|
|
14293
|
+
export { booleanField as BooleanField, BusinessUnitAssociatesList, BusinessUnitAssociatesListView, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$v as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$4 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$5 as productSelectionsFetcherMockHandler, handlers$6 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$J as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$7 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, trackMenuClick, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, handlers$2 as useBusinessUnitsListFetcherMockHandler, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, handlers$1 as useTotalNumberOfBusinessUnitsFetcherHandlers, useTotalNumberOfStoresFetcher, handlers$3 as useTotalNumberOfStoresFetcherHandlers, useTracking, useTracking as useTrackingContext, useTrackingShared, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$O as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|