@commercetools-frontend/experimental-components 5.0.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +663 -483
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +663 -483
- package/dist/commercetools-frontend-experimental-components.esm.js +658 -479
- package/dist/styles.css +316 -316
- package/package.json +18 -18
|
@@ -375,7 +375,7 @@ function uniqueObjects(items) {
|
|
|
375
375
|
|
|
376
376
|
*/
|
|
377
377
|
|
|
378
|
-
const messages$
|
|
378
|
+
const messages$K = reactIntl.defineMessages({
|
|
379
379
|
unique: {
|
|
380
380
|
id: 'Validation.unique',
|
|
381
381
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1670,8 +1670,8 @@ const getData = (code, field) => {
|
|
|
1670
1670
|
};
|
|
1671
1671
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1672
1672
|
|
|
1673
|
-
function ownKeys$
|
|
1674
|
-
function _objectSpread$
|
|
1673
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1674
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1k(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1675
1675
|
function formatMoneyRangeValue(value, intl) {
|
|
1676
1676
|
var _context;
|
|
1677
1677
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1681,7 +1681,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1681
1681
|
return '';
|
|
1682
1682
|
}
|
|
1683
1683
|
function formatMoneyValue(amount, currency, intl) {
|
|
1684
|
-
return formatMoney$1(_objectSpread$
|
|
1684
|
+
return formatMoney$1(_objectSpread$1k({
|
|
1685
1685
|
centAmount: amount,
|
|
1686
1686
|
fractionDigits: getFractionDigit(currency)
|
|
1687
1687
|
}, currency ? {
|
|
@@ -1698,14 +1698,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1700
1700
|
var _moneyValue$fractione;
|
|
1701
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1701
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1k({
|
|
1702
1702
|
style: 'currency',
|
|
1703
1703
|
currency: moneyValue.currencyCode,
|
|
1704
1704
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1705
1705
|
}, options));
|
|
1706
1706
|
}
|
|
1707
1707
|
|
|
1708
|
-
var messages$
|
|
1708
|
+
var messages$J = reactIntl.defineMessages({
|
|
1709
1709
|
booleanYes: {
|
|
1710
1710
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1711
1711
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1790,7 +1790,7 @@ const formatDateTime = _ref7 => {
|
|
|
1790
1790
|
const formatBoolean = _ref8 => {
|
|
1791
1791
|
let value = _ref8.value,
|
|
1792
1792
|
intl = _ref8.intl;
|
|
1793
|
-
return value ? intl.formatMessage(messages$
|
|
1793
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1794
1794
|
};
|
|
1795
1795
|
const formatNilType = _ref9 => {
|
|
1796
1796
|
let value = _ref9.value,
|
|
@@ -1952,8 +1952,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1952
1952
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1953
1953
|
};
|
|
1954
1954
|
|
|
1955
|
-
function ownKeys$
|
|
1956
|
-
function _objectSpread$
|
|
1955
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1956
|
+
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__default["default"](_context = ownKeys$1j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1957
1957
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1958
1958
|
const WithDataTablePaginationState = props => {
|
|
1959
1959
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1964,10 +1964,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1964
1964
|
page = _usePaginationState.page,
|
|
1965
1965
|
perPage = _usePaginationState.perPage;
|
|
1966
1966
|
const tableSorting = uiKit.useDataTableSortingState({
|
|
1967
|
-
key: initialValues === null || initialValues === void 0
|
|
1968
|
-
order: initialValues === null || initialValues === void 0
|
|
1967
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1968
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1969
1969
|
});
|
|
1970
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1970
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1971
1971
|
dataTablePaginationState: {
|
|
1972
1972
|
page,
|
|
1973
1973
|
perPage,
|
|
@@ -1979,8 +1979,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1979
1979
|
return WithDataTablePaginationState;
|
|
1980
1980
|
};
|
|
1981
1981
|
|
|
1982
|
-
function ownKeys$
|
|
1983
|
-
function _objectSpread$
|
|
1982
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1983
|
+
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__default["default"](_context = ownKeys$1i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1984
1984
|
const injectNotifications = function () {
|
|
1985
1985
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1986
1986
|
return Component => {
|
|
@@ -1995,7 +1995,7 @@ const injectNotifications = function () {
|
|
|
1995
1995
|
onActionError,
|
|
1996
1996
|
hideAllPageNotifications
|
|
1997
1997
|
};
|
|
1998
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1998
|
+
return jsxRuntime.jsx(Component, _objectSpread$1i(_objectSpread$1i({}, props), {}, {
|
|
1999
1999
|
[propName]: notifications
|
|
2000
2000
|
}));
|
|
2001
2001
|
};
|
|
@@ -2004,22 +2004,22 @@ const injectNotifications = function () {
|
|
|
2004
2004
|
};
|
|
2005
2005
|
};
|
|
2006
2006
|
|
|
2007
|
-
function ownKeys$
|
|
2008
|
-
function _objectSpread$
|
|
2007
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2008
|
+
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__default["default"](_context = ownKeys$1h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2009
2009
|
function isPropsMapper(mapProps) {
|
|
2010
2010
|
return typeof mapProps === 'function';
|
|
2011
2011
|
}
|
|
2012
2012
|
const withProps = mapProps => Component => {
|
|
2013
2013
|
const EnhancedWithProps = ownProps => {
|
|
2014
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2015
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2014
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps(ownProps)) : _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps);
|
|
2015
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h({}, enhancedProps));
|
|
2016
2016
|
};
|
|
2017
2017
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2018
2018
|
return EnhancedWithProps;
|
|
2019
2019
|
};
|
|
2020
2020
|
|
|
2021
|
-
function ownKeys$
|
|
2022
|
-
function _objectSpread$
|
|
2021
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2022
|
+
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__default["default"](_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2023
2023
|
const useRedirectEffect = _ref => {
|
|
2024
2024
|
let goTo = _ref.goTo;
|
|
2025
2025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2039,30 +2039,30 @@ const defaultOptions$5 = {
|
|
|
2039
2039
|
skip: () => false
|
|
2040
2040
|
};
|
|
2041
2041
|
const withRedirectTo = options => Component => {
|
|
2042
|
-
const mergedOptions = _objectSpread$
|
|
2042
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$5), options);
|
|
2043
2043
|
const WithRedirectTo = props => {
|
|
2044
2044
|
if (!mergedOptions.skip(props)) {
|
|
2045
2045
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2046
2046
|
goTo: options.selectGoTo(props)
|
|
2047
2047
|
});
|
|
2048
2048
|
}
|
|
2049
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2049
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g({}, props));
|
|
2050
2050
|
};
|
|
2051
2051
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2052
2052
|
return WithRedirectTo;
|
|
2053
2053
|
};
|
|
2054
2054
|
|
|
2055
|
-
function ownKeys$
|
|
2056
|
-
function _objectSpread$
|
|
2055
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2056
|
+
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__default["default"](_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2057
2057
|
const defaultOptions$4 = {
|
|
2058
2058
|
propName: 'modalState',
|
|
2059
2059
|
isInitiallyOpen: false
|
|
2060
2060
|
};
|
|
2061
2061
|
const injectModalState$1 = options => Component => {
|
|
2062
|
-
const mergedOptions = _objectSpread$
|
|
2062
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$4), options);
|
|
2063
2063
|
const WithModalState = props => {
|
|
2064
2064
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2065
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2065
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2066
2066
|
[mergedOptions.propName]: modalState
|
|
2067
2067
|
}));
|
|
2068
2068
|
};
|
|
@@ -2070,17 +2070,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2070
2070
|
return WithModalState;
|
|
2071
2071
|
};
|
|
2072
2072
|
|
|
2073
|
-
function ownKeys$
|
|
2074
|
-
function _objectSpread$
|
|
2073
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2074
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2075
2075
|
const defaultOptions$3 = {
|
|
2076
2076
|
propName: 'toggleState',
|
|
2077
2077
|
isInitiallyOpen: false
|
|
2078
2078
|
};
|
|
2079
2079
|
const injectModalState = options => Component => {
|
|
2080
|
-
const mergedOptions = _objectSpread$
|
|
2080
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$3), options);
|
|
2081
2081
|
const WithToggleState = props => {
|
|
2082
2082
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2083
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2083
|
+
return jsxRuntime.jsx(Component, _objectSpread$1e(_objectSpread$1e({}, props), {}, {
|
|
2084
2084
|
[mergedOptions.propName]: toggleState
|
|
2085
2085
|
}));
|
|
2086
2086
|
};
|
|
@@ -2088,8 +2088,8 @@ const injectModalState = options => Component => {
|
|
|
2088
2088
|
return WithToggleState;
|
|
2089
2089
|
};
|
|
2090
2090
|
|
|
2091
|
-
function ownKeys$
|
|
2092
|
-
function _objectSpread$
|
|
2091
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2092
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2093
2093
|
const defaultOptions$2 = {
|
|
2094
2094
|
storageType: 'local',
|
|
2095
2095
|
segregateByUser: true
|
|
@@ -2107,7 +2107,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2107
2107
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2108
2108
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2109
2109
|
var _context;
|
|
2110
|
-
const mergedOptions = _objectSpread$
|
|
2110
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$2), options);
|
|
2111
2111
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2112
2112
|
var _context$user;
|
|
2113
2113
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2155,8 +2155,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2155
2155
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2156
2156
|
};
|
|
2157
2157
|
|
|
2158
|
-
function ownKeys$
|
|
2159
|
-
function _objectSpread$
|
|
2158
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2159
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2160
2160
|
const defaultOptions$1 = {
|
|
2161
2161
|
propName: 'storage',
|
|
2162
2162
|
storageKey: '',
|
|
@@ -2169,7 +2169,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2169
2169
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2170
2170
|
* argument position does not allow passing specification of option(s).
|
|
2171
2171
|
*/
|
|
2172
|
-
const mergedOptions = _objectSpread$
|
|
2172
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$1), options);
|
|
2173
2173
|
const WithStorage = props => {
|
|
2174
2174
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2175
2175
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2183,7 +2183,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2183
2183
|
readFromStorage
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2186
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1c(_objectSpread$1c({}, props), storageProp));
|
|
2187
2187
|
};
|
|
2188
2188
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2189
2189
|
return WithStorage;
|
|
@@ -2227,8 +2227,8 @@ const usePrevious = value => {
|
|
|
2227
2227
|
return ref.current;
|
|
2228
2228
|
};
|
|
2229
2229
|
|
|
2230
|
-
function ownKeys$
|
|
2231
|
-
function _objectSpread$
|
|
2230
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2231
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2232
2232
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n type\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2233
2233
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2234
2234
|
var _storesQueryResult$re;
|
|
@@ -2239,7 +2239,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2239
2239
|
offset: storesQueryResult.offset,
|
|
2240
2240
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2241
2241
|
var _store$productSelecti;
|
|
2242
|
-
return _objectSpread$
|
|
2242
|
+
return _objectSpread$1b(_objectSpread$1b({}, store), {}, {
|
|
2243
2243
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2244
2244
|
});
|
|
2245
2245
|
})
|
|
@@ -2247,7 +2247,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2247
2247
|
};
|
|
2248
2248
|
const createQueryVariables$6 = ownProps => {
|
|
2249
2249
|
var _context;
|
|
2250
|
-
return _objectSpread$
|
|
2250
|
+
return _objectSpread$1b(_objectSpread$1b({
|
|
2251
2251
|
limit: ownProps.limit,
|
|
2252
2252
|
offset: ownProps.offset,
|
|
2253
2253
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2402,8 +2402,8 @@ function useDidFormValidationFail() {
|
|
|
2402
2402
|
return Boolean(didFormValidationFail);
|
|
2403
2403
|
}
|
|
2404
2404
|
|
|
2405
|
-
function ownKeys$
|
|
2406
|
-
function _objectSpread$
|
|
2405
|
+
function ownKeys$1a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2406
|
+
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__default["default"](_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2407
2407
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2408
2408
|
const defaultOptions = {
|
|
2409
2409
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2431,7 +2431,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2431
2431
|
};
|
|
2432
2432
|
const usePersistedReminder = function () {
|
|
2433
2433
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2434
|
-
const mergedOptions = _objectSpread$
|
|
2434
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions), options);
|
|
2435
2435
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2436
2436
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2437
2437
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2477,7 +2477,7 @@ const usePersistedReminder = function () {
|
|
|
2477
2477
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2478
2478
|
};
|
|
2479
2479
|
|
|
2480
|
-
var messages$
|
|
2480
|
+
var messages$I = reactIntl.defineMessages({
|
|
2481
2481
|
profileUpdated: {
|
|
2482
2482
|
id: 'NotificationText.profileUpdated',
|
|
2483
2483
|
description: 'Label for the notification header',
|
|
@@ -2495,8 +2495,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2495
2495
|
}
|
|
2496
2496
|
});
|
|
2497
2497
|
|
|
2498
|
-
function ownKeys$
|
|
2499
|
-
function _objectSpread$
|
|
2498
|
+
function ownKeys$19(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2499
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2500
2500
|
const LinkToProfile = props => {
|
|
2501
2501
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2502
2502
|
to: "/account/profile",
|
|
@@ -2514,9 +2514,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2514
2514
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2515
2515
|
as: "p",
|
|
2516
2516
|
isBold: true,
|
|
2517
|
-
intlMessage: messages$
|
|
2517
|
+
intlMessage: messages$I.profileUpdated
|
|
2518
2518
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2519
|
-
intlMessage: _objectSpread$
|
|
2519
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.addMoreInformation), {}, {
|
|
2520
2520
|
values: {
|
|
2521
2521
|
newline: getNewLine
|
|
2522
2522
|
}
|
|
@@ -2525,7 +2525,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2525
2525
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2526
2526
|
scale: "xs",
|
|
2527
2527
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2528
|
-
intlMessage: _objectSpread$
|
|
2528
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.informationAndProfileLink), {}, {
|
|
2529
2529
|
values: {
|
|
2530
2530
|
newline: getNewLine,
|
|
2531
2531
|
link: getLinkToProfile
|
|
@@ -2646,7 +2646,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2646
2646
|
}, [ref]);
|
|
2647
2647
|
};
|
|
2648
2648
|
|
|
2649
|
-
var messages$
|
|
2649
|
+
var messages$H = reactIntl.defineMessages({
|
|
2650
2650
|
fallbackHint: {
|
|
2651
2651
|
id: 'KeyFallback.fallbackHint',
|
|
2652
2652
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2670,7 +2670,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2670
2670
|
return values => {
|
|
2671
2671
|
if (!values.resource) return null;
|
|
2672
2672
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2673
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2673
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2674
2674
|
key: values.resource.key
|
|
2675
2675
|
});
|
|
2676
2676
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2682,8 +2682,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2682
2682
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2683
2683
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2684
2684
|
|
|
2685
|
-
function ownKeys$
|
|
2686
|
-
function _objectSpread$
|
|
2685
|
+
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2686
|
+
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__default["default"](_context2 = ownKeys$18(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$18(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2687
2687
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2688
2688
|
const updatedColumnProps = {};
|
|
2689
2689
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2703,14 +2703,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2703
2703
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2704
2704
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2705
2705
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2706
|
-
return _objectSpread$
|
|
2706
|
+
return _objectSpread$18(_objectSpread$18({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2707
2707
|
});
|
|
2708
2708
|
};
|
|
2709
2709
|
const handleCacheUpdate = _ref2 => {
|
|
2710
2710
|
let update = _ref2.update,
|
|
2711
2711
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2712
2712
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2713
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2713
|
+
return updateCachedTableConfiguration(_objectSpread$18(_objectSpread$18({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2714
2714
|
};
|
|
2715
2715
|
|
|
2716
2716
|
// Signature:
|
|
@@ -2739,7 +2739,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2739
2739
|
return {
|
|
2740
2740
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2741
2741
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2742
|
-
return _objectSpread$
|
|
2742
|
+
return _objectSpread$18({
|
|
2743
2743
|
key: visibleColumnKey
|
|
2744
2744
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2745
2745
|
}),
|
|
@@ -2795,7 +2795,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2795
2795
|
data = _useQuery.data;
|
|
2796
2796
|
return {
|
|
2797
2797
|
isLoading: loading,
|
|
2798
|
-
total: data === null || data === void 0
|
|
2798
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2799
2799
|
};
|
|
2800
2800
|
};
|
|
2801
2801
|
|
|
@@ -2810,14 +2810,14 @@ const handlers$4 = {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
};
|
|
2812
2812
|
|
|
2813
|
-
function ownKeys$
|
|
2814
|
-
function _objectSpread$
|
|
2813
|
+
function ownKeys$17(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2814
|
+
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__default["default"](_context2 = ownKeys$17(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$17(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2815
2815
|
|
|
2816
2816
|
// eslint-disable-next-line import/prefer-default-export
|
|
2817
2817
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2818
2818
|
var _context;
|
|
2819
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2820
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2819
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
|
|
2820
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$17({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2821
2821
|
from: 'nameAllLocales',
|
|
2822
2822
|
to: 'name'
|
|
2823
2823
|
}])))
|
|
@@ -2967,7 +2967,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
2967
2967
|
});
|
|
2968
2968
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2969
2969
|
|
|
2970
|
-
var messages$
|
|
2970
|
+
var messages$G = reactIntl.defineMessages({
|
|
2971
2971
|
noChannelsFound: {
|
|
2972
2972
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2973
2973
|
description: 'The message to display when no channels were found',
|
|
@@ -2993,8 +2993,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2993
2993
|
}
|
|
2994
2994
|
});
|
|
2995
2995
|
|
|
2996
|
-
function ownKeys$
|
|
2997
|
-
function _objectSpread$
|
|
2996
|
+
function ownKeys$16(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2997
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$16(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2998
2998
|
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 } } } };
|
|
2999
2999
|
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 } } } };
|
|
3000
3000
|
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 } } } };
|
|
@@ -3015,7 +3015,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3015
3015
|
const _useIntl = reactIntl.useIntl(),
|
|
3016
3016
|
formatMessage = _useIntl.formatMessage;
|
|
3017
3017
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3018
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3018
|
+
const variables = React.useMemo(() => _objectSpread$16({
|
|
3019
3019
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3020
3020
|
}, role && {
|
|
3021
3021
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3076,8 +3076,8 @@ const ChannelPickerInput = _ref => {
|
|
|
3076
3076
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3077
3077
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3078
3078
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3079
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3080
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3079
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3080
|
+
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 : '';
|
|
3081
3081
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3082
3082
|
max: "scale",
|
|
3083
3083
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3087,7 +3087,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3087
3087
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3088
3088
|
id: name,
|
|
3089
3089
|
name: name,
|
|
3090
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3090
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3091
3091
|
loadOptions: loadOptionsDebounced,
|
|
3092
3092
|
defaultOptions: true,
|
|
3093
3093
|
showOptionGroupDivider: true,
|
|
@@ -3130,7 +3130,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3130
3130
|
var _this$props;
|
|
3131
3131
|
let user = _ref.user;
|
|
3132
3132
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3133
|
-
timeZone: (this === null || this === void 0
|
|
3133
|
+
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),
|
|
3134
3134
|
locale: this.props.intl.locale
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
@@ -3144,8 +3144,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3144
3144
|
|
|
3145
3145
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3146
3146
|
|
|
3147
|
-
function ownKeys$
|
|
3148
|
-
function _objectSpread$
|
|
3147
|
+
function ownKeys$15(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3148
|
+
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__default["default"](_context = ownKeys$15(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$15(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3149
3149
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3150
3150
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3151
3151
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3177,7 +3177,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3177
3177
|
handleMouseOver: this.handleMouseOver,
|
|
3178
3178
|
handleMouseOut: this.handleMouseOut
|
|
3179
3179
|
};
|
|
3180
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3180
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$15({}, _objectSpread$15(_objectSpread$15({}, this.props), injectedProps)));
|
|
3181
3181
|
}
|
|
3182
3182
|
}]);
|
|
3183
3183
|
return WithMouseOverState;
|
|
@@ -3186,8 +3186,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3186
3186
|
return WithMouseOverState;
|
|
3187
3187
|
};
|
|
3188
3188
|
|
|
3189
|
-
function ownKeys$
|
|
3190
|
-
function _objectSpread$
|
|
3189
|
+
function ownKeys$14(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3190
|
+
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__default["default"](_context = ownKeys$14(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3191
3191
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3192
3192
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3193
3193
|
var styles$h = {
|
|
@@ -3298,7 +3298,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3298
3298
|
}, {
|
|
3299
3299
|
key: "render",
|
|
3300
3300
|
value: function render() {
|
|
3301
|
-
const commonProps = _objectSpread$
|
|
3301
|
+
const commonProps = _objectSpread$14(_objectSpread$14({
|
|
3302
3302
|
value: this.state.draftValue,
|
|
3303
3303
|
autoComplete: this.props.autoComplete,
|
|
3304
3304
|
onChange: this.handleChange,
|
|
@@ -3317,7 +3317,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3317
3317
|
htmlFor: inputId,
|
|
3318
3318
|
children: this.props.label
|
|
3319
3319
|
})
|
|
3320
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3320
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3321
3321
|
id: inputId,
|
|
3322
3322
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3323
3323
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3326,7 +3326,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3326
3326
|
rows: 1,
|
|
3327
3327
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3328
3328
|
cacheMeasurements: true
|
|
3329
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3329
|
+
})) : jsxRuntime.jsx("input", _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3330
3330
|
id: inputId,
|
|
3331
3331
|
ref: this.props.inputRef,
|
|
3332
3332
|
type: this.props.as,
|
|
@@ -3353,7 +3353,7 @@ ThrottledField.defaultProps = {
|
|
|
3353
3353
|
label: 'Throttled field'
|
|
3354
3354
|
};
|
|
3355
3355
|
|
|
3356
|
-
var messages$
|
|
3356
|
+
var messages$F = reactIntl.defineMessages({
|
|
3357
3357
|
buttonLabel: {
|
|
3358
3358
|
id: 'SearchInput.buttonLabel',
|
|
3359
3359
|
description: 'Label for "Search" button.',
|
|
@@ -3460,7 +3460,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3460
3460
|
"data-testid": this.props.testId || 'search-input',
|
|
3461
3461
|
value: this.state.text,
|
|
3462
3462
|
label: this.props.label,
|
|
3463
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3463
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3464
3464
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3465
3465
|
onChange: this.handleInputChange,
|
|
3466
3466
|
onEnter: this.handleEnter,
|
|
@@ -3553,7 +3553,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3553
3553
|
const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
|
|
3554
3554
|
var _result$hits$map, _result$hits;
|
|
3555
3555
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3556
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3556
|
+
const ids = (_result$hits$map = result === null || result === void 0 || (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _mapInstanceProperty__default["default"](_result$hits).call(_result$hits, hit => hit.id)) !== null && _result$hits$map !== void 0 ? _result$hits$map : [];
|
|
3557
3557
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3558
3558
|
if (ids.length === 0) {
|
|
3559
3559
|
return {
|
|
@@ -3636,7 +3636,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3636
3636
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3637
3637
|
};
|
|
3638
3638
|
const usePimStatus = () => {
|
|
3639
|
-
var _data$indicesExist
|
|
3639
|
+
var _data$indicesExist;
|
|
3640
3640
|
const _useQuery = react.useQuery(FetchIndicesExist$1, {
|
|
3641
3641
|
context: {
|
|
3642
3642
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3646,7 +3646,7 @@ const usePimStatus = () => {
|
|
|
3646
3646
|
data = _useQuery.data;
|
|
3647
3647
|
return {
|
|
3648
3648
|
data,
|
|
3649
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3649
|
+
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)
|
|
3650
3650
|
};
|
|
3651
3651
|
};
|
|
3652
3652
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3675,7 +3675,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3675
3675
|
};
|
|
3676
3676
|
};
|
|
3677
3677
|
|
|
3678
|
-
var messages$
|
|
3678
|
+
var messages$E = reactIntl.defineMessages({
|
|
3679
3679
|
bottomOption: {
|
|
3680
3680
|
id: 'Products.Pickers.bottomOption',
|
|
3681
3681
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3683,11 +3683,11 @@ var messages$D = reactIntl.defineMessages({
|
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
3685
|
|
|
3686
|
-
function ownKeys$
|
|
3687
|
-
function _objectSpread$
|
|
3686
|
+
function ownKeys$13(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3687
|
+
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__default["default"](_context = ownKeys$13(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$13(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3688
3688
|
const getBottomOption = formatMessage => ({
|
|
3689
3689
|
options: [{
|
|
3690
|
-
label: formatMessage ? formatMessage(messages$
|
|
3690
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3691
3691
|
isBottomOption: true,
|
|
3692
3692
|
isDisabled: true
|
|
3693
3693
|
}]
|
|
@@ -3695,7 +3695,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3695
3695
|
const Option$2 = props => {
|
|
3696
3696
|
const _useIntl = reactIntl.useIntl(),
|
|
3697
3697
|
formatMessage = _useIntl.formatMessage;
|
|
3698
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3698
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$13(_objectSpread$13({}, props), {}, {
|
|
3699
3699
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3700
3700
|
tone: "secondary",
|
|
3701
3701
|
children: formatMessage(props.data.label)
|
|
@@ -3712,8 +3712,8 @@ const Option$2 = props => {
|
|
|
3712
3712
|
};
|
|
3713
3713
|
Option$2.displayName = 'Option';
|
|
3714
3714
|
|
|
3715
|
-
function ownKeys$
|
|
3716
|
-
function _objectSpread$
|
|
3715
|
+
function ownKeys$12(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3716
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$12(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$12(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3717
3717
|
const useHandlers = onChange => {
|
|
3718
3718
|
const _useState = React.useState(),
|
|
3719
3719
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3724,8 +3724,8 @@ const useHandlers = onChange => {
|
|
|
3724
3724
|
}, []);
|
|
3725
3725
|
const handleChange = useEventCallback(event => {
|
|
3726
3726
|
var _event$target$value;
|
|
3727
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3728
|
-
target: _objectSpread$
|
|
3727
|
+
const eventWithExtractedValue = _objectSpread$12(_objectSpread$12({}, event), {}, {
|
|
3728
|
+
target: _objectSpread$12(_objectSpread$12({}, event.target), {}, {
|
|
3729
3729
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3730
3730
|
})
|
|
3731
3731
|
});
|
|
@@ -3734,8 +3734,8 @@ const useHandlers = onChange => {
|
|
|
3734
3734
|
return [handleInputChange, handleChange];
|
|
3735
3735
|
};
|
|
3736
3736
|
|
|
3737
|
-
function ownKeys
|
|
3738
|
-
function _objectSpread
|
|
3737
|
+
function ownKeys$11(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3738
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$11(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$11(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3739
3739
|
const constructPrefixSearchPredicate = function () {
|
|
3740
3740
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3741
3741
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3778,7 +3778,7 @@ const useLoadOptions = _ref => {
|
|
|
3778
3778
|
}();
|
|
3779
3779
|
return client$1.query({
|
|
3780
3780
|
query,
|
|
3781
|
-
variables: _objectSpread
|
|
3781
|
+
variables: _objectSpread$11({
|
|
3782
3782
|
where
|
|
3783
3783
|
}, variables),
|
|
3784
3784
|
context: {
|
|
@@ -3832,7 +3832,7 @@ function useCurrentOption(_ref) {
|
|
|
3832
3832
|
};
|
|
3833
3833
|
}
|
|
3834
3834
|
|
|
3835
|
-
var messages$
|
|
3835
|
+
var messages$D = reactIntl.defineMessages({
|
|
3836
3836
|
noProductTypesFound: {
|
|
3837
3837
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3838
3838
|
description: 'The message to display when no product types were found',
|
|
@@ -3912,7 +3912,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3912
3912
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3913
3913
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3914
3914
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3915
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3915
|
+
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 : '';
|
|
3916
3916
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3917
3917
|
max: "scale",
|
|
3918
3918
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3922,7 +3922,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3922
3922
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3923
3923
|
id: name,
|
|
3924
3924
|
name: name,
|
|
3925
|
-
placeholder: formatMessage(messages$
|
|
3925
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3926
3926
|
loadOptions: loadOptionsDebounced,
|
|
3927
3927
|
defaultOptions: [],
|
|
3928
3928
|
isClearable: isClearable,
|
|
@@ -3935,7 +3935,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3935
3935
|
onInputChange: handleInputChange,
|
|
3936
3936
|
onBlur: onBlur,
|
|
3937
3937
|
value: currentOption.data,
|
|
3938
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3938
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3939
3939
|
hasError: hasError || isLoadingFailed
|
|
3940
3940
|
})
|
|
3941
3941
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3947,7 +3947,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3947
3947
|
};
|
|
3948
3948
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3949
3949
|
|
|
3950
|
-
var messages$
|
|
3950
|
+
var messages$C = reactIntl.defineMessages({
|
|
3951
3951
|
noStatesFound: {
|
|
3952
3952
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3953
3953
|
description: 'The message to display when no states were found',
|
|
@@ -4031,8 +4031,8 @@ const StatePickerInput = _ref => {
|
|
|
4031
4031
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4032
4032
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4033
4033
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4034
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4035
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
4034
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
4035
|
+
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 : '';
|
|
4036
4036
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4037
4037
|
max: "scale",
|
|
4038
4038
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -4043,7 +4043,7 @@ const StatePickerInput = _ref => {
|
|
|
4043
4043
|
id: name,
|
|
4044
4044
|
name: name,
|
|
4045
4045
|
horizontalConstraint: "scale",
|
|
4046
|
-
placeholder: formatMessage(messages$
|
|
4046
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
4047
4047
|
loadOptions: loadOptionsDebounced,
|
|
4048
4048
|
defaultOptions: true,
|
|
4049
4049
|
showOptionGroupDivider: true,
|
|
@@ -4069,9 +4069,9 @@ const StatePickerInput = _ref => {
|
|
|
4069
4069
|
};
|
|
4070
4070
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4071
4071
|
|
|
4072
|
-
function ownKeys$
|
|
4073
|
-
function _objectSpread$
|
|
4074
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4072
|
+
function ownKeys$10(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4073
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$10(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$10(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4074
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$10({
|
|
4075
4075
|
ref: ref,
|
|
4076
4076
|
style: {
|
|
4077
4077
|
display: 'block',
|
|
@@ -4209,8 +4209,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4209
4209
|
};
|
|
4210
4210
|
|
|
4211
4211
|
const _excluded = ["action"];
|
|
4212
|
-
function ownKeys
|
|
4213
|
-
function _objectSpread
|
|
4212
|
+
function ownKeys$$(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4213
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$$(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$$(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4214
4214
|
|
|
4215
4215
|
/**
|
|
4216
4216
|
* Checks if a value is a LocalizedString
|
|
@@ -4232,7 +4232,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4232
4232
|
*/
|
|
4233
4233
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4234
4234
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4235
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4235
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$$(_objectSpread$$({}, customFields), {}, {
|
|
4236
4236
|
[customField.name]: customField.value
|
|
4237
4237
|
}), {});
|
|
4238
4238
|
};
|
|
@@ -4256,7 +4256,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4256
4256
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4257
4257
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4258
4258
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4259
|
-
return _objectSpread
|
|
4259
|
+
return _objectSpread$$(_objectSpread$$(_objectSpread$$({}, transformedData), parent ? {
|
|
4260
4260
|
parent
|
|
4261
4261
|
} : {}), ancestors ? {
|
|
4262
4262
|
ancestors
|
|
@@ -4481,7 +4481,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4481
4481
|
case 'addAttributeDefinition':
|
|
4482
4482
|
return {
|
|
4483
4483
|
[actionName]: {
|
|
4484
|
-
attributeDefinition: _objectSpread
|
|
4484
|
+
attributeDefinition: _objectSpread$$(_objectSpread$$({}, actionPayload.attribute), {}, {
|
|
4485
4485
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4486
4486
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4487
4487
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4577,7 +4577,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4577
4577
|
return {
|
|
4578
4578
|
[actionName]: {
|
|
4579
4579
|
attributeName: actionPayload.attributeName,
|
|
4580
|
-
value: _objectSpread
|
|
4580
|
+
value: _objectSpread$$(_objectSpread$$({}, actionPayload.value), {}, {
|
|
4581
4581
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4582
4582
|
})
|
|
4583
4583
|
}
|
|
@@ -4586,7 +4586,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4586
4586
|
return {
|
|
4587
4587
|
[actionName]: {
|
|
4588
4588
|
attributeName: actionPayload.attributeName,
|
|
4589
|
-
newValue: _objectSpread
|
|
4589
|
+
newValue: _objectSpread$$(_objectSpread$$({}, actionPayload.newValue), {}, {
|
|
4590
4590
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4591
4591
|
})
|
|
4592
4592
|
}
|
|
@@ -4613,7 +4613,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4613
4613
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4614
4614
|
taxCategory: actionPayload.taxCategory,
|
|
4615
4615
|
money: {
|
|
4616
|
-
[actionPayload.money.type]: _objectSpread
|
|
4616
|
+
[actionPayload.money.type]: _objectSpread$$({
|
|
4617
4617
|
centAmount: actionPayload.money.centAmount,
|
|
4618
4618
|
currencyCode: actionPayload.money.currencyCode
|
|
4619
4619
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4648,7 +4648,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4648
4648
|
case 'addAddress':
|
|
4649
4649
|
case 'changeAddress':
|
|
4650
4650
|
{
|
|
4651
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4651
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4652
4652
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4653
4653
|
_ref3$fields = _ref3.fields,
|
|
4654
4654
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4661,15 +4661,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4661
4661
|
value: _JSON$stringify__default["default"](value)
|
|
4662
4662
|
};
|
|
4663
4663
|
});
|
|
4664
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4664
|
+
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 ? {
|
|
4665
4665
|
type: {
|
|
4666
4666
|
id: actionPayload.address.custom.type.id
|
|
4667
4667
|
},
|
|
4668
4668
|
fields: customFields
|
|
4669
4669
|
} : null;
|
|
4670
4670
|
return {
|
|
4671
|
-
[actionName]: _objectSpread
|
|
4672
|
-
address: _objectSpread
|
|
4671
|
+
[actionName]: _objectSpread$$(_objectSpread$$({}, actionPayload), {}, {
|
|
4672
|
+
address: _objectSpread$$(_objectSpread$$({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4673
4673
|
custom
|
|
4674
4674
|
})
|
|
4675
4675
|
})
|
|
@@ -4715,8 +4715,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
|
|
|
4715
4715
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4716
4716
|
}, []);
|
|
4717
4717
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4718
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4719
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4718
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4719
|
+
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) {
|
|
4720
4720
|
return graphQlResponse.networkError.result.errors;
|
|
4721
4721
|
}
|
|
4722
4722
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4745,26 +4745,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4745
4745
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4746
4746
|
}
|
|
4747
4747
|
|
|
4748
|
-
function ownKeys$
|
|
4749
|
-
function _objectSpread$
|
|
4748
|
+
function ownKeys$_(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4749
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4750
4750
|
function getPriceChannelName(price) {
|
|
4751
4751
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4752
4752
|
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;
|
|
4753
4753
|
}
|
|
4754
4754
|
function getDiscountValue(price) {
|
|
4755
|
-
var _price$value, _price$value2, _price$discounted
|
|
4755
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4756
4756
|
let preciseAmount;
|
|
4757
4757
|
let fractionedAmount;
|
|
4758
4758
|
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) {
|
|
4759
4759
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
4760
|
-
} 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
|
|
4760
|
+
} 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) {
|
|
4761
4761
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4762
4762
|
}
|
|
4763
|
-
return price.discounted ? _objectSpread$
|
|
4763
|
+
return price.discounted ? _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4764
4764
|
fractionedAmount,
|
|
4765
4765
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4766
4766
|
preciseAmount
|
|
4767
|
-
}) : _objectSpread$
|
|
4767
|
+
}) : _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4768
4768
|
centAmount: 0
|
|
4769
4769
|
});
|
|
4770
4770
|
}
|
|
@@ -4772,17 +4772,17 @@ function getSelectedPrice(price) {
|
|
|
4772
4772
|
return price.discounted ? price.discounted : price;
|
|
4773
4773
|
}
|
|
4774
4774
|
function getNetUnitPrice(_ref2) {
|
|
4775
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4775
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4776
4776
|
let lineItem = _ref2.lineItem,
|
|
4777
4777
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4778
4778
|
const price = getSelectedPrice(lineItem.price);
|
|
4779
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4780
|
-
var _lineItem$shippingDet
|
|
4781
|
-
return (lineItem === null || lineItem === void 0
|
|
4779
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 || (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4780
|
+
var _lineItem$shippingDet;
|
|
4781
|
+
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__default["default"](_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;
|
|
4782
4782
|
});
|
|
4783
4783
|
|
|
4784
4784
|
// when shipping mode is multi with the same tax rate
|
|
4785
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4785
|
+
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) {
|
|
4786
4786
|
var _price$value3, _price$value4;
|
|
4787
4787
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4788
4788
|
let centAmount;
|
|
@@ -4793,7 +4793,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4793
4793
|
}
|
|
4794
4794
|
let preciseAmount;
|
|
4795
4795
|
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);
|
|
4796
|
-
return _objectSpread$
|
|
4796
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4797
4797
|
centAmount,
|
|
4798
4798
|
preciseAmount
|
|
4799
4799
|
});
|
|
@@ -4810,7 +4810,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4810
4810
|
}
|
|
4811
4811
|
let preciseAmount;
|
|
4812
4812
|
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);
|
|
4813
|
-
return _objectSpread$
|
|
4813
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4814
4814
|
centAmount,
|
|
4815
4815
|
preciseAmount
|
|
4816
4816
|
});
|
|
@@ -4822,7 +4822,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4822
4822
|
const currencyCode = price.value.currencyCode;
|
|
4823
4823
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4824
4824
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4825
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4825
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$_(_objectSpread$_({}, minPrices), {}, {
|
|
4826
4826
|
[currencyCode]: price.value
|
|
4827
4827
|
});
|
|
4828
4828
|
}
|
|
@@ -4831,8 +4831,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4831
4831
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4832
4832
|
}
|
|
4833
4833
|
|
|
4834
|
-
function ownKeys$
|
|
4835
|
-
function _objectSpread$
|
|
4834
|
+
function ownKeys$Z(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4835
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$Z(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$Z(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4836
4836
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4837
4837
|
var _context, _context4;
|
|
4838
4838
|
return {
|
|
@@ -4843,18 +4843,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4843
4843
|
key: resource.custom.type.key,
|
|
4844
4844
|
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4845
4845
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4846
|
-
var _fieldDefinition$type,
|
|
4846
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4847
4847
|
return {
|
|
4848
4848
|
name: fieldDefinition.name,
|
|
4849
4849
|
required: fieldDefinition.required,
|
|
4850
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4851
|
-
elementType: _objectSpread$
|
|
4850
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4851
|
+
elementType: _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type.elementType), {}, {
|
|
4852
4852
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4853
4853
|
key: value.key,
|
|
4854
4854
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4855
4855
|
}))
|
|
4856
4856
|
})
|
|
4857
|
-
}) : ((_fieldDefinition$
|
|
4857
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4858
4858
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4859
4859
|
key: value.key,
|
|
4860
4860
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4865,7 +4865,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4865
4865
|
})
|
|
4866
4866
|
}
|
|
4867
4867
|
},
|
|
4868
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4868
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$Z(_objectSpread$Z({}, fields), {}, {
|
|
4869
4869
|
[customField.name]: customField.value
|
|
4870
4870
|
}), {})
|
|
4871
4871
|
};
|
|
@@ -4877,7 +4877,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4877
4877
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4878
4878
|
// in either case we return null
|
|
4879
4879
|
if (!productSelection) return null;
|
|
4880
|
-
return _objectSpread$
|
|
4880
|
+
return _objectSpread$Z(_objectSpread$Z({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4881
4881
|
from: 'nameAllLocales',
|
|
4882
4882
|
to: 'name'
|
|
4883
4883
|
}])), {}, {
|
|
@@ -4900,8 +4900,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4900
4900
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4901
4901
|
};
|
|
4902
4902
|
|
|
4903
|
-
function ownKeys$
|
|
4904
|
-
function _objectSpread$
|
|
4903
|
+
function ownKeys$Y(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4904
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$Y(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$Y(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4905
4905
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4906
4906
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4907
4907
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4918,7 +4918,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4918
4918
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4919
4919
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4920
4920
|
const definitionName = definition.type.elementType.name;
|
|
4921
|
-
return _objectSpread$
|
|
4921
|
+
return _objectSpread$Y(_objectSpread$Y({}, updateAction), {}, {
|
|
4922
4922
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4923
4923
|
});
|
|
4924
4924
|
}
|
|
@@ -4992,8 +4992,8 @@ function omitSetsOfSets() {
|
|
|
4992
4992
|
|
|
4993
4993
|
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 } } } };
|
|
4994
4994
|
|
|
4995
|
-
function ownKeys$
|
|
4996
|
-
function _objectSpread$
|
|
4995
|
+
function ownKeys$X(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4996
|
+
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__default["default"](_context4 = ownKeys$X(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$X(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4997
4997
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4998
4998
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4999
4999
|
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 } } } };
|
|
@@ -5053,7 +5053,7 @@ const mapDataToProps = _ref => {
|
|
|
5053
5053
|
return {
|
|
5054
5054
|
fetchTypeDefinitionsQuery: {
|
|
5055
5055
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5056
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5056
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$X({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5057
5057
|
isImmutable: true
|
|
5058
5058
|
}), [{
|
|
5059
5059
|
from: 'labelAllLocales',
|
|
@@ -5081,12 +5081,12 @@ const handlers$2 = {
|
|
|
5081
5081
|
}
|
|
5082
5082
|
};
|
|
5083
5083
|
|
|
5084
|
-
function ownKeys$
|
|
5085
|
-
function _objectSpread$
|
|
5084
|
+
function ownKeys$W(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5085
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$W(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$W(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5086
5086
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5087
5087
|
return {
|
|
5088
5088
|
fields: customFieldsFromRestResponse.fields,
|
|
5089
|
-
type: _objectSpread$
|
|
5089
|
+
type: _objectSpread$W({
|
|
5090
5090
|
id: customFieldsFromRestResponse.type.id
|
|
5091
5091
|
}, customFieldsFromRestResponse.type.obj)
|
|
5092
5092
|
};
|
|
@@ -5100,19 +5100,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5100
5100
|
key: typeDefinition.key,
|
|
5101
5101
|
name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5102
5102
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5103
|
-
var _fieldDefinition$type,
|
|
5103
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5104
5104
|
return {
|
|
5105
5105
|
name: fieldDefinition.name,
|
|
5106
5106
|
required: fieldDefinition.required,
|
|
5107
5107
|
inputHint: fieldDefinition.inputHint,
|
|
5108
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5109
|
-
elementType: _objectSpread$
|
|
5108
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5109
|
+
elementType: _objectSpread$W(_objectSpread$W({}, fieldDefinition.type.elementType), {}, {
|
|
5110
5110
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5111
5111
|
key: value.key,
|
|
5112
5112
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5113
5113
|
}))
|
|
5114
5114
|
})
|
|
5115
|
-
}) : ((_fieldDefinition$
|
|
5115
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5116
5116
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5117
5117
|
key: value.key,
|
|
5118
5118
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5128,7 +5128,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5128
5128
|
type: {
|
|
5129
5129
|
id: formCustomFields.type.id,
|
|
5130
5130
|
typeId: 'type',
|
|
5131
|
-
obj: _objectSpread$
|
|
5131
|
+
obj: _objectSpread$W({}, formCustomFields.type)
|
|
5132
5132
|
},
|
|
5133
5133
|
fields: formCustomFields.fields
|
|
5134
5134
|
});
|
|
@@ -5136,7 +5136,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5136
5136
|
type: {
|
|
5137
5137
|
id: formCustomFields.type.id,
|
|
5138
5138
|
typeId: 'type',
|
|
5139
|
-
obj: _objectSpread$
|
|
5139
|
+
obj: _objectSpread$W({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5140
5140
|
},
|
|
5141
5141
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5142
5142
|
});
|
|
@@ -5152,7 +5152,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5152
5152
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5153
5153
|
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5154
5154
|
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 } } } };
|
|
5155
|
-
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'];
|
|
5155
|
+
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'];
|
|
5156
5156
|
const emptyTypeDefinitions = {
|
|
5157
5157
|
total: 0,
|
|
5158
5158
|
count: 0,
|
|
@@ -5210,7 +5210,7 @@ const createGraphQlOptions = ownProps => {
|
|
|
5210
5210
|
}
|
|
5211
5211
|
};
|
|
5212
5212
|
};
|
|
5213
|
-
var
|
|
5213
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics__default["default"](hoc.graphql(FetchTypeDefinitionsWithNamesQuery, {
|
|
5214
5214
|
name: 'fetchTypeDefinitionsQuery',
|
|
5215
5215
|
skip: ownProps => ownProps.isDisabled,
|
|
5216
5216
|
options: createGraphQlOptions
|
|
@@ -5267,8 +5267,8 @@ const REFERENCED_TYPES = {
|
|
|
5267
5267
|
zone: 'zone'
|
|
5268
5268
|
};
|
|
5269
5269
|
|
|
5270
|
-
function ownKeys$
|
|
5271
|
-
function _objectSpread$
|
|
5270
|
+
function ownKeys$V(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5271
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$V(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$V(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5272
5272
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5273
5273
|
let validatedValues = [];
|
|
5274
5274
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5335,8 +5335,8 @@ function validations (formValues, language, languages) {
|
|
|
5335
5335
|
var _context2;
|
|
5336
5336
|
// Collect all required and set type fields
|
|
5337
5337
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5338
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5339
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5338
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$V(_objectSpread$V({}, acc), {}, {
|
|
5339
|
+
[fieldDefinition.name]: _objectSpread$V(_objectSpread$V({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5340
5340
|
}), {});
|
|
5341
5341
|
return withoutEmptyErrorsByField(errors);
|
|
5342
5342
|
}
|
|
@@ -5363,8 +5363,8 @@ function CustomTextInput(props) {
|
|
|
5363
5363
|
}
|
|
5364
5364
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5365
5365
|
|
|
5366
|
-
function ownKeys$
|
|
5367
|
-
function _objectSpread$
|
|
5366
|
+
function ownKeys$U(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5367
|
+
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__default["default"](_context = ownKeys$U(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$U(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5368
5368
|
const getSubfieldLanguage = subfieldName => {
|
|
5369
5369
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5370
5370
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5388,7 +5388,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5388
5388
|
// as a whole.
|
|
5389
5389
|
|
|
5390
5390
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5391
|
-
const newValue = _objectSpread$
|
|
5391
|
+
const newValue = _objectSpread$U(_objectSpread$U({}, props.value), {}, {
|
|
5392
5392
|
[fieldLanguage]: rawValue
|
|
5393
5393
|
});
|
|
5394
5394
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5455,21 +5455,21 @@ function CustomNumberInput(props) {
|
|
|
5455
5455
|
}
|
|
5456
5456
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5457
5457
|
|
|
5458
|
-
function ownKeys$
|
|
5459
|
-
function _objectSpread$
|
|
5458
|
+
function ownKeys$T(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5459
|
+
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__default["default"](_context = ownKeys$T(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$T(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5460
5460
|
var styles$f = {
|
|
5461
5461
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5462
5462
|
};
|
|
5463
5463
|
const fixCurrencyCode = (value, currencies) => {
|
|
5464
5464
|
if (value.currencyCode) return value;
|
|
5465
5465
|
const firstCurrency = currencies[0];
|
|
5466
|
-
return _objectSpread$
|
|
5466
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5467
5467
|
currencyCode: firstCurrency
|
|
5468
5468
|
});
|
|
5469
5469
|
};
|
|
5470
5470
|
const fixAmount = value => {
|
|
5471
5471
|
if (!value.amount) {
|
|
5472
|
-
return _objectSpread$
|
|
5472
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5473
5473
|
amount: '0'
|
|
5474
5474
|
});
|
|
5475
5475
|
}
|
|
@@ -5511,7 +5511,7 @@ function CustomMoneyInput(props) {
|
|
|
5511
5511
|
}
|
|
5512
5512
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5513
5513
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5514
|
-
const newValue = _objectSpread$
|
|
5514
|
+
const newValue = _objectSpread$T({}, internalValue.current);
|
|
5515
5515
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5516
5516
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5517
5517
|
internalValue.current = fixedValue;
|
|
@@ -5792,7 +5792,7 @@ function ReferenceSearch(props) {
|
|
|
5792
5792
|
});
|
|
5793
5793
|
}
|
|
5794
5794
|
|
|
5795
|
-
const messages$
|
|
5795
|
+
const messages$B = reactIntl.defineMessages({
|
|
5796
5796
|
placeholder: {
|
|
5797
5797
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5798
5798
|
description: 'Placeholder for search for a category',
|
|
@@ -5825,8 +5825,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5825
5825
|
}
|
|
5826
5826
|
});
|
|
5827
5827
|
|
|
5828
|
-
function ownKeys$
|
|
5829
|
-
function _objectSpread$
|
|
5828
|
+
function ownKeys$S(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5829
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$S(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$S(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5830
5830
|
function Option$1(props) {
|
|
5831
5831
|
var _context, _context2;
|
|
5832
5832
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5838,7 +5838,7 @@ function Option$1(props) {
|
|
|
5838
5838
|
const _useIntl = reactIntl.useIntl(),
|
|
5839
5839
|
formatMessage = _useIntl.formatMessage;
|
|
5840
5840
|
const category = props.data;
|
|
5841
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5841
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$S(_objectSpread$S({}, props), {}, {
|
|
5842
5842
|
children: jsxRuntime.jsxs("div", {
|
|
5843
5843
|
"data-testid": "category-option",
|
|
5844
5844
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5849,7 +5849,7 @@ function Option$1(props) {
|
|
|
5849
5849
|
fallbackOrder: languages
|
|
5850
5850
|
})
|
|
5851
5851
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5852
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5852
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5853
5853
|
key: 'name',
|
|
5854
5854
|
locale: language,
|
|
5855
5855
|
fallbackOrder: languages
|
|
@@ -5861,14 +5861,14 @@ function Option$1(props) {
|
|
|
5861
5861
|
fallbackOrder: languages
|
|
5862
5862
|
}))
|
|
5863
5863
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5864
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5864
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5865
5865
|
})]
|
|
5866
5866
|
})
|
|
5867
5867
|
}));
|
|
5868
5868
|
}
|
|
5869
5869
|
|
|
5870
|
-
function ownKeys$
|
|
5871
|
-
function _objectSpread$
|
|
5870
|
+
function ownKeys$R(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5871
|
+
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__default["default"](_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5872
5872
|
const filterOption$1 = () => true;
|
|
5873
5873
|
function CategoryReferenceSearch(props) {
|
|
5874
5874
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5880,7 +5880,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5880
5880
|
})),
|
|
5881
5881
|
language = _useApplicationContex.language,
|
|
5882
5882
|
languages = _useApplicationContex.languages;
|
|
5883
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5883
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$R(_objectSpread$R({}, category), {}, {
|
|
5884
5884
|
value: category.id,
|
|
5885
5885
|
label: l10n.formatLocalizedString(category, {
|
|
5886
5886
|
key: 'name',
|
|
@@ -5898,7 +5898,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5898
5898
|
}), [apolloClient]);
|
|
5899
5899
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5900
5900
|
id: props.id,
|
|
5901
|
-
components: _objectSpread$
|
|
5901
|
+
components: _objectSpread$R({
|
|
5902
5902
|
Option: Option$1
|
|
5903
5903
|
}, props.components),
|
|
5904
5904
|
isClearable: props.isClearable,
|
|
@@ -5909,10 +5909,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5909
5909
|
onBlur: props.onBlur,
|
|
5910
5910
|
onChange: props.onChange,
|
|
5911
5911
|
value: props.value,
|
|
5912
|
-
placeholderLabel: formatMessage(messages$
|
|
5913
|
-
searchPromptLabel: formatMessage(messages$
|
|
5914
|
-
noResultsLabel: formatMessage(messages$
|
|
5915
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5912
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5913
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5914
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5915
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5916
5916
|
mapItemToOption: mapItemToOption,
|
|
5917
5917
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5918
5918
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5988,7 +5988,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5988
5988
|
});
|
|
5989
5989
|
}
|
|
5990
5990
|
|
|
5991
|
-
const messages$
|
|
5991
|
+
const messages$A = reactIntl.defineMessages({
|
|
5992
5992
|
placeholder: {
|
|
5993
5993
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5994
5994
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6016,8 +6016,8 @@ const messages$z = reactIntl.defineMessages({
|
|
|
6016
6016
|
}
|
|
6017
6017
|
});
|
|
6018
6018
|
|
|
6019
|
-
function ownKeys$
|
|
6020
|
-
function _objectSpread$
|
|
6019
|
+
function ownKeys$Q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6020
|
+
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__default["default"](_context = ownKeys$Q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Q(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6021
6021
|
function Option(props) {
|
|
6022
6022
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6023
6023
|
language: applicationContext.dataLocale,
|
|
@@ -6028,7 +6028,7 @@ function Option(props) {
|
|
|
6028
6028
|
const _useIntl = reactIntl.useIntl(),
|
|
6029
6029
|
formatMessage = _useIntl.formatMessage;
|
|
6030
6030
|
const cartDiscount = props.data;
|
|
6031
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6031
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
6032
6032
|
children: jsxRuntime.jsxs("div", {
|
|
6033
6033
|
"data-testid": "cart-discount-option",
|
|
6034
6034
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6039,14 +6039,14 @@ function Option(props) {
|
|
|
6039
6039
|
fallbackOrder: languages
|
|
6040
6040
|
})
|
|
6041
6041
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6042
|
-
children: [formatMessage(messages$
|
|
6042
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6043
6043
|
})]
|
|
6044
6044
|
})
|
|
6045
6045
|
}));
|
|
6046
6046
|
}
|
|
6047
6047
|
|
|
6048
|
-
function ownKeys$
|
|
6049
|
-
function _objectSpread$
|
|
6048
|
+
function ownKeys$P(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6049
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$P(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$P(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6050
6050
|
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 } } } };
|
|
6051
6051
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6052
6052
|
const filterOption = (option, text) => {
|
|
@@ -6072,7 +6072,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6072
6072
|
})),
|
|
6073
6073
|
language = _useApplicationContex.language,
|
|
6074
6074
|
languages = _useApplicationContex.languages;
|
|
6075
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6075
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$P(_objectSpread$P({}, cartDiscount), {}, {
|
|
6076
6076
|
value: cartDiscount.id,
|
|
6077
6077
|
key: cartDiscount.key,
|
|
6078
6078
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6115,10 +6115,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6115
6115
|
onBlur: props.onBlur,
|
|
6116
6116
|
onChange: props.onChange,
|
|
6117
6117
|
value: returnNullIfEmpty(props.value),
|
|
6118
|
-
placeholderLabel: formatMessage(messages$
|
|
6119
|
-
searchPromptLabel: formatMessage(messages$
|
|
6120
|
-
noResultsLabel: formatMessage(messages$
|
|
6121
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6118
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6119
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6120
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6121
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6122
6122
|
mapItemToOption: mapItemToOption,
|
|
6123
6123
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6124
6124
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6179,7 +6179,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6179
6179
|
});
|
|
6180
6180
|
}
|
|
6181
6181
|
|
|
6182
|
-
var messages$
|
|
6182
|
+
var messages$z = reactIntl.defineMessages({
|
|
6183
6183
|
noProductsFound: {
|
|
6184
6184
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6185
6185
|
description: 'The message to display when no products were found',
|
|
@@ -6268,7 +6268,7 @@ const ProductPickerInput = _ref => {
|
|
|
6268
6268
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6269
6269
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6270
6270
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6271
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6271
|
+
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 : '';
|
|
6272
6272
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6273
6273
|
max: "scale",
|
|
6274
6274
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -6278,7 +6278,7 @@ const ProductPickerInput = _ref => {
|
|
|
6278
6278
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6279
6279
|
id: name,
|
|
6280
6280
|
name: name,
|
|
6281
|
-
placeholder: formatMessage(messages$
|
|
6281
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6282
6282
|
loadOptions: loadOptionsDebounced,
|
|
6283
6283
|
defaultOptions: [],
|
|
6284
6284
|
isClearable: isClearable,
|
|
@@ -6292,7 +6292,7 @@ const ProductPickerInput = _ref => {
|
|
|
6292
6292
|
onInputChange: handleInputChange,
|
|
6293
6293
|
onBlur: onBlur,
|
|
6294
6294
|
value: currentOption.data,
|
|
6295
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6295
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6296
6296
|
hasError: hasError || isLoadingFailed
|
|
6297
6297
|
})
|
|
6298
6298
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6542,8 +6542,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6542
6542
|
}
|
|
6543
6543
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6544
6544
|
|
|
6545
|
-
function ownKeys$
|
|
6546
|
-
function _objectSpread$
|
|
6545
|
+
function ownKeys$O(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6546
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$O(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$O(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6547
6547
|
const getTypeName = type => type.name.toLowerCase();
|
|
6548
6548
|
const findLabel = (enumType, key) => {
|
|
6549
6549
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6592,7 +6592,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6592
6592
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6593
6593
|
let name = _ref2.name,
|
|
6594
6594
|
value = _ref2.value;
|
|
6595
|
-
return _objectSpread$
|
|
6595
|
+
return _objectSpread$O(_objectSpread$O({}, result), {}, {
|
|
6596
6596
|
[name]: value
|
|
6597
6597
|
});
|
|
6598
6598
|
}, {});
|
|
@@ -6676,7 +6676,7 @@ function ProductAttributeInput(props) {
|
|
|
6676
6676
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6677
6677
|
|
|
6678
6678
|
// eslint-disable-next-line import/prefer-default-export
|
|
6679
|
-
const messages$
|
|
6679
|
+
const messages$y = reactIntl.defineMessages({
|
|
6680
6680
|
aboveFifthLevelWarning: {
|
|
6681
6681
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6682
6682
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6689,23 +6689,23 @@ const messages$x = reactIntl.defineMessages({
|
|
|
6689
6689
|
}
|
|
6690
6690
|
});
|
|
6691
6691
|
|
|
6692
|
-
function ownKeys$
|
|
6693
|
-
function _objectSpread$
|
|
6692
|
+
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6693
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$N(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$N(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6694
6694
|
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 } } } };
|
|
6695
6695
|
const mapAttributeDefinition = definition => {
|
|
6696
|
-
var _context, _definition$type,
|
|
6697
|
-
return _objectSpread$
|
|
6696
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6697
|
+
return _objectSpread$N(_objectSpread$N({}, definition), {}, {
|
|
6698
6698
|
required: definition.isRequired,
|
|
6699
6699
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6700
6700
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6701
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6702
|
-
elementType: _objectSpread$
|
|
6701
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 || (_definition$type = _definition$type.elementType) === null || _definition$type === void 0 ? void 0 : _definition$type.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6702
|
+
elementType: _objectSpread$N(_objectSpread$N({}, definition.type.elementType), {}, {
|
|
6703
6703
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6704
6704
|
key: value.key,
|
|
6705
6705
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6706
6706
|
}))
|
|
6707
6707
|
})
|
|
6708
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6708
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6709
6709
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6710
6710
|
key: value.key,
|
|
6711
6711
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6746,7 +6746,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6746
6746
|
};
|
|
6747
6747
|
}
|
|
6748
6748
|
|
|
6749
|
-
var messages$
|
|
6749
|
+
var messages$x = reactIntl.defineMessages({
|
|
6750
6750
|
updateButton: {
|
|
6751
6751
|
id: 'NestedAttributes.Details.updateButton',
|
|
6752
6752
|
description: 'Update button label',
|
|
@@ -6826,14 +6826,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
6826
6826
|
|
|
6827
6827
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6828
6828
|
|
|
6829
|
-
function ownKeys$
|
|
6830
|
-
function _objectSpread$
|
|
6829
|
+
function ownKeys$M(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6830
|
+
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__default["default"](_context = ownKeys$M(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$M(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6831
6831
|
const EditButton = props => {
|
|
6832
6832
|
const _useIntl = reactIntl.useIntl(),
|
|
6833
6833
|
formatMessage = _useIntl.formatMessage;
|
|
6834
6834
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
6835
6835
|
placement: "top",
|
|
6836
|
-
title: formatMessage(messages$
|
|
6836
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6837
6837
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
6838
6838
|
label: "Edit",
|
|
6839
6839
|
isDisabled: props.isDisabled,
|
|
@@ -6849,12 +6849,12 @@ const DropChangesConfirmation = props => {
|
|
|
6849
6849
|
formatMessage = _useIntl2.formatMessage;
|
|
6850
6850
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
6851
6851
|
isOpen: props.isOpen || false,
|
|
6852
|
-
title: formatMessage(messages$
|
|
6853
|
-
labelPrimary: formatMessage(messages$
|
|
6852
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6853
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6854
6854
|
onConfirm: props.onConfirm,
|
|
6855
6855
|
onCancel: props.onCancel,
|
|
6856
6856
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6857
|
-
intlMessage: messages$
|
|
6857
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6858
6858
|
})
|
|
6859
6859
|
});
|
|
6860
6860
|
};
|
|
@@ -6879,11 +6879,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6879
6879
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
6880
6880
|
isDisabled: !formik$1.dirty,
|
|
6881
6881
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
6882
|
-
label: formatMessage(messages$
|
|
6882
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6883
6883
|
onClick: formik$1.resetForm
|
|
6884
6884
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
6885
6885
|
isDisabled: !formik$1.dirty,
|
|
6886
|
-
label: formatMessage(messages$
|
|
6886
|
+
label: formatMessage(messages$x.updateButton),
|
|
6887
6887
|
onClick: formik$1.handleSubmit
|
|
6888
6888
|
})]
|
|
6889
6889
|
}),
|
|
@@ -6912,7 +6912,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6912
6912
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
6913
6913
|
title: "",
|
|
6914
6914
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6915
|
-
intlMessage: messages$
|
|
6915
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6916
6916
|
}),
|
|
6917
6917
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
6918
6918
|
});
|
|
@@ -6924,7 +6924,7 @@ const NestedInputControls = props => {
|
|
|
6924
6924
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
6925
6925
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6926
6926
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6927
|
-
intlMessage: messages$
|
|
6927
|
+
intlMessage: messages$x.emptyProductType,
|
|
6928
6928
|
tone: "secondary"
|
|
6929
6929
|
});
|
|
6930
6930
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -6938,7 +6938,7 @@ const NestedInputControls = props => {
|
|
|
6938
6938
|
children: props.productType.name
|
|
6939
6939
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
6940
6940
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
6941
|
-
children: formatMessage(messages$
|
|
6941
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6942
6942
|
})
|
|
6943
6943
|
})]
|
|
6944
6944
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -6974,13 +6974,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6974
6974
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6975
6975
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6976
6976
|
const openNestedAttributesForm = () => {
|
|
6977
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6977
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6978
6978
|
hideSaveToolbar: true
|
|
6979
6979
|
}));
|
|
6980
6980
|
attributesForm.openModal();
|
|
6981
6981
|
};
|
|
6982
6982
|
const closeNestedAttributesForm = () => {
|
|
6983
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6983
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6984
6984
|
hideSaveToolbar: false
|
|
6985
6985
|
}));
|
|
6986
6986
|
attributesForm.closeModal();
|
|
@@ -7000,7 +7000,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7000
7000
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7001
7001
|
kind: 'success',
|
|
7002
7002
|
domain: constants.DOMAINS.SIDE,
|
|
7003
|
-
text: formatMessage(messages$
|
|
7003
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
7004
7004
|
});
|
|
7005
7005
|
setSubmitting(false);
|
|
7006
7006
|
},
|
|
@@ -7084,8 +7084,8 @@ const SetButtons = props => {
|
|
|
7084
7084
|
};
|
|
7085
7085
|
SetButtons.displayName = 'SetButtons';
|
|
7086
7086
|
|
|
7087
|
-
function ownKeys$
|
|
7088
|
-
function _objectSpread$
|
|
7087
|
+
function ownKeys$L(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7088
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$L(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$L(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7089
7089
|
const getDuplicateErrors = setValues => {
|
|
7090
7090
|
/* eslint-disable no-plusplus */
|
|
7091
7091
|
const result = [];
|
|
@@ -7142,7 +7142,7 @@ function CustomInputSet(props) {
|
|
|
7142
7142
|
touched = _useFormikContext.touched,
|
|
7143
7143
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7144
7144
|
dirty = _useFormikContext.dirty;
|
|
7145
|
-
const itemFieldDefinition = _objectSpread$
|
|
7145
|
+
const itemFieldDefinition = _objectSpread$L(_objectSpread$L({}, props.fieldDefinition), {}, {
|
|
7146
7146
|
type: props.fieldDefinition.type.elementType
|
|
7147
7147
|
});
|
|
7148
7148
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7302,7 +7302,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7302
7302
|
});
|
|
7303
7303
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7304
7304
|
|
|
7305
|
-
var messages$
|
|
7305
|
+
var messages$w = reactIntl.defineMessages({
|
|
7306
7306
|
referencedProductType: {
|
|
7307
7307
|
id: 'NestedAttributes.referencedProductType',
|
|
7308
7308
|
description: 'Product type referenced hint',
|
|
@@ -7310,10 +7310,10 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7310
7310
|
}
|
|
7311
7311
|
});
|
|
7312
7312
|
|
|
7313
|
-
function ownKeys$
|
|
7314
|
-
function _objectSpread$
|
|
7313
|
+
function ownKeys$K(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7314
|
+
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__default["default"](_context = ownKeys$K(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$K(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7315
7315
|
function ProductTypeReference(props) {
|
|
7316
|
-
const productTypeMessage = _objectSpread$
|
|
7316
|
+
const productTypeMessage = _objectSpread$K(_objectSpread$K({}, messages$w.referencedProductType), {}, {
|
|
7317
7317
|
values: {
|
|
7318
7318
|
productTypeName: props.productType.name
|
|
7319
7319
|
}
|
|
@@ -7359,9 +7359,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7359
7359
|
}
|
|
7360
7360
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7361
7361
|
|
|
7362
|
-
function ownKeys$
|
|
7363
|
-
function _objectSpread$
|
|
7364
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7362
|
+
function ownKeys$J(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7363
|
+
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__default["default"](_context = ownKeys$J(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7364
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$J(_objectSpread$J({}, result), itemErrors), {});
|
|
7365
7365
|
|
|
7366
7366
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7367
7367
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7372,15 +7372,15 @@ const CustomFieldErrors = props => {
|
|
|
7372
7372
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7373
7373
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7374
7374
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7375
|
-
intlMessage: messages$
|
|
7375
|
+
intlMessage: messages$K.required
|
|
7376
7376
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7377
|
-
intlMessage: messages$
|
|
7377
|
+
intlMessage: messages$K.unique
|
|
7378
7378
|
})]
|
|
7379
7379
|
});
|
|
7380
7380
|
};
|
|
7381
7381
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7382
7382
|
|
|
7383
|
-
var messages$
|
|
7383
|
+
var messages$v = reactIntl.defineMessages({
|
|
7384
7384
|
productReferenceLabel: {
|
|
7385
7385
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7386
7386
|
description: 'Label shown above the product picker input.',
|
|
@@ -7413,8 +7413,8 @@ var messages$u = reactIntl.defineMessages({
|
|
|
7413
7413
|
}
|
|
7414
7414
|
});
|
|
7415
7415
|
|
|
7416
|
-
function ownKeys$
|
|
7417
|
-
function _objectSpread$
|
|
7416
|
+
function ownKeys$I(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7417
|
+
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__default["default"](_context2 = ownKeys$I(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$I(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7418
7418
|
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 } } } };
|
|
7419
7419
|
const CustomFieldsLabelHint = _ref => {
|
|
7420
7420
|
var _type$name;
|
|
@@ -7444,7 +7444,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7444
7444
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7445
7445
|
size: "medium",
|
|
7446
7446
|
color: "warning"
|
|
7447
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7447
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$I({}, messages$v.cartDiscountMoreThan500))]
|
|
7448
7448
|
});
|
|
7449
7449
|
}
|
|
7450
7450
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7458,8 +7458,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7458
7458
|
formatMessage = _useIntl.formatMessage;
|
|
7459
7459
|
const _usePimStatus = usePimStatus(),
|
|
7460
7460
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7461
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7462
|
-
return formatMessage(messages$
|
|
7461
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7462
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7463
7463
|
}
|
|
7464
7464
|
|
|
7465
7465
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7475,7 +7475,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7475
7475
|
const referenceTypeId = type.referenceTypeId;
|
|
7476
7476
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7477
7477
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7478
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7478
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$v.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$v.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$v.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7479
7479
|
}
|
|
7480
7480
|
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
7481
7481
|
let name = _ref3.name,
|
|
@@ -7630,8 +7630,8 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7630
7630
|
}
|
|
7631
7631
|
});
|
|
7632
7632
|
|
|
7633
|
-
function ownKeys$
|
|
7634
|
-
function _objectSpread$
|
|
7633
|
+
function ownKeys$H(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7634
|
+
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__default["default"](_context2 = ownKeys$H(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$H(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7635
7635
|
const PRODUCT_SELECTION_TYPES = {
|
|
7636
7636
|
INCLUSION: 'individual',
|
|
7637
7637
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7645,7 +7645,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7645
7645
|
var _context;
|
|
7646
7646
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7647
7647
|
if (!ps) return undefined;
|
|
7648
|
-
return _objectSpread$
|
|
7648
|
+
return _objectSpread$H(_objectSpread$H({}, ps), {}, {
|
|
7649
7649
|
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getType(ps === null || ps === void 0 ? void 0 : ps.type), ")") : '')
|
|
7650
7650
|
});
|
|
7651
7651
|
};
|
|
@@ -7941,7 +7941,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7941
7941
|
fetchPolicy: 'network-only'
|
|
7942
7942
|
}),
|
|
7943
7943
|
data = _await$client$query.data;
|
|
7944
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7944
|
+
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 : [];
|
|
7945
7945
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7946
7946
|
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7947
7947
|
var _context2;
|
|
@@ -7996,12 +7996,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7996
7996
|
});
|
|
7997
7997
|
}
|
|
7998
7998
|
|
|
7999
|
-
function ownKeys$
|
|
8000
|
-
function _objectSpread$
|
|
7999
|
+
function ownKeys$G(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8000
|
+
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__default["default"](_context = ownKeys$G(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$G(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8001
8001
|
function TypeSelectInputOption(props) {
|
|
8002
8002
|
const data = props.data;
|
|
8003
8003
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
8004
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8004
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
8005
8005
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
8006
8006
|
scale: "xs",
|
|
8007
8007
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8016,18 +8016,18 @@ function TypeSelectInputOption(props) {
|
|
|
8016
8016
|
}));
|
|
8017
8017
|
}
|
|
8018
8018
|
|
|
8019
|
-
function ownKeys$
|
|
8020
|
-
function _objectSpread$
|
|
8019
|
+
function ownKeys$F(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8020
|
+
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__default["default"](_context = ownKeys$F(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$F(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8021
8021
|
function ProductSelectionsPicker(props) {
|
|
8022
8022
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8023
8023
|
const components = React.useMemo(() => {
|
|
8024
8024
|
return {
|
|
8025
8025
|
Option: optionInnerProps => {
|
|
8026
8026
|
if (optionInnerProps.isDisabled) {
|
|
8027
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8027
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
8028
8028
|
}
|
|
8029
8029
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8030
|
-
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$
|
|
8030
|
+
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
8031
8031
|
}
|
|
8032
8032
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8033
8033
|
optionType: props.optionType,
|
|
@@ -8039,7 +8039,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8039
8039
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8040
8040
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8041
8041
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8042
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8042
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
8043
8043
|
components: components
|
|
8044
8044
|
}))
|
|
8045
8045
|
});
|
|
@@ -8062,7 +8062,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8062
8062
|
|
|
8063
8063
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8064
8064
|
|
|
8065
|
-
var messages$
|
|
8065
|
+
var messages$u = reactIntl.defineMessages({
|
|
8066
8066
|
countriesBasicSelectPlaceholder: {
|
|
8067
8067
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8068
8068
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8090,7 +8090,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8090
8090
|
value: props.value,
|
|
8091
8091
|
isRequired: props.isRequired,
|
|
8092
8092
|
description: props.description,
|
|
8093
|
-
placeholder: intl.formatMessage(messages$
|
|
8093
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8094
8094
|
options: props.options,
|
|
8095
8095
|
onChange: props.onChange,
|
|
8096
8096
|
isDisabled: props.isDisabled,
|
|
@@ -8100,10 +8100,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8100
8100
|
});
|
|
8101
8101
|
}
|
|
8102
8102
|
|
|
8103
|
-
function ownKeys$
|
|
8104
|
-
function _objectSpread$
|
|
8103
|
+
function ownKeys$E(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8104
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$E(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$E(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8105
8105
|
const emptyCountryOption = intl => [{
|
|
8106
|
-
label: intl.formatMessage(messages$
|
|
8106
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8107
8107
|
value: undefined,
|
|
8108
8108
|
isDisabled: true
|
|
8109
8109
|
}];
|
|
@@ -8128,7 +8128,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8128
8128
|
const onOptionChange = event => {
|
|
8129
8129
|
const countries = event.target.value;
|
|
8130
8130
|
props.onChange({
|
|
8131
|
-
target: _objectSpread$
|
|
8131
|
+
target: _objectSpread$E(_objectSpread$E({}, event.target), {}, {
|
|
8132
8132
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8133
8133
|
var _country$value;
|
|
8134
8134
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8149,7 +8149,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8149
8149
|
var _context3;
|
|
8150
8150
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8151
8151
|
}),
|
|
8152
|
-
placeholder: intl.formatMessage(messages$
|
|
8152
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8153
8153
|
loadOptions: handleLoadOptions,
|
|
8154
8154
|
onChange: onOptionChange,
|
|
8155
8155
|
isDisabled: props.isDisabled,
|
|
@@ -8159,13 +8159,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8159
8159
|
});
|
|
8160
8160
|
}
|
|
8161
8161
|
|
|
8162
|
-
function ownKeys$
|
|
8163
|
-
function _objectSpread$
|
|
8162
|
+
function ownKeys$D(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8163
|
+
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__default["default"](_context = ownKeys$D(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$D(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8164
8164
|
function CountriesPicker(props) {
|
|
8165
8165
|
var _props$options;
|
|
8166
8166
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8167
8167
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8168
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8168
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$D({}, props))
|
|
8169
8169
|
});
|
|
8170
8170
|
}
|
|
8171
8171
|
CountriesPicker.defaultProps = {
|
|
@@ -8175,7 +8175,7 @@ CountriesPicker.defaultProps = {
|
|
|
8175
8175
|
hasWarning: false
|
|
8176
8176
|
};
|
|
8177
8177
|
|
|
8178
|
-
var messages$
|
|
8178
|
+
var messages$t = reactIntl.defineMessages({
|
|
8179
8179
|
noCustomerGroupsFound: {
|
|
8180
8180
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8181
8181
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8266,8 +8266,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8266
8266
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8267
8267
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8268
8268
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8269
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8270
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8269
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8270
|
+
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 : '';
|
|
8271
8271
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8272
8272
|
max: "scale",
|
|
8273
8273
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -8277,7 +8277,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8277
8277
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8278
8278
|
id: name,
|
|
8279
8279
|
name: name,
|
|
8280
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8280
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8281
8281
|
loadOptions: loadOptionsDebounced,
|
|
8282
8282
|
defaultOptions: true,
|
|
8283
8283
|
showOptionGroupDivider: true,
|
|
@@ -8347,7 +8347,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8347
8347
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8348
8348
|
};
|
|
8349
8349
|
|
|
8350
|
-
var messages$
|
|
8350
|
+
var messages$s = reactIntl.defineMessages({
|
|
8351
8351
|
basicSelectInputPlaceholder: {
|
|
8352
8352
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8353
8353
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8373,6 +8373,11 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8373
8373
|
description: 'The message shown in search select input when matches are found',
|
|
8374
8374
|
defaultMessage: 'No matches found for your search term'
|
|
8375
8375
|
},
|
|
8376
|
+
searchSelectInputNoValueMessage: {
|
|
8377
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8378
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8379
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8380
|
+
},
|
|
8376
8381
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8377
8382
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8378
8383
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8380,8 +8385,8 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8380
8385
|
}
|
|
8381
8386
|
});
|
|
8382
8387
|
|
|
8383
|
-
function ownKeys$
|
|
8384
|
-
function _objectSpread$
|
|
8388
|
+
function ownKeys$C(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8389
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$C(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$C(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8385
8390
|
const hasErrors$2 = errors => {
|
|
8386
8391
|
var _context;
|
|
8387
8392
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8406,7 +8411,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8406
8411
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8407
8412
|
};
|
|
8408
8413
|
const emptyStoreOption = intl => [{
|
|
8409
|
-
label: intl.formatMessage(messages$
|
|
8414
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8410
8415
|
value: undefined,
|
|
8411
8416
|
isDisabled: true
|
|
8412
8417
|
}];
|
|
@@ -8453,10 +8458,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8453
8458
|
};
|
|
8454
8459
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8455
8460
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8456
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8461
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$C(_objectSpread$C({
|
|
8457
8462
|
id: props.id,
|
|
8458
8463
|
name: props.name,
|
|
8459
|
-
placeholder: intl.formatMessage(messages$
|
|
8464
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8460
8465
|
horizontalConstraint: props.horizontalConstraint,
|
|
8461
8466
|
loadOptions: handleLoadOptions,
|
|
8462
8467
|
defaultOptions: true,
|
|
@@ -8496,8 +8501,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8496
8501
|
shouldFetchProductSelections: false
|
|
8497
8502
|
};
|
|
8498
8503
|
|
|
8499
|
-
function ownKeys$
|
|
8500
|
-
function _objectSpread$
|
|
8504
|
+
function ownKeys$B(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8505
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$B(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$B(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8501
8506
|
const hasErrors$1 = errors => {
|
|
8502
8507
|
var _context;
|
|
8503
8508
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8545,10 +8550,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8545
8550
|
};
|
|
8546
8551
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8547
8552
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8548
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8553
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$B(_objectSpread$B({
|
|
8549
8554
|
id: props.id,
|
|
8550
8555
|
name: props.name,
|
|
8551
|
-
placeholder: intl.formatMessage(messages$
|
|
8556
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8552
8557
|
horizontalConstraint: props.horizontalConstraint,
|
|
8553
8558
|
options: mappedStoresListOptions,
|
|
8554
8559
|
isMulti: props.isMulti,
|
|
@@ -8641,8 +8646,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8641
8646
|
};
|
|
8642
8647
|
};
|
|
8643
8648
|
|
|
8644
|
-
function ownKeys$
|
|
8645
|
-
function _objectSpread$
|
|
8649
|
+
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8650
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$A(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$A(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8646
8651
|
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 } } } };
|
|
8647
8652
|
const hasErrors = errors => {
|
|
8648
8653
|
var _context;
|
|
@@ -8744,10 +8749,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8744
8749
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8745
8750
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8746
8751
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8747
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8752
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8748
8753
|
id: props.id,
|
|
8749
8754
|
name: props.name,
|
|
8750
|
-
placeholder: intl.formatMessage(messages$
|
|
8755
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8751
8756
|
horizontalConstraint: props.horizontalConstraint,
|
|
8752
8757
|
loadOptions: loadOptionsDebounced,
|
|
8753
8758
|
defaultOptions: false,
|
|
@@ -8761,8 +8766,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8761
8766
|
}),
|
|
8762
8767
|
onChange: props.onChange,
|
|
8763
8768
|
onBlur: props.onBlur,
|
|
8764
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8765
|
-
noOptionsMessage:
|
|
8769
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8770
|
+
noOptionsMessage: _ref4 => {
|
|
8771
|
+
let inputValue = _ref4.inputValue;
|
|
8772
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8773
|
+
},
|
|
8766
8774
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8767
8775
|
isReadOnly: props.isReadOnly,
|
|
8768
8776
|
isClearable: props.isClearable,
|
|
@@ -8790,8 +8798,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8790
8798
|
shouldFetchProductSelections: false
|
|
8791
8799
|
};
|
|
8792
8800
|
|
|
8793
|
-
function ownKeys$
|
|
8794
|
-
function _objectSpread$
|
|
8801
|
+
function ownKeys$z(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8802
|
+
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__default["default"](_context = ownKeys$z(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$z(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8795
8803
|
const StoreSelectInput = props => {
|
|
8796
8804
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8797
8805
|
const components = React.useMemo(() => {
|
|
@@ -8799,7 +8807,7 @@ const StoreSelectInput = props => {
|
|
|
8799
8807
|
// eslint-disable-next-line react/display-name
|
|
8800
8808
|
Option: optionInnerProps => {
|
|
8801
8809
|
if (optionInnerProps.isDisabled) {
|
|
8802
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8810
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$z({}, optionInnerProps));
|
|
8803
8811
|
}
|
|
8804
8812
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8805
8813
|
optionType: props.optionType,
|
|
@@ -8810,7 +8818,7 @@ const StoreSelectInput = props => {
|
|
|
8810
8818
|
}, [props.optionType]);
|
|
8811
8819
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8812
8820
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8813
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8821
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$z(_objectSpread$z({
|
|
8814
8822
|
projectKey: props.projectKey,
|
|
8815
8823
|
id: props.id,
|
|
8816
8824
|
name: props.name,
|
|
@@ -8865,7 +8873,7 @@ const businessRoleConstants = {
|
|
|
8865
8873
|
|
|
8866
8874
|
const businessRoleKeys = _Object$values__default["default"](businessRoleConstants);
|
|
8867
8875
|
|
|
8868
|
-
var messages$
|
|
8876
|
+
var messages$r = reactIntl.defineMessages({
|
|
8869
8877
|
ExecutiveManagement: {
|
|
8870
8878
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8871
8879
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8923,7 +8931,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8923
8931
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
8924
8932
|
}
|
|
8925
8933
|
|
|
8926
|
-
const messages$
|
|
8934
|
+
const messages$q = reactIntl.defineMessages({
|
|
8927
8935
|
inputFieldError: {
|
|
8928
8936
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8929
8937
|
description: 'Error message for empty input field ',
|
|
@@ -8944,14 +8952,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8944
8952
|
if (validateSingleFilter({
|
|
8945
8953
|
value
|
|
8946
8954
|
})) {
|
|
8947
|
-
return intl.formatMessage(messages$
|
|
8955
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8948
8956
|
}
|
|
8949
8957
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8950
8958
|
value: value.currencyCode
|
|
8951
8959
|
}) || validateSingleFilter({
|
|
8952
8960
|
value: value.amount
|
|
8953
8961
|
}))) {
|
|
8954
|
-
return intl.formatMessage(messages$
|
|
8962
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8955
8963
|
}
|
|
8956
8964
|
return null;
|
|
8957
8965
|
};
|
|
@@ -8959,7 +8967,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8959
8967
|
let value = _ref.value;
|
|
8960
8968
|
if (!value || !value.type) {
|
|
8961
8969
|
return {
|
|
8962
|
-
type: intl.formatMessage(messages$
|
|
8970
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8963
8971
|
};
|
|
8964
8972
|
}
|
|
8965
8973
|
const typeName = value.type.name;
|
|
@@ -8967,7 +8975,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8967
8975
|
const filterValue = value.value;
|
|
8968
8976
|
if (hasOption && !value.option) {
|
|
8969
8977
|
return {
|
|
8970
|
-
option: intl.formatMessage(messages$
|
|
8978
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8971
8979
|
};
|
|
8972
8980
|
}
|
|
8973
8981
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8986,7 +8994,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8986
8994
|
} : null;
|
|
8987
8995
|
}
|
|
8988
8996
|
|
|
8989
|
-
const messages$
|
|
8997
|
+
const messages$p = reactIntl.defineMessages({
|
|
8990
8998
|
rangeMissingValue: {
|
|
8991
8999
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8992
9000
|
description: 'error message if missing a value in a range',
|
|
@@ -9011,25 +9019,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
9011
9019
|
if (validateSingleFilter({
|
|
9012
9020
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
9013
9021
|
})) return {
|
|
9014
|
-
from: intl.formatMessage(messages$
|
|
9022
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9015
9023
|
};
|
|
9016
9024
|
if (validateSingleFilter({
|
|
9017
9025
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
9018
9026
|
})) return {
|
|
9019
|
-
to: intl.formatMessage(messages$
|
|
9027
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9020
9028
|
};
|
|
9021
9029
|
if (moment__default$1["default"](value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
9022
|
-
from: intl.formatMessage(messages$
|
|
9030
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
9023
9031
|
};
|
|
9024
9032
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9025
9033
|
if (validateSingleFilter({
|
|
9026
9034
|
value
|
|
9027
|
-
})) return intl.formatMessage(messages$
|
|
9035
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
9028
9036
|
}
|
|
9029
9037
|
return null;
|
|
9030
9038
|
}
|
|
9031
9039
|
|
|
9032
|
-
const messages$
|
|
9040
|
+
const messages$o = reactIntl.defineMessages({
|
|
9033
9041
|
rangeMissingValue: {
|
|
9034
9042
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9035
9043
|
description: 'error message if missing a value in a range',
|
|
@@ -9048,30 +9056,30 @@ function validateFilter(_ref, intl) {
|
|
|
9048
9056
|
_ref$allowFloat = _ref.allowFloat,
|
|
9049
9057
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9050
9058
|
if (type !== 'range') {
|
|
9051
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9059
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
9052
9060
|
return null;
|
|
9053
9061
|
}
|
|
9054
9062
|
|
|
9055
9063
|
// only range types from here
|
|
9056
9064
|
|
|
9057
9065
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9058
|
-
from: intl.formatMessage(messages$
|
|
9066
|
+
from: intl.formatMessage(messages$K.integer)
|
|
9059
9067
|
};
|
|
9060
9068
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9061
|
-
to: intl.formatMessage(messages$
|
|
9069
|
+
to: intl.formatMessage(messages$K.integer)
|
|
9062
9070
|
};
|
|
9063
9071
|
if (validateSingleFilter({
|
|
9064
9072
|
value: value.from
|
|
9065
9073
|
})) return {
|
|
9066
|
-
from: intl.formatMessage(messages$
|
|
9074
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9067
9075
|
};
|
|
9068
9076
|
if (validateSingleFilter({
|
|
9069
9077
|
value: value.to
|
|
9070
9078
|
})) return {
|
|
9071
|
-
to: intl.formatMessage(messages$
|
|
9079
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9072
9080
|
};
|
|
9073
9081
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9074
|
-
from: intl.formatMessage(messages$
|
|
9082
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9075
9083
|
};
|
|
9076
9084
|
return null;
|
|
9077
9085
|
}
|
|
@@ -9365,10 +9373,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9365
9373
|
carts: 'carts'
|
|
9366
9374
|
};
|
|
9367
9375
|
|
|
9368
|
-
function ownKeys$
|
|
9369
|
-
function _objectSpread$
|
|
9376
|
+
function ownKeys$y(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9377
|
+
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__default["default"](_context = ownKeys$y(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$y(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9370
9378
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9371
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9379
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$y({
|
|
9372
9380
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9373
9381
|
}, previousIncludedLimits), {});
|
|
9374
9382
|
|
|
@@ -9430,7 +9438,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9430
9438
|
};
|
|
9431
9439
|
};
|
|
9432
9440
|
|
|
9433
|
-
var messages$
|
|
9441
|
+
var messages$n = reactIntl.defineMessages({
|
|
9434
9442
|
shippingMethods: {
|
|
9435
9443
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9436
9444
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9458,8 +9466,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9458
9466
|
}
|
|
9459
9467
|
});
|
|
9460
9468
|
|
|
9461
|
-
function ownKeys$
|
|
9462
|
-
function _objectSpread$
|
|
9469
|
+
function ownKeys$x(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9470
|
+
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__default["default"](_context = ownKeys$x(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$x(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9463
9471
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9464
9472
|
isExternal: true,
|
|
9465
9473
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9470,7 +9478,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9470
9478
|
limit = _ref.limit;
|
|
9471
9479
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9472
9480
|
type: "warning",
|
|
9473
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9481
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$n[resource]), {}, {
|
|
9474
9482
|
values: {
|
|
9475
9483
|
limit,
|
|
9476
9484
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9483,7 +9491,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9483
9491
|
};
|
|
9484
9492
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9485
9493
|
|
|
9486
|
-
var messages$
|
|
9494
|
+
var messages$m = reactIntl.defineMessages({
|
|
9487
9495
|
shippingMethods: {
|
|
9488
9496
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9489
9497
|
description: 'error message about platform limit exceeded',
|
|
@@ -9511,8 +9519,8 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9511
9519
|
}
|
|
9512
9520
|
});
|
|
9513
9521
|
|
|
9514
|
-
function ownKeys$
|
|
9515
|
-
function _objectSpread$
|
|
9522
|
+
function ownKeys$w(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9523
|
+
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__default["default"](_context = ownKeys$w(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$w(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9516
9524
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9517
9525
|
isExternal: true,
|
|
9518
9526
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9523,7 +9531,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9523
9531
|
limit = _ref.limit;
|
|
9524
9532
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9525
9533
|
type: "error",
|
|
9526
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9534
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w(_objectSpread$w({}, messages$m[resource]), {}, {
|
|
9527
9535
|
values: {
|
|
9528
9536
|
limit,
|
|
9529
9537
|
customersupport: getCustomerSupportLink
|
|
@@ -9541,8 +9549,8 @@ const Notifications = {
|
|
|
9541
9549
|
Error: PlatformLimitErrorNotification
|
|
9542
9550
|
};
|
|
9543
9551
|
|
|
9544
|
-
function ownKeys$
|
|
9545
|
-
function _objectSpread$
|
|
9552
|
+
function ownKeys$v(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9553
|
+
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__default["default"](_context = ownKeys$v(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$v(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9546
9554
|
const PlatformLimitsStatusText = _ref => {
|
|
9547
9555
|
let intlMessage = _ref.intlMessage,
|
|
9548
9556
|
children = _ref.children;
|
|
@@ -9551,7 +9559,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9551
9559
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9552
9560
|
size: "xs",
|
|
9553
9561
|
children: [jsxRuntime.jsx("span", {
|
|
9554
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9562
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$v({}, intlMessage))
|
|
9555
9563
|
}), jsxRuntime.jsx("span", {
|
|
9556
9564
|
children: children
|
|
9557
9565
|
})]
|
|
@@ -9652,7 +9660,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9652
9660
|
};
|
|
9653
9661
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9654
9662
|
|
|
9655
|
-
var messages$
|
|
9663
|
+
var messages$l = reactIntl.defineMessages({
|
|
9656
9664
|
shippingMethodsPlatformLimitReached: {
|
|
9657
9665
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9658
9666
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9660,17 +9668,17 @@ var messages$k = reactIntl.defineMessages({
|
|
|
9660
9668
|
}
|
|
9661
9669
|
});
|
|
9662
9670
|
|
|
9663
|
-
function ownKeys$
|
|
9664
|
-
function _objectSpread$
|
|
9671
|
+
function ownKeys$u(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9672
|
+
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__default["default"](_context = ownKeys$u(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$u(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9665
9673
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9666
9674
|
const intl = reactIntl.useIntl();
|
|
9667
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9668
|
-
title: intl.formatMessage(messages$
|
|
9675
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
9676
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9669
9677
|
}));
|
|
9670
9678
|
};
|
|
9671
9679
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9672
9680
|
|
|
9673
|
-
var messages$
|
|
9681
|
+
var messages$k = reactIntl.defineMessages({
|
|
9674
9682
|
shippingMethodsStatus: {
|
|
9675
9683
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9676
9684
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9679,15 +9687,15 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9679
9687
|
});
|
|
9680
9688
|
|
|
9681
9689
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9682
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9690
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9683
9691
|
let total = _ref.total;
|
|
9684
9692
|
const intl = reactIntl.useIntl();
|
|
9685
9693
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9686
9694
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9687
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9688
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9695
|
+
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;
|
|
9696
|
+
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;
|
|
9689
9697
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9690
|
-
intlMessage: messages$
|
|
9698
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9691
9699
|
children: getPlatformLimitsStatus({
|
|
9692
9700
|
limit,
|
|
9693
9701
|
current,
|
|
@@ -9718,15 +9726,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9718
9726
|
};
|
|
9719
9727
|
};
|
|
9720
9728
|
|
|
9721
|
-
function ownKeys$
|
|
9722
|
-
function _objectSpread$
|
|
9729
|
+
function ownKeys$t(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9730
|
+
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__default["default"](_context = ownKeys$t(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$t(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9723
9731
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9724
9732
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9725
9733
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9726
9734
|
const shippingMethodsProps = {
|
|
9727
9735
|
platformLimits: shippingMethodsPlatformLimits
|
|
9728
9736
|
};
|
|
9729
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9737
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$t(_objectSpread$t({}, props), shippingMethodsProps));
|
|
9730
9738
|
};
|
|
9731
9739
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9732
9740
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9799,7 +9807,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9799
9807
|
};
|
|
9800
9808
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9801
9809
|
|
|
9802
|
-
var messages$
|
|
9810
|
+
var messages$j = reactIntl.defineMessages({
|
|
9803
9811
|
taxCategoriesPlatformLimitReached: {
|
|
9804
9812
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9805
9813
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9807,17 +9815,17 @@ var messages$i = reactIntl.defineMessages({
|
|
|
9807
9815
|
}
|
|
9808
9816
|
});
|
|
9809
9817
|
|
|
9810
|
-
function ownKeys$
|
|
9811
|
-
function _objectSpread$
|
|
9818
|
+
function ownKeys$s(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9819
|
+
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__default["default"](_context = ownKeys$s(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$s(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9812
9820
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9813
9821
|
const intl = reactIntl.useIntl();
|
|
9814
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9815
|
-
title: intl.formatMessage(messages$
|
|
9822
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9823
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9816
9824
|
}));
|
|
9817
9825
|
};
|
|
9818
9826
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9819
9827
|
|
|
9820
|
-
var messages$
|
|
9828
|
+
var messages$i = reactIntl.defineMessages({
|
|
9821
9829
|
taxCategoriesStatus: {
|
|
9822
9830
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9823
9831
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9826,15 +9834,15 @@ var messages$h = reactIntl.defineMessages({
|
|
|
9826
9834
|
});
|
|
9827
9835
|
|
|
9828
9836
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9829
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9837
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9830
9838
|
let total = _ref.total;
|
|
9831
9839
|
const intl = reactIntl.useIntl();
|
|
9832
9840
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9833
9841
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9834
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9835
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9842
|
+
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;
|
|
9843
|
+
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;
|
|
9836
9844
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9837
|
-
intlMessage: messages$
|
|
9845
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9838
9846
|
children: getPlatformLimitsStatus({
|
|
9839
9847
|
limit,
|
|
9840
9848
|
current,
|
|
@@ -9865,15 +9873,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9865
9873
|
};
|
|
9866
9874
|
};
|
|
9867
9875
|
|
|
9868
|
-
function ownKeys$
|
|
9869
|
-
function _objectSpread$
|
|
9876
|
+
function ownKeys$r(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9877
|
+
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__default["default"](_context = ownKeys$r(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$r(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9870
9878
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9871
9879
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9872
9880
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9873
9881
|
const taxCategoriesProps = {
|
|
9874
9882
|
platformLimits: taxCategoriesPlatformLimits
|
|
9875
9883
|
};
|
|
9876
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9884
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), taxCategoriesProps));
|
|
9877
9885
|
};
|
|
9878
9886
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9879
9887
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9946,7 +9954,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9946
9954
|
};
|
|
9947
9955
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9948
9956
|
|
|
9949
|
-
var messages$
|
|
9957
|
+
var messages$h = reactIntl.defineMessages({
|
|
9950
9958
|
zonesPlatformLimitReached: {
|
|
9951
9959
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9952
9960
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9954,17 +9962,17 @@ var messages$g = reactIntl.defineMessages({
|
|
|
9954
9962
|
}
|
|
9955
9963
|
});
|
|
9956
9964
|
|
|
9957
|
-
function ownKeys$
|
|
9958
|
-
function _objectSpread$
|
|
9965
|
+
function ownKeys$q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9966
|
+
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__default["default"](_context = ownKeys$q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$q(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9959
9967
|
const PlatformLimitsZonesTooltip = props => {
|
|
9960
9968
|
const intl = reactIntl.useIntl();
|
|
9961
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9962
|
-
title: intl.formatMessage(messages$
|
|
9969
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9970
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9963
9971
|
}));
|
|
9964
9972
|
};
|
|
9965
9973
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9966
9974
|
|
|
9967
|
-
var messages$
|
|
9975
|
+
var messages$g = reactIntl.defineMessages({
|
|
9968
9976
|
zonesStatus: {
|
|
9969
9977
|
id: 'PlatformLimits.Status.zones',
|
|
9970
9978
|
description: 'The message for zones platform limit values',
|
|
@@ -9973,15 +9981,15 @@ var messages$f = reactIntl.defineMessages({
|
|
|
9973
9981
|
});
|
|
9974
9982
|
|
|
9975
9983
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9976
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
9984
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9977
9985
|
let total = _ref.total;
|
|
9978
9986
|
const intl = reactIntl.useIntl();
|
|
9979
9987
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9980
9988
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9981
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9982
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9989
|
+
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;
|
|
9990
|
+
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;
|
|
9983
9991
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9984
|
-
intlMessage: messages$
|
|
9992
|
+
intlMessage: messages$g.zonesStatus,
|
|
9985
9993
|
children: getPlatformLimitsStatus({
|
|
9986
9994
|
limit,
|
|
9987
9995
|
current,
|
|
@@ -10012,15 +10020,15 @@ const useZonesLimits = () => {
|
|
|
10012
10020
|
};
|
|
10013
10021
|
};
|
|
10014
10022
|
|
|
10015
|
-
function ownKeys$
|
|
10016
|
-
function _objectSpread$
|
|
10023
|
+
function ownKeys$p(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10024
|
+
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__default["default"](_context = ownKeys$p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$p(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10017
10025
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
10018
10026
|
const WithZonesPlatformLimits = props => {
|
|
10019
10027
|
const zonesPlatformLimits = useZonesLimits();
|
|
10020
10028
|
const zonesProps = {
|
|
10021
10029
|
platformLimits: zonesPlatformLimits
|
|
10022
10030
|
};
|
|
10023
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10031
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), zonesProps));
|
|
10024
10032
|
};
|
|
10025
10033
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10026
10034
|
return WithZonesPlatformLimits;
|
|
@@ -10106,7 +10114,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10106
10114
|
};
|
|
10107
10115
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10108
10116
|
|
|
10109
|
-
var messages$
|
|
10117
|
+
var messages$f = reactIntl.defineMessages({
|
|
10110
10118
|
customersPlatformLimitReached: {
|
|
10111
10119
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10112
10120
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10114,17 +10122,17 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10114
10122
|
}
|
|
10115
10123
|
});
|
|
10116
10124
|
|
|
10117
|
-
function ownKeys$
|
|
10118
|
-
function _objectSpread$
|
|
10125
|
+
function ownKeys$o(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10126
|
+
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__default["default"](_context = ownKeys$o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$o(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10119
10127
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10120
10128
|
const intl = reactIntl.useIntl();
|
|
10121
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10122
|
-
title: intl.formatMessage(messages$
|
|
10129
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
10130
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10123
10131
|
}));
|
|
10124
10132
|
};
|
|
10125
10133
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10126
10134
|
|
|
10127
|
-
var messages$
|
|
10135
|
+
var messages$e = reactIntl.defineMessages({
|
|
10128
10136
|
customersStatus: {
|
|
10129
10137
|
id: 'PlatformLimits.Status.customers',
|
|
10130
10138
|
description: 'The message for customers platform limit values',
|
|
@@ -10132,8 +10140,8 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10132
10140
|
}
|
|
10133
10141
|
});
|
|
10134
10142
|
|
|
10135
|
-
function ownKeys$
|
|
10136
|
-
function _objectSpread$
|
|
10143
|
+
function ownKeys$n(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10144
|
+
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__default["default"](_context = ownKeys$n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$n(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10137
10145
|
var styles$b = {
|
|
10138
10146
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10139
10147
|
};
|
|
@@ -10153,7 +10161,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10153
10161
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10154
10162
|
tone: "secondary",
|
|
10155
10163
|
isInline: true,
|
|
10156
|
-
intlMessage: _objectSpread$
|
|
10164
|
+
intlMessage: _objectSpread$n(_objectSpread$n({}, messages$e.customersStatus), {}, {
|
|
10157
10165
|
values: {
|
|
10158
10166
|
current: intl.formatNumber(current),
|
|
10159
10167
|
limit: intl.formatNumber(limit)
|
|
@@ -10164,7 +10172,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10164
10172
|
};
|
|
10165
10173
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10166
10174
|
|
|
10167
|
-
var messages$
|
|
10175
|
+
var messages$d = reactIntl.defineMessages({
|
|
10168
10176
|
title: {
|
|
10169
10177
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10170
10178
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10177,10 +10185,10 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10177
10185
|
}
|
|
10178
10186
|
});
|
|
10179
10187
|
|
|
10180
|
-
function ownKeys$
|
|
10181
|
-
function _objectSpread$
|
|
10188
|
+
function ownKeys$m(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10189
|
+
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__default["default"](_context = ownKeys$m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$m(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10182
10190
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10183
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10191
|
+
return jsxRuntime.jsxs("svg", _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10184
10192
|
children: [jsxRuntime.jsx("defs", {
|
|
10185
10193
|
children: jsxRuntime.jsx("path", {
|
|
10186
10194
|
id: "a",
|
|
@@ -10288,7 +10296,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10288
10296
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10289
10297
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10290
10298
|
onClose: onClose,
|
|
10291
|
-
title: intl.formatMessage(messages$
|
|
10299
|
+
title: intl.formatMessage(messages$d.title),
|
|
10292
10300
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10293
10301
|
scale: "m",
|
|
10294
10302
|
alignItems: "center",
|
|
@@ -10297,7 +10305,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10297
10305
|
alignItems: "center",
|
|
10298
10306
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10299
10307
|
onClick: onClose,
|
|
10300
|
-
label: intl.formatMessage(messages$
|
|
10308
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10301
10309
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10302
10310
|
size: "medium",
|
|
10303
10311
|
color: "primary"
|
|
@@ -10352,15 +10360,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10352
10360
|
};
|
|
10353
10361
|
};
|
|
10354
10362
|
|
|
10355
|
-
function ownKeys$
|
|
10356
|
-
function _objectSpread$
|
|
10363
|
+
function ownKeys$l(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10364
|
+
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__default["default"](_context = ownKeys$l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$l(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10357
10365
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10358
10366
|
const WithCustomersPlatformLimits = props => {
|
|
10359
10367
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10360
10368
|
const customersProps = {
|
|
10361
10369
|
platformLimits: CustomersPlatformLimits
|
|
10362
10370
|
};
|
|
10363
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10371
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$l(_objectSpread$l({}, props), customersProps));
|
|
10364
10372
|
};
|
|
10365
10373
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10366
10374
|
return WithCustomersPlatformLimits;
|
|
@@ -10446,7 +10454,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10446
10454
|
};
|
|
10447
10455
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10448
10456
|
|
|
10449
|
-
var messages$
|
|
10457
|
+
var messages$c = reactIntl.defineMessages({
|
|
10450
10458
|
customerGroupsPlatformLimitReached: {
|
|
10451
10459
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10452
10460
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10454,17 +10462,17 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10454
10462
|
}
|
|
10455
10463
|
});
|
|
10456
10464
|
|
|
10457
|
-
function ownKeys$
|
|
10458
|
-
function _objectSpread$
|
|
10465
|
+
function ownKeys$k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10466
|
+
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__default["default"](_context = ownKeys$k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10459
10467
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10460
10468
|
const intl = reactIntl.useIntl();
|
|
10461
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10462
|
-
title: intl.formatMessage(messages$
|
|
10469
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10470
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10463
10471
|
}));
|
|
10464
10472
|
};
|
|
10465
10473
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10466
10474
|
|
|
10467
|
-
var messages$
|
|
10475
|
+
var messages$b = reactIntl.defineMessages({
|
|
10468
10476
|
customerGroupsStatus: {
|
|
10469
10477
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10470
10478
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10472,8 +10480,8 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10472
10480
|
}
|
|
10473
10481
|
});
|
|
10474
10482
|
|
|
10475
|
-
function ownKeys$
|
|
10476
|
-
function _objectSpread$
|
|
10483
|
+
function ownKeys$j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10484
|
+
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__default["default"](_context = ownKeys$j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10477
10485
|
var styles$9 = {
|
|
10478
10486
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10479
10487
|
};
|
|
@@ -10493,7 +10501,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10493
10501
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10494
10502
|
tone: "secondary",
|
|
10495
10503
|
isInline: true,
|
|
10496
|
-
intlMessage: _objectSpread$
|
|
10504
|
+
intlMessage: _objectSpread$j(_objectSpread$j({}, messages$b.customerGroupsStatus), {}, {
|
|
10497
10505
|
values: {
|
|
10498
10506
|
current: intl.formatNumber(current),
|
|
10499
10507
|
limit: intl.formatNumber(limit)
|
|
@@ -10504,7 +10512,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10504
10512
|
};
|
|
10505
10513
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10506
10514
|
|
|
10507
|
-
var messages$
|
|
10515
|
+
var messages$a = reactIntl.defineMessages({
|
|
10508
10516
|
title: {
|
|
10509
10517
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10510
10518
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10517,10 +10525,10 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
10517
10525
|
}
|
|
10518
10526
|
});
|
|
10519
10527
|
|
|
10520
|
-
function ownKeys$
|
|
10521
|
-
function _objectSpread$
|
|
10528
|
+
function ownKeys$i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10529
|
+
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__default["default"](_context = ownKeys$i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10522
10530
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10523
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10531
|
+
return jsxRuntime.jsxs("svg", _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10524
10532
|
children: [jsxRuntime.jsx("defs", {
|
|
10525
10533
|
children: jsxRuntime.jsx("path", {
|
|
10526
10534
|
id: "a",
|
|
@@ -10628,7 +10636,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10628
10636
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10629
10637
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10630
10638
|
onClose: onClose,
|
|
10631
|
-
title: intl.formatMessage(messages$
|
|
10639
|
+
title: intl.formatMessage(messages$a.title),
|
|
10632
10640
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10633
10641
|
scale: "m",
|
|
10634
10642
|
alignItems: "center",
|
|
@@ -10637,7 +10645,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10637
10645
|
alignItems: "center",
|
|
10638
10646
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10639
10647
|
onClick: onClose,
|
|
10640
|
-
label: intl.formatMessage(messages$
|
|
10648
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10641
10649
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10642
10650
|
size: "medium",
|
|
10643
10651
|
color: "primary"
|
|
@@ -10692,15 +10700,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10692
10700
|
};
|
|
10693
10701
|
};
|
|
10694
10702
|
|
|
10695
|
-
function ownKeys$
|
|
10696
|
-
function _objectSpread$
|
|
10703
|
+
function ownKeys$h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10704
|
+
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__default["default"](_context = ownKeys$h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10697
10705
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10698
10706
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10699
10707
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10700
10708
|
const customersProps = {
|
|
10701
10709
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10702
10710
|
};
|
|
10703
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10711
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$h(_objectSpread$h({}, props), customersProps));
|
|
10704
10712
|
};
|
|
10705
10713
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10706
10714
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10755,7 +10763,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10755
10763
|
}
|
|
10756
10764
|
});
|
|
10757
10765
|
|
|
10758
|
-
var messages$
|
|
10766
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10759
10767
|
indexingSucceed: {
|
|
10760
10768
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10761
10769
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10793,8 +10801,8 @@ const defaultValue = {
|
|
|
10793
10801
|
*/
|
|
10794
10802
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10795
10803
|
|
|
10796
|
-
function ownKeys$
|
|
10797
|
-
function _objectSpread$
|
|
10804
|
+
function ownKeys$g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10805
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$g(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$g(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10798
10806
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10799
10807
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10800
10808
|
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 } } } };
|
|
@@ -10880,7 +10888,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10880
10888
|
_this.props.notifications.showNotification({
|
|
10881
10889
|
kind: 'error',
|
|
10882
10890
|
domain: constants.DOMAINS.SIDE,
|
|
10883
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10891
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10884
10892
|
});
|
|
10885
10893
|
};
|
|
10886
10894
|
_this.getIndexingProgress = async () => {
|
|
@@ -10921,7 +10929,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10921
10929
|
_this.props.notifications.showNotification({
|
|
10922
10930
|
kind: 'success',
|
|
10923
10931
|
domain: constants.DOMAINS.SIDE,
|
|
10924
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10932
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10925
10933
|
},
|
|
10926
10934
|
// because the indexing may take so long, the success notification
|
|
10927
10935
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10970,7 +10978,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10970
10978
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10971
10979
|
}
|
|
10972
10980
|
});
|
|
10973
|
-
_this.setState(_objectSpread$
|
|
10981
|
+
_this.setState(_objectSpread$g(_objectSpread$g({
|
|
10974
10982
|
isLoading: false,
|
|
10975
10983
|
isProjectBeingIndexedByPim: true
|
|
10976
10984
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10995,7 +11003,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10995
11003
|
key: "render",
|
|
10996
11004
|
value: function render() {
|
|
10997
11005
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
10998
|
-
value: _objectSpread$
|
|
11006
|
+
value: _objectSpread$g(_objectSpread$g({}, this.state), {}, {
|
|
10999
11007
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
11000
11008
|
indexProject: this.indexProject
|
|
11001
11009
|
}),
|
|
@@ -11037,13 +11045,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11037
11045
|
}(React.PureComponent);
|
|
11038
11046
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11039
11047
|
|
|
11040
|
-
function ownKeys$
|
|
11041
|
-
function _objectSpread$
|
|
11048
|
+
function ownKeys$f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11049
|
+
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__default["default"](_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11042
11050
|
var injectPimIndexer = (function () {
|
|
11043
11051
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11044
11052
|
return Component => {
|
|
11045
11053
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11046
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11054
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
11047
11055
|
[propName]: pimIndexerProps
|
|
11048
11056
|
}))
|
|
11049
11057
|
});
|
|
@@ -11056,7 +11064,7 @@ function usePimIndexer() {
|
|
|
11056
11064
|
return React.useContext(PimIndexerContext);
|
|
11057
11065
|
}
|
|
11058
11066
|
|
|
11059
|
-
var messages$
|
|
11067
|
+
var messages$8 = reactIntl.defineMessages({
|
|
11060
11068
|
yes: {
|
|
11061
11069
|
id: 'BooleanField.yes',
|
|
11062
11070
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11078,8 +11086,8 @@ const BooleanField = props => {
|
|
|
11078
11086
|
var _context;
|
|
11079
11087
|
let selectedValue;
|
|
11080
11088
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray__default["default"](props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
11081
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11082
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11089
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11090
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11083
11091
|
const options = [{
|
|
11084
11092
|
value: 'yes',
|
|
11085
11093
|
label: yesLabel
|
|
@@ -11117,7 +11125,7 @@ function getBooleanValue(value) {
|
|
|
11117
11125
|
return value === false ? 'no' : 'yes';
|
|
11118
11126
|
}
|
|
11119
11127
|
|
|
11120
|
-
var messages$
|
|
11128
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11121
11129
|
label: {
|
|
11122
11130
|
id: 'MissingValueField.label',
|
|
11123
11131
|
description: 'The label text for the missing values option',
|
|
@@ -11125,20 +11133,20 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11125
11133
|
}
|
|
11126
11134
|
});
|
|
11127
11135
|
|
|
11128
|
-
function ownKeys$
|
|
11129
|
-
function _objectSpread$
|
|
11136
|
+
function ownKeys$e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11137
|
+
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__default["default"](_context = ownKeys$e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11130
11138
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11131
11139
|
name: "missing-value",
|
|
11132
11140
|
isChecked: props.isChecked,
|
|
11133
11141
|
onChange: props.onChange,
|
|
11134
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11142
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$e({}, messages$7.label))
|
|
11135
11143
|
});
|
|
11136
11144
|
MissingValueField.defaultProps = {
|
|
11137
11145
|
isChecked: false
|
|
11138
11146
|
};
|
|
11139
11147
|
|
|
11140
|
-
function ownKeys$
|
|
11141
|
-
function _objectSpread$
|
|
11148
|
+
function ownKeys$d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11149
|
+
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__default["default"](_context = ownKeys$d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$d(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11142
11150
|
var styles$7 = {
|
|
11143
11151
|
"button": "button-module__button___1OzVf",
|
|
11144
11152
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11172,7 +11180,7 @@ const Button = props => {
|
|
|
11172
11180
|
|
|
11173
11181
|
// Pass only `data-*` props
|
|
11174
11182
|
const dataProps = filterDataAttributes(props);
|
|
11175
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11183
|
+
return jsxRuntime.jsx("button", _objectSpread$d(_objectSpread$d({
|
|
11176
11184
|
onClick: isDisabled ? null : onClick,
|
|
11177
11185
|
type: props.type,
|
|
11178
11186
|
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11187,7 +11195,7 @@ Button.defaultProps = {
|
|
|
11187
11195
|
type: 'button'
|
|
11188
11196
|
};
|
|
11189
11197
|
|
|
11190
|
-
var messages$
|
|
11198
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11191
11199
|
chooseFile: {
|
|
11192
11200
|
id: 'ButtonFileInput.chooseFile',
|
|
11193
11201
|
description: 'The label text of the field for upload local file',
|
|
@@ -11195,8 +11203,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
11195
11203
|
}
|
|
11196
11204
|
});
|
|
11197
11205
|
|
|
11198
|
-
function ownKeys$
|
|
11199
|
-
function _objectSpread$
|
|
11206
|
+
function ownKeys$c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11207
|
+
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__default["default"](_context = ownKeys$c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$c(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11200
11208
|
var styles$6 = {
|
|
11201
11209
|
"button": "file-input-module__button___2KypN",
|
|
11202
11210
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11216,7 +11224,7 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11216
11224
|
});
|
|
11217
11225
|
FileInput.displayName = 'FileInput';
|
|
11218
11226
|
FileInput.defaultProps = {
|
|
11219
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11227
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$c({}, messages$6.chooseFile)),
|
|
11220
11228
|
allowMultiple: false,
|
|
11221
11229
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11222
11230
|
};
|
|
@@ -11263,7 +11271,7 @@ const ScrollToFieldError = () => {
|
|
|
11263
11271
|
return null;
|
|
11264
11272
|
};
|
|
11265
11273
|
|
|
11266
|
-
var messages$
|
|
11274
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11267
11275
|
buttonLabel: {
|
|
11268
11276
|
id: 'SearchInput.buttonLabel',
|
|
11269
11277
|
description: 'Label for "Search" button.',
|
|
@@ -11318,15 +11326,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11318
11326
|
});
|
|
11319
11327
|
},
|
|
11320
11328
|
onReset: props.onReset,
|
|
11321
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11329
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11322
11330
|
isDisabled: props.disabled
|
|
11323
11331
|
})
|
|
11324
11332
|
});
|
|
11325
11333
|
};
|
|
11326
11334
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11327
11335
|
|
|
11328
|
-
function ownKeys$
|
|
11329
|
-
function _objectSpread$
|
|
11336
|
+
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11337
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11330
11338
|
const StoreSelectField = props => {
|
|
11331
11339
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
11332
11340
|
max: props.horizontalConstraint,
|
|
@@ -11340,7 +11348,7 @@ const StoreSelectField = props => {
|
|
|
11340
11348
|
htmlFor: props.id,
|
|
11341
11349
|
hasRequiredIndicator: props.isRequired,
|
|
11342
11350
|
isBold: true
|
|
11343
|
-
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$
|
|
11351
|
+
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$b(_objectSpread$b({
|
|
11344
11352
|
projectKey: props.projectKey,
|
|
11345
11353
|
id: props.id,
|
|
11346
11354
|
name: props.name,
|
|
@@ -11380,8 +11388,8 @@ StoreSelectField.defaultProps = {
|
|
|
11380
11388
|
};
|
|
11381
11389
|
|
|
11382
11390
|
var _templateObject;
|
|
11383
|
-
function ownKeys$
|
|
11384
|
-
function _objectSpread$
|
|
11391
|
+
function ownKeys$a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11392
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$a(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$a(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11385
11393
|
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__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11386
11394
|
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11387
11395
|
var styles$3 = {
|
|
@@ -11398,7 +11406,7 @@ const validateRequired = value => {
|
|
|
11398
11406
|
};
|
|
11399
11407
|
const VALIDATOR_REQUIRED = {
|
|
11400
11408
|
name: 'required',
|
|
11401
|
-
message: messages$
|
|
11409
|
+
message: messages$K.required,
|
|
11402
11410
|
permanent: true,
|
|
11403
11411
|
validators: {
|
|
11404
11412
|
change(value) {
|
|
@@ -11412,7 +11420,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11412
11420
|
};
|
|
11413
11421
|
const VALIDATOR_NUMERIC = {
|
|
11414
11422
|
name: 'numeric',
|
|
11415
|
-
message: messages$
|
|
11423
|
+
message: messages$K.numeric,
|
|
11416
11424
|
permanent: false,
|
|
11417
11425
|
validators: {
|
|
11418
11426
|
change: v => {
|
|
@@ -11427,7 +11435,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11427
11435
|
};
|
|
11428
11436
|
const VALIDATOR_INTEGER = {
|
|
11429
11437
|
name: 'integer',
|
|
11430
|
-
message: messages$
|
|
11438
|
+
message: messages$K.integer,
|
|
11431
11439
|
permanent: false,
|
|
11432
11440
|
validators: {
|
|
11433
11441
|
change: v => {
|
|
@@ -11442,7 +11450,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11442
11450
|
};
|
|
11443
11451
|
({
|
|
11444
11452
|
name: 'email',
|
|
11445
|
-
message: messages$
|
|
11453
|
+
message: messages$K.email,
|
|
11446
11454
|
permanent: false,
|
|
11447
11455
|
validators: {
|
|
11448
11456
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11525,7 +11533,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11525
11533
|
* so it must be an invalid numeric value
|
|
11526
11534
|
*/
|
|
11527
11535
|
_this.handleInvalid = () => {
|
|
11528
|
-
const nextValidStatus = _objectSpread$
|
|
11536
|
+
const nextValidStatus = _objectSpread$a({}, _this.state.validStatus);
|
|
11529
11537
|
if (has__default["default"](nextValidStatus, 'numeric')) {
|
|
11530
11538
|
nextValidStatus.numeric = false;
|
|
11531
11539
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11557,10 +11565,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11557
11565
|
key: "componentDidMount",
|
|
11558
11566
|
value: function componentDidMount() {
|
|
11559
11567
|
}
|
|
11560
|
-
// eslint-disable-next-line camelcase
|
|
11561
11568
|
}, {
|
|
11562
|
-
key: "
|
|
11563
|
-
value: function
|
|
11569
|
+
key: "componentDidUpdate",
|
|
11570
|
+
value: function componentDidUpdate() {
|
|
11571
|
+
const nextProps = this.props;
|
|
11564
11572
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11565
11573
|
this.resetValidity();
|
|
11566
11574
|
this.handleChange(nextProps.value, {
|
|
@@ -11575,7 +11583,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11575
11583
|
if (prev) return this.state.validStatus[v.name];
|
|
11576
11584
|
return prev;
|
|
11577
11585
|
}, true);
|
|
11578
|
-
const componentProps = _objectSpread$
|
|
11586
|
+
const componentProps = _objectSpread$a(_objectSpread$a({}, this.props), {}, {
|
|
11579
11587
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11580
11588
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11581
11589
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11592,7 +11600,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11592
11600
|
components: {
|
|
11593
11601
|
WrapperComponent: ToolTipWrapperComponent
|
|
11594
11602
|
},
|
|
11595
|
-
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$
|
|
11603
|
+
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$a({}, componentProps))
|
|
11596
11604
|
})
|
|
11597
11605
|
});
|
|
11598
11606
|
}
|
|
@@ -11647,7 +11655,7 @@ function simpleInput(type) {
|
|
|
11647
11655
|
}, _class;
|
|
11648
11656
|
}
|
|
11649
11657
|
|
|
11650
|
-
var messages$
|
|
11658
|
+
var messages$4 = reactIntl.defineMessages({
|
|
11651
11659
|
customFieldsError: {
|
|
11652
11660
|
id: 'CustomFieldsError.Error',
|
|
11653
11661
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11655,14 +11663,14 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
11655
11663
|
}
|
|
11656
11664
|
});
|
|
11657
11665
|
|
|
11658
|
-
function ownKeys$
|
|
11659
|
-
function _objectSpread$
|
|
11666
|
+
function ownKeys$9(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11667
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$9(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11660
11668
|
const CustomFieldsErrorTextNotification = props => {
|
|
11661
11669
|
var _context;
|
|
11662
11670
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
11663
11671
|
scale: "s",
|
|
11664
11672
|
children: [jsxRuntime.jsx(uiKit.Text.Wrap, {
|
|
11665
|
-
intlMessage: _objectSpread$
|
|
11673
|
+
intlMessage: _objectSpread$9({}, messages$4.customFieldsError)
|
|
11666
11674
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
11667
11675
|
scale: "xs",
|
|
11668
11676
|
children: _mapInstanceProperty__default["default"](_context = props.formErrors).call(_context, formError => jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -11674,7 +11682,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11674
11682
|
};
|
|
11675
11683
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11676
11684
|
|
|
11677
|
-
const messages$
|
|
11685
|
+
const messages$3 = reactIntl.defineMessages({
|
|
11678
11686
|
from: {
|
|
11679
11687
|
id: 'LabelRange.from',
|
|
11680
11688
|
description: 'The label for "from" range',
|
|
@@ -11687,8 +11695,8 @@ const messages$2 = reactIntl.defineMessages({
|
|
|
11687
11695
|
}
|
|
11688
11696
|
});
|
|
11689
11697
|
|
|
11690
|
-
function ownKeys$
|
|
11691
|
-
function _objectSpread$
|
|
11698
|
+
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11699
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11692
11700
|
var styles$2 = {
|
|
11693
11701
|
"label": "label-range-module__label___3Tb0p"
|
|
11694
11702
|
};
|
|
@@ -11696,12 +11704,12 @@ const LabelRange = _ref => {
|
|
|
11696
11704
|
let type = _ref.type;
|
|
11697
11705
|
return jsxRuntime.jsx("label", {
|
|
11698
11706
|
className: styles$2.label,
|
|
11699
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11707
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$3[type]))
|
|
11700
11708
|
});
|
|
11701
11709
|
};
|
|
11702
11710
|
LabelRange.displayName = 'LabelRange';
|
|
11703
11711
|
|
|
11704
|
-
var messages$
|
|
11712
|
+
var messages$2 = reactIntl.defineMessages({
|
|
11705
11713
|
filterWholeInput: {
|
|
11706
11714
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11707
11715
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11714,8 +11722,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
11714
11722
|
}
|
|
11715
11723
|
});
|
|
11716
11724
|
|
|
11717
|
-
function ownKeys$
|
|
11718
|
-
function _objectSpread$
|
|
11725
|
+
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11726
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$7(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11719
11727
|
var styles$1 = {
|
|
11720
11728
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11721
11729
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11739,7 +11747,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11739
11747
|
}),
|
|
11740
11748
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11741
11749
|
truncate: true,
|
|
11742
|
-
intlMessage: _objectSpread$
|
|
11750
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterWholeInput), {}, {
|
|
11743
11751
|
values: {
|
|
11744
11752
|
values: "\"".concat(props.value, "\"")
|
|
11745
11753
|
}
|
|
@@ -11752,7 +11760,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11752
11760
|
}),
|
|
11753
11761
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11754
11762
|
truncate: true,
|
|
11755
|
-
intlMessage: _objectSpread$
|
|
11763
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterSeparateValues), {}, {
|
|
11756
11764
|
values: {
|
|
11757
11765
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11758
11766
|
}
|
|
@@ -11863,8 +11871,8 @@ const MultiValueSearchInput = props => {
|
|
|
11863
11871
|
};
|
|
11864
11872
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11865
11873
|
|
|
11866
|
-
function ownKeys$
|
|
11867
|
-
function _objectSpread$
|
|
11874
|
+
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11875
|
+
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__default["default"](_context = ownKeys$6(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11868
11876
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11869
11877
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11870
11878
|
var styles = {
|
|
@@ -11927,7 +11935,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11927
11935
|
value: function render() {
|
|
11928
11936
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11929
11937
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11930
|
-
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$
|
|
11938
|
+
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$6({
|
|
11931
11939
|
placeholder: this.props.placeholder,
|
|
11932
11940
|
htmlRef: this.registerInputRef,
|
|
11933
11941
|
options: {
|
|
@@ -12223,8 +12231,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12223
12231
|
}
|
|
12224
12232
|
};
|
|
12225
12233
|
|
|
12226
|
-
function ownKeys$
|
|
12227
|
-
function _objectSpread$
|
|
12234
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12235
|
+
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__default["default"](_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12228
12236
|
/**
|
|
12229
12237
|
* Creates reducer
|
|
12230
12238
|
* @param {Object} initialState
|
|
@@ -12240,13 +12248,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12240
12248
|
|
|
12241
12249
|
// In case reducer ignored action, avoid creating new object
|
|
12242
12250
|
const newSubstate = reduce(newState, action);
|
|
12243
|
-
if (newSubstate) return _objectSpread$
|
|
12251
|
+
if (newSubstate) return _objectSpread$5(_objectSpread$5({}, newState), newSubstate);
|
|
12244
12252
|
return newState;
|
|
12245
12253
|
};
|
|
12246
12254
|
}
|
|
12247
12255
|
|
|
12248
|
-
function ownKeys$
|
|
12249
|
-
function _objectSpread$
|
|
12256
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12257
|
+
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__default["default"](_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12250
12258
|
function updateStatusInList(mergeData) {
|
|
12251
12259
|
return (state, _ref) => {
|
|
12252
12260
|
let payload = _ref.payload;
|
|
@@ -12255,15 +12263,15 @@ function updateStatusInList(mergeData) {
|
|
|
12255
12263
|
results[index] = mergeData(payload, results[index]);
|
|
12256
12264
|
results[index].checked = false;
|
|
12257
12265
|
return {
|
|
12258
|
-
currentQueryResult: _objectSpread$
|
|
12266
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12259
12267
|
results
|
|
12260
12268
|
})
|
|
12261
12269
|
};
|
|
12262
12270
|
};
|
|
12263
12271
|
}
|
|
12264
12272
|
|
|
12265
|
-
function ownKeys$
|
|
12266
|
-
function _objectSpread$
|
|
12273
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12274
|
+
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__default["default"](_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12267
12275
|
const identity = value => value;
|
|
12268
12276
|
function createResourceReducer(options) {
|
|
12269
12277
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12273,7 +12281,7 @@ function createResourceReducer(options) {
|
|
|
12273
12281
|
_options$initialState = options.initialState,
|
|
12274
12282
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12275
12283
|
const mergeData = options.mergeData || identity;
|
|
12276
|
-
const initialState = _objectSpread$
|
|
12284
|
+
const initialState = _objectSpread$3({
|
|
12277
12285
|
currentQueryResult: {
|
|
12278
12286
|
count: 0,
|
|
12279
12287
|
offset: 0,
|
|
@@ -12293,7 +12301,7 @@ function createResourceReducer(options) {
|
|
|
12293
12301
|
let payload = _ref.payload;
|
|
12294
12302
|
const results = state.currentQueryResult.results;
|
|
12295
12303
|
return {
|
|
12296
|
-
currentQueryResult: _objectSpread$
|
|
12304
|
+
currentQueryResult: _objectSpread$3(_objectSpread$3({}, state.currentQueryResult), {}, {
|
|
12297
12305
|
results: _filterInstanceProperty__default["default"](results).call(results, _ref2 => {
|
|
12298
12306
|
let id = _ref2.id;
|
|
12299
12307
|
return id !== payload.id;
|
|
@@ -12371,17 +12379,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12371
12379
|
}
|
|
12372
12380
|
|
|
12373
12381
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12374
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12382
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12375
12383
|
return null;
|
|
12376
12384
|
};
|
|
12377
12385
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12378
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12386
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12379
12387
|
return null;
|
|
12380
12388
|
};
|
|
12381
12389
|
|
|
12382
12390
|
// eslint-disable-next-line import/prefer-default-export
|
|
12383
12391
|
const validateText = (text, intl) => {
|
|
12384
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12392
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12385
12393
|
return null;
|
|
12386
12394
|
};
|
|
12387
12395
|
|
|
@@ -12468,7 +12476,7 @@ const safelyAddFallback = function (string) {
|
|
|
12468
12476
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12469
12477
|
};
|
|
12470
12478
|
|
|
12471
|
-
var messages = reactIntl.defineMessages({
|
|
12479
|
+
var messages$1 = reactIntl.defineMessages({
|
|
12472
12480
|
booleanAttributeTrue: {
|
|
12473
12481
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12474
12482
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12661,7 +12669,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12661
12669
|
case 'boolean':
|
|
12662
12670
|
{
|
|
12663
12671
|
if (isNil__default["default"](value)) return constants.NO_VALUE_FALLBACK;
|
|
12664
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12672
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12665
12673
|
}
|
|
12666
12674
|
case 'reference':
|
|
12667
12675
|
return value.id || constants.NO_VALUE_FALLBACK;
|
|
@@ -12797,8 +12805,8 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
|
|
|
12797
12805
|
} else {
|
|
12798
12806
|
var _context3;
|
|
12799
12807
|
const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](timeZones)).call(_context3, timeZoneId => {
|
|
12800
|
-
var _timeZones$timeZoneId
|
|
12801
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12808
|
+
var _timeZones$timeZoneId;
|
|
12809
|
+
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0 || (_timeZones$timeZoneId = _timeZones$timeZoneId.translationFor) === null || _timeZones$timeZoneId === void 0 ? void 0 : _someInstanceProperty__default["default"](_timeZones$timeZoneId).call(_timeZones$timeZoneId, fallbackTimeZone => fallbackTimeZone === selectedTimeZone);
|
|
12802
12810
|
});
|
|
12803
12811
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12804
12812
|
return fallbackTimeZoneId.toString();
|
|
@@ -12814,8 +12822,8 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
12814
12822
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12815
12823
|
});
|
|
12816
12824
|
|
|
12817
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12818
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12825
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12826
|
+
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__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12819
12827
|
function withPendingRequests() {
|
|
12820
12828
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12821
12829
|
return Component => {
|
|
@@ -12824,13 +12832,184 @@ function withPendingRequests() {
|
|
|
12824
12832
|
const pendingProp = {
|
|
12825
12833
|
[propName]: pendingRequests
|
|
12826
12834
|
};
|
|
12827
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12835
|
+
return jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), pendingProp));
|
|
12828
12836
|
};
|
|
12829
12837
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12830
12838
|
return WrappedComponent;
|
|
12831
12839
|
};
|
|
12832
12840
|
}
|
|
12833
12841
|
|
|
12842
|
+
var messages = reactIntl.defineMessages({
|
|
12843
|
+
noCustomFields: {
|
|
12844
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12845
|
+
description: 'The label when there are no custom fields defined',
|
|
12846
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12847
|
+
},
|
|
12848
|
+
noCustomType: {
|
|
12849
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12850
|
+
description: 'The label when there is no custom type selected',
|
|
12851
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12852
|
+
},
|
|
12853
|
+
noTypes: {
|
|
12854
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12855
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12856
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12857
|
+
},
|
|
12858
|
+
title: {
|
|
12859
|
+
id: 'CustomTypesSubform.title',
|
|
12860
|
+
description: 'Fallback title for the subform',
|
|
12861
|
+
defaultMessage: 'Custom fields'
|
|
12862
|
+
},
|
|
12863
|
+
typesPlaceholder: {
|
|
12864
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12865
|
+
description: 'The placeholder for the types',
|
|
12866
|
+
defaultMessage: 'Select...'
|
|
12867
|
+
}
|
|
12868
|
+
});
|
|
12869
|
+
|
|
12870
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12871
|
+
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__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12872
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12873
|
+
return typeDefinitions.length > 0;
|
|
12874
|
+
};
|
|
12875
|
+
const typeDefinitionSelected = formValues => {
|
|
12876
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12877
|
+
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);
|
|
12878
|
+
};
|
|
12879
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12880
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12881
|
+
};
|
|
12882
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12883
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12884
|
+
isReadOnly = _ref.isReadOnly;
|
|
12885
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12886
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12887
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12888
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noTypes));
|
|
12889
|
+
}
|
|
12890
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12891
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomType));
|
|
12892
|
+
}
|
|
12893
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12894
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomFields));
|
|
12895
|
+
}
|
|
12896
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12897
|
+
max: "scale",
|
|
12898
|
+
children: jsxRuntime.jsx(CustomFields, {
|
|
12899
|
+
isReadOnly: isReadOnly,
|
|
12900
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12901
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12902
|
+
})
|
|
12903
|
+
});
|
|
12904
|
+
};
|
|
12905
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12906
|
+
|
|
12907
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12908
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12909
|
+
const FIELD_NAME = 'custom';
|
|
12910
|
+
|
|
12911
|
+
// Creates dropdown options
|
|
12912
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12913
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12914
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12915
|
+
value: typeDefinition.type.key,
|
|
12916
|
+
label: l10n.formatLocalizedString(typeDefinition.type, {
|
|
12917
|
+
key: 'name',
|
|
12918
|
+
locale: language,
|
|
12919
|
+
fallbackOrder: languages
|
|
12920
|
+
})
|
|
12921
|
+
}));
|
|
12922
|
+
};
|
|
12923
|
+
|
|
12924
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12925
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12926
|
+
return {
|
|
12927
|
+
type: {
|
|
12928
|
+
id: selectedTypeDefinition.type.id,
|
|
12929
|
+
obj: {
|
|
12930
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12931
|
+
key: selectedTypeDefinition.type.key
|
|
12932
|
+
}
|
|
12933
|
+
},
|
|
12934
|
+
fields: {}
|
|
12935
|
+
};
|
|
12936
|
+
};
|
|
12937
|
+
const CustomTypeSubform = _ref => {
|
|
12938
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12939
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12940
|
+
isReadOnly = _ref.isReadOnly;
|
|
12941
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12942
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12943
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
12944
|
+
const _useIntl = reactIntl.useIntl(),
|
|
12945
|
+
formatMessage = _useIntl.formatMessage;
|
|
12946
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
12947
|
+
language: applicationContext.dataLocale,
|
|
12948
|
+
languages: applicationContext.project.languages
|
|
12949
|
+
})),
|
|
12950
|
+
language = _useApplicationContex.language,
|
|
12951
|
+
languages = _useApplicationContex.languages;
|
|
12952
|
+
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
12953
|
+
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12954
|
+
if (selectedTypeDefinition) {
|
|
12955
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12956
|
+
setFieldValue(FIELD_NAME, nextCustom);
|
|
12957
|
+
} else {
|
|
12958
|
+
// if the dropdown selector is cleared
|
|
12959
|
+
const emptyFormState = CustomFieldTypeDefinitionsConnector$1.createEmptyCustomFields(formValues[FIELD_NAME].type);
|
|
12960
|
+
setFieldValue(FIELD_NAME, emptyFormState);
|
|
12961
|
+
}
|
|
12962
|
+
}, [typeDefinitions, setFieldValue, formValues]);
|
|
12963
|
+
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
12964
|
+
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
12965
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.title))
|
|
12966
|
+
}),
|
|
12967
|
+
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
12968
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint10, ";" + ("" ), "" ),
|
|
12969
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
12970
|
+
isClearable: true,
|
|
12971
|
+
"data-testid": "custom-type-select",
|
|
12972
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12973
|
+
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),
|
|
12974
|
+
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,
|
|
12975
|
+
onChange: handleTypeDefinitionSelect,
|
|
12976
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12977
|
+
isReadOnly: isReadOnly
|
|
12978
|
+
})
|
|
12979
|
+
}),
|
|
12980
|
+
headerControlsAlignment: "left",
|
|
12981
|
+
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
12982
|
+
typeDefinitions: typeDefinitions,
|
|
12983
|
+
isReadOnly: isReadOnly
|
|
12984
|
+
})
|
|
12985
|
+
});
|
|
12986
|
+
};
|
|
12987
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
12988
|
+
|
|
12989
|
+
const CustomFieldsFormField = _ref => {
|
|
12990
|
+
let resources = _ref.resources,
|
|
12991
|
+
isReadOnly = _ref.isReadOnly;
|
|
12992
|
+
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
12993
|
+
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
12994
|
+
resources: resources,
|
|
12995
|
+
projectKey: projectKey,
|
|
12996
|
+
children: _ref2 => {
|
|
12997
|
+
var _context;
|
|
12998
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
12999
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13000
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13001
|
+
if (isLoading) {
|
|
13002
|
+
return jsxRuntime.jsx(uiKit.LoadingSpinner, {});
|
|
13003
|
+
}
|
|
13004
|
+
const typeDefinitions = _mapInstanceProperty__default["default"](_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13005
|
+
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13006
|
+
typeDefinitions: typeDefinitions,
|
|
13007
|
+
isReadOnly: isReadOnly
|
|
13008
|
+
});
|
|
13009
|
+
}
|
|
13010
|
+
});
|
|
13011
|
+
};
|
|
13012
|
+
|
|
12834
13013
|
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 } } } };
|
|
12835
13014
|
|
|
12836
13015
|
exports.BooleanField = booleanField;
|
|
@@ -12842,9 +13021,10 @@ exports.CenteredLoadingSpinner = CenteredLoadingSpinner;
|
|
|
12842
13021
|
exports.ChannelPickerInput = ChannelPickerInput;
|
|
12843
13022
|
exports.CountriesPicker = CountriesPicker;
|
|
12844
13023
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
12845
|
-
exports.CustomFieldTypeDefinitionsConnector =
|
|
13024
|
+
exports.CustomFieldTypeDefinitionsConnector = CustomFieldTypeDefinitionsConnector$1;
|
|
12846
13025
|
exports.CustomFields = CustomFields;
|
|
12847
13026
|
exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification;
|
|
13027
|
+
exports.CustomFieldsFormField = CustomFieldsFormField;
|
|
12848
13028
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput;
|
|
12849
13029
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
12850
13030
|
exports.Divider = Divider;
|
|
@@ -12877,10 +13057,10 @@ exports.allowedProperties = allowedProperties;
|
|
|
12877
13057
|
exports.and = and;
|
|
12878
13058
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
12879
13059
|
exports.base64ToString = base64ToString;
|
|
12880
|
-
exports.booleanMessages = messages$
|
|
13060
|
+
exports.booleanMessages = messages$8;
|
|
12881
13061
|
exports.buildSearchQuery = buildSearchQuery;
|
|
12882
13062
|
exports.businessRoleConstants = businessRoleConstants;
|
|
12883
|
-
exports.businessRoleMessages = messages$
|
|
13063
|
+
exports.businessRoleMessages = messages$r;
|
|
12884
13064
|
exports.businessRoles = businessRoleKeys;
|
|
12885
13065
|
exports.capitalizeFirst = capitalizeFirst;
|
|
12886
13066
|
exports.clone = clone;
|
|
@@ -12965,7 +13145,7 @@ exports.keepDisplayName = keepDisplayName;
|
|
|
12965
13145
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
12966
13146
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
12967
13147
|
exports.minusify = minusify;
|
|
12968
|
-
exports.missingValueMessages = messages$
|
|
13148
|
+
exports.missingValueMessages = messages$7;
|
|
12969
13149
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
12970
13150
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
12971
13151
|
exports.not = not;
|
|
@@ -12982,7 +13162,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
12982
13162
|
exports.safelyAddFallback = safelyAddFallback;
|
|
12983
13163
|
exports.sanitize = sanitize;
|
|
12984
13164
|
exports.searchCategories = searchCategories;
|
|
12985
|
-
exports.searchInputMessages = messages$
|
|
13165
|
+
exports.searchInputMessages = messages$F;
|
|
12986
13166
|
exports.setDisplayName = setDisplayName;
|
|
12987
13167
|
exports.setToArray = setToArray;
|
|
12988
13168
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13028,7 +13208,7 @@ exports.validateNumber = validateFilter;
|
|
|
13028
13208
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13029
13209
|
exports.validateText = validateText;
|
|
13030
13210
|
exports.validatedInput = validatedInput;
|
|
13031
|
-
exports.validationMessages = messages$
|
|
13211
|
+
exports.validationMessages = messages$K;
|
|
13032
13212
|
exports.withPendingRequests = withPendingRequests;
|
|
13033
13213
|
exports.withProps = withProps;
|
|
13034
13214
|
exports.withRedirectTo = withRedirectTo;
|