@commercetools-frontend/experimental-components 5.0.2 → 5.1.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 +692 -489
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +692 -489
- package/dist/commercetools-frontend-experimental-components.esm.js +685 -484
- package/dist/styles.css +251 -251
- package/package.json +18 -18
|
@@ -41,7 +41,7 @@ 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, SecondaryButton, RevertIcon, Grid, customProperties, SubdirectoryArrowIcon, Tag, IconButton, EditIcon, FieldLabel, WarningIcon, FlatButton, AngleUpIcon, AngleDownIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput, SelectableSearchInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
|
|
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, SecondaryButton, RevertIcon, Grid, customProperties, SubdirectoryArrowIcon, Tag, IconButton, EditIcon, FieldLabel, WarningIcon, FlatButton, AngleUpIcon, AngleDownIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput, SelectableSearchInput, SearchTextInput, CollapsiblePanel, designTokens } 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';
|
|
@@ -71,6 +71,7 @@ import { useAsyncDispatch, actions } from '@commercetools-frontend/sdk';
|
|
|
71
71
|
import { useApolloClient as useApolloClient$1, useQuery as useQuery$2 } from '@apollo/client';
|
|
72
72
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
73
73
|
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
74
|
+
import _parseFloat from '@babel/runtime-corejs3/core-js-stable/parse-float';
|
|
74
75
|
import omit from 'lodash/omit';
|
|
75
76
|
import isEmpty$3 from 'lodash/isEmpty';
|
|
76
77
|
import _Object$freeze from '@babel/runtime-corejs3/core-js-stable/object/freeze';
|
|
@@ -97,7 +98,6 @@ import { ErrorMessage } from '@commercetools-frontend/ui-kit/';
|
|
|
97
98
|
import { CustomSelectInputOption } from '@commercetools-uikit/select-utils';
|
|
98
99
|
import memoize from 'memoize-one';
|
|
99
100
|
import { filterAriaAttributes, filterDataAttributes as filterDataAttributes$1 } from '@commercetools-uikit/utils';
|
|
100
|
-
import _parseFloat from '@babel/runtime-corejs3/core-js-stable/parse-float';
|
|
101
101
|
import flatMap from 'lodash/flatMap';
|
|
102
102
|
import { connect } from 'react-redux';
|
|
103
103
|
import { oneLineTrim } from 'common-tags';
|
|
@@ -294,7 +294,7 @@ function uniqueObjects(items) {
|
|
|
294
294
|
|
|
295
295
|
*/
|
|
296
296
|
|
|
297
|
-
const messages$
|
|
297
|
+
const messages$K = defineMessages({
|
|
298
298
|
unique: {
|
|
299
299
|
id: 'Validation.unique',
|
|
300
300
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1589,8 +1589,8 @@ const getData = (code, field) => {
|
|
|
1589
1589
|
};
|
|
1590
1590
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1591
1591
|
|
|
1592
|
-
function ownKeys$
|
|
1593
|
-
function _objectSpread$
|
|
1592
|
+
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; }
|
|
1593
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1k(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1k(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1594
1594
|
function formatMoneyRangeValue(value, intl) {
|
|
1595
1595
|
var _context;
|
|
1596
1596
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1600,7 +1600,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1600
1600
|
return '';
|
|
1601
1601
|
}
|
|
1602
1602
|
function formatMoneyValue(amount, currency, intl) {
|
|
1603
|
-
return formatMoney$1(_objectSpread$
|
|
1603
|
+
return formatMoney$1(_objectSpread$1k({
|
|
1604
1604
|
centAmount: amount,
|
|
1605
1605
|
fractionDigits: getFractionDigit(currency)
|
|
1606
1606
|
}, currency ? {
|
|
@@ -1617,14 +1617,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1617
1617
|
}
|
|
1618
1618
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1619
1619
|
var _moneyValue$fractione;
|
|
1620
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1620
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1k({
|
|
1621
1621
|
style: 'currency',
|
|
1622
1622
|
currency: moneyValue.currencyCode,
|
|
1623
1623
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1624
1624
|
}, options));
|
|
1625
1625
|
}
|
|
1626
1626
|
|
|
1627
|
-
var messages$
|
|
1627
|
+
var messages$J = defineMessages({
|
|
1628
1628
|
booleanYes: {
|
|
1629
1629
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1630
1630
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1709,7 +1709,7 @@ const formatDateTime = _ref7 => {
|
|
|
1709
1709
|
const formatBoolean = _ref8 => {
|
|
1710
1710
|
let value = _ref8.value,
|
|
1711
1711
|
intl = _ref8.intl;
|
|
1712
|
-
return value ? intl.formatMessage(messages$
|
|
1712
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1713
1713
|
};
|
|
1714
1714
|
const formatNilType = _ref9 => {
|
|
1715
1715
|
let value = _ref9.value,
|
|
@@ -1871,8 +1871,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1871
1871
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1872
1872
|
};
|
|
1873
1873
|
|
|
1874
|
-
function ownKeys$
|
|
1875
|
-
function _objectSpread$
|
|
1874
|
+
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; }
|
|
1875
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1876
1876
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1877
1877
|
const WithDataTablePaginationState = props => {
|
|
1878
1878
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1883,10 +1883,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1883
1883
|
page = _usePaginationState.page,
|
|
1884
1884
|
perPage = _usePaginationState.perPage;
|
|
1885
1885
|
const tableSorting = useDataTableSortingState({
|
|
1886
|
-
key: initialValues === null || initialValues === void 0
|
|
1887
|
-
order: initialValues === null || initialValues === void 0
|
|
1886
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1887
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1888
1888
|
});
|
|
1889
|
-
return jsx(Component, _objectSpread$
|
|
1889
|
+
return jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1890
1890
|
dataTablePaginationState: {
|
|
1891
1891
|
page,
|
|
1892
1892
|
perPage,
|
|
@@ -1898,8 +1898,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1898
1898
|
return WithDataTablePaginationState;
|
|
1899
1899
|
};
|
|
1900
1900
|
|
|
1901
|
-
function ownKeys$
|
|
1902
|
-
function _objectSpread$
|
|
1901
|
+
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; }
|
|
1902
|
+
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; }
|
|
1903
1903
|
const injectNotifications = function () {
|
|
1904
1904
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1905
1905
|
return Component => {
|
|
@@ -1914,7 +1914,7 @@ const injectNotifications = function () {
|
|
|
1914
1914
|
onActionError,
|
|
1915
1915
|
hideAllPageNotifications
|
|
1916
1916
|
};
|
|
1917
|
-
return jsx(Component, _objectSpread$
|
|
1917
|
+
return jsx(Component, _objectSpread$1i(_objectSpread$1i({}, props), {}, {
|
|
1918
1918
|
[propName]: notifications
|
|
1919
1919
|
}));
|
|
1920
1920
|
};
|
|
@@ -1923,22 +1923,22 @@ const injectNotifications = function () {
|
|
|
1923
1923
|
};
|
|
1924
1924
|
};
|
|
1925
1925
|
|
|
1926
|
-
function ownKeys$
|
|
1927
|
-
function _objectSpread$
|
|
1926
|
+
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; }
|
|
1927
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1928
1928
|
function isPropsMapper(mapProps) {
|
|
1929
1929
|
return typeof mapProps === 'function';
|
|
1930
1930
|
}
|
|
1931
1931
|
const withProps = mapProps => Component => {
|
|
1932
1932
|
const EnhancedWithProps = ownProps => {
|
|
1933
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1934
|
-
return jsx(Component, _objectSpread$
|
|
1933
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps(ownProps)) : _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps);
|
|
1934
|
+
return jsx(Component, _objectSpread$1h({}, enhancedProps));
|
|
1935
1935
|
};
|
|
1936
1936
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1937
1937
|
return EnhancedWithProps;
|
|
1938
1938
|
};
|
|
1939
1939
|
|
|
1940
|
-
function ownKeys$
|
|
1941
|
-
function _objectSpread$
|
|
1940
|
+
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; }
|
|
1941
|
+
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; }
|
|
1942
1942
|
const useRedirectEffect = _ref => {
|
|
1943
1943
|
let goTo = _ref.goTo;
|
|
1944
1944
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1958,30 +1958,30 @@ const defaultOptions$5 = {
|
|
|
1958
1958
|
skip: () => false
|
|
1959
1959
|
};
|
|
1960
1960
|
const withRedirectTo = options => Component => {
|
|
1961
|
-
const mergedOptions = _objectSpread$
|
|
1961
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$5), options);
|
|
1962
1962
|
const WithRedirectTo = props => {
|
|
1963
1963
|
if (!mergedOptions.skip(props)) {
|
|
1964
1964
|
return jsx(RedirectTo, {
|
|
1965
1965
|
goTo: options.selectGoTo(props)
|
|
1966
1966
|
});
|
|
1967
1967
|
}
|
|
1968
|
-
return jsx(Component, _objectSpread$
|
|
1968
|
+
return jsx(Component, _objectSpread$1g({}, props));
|
|
1969
1969
|
};
|
|
1970
1970
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1971
1971
|
return WithRedirectTo;
|
|
1972
1972
|
};
|
|
1973
1973
|
|
|
1974
|
-
function ownKeys$
|
|
1975
|
-
function _objectSpread$
|
|
1974
|
+
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; }
|
|
1975
|
+
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; }
|
|
1976
1976
|
const defaultOptions$4 = {
|
|
1977
1977
|
propName: 'modalState',
|
|
1978
1978
|
isInitiallyOpen: false
|
|
1979
1979
|
};
|
|
1980
1980
|
const injectModalState$1 = options => Component => {
|
|
1981
|
-
const mergedOptions = _objectSpread$
|
|
1981
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$4), options);
|
|
1982
1982
|
const WithModalState = props => {
|
|
1983
1983
|
const modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
1984
|
-
return jsx(Component, _objectSpread$
|
|
1984
|
+
return jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
1985
1985
|
[mergedOptions.propName]: modalState
|
|
1986
1986
|
}));
|
|
1987
1987
|
};
|
|
@@ -1989,17 +1989,17 @@ const injectModalState$1 = options => Component => {
|
|
|
1989
1989
|
return WithModalState;
|
|
1990
1990
|
};
|
|
1991
1991
|
|
|
1992
|
-
function ownKeys$
|
|
1993
|
-
function _objectSpread$
|
|
1992
|
+
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; }
|
|
1993
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1994
1994
|
const defaultOptions$3 = {
|
|
1995
1995
|
propName: 'toggleState',
|
|
1996
1996
|
isInitiallyOpen: false
|
|
1997
1997
|
};
|
|
1998
1998
|
const injectModalState = options => Component => {
|
|
1999
|
-
const mergedOptions = _objectSpread$
|
|
1999
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$3), options);
|
|
2000
2000
|
const WithToggleState = props => {
|
|
2001
2001
|
const toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2002
|
-
return jsx(Component, _objectSpread$
|
|
2002
|
+
return jsx(Component, _objectSpread$1e(_objectSpread$1e({}, props), {}, {
|
|
2003
2003
|
[mergedOptions.propName]: toggleState
|
|
2004
2004
|
}));
|
|
2005
2005
|
};
|
|
@@ -2007,8 +2007,8 @@ const injectModalState = options => Component => {
|
|
|
2007
2007
|
return WithToggleState;
|
|
2008
2008
|
};
|
|
2009
2009
|
|
|
2010
|
-
function ownKeys$
|
|
2011
|
-
function _objectSpread$
|
|
2010
|
+
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; }
|
|
2011
|
+
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; }
|
|
2012
2012
|
const defaultOptions$2 = {
|
|
2013
2013
|
storageType: 'local',
|
|
2014
2014
|
segregateByUser: true
|
|
@@ -2026,7 +2026,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2026
2026
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2027
2027
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2028
2028
|
var _context;
|
|
2029
|
-
const mergedOptions = _objectSpread$
|
|
2029
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$2), options);
|
|
2030
2030
|
const userId = useApplicationContext(context => {
|
|
2031
2031
|
var _context$user;
|
|
2032
2032
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2074,8 +2074,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2074
2074
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2075
2075
|
};
|
|
2076
2076
|
|
|
2077
|
-
function ownKeys$
|
|
2078
|
-
function _objectSpread$
|
|
2077
|
+
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; }
|
|
2078
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2079
2079
|
const defaultOptions$1 = {
|
|
2080
2080
|
propName: 'storage',
|
|
2081
2081
|
storageKey: '',
|
|
@@ -2088,7 +2088,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2088
2088
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2089
2089
|
* argument position does not allow passing specification of option(s).
|
|
2090
2090
|
*/
|
|
2091
|
-
const mergedOptions = _objectSpread$
|
|
2091
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$1), options);
|
|
2092
2092
|
const WithStorage = props => {
|
|
2093
2093
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2094
2094
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2102,7 +2102,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2102
2102
|
readFromStorage
|
|
2103
2103
|
}
|
|
2104
2104
|
};
|
|
2105
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2105
|
+
return jsx(WrappedComponent, _objectSpread$1c(_objectSpread$1c({}, props), storageProp));
|
|
2106
2106
|
};
|
|
2107
2107
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2108
2108
|
return WithStorage;
|
|
@@ -2146,8 +2146,8 @@ const usePrevious = value => {
|
|
|
2146
2146
|
return ref.current;
|
|
2147
2147
|
};
|
|
2148
2148
|
|
|
2149
|
-
function ownKeys$
|
|
2150
|
-
function _objectSpread$
|
|
2149
|
+
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; }
|
|
2150
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1b(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2151
2151
|
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: "type" }, 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: 1089, 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 type\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2152
2152
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2153
2153
|
var _storesQueryResult$re;
|
|
@@ -2158,7 +2158,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2158
2158
|
offset: storesQueryResult.offset,
|
|
2159
2159
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2160
2160
|
var _store$productSelecti;
|
|
2161
|
-
return _objectSpread$
|
|
2161
|
+
return _objectSpread$1b(_objectSpread$1b({}, store), {}, {
|
|
2162
2162
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2163
2163
|
});
|
|
2164
2164
|
})
|
|
@@ -2166,7 +2166,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2166
2166
|
};
|
|
2167
2167
|
const createQueryVariables$6 = ownProps => {
|
|
2168
2168
|
var _context;
|
|
2169
|
-
return _objectSpread$
|
|
2169
|
+
return _objectSpread$1b(_objectSpread$1b({
|
|
2170
2170
|
limit: ownProps.limit,
|
|
2171
2171
|
offset: ownProps.offset,
|
|
2172
2172
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2321,8 +2321,8 @@ function useDidFormValidationFail() {
|
|
|
2321
2321
|
return Boolean(didFormValidationFail);
|
|
2322
2322
|
}
|
|
2323
2323
|
|
|
2324
|
-
function ownKeys$
|
|
2325
|
-
function _objectSpread$
|
|
2324
|
+
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; }
|
|
2325
|
+
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; }
|
|
2326
2326
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2327
2327
|
const defaultOptions = {
|
|
2328
2328
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2350,7 +2350,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2350
2350
|
};
|
|
2351
2351
|
const usePersistedReminder = function () {
|
|
2352
2352
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2353
|
-
const mergedOptions = _objectSpread$
|
|
2353
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions), options);
|
|
2354
2354
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2355
2355
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2356
2356
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2396,7 +2396,7 @@ const usePersistedReminder = function () {
|
|
|
2396
2396
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2397
2397
|
};
|
|
2398
2398
|
|
|
2399
|
-
var messages$
|
|
2399
|
+
var messages$I = defineMessages({
|
|
2400
2400
|
profileUpdated: {
|
|
2401
2401
|
id: 'NotificationText.profileUpdated',
|
|
2402
2402
|
description: 'Label for the notification header',
|
|
@@ -2414,8 +2414,8 @@ var messages$H = defineMessages({
|
|
|
2414
2414
|
}
|
|
2415
2415
|
});
|
|
2416
2416
|
|
|
2417
|
-
function ownKeys$
|
|
2418
|
-
function _objectSpread$
|
|
2417
|
+
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; }
|
|
2418
|
+
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; }
|
|
2419
2419
|
const LinkToProfile = props => {
|
|
2420
2420
|
return jsx(Link, {
|
|
2421
2421
|
to: "/account/profile",
|
|
@@ -2433,9 +2433,9 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2433
2433
|
children: [jsx(Text.Body, {
|
|
2434
2434
|
as: "p",
|
|
2435
2435
|
isBold: true,
|
|
2436
|
-
intlMessage: messages$
|
|
2436
|
+
intlMessage: messages$I.profileUpdated
|
|
2437
2437
|
}), jsx(Text.Body, {
|
|
2438
|
-
intlMessage: _objectSpread$
|
|
2438
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.addMoreInformation), {}, {
|
|
2439
2439
|
values: {
|
|
2440
2440
|
newline: getNewLine
|
|
2441
2441
|
}
|
|
@@ -2444,7 +2444,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2444
2444
|
}), jsx(Spacings.Stack, {
|
|
2445
2445
|
scale: "xs",
|
|
2446
2446
|
children: jsx(Text.Body, {
|
|
2447
|
-
intlMessage: _objectSpread$
|
|
2447
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.informationAndProfileLink), {}, {
|
|
2448
2448
|
values: {
|
|
2449
2449
|
newline: getNewLine,
|
|
2450
2450
|
link: getLinkToProfile
|
|
@@ -2565,7 +2565,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2565
2565
|
}, [ref]);
|
|
2566
2566
|
};
|
|
2567
2567
|
|
|
2568
|
-
var messages$
|
|
2568
|
+
var messages$H = defineMessages({
|
|
2569
2569
|
fallbackHint: {
|
|
2570
2570
|
id: 'KeyFallback.fallbackHint',
|
|
2571
2571
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2589,7 +2589,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2589
2589
|
return values => {
|
|
2590
2590
|
if (!values.resource) return null;
|
|
2591
2591
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2592
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2592
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2593
2593
|
key: values.resource.key
|
|
2594
2594
|
});
|
|
2595
2595
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2601,8 +2601,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2601
2601
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2602
2602
|
useCallback(debounce(promiseCallback, wait), [promiseCallback]);
|
|
2603
2603
|
|
|
2604
|
-
function ownKeys$
|
|
2605
|
-
function _objectSpread$
|
|
2604
|
+
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; }
|
|
2605
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$18(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$18(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2606
2606
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2607
2607
|
const updatedColumnProps = {};
|
|
2608
2608
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2622,14 +2622,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2622
2622
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2623
2623
|
return _mapInstanceProperty(_context = _filterInstanceProperty(cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2624
2624
|
const initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2625
|
-
return _objectSpread$
|
|
2625
|
+
return _objectSpread$18(_objectSpread$18({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2626
2626
|
});
|
|
2627
2627
|
};
|
|
2628
2628
|
const handleCacheUpdate = _ref2 => {
|
|
2629
2629
|
let update = _ref2.update,
|
|
2630
2630
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2631
2631
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2632
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2632
|
+
return updateCachedTableConfiguration(_objectSpread$18(_objectSpread$18({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2633
2633
|
};
|
|
2634
2634
|
|
|
2635
2635
|
// Signature:
|
|
@@ -2658,7 +2658,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2658
2658
|
return {
|
|
2659
2659
|
columnsConfig: _mapInstanceProperty(initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2660
2660
|
const visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2661
|
-
return _objectSpread$
|
|
2661
|
+
return _objectSpread$18({
|
|
2662
2662
|
key: visibleColumnKey
|
|
2663
2663
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2664
2664
|
}),
|
|
@@ -2714,7 +2714,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2714
2714
|
data = _useQuery.data;
|
|
2715
2715
|
return {
|
|
2716
2716
|
isLoading: loading,
|
|
2717
|
-
total: data === null || data === void 0
|
|
2717
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2718
2718
|
};
|
|
2719
2719
|
};
|
|
2720
2720
|
|
|
@@ -2729,14 +2729,14 @@ const handlers$4 = {
|
|
|
2729
2729
|
}
|
|
2730
2730
|
};
|
|
2731
2731
|
|
|
2732
|
-
function ownKeys$
|
|
2733
|
-
function _objectSpread$
|
|
2732
|
+
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; }
|
|
2733
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$17(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$17(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2734
2734
|
|
|
2735
2735
|
// eslint-disable-next-line import/prefer-default-export
|
|
2736
2736
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2737
2737
|
var _context;
|
|
2738
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2739
|
-
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2738
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
|
|
2739
|
+
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$17({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2740
2740
|
from: 'nameAllLocales',
|
|
2741
2741
|
to: 'name'
|
|
2742
2742
|
}])))
|
|
@@ -2886,7 +2886,7 @@ const CenteredLoadingSpinner = () => jsx("div", {
|
|
|
2886
2886
|
});
|
|
2887
2887
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2888
2888
|
|
|
2889
|
-
var messages$
|
|
2889
|
+
var messages$G = defineMessages({
|
|
2890
2890
|
noChannelsFound: {
|
|
2891
2891
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2892
2892
|
description: 'The message to display when no channels were found',
|
|
@@ -2912,8 +2912,8 @@ var commonPickerMessages = defineMessages({
|
|
|
2912
2912
|
}
|
|
2913
2913
|
});
|
|
2914
2914
|
|
|
2915
|
-
function ownKeys$
|
|
2916
|
-
function _objectSpread$
|
|
2915
|
+
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; }
|
|
2916
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$16(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$16(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2917
2917
|
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 } } } };
|
|
2918
2918
|
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 } } } };
|
|
2919
2919
|
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 } } } };
|
|
@@ -2934,7 +2934,7 @@ const ChannelPickerInput = _ref => {
|
|
|
2934
2934
|
const _useIntl = useIntl(),
|
|
2935
2935
|
formatMessage = _useIntl.formatMessage;
|
|
2936
2936
|
const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
2937
|
-
const variables = useMemo(() => _objectSpread$
|
|
2937
|
+
const variables = useMemo(() => _objectSpread$16({
|
|
2938
2938
|
sortByNamePath: "name.".concat(dataLocale)
|
|
2939
2939
|
}, role && {
|
|
2940
2940
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -2995,8 +2995,8 @@ const ChannelPickerInput = _ref => {
|
|
|
2995
2995
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
2996
2996
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
2997
2997
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
2998
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
2999
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
2998
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
2999
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
3000
3000
|
return jsx(Constraints.Horizontal, {
|
|
3001
3001
|
max: "scale",
|
|
3002
3002
|
children: jsxs(Spacings.Stack, {
|
|
@@ -3006,7 +3006,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3006
3006
|
children: jsx(AsyncSelectInput, {
|
|
3007
3007
|
id: name,
|
|
3008
3008
|
name: name,
|
|
3009
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3009
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3010
3010
|
loadOptions: loadOptionsDebounced,
|
|
3011
3011
|
defaultOptions: true,
|
|
3012
3012
|
showOptionGroupDivider: true,
|
|
@@ -3049,7 +3049,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3049
3049
|
var _this$props;
|
|
3050
3050
|
let user = _ref.user;
|
|
3051
3051
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3052
|
-
timeZone: (this === null || this === void 0
|
|
3052
|
+
timeZone: (this === null || this === void 0 || (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.timeZone) || (user === null || user === void 0 ? void 0 : user.timeZone),
|
|
3053
3053
|
locale: this.props.intl.locale
|
|
3054
3054
|
});
|
|
3055
3055
|
}
|
|
@@ -3063,8 +3063,8 @@ var FormattedDateTime$1 = injectIntl(FormattedDateTime);
|
|
|
3063
3063
|
|
|
3064
3064
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3065
3065
|
|
|
3066
|
-
function ownKeys$
|
|
3067
|
-
function _objectSpread$
|
|
3066
|
+
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; }
|
|
3067
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$15(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$15(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3068
3068
|
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); }; }
|
|
3069
3069
|
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; } }
|
|
3070
3070
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3096,7 +3096,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3096
3096
|
handleMouseOver: this.handleMouseOver,
|
|
3097
3097
|
handleMouseOut: this.handleMouseOut
|
|
3098
3098
|
};
|
|
3099
|
-
return jsx(BaseComponent, _objectSpread$
|
|
3099
|
+
return jsx(BaseComponent, _objectSpread$15({}, _objectSpread$15(_objectSpread$15({}, this.props), injectedProps)));
|
|
3100
3100
|
}
|
|
3101
3101
|
}]);
|
|
3102
3102
|
return WithMouseOverState;
|
|
@@ -3105,8 +3105,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3105
3105
|
return WithMouseOverState;
|
|
3106
3106
|
};
|
|
3107
3107
|
|
|
3108
|
-
function ownKeys$
|
|
3109
|
-
function _objectSpread$
|
|
3108
|
+
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; }
|
|
3109
|
+
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; }
|
|
3110
3110
|
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); }; }
|
|
3111
3111
|
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; } }
|
|
3112
3112
|
var styles$h = {
|
|
@@ -3217,7 +3217,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3217
3217
|
}, {
|
|
3218
3218
|
key: "render",
|
|
3219
3219
|
value: function render() {
|
|
3220
|
-
const commonProps = _objectSpread$
|
|
3220
|
+
const commonProps = _objectSpread$14(_objectSpread$14({
|
|
3221
3221
|
value: this.state.draftValue,
|
|
3222
3222
|
autoComplete: this.props.autoComplete,
|
|
3223
3223
|
onChange: this.handleChange,
|
|
@@ -3236,7 +3236,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3236
3236
|
htmlFor: inputId,
|
|
3237
3237
|
children: this.props.label
|
|
3238
3238
|
})
|
|
3239
|
-
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$
|
|
3239
|
+
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3240
3240
|
id: inputId,
|
|
3241
3241
|
className: classnames(styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3242
3242
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3245,7 +3245,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3245
3245
|
rows: 1,
|
|
3246
3246
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3247
3247
|
cacheMeasurements: true
|
|
3248
|
-
})) : jsx("input", _objectSpread$
|
|
3248
|
+
})) : jsx("input", _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3249
3249
|
id: inputId,
|
|
3250
3250
|
ref: this.props.inputRef,
|
|
3251
3251
|
type: this.props.as,
|
|
@@ -3272,7 +3272,7 @@ ThrottledField.defaultProps = {
|
|
|
3272
3272
|
label: 'Throttled field'
|
|
3273
3273
|
};
|
|
3274
3274
|
|
|
3275
|
-
var messages$
|
|
3275
|
+
var messages$F = defineMessages({
|
|
3276
3276
|
buttonLabel: {
|
|
3277
3277
|
id: 'SearchInput.buttonLabel',
|
|
3278
3278
|
description: 'Label for "Search" button.',
|
|
@@ -3379,7 +3379,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3379
3379
|
"data-testid": this.props.testId || 'search-input',
|
|
3380
3380
|
value: this.state.text,
|
|
3381
3381
|
label: this.props.label,
|
|
3382
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3382
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3383
3383
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3384
3384
|
onChange: this.handleInputChange,
|
|
3385
3385
|
onEnter: this.handleEnter,
|
|
@@ -3472,7 +3472,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3472
3472
|
const fetchProductTypesFromPim = useCallback(async searchTerm => {
|
|
3473
3473
|
var _result$hits$map, _result$hits;
|
|
3474
3474
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3475
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3475
|
+
const ids = (_result$hits$map = result === null || result === void 0 || (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _mapInstanceProperty(_result$hits).call(_result$hits, hit => hit.id)) !== null && _result$hits$map !== void 0 ? _result$hits$map : [];
|
|
3476
3476
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3477
3477
|
if (ids.length === 0) {
|
|
3478
3478
|
return {
|
|
@@ -3555,7 +3555,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3555
3555
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3556
3556
|
};
|
|
3557
3557
|
const usePimStatus = () => {
|
|
3558
|
-
var _data$indicesExist
|
|
3558
|
+
var _data$indicesExist;
|
|
3559
3559
|
const _useQuery = useQuery(FetchIndicesExist$1, {
|
|
3560
3560
|
context: {
|
|
3561
3561
|
target: GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3565,7 +3565,7 @@ const usePimStatus = () => {
|
|
|
3565
3565
|
data = _useQuery.data;
|
|
3566
3566
|
return {
|
|
3567
3567
|
data,
|
|
3568
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3568
|
+
isProjectIndexed: Boolean(data === null || data === void 0 || (_data$indicesExist = data.indicesExist) === null || _data$indicesExist === void 0 || (_data$indicesExist = _data$indicesExist.productTypes) === null || _data$indicesExist === void 0 ? void 0 : _data$indicesExist.searchableIndexExists)
|
|
3569
3569
|
};
|
|
3570
3570
|
};
|
|
3571
3571
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3594,7 +3594,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3594
3594
|
};
|
|
3595
3595
|
};
|
|
3596
3596
|
|
|
3597
|
-
var messages$
|
|
3597
|
+
var messages$E = defineMessages({
|
|
3598
3598
|
bottomOption: {
|
|
3599
3599
|
id: 'Products.Pickers.bottomOption',
|
|
3600
3600
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3602,11 +3602,11 @@ var messages$D = defineMessages({
|
|
|
3602
3602
|
}
|
|
3603
3603
|
});
|
|
3604
3604
|
|
|
3605
|
-
function ownKeys$
|
|
3606
|
-
function _objectSpread$
|
|
3607
|
-
const getBottomOption =
|
|
3605
|
+
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; }
|
|
3606
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$13(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$13(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3607
|
+
const getBottomOption = formatMessage => ({
|
|
3608
3608
|
options: [{
|
|
3609
|
-
label: messages$
|
|
3609
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3610
3610
|
isBottomOption: true,
|
|
3611
3611
|
isDisabled: true
|
|
3612
3612
|
}]
|
|
@@ -3614,7 +3614,7 @@ const getBottomOption = () => ({
|
|
|
3614
3614
|
const Option$2 = props => {
|
|
3615
3615
|
const _useIntl = useIntl(),
|
|
3616
3616
|
formatMessage = _useIntl.formatMessage;
|
|
3617
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
3617
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$13(_objectSpread$13({}, props), {}, {
|
|
3618
3618
|
children: props.data.isBottomOption ? jsx(Text.Detail, {
|
|
3619
3619
|
tone: "secondary",
|
|
3620
3620
|
children: formatMessage(props.data.label)
|
|
@@ -3631,8 +3631,8 @@ const Option$2 = props => {
|
|
|
3631
3631
|
};
|
|
3632
3632
|
Option$2.displayName = 'Option';
|
|
3633
3633
|
|
|
3634
|
-
function ownKeys$
|
|
3635
|
-
function _objectSpread$
|
|
3634
|
+
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; }
|
|
3635
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$12(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$12(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3636
3636
|
const useHandlers = onChange => {
|
|
3637
3637
|
const _useState = useState(),
|
|
3638
3638
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3643,8 +3643,8 @@ const useHandlers = onChange => {
|
|
|
3643
3643
|
}, []);
|
|
3644
3644
|
const handleChange = useEventCallback(event => {
|
|
3645
3645
|
var _event$target$value;
|
|
3646
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3647
|
-
target: _objectSpread$
|
|
3646
|
+
const eventWithExtractedValue = _objectSpread$12(_objectSpread$12({}, event), {}, {
|
|
3647
|
+
target: _objectSpread$12(_objectSpread$12({}, event.target), {}, {
|
|
3648
3648
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3649
3649
|
})
|
|
3650
3650
|
});
|
|
@@ -3653,8 +3653,8 @@ const useHandlers = onChange => {
|
|
|
3653
3653
|
return [handleInputChange, handleChange];
|
|
3654
3654
|
};
|
|
3655
3655
|
|
|
3656
|
-
function ownKeys
|
|
3657
|
-
function _objectSpread
|
|
3656
|
+
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; }
|
|
3657
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$11(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$11(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3658
3658
|
const constructPrefixSearchPredicate = function () {
|
|
3659
3659
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3660
3660
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3697,7 +3697,7 @@ const useLoadOptions = _ref => {
|
|
|
3697
3697
|
}();
|
|
3698
3698
|
return client.query({
|
|
3699
3699
|
query,
|
|
3700
|
-
variables: _objectSpread
|
|
3700
|
+
variables: _objectSpread$11({
|
|
3701
3701
|
where
|
|
3702
3702
|
}, variables),
|
|
3703
3703
|
context: {
|
|
@@ -3751,7 +3751,7 @@ function useCurrentOption(_ref) {
|
|
|
3751
3751
|
};
|
|
3752
3752
|
}
|
|
3753
3753
|
|
|
3754
|
-
var messages$
|
|
3754
|
+
var messages$D = defineMessages({
|
|
3755
3755
|
noProductTypesFound: {
|
|
3756
3756
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3757
3757
|
description: 'The message to display when no product types were found',
|
|
@@ -3831,7 +3831,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3831
3831
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3832
3832
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3833
3833
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3834
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3834
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
3835
3835
|
return jsx(Constraints.Horizontal, {
|
|
3836
3836
|
max: "scale",
|
|
3837
3837
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -3841,7 +3841,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3841
3841
|
children: jsx(AsyncSelectInput, {
|
|
3842
3842
|
id: name,
|
|
3843
3843
|
name: name,
|
|
3844
|
-
placeholder: formatMessage(messages$
|
|
3844
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3845
3845
|
loadOptions: loadOptionsDebounced,
|
|
3846
3846
|
defaultOptions: [],
|
|
3847
3847
|
isClearable: isClearable,
|
|
@@ -3854,7 +3854,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3854
3854
|
onInputChange: handleInputChange,
|
|
3855
3855
|
onBlur: onBlur,
|
|
3856
3856
|
value: currentOption.data,
|
|
3857
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3857
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3858
3858
|
hasError: hasError || isLoadingFailed
|
|
3859
3859
|
})
|
|
3860
3860
|
}), isLoadingFailed && jsx(Text.Body, {
|
|
@@ -3866,7 +3866,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3866
3866
|
};
|
|
3867
3867
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3868
3868
|
|
|
3869
|
-
var messages$
|
|
3869
|
+
var messages$C = defineMessages({
|
|
3870
3870
|
noStatesFound: {
|
|
3871
3871
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3872
3872
|
description: 'The message to display when no states were found',
|
|
@@ -3950,8 +3950,8 @@ const StatePickerInput = _ref => {
|
|
|
3950
3950
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3951
3951
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3952
3952
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3953
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3954
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3953
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
3954
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
3955
3955
|
return jsx(Constraints.Horizontal, {
|
|
3956
3956
|
max: "scale",
|
|
3957
3957
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -3962,7 +3962,7 @@ const StatePickerInput = _ref => {
|
|
|
3962
3962
|
id: name,
|
|
3963
3963
|
name: name,
|
|
3964
3964
|
horizontalConstraint: "scale",
|
|
3965
|
-
placeholder: formatMessage(messages$
|
|
3965
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
3966
3966
|
loadOptions: loadOptionsDebounced,
|
|
3967
3967
|
defaultOptions: true,
|
|
3968
3968
|
showOptionGroupDivider: true,
|
|
@@ -3988,9 +3988,9 @@ const StatePickerInput = _ref => {
|
|
|
3988
3988
|
};
|
|
3989
3989
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
3990
3990
|
|
|
3991
|
-
function ownKeys$
|
|
3992
|
-
function _objectSpread$
|
|
3993
|
-
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$
|
|
3991
|
+
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; }
|
|
3992
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$10(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$10(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3993
|
+
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$10({
|
|
3994
3994
|
ref: ref,
|
|
3995
3995
|
style: {
|
|
3996
3996
|
display: 'block',
|
|
@@ -4128,8 +4128,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4128
4128
|
};
|
|
4129
4129
|
|
|
4130
4130
|
const _excluded = ["action"];
|
|
4131
|
-
function ownKeys
|
|
4132
|
-
function _objectSpread
|
|
4131
|
+
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; }
|
|
4132
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys$$(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys$$(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4133
4133
|
|
|
4134
4134
|
/**
|
|
4135
4135
|
* Checks if a value is a LocalizedString
|
|
@@ -4151,7 +4151,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4151
4151
|
*/
|
|
4152
4152
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4153
4153
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4154
|
-
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4154
|
+
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$$(_objectSpread$$({}, customFields), {}, {
|
|
4155
4155
|
[customField.name]: customField.value
|
|
4156
4156
|
}), {});
|
|
4157
4157
|
};
|
|
@@ -4175,7 +4175,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4175
4175
|
const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
|
|
4176
4176
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4177
4177
|
const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4178
|
-
return _objectSpread
|
|
4178
|
+
return _objectSpread$$(_objectSpread$$(_objectSpread$$({}, transformedData), parent ? {
|
|
4179
4179
|
parent
|
|
4180
4180
|
} : {}), ancestors ? {
|
|
4181
4181
|
ancestors
|
|
@@ -4286,7 +4286,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4286
4286
|
* as its dynamic content can not be typed in SDL for the mutation.
|
|
4287
4287
|
*/
|
|
4288
4288
|
const convertAction = (actionName, actionPayload) => {
|
|
4289
|
-
var _actionPayload$type, _context3, _actionPayload$shippi, _context4, _context5;
|
|
4289
|
+
var _actionPayload$type, _context3, _actionPayload$geoLoc, _actionPayload$geoLoc2, _actionPayload$shippi, _context4, _context5;
|
|
4290
4290
|
const getNameFromPayload = payload => {
|
|
4291
4291
|
// changeName for `Organizations`
|
|
4292
4292
|
if (typeof payload.name === 'string') return payload;
|
|
@@ -4372,6 +4372,17 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
4374
|
};
|
|
4375
|
+
case 'setGeoLocation':
|
|
4376
|
+
return {
|
|
4377
|
+
[actionName]: actionPayload !== null && actionPayload !== void 0 && actionPayload.geoLocation ? {
|
|
4378
|
+
geoLocation: {
|
|
4379
|
+
type: 'Point',
|
|
4380
|
+
coordinates: [_parseFloat((_actionPayload$geoLoc = actionPayload.geoLocation) === null || _actionPayload$geoLoc === void 0 ? void 0 : _actionPayload$geoLoc.longitude), _parseFloat((_actionPayload$geoLoc2 = actionPayload.geoLocation) === null || _actionPayload$geoLoc2 === void 0 ? void 0 : _actionPayload$geoLoc2.latitude)]
|
|
4381
|
+
}
|
|
4382
|
+
} : {
|
|
4383
|
+
undefined
|
|
4384
|
+
}
|
|
4385
|
+
};
|
|
4375
4386
|
case 'changeLabel':
|
|
4376
4387
|
return {
|
|
4377
4388
|
changeLabel: {
|
|
@@ -4389,7 +4400,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4389
4400
|
case 'addAttributeDefinition':
|
|
4390
4401
|
return {
|
|
4391
4402
|
[actionName]: {
|
|
4392
|
-
attributeDefinition: _objectSpread
|
|
4403
|
+
attributeDefinition: _objectSpread$$(_objectSpread$$({}, actionPayload.attribute), {}, {
|
|
4393
4404
|
label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4394
4405
|
inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4395
4406
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4485,7 +4496,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4485
4496
|
return {
|
|
4486
4497
|
[actionName]: {
|
|
4487
4498
|
attributeName: actionPayload.attributeName,
|
|
4488
|
-
value: _objectSpread
|
|
4499
|
+
value: _objectSpread$$(_objectSpread$$({}, actionPayload.value), {}, {
|
|
4489
4500
|
label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4490
4501
|
})
|
|
4491
4502
|
}
|
|
@@ -4494,7 +4505,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4494
4505
|
return {
|
|
4495
4506
|
[actionName]: {
|
|
4496
4507
|
attributeName: actionPayload.attributeName,
|
|
4497
|
-
newValue: _objectSpread
|
|
4508
|
+
newValue: _objectSpread$$(_objectSpread$$({}, actionPayload.newValue), {}, {
|
|
4498
4509
|
label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4499
4510
|
})
|
|
4500
4511
|
}
|
|
@@ -4521,7 +4532,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4521
4532
|
name: transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4522
4533
|
taxCategory: actionPayload.taxCategory,
|
|
4523
4534
|
money: {
|
|
4524
|
-
[actionPayload.money.type]: _objectSpread
|
|
4535
|
+
[actionPayload.money.type]: _objectSpread$$({
|
|
4525
4536
|
centAmount: actionPayload.money.centAmount,
|
|
4526
4537
|
currencyCode: actionPayload.money.currencyCode
|
|
4527
4538
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4556,7 +4567,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4556
4567
|
case 'addAddress':
|
|
4557
4568
|
case 'changeAddress':
|
|
4558
4569
|
{
|
|
4559
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4570
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4560
4571
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4561
4572
|
_ref3$fields = _ref3.fields,
|
|
4562
4573
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4569,15 +4580,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4569
4580
|
value: _JSON$stringify(value)
|
|
4570
4581
|
};
|
|
4571
4582
|
});
|
|
4572
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4583
|
+
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.custom) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.type) !== null && _actionPayload$addres2 !== void 0 && _actionPayload$addres2.id ? {
|
|
4573
4584
|
type: {
|
|
4574
4585
|
id: actionPayload.address.custom.type.id
|
|
4575
4586
|
},
|
|
4576
4587
|
fields: customFields
|
|
4577
4588
|
} : null;
|
|
4578
4589
|
return {
|
|
4579
|
-
[actionName]: _objectSpread
|
|
4580
|
-
address: _objectSpread
|
|
4590
|
+
[actionName]: _objectSpread$$(_objectSpread$$({}, actionPayload), {}, {
|
|
4591
|
+
address: _objectSpread$$(_objectSpread$$({}, omit(actionPayload.address, ['__typename'])), {}, {
|
|
4581
4592
|
custom
|
|
4582
4593
|
})
|
|
4583
4594
|
})
|
|
@@ -4623,8 +4634,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty(actions).c
|
|
|
4623
4634
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4624
4635
|
}, []);
|
|
4625
4636
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4626
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4627
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4637
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4638
|
+
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.result) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.errors) === null || _graphQlResponse$netw === void 0 ? void 0 : _graphQlResponse$netw.length) > 0) {
|
|
4628
4639
|
return graphQlResponse.networkError.result.errors;
|
|
4629
4640
|
}
|
|
4630
4641
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4653,26 +4664,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4653
4664
|
return originalOmitDeep(obj, fieldsToOmit);
|
|
4654
4665
|
}
|
|
4655
4666
|
|
|
4656
|
-
function ownKeys$
|
|
4657
|
-
function _objectSpread$
|
|
4667
|
+
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; }
|
|
4668
|
+
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; }
|
|
4658
4669
|
function getPriceChannelName(price) {
|
|
4659
4670
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4660
4671
|
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;
|
|
4661
4672
|
}
|
|
4662
4673
|
function getDiscountValue(price) {
|
|
4663
|
-
var _price$value, _price$value2, _price$discounted
|
|
4674
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4664
4675
|
let preciseAmount;
|
|
4665
4676
|
let fractionedAmount;
|
|
4666
4677
|
if (((_price$value = price.value) === null || _price$value === void 0 ? void 0 : _price$value.type) === PRECISION_TYPES.highPrecision && price.discounted.value.type === PRECISION_TYPES.highPrecision) {
|
|
4667
4678
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
4668
|
-
} 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
|
|
4679
|
+
} 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 || (_price$discounted = _price$discounted.value) === null || _price$discounted === void 0 ? void 0 : _price$discounted.type) === PRECISION_TYPES.centPrecision) {
|
|
4669
4680
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4670
4681
|
}
|
|
4671
|
-
return price.discounted ? _objectSpread$
|
|
4682
|
+
return price.discounted ? _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4672
4683
|
fractionedAmount,
|
|
4673
4684
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4674
4685
|
preciseAmount
|
|
4675
|
-
}) : _objectSpread$
|
|
4686
|
+
}) : _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4676
4687
|
centAmount: 0
|
|
4677
4688
|
});
|
|
4678
4689
|
}
|
|
@@ -4680,17 +4691,17 @@ function getSelectedPrice(price) {
|
|
|
4680
4691
|
return price.discounted ? price.discounted : price;
|
|
4681
4692
|
}
|
|
4682
4693
|
function getNetUnitPrice(_ref2) {
|
|
4683
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4694
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4684
4695
|
let lineItem = _ref2.lineItem,
|
|
4685
4696
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4686
4697
|
const price = getSelectedPrice(lineItem.price);
|
|
4687
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4688
|
-
var _lineItem$shippingDet
|
|
4689
|
-
return (lineItem === null || lineItem === void 0
|
|
4698
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 || (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty(_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4699
|
+
var _lineItem$shippingDet;
|
|
4700
|
+
return (lineItem === null || lineItem === void 0 || (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 || (_lineItem$shippingDet = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet === void 0 ? void 0 : _findIndexInstanceProperty(_lineItem$shippingDet).call(_lineItem$shippingDet, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
|
|
4690
4701
|
});
|
|
4691
4702
|
|
|
4692
4703
|
// when shipping mode is multi with the same tax rate
|
|
4693
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4704
|
+
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax !== void 0 && _filteredPerMethodTax.includedInPrice) {
|
|
4694
4705
|
var _price$value3, _price$value4;
|
|
4695
4706
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4696
4707
|
let centAmount;
|
|
@@ -4701,7 +4712,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4701
4712
|
}
|
|
4702
4713
|
let preciseAmount;
|
|
4703
4714
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4704
|
-
return _objectSpread$
|
|
4715
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4705
4716
|
centAmount,
|
|
4706
4717
|
preciseAmount
|
|
4707
4718
|
});
|
|
@@ -4718,7 +4729,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4718
4729
|
}
|
|
4719
4730
|
let preciseAmount;
|
|
4720
4731
|
if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4721
|
-
return _objectSpread$
|
|
4732
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4722
4733
|
centAmount,
|
|
4723
4734
|
preciseAmount
|
|
4724
4735
|
});
|
|
@@ -4730,7 +4741,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4730
4741
|
const currencyCode = price.value.currencyCode;
|
|
4731
4742
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4732
4743
|
if (currencyCode && !isNil$1(fractionedAmount)) {
|
|
4733
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4744
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$_(_objectSpread$_({}, minPrices), {}, {
|
|
4734
4745
|
[currencyCode]: price.value
|
|
4735
4746
|
});
|
|
4736
4747
|
}
|
|
@@ -4739,8 +4750,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4739
4750
|
return _Object$values(minPricesByCurrency);
|
|
4740
4751
|
}
|
|
4741
4752
|
|
|
4742
|
-
function ownKeys$
|
|
4743
|
-
function _objectSpread$
|
|
4753
|
+
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; }
|
|
4754
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$Z(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$Z(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4744
4755
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4745
4756
|
var _context, _context4;
|
|
4746
4757
|
return {
|
|
@@ -4751,18 +4762,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4751
4762
|
key: resource.custom.type.key,
|
|
4752
4763
|
name: transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4753
4764
|
fieldDefinitions: _mapInstanceProperty(_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4754
|
-
var _fieldDefinition$type,
|
|
4765
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4755
4766
|
return {
|
|
4756
4767
|
name: fieldDefinition.name,
|
|
4757
4768
|
required: fieldDefinition.required,
|
|
4758
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4759
|
-
elementType: _objectSpread$
|
|
4769
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4770
|
+
elementType: _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type.elementType), {}, {
|
|
4760
4771
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4761
4772
|
key: value.key,
|
|
4762
4773
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4763
4774
|
}))
|
|
4764
4775
|
})
|
|
4765
|
-
}) : ((_fieldDefinition$
|
|
4776
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4766
4777
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
4767
4778
|
key: value.key,
|
|
4768
4779
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4773,7 +4784,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4773
4784
|
})
|
|
4774
4785
|
}
|
|
4775
4786
|
},
|
|
4776
|
-
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4787
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$Z(_objectSpread$Z({}, fields), {}, {
|
|
4777
4788
|
[customField.name]: customField.value
|
|
4778
4789
|
}), {})
|
|
4779
4790
|
};
|
|
@@ -4785,7 +4796,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4785
4796
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4786
4797
|
// in either case we return null
|
|
4787
4798
|
if (!productSelection) return null;
|
|
4788
|
-
return _objectSpread$
|
|
4799
|
+
return _objectSpread$Z(_objectSpread$Z({}, applyTransformedLocalizedFields(productSelection, [{
|
|
4789
4800
|
from: 'nameAllLocales',
|
|
4790
4801
|
to: 'name'
|
|
4791
4802
|
}])), {}, {
|
|
@@ -4808,8 +4819,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4808
4819
|
return _mapInstanceProperty(_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4809
4820
|
};
|
|
4810
4821
|
|
|
4811
|
-
function ownKeys$
|
|
4812
|
-
function _objectSpread$
|
|
4822
|
+
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; }
|
|
4823
|
+
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; }
|
|
4813
4824
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4814
4825
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4815
4826
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4826,7 +4837,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4826
4837
|
if (updateAction.action === 'setCustomField' && _Array$isArray(updateAction.value)) {
|
|
4827
4838
|
const definition = _findInstanceProperty(fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4828
4839
|
const definitionName = definition.type.elementType.name;
|
|
4829
|
-
return _objectSpread$
|
|
4840
|
+
return _objectSpread$Y(_objectSpread$Y({}, updateAction), {}, {
|
|
4830
4841
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4831
4842
|
});
|
|
4832
4843
|
}
|
|
@@ -4900,8 +4911,8 @@ function omitSetsOfSets() {
|
|
|
4900
4911
|
|
|
4901
4912
|
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 } } } };
|
|
4902
4913
|
|
|
4903
|
-
function ownKeys$
|
|
4904
|
-
function _objectSpread$
|
|
4914
|
+
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; }
|
|
4915
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$X(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$X(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4905
4916
|
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); }; }
|
|
4906
4917
|
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; } }
|
|
4907
4918
|
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 } } } };
|
|
@@ -4961,7 +4972,7 @@ const mapDataToProps = _ref => {
|
|
|
4961
4972
|
return {
|
|
4962
4973
|
fetchTypeDefinitionsQuery: {
|
|
4963
4974
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
4964
|
-
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
4975
|
+
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$X({}, applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
4965
4976
|
isImmutable: true
|
|
4966
4977
|
}), [{
|
|
4967
4978
|
from: 'labelAllLocales',
|
|
@@ -4989,12 +5000,12 @@ const handlers$2 = {
|
|
|
4989
5000
|
}
|
|
4990
5001
|
};
|
|
4991
5002
|
|
|
4992
|
-
function ownKeys$
|
|
4993
|
-
function _objectSpread$
|
|
5003
|
+
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; }
|
|
5004
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$W(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$W(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4994
5005
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
4995
5006
|
return {
|
|
4996
5007
|
fields: customFieldsFromRestResponse.fields,
|
|
4997
|
-
type: _objectSpread$
|
|
5008
|
+
type: _objectSpread$W({
|
|
4998
5009
|
id: customFieldsFromRestResponse.type.id
|
|
4999
5010
|
}, customFieldsFromRestResponse.type.obj)
|
|
5000
5011
|
};
|
|
@@ -5008,19 +5019,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5008
5019
|
key: typeDefinition.key,
|
|
5009
5020
|
name: transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5010
5021
|
fieldDefinitions: _mapInstanceProperty(_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5011
|
-
var _fieldDefinition$type,
|
|
5022
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5012
5023
|
return {
|
|
5013
5024
|
name: fieldDefinition.name,
|
|
5014
5025
|
required: fieldDefinition.required,
|
|
5015
5026
|
inputHint: fieldDefinition.inputHint,
|
|
5016
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5017
|
-
elementType: _objectSpread$
|
|
5027
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5028
|
+
elementType: _objectSpread$W(_objectSpread$W({}, fieldDefinition.type.elementType), {}, {
|
|
5018
5029
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5019
5030
|
key: value.key,
|
|
5020
5031
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5021
5032
|
}))
|
|
5022
5033
|
})
|
|
5023
|
-
}) : ((_fieldDefinition$
|
|
5034
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5024
5035
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
5025
5036
|
key: value.key,
|
|
5026
5037
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5036,7 +5047,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5036
5047
|
type: {
|
|
5037
5048
|
id: formCustomFields.type.id,
|
|
5038
5049
|
typeId: 'type',
|
|
5039
|
-
obj: _objectSpread$
|
|
5050
|
+
obj: _objectSpread$W({}, formCustomFields.type)
|
|
5040
5051
|
},
|
|
5041
5052
|
fields: formCustomFields.fields
|
|
5042
5053
|
});
|
|
@@ -5044,7 +5055,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5044
5055
|
type: {
|
|
5045
5056
|
id: formCustomFields.type.id,
|
|
5046
5057
|
typeId: 'type',
|
|
5047
|
-
obj: _objectSpread$
|
|
5058
|
+
obj: _objectSpread$W({}, omit(formCustomFields.type, ['id']))
|
|
5048
5059
|
},
|
|
5049
5060
|
fields: omitBy(formCustomFields.fields || {}, isNil$1)
|
|
5050
5061
|
});
|
|
@@ -5060,7 +5071,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5060
5071
|
function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); 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); }; }
|
|
5061
5072
|
function _isNativeReflectConstruct$4() { 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; } }
|
|
5062
5073
|
var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5063
|
-
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5074
|
+
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5064
5075
|
const emptyTypeDefinitions = {
|
|
5065
5076
|
total: 0,
|
|
5066
5077
|
count: 0,
|
|
@@ -5118,7 +5129,7 @@ const createGraphQlOptions = ownProps => {
|
|
|
5118
5129
|
}
|
|
5119
5130
|
};
|
|
5120
5131
|
};
|
|
5121
|
-
var
|
|
5132
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics(graphql$1(FetchTypeDefinitionsWithNamesQuery, {
|
|
5122
5133
|
name: 'fetchTypeDefinitionsQuery',
|
|
5123
5134
|
skip: ownProps => ownProps.isDisabled,
|
|
5124
5135
|
options: createGraphQlOptions
|
|
@@ -5175,8 +5186,8 @@ const REFERENCED_TYPES = {
|
|
|
5175
5186
|
zone: 'zone'
|
|
5176
5187
|
};
|
|
5177
5188
|
|
|
5178
|
-
function ownKeys$
|
|
5179
|
-
function _objectSpread$
|
|
5189
|
+
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; }
|
|
5190
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$V(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$V(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5180
5191
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5181
5192
|
let validatedValues = [];
|
|
5182
5193
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5243,8 +5254,8 @@ function validations (formValues, language, languages) {
|
|
|
5243
5254
|
var _context2;
|
|
5244
5255
|
// Collect all required and set type fields
|
|
5245
5256
|
const fieldDefinitionsToValidate = _filterInstanceProperty(_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5246
|
-
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5247
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5257
|
+
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$V(_objectSpread$V({}, acc), {}, {
|
|
5258
|
+
[fieldDefinition.name]: _objectSpread$V(_objectSpread$V({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5248
5259
|
}), {});
|
|
5249
5260
|
return withoutEmptyErrorsByField(errors);
|
|
5250
5261
|
}
|
|
@@ -5271,8 +5282,8 @@ function CustomTextInput(props) {
|
|
|
5271
5282
|
}
|
|
5272
5283
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5273
5284
|
|
|
5274
|
-
function ownKeys$
|
|
5275
|
-
function _objectSpread$
|
|
5285
|
+
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; }
|
|
5286
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$U(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$U(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5276
5287
|
const getSubfieldLanguage = subfieldName => {
|
|
5277
5288
|
const lastDotIndex = _lastIndexOfInstanceProperty(subfieldName).call(subfieldName, '.');
|
|
5278
5289
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5296,7 +5307,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5296
5307
|
// as a whole.
|
|
5297
5308
|
|
|
5298
5309
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5299
|
-
const newValue = _objectSpread$
|
|
5310
|
+
const newValue = _objectSpread$U(_objectSpread$U({}, props.value), {}, {
|
|
5300
5311
|
[fieldLanguage]: rawValue
|
|
5301
5312
|
});
|
|
5302
5313
|
const nullifiedIfNeeded = LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5363,21 +5374,21 @@ function CustomNumberInput(props) {
|
|
|
5363
5374
|
}
|
|
5364
5375
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5365
5376
|
|
|
5366
|
-
function ownKeys$
|
|
5367
|
-
function _objectSpread$
|
|
5377
|
+
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; }
|
|
5378
|
+
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; }
|
|
5368
5379
|
var styles$f = {
|
|
5369
5380
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5370
5381
|
};
|
|
5371
5382
|
const fixCurrencyCode = (value, currencies) => {
|
|
5372
5383
|
if (value.currencyCode) return value;
|
|
5373
5384
|
const firstCurrency = currencies[0];
|
|
5374
|
-
return _objectSpread$
|
|
5385
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5375
5386
|
currencyCode: firstCurrency
|
|
5376
5387
|
});
|
|
5377
5388
|
};
|
|
5378
5389
|
const fixAmount = value => {
|
|
5379
5390
|
if (!value.amount) {
|
|
5380
|
-
return _objectSpread$
|
|
5391
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5381
5392
|
amount: '0'
|
|
5382
5393
|
});
|
|
5383
5394
|
}
|
|
@@ -5419,7 +5430,7 @@ function CustomMoneyInput(props) {
|
|
|
5419
5430
|
}
|
|
5420
5431
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5421
5432
|
const isAmount = _endsWithInstanceProperty(subfieldName).call(subfieldName, 'amount');
|
|
5422
|
-
const newValue = _objectSpread$
|
|
5433
|
+
const newValue = _objectSpread$T({}, internalValue.current);
|
|
5423
5434
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5424
5435
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5425
5436
|
internalValue.current = fixedValue;
|
|
@@ -5700,7 +5711,7 @@ function ReferenceSearch(props) {
|
|
|
5700
5711
|
});
|
|
5701
5712
|
}
|
|
5702
5713
|
|
|
5703
|
-
const messages$
|
|
5714
|
+
const messages$B = defineMessages({
|
|
5704
5715
|
placeholder: {
|
|
5705
5716
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5706
5717
|
description: 'Placeholder for search for a category',
|
|
@@ -5733,8 +5744,8 @@ const messages$A = defineMessages({
|
|
|
5733
5744
|
}
|
|
5734
5745
|
});
|
|
5735
5746
|
|
|
5736
|
-
function ownKeys$
|
|
5737
|
-
function _objectSpread$
|
|
5747
|
+
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; }
|
|
5748
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$S(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$S(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5738
5749
|
function Option$1(props) {
|
|
5739
5750
|
var _context, _context2;
|
|
5740
5751
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
@@ -5746,7 +5757,7 @@ function Option$1(props) {
|
|
|
5746
5757
|
const _useIntl = useIntl(),
|
|
5747
5758
|
formatMessage = _useIntl.formatMessage;
|
|
5748
5759
|
const category = props.data;
|
|
5749
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5760
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$S(_objectSpread$S({}, props), {}, {
|
|
5750
5761
|
children: jsxs("div", {
|
|
5751
5762
|
"data-testid": "category-option",
|
|
5752
5763
|
children: [jsx(Text.Body, {
|
|
@@ -5757,7 +5768,7 @@ function Option$1(props) {
|
|
|
5757
5768
|
fallbackOrder: languages
|
|
5758
5769
|
})
|
|
5759
5770
|
}), category.parent && jsx(Text.Detail, {
|
|
5760
|
-
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$
|
|
5771
|
+
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, formatLocalizedString(category.parent, {
|
|
5761
5772
|
key: 'name',
|
|
5762
5773
|
locale: language,
|
|
5763
5774
|
fallbackOrder: languages
|
|
@@ -5769,14 +5780,14 @@ function Option$1(props) {
|
|
|
5769
5780
|
fallbackOrder: languages
|
|
5770
5781
|
}))
|
|
5771
5782
|
}), category.externalId && jsx(Text.Detail, {
|
|
5772
|
-
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$
|
|
5783
|
+
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || NO_VALUE_FALLBACK)
|
|
5773
5784
|
})]
|
|
5774
5785
|
})
|
|
5775
5786
|
}));
|
|
5776
5787
|
}
|
|
5777
5788
|
|
|
5778
|
-
function ownKeys$
|
|
5779
|
-
function _objectSpread$
|
|
5789
|
+
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; }
|
|
5790
|
+
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; }
|
|
5780
5791
|
const filterOption$1 = () => true;
|
|
5781
5792
|
function CategoryReferenceSearch(props) {
|
|
5782
5793
|
const _useIntl = useIntl(),
|
|
@@ -5788,7 +5799,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5788
5799
|
})),
|
|
5789
5800
|
language = _useApplicationContex.language,
|
|
5790
5801
|
languages = _useApplicationContex.languages;
|
|
5791
|
-
const mapItemToOption = useCallback(category => _objectSpread$
|
|
5802
|
+
const mapItemToOption = useCallback(category => _objectSpread$R(_objectSpread$R({}, category), {}, {
|
|
5792
5803
|
value: category.id,
|
|
5793
5804
|
label: formatLocalizedString(category, {
|
|
5794
5805
|
key: 'name',
|
|
@@ -5806,7 +5817,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5806
5817
|
}), [apolloClient]);
|
|
5807
5818
|
return jsx(ReferenceSearch, {
|
|
5808
5819
|
id: props.id,
|
|
5809
|
-
components: _objectSpread$
|
|
5820
|
+
components: _objectSpread$R({
|
|
5810
5821
|
Option: Option$1
|
|
5811
5822
|
}, props.components),
|
|
5812
5823
|
isClearable: props.isClearable,
|
|
@@ -5817,10 +5828,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5817
5828
|
onBlur: props.onBlur,
|
|
5818
5829
|
onChange: props.onChange,
|
|
5819
5830
|
value: props.value,
|
|
5820
|
-
placeholderLabel: formatMessage(messages$
|
|
5821
|
-
searchPromptLabel: formatMessage(messages$
|
|
5822
|
-
noResultsLabel: formatMessage(messages$
|
|
5823
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5831
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5832
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5833
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5834
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5824
5835
|
mapItemToOption: mapItemToOption,
|
|
5825
5836
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5826
5837
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5896,7 +5907,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5896
5907
|
});
|
|
5897
5908
|
}
|
|
5898
5909
|
|
|
5899
|
-
const messages$
|
|
5910
|
+
const messages$A = defineMessages({
|
|
5900
5911
|
placeholder: {
|
|
5901
5912
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5902
5913
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5924,8 +5935,8 @@ const messages$z = defineMessages({
|
|
|
5924
5935
|
}
|
|
5925
5936
|
});
|
|
5926
5937
|
|
|
5927
|
-
function ownKeys$
|
|
5928
|
-
function _objectSpread$
|
|
5938
|
+
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; }
|
|
5939
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$Q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$Q(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5929
5940
|
function Option(props) {
|
|
5930
5941
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
5931
5942
|
language: applicationContext.dataLocale,
|
|
@@ -5936,7 +5947,7 @@ function Option(props) {
|
|
|
5936
5947
|
const _useIntl = useIntl(),
|
|
5937
5948
|
formatMessage = _useIntl.formatMessage;
|
|
5938
5949
|
const cartDiscount = props.data;
|
|
5939
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5950
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
5940
5951
|
children: jsxs("div", {
|
|
5941
5952
|
"data-testid": "cart-discount-option",
|
|
5942
5953
|
children: [jsx(Text.Detail, {
|
|
@@ -5947,14 +5958,14 @@ function Option(props) {
|
|
|
5947
5958
|
fallbackOrder: languages
|
|
5948
5959
|
})
|
|
5949
5960
|
}), jsxs(Text.Detail, {
|
|
5950
|
-
children: [formatMessage(messages$
|
|
5961
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
|
|
5951
5962
|
})]
|
|
5952
5963
|
})
|
|
5953
5964
|
}));
|
|
5954
5965
|
}
|
|
5955
5966
|
|
|
5956
|
-
function ownKeys$
|
|
5957
|
-
function _objectSpread$
|
|
5967
|
+
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; }
|
|
5968
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$P(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$P(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5958
5969
|
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 } } } };
|
|
5959
5970
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
5960
5971
|
const filterOption = (option, text) => {
|
|
@@ -5980,7 +5991,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5980
5991
|
})),
|
|
5981
5992
|
language = _useApplicationContex.language,
|
|
5982
5993
|
languages = _useApplicationContex.languages;
|
|
5983
|
-
const mapItemToOption = useCallback(cartDiscount => _objectSpread$
|
|
5994
|
+
const mapItemToOption = useCallback(cartDiscount => _objectSpread$P(_objectSpread$P({}, cartDiscount), {}, {
|
|
5984
5995
|
value: cartDiscount.id,
|
|
5985
5996
|
key: cartDiscount.key,
|
|
5986
5997
|
label: formatLocalizedString(cartDiscount, {
|
|
@@ -6023,10 +6034,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6023
6034
|
onBlur: props.onBlur,
|
|
6024
6035
|
onChange: props.onChange,
|
|
6025
6036
|
value: returnNullIfEmpty(props.value),
|
|
6026
|
-
placeholderLabel: formatMessage(messages$
|
|
6027
|
-
searchPromptLabel: formatMessage(messages$
|
|
6028
|
-
noResultsLabel: formatMessage(messages$
|
|
6029
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6037
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6038
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6039
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6040
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6030
6041
|
mapItemToOption: mapItemToOption,
|
|
6031
6042
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6032
6043
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6087,7 +6098,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6087
6098
|
});
|
|
6088
6099
|
}
|
|
6089
6100
|
|
|
6090
|
-
var messages$
|
|
6101
|
+
var messages$z = defineMessages({
|
|
6091
6102
|
noProductsFound: {
|
|
6092
6103
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6093
6104
|
description: 'The message to display when no products were found',
|
|
@@ -6176,7 +6187,7 @@ const ProductPickerInput = _ref => {
|
|
|
6176
6187
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6177
6188
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6178
6189
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6179
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6190
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
6180
6191
|
return jsx(Constraints.Horizontal, {
|
|
6181
6192
|
max: "scale",
|
|
6182
6193
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -6186,7 +6197,7 @@ const ProductPickerInput = _ref => {
|
|
|
6186
6197
|
children: jsx(AsyncSelectInput, {
|
|
6187
6198
|
id: name,
|
|
6188
6199
|
name: name,
|
|
6189
|
-
placeholder: formatMessage(messages$
|
|
6200
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6190
6201
|
loadOptions: loadOptionsDebounced,
|
|
6191
6202
|
defaultOptions: [],
|
|
6192
6203
|
isClearable: isClearable,
|
|
@@ -6200,7 +6211,7 @@ const ProductPickerInput = _ref => {
|
|
|
6200
6211
|
onInputChange: handleInputChange,
|
|
6201
6212
|
onBlur: onBlur,
|
|
6202
6213
|
value: currentOption.data,
|
|
6203
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6214
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6204
6215
|
hasError: hasError || isLoadingFailed
|
|
6205
6216
|
})
|
|
6206
6217
|
}), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
|
|
@@ -6450,8 +6461,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6450
6461
|
}
|
|
6451
6462
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6452
6463
|
|
|
6453
|
-
function ownKeys$
|
|
6454
|
-
function _objectSpread$
|
|
6464
|
+
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; }
|
|
6465
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$O(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$O(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6455
6466
|
const getTypeName = type => type.name.toLowerCase();
|
|
6456
6467
|
const findLabel = (enumType, key) => {
|
|
6457
6468
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6500,7 +6511,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6500
6511
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty(pairs).call(pairs, (result, _ref2) => {
|
|
6501
6512
|
let name = _ref2.name,
|
|
6502
6513
|
value = _ref2.value;
|
|
6503
|
-
return _objectSpread$
|
|
6514
|
+
return _objectSpread$O(_objectSpread$O({}, result), {}, {
|
|
6504
6515
|
[name]: value
|
|
6505
6516
|
});
|
|
6506
6517
|
}, {});
|
|
@@ -6584,7 +6595,7 @@ function ProductAttributeInput(props) {
|
|
|
6584
6595
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6585
6596
|
|
|
6586
6597
|
// eslint-disable-next-line import/prefer-default-export
|
|
6587
|
-
const messages$
|
|
6598
|
+
const messages$y = defineMessages({
|
|
6588
6599
|
aboveFifthLevelWarning: {
|
|
6589
6600
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6590
6601
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6597,23 +6608,23 @@ const messages$x = defineMessages({
|
|
|
6597
6608
|
}
|
|
6598
6609
|
});
|
|
6599
6610
|
|
|
6600
|
-
function ownKeys$
|
|
6601
|
-
function _objectSpread$
|
|
6611
|
+
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; }
|
|
6612
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$N(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$N(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6602
6613
|
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 } } } };
|
|
6603
6614
|
const mapAttributeDefinition = definition => {
|
|
6604
|
-
var _context, _definition$type,
|
|
6605
|
-
return _objectSpread$
|
|
6615
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6616
|
+
return _objectSpread$N(_objectSpread$N({}, definition), {}, {
|
|
6606
6617
|
required: definition.isRequired,
|
|
6607
6618
|
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6608
6619
|
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6609
|
-
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6610
|
-
elementType: _objectSpread$
|
|
6620
|
+
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 || (_definition$type = _definition$type.elementType) === null || _definition$type === void 0 ? void 0 : _definition$type.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6621
|
+
elementType: _objectSpread$N(_objectSpread$N({}, definition.type.elementType), {}, {
|
|
6611
6622
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6612
6623
|
key: value.key,
|
|
6613
6624
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6614
6625
|
}))
|
|
6615
6626
|
})
|
|
6616
|
-
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6627
|
+
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6617
6628
|
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6618
6629
|
key: value.key,
|
|
6619
6630
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6654,7 +6665,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6654
6665
|
};
|
|
6655
6666
|
}
|
|
6656
6667
|
|
|
6657
|
-
var messages$
|
|
6668
|
+
var messages$x = defineMessages({
|
|
6658
6669
|
updateButton: {
|
|
6659
6670
|
id: 'NestedAttributes.Details.updateButton',
|
|
6660
6671
|
description: 'Update button label',
|
|
@@ -6734,14 +6745,14 @@ var messages$w = defineMessages({
|
|
|
6734
6745
|
|
|
6735
6746
|
const NestingLevelContext = /*#__PURE__*/createContext(0);
|
|
6736
6747
|
|
|
6737
|
-
function ownKeys$
|
|
6738
|
-
function _objectSpread$
|
|
6748
|
+
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; }
|
|
6749
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$M(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$M(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6739
6750
|
const EditButton = props => {
|
|
6740
6751
|
const _useIntl = useIntl(),
|
|
6741
6752
|
formatMessage = _useIntl.formatMessage;
|
|
6742
6753
|
return jsx(Tooltip, {
|
|
6743
6754
|
placement: "top",
|
|
6744
|
-
title: formatMessage(messages$
|
|
6755
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6745
6756
|
children: jsx(IconButton, {
|
|
6746
6757
|
label: "Edit",
|
|
6747
6758
|
isDisabled: props.isDisabled,
|
|
@@ -6757,12 +6768,12 @@ const DropChangesConfirmation = props => {
|
|
|
6757
6768
|
formatMessage = _useIntl2.formatMessage;
|
|
6758
6769
|
return jsx(ConfirmationDialog, {
|
|
6759
6770
|
isOpen: props.isOpen || false,
|
|
6760
|
-
title: formatMessage(messages$
|
|
6761
|
-
labelPrimary: formatMessage(messages$
|
|
6771
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6772
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6762
6773
|
onConfirm: props.onConfirm,
|
|
6763
6774
|
onCancel: props.onCancel,
|
|
6764
6775
|
children: jsx(Text.Body, {
|
|
6765
|
-
intlMessage: messages$
|
|
6776
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6766
6777
|
})
|
|
6767
6778
|
});
|
|
6768
6779
|
};
|
|
@@ -6787,11 +6798,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6787
6798
|
children: [jsx(SecondaryButton, {
|
|
6788
6799
|
isDisabled: !formik.dirty,
|
|
6789
6800
|
iconLeft: jsx(RevertIcon, {}),
|
|
6790
|
-
label: formatMessage(messages$
|
|
6801
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6791
6802
|
onClick: formik.resetForm
|
|
6792
6803
|
}), jsx(CustomFormModalPage.FormPrimaryButton, {
|
|
6793
6804
|
isDisabled: !formik.dirty,
|
|
6794
|
-
label: formatMessage(messages$
|
|
6805
|
+
label: formatMessage(messages$x.updateButton),
|
|
6795
6806
|
onClick: formik.handleSubmit
|
|
6796
6807
|
})]
|
|
6797
6808
|
}),
|
|
@@ -6820,7 +6831,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6820
6831
|
const MaxNestingLevelReached = () => jsx(FieldLabel, {
|
|
6821
6832
|
title: "",
|
|
6822
6833
|
hint: jsx(Text.Body, {
|
|
6823
|
-
intlMessage: messages$
|
|
6834
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6824
6835
|
}),
|
|
6825
6836
|
hintIcon: jsx(WarningIcon, {})
|
|
6826
6837
|
});
|
|
@@ -6832,7 +6843,7 @@ const NestedInputControls = props => {
|
|
|
6832
6843
|
if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
|
|
6833
6844
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6834
6845
|
if (!hasAttributes) return jsx(Text.Body, {
|
|
6835
|
-
intlMessage: messages$
|
|
6846
|
+
intlMessage: messages$x.emptyProductType,
|
|
6836
6847
|
tone: "secondary"
|
|
6837
6848
|
});
|
|
6838
6849
|
return jsxs(Spacings.Inline, {
|
|
@@ -6846,7 +6857,7 @@ const NestedInputControls = props => {
|
|
|
6846
6857
|
children: props.productType.name
|
|
6847
6858
|
}), props.isEmpty && jsx("span", {
|
|
6848
6859
|
children: jsx(Tag, {
|
|
6849
|
-
children: formatMessage(messages$
|
|
6860
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6850
6861
|
})
|
|
6851
6862
|
})]
|
|
6852
6863
|
}), jsx(EditButton, {
|
|
@@ -6882,13 +6893,13 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
6882
6893
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6883
6894
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6884
6895
|
const openNestedAttributesForm = () => {
|
|
6885
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6896
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6886
6897
|
hideSaveToolbar: true
|
|
6887
6898
|
}));
|
|
6888
6899
|
attributesForm.openModal();
|
|
6889
6900
|
};
|
|
6890
6901
|
const closeNestedAttributesForm = () => {
|
|
6891
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6902
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6892
6903
|
hideSaveToolbar: false
|
|
6893
6904
|
}));
|
|
6894
6905
|
attributesForm.closeModal();
|
|
@@ -6908,7 +6919,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
6908
6919
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
6909
6920
|
kind: 'success',
|
|
6910
6921
|
domain: DOMAINS.SIDE,
|
|
6911
|
-
text: formatMessage(messages$
|
|
6922
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
6912
6923
|
});
|
|
6913
6924
|
setSubmitting(false);
|
|
6914
6925
|
},
|
|
@@ -6992,8 +7003,8 @@ const SetButtons = props => {
|
|
|
6992
7003
|
};
|
|
6993
7004
|
SetButtons.displayName = 'SetButtons';
|
|
6994
7005
|
|
|
6995
|
-
function ownKeys$
|
|
6996
|
-
function _objectSpread$
|
|
7006
|
+
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; }
|
|
7007
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$L(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$L(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6997
7008
|
const getDuplicateErrors = setValues => {
|
|
6998
7009
|
/* eslint-disable no-plusplus */
|
|
6999
7010
|
const result = [];
|
|
@@ -7050,7 +7061,7 @@ function CustomInputSet(props) {
|
|
|
7050
7061
|
touched = _useFormikContext.touched,
|
|
7051
7062
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7052
7063
|
dirty = _useFormikContext.dirty;
|
|
7053
|
-
const itemFieldDefinition = _objectSpread$
|
|
7064
|
+
const itemFieldDefinition = _objectSpread$L(_objectSpread$L({}, props.fieldDefinition), {}, {
|
|
7054
7065
|
type: props.fieldDefinition.type.elementType
|
|
7055
7066
|
});
|
|
7056
7067
|
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7210,7 +7221,7 @@ const CustomFieldInput = /*#__PURE__*/memo(props => {
|
|
|
7210
7221
|
});
|
|
7211
7222
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7212
7223
|
|
|
7213
|
-
var messages$
|
|
7224
|
+
var messages$w = defineMessages({
|
|
7214
7225
|
referencedProductType: {
|
|
7215
7226
|
id: 'NestedAttributes.referencedProductType',
|
|
7216
7227
|
description: 'Product type referenced hint',
|
|
@@ -7218,10 +7229,10 @@ var messages$v = defineMessages({
|
|
|
7218
7229
|
}
|
|
7219
7230
|
});
|
|
7220
7231
|
|
|
7221
|
-
function ownKeys$
|
|
7222
|
-
function _objectSpread$
|
|
7232
|
+
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; }
|
|
7233
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$K(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$K(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7223
7234
|
function ProductTypeReference(props) {
|
|
7224
|
-
const productTypeMessage = _objectSpread$
|
|
7235
|
+
const productTypeMessage = _objectSpread$K(_objectSpread$K({}, messages$w.referencedProductType), {}, {
|
|
7225
7236
|
values: {
|
|
7226
7237
|
productTypeName: props.productType.name
|
|
7227
7238
|
}
|
|
@@ -7267,9 +7278,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7267
7278
|
}
|
|
7268
7279
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7269
7280
|
|
|
7270
|
-
function ownKeys$
|
|
7271
|
-
function _objectSpread$
|
|
7272
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7281
|
+
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; }
|
|
7282
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$J(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$J(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7283
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$J(_objectSpread$J({}, result), itemErrors), {});
|
|
7273
7284
|
|
|
7274
7285
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7275
7286
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7280,15 +7291,15 @@ const CustomFieldErrors = props => {
|
|
|
7280
7291
|
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7281
7292
|
return jsxs(Fragment, {
|
|
7282
7293
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
7283
|
-
intlMessage: messages$
|
|
7294
|
+
intlMessage: messages$K.required
|
|
7284
7295
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
7285
|
-
intlMessage: messages$
|
|
7296
|
+
intlMessage: messages$K.unique
|
|
7286
7297
|
})]
|
|
7287
7298
|
});
|
|
7288
7299
|
};
|
|
7289
7300
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7290
7301
|
|
|
7291
|
-
var messages$
|
|
7302
|
+
var messages$v = defineMessages({
|
|
7292
7303
|
productReferenceLabel: {
|
|
7293
7304
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7294
7305
|
description: 'Label shown above the product picker input.',
|
|
@@ -7321,8 +7332,8 @@ var messages$u = defineMessages({
|
|
|
7321
7332
|
}
|
|
7322
7333
|
});
|
|
7323
7334
|
|
|
7324
|
-
function ownKeys$
|
|
7325
|
-
function _objectSpread$
|
|
7335
|
+
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; }
|
|
7336
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$I(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$I(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7326
7337
|
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 } } } };
|
|
7327
7338
|
const CustomFieldsLabelHint = _ref => {
|
|
7328
7339
|
var _type$name;
|
|
@@ -7352,7 +7363,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7352
7363
|
children: [jsx(WarningIcon, {
|
|
7353
7364
|
size: "medium",
|
|
7354
7365
|
color: "warning"
|
|
7355
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7366
|
+
}), jsx(FormattedMessage, _objectSpread$I({}, messages$v.cartDiscountMoreThan500))]
|
|
7356
7367
|
});
|
|
7357
7368
|
}
|
|
7358
7369
|
return formatLocalizedString(fieldDefinition, {
|
|
@@ -7366,8 +7377,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7366
7377
|
formatMessage = _useIntl.formatMessage;
|
|
7367
7378
|
const _usePimStatus = usePimStatus(),
|
|
7368
7379
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7369
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7370
|
-
return formatMessage(messages$
|
|
7380
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7381
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7371
7382
|
}
|
|
7372
7383
|
|
|
7373
7384
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7383,7 +7394,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7383
7394
|
const referenceTypeId = type.referenceTypeId;
|
|
7384
7395
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7385
7396
|
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7386
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7397
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$v.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$v.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$v.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7387
7398
|
}
|
|
7388
7399
|
const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
7389
7400
|
let name = _ref3.name,
|
|
@@ -7538,8 +7549,8 @@ var pickerMessages = defineMessages({
|
|
|
7538
7549
|
}
|
|
7539
7550
|
});
|
|
7540
7551
|
|
|
7541
|
-
function ownKeys$
|
|
7542
|
-
function _objectSpread$
|
|
7552
|
+
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; }
|
|
7553
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$H(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$H(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7543
7554
|
const PRODUCT_SELECTION_TYPES = {
|
|
7544
7555
|
INCLUSION: 'individual',
|
|
7545
7556
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7553,7 +7564,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7553
7564
|
var _context;
|
|
7554
7565
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7555
7566
|
if (!ps) return undefined;
|
|
7556
|
-
return _objectSpread$
|
|
7567
|
+
return _objectSpread$H(_objectSpread$H({}, ps), {}, {
|
|
7557
7568
|
label: _concatInstanceProperty(_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getType(ps === null || ps === void 0 ? void 0 : ps.type), ")") : '')
|
|
7558
7569
|
});
|
|
7559
7570
|
};
|
|
@@ -7849,7 +7860,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7849
7860
|
fetchPolicy: 'network-only'
|
|
7850
7861
|
}),
|
|
7851
7862
|
data = _await$client$query.data;
|
|
7852
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7863
|
+
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 || (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
7853
7864
|
const updatedProductSelections = _mapInstanceProperty(matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7854
7865
|
const filteredProductSelections = _filterInstanceProperty(updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7855
7866
|
var _context2;
|
|
@@ -7904,12 +7915,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7904
7915
|
});
|
|
7905
7916
|
}
|
|
7906
7917
|
|
|
7907
|
-
function ownKeys$
|
|
7908
|
-
function _objectSpread$
|
|
7918
|
+
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; }
|
|
7919
|
+
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$G(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$G(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7909
7920
|
function TypeSelectInputOption(props) {
|
|
7910
7921
|
const data = props.data;
|
|
7911
7922
|
const noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
7912
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7923
|
+
return jsx(SelectInput.Option, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
7913
7924
|
children: jsxs(Spacings.Stack, {
|
|
7914
7925
|
scale: "xs",
|
|
7915
7926
|
children: [jsx(Text.Detail, {
|
|
@@ -7924,18 +7935,18 @@ function TypeSelectInputOption(props) {
|
|
|
7924
7935
|
}));
|
|
7925
7936
|
}
|
|
7926
7937
|
|
|
7927
|
-
function ownKeys$
|
|
7928
|
-
function _objectSpread$
|
|
7938
|
+
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; }
|
|
7939
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$F(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$F(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7929
7940
|
function ProductSelectionsPicker(props) {
|
|
7930
7941
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
7931
7942
|
const components = useMemo(() => {
|
|
7932
7943
|
return {
|
|
7933
7944
|
Option: optionInnerProps => {
|
|
7934
7945
|
if (optionInnerProps.isDisabled) {
|
|
7935
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7946
|
+
return jsx(SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
7936
7947
|
}
|
|
7937
7948
|
if (props.optionType === TYPE_PROPERTY) {
|
|
7938
|
-
return jsx(TypeSelectInputOption, _objectSpread$
|
|
7949
|
+
return jsx(TypeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
7939
7950
|
}
|
|
7940
7951
|
return jsx(CustomSelectInputOption, {
|
|
7941
7952
|
optionType: props.optionType,
|
|
@@ -7947,7 +7958,7 @@ function ProductSelectionsPicker(props) {
|
|
|
7947
7958
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7948
7959
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
7949
7960
|
return jsx(Spacings.Stack, {
|
|
7950
|
-
children: jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
7961
|
+
children: jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
7951
7962
|
components: components
|
|
7952
7963
|
}))
|
|
7953
7964
|
});
|
|
@@ -7970,7 +7981,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
7970
7981
|
|
|
7971
7982
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
7972
7983
|
|
|
7973
|
-
var messages$
|
|
7984
|
+
var messages$u = defineMessages({
|
|
7974
7985
|
countriesBasicSelectPlaceholder: {
|
|
7975
7986
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
7976
7987
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -7998,7 +8009,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
7998
8009
|
value: props.value,
|
|
7999
8010
|
isRequired: props.isRequired,
|
|
8000
8011
|
description: props.description,
|
|
8001
|
-
placeholder: intl.formatMessage(messages$
|
|
8012
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8002
8013
|
options: props.options,
|
|
8003
8014
|
onChange: props.onChange,
|
|
8004
8015
|
isDisabled: props.isDisabled,
|
|
@@ -8008,10 +8019,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8008
8019
|
});
|
|
8009
8020
|
}
|
|
8010
8021
|
|
|
8011
|
-
function ownKeys$
|
|
8012
|
-
function _objectSpread$
|
|
8022
|
+
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; }
|
|
8023
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$E(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$E(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8013
8024
|
const emptyCountryOption = intl => [{
|
|
8014
|
-
label: intl.formatMessage(messages$
|
|
8025
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8015
8026
|
value: undefined,
|
|
8016
8027
|
isDisabled: true
|
|
8017
8028
|
}];
|
|
@@ -8036,7 +8047,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8036
8047
|
const onOptionChange = event => {
|
|
8037
8048
|
const countries = event.target.value;
|
|
8038
8049
|
props.onChange({
|
|
8039
|
-
target: _objectSpread$
|
|
8050
|
+
target: _objectSpread$E(_objectSpread$E({}, event.target), {}, {
|
|
8040
8051
|
value: _mapInstanceProperty(countries).call(countries, country => {
|
|
8041
8052
|
var _country$value;
|
|
8042
8053
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8057,7 +8068,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8057
8068
|
var _context3;
|
|
8058
8069
|
return _findInstanceProperty(_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8059
8070
|
}),
|
|
8060
|
-
placeholder: intl.formatMessage(messages$
|
|
8071
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8061
8072
|
loadOptions: handleLoadOptions,
|
|
8062
8073
|
onChange: onOptionChange,
|
|
8063
8074
|
isDisabled: props.isDisabled,
|
|
@@ -8067,13 +8078,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8067
8078
|
});
|
|
8068
8079
|
}
|
|
8069
8080
|
|
|
8070
|
-
function ownKeys$
|
|
8071
|
-
function _objectSpread$
|
|
8081
|
+
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; }
|
|
8082
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$D(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$D(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8072
8083
|
function CountriesPicker(props) {
|
|
8073
8084
|
var _props$options;
|
|
8074
8085
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8075
8086
|
return jsx(Spacings.Stack, {
|
|
8076
|
-
children: jsx(CustomCountriesPicker, _objectSpread$
|
|
8087
|
+
children: jsx(CustomCountriesPicker, _objectSpread$D({}, props))
|
|
8077
8088
|
});
|
|
8078
8089
|
}
|
|
8079
8090
|
CountriesPicker.defaultProps = {
|
|
@@ -8083,7 +8094,7 @@ CountriesPicker.defaultProps = {
|
|
|
8083
8094
|
hasWarning: false
|
|
8084
8095
|
};
|
|
8085
8096
|
|
|
8086
|
-
var messages$
|
|
8097
|
+
var messages$t = defineMessages({
|
|
8087
8098
|
noCustomerGroupsFound: {
|
|
8088
8099
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8089
8100
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8174,8 +8185,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8174
8185
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8175
8186
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8176
8187
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8177
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8178
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8188
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8189
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === 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 : '';
|
|
8179
8190
|
return jsx(Constraints.Horizontal, {
|
|
8180
8191
|
max: "scale",
|
|
8181
8192
|
children: jsxs(Spacings.Stack, {
|
|
@@ -8185,7 +8196,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8185
8196
|
children: jsx(AsyncSelectInput, {
|
|
8186
8197
|
id: name,
|
|
8187
8198
|
name: name,
|
|
8188
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8199
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8189
8200
|
loadOptions: loadOptionsDebounced,
|
|
8190
8201
|
defaultOptions: true,
|
|
8191
8202
|
showOptionGroupDivider: true,
|
|
@@ -8255,7 +8266,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8255
8266
|
return _sliceInstanceProperty(storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8256
8267
|
};
|
|
8257
8268
|
|
|
8258
|
-
var messages$
|
|
8269
|
+
var messages$s = defineMessages({
|
|
8259
8270
|
basicSelectInputPlaceholder: {
|
|
8260
8271
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8261
8272
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8281,6 +8292,11 @@ var messages$r = defineMessages({
|
|
|
8281
8292
|
description: 'The message shown in search select input when matches are found',
|
|
8282
8293
|
defaultMessage: 'No matches found for your search term'
|
|
8283
8294
|
},
|
|
8295
|
+
searchSelectInputNoValueMessage: {
|
|
8296
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8297
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8298
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8299
|
+
},
|
|
8284
8300
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8285
8301
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8286
8302
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8288,8 +8304,8 @@ var messages$r = defineMessages({
|
|
|
8288
8304
|
}
|
|
8289
8305
|
});
|
|
8290
8306
|
|
|
8291
|
-
function ownKeys$
|
|
8292
|
-
function _objectSpread$
|
|
8307
|
+
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; }
|
|
8308
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$C(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$C(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8293
8309
|
const hasErrors$2 = errors => {
|
|
8294
8310
|
var _context;
|
|
8295
8311
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8314,7 +8330,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8314
8330
|
return _findInstanceProperty(mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8315
8331
|
};
|
|
8316
8332
|
const emptyStoreOption = intl => [{
|
|
8317
|
-
label: intl.formatMessage(messages$
|
|
8333
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8318
8334
|
value: undefined,
|
|
8319
8335
|
isDisabled: true
|
|
8320
8336
|
}];
|
|
@@ -8361,10 +8377,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8361
8377
|
};
|
|
8362
8378
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8363
8379
|
return jsxs(Fragment, {
|
|
8364
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
8380
|
+
children: [jsx(AsyncSelectInput, _objectSpread$C(_objectSpread$C({
|
|
8365
8381
|
id: props.id,
|
|
8366
8382
|
name: props.name,
|
|
8367
|
-
placeholder: intl.formatMessage(messages$
|
|
8383
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8368
8384
|
horizontalConstraint: props.horizontalConstraint,
|
|
8369
8385
|
loadOptions: handleLoadOptions,
|
|
8370
8386
|
defaultOptions: true,
|
|
@@ -8404,8 +8420,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8404
8420
|
shouldFetchProductSelections: false
|
|
8405
8421
|
};
|
|
8406
8422
|
|
|
8407
|
-
function ownKeys$
|
|
8408
|
-
function _objectSpread$
|
|
8423
|
+
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; }
|
|
8424
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$B(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$B(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8409
8425
|
const hasErrors$1 = errors => {
|
|
8410
8426
|
var _context;
|
|
8411
8427
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8453,10 +8469,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8453
8469
|
};
|
|
8454
8470
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8455
8471
|
return jsxs(Fragment, {
|
|
8456
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
8472
|
+
children: [jsx(SelectInput, _objectSpread$B(_objectSpread$B({
|
|
8457
8473
|
id: props.id,
|
|
8458
8474
|
name: props.name,
|
|
8459
|
-
placeholder: intl.formatMessage(messages$
|
|
8475
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8460
8476
|
horizontalConstraint: props.horizontalConstraint,
|
|
8461
8477
|
options: mappedStoresListOptions,
|
|
8462
8478
|
isMulti: props.isMulti,
|
|
@@ -8549,8 +8565,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8549
8565
|
};
|
|
8550
8566
|
};
|
|
8551
8567
|
|
|
8552
|
-
function ownKeys$
|
|
8553
|
-
function _objectSpread$
|
|
8568
|
+
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; }
|
|
8569
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$A(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$A(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8554
8570
|
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 } } } };
|
|
8555
8571
|
const hasErrors = errors => {
|
|
8556
8572
|
var _context;
|
|
@@ -8652,10 +8668,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8652
8668
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8653
8669
|
if (storesByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8654
8670
|
return jsxs(Fragment, {
|
|
8655
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
8671
|
+
children: [jsx(SearchSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8656
8672
|
id: props.id,
|
|
8657
8673
|
name: props.name,
|
|
8658
|
-
placeholder: intl.formatMessage(messages$
|
|
8674
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8659
8675
|
horizontalConstraint: props.horizontalConstraint,
|
|
8660
8676
|
loadOptions: loadOptionsDebounced,
|
|
8661
8677
|
defaultOptions: false,
|
|
@@ -8669,8 +8685,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8669
8685
|
}),
|
|
8670
8686
|
onChange: props.onChange,
|
|
8671
8687
|
onBlur: props.onBlur,
|
|
8672
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8673
|
-
noOptionsMessage:
|
|
8688
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8689
|
+
noOptionsMessage: _ref4 => {
|
|
8690
|
+
let inputValue = _ref4.inputValue;
|
|
8691
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8692
|
+
},
|
|
8674
8693
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8675
8694
|
isReadOnly: props.isReadOnly,
|
|
8676
8695
|
isClearable: props.isClearable,
|
|
@@ -8698,8 +8717,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8698
8717
|
shouldFetchProductSelections: false
|
|
8699
8718
|
};
|
|
8700
8719
|
|
|
8701
|
-
function ownKeys$
|
|
8702
|
-
function _objectSpread$
|
|
8720
|
+
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; }
|
|
8721
|
+
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; }
|
|
8703
8722
|
const StoreSelectInput = props => {
|
|
8704
8723
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8705
8724
|
const components = useMemo(() => {
|
|
@@ -8707,7 +8726,7 @@ const StoreSelectInput = props => {
|
|
|
8707
8726
|
// eslint-disable-next-line react/display-name
|
|
8708
8727
|
Option: optionInnerProps => {
|
|
8709
8728
|
if (optionInnerProps.isDisabled) {
|
|
8710
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
8729
|
+
return jsx(SelectInput.Option, _objectSpread$z({}, optionInnerProps));
|
|
8711
8730
|
}
|
|
8712
8731
|
return jsx(CustomSelectInputOption, {
|
|
8713
8732
|
optionType: props.optionType,
|
|
@@ -8718,7 +8737,7 @@ const StoreSelectInput = props => {
|
|
|
8718
8737
|
}, [props.optionType]);
|
|
8719
8738
|
if (totalNumberOfStoresFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8720
8739
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8721
|
-
return jsx(CustomStoreSelectInput, _objectSpread$
|
|
8740
|
+
return jsx(CustomStoreSelectInput, _objectSpread$z(_objectSpread$z({
|
|
8722
8741
|
projectKey: props.projectKey,
|
|
8723
8742
|
id: props.id,
|
|
8724
8743
|
name: props.name,
|
|
@@ -8758,11 +8777,22 @@ StoreSelectInput.defaultProps = {
|
|
|
8758
8777
|
shouldFetchProductSelections: false
|
|
8759
8778
|
};
|
|
8760
8779
|
|
|
8761
|
-
//
|
|
8780
|
+
// Values have to match enum values on core ws
|
|
8762
8781
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
8763
|
-
const
|
|
8782
|
+
const businessRoleConstants = {
|
|
8783
|
+
ExecutiveManagement: 'ExecutiveManagement',
|
|
8784
|
+
Architect: 'Architect',
|
|
8785
|
+
Engineer: 'Engineer',
|
|
8786
|
+
ProductProjectManagerOrOwner: 'ProductProjectManagerOrOwner',
|
|
8787
|
+
Marketing: 'Marketing',
|
|
8788
|
+
CustomerService: 'CustomerService',
|
|
8789
|
+
SalesAndECommerceManager: 'SalesAndECommerceManager',
|
|
8790
|
+
Other: 'Other'
|
|
8791
|
+
};
|
|
8792
|
+
|
|
8793
|
+
const businessRoleKeys = _Object$values(businessRoleConstants);
|
|
8764
8794
|
|
|
8765
|
-
var messages$
|
|
8795
|
+
var messages$r = defineMessages({
|
|
8766
8796
|
ExecutiveManagement: {
|
|
8767
8797
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8768
8798
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8820,7 +8850,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8820
8850
|
return _parseFloat((ratio * 100).toFixed(2));
|
|
8821
8851
|
}
|
|
8822
8852
|
|
|
8823
|
-
const messages$
|
|
8853
|
+
const messages$q = defineMessages({
|
|
8824
8854
|
inputFieldError: {
|
|
8825
8855
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8826
8856
|
description: 'Error message for empty input field ',
|
|
@@ -8841,14 +8871,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8841
8871
|
if (validateSingleFilter({
|
|
8842
8872
|
value
|
|
8843
8873
|
})) {
|
|
8844
|
-
return intl.formatMessage(messages$
|
|
8874
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8845
8875
|
}
|
|
8846
8876
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8847
8877
|
value: value.currencyCode
|
|
8848
8878
|
}) || validateSingleFilter({
|
|
8849
8879
|
value: value.amount
|
|
8850
8880
|
}))) {
|
|
8851
|
-
return intl.formatMessage(messages$
|
|
8881
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8852
8882
|
}
|
|
8853
8883
|
return null;
|
|
8854
8884
|
};
|
|
@@ -8856,7 +8886,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8856
8886
|
let value = _ref.value;
|
|
8857
8887
|
if (!value || !value.type) {
|
|
8858
8888
|
return {
|
|
8859
|
-
type: intl.formatMessage(messages$
|
|
8889
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8860
8890
|
};
|
|
8861
8891
|
}
|
|
8862
8892
|
const typeName = value.type.name;
|
|
@@ -8864,7 +8894,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8864
8894
|
const filterValue = value.value;
|
|
8865
8895
|
if (hasOption && !value.option) {
|
|
8866
8896
|
return {
|
|
8867
|
-
option: intl.formatMessage(messages$
|
|
8897
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8868
8898
|
};
|
|
8869
8899
|
}
|
|
8870
8900
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8883,7 +8913,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8883
8913
|
} : null;
|
|
8884
8914
|
}
|
|
8885
8915
|
|
|
8886
|
-
const messages$
|
|
8916
|
+
const messages$p = defineMessages({
|
|
8887
8917
|
rangeMissingValue: {
|
|
8888
8918
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8889
8919
|
description: 'error message if missing a value in a range',
|
|
@@ -8908,25 +8938,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
8908
8938
|
if (validateSingleFilter({
|
|
8909
8939
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
8910
8940
|
})) return {
|
|
8911
|
-
from: intl.formatMessage(messages$
|
|
8941
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8912
8942
|
};
|
|
8913
8943
|
if (validateSingleFilter({
|
|
8914
8944
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
8915
8945
|
})) return {
|
|
8916
|
-
to: intl.formatMessage(messages$
|
|
8946
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8917
8947
|
};
|
|
8918
8948
|
if (moment$1(value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
8919
|
-
from: intl.formatMessage(messages$
|
|
8949
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
8920
8950
|
};
|
|
8921
8951
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
8922
8952
|
if (validateSingleFilter({
|
|
8923
8953
|
value
|
|
8924
|
-
})) return intl.formatMessage(messages$
|
|
8954
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
8925
8955
|
}
|
|
8926
8956
|
return null;
|
|
8927
8957
|
}
|
|
8928
8958
|
|
|
8929
|
-
const messages$
|
|
8959
|
+
const messages$o = defineMessages({
|
|
8930
8960
|
rangeMissingValue: {
|
|
8931
8961
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
8932
8962
|
description: 'error message if missing a value in a range',
|
|
@@ -8945,30 +8975,30 @@ function validateFilter(_ref, intl) {
|
|
|
8945
8975
|
_ref$allowFloat = _ref.allowFloat,
|
|
8946
8976
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
8947
8977
|
if (type !== 'range') {
|
|
8948
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
8978
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
8949
8979
|
return null;
|
|
8950
8980
|
}
|
|
8951
8981
|
|
|
8952
8982
|
// only range types from here
|
|
8953
8983
|
|
|
8954
8984
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
8955
|
-
from: intl.formatMessage(messages$
|
|
8985
|
+
from: intl.formatMessage(messages$K.integer)
|
|
8956
8986
|
};
|
|
8957
8987
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
8958
|
-
to: intl.formatMessage(messages$
|
|
8988
|
+
to: intl.formatMessage(messages$K.integer)
|
|
8959
8989
|
};
|
|
8960
8990
|
if (validateSingleFilter({
|
|
8961
8991
|
value: value.from
|
|
8962
8992
|
})) return {
|
|
8963
|
-
from: intl.formatMessage(messages$
|
|
8993
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
8964
8994
|
};
|
|
8965
8995
|
if (validateSingleFilter({
|
|
8966
8996
|
value: value.to
|
|
8967
8997
|
})) return {
|
|
8968
|
-
to: intl.formatMessage(messages$
|
|
8998
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
8969
8999
|
};
|
|
8970
9000
|
if (_parseFloat(value.to) < _parseFloat(value.from)) return {
|
|
8971
|
-
from: intl.formatMessage(messages$
|
|
9001
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
8972
9002
|
};
|
|
8973
9003
|
return null;
|
|
8974
9004
|
}
|
|
@@ -9262,10 +9292,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9262
9292
|
carts: 'carts'
|
|
9263
9293
|
};
|
|
9264
9294
|
|
|
9265
|
-
function ownKeys$
|
|
9266
|
-
function _objectSpread$
|
|
9295
|
+
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; }
|
|
9296
|
+
function _objectSpread$y(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$y(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$y(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9267
9297
|
const resourcesWithPlatformLimits = _Object$keys(RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9268
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9298
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$y({
|
|
9269
9299
|
[camelCase("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9270
9300
|
}, previousIncludedLimits), {});
|
|
9271
9301
|
|
|
@@ -9327,7 +9357,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9327
9357
|
};
|
|
9328
9358
|
};
|
|
9329
9359
|
|
|
9330
|
-
var messages$
|
|
9360
|
+
var messages$n = defineMessages({
|
|
9331
9361
|
shippingMethods: {
|
|
9332
9362
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9333
9363
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9355,8 +9385,8 @@ var messages$m = defineMessages({
|
|
|
9355
9385
|
}
|
|
9356
9386
|
});
|
|
9357
9387
|
|
|
9358
|
-
function ownKeys$
|
|
9359
|
-
function _objectSpread$
|
|
9388
|
+
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; }
|
|
9389
|
+
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; }
|
|
9360
9390
|
const getCustomerSupportLink$1 = msg => jsx(Link, {
|
|
9361
9391
|
isExternal: true,
|
|
9362
9392
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9367,7 +9397,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9367
9397
|
limit = _ref.limit;
|
|
9368
9398
|
return jsx(ContentNotification, {
|
|
9369
9399
|
type: "warning",
|
|
9370
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9400
|
+
children: jsx(FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$n[resource]), {}, {
|
|
9371
9401
|
values: {
|
|
9372
9402
|
limit,
|
|
9373
9403
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9380,7 +9410,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9380
9410
|
};
|
|
9381
9411
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9382
9412
|
|
|
9383
|
-
var messages$
|
|
9413
|
+
var messages$m = defineMessages({
|
|
9384
9414
|
shippingMethods: {
|
|
9385
9415
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9386
9416
|
description: 'error message about platform limit exceeded',
|
|
@@ -9408,8 +9438,8 @@ var messages$l = defineMessages({
|
|
|
9408
9438
|
}
|
|
9409
9439
|
});
|
|
9410
9440
|
|
|
9411
|
-
function ownKeys$
|
|
9412
|
-
function _objectSpread$
|
|
9441
|
+
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; }
|
|
9442
|
+
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; }
|
|
9413
9443
|
const getCustomerSupportLink = msg => jsx(Link, {
|
|
9414
9444
|
isExternal: true,
|
|
9415
9445
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9420,7 +9450,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9420
9450
|
limit = _ref.limit;
|
|
9421
9451
|
return jsx(ContentNotification, {
|
|
9422
9452
|
type: "error",
|
|
9423
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9453
|
+
children: jsx(FormattedMessage, _objectSpread$w(_objectSpread$w({}, messages$m[resource]), {}, {
|
|
9424
9454
|
values: {
|
|
9425
9455
|
limit,
|
|
9426
9456
|
customersupport: getCustomerSupportLink
|
|
@@ -9438,8 +9468,8 @@ const Notifications = {
|
|
|
9438
9468
|
Error: PlatformLimitErrorNotification
|
|
9439
9469
|
};
|
|
9440
9470
|
|
|
9441
|
-
function ownKeys$
|
|
9442
|
-
function _objectSpread$
|
|
9471
|
+
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; }
|
|
9472
|
+
function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$v(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$v(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9443
9473
|
const PlatformLimitsStatusText = _ref => {
|
|
9444
9474
|
let intlMessage = _ref.intlMessage,
|
|
9445
9475
|
children = _ref.children;
|
|
@@ -9448,7 +9478,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9448
9478
|
children: jsxs(Spacings.Inline, {
|
|
9449
9479
|
size: "xs",
|
|
9450
9480
|
children: [jsx("span", {
|
|
9451
|
-
children: intlMessage && jsx(FormattedMessage, _objectSpread$
|
|
9481
|
+
children: intlMessage && jsx(FormattedMessage, _objectSpread$v({}, intlMessage))
|
|
9452
9482
|
}), jsx("span", {
|
|
9453
9483
|
children: children
|
|
9454
9484
|
})]
|
|
@@ -9549,7 +9579,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9549
9579
|
};
|
|
9550
9580
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9551
9581
|
|
|
9552
|
-
var messages$
|
|
9582
|
+
var messages$l = defineMessages({
|
|
9553
9583
|
shippingMethodsPlatformLimitReached: {
|
|
9554
9584
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9555
9585
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9557,17 +9587,17 @@ var messages$k = defineMessages({
|
|
|
9557
9587
|
}
|
|
9558
9588
|
});
|
|
9559
9589
|
|
|
9560
|
-
function ownKeys$
|
|
9561
|
-
function _objectSpread$
|
|
9590
|
+
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; }
|
|
9591
|
+
function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$u(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$u(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9562
9592
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9563
9593
|
const intl = useIntl();
|
|
9564
|
-
return jsx(Tooltip, _objectSpread$
|
|
9565
|
-
title: intl.formatMessage(messages$
|
|
9594
|
+
return jsx(Tooltip, _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
9595
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9566
9596
|
}));
|
|
9567
9597
|
};
|
|
9568
9598
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9569
9599
|
|
|
9570
|
-
var messages$
|
|
9600
|
+
var messages$k = defineMessages({
|
|
9571
9601
|
shippingMethodsStatus: {
|
|
9572
9602
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9573
9603
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9576,15 +9606,15 @@ var messages$j = defineMessages({
|
|
|
9576
9606
|
});
|
|
9577
9607
|
|
|
9578
9608
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9579
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9609
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9580
9610
|
let total = _ref.total;
|
|
9581
9611
|
const intl = useIntl();
|
|
9582
9612
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9583
9613
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9584
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9585
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9614
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 || (_platformLimits$shipp = _platformLimits$shipp.total) === null || _platformLimits$shipp === void 0 ? void 0 : _platformLimits$shipp.current;
|
|
9615
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp2 = platformLimits.shippingMethods) === null || _platformLimits$shipp2 === void 0 || (_platformLimits$shipp2 = _platformLimits$shipp2.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.limit;
|
|
9586
9616
|
return jsx(PlatformLimitsStatusText, {
|
|
9587
|
-
intlMessage: messages$
|
|
9617
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9588
9618
|
children: getPlatformLimitsStatus({
|
|
9589
9619
|
limit,
|
|
9590
9620
|
current,
|
|
@@ -9615,15 +9645,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9615
9645
|
};
|
|
9616
9646
|
};
|
|
9617
9647
|
|
|
9618
|
-
function ownKeys$
|
|
9619
|
-
function _objectSpread$
|
|
9648
|
+
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; }
|
|
9649
|
+
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; }
|
|
9620
9650
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9621
9651
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9622
9652
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9623
9653
|
const shippingMethodsProps = {
|
|
9624
9654
|
platformLimits: shippingMethodsPlatformLimits
|
|
9625
9655
|
};
|
|
9626
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9656
|
+
return jsx(WrappedComponent, _objectSpread$t(_objectSpread$t({}, props), shippingMethodsProps));
|
|
9627
9657
|
};
|
|
9628
9658
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9629
9659
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9696,7 +9726,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9696
9726
|
};
|
|
9697
9727
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9698
9728
|
|
|
9699
|
-
var messages$
|
|
9729
|
+
var messages$j = defineMessages({
|
|
9700
9730
|
taxCategoriesPlatformLimitReached: {
|
|
9701
9731
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9702
9732
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9704,17 +9734,17 @@ var messages$i = defineMessages({
|
|
|
9704
9734
|
}
|
|
9705
9735
|
});
|
|
9706
9736
|
|
|
9707
|
-
function ownKeys$
|
|
9708
|
-
function _objectSpread$
|
|
9737
|
+
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; }
|
|
9738
|
+
function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$s(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$s(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9709
9739
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9710
9740
|
const intl = useIntl();
|
|
9711
|
-
return jsx(Tooltip, _objectSpread$
|
|
9712
|
-
title: intl.formatMessage(messages$
|
|
9741
|
+
return jsx(Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9742
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9713
9743
|
}));
|
|
9714
9744
|
};
|
|
9715
9745
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9716
9746
|
|
|
9717
|
-
var messages$
|
|
9747
|
+
var messages$i = defineMessages({
|
|
9718
9748
|
taxCategoriesStatus: {
|
|
9719
9749
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9720
9750
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9723,15 +9753,15 @@ var messages$h = defineMessages({
|
|
|
9723
9753
|
});
|
|
9724
9754
|
|
|
9725
9755
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9726
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9756
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9727
9757
|
let total = _ref.total;
|
|
9728
9758
|
const intl = useIntl();
|
|
9729
9759
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9730
9760
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9731
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9732
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9761
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 || (_platformLimits$taxCa = _platformLimits$taxCa.total) === null || _platformLimits$taxCa === void 0 ? void 0 : _platformLimits$taxCa.current;
|
|
9762
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa2 = platformLimits.taxCategories) === null || _platformLimits$taxCa2 === void 0 || (_platformLimits$taxCa2 = _platformLimits$taxCa2.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.limit;
|
|
9733
9763
|
return jsx(PlatformLimitsStatusText, {
|
|
9734
|
-
intlMessage: messages$
|
|
9764
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9735
9765
|
children: getPlatformLimitsStatus({
|
|
9736
9766
|
limit,
|
|
9737
9767
|
current,
|
|
@@ -9762,15 +9792,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9762
9792
|
};
|
|
9763
9793
|
};
|
|
9764
9794
|
|
|
9765
|
-
function ownKeys$
|
|
9766
|
-
function _objectSpread$
|
|
9795
|
+
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; }
|
|
9796
|
+
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; }
|
|
9767
9797
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9768
9798
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9769
9799
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9770
9800
|
const taxCategoriesProps = {
|
|
9771
9801
|
platformLimits: taxCategoriesPlatformLimits
|
|
9772
9802
|
};
|
|
9773
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9803
|
+
return jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), taxCategoriesProps));
|
|
9774
9804
|
};
|
|
9775
9805
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9776
9806
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9843,7 +9873,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9843
9873
|
};
|
|
9844
9874
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9845
9875
|
|
|
9846
|
-
var messages$
|
|
9876
|
+
var messages$h = defineMessages({
|
|
9847
9877
|
zonesPlatformLimitReached: {
|
|
9848
9878
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9849
9879
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9851,17 +9881,17 @@ var messages$g = defineMessages({
|
|
|
9851
9881
|
}
|
|
9852
9882
|
});
|
|
9853
9883
|
|
|
9854
|
-
function ownKeys$
|
|
9855
|
-
function _objectSpread$
|
|
9884
|
+
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; }
|
|
9885
|
+
function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$q(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9856
9886
|
const PlatformLimitsZonesTooltip = props => {
|
|
9857
9887
|
const intl = useIntl();
|
|
9858
|
-
return jsx(Tooltip, _objectSpread$
|
|
9859
|
-
title: intl.formatMessage(messages$
|
|
9888
|
+
return jsx(Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9889
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9860
9890
|
}));
|
|
9861
9891
|
};
|
|
9862
9892
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9863
9893
|
|
|
9864
|
-
var messages$
|
|
9894
|
+
var messages$g = defineMessages({
|
|
9865
9895
|
zonesStatus: {
|
|
9866
9896
|
id: 'PlatformLimits.Status.zones',
|
|
9867
9897
|
description: 'The message for zones platform limit values',
|
|
@@ -9870,15 +9900,15 @@ var messages$f = defineMessages({
|
|
|
9870
9900
|
});
|
|
9871
9901
|
|
|
9872
9902
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9873
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
9903
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9874
9904
|
let total = _ref.total;
|
|
9875
9905
|
const intl = useIntl();
|
|
9876
9906
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9877
9907
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9878
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9879
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9908
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 || (_platformLimits$zones = _platformLimits$zones.total) === null || _platformLimits$zones === void 0 ? void 0 : _platformLimits$zones.current;
|
|
9909
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones2 = platformLimits.zones) === null || _platformLimits$zones2 === void 0 || (_platformLimits$zones2 = _platformLimits$zones2.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.limit;
|
|
9880
9910
|
return jsx(PlatformLimitsStatusText, {
|
|
9881
|
-
intlMessage: messages$
|
|
9911
|
+
intlMessage: messages$g.zonesStatus,
|
|
9882
9912
|
children: getPlatformLimitsStatus({
|
|
9883
9913
|
limit,
|
|
9884
9914
|
current,
|
|
@@ -9909,15 +9939,15 @@ const useZonesLimits = () => {
|
|
|
9909
9939
|
};
|
|
9910
9940
|
};
|
|
9911
9941
|
|
|
9912
|
-
function ownKeys$
|
|
9913
|
-
function _objectSpread$
|
|
9942
|
+
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; }
|
|
9943
|
+
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$p(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9914
9944
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
9915
9945
|
const WithZonesPlatformLimits = props => {
|
|
9916
9946
|
const zonesPlatformLimits = useZonesLimits();
|
|
9917
9947
|
const zonesProps = {
|
|
9918
9948
|
platformLimits: zonesPlatformLimits
|
|
9919
9949
|
};
|
|
9920
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9950
|
+
return jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), zonesProps));
|
|
9921
9951
|
};
|
|
9922
9952
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
9923
9953
|
return WithZonesPlatformLimits;
|
|
@@ -10003,7 +10033,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10003
10033
|
};
|
|
10004
10034
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10005
10035
|
|
|
10006
|
-
var messages$
|
|
10036
|
+
var messages$f = defineMessages({
|
|
10007
10037
|
customersPlatformLimitReached: {
|
|
10008
10038
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10009
10039
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10011,17 +10041,17 @@ var messages$e = defineMessages({
|
|
|
10011
10041
|
}
|
|
10012
10042
|
});
|
|
10013
10043
|
|
|
10014
|
-
function ownKeys$
|
|
10015
|
-
function _objectSpread$
|
|
10044
|
+
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; }
|
|
10045
|
+
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; }
|
|
10016
10046
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10017
10047
|
const intl = useIntl();
|
|
10018
|
-
return jsx(Tooltip, _objectSpread$
|
|
10019
|
-
title: intl.formatMessage(messages$
|
|
10048
|
+
return jsx(Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
10049
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10020
10050
|
}));
|
|
10021
10051
|
};
|
|
10022
10052
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10023
10053
|
|
|
10024
|
-
var messages$
|
|
10054
|
+
var messages$e = defineMessages({
|
|
10025
10055
|
customersStatus: {
|
|
10026
10056
|
id: 'PlatformLimits.Status.customers',
|
|
10027
10057
|
description: 'The message for customers platform limit values',
|
|
@@ -10029,8 +10059,8 @@ var messages$d = defineMessages({
|
|
|
10029
10059
|
}
|
|
10030
10060
|
});
|
|
10031
10061
|
|
|
10032
|
-
function ownKeys$
|
|
10033
|
-
function _objectSpread$
|
|
10062
|
+
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; }
|
|
10063
|
+
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; }
|
|
10034
10064
|
var styles$b = {
|
|
10035
10065
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10036
10066
|
};
|
|
@@ -10050,7 +10080,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10050
10080
|
children: jsx(Text.Detail, {
|
|
10051
10081
|
tone: "secondary",
|
|
10052
10082
|
isInline: true,
|
|
10053
|
-
intlMessage: _objectSpread$
|
|
10083
|
+
intlMessage: _objectSpread$n(_objectSpread$n({}, messages$e.customersStatus), {}, {
|
|
10054
10084
|
values: {
|
|
10055
10085
|
current: intl.formatNumber(current),
|
|
10056
10086
|
limit: intl.formatNumber(limit)
|
|
@@ -10061,7 +10091,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10061
10091
|
};
|
|
10062
10092
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10063
10093
|
|
|
10064
|
-
var messages$
|
|
10094
|
+
var messages$d = defineMessages({
|
|
10065
10095
|
title: {
|
|
10066
10096
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10067
10097
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10074,10 +10104,10 @@ var messages$c = defineMessages({
|
|
|
10074
10104
|
}
|
|
10075
10105
|
});
|
|
10076
10106
|
|
|
10077
|
-
function ownKeys$
|
|
10078
|
-
function _objectSpread$
|
|
10107
|
+
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; }
|
|
10108
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$m(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10079
10109
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10080
|
-
return jsxs("svg", _objectSpread$
|
|
10110
|
+
return jsxs("svg", _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10081
10111
|
children: [jsx("defs", {
|
|
10082
10112
|
children: jsx("path", {
|
|
10083
10113
|
id: "a",
|
|
@@ -10185,7 +10215,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10185
10215
|
return jsx(InfoDialog, {
|
|
10186
10216
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10187
10217
|
onClose: onClose,
|
|
10188
|
-
title: intl.formatMessage(messages$
|
|
10218
|
+
title: intl.formatMessage(messages$d.title),
|
|
10189
10219
|
children: jsxs(Spacings.Stack, {
|
|
10190
10220
|
scale: "m",
|
|
10191
10221
|
alignItems: "center",
|
|
@@ -10194,7 +10224,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10194
10224
|
alignItems: "center",
|
|
10195
10225
|
children: [jsx(PlatformLimitsCustomersNotifications, {}), jsx(FlatButton, {
|
|
10196
10226
|
onClick: onClose,
|
|
10197
|
-
label: intl.formatMessage(messages$
|
|
10227
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10198
10228
|
icon: jsx(ListIcon, {
|
|
10199
10229
|
size: "medium",
|
|
10200
10230
|
color: "primary"
|
|
@@ -10249,15 +10279,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10249
10279
|
};
|
|
10250
10280
|
};
|
|
10251
10281
|
|
|
10252
|
-
function ownKeys$
|
|
10253
|
-
function _objectSpread$
|
|
10282
|
+
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; }
|
|
10283
|
+
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; }
|
|
10254
10284
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10255
10285
|
const WithCustomersPlatformLimits = props => {
|
|
10256
10286
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10257
10287
|
const customersProps = {
|
|
10258
10288
|
platformLimits: CustomersPlatformLimits
|
|
10259
10289
|
};
|
|
10260
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10290
|
+
return jsx(WrappedComponent, _objectSpread$l(_objectSpread$l({}, props), customersProps));
|
|
10261
10291
|
};
|
|
10262
10292
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10263
10293
|
return WithCustomersPlatformLimits;
|
|
@@ -10343,7 +10373,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10343
10373
|
};
|
|
10344
10374
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10345
10375
|
|
|
10346
|
-
var messages$
|
|
10376
|
+
var messages$c = defineMessages({
|
|
10347
10377
|
customerGroupsPlatformLimitReached: {
|
|
10348
10378
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10349
10379
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10351,17 +10381,17 @@ var messages$b = defineMessages({
|
|
|
10351
10381
|
}
|
|
10352
10382
|
});
|
|
10353
10383
|
|
|
10354
|
-
function ownKeys$
|
|
10355
|
-
function _objectSpread$
|
|
10384
|
+
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; }
|
|
10385
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10356
10386
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10357
10387
|
const intl = useIntl();
|
|
10358
|
-
return jsx(Tooltip, _objectSpread$
|
|
10359
|
-
title: intl.formatMessage(messages$
|
|
10388
|
+
return jsx(Tooltip, _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10389
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10360
10390
|
}));
|
|
10361
10391
|
};
|
|
10362
10392
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10363
10393
|
|
|
10364
|
-
var messages$
|
|
10394
|
+
var messages$b = defineMessages({
|
|
10365
10395
|
customerGroupsStatus: {
|
|
10366
10396
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10367
10397
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10369,8 +10399,8 @@ var messages$a = defineMessages({
|
|
|
10369
10399
|
}
|
|
10370
10400
|
});
|
|
10371
10401
|
|
|
10372
|
-
function ownKeys$
|
|
10373
|
-
function _objectSpread$
|
|
10402
|
+
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; }
|
|
10403
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$j(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10374
10404
|
var styles$9 = {
|
|
10375
10405
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10376
10406
|
};
|
|
@@ -10390,7 +10420,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10390
10420
|
children: jsx(Text.Detail, {
|
|
10391
10421
|
tone: "secondary",
|
|
10392
10422
|
isInline: true,
|
|
10393
|
-
intlMessage: _objectSpread$
|
|
10423
|
+
intlMessage: _objectSpread$j(_objectSpread$j({}, messages$b.customerGroupsStatus), {}, {
|
|
10394
10424
|
values: {
|
|
10395
10425
|
current: intl.formatNumber(current),
|
|
10396
10426
|
limit: intl.formatNumber(limit)
|
|
@@ -10401,7 +10431,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10401
10431
|
};
|
|
10402
10432
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10403
10433
|
|
|
10404
|
-
var messages$
|
|
10434
|
+
var messages$a = defineMessages({
|
|
10405
10435
|
title: {
|
|
10406
10436
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10407
10437
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10414,10 +10444,10 @@ var messages$9 = defineMessages({
|
|
|
10414
10444
|
}
|
|
10415
10445
|
});
|
|
10416
10446
|
|
|
10417
|
-
function ownKeys$
|
|
10418
|
-
function _objectSpread$
|
|
10447
|
+
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; }
|
|
10448
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$i(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10419
10449
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10420
|
-
return jsxs("svg", _objectSpread$
|
|
10450
|
+
return jsxs("svg", _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10421
10451
|
children: [jsx("defs", {
|
|
10422
10452
|
children: jsx("path", {
|
|
10423
10453
|
id: "a",
|
|
@@ -10525,7 +10555,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10525
10555
|
return jsx(InfoDialog, {
|
|
10526
10556
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10527
10557
|
onClose: onClose,
|
|
10528
|
-
title: intl.formatMessage(messages$
|
|
10558
|
+
title: intl.formatMessage(messages$a.title),
|
|
10529
10559
|
children: jsxs(Spacings.Stack, {
|
|
10530
10560
|
scale: "m",
|
|
10531
10561
|
alignItems: "center",
|
|
@@ -10534,7 +10564,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10534
10564
|
alignItems: "center",
|
|
10535
10565
|
children: [jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsx(FlatButton, {
|
|
10536
10566
|
onClick: onClose,
|
|
10537
|
-
label: intl.formatMessage(messages$
|
|
10567
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10538
10568
|
icon: jsx(ListIcon, {
|
|
10539
10569
|
size: "medium",
|
|
10540
10570
|
color: "primary"
|
|
@@ -10589,15 +10619,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10589
10619
|
};
|
|
10590
10620
|
};
|
|
10591
10621
|
|
|
10592
|
-
function ownKeys$
|
|
10593
|
-
function _objectSpread$
|
|
10622
|
+
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; }
|
|
10623
|
+
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; }
|
|
10594
10624
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10595
10625
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10596
10626
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10597
10627
|
const customersProps = {
|
|
10598
10628
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10599
10629
|
};
|
|
10600
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10630
|
+
return jsx(WrappedComponent, _objectSpread$h(_objectSpread$h({}, props), customersProps));
|
|
10601
10631
|
};
|
|
10602
10632
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10603
10633
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10652,7 +10682,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10652
10682
|
}
|
|
10653
10683
|
});
|
|
10654
10684
|
|
|
10655
|
-
var messages$
|
|
10685
|
+
var messages$9 = defineMessages({
|
|
10656
10686
|
indexingSucceed: {
|
|
10657
10687
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10658
10688
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10690,8 +10720,8 @@ const defaultValue = {
|
|
|
10690
10720
|
*/
|
|
10691
10721
|
const PimIndexerContext = /*#__PURE__*/createContext(defaultValue);
|
|
10692
10722
|
|
|
10693
|
-
function ownKeys$
|
|
10694
|
-
function _objectSpread$
|
|
10723
|
+
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; }
|
|
10724
|
+
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; }
|
|
10695
10725
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); 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); }; }
|
|
10696
10726
|
function _isNativeReflectConstruct$3() { 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; } }
|
|
10697
10727
|
var RefreshProductIndices = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "RefreshProductIndices" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "ids" } }, type: { kind: "NonNullType", 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: "refreshProducts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "ids" }, value: { kind: "Variable", name: { kind: "Name", value: "ids" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatedDocuments" }, 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: "deletedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "notFoundDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "unchangedDocuments" }, 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: "failedRefreshedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 1119, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -10777,7 +10807,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10777
10807
|
_this.props.notifications.showNotification({
|
|
10778
10808
|
kind: 'error',
|
|
10779
10809
|
domain: DOMAINS.SIDE,
|
|
10780
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10810
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10781
10811
|
});
|
|
10782
10812
|
};
|
|
10783
10813
|
_this.getIndexingProgress = async () => {
|
|
@@ -10818,7 +10848,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10818
10848
|
_this.props.notifications.showNotification({
|
|
10819
10849
|
kind: 'success',
|
|
10820
10850
|
domain: DOMAINS.SIDE,
|
|
10821
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10851
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10822
10852
|
},
|
|
10823
10853
|
// because the indexing may take so long, the success notification
|
|
10824
10854
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10867,7 +10897,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10867
10897
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10868
10898
|
}
|
|
10869
10899
|
});
|
|
10870
|
-
_this.setState(_objectSpread$
|
|
10900
|
+
_this.setState(_objectSpread$g(_objectSpread$g({
|
|
10871
10901
|
isLoading: false,
|
|
10872
10902
|
isProjectBeingIndexedByPim: true
|
|
10873
10903
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10892,7 +10922,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10892
10922
|
key: "render",
|
|
10893
10923
|
value: function render() {
|
|
10894
10924
|
return jsx(PimIndexerContext.Provider, {
|
|
10895
|
-
value: _objectSpread$
|
|
10925
|
+
value: _objectSpread$g(_objectSpread$g({}, this.state), {}, {
|
|
10896
10926
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
10897
10927
|
indexProject: this.indexProject
|
|
10898
10928
|
}),
|
|
@@ -10934,13 +10964,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
10934
10964
|
}(PureComponent);
|
|
10935
10965
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
10936
10966
|
|
|
10937
|
-
function ownKeys$
|
|
10938
|
-
function _objectSpread$
|
|
10967
|
+
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; }
|
|
10968
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10939
10969
|
var injectPimIndexer = (function () {
|
|
10940
10970
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
10941
10971
|
return Component => {
|
|
10942
10972
|
const WrappedComponent = props => jsx(WithPimIndexer, {
|
|
10943
|
-
children: pimIndexerProps => jsx(Component, _objectSpread$
|
|
10973
|
+
children: pimIndexerProps => jsx(Component, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
10944
10974
|
[propName]: pimIndexerProps
|
|
10945
10975
|
}))
|
|
10946
10976
|
});
|
|
@@ -10953,7 +10983,7 @@ function usePimIndexer() {
|
|
|
10953
10983
|
return useContext(PimIndexerContext);
|
|
10954
10984
|
}
|
|
10955
10985
|
|
|
10956
|
-
var messages$
|
|
10986
|
+
var messages$8 = defineMessages({
|
|
10957
10987
|
yes: {
|
|
10958
10988
|
id: 'BooleanField.yes',
|
|
10959
10989
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -10975,8 +11005,8 @@ const BooleanField = props => {
|
|
|
10975
11005
|
var _context;
|
|
10976
11006
|
let selectedValue;
|
|
10977
11007
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray(props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
10978
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
10979
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11008
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11009
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
10980
11010
|
const options = [{
|
|
10981
11011
|
value: 'yes',
|
|
10982
11012
|
label: yesLabel
|
|
@@ -11014,7 +11044,7 @@ function getBooleanValue(value) {
|
|
|
11014
11044
|
return value === false ? 'no' : 'yes';
|
|
11015
11045
|
}
|
|
11016
11046
|
|
|
11017
|
-
var messages$
|
|
11047
|
+
var messages$7 = defineMessages({
|
|
11018
11048
|
label: {
|
|
11019
11049
|
id: 'MissingValueField.label',
|
|
11020
11050
|
description: 'The label text for the missing values option',
|
|
@@ -11022,20 +11052,20 @@ var messages$6 = defineMessages({
|
|
|
11022
11052
|
}
|
|
11023
11053
|
});
|
|
11024
11054
|
|
|
11025
|
-
function ownKeys$
|
|
11026
|
-
function _objectSpread$
|
|
11055
|
+
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; }
|
|
11056
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$e(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11027
11057
|
const MissingValueField = props => jsx(CheckboxInput, {
|
|
11028
11058
|
name: "missing-value",
|
|
11029
11059
|
isChecked: props.isChecked,
|
|
11030
11060
|
onChange: props.onChange,
|
|
11031
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11061
|
+
children: jsx(FormattedMessage, _objectSpread$e({}, messages$7.label))
|
|
11032
11062
|
});
|
|
11033
11063
|
MissingValueField.defaultProps = {
|
|
11034
11064
|
isChecked: false
|
|
11035
11065
|
};
|
|
11036
11066
|
|
|
11037
|
-
function ownKeys$
|
|
11038
|
-
function _objectSpread$
|
|
11067
|
+
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; }
|
|
11068
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$d(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11039
11069
|
var styles$7 = {
|
|
11040
11070
|
"button": "button-module__button___1OzVf",
|
|
11041
11071
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11069,7 +11099,7 @@ const Button = props => {
|
|
|
11069
11099
|
|
|
11070
11100
|
// Pass only `data-*` props
|
|
11071
11101
|
const dataProps = filterDataAttributes(props);
|
|
11072
|
-
return jsx("button", _objectSpread$
|
|
11102
|
+
return jsx("button", _objectSpread$d(_objectSpread$d({
|
|
11073
11103
|
onClick: isDisabled ? null : onClick,
|
|
11074
11104
|
type: props.type,
|
|
11075
11105
|
className: classnames(styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11084,7 +11114,7 @@ Button.defaultProps = {
|
|
|
11084
11114
|
type: 'button'
|
|
11085
11115
|
};
|
|
11086
11116
|
|
|
11087
|
-
var messages$
|
|
11117
|
+
var messages$6 = defineMessages({
|
|
11088
11118
|
chooseFile: {
|
|
11089
11119
|
id: 'ButtonFileInput.chooseFile',
|
|
11090
11120
|
description: 'The label text of the field for upload local file',
|
|
@@ -11092,8 +11122,8 @@ var messages$5 = defineMessages({
|
|
|
11092
11122
|
}
|
|
11093
11123
|
});
|
|
11094
11124
|
|
|
11095
|
-
function ownKeys$
|
|
11096
|
-
function _objectSpread$
|
|
11125
|
+
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; }
|
|
11126
|
+
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; }
|
|
11097
11127
|
var styles$6 = {
|
|
11098
11128
|
"button": "file-input-module__button___2KypN",
|
|
11099
11129
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11113,7 +11143,7 @@ const FileInput = props => jsx("label", {
|
|
|
11113
11143
|
});
|
|
11114
11144
|
FileInput.displayName = 'FileInput';
|
|
11115
11145
|
FileInput.defaultProps = {
|
|
11116
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11146
|
+
children: jsx(FormattedMessage, _objectSpread$c({}, messages$6.chooseFile)),
|
|
11117
11147
|
allowMultiple: false,
|
|
11118
11148
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11119
11149
|
};
|
|
@@ -11160,7 +11190,7 @@ const ScrollToFieldError = () => {
|
|
|
11160
11190
|
return null;
|
|
11161
11191
|
};
|
|
11162
11192
|
|
|
11163
|
-
var messages$
|
|
11193
|
+
var messages$5 = defineMessages({
|
|
11164
11194
|
buttonLabel: {
|
|
11165
11195
|
id: 'SearchInput.buttonLabel',
|
|
11166
11196
|
description: 'Label for "Search" button.',
|
|
@@ -11215,15 +11245,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11215
11245
|
});
|
|
11216
11246
|
},
|
|
11217
11247
|
onReset: props.onReset,
|
|
11218
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11248
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11219
11249
|
isDisabled: props.disabled
|
|
11220
11250
|
})
|
|
11221
11251
|
});
|
|
11222
11252
|
};
|
|
11223
11253
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11224
11254
|
|
|
11225
|
-
function ownKeys$
|
|
11226
|
-
function _objectSpread$
|
|
11255
|
+
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; }
|
|
11256
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11227
11257
|
const StoreSelectField = props => {
|
|
11228
11258
|
return jsx(Constraints.Horizontal, {
|
|
11229
11259
|
max: props.horizontalConstraint,
|
|
@@ -11237,7 +11267,7 @@ const StoreSelectField = props => {
|
|
|
11237
11267
|
htmlFor: props.id,
|
|
11238
11268
|
hasRequiredIndicator: props.isRequired,
|
|
11239
11269
|
isBold: true
|
|
11240
|
-
}), jsx(StoreSelectInput, _objectSpread$
|
|
11270
|
+
}), jsx(StoreSelectInput, _objectSpread$b(_objectSpread$b({
|
|
11241
11271
|
projectKey: props.projectKey,
|
|
11242
11272
|
id: props.id,
|
|
11243
11273
|
name: props.name,
|
|
@@ -11277,8 +11307,8 @@ StoreSelectField.defaultProps = {
|
|
|
11277
11307
|
};
|
|
11278
11308
|
|
|
11279
11309
|
var _templateObject;
|
|
11280
|
-
function ownKeys$
|
|
11281
|
-
function _objectSpread$
|
|
11310
|
+
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; }
|
|
11311
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$a(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$a(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11282
11312
|
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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); }; }
|
|
11283
11313
|
function _isNativeReflectConstruct$1() { 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; } }
|
|
11284
11314
|
var styles$3 = {
|
|
@@ -11295,7 +11325,7 @@ const validateRequired = value => {
|
|
|
11295
11325
|
};
|
|
11296
11326
|
const VALIDATOR_REQUIRED = {
|
|
11297
11327
|
name: 'required',
|
|
11298
|
-
message: messages$
|
|
11328
|
+
message: messages$K.required,
|
|
11299
11329
|
permanent: true,
|
|
11300
11330
|
validators: {
|
|
11301
11331
|
change(value) {
|
|
@@ -11309,7 +11339,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11309
11339
|
};
|
|
11310
11340
|
const VALIDATOR_NUMERIC = {
|
|
11311
11341
|
name: 'numeric',
|
|
11312
|
-
message: messages$
|
|
11342
|
+
message: messages$K.numeric,
|
|
11313
11343
|
permanent: false,
|
|
11314
11344
|
validators: {
|
|
11315
11345
|
change: v => {
|
|
@@ -11324,7 +11354,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11324
11354
|
};
|
|
11325
11355
|
const VALIDATOR_INTEGER = {
|
|
11326
11356
|
name: 'integer',
|
|
11327
|
-
message: messages$
|
|
11357
|
+
message: messages$K.integer,
|
|
11328
11358
|
permanent: false,
|
|
11329
11359
|
validators: {
|
|
11330
11360
|
change: v => {
|
|
@@ -11339,7 +11369,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11339
11369
|
};
|
|
11340
11370
|
({
|
|
11341
11371
|
name: 'email',
|
|
11342
|
-
message: messages$
|
|
11372
|
+
message: messages$K.email,
|
|
11343
11373
|
permanent: false,
|
|
11344
11374
|
validators: {
|
|
11345
11375
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11428,7 +11458,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11428
11458
|
* so it must be an invalid numeric value
|
|
11429
11459
|
*/
|
|
11430
11460
|
_this.handleInvalid = () => {
|
|
11431
|
-
const nextValidStatus = _objectSpread$
|
|
11461
|
+
const nextValidStatus = _objectSpread$a({}, _this.state.validStatus);
|
|
11432
11462
|
if (has(nextValidStatus, 'numeric')) {
|
|
11433
11463
|
nextValidStatus.numeric = false;
|
|
11434
11464
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11462,10 +11492,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11462
11492
|
process.env.NODE_ENV !== "production" ? warning(hasWarned, warningMessage) : void 0;
|
|
11463
11493
|
hasWarned = true;
|
|
11464
11494
|
}
|
|
11465
|
-
// eslint-disable-next-line camelcase
|
|
11466
11495
|
}, {
|
|
11467
|
-
key: "
|
|
11468
|
-
value: function
|
|
11496
|
+
key: "componentDidUpdate",
|
|
11497
|
+
value: function componentDidUpdate() {
|
|
11498
|
+
const nextProps = this.props;
|
|
11469
11499
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11470
11500
|
this.resetValidity();
|
|
11471
11501
|
this.handleChange(nextProps.value, {
|
|
@@ -11480,7 +11510,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11480
11510
|
if (prev) return this.state.validStatus[v.name];
|
|
11481
11511
|
return prev;
|
|
11482
11512
|
}, true);
|
|
11483
|
-
const componentProps = _objectSpread$
|
|
11513
|
+
const componentProps = _objectSpread$a(_objectSpread$a({}, this.props), {}, {
|
|
11484
11514
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11485
11515
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11486
11516
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11497,7 +11527,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11497
11527
|
components: {
|
|
11498
11528
|
WrapperComponent: ToolTipWrapperComponent
|
|
11499
11529
|
},
|
|
11500
|
-
children: jsx(_InnerComponent, _objectSpread$
|
|
11530
|
+
children: jsx(_InnerComponent, _objectSpread$a({}, componentProps))
|
|
11501
11531
|
})
|
|
11502
11532
|
});
|
|
11503
11533
|
}
|
|
@@ -11552,7 +11582,7 @@ function simpleInput(type) {
|
|
|
11552
11582
|
}, _class;
|
|
11553
11583
|
}
|
|
11554
11584
|
|
|
11555
|
-
var messages$
|
|
11585
|
+
var messages$4 = defineMessages({
|
|
11556
11586
|
customFieldsError: {
|
|
11557
11587
|
id: 'CustomFieldsError.Error',
|
|
11558
11588
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11560,14 +11590,14 @@ var messages$3 = defineMessages({
|
|
|
11560
11590
|
}
|
|
11561
11591
|
});
|
|
11562
11592
|
|
|
11563
|
-
function ownKeys$
|
|
11564
|
-
function _objectSpread$
|
|
11593
|
+
function ownKeys$9(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; }
|
|
11594
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$9(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$9(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11565
11595
|
const CustomFieldsErrorTextNotification = props => {
|
|
11566
11596
|
var _context;
|
|
11567
11597
|
return jsxs(Spacings.Stack, {
|
|
11568
11598
|
scale: "s",
|
|
11569
11599
|
children: [jsx(Text.Wrap, {
|
|
11570
|
-
intlMessage: _objectSpread$
|
|
11600
|
+
intlMessage: _objectSpread$9({}, messages$4.customFieldsError)
|
|
11571
11601
|
}), jsx(Spacings.Stack, {
|
|
11572
11602
|
scale: "xs",
|
|
11573
11603
|
children: _mapInstanceProperty(_context = props.formErrors).call(_context, formError => jsx(Text.Detail, {
|
|
@@ -11579,7 +11609,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11579
11609
|
};
|
|
11580
11610
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11581
11611
|
|
|
11582
|
-
const messages$
|
|
11612
|
+
const messages$3 = defineMessages({
|
|
11583
11613
|
from: {
|
|
11584
11614
|
id: 'LabelRange.from',
|
|
11585
11615
|
description: 'The label for "from" range',
|
|
@@ -11592,8 +11622,8 @@ const messages$2 = defineMessages({
|
|
|
11592
11622
|
}
|
|
11593
11623
|
});
|
|
11594
11624
|
|
|
11595
|
-
function ownKeys$
|
|
11596
|
-
function _objectSpread$
|
|
11625
|
+
function ownKeys$8(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; }
|
|
11626
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11597
11627
|
var styles$2 = {
|
|
11598
11628
|
"label": "label-range-module__label___3Tb0p"
|
|
11599
11629
|
};
|
|
@@ -11601,12 +11631,12 @@ const LabelRange = _ref => {
|
|
|
11601
11631
|
let type = _ref.type;
|
|
11602
11632
|
return jsx("label", {
|
|
11603
11633
|
className: styles$2.label,
|
|
11604
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11634
|
+
children: jsx(FormattedMessage, _objectSpread$8({}, messages$3[type]))
|
|
11605
11635
|
});
|
|
11606
11636
|
};
|
|
11607
11637
|
LabelRange.displayName = 'LabelRange';
|
|
11608
11638
|
|
|
11609
|
-
var messages$
|
|
11639
|
+
var messages$2 = defineMessages({
|
|
11610
11640
|
filterWholeInput: {
|
|
11611
11641
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11612
11642
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11619,8 +11649,8 @@ var messages$1 = defineMessages({
|
|
|
11619
11649
|
}
|
|
11620
11650
|
});
|
|
11621
11651
|
|
|
11622
|
-
function ownKeys$
|
|
11623
|
-
function _objectSpread$
|
|
11652
|
+
function ownKeys$7(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; }
|
|
11653
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$7(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$7(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11624
11654
|
var styles$1 = {
|
|
11625
11655
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11626
11656
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11644,7 +11674,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11644
11674
|
}),
|
|
11645
11675
|
children: jsx(Text.Body, {
|
|
11646
11676
|
truncate: true,
|
|
11647
|
-
intlMessage: _objectSpread$
|
|
11677
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterWholeInput), {}, {
|
|
11648
11678
|
values: {
|
|
11649
11679
|
values: "\"".concat(props.value, "\"")
|
|
11650
11680
|
}
|
|
@@ -11657,7 +11687,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11657
11687
|
}),
|
|
11658
11688
|
children: jsx(Text.Body, {
|
|
11659
11689
|
truncate: true,
|
|
11660
|
-
intlMessage: _objectSpread$
|
|
11690
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterSeparateValues), {}, {
|
|
11661
11691
|
values: {
|
|
11662
11692
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11663
11693
|
}
|
|
@@ -11768,8 +11798,8 @@ const MultiValueSearchInput = props => {
|
|
|
11768
11798
|
};
|
|
11769
11799
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11770
11800
|
|
|
11771
|
-
function ownKeys$
|
|
11772
|
-
function _objectSpread$
|
|
11801
|
+
function ownKeys$6(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; }
|
|
11802
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11773
11803
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); 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); }; }
|
|
11774
11804
|
function _isNativeReflectConstruct() { 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; } }
|
|
11775
11805
|
var styles = {
|
|
@@ -11832,7 +11862,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11832
11862
|
value: function render() {
|
|
11833
11863
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11834
11864
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11835
|
-
return jsx(Cleave, _objectSpread$
|
|
11865
|
+
return jsx(Cleave, _objectSpread$6({
|
|
11836
11866
|
placeholder: this.props.placeholder,
|
|
11837
11867
|
htmlRef: this.registerInputRef,
|
|
11838
11868
|
options: {
|
|
@@ -12128,8 +12158,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12128
12158
|
}
|
|
12129
12159
|
};
|
|
12130
12160
|
|
|
12131
|
-
function ownKeys$
|
|
12132
|
-
function _objectSpread$
|
|
12161
|
+
function ownKeys$5(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; }
|
|
12162
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12133
12163
|
/**
|
|
12134
12164
|
* Creates reducer
|
|
12135
12165
|
* @param {Object} initialState
|
|
@@ -12145,13 +12175,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12145
12175
|
|
|
12146
12176
|
// In case reducer ignored action, avoid creating new object
|
|
12147
12177
|
const newSubstate = reduce(newState, action);
|
|
12148
|
-
if (newSubstate) return _objectSpread$
|
|
12178
|
+
if (newSubstate) return _objectSpread$5(_objectSpread$5({}, newState), newSubstate);
|
|
12149
12179
|
return newState;
|
|
12150
12180
|
};
|
|
12151
12181
|
}
|
|
12152
12182
|
|
|
12153
|
-
function ownKeys$
|
|
12154
|
-
function _objectSpread$
|
|
12183
|
+
function ownKeys$4(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; }
|
|
12184
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12155
12185
|
function updateStatusInList(mergeData) {
|
|
12156
12186
|
return (state, _ref) => {
|
|
12157
12187
|
let payload = _ref.payload;
|
|
@@ -12160,15 +12190,15 @@ function updateStatusInList(mergeData) {
|
|
|
12160
12190
|
results[index] = mergeData(payload, results[index]);
|
|
12161
12191
|
results[index].checked = false;
|
|
12162
12192
|
return {
|
|
12163
|
-
currentQueryResult: _objectSpread$
|
|
12193
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12164
12194
|
results
|
|
12165
12195
|
})
|
|
12166
12196
|
};
|
|
12167
12197
|
};
|
|
12168
12198
|
}
|
|
12169
12199
|
|
|
12170
|
-
function ownKeys$
|
|
12171
|
-
function _objectSpread$
|
|
12200
|
+
function ownKeys$3(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; }
|
|
12201
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12172
12202
|
const identity = value => value;
|
|
12173
12203
|
function createResourceReducer(options) {
|
|
12174
12204
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12178,7 +12208,7 @@ function createResourceReducer(options) {
|
|
|
12178
12208
|
_options$initialState = options.initialState,
|
|
12179
12209
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12180
12210
|
const mergeData = options.mergeData || identity;
|
|
12181
|
-
const initialState = _objectSpread$
|
|
12211
|
+
const initialState = _objectSpread$3({
|
|
12182
12212
|
currentQueryResult: {
|
|
12183
12213
|
count: 0,
|
|
12184
12214
|
offset: 0,
|
|
@@ -12198,7 +12228,7 @@ function createResourceReducer(options) {
|
|
|
12198
12228
|
let payload = _ref.payload;
|
|
12199
12229
|
const results = state.currentQueryResult.results;
|
|
12200
12230
|
return {
|
|
12201
|
-
currentQueryResult: _objectSpread$
|
|
12231
|
+
currentQueryResult: _objectSpread$3(_objectSpread$3({}, state.currentQueryResult), {}, {
|
|
12202
12232
|
results: _filterInstanceProperty(results).call(results, _ref2 => {
|
|
12203
12233
|
let id = _ref2.id;
|
|
12204
12234
|
return id !== payload.id;
|
|
@@ -12276,17 +12306,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12276
12306
|
}
|
|
12277
12307
|
|
|
12278
12308
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12279
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12309
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12280
12310
|
return null;
|
|
12281
12311
|
};
|
|
12282
12312
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12283
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12313
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12284
12314
|
return null;
|
|
12285
12315
|
};
|
|
12286
12316
|
|
|
12287
12317
|
// eslint-disable-next-line import/prefer-default-export
|
|
12288
12318
|
const validateText = (text, intl) => {
|
|
12289
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12319
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12290
12320
|
return null;
|
|
12291
12321
|
};
|
|
12292
12322
|
|
|
@@ -12373,7 +12403,7 @@ const safelyAddFallback = function (string) {
|
|
|
12373
12403
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12374
12404
|
};
|
|
12375
12405
|
|
|
12376
|
-
var messages = defineMessages({
|
|
12406
|
+
var messages$1 = defineMessages({
|
|
12377
12407
|
booleanAttributeTrue: {
|
|
12378
12408
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12379
12409
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12566,7 +12596,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12566
12596
|
case 'boolean':
|
|
12567
12597
|
{
|
|
12568
12598
|
if (isNil$1(value)) return NO_VALUE_FALLBACK;
|
|
12569
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12599
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12570
12600
|
}
|
|
12571
12601
|
case 'reference':
|
|
12572
12602
|
return value.id || NO_VALUE_FALLBACK;
|
|
@@ -12702,8 +12732,8 @@ const getTimeZoneId = memoize((selectedTimeZone, timeZones) => {
|
|
|
12702
12732
|
} else {
|
|
12703
12733
|
var _context3;
|
|
12704
12734
|
const fallbackTimeZoneId = _findInstanceProperty(_context3 = _Object$keys(timeZones)).call(_context3, timeZoneId => {
|
|
12705
|
-
var _timeZones$timeZoneId
|
|
12706
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12735
|
+
var _timeZones$timeZoneId;
|
|
12736
|
+
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0 || (_timeZones$timeZoneId = _timeZones$timeZoneId.translationFor) === null || _timeZones$timeZoneId === void 0 ? void 0 : _someInstanceProperty(_timeZones$timeZoneId).call(_timeZones$timeZoneId, fallbackTimeZone => fallbackTimeZone === selectedTimeZone);
|
|
12707
12737
|
});
|
|
12708
12738
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12709
12739
|
return fallbackTimeZoneId.toString();
|
|
@@ -12719,8 +12749,8 @@ const getTimeZoneLabel = memoize((selectedTimeZone, timeZones) => {
|
|
|
12719
12749
|
return _concatInstanceProperty(_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12720
12750
|
});
|
|
12721
12751
|
|
|
12722
|
-
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; }
|
|
12723
|
-
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; }
|
|
12752
|
+
function ownKeys$2(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; }
|
|
12753
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12724
12754
|
function withPendingRequests() {
|
|
12725
12755
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12726
12756
|
return Component => {
|
|
@@ -12729,13 +12759,184 @@ function withPendingRequests() {
|
|
|
12729
12759
|
const pendingProp = {
|
|
12730
12760
|
[propName]: pendingRequests
|
|
12731
12761
|
};
|
|
12732
|
-
return jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12762
|
+
return jsx(Component, _objectSpread$2(_objectSpread$2({}, props), pendingProp));
|
|
12733
12763
|
};
|
|
12734
12764
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12735
12765
|
return WrappedComponent;
|
|
12736
12766
|
};
|
|
12737
12767
|
}
|
|
12738
12768
|
|
|
12769
|
+
var messages = defineMessages({
|
|
12770
|
+
noCustomFields: {
|
|
12771
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12772
|
+
description: 'The label when there are no custom fields defined',
|
|
12773
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12774
|
+
},
|
|
12775
|
+
noCustomType: {
|
|
12776
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12777
|
+
description: 'The label when there is no custom type selected',
|
|
12778
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12779
|
+
},
|
|
12780
|
+
noTypes: {
|
|
12781
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12782
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12783
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12784
|
+
},
|
|
12785
|
+
title: {
|
|
12786
|
+
id: 'CustomTypesSubform.title',
|
|
12787
|
+
description: 'Fallback title for the subform',
|
|
12788
|
+
defaultMessage: 'Custom fields'
|
|
12789
|
+
},
|
|
12790
|
+
typesPlaceholder: {
|
|
12791
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12792
|
+
description: 'The placeholder for the types',
|
|
12793
|
+
defaultMessage: 'Select...'
|
|
12794
|
+
}
|
|
12795
|
+
});
|
|
12796
|
+
|
|
12797
|
+
function ownKeys$1(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; }
|
|
12798
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12799
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12800
|
+
return typeDefinitions.length > 0;
|
|
12801
|
+
};
|
|
12802
|
+
const typeDefinitionSelected = formValues => {
|
|
12803
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12804
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
12805
|
+
};
|
|
12806
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12807
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12808
|
+
};
|
|
12809
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12810
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12811
|
+
isReadOnly = _ref.isReadOnly;
|
|
12812
|
+
const _useFormikContext = useFormikContext(),
|
|
12813
|
+
formValues = _valuesInstanceProperty(_useFormikContext);
|
|
12814
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12815
|
+
return jsx(FormattedMessage, _objectSpread$1({}, messages.noTypes));
|
|
12816
|
+
}
|
|
12817
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12818
|
+
return jsx(FormattedMessage, _objectSpread$1({}, messages.noCustomType));
|
|
12819
|
+
}
|
|
12820
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12821
|
+
return jsx(FormattedMessage, _objectSpread$1({}, messages.noCustomFields));
|
|
12822
|
+
}
|
|
12823
|
+
return jsx(Constraints.Horizontal, {
|
|
12824
|
+
max: "scale",
|
|
12825
|
+
children: jsx(CustomFields, {
|
|
12826
|
+
isReadOnly: isReadOnly,
|
|
12827
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12828
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12829
|
+
})
|
|
12830
|
+
});
|
|
12831
|
+
};
|
|
12832
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12833
|
+
|
|
12834
|
+
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; }
|
|
12835
|
+
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; }
|
|
12836
|
+
const FIELD_NAME = 'custom';
|
|
12837
|
+
|
|
12838
|
+
// Creates dropdown options
|
|
12839
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12840
|
+
return _mapInstanceProperty(typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12841
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12842
|
+
value: typeDefinition.type.key,
|
|
12843
|
+
label: formatLocalizedString(typeDefinition.type, {
|
|
12844
|
+
key: 'name',
|
|
12845
|
+
locale: language,
|
|
12846
|
+
fallbackOrder: languages
|
|
12847
|
+
})
|
|
12848
|
+
}));
|
|
12849
|
+
};
|
|
12850
|
+
|
|
12851
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12852
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12853
|
+
return {
|
|
12854
|
+
type: {
|
|
12855
|
+
id: selectedTypeDefinition.type.id,
|
|
12856
|
+
obj: {
|
|
12857
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12858
|
+
key: selectedTypeDefinition.type.key
|
|
12859
|
+
}
|
|
12860
|
+
},
|
|
12861
|
+
fields: {}
|
|
12862
|
+
};
|
|
12863
|
+
};
|
|
12864
|
+
const CustomTypeSubform = _ref => {
|
|
12865
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12866
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12867
|
+
isReadOnly = _ref.isReadOnly;
|
|
12868
|
+
const _useFormikContext = useFormikContext(),
|
|
12869
|
+
formValues = _valuesInstanceProperty(_useFormikContext),
|
|
12870
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
12871
|
+
const _useIntl = useIntl(),
|
|
12872
|
+
formatMessage = _useIntl.formatMessage;
|
|
12873
|
+
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
12874
|
+
language: applicationContext.dataLocale,
|
|
12875
|
+
languages: applicationContext.project.languages
|
|
12876
|
+
})),
|
|
12877
|
+
language = _useApplicationContex.language,
|
|
12878
|
+
languages = _useApplicationContex.languages;
|
|
12879
|
+
const handleTypeDefinitionSelect = useCallback(event => {
|
|
12880
|
+
const selectedTypeDefinition = _findInstanceProperty(typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12881
|
+
if (selectedTypeDefinition) {
|
|
12882
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12883
|
+
setFieldValue(FIELD_NAME, nextCustom);
|
|
12884
|
+
} else {
|
|
12885
|
+
// if the dropdown selector is cleared
|
|
12886
|
+
const emptyFormState = CustomFieldTypeDefinitionsConnector$1.createEmptyCustomFields(formValues[FIELD_NAME].type);
|
|
12887
|
+
setFieldValue(FIELD_NAME, emptyFormState);
|
|
12888
|
+
}
|
|
12889
|
+
}, [typeDefinitions, setFieldValue, formValues]);
|
|
12890
|
+
return jsx(CollapsiblePanel, {
|
|
12891
|
+
header: jsx(CollapsiblePanel.Header, {
|
|
12892
|
+
children: jsx(FormattedMessage, _objectSpread({}, messages.title))
|
|
12893
|
+
}),
|
|
12894
|
+
headerControls: typeDefinitions.length > 0 && jsx("div", {
|
|
12895
|
+
css: /*#__PURE__*/css("min-width:", designTokens.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0IH0gZnJvbSAnZm9ybWlrJztcbmltcG9ydCB7IEZvcm1hdHRlZE1lc3NhZ2UsIHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnO1xuaW1wb3J0IEN1c3RvbUZpZWxkVHlwZURlZmluaXRpb25zQ29ubmVjdG9yIGZyb20gJy4uL2N1c3RvbS1maWVsZC10eXBlLWRlZmluaXRpb25zLWNvbm5lY3Rvcic7XG5pbXBvcnQgeyBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9sMTBuJztcbmltcG9ydCB7XG4gIENvbGxhcHNpYmxlUGFuZWwsXG4gIFNlbGVjdElucHV0LFxuICBkZXNpZ25Ub2tlbnMsXG59IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5pbXBvcnQgbWVzc2FnZXMgZnJvbSAnLi9tZXNzYWdlcyc7XG5pbXBvcnQgQ3VzdG9tRmllbGRzSW5wdXRXcmFwcGVyIGZyb20gJy4vY3VzdG9tLWZpZWxkcy1pbnB1dC13cmFwcGVyJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gVE9ETzogbWFrZSBjb25maWd1cmFibGUgYnkgY29uc3VtZXJzP1xuZXhwb3J0IGNvbnN0IEZJRUxEX05BTUUgPSAnY3VzdG9tJztcblxuLy8gQ3JlYXRlcyBkcm9wZG93biBvcHRpb25zXG5leHBvcnQgY29uc3QgbWFwVHlwZURlZmluaXRpb25zVG9PcHRpb25zID0gKFxuICB0eXBlRGVmaW5pdGlvbnMsXG4gIGxhbmd1YWdlLFxuICBsYW5ndWFnZXMsXG4gIHNlbGVjdGVkVHlwZURlZmluaXRpb25JZFxuKSA9PiB7XG4gIHJldHVybiB0eXBlRGVmaW5pdGlvbnMubWFwKCh0eXBlRGVmaW5pdGlvbikgPT4gKHtcbiAgICBpc0Rpc2FibGVkOlxuICAgICAgc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbklkICYmXG4gICAgICBzZWxlY3RlZFR5cGVEZWZpbml0aW9uSWQgPT09IHR5cGVEZWZpbml0aW9uLnR5cGUuaWQsXG4gICAgdmFsdWU6IHR5cGVEZWZpbml0aW9uLnR5cGUua2V5LFxuICAgIGxhYmVsOiBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcodHlwZURlZmluaXRpb24udHlwZSwge1xuICAgICAga2V5OiAnbmFtZScsXG4gICAgICBsb2NhbGU6IGxhbmd1YWdlLFxuICAgICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICAgIH0pLFxuICB9KSk7XG59O1xuXG4vLyBVc2VkIHRvIGdlbmVyYXRlIGZvcm0gc3RhdGUgd2hlbiB0aGUgdXNlciBzZWxlY3RzIGEgdHlwZSBkZWZpbml0aW9uIGZyb20gdGhlIGRyb3Bkb3duXG5jb25zdCBjcmVhdGVGb3JtU3RhdGVGcm9tVHlwZURlZmluaXRpb24gPSAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikgPT4ge1xuICByZXR1cm4ge1xuICAgIHR5cGU6IHtcbiAgICAgIGlkOiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUuaWQsXG4gICAgICBvYmo6IHtcbiAgICAgICAgZmllbGREZWZpbml0aW9uczogc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbi50eXBlLmZpZWxkRGVmaW5pdGlvbnMsXG4gICAgICAgIGtleTogc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbi50eXBlLmtleSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICBmaWVsZHM6IHt9LFxuICB9O1xufTtcblxuY29uc3QgQ3VzdG9tVHlwZVN1YmZvcm0gPSAoeyB0eXBlRGVmaW5pdGlvbnMsIGlzUmVhZE9ubHkgfSkgPT4ge1xuICBjb25zdCB7IHZhbHVlczogZm9ybVZhbHVlcywgc2V0RmllbGRWYWx1ZSB9ID0gdXNlRm9ybWlrQ29udGV4dCgpO1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgeyBsYW5ndWFnZSwgbGFuZ3VhZ2VzIH0gPSB1c2VBcHBsaWNhdGlvbkNvbnRleHQoXG4gICAgKGFwcGxpY2F0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICAgIGxhbmd1YWdlczogYXBwbGljYXRpb25Db250ZXh0LnByb2plY3QubGFuZ3VhZ2VzLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgaGFuZGxlVHlwZURlZmluaXRpb25TZWxlY3QgPSB1c2VDYWxsYmFjayhcbiAgICAoZXZlbnQpID0+IHtcbiAgICAgIGNvbnN0IHNlbGVjdGVkVHlwZURlZmluaXRpb24gPSB0eXBlRGVmaW5pdGlvbnMuZmluZChcbiAgICAgICAgKHR5cGVEZWZpbml0aW9uKSA9PiB0eXBlRGVmaW5pdGlvbi50eXBlLmtleSA9PT0gZXZlbnQudGFyZ2V0LnZhbHVlXG4gICAgICApO1xuXG4gICAgICBpZiAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikge1xuICAgICAgICBjb25zdCBuZXh0Q3VzdG9tID0gY3JlYXRlRm9ybVN0YXRlRnJvbVR5cGVEZWZpbml0aW9uKFxuICAgICAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25cbiAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIG5leHRDdXN0b20pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gaWYgdGhlIGRyb3Bkb3duIHNlbGVjdG9yIGlzIGNsZWFyZWRcbiAgICAgICAgY29uc3QgZW1wdHlGb3JtU3RhdGUgPVxuICAgICAgICAgIEN1c3RvbUZpZWxkVHlwZURlZmluaXRpb25zQ29ubmVjdG9yLmNyZWF0ZUVtcHR5Q3VzdG9tRmllbGRzKFxuICAgICAgICAgICAgZm9ybVZhbHVlc1tGSUVMRF9OQU1FXS50eXBlXG4gICAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIGVtcHR5Rm9ybVN0YXRlKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIFt0eXBlRGVmaW5pdGlvbnMsIHNldEZpZWxkVmFsdWUsIGZvcm1WYWx1ZXNdXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8Q29sbGFwc2libGVQYW5lbFxuICAgICAgaGVhZGVyPXtcbiAgICAgICAgPENvbGxhcHNpYmxlUGFuZWwuSGVhZGVyPlxuICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy50aXRsZX0gLz5cbiAgICAgICAgPC9Db2xsYXBzaWJsZVBhbmVsLkhlYWRlcj5cbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzPXtcbiAgICAgICAgdHlwZURlZmluaXRpb25zLmxlbmd0aCA+IDAgJiYgKFxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgICAgICBtaW4td2lkdGg6ICR7ZGVzaWduVG9rZW5zLmNvbnN0cmFpbnQxMH07XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxTZWxlY3RJbnB1dFxuICAgICAgICAgICAgICBpc0NsZWFyYWJsZVxuICAgICAgICAgICAgICBkYXRhLXRlc3RpZD1cImN1c3RvbS10eXBlLXNlbGVjdFwiXG4gICAgICAgICAgICAgIG5hbWU9e2Ake0ZJRUxEX05BTUV9LnR5cGUub2JqLmtleWB9XG4gICAgICAgICAgICAgIG9wdGlvbnM9e21hcFR5cGVEZWZpbml0aW9uc1RvT3B0aW9ucyhcbiAgICAgICAgICAgICAgICB0eXBlRGVmaW5pdGlvbnMsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZvcm1WYWx1ZXNbRklFTERfTkFNRV0/LnR5cGU/LmlkXG4gICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIHZhbHVlPXtmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwibGVmdFwiXG4gICAgPlxuICAgICAgPEN1c3RvbUZpZWxkc0lucHV0V3JhcHBlclxuICAgICAgICB0eXBlRGVmaW5pdGlvbnM9e3R5cGVEZWZpbml0aW9uc31cbiAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgIC8+XG4gICAgPC9Db2xsYXBzaWJsZVBhbmVsPlxuICApO1xufTtcblxuQ3VzdG9tVHlwZVN1YmZvcm0uZGlzcGxheU5hbWUgPSAnQ3VzdG9tVHlwZVN1YmZvcm0nO1xuQ3VzdG9tVHlwZVN1YmZvcm0ucHJvcFR5cGVzID0ge1xuICB0eXBlRGVmaW5pdGlvbnM6IFByb3BUeXBlcy5hcnJheS5pc1JlcXVpcmVkLFxuICBpc1JlYWRPbmx5OiBQcm9wVHlwZXMuYm9vbCxcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEN1c3RvbVR5cGVTdWJmb3JtO1xuIl19 */"),
|
|
12896
|
+
children: jsx(SelectInput, {
|
|
12897
|
+
isClearable: true,
|
|
12898
|
+
"data-testid": "custom-type-select",
|
|
12899
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12900
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 || (_formValues$FIELD_NAM = _formValues$FIELD_NAM.type) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.id),
|
|
12901
|
+
value: (_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.obj) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.key,
|
|
12902
|
+
onChange: handleTypeDefinitionSelect,
|
|
12903
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12904
|
+
isReadOnly: isReadOnly
|
|
12905
|
+
})
|
|
12906
|
+
}),
|
|
12907
|
+
headerControlsAlignment: "left",
|
|
12908
|
+
children: jsx(CustomFieldsInputWrapper, {
|
|
12909
|
+
typeDefinitions: typeDefinitions,
|
|
12910
|
+
isReadOnly: isReadOnly
|
|
12911
|
+
})
|
|
12912
|
+
});
|
|
12913
|
+
};
|
|
12914
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
12915
|
+
|
|
12916
|
+
const CustomFieldsFormField = _ref => {
|
|
12917
|
+
let resources = _ref.resources,
|
|
12918
|
+
isReadOnly = _ref.isReadOnly;
|
|
12919
|
+
const projectKey = useApplicationContext(applicationContext => applicationContext.project.key);
|
|
12920
|
+
return jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
12921
|
+
resources: resources,
|
|
12922
|
+
projectKey: projectKey,
|
|
12923
|
+
children: _ref2 => {
|
|
12924
|
+
var _context;
|
|
12925
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
12926
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
12927
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
12928
|
+
if (isLoading) {
|
|
12929
|
+
return jsx(LoadingSpinner, {});
|
|
12930
|
+
}
|
|
12931
|
+
const typeDefinitions = _mapInstanceProperty(_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
12932
|
+
return jsx(CustomTypeSubform, {
|
|
12933
|
+
typeDefinitions: typeDefinitions,
|
|
12934
|
+
isReadOnly: isReadOnly
|
|
12935
|
+
});
|
|
12936
|
+
}
|
|
12937
|
+
});
|
|
12938
|
+
};
|
|
12939
|
+
|
|
12739
12940
|
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 } } } };
|
|
12740
12941
|
|
|
12741
|
-
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector,
|
|
12942
|
+
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, CustomFieldTypeDefinitionsConnector$1 as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomFieldsFormField, 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, businessRoleConstants, messages$r as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$2 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, mapStoresToOptions, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$3 as productSelectionsFetcherMockHandler, handlers$4 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$F as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$5 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, useTotalNumberOfStoresFetcher, handlers$1 as useTotalNumberOfStoresFetcherHandlers, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$K as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|