@commercetools-frontend/experimental-components 5.0.3 → 5.2.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 +877 -554
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +871 -554
- package/dist/commercetools-frontend-experimental-components.esm.js +871 -550
- package/dist/styles.css +116 -116
- package/package.json +19 -19
|
@@ -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, SwitcherIcon, 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';
|
|
@@ -95,6 +95,7 @@ import merge from 'lodash/merge';
|
|
|
95
95
|
import set from 'lodash/set';
|
|
96
96
|
import { v4 } from 'uuid';
|
|
97
97
|
import { ErrorMessage } from '@commercetools-frontend/ui-kit/';
|
|
98
|
+
import ReactDOM from 'react-dom';
|
|
98
99
|
import { CustomSelectInputOption } from '@commercetools-uikit/select-utils';
|
|
99
100
|
import memoize from 'memoize-one';
|
|
100
101
|
import { filterAriaAttributes, filterDataAttributes as filterDataAttributes$1 } from '@commercetools-uikit/utils';
|
|
@@ -294,7 +295,7 @@ function uniqueObjects(items) {
|
|
|
294
295
|
|
|
295
296
|
*/
|
|
296
297
|
|
|
297
|
-
const messages$
|
|
298
|
+
const messages$K = defineMessages({
|
|
298
299
|
unique: {
|
|
299
300
|
id: 'Validation.unique',
|
|
300
301
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1589,8 +1590,8 @@ const getData = (code, field) => {
|
|
|
1589
1590
|
};
|
|
1590
1591
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1591
1592
|
|
|
1592
|
-
function ownKeys$
|
|
1593
|
-
function _objectSpread$
|
|
1593
|
+
function ownKeys$1l(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1594
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1l(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1l(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1594
1595
|
function formatMoneyRangeValue(value, intl) {
|
|
1595
1596
|
var _context;
|
|
1596
1597
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1600,7 +1601,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1600
1601
|
return '';
|
|
1601
1602
|
}
|
|
1602
1603
|
function formatMoneyValue(amount, currency, intl) {
|
|
1603
|
-
return formatMoney$1(_objectSpread$
|
|
1604
|
+
return formatMoney$1(_objectSpread$1l({
|
|
1604
1605
|
centAmount: amount,
|
|
1605
1606
|
fractionDigits: getFractionDigit(currency)
|
|
1606
1607
|
}, currency ? {
|
|
@@ -1617,14 +1618,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1617
1618
|
}
|
|
1618
1619
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1619
1620
|
var _moneyValue$fractione;
|
|
1620
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1621
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1621
1622
|
style: 'currency',
|
|
1622
1623
|
currency: moneyValue.currencyCode,
|
|
1623
1624
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1624
1625
|
}, options));
|
|
1625
1626
|
}
|
|
1626
1627
|
|
|
1627
|
-
var messages$
|
|
1628
|
+
var messages$J = defineMessages({
|
|
1628
1629
|
booleanYes: {
|
|
1629
1630
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1630
1631
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1709,7 +1710,7 @@ const formatDateTime = _ref7 => {
|
|
|
1709
1710
|
const formatBoolean = _ref8 => {
|
|
1710
1711
|
let value = _ref8.value,
|
|
1711
1712
|
intl = _ref8.intl;
|
|
1712
|
-
return value ? intl.formatMessage(messages$
|
|
1713
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1713
1714
|
};
|
|
1714
1715
|
const formatNilType = _ref9 => {
|
|
1715
1716
|
let value = _ref9.value,
|
|
@@ -1871,8 +1872,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1871
1872
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1872
1873
|
};
|
|
1873
1874
|
|
|
1874
|
-
function ownKeys$
|
|
1875
|
-
function _objectSpread$
|
|
1875
|
+
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; }
|
|
1876
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1876
1877
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1877
1878
|
const WithDataTablePaginationState = props => {
|
|
1878
1879
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1883,10 +1884,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1883
1884
|
page = _usePaginationState.page,
|
|
1884
1885
|
perPage = _usePaginationState.perPage;
|
|
1885
1886
|
const tableSorting = useDataTableSortingState({
|
|
1886
|
-
key: initialValues === null || initialValues === void 0
|
|
1887
|
-
order: initialValues === null || initialValues === void 0
|
|
1887
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1888
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1888
1889
|
});
|
|
1889
|
-
return jsx(Component, _objectSpread$
|
|
1890
|
+
return jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
1890
1891
|
dataTablePaginationState: {
|
|
1891
1892
|
page,
|
|
1892
1893
|
perPage,
|
|
@@ -1898,8 +1899,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1898
1899
|
return WithDataTablePaginationState;
|
|
1899
1900
|
};
|
|
1900
1901
|
|
|
1901
|
-
function ownKeys$
|
|
1902
|
-
function _objectSpread$
|
|
1902
|
+
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; }
|
|
1903
|
+
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; }
|
|
1903
1904
|
const injectNotifications = function () {
|
|
1904
1905
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1905
1906
|
return Component => {
|
|
@@ -1914,7 +1915,7 @@ const injectNotifications = function () {
|
|
|
1914
1915
|
onActionError,
|
|
1915
1916
|
hideAllPageNotifications
|
|
1916
1917
|
};
|
|
1917
|
-
return jsx(Component, _objectSpread$
|
|
1918
|
+
return jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1918
1919
|
[propName]: notifications
|
|
1919
1920
|
}));
|
|
1920
1921
|
};
|
|
@@ -1923,22 +1924,22 @@ const injectNotifications = function () {
|
|
|
1923
1924
|
};
|
|
1924
1925
|
};
|
|
1925
1926
|
|
|
1926
|
-
function ownKeys$
|
|
1927
|
-
function _objectSpread$
|
|
1927
|
+
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; }
|
|
1928
|
+
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; }
|
|
1928
1929
|
function isPropsMapper(mapProps) {
|
|
1929
1930
|
return typeof mapProps === 'function';
|
|
1930
1931
|
}
|
|
1931
1932
|
const withProps = mapProps => Component => {
|
|
1932
1933
|
const EnhancedWithProps = ownProps => {
|
|
1933
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1934
|
-
return jsx(Component, _objectSpread$
|
|
1934
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps(ownProps)) : _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps);
|
|
1935
|
+
return jsx(Component, _objectSpread$1i({}, enhancedProps));
|
|
1935
1936
|
};
|
|
1936
1937
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1937
1938
|
return EnhancedWithProps;
|
|
1938
1939
|
};
|
|
1939
1940
|
|
|
1940
|
-
function ownKeys$
|
|
1941
|
-
function _objectSpread$
|
|
1941
|
+
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; }
|
|
1942
|
+
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; }
|
|
1942
1943
|
const useRedirectEffect = _ref => {
|
|
1943
1944
|
let goTo = _ref.goTo;
|
|
1944
1945
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1958,30 +1959,30 @@ const defaultOptions$5 = {
|
|
|
1958
1959
|
skip: () => false
|
|
1959
1960
|
};
|
|
1960
1961
|
const withRedirectTo = options => Component => {
|
|
1961
|
-
const mergedOptions = _objectSpread$
|
|
1962
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$5), options);
|
|
1962
1963
|
const WithRedirectTo = props => {
|
|
1963
1964
|
if (!mergedOptions.skip(props)) {
|
|
1964
1965
|
return jsx(RedirectTo, {
|
|
1965
1966
|
goTo: options.selectGoTo(props)
|
|
1966
1967
|
});
|
|
1967
1968
|
}
|
|
1968
|
-
return jsx(Component, _objectSpread$
|
|
1969
|
+
return jsx(Component, _objectSpread$1h({}, props));
|
|
1969
1970
|
};
|
|
1970
1971
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1971
1972
|
return WithRedirectTo;
|
|
1972
1973
|
};
|
|
1973
1974
|
|
|
1974
|
-
function ownKeys$
|
|
1975
|
-
function _objectSpread$
|
|
1975
|
+
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; }
|
|
1976
|
+
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; }
|
|
1976
1977
|
const defaultOptions$4 = {
|
|
1977
1978
|
propName: 'modalState',
|
|
1978
1979
|
isInitiallyOpen: false
|
|
1979
1980
|
};
|
|
1980
1981
|
const injectModalState$1 = options => Component => {
|
|
1981
|
-
const mergedOptions = _objectSpread$
|
|
1982
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$4), options);
|
|
1982
1983
|
const WithModalState = props => {
|
|
1983
1984
|
const modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
1984
|
-
return jsx(Component, _objectSpread$
|
|
1985
|
+
return jsx(Component, _objectSpread$1g(_objectSpread$1g({}, props), {}, {
|
|
1985
1986
|
[mergedOptions.propName]: modalState
|
|
1986
1987
|
}));
|
|
1987
1988
|
};
|
|
@@ -1989,17 +1990,17 @@ const injectModalState$1 = options => Component => {
|
|
|
1989
1990
|
return WithModalState;
|
|
1990
1991
|
};
|
|
1991
1992
|
|
|
1992
|
-
function ownKeys$
|
|
1993
|
-
function _objectSpread$
|
|
1993
|
+
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; }
|
|
1994
|
+
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; }
|
|
1994
1995
|
const defaultOptions$3 = {
|
|
1995
1996
|
propName: 'toggleState',
|
|
1996
1997
|
isInitiallyOpen: false
|
|
1997
1998
|
};
|
|
1998
1999
|
const injectModalState = options => Component => {
|
|
1999
|
-
const mergedOptions = _objectSpread$
|
|
2000
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$3), options);
|
|
2000
2001
|
const WithToggleState = props => {
|
|
2001
2002
|
const toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2002
|
-
return jsx(Component, _objectSpread$
|
|
2003
|
+
return jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2003
2004
|
[mergedOptions.propName]: toggleState
|
|
2004
2005
|
}));
|
|
2005
2006
|
};
|
|
@@ -2007,8 +2008,8 @@ const injectModalState = options => Component => {
|
|
|
2007
2008
|
return WithToggleState;
|
|
2008
2009
|
};
|
|
2009
2010
|
|
|
2010
|
-
function ownKeys$
|
|
2011
|
-
function _objectSpread$
|
|
2011
|
+
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; }
|
|
2012
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1e(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2012
2013
|
const defaultOptions$2 = {
|
|
2013
2014
|
storageType: 'local',
|
|
2014
2015
|
segregateByUser: true
|
|
@@ -2026,7 +2027,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2026
2027
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2027
2028
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2028
2029
|
var _context;
|
|
2029
|
-
const mergedOptions = _objectSpread$
|
|
2030
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$2), options);
|
|
2030
2031
|
const userId = useApplicationContext(context => {
|
|
2031
2032
|
var _context$user;
|
|
2032
2033
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2074,8 +2075,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2074
2075
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2075
2076
|
};
|
|
2076
2077
|
|
|
2077
|
-
function ownKeys$
|
|
2078
|
-
function _objectSpread$
|
|
2078
|
+
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; }
|
|
2079
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1d(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2079
2080
|
const defaultOptions$1 = {
|
|
2080
2081
|
propName: 'storage',
|
|
2081
2082
|
storageKey: '',
|
|
@@ -2088,7 +2089,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2088
2089
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2089
2090
|
* argument position does not allow passing specification of option(s).
|
|
2090
2091
|
*/
|
|
2091
|
-
const mergedOptions = _objectSpread$
|
|
2092
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$1), options);
|
|
2092
2093
|
const WithStorage = props => {
|
|
2093
2094
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2094
2095
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2102,7 +2103,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2102
2103
|
readFromStorage
|
|
2103
2104
|
}
|
|
2104
2105
|
};
|
|
2105
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2106
|
+
return jsx(WrappedComponent, _objectSpread$1d(_objectSpread$1d({}, props), storageProp));
|
|
2106
2107
|
};
|
|
2107
2108
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2108
2109
|
return WithStorage;
|
|
@@ -2146,9 +2147,9 @@ const usePrevious = value => {
|
|
|
2146
2147
|
return ref.current;
|
|
2147
2148
|
};
|
|
2148
2149
|
|
|
2149
|
-
function ownKeys$
|
|
2150
|
-
function _objectSpread$
|
|
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: "
|
|
2150
|
+
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; }
|
|
2151
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2152
|
+
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: "mode" }, 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 mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2152
2153
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2153
2154
|
var _storesQueryResult$re;
|
|
2154
2155
|
if (!storesQueryResult) return null;
|
|
@@ -2158,7 +2159,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2158
2159
|
offset: storesQueryResult.offset,
|
|
2159
2160
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2160
2161
|
var _store$productSelecti;
|
|
2161
|
-
return _objectSpread$
|
|
2162
|
+
return _objectSpread$1c(_objectSpread$1c({}, store), {}, {
|
|
2162
2163
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2163
2164
|
});
|
|
2164
2165
|
})
|
|
@@ -2166,7 +2167,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2166
2167
|
};
|
|
2167
2168
|
const createQueryVariables$6 = ownProps => {
|
|
2168
2169
|
var _context;
|
|
2169
|
-
return _objectSpread$
|
|
2170
|
+
return _objectSpread$1c(_objectSpread$1c({
|
|
2170
2171
|
limit: ownProps.limit,
|
|
2171
2172
|
offset: ownProps.offset,
|
|
2172
2173
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2321,8 +2322,8 @@ function useDidFormValidationFail() {
|
|
|
2321
2322
|
return Boolean(didFormValidationFail);
|
|
2322
2323
|
}
|
|
2323
2324
|
|
|
2324
|
-
function ownKeys$
|
|
2325
|
-
function _objectSpread$
|
|
2325
|
+
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; }
|
|
2326
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2326
2327
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2327
2328
|
const defaultOptions = {
|
|
2328
2329
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2350,7 +2351,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2350
2351
|
};
|
|
2351
2352
|
const usePersistedReminder = function () {
|
|
2352
2353
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2353
|
-
const mergedOptions = _objectSpread$
|
|
2354
|
+
const mergedOptions = _objectSpread$1b(_objectSpread$1b({}, defaultOptions), options);
|
|
2354
2355
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2355
2356
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2356
2357
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2396,7 +2397,7 @@ const usePersistedReminder = function () {
|
|
|
2396
2397
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2397
2398
|
};
|
|
2398
2399
|
|
|
2399
|
-
var messages$
|
|
2400
|
+
var messages$I = defineMessages({
|
|
2400
2401
|
profileUpdated: {
|
|
2401
2402
|
id: 'NotificationText.profileUpdated',
|
|
2402
2403
|
description: 'Label for the notification header',
|
|
@@ -2414,8 +2415,8 @@ var messages$H = defineMessages({
|
|
|
2414
2415
|
}
|
|
2415
2416
|
});
|
|
2416
2417
|
|
|
2417
|
-
function ownKeys$
|
|
2418
|
-
function _objectSpread$
|
|
2418
|
+
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; }
|
|
2419
|
+
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; }
|
|
2419
2420
|
const LinkToProfile = props => {
|
|
2420
2421
|
return jsx(Link, {
|
|
2421
2422
|
to: "/account/profile",
|
|
@@ -2433,9 +2434,9 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2433
2434
|
children: [jsx(Text.Body, {
|
|
2434
2435
|
as: "p",
|
|
2435
2436
|
isBold: true,
|
|
2436
|
-
intlMessage: messages$
|
|
2437
|
+
intlMessage: messages$I.profileUpdated
|
|
2437
2438
|
}), jsx(Text.Body, {
|
|
2438
|
-
intlMessage: _objectSpread$
|
|
2439
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.addMoreInformation), {}, {
|
|
2439
2440
|
values: {
|
|
2440
2441
|
newline: getNewLine
|
|
2441
2442
|
}
|
|
@@ -2444,7 +2445,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2444
2445
|
}), jsx(Spacings.Stack, {
|
|
2445
2446
|
scale: "xs",
|
|
2446
2447
|
children: jsx(Text.Body, {
|
|
2447
|
-
intlMessage: _objectSpread$
|
|
2448
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.informationAndProfileLink), {}, {
|
|
2448
2449
|
values: {
|
|
2449
2450
|
newline: getNewLine,
|
|
2450
2451
|
link: getLinkToProfile
|
|
@@ -2565,7 +2566,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2565
2566
|
}, [ref]);
|
|
2566
2567
|
};
|
|
2567
2568
|
|
|
2568
|
-
var messages$
|
|
2569
|
+
var messages$H = defineMessages({
|
|
2569
2570
|
fallbackHint: {
|
|
2570
2571
|
id: 'KeyFallback.fallbackHint',
|
|
2571
2572
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2589,7 +2590,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2589
2590
|
return values => {
|
|
2590
2591
|
if (!values.resource) return null;
|
|
2591
2592
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2592
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2593
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2593
2594
|
key: values.resource.key
|
|
2594
2595
|
});
|
|
2595
2596
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2601,8 +2602,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2601
2602
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2602
2603
|
useCallback(debounce(promiseCallback, wait), [promiseCallback]);
|
|
2603
2604
|
|
|
2604
|
-
function ownKeys$
|
|
2605
|
-
function _objectSpread$
|
|
2605
|
+
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; }
|
|
2606
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$19(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$19(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2606
2607
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2607
2608
|
const updatedColumnProps = {};
|
|
2608
2609
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2622,14 +2623,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2622
2623
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2623
2624
|
return _mapInstanceProperty(_context = _filterInstanceProperty(cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2624
2625
|
const initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2625
|
-
return _objectSpread$
|
|
2626
|
+
return _objectSpread$19(_objectSpread$19({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2626
2627
|
});
|
|
2627
2628
|
};
|
|
2628
2629
|
const handleCacheUpdate = _ref2 => {
|
|
2629
2630
|
let update = _ref2.update,
|
|
2630
2631
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2631
2632
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2632
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2633
|
+
return updateCachedTableConfiguration(_objectSpread$19(_objectSpread$19({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2633
2634
|
};
|
|
2634
2635
|
|
|
2635
2636
|
// Signature:
|
|
@@ -2658,7 +2659,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2658
2659
|
return {
|
|
2659
2660
|
columnsConfig: _mapInstanceProperty(initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2660
2661
|
const visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2661
|
-
return _objectSpread$
|
|
2662
|
+
return _objectSpread$19({
|
|
2662
2663
|
key: visibleColumnKey
|
|
2663
2664
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2664
2665
|
}),
|
|
@@ -2714,7 +2715,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2714
2715
|
data = _useQuery.data;
|
|
2715
2716
|
return {
|
|
2716
2717
|
isLoading: loading,
|
|
2717
|
-
total: data === null || data === void 0
|
|
2718
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2718
2719
|
};
|
|
2719
2720
|
};
|
|
2720
2721
|
|
|
@@ -2729,21 +2730,21 @@ const handlers$4 = {
|
|
|
2729
2730
|
}
|
|
2730
2731
|
};
|
|
2731
2732
|
|
|
2732
|
-
function ownKeys$
|
|
2733
|
-
function _objectSpread$
|
|
2733
|
+
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; }
|
|
2734
|
+
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; }
|
|
2734
2735
|
|
|
2735
2736
|
// eslint-disable-next-line import/prefer-default-export
|
|
2736
2737
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2737
2738
|
var _context;
|
|
2738
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2739
|
-
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2739
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$18(_objectSpread$18({}, productSelections), {}, {
|
|
2740
|
+
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$18({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2740
2741
|
from: 'nameAllLocales',
|
|
2741
2742
|
to: 'name'
|
|
2742
2743
|
}])))
|
|
2743
2744
|
});
|
|
2744
2745
|
};
|
|
2745
2746
|
|
|
2746
|
-
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "
|
|
2747
|
+
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2747
2748
|
const createQueryVariables$5 = ownProps => ({
|
|
2748
2749
|
limit: ownProps.limit,
|
|
2749
2750
|
offset: ownProps.offset,
|
|
@@ -2886,7 +2887,7 @@ const CenteredLoadingSpinner = () => jsx("div", {
|
|
|
2886
2887
|
});
|
|
2887
2888
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2888
2889
|
|
|
2889
|
-
var messages$
|
|
2890
|
+
var messages$G = defineMessages({
|
|
2890
2891
|
noChannelsFound: {
|
|
2891
2892
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2892
2893
|
description: 'The message to display when no channels were found',
|
|
@@ -2912,8 +2913,8 @@ var commonPickerMessages = defineMessages({
|
|
|
2912
2913
|
}
|
|
2913
2914
|
});
|
|
2914
2915
|
|
|
2915
|
-
function ownKeys$
|
|
2916
|
-
function _objectSpread$
|
|
2916
|
+
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; }
|
|
2917
|
+
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; }
|
|
2917
2918
|
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
2919
|
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
2920
|
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 +2935,7 @@ const ChannelPickerInput = _ref => {
|
|
|
2934
2935
|
const _useIntl = useIntl(),
|
|
2935
2936
|
formatMessage = _useIntl.formatMessage;
|
|
2936
2937
|
const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
2937
|
-
const variables = useMemo(() => _objectSpread$
|
|
2938
|
+
const variables = useMemo(() => _objectSpread$17({
|
|
2938
2939
|
sortByNamePath: "name.".concat(dataLocale)
|
|
2939
2940
|
}, role && {
|
|
2940
2941
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -2995,8 +2996,8 @@ const ChannelPickerInput = _ref => {
|
|
|
2995
2996
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
2996
2997
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
2997
2998
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
2998
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
2999
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
2999
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3000
|
+
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
3001
|
return jsx(Constraints.Horizontal, {
|
|
3001
3002
|
max: "scale",
|
|
3002
3003
|
children: jsxs(Spacings.Stack, {
|
|
@@ -3006,7 +3007,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3006
3007
|
children: jsx(AsyncSelectInput, {
|
|
3007
3008
|
id: name,
|
|
3008
3009
|
name: name,
|
|
3009
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3010
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3010
3011
|
loadOptions: loadOptionsDebounced,
|
|
3011
3012
|
defaultOptions: true,
|
|
3012
3013
|
showOptionGroupDivider: true,
|
|
@@ -3049,7 +3050,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3049
3050
|
var _this$props;
|
|
3050
3051
|
let user = _ref.user;
|
|
3051
3052
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3052
|
-
timeZone: (this === null || this === void 0
|
|
3053
|
+
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
3054
|
locale: this.props.intl.locale
|
|
3054
3055
|
});
|
|
3055
3056
|
}
|
|
@@ -3063,8 +3064,8 @@ var FormattedDateTime$1 = injectIntl(FormattedDateTime);
|
|
|
3063
3064
|
|
|
3064
3065
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3065
3066
|
|
|
3066
|
-
function ownKeys$
|
|
3067
|
-
function _objectSpread$
|
|
3067
|
+
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; }
|
|
3068
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$16(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$16(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3068
3069
|
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
3070
|
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
3071
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3096,7 +3097,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3096
3097
|
handleMouseOver: this.handleMouseOver,
|
|
3097
3098
|
handleMouseOut: this.handleMouseOut
|
|
3098
3099
|
};
|
|
3099
|
-
return jsx(BaseComponent, _objectSpread$
|
|
3100
|
+
return jsx(BaseComponent, _objectSpread$16({}, _objectSpread$16(_objectSpread$16({}, this.props), injectedProps)));
|
|
3100
3101
|
}
|
|
3101
3102
|
}]);
|
|
3102
3103
|
return WithMouseOverState;
|
|
@@ -3105,8 +3106,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3105
3106
|
return WithMouseOverState;
|
|
3106
3107
|
};
|
|
3107
3108
|
|
|
3108
|
-
function ownKeys$
|
|
3109
|
-
function _objectSpread$
|
|
3109
|
+
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; }
|
|
3110
|
+
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; }
|
|
3110
3111
|
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
3112
|
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
3113
|
var styles$h = {
|
|
@@ -3132,7 +3133,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3132
3133
|
}
|
|
3133
3134
|
_this = _super.call(this, ...args);
|
|
3134
3135
|
_this.state = {
|
|
3135
|
-
draftValue:
|
|
3136
|
+
draftValue: '',
|
|
3137
|
+
prevValue: ''
|
|
3136
3138
|
};
|
|
3137
3139
|
_this.clearPendingUpdates = () => {
|
|
3138
3140
|
clearTimeout(_this.changeTimeout);
|
|
@@ -3179,8 +3181,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3179
3181
|
};
|
|
3180
3182
|
_this.doDelayedUpdate = (updateFunction, event, eventType) => {
|
|
3181
3183
|
const self = _assertThisInitialized(_this);
|
|
3182
|
-
// TODO: can't we just use one variable?
|
|
3183
3184
|
const timeoutKey = "".concat(eventType, "Timeout");
|
|
3185
|
+
// TODO: can't we just use one variable?
|
|
3184
3186
|
clearTimeout(_this[timeoutKey]);
|
|
3185
3187
|
_this[timeoutKey] = _setTimeout(() => {
|
|
3186
3188
|
updateFunction.call(self, event);
|
|
@@ -3190,26 +3192,6 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3190
3192
|
return _this;
|
|
3191
3193
|
}
|
|
3192
3194
|
_createClass(ThrottledField, [{
|
|
3193
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
3194
|
-
value:
|
|
3195
|
-
// eslint-disable-next-line camelcase
|
|
3196
|
-
function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
3197
|
-
if (!has(nextProps, 'value')) return;
|
|
3198
|
-
if (!nextProps.value && nextProps.value !== 0) {
|
|
3199
|
-
// let new value from props take precedence over pending updates
|
|
3200
|
-
this.clearPendingUpdates();
|
|
3201
|
-
this.setState({
|
|
3202
|
-
draftValue: ''
|
|
3203
|
-
});
|
|
3204
|
-
} else if (nextProps.value !== this.state.draftValue) {
|
|
3205
|
-
// let new value from props take precedence over pending updates
|
|
3206
|
-
this.clearPendingUpdates();
|
|
3207
|
-
this.setState({
|
|
3208
|
-
draftValue: nextProps.value
|
|
3209
|
-
});
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
}, {
|
|
3213
3195
|
key: "componentWillUnmount",
|
|
3214
3196
|
value: function componentWillUnmount() {
|
|
3215
3197
|
this.clearPendingUpdates();
|
|
@@ -3217,7 +3199,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3217
3199
|
}, {
|
|
3218
3200
|
key: "render",
|
|
3219
3201
|
value: function render() {
|
|
3220
|
-
const commonProps = _objectSpread$
|
|
3202
|
+
const commonProps = _objectSpread$15(_objectSpread$15({
|
|
3221
3203
|
value: this.state.draftValue,
|
|
3222
3204
|
autoComplete: this.props.autoComplete,
|
|
3223
3205
|
onChange: this.handleChange,
|
|
@@ -3236,7 +3218,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3236
3218
|
htmlFor: inputId,
|
|
3237
3219
|
children: this.props.label
|
|
3238
3220
|
})
|
|
3239
|
-
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$
|
|
3221
|
+
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3240
3222
|
id: inputId,
|
|
3241
3223
|
className: classnames(styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3242
3224
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3245,7 +3227,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3245
3227
|
rows: 1,
|
|
3246
3228
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3247
3229
|
cacheMeasurements: true
|
|
3248
|
-
})) : jsx("input", _objectSpread$
|
|
3230
|
+
})) : jsx("input", _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3249
3231
|
id: inputId,
|
|
3250
3232
|
ref: this.props.inputRef,
|
|
3251
3233
|
type: this.props.as,
|
|
@@ -3257,6 +3239,17 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3257
3239
|
}))]
|
|
3258
3240
|
});
|
|
3259
3241
|
}
|
|
3242
|
+
}], [{
|
|
3243
|
+
key: "getDerivedStateFromProps",
|
|
3244
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
3245
|
+
if (nextProps.value !== prevState.prevValue) {
|
|
3246
|
+
return {
|
|
3247
|
+
draftValue: nextProps.value || nextProps.value === 0 ? nextProps.value : '',
|
|
3248
|
+
prevValue: nextProps.value
|
|
3249
|
+
};
|
|
3250
|
+
}
|
|
3251
|
+
return null;
|
|
3252
|
+
}
|
|
3260
3253
|
}]);
|
|
3261
3254
|
return ThrottledField;
|
|
3262
3255
|
}(PureComponent);
|
|
@@ -3272,7 +3265,7 @@ ThrottledField.defaultProps = {
|
|
|
3272
3265
|
label: 'Throttled field'
|
|
3273
3266
|
};
|
|
3274
3267
|
|
|
3275
|
-
var messages$
|
|
3268
|
+
var messages$F = defineMessages({
|
|
3276
3269
|
buttonLabel: {
|
|
3277
3270
|
id: 'SearchInput.buttonLabel',
|
|
3278
3271
|
description: 'Label for "Search" button.',
|
|
@@ -3379,7 +3372,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3379
3372
|
"data-testid": this.props.testId || 'search-input',
|
|
3380
3373
|
value: this.state.text,
|
|
3381
3374
|
label: this.props.label,
|
|
3382
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3375
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3383
3376
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3384
3377
|
onChange: this.handleInputChange,
|
|
3385
3378
|
onEnter: this.handleEnter,
|
|
@@ -3472,7 +3465,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3472
3465
|
const fetchProductTypesFromPim = useCallback(async searchTerm => {
|
|
3473
3466
|
var _result$hits$map, _result$hits;
|
|
3474
3467
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3475
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3468
|
+
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
3469
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3477
3470
|
if (ids.length === 0) {
|
|
3478
3471
|
return {
|
|
@@ -3555,7 +3548,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3555
3548
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3556
3549
|
};
|
|
3557
3550
|
const usePimStatus = () => {
|
|
3558
|
-
var _data$indicesExist
|
|
3551
|
+
var _data$indicesExist;
|
|
3559
3552
|
const _useQuery = useQuery(FetchIndicesExist$1, {
|
|
3560
3553
|
context: {
|
|
3561
3554
|
target: GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3565,7 +3558,7 @@ const usePimStatus = () => {
|
|
|
3565
3558
|
data = _useQuery.data;
|
|
3566
3559
|
return {
|
|
3567
3560
|
data,
|
|
3568
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3561
|
+
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
3562
|
};
|
|
3570
3563
|
};
|
|
3571
3564
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3594,7 +3587,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3594
3587
|
};
|
|
3595
3588
|
};
|
|
3596
3589
|
|
|
3597
|
-
var messages$
|
|
3590
|
+
var messages$E = defineMessages({
|
|
3598
3591
|
bottomOption: {
|
|
3599
3592
|
id: 'Products.Pickers.bottomOption',
|
|
3600
3593
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3602,11 +3595,11 @@ var messages$D = defineMessages({
|
|
|
3602
3595
|
}
|
|
3603
3596
|
});
|
|
3604
3597
|
|
|
3605
|
-
function ownKeys$
|
|
3606
|
-
function _objectSpread$
|
|
3598
|
+
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; }
|
|
3599
|
+
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; }
|
|
3607
3600
|
const getBottomOption = formatMessage => ({
|
|
3608
3601
|
options: [{
|
|
3609
|
-
label: formatMessage ? formatMessage(messages$
|
|
3602
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3610
3603
|
isBottomOption: true,
|
|
3611
3604
|
isDisabled: true
|
|
3612
3605
|
}]
|
|
@@ -3614,7 +3607,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3614
3607
|
const Option$2 = props => {
|
|
3615
3608
|
const _useIntl = useIntl(),
|
|
3616
3609
|
formatMessage = _useIntl.formatMessage;
|
|
3617
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
3610
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$14(_objectSpread$14({}, props), {}, {
|
|
3618
3611
|
children: props.data.isBottomOption ? jsx(Text.Detail, {
|
|
3619
3612
|
tone: "secondary",
|
|
3620
3613
|
children: formatMessage(props.data.label)
|
|
@@ -3631,8 +3624,8 @@ const Option$2 = props => {
|
|
|
3631
3624
|
};
|
|
3632
3625
|
Option$2.displayName = 'Option';
|
|
3633
3626
|
|
|
3634
|
-
function ownKeys$
|
|
3635
|
-
function _objectSpread$
|
|
3627
|
+
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; }
|
|
3628
|
+
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; }
|
|
3636
3629
|
const useHandlers = onChange => {
|
|
3637
3630
|
const _useState = useState(),
|
|
3638
3631
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3643,8 +3636,8 @@ const useHandlers = onChange => {
|
|
|
3643
3636
|
}, []);
|
|
3644
3637
|
const handleChange = useEventCallback(event => {
|
|
3645
3638
|
var _event$target$value;
|
|
3646
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3647
|
-
target: _objectSpread$
|
|
3639
|
+
const eventWithExtractedValue = _objectSpread$13(_objectSpread$13({}, event), {}, {
|
|
3640
|
+
target: _objectSpread$13(_objectSpread$13({}, event.target), {}, {
|
|
3648
3641
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3649
3642
|
})
|
|
3650
3643
|
});
|
|
@@ -3653,8 +3646,8 @@ const useHandlers = onChange => {
|
|
|
3653
3646
|
return [handleInputChange, handleChange];
|
|
3654
3647
|
};
|
|
3655
3648
|
|
|
3656
|
-
function ownKeys
|
|
3657
|
-
function _objectSpread
|
|
3649
|
+
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; }
|
|
3650
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$12(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$12(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3658
3651
|
const constructPrefixSearchPredicate = function () {
|
|
3659
3652
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3660
3653
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3697,7 +3690,7 @@ const useLoadOptions = _ref => {
|
|
|
3697
3690
|
}();
|
|
3698
3691
|
return client.query({
|
|
3699
3692
|
query,
|
|
3700
|
-
variables: _objectSpread
|
|
3693
|
+
variables: _objectSpread$12({
|
|
3701
3694
|
where
|
|
3702
3695
|
}, variables),
|
|
3703
3696
|
context: {
|
|
@@ -3751,7 +3744,7 @@ function useCurrentOption(_ref) {
|
|
|
3751
3744
|
};
|
|
3752
3745
|
}
|
|
3753
3746
|
|
|
3754
|
-
var messages$
|
|
3747
|
+
var messages$D = defineMessages({
|
|
3755
3748
|
noProductTypesFound: {
|
|
3756
3749
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3757
3750
|
description: 'The message to display when no product types were found',
|
|
@@ -3831,7 +3824,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3831
3824
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3832
3825
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3833
3826
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3834
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3827
|
+
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
3828
|
return jsx(Constraints.Horizontal, {
|
|
3836
3829
|
max: "scale",
|
|
3837
3830
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -3841,7 +3834,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3841
3834
|
children: jsx(AsyncSelectInput, {
|
|
3842
3835
|
id: name,
|
|
3843
3836
|
name: name,
|
|
3844
|
-
placeholder: formatMessage(messages$
|
|
3837
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3845
3838
|
loadOptions: loadOptionsDebounced,
|
|
3846
3839
|
defaultOptions: [],
|
|
3847
3840
|
isClearable: isClearable,
|
|
@@ -3854,7 +3847,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3854
3847
|
onInputChange: handleInputChange,
|
|
3855
3848
|
onBlur: onBlur,
|
|
3856
3849
|
value: currentOption.data,
|
|
3857
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3850
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3858
3851
|
hasError: hasError || isLoadingFailed
|
|
3859
3852
|
})
|
|
3860
3853
|
}), isLoadingFailed && jsx(Text.Body, {
|
|
@@ -3866,7 +3859,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3866
3859
|
};
|
|
3867
3860
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3868
3861
|
|
|
3869
|
-
var messages$
|
|
3862
|
+
var messages$C = defineMessages({
|
|
3870
3863
|
noStatesFound: {
|
|
3871
3864
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3872
3865
|
description: 'The message to display when no states were found',
|
|
@@ -3950,8 +3943,8 @@ const StatePickerInput = _ref => {
|
|
|
3950
3943
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3951
3944
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3952
3945
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3953
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3954
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3946
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
3947
|
+
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
3948
|
return jsx(Constraints.Horizontal, {
|
|
3956
3949
|
max: "scale",
|
|
3957
3950
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -3962,7 +3955,7 @@ const StatePickerInput = _ref => {
|
|
|
3962
3955
|
id: name,
|
|
3963
3956
|
name: name,
|
|
3964
3957
|
horizontalConstraint: "scale",
|
|
3965
|
-
placeholder: formatMessage(messages$
|
|
3958
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
3966
3959
|
loadOptions: loadOptionsDebounced,
|
|
3967
3960
|
defaultOptions: true,
|
|
3968
3961
|
showOptionGroupDivider: true,
|
|
@@ -3988,9 +3981,9 @@ const StatePickerInput = _ref => {
|
|
|
3988
3981
|
};
|
|
3989
3982
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
3990
3983
|
|
|
3991
|
-
function ownKeys$
|
|
3992
|
-
function _objectSpread$
|
|
3993
|
-
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$
|
|
3984
|
+
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; }
|
|
3985
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$11(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$11(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3986
|
+
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$11({
|
|
3994
3987
|
ref: ref,
|
|
3995
3988
|
style: {
|
|
3996
3989
|
display: 'block',
|
|
@@ -4128,8 +4121,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4128
4121
|
};
|
|
4129
4122
|
|
|
4130
4123
|
const _excluded = ["action"];
|
|
4131
|
-
function ownKeys$
|
|
4132
|
-
function _objectSpread$
|
|
4124
|
+
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; }
|
|
4125
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys$10(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys$10(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4133
4126
|
|
|
4134
4127
|
/**
|
|
4135
4128
|
* Checks if a value is a LocalizedString
|
|
@@ -4151,7 +4144,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4151
4144
|
*/
|
|
4152
4145
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4153
4146
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4154
|
-
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4147
|
+
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$10(_objectSpread$10({}, customFields), {}, {
|
|
4155
4148
|
[customField.name]: customField.value
|
|
4156
4149
|
}), {});
|
|
4157
4150
|
};
|
|
@@ -4175,7 +4168,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4175
4168
|
const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
|
|
4176
4169
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4177
4170
|
const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4178
|
-
return _objectSpread$
|
|
4171
|
+
return _objectSpread$10(_objectSpread$10(_objectSpread$10({}, transformedData), parent ? {
|
|
4179
4172
|
parent
|
|
4180
4173
|
} : {}), ancestors ? {
|
|
4181
4174
|
ancestors
|
|
@@ -4400,7 +4393,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4400
4393
|
case 'addAttributeDefinition':
|
|
4401
4394
|
return {
|
|
4402
4395
|
[actionName]: {
|
|
4403
|
-
attributeDefinition: _objectSpread$
|
|
4396
|
+
attributeDefinition: _objectSpread$10(_objectSpread$10({}, actionPayload.attribute), {}, {
|
|
4404
4397
|
label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4405
4398
|
inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4406
4399
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4496,7 +4489,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4496
4489
|
return {
|
|
4497
4490
|
[actionName]: {
|
|
4498
4491
|
attributeName: actionPayload.attributeName,
|
|
4499
|
-
value: _objectSpread$
|
|
4492
|
+
value: _objectSpread$10(_objectSpread$10({}, actionPayload.value), {}, {
|
|
4500
4493
|
label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4501
4494
|
})
|
|
4502
4495
|
}
|
|
@@ -4505,7 +4498,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4505
4498
|
return {
|
|
4506
4499
|
[actionName]: {
|
|
4507
4500
|
attributeName: actionPayload.attributeName,
|
|
4508
|
-
newValue: _objectSpread$
|
|
4501
|
+
newValue: _objectSpread$10(_objectSpread$10({}, actionPayload.newValue), {}, {
|
|
4509
4502
|
label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4510
4503
|
})
|
|
4511
4504
|
}
|
|
@@ -4532,7 +4525,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4532
4525
|
name: transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4533
4526
|
taxCategory: actionPayload.taxCategory,
|
|
4534
4527
|
money: {
|
|
4535
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4528
|
+
[actionPayload.money.type]: _objectSpread$10({
|
|
4536
4529
|
centAmount: actionPayload.money.centAmount,
|
|
4537
4530
|
currencyCode: actionPayload.money.currencyCode
|
|
4538
4531
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4567,7 +4560,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4567
4560
|
case 'addAddress':
|
|
4568
4561
|
case 'changeAddress':
|
|
4569
4562
|
{
|
|
4570
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4563
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4571
4564
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4572
4565
|
_ref3$fields = _ref3.fields,
|
|
4573
4566
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4580,15 +4573,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4580
4573
|
value: _JSON$stringify(value)
|
|
4581
4574
|
};
|
|
4582
4575
|
});
|
|
4583
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4576
|
+
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 ? {
|
|
4584
4577
|
type: {
|
|
4585
4578
|
id: actionPayload.address.custom.type.id
|
|
4586
4579
|
},
|
|
4587
4580
|
fields: customFields
|
|
4588
4581
|
} : null;
|
|
4589
4582
|
return {
|
|
4590
|
-
[actionName]: _objectSpread$
|
|
4591
|
-
address: _objectSpread$
|
|
4583
|
+
[actionName]: _objectSpread$10(_objectSpread$10({}, actionPayload), {}, {
|
|
4584
|
+
address: _objectSpread$10(_objectSpread$10({}, omit(actionPayload.address, ['__typename'])), {}, {
|
|
4592
4585
|
custom
|
|
4593
4586
|
})
|
|
4594
4587
|
})
|
|
@@ -4634,8 +4627,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty(actions).c
|
|
|
4634
4627
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4635
4628
|
}, []);
|
|
4636
4629
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4637
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4638
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4630
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4631
|
+
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) {
|
|
4639
4632
|
return graphQlResponse.networkError.result.errors;
|
|
4640
4633
|
}
|
|
4641
4634
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4664,26 +4657,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4664
4657
|
return originalOmitDeep(obj, fieldsToOmit);
|
|
4665
4658
|
}
|
|
4666
4659
|
|
|
4667
|
-
function ownKeys
|
|
4668
|
-
function _objectSpread
|
|
4660
|
+
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; }
|
|
4661
|
+
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; }
|
|
4669
4662
|
function getPriceChannelName(price) {
|
|
4670
4663
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4671
4664
|
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;
|
|
4672
4665
|
}
|
|
4673
4666
|
function getDiscountValue(price) {
|
|
4674
|
-
var _price$value, _price$value2, _price$discounted
|
|
4667
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4675
4668
|
let preciseAmount;
|
|
4676
4669
|
let fractionedAmount;
|
|
4677
4670
|
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) {
|
|
4678
4671
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
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
|
|
4672
|
+
} 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) {
|
|
4680
4673
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4681
4674
|
}
|
|
4682
|
-
return price.discounted ? _objectSpread
|
|
4675
|
+
return price.discounted ? _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4683
4676
|
fractionedAmount,
|
|
4684
4677
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4685
4678
|
preciseAmount
|
|
4686
|
-
}) : _objectSpread
|
|
4679
|
+
}) : _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4687
4680
|
centAmount: 0
|
|
4688
4681
|
});
|
|
4689
4682
|
}
|
|
@@ -4691,17 +4684,17 @@ function getSelectedPrice(price) {
|
|
|
4691
4684
|
return price.discounted ? price.discounted : price;
|
|
4692
4685
|
}
|
|
4693
4686
|
function getNetUnitPrice(_ref2) {
|
|
4694
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4687
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4695
4688
|
let lineItem = _ref2.lineItem,
|
|
4696
4689
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4697
4690
|
const price = getSelectedPrice(lineItem.price);
|
|
4698
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4699
|
-
var _lineItem$shippingDet
|
|
4700
|
-
return (lineItem === null || lineItem === void 0
|
|
4691
|
+
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 => {
|
|
4692
|
+
var _lineItem$shippingDet;
|
|
4693
|
+
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;
|
|
4701
4694
|
});
|
|
4702
4695
|
|
|
4703
4696
|
// when shipping mode is multi with the same tax rate
|
|
4704
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4697
|
+
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) {
|
|
4705
4698
|
var _price$value3, _price$value4;
|
|
4706
4699
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4707
4700
|
let centAmount;
|
|
@@ -4712,7 +4705,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4712
4705
|
}
|
|
4713
4706
|
let preciseAmount;
|
|
4714
4707
|
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);
|
|
4715
|
-
return _objectSpread
|
|
4708
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4716
4709
|
centAmount,
|
|
4717
4710
|
preciseAmount
|
|
4718
4711
|
});
|
|
@@ -4729,7 +4722,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4729
4722
|
}
|
|
4730
4723
|
let preciseAmount;
|
|
4731
4724
|
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);
|
|
4732
|
-
return _objectSpread
|
|
4725
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4733
4726
|
centAmount,
|
|
4734
4727
|
preciseAmount
|
|
4735
4728
|
});
|
|
@@ -4741,7 +4734,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4741
4734
|
const currencyCode = price.value.currencyCode;
|
|
4742
4735
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4743
4736
|
if (currencyCode && !isNil$1(fractionedAmount)) {
|
|
4744
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4737
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$$(_objectSpread$$({}, minPrices), {}, {
|
|
4745
4738
|
[currencyCode]: price.value
|
|
4746
4739
|
});
|
|
4747
4740
|
}
|
|
@@ -4750,8 +4743,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4750
4743
|
return _Object$values(minPricesByCurrency);
|
|
4751
4744
|
}
|
|
4752
4745
|
|
|
4753
|
-
function ownKeys$
|
|
4754
|
-
function _objectSpread$
|
|
4746
|
+
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; }
|
|
4747
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$_(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$_(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4755
4748
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4756
4749
|
var _context, _context4;
|
|
4757
4750
|
return {
|
|
@@ -4762,18 +4755,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4762
4755
|
key: resource.custom.type.key,
|
|
4763
4756
|
name: transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4764
4757
|
fieldDefinitions: _mapInstanceProperty(_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4765
|
-
var _fieldDefinition$type,
|
|
4758
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4766
4759
|
return {
|
|
4767
4760
|
name: fieldDefinition.name,
|
|
4768
4761
|
required: fieldDefinition.required,
|
|
4769
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4770
|
-
elementType: _objectSpread$
|
|
4762
|
+
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$_(_objectSpread$_({}, fieldDefinition.type), {}, {
|
|
4763
|
+
elementType: _objectSpread$_(_objectSpread$_({}, fieldDefinition.type.elementType), {}, {
|
|
4771
4764
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4772
4765
|
key: value.key,
|
|
4773
4766
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4774
4767
|
}))
|
|
4775
4768
|
})
|
|
4776
|
-
}) : ((_fieldDefinition$
|
|
4769
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$_(_objectSpread$_({}, fieldDefinition.type), {}, {
|
|
4777
4770
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
4778
4771
|
key: value.key,
|
|
4779
4772
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4784,7 +4777,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4784
4777
|
})
|
|
4785
4778
|
}
|
|
4786
4779
|
},
|
|
4787
|
-
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4780
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$_(_objectSpread$_({}, fields), {}, {
|
|
4788
4781
|
[customField.name]: customField.value
|
|
4789
4782
|
}), {})
|
|
4790
4783
|
};
|
|
@@ -4796,7 +4789,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4796
4789
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4797
4790
|
// in either case we return null
|
|
4798
4791
|
if (!productSelection) return null;
|
|
4799
|
-
return _objectSpread$
|
|
4792
|
+
return _objectSpread$_(_objectSpread$_({}, applyTransformedLocalizedFields(productSelection, [{
|
|
4800
4793
|
from: 'nameAllLocales',
|
|
4801
4794
|
to: 'name'
|
|
4802
4795
|
}])), {}, {
|
|
@@ -4819,8 +4812,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4819
4812
|
return _mapInstanceProperty(_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4820
4813
|
};
|
|
4821
4814
|
|
|
4822
|
-
function ownKeys$
|
|
4823
|
-
function _objectSpread$
|
|
4815
|
+
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; }
|
|
4816
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$Z(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$Z(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4824
4817
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4825
4818
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4826
4819
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4837,7 +4830,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4837
4830
|
if (updateAction.action === 'setCustomField' && _Array$isArray(updateAction.value)) {
|
|
4838
4831
|
const definition = _findInstanceProperty(fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4839
4832
|
const definitionName = definition.type.elementType.name;
|
|
4840
|
-
return _objectSpread$
|
|
4833
|
+
return _objectSpread$Z(_objectSpread$Z({}, updateAction), {}, {
|
|
4841
4834
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4842
4835
|
});
|
|
4843
4836
|
}
|
|
@@ -4911,8 +4904,8 @@ function omitSetsOfSets() {
|
|
|
4911
4904
|
|
|
4912
4905
|
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 } } } };
|
|
4913
4906
|
|
|
4914
|
-
function ownKeys$
|
|
4915
|
-
function _objectSpread$
|
|
4907
|
+
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; }
|
|
4908
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$Y(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$Y(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4916
4909
|
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); }; }
|
|
4917
4910
|
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; } }
|
|
4918
4911
|
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 } } } };
|
|
@@ -4972,7 +4965,7 @@ const mapDataToProps = _ref => {
|
|
|
4972
4965
|
return {
|
|
4973
4966
|
fetchTypeDefinitionsQuery: {
|
|
4974
4967
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
4975
|
-
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
4968
|
+
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$Y({}, applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
4976
4969
|
isImmutable: true
|
|
4977
4970
|
}), [{
|
|
4978
4971
|
from: 'labelAllLocales',
|
|
@@ -5000,12 +4993,12 @@ const handlers$2 = {
|
|
|
5000
4993
|
}
|
|
5001
4994
|
};
|
|
5002
4995
|
|
|
5003
|
-
function ownKeys$
|
|
5004
|
-
function _objectSpread$
|
|
4996
|
+
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; }
|
|
4997
|
+
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; }
|
|
5005
4998
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5006
4999
|
return {
|
|
5007
5000
|
fields: customFieldsFromRestResponse.fields,
|
|
5008
|
-
type: _objectSpread$
|
|
5001
|
+
type: _objectSpread$X({
|
|
5009
5002
|
id: customFieldsFromRestResponse.type.id
|
|
5010
5003
|
}, customFieldsFromRestResponse.type.obj)
|
|
5011
5004
|
};
|
|
@@ -5019,19 +5012,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5019
5012
|
key: typeDefinition.key,
|
|
5020
5013
|
name: transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5021
5014
|
fieldDefinitions: _mapInstanceProperty(_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5022
|
-
var _fieldDefinition$type,
|
|
5015
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5023
5016
|
return {
|
|
5024
5017
|
name: fieldDefinition.name,
|
|
5025
5018
|
required: fieldDefinition.required,
|
|
5026
5019
|
inputHint: fieldDefinition.inputHint,
|
|
5027
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5028
|
-
elementType: _objectSpread$
|
|
5020
|
+
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$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
5021
|
+
elementType: _objectSpread$X(_objectSpread$X({}, fieldDefinition.type.elementType), {}, {
|
|
5029
5022
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5030
5023
|
key: value.key,
|
|
5031
5024
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5032
5025
|
}))
|
|
5033
5026
|
})
|
|
5034
|
-
}) : ((_fieldDefinition$
|
|
5027
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
5035
5028
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
5036
5029
|
key: value.key,
|
|
5037
5030
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5047,7 +5040,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5047
5040
|
type: {
|
|
5048
5041
|
id: formCustomFields.type.id,
|
|
5049
5042
|
typeId: 'type',
|
|
5050
|
-
obj: _objectSpread$
|
|
5043
|
+
obj: _objectSpread$X({}, formCustomFields.type)
|
|
5051
5044
|
},
|
|
5052
5045
|
fields: formCustomFields.fields
|
|
5053
5046
|
});
|
|
@@ -5055,7 +5048,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5055
5048
|
type: {
|
|
5056
5049
|
id: formCustomFields.type.id,
|
|
5057
5050
|
typeId: 'type',
|
|
5058
|
-
obj: _objectSpread$
|
|
5051
|
+
obj: _objectSpread$X({}, omit(formCustomFields.type, ['id']))
|
|
5059
5052
|
},
|
|
5060
5053
|
fields: omitBy(formCustomFields.fields || {}, isNil$1)
|
|
5061
5054
|
});
|
|
@@ -5071,7 +5064,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5071
5064
|
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); }; }
|
|
5072
5065
|
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; } }
|
|
5073
5066
|
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 } } } };
|
|
5074
|
-
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'];
|
|
5067
|
+
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'];
|
|
5075
5068
|
const emptyTypeDefinitions = {
|
|
5076
5069
|
total: 0,
|
|
5077
5070
|
count: 0,
|
|
@@ -5129,13 +5122,13 @@ const createGraphQlOptions = ownProps => {
|
|
|
5129
5122
|
}
|
|
5130
5123
|
};
|
|
5131
5124
|
};
|
|
5132
|
-
var
|
|
5125
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics(graphql$1(FetchTypeDefinitionsWithNamesQuery, {
|
|
5133
5126
|
name: 'fetchTypeDefinitionsQuery',
|
|
5134
5127
|
skip: ownProps => ownProps.isDisabled,
|
|
5135
5128
|
options: createGraphQlOptions
|
|
5136
5129
|
})(CustomFieldTypeDefinitionsConnector), CustomFieldTypeDefinitionsConnector);
|
|
5137
5130
|
|
|
5138
|
-
const getType
|
|
5131
|
+
const getType = fieldDefinition => {
|
|
5139
5132
|
const fieldDefinitionType = fieldDefinition.type.name.toLowerCase() === 'set' ? fieldDefinition.type.elementType : fieldDefinition.type;
|
|
5140
5133
|
return fieldDefinitionType;
|
|
5141
5134
|
};
|
|
@@ -5186,8 +5179,8 @@ const REFERENCED_TYPES = {
|
|
|
5186
5179
|
zone: 'zone'
|
|
5187
5180
|
};
|
|
5188
5181
|
|
|
5189
|
-
function ownKeys$
|
|
5190
|
-
function _objectSpread$
|
|
5182
|
+
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; }
|
|
5183
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$W(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$W(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5191
5184
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5192
5185
|
let validatedValues = [];
|
|
5193
5186
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5200,7 +5193,7 @@ const extractDuplicatedValues = (values, type, language, languages) => {
|
|
|
5200
5193
|
const setDuplicatedIfSet = (formValues, fieldDefinition, language, languages) => {
|
|
5201
5194
|
const fieldValue = formValues.custom.fields[fieldDefinition.name];
|
|
5202
5195
|
if (fieldDefinition.type.name.toLowerCase() === 'set' && _Array$isArray(fieldValue)) {
|
|
5203
|
-
const duplicatedValues = extractDuplicatedValues(fieldValue, getType
|
|
5196
|
+
const duplicatedValues = extractDuplicatedValues(fieldValue, getType(fieldDefinition), language, languages);
|
|
5204
5197
|
return {
|
|
5205
5198
|
duplicated: {
|
|
5206
5199
|
// although this is mixing concerns, we pass down `duplicatedValues` to the form.
|
|
@@ -5254,8 +5247,8 @@ function validations (formValues, language, languages) {
|
|
|
5254
5247
|
var _context2;
|
|
5255
5248
|
// Collect all required and set type fields
|
|
5256
5249
|
const fieldDefinitionsToValidate = _filterInstanceProperty(_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5257
|
-
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5258
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5250
|
+
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$W(_objectSpread$W({}, acc), {}, {
|
|
5251
|
+
[fieldDefinition.name]: _objectSpread$W(_objectSpread$W({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5259
5252
|
}), {});
|
|
5260
5253
|
return withoutEmptyErrorsByField(errors);
|
|
5261
5254
|
}
|
|
@@ -5282,8 +5275,8 @@ function CustomTextInput(props) {
|
|
|
5282
5275
|
}
|
|
5283
5276
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5284
5277
|
|
|
5285
|
-
function ownKeys$
|
|
5286
|
-
function _objectSpread$
|
|
5278
|
+
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; }
|
|
5279
|
+
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; }
|
|
5287
5280
|
const getSubfieldLanguage = subfieldName => {
|
|
5288
5281
|
const lastDotIndex = _lastIndexOfInstanceProperty(subfieldName).call(subfieldName, '.');
|
|
5289
5282
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5307,7 +5300,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5307
5300
|
// as a whole.
|
|
5308
5301
|
|
|
5309
5302
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5310
|
-
const newValue = _objectSpread$
|
|
5303
|
+
const newValue = _objectSpread$V(_objectSpread$V({}, props.value), {}, {
|
|
5311
5304
|
[fieldLanguage]: rawValue
|
|
5312
5305
|
});
|
|
5313
5306
|
const nullifiedIfNeeded = LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5374,21 +5367,21 @@ function CustomNumberInput(props) {
|
|
|
5374
5367
|
}
|
|
5375
5368
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5376
5369
|
|
|
5377
|
-
function ownKeys$
|
|
5378
|
-
function _objectSpread$
|
|
5370
|
+
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; }
|
|
5371
|
+
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; }
|
|
5379
5372
|
var styles$f = {
|
|
5380
5373
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5381
5374
|
};
|
|
5382
5375
|
const fixCurrencyCode = (value, currencies) => {
|
|
5383
5376
|
if (value.currencyCode) return value;
|
|
5384
5377
|
const firstCurrency = currencies[0];
|
|
5385
|
-
return _objectSpread$
|
|
5378
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5386
5379
|
currencyCode: firstCurrency
|
|
5387
5380
|
});
|
|
5388
5381
|
};
|
|
5389
5382
|
const fixAmount = value => {
|
|
5390
5383
|
if (!value.amount) {
|
|
5391
|
-
return _objectSpread$
|
|
5384
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5392
5385
|
amount: '0'
|
|
5393
5386
|
});
|
|
5394
5387
|
}
|
|
@@ -5430,7 +5423,7 @@ function CustomMoneyInput(props) {
|
|
|
5430
5423
|
}
|
|
5431
5424
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5432
5425
|
const isAmount = _endsWithInstanceProperty(subfieldName).call(subfieldName, 'amount');
|
|
5433
|
-
const newValue = _objectSpread$
|
|
5426
|
+
const newValue = _objectSpread$U({}, internalValue.current);
|
|
5434
5427
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5435
5428
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5436
5429
|
internalValue.current = fixedValue;
|
|
@@ -5711,7 +5704,7 @@ function ReferenceSearch(props) {
|
|
|
5711
5704
|
});
|
|
5712
5705
|
}
|
|
5713
5706
|
|
|
5714
|
-
const messages$
|
|
5707
|
+
const messages$B = defineMessages({
|
|
5715
5708
|
placeholder: {
|
|
5716
5709
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5717
5710
|
description: 'Placeholder for search for a category',
|
|
@@ -5744,8 +5737,8 @@ const messages$A = defineMessages({
|
|
|
5744
5737
|
}
|
|
5745
5738
|
});
|
|
5746
5739
|
|
|
5747
|
-
function ownKeys$
|
|
5748
|
-
function _objectSpread$
|
|
5740
|
+
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; }
|
|
5741
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$T(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$T(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5749
5742
|
function Option$1(props) {
|
|
5750
5743
|
var _context, _context2;
|
|
5751
5744
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
@@ -5757,7 +5750,7 @@ function Option$1(props) {
|
|
|
5757
5750
|
const _useIntl = useIntl(),
|
|
5758
5751
|
formatMessage = _useIntl.formatMessage;
|
|
5759
5752
|
const category = props.data;
|
|
5760
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5753
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$T(_objectSpread$T({}, props), {}, {
|
|
5761
5754
|
children: jsxs("div", {
|
|
5762
5755
|
"data-testid": "category-option",
|
|
5763
5756
|
children: [jsx(Text.Body, {
|
|
@@ -5768,7 +5761,7 @@ function Option$1(props) {
|
|
|
5768
5761
|
fallbackOrder: languages
|
|
5769
5762
|
})
|
|
5770
5763
|
}), category.parent && jsx(Text.Detail, {
|
|
5771
|
-
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$
|
|
5764
|
+
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, formatLocalizedString(category.parent, {
|
|
5772
5765
|
key: 'name',
|
|
5773
5766
|
locale: language,
|
|
5774
5767
|
fallbackOrder: languages
|
|
@@ -5780,14 +5773,14 @@ function Option$1(props) {
|
|
|
5780
5773
|
fallbackOrder: languages
|
|
5781
5774
|
}))
|
|
5782
5775
|
}), category.externalId && jsx(Text.Detail, {
|
|
5783
|
-
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$
|
|
5776
|
+
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || NO_VALUE_FALLBACK)
|
|
5784
5777
|
})]
|
|
5785
5778
|
})
|
|
5786
5779
|
}));
|
|
5787
5780
|
}
|
|
5788
5781
|
|
|
5789
|
-
function ownKeys$
|
|
5790
|
-
function _objectSpread$
|
|
5782
|
+
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; }
|
|
5783
|
+
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; }
|
|
5791
5784
|
const filterOption$1 = () => true;
|
|
5792
5785
|
function CategoryReferenceSearch(props) {
|
|
5793
5786
|
const _useIntl = useIntl(),
|
|
@@ -5799,7 +5792,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5799
5792
|
})),
|
|
5800
5793
|
language = _useApplicationContex.language,
|
|
5801
5794
|
languages = _useApplicationContex.languages;
|
|
5802
|
-
const mapItemToOption = useCallback(category => _objectSpread$
|
|
5795
|
+
const mapItemToOption = useCallback(category => _objectSpread$S(_objectSpread$S({}, category), {}, {
|
|
5803
5796
|
value: category.id,
|
|
5804
5797
|
label: formatLocalizedString(category, {
|
|
5805
5798
|
key: 'name',
|
|
@@ -5817,7 +5810,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5817
5810
|
}), [apolloClient]);
|
|
5818
5811
|
return jsx(ReferenceSearch, {
|
|
5819
5812
|
id: props.id,
|
|
5820
|
-
components: _objectSpread$
|
|
5813
|
+
components: _objectSpread$S({
|
|
5821
5814
|
Option: Option$1
|
|
5822
5815
|
}, props.components),
|
|
5823
5816
|
isClearable: props.isClearable,
|
|
@@ -5828,10 +5821,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5828
5821
|
onBlur: props.onBlur,
|
|
5829
5822
|
onChange: props.onChange,
|
|
5830
5823
|
value: props.value,
|
|
5831
|
-
placeholderLabel: formatMessage(messages$
|
|
5832
|
-
searchPromptLabel: formatMessage(messages$
|
|
5833
|
-
noResultsLabel: formatMessage(messages$
|
|
5834
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5824
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5825
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5826
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5827
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5835
5828
|
mapItemToOption: mapItemToOption,
|
|
5836
5829
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5837
5830
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5907,7 +5900,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5907
5900
|
});
|
|
5908
5901
|
}
|
|
5909
5902
|
|
|
5910
|
-
const messages$
|
|
5903
|
+
const messages$A = defineMessages({
|
|
5911
5904
|
placeholder: {
|
|
5912
5905
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5913
5906
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5935,8 +5928,8 @@ const messages$z = defineMessages({
|
|
|
5935
5928
|
}
|
|
5936
5929
|
});
|
|
5937
5930
|
|
|
5938
|
-
function ownKeys$
|
|
5939
|
-
function _objectSpread$
|
|
5931
|
+
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; }
|
|
5932
|
+
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; }
|
|
5940
5933
|
function Option(props) {
|
|
5941
5934
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
5942
5935
|
language: applicationContext.dataLocale,
|
|
@@ -5947,7 +5940,7 @@ function Option(props) {
|
|
|
5947
5940
|
const _useIntl = useIntl(),
|
|
5948
5941
|
formatMessage = _useIntl.formatMessage;
|
|
5949
5942
|
const cartDiscount = props.data;
|
|
5950
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5943
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$R(_objectSpread$R({}, props), {}, {
|
|
5951
5944
|
children: jsxs("div", {
|
|
5952
5945
|
"data-testid": "cart-discount-option",
|
|
5953
5946
|
children: [jsx(Text.Detail, {
|
|
@@ -5958,14 +5951,14 @@ function Option(props) {
|
|
|
5958
5951
|
fallbackOrder: languages
|
|
5959
5952
|
})
|
|
5960
5953
|
}), jsxs(Text.Detail, {
|
|
5961
|
-
children: [formatMessage(messages$
|
|
5954
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
|
|
5962
5955
|
})]
|
|
5963
5956
|
})
|
|
5964
5957
|
}));
|
|
5965
5958
|
}
|
|
5966
5959
|
|
|
5967
|
-
function ownKeys$
|
|
5968
|
-
function _objectSpread$
|
|
5960
|
+
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; }
|
|
5961
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$Q(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$Q(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5969
5962
|
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 } } } };
|
|
5970
5963
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
5971
5964
|
const filterOption = (option, text) => {
|
|
@@ -5991,7 +5984,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5991
5984
|
})),
|
|
5992
5985
|
language = _useApplicationContex.language,
|
|
5993
5986
|
languages = _useApplicationContex.languages;
|
|
5994
|
-
const mapItemToOption = useCallback(cartDiscount => _objectSpread$
|
|
5987
|
+
const mapItemToOption = useCallback(cartDiscount => _objectSpread$Q(_objectSpread$Q({}, cartDiscount), {}, {
|
|
5995
5988
|
value: cartDiscount.id,
|
|
5996
5989
|
key: cartDiscount.key,
|
|
5997
5990
|
label: formatLocalizedString(cartDiscount, {
|
|
@@ -6034,10 +6027,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6034
6027
|
onBlur: props.onBlur,
|
|
6035
6028
|
onChange: props.onChange,
|
|
6036
6029
|
value: returnNullIfEmpty(props.value),
|
|
6037
|
-
placeholderLabel: formatMessage(messages$
|
|
6038
|
-
searchPromptLabel: formatMessage(messages$
|
|
6039
|
-
noResultsLabel: formatMessage(messages$
|
|
6040
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6030
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6031
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6032
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6033
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6041
6034
|
mapItemToOption: mapItemToOption,
|
|
6042
6035
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6043
6036
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6098,7 +6091,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6098
6091
|
});
|
|
6099
6092
|
}
|
|
6100
6093
|
|
|
6101
|
-
var messages$
|
|
6094
|
+
var messages$z = defineMessages({
|
|
6102
6095
|
noProductsFound: {
|
|
6103
6096
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6104
6097
|
description: 'The message to display when no products were found',
|
|
@@ -6187,7 +6180,7 @@ const ProductPickerInput = _ref => {
|
|
|
6187
6180
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6188
6181
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6189
6182
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6190
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6183
|
+
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 : '';
|
|
6191
6184
|
return jsx(Constraints.Horizontal, {
|
|
6192
6185
|
max: "scale",
|
|
6193
6186
|
children: currentOption.loading ? jsx(CenteredLoadingSpinner, {}) : jsxs(Spacings.Stack, {
|
|
@@ -6197,7 +6190,7 @@ const ProductPickerInput = _ref => {
|
|
|
6197
6190
|
children: jsx(AsyncSelectInput, {
|
|
6198
6191
|
id: name,
|
|
6199
6192
|
name: name,
|
|
6200
|
-
placeholder: formatMessage(messages$
|
|
6193
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6201
6194
|
loadOptions: loadOptionsDebounced,
|
|
6202
6195
|
defaultOptions: [],
|
|
6203
6196
|
isClearable: isClearable,
|
|
@@ -6211,7 +6204,7 @@ const ProductPickerInput = _ref => {
|
|
|
6211
6204
|
onInputChange: handleInputChange,
|
|
6212
6205
|
onBlur: onBlur,
|
|
6213
6206
|
value: currentOption.data,
|
|
6214
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6207
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6215
6208
|
hasError: hasError || isLoadingFailed
|
|
6216
6209
|
})
|
|
6217
6210
|
}), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
|
|
@@ -6461,8 +6454,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6461
6454
|
}
|
|
6462
6455
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6463
6456
|
|
|
6464
|
-
function ownKeys$
|
|
6465
|
-
function _objectSpread$
|
|
6457
|
+
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; }
|
|
6458
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$P(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$P(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6466
6459
|
const getTypeName = type => type.name.toLowerCase();
|
|
6467
6460
|
const findLabel = (enumType, key) => {
|
|
6468
6461
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6506,12 +6499,13 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6506
6499
|
inputHint: attributeDefinition.inputHint,
|
|
6507
6500
|
inputTip: attributeDefinition.inputTip,
|
|
6508
6501
|
required: attributeDefinition.isRequired,
|
|
6509
|
-
type: attributeDefinition.type
|
|
6502
|
+
type: attributeDefinition.type,
|
|
6503
|
+
assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
|
|
6510
6504
|
});
|
|
6511
6505
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty(pairs).call(pairs, (result, _ref2) => {
|
|
6512
6506
|
let name = _ref2.name,
|
|
6513
6507
|
value = _ref2.value;
|
|
6514
|
-
return _objectSpread$
|
|
6508
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
6515
6509
|
[name]: value
|
|
6516
6510
|
});
|
|
6517
6511
|
}, {});
|
|
@@ -6595,7 +6589,7 @@ function ProductAttributeInput(props) {
|
|
|
6595
6589
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6596
6590
|
|
|
6597
6591
|
// eslint-disable-next-line import/prefer-default-export
|
|
6598
|
-
const messages$
|
|
6592
|
+
const messages$y = defineMessages({
|
|
6599
6593
|
aboveFifthLevelWarning: {
|
|
6600
6594
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6601
6595
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6608,23 +6602,23 @@ const messages$x = defineMessages({
|
|
|
6608
6602
|
}
|
|
6609
6603
|
});
|
|
6610
6604
|
|
|
6611
|
-
function ownKeys$
|
|
6612
|
-
function _objectSpread$
|
|
6605
|
+
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; }
|
|
6606
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$O(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$O(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6613
6607
|
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 } } } };
|
|
6614
6608
|
const mapAttributeDefinition = definition => {
|
|
6615
|
-
var _context, _definition$type,
|
|
6616
|
-
return _objectSpread$
|
|
6609
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6610
|
+
return _objectSpread$O(_objectSpread$O({}, definition), {}, {
|
|
6617
6611
|
required: definition.isRequired,
|
|
6618
6612
|
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6619
6613
|
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6620
|
-
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6621
|
-
elementType: _objectSpread$
|
|
6614
|
+
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$O(_objectSpread$O({}, definition.type), {}, {
|
|
6615
|
+
elementType: _objectSpread$O(_objectSpread$O({}, definition.type.elementType), {}, {
|
|
6622
6616
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6623
6617
|
key: value.key,
|
|
6624
6618
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6625
6619
|
}))
|
|
6626
6620
|
})
|
|
6627
|
-
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6621
|
+
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$O(_objectSpread$O({}, definition.type), {}, {
|
|
6628
6622
|
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6629
6623
|
key: value.key,
|
|
6630
6624
|
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6665,7 +6659,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6665
6659
|
};
|
|
6666
6660
|
}
|
|
6667
6661
|
|
|
6668
|
-
var messages$
|
|
6662
|
+
var messages$x = defineMessages({
|
|
6669
6663
|
updateButton: {
|
|
6670
6664
|
id: 'NestedAttributes.Details.updateButton',
|
|
6671
6665
|
description: 'Update button label',
|
|
@@ -6745,14 +6739,14 @@ var messages$w = defineMessages({
|
|
|
6745
6739
|
|
|
6746
6740
|
const NestingLevelContext = /*#__PURE__*/createContext(0);
|
|
6747
6741
|
|
|
6748
|
-
function ownKeys$
|
|
6749
|
-
function _objectSpread$
|
|
6742
|
+
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; }
|
|
6743
|
+
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; }
|
|
6750
6744
|
const EditButton = props => {
|
|
6751
6745
|
const _useIntl = useIntl(),
|
|
6752
6746
|
formatMessage = _useIntl.formatMessage;
|
|
6753
6747
|
return jsx(Tooltip, {
|
|
6754
6748
|
placement: "top",
|
|
6755
|
-
title: formatMessage(messages$
|
|
6749
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6756
6750
|
children: jsx(IconButton, {
|
|
6757
6751
|
label: "Edit",
|
|
6758
6752
|
isDisabled: props.isDisabled,
|
|
@@ -6768,12 +6762,12 @@ const DropChangesConfirmation = props => {
|
|
|
6768
6762
|
formatMessage = _useIntl2.formatMessage;
|
|
6769
6763
|
return jsx(ConfirmationDialog, {
|
|
6770
6764
|
isOpen: props.isOpen || false,
|
|
6771
|
-
title: formatMessage(messages$
|
|
6772
|
-
labelPrimary: formatMessage(messages$
|
|
6765
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6766
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6773
6767
|
onConfirm: props.onConfirm,
|
|
6774
6768
|
onCancel: props.onCancel,
|
|
6775
6769
|
children: jsx(Text.Body, {
|
|
6776
|
-
intlMessage: messages$
|
|
6770
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6777
6771
|
})
|
|
6778
6772
|
});
|
|
6779
6773
|
};
|
|
@@ -6798,11 +6792,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6798
6792
|
children: [jsx(SecondaryButton, {
|
|
6799
6793
|
isDisabled: !formik.dirty,
|
|
6800
6794
|
iconLeft: jsx(RevertIcon, {}),
|
|
6801
|
-
label: formatMessage(messages$
|
|
6795
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6802
6796
|
onClick: formik.resetForm
|
|
6803
6797
|
}), jsx(CustomFormModalPage.FormPrimaryButton, {
|
|
6804
6798
|
isDisabled: !formik.dirty,
|
|
6805
|
-
label: formatMessage(messages$
|
|
6799
|
+
label: formatMessage(messages$x.updateButton),
|
|
6806
6800
|
onClick: formik.handleSubmit
|
|
6807
6801
|
})]
|
|
6808
6802
|
}),
|
|
@@ -6831,7 +6825,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6831
6825
|
const MaxNestingLevelReached = () => jsx(FieldLabel, {
|
|
6832
6826
|
title: "",
|
|
6833
6827
|
hint: jsx(Text.Body, {
|
|
6834
|
-
intlMessage: messages$
|
|
6828
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6835
6829
|
}),
|
|
6836
6830
|
hintIcon: jsx(WarningIcon, {})
|
|
6837
6831
|
});
|
|
@@ -6843,7 +6837,7 @@ const NestedInputControls = props => {
|
|
|
6843
6837
|
if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
|
|
6844
6838
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6845
6839
|
if (!hasAttributes) return jsx(Text.Body, {
|
|
6846
|
-
intlMessage: messages$
|
|
6840
|
+
intlMessage: messages$x.emptyProductType,
|
|
6847
6841
|
tone: "secondary"
|
|
6848
6842
|
});
|
|
6849
6843
|
return jsxs(Spacings.Inline, {
|
|
@@ -6857,7 +6851,7 @@ const NestedInputControls = props => {
|
|
|
6857
6851
|
children: props.productType.name
|
|
6858
6852
|
}), props.isEmpty && jsx("span", {
|
|
6859
6853
|
children: jsx(Tag, {
|
|
6860
|
-
children: formatMessage(messages$
|
|
6854
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6861
6855
|
})
|
|
6862
6856
|
})]
|
|
6863
6857
|
}), jsx(EditButton, {
|
|
@@ -6893,13 +6887,13 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
6893
6887
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6894
6888
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6895
6889
|
const openNestedAttributesForm = () => {
|
|
6896
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6890
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6897
6891
|
hideSaveToolbar: true
|
|
6898
6892
|
}));
|
|
6899
6893
|
attributesForm.openModal();
|
|
6900
6894
|
};
|
|
6901
6895
|
const closeNestedAttributesForm = () => {
|
|
6902
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6896
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6903
6897
|
hideSaveToolbar: false
|
|
6904
6898
|
}));
|
|
6905
6899
|
attributesForm.closeModal();
|
|
@@ -6919,7 +6913,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
6919
6913
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
6920
6914
|
kind: 'success',
|
|
6921
6915
|
domain: DOMAINS.SIDE,
|
|
6922
|
-
text: formatMessage(messages$
|
|
6916
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
6923
6917
|
});
|
|
6924
6918
|
setSubmitting(false);
|
|
6925
6919
|
},
|
|
@@ -7003,8 +6997,8 @@ const SetButtons = props => {
|
|
|
7003
6997
|
};
|
|
7004
6998
|
SetButtons.displayName = 'SetButtons';
|
|
7005
6999
|
|
|
7006
|
-
function ownKeys$
|
|
7007
|
-
function _objectSpread$
|
|
7000
|
+
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; }
|
|
7001
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$M(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$M(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7008
7002
|
const getDuplicateErrors = setValues => {
|
|
7009
7003
|
/* eslint-disable no-plusplus */
|
|
7010
7004
|
const result = [];
|
|
@@ -7061,7 +7055,7 @@ function CustomInputSet(props) {
|
|
|
7061
7055
|
touched = _useFormikContext.touched,
|
|
7062
7056
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7063
7057
|
dirty = _useFormikContext.dirty;
|
|
7064
|
-
const itemFieldDefinition = _objectSpread$
|
|
7058
|
+
const itemFieldDefinition = _objectSpread$M(_objectSpread$M({}, props.fieldDefinition), {}, {
|
|
7065
7059
|
type: props.fieldDefinition.type.elementType
|
|
7066
7060
|
});
|
|
7067
7061
|
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7119,7 +7113,7 @@ function CustomInputSet(props) {
|
|
|
7119
7113
|
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
7120
7114
|
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
7121
7115
|
// type is selected.
|
|
7122
|
-
const type = getType
|
|
7116
|
+
const type = getType(props.fieldDefinition);
|
|
7123
7117
|
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
7124
7118
|
const areButtonsTopAligned = _includesInstanceProperty(_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
|
|
7125
7119
|
return jsxs(Fragment, {
|
|
@@ -7199,7 +7193,7 @@ const CustomFieldInput = /*#__PURE__*/memo(props => {
|
|
|
7199
7193
|
// Boolean is the only set element with peculiarities (i.e. way more
|
|
7200
7194
|
// convenient for user to work with it as with select input with three values:
|
|
7201
7195
|
// [true], [false] and [true, false]).
|
|
7202
|
-
if (((_getSetElementType = getType
|
|
7196
|
+
if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
|
|
7203
7197
|
return CustomBooleanInputSet;
|
|
7204
7198
|
}
|
|
7205
7199
|
// All the rest sets are just a fancy wrapper around single-item components
|
|
@@ -7221,7 +7215,7 @@ const CustomFieldInput = /*#__PURE__*/memo(props => {
|
|
|
7221
7215
|
});
|
|
7222
7216
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7223
7217
|
|
|
7224
|
-
var messages$
|
|
7218
|
+
var messages$w = defineMessages({
|
|
7225
7219
|
referencedProductType: {
|
|
7226
7220
|
id: 'NestedAttributes.referencedProductType',
|
|
7227
7221
|
description: 'Product type referenced hint',
|
|
@@ -7229,10 +7223,10 @@ var messages$v = defineMessages({
|
|
|
7229
7223
|
}
|
|
7230
7224
|
});
|
|
7231
7225
|
|
|
7232
|
-
function ownKeys$
|
|
7233
|
-
function _objectSpread$
|
|
7226
|
+
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; }
|
|
7227
|
+
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; }
|
|
7234
7228
|
function ProductTypeReference(props) {
|
|
7235
|
-
const productTypeMessage = _objectSpread$
|
|
7229
|
+
const productTypeMessage = _objectSpread$L(_objectSpread$L({}, messages$w.referencedProductType), {}, {
|
|
7236
7230
|
values: {
|
|
7237
7231
|
productTypeName: props.productType.name
|
|
7238
7232
|
}
|
|
@@ -7278,9 +7272,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7278
7272
|
}
|
|
7279
7273
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7280
7274
|
|
|
7281
|
-
function ownKeys$
|
|
7282
|
-
function _objectSpread$
|
|
7283
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7275
|
+
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; }
|
|
7276
|
+
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; }
|
|
7277
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$K(_objectSpread$K({}, result), itemErrors), {});
|
|
7284
7278
|
|
|
7285
7279
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7286
7280
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7291,15 +7285,15 @@ const CustomFieldErrors = props => {
|
|
|
7291
7285
|
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7292
7286
|
return jsxs(Fragment, {
|
|
7293
7287
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
7294
|
-
intlMessage: messages$
|
|
7288
|
+
intlMessage: messages$K.required
|
|
7295
7289
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
7296
|
-
intlMessage: messages$
|
|
7290
|
+
intlMessage: messages$K.unique
|
|
7297
7291
|
})]
|
|
7298
7292
|
});
|
|
7299
7293
|
};
|
|
7300
7294
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7301
7295
|
|
|
7302
|
-
var messages$
|
|
7296
|
+
var messages$v = defineMessages({
|
|
7303
7297
|
productReferenceLabel: {
|
|
7304
7298
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7305
7299
|
description: 'Label shown above the product picker input.',
|
|
@@ -7329,16 +7323,22 @@ var messages$u = defineMessages({
|
|
|
7329
7323
|
id: 'cartDiscountMoreThan500',
|
|
7330
7324
|
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
7331
7325
|
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
7326
|
+
},
|
|
7327
|
+
attributeGroupCountTooltip: {
|
|
7328
|
+
id: 'CustomFieldsLabel.attributeGroupCountTooltip',
|
|
7329
|
+
description: 'Tooltip message to display when the same attribute is assigned to multiple attribute groups',
|
|
7330
|
+
defaultMessage: 'Synced with {count} Attribute groups: {attributeGroups}'
|
|
7332
7331
|
}
|
|
7333
7332
|
});
|
|
7334
7333
|
|
|
7335
|
-
function ownKeys$
|
|
7336
|
-
function _objectSpread$
|
|
7334
|
+
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; }
|
|
7335
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$J(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$J(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7336
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
7337
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 } } } };
|
|
7338
|
-
const CustomFieldsLabelHint =
|
|
7338
|
+
const CustomFieldsLabelHint = _ref2 => {
|
|
7339
7339
|
var _type$name;
|
|
7340
|
-
let fieldDefinition =
|
|
7341
|
-
const type = getType
|
|
7340
|
+
let fieldDefinition = _ref2.fieldDefinition;
|
|
7341
|
+
const type = getType(fieldDefinition);
|
|
7342
7342
|
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
7343
7343
|
const referenceTypeId = type.referenceTypeId;
|
|
7344
7344
|
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
@@ -7363,7 +7363,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7363
7363
|
children: [jsx(WarningIcon, {
|
|
7364
7364
|
size: "medium",
|
|
7365
7365
|
color: "warning"
|
|
7366
|
-
}), jsx(FormattedMessage, _objectSpread$
|
|
7366
|
+
}), jsx(FormattedMessage, _objectSpread$J({}, messages$v.cartDiscountMoreThan500))]
|
|
7367
7367
|
});
|
|
7368
7368
|
}
|
|
7369
7369
|
return formatLocalizedString(fieldDefinition, {
|
|
@@ -7377,28 +7377,61 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7377
7377
|
formatMessage = _useIntl.formatMessage;
|
|
7378
7378
|
const _usePimStatus = usePimStatus(),
|
|
7379
7379
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7380
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7381
|
-
return formatMessage(messages$
|
|
7380
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7381
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7382
7382
|
}
|
|
7383
7383
|
|
|
7384
7384
|
// TODO(pa3): this logic may be misplaced and probably
|
|
7385
7385
|
// should belong to <CustomReferenceInput /> component instead.
|
|
7386
|
-
function CustomFieldsLabelSubtitle(
|
|
7386
|
+
function CustomFieldsLabelSubtitle(_ref3) {
|
|
7387
7387
|
var _type$name2, _context;
|
|
7388
|
-
let fieldDefinition =
|
|
7388
|
+
let fieldDefinition = _ref3.fieldDefinition;
|
|
7389
7389
|
const _useIntl2 = useIntl(),
|
|
7390
7390
|
formatMessage = _useIntl2.formatMessage;
|
|
7391
|
-
const type = getType
|
|
7391
|
+
const type = getType(fieldDefinition);
|
|
7392
7392
|
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
7393
7393
|
if (!isReference) return null;
|
|
7394
7394
|
const referenceTypeId = type.referenceTypeId;
|
|
7395
7395
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7396
7396
|
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7397
|
-
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");
|
|
7398
|
+
}
|
|
7399
|
+
const Portal = props => /*#__PURE__*/ReactDOM.createPortal(props.children, document.body);
|
|
7400
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
7401
|
+
name: "ar8y70",
|
|
7402
|
+
styles: "cursor:pointer;line-height:normal"
|
|
7403
|
+
} : {
|
|
7404
|
+
name: "471ze2-CustomFieldsCountIndicator",
|
|
7405
|
+
styles: "cursor:pointer;line-height:normal;label:CustomFieldsCountIndicator;",
|
|
7406
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS1maWVsZHMtbGFiZWwuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9KZ0IiLCJmaWxlIjoiY3VzdG9tLWZpZWxkcy1sYWJlbC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBtZW1vIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFJlYWN0RE9NIGZyb20gJ3JlYWN0LWRvbSc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQge1xuICBDb25zdHJhaW50cyxcbiAgRmllbGRMYWJlbCxcbiAgU3BhY2luZ3MsXG4gIFN3aXRjaGVySWNvbixcbiAgVG9vbHRpcCxcbiAgV2FybmluZ0ljb24sXG59IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5pbXBvcnQgeyBGb3JtYXR0ZWRNZXNzYWdlLCB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9sMTBuJztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VBcHBsaWNhdGlvbkNvbnRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9hcHBsaWNhdGlvbi1zaGVsbC1jb25uZWN0b3JzJztcbmltcG9ydCB7IHVzZVF1ZXJ5IH0gZnJvbSAnQGFwb2xsby9jbGllbnQvcmVhY3QnO1xuaW1wb3J0IHsgR1JBUEhRTF9UQVJHRVRTIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJztcbmltcG9ydCB7IFFVRVJZX01BWF9MSU1JVCwgU0VBUkNIQUJMRV9SRUZFUkVOQ0VTIH0gZnJvbSAnLi4vLi4vLi4vY29uc3RhbnRzJztcbmltcG9ydCB7XG4gIHVzZVBpbVN0YXR1cyxcbiAgY2FwaXRhbGl6ZUZpcnN0LFxuICB1c2VGb3JtYXRMb2NhbGl6ZWRGaWVsZFRvU3RyaW5nLFxufSBmcm9tICcuLi8uLi8uLi9pbnRlcm5hbC1pbmRleCc7XG5cbmltcG9ydCB7IGdldFR5cGUgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBDYXJ0RGlzY291bnRzQ291bnQgfSBmcm9tICcuL2NhcnQtZGlzY291bnRzLWNvdW50LmN0cC5ncmFwaHFsJztcblxuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuXG5jb25zdCBDdXN0b21GaWVsZHNMYWJlbEhpbnQgPSAoeyBmaWVsZERlZmluaXRpb24gfSkgPT4ge1xuICBjb25zdCB0eXBlID0gZ2V0VHlwZShmaWVsZERlZmluaXRpb24pO1xuICBjb25zdCBpc1JlZmVyZW5jZSA9IHR5cGUubmFtZT8udG9Mb3dlckNhc2UoKSA9PT0gJ3JlZmVyZW5jZSc7XG4gIGNvbnN0IHJlZmVyZW5jZVR5cGVJZCA9IHR5cGUucmVmZXJlbmNlVHlwZUlkO1xuICBjb25zdCBpc0NhcnREaXNjb3VudHNSZWZlcmVuY2UgPVxuICAgIGlzUmVmZXJlbmNlICYmIHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLmNhcnREaXNjb3VudDtcblxuICBjb25zdCB7IGxhbmd1YWdlcywgZGF0YUxvY2FsZSB9ID0gdXNlQXBwbGljYXRpb25Db250ZXh0KFxuICAgIChhcHBsaWNhdGlvbkNvbnRleHQpID0+ICh7XG4gICAgICBsYW5ndWFnZXM6IGFwcGxpY2F0aW9uQ29udGV4dC5wcm9qZWN0Lmxhbmd1YWdlcyxcbiAgICAgIGRhdGFMb2NhbGU6IGFwcGxpY2F0aW9uQ29udGV4dC5kYXRhTG9jYWxlLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgeyBkYXRhLCBsb2FkaW5nIH0gPSB1c2VRdWVyeShDYXJ0RGlzY291bnRzQ291bnQsIHtcbiAgICBza2lwOiAhaXNDYXJ0RGlzY291bnRzUmVmZXJlbmNlLFxuICAgIGNvbnRleHQ6IHtcbiAgICAgIHRhcmdldDogR1JBUEhRTF9UQVJHRVRTLkNPTU1FUkNFVE9PTFNfUExBVEZPUk0sXG4gICAgfSxcbiAgfSk7XG5cbiAgaWYgKGxvYWRpbmcpIHJldHVybiBudWxsO1xuXG4gIGlmIChkYXRhPy5jYXJ0RGlzY291bnRzLnRvdGFsID4gUVVFUllfTUFYX0xJTUlUKSB7XG4gICAgcmV0dXJuIChcbiAgICAgIDxTcGFjaW5ncy5JbmxpbmUgYWxpZ25JdGVtcz1cImNlbnRlclwiPlxuICAgICAgICA8V2FybmluZ0ljb24gc2l6ZT1cIm1lZGl1bVwiIGNvbG9yPVwid2FybmluZ1wiIC8+XG4gICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5jYXJ0RGlzY291bnRNb3JlVGhhbjUwMH0gLz5cbiAgICAgIDwvU3BhY2luZ3MuSW5saW5lPlxuICAgICk7XG4gIH1cblxuICByZXR1cm4gZm9ybWF0TG9jYWxpemVkU3RyaW5nKGZpZWxkRGVmaW5pdGlvbiwge1xuICAgIGtleTogJ2lucHV0VGlwJyxcbiAgICBsb2NhbGU6IGRhdGFMb2NhbGUsXG4gICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICB9KTtcbn07XG5DdXN0b21GaWVsZHNMYWJlbEhpbnQucHJvcFR5cGVzID0ge1xuICBmaWVsZERlZmluaXRpb246IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgbmFtZTogUHJvcFR5cGVzLnN0cmluZyxcbiAgICBpbnB1dFRpcDogUHJvcFR5cGVzLm9iamVjdCxcbiAgICByZXF1aXJlZDogUHJvcFR5cGVzLmJvb2wsXG4gIH0pLFxufTtcblxuZnVuY3Rpb24gQ3VzdG9tRmllbGRzUHJvZHVjdFR5cGVSZWZlcmVuY2VTdWJ0aXRsZSgpIHtcbiAgY29uc3QgeyBmb3JtYXRNZXNzYWdlIH0gPSB1c2VJbnRsKCk7XG4gIGNvbnN0IHsgaXNQcm9qZWN0SW5kZXhlZCB9ID0gdXNlUGltU3RhdHVzKCk7XG5cbiAgaWYgKGlzUHJvamVjdEluZGV4ZWQpXG4gICAgcmV0dXJuIGZvcm1hdE1lc3NhZ2UobWVzc2FnZXMucHJvZHVjdFR5cGVSZWZlcmVuY2VMYWJlbEkpO1xuICByZXR1cm4gZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5wcm9kdWN0VHlwZVJlZmVyZW5jZUxhYmVsKTtcbn1cblxuLy8gVE9ETyhwYTMpOiB0aGlzIGxvZ2ljIG1heSBiZSBtaXNwbGFjZWQgYW5kIHByb2JhYmx5XG4vLyBzaG91bGQgYmVsb25nIHRvIDxDdXN0b21SZWZlcmVuY2VJbnB1dCAvPiBjb21wb25lbnQgaW5zdGVhZC5cbmZ1bmN0aW9uIEN1c3RvbUZpZWxkc0xhYmVsU3VidGl0bGUoeyBmaWVsZERlZmluaXRpb24gfSkge1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgdHlwZSA9IGdldFR5cGUoZmllbGREZWZpbml0aW9uKTtcbiAgY29uc3QgaXNSZWZlcmVuY2UgPSB0eXBlLm5hbWU/LnRvTG93ZXJDYXNlKCkgPT09ICdyZWZlcmVuY2UnO1xuXG4gIGlmICghaXNSZWZlcmVuY2UpIHJldHVybiBudWxsO1xuXG4gIGNvbnN0IHJlZmVyZW5jZVR5cGVJZCA9IHR5cGUucmVmZXJlbmNlVHlwZUlkO1xuICBjb25zdCByZWZlcmVuY2VUeXBlTmFtZSA9IGNhcGl0YWxpemVGaXJzdChyZWZlcmVuY2VUeXBlSWQpO1xuXG4gIGlmIChcbiAgICBbXG4gICAgICBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMuY2F0ZWdvcnksXG4gICAgICBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMuY2FydERpc2NvdW50LFxuICAgIF0uaW5jbHVkZXMocmVmZXJlbmNlVHlwZUlkKVxuICApXG4gICAgcmV0dXJuIHJlZmVyZW5jZVR5cGVOYW1lO1xuXG4gIHJldHVybiBkbyB7XG4gICAgaWYgKHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLnByb2R1Y3QpXG4gICAgICBmb3JtYXRNZXNzYWdlKG1lc3NhZ2VzLnByb2R1Y3RSZWZlcmVuY2VMYWJlbCk7XG4gICAgZWxzZSBpZiAocmVmZXJlbmNlVHlwZUlkID09PSBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMucHJvZHVjdFR5cGUpXG4gICAgICA8Q3VzdG9tRmllbGRzUHJvZHVjdFR5cGVSZWZlcmVuY2VTdWJ0aXRsZSAvPjtcbiAgICBlbHNlIGlmIChyZWZlcmVuY2VUeXBlSWQgPT09IFNFQVJDSEFCTEVfUkVGRVJFTkNFUy5jaGFubmVsKVxuICAgICAgZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jaGFubmVsUmVmZXJlbmNlTGFiZWwpO1xuICAgIGVsc2UgaWYgKHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLnN0YXRlKVxuICAgICAgZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5zdGF0ZVJlZmVyZW5jZUxhYmVsKTtcbiAgICBlbHNlIGAke3JlZmVyZW5jZVR5cGVOYW1lfSBJRGA7XG4gIH07XG59XG5DdXN0b21GaWVsZHNMYWJlbFN1YnRpdGxlLnByb3BUeXBlcyA9IHtcbiAgZmllbGREZWZpbml0aW9uOiBQcm9wVHlwZXMuc2hhcGUoe1xuICAgIHR5cGU6IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICBuYW1lOiBQcm9wVHlwZXMuc3RyaW5nLFxuICAgICAgZWxlbWVudFR5cGU6IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICAgIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gICAgICB9KSxcbiAgICB9KSxcbiAgICBuYW1lOiBQcm9wVHlwZXMuc3RyaW5nLFxuICB9KS5pc1JlcXVpcmVkLFxufTtcblxuY29uc3QgUG9ydGFsID0gKHByb3BzKSA9PiBSZWFjdERPTS5jcmVhdGVQb3J0YWwocHJvcHMuY2hpbGRyZW4sIGRvY3VtZW50LmJvZHkpO1xuXG5mdW5jdGlvbiBDdXN0b21GaWVsZHNDb3VudEluZGljYXRvcih7IGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzIH0pIHtcbiAgY29uc3QgZm9ybWF0TG9jYWxpemVkRmllbGQgPSB1c2VGb3JtYXRMb2NhbGl6ZWRGaWVsZFRvU3RyaW5nKCk7XG4gIGNvbnN0IHsgZm9ybWF0TWVzc2FnZSB9ID0gdXNlSW50bCgpO1xuXG4gIHJldHVybiBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwcz8ubGVuZ3RoID4gMSA/IChcbiAgICA8VG9vbHRpcFxuICAgICAgdGl0bGU9e2Zvcm1hdE1lc3NhZ2UobWVzc2FnZXMuYXR0cmlidXRlR3JvdXBDb3VudFRvb2x0aXAsIHtcbiAgICAgICAgYXR0cmlidXRlR3JvdXBzOiBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwc1xuICAgICAgICAgIC5tYXAoKGFzc2lnbmVkQXR0cmlidXRlR3JvdXApID0+XG4gICAgICAgICAgICBmb3JtYXRMb2NhbGl6ZWRGaWVsZChhc3NpZ25lZEF0dHJpYnV0ZUdyb3VwLm5hbWVBbGxMb2NhbGVzKVxuICAgICAgICAgIClcbiAgICAgICAgICAuam9pbignLCAnKSxcbiAgICAgICAgY291bnQ6IGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzLmxlbmd0aCxcbiAgICAgIH0pfVxuICAgICAgaG9yaXpvbnRhbENvbnN0cmFpbnQ9ezd9XG4gICAgICBjb21wb25lbnRzPXt7IFRvb2x0aXBXcmFwcGVyQ29tcG9uZW50OiBQb3J0YWwgfX1cbiAgICA+XG4gICAgICA8ZGl2XG4gICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICBsaW5lLWhlaWdodDogbm9ybWFsO1xuICAgICAgICBgfVxuICAgICAgPlxuICAgICAgICA8U3dpdGNoZXJJY29uIGNvbG9yPVwiaW5mb1wiIHNpemU9XCJtZWRpdW1cIiAvPlxuICAgICAgPC9kaXY+XG4gICAgPC9Ub29sdGlwPlxuICApIDogbnVsbDtcbn1cblxuQ3VzdG9tRmllbGRzQ291bnRJbmRpY2F0b3IucHJvcFR5cGVzID0ge1xuICBhc3NpZ25lZEF0dHJpYnV0ZUdyb3VwczogUHJvcFR5cGVzLmFycmF5LFxufTtcblxuY29uc3QgQ3VzdG9tRmllbGRzTGFiZWwgPSBtZW1vKCh7IG5hbWUsIGZpZWxkRGVmaW5pdGlvbiB9KSA9PiB7XG4gIGNvbnN0IHsgbGFuZ3VhZ2VzLCBsYW5ndWFnZSB9ID0gdXNlQXBwbGljYXRpb25Db250ZXh0KFxuICAgIChhcHBsaWNhdGlvbkNvbnRleHQpID0+ICh7XG4gICAgICBsYW5ndWFnZXM6IGFwcGxpY2F0aW9uQ29udGV4dC5wcm9qZWN0Lmxhbmd1YWdlcyxcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICB9KVxuICApO1xuXG4gIHJldHVybiAoXG4gICAgPEZpZWxkTGFiZWxcbiAgICAgIGh0bWxGb3I9e25hbWV9XG4gICAgICB0aXRsZT17XG4gICAgICAgIDxDb25zdHJhaW50cy5Ib3Jpem9udGFsIG1heD1cInNjYWxlXCI+XG4gICAgICAgICAgPFNwYWNpbmdzLklubGluZSBzY2FsZT1cInNcIiBhbGlnbkl0ZW1zPVwiZmxleC1lbmRcIj5cbiAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgIHtmb3JtYXRMb2NhbGl6ZWRTdHJpbmcoZmllbGREZWZpbml0aW9uLCB7XG4gICAgICAgICAgICAgICAga2V5OiAnbGFiZWwnLFxuICAgICAgICAgICAgICAgIGxvY2FsZTogbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZhbGxiYWNrOiBmaWVsZERlZmluaXRpb24ubmFtZSxcbiAgICAgICAgICAgICAgfSl9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxDdXN0b21GaWVsZHNDb3VudEluZGljYXRvclxuICAgICAgICAgICAgICBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwcz17ZmllbGREZWZpbml0aW9uLmFzc2lnbmVkQXR0cmlidXRlR3JvdXBzfVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICA8L1NwYWNpbmdzLklubGluZT5cbiAgICAgICAgPC9Db25zdHJhaW50cy5Ib3Jpem9udGFsPlxuICAgICAgfVxuICAgICAgZGVzY3JpcHRpb249e1xuICAgICAgICA8Q3VzdG9tRmllbGRzTGFiZWxTdWJ0aXRsZSBmaWVsZERlZmluaXRpb249e2ZpZWxkRGVmaW5pdGlvbn0gLz5cbiAgICAgIH1cbiAgICAgIGhpbnQ9ezxDdXN0b21GaWVsZHNMYWJlbEhpbnQgZmllbGREZWZpbml0aW9uPXtmaWVsZERlZmluaXRpb259IC8+fVxuICAgICAgaGFzUmVxdWlyZWRJbmRpY2F0b3I9e2ZpZWxkRGVmaW5pdGlvbi5yZXF1aXJlZH1cbiAgICAvPlxuICApO1xufSk7XG5DdXN0b21GaWVsZHNMYWJlbC5kaXNwbGF5TmFtZSA9ICdDdXN0b21GaWVsZHNUaXRsZSc7XG5DdXN0b21GaWVsZHNMYWJlbC5wcm9wVHlwZXMgPSB7XG4gIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcuaXNSZXF1aXJlZCxcbiAgZmllbGREZWZpbml0aW9uOiBQcm9wVHlwZXMuc2hhcGUoe1xuICAgIGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzOiBQcm9wVHlwZXMuYXJyYXksXG4gICAgbmFtZTogUHJvcFR5cGVzLnN0cmluZyxcbiAgICBpbnB1dFRpcDogUHJvcFR5cGVzLm9iamVjdCxcbiAgICByZXF1aXJlZDogUHJvcFR5cGVzLmJvb2wsXG4gIH0pLFxufTtcbmV4cG9ydCBkZWZhdWx0IEN1c3RvbUZpZWxkc0xhYmVsO1xuIl19 */",
|
|
7407
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
7408
|
+
};
|
|
7409
|
+
function CustomFieldsCountIndicator(_ref4) {
|
|
7410
|
+
let assignedAttributeGroups = _ref4.assignedAttributeGroups;
|
|
7411
|
+
const formatLocalizedField = useFormatLocalizedFieldToString();
|
|
7412
|
+
const _useIntl3 = useIntl(),
|
|
7413
|
+
formatMessage = _useIntl3.formatMessage;
|
|
7414
|
+
return (assignedAttributeGroups === null || assignedAttributeGroups === void 0 ? void 0 : assignedAttributeGroups.length) > 1 ? jsx(Tooltip, {
|
|
7415
|
+
title: formatMessage(messages$v.attributeGroupCountTooltip, {
|
|
7416
|
+
attributeGroups: _mapInstanceProperty(assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
|
|
7417
|
+
count: assignedAttributeGroups.length
|
|
7418
|
+
}),
|
|
7419
|
+
horizontalConstraint: 7,
|
|
7420
|
+
components: {
|
|
7421
|
+
TooltipWrapperComponent: Portal
|
|
7422
|
+
},
|
|
7423
|
+
children: jsx("div", {
|
|
7424
|
+
css: _ref,
|
|
7425
|
+
children: jsx(SwitcherIcon, {
|
|
7426
|
+
color: "info",
|
|
7427
|
+
size: "medium"
|
|
7428
|
+
})
|
|
7429
|
+
})
|
|
7430
|
+
}) : null;
|
|
7398
7431
|
}
|
|
7399
|
-
const CustomFieldsLabel = /*#__PURE__*/memo(
|
|
7400
|
-
let name =
|
|
7401
|
-
fieldDefinition =
|
|
7432
|
+
const CustomFieldsLabel = /*#__PURE__*/memo(_ref5 => {
|
|
7433
|
+
let name = _ref5.name,
|
|
7434
|
+
fieldDefinition = _ref5.fieldDefinition;
|
|
7402
7435
|
const _useApplicationContex2 = useApplicationContext(applicationContext => ({
|
|
7403
7436
|
languages: applicationContext.project.languages,
|
|
7404
7437
|
language: applicationContext.dataLocale
|
|
@@ -7407,11 +7440,22 @@ const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
|
7407
7440
|
language = _useApplicationContex2.language;
|
|
7408
7441
|
return jsx(FieldLabel, {
|
|
7409
7442
|
htmlFor: name,
|
|
7410
|
-
title:
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7443
|
+
title: jsx(Constraints.Horizontal, {
|
|
7444
|
+
max: "scale",
|
|
7445
|
+
children: jsxs(Spacings.Inline, {
|
|
7446
|
+
scale: "s",
|
|
7447
|
+
alignItems: "flex-end",
|
|
7448
|
+
children: [jsx("div", {
|
|
7449
|
+
children: formatLocalizedString(fieldDefinition, {
|
|
7450
|
+
key: 'label',
|
|
7451
|
+
locale: language,
|
|
7452
|
+
fallbackOrder: languages,
|
|
7453
|
+
fallback: fieldDefinition.name
|
|
7454
|
+
})
|
|
7455
|
+
}), jsx(CustomFieldsCountIndicator, {
|
|
7456
|
+
assignedAttributeGroups: fieldDefinition.assignedAttributeGroups
|
|
7457
|
+
})]
|
|
7458
|
+
})
|
|
7415
7459
|
}),
|
|
7416
7460
|
description: jsx(CustomFieldsLabelSubtitle, {
|
|
7417
7461
|
fieldDefinition: fieldDefinition
|
|
@@ -7549,23 +7593,23 @@ var pickerMessages = defineMessages({
|
|
|
7549
7593
|
}
|
|
7550
7594
|
});
|
|
7551
7595
|
|
|
7552
|
-
function ownKeys$
|
|
7553
|
-
function _objectSpread$
|
|
7554
|
-
const
|
|
7555
|
-
INCLUSION: '
|
|
7556
|
-
EXCLUSION: '
|
|
7596
|
+
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; }
|
|
7597
|
+
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; }
|
|
7598
|
+
const PRODUCT_SELECTION_MODES = {
|
|
7599
|
+
INCLUSION: 'Individual',
|
|
7600
|
+
EXCLUSION: 'IndividualExclusion'
|
|
7557
7601
|
};
|
|
7558
|
-
const
|
|
7602
|
+
const PRODUCT_SELECTION_MODES_LABELS = {
|
|
7559
7603
|
INCLUSION: 'inclusion',
|
|
7560
7604
|
EXCLUSION: 'exclusion'
|
|
7561
7605
|
};
|
|
7562
|
-
const
|
|
7563
|
-
const
|
|
7606
|
+
const getMode = mode => mode === PRODUCT_SELECTION_MODES.INCLUSION || mode === PRODUCT_SELECTION_MODES_LABELS.INCLUSION ? 'inclusion' : 'exclusion';
|
|
7607
|
+
const addModeToLabel = function (ps) {
|
|
7564
7608
|
var _context;
|
|
7565
7609
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7566
7610
|
if (!ps) return undefined;
|
|
7567
|
-
return _objectSpread$
|
|
7568
|
-
label: _concatInstanceProperty(_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(
|
|
7611
|
+
return _objectSpread$I(_objectSpread$I({}, ps), {}, {
|
|
7612
|
+
label: _concatInstanceProperty(_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getMode(ps === null || ps === void 0 ? void 0 : ps.mode), ")") : '')
|
|
7569
7613
|
});
|
|
7570
7614
|
};
|
|
7571
7615
|
|
|
@@ -7586,9 +7630,9 @@ const mapProductSelectionsToOptions$1 = memoize(function () {
|
|
|
7586
7630
|
return {
|
|
7587
7631
|
id: productSelection.id,
|
|
7588
7632
|
value: productSelection.id,
|
|
7589
|
-
label: _concatInstanceProperty(_context = "".concat(label)).call(_context, _includesInstanceProperty(selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(
|
|
7633
|
+
label: _concatInstanceProperty(_context = "".concat(label)).call(_context, _includesInstanceProperty(selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(getMode(productSelection.mode), ")") : ''),
|
|
7590
7634
|
key: productSelection.key,
|
|
7591
|
-
|
|
7635
|
+
mode: getMode(productSelection.mode)
|
|
7592
7636
|
};
|
|
7593
7637
|
});
|
|
7594
7638
|
});
|
|
@@ -7658,11 +7702,11 @@ const getValueFromOptions$3 = _ref => {
|
|
|
7658
7702
|
// handle async-select-field value transformation
|
|
7659
7703
|
if (isMulti) {
|
|
7660
7704
|
var _context;
|
|
7661
|
-
return _mapInstanceProperty(_context = _filterInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty(currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value))).call(_context, ps =>
|
|
7705
|
+
return _mapInstanceProperty(_context = _filterInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty(currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value))).call(_context, ps => addModeToLabel(ps, enableExcludingProducts));
|
|
7662
7706
|
}
|
|
7663
7707
|
|
|
7664
7708
|
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
7665
|
-
return
|
|
7709
|
+
return addModeToLabel(_findInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value), enableExcludingProducts);
|
|
7666
7710
|
};
|
|
7667
7711
|
const emptyStoreOption$1 = intl => [{
|
|
7668
7712
|
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
@@ -7709,7 +7753,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7709
7753
|
value: productSelection.id,
|
|
7710
7754
|
name: localizedName,
|
|
7711
7755
|
key: productSelection.key,
|
|
7712
|
-
|
|
7756
|
+
mode: getMode(productSelection.mode)
|
|
7713
7757
|
};
|
|
7714
7758
|
});
|
|
7715
7759
|
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
@@ -7764,7 +7808,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7764
7808
|
});
|
|
7765
7809
|
}
|
|
7766
7810
|
|
|
7767
|
-
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "
|
|
7811
|
+
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 223, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7768
7812
|
const createQueryVariables$4 = (productSelections, predicateField) => {
|
|
7769
7813
|
var _context;
|
|
7770
7814
|
return {
|
|
@@ -7788,7 +7832,7 @@ const useProductSelectionsByFieldFetcher = (productSelections, predicateField) =
|
|
|
7788
7832
|
};
|
|
7789
7833
|
};
|
|
7790
7834
|
|
|
7791
|
-
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "
|
|
7835
|
+
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 223, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7792
7836
|
const mapProductSelectionsToOptions = memoize(_ref => {
|
|
7793
7837
|
let _ref$productSelection = _ref.productSelections,
|
|
7794
7838
|
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
@@ -7803,7 +7847,7 @@ const mapProductSelectionsToOptions = memoize(_ref => {
|
|
|
7803
7847
|
fallbackOrder: projectLanguages
|
|
7804
7848
|
}),
|
|
7805
7849
|
key: productSelection.key,
|
|
7806
|
-
|
|
7850
|
+
mode: getMode(productSelection.mode)
|
|
7807
7851
|
}));
|
|
7808
7852
|
});
|
|
7809
7853
|
const getValueFromOptions$2 = _ref2 => {
|
|
@@ -7815,10 +7859,10 @@ const getValueFromOptions$2 = _ref2 => {
|
|
|
7815
7859
|
return undefined;
|
|
7816
7860
|
}
|
|
7817
7861
|
if (isMulti) {
|
|
7818
|
-
return _mapInstanceProperty(productSelectionFieldOptions).call(productSelectionFieldOptions, ps =>
|
|
7862
|
+
return _mapInstanceProperty(productSelectionFieldOptions).call(productSelectionFieldOptions, ps => addModeToLabel(ps, enableExcludingProducts));
|
|
7819
7863
|
}
|
|
7820
7864
|
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
7821
|
-
return
|
|
7865
|
+
return addModeToLabel(productSelectionFieldOptions[0], enableExcludingProducts);
|
|
7822
7866
|
};
|
|
7823
7867
|
const createQueryVariables$3 = _ref3 => {
|
|
7824
7868
|
var _context;
|
|
@@ -7860,7 +7904,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7860
7904
|
fetchPolicy: 'network-only'
|
|
7861
7905
|
}),
|
|
7862
7906
|
data = _await$client$query.data;
|
|
7863
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7907
|
+
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 : [];
|
|
7864
7908
|
const updatedProductSelections = _mapInstanceProperty(matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7865
7909
|
const filteredProductSelections = _filterInstanceProperty(updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7866
7910
|
var _context2;
|
|
@@ -7915,12 +7959,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7915
7959
|
});
|
|
7916
7960
|
}
|
|
7917
7961
|
|
|
7918
|
-
function ownKeys$
|
|
7919
|
-
function _objectSpread$
|
|
7920
|
-
function
|
|
7962
|
+
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; }
|
|
7963
|
+
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; }
|
|
7964
|
+
function ModeSelectInputOption(props) {
|
|
7921
7965
|
const data = props.data;
|
|
7922
7966
|
const noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
7923
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7967
|
+
return jsx(SelectInput.Option, _objectSpread$H(_objectSpread$H({}, props), {}, {
|
|
7924
7968
|
children: jsxs(Spacings.Stack, {
|
|
7925
7969
|
scale: "xs",
|
|
7926
7970
|
children: [jsx(Text.Detail, {
|
|
@@ -7929,24 +7973,24 @@ function TypeSelectInputOption(props) {
|
|
|
7929
7973
|
}), jsxs(Text.Detail, {
|
|
7930
7974
|
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
7931
7975
|
}), jsxs(Text.Detail, {
|
|
7932
|
-
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.
|
|
7976
|
+
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.mode) || noValueFallback]
|
|
7933
7977
|
})]
|
|
7934
7978
|
})
|
|
7935
7979
|
}));
|
|
7936
7980
|
}
|
|
7937
7981
|
|
|
7938
|
-
function ownKeys$
|
|
7939
|
-
function _objectSpread$
|
|
7982
|
+
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; }
|
|
7983
|
+
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; }
|
|
7940
7984
|
function ProductSelectionsPicker(props) {
|
|
7941
7985
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
7942
7986
|
const components = useMemo(() => {
|
|
7943
7987
|
return {
|
|
7944
7988
|
Option: optionInnerProps => {
|
|
7945
7989
|
if (optionInnerProps.isDisabled) {
|
|
7946
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7990
|
+
return jsx(SelectInput.Option, _objectSpread$G({}, optionInnerProps));
|
|
7947
7991
|
}
|
|
7948
7992
|
if (props.optionType === TYPE_PROPERTY) {
|
|
7949
|
-
return jsx(
|
|
7993
|
+
return jsx(ModeSelectInputOption, _objectSpread$G({}, optionInnerProps));
|
|
7950
7994
|
}
|
|
7951
7995
|
return jsx(CustomSelectInputOption, {
|
|
7952
7996
|
optionType: props.optionType,
|
|
@@ -7958,7 +8002,7 @@ function ProductSelectionsPicker(props) {
|
|
|
7958
8002
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7959
8003
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
7960
8004
|
return jsx(Spacings.Stack, {
|
|
7961
|
-
children: jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8005
|
+
children: jsx(CustomProductSelectionsPicker, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
7962
8006
|
components: components
|
|
7963
8007
|
}))
|
|
7964
8008
|
});
|
|
@@ -7981,7 +8025,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
7981
8025
|
|
|
7982
8026
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
7983
8027
|
|
|
7984
|
-
var messages$
|
|
8028
|
+
var messages$u = defineMessages({
|
|
7985
8029
|
countriesBasicSelectPlaceholder: {
|
|
7986
8030
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
7987
8031
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8009,7 +8053,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8009
8053
|
value: props.value,
|
|
8010
8054
|
isRequired: props.isRequired,
|
|
8011
8055
|
description: props.description,
|
|
8012
|
-
placeholder: intl.formatMessage(messages$
|
|
8056
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8013
8057
|
options: props.options,
|
|
8014
8058
|
onChange: props.onChange,
|
|
8015
8059
|
isDisabled: props.isDisabled,
|
|
@@ -8019,10 +8063,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8019
8063
|
});
|
|
8020
8064
|
}
|
|
8021
8065
|
|
|
8022
|
-
function ownKeys$
|
|
8023
|
-
function _objectSpread$
|
|
8066
|
+
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; }
|
|
8067
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$F(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$F(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8024
8068
|
const emptyCountryOption = intl => [{
|
|
8025
|
-
label: intl.formatMessage(messages$
|
|
8069
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8026
8070
|
value: undefined,
|
|
8027
8071
|
isDisabled: true
|
|
8028
8072
|
}];
|
|
@@ -8047,7 +8091,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8047
8091
|
const onOptionChange = event => {
|
|
8048
8092
|
const countries = event.target.value;
|
|
8049
8093
|
props.onChange({
|
|
8050
|
-
target: _objectSpread$
|
|
8094
|
+
target: _objectSpread$F(_objectSpread$F({}, event.target), {}, {
|
|
8051
8095
|
value: _mapInstanceProperty(countries).call(countries, country => {
|
|
8052
8096
|
var _country$value;
|
|
8053
8097
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8068,7 +8112,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8068
8112
|
var _context3;
|
|
8069
8113
|
return _findInstanceProperty(_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8070
8114
|
}),
|
|
8071
|
-
placeholder: intl.formatMessage(messages$
|
|
8115
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8072
8116
|
loadOptions: handleLoadOptions,
|
|
8073
8117
|
onChange: onOptionChange,
|
|
8074
8118
|
isDisabled: props.isDisabled,
|
|
@@ -8078,13 +8122,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8078
8122
|
});
|
|
8079
8123
|
}
|
|
8080
8124
|
|
|
8081
|
-
function ownKeys$
|
|
8082
|
-
function _objectSpread$
|
|
8125
|
+
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; }
|
|
8126
|
+
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; }
|
|
8083
8127
|
function CountriesPicker(props) {
|
|
8084
8128
|
var _props$options;
|
|
8085
8129
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8086
8130
|
return jsx(Spacings.Stack, {
|
|
8087
|
-
children: jsx(CustomCountriesPicker, _objectSpread$
|
|
8131
|
+
children: jsx(CustomCountriesPicker, _objectSpread$E({}, props))
|
|
8088
8132
|
});
|
|
8089
8133
|
}
|
|
8090
8134
|
CountriesPicker.defaultProps = {
|
|
@@ -8094,7 +8138,7 @@ CountriesPicker.defaultProps = {
|
|
|
8094
8138
|
hasWarning: false
|
|
8095
8139
|
};
|
|
8096
8140
|
|
|
8097
|
-
var messages$
|
|
8141
|
+
var messages$t = defineMessages({
|
|
8098
8142
|
noCustomerGroupsFound: {
|
|
8099
8143
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8100
8144
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8185,8 +8229,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8185
8229
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8186
8230
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8187
8231
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8188
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8189
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8232
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8233
|
+
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 : '';
|
|
8190
8234
|
return jsx(Constraints.Horizontal, {
|
|
8191
8235
|
max: "scale",
|
|
8192
8236
|
children: jsxs(Spacings.Stack, {
|
|
@@ -8196,7 +8240,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8196
8240
|
children: jsx(AsyncSelectInput, {
|
|
8197
8241
|
id: name,
|
|
8198
8242
|
name: name,
|
|
8199
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8243
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8200
8244
|
loadOptions: loadOptionsDebounced,
|
|
8201
8245
|
defaultOptions: true,
|
|
8202
8246
|
showOptionGroupDivider: true,
|
|
@@ -8266,7 +8310,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8266
8310
|
return _sliceInstanceProperty(storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8267
8311
|
};
|
|
8268
8312
|
|
|
8269
|
-
var messages$
|
|
8313
|
+
var messages$s = defineMessages({
|
|
8270
8314
|
basicSelectInputPlaceholder: {
|
|
8271
8315
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8272
8316
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8292,6 +8336,11 @@ var messages$r = defineMessages({
|
|
|
8292
8336
|
description: 'The message shown in search select input when matches are found',
|
|
8293
8337
|
defaultMessage: 'No matches found for your search term'
|
|
8294
8338
|
},
|
|
8339
|
+
searchSelectInputNoValueMessage: {
|
|
8340
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8341
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8342
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8343
|
+
},
|
|
8295
8344
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8296
8345
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8297
8346
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8299,8 +8348,8 @@ var messages$r = defineMessages({
|
|
|
8299
8348
|
}
|
|
8300
8349
|
});
|
|
8301
8350
|
|
|
8302
|
-
function ownKeys$
|
|
8303
|
-
function _objectSpread$
|
|
8351
|
+
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; }
|
|
8352
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$D(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$D(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8304
8353
|
const hasErrors$2 = errors => {
|
|
8305
8354
|
var _context;
|
|
8306
8355
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8325,7 +8374,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8325
8374
|
return _findInstanceProperty(mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8326
8375
|
};
|
|
8327
8376
|
const emptyStoreOption = intl => [{
|
|
8328
|
-
label: intl.formatMessage(messages$
|
|
8377
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8329
8378
|
value: undefined,
|
|
8330
8379
|
isDisabled: true
|
|
8331
8380
|
}];
|
|
@@ -8372,10 +8421,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8372
8421
|
};
|
|
8373
8422
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8374
8423
|
return jsxs(Fragment, {
|
|
8375
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
8424
|
+
children: [jsx(AsyncSelectInput, _objectSpread$D(_objectSpread$D({
|
|
8376
8425
|
id: props.id,
|
|
8377
8426
|
name: props.name,
|
|
8378
|
-
placeholder: intl.formatMessage(messages$
|
|
8427
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8379
8428
|
horizontalConstraint: props.horizontalConstraint,
|
|
8380
8429
|
loadOptions: handleLoadOptions,
|
|
8381
8430
|
defaultOptions: true,
|
|
@@ -8415,8 +8464,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8415
8464
|
shouldFetchProductSelections: false
|
|
8416
8465
|
};
|
|
8417
8466
|
|
|
8418
|
-
function ownKeys$
|
|
8419
|
-
function _objectSpread$
|
|
8467
|
+
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; }
|
|
8468
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$C(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$C(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8420
8469
|
const hasErrors$1 = errors => {
|
|
8421
8470
|
var _context;
|
|
8422
8471
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8464,10 +8513,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8464
8513
|
};
|
|
8465
8514
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8466
8515
|
return jsxs(Fragment, {
|
|
8467
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
8516
|
+
children: [jsx(SelectInput, _objectSpread$C(_objectSpread$C({
|
|
8468
8517
|
id: props.id,
|
|
8469
8518
|
name: props.name,
|
|
8470
|
-
placeholder: intl.formatMessage(messages$
|
|
8519
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8471
8520
|
horizontalConstraint: props.horizontalConstraint,
|
|
8472
8521
|
options: mappedStoresListOptions,
|
|
8473
8522
|
isMulti: props.isMulti,
|
|
@@ -8560,8 +8609,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8560
8609
|
};
|
|
8561
8610
|
};
|
|
8562
8611
|
|
|
8563
|
-
function ownKeys$
|
|
8564
|
-
function _objectSpread$
|
|
8612
|
+
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; }
|
|
8613
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$B(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$B(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8565
8614
|
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 } } } };
|
|
8566
8615
|
const hasErrors = errors => {
|
|
8567
8616
|
var _context;
|
|
@@ -8663,10 +8712,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8663
8712
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8664
8713
|
if (storesByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8665
8714
|
return jsxs(Fragment, {
|
|
8666
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
8715
|
+
children: [jsx(SearchSelectInput, _objectSpread$B(_objectSpread$B({
|
|
8667
8716
|
id: props.id,
|
|
8668
8717
|
name: props.name,
|
|
8669
|
-
placeholder: intl.formatMessage(messages$
|
|
8718
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8670
8719
|
horizontalConstraint: props.horizontalConstraint,
|
|
8671
8720
|
loadOptions: loadOptionsDebounced,
|
|
8672
8721
|
defaultOptions: false,
|
|
@@ -8680,8 +8729,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8680
8729
|
}),
|
|
8681
8730
|
onChange: props.onChange,
|
|
8682
8731
|
onBlur: props.onBlur,
|
|
8683
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8684
|
-
noOptionsMessage:
|
|
8732
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8733
|
+
noOptionsMessage: _ref4 => {
|
|
8734
|
+
let inputValue = _ref4.inputValue;
|
|
8735
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8736
|
+
},
|
|
8685
8737
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8686
8738
|
isReadOnly: props.isReadOnly,
|
|
8687
8739
|
isClearable: props.isClearable,
|
|
@@ -8709,8 +8761,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8709
8761
|
shouldFetchProductSelections: false
|
|
8710
8762
|
};
|
|
8711
8763
|
|
|
8712
|
-
function ownKeys$
|
|
8713
|
-
function _objectSpread$
|
|
8764
|
+
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; }
|
|
8765
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$A(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$A(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8714
8766
|
const StoreSelectInput = props => {
|
|
8715
8767
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8716
8768
|
const components = useMemo(() => {
|
|
@@ -8718,7 +8770,7 @@ const StoreSelectInput = props => {
|
|
|
8718
8770
|
// eslint-disable-next-line react/display-name
|
|
8719
8771
|
Option: optionInnerProps => {
|
|
8720
8772
|
if (optionInnerProps.isDisabled) {
|
|
8721
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
8773
|
+
return jsx(SelectInput.Option, _objectSpread$A({}, optionInnerProps));
|
|
8722
8774
|
}
|
|
8723
8775
|
return jsx(CustomSelectInputOption, {
|
|
8724
8776
|
optionType: props.optionType,
|
|
@@ -8729,7 +8781,7 @@ const StoreSelectInput = props => {
|
|
|
8729
8781
|
}, [props.optionType]);
|
|
8730
8782
|
if (totalNumberOfStoresFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8731
8783
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8732
|
-
return jsx(CustomStoreSelectInput, _objectSpread$
|
|
8784
|
+
return jsx(CustomStoreSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8733
8785
|
projectKey: props.projectKey,
|
|
8734
8786
|
id: props.id,
|
|
8735
8787
|
name: props.name,
|
|
@@ -8784,7 +8836,7 @@ const businessRoleConstants = {
|
|
|
8784
8836
|
|
|
8785
8837
|
const businessRoleKeys = _Object$values(businessRoleConstants);
|
|
8786
8838
|
|
|
8787
|
-
var messages$
|
|
8839
|
+
var messages$r = defineMessages({
|
|
8788
8840
|
ExecutiveManagement: {
|
|
8789
8841
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8790
8842
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8842,7 +8894,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8842
8894
|
return _parseFloat((ratio * 100).toFixed(2));
|
|
8843
8895
|
}
|
|
8844
8896
|
|
|
8845
|
-
const messages$
|
|
8897
|
+
const messages$q = defineMessages({
|
|
8846
8898
|
inputFieldError: {
|
|
8847
8899
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8848
8900
|
description: 'Error message for empty input field ',
|
|
@@ -8863,14 +8915,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8863
8915
|
if (validateSingleFilter({
|
|
8864
8916
|
value
|
|
8865
8917
|
})) {
|
|
8866
|
-
return intl.formatMessage(messages$
|
|
8918
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8867
8919
|
}
|
|
8868
8920
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8869
8921
|
value: value.currencyCode
|
|
8870
8922
|
}) || validateSingleFilter({
|
|
8871
8923
|
value: value.amount
|
|
8872
8924
|
}))) {
|
|
8873
|
-
return intl.formatMessage(messages$
|
|
8925
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8874
8926
|
}
|
|
8875
8927
|
return null;
|
|
8876
8928
|
};
|
|
@@ -8878,7 +8930,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8878
8930
|
let value = _ref.value;
|
|
8879
8931
|
if (!value || !value.type) {
|
|
8880
8932
|
return {
|
|
8881
|
-
type: intl.formatMessage(messages$
|
|
8933
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8882
8934
|
};
|
|
8883
8935
|
}
|
|
8884
8936
|
const typeName = value.type.name;
|
|
@@ -8886,7 +8938,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8886
8938
|
const filterValue = value.value;
|
|
8887
8939
|
if (hasOption && !value.option) {
|
|
8888
8940
|
return {
|
|
8889
|
-
option: intl.formatMessage(messages$
|
|
8941
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8890
8942
|
};
|
|
8891
8943
|
}
|
|
8892
8944
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8905,7 +8957,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8905
8957
|
} : null;
|
|
8906
8958
|
}
|
|
8907
8959
|
|
|
8908
|
-
const messages$
|
|
8960
|
+
const messages$p = defineMessages({
|
|
8909
8961
|
rangeMissingValue: {
|
|
8910
8962
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8911
8963
|
description: 'error message if missing a value in a range',
|
|
@@ -8930,25 +8982,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
8930
8982
|
if (validateSingleFilter({
|
|
8931
8983
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
8932
8984
|
})) return {
|
|
8933
|
-
from: intl.formatMessage(messages$
|
|
8985
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8934
8986
|
};
|
|
8935
8987
|
if (validateSingleFilter({
|
|
8936
8988
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
8937
8989
|
})) return {
|
|
8938
|
-
to: intl.formatMessage(messages$
|
|
8990
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8939
8991
|
};
|
|
8940
8992
|
if (moment$1(value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
8941
|
-
from: intl.formatMessage(messages$
|
|
8993
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
8942
8994
|
};
|
|
8943
8995
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
8944
8996
|
if (validateSingleFilter({
|
|
8945
8997
|
value
|
|
8946
|
-
})) return intl.formatMessage(messages$
|
|
8998
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
8947
8999
|
}
|
|
8948
9000
|
return null;
|
|
8949
9001
|
}
|
|
8950
9002
|
|
|
8951
|
-
const messages$
|
|
9003
|
+
const messages$o = defineMessages({
|
|
8952
9004
|
rangeMissingValue: {
|
|
8953
9005
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
8954
9006
|
description: 'error message if missing a value in a range',
|
|
@@ -8967,30 +9019,30 @@ function validateFilter(_ref, intl) {
|
|
|
8967
9019
|
_ref$allowFloat = _ref.allowFloat,
|
|
8968
9020
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
8969
9021
|
if (type !== 'range') {
|
|
8970
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9022
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
8971
9023
|
return null;
|
|
8972
9024
|
}
|
|
8973
9025
|
|
|
8974
9026
|
// only range types from here
|
|
8975
9027
|
|
|
8976
9028
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
8977
|
-
from: intl.formatMessage(messages$
|
|
9029
|
+
from: intl.formatMessage(messages$K.integer)
|
|
8978
9030
|
};
|
|
8979
9031
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
8980
|
-
to: intl.formatMessage(messages$
|
|
9032
|
+
to: intl.formatMessage(messages$K.integer)
|
|
8981
9033
|
};
|
|
8982
9034
|
if (validateSingleFilter({
|
|
8983
9035
|
value: value.from
|
|
8984
9036
|
})) return {
|
|
8985
|
-
from: intl.formatMessage(messages$
|
|
9037
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
8986
9038
|
};
|
|
8987
9039
|
if (validateSingleFilter({
|
|
8988
9040
|
value: value.to
|
|
8989
9041
|
})) return {
|
|
8990
|
-
to: intl.formatMessage(messages$
|
|
9042
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
8991
9043
|
};
|
|
8992
9044
|
if (_parseFloat(value.to) < _parseFloat(value.from)) return {
|
|
8993
|
-
from: intl.formatMessage(messages$
|
|
9045
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
8994
9046
|
};
|
|
8995
9047
|
return null;
|
|
8996
9048
|
}
|
|
@@ -9284,10 +9336,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9284
9336
|
carts: 'carts'
|
|
9285
9337
|
};
|
|
9286
9338
|
|
|
9287
|
-
function ownKeys$
|
|
9288
|
-
function _objectSpread$
|
|
9339
|
+
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; }
|
|
9340
|
+
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; }
|
|
9289
9341
|
const resourcesWithPlatformLimits = _Object$keys(RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9290
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9342
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$z({
|
|
9291
9343
|
[camelCase("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9292
9344
|
}, previousIncludedLimits), {});
|
|
9293
9345
|
|
|
@@ -9349,7 +9401,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9349
9401
|
};
|
|
9350
9402
|
};
|
|
9351
9403
|
|
|
9352
|
-
var messages$
|
|
9404
|
+
var messages$n = defineMessages({
|
|
9353
9405
|
shippingMethods: {
|
|
9354
9406
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9355
9407
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9377,8 +9429,8 @@ var messages$m = defineMessages({
|
|
|
9377
9429
|
}
|
|
9378
9430
|
});
|
|
9379
9431
|
|
|
9380
|
-
function ownKeys$
|
|
9381
|
-
function _objectSpread$
|
|
9432
|
+
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; }
|
|
9433
|
+
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; }
|
|
9382
9434
|
const getCustomerSupportLink$1 = msg => jsx(Link, {
|
|
9383
9435
|
isExternal: true,
|
|
9384
9436
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9389,7 +9441,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9389
9441
|
limit = _ref.limit;
|
|
9390
9442
|
return jsx(ContentNotification, {
|
|
9391
9443
|
type: "warning",
|
|
9392
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9444
|
+
children: jsx(FormattedMessage, _objectSpread$y(_objectSpread$y({}, messages$n[resource]), {}, {
|
|
9393
9445
|
values: {
|
|
9394
9446
|
limit,
|
|
9395
9447
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9402,7 +9454,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9402
9454
|
};
|
|
9403
9455
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9404
9456
|
|
|
9405
|
-
var messages$
|
|
9457
|
+
var messages$m = defineMessages({
|
|
9406
9458
|
shippingMethods: {
|
|
9407
9459
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9408
9460
|
description: 'error message about platform limit exceeded',
|
|
@@ -9430,8 +9482,8 @@ var messages$l = defineMessages({
|
|
|
9430
9482
|
}
|
|
9431
9483
|
});
|
|
9432
9484
|
|
|
9433
|
-
function ownKeys$
|
|
9434
|
-
function _objectSpread$
|
|
9485
|
+
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; }
|
|
9486
|
+
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; }
|
|
9435
9487
|
const getCustomerSupportLink = msg => jsx(Link, {
|
|
9436
9488
|
isExternal: true,
|
|
9437
9489
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9442,7 +9494,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9442
9494
|
limit = _ref.limit;
|
|
9443
9495
|
return jsx(ContentNotification, {
|
|
9444
9496
|
type: "error",
|
|
9445
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9497
|
+
children: jsx(FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$m[resource]), {}, {
|
|
9446
9498
|
values: {
|
|
9447
9499
|
limit,
|
|
9448
9500
|
customersupport: getCustomerSupportLink
|
|
@@ -9460,8 +9512,8 @@ const Notifications = {
|
|
|
9460
9512
|
Error: PlatformLimitErrorNotification
|
|
9461
9513
|
};
|
|
9462
9514
|
|
|
9463
|
-
function ownKeys$
|
|
9464
|
-
function _objectSpread$
|
|
9515
|
+
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; }
|
|
9516
|
+
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; }
|
|
9465
9517
|
const PlatformLimitsStatusText = _ref => {
|
|
9466
9518
|
let intlMessage = _ref.intlMessage,
|
|
9467
9519
|
children = _ref.children;
|
|
@@ -9470,7 +9522,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9470
9522
|
children: jsxs(Spacings.Inline, {
|
|
9471
9523
|
size: "xs",
|
|
9472
9524
|
children: [jsx("span", {
|
|
9473
|
-
children: intlMessage && jsx(FormattedMessage, _objectSpread$
|
|
9525
|
+
children: intlMessage && jsx(FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
9474
9526
|
}), jsx("span", {
|
|
9475
9527
|
children: children
|
|
9476
9528
|
})]
|
|
@@ -9571,7 +9623,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9571
9623
|
};
|
|
9572
9624
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9573
9625
|
|
|
9574
|
-
var messages$
|
|
9626
|
+
var messages$l = defineMessages({
|
|
9575
9627
|
shippingMethodsPlatformLimitReached: {
|
|
9576
9628
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9577
9629
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9579,17 +9631,17 @@ var messages$k = defineMessages({
|
|
|
9579
9631
|
}
|
|
9580
9632
|
});
|
|
9581
9633
|
|
|
9582
|
-
function ownKeys$
|
|
9583
|
-
function _objectSpread$
|
|
9634
|
+
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; }
|
|
9635
|
+
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; }
|
|
9584
9636
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9585
9637
|
const intl = useIntl();
|
|
9586
|
-
return jsx(Tooltip, _objectSpread$
|
|
9587
|
-
title: intl.formatMessage(messages$
|
|
9638
|
+
return jsx(Tooltip, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
9639
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9588
9640
|
}));
|
|
9589
9641
|
};
|
|
9590
9642
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9591
9643
|
|
|
9592
|
-
var messages$
|
|
9644
|
+
var messages$k = defineMessages({
|
|
9593
9645
|
shippingMethodsStatus: {
|
|
9594
9646
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9595
9647
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9598,15 +9650,15 @@ var messages$j = defineMessages({
|
|
|
9598
9650
|
});
|
|
9599
9651
|
|
|
9600
9652
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9601
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9653
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9602
9654
|
let total = _ref.total;
|
|
9603
9655
|
const intl = useIntl();
|
|
9604
9656
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9605
9657
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9606
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9607
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9658
|
+
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;
|
|
9659
|
+
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;
|
|
9608
9660
|
return jsx(PlatformLimitsStatusText, {
|
|
9609
|
-
intlMessage: messages$
|
|
9661
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9610
9662
|
children: getPlatformLimitsStatus({
|
|
9611
9663
|
limit,
|
|
9612
9664
|
current,
|
|
@@ -9637,15 +9689,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9637
9689
|
};
|
|
9638
9690
|
};
|
|
9639
9691
|
|
|
9640
|
-
function ownKeys$
|
|
9641
|
-
function _objectSpread$
|
|
9692
|
+
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; }
|
|
9693
|
+
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; }
|
|
9642
9694
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9643
9695
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9644
9696
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9645
9697
|
const shippingMethodsProps = {
|
|
9646
9698
|
platformLimits: shippingMethodsPlatformLimits
|
|
9647
9699
|
};
|
|
9648
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9700
|
+
return jsx(WrappedComponent, _objectSpread$u(_objectSpread$u({}, props), shippingMethodsProps));
|
|
9649
9701
|
};
|
|
9650
9702
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9651
9703
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9718,7 +9770,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9718
9770
|
};
|
|
9719
9771
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9720
9772
|
|
|
9721
|
-
var messages$
|
|
9773
|
+
var messages$j = defineMessages({
|
|
9722
9774
|
taxCategoriesPlatformLimitReached: {
|
|
9723
9775
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9724
9776
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9726,17 +9778,17 @@ var messages$i = defineMessages({
|
|
|
9726
9778
|
}
|
|
9727
9779
|
});
|
|
9728
9780
|
|
|
9729
|
-
function ownKeys$
|
|
9730
|
-
function _objectSpread$
|
|
9781
|
+
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; }
|
|
9782
|
+
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; }
|
|
9731
9783
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9732
9784
|
const intl = useIntl();
|
|
9733
|
-
return jsx(Tooltip, _objectSpread$
|
|
9734
|
-
title: intl.formatMessage(messages$
|
|
9785
|
+
return jsx(Tooltip, _objectSpread$t(_objectSpread$t({}, props), {}, {
|
|
9786
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9735
9787
|
}));
|
|
9736
9788
|
};
|
|
9737
9789
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9738
9790
|
|
|
9739
|
-
var messages$
|
|
9791
|
+
var messages$i = defineMessages({
|
|
9740
9792
|
taxCategoriesStatus: {
|
|
9741
9793
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9742
9794
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9745,15 +9797,15 @@ var messages$h = defineMessages({
|
|
|
9745
9797
|
});
|
|
9746
9798
|
|
|
9747
9799
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9748
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9800
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9749
9801
|
let total = _ref.total;
|
|
9750
9802
|
const intl = useIntl();
|
|
9751
9803
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9752
9804
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9753
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9754
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9805
|
+
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;
|
|
9806
|
+
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;
|
|
9755
9807
|
return jsx(PlatformLimitsStatusText, {
|
|
9756
|
-
intlMessage: messages$
|
|
9808
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9757
9809
|
children: getPlatformLimitsStatus({
|
|
9758
9810
|
limit,
|
|
9759
9811
|
current,
|
|
@@ -9784,15 +9836,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9784
9836
|
};
|
|
9785
9837
|
};
|
|
9786
9838
|
|
|
9787
|
-
function ownKeys$
|
|
9788
|
-
function _objectSpread$
|
|
9839
|
+
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; }
|
|
9840
|
+
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; }
|
|
9789
9841
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9790
9842
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9791
9843
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9792
9844
|
const taxCategoriesProps = {
|
|
9793
9845
|
platformLimits: taxCategoriesPlatformLimits
|
|
9794
9846
|
};
|
|
9795
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9847
|
+
return jsx(WrappedComponent, _objectSpread$s(_objectSpread$s({}, props), taxCategoriesProps));
|
|
9796
9848
|
};
|
|
9797
9849
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9798
9850
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9865,7 +9917,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9865
9917
|
};
|
|
9866
9918
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9867
9919
|
|
|
9868
|
-
var messages$
|
|
9920
|
+
var messages$h = defineMessages({
|
|
9869
9921
|
zonesPlatformLimitReached: {
|
|
9870
9922
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9871
9923
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9873,17 +9925,17 @@ var messages$g = defineMessages({
|
|
|
9873
9925
|
}
|
|
9874
9926
|
});
|
|
9875
9927
|
|
|
9876
|
-
function ownKeys$
|
|
9877
|
-
function _objectSpread$
|
|
9928
|
+
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; }
|
|
9929
|
+
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; }
|
|
9878
9930
|
const PlatformLimitsZonesTooltip = props => {
|
|
9879
9931
|
const intl = useIntl();
|
|
9880
|
-
return jsx(Tooltip, _objectSpread$
|
|
9881
|
-
title: intl.formatMessage(messages$
|
|
9932
|
+
return jsx(Tooltip, _objectSpread$r(_objectSpread$r({}, props), {}, {
|
|
9933
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9882
9934
|
}));
|
|
9883
9935
|
};
|
|
9884
9936
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9885
9937
|
|
|
9886
|
-
var messages$
|
|
9938
|
+
var messages$g = defineMessages({
|
|
9887
9939
|
zonesStatus: {
|
|
9888
9940
|
id: 'PlatformLimits.Status.zones',
|
|
9889
9941
|
description: 'The message for zones platform limit values',
|
|
@@ -9892,15 +9944,15 @@ var messages$f = defineMessages({
|
|
|
9892
9944
|
});
|
|
9893
9945
|
|
|
9894
9946
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9895
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
9947
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9896
9948
|
let total = _ref.total;
|
|
9897
9949
|
const intl = useIntl();
|
|
9898
9950
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9899
9951
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9900
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9901
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9952
|
+
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;
|
|
9953
|
+
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;
|
|
9902
9954
|
return jsx(PlatformLimitsStatusText, {
|
|
9903
|
-
intlMessage: messages$
|
|
9955
|
+
intlMessage: messages$g.zonesStatus,
|
|
9904
9956
|
children: getPlatformLimitsStatus({
|
|
9905
9957
|
limit,
|
|
9906
9958
|
current,
|
|
@@ -9931,15 +9983,15 @@ const useZonesLimits = () => {
|
|
|
9931
9983
|
};
|
|
9932
9984
|
};
|
|
9933
9985
|
|
|
9934
|
-
function ownKeys$
|
|
9935
|
-
function _objectSpread$
|
|
9986
|
+
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; }
|
|
9987
|
+
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; }
|
|
9936
9988
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
9937
9989
|
const WithZonesPlatformLimits = props => {
|
|
9938
9990
|
const zonesPlatformLimits = useZonesLimits();
|
|
9939
9991
|
const zonesProps = {
|
|
9940
9992
|
platformLimits: zonesPlatformLimits
|
|
9941
9993
|
};
|
|
9942
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9994
|
+
return jsx(WrappedComponent, _objectSpread$q(_objectSpread$q({}, props), zonesProps));
|
|
9943
9995
|
};
|
|
9944
9996
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
9945
9997
|
return WithZonesPlatformLimits;
|
|
@@ -10025,7 +10077,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10025
10077
|
};
|
|
10026
10078
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10027
10079
|
|
|
10028
|
-
var messages$
|
|
10080
|
+
var messages$f = defineMessages({
|
|
10029
10081
|
customersPlatformLimitReached: {
|
|
10030
10082
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10031
10083
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10033,17 +10085,17 @@ var messages$e = defineMessages({
|
|
|
10033
10085
|
}
|
|
10034
10086
|
});
|
|
10035
10087
|
|
|
10036
|
-
function ownKeys$
|
|
10037
|
-
function _objectSpread$
|
|
10088
|
+
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; }
|
|
10089
|
+
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; }
|
|
10038
10090
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10039
10091
|
const intl = useIntl();
|
|
10040
|
-
return jsx(Tooltip, _objectSpread$
|
|
10041
|
-
title: intl.formatMessage(messages$
|
|
10092
|
+
return jsx(Tooltip, _objectSpread$p(_objectSpread$p({}, props), {}, {
|
|
10093
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10042
10094
|
}));
|
|
10043
10095
|
};
|
|
10044
10096
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10045
10097
|
|
|
10046
|
-
var messages$
|
|
10098
|
+
var messages$e = defineMessages({
|
|
10047
10099
|
customersStatus: {
|
|
10048
10100
|
id: 'PlatformLimits.Status.customers',
|
|
10049
10101
|
description: 'The message for customers platform limit values',
|
|
@@ -10051,8 +10103,8 @@ var messages$d = defineMessages({
|
|
|
10051
10103
|
}
|
|
10052
10104
|
});
|
|
10053
10105
|
|
|
10054
|
-
function ownKeys$
|
|
10055
|
-
function _objectSpread$
|
|
10106
|
+
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; }
|
|
10107
|
+
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; }
|
|
10056
10108
|
var styles$b = {
|
|
10057
10109
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10058
10110
|
};
|
|
@@ -10072,7 +10124,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10072
10124
|
children: jsx(Text.Detail, {
|
|
10073
10125
|
tone: "secondary",
|
|
10074
10126
|
isInline: true,
|
|
10075
|
-
intlMessage: _objectSpread$
|
|
10127
|
+
intlMessage: _objectSpread$o(_objectSpread$o({}, messages$e.customersStatus), {}, {
|
|
10076
10128
|
values: {
|
|
10077
10129
|
current: intl.formatNumber(current),
|
|
10078
10130
|
limit: intl.formatNumber(limit)
|
|
@@ -10083,7 +10135,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10083
10135
|
};
|
|
10084
10136
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10085
10137
|
|
|
10086
|
-
var messages$
|
|
10138
|
+
var messages$d = defineMessages({
|
|
10087
10139
|
title: {
|
|
10088
10140
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10089
10141
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10096,10 +10148,10 @@ var messages$c = defineMessages({
|
|
|
10096
10148
|
}
|
|
10097
10149
|
});
|
|
10098
10150
|
|
|
10099
|
-
function ownKeys$
|
|
10100
|
-
function _objectSpread$
|
|
10151
|
+
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; }
|
|
10152
|
+
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; }
|
|
10101
10153
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10102
|
-
return jsxs("svg", _objectSpread$
|
|
10154
|
+
return jsxs("svg", _objectSpread$n(_objectSpread$n({}, props), {}, {
|
|
10103
10155
|
children: [jsx("defs", {
|
|
10104
10156
|
children: jsx("path", {
|
|
10105
10157
|
id: "a",
|
|
@@ -10207,7 +10259,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10207
10259
|
return jsx(InfoDialog, {
|
|
10208
10260
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10209
10261
|
onClose: onClose,
|
|
10210
|
-
title: intl.formatMessage(messages$
|
|
10262
|
+
title: intl.formatMessage(messages$d.title),
|
|
10211
10263
|
children: jsxs(Spacings.Stack, {
|
|
10212
10264
|
scale: "m",
|
|
10213
10265
|
alignItems: "center",
|
|
@@ -10216,7 +10268,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10216
10268
|
alignItems: "center",
|
|
10217
10269
|
children: [jsx(PlatformLimitsCustomersNotifications, {}), jsx(FlatButton, {
|
|
10218
10270
|
onClick: onClose,
|
|
10219
|
-
label: intl.formatMessage(messages$
|
|
10271
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10220
10272
|
icon: jsx(ListIcon, {
|
|
10221
10273
|
size: "medium",
|
|
10222
10274
|
color: "primary"
|
|
@@ -10271,15 +10323,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10271
10323
|
};
|
|
10272
10324
|
};
|
|
10273
10325
|
|
|
10274
|
-
function ownKeys$
|
|
10275
|
-
function _objectSpread$
|
|
10326
|
+
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; }
|
|
10327
|
+
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; }
|
|
10276
10328
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10277
10329
|
const WithCustomersPlatformLimits = props => {
|
|
10278
10330
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10279
10331
|
const customersProps = {
|
|
10280
10332
|
platformLimits: CustomersPlatformLimits
|
|
10281
10333
|
};
|
|
10282
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10334
|
+
return jsx(WrappedComponent, _objectSpread$m(_objectSpread$m({}, props), customersProps));
|
|
10283
10335
|
};
|
|
10284
10336
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10285
10337
|
return WithCustomersPlatformLimits;
|
|
@@ -10365,7 +10417,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10365
10417
|
};
|
|
10366
10418
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10367
10419
|
|
|
10368
|
-
var messages$
|
|
10420
|
+
var messages$c = defineMessages({
|
|
10369
10421
|
customerGroupsPlatformLimitReached: {
|
|
10370
10422
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10371
10423
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10373,17 +10425,17 @@ var messages$b = defineMessages({
|
|
|
10373
10425
|
}
|
|
10374
10426
|
});
|
|
10375
10427
|
|
|
10376
|
-
function ownKeys$
|
|
10377
|
-
function _objectSpread$
|
|
10428
|
+
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; }
|
|
10429
|
+
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; }
|
|
10378
10430
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10379
10431
|
const intl = useIntl();
|
|
10380
|
-
return jsx(Tooltip, _objectSpread$
|
|
10381
|
-
title: intl.formatMessage(messages$
|
|
10432
|
+
return jsx(Tooltip, _objectSpread$l(_objectSpread$l({}, props), {}, {
|
|
10433
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10382
10434
|
}));
|
|
10383
10435
|
};
|
|
10384
10436
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10385
10437
|
|
|
10386
|
-
var messages$
|
|
10438
|
+
var messages$b = defineMessages({
|
|
10387
10439
|
customerGroupsStatus: {
|
|
10388
10440
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10389
10441
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10391,8 +10443,8 @@ var messages$a = defineMessages({
|
|
|
10391
10443
|
}
|
|
10392
10444
|
});
|
|
10393
10445
|
|
|
10394
|
-
function ownKeys$
|
|
10395
|
-
function _objectSpread$
|
|
10446
|
+
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; }
|
|
10447
|
+
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; }
|
|
10396
10448
|
var styles$9 = {
|
|
10397
10449
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10398
10450
|
};
|
|
@@ -10412,7 +10464,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10412
10464
|
children: jsx(Text.Detail, {
|
|
10413
10465
|
tone: "secondary",
|
|
10414
10466
|
isInline: true,
|
|
10415
|
-
intlMessage: _objectSpread$
|
|
10467
|
+
intlMessage: _objectSpread$k(_objectSpread$k({}, messages$b.customerGroupsStatus), {}, {
|
|
10416
10468
|
values: {
|
|
10417
10469
|
current: intl.formatNumber(current),
|
|
10418
10470
|
limit: intl.formatNumber(limit)
|
|
@@ -10423,7 +10475,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10423
10475
|
};
|
|
10424
10476
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10425
10477
|
|
|
10426
|
-
var messages$
|
|
10478
|
+
var messages$a = defineMessages({
|
|
10427
10479
|
title: {
|
|
10428
10480
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10429
10481
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10436,10 +10488,10 @@ var messages$9 = defineMessages({
|
|
|
10436
10488
|
}
|
|
10437
10489
|
});
|
|
10438
10490
|
|
|
10439
|
-
function ownKeys$
|
|
10440
|
-
function _objectSpread$
|
|
10491
|
+
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; }
|
|
10492
|
+
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; }
|
|
10441
10493
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10442
|
-
return jsxs("svg", _objectSpread$
|
|
10494
|
+
return jsxs("svg", _objectSpread$j(_objectSpread$j({}, props), {}, {
|
|
10443
10495
|
children: [jsx("defs", {
|
|
10444
10496
|
children: jsx("path", {
|
|
10445
10497
|
id: "a",
|
|
@@ -10547,7 +10599,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10547
10599
|
return jsx(InfoDialog, {
|
|
10548
10600
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10549
10601
|
onClose: onClose,
|
|
10550
|
-
title: intl.formatMessage(messages$
|
|
10602
|
+
title: intl.formatMessage(messages$a.title),
|
|
10551
10603
|
children: jsxs(Spacings.Stack, {
|
|
10552
10604
|
scale: "m",
|
|
10553
10605
|
alignItems: "center",
|
|
@@ -10556,7 +10608,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10556
10608
|
alignItems: "center",
|
|
10557
10609
|
children: [jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsx(FlatButton, {
|
|
10558
10610
|
onClick: onClose,
|
|
10559
|
-
label: intl.formatMessage(messages$
|
|
10611
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10560
10612
|
icon: jsx(ListIcon, {
|
|
10561
10613
|
size: "medium",
|
|
10562
10614
|
color: "primary"
|
|
@@ -10611,15 +10663,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10611
10663
|
};
|
|
10612
10664
|
};
|
|
10613
10665
|
|
|
10614
|
-
function ownKeys$
|
|
10615
|
-
function _objectSpread$
|
|
10666
|
+
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; }
|
|
10667
|
+
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; }
|
|
10616
10668
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10617
10669
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10618
10670
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10619
10671
|
const customersProps = {
|
|
10620
10672
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10621
10673
|
};
|
|
10622
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10674
|
+
return jsx(WrappedComponent, _objectSpread$i(_objectSpread$i({}, props), customersProps));
|
|
10623
10675
|
};
|
|
10624
10676
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10625
10677
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10674,7 +10726,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10674
10726
|
}
|
|
10675
10727
|
});
|
|
10676
10728
|
|
|
10677
|
-
var messages$
|
|
10729
|
+
var messages$9 = defineMessages({
|
|
10678
10730
|
indexingSucceed: {
|
|
10679
10731
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10680
10732
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10712,8 +10764,8 @@ const defaultValue = {
|
|
|
10712
10764
|
*/
|
|
10713
10765
|
const PimIndexerContext = /*#__PURE__*/createContext(defaultValue);
|
|
10714
10766
|
|
|
10715
|
-
function ownKeys$
|
|
10716
|
-
function _objectSpread$
|
|
10767
|
+
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; }
|
|
10768
|
+
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; }
|
|
10717
10769
|
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); }; }
|
|
10718
10770
|
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; } }
|
|
10719
10771
|
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 } } } };
|
|
@@ -10799,7 +10851,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10799
10851
|
_this.props.notifications.showNotification({
|
|
10800
10852
|
kind: 'error',
|
|
10801
10853
|
domain: DOMAINS.SIDE,
|
|
10802
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10854
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10803
10855
|
});
|
|
10804
10856
|
};
|
|
10805
10857
|
_this.getIndexingProgress = async () => {
|
|
@@ -10840,7 +10892,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10840
10892
|
_this.props.notifications.showNotification({
|
|
10841
10893
|
kind: 'success',
|
|
10842
10894
|
domain: DOMAINS.SIDE,
|
|
10843
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10895
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10844
10896
|
},
|
|
10845
10897
|
// because the indexing may take so long, the success notification
|
|
10846
10898
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10889,7 +10941,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10889
10941
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10890
10942
|
}
|
|
10891
10943
|
});
|
|
10892
|
-
_this.setState(_objectSpread$
|
|
10944
|
+
_this.setState(_objectSpread$h(_objectSpread$h({
|
|
10893
10945
|
isLoading: false,
|
|
10894
10946
|
isProjectBeingIndexedByPim: true
|
|
10895
10947
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10914,7 +10966,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10914
10966
|
key: "render",
|
|
10915
10967
|
value: function render() {
|
|
10916
10968
|
return jsx(PimIndexerContext.Provider, {
|
|
10917
|
-
value: _objectSpread$
|
|
10969
|
+
value: _objectSpread$h(_objectSpread$h({}, this.state), {}, {
|
|
10918
10970
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
10919
10971
|
indexProject: this.indexProject
|
|
10920
10972
|
}),
|
|
@@ -10956,13 +11008,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
10956
11008
|
}(PureComponent);
|
|
10957
11009
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
10958
11010
|
|
|
10959
|
-
function ownKeys$
|
|
10960
|
-
function _objectSpread$
|
|
11011
|
+
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; }
|
|
11012
|
+
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; }
|
|
10961
11013
|
var injectPimIndexer = (function () {
|
|
10962
11014
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
10963
11015
|
return Component => {
|
|
10964
11016
|
const WrappedComponent = props => jsx(WithPimIndexer, {
|
|
10965
|
-
children: pimIndexerProps => jsx(Component, _objectSpread$
|
|
11017
|
+
children: pimIndexerProps => jsx(Component, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
10966
11018
|
[propName]: pimIndexerProps
|
|
10967
11019
|
}))
|
|
10968
11020
|
});
|
|
@@ -10975,7 +11027,7 @@ function usePimIndexer() {
|
|
|
10975
11027
|
return useContext(PimIndexerContext);
|
|
10976
11028
|
}
|
|
10977
11029
|
|
|
10978
|
-
var messages$
|
|
11030
|
+
var messages$8 = defineMessages({
|
|
10979
11031
|
yes: {
|
|
10980
11032
|
id: 'BooleanField.yes',
|
|
10981
11033
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -10997,8 +11049,8 @@ const BooleanField = props => {
|
|
|
10997
11049
|
var _context;
|
|
10998
11050
|
let selectedValue;
|
|
10999
11051
|
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]);
|
|
11000
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11001
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11052
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11053
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11002
11054
|
const options = [{
|
|
11003
11055
|
value: 'yes',
|
|
11004
11056
|
label: yesLabel
|
|
@@ -11036,7 +11088,7 @@ function getBooleanValue(value) {
|
|
|
11036
11088
|
return value === false ? 'no' : 'yes';
|
|
11037
11089
|
}
|
|
11038
11090
|
|
|
11039
|
-
var messages$
|
|
11091
|
+
var messages$7 = defineMessages({
|
|
11040
11092
|
label: {
|
|
11041
11093
|
id: 'MissingValueField.label',
|
|
11042
11094
|
description: 'The label text for the missing values option',
|
|
@@ -11044,20 +11096,20 @@ var messages$6 = defineMessages({
|
|
|
11044
11096
|
}
|
|
11045
11097
|
});
|
|
11046
11098
|
|
|
11047
|
-
function ownKeys$
|
|
11048
|
-
function _objectSpread$
|
|
11099
|
+
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; }
|
|
11100
|
+
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; }
|
|
11049
11101
|
const MissingValueField = props => jsx(CheckboxInput, {
|
|
11050
11102
|
name: "missing-value",
|
|
11051
11103
|
isChecked: props.isChecked,
|
|
11052
11104
|
onChange: props.onChange,
|
|
11053
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11105
|
+
children: jsx(FormattedMessage, _objectSpread$f({}, messages$7.label))
|
|
11054
11106
|
});
|
|
11055
11107
|
MissingValueField.defaultProps = {
|
|
11056
11108
|
isChecked: false
|
|
11057
11109
|
};
|
|
11058
11110
|
|
|
11059
|
-
function ownKeys$
|
|
11060
|
-
function _objectSpread$
|
|
11111
|
+
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; }
|
|
11112
|
+
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; }
|
|
11061
11113
|
var styles$7 = {
|
|
11062
11114
|
"button": "button-module__button___1OzVf",
|
|
11063
11115
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11091,7 +11143,7 @@ const Button = props => {
|
|
|
11091
11143
|
|
|
11092
11144
|
// Pass only `data-*` props
|
|
11093
11145
|
const dataProps = filterDataAttributes(props);
|
|
11094
|
-
return jsx("button", _objectSpread$
|
|
11146
|
+
return jsx("button", _objectSpread$e(_objectSpread$e({
|
|
11095
11147
|
onClick: isDisabled ? null : onClick,
|
|
11096
11148
|
type: props.type,
|
|
11097
11149
|
className: classnames(styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11106,7 +11158,7 @@ Button.defaultProps = {
|
|
|
11106
11158
|
type: 'button'
|
|
11107
11159
|
};
|
|
11108
11160
|
|
|
11109
|
-
var messages$
|
|
11161
|
+
var messages$6 = defineMessages({
|
|
11110
11162
|
chooseFile: {
|
|
11111
11163
|
id: 'ButtonFileInput.chooseFile',
|
|
11112
11164
|
description: 'The label text of the field for upload local file',
|
|
@@ -11114,8 +11166,8 @@ var messages$5 = defineMessages({
|
|
|
11114
11166
|
}
|
|
11115
11167
|
});
|
|
11116
11168
|
|
|
11117
|
-
function ownKeys$
|
|
11118
|
-
function _objectSpread$
|
|
11169
|
+
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; }
|
|
11170
|
+
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; }
|
|
11119
11171
|
var styles$6 = {
|
|
11120
11172
|
"button": "file-input-module__button___2KypN",
|
|
11121
11173
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11135,7 +11187,7 @@ const FileInput = props => jsx("label", {
|
|
|
11135
11187
|
});
|
|
11136
11188
|
FileInput.displayName = 'FileInput';
|
|
11137
11189
|
FileInput.defaultProps = {
|
|
11138
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11190
|
+
children: jsx(FormattedMessage, _objectSpread$d({}, messages$6.chooseFile)),
|
|
11139
11191
|
allowMultiple: false,
|
|
11140
11192
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11141
11193
|
};
|
|
@@ -11182,7 +11234,7 @@ const ScrollToFieldError = () => {
|
|
|
11182
11234
|
return null;
|
|
11183
11235
|
};
|
|
11184
11236
|
|
|
11185
|
-
var messages$
|
|
11237
|
+
var messages$5 = defineMessages({
|
|
11186
11238
|
buttonLabel: {
|
|
11187
11239
|
id: 'SearchInput.buttonLabel',
|
|
11188
11240
|
description: 'Label for "Search" button.',
|
|
@@ -11237,15 +11289,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11237
11289
|
});
|
|
11238
11290
|
},
|
|
11239
11291
|
onReset: props.onReset,
|
|
11240
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11292
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11241
11293
|
isDisabled: props.disabled
|
|
11242
11294
|
})
|
|
11243
11295
|
});
|
|
11244
11296
|
};
|
|
11245
11297
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11246
11298
|
|
|
11247
|
-
function ownKeys$
|
|
11248
|
-
function _objectSpread$
|
|
11299
|
+
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; }
|
|
11300
|
+
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; }
|
|
11249
11301
|
const StoreSelectField = props => {
|
|
11250
11302
|
return jsx(Constraints.Horizontal, {
|
|
11251
11303
|
max: props.horizontalConstraint,
|
|
@@ -11259,7 +11311,7 @@ const StoreSelectField = props => {
|
|
|
11259
11311
|
htmlFor: props.id,
|
|
11260
11312
|
hasRequiredIndicator: props.isRequired,
|
|
11261
11313
|
isBold: true
|
|
11262
|
-
}), jsx(StoreSelectInput, _objectSpread$
|
|
11314
|
+
}), jsx(StoreSelectInput, _objectSpread$c(_objectSpread$c({
|
|
11263
11315
|
projectKey: props.projectKey,
|
|
11264
11316
|
id: props.id,
|
|
11265
11317
|
name: props.name,
|
|
@@ -11299,8 +11351,8 @@ StoreSelectField.defaultProps = {
|
|
|
11299
11351
|
};
|
|
11300
11352
|
|
|
11301
11353
|
var _templateObject;
|
|
11302
|
-
function ownKeys$
|
|
11303
|
-
function _objectSpread$
|
|
11354
|
+
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; }
|
|
11355
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$b(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$b(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11304
11356
|
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); }; }
|
|
11305
11357
|
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; } }
|
|
11306
11358
|
var styles$3 = {
|
|
@@ -11317,7 +11369,7 @@ const validateRequired = value => {
|
|
|
11317
11369
|
};
|
|
11318
11370
|
const VALIDATOR_REQUIRED = {
|
|
11319
11371
|
name: 'required',
|
|
11320
|
-
message: messages$
|
|
11372
|
+
message: messages$K.required,
|
|
11321
11373
|
permanent: true,
|
|
11322
11374
|
validators: {
|
|
11323
11375
|
change(value) {
|
|
@@ -11331,7 +11383,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11331
11383
|
};
|
|
11332
11384
|
const VALIDATOR_NUMERIC = {
|
|
11333
11385
|
name: 'numeric',
|
|
11334
|
-
message: messages$
|
|
11386
|
+
message: messages$K.numeric,
|
|
11335
11387
|
permanent: false,
|
|
11336
11388
|
validators: {
|
|
11337
11389
|
change: v => {
|
|
@@ -11346,7 +11398,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11346
11398
|
};
|
|
11347
11399
|
const VALIDATOR_INTEGER = {
|
|
11348
11400
|
name: 'integer',
|
|
11349
|
-
message: messages$
|
|
11401
|
+
message: messages$K.integer,
|
|
11350
11402
|
permanent: false,
|
|
11351
11403
|
validators: {
|
|
11352
11404
|
change: v => {
|
|
@@ -11361,7 +11413,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11361
11413
|
};
|
|
11362
11414
|
({
|
|
11363
11415
|
name: 'email',
|
|
11364
|
-
message: messages$
|
|
11416
|
+
message: messages$K.email,
|
|
11365
11417
|
permanent: false,
|
|
11366
11418
|
validators: {
|
|
11367
11419
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11450,7 +11502,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11450
11502
|
* so it must be an invalid numeric value
|
|
11451
11503
|
*/
|
|
11452
11504
|
_this.handleInvalid = () => {
|
|
11453
|
-
const nextValidStatus = _objectSpread$
|
|
11505
|
+
const nextValidStatus = _objectSpread$b({}, _this.state.validStatus);
|
|
11454
11506
|
if (has(nextValidStatus, 'numeric')) {
|
|
11455
11507
|
nextValidStatus.numeric = false;
|
|
11456
11508
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11484,10 +11536,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11484
11536
|
process.env.NODE_ENV !== "production" ? warning(hasWarned, warningMessage) : void 0;
|
|
11485
11537
|
hasWarned = true;
|
|
11486
11538
|
}
|
|
11487
|
-
// eslint-disable-next-line camelcase
|
|
11488
11539
|
}, {
|
|
11489
|
-
key: "
|
|
11490
|
-
value: function
|
|
11540
|
+
key: "componentDidUpdate",
|
|
11541
|
+
value: function componentDidUpdate() {
|
|
11542
|
+
const nextProps = this.props;
|
|
11491
11543
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11492
11544
|
this.resetValidity();
|
|
11493
11545
|
this.handleChange(nextProps.value, {
|
|
@@ -11502,7 +11554,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11502
11554
|
if (prev) return this.state.validStatus[v.name];
|
|
11503
11555
|
return prev;
|
|
11504
11556
|
}, true);
|
|
11505
|
-
const componentProps = _objectSpread$
|
|
11557
|
+
const componentProps = _objectSpread$b(_objectSpread$b({}, this.props), {}, {
|
|
11506
11558
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11507
11559
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11508
11560
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11519,7 +11571,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11519
11571
|
components: {
|
|
11520
11572
|
WrapperComponent: ToolTipWrapperComponent
|
|
11521
11573
|
},
|
|
11522
|
-
children: jsx(_InnerComponent, _objectSpread$
|
|
11574
|
+
children: jsx(_InnerComponent, _objectSpread$b({}, componentProps))
|
|
11523
11575
|
})
|
|
11524
11576
|
});
|
|
11525
11577
|
}
|
|
@@ -11574,7 +11626,7 @@ function simpleInput(type) {
|
|
|
11574
11626
|
}, _class;
|
|
11575
11627
|
}
|
|
11576
11628
|
|
|
11577
|
-
var messages$
|
|
11629
|
+
var messages$4 = defineMessages({
|
|
11578
11630
|
customFieldsError: {
|
|
11579
11631
|
id: 'CustomFieldsError.Error',
|
|
11580
11632
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11582,14 +11634,14 @@ var messages$3 = defineMessages({
|
|
|
11582
11634
|
}
|
|
11583
11635
|
});
|
|
11584
11636
|
|
|
11585
|
-
function ownKeys$
|
|
11586
|
-
function _objectSpread$
|
|
11637
|
+
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; }
|
|
11638
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$a(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$a(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11587
11639
|
const CustomFieldsErrorTextNotification = props => {
|
|
11588
11640
|
var _context;
|
|
11589
11641
|
return jsxs(Spacings.Stack, {
|
|
11590
11642
|
scale: "s",
|
|
11591
11643
|
children: [jsx(Text.Wrap, {
|
|
11592
|
-
intlMessage: _objectSpread$
|
|
11644
|
+
intlMessage: _objectSpread$a({}, messages$4.customFieldsError)
|
|
11593
11645
|
}), jsx(Spacings.Stack, {
|
|
11594
11646
|
scale: "xs",
|
|
11595
11647
|
children: _mapInstanceProperty(_context = props.formErrors).call(_context, formError => jsx(Text.Detail, {
|
|
@@ -11601,7 +11653,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11601
11653
|
};
|
|
11602
11654
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11603
11655
|
|
|
11604
|
-
const messages$
|
|
11656
|
+
const messages$3 = defineMessages({
|
|
11605
11657
|
from: {
|
|
11606
11658
|
id: 'LabelRange.from',
|
|
11607
11659
|
description: 'The label for "from" range',
|
|
@@ -11614,8 +11666,8 @@ const messages$2 = defineMessages({
|
|
|
11614
11666
|
}
|
|
11615
11667
|
});
|
|
11616
11668
|
|
|
11617
|
-
function ownKeys$
|
|
11618
|
-
function _objectSpread$
|
|
11669
|
+
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; }
|
|
11670
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$9(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11619
11671
|
var styles$2 = {
|
|
11620
11672
|
"label": "label-range-module__label___3Tb0p"
|
|
11621
11673
|
};
|
|
@@ -11623,12 +11675,12 @@ const LabelRange = _ref => {
|
|
|
11623
11675
|
let type = _ref.type;
|
|
11624
11676
|
return jsx("label", {
|
|
11625
11677
|
className: styles$2.label,
|
|
11626
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11678
|
+
children: jsx(FormattedMessage, _objectSpread$9({}, messages$3[type]))
|
|
11627
11679
|
});
|
|
11628
11680
|
};
|
|
11629
11681
|
LabelRange.displayName = 'LabelRange';
|
|
11630
11682
|
|
|
11631
|
-
var messages$
|
|
11683
|
+
var messages$2 = defineMessages({
|
|
11632
11684
|
filterWholeInput: {
|
|
11633
11685
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11634
11686
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11641,8 +11693,8 @@ var messages$1 = defineMessages({
|
|
|
11641
11693
|
}
|
|
11642
11694
|
});
|
|
11643
11695
|
|
|
11644
|
-
function ownKeys$
|
|
11645
|
-
function _objectSpread$
|
|
11696
|
+
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; }
|
|
11697
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$8(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$8(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11646
11698
|
var styles$1 = {
|
|
11647
11699
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11648
11700
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11666,7 +11718,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11666
11718
|
}),
|
|
11667
11719
|
children: jsx(Text.Body, {
|
|
11668
11720
|
truncate: true,
|
|
11669
|
-
intlMessage: _objectSpread$
|
|
11721
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterWholeInput), {}, {
|
|
11670
11722
|
values: {
|
|
11671
11723
|
values: "\"".concat(props.value, "\"")
|
|
11672
11724
|
}
|
|
@@ -11679,7 +11731,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11679
11731
|
}),
|
|
11680
11732
|
children: jsx(Text.Body, {
|
|
11681
11733
|
truncate: true,
|
|
11682
|
-
intlMessage: _objectSpread$
|
|
11734
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterSeparateValues), {}, {
|
|
11683
11735
|
values: {
|
|
11684
11736
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11685
11737
|
}
|
|
@@ -11790,8 +11842,8 @@ const MultiValueSearchInput = props => {
|
|
|
11790
11842
|
};
|
|
11791
11843
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11792
11844
|
|
|
11793
|
-
function ownKeys$
|
|
11794
|
-
function _objectSpread$
|
|
11845
|
+
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; }
|
|
11846
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$7(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11795
11847
|
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); }; }
|
|
11796
11848
|
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; } }
|
|
11797
11849
|
var styles = {
|
|
@@ -11813,7 +11865,9 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11813
11865
|
args[_key] = arguments[_key];
|
|
11814
11866
|
}
|
|
11815
11867
|
_this = _super.call(this, ...args);
|
|
11816
|
-
_this.
|
|
11868
|
+
_this.state = {
|
|
11869
|
+
parsedValue: _this.props.value
|
|
11870
|
+
};
|
|
11817
11871
|
_this.setValue = value => {
|
|
11818
11872
|
if (!isValidValue(value)) return;
|
|
11819
11873
|
const newValue = !isUndefined(value) ? _this.props.formatNumber(value) : undefined;
|
|
@@ -11826,8 +11880,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11826
11880
|
_this.handleChange = event => {
|
|
11827
11881
|
const value = event.target.rawValue;
|
|
11828
11882
|
const parsedNumber = _this.props.parseNumber(value);
|
|
11829
|
-
if (_this.parsedValue === parsedNumber) return;
|
|
11830
|
-
_this.
|
|
11883
|
+
if (_this.state.parsedValue === parsedNumber) return;
|
|
11884
|
+
_this.setState({
|
|
11885
|
+
parsedValue: parsedNumber
|
|
11886
|
+
});
|
|
11831
11887
|
_this.props.onChangeValue(parsedNumber);
|
|
11832
11888
|
if (!isNumberish(value) && _this.props.onInvalidValue) _this.props.onInvalidValue(value);
|
|
11833
11889
|
};
|
|
@@ -11841,12 +11897,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11841
11897
|
return _this;
|
|
11842
11898
|
}
|
|
11843
11899
|
_createClass(NumericFormatInput, [{
|
|
11844
|
-
key: "
|
|
11845
|
-
value:
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
if (this.props.value !== nextProps.value && nextProps.value !== this.parsedValue) {
|
|
11849
|
-
this.setValue(nextProps.value);
|
|
11900
|
+
key: "componentDidUpdate",
|
|
11901
|
+
value: function componentDidUpdate(prevProps) {
|
|
11902
|
+
if (this.props.value !== prevProps.value && this.props.value !== this.state.parsedValue) {
|
|
11903
|
+
this.setValue(this.props.value);
|
|
11850
11904
|
}
|
|
11851
11905
|
}
|
|
11852
11906
|
}, {
|
|
@@ -11854,7 +11908,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11854
11908
|
value: function render() {
|
|
11855
11909
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11856
11910
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11857
|
-
return jsx(Cleave, _objectSpread$
|
|
11911
|
+
return jsx(Cleave, _objectSpread$7({
|
|
11858
11912
|
placeholder: this.props.placeholder,
|
|
11859
11913
|
htmlRef: this.registerInputRef,
|
|
11860
11914
|
options: {
|
|
@@ -12150,8 +12204,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12150
12204
|
}
|
|
12151
12205
|
};
|
|
12152
12206
|
|
|
12153
|
-
function ownKeys$
|
|
12154
|
-
function _objectSpread$
|
|
12207
|
+
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; }
|
|
12208
|
+
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; }
|
|
12155
12209
|
/**
|
|
12156
12210
|
* Creates reducer
|
|
12157
12211
|
* @param {Object} initialState
|
|
@@ -12167,13 +12221,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12167
12221
|
|
|
12168
12222
|
// In case reducer ignored action, avoid creating new object
|
|
12169
12223
|
const newSubstate = reduce(newState, action);
|
|
12170
|
-
if (newSubstate) return _objectSpread$
|
|
12224
|
+
if (newSubstate) return _objectSpread$6(_objectSpread$6({}, newState), newSubstate);
|
|
12171
12225
|
return newState;
|
|
12172
12226
|
};
|
|
12173
12227
|
}
|
|
12174
12228
|
|
|
12175
|
-
function ownKeys$
|
|
12176
|
-
function _objectSpread$
|
|
12229
|
+
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; }
|
|
12230
|
+
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; }
|
|
12177
12231
|
function updateStatusInList(mergeData) {
|
|
12178
12232
|
return (state, _ref) => {
|
|
12179
12233
|
let payload = _ref.payload;
|
|
@@ -12182,15 +12236,15 @@ function updateStatusInList(mergeData) {
|
|
|
12182
12236
|
results[index] = mergeData(payload, results[index]);
|
|
12183
12237
|
results[index].checked = false;
|
|
12184
12238
|
return {
|
|
12185
|
-
currentQueryResult: _objectSpread$
|
|
12239
|
+
currentQueryResult: _objectSpread$5(_objectSpread$5({}, state.currentQueryResult), {}, {
|
|
12186
12240
|
results
|
|
12187
12241
|
})
|
|
12188
12242
|
};
|
|
12189
12243
|
};
|
|
12190
12244
|
}
|
|
12191
12245
|
|
|
12192
|
-
function ownKeys$
|
|
12193
|
-
function _objectSpread$
|
|
12246
|
+
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; }
|
|
12247
|
+
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; }
|
|
12194
12248
|
const identity = value => value;
|
|
12195
12249
|
function createResourceReducer(options) {
|
|
12196
12250
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12200,7 +12254,7 @@ function createResourceReducer(options) {
|
|
|
12200
12254
|
_options$initialState = options.initialState,
|
|
12201
12255
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12202
12256
|
const mergeData = options.mergeData || identity;
|
|
12203
|
-
const initialState = _objectSpread$
|
|
12257
|
+
const initialState = _objectSpread$4({
|
|
12204
12258
|
currentQueryResult: {
|
|
12205
12259
|
count: 0,
|
|
12206
12260
|
offset: 0,
|
|
@@ -12220,7 +12274,7 @@ function createResourceReducer(options) {
|
|
|
12220
12274
|
let payload = _ref.payload;
|
|
12221
12275
|
const results = state.currentQueryResult.results;
|
|
12222
12276
|
return {
|
|
12223
|
-
currentQueryResult: _objectSpread$
|
|
12277
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12224
12278
|
results: _filterInstanceProperty(results).call(results, _ref2 => {
|
|
12225
12279
|
let id = _ref2.id;
|
|
12226
12280
|
return id !== payload.id;
|
|
@@ -12298,17 +12352,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12298
12352
|
}
|
|
12299
12353
|
|
|
12300
12354
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12301
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12355
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12302
12356
|
return null;
|
|
12303
12357
|
};
|
|
12304
12358
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12305
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12359
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12306
12360
|
return null;
|
|
12307
12361
|
};
|
|
12308
12362
|
|
|
12309
12363
|
// eslint-disable-next-line import/prefer-default-export
|
|
12310
12364
|
const validateText = (text, intl) => {
|
|
12311
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12365
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12312
12366
|
return null;
|
|
12313
12367
|
};
|
|
12314
12368
|
|
|
@@ -12395,7 +12449,7 @@ const safelyAddFallback = function (string) {
|
|
|
12395
12449
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12396
12450
|
};
|
|
12397
12451
|
|
|
12398
|
-
var messages = defineMessages({
|
|
12452
|
+
var messages$1 = defineMessages({
|
|
12399
12453
|
booleanAttributeTrue: {
|
|
12400
12454
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12401
12455
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12588,7 +12642,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12588
12642
|
case 'boolean':
|
|
12589
12643
|
{
|
|
12590
12644
|
if (isNil$1(value)) return NO_VALUE_FALLBACK;
|
|
12591
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12645
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12592
12646
|
}
|
|
12593
12647
|
case 'reference':
|
|
12594
12648
|
return value.id || NO_VALUE_FALLBACK;
|
|
@@ -12724,8 +12778,8 @@ const getTimeZoneId = memoize((selectedTimeZone, timeZones) => {
|
|
|
12724
12778
|
} else {
|
|
12725
12779
|
var _context3;
|
|
12726
12780
|
const fallbackTimeZoneId = _findInstanceProperty(_context3 = _Object$keys(timeZones)).call(_context3, timeZoneId => {
|
|
12727
|
-
var _timeZones$timeZoneId
|
|
12728
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12781
|
+
var _timeZones$timeZoneId;
|
|
12782
|
+
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);
|
|
12729
12783
|
});
|
|
12730
12784
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12731
12785
|
return fallbackTimeZoneId.toString();
|
|
@@ -12741,8 +12795,8 @@ const getTimeZoneLabel = memoize((selectedTimeZone, timeZones) => {
|
|
|
12741
12795
|
return _concatInstanceProperty(_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12742
12796
|
});
|
|
12743
12797
|
|
|
12744
|
-
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; }
|
|
12745
|
-
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; }
|
|
12798
|
+
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; }
|
|
12799
|
+
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; }
|
|
12746
12800
|
function withPendingRequests() {
|
|
12747
12801
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12748
12802
|
return Component => {
|
|
@@ -12751,13 +12805,280 @@ function withPendingRequests() {
|
|
|
12751
12805
|
const pendingProp = {
|
|
12752
12806
|
[propName]: pendingRequests
|
|
12753
12807
|
};
|
|
12754
|
-
return jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12808
|
+
return jsx(Component, _objectSpread$3(_objectSpread$3({}, props), pendingProp));
|
|
12755
12809
|
};
|
|
12756
12810
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12757
12811
|
return WrappedComponent;
|
|
12758
12812
|
};
|
|
12759
12813
|
}
|
|
12760
12814
|
|
|
12815
|
+
var messages = defineMessages({
|
|
12816
|
+
noCustomFields: {
|
|
12817
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12818
|
+
description: 'The label when there are no custom fields defined',
|
|
12819
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12820
|
+
},
|
|
12821
|
+
noCustomType: {
|
|
12822
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12823
|
+
description: 'The label when there is no custom type selected',
|
|
12824
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12825
|
+
},
|
|
12826
|
+
noTypes: {
|
|
12827
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12828
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12829
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12830
|
+
},
|
|
12831
|
+
title: {
|
|
12832
|
+
id: 'CustomTypesSubform.title',
|
|
12833
|
+
description: 'Fallback title for the subform',
|
|
12834
|
+
defaultMessage: 'Custom fields'
|
|
12835
|
+
},
|
|
12836
|
+
typesPlaceholder: {
|
|
12837
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12838
|
+
description: 'The placeholder for the types',
|
|
12839
|
+
defaultMessage: 'Select...'
|
|
12840
|
+
}
|
|
12841
|
+
});
|
|
12842
|
+
|
|
12843
|
+
const FIELD_NAME = 'custom';
|
|
12844
|
+
|
|
12845
|
+
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; }
|
|
12846
|
+
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; }
|
|
12847
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12848
|
+
return typeDefinitions.length > 0;
|
|
12849
|
+
};
|
|
12850
|
+
const typeDefinitionSelected = formValues => {
|
|
12851
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12852
|
+
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);
|
|
12853
|
+
};
|
|
12854
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12855
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12856
|
+
};
|
|
12857
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12858
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12859
|
+
isReadOnly = _ref.isReadOnly;
|
|
12860
|
+
const _useFormikContext = useFormikContext(),
|
|
12861
|
+
formValues = _valuesInstanceProperty(_useFormikContext);
|
|
12862
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12863
|
+
return jsx(FormattedMessage, _objectSpread$2({}, messages.noTypes));
|
|
12864
|
+
}
|
|
12865
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12866
|
+
return jsx(FormattedMessage, _objectSpread$2({}, messages.noCustomType));
|
|
12867
|
+
}
|
|
12868
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12869
|
+
return jsx(FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12870
|
+
}
|
|
12871
|
+
return jsx(Constraints.Horizontal, {
|
|
12872
|
+
max: "scale",
|
|
12873
|
+
children: jsx(CustomFields, {
|
|
12874
|
+
isReadOnly: isReadOnly,
|
|
12875
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12876
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12877
|
+
})
|
|
12878
|
+
});
|
|
12879
|
+
};
|
|
12880
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12881
|
+
|
|
12882
|
+
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; }
|
|
12883
|
+
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; }
|
|
12884
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12885
|
+
return _mapInstanceProperty(typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12886
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12887
|
+
value: typeDefinition.type.key,
|
|
12888
|
+
label: formatLocalizedString(typeDefinition.type, {
|
|
12889
|
+
key: 'name',
|
|
12890
|
+
locale: language,
|
|
12891
|
+
fallbackOrder: languages
|
|
12892
|
+
})
|
|
12893
|
+
}));
|
|
12894
|
+
};
|
|
12895
|
+
|
|
12896
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12897
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12898
|
+
return {
|
|
12899
|
+
type: {
|
|
12900
|
+
id: selectedTypeDefinition.type.id,
|
|
12901
|
+
obj: {
|
|
12902
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12903
|
+
key: selectedTypeDefinition.type.key
|
|
12904
|
+
}
|
|
12905
|
+
},
|
|
12906
|
+
fields: {}
|
|
12907
|
+
};
|
|
12908
|
+
};
|
|
12909
|
+
const CustomTypeSubform = _ref => {
|
|
12910
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12911
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12912
|
+
isReadOnly = _ref.isReadOnly,
|
|
12913
|
+
isCondensed = _ref.isCondensed;
|
|
12914
|
+
const _useFormikContext = useFormikContext(),
|
|
12915
|
+
formValues = _valuesInstanceProperty(_useFormikContext),
|
|
12916
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
12917
|
+
validateForm = _useFormikContext.validateForm;
|
|
12918
|
+
const _useIntl = useIntl(),
|
|
12919
|
+
formatMessage = _useIntl.formatMessage;
|
|
12920
|
+
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
12921
|
+
language: applicationContext.dataLocale,
|
|
12922
|
+
languages: applicationContext.project.languages
|
|
12923
|
+
})),
|
|
12924
|
+
language = _useApplicationContex.language,
|
|
12925
|
+
languages = _useApplicationContex.languages;
|
|
12926
|
+
const handleTypeDefinitionSelect = useCallback(event => {
|
|
12927
|
+
const selectedTypeDefinition = _findInstanceProperty(typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12928
|
+
if (selectedTypeDefinition) {
|
|
12929
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12930
|
+
setFieldValue(FIELD_NAME, nextCustom).then(() => {
|
|
12931
|
+
validateForm();
|
|
12932
|
+
});
|
|
12933
|
+
} else {
|
|
12934
|
+
// if the dropdown selector is cleared, remove the `custom` field from the form state entirely
|
|
12935
|
+
setFieldValue(FIELD_NAME, undefined).then(() => {
|
|
12936
|
+
validateForm();
|
|
12937
|
+
});
|
|
12938
|
+
}
|
|
12939
|
+
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
12940
|
+
return jsx(CollapsiblePanel, {
|
|
12941
|
+
header: jsx(CollapsiblePanel.Header, {
|
|
12942
|
+
isCondensed: isCondensed,
|
|
12943
|
+
children: jsx(FormattedMessage, _objectSpread$1({}, messages.title))
|
|
12944
|
+
}),
|
|
12945
|
+
headerControls: typeDefinitions.length > 0 && jsx("div", {
|
|
12946
|
+
css: /*#__PURE__*/css("min-width:", designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0IH0gZnJvbSAnZm9ybWlrJztcbmltcG9ydCB7IEZvcm1hdHRlZE1lc3NhZ2UsIHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnO1xuaW1wb3J0IHsgZm9ybWF0TG9jYWxpemVkU3RyaW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvbDEwbic7XG5pbXBvcnQge1xuICBDb2xsYXBzaWJsZVBhbmVsLFxuICBTZWxlY3RJbnB1dCxcbiAgZGVzaWduVG9rZW5zLFxufSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnO1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuaW1wb3J0IEN1c3RvbUZpZWxkc0lucHV0V3JhcHBlciBmcm9tICcuL2N1c3RvbS1maWVsZHMtaW5wdXQtd3JhcHBlcic7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyBGSUVMRF9OQU1FIH0gZnJvbSAnLi9jb25zdGFudHMnO1xuXG4vLyBDcmVhdGVzIGRyb3Bkb3duIG9wdGlvbnNcbmV4cG9ydCBjb25zdCBtYXBUeXBlRGVmaW5pdGlvbnNUb09wdGlvbnMgPSAoXG4gIHR5cGVEZWZpbml0aW9ucyxcbiAgbGFuZ3VhZ2UsXG4gIGxhbmd1YWdlcyxcbiAgc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbklkXG4pID0+IHtcbiAgcmV0dXJuIHR5cGVEZWZpbml0aW9ucy5tYXAoKHR5cGVEZWZpbml0aW9uKSA9PiAoe1xuICAgIGlzRGlzYWJsZWQ6XG4gICAgICBzZWxlY3RlZFR5cGVEZWZpbml0aW9uSWQgJiZcbiAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25JZCA9PT0gdHlwZURlZmluaXRpb24udHlwZS5pZCxcbiAgICB2YWx1ZTogdHlwZURlZmluaXRpb24udHlwZS5rZXksXG4gICAgbGFiZWw6IGZvcm1hdExvY2FsaXplZFN0cmluZyh0eXBlRGVmaW5pdGlvbi50eXBlLCB7XG4gICAgICBrZXk6ICduYW1lJyxcbiAgICAgIGxvY2FsZTogbGFuZ3VhZ2UsXG4gICAgICBmYWxsYmFja09yZGVyOiBsYW5ndWFnZXMsXG4gICAgfSksXG4gIH0pKTtcbn07XG5cbi8vIFVzZWQgdG8gZ2VuZXJhdGUgZm9ybSBzdGF0ZSB3aGVuIHRoZSB1c2VyIHNlbGVjdHMgYSB0eXBlIGRlZmluaXRpb24gZnJvbSB0aGUgZHJvcGRvd25cbmNvbnN0IGNyZWF0ZUZvcm1TdGF0ZUZyb21UeXBlRGVmaW5pdGlvbiA9IChzZWxlY3RlZFR5cGVEZWZpbml0aW9uKSA9PiB7XG4gIHJldHVybiB7XG4gICAgdHlwZToge1xuICAgICAgaWQ6IHNlbGVjdGVkVHlwZURlZmluaXRpb24udHlwZS5pZCxcbiAgICAgIG9iajoge1xuICAgICAgICBmaWVsZERlZmluaXRpb25zOiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUuZmllbGREZWZpbml0aW9ucyxcbiAgICAgICAga2V5OiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUua2V5LFxuICAgICAgfSxcbiAgICB9LFxuICAgIGZpZWxkczoge30sXG4gIH07XG59O1xuXG5jb25zdCBDdXN0b21UeXBlU3ViZm9ybSA9ICh7IHR5cGVEZWZpbml0aW9ucywgaXNSZWFkT25seSwgaXNDb25kZW5zZWQgfSkgPT4ge1xuICBjb25zdCB7XG4gICAgdmFsdWVzOiBmb3JtVmFsdWVzLFxuICAgIHNldEZpZWxkVmFsdWUsXG4gICAgdmFsaWRhdGVGb3JtLFxuICB9ID0gdXNlRm9ybWlrQ29udGV4dCgpO1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgeyBsYW5ndWFnZSwgbGFuZ3VhZ2VzIH0gPSB1c2VBcHBsaWNhdGlvbkNvbnRleHQoXG4gICAgKGFwcGxpY2F0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICAgIGxhbmd1YWdlczogYXBwbGljYXRpb25Db250ZXh0LnByb2plY3QubGFuZ3VhZ2VzLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgaGFuZGxlVHlwZURlZmluaXRpb25TZWxlY3QgPSB1c2VDYWxsYmFjayhcbiAgICAoZXZlbnQpID0+IHtcbiAgICAgIGNvbnN0IHNlbGVjdGVkVHlwZURlZmluaXRpb24gPSB0eXBlRGVmaW5pdGlvbnMuZmluZChcbiAgICAgICAgKHR5cGVEZWZpbml0aW9uKSA9PiB0eXBlRGVmaW5pdGlvbi50eXBlLmtleSA9PT0gZXZlbnQudGFyZ2V0LnZhbHVlXG4gICAgICApO1xuXG4gICAgICBpZiAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikge1xuICAgICAgICBjb25zdCBuZXh0Q3VzdG9tID0gY3JlYXRlRm9ybVN0YXRlRnJvbVR5cGVEZWZpbml0aW9uKFxuICAgICAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25cbiAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIG5leHRDdXN0b20pLnRoZW4oKCkgPT4ge1xuICAgICAgICAgIHZhbGlkYXRlRm9ybSgpO1xuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIGlmIHRoZSBkcm9wZG93biBzZWxlY3RvciBpcyBjbGVhcmVkLCByZW1vdmUgdGhlIGBjdXN0b21gIGZpZWxkIGZyb20gdGhlIGZvcm0gc3RhdGUgZW50aXJlbHlcbiAgICAgICAgc2V0RmllbGRWYWx1ZShGSUVMRF9OQU1FLCB1bmRlZmluZWQpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgIHZhbGlkYXRlRm9ybSgpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9LFxuICAgIFt0eXBlRGVmaW5pdGlvbnMsIHNldEZpZWxkVmFsdWUsIHZhbGlkYXRlRm9ybV1cbiAgKTtcblxuICByZXR1cm4gKFxuICAgIDxDb2xsYXBzaWJsZVBhbmVsXG4gICAgICBoZWFkZXI9e1xuICAgICAgICA8Q29sbGFwc2libGVQYW5lbC5IZWFkZXIgaXNDb25kZW5zZWQ9e2lzQ29uZGVuc2VkfT5cbiAgICAgICAgICA8Rm9ybWF0dGVkTWVzc2FnZSB7Li4ubWVzc2FnZXMudGl0bGV9IC8+XG4gICAgICAgIDwvQ29sbGFwc2libGVQYW5lbC5IZWFkZXI+XG4gICAgICB9XG4gICAgICBoZWFkZXJDb250cm9scz17XG4gICAgICAgIHR5cGVEZWZpbml0aW9ucy5sZW5ndGggPiAwICYmIChcbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICAgICAgbWluLXdpZHRoOiAke2Rlc2lnblRva2Vucy5jb25zdHJhaW50MTF9O1xuICAgICAgICAgICAgYH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICA8U2VsZWN0SW5wdXRcbiAgICAgICAgICAgICAgaXNDbGVhcmFibGVcbiAgICAgICAgICAgICAgZGF0YS10ZXN0aWQ9XCJjdXN0b20tdHlwZS1zZWxlY3RcIlxuICAgICAgICAgICAgICBuYW1lPXtgJHtGSUVMRF9OQU1FfS50eXBlLm9iai5rZXlgfVxuICAgICAgICAgICAgICBvcHRpb25zPXttYXBUeXBlRGVmaW5pdGlvbnNUb09wdGlvbnMoXG4gICAgICAgICAgICAgICAgdHlwZURlZmluaXRpb25zLFxuICAgICAgICAgICAgICAgIGxhbmd1YWdlLFxuICAgICAgICAgICAgICAgIGxhbmd1YWdlcyxcbiAgICAgICAgICAgICAgICBmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5pZFxuICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICB2YWx1ZT17Zm9ybVZhbHVlc1tGSUVMRF9OQU1FXT8udHlwZT8ub2JqPy5rZXl9XG4gICAgICAgICAgICAgIG9uQ2hhbmdlPXtoYW5kbGVUeXBlRGVmaW5pdGlvblNlbGVjdH1cbiAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9e2Zvcm1hdE1lc3NhZ2UobWVzc2FnZXMudHlwZXNQbGFjZWhvbGRlcil9XG4gICAgICAgICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICApXG4gICAgICB9XG4gICAgICBoZWFkZXJDb250cm9sc0FsaWdubWVudD1cInJpZ2h0XCJcbiAgICA+XG4gICAgICA8Q3VzdG9tRmllbGRzSW5wdXRXcmFwcGVyXG4gICAgICAgIHR5cGVEZWZpbml0aW9ucz17dHlwZURlZmluaXRpb25zfVxuICAgICAgICBpc1JlYWRPbmx5PXtpc1JlYWRPbmx5fVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDdXN0b21UeXBlU3ViZm9ybTtcbiJdfQ== */"),
|
|
12947
|
+
children: jsx(SelectInput, {
|
|
12948
|
+
isClearable: true,
|
|
12949
|
+
"data-testid": "custom-type-select",
|
|
12950
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12951
|
+
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),
|
|
12952
|
+
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,
|
|
12953
|
+
onChange: handleTypeDefinitionSelect,
|
|
12954
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12955
|
+
isReadOnly: isReadOnly
|
|
12956
|
+
})
|
|
12957
|
+
}),
|
|
12958
|
+
headerControlsAlignment: "right",
|
|
12959
|
+
children: jsx(CustomFieldsInputWrapper, {
|
|
12960
|
+
typeDefinitions: typeDefinitions,
|
|
12961
|
+
isReadOnly: isReadOnly
|
|
12962
|
+
})
|
|
12963
|
+
});
|
|
12964
|
+
};
|
|
12965
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
12966
|
+
|
|
12967
|
+
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; }
|
|
12968
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12969
|
+
const transformFieldType = fieldDefinition => {
|
|
12970
|
+
var _fieldDefinition$type, _fieldDefinition$type2;
|
|
12971
|
+
if (((_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') {
|
|
12972
|
+
var _context;
|
|
12973
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
12974
|
+
elementType: _objectSpread(_objectSpread({}, fieldDefinition.type.elementType), {}, {
|
|
12975
|
+
values: _mapInstanceProperty(_context = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context, value => ({
|
|
12976
|
+
key: value.key,
|
|
12977
|
+
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
12978
|
+
}))
|
|
12979
|
+
})
|
|
12980
|
+
});
|
|
12981
|
+
} else if (((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum') {
|
|
12982
|
+
var _context2;
|
|
12983
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
12984
|
+
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type)).call(_context2, value => ({
|
|
12985
|
+
key: value.key,
|
|
12986
|
+
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
12987
|
+
}))
|
|
12988
|
+
});
|
|
12989
|
+
} else {
|
|
12990
|
+
return fieldDefinition.type;
|
|
12991
|
+
}
|
|
12992
|
+
};
|
|
12993
|
+
const convertCustomField = resource => {
|
|
12994
|
+
var _context3, _context4;
|
|
12995
|
+
return {
|
|
12996
|
+
type: {
|
|
12997
|
+
typeId: 'type',
|
|
12998
|
+
id: resource.custom.type.id,
|
|
12999
|
+
obj: {
|
|
13000
|
+
key: resource.custom.type.key,
|
|
13001
|
+
name: transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
13002
|
+
fieldDefinitions: _mapInstanceProperty(_context3 = resource.custom.type.fieldDefinitions).call(_context3, fieldDefinition => ({
|
|
13003
|
+
name: fieldDefinition.name,
|
|
13004
|
+
required: fieldDefinition.required,
|
|
13005
|
+
inputHint: fieldDefinition.inputHint,
|
|
13006
|
+
type: transformFieldType(fieldDefinition),
|
|
13007
|
+
label: transformLocalizedFieldToLocalizedString(fieldDefinition.labelAllLocales)
|
|
13008
|
+
}))
|
|
13009
|
+
}
|
|
13010
|
+
},
|
|
13011
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread(_objectSpread({}, fields), {}, {
|
|
13012
|
+
[customField.name]: customField.value
|
|
13013
|
+
}), {})
|
|
13014
|
+
};
|
|
13015
|
+
};
|
|
13016
|
+
const createFormStateFromResource = resource => {
|
|
13017
|
+
// If there are no custom fields on the resource, don't create a form state
|
|
13018
|
+
if (!resource[FIELD_NAME]) {
|
|
13019
|
+
return {
|
|
13020
|
+
[FIELD_NAME]: undefined
|
|
13021
|
+
};
|
|
13022
|
+
}
|
|
13023
|
+
return {
|
|
13024
|
+
[FIELD_NAME]: convertCustomField(resource)
|
|
13025
|
+
};
|
|
13026
|
+
};
|
|
13027
|
+
const createGraphQlDocFromFormState = formState => {
|
|
13028
|
+
var _context5;
|
|
13029
|
+
// Unset the custom type if it's not in the form state
|
|
13030
|
+
if (!formState[FIELD_NAME]) {
|
|
13031
|
+
return {
|
|
13032
|
+
[FIELD_NAME]: {}
|
|
13033
|
+
};
|
|
13034
|
+
}
|
|
13035
|
+
return {
|
|
13036
|
+
[FIELD_NAME]: {
|
|
13037
|
+
type: {
|
|
13038
|
+
id: formState[FIELD_NAME].type.id,
|
|
13039
|
+
typeId: 'type'
|
|
13040
|
+
},
|
|
13041
|
+
fields: _mapInstanceProperty(_context5 = _Object$entries(formState[FIELD_NAME].fields)).call(_context5, _ref => {
|
|
13042
|
+
let _ref2 = _slicedToArray(_ref, 2),
|
|
13043
|
+
name = _ref2[0],
|
|
13044
|
+
value = _ref2[1];
|
|
13045
|
+
return {
|
|
13046
|
+
name,
|
|
13047
|
+
value: _JSON$stringify(value)
|
|
13048
|
+
};
|
|
13049
|
+
})
|
|
13050
|
+
}
|
|
13051
|
+
};
|
|
13052
|
+
};
|
|
13053
|
+
|
|
13054
|
+
const CustomFieldsFormField = _ref => {
|
|
13055
|
+
let resources = _ref.resources,
|
|
13056
|
+
isReadOnly = _ref.isReadOnly,
|
|
13057
|
+
isCondensed = _ref.isCondensed;
|
|
13058
|
+
const projectKey = useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13059
|
+
return jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13060
|
+
resources: resources,
|
|
13061
|
+
projectKey: projectKey,
|
|
13062
|
+
children: _ref2 => {
|
|
13063
|
+
var _context;
|
|
13064
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
13065
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13066
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13067
|
+
if (isLoading) {
|
|
13068
|
+
return jsx(LoadingSpinner, {});
|
|
13069
|
+
}
|
|
13070
|
+
const typeDefinitions = _mapInstanceProperty(_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13071
|
+
return jsx(CustomTypeSubform, {
|
|
13072
|
+
typeDefinitions: typeDefinitions,
|
|
13073
|
+
isReadOnly: isReadOnly,
|
|
13074
|
+
isCondensed: isCondensed
|
|
13075
|
+
});
|
|
13076
|
+
}
|
|
13077
|
+
});
|
|
13078
|
+
};
|
|
13079
|
+
CustomFieldsFormField.createFormStateFromResource = createFormStateFromResource;
|
|
13080
|
+
CustomFieldsFormField.createGraphQlDocFromFormState = createGraphQlDocFromFormState;
|
|
13081
|
+
|
|
12761
13082
|
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 } } } };
|
|
12762
13083
|
|
|
12763
|
-
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector,
|
|
13084
|
+
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 };
|