@commercetools-frontend/experimental-components 5.0.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +877 -554
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +871 -554
- package/dist/commercetools-frontend-experimental-components.esm.js +871 -550
- package/dist/styles.css +116 -116
- package/package.json +19 -19
|
@@ -99,6 +99,7 @@ var merge = require('lodash/merge');
|
|
|
99
99
|
var set = require('lodash/set');
|
|
100
100
|
var uuid = require('uuid');
|
|
101
101
|
var _ = require('@commercetools-frontend/ui-kit/');
|
|
102
|
+
var ReactDOM = require('react-dom');
|
|
102
103
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
103
104
|
var memoize = require('memoize-one');
|
|
104
105
|
var utils = require('@commercetools-uikit/utils');
|
|
@@ -182,6 +183,7 @@ var keyBy__default = /*#__PURE__*/_interopDefault(keyBy);
|
|
|
182
183
|
var times__default = /*#__PURE__*/_interopDefault(times);
|
|
183
184
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
184
185
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
186
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
185
187
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
186
188
|
var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
|
|
187
189
|
var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
@@ -375,7 +377,7 @@ function uniqueObjects(items) {
|
|
|
375
377
|
|
|
376
378
|
*/
|
|
377
379
|
|
|
378
|
-
const messages$
|
|
380
|
+
const messages$K = reactIntl.defineMessages({
|
|
379
381
|
unique: {
|
|
380
382
|
id: 'Validation.unique',
|
|
381
383
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1670,8 +1672,8 @@ const getData = (code, field) => {
|
|
|
1670
1672
|
};
|
|
1671
1673
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1672
1674
|
|
|
1673
|
-
function ownKeys$
|
|
1674
|
-
function _objectSpread$
|
|
1675
|
+
function ownKeys$1l(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; }
|
|
1676
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(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$1l(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1675
1677
|
function formatMoneyRangeValue(value, intl) {
|
|
1676
1678
|
var _context;
|
|
1677
1679
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1681,7 +1683,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1681
1683
|
return '';
|
|
1682
1684
|
}
|
|
1683
1685
|
function formatMoneyValue(amount, currency, intl) {
|
|
1684
|
-
return formatMoney$1(_objectSpread$
|
|
1686
|
+
return formatMoney$1(_objectSpread$1l({
|
|
1685
1687
|
centAmount: amount,
|
|
1686
1688
|
fractionDigits: getFractionDigit(currency)
|
|
1687
1689
|
}, currency ? {
|
|
@@ -1698,14 +1700,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1698
1700
|
}
|
|
1699
1701
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1700
1702
|
var _moneyValue$fractione;
|
|
1701
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1703
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1702
1704
|
style: 'currency',
|
|
1703
1705
|
currency: moneyValue.currencyCode,
|
|
1704
1706
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1705
1707
|
}, options));
|
|
1706
1708
|
}
|
|
1707
1709
|
|
|
1708
|
-
var messages$
|
|
1710
|
+
var messages$J = reactIntl.defineMessages({
|
|
1709
1711
|
booleanYes: {
|
|
1710
1712
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1711
1713
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1790,7 +1792,7 @@ const formatDateTime = _ref7 => {
|
|
|
1790
1792
|
const formatBoolean = _ref8 => {
|
|
1791
1793
|
let value = _ref8.value,
|
|
1792
1794
|
intl = _ref8.intl;
|
|
1793
|
-
return value ? intl.formatMessage(messages$
|
|
1795
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1794
1796
|
};
|
|
1795
1797
|
const formatNilType = _ref9 => {
|
|
1796
1798
|
let value = _ref9.value,
|
|
@@ -1952,8 +1954,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1952
1954
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1953
1955
|
};
|
|
1954
1956
|
|
|
1955
|
-
function ownKeys$
|
|
1956
|
-
function _objectSpread$
|
|
1957
|
+
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; }
|
|
1958
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(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$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1957
1959
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1958
1960
|
const WithDataTablePaginationState = props => {
|
|
1959
1961
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1964,10 +1966,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1964
1966
|
page = _usePaginationState.page,
|
|
1965
1967
|
perPage = _usePaginationState.perPage;
|
|
1966
1968
|
const tableSorting = uiKit.useDataTableSortingState({
|
|
1967
|
-
key: initialValues === null || initialValues === void 0
|
|
1968
|
-
order: initialValues === null || initialValues === void 0
|
|
1969
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1970
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1969
1971
|
});
|
|
1970
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1972
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
1971
1973
|
dataTablePaginationState: {
|
|
1972
1974
|
page,
|
|
1973
1975
|
perPage,
|
|
@@ -1979,8 +1981,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1979
1981
|
return WithDataTablePaginationState;
|
|
1980
1982
|
};
|
|
1981
1983
|
|
|
1982
|
-
function ownKeys$
|
|
1983
|
-
function _objectSpread$
|
|
1984
|
+
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; }
|
|
1985
|
+
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; }
|
|
1984
1986
|
const injectNotifications = function () {
|
|
1985
1987
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1986
1988
|
return Component => {
|
|
@@ -1995,7 +1997,7 @@ const injectNotifications = function () {
|
|
|
1995
1997
|
onActionError,
|
|
1996
1998
|
hideAllPageNotifications
|
|
1997
1999
|
};
|
|
1998
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2000
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1999
2001
|
[propName]: notifications
|
|
2000
2002
|
}));
|
|
2001
2003
|
};
|
|
@@ -2004,22 +2006,22 @@ const injectNotifications = function () {
|
|
|
2004
2006
|
};
|
|
2005
2007
|
};
|
|
2006
2008
|
|
|
2007
|
-
function ownKeys$
|
|
2008
|
-
function _objectSpread$
|
|
2009
|
+
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; }
|
|
2010
|
+
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; }
|
|
2009
2011
|
function isPropsMapper(mapProps) {
|
|
2010
2012
|
return typeof mapProps === 'function';
|
|
2011
2013
|
}
|
|
2012
2014
|
const withProps = mapProps => Component => {
|
|
2013
2015
|
const EnhancedWithProps = ownProps => {
|
|
2014
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2015
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2016
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps(ownProps)) : _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps);
|
|
2017
|
+
return jsxRuntime.jsx(Component, _objectSpread$1i({}, enhancedProps));
|
|
2016
2018
|
};
|
|
2017
2019
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2018
2020
|
return EnhancedWithProps;
|
|
2019
2021
|
};
|
|
2020
2022
|
|
|
2021
|
-
function ownKeys$
|
|
2022
|
-
function _objectSpread$
|
|
2023
|
+
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; }
|
|
2024
|
+
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; }
|
|
2023
2025
|
const useRedirectEffect = _ref => {
|
|
2024
2026
|
let goTo = _ref.goTo;
|
|
2025
2027
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2039,30 +2041,30 @@ const defaultOptions$5 = {
|
|
|
2039
2041
|
skip: () => false
|
|
2040
2042
|
};
|
|
2041
2043
|
const withRedirectTo = options => Component => {
|
|
2042
|
-
const mergedOptions = _objectSpread$
|
|
2044
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$5), options);
|
|
2043
2045
|
const WithRedirectTo = props => {
|
|
2044
2046
|
if (!mergedOptions.skip(props)) {
|
|
2045
2047
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2046
2048
|
goTo: options.selectGoTo(props)
|
|
2047
2049
|
});
|
|
2048
2050
|
}
|
|
2049
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2051
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h({}, props));
|
|
2050
2052
|
};
|
|
2051
2053
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2052
2054
|
return WithRedirectTo;
|
|
2053
2055
|
};
|
|
2054
2056
|
|
|
2055
|
-
function ownKeys$
|
|
2056
|
-
function _objectSpread$
|
|
2057
|
+
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; }
|
|
2058
|
+
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; }
|
|
2057
2059
|
const defaultOptions$4 = {
|
|
2058
2060
|
propName: 'modalState',
|
|
2059
2061
|
isInitiallyOpen: false
|
|
2060
2062
|
};
|
|
2061
2063
|
const injectModalState$1 = options => Component => {
|
|
2062
|
-
const mergedOptions = _objectSpread$
|
|
2064
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$4), options);
|
|
2063
2065
|
const WithModalState = props => {
|
|
2064
2066
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2065
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2067
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g(_objectSpread$1g({}, props), {}, {
|
|
2066
2068
|
[mergedOptions.propName]: modalState
|
|
2067
2069
|
}));
|
|
2068
2070
|
};
|
|
@@ -2070,17 +2072,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2070
2072
|
return WithModalState;
|
|
2071
2073
|
};
|
|
2072
2074
|
|
|
2073
|
-
function ownKeys$
|
|
2074
|
-
function _objectSpread$
|
|
2075
|
+
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; }
|
|
2076
|
+
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; }
|
|
2075
2077
|
const defaultOptions$3 = {
|
|
2076
2078
|
propName: 'toggleState',
|
|
2077
2079
|
isInitiallyOpen: false
|
|
2078
2080
|
};
|
|
2079
2081
|
const injectModalState = options => Component => {
|
|
2080
|
-
const mergedOptions = _objectSpread$
|
|
2082
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$3), options);
|
|
2081
2083
|
const WithToggleState = props => {
|
|
2082
2084
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2083
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2085
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2084
2086
|
[mergedOptions.propName]: toggleState
|
|
2085
2087
|
}));
|
|
2086
2088
|
};
|
|
@@ -2088,8 +2090,8 @@ const injectModalState = options => Component => {
|
|
|
2088
2090
|
return WithToggleState;
|
|
2089
2091
|
};
|
|
2090
2092
|
|
|
2091
|
-
function ownKeys$
|
|
2092
|
-
function _objectSpread$
|
|
2093
|
+
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; }
|
|
2094
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(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$1e(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2093
2095
|
const defaultOptions$2 = {
|
|
2094
2096
|
storageType: 'local',
|
|
2095
2097
|
segregateByUser: true
|
|
@@ -2107,7 +2109,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2107
2109
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2108
2110
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2109
2111
|
var _context;
|
|
2110
|
-
const mergedOptions = _objectSpread$
|
|
2112
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$2), options);
|
|
2111
2113
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2112
2114
|
var _context$user;
|
|
2113
2115
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2155,8 +2157,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2155
2157
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2156
2158
|
};
|
|
2157
2159
|
|
|
2158
|
-
function ownKeys$
|
|
2159
|
-
function _objectSpread$
|
|
2160
|
+
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; }
|
|
2161
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1d(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$1d(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2160
2162
|
const defaultOptions$1 = {
|
|
2161
2163
|
propName: 'storage',
|
|
2162
2164
|
storageKey: '',
|
|
@@ -2169,7 +2171,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2169
2171
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2170
2172
|
* argument position does not allow passing specification of option(s).
|
|
2171
2173
|
*/
|
|
2172
|
-
const mergedOptions = _objectSpread$
|
|
2174
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$1), options);
|
|
2173
2175
|
const WithStorage = props => {
|
|
2174
2176
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2175
2177
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2183,7 +2185,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2183
2185
|
readFromStorage
|
|
2184
2186
|
}
|
|
2185
2187
|
};
|
|
2186
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2188
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1d(_objectSpread$1d({}, props), storageProp));
|
|
2187
2189
|
};
|
|
2188
2190
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2189
2191
|
return WithStorage;
|
|
@@ -2227,9 +2229,9 @@ const usePrevious = value => {
|
|
|
2227
2229
|
return ref.current;
|
|
2228
2230
|
};
|
|
2229
2231
|
|
|
2230
|
-
function ownKeys$
|
|
2231
|
-
function _objectSpread$
|
|
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: "
|
|
2232
|
+
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; }
|
|
2233
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(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$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2234
|
+
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2233
2235
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2234
2236
|
var _storesQueryResult$re;
|
|
2235
2237
|
if (!storesQueryResult) return null;
|
|
@@ -2239,7 +2241,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2239
2241
|
offset: storesQueryResult.offset,
|
|
2240
2242
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2241
2243
|
var _store$productSelecti;
|
|
2242
|
-
return _objectSpread$
|
|
2244
|
+
return _objectSpread$1c(_objectSpread$1c({}, store), {}, {
|
|
2243
2245
|
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
2246
|
});
|
|
2245
2247
|
})
|
|
@@ -2247,7 +2249,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2247
2249
|
};
|
|
2248
2250
|
const createQueryVariables$6 = ownProps => {
|
|
2249
2251
|
var _context;
|
|
2250
|
-
return _objectSpread$
|
|
2252
|
+
return _objectSpread$1c(_objectSpread$1c({
|
|
2251
2253
|
limit: ownProps.limit,
|
|
2252
2254
|
offset: ownProps.offset,
|
|
2253
2255
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2402,8 +2404,8 @@ function useDidFormValidationFail() {
|
|
|
2402
2404
|
return Boolean(didFormValidationFail);
|
|
2403
2405
|
}
|
|
2404
2406
|
|
|
2405
|
-
function ownKeys$
|
|
2406
|
-
function _objectSpread$
|
|
2407
|
+
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; }
|
|
2408
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1b(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$1b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2407
2409
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2408
2410
|
const defaultOptions = {
|
|
2409
2411
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2431,7 +2433,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2431
2433
|
};
|
|
2432
2434
|
const usePersistedReminder = function () {
|
|
2433
2435
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2434
|
-
const mergedOptions = _objectSpread$
|
|
2436
|
+
const mergedOptions = _objectSpread$1b(_objectSpread$1b({}, defaultOptions), options);
|
|
2435
2437
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2436
2438
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2437
2439
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2477,7 +2479,7 @@ const usePersistedReminder = function () {
|
|
|
2477
2479
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2478
2480
|
};
|
|
2479
2481
|
|
|
2480
|
-
var messages$
|
|
2482
|
+
var messages$I = reactIntl.defineMessages({
|
|
2481
2483
|
profileUpdated: {
|
|
2482
2484
|
id: 'NotificationText.profileUpdated',
|
|
2483
2485
|
description: 'Label for the notification header',
|
|
@@ -2495,8 +2497,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2495
2497
|
}
|
|
2496
2498
|
});
|
|
2497
2499
|
|
|
2498
|
-
function ownKeys$
|
|
2499
|
-
function _objectSpread$
|
|
2500
|
+
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; }
|
|
2501
|
+
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; }
|
|
2500
2502
|
const LinkToProfile = props => {
|
|
2501
2503
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2502
2504
|
to: "/account/profile",
|
|
@@ -2514,9 +2516,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2514
2516
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2515
2517
|
as: "p",
|
|
2516
2518
|
isBold: true,
|
|
2517
|
-
intlMessage: messages$
|
|
2519
|
+
intlMessage: messages$I.profileUpdated
|
|
2518
2520
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2519
|
-
intlMessage: _objectSpread$
|
|
2521
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.addMoreInformation), {}, {
|
|
2520
2522
|
values: {
|
|
2521
2523
|
newline: getNewLine
|
|
2522
2524
|
}
|
|
@@ -2525,7 +2527,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2525
2527
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2526
2528
|
scale: "xs",
|
|
2527
2529
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2528
|
-
intlMessage: _objectSpread$
|
|
2530
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.informationAndProfileLink), {}, {
|
|
2529
2531
|
values: {
|
|
2530
2532
|
newline: getNewLine,
|
|
2531
2533
|
link: getLinkToProfile
|
|
@@ -2646,7 +2648,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2646
2648
|
}, [ref]);
|
|
2647
2649
|
};
|
|
2648
2650
|
|
|
2649
|
-
var messages$
|
|
2651
|
+
var messages$H = reactIntl.defineMessages({
|
|
2650
2652
|
fallbackHint: {
|
|
2651
2653
|
id: 'KeyFallback.fallbackHint',
|
|
2652
2654
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2670,7 +2672,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2670
2672
|
return values => {
|
|
2671
2673
|
if (!values.resource) return null;
|
|
2672
2674
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2673
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2675
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2674
2676
|
key: values.resource.key
|
|
2675
2677
|
});
|
|
2676
2678
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2682,8 +2684,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2682
2684
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2683
2685
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2684
2686
|
|
|
2685
|
-
function ownKeys$
|
|
2686
|
-
function _objectSpread$
|
|
2687
|
+
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; }
|
|
2688
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(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$19(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2687
2689
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2688
2690
|
const updatedColumnProps = {};
|
|
2689
2691
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2703,14 +2705,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2703
2705
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2704
2706
|
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
2707
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2706
|
-
return _objectSpread$
|
|
2708
|
+
return _objectSpread$19(_objectSpread$19({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2707
2709
|
});
|
|
2708
2710
|
};
|
|
2709
2711
|
const handleCacheUpdate = _ref2 => {
|
|
2710
2712
|
let update = _ref2.update,
|
|
2711
2713
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2712
2714
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2713
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2715
|
+
return updateCachedTableConfiguration(_objectSpread$19(_objectSpread$19({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2714
2716
|
};
|
|
2715
2717
|
|
|
2716
2718
|
// Signature:
|
|
@@ -2739,7 +2741,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2739
2741
|
return {
|
|
2740
2742
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2741
2743
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2742
|
-
return _objectSpread$
|
|
2744
|
+
return _objectSpread$19({
|
|
2743
2745
|
key: visibleColumnKey
|
|
2744
2746
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2745
2747
|
}),
|
|
@@ -2795,7 +2797,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2795
2797
|
data = _useQuery.data;
|
|
2796
2798
|
return {
|
|
2797
2799
|
isLoading: loading,
|
|
2798
|
-
total: data === null || data === void 0
|
|
2800
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2799
2801
|
};
|
|
2800
2802
|
};
|
|
2801
2803
|
|
|
@@ -2810,21 +2812,21 @@ const handlers$4 = {
|
|
|
2810
2812
|
}
|
|
2811
2813
|
};
|
|
2812
2814
|
|
|
2813
|
-
function ownKeys$
|
|
2814
|
-
function _objectSpread$
|
|
2815
|
+
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; }
|
|
2816
|
+
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; }
|
|
2815
2817
|
|
|
2816
2818
|
// eslint-disable-next-line import/prefer-default-export
|
|
2817
2819
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2818
2820
|
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$
|
|
2821
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$18(_objectSpread$18({}, productSelections), {}, {
|
|
2822
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$18({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2821
2823
|
from: 'nameAllLocales',
|
|
2822
2824
|
to: 'name'
|
|
2823
2825
|
}])))
|
|
2824
2826
|
});
|
|
2825
2827
|
};
|
|
2826
2828
|
|
|
2827
|
-
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "
|
|
2829
|
+
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2828
2830
|
const createQueryVariables$5 = ownProps => ({
|
|
2829
2831
|
limit: ownProps.limit,
|
|
2830
2832
|
offset: ownProps.offset,
|
|
@@ -2967,7 +2969,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
2967
2969
|
});
|
|
2968
2970
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2969
2971
|
|
|
2970
|
-
var messages$
|
|
2972
|
+
var messages$G = reactIntl.defineMessages({
|
|
2971
2973
|
noChannelsFound: {
|
|
2972
2974
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2973
2975
|
description: 'The message to display when no channels were found',
|
|
@@ -2993,8 +2995,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2993
2995
|
}
|
|
2994
2996
|
});
|
|
2995
2997
|
|
|
2996
|
-
function ownKeys$
|
|
2997
|
-
function _objectSpread$
|
|
2998
|
+
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; }
|
|
2999
|
+
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; }
|
|
2998
3000
|
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
3001
|
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
3002
|
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 +3017,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3015
3017
|
const _useIntl = reactIntl.useIntl(),
|
|
3016
3018
|
formatMessage = _useIntl.formatMessage;
|
|
3017
3019
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3018
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3020
|
+
const variables = React.useMemo(() => _objectSpread$17({
|
|
3019
3021
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3020
3022
|
}, role && {
|
|
3021
3023
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3076,8 +3078,8 @@ const ChannelPickerInput = _ref => {
|
|
|
3076
3078
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3077
3079
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3078
3080
|
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
|
|
3081
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3082
|
+
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
3083
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3082
3084
|
max: "scale",
|
|
3083
3085
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3087,7 +3089,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3087
3089
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3088
3090
|
id: name,
|
|
3089
3091
|
name: name,
|
|
3090
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3092
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3091
3093
|
loadOptions: loadOptionsDebounced,
|
|
3092
3094
|
defaultOptions: true,
|
|
3093
3095
|
showOptionGroupDivider: true,
|
|
@@ -3130,7 +3132,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3130
3132
|
var _this$props;
|
|
3131
3133
|
let user = _ref.user;
|
|
3132
3134
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3133
|
-
timeZone: (this === null || this === void 0
|
|
3135
|
+
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
3136
|
locale: this.props.intl.locale
|
|
3135
3137
|
});
|
|
3136
3138
|
}
|
|
@@ -3144,8 +3146,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3144
3146
|
|
|
3145
3147
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3146
3148
|
|
|
3147
|
-
function ownKeys$
|
|
3148
|
-
function _objectSpread$
|
|
3149
|
+
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; }
|
|
3150
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$16(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$16(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3149
3151
|
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
3152
|
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
3153
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3177,7 +3179,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3177
3179
|
handleMouseOver: this.handleMouseOver,
|
|
3178
3180
|
handleMouseOut: this.handleMouseOut
|
|
3179
3181
|
};
|
|
3180
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3182
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$16({}, _objectSpread$16(_objectSpread$16({}, this.props), injectedProps)));
|
|
3181
3183
|
}
|
|
3182
3184
|
}]);
|
|
3183
3185
|
return WithMouseOverState;
|
|
@@ -3186,8 +3188,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3186
3188
|
return WithMouseOverState;
|
|
3187
3189
|
};
|
|
3188
3190
|
|
|
3189
|
-
function ownKeys$
|
|
3190
|
-
function _objectSpread$
|
|
3191
|
+
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; }
|
|
3192
|
+
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; }
|
|
3191
3193
|
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
3194
|
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
3195
|
var styles$h = {
|
|
@@ -3213,7 +3215,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3213
3215
|
}
|
|
3214
3216
|
_this = _super.call(this, ...args);
|
|
3215
3217
|
_this.state = {
|
|
3216
|
-
draftValue:
|
|
3218
|
+
draftValue: '',
|
|
3219
|
+
prevValue: ''
|
|
3217
3220
|
};
|
|
3218
3221
|
_this.clearPendingUpdates = () => {
|
|
3219
3222
|
clearTimeout(_this.changeTimeout);
|
|
@@ -3260,8 +3263,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3260
3263
|
};
|
|
3261
3264
|
_this.doDelayedUpdate = (updateFunction, event, eventType) => {
|
|
3262
3265
|
const self = _assertThisInitialized(_this);
|
|
3263
|
-
// TODO: can't we just use one variable?
|
|
3264
3266
|
const timeoutKey = "".concat(eventType, "Timeout");
|
|
3267
|
+
// TODO: can't we just use one variable?
|
|
3265
3268
|
clearTimeout(_this[timeoutKey]);
|
|
3266
3269
|
_this[timeoutKey] = _setTimeout__default["default"](() => {
|
|
3267
3270
|
updateFunction.call(self, event);
|
|
@@ -3271,26 +3274,6 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3271
3274
|
return _this;
|
|
3272
3275
|
}
|
|
3273
3276
|
_createClass(ThrottledField, [{
|
|
3274
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
3275
|
-
value:
|
|
3276
|
-
// eslint-disable-next-line camelcase
|
|
3277
|
-
function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
3278
|
-
if (!has__default["default"](nextProps, 'value')) return;
|
|
3279
|
-
if (!nextProps.value && nextProps.value !== 0) {
|
|
3280
|
-
// let new value from props take precedence over pending updates
|
|
3281
|
-
this.clearPendingUpdates();
|
|
3282
|
-
this.setState({
|
|
3283
|
-
draftValue: ''
|
|
3284
|
-
});
|
|
3285
|
-
} else if (nextProps.value !== this.state.draftValue) {
|
|
3286
|
-
// let new value from props take precedence over pending updates
|
|
3287
|
-
this.clearPendingUpdates();
|
|
3288
|
-
this.setState({
|
|
3289
|
-
draftValue: nextProps.value
|
|
3290
|
-
});
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
}, {
|
|
3294
3277
|
key: "componentWillUnmount",
|
|
3295
3278
|
value: function componentWillUnmount() {
|
|
3296
3279
|
this.clearPendingUpdates();
|
|
@@ -3298,7 +3281,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3298
3281
|
}, {
|
|
3299
3282
|
key: "render",
|
|
3300
3283
|
value: function render() {
|
|
3301
|
-
const commonProps = _objectSpread$
|
|
3284
|
+
const commonProps = _objectSpread$15(_objectSpread$15({
|
|
3302
3285
|
value: this.state.draftValue,
|
|
3303
3286
|
autoComplete: this.props.autoComplete,
|
|
3304
3287
|
onChange: this.handleChange,
|
|
@@ -3317,7 +3300,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3317
3300
|
htmlFor: inputId,
|
|
3318
3301
|
children: this.props.label
|
|
3319
3302
|
})
|
|
3320
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3303
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3321
3304
|
id: inputId,
|
|
3322
3305
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3323
3306
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3326,7 +3309,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3326
3309
|
rows: 1,
|
|
3327
3310
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3328
3311
|
cacheMeasurements: true
|
|
3329
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3312
|
+
})) : jsxRuntime.jsx("input", _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3330
3313
|
id: inputId,
|
|
3331
3314
|
ref: this.props.inputRef,
|
|
3332
3315
|
type: this.props.as,
|
|
@@ -3338,6 +3321,17 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3338
3321
|
}))]
|
|
3339
3322
|
});
|
|
3340
3323
|
}
|
|
3324
|
+
}], [{
|
|
3325
|
+
key: "getDerivedStateFromProps",
|
|
3326
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
3327
|
+
if (nextProps.value !== prevState.prevValue) {
|
|
3328
|
+
return {
|
|
3329
|
+
draftValue: nextProps.value || nextProps.value === 0 ? nextProps.value : '',
|
|
3330
|
+
prevValue: nextProps.value
|
|
3331
|
+
};
|
|
3332
|
+
}
|
|
3333
|
+
return null;
|
|
3334
|
+
}
|
|
3341
3335
|
}]);
|
|
3342
3336
|
return ThrottledField;
|
|
3343
3337
|
}(React.PureComponent);
|
|
@@ -3353,7 +3347,7 @@ ThrottledField.defaultProps = {
|
|
|
3353
3347
|
label: 'Throttled field'
|
|
3354
3348
|
};
|
|
3355
3349
|
|
|
3356
|
-
var messages$
|
|
3350
|
+
var messages$F = reactIntl.defineMessages({
|
|
3357
3351
|
buttonLabel: {
|
|
3358
3352
|
id: 'SearchInput.buttonLabel',
|
|
3359
3353
|
description: 'Label for "Search" button.',
|
|
@@ -3460,7 +3454,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3460
3454
|
"data-testid": this.props.testId || 'search-input',
|
|
3461
3455
|
value: this.state.text,
|
|
3462
3456
|
label: this.props.label,
|
|
3463
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3457
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3464
3458
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3465
3459
|
onChange: this.handleInputChange,
|
|
3466
3460
|
onEnter: this.handleEnter,
|
|
@@ -3553,7 +3547,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3553
3547
|
const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
|
|
3554
3548
|
var _result$hits$map, _result$hits;
|
|
3555
3549
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3556
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3550
|
+
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
3551
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3558
3552
|
if (ids.length === 0) {
|
|
3559
3553
|
return {
|
|
@@ -3636,7 +3630,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3636
3630
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3637
3631
|
};
|
|
3638
3632
|
const usePimStatus = () => {
|
|
3639
|
-
var _data$indicesExist
|
|
3633
|
+
var _data$indicesExist;
|
|
3640
3634
|
const _useQuery = react.useQuery(FetchIndicesExist$1, {
|
|
3641
3635
|
context: {
|
|
3642
3636
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3646,7 +3640,7 @@ const usePimStatus = () => {
|
|
|
3646
3640
|
data = _useQuery.data;
|
|
3647
3641
|
return {
|
|
3648
3642
|
data,
|
|
3649
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3643
|
+
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
3644
|
};
|
|
3651
3645
|
};
|
|
3652
3646
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3675,7 +3669,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3675
3669
|
};
|
|
3676
3670
|
};
|
|
3677
3671
|
|
|
3678
|
-
var messages$
|
|
3672
|
+
var messages$E = reactIntl.defineMessages({
|
|
3679
3673
|
bottomOption: {
|
|
3680
3674
|
id: 'Products.Pickers.bottomOption',
|
|
3681
3675
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3683,11 +3677,11 @@ var messages$D = reactIntl.defineMessages({
|
|
|
3683
3677
|
}
|
|
3684
3678
|
});
|
|
3685
3679
|
|
|
3686
|
-
function ownKeys$
|
|
3687
|
-
function _objectSpread$
|
|
3680
|
+
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; }
|
|
3681
|
+
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; }
|
|
3688
3682
|
const getBottomOption = formatMessage => ({
|
|
3689
3683
|
options: [{
|
|
3690
|
-
label: formatMessage ? formatMessage(messages$
|
|
3684
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3691
3685
|
isBottomOption: true,
|
|
3692
3686
|
isDisabled: true
|
|
3693
3687
|
}]
|
|
@@ -3695,7 +3689,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3695
3689
|
const Option$2 = props => {
|
|
3696
3690
|
const _useIntl = reactIntl.useIntl(),
|
|
3697
3691
|
formatMessage = _useIntl.formatMessage;
|
|
3698
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3692
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$14(_objectSpread$14({}, props), {}, {
|
|
3699
3693
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3700
3694
|
tone: "secondary",
|
|
3701
3695
|
children: formatMessage(props.data.label)
|
|
@@ -3712,8 +3706,8 @@ const Option$2 = props => {
|
|
|
3712
3706
|
};
|
|
3713
3707
|
Option$2.displayName = 'Option';
|
|
3714
3708
|
|
|
3715
|
-
function ownKeys$
|
|
3716
|
-
function _objectSpread$
|
|
3709
|
+
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; }
|
|
3710
|
+
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; }
|
|
3717
3711
|
const useHandlers = onChange => {
|
|
3718
3712
|
const _useState = React.useState(),
|
|
3719
3713
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3724,8 +3718,8 @@ const useHandlers = onChange => {
|
|
|
3724
3718
|
}, []);
|
|
3725
3719
|
const handleChange = useEventCallback(event => {
|
|
3726
3720
|
var _event$target$value;
|
|
3727
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3728
|
-
target: _objectSpread$
|
|
3721
|
+
const eventWithExtractedValue = _objectSpread$13(_objectSpread$13({}, event), {}, {
|
|
3722
|
+
target: _objectSpread$13(_objectSpread$13({}, event.target), {}, {
|
|
3729
3723
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3730
3724
|
})
|
|
3731
3725
|
});
|
|
@@ -3734,8 +3728,8 @@ const useHandlers = onChange => {
|
|
|
3734
3728
|
return [handleInputChange, handleChange];
|
|
3735
3729
|
};
|
|
3736
3730
|
|
|
3737
|
-
function ownKeys
|
|
3738
|
-
function _objectSpread
|
|
3731
|
+
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; }
|
|
3732
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$12(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$12(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3739
3733
|
const constructPrefixSearchPredicate = function () {
|
|
3740
3734
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3741
3735
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3778,7 +3772,7 @@ const useLoadOptions = _ref => {
|
|
|
3778
3772
|
}();
|
|
3779
3773
|
return client$1.query({
|
|
3780
3774
|
query,
|
|
3781
|
-
variables: _objectSpread
|
|
3775
|
+
variables: _objectSpread$12({
|
|
3782
3776
|
where
|
|
3783
3777
|
}, variables),
|
|
3784
3778
|
context: {
|
|
@@ -3832,7 +3826,7 @@ function useCurrentOption(_ref) {
|
|
|
3832
3826
|
};
|
|
3833
3827
|
}
|
|
3834
3828
|
|
|
3835
|
-
var messages$
|
|
3829
|
+
var messages$D = reactIntl.defineMessages({
|
|
3836
3830
|
noProductTypesFound: {
|
|
3837
3831
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3838
3832
|
description: 'The message to display when no product types were found',
|
|
@@ -3912,7 +3906,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3912
3906
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3913
3907
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3914
3908
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3915
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3909
|
+
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
3910
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3917
3911
|
max: "scale",
|
|
3918
3912
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3922,7 +3916,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3922
3916
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3923
3917
|
id: name,
|
|
3924
3918
|
name: name,
|
|
3925
|
-
placeholder: formatMessage(messages$
|
|
3919
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3926
3920
|
loadOptions: loadOptionsDebounced,
|
|
3927
3921
|
defaultOptions: [],
|
|
3928
3922
|
isClearable: isClearable,
|
|
@@ -3935,7 +3929,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3935
3929
|
onInputChange: handleInputChange,
|
|
3936
3930
|
onBlur: onBlur,
|
|
3937
3931
|
value: currentOption.data,
|
|
3938
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3932
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3939
3933
|
hasError: hasError || isLoadingFailed
|
|
3940
3934
|
})
|
|
3941
3935
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3947,7 +3941,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3947
3941
|
};
|
|
3948
3942
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3949
3943
|
|
|
3950
|
-
var messages$
|
|
3944
|
+
var messages$C = reactIntl.defineMessages({
|
|
3951
3945
|
noStatesFound: {
|
|
3952
3946
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3953
3947
|
description: 'The message to display when no states were found',
|
|
@@ -4031,8 +4025,8 @@ const StatePickerInput = _ref => {
|
|
|
4031
4025
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4032
4026
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4033
4027
|
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
|
|
4028
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
4029
|
+
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
4030
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4037
4031
|
max: "scale",
|
|
4038
4032
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -4043,7 +4037,7 @@ const StatePickerInput = _ref => {
|
|
|
4043
4037
|
id: name,
|
|
4044
4038
|
name: name,
|
|
4045
4039
|
horizontalConstraint: "scale",
|
|
4046
|
-
placeholder: formatMessage(messages$
|
|
4040
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
4047
4041
|
loadOptions: loadOptionsDebounced,
|
|
4048
4042
|
defaultOptions: true,
|
|
4049
4043
|
showOptionGroupDivider: true,
|
|
@@ -4069,9 +4063,9 @@ const StatePickerInput = _ref => {
|
|
|
4069
4063
|
};
|
|
4070
4064
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4071
4065
|
|
|
4072
|
-
function ownKeys$
|
|
4073
|
-
function _objectSpread$
|
|
4074
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4066
|
+
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; }
|
|
4067
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$11(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$11(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4068
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$11({
|
|
4075
4069
|
ref: ref,
|
|
4076
4070
|
style: {
|
|
4077
4071
|
display: 'block',
|
|
@@ -4209,8 +4203,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4209
4203
|
};
|
|
4210
4204
|
|
|
4211
4205
|
const _excluded = ["action"];
|
|
4212
|
-
function ownKeys$
|
|
4213
|
-
function _objectSpread$
|
|
4206
|
+
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; }
|
|
4207
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$10(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$10(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4214
4208
|
|
|
4215
4209
|
/**
|
|
4216
4210
|
* Checks if a value is a LocalizedString
|
|
@@ -4232,7 +4226,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4232
4226
|
*/
|
|
4233
4227
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4234
4228
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4235
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4229
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$10(_objectSpread$10({}, customFields), {}, {
|
|
4236
4230
|
[customField.name]: customField.value
|
|
4237
4231
|
}), {});
|
|
4238
4232
|
};
|
|
@@ -4256,7 +4250,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4256
4250
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4257
4251
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4258
4252
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4259
|
-
return _objectSpread$
|
|
4253
|
+
return _objectSpread$10(_objectSpread$10(_objectSpread$10({}, transformedData), parent ? {
|
|
4260
4254
|
parent
|
|
4261
4255
|
} : {}), ancestors ? {
|
|
4262
4256
|
ancestors
|
|
@@ -4481,7 +4475,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4481
4475
|
case 'addAttributeDefinition':
|
|
4482
4476
|
return {
|
|
4483
4477
|
[actionName]: {
|
|
4484
|
-
attributeDefinition: _objectSpread$
|
|
4478
|
+
attributeDefinition: _objectSpread$10(_objectSpread$10({}, actionPayload.attribute), {}, {
|
|
4485
4479
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4486
4480
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4487
4481
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4577,7 +4571,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4577
4571
|
return {
|
|
4578
4572
|
[actionName]: {
|
|
4579
4573
|
attributeName: actionPayload.attributeName,
|
|
4580
|
-
value: _objectSpread$
|
|
4574
|
+
value: _objectSpread$10(_objectSpread$10({}, actionPayload.value), {}, {
|
|
4581
4575
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4582
4576
|
})
|
|
4583
4577
|
}
|
|
@@ -4586,7 +4580,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4586
4580
|
return {
|
|
4587
4581
|
[actionName]: {
|
|
4588
4582
|
attributeName: actionPayload.attributeName,
|
|
4589
|
-
newValue: _objectSpread$
|
|
4583
|
+
newValue: _objectSpread$10(_objectSpread$10({}, actionPayload.newValue), {}, {
|
|
4590
4584
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4591
4585
|
})
|
|
4592
4586
|
}
|
|
@@ -4613,7 +4607,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4613
4607
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4614
4608
|
taxCategory: actionPayload.taxCategory,
|
|
4615
4609
|
money: {
|
|
4616
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4610
|
+
[actionPayload.money.type]: _objectSpread$10({
|
|
4617
4611
|
centAmount: actionPayload.money.centAmount,
|
|
4618
4612
|
currencyCode: actionPayload.money.currencyCode
|
|
4619
4613
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4648,7 +4642,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4648
4642
|
case 'addAddress':
|
|
4649
4643
|
case 'changeAddress':
|
|
4650
4644
|
{
|
|
4651
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4645
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4652
4646
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4653
4647
|
_ref3$fields = _ref3.fields,
|
|
4654
4648
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4661,15 +4655,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4661
4655
|
value: _JSON$stringify__default["default"](value)
|
|
4662
4656
|
};
|
|
4663
4657
|
});
|
|
4664
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4658
|
+
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
4659
|
type: {
|
|
4666
4660
|
id: actionPayload.address.custom.type.id
|
|
4667
4661
|
},
|
|
4668
4662
|
fields: customFields
|
|
4669
4663
|
} : null;
|
|
4670
4664
|
return {
|
|
4671
|
-
[actionName]: _objectSpread$
|
|
4672
|
-
address: _objectSpread$
|
|
4665
|
+
[actionName]: _objectSpread$10(_objectSpread$10({}, actionPayload), {}, {
|
|
4666
|
+
address: _objectSpread$10(_objectSpread$10({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4673
4667
|
custom
|
|
4674
4668
|
})
|
|
4675
4669
|
})
|
|
@@ -4715,8 +4709,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
|
|
|
4715
4709
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4716
4710
|
}, []);
|
|
4717
4711
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4718
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4719
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4712
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4713
|
+
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
4714
|
return graphQlResponse.networkError.result.errors;
|
|
4721
4715
|
}
|
|
4722
4716
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4745,26 +4739,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4745
4739
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4746
4740
|
}
|
|
4747
4741
|
|
|
4748
|
-
function ownKeys
|
|
4749
|
-
function _objectSpread
|
|
4742
|
+
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; }
|
|
4743
|
+
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
4744
|
function getPriceChannelName(price) {
|
|
4751
4745
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4752
4746
|
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
4747
|
}
|
|
4754
4748
|
function getDiscountValue(price) {
|
|
4755
|
-
var _price$value, _price$value2, _price$discounted
|
|
4749
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4756
4750
|
let preciseAmount;
|
|
4757
4751
|
let fractionedAmount;
|
|
4758
4752
|
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
4753
|
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
|
|
4754
|
+
} 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
4755
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4762
4756
|
}
|
|
4763
|
-
return price.discounted ? _objectSpread
|
|
4757
|
+
return price.discounted ? _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4764
4758
|
fractionedAmount,
|
|
4765
4759
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4766
4760
|
preciseAmount
|
|
4767
|
-
}) : _objectSpread
|
|
4761
|
+
}) : _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4768
4762
|
centAmount: 0
|
|
4769
4763
|
});
|
|
4770
4764
|
}
|
|
@@ -4772,17 +4766,17 @@ function getSelectedPrice(price) {
|
|
|
4772
4766
|
return price.discounted ? price.discounted : price;
|
|
4773
4767
|
}
|
|
4774
4768
|
function getNetUnitPrice(_ref2) {
|
|
4775
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4769
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4776
4770
|
let lineItem = _ref2.lineItem,
|
|
4777
4771
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4778
4772
|
const price = getSelectedPrice(lineItem.price);
|
|
4779
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4780
|
-
var _lineItem$shippingDet
|
|
4781
|
-
return (lineItem === null || lineItem === void 0
|
|
4773
|
+
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 => {
|
|
4774
|
+
var _lineItem$shippingDet;
|
|
4775
|
+
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
4776
|
});
|
|
4783
4777
|
|
|
4784
4778
|
// 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 && (
|
|
4779
|
+
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
4780
|
var _price$value3, _price$value4;
|
|
4787
4781
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4788
4782
|
let centAmount;
|
|
@@ -4793,7 +4787,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4793
4787
|
}
|
|
4794
4788
|
let preciseAmount;
|
|
4795
4789
|
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
|
|
4790
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4797
4791
|
centAmount,
|
|
4798
4792
|
preciseAmount
|
|
4799
4793
|
});
|
|
@@ -4810,7 +4804,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4810
4804
|
}
|
|
4811
4805
|
let preciseAmount;
|
|
4812
4806
|
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
|
|
4807
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4814
4808
|
centAmount,
|
|
4815
4809
|
preciseAmount
|
|
4816
4810
|
});
|
|
@@ -4822,7 +4816,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4822
4816
|
const currencyCode = price.value.currencyCode;
|
|
4823
4817
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4824
4818
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4825
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4819
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$$(_objectSpread$$({}, minPrices), {}, {
|
|
4826
4820
|
[currencyCode]: price.value
|
|
4827
4821
|
});
|
|
4828
4822
|
}
|
|
@@ -4831,8 +4825,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4831
4825
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4832
4826
|
}
|
|
4833
4827
|
|
|
4834
|
-
function ownKeys$
|
|
4835
|
-
function _objectSpread$
|
|
4828
|
+
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; }
|
|
4829
|
+
function _objectSpread$_(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$_(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$_(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4836
4830
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4837
4831
|
var _context, _context4;
|
|
4838
4832
|
return {
|
|
@@ -4843,18 +4837,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4843
4837
|
key: resource.custom.type.key,
|
|
4844
4838
|
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4845
4839
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4846
|
-
var _fieldDefinition$type,
|
|
4840
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4847
4841
|
return {
|
|
4848
4842
|
name: fieldDefinition.name,
|
|
4849
4843
|
required: fieldDefinition.required,
|
|
4850
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4851
|
-
elementType: _objectSpread$
|
|
4844
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$_(_objectSpread$_({}, fieldDefinition.type), {}, {
|
|
4845
|
+
elementType: _objectSpread$_(_objectSpread$_({}, fieldDefinition.type.elementType), {}, {
|
|
4852
4846
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4853
4847
|
key: value.key,
|
|
4854
4848
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4855
4849
|
}))
|
|
4856
4850
|
})
|
|
4857
|
-
}) : ((_fieldDefinition$
|
|
4851
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$_(_objectSpread$_({}, fieldDefinition.type), {}, {
|
|
4858
4852
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4859
4853
|
key: value.key,
|
|
4860
4854
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4865,7 +4859,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4865
4859
|
})
|
|
4866
4860
|
}
|
|
4867
4861
|
},
|
|
4868
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4862
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$_(_objectSpread$_({}, fields), {}, {
|
|
4869
4863
|
[customField.name]: customField.value
|
|
4870
4864
|
}), {})
|
|
4871
4865
|
};
|
|
@@ -4877,7 +4871,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4877
4871
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4878
4872
|
// in either case we return null
|
|
4879
4873
|
if (!productSelection) return null;
|
|
4880
|
-
return _objectSpread$
|
|
4874
|
+
return _objectSpread$_(_objectSpread$_({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4881
4875
|
from: 'nameAllLocales',
|
|
4882
4876
|
to: 'name'
|
|
4883
4877
|
}])), {}, {
|
|
@@ -4900,8 +4894,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4900
4894
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4901
4895
|
};
|
|
4902
4896
|
|
|
4903
|
-
function ownKeys$
|
|
4904
|
-
function _objectSpread$
|
|
4897
|
+
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; }
|
|
4898
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$Z(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$Z(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4905
4899
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4906
4900
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4907
4901
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4918,7 +4912,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4918
4912
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4919
4913
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4920
4914
|
const definitionName = definition.type.elementType.name;
|
|
4921
|
-
return _objectSpread$
|
|
4915
|
+
return _objectSpread$Z(_objectSpread$Z({}, updateAction), {}, {
|
|
4922
4916
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4923
4917
|
});
|
|
4924
4918
|
}
|
|
@@ -4992,8 +4986,8 @@ function omitSetsOfSets() {
|
|
|
4992
4986
|
|
|
4993
4987
|
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
4988
|
|
|
4995
|
-
function ownKeys$
|
|
4996
|
-
function _objectSpread$
|
|
4989
|
+
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; }
|
|
4990
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$Y(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$Y(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4997
4991
|
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
4992
|
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
4993
|
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 +5047,7 @@ const mapDataToProps = _ref => {
|
|
|
5053
5047
|
return {
|
|
5054
5048
|
fetchTypeDefinitionsQuery: {
|
|
5055
5049
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5056
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5050
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$Y({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5057
5051
|
isImmutable: true
|
|
5058
5052
|
}), [{
|
|
5059
5053
|
from: 'labelAllLocales',
|
|
@@ -5081,12 +5075,12 @@ const handlers$2 = {
|
|
|
5081
5075
|
}
|
|
5082
5076
|
};
|
|
5083
5077
|
|
|
5084
|
-
function ownKeys$
|
|
5085
|
-
function _objectSpread$
|
|
5078
|
+
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; }
|
|
5079
|
+
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; }
|
|
5086
5080
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5087
5081
|
return {
|
|
5088
5082
|
fields: customFieldsFromRestResponse.fields,
|
|
5089
|
-
type: _objectSpread$
|
|
5083
|
+
type: _objectSpread$X({
|
|
5090
5084
|
id: customFieldsFromRestResponse.type.id
|
|
5091
5085
|
}, customFieldsFromRestResponse.type.obj)
|
|
5092
5086
|
};
|
|
@@ -5100,19 +5094,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5100
5094
|
key: typeDefinition.key,
|
|
5101
5095
|
name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5102
5096
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5103
|
-
var _fieldDefinition$type,
|
|
5097
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5104
5098
|
return {
|
|
5105
5099
|
name: fieldDefinition.name,
|
|
5106
5100
|
required: fieldDefinition.required,
|
|
5107
5101
|
inputHint: fieldDefinition.inputHint,
|
|
5108
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5109
|
-
elementType: _objectSpread$
|
|
5102
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
5103
|
+
elementType: _objectSpread$X(_objectSpread$X({}, fieldDefinition.type.elementType), {}, {
|
|
5110
5104
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5111
5105
|
key: value.key,
|
|
5112
5106
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5113
5107
|
}))
|
|
5114
5108
|
})
|
|
5115
|
-
}) : ((_fieldDefinition$
|
|
5109
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
5116
5110
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5117
5111
|
key: value.key,
|
|
5118
5112
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5128,7 +5122,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5128
5122
|
type: {
|
|
5129
5123
|
id: formCustomFields.type.id,
|
|
5130
5124
|
typeId: 'type',
|
|
5131
|
-
obj: _objectSpread$
|
|
5125
|
+
obj: _objectSpread$X({}, formCustomFields.type)
|
|
5132
5126
|
},
|
|
5133
5127
|
fields: formCustomFields.fields
|
|
5134
5128
|
});
|
|
@@ -5136,7 +5130,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5136
5130
|
type: {
|
|
5137
5131
|
id: formCustomFields.type.id,
|
|
5138
5132
|
typeId: 'type',
|
|
5139
|
-
obj: _objectSpread$
|
|
5133
|
+
obj: _objectSpread$X({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5140
5134
|
},
|
|
5141
5135
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5142
5136
|
});
|
|
@@ -5152,7 +5146,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5152
5146
|
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
5147
|
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
5148
|
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'];
|
|
5149
|
+
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
5150
|
const emptyTypeDefinitions = {
|
|
5157
5151
|
total: 0,
|
|
5158
5152
|
count: 0,
|
|
@@ -5210,13 +5204,13 @@ const createGraphQlOptions = ownProps => {
|
|
|
5210
5204
|
}
|
|
5211
5205
|
};
|
|
5212
5206
|
};
|
|
5213
|
-
var
|
|
5207
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics__default["default"](hoc.graphql(FetchTypeDefinitionsWithNamesQuery, {
|
|
5214
5208
|
name: 'fetchTypeDefinitionsQuery',
|
|
5215
5209
|
skip: ownProps => ownProps.isDisabled,
|
|
5216
5210
|
options: createGraphQlOptions
|
|
5217
5211
|
})(CustomFieldTypeDefinitionsConnector), CustomFieldTypeDefinitionsConnector);
|
|
5218
5212
|
|
|
5219
|
-
const getType
|
|
5213
|
+
const getType = fieldDefinition => {
|
|
5220
5214
|
const fieldDefinitionType = fieldDefinition.type.name.toLowerCase() === 'set' ? fieldDefinition.type.elementType : fieldDefinition.type;
|
|
5221
5215
|
return fieldDefinitionType;
|
|
5222
5216
|
};
|
|
@@ -5267,8 +5261,8 @@ const REFERENCED_TYPES = {
|
|
|
5267
5261
|
zone: 'zone'
|
|
5268
5262
|
};
|
|
5269
5263
|
|
|
5270
|
-
function ownKeys$
|
|
5271
|
-
function _objectSpread$
|
|
5264
|
+
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; }
|
|
5265
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$W(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$W(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5272
5266
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5273
5267
|
let validatedValues = [];
|
|
5274
5268
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5281,7 +5275,7 @@ const extractDuplicatedValues = (values, type, language, languages) => {
|
|
|
5281
5275
|
const setDuplicatedIfSet = (formValues, fieldDefinition, language, languages) => {
|
|
5282
5276
|
const fieldValue = formValues.custom.fields[fieldDefinition.name];
|
|
5283
5277
|
if (fieldDefinition.type.name.toLowerCase() === 'set' && _Array$isArray__default["default"](fieldValue)) {
|
|
5284
|
-
const duplicatedValues = extractDuplicatedValues(fieldValue, getType
|
|
5278
|
+
const duplicatedValues = extractDuplicatedValues(fieldValue, getType(fieldDefinition), language, languages);
|
|
5285
5279
|
return {
|
|
5286
5280
|
duplicated: {
|
|
5287
5281
|
// although this is mixing concerns, we pass down `duplicatedValues` to the form.
|
|
@@ -5335,8 +5329,8 @@ function validations (formValues, language, languages) {
|
|
|
5335
5329
|
var _context2;
|
|
5336
5330
|
// Collect all required and set type fields
|
|
5337
5331
|
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$
|
|
5332
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$W(_objectSpread$W({}, acc), {}, {
|
|
5333
|
+
[fieldDefinition.name]: _objectSpread$W(_objectSpread$W({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5340
5334
|
}), {});
|
|
5341
5335
|
return withoutEmptyErrorsByField(errors);
|
|
5342
5336
|
}
|
|
@@ -5363,8 +5357,8 @@ function CustomTextInput(props) {
|
|
|
5363
5357
|
}
|
|
5364
5358
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5365
5359
|
|
|
5366
|
-
function ownKeys$
|
|
5367
|
-
function _objectSpread$
|
|
5360
|
+
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; }
|
|
5361
|
+
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; }
|
|
5368
5362
|
const getSubfieldLanguage = subfieldName => {
|
|
5369
5363
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5370
5364
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5388,7 +5382,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5388
5382
|
// as a whole.
|
|
5389
5383
|
|
|
5390
5384
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5391
|
-
const newValue = _objectSpread$
|
|
5385
|
+
const newValue = _objectSpread$V(_objectSpread$V({}, props.value), {}, {
|
|
5392
5386
|
[fieldLanguage]: rawValue
|
|
5393
5387
|
});
|
|
5394
5388
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5455,21 +5449,21 @@ function CustomNumberInput(props) {
|
|
|
5455
5449
|
}
|
|
5456
5450
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5457
5451
|
|
|
5458
|
-
function ownKeys$
|
|
5459
|
-
function _objectSpread$
|
|
5452
|
+
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; }
|
|
5453
|
+
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; }
|
|
5460
5454
|
var styles$f = {
|
|
5461
5455
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5462
5456
|
};
|
|
5463
5457
|
const fixCurrencyCode = (value, currencies) => {
|
|
5464
5458
|
if (value.currencyCode) return value;
|
|
5465
5459
|
const firstCurrency = currencies[0];
|
|
5466
|
-
return _objectSpread$
|
|
5460
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5467
5461
|
currencyCode: firstCurrency
|
|
5468
5462
|
});
|
|
5469
5463
|
};
|
|
5470
5464
|
const fixAmount = value => {
|
|
5471
5465
|
if (!value.amount) {
|
|
5472
|
-
return _objectSpread$
|
|
5466
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5473
5467
|
amount: '0'
|
|
5474
5468
|
});
|
|
5475
5469
|
}
|
|
@@ -5511,7 +5505,7 @@ function CustomMoneyInput(props) {
|
|
|
5511
5505
|
}
|
|
5512
5506
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5513
5507
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5514
|
-
const newValue = _objectSpread$
|
|
5508
|
+
const newValue = _objectSpread$U({}, internalValue.current);
|
|
5515
5509
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5516
5510
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5517
5511
|
internalValue.current = fixedValue;
|
|
@@ -5792,7 +5786,7 @@ function ReferenceSearch(props) {
|
|
|
5792
5786
|
});
|
|
5793
5787
|
}
|
|
5794
5788
|
|
|
5795
|
-
const messages$
|
|
5789
|
+
const messages$B = reactIntl.defineMessages({
|
|
5796
5790
|
placeholder: {
|
|
5797
5791
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5798
5792
|
description: 'Placeholder for search for a category',
|
|
@@ -5825,8 +5819,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5825
5819
|
}
|
|
5826
5820
|
});
|
|
5827
5821
|
|
|
5828
|
-
function ownKeys$
|
|
5829
|
-
function _objectSpread$
|
|
5822
|
+
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; }
|
|
5823
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$T(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$T(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5830
5824
|
function Option$1(props) {
|
|
5831
5825
|
var _context, _context2;
|
|
5832
5826
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5838,7 +5832,7 @@ function Option$1(props) {
|
|
|
5838
5832
|
const _useIntl = reactIntl.useIntl(),
|
|
5839
5833
|
formatMessage = _useIntl.formatMessage;
|
|
5840
5834
|
const category = props.data;
|
|
5841
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5835
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$T(_objectSpread$T({}, props), {}, {
|
|
5842
5836
|
children: jsxRuntime.jsxs("div", {
|
|
5843
5837
|
"data-testid": "category-option",
|
|
5844
5838
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5849,7 +5843,7 @@ function Option$1(props) {
|
|
|
5849
5843
|
fallbackOrder: languages
|
|
5850
5844
|
})
|
|
5851
5845
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5852
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5846
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5853
5847
|
key: 'name',
|
|
5854
5848
|
locale: language,
|
|
5855
5849
|
fallbackOrder: languages
|
|
@@ -5861,14 +5855,14 @@ function Option$1(props) {
|
|
|
5861
5855
|
fallbackOrder: languages
|
|
5862
5856
|
}))
|
|
5863
5857
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5864
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5858
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5865
5859
|
})]
|
|
5866
5860
|
})
|
|
5867
5861
|
}));
|
|
5868
5862
|
}
|
|
5869
5863
|
|
|
5870
|
-
function ownKeys$
|
|
5871
|
-
function _objectSpread$
|
|
5864
|
+
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; }
|
|
5865
|
+
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; }
|
|
5872
5866
|
const filterOption$1 = () => true;
|
|
5873
5867
|
function CategoryReferenceSearch(props) {
|
|
5874
5868
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5880,7 +5874,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5880
5874
|
})),
|
|
5881
5875
|
language = _useApplicationContex.language,
|
|
5882
5876
|
languages = _useApplicationContex.languages;
|
|
5883
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5877
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$S(_objectSpread$S({}, category), {}, {
|
|
5884
5878
|
value: category.id,
|
|
5885
5879
|
label: l10n.formatLocalizedString(category, {
|
|
5886
5880
|
key: 'name',
|
|
@@ -5898,7 +5892,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5898
5892
|
}), [apolloClient]);
|
|
5899
5893
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5900
5894
|
id: props.id,
|
|
5901
|
-
components: _objectSpread$
|
|
5895
|
+
components: _objectSpread$S({
|
|
5902
5896
|
Option: Option$1
|
|
5903
5897
|
}, props.components),
|
|
5904
5898
|
isClearable: props.isClearable,
|
|
@@ -5909,10 +5903,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5909
5903
|
onBlur: props.onBlur,
|
|
5910
5904
|
onChange: props.onChange,
|
|
5911
5905
|
value: props.value,
|
|
5912
|
-
placeholderLabel: formatMessage(messages$
|
|
5913
|
-
searchPromptLabel: formatMessage(messages$
|
|
5914
|
-
noResultsLabel: formatMessage(messages$
|
|
5915
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5906
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5907
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5908
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5909
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5916
5910
|
mapItemToOption: mapItemToOption,
|
|
5917
5911
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5918
5912
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5988,7 +5982,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5988
5982
|
});
|
|
5989
5983
|
}
|
|
5990
5984
|
|
|
5991
|
-
const messages$
|
|
5985
|
+
const messages$A = reactIntl.defineMessages({
|
|
5992
5986
|
placeholder: {
|
|
5993
5987
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5994
5988
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6016,8 +6010,8 @@ const messages$z = reactIntl.defineMessages({
|
|
|
6016
6010
|
}
|
|
6017
6011
|
});
|
|
6018
6012
|
|
|
6019
|
-
function ownKeys$
|
|
6020
|
-
function _objectSpread$
|
|
6013
|
+
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; }
|
|
6014
|
+
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; }
|
|
6021
6015
|
function Option(props) {
|
|
6022
6016
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6023
6017
|
language: applicationContext.dataLocale,
|
|
@@ -6028,7 +6022,7 @@ function Option(props) {
|
|
|
6028
6022
|
const _useIntl = reactIntl.useIntl(),
|
|
6029
6023
|
formatMessage = _useIntl.formatMessage;
|
|
6030
6024
|
const cartDiscount = props.data;
|
|
6031
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6025
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$R(_objectSpread$R({}, props), {}, {
|
|
6032
6026
|
children: jsxRuntime.jsxs("div", {
|
|
6033
6027
|
"data-testid": "cart-discount-option",
|
|
6034
6028
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6039,14 +6033,14 @@ function Option(props) {
|
|
|
6039
6033
|
fallbackOrder: languages
|
|
6040
6034
|
})
|
|
6041
6035
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6042
|
-
children: [formatMessage(messages$
|
|
6036
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6043
6037
|
})]
|
|
6044
6038
|
})
|
|
6045
6039
|
}));
|
|
6046
6040
|
}
|
|
6047
6041
|
|
|
6048
|
-
function ownKeys$
|
|
6049
|
-
function _objectSpread$
|
|
6042
|
+
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; }
|
|
6043
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$Q(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$Q(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6050
6044
|
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
6045
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6052
6046
|
const filterOption = (option, text) => {
|
|
@@ -6072,7 +6066,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6072
6066
|
})),
|
|
6073
6067
|
language = _useApplicationContex.language,
|
|
6074
6068
|
languages = _useApplicationContex.languages;
|
|
6075
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6069
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$Q(_objectSpread$Q({}, cartDiscount), {}, {
|
|
6076
6070
|
value: cartDiscount.id,
|
|
6077
6071
|
key: cartDiscount.key,
|
|
6078
6072
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6115,10 +6109,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6115
6109
|
onBlur: props.onBlur,
|
|
6116
6110
|
onChange: props.onChange,
|
|
6117
6111
|
value: returnNullIfEmpty(props.value),
|
|
6118
|
-
placeholderLabel: formatMessage(messages$
|
|
6119
|
-
searchPromptLabel: formatMessage(messages$
|
|
6120
|
-
noResultsLabel: formatMessage(messages$
|
|
6121
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6112
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6113
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6114
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6115
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6122
6116
|
mapItemToOption: mapItemToOption,
|
|
6123
6117
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6124
6118
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6179,7 +6173,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6179
6173
|
});
|
|
6180
6174
|
}
|
|
6181
6175
|
|
|
6182
|
-
var messages$
|
|
6176
|
+
var messages$z = reactIntl.defineMessages({
|
|
6183
6177
|
noProductsFound: {
|
|
6184
6178
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6185
6179
|
description: 'The message to display when no products were found',
|
|
@@ -6268,7 +6262,7 @@ const ProductPickerInput = _ref => {
|
|
|
6268
6262
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6269
6263
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6270
6264
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6271
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6265
|
+
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
6266
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6273
6267
|
max: "scale",
|
|
6274
6268
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -6278,7 +6272,7 @@ const ProductPickerInput = _ref => {
|
|
|
6278
6272
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6279
6273
|
id: name,
|
|
6280
6274
|
name: name,
|
|
6281
|
-
placeholder: formatMessage(messages$
|
|
6275
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6282
6276
|
loadOptions: loadOptionsDebounced,
|
|
6283
6277
|
defaultOptions: [],
|
|
6284
6278
|
isClearable: isClearable,
|
|
@@ -6292,7 +6286,7 @@ const ProductPickerInput = _ref => {
|
|
|
6292
6286
|
onInputChange: handleInputChange,
|
|
6293
6287
|
onBlur: onBlur,
|
|
6294
6288
|
value: currentOption.data,
|
|
6295
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6289
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6296
6290
|
hasError: hasError || isLoadingFailed
|
|
6297
6291
|
})
|
|
6298
6292
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6542,8 +6536,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6542
6536
|
}
|
|
6543
6537
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6544
6538
|
|
|
6545
|
-
function ownKeys$
|
|
6546
|
-
function _objectSpread$
|
|
6539
|
+
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; }
|
|
6540
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$P(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$P(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6547
6541
|
const getTypeName = type => type.name.toLowerCase();
|
|
6548
6542
|
const findLabel = (enumType, key) => {
|
|
6549
6543
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6587,12 +6581,13 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6587
6581
|
inputHint: attributeDefinition.inputHint,
|
|
6588
6582
|
inputTip: attributeDefinition.inputTip,
|
|
6589
6583
|
required: attributeDefinition.isRequired,
|
|
6590
|
-
type: attributeDefinition.type
|
|
6584
|
+
type: attributeDefinition.type,
|
|
6585
|
+
assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
|
|
6591
6586
|
});
|
|
6592
6587
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6593
6588
|
let name = _ref2.name,
|
|
6594
6589
|
value = _ref2.value;
|
|
6595
|
-
return _objectSpread$
|
|
6590
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
6596
6591
|
[name]: value
|
|
6597
6592
|
});
|
|
6598
6593
|
}, {});
|
|
@@ -6676,7 +6671,7 @@ function ProductAttributeInput(props) {
|
|
|
6676
6671
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6677
6672
|
|
|
6678
6673
|
// eslint-disable-next-line import/prefer-default-export
|
|
6679
|
-
const messages$
|
|
6674
|
+
const messages$y = reactIntl.defineMessages({
|
|
6680
6675
|
aboveFifthLevelWarning: {
|
|
6681
6676
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6682
6677
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6689,23 +6684,23 @@ const messages$x = reactIntl.defineMessages({
|
|
|
6689
6684
|
}
|
|
6690
6685
|
});
|
|
6691
6686
|
|
|
6692
|
-
function ownKeys$
|
|
6693
|
-
function _objectSpread$
|
|
6687
|
+
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; }
|
|
6688
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$O(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$O(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6694
6689
|
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
6690
|
const mapAttributeDefinition = definition => {
|
|
6696
|
-
var _context, _definition$type,
|
|
6697
|
-
return _objectSpread$
|
|
6691
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6692
|
+
return _objectSpread$O(_objectSpread$O({}, definition), {}, {
|
|
6698
6693
|
required: definition.isRequired,
|
|
6699
6694
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6700
6695
|
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$
|
|
6696
|
+
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$O(_objectSpread$O({}, definition.type), {}, {
|
|
6697
|
+
elementType: _objectSpread$O(_objectSpread$O({}, definition.type.elementType), {}, {
|
|
6703
6698
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6704
6699
|
key: value.key,
|
|
6705
6700
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6706
6701
|
}))
|
|
6707
6702
|
})
|
|
6708
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6703
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$O(_objectSpread$O({}, definition.type), {}, {
|
|
6709
6704
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6710
6705
|
key: value.key,
|
|
6711
6706
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6746,7 +6741,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6746
6741
|
};
|
|
6747
6742
|
}
|
|
6748
6743
|
|
|
6749
|
-
var messages$
|
|
6744
|
+
var messages$x = reactIntl.defineMessages({
|
|
6750
6745
|
updateButton: {
|
|
6751
6746
|
id: 'NestedAttributes.Details.updateButton',
|
|
6752
6747
|
description: 'Update button label',
|
|
@@ -6826,14 +6821,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
6826
6821
|
|
|
6827
6822
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6828
6823
|
|
|
6829
|
-
function ownKeys$
|
|
6830
|
-
function _objectSpread$
|
|
6824
|
+
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; }
|
|
6825
|
+
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; }
|
|
6831
6826
|
const EditButton = props => {
|
|
6832
6827
|
const _useIntl = reactIntl.useIntl(),
|
|
6833
6828
|
formatMessage = _useIntl.formatMessage;
|
|
6834
6829
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
6835
6830
|
placement: "top",
|
|
6836
|
-
title: formatMessage(messages$
|
|
6831
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6837
6832
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
6838
6833
|
label: "Edit",
|
|
6839
6834
|
isDisabled: props.isDisabled,
|
|
@@ -6849,12 +6844,12 @@ const DropChangesConfirmation = props => {
|
|
|
6849
6844
|
formatMessage = _useIntl2.formatMessage;
|
|
6850
6845
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
6851
6846
|
isOpen: props.isOpen || false,
|
|
6852
|
-
title: formatMessage(messages$
|
|
6853
|
-
labelPrimary: formatMessage(messages$
|
|
6847
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6848
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6854
6849
|
onConfirm: props.onConfirm,
|
|
6855
6850
|
onCancel: props.onCancel,
|
|
6856
6851
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6857
|
-
intlMessage: messages$
|
|
6852
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6858
6853
|
})
|
|
6859
6854
|
});
|
|
6860
6855
|
};
|
|
@@ -6879,11 +6874,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6879
6874
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
6880
6875
|
isDisabled: !formik$1.dirty,
|
|
6881
6876
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
6882
|
-
label: formatMessage(messages$
|
|
6877
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6883
6878
|
onClick: formik$1.resetForm
|
|
6884
6879
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
6885
6880
|
isDisabled: !formik$1.dirty,
|
|
6886
|
-
label: formatMessage(messages$
|
|
6881
|
+
label: formatMessage(messages$x.updateButton),
|
|
6887
6882
|
onClick: formik$1.handleSubmit
|
|
6888
6883
|
})]
|
|
6889
6884
|
}),
|
|
@@ -6912,7 +6907,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6912
6907
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
6913
6908
|
title: "",
|
|
6914
6909
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6915
|
-
intlMessage: messages$
|
|
6910
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6916
6911
|
}),
|
|
6917
6912
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
6918
6913
|
});
|
|
@@ -6924,7 +6919,7 @@ const NestedInputControls = props => {
|
|
|
6924
6919
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
6925
6920
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6926
6921
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6927
|
-
intlMessage: messages$
|
|
6922
|
+
intlMessage: messages$x.emptyProductType,
|
|
6928
6923
|
tone: "secondary"
|
|
6929
6924
|
});
|
|
6930
6925
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -6938,7 +6933,7 @@ const NestedInputControls = props => {
|
|
|
6938
6933
|
children: props.productType.name
|
|
6939
6934
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
6940
6935
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
6941
|
-
children: formatMessage(messages$
|
|
6936
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6942
6937
|
})
|
|
6943
6938
|
})]
|
|
6944
6939
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -6974,13 +6969,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6974
6969
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6975
6970
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6976
6971
|
const openNestedAttributesForm = () => {
|
|
6977
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6972
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6978
6973
|
hideSaveToolbar: true
|
|
6979
6974
|
}));
|
|
6980
6975
|
attributesForm.openModal();
|
|
6981
6976
|
};
|
|
6982
6977
|
const closeNestedAttributesForm = () => {
|
|
6983
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6978
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6984
6979
|
hideSaveToolbar: false
|
|
6985
6980
|
}));
|
|
6986
6981
|
attributesForm.closeModal();
|
|
@@ -7000,7 +6995,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7000
6995
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7001
6996
|
kind: 'success',
|
|
7002
6997
|
domain: constants.DOMAINS.SIDE,
|
|
7003
|
-
text: formatMessage(messages$
|
|
6998
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
7004
6999
|
});
|
|
7005
7000
|
setSubmitting(false);
|
|
7006
7001
|
},
|
|
@@ -7084,8 +7079,8 @@ const SetButtons = props => {
|
|
|
7084
7079
|
};
|
|
7085
7080
|
SetButtons.displayName = 'SetButtons';
|
|
7086
7081
|
|
|
7087
|
-
function ownKeys$
|
|
7088
|
-
function _objectSpread$
|
|
7082
|
+
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; }
|
|
7083
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$M(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$M(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7089
7084
|
const getDuplicateErrors = setValues => {
|
|
7090
7085
|
/* eslint-disable no-plusplus */
|
|
7091
7086
|
const result = [];
|
|
@@ -7142,7 +7137,7 @@ function CustomInputSet(props) {
|
|
|
7142
7137
|
touched = _useFormikContext.touched,
|
|
7143
7138
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7144
7139
|
dirty = _useFormikContext.dirty;
|
|
7145
|
-
const itemFieldDefinition = _objectSpread$
|
|
7140
|
+
const itemFieldDefinition = _objectSpread$M(_objectSpread$M({}, props.fieldDefinition), {}, {
|
|
7146
7141
|
type: props.fieldDefinition.type.elementType
|
|
7147
7142
|
});
|
|
7148
7143
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7200,7 +7195,7 @@ function CustomInputSet(props) {
|
|
|
7200
7195
|
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
7201
7196
|
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
7202
7197
|
// type is selected.
|
|
7203
|
-
const type = getType
|
|
7198
|
+
const type = getType(props.fieldDefinition);
|
|
7204
7199
|
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
7205
7200
|
const areButtonsTopAligned = _includesInstanceProperty__default["default"](_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
|
|
7206
7201
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -7280,7 +7275,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7280
7275
|
// Boolean is the only set element with peculiarities (i.e. way more
|
|
7281
7276
|
// convenient for user to work with it as with select input with three values:
|
|
7282
7277
|
// [true], [false] and [true, false]).
|
|
7283
|
-
if (((_getSetElementType = getType
|
|
7278
|
+
if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
|
|
7284
7279
|
return CustomBooleanInputSet;
|
|
7285
7280
|
}
|
|
7286
7281
|
// All the rest sets are just a fancy wrapper around single-item components
|
|
@@ -7302,7 +7297,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7302
7297
|
});
|
|
7303
7298
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7304
7299
|
|
|
7305
|
-
var messages$
|
|
7300
|
+
var messages$w = reactIntl.defineMessages({
|
|
7306
7301
|
referencedProductType: {
|
|
7307
7302
|
id: 'NestedAttributes.referencedProductType',
|
|
7308
7303
|
description: 'Product type referenced hint',
|
|
@@ -7310,10 +7305,10 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7310
7305
|
}
|
|
7311
7306
|
});
|
|
7312
7307
|
|
|
7313
|
-
function ownKeys$
|
|
7314
|
-
function _objectSpread$
|
|
7308
|
+
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; }
|
|
7309
|
+
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; }
|
|
7315
7310
|
function ProductTypeReference(props) {
|
|
7316
|
-
const productTypeMessage = _objectSpread$
|
|
7311
|
+
const productTypeMessage = _objectSpread$L(_objectSpread$L({}, messages$w.referencedProductType), {}, {
|
|
7317
7312
|
values: {
|
|
7318
7313
|
productTypeName: props.productType.name
|
|
7319
7314
|
}
|
|
@@ -7359,9 +7354,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7359
7354
|
}
|
|
7360
7355
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7361
7356
|
|
|
7362
|
-
function ownKeys$
|
|
7363
|
-
function _objectSpread$
|
|
7364
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7357
|
+
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; }
|
|
7358
|
+
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; }
|
|
7359
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$K(_objectSpread$K({}, result), itemErrors), {});
|
|
7365
7360
|
|
|
7366
7361
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7367
7362
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7372,15 +7367,15 @@ const CustomFieldErrors = props => {
|
|
|
7372
7367
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7373
7368
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7374
7369
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7375
|
-
intlMessage: messages$
|
|
7370
|
+
intlMessage: messages$K.required
|
|
7376
7371
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7377
|
-
intlMessage: messages$
|
|
7372
|
+
intlMessage: messages$K.unique
|
|
7378
7373
|
})]
|
|
7379
7374
|
});
|
|
7380
7375
|
};
|
|
7381
7376
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7382
7377
|
|
|
7383
|
-
var messages$
|
|
7378
|
+
var messages$v = reactIntl.defineMessages({
|
|
7384
7379
|
productReferenceLabel: {
|
|
7385
7380
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7386
7381
|
description: 'Label shown above the product picker input.',
|
|
@@ -7410,16 +7405,21 @@ var messages$u = reactIntl.defineMessages({
|
|
|
7410
7405
|
id: 'cartDiscountMoreThan500',
|
|
7411
7406
|
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
7412
7407
|
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
7408
|
+
},
|
|
7409
|
+
attributeGroupCountTooltip: {
|
|
7410
|
+
id: 'CustomFieldsLabel.attributeGroupCountTooltip',
|
|
7411
|
+
description: 'Tooltip message to display when the same attribute is assigned to multiple attribute groups',
|
|
7412
|
+
defaultMessage: 'Synced with {count} Attribute groups: {attributeGroups}'
|
|
7413
7413
|
}
|
|
7414
7414
|
});
|
|
7415
7415
|
|
|
7416
|
-
function ownKeys$
|
|
7417
|
-
function _objectSpread$
|
|
7416
|
+
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; }
|
|
7417
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(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$J(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
|
-
const CustomFieldsLabelHint =
|
|
7419
|
+
const CustomFieldsLabelHint = _ref2 => {
|
|
7420
7420
|
var _type$name;
|
|
7421
|
-
let fieldDefinition =
|
|
7422
|
-
const type = getType
|
|
7421
|
+
let fieldDefinition = _ref2.fieldDefinition;
|
|
7422
|
+
const type = getType(fieldDefinition);
|
|
7423
7423
|
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
7424
7424
|
const referenceTypeId = type.referenceTypeId;
|
|
7425
7425
|
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
@@ -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$J({}, messages$v.cartDiscountMoreThan500))]
|
|
7448
7448
|
});
|
|
7449
7449
|
}
|
|
7450
7450
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7458,28 +7458,56 @@ 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
|
|
7466
7466
|
// should belong to <CustomReferenceInput /> component instead.
|
|
7467
|
-
function CustomFieldsLabelSubtitle(
|
|
7467
|
+
function CustomFieldsLabelSubtitle(_ref3) {
|
|
7468
7468
|
var _type$name2, _context;
|
|
7469
|
-
let fieldDefinition =
|
|
7469
|
+
let fieldDefinition = _ref3.fieldDefinition;
|
|
7470
7470
|
const _useIntl2 = reactIntl.useIntl(),
|
|
7471
7471
|
formatMessage = _useIntl2.formatMessage;
|
|
7472
|
-
const type = getType
|
|
7472
|
+
const type = getType(fieldDefinition);
|
|
7473
7473
|
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
7474
7474
|
if (!isReference) return null;
|
|
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
|
+
}
|
|
7480
|
+
const Portal = props => /*#__PURE__*/ReactDOM__default["default"].createPortal(props.children, document.body);
|
|
7481
|
+
var _ref = {
|
|
7482
|
+
name: "ar8y70",
|
|
7483
|
+
styles: "cursor:pointer;line-height:normal"
|
|
7484
|
+
} ;
|
|
7485
|
+
function CustomFieldsCountIndicator(_ref4) {
|
|
7486
|
+
let assignedAttributeGroups = _ref4.assignedAttributeGroups;
|
|
7487
|
+
const formatLocalizedField = useFormatLocalizedFieldToString();
|
|
7488
|
+
const _useIntl3 = reactIntl.useIntl(),
|
|
7489
|
+
formatMessage = _useIntl3.formatMessage;
|
|
7490
|
+
return (assignedAttributeGroups === null || assignedAttributeGroups === void 0 ? void 0 : assignedAttributeGroups.length) > 1 ? jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7491
|
+
title: formatMessage(messages$v.attributeGroupCountTooltip, {
|
|
7492
|
+
attributeGroups: _mapInstanceProperty__default["default"](assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
|
|
7493
|
+
count: assignedAttributeGroups.length
|
|
7494
|
+
}),
|
|
7495
|
+
horizontalConstraint: 7,
|
|
7496
|
+
components: {
|
|
7497
|
+
TooltipWrapperComponent: Portal
|
|
7498
|
+
},
|
|
7499
|
+
children: jsxRuntime.jsx("div", {
|
|
7500
|
+
css: _ref,
|
|
7501
|
+
children: jsxRuntime.jsx(uiKit.SwitcherIcon, {
|
|
7502
|
+
color: "info",
|
|
7503
|
+
size: "medium"
|
|
7504
|
+
})
|
|
7505
|
+
})
|
|
7506
|
+
}) : null;
|
|
7479
7507
|
}
|
|
7480
|
-
const CustomFieldsLabel = /*#__PURE__*/React.memo(
|
|
7481
|
-
let name =
|
|
7482
|
-
fieldDefinition =
|
|
7508
|
+
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref5 => {
|
|
7509
|
+
let name = _ref5.name,
|
|
7510
|
+
fieldDefinition = _ref5.fieldDefinition;
|
|
7483
7511
|
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
7484
7512
|
languages: applicationContext.project.languages,
|
|
7485
7513
|
language: applicationContext.dataLocale
|
|
@@ -7488,11 +7516,22 @@ const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
|
7488
7516
|
language = _useApplicationContex2.language;
|
|
7489
7517
|
return jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
7490
7518
|
htmlFor: name,
|
|
7491
|
-
title:
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7519
|
+
title: jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
7520
|
+
max: "scale",
|
|
7521
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7522
|
+
scale: "s",
|
|
7523
|
+
alignItems: "flex-end",
|
|
7524
|
+
children: [jsxRuntime.jsx("div", {
|
|
7525
|
+
children: l10n.formatLocalizedString(fieldDefinition, {
|
|
7526
|
+
key: 'label',
|
|
7527
|
+
locale: language,
|
|
7528
|
+
fallbackOrder: languages,
|
|
7529
|
+
fallback: fieldDefinition.name
|
|
7530
|
+
})
|
|
7531
|
+
}), jsxRuntime.jsx(CustomFieldsCountIndicator, {
|
|
7532
|
+
assignedAttributeGroups: fieldDefinition.assignedAttributeGroups
|
|
7533
|
+
})]
|
|
7534
|
+
})
|
|
7496
7535
|
}),
|
|
7497
7536
|
description: jsxRuntime.jsx(CustomFieldsLabelSubtitle, {
|
|
7498
7537
|
fieldDefinition: fieldDefinition
|
|
@@ -7630,23 +7669,23 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7630
7669
|
}
|
|
7631
7670
|
});
|
|
7632
7671
|
|
|
7633
|
-
function ownKeys$
|
|
7634
|
-
function _objectSpread$
|
|
7635
|
-
const
|
|
7636
|
-
INCLUSION: '
|
|
7637
|
-
EXCLUSION: '
|
|
7672
|
+
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; }
|
|
7673
|
+
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; }
|
|
7674
|
+
const PRODUCT_SELECTION_MODES = {
|
|
7675
|
+
INCLUSION: 'Individual',
|
|
7676
|
+
EXCLUSION: 'IndividualExclusion'
|
|
7638
7677
|
};
|
|
7639
|
-
const
|
|
7678
|
+
const PRODUCT_SELECTION_MODES_LABELS = {
|
|
7640
7679
|
INCLUSION: 'inclusion',
|
|
7641
7680
|
EXCLUSION: 'exclusion'
|
|
7642
7681
|
};
|
|
7643
|
-
const
|
|
7644
|
-
const
|
|
7682
|
+
const getMode = mode => mode === PRODUCT_SELECTION_MODES.INCLUSION || mode === PRODUCT_SELECTION_MODES_LABELS.INCLUSION ? 'inclusion' : 'exclusion';
|
|
7683
|
+
const addModeToLabel = function (ps) {
|
|
7645
7684
|
var _context;
|
|
7646
7685
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7647
7686
|
if (!ps) return undefined;
|
|
7648
|
-
return _objectSpread$
|
|
7649
|
-
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(
|
|
7687
|
+
return _objectSpread$I(_objectSpread$I({}, ps), {}, {
|
|
7688
|
+
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getMode(ps === null || ps === void 0 ? void 0 : ps.mode), ")") : '')
|
|
7650
7689
|
});
|
|
7651
7690
|
};
|
|
7652
7691
|
|
|
@@ -7667,9 +7706,9 @@ const mapProductSelectionsToOptions$1 = memoize__default["default"](function ()
|
|
|
7667
7706
|
return {
|
|
7668
7707
|
id: productSelection.id,
|
|
7669
7708
|
value: productSelection.id,
|
|
7670
|
-
label: _concatInstanceProperty__default["default"](_context = "".concat(label)).call(_context, _includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(
|
|
7709
|
+
label: _concatInstanceProperty__default["default"](_context = "".concat(label)).call(_context, _includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(getMode(productSelection.mode), ")") : ''),
|
|
7671
7710
|
key: productSelection.key,
|
|
7672
|
-
|
|
7711
|
+
mode: getMode(productSelection.mode)
|
|
7673
7712
|
};
|
|
7674
7713
|
});
|
|
7675
7714
|
});
|
|
@@ -7739,11 +7778,11 @@ const getValueFromOptions$3 = _ref => {
|
|
|
7739
7778
|
// handle async-select-field value transformation
|
|
7740
7779
|
if (isMulti) {
|
|
7741
7780
|
var _context;
|
|
7742
|
-
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value))).call(_context, ps =>
|
|
7781
|
+
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value))).call(_context, ps => addModeToLabel(ps, enableExcludingProducts));
|
|
7743
7782
|
}
|
|
7744
7783
|
|
|
7745
7784
|
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
7746
|
-
return
|
|
7785
|
+
return addModeToLabel(_findInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value), enableExcludingProducts);
|
|
7747
7786
|
};
|
|
7748
7787
|
const emptyStoreOption$1 = intl => [{
|
|
7749
7788
|
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
@@ -7790,7 +7829,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7790
7829
|
value: productSelection.id,
|
|
7791
7830
|
name: localizedName,
|
|
7792
7831
|
key: productSelection.key,
|
|
7793
|
-
|
|
7832
|
+
mode: getMode(productSelection.mode)
|
|
7794
7833
|
};
|
|
7795
7834
|
});
|
|
7796
7835
|
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
@@ -7845,7 +7884,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7845
7884
|
});
|
|
7846
7885
|
}
|
|
7847
7886
|
|
|
7848
|
-
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "
|
|
7887
|
+
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 223, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7849
7888
|
const createQueryVariables$4 = (productSelections, predicateField) => {
|
|
7850
7889
|
var _context;
|
|
7851
7890
|
return {
|
|
@@ -7869,7 +7908,7 @@ const useProductSelectionsByFieldFetcher = (productSelections, predicateField) =
|
|
|
7869
7908
|
};
|
|
7870
7909
|
};
|
|
7871
7910
|
|
|
7872
|
-
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "
|
|
7911
|
+
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 223, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n mode\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7873
7912
|
const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
7874
7913
|
let _ref$productSelection = _ref.productSelections,
|
|
7875
7914
|
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
@@ -7884,7 +7923,7 @@ const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
|
7884
7923
|
fallbackOrder: projectLanguages
|
|
7885
7924
|
}),
|
|
7886
7925
|
key: productSelection.key,
|
|
7887
|
-
|
|
7926
|
+
mode: getMode(productSelection.mode)
|
|
7888
7927
|
}));
|
|
7889
7928
|
});
|
|
7890
7929
|
const getValueFromOptions$2 = _ref2 => {
|
|
@@ -7896,10 +7935,10 @@ const getValueFromOptions$2 = _ref2 => {
|
|
|
7896
7935
|
return undefined;
|
|
7897
7936
|
}
|
|
7898
7937
|
if (isMulti) {
|
|
7899
|
-
return _mapInstanceProperty__default["default"](productSelectionFieldOptions).call(productSelectionFieldOptions, ps =>
|
|
7938
|
+
return _mapInstanceProperty__default["default"](productSelectionFieldOptions).call(productSelectionFieldOptions, ps => addModeToLabel(ps, enableExcludingProducts));
|
|
7900
7939
|
}
|
|
7901
7940
|
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
7902
|
-
return
|
|
7941
|
+
return addModeToLabel(productSelectionFieldOptions[0], enableExcludingProducts);
|
|
7903
7942
|
};
|
|
7904
7943
|
const createQueryVariables$3 = _ref3 => {
|
|
7905
7944
|
var _context;
|
|
@@ -7941,7 +7980,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7941
7980
|
fetchPolicy: 'network-only'
|
|
7942
7981
|
}),
|
|
7943
7982
|
data = _await$client$query.data;
|
|
7944
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7983
|
+
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
7984
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7946
7985
|
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7947
7986
|
var _context2;
|
|
@@ -7996,12 +8035,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7996
8035
|
});
|
|
7997
8036
|
}
|
|
7998
8037
|
|
|
7999
|
-
function ownKeys$
|
|
8000
|
-
function _objectSpread$
|
|
8001
|
-
function
|
|
8038
|
+
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; }
|
|
8039
|
+
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; }
|
|
8040
|
+
function ModeSelectInputOption(props) {
|
|
8002
8041
|
const data = props.data;
|
|
8003
8042
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
8004
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8043
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$H(_objectSpread$H({}, props), {}, {
|
|
8005
8044
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
8006
8045
|
scale: "xs",
|
|
8007
8046
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8010,24 +8049,24 @@ function TypeSelectInputOption(props) {
|
|
|
8010
8049
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
8011
8050
|
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
8012
8051
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
8013
|
-
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.
|
|
8052
|
+
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.mode) || noValueFallback]
|
|
8014
8053
|
})]
|
|
8015
8054
|
})
|
|
8016
8055
|
}));
|
|
8017
8056
|
}
|
|
8018
8057
|
|
|
8019
|
-
function ownKeys$
|
|
8020
|
-
function _objectSpread$
|
|
8058
|
+
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; }
|
|
8059
|
+
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; }
|
|
8021
8060
|
function ProductSelectionsPicker(props) {
|
|
8022
8061
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8023
8062
|
const components = React.useMemo(() => {
|
|
8024
8063
|
return {
|
|
8025
8064
|
Option: optionInnerProps => {
|
|
8026
8065
|
if (optionInnerProps.isDisabled) {
|
|
8027
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8066
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$G({}, optionInnerProps));
|
|
8028
8067
|
}
|
|
8029
8068
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8030
|
-
return jsxRuntime.jsx(
|
|
8069
|
+
return jsxRuntime.jsx(ModeSelectInputOption, _objectSpread$G({}, optionInnerProps));
|
|
8031
8070
|
}
|
|
8032
8071
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8033
8072
|
optionType: props.optionType,
|
|
@@ -8039,7 +8078,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8039
8078
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8040
8079
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8041
8080
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8042
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8081
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
8043
8082
|
components: components
|
|
8044
8083
|
}))
|
|
8045
8084
|
});
|
|
@@ -8062,7 +8101,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8062
8101
|
|
|
8063
8102
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8064
8103
|
|
|
8065
|
-
var messages$
|
|
8104
|
+
var messages$u = reactIntl.defineMessages({
|
|
8066
8105
|
countriesBasicSelectPlaceholder: {
|
|
8067
8106
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8068
8107
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8090,7 +8129,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8090
8129
|
value: props.value,
|
|
8091
8130
|
isRequired: props.isRequired,
|
|
8092
8131
|
description: props.description,
|
|
8093
|
-
placeholder: intl.formatMessage(messages$
|
|
8132
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8094
8133
|
options: props.options,
|
|
8095
8134
|
onChange: props.onChange,
|
|
8096
8135
|
isDisabled: props.isDisabled,
|
|
@@ -8100,10 +8139,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8100
8139
|
});
|
|
8101
8140
|
}
|
|
8102
8141
|
|
|
8103
|
-
function ownKeys$
|
|
8104
|
-
function _objectSpread$
|
|
8142
|
+
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; }
|
|
8143
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$F(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$F(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8105
8144
|
const emptyCountryOption = intl => [{
|
|
8106
|
-
label: intl.formatMessage(messages$
|
|
8145
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8107
8146
|
value: undefined,
|
|
8108
8147
|
isDisabled: true
|
|
8109
8148
|
}];
|
|
@@ -8128,7 +8167,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8128
8167
|
const onOptionChange = event => {
|
|
8129
8168
|
const countries = event.target.value;
|
|
8130
8169
|
props.onChange({
|
|
8131
|
-
target: _objectSpread$
|
|
8170
|
+
target: _objectSpread$F(_objectSpread$F({}, event.target), {}, {
|
|
8132
8171
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8133
8172
|
var _country$value;
|
|
8134
8173
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8149,7 +8188,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8149
8188
|
var _context3;
|
|
8150
8189
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8151
8190
|
}),
|
|
8152
|
-
placeholder: intl.formatMessage(messages$
|
|
8191
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8153
8192
|
loadOptions: handleLoadOptions,
|
|
8154
8193
|
onChange: onOptionChange,
|
|
8155
8194
|
isDisabled: props.isDisabled,
|
|
@@ -8159,13 +8198,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8159
8198
|
});
|
|
8160
8199
|
}
|
|
8161
8200
|
|
|
8162
|
-
function ownKeys$
|
|
8163
|
-
function _objectSpread$
|
|
8201
|
+
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; }
|
|
8202
|
+
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; }
|
|
8164
8203
|
function CountriesPicker(props) {
|
|
8165
8204
|
var _props$options;
|
|
8166
8205
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8167
8206
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8168
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8207
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$E({}, props))
|
|
8169
8208
|
});
|
|
8170
8209
|
}
|
|
8171
8210
|
CountriesPicker.defaultProps = {
|
|
@@ -8175,7 +8214,7 @@ CountriesPicker.defaultProps = {
|
|
|
8175
8214
|
hasWarning: false
|
|
8176
8215
|
};
|
|
8177
8216
|
|
|
8178
|
-
var messages$
|
|
8217
|
+
var messages$t = reactIntl.defineMessages({
|
|
8179
8218
|
noCustomerGroupsFound: {
|
|
8180
8219
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8181
8220
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8266,8 +8305,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8266
8305
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8267
8306
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8268
8307
|
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
|
|
8308
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8309
|
+
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
8310
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8272
8311
|
max: "scale",
|
|
8273
8312
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -8277,7 +8316,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8277
8316
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8278
8317
|
id: name,
|
|
8279
8318
|
name: name,
|
|
8280
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8319
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8281
8320
|
loadOptions: loadOptionsDebounced,
|
|
8282
8321
|
defaultOptions: true,
|
|
8283
8322
|
showOptionGroupDivider: true,
|
|
@@ -8347,7 +8386,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8347
8386
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8348
8387
|
};
|
|
8349
8388
|
|
|
8350
|
-
var messages$
|
|
8389
|
+
var messages$s = reactIntl.defineMessages({
|
|
8351
8390
|
basicSelectInputPlaceholder: {
|
|
8352
8391
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8353
8392
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8373,6 +8412,11 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8373
8412
|
description: 'The message shown in search select input when matches are found',
|
|
8374
8413
|
defaultMessage: 'No matches found for your search term'
|
|
8375
8414
|
},
|
|
8415
|
+
searchSelectInputNoValueMessage: {
|
|
8416
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8417
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8418
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8419
|
+
},
|
|
8376
8420
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8377
8421
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8378
8422
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8380,8 +8424,8 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8380
8424
|
}
|
|
8381
8425
|
});
|
|
8382
8426
|
|
|
8383
|
-
function ownKeys$
|
|
8384
|
-
function _objectSpread$
|
|
8427
|
+
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; }
|
|
8428
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$D(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$D(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8385
8429
|
const hasErrors$2 = errors => {
|
|
8386
8430
|
var _context;
|
|
8387
8431
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8406,7 +8450,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8406
8450
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8407
8451
|
};
|
|
8408
8452
|
const emptyStoreOption = intl => [{
|
|
8409
|
-
label: intl.formatMessage(messages$
|
|
8453
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8410
8454
|
value: undefined,
|
|
8411
8455
|
isDisabled: true
|
|
8412
8456
|
}];
|
|
@@ -8453,10 +8497,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8453
8497
|
};
|
|
8454
8498
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8455
8499
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8456
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8500
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$D(_objectSpread$D({
|
|
8457
8501
|
id: props.id,
|
|
8458
8502
|
name: props.name,
|
|
8459
|
-
placeholder: intl.formatMessage(messages$
|
|
8503
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8460
8504
|
horizontalConstraint: props.horizontalConstraint,
|
|
8461
8505
|
loadOptions: handleLoadOptions,
|
|
8462
8506
|
defaultOptions: true,
|
|
@@ -8496,8 +8540,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8496
8540
|
shouldFetchProductSelections: false
|
|
8497
8541
|
};
|
|
8498
8542
|
|
|
8499
|
-
function ownKeys$
|
|
8500
|
-
function _objectSpread$
|
|
8543
|
+
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; }
|
|
8544
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$C(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$C(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8501
8545
|
const hasErrors$1 = errors => {
|
|
8502
8546
|
var _context;
|
|
8503
8547
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8545,10 +8589,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8545
8589
|
};
|
|
8546
8590
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8547
8591
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8548
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8592
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$C(_objectSpread$C({
|
|
8549
8593
|
id: props.id,
|
|
8550
8594
|
name: props.name,
|
|
8551
|
-
placeholder: intl.formatMessage(messages$
|
|
8595
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8552
8596
|
horizontalConstraint: props.horizontalConstraint,
|
|
8553
8597
|
options: mappedStoresListOptions,
|
|
8554
8598
|
isMulti: props.isMulti,
|
|
@@ -8641,8 +8685,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8641
8685
|
};
|
|
8642
8686
|
};
|
|
8643
8687
|
|
|
8644
|
-
function ownKeys$
|
|
8645
|
-
function _objectSpread$
|
|
8688
|
+
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; }
|
|
8689
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$B(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$B(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8646
8690
|
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
8691
|
const hasErrors = errors => {
|
|
8648
8692
|
var _context;
|
|
@@ -8744,10 +8788,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8744
8788
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8745
8789
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8746
8790
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8747
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8791
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$B(_objectSpread$B({
|
|
8748
8792
|
id: props.id,
|
|
8749
8793
|
name: props.name,
|
|
8750
|
-
placeholder: intl.formatMessage(messages$
|
|
8794
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8751
8795
|
horizontalConstraint: props.horizontalConstraint,
|
|
8752
8796
|
loadOptions: loadOptionsDebounced,
|
|
8753
8797
|
defaultOptions: false,
|
|
@@ -8761,8 +8805,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8761
8805
|
}),
|
|
8762
8806
|
onChange: props.onChange,
|
|
8763
8807
|
onBlur: props.onBlur,
|
|
8764
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8765
|
-
noOptionsMessage:
|
|
8808
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8809
|
+
noOptionsMessage: _ref4 => {
|
|
8810
|
+
let inputValue = _ref4.inputValue;
|
|
8811
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8812
|
+
},
|
|
8766
8813
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8767
8814
|
isReadOnly: props.isReadOnly,
|
|
8768
8815
|
isClearable: props.isClearable,
|
|
@@ -8790,8 +8837,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8790
8837
|
shouldFetchProductSelections: false
|
|
8791
8838
|
};
|
|
8792
8839
|
|
|
8793
|
-
function ownKeys$
|
|
8794
|
-
function _objectSpread$
|
|
8840
|
+
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; }
|
|
8841
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$A(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$A(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8795
8842
|
const StoreSelectInput = props => {
|
|
8796
8843
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8797
8844
|
const components = React.useMemo(() => {
|
|
@@ -8799,7 +8846,7 @@ const StoreSelectInput = props => {
|
|
|
8799
8846
|
// eslint-disable-next-line react/display-name
|
|
8800
8847
|
Option: optionInnerProps => {
|
|
8801
8848
|
if (optionInnerProps.isDisabled) {
|
|
8802
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8849
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$A({}, optionInnerProps));
|
|
8803
8850
|
}
|
|
8804
8851
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8805
8852
|
optionType: props.optionType,
|
|
@@ -8810,7 +8857,7 @@ const StoreSelectInput = props => {
|
|
|
8810
8857
|
}, [props.optionType]);
|
|
8811
8858
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8812
8859
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8813
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8860
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8814
8861
|
projectKey: props.projectKey,
|
|
8815
8862
|
id: props.id,
|
|
8816
8863
|
name: props.name,
|
|
@@ -8865,7 +8912,7 @@ const businessRoleConstants = {
|
|
|
8865
8912
|
|
|
8866
8913
|
const businessRoleKeys = _Object$values__default["default"](businessRoleConstants);
|
|
8867
8914
|
|
|
8868
|
-
var messages$
|
|
8915
|
+
var messages$r = reactIntl.defineMessages({
|
|
8869
8916
|
ExecutiveManagement: {
|
|
8870
8917
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8871
8918
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8923,7 +8970,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8923
8970
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
8924
8971
|
}
|
|
8925
8972
|
|
|
8926
|
-
const messages$
|
|
8973
|
+
const messages$q = reactIntl.defineMessages({
|
|
8927
8974
|
inputFieldError: {
|
|
8928
8975
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8929
8976
|
description: 'Error message for empty input field ',
|
|
@@ -8944,14 +8991,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8944
8991
|
if (validateSingleFilter({
|
|
8945
8992
|
value
|
|
8946
8993
|
})) {
|
|
8947
|
-
return intl.formatMessage(messages$
|
|
8994
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8948
8995
|
}
|
|
8949
8996
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8950
8997
|
value: value.currencyCode
|
|
8951
8998
|
}) || validateSingleFilter({
|
|
8952
8999
|
value: value.amount
|
|
8953
9000
|
}))) {
|
|
8954
|
-
return intl.formatMessage(messages$
|
|
9001
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8955
9002
|
}
|
|
8956
9003
|
return null;
|
|
8957
9004
|
};
|
|
@@ -8959,7 +9006,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8959
9006
|
let value = _ref.value;
|
|
8960
9007
|
if (!value || !value.type) {
|
|
8961
9008
|
return {
|
|
8962
|
-
type: intl.formatMessage(messages$
|
|
9009
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8963
9010
|
};
|
|
8964
9011
|
}
|
|
8965
9012
|
const typeName = value.type.name;
|
|
@@ -8967,7 +9014,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8967
9014
|
const filterValue = value.value;
|
|
8968
9015
|
if (hasOption && !value.option) {
|
|
8969
9016
|
return {
|
|
8970
|
-
option: intl.formatMessage(messages$
|
|
9017
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8971
9018
|
};
|
|
8972
9019
|
}
|
|
8973
9020
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8986,7 +9033,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8986
9033
|
} : null;
|
|
8987
9034
|
}
|
|
8988
9035
|
|
|
8989
|
-
const messages$
|
|
9036
|
+
const messages$p = reactIntl.defineMessages({
|
|
8990
9037
|
rangeMissingValue: {
|
|
8991
9038
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8992
9039
|
description: 'error message if missing a value in a range',
|
|
@@ -9011,25 +9058,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
9011
9058
|
if (validateSingleFilter({
|
|
9012
9059
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
9013
9060
|
})) return {
|
|
9014
|
-
from: intl.formatMessage(messages$
|
|
9061
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9015
9062
|
};
|
|
9016
9063
|
if (validateSingleFilter({
|
|
9017
9064
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
9018
9065
|
})) return {
|
|
9019
|
-
to: intl.formatMessage(messages$
|
|
9066
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9020
9067
|
};
|
|
9021
9068
|
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$
|
|
9069
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
9023
9070
|
};
|
|
9024
9071
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9025
9072
|
if (validateSingleFilter({
|
|
9026
9073
|
value
|
|
9027
|
-
})) return intl.formatMessage(messages$
|
|
9074
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
9028
9075
|
}
|
|
9029
9076
|
return null;
|
|
9030
9077
|
}
|
|
9031
9078
|
|
|
9032
|
-
const messages$
|
|
9079
|
+
const messages$o = reactIntl.defineMessages({
|
|
9033
9080
|
rangeMissingValue: {
|
|
9034
9081
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9035
9082
|
description: 'error message if missing a value in a range',
|
|
@@ -9048,30 +9095,30 @@ function validateFilter(_ref, intl) {
|
|
|
9048
9095
|
_ref$allowFloat = _ref.allowFloat,
|
|
9049
9096
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9050
9097
|
if (type !== 'range') {
|
|
9051
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9098
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
9052
9099
|
return null;
|
|
9053
9100
|
}
|
|
9054
9101
|
|
|
9055
9102
|
// only range types from here
|
|
9056
9103
|
|
|
9057
9104
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9058
|
-
from: intl.formatMessage(messages$
|
|
9105
|
+
from: intl.formatMessage(messages$K.integer)
|
|
9059
9106
|
};
|
|
9060
9107
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9061
|
-
to: intl.formatMessage(messages$
|
|
9108
|
+
to: intl.formatMessage(messages$K.integer)
|
|
9062
9109
|
};
|
|
9063
9110
|
if (validateSingleFilter({
|
|
9064
9111
|
value: value.from
|
|
9065
9112
|
})) return {
|
|
9066
|
-
from: intl.formatMessage(messages$
|
|
9113
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9067
9114
|
};
|
|
9068
9115
|
if (validateSingleFilter({
|
|
9069
9116
|
value: value.to
|
|
9070
9117
|
})) return {
|
|
9071
|
-
to: intl.formatMessage(messages$
|
|
9118
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9072
9119
|
};
|
|
9073
9120
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9074
|
-
from: intl.formatMessage(messages$
|
|
9121
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9075
9122
|
};
|
|
9076
9123
|
return null;
|
|
9077
9124
|
}
|
|
@@ -9365,10 +9412,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9365
9412
|
carts: 'carts'
|
|
9366
9413
|
};
|
|
9367
9414
|
|
|
9368
|
-
function ownKeys$
|
|
9369
|
-
function _objectSpread$
|
|
9415
|
+
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; }
|
|
9416
|
+
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; }
|
|
9370
9417
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9371
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9418
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$z({
|
|
9372
9419
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9373
9420
|
}, previousIncludedLimits), {});
|
|
9374
9421
|
|
|
@@ -9430,7 +9477,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9430
9477
|
};
|
|
9431
9478
|
};
|
|
9432
9479
|
|
|
9433
|
-
var messages$
|
|
9480
|
+
var messages$n = reactIntl.defineMessages({
|
|
9434
9481
|
shippingMethods: {
|
|
9435
9482
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9436
9483
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9458,8 +9505,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9458
9505
|
}
|
|
9459
9506
|
});
|
|
9460
9507
|
|
|
9461
|
-
function ownKeys$
|
|
9462
|
-
function _objectSpread$
|
|
9508
|
+
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; }
|
|
9509
|
+
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; }
|
|
9463
9510
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9464
9511
|
isExternal: true,
|
|
9465
9512
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9470,7 +9517,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9470
9517
|
limit = _ref.limit;
|
|
9471
9518
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9472
9519
|
type: "warning",
|
|
9473
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9520
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$y(_objectSpread$y({}, messages$n[resource]), {}, {
|
|
9474
9521
|
values: {
|
|
9475
9522
|
limit,
|
|
9476
9523
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9483,7 +9530,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9483
9530
|
};
|
|
9484
9531
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9485
9532
|
|
|
9486
|
-
var messages$
|
|
9533
|
+
var messages$m = reactIntl.defineMessages({
|
|
9487
9534
|
shippingMethods: {
|
|
9488
9535
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9489
9536
|
description: 'error message about platform limit exceeded',
|
|
@@ -9511,8 +9558,8 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9511
9558
|
}
|
|
9512
9559
|
});
|
|
9513
9560
|
|
|
9514
|
-
function ownKeys$
|
|
9515
|
-
function _objectSpread$
|
|
9561
|
+
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; }
|
|
9562
|
+
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; }
|
|
9516
9563
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9517
9564
|
isExternal: true,
|
|
9518
9565
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9523,7 +9570,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9523
9570
|
limit = _ref.limit;
|
|
9524
9571
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9525
9572
|
type: "error",
|
|
9526
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9573
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$m[resource]), {}, {
|
|
9527
9574
|
values: {
|
|
9528
9575
|
limit,
|
|
9529
9576
|
customersupport: getCustomerSupportLink
|
|
@@ -9541,8 +9588,8 @@ const Notifications = {
|
|
|
9541
9588
|
Error: PlatformLimitErrorNotification
|
|
9542
9589
|
};
|
|
9543
9590
|
|
|
9544
|
-
function ownKeys$
|
|
9545
|
-
function _objectSpread$
|
|
9591
|
+
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; }
|
|
9592
|
+
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; }
|
|
9546
9593
|
const PlatformLimitsStatusText = _ref => {
|
|
9547
9594
|
let intlMessage = _ref.intlMessage,
|
|
9548
9595
|
children = _ref.children;
|
|
@@ -9551,7 +9598,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9551
9598
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9552
9599
|
size: "xs",
|
|
9553
9600
|
children: [jsxRuntime.jsx("span", {
|
|
9554
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9601
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
9555
9602
|
}), jsxRuntime.jsx("span", {
|
|
9556
9603
|
children: children
|
|
9557
9604
|
})]
|
|
@@ -9652,7 +9699,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9652
9699
|
};
|
|
9653
9700
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9654
9701
|
|
|
9655
|
-
var messages$
|
|
9702
|
+
var messages$l = reactIntl.defineMessages({
|
|
9656
9703
|
shippingMethodsPlatformLimitReached: {
|
|
9657
9704
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9658
9705
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9660,17 +9707,17 @@ var messages$k = reactIntl.defineMessages({
|
|
|
9660
9707
|
}
|
|
9661
9708
|
});
|
|
9662
9709
|
|
|
9663
|
-
function ownKeys$
|
|
9664
|
-
function _objectSpread$
|
|
9710
|
+
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; }
|
|
9711
|
+
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; }
|
|
9665
9712
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9666
9713
|
const intl = reactIntl.useIntl();
|
|
9667
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9668
|
-
title: intl.formatMessage(messages$
|
|
9714
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
9715
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9669
9716
|
}));
|
|
9670
9717
|
};
|
|
9671
9718
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9672
9719
|
|
|
9673
|
-
var messages$
|
|
9720
|
+
var messages$k = reactIntl.defineMessages({
|
|
9674
9721
|
shippingMethodsStatus: {
|
|
9675
9722
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9676
9723
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9679,15 +9726,15 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9679
9726
|
});
|
|
9680
9727
|
|
|
9681
9728
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9682
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9729
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9683
9730
|
let total = _ref.total;
|
|
9684
9731
|
const intl = reactIntl.useIntl();
|
|
9685
9732
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9686
9733
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9687
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9688
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9734
|
+
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;
|
|
9735
|
+
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
9736
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9690
|
-
intlMessage: messages$
|
|
9737
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9691
9738
|
children: getPlatformLimitsStatus({
|
|
9692
9739
|
limit,
|
|
9693
9740
|
current,
|
|
@@ -9718,15 +9765,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9718
9765
|
};
|
|
9719
9766
|
};
|
|
9720
9767
|
|
|
9721
|
-
function ownKeys$
|
|
9722
|
-
function _objectSpread$
|
|
9768
|
+
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; }
|
|
9769
|
+
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; }
|
|
9723
9770
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9724
9771
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9725
9772
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9726
9773
|
const shippingMethodsProps = {
|
|
9727
9774
|
platformLimits: shippingMethodsPlatformLimits
|
|
9728
9775
|
};
|
|
9729
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9776
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$u(_objectSpread$u({}, props), shippingMethodsProps));
|
|
9730
9777
|
};
|
|
9731
9778
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9732
9779
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9799,7 +9846,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9799
9846
|
};
|
|
9800
9847
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9801
9848
|
|
|
9802
|
-
var messages$
|
|
9849
|
+
var messages$j = reactIntl.defineMessages({
|
|
9803
9850
|
taxCategoriesPlatformLimitReached: {
|
|
9804
9851
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9805
9852
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9807,17 +9854,17 @@ var messages$i = reactIntl.defineMessages({
|
|
|
9807
9854
|
}
|
|
9808
9855
|
});
|
|
9809
9856
|
|
|
9810
|
-
function ownKeys$
|
|
9811
|
-
function _objectSpread$
|
|
9857
|
+
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; }
|
|
9858
|
+
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; }
|
|
9812
9859
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9813
9860
|
const intl = reactIntl.useIntl();
|
|
9814
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9815
|
-
title: intl.formatMessage(messages$
|
|
9861
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$t(_objectSpread$t({}, props), {}, {
|
|
9862
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9816
9863
|
}));
|
|
9817
9864
|
};
|
|
9818
9865
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9819
9866
|
|
|
9820
|
-
var messages$
|
|
9867
|
+
var messages$i = reactIntl.defineMessages({
|
|
9821
9868
|
taxCategoriesStatus: {
|
|
9822
9869
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9823
9870
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9826,15 +9873,15 @@ var messages$h = reactIntl.defineMessages({
|
|
|
9826
9873
|
});
|
|
9827
9874
|
|
|
9828
9875
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9829
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9876
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9830
9877
|
let total = _ref.total;
|
|
9831
9878
|
const intl = reactIntl.useIntl();
|
|
9832
9879
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9833
9880
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9834
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9835
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9881
|
+
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;
|
|
9882
|
+
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
9883
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9837
|
-
intlMessage: messages$
|
|
9884
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9838
9885
|
children: getPlatformLimitsStatus({
|
|
9839
9886
|
limit,
|
|
9840
9887
|
current,
|
|
@@ -9865,15 +9912,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9865
9912
|
};
|
|
9866
9913
|
};
|
|
9867
9914
|
|
|
9868
|
-
function ownKeys$
|
|
9869
|
-
function _objectSpread$
|
|
9915
|
+
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; }
|
|
9916
|
+
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; }
|
|
9870
9917
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9871
9918
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9872
9919
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9873
9920
|
const taxCategoriesProps = {
|
|
9874
9921
|
platformLimits: taxCategoriesPlatformLimits
|
|
9875
9922
|
};
|
|
9876
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9923
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$s(_objectSpread$s({}, props), taxCategoriesProps));
|
|
9877
9924
|
};
|
|
9878
9925
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9879
9926
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9946,7 +9993,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9946
9993
|
};
|
|
9947
9994
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9948
9995
|
|
|
9949
|
-
var messages$
|
|
9996
|
+
var messages$h = reactIntl.defineMessages({
|
|
9950
9997
|
zonesPlatformLimitReached: {
|
|
9951
9998
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9952
9999
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9954,17 +10001,17 @@ var messages$g = reactIntl.defineMessages({
|
|
|
9954
10001
|
}
|
|
9955
10002
|
});
|
|
9956
10003
|
|
|
9957
|
-
function ownKeys$
|
|
9958
|
-
function _objectSpread$
|
|
10004
|
+
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; }
|
|
10005
|
+
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; }
|
|
9959
10006
|
const PlatformLimitsZonesTooltip = props => {
|
|
9960
10007
|
const intl = reactIntl.useIntl();
|
|
9961
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9962
|
-
title: intl.formatMessage(messages$
|
|
10008
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$r(_objectSpread$r({}, props), {}, {
|
|
10009
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9963
10010
|
}));
|
|
9964
10011
|
};
|
|
9965
10012
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9966
10013
|
|
|
9967
|
-
var messages$
|
|
10014
|
+
var messages$g = reactIntl.defineMessages({
|
|
9968
10015
|
zonesStatus: {
|
|
9969
10016
|
id: 'PlatformLimits.Status.zones',
|
|
9970
10017
|
description: 'The message for zones platform limit values',
|
|
@@ -9973,15 +10020,15 @@ var messages$f = reactIntl.defineMessages({
|
|
|
9973
10020
|
});
|
|
9974
10021
|
|
|
9975
10022
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9976
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
10023
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9977
10024
|
let total = _ref.total;
|
|
9978
10025
|
const intl = reactIntl.useIntl();
|
|
9979
10026
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9980
10027
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9981
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9982
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
10028
|
+
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;
|
|
10029
|
+
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
10030
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9984
|
-
intlMessage: messages$
|
|
10031
|
+
intlMessage: messages$g.zonesStatus,
|
|
9985
10032
|
children: getPlatformLimitsStatus({
|
|
9986
10033
|
limit,
|
|
9987
10034
|
current,
|
|
@@ -10012,15 +10059,15 @@ const useZonesLimits = () => {
|
|
|
10012
10059
|
};
|
|
10013
10060
|
};
|
|
10014
10061
|
|
|
10015
|
-
function ownKeys$
|
|
10016
|
-
function _objectSpread$
|
|
10062
|
+
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; }
|
|
10063
|
+
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; }
|
|
10017
10064
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
10018
10065
|
const WithZonesPlatformLimits = props => {
|
|
10019
10066
|
const zonesPlatformLimits = useZonesLimits();
|
|
10020
10067
|
const zonesProps = {
|
|
10021
10068
|
platformLimits: zonesPlatformLimits
|
|
10022
10069
|
};
|
|
10023
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10070
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$q(_objectSpread$q({}, props), zonesProps));
|
|
10024
10071
|
};
|
|
10025
10072
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10026
10073
|
return WithZonesPlatformLimits;
|
|
@@ -10106,7 +10153,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10106
10153
|
};
|
|
10107
10154
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10108
10155
|
|
|
10109
|
-
var messages$
|
|
10156
|
+
var messages$f = reactIntl.defineMessages({
|
|
10110
10157
|
customersPlatformLimitReached: {
|
|
10111
10158
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10112
10159
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10114,17 +10161,17 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10114
10161
|
}
|
|
10115
10162
|
});
|
|
10116
10163
|
|
|
10117
|
-
function ownKeys$
|
|
10118
|
-
function _objectSpread$
|
|
10164
|
+
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; }
|
|
10165
|
+
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; }
|
|
10119
10166
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10120
10167
|
const intl = reactIntl.useIntl();
|
|
10121
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10122
|
-
title: intl.formatMessage(messages$
|
|
10168
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$p(_objectSpread$p({}, props), {}, {
|
|
10169
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10123
10170
|
}));
|
|
10124
10171
|
};
|
|
10125
10172
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10126
10173
|
|
|
10127
|
-
var messages$
|
|
10174
|
+
var messages$e = reactIntl.defineMessages({
|
|
10128
10175
|
customersStatus: {
|
|
10129
10176
|
id: 'PlatformLimits.Status.customers',
|
|
10130
10177
|
description: 'The message for customers platform limit values',
|
|
@@ -10132,8 +10179,8 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10132
10179
|
}
|
|
10133
10180
|
});
|
|
10134
10181
|
|
|
10135
|
-
function ownKeys$
|
|
10136
|
-
function _objectSpread$
|
|
10182
|
+
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; }
|
|
10183
|
+
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; }
|
|
10137
10184
|
var styles$b = {
|
|
10138
10185
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10139
10186
|
};
|
|
@@ -10153,7 +10200,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10153
10200
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10154
10201
|
tone: "secondary",
|
|
10155
10202
|
isInline: true,
|
|
10156
|
-
intlMessage: _objectSpread$
|
|
10203
|
+
intlMessage: _objectSpread$o(_objectSpread$o({}, messages$e.customersStatus), {}, {
|
|
10157
10204
|
values: {
|
|
10158
10205
|
current: intl.formatNumber(current),
|
|
10159
10206
|
limit: intl.formatNumber(limit)
|
|
@@ -10164,7 +10211,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10164
10211
|
};
|
|
10165
10212
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10166
10213
|
|
|
10167
|
-
var messages$
|
|
10214
|
+
var messages$d = reactIntl.defineMessages({
|
|
10168
10215
|
title: {
|
|
10169
10216
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10170
10217
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10177,10 +10224,10 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10177
10224
|
}
|
|
10178
10225
|
});
|
|
10179
10226
|
|
|
10180
|
-
function ownKeys$
|
|
10181
|
-
function _objectSpread$
|
|
10227
|
+
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; }
|
|
10228
|
+
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; }
|
|
10182
10229
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10183
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10230
|
+
return jsxRuntime.jsxs("svg", _objectSpread$n(_objectSpread$n({}, props), {}, {
|
|
10184
10231
|
children: [jsxRuntime.jsx("defs", {
|
|
10185
10232
|
children: jsxRuntime.jsx("path", {
|
|
10186
10233
|
id: "a",
|
|
@@ -10288,7 +10335,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10288
10335
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10289
10336
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10290
10337
|
onClose: onClose,
|
|
10291
|
-
title: intl.formatMessage(messages$
|
|
10338
|
+
title: intl.formatMessage(messages$d.title),
|
|
10292
10339
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10293
10340
|
scale: "m",
|
|
10294
10341
|
alignItems: "center",
|
|
@@ -10297,7 +10344,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10297
10344
|
alignItems: "center",
|
|
10298
10345
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10299
10346
|
onClick: onClose,
|
|
10300
|
-
label: intl.formatMessage(messages$
|
|
10347
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10301
10348
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10302
10349
|
size: "medium",
|
|
10303
10350
|
color: "primary"
|
|
@@ -10352,15 +10399,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10352
10399
|
};
|
|
10353
10400
|
};
|
|
10354
10401
|
|
|
10355
|
-
function ownKeys$
|
|
10356
|
-
function _objectSpread$
|
|
10402
|
+
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; }
|
|
10403
|
+
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; }
|
|
10357
10404
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10358
10405
|
const WithCustomersPlatformLimits = props => {
|
|
10359
10406
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10360
10407
|
const customersProps = {
|
|
10361
10408
|
platformLimits: CustomersPlatformLimits
|
|
10362
10409
|
};
|
|
10363
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10410
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$m(_objectSpread$m({}, props), customersProps));
|
|
10364
10411
|
};
|
|
10365
10412
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10366
10413
|
return WithCustomersPlatformLimits;
|
|
@@ -10446,7 +10493,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10446
10493
|
};
|
|
10447
10494
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10448
10495
|
|
|
10449
|
-
var messages$
|
|
10496
|
+
var messages$c = reactIntl.defineMessages({
|
|
10450
10497
|
customerGroupsPlatformLimitReached: {
|
|
10451
10498
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10452
10499
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10454,17 +10501,17 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10454
10501
|
}
|
|
10455
10502
|
});
|
|
10456
10503
|
|
|
10457
|
-
function ownKeys$
|
|
10458
|
-
function _objectSpread$
|
|
10504
|
+
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; }
|
|
10505
|
+
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; }
|
|
10459
10506
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10460
10507
|
const intl = reactIntl.useIntl();
|
|
10461
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10462
|
-
title: intl.formatMessage(messages$
|
|
10508
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$l(_objectSpread$l({}, props), {}, {
|
|
10509
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10463
10510
|
}));
|
|
10464
10511
|
};
|
|
10465
10512
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10466
10513
|
|
|
10467
|
-
var messages$
|
|
10514
|
+
var messages$b = reactIntl.defineMessages({
|
|
10468
10515
|
customerGroupsStatus: {
|
|
10469
10516
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10470
10517
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10472,8 +10519,8 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10472
10519
|
}
|
|
10473
10520
|
});
|
|
10474
10521
|
|
|
10475
|
-
function ownKeys$
|
|
10476
|
-
function _objectSpread$
|
|
10522
|
+
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; }
|
|
10523
|
+
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; }
|
|
10477
10524
|
var styles$9 = {
|
|
10478
10525
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10479
10526
|
};
|
|
@@ -10493,7 +10540,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10493
10540
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10494
10541
|
tone: "secondary",
|
|
10495
10542
|
isInline: true,
|
|
10496
|
-
intlMessage: _objectSpread$
|
|
10543
|
+
intlMessage: _objectSpread$k(_objectSpread$k({}, messages$b.customerGroupsStatus), {}, {
|
|
10497
10544
|
values: {
|
|
10498
10545
|
current: intl.formatNumber(current),
|
|
10499
10546
|
limit: intl.formatNumber(limit)
|
|
@@ -10504,7 +10551,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10504
10551
|
};
|
|
10505
10552
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10506
10553
|
|
|
10507
|
-
var messages$
|
|
10554
|
+
var messages$a = reactIntl.defineMessages({
|
|
10508
10555
|
title: {
|
|
10509
10556
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10510
10557
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10517,10 +10564,10 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
10517
10564
|
}
|
|
10518
10565
|
});
|
|
10519
10566
|
|
|
10520
|
-
function ownKeys$
|
|
10521
|
-
function _objectSpread$
|
|
10567
|
+
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; }
|
|
10568
|
+
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; }
|
|
10522
10569
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10523
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10570
|
+
return jsxRuntime.jsxs("svg", _objectSpread$j(_objectSpread$j({}, props), {}, {
|
|
10524
10571
|
children: [jsxRuntime.jsx("defs", {
|
|
10525
10572
|
children: jsxRuntime.jsx("path", {
|
|
10526
10573
|
id: "a",
|
|
@@ -10628,7 +10675,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10628
10675
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10629
10676
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10630
10677
|
onClose: onClose,
|
|
10631
|
-
title: intl.formatMessage(messages$
|
|
10678
|
+
title: intl.formatMessage(messages$a.title),
|
|
10632
10679
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10633
10680
|
scale: "m",
|
|
10634
10681
|
alignItems: "center",
|
|
@@ -10637,7 +10684,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10637
10684
|
alignItems: "center",
|
|
10638
10685
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10639
10686
|
onClick: onClose,
|
|
10640
|
-
label: intl.formatMessage(messages$
|
|
10687
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10641
10688
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10642
10689
|
size: "medium",
|
|
10643
10690
|
color: "primary"
|
|
@@ -10692,15 +10739,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10692
10739
|
};
|
|
10693
10740
|
};
|
|
10694
10741
|
|
|
10695
|
-
function ownKeys$
|
|
10696
|
-
function _objectSpread$
|
|
10742
|
+
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; }
|
|
10743
|
+
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; }
|
|
10697
10744
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10698
10745
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10699
10746
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10700
10747
|
const customersProps = {
|
|
10701
10748
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10702
10749
|
};
|
|
10703
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10750
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$i(_objectSpread$i({}, props), customersProps));
|
|
10704
10751
|
};
|
|
10705
10752
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10706
10753
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10755,7 +10802,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10755
10802
|
}
|
|
10756
10803
|
});
|
|
10757
10804
|
|
|
10758
|
-
var messages$
|
|
10805
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10759
10806
|
indexingSucceed: {
|
|
10760
10807
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10761
10808
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10793,8 +10840,8 @@ const defaultValue = {
|
|
|
10793
10840
|
*/
|
|
10794
10841
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10795
10842
|
|
|
10796
|
-
function ownKeys$
|
|
10797
|
-
function _objectSpread$
|
|
10843
|
+
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; }
|
|
10844
|
+
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; }
|
|
10798
10845
|
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
10846
|
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
10847
|
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 +10927,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10880
10927
|
_this.props.notifications.showNotification({
|
|
10881
10928
|
kind: 'error',
|
|
10882
10929
|
domain: constants.DOMAINS.SIDE,
|
|
10883
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10930
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10884
10931
|
});
|
|
10885
10932
|
};
|
|
10886
10933
|
_this.getIndexingProgress = async () => {
|
|
@@ -10921,7 +10968,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10921
10968
|
_this.props.notifications.showNotification({
|
|
10922
10969
|
kind: 'success',
|
|
10923
10970
|
domain: constants.DOMAINS.SIDE,
|
|
10924
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10971
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10925
10972
|
},
|
|
10926
10973
|
// because the indexing may take so long, the success notification
|
|
10927
10974
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10970,7 +11017,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10970
11017
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10971
11018
|
}
|
|
10972
11019
|
});
|
|
10973
|
-
_this.setState(_objectSpread$
|
|
11020
|
+
_this.setState(_objectSpread$h(_objectSpread$h({
|
|
10974
11021
|
isLoading: false,
|
|
10975
11022
|
isProjectBeingIndexedByPim: true
|
|
10976
11023
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10995,7 +11042,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10995
11042
|
key: "render",
|
|
10996
11043
|
value: function render() {
|
|
10997
11044
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
10998
|
-
value: _objectSpread$
|
|
11045
|
+
value: _objectSpread$h(_objectSpread$h({}, this.state), {}, {
|
|
10999
11046
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
11000
11047
|
indexProject: this.indexProject
|
|
11001
11048
|
}),
|
|
@@ -11037,13 +11084,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11037
11084
|
}(React.PureComponent);
|
|
11038
11085
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11039
11086
|
|
|
11040
|
-
function ownKeys$
|
|
11041
|
-
function _objectSpread$
|
|
11087
|
+
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; }
|
|
11088
|
+
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; }
|
|
11042
11089
|
var injectPimIndexer = (function () {
|
|
11043
11090
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11044
11091
|
return Component => {
|
|
11045
11092
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11046
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11093
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
11047
11094
|
[propName]: pimIndexerProps
|
|
11048
11095
|
}))
|
|
11049
11096
|
});
|
|
@@ -11056,7 +11103,7 @@ function usePimIndexer() {
|
|
|
11056
11103
|
return React.useContext(PimIndexerContext);
|
|
11057
11104
|
}
|
|
11058
11105
|
|
|
11059
|
-
var messages$
|
|
11106
|
+
var messages$8 = reactIntl.defineMessages({
|
|
11060
11107
|
yes: {
|
|
11061
11108
|
id: 'BooleanField.yes',
|
|
11062
11109
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11078,8 +11125,8 @@ const BooleanField = props => {
|
|
|
11078
11125
|
var _context;
|
|
11079
11126
|
let selectedValue;
|
|
11080
11127
|
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$
|
|
11128
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11129
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11083
11130
|
const options = [{
|
|
11084
11131
|
value: 'yes',
|
|
11085
11132
|
label: yesLabel
|
|
@@ -11117,7 +11164,7 @@ function getBooleanValue(value) {
|
|
|
11117
11164
|
return value === false ? 'no' : 'yes';
|
|
11118
11165
|
}
|
|
11119
11166
|
|
|
11120
|
-
var messages$
|
|
11167
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11121
11168
|
label: {
|
|
11122
11169
|
id: 'MissingValueField.label',
|
|
11123
11170
|
description: 'The label text for the missing values option',
|
|
@@ -11125,20 +11172,20 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11125
11172
|
}
|
|
11126
11173
|
});
|
|
11127
11174
|
|
|
11128
|
-
function ownKeys$
|
|
11129
|
-
function _objectSpread$
|
|
11175
|
+
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; }
|
|
11176
|
+
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; }
|
|
11130
11177
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11131
11178
|
name: "missing-value",
|
|
11132
11179
|
isChecked: props.isChecked,
|
|
11133
11180
|
onChange: props.onChange,
|
|
11134
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11181
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$f({}, messages$7.label))
|
|
11135
11182
|
});
|
|
11136
11183
|
MissingValueField.defaultProps = {
|
|
11137
11184
|
isChecked: false
|
|
11138
11185
|
};
|
|
11139
11186
|
|
|
11140
|
-
function ownKeys$
|
|
11141
|
-
function _objectSpread$
|
|
11187
|
+
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; }
|
|
11188
|
+
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; }
|
|
11142
11189
|
var styles$7 = {
|
|
11143
11190
|
"button": "button-module__button___1OzVf",
|
|
11144
11191
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11172,7 +11219,7 @@ const Button = props => {
|
|
|
11172
11219
|
|
|
11173
11220
|
// Pass only `data-*` props
|
|
11174
11221
|
const dataProps = filterDataAttributes(props);
|
|
11175
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11222
|
+
return jsxRuntime.jsx("button", _objectSpread$e(_objectSpread$e({
|
|
11176
11223
|
onClick: isDisabled ? null : onClick,
|
|
11177
11224
|
type: props.type,
|
|
11178
11225
|
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11187,7 +11234,7 @@ Button.defaultProps = {
|
|
|
11187
11234
|
type: 'button'
|
|
11188
11235
|
};
|
|
11189
11236
|
|
|
11190
|
-
var messages$
|
|
11237
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11191
11238
|
chooseFile: {
|
|
11192
11239
|
id: 'ButtonFileInput.chooseFile',
|
|
11193
11240
|
description: 'The label text of the field for upload local file',
|
|
@@ -11195,8 +11242,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
11195
11242
|
}
|
|
11196
11243
|
});
|
|
11197
11244
|
|
|
11198
|
-
function ownKeys$
|
|
11199
|
-
function _objectSpread$
|
|
11245
|
+
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; }
|
|
11246
|
+
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; }
|
|
11200
11247
|
var styles$6 = {
|
|
11201
11248
|
"button": "file-input-module__button___2KypN",
|
|
11202
11249
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11216,7 +11263,7 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11216
11263
|
});
|
|
11217
11264
|
FileInput.displayName = 'FileInput';
|
|
11218
11265
|
FileInput.defaultProps = {
|
|
11219
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11266
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$d({}, messages$6.chooseFile)),
|
|
11220
11267
|
allowMultiple: false,
|
|
11221
11268
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11222
11269
|
};
|
|
@@ -11263,7 +11310,7 @@ const ScrollToFieldError = () => {
|
|
|
11263
11310
|
return null;
|
|
11264
11311
|
};
|
|
11265
11312
|
|
|
11266
|
-
var messages$
|
|
11313
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11267
11314
|
buttonLabel: {
|
|
11268
11315
|
id: 'SearchInput.buttonLabel',
|
|
11269
11316
|
description: 'Label for "Search" button.',
|
|
@@ -11318,15 +11365,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11318
11365
|
});
|
|
11319
11366
|
},
|
|
11320
11367
|
onReset: props.onReset,
|
|
11321
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11368
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11322
11369
|
isDisabled: props.disabled
|
|
11323
11370
|
})
|
|
11324
11371
|
});
|
|
11325
11372
|
};
|
|
11326
11373
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11327
11374
|
|
|
11328
|
-
function ownKeys$
|
|
11329
|
-
function _objectSpread$
|
|
11375
|
+
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; }
|
|
11376
|
+
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; }
|
|
11330
11377
|
const StoreSelectField = props => {
|
|
11331
11378
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
11332
11379
|
max: props.horizontalConstraint,
|
|
@@ -11340,7 +11387,7 @@ const StoreSelectField = props => {
|
|
|
11340
11387
|
htmlFor: props.id,
|
|
11341
11388
|
hasRequiredIndicator: props.isRequired,
|
|
11342
11389
|
isBold: true
|
|
11343
|
-
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$
|
|
11390
|
+
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$c(_objectSpread$c({
|
|
11344
11391
|
projectKey: props.projectKey,
|
|
11345
11392
|
id: props.id,
|
|
11346
11393
|
name: props.name,
|
|
@@ -11380,8 +11427,8 @@ StoreSelectField.defaultProps = {
|
|
|
11380
11427
|
};
|
|
11381
11428
|
|
|
11382
11429
|
var _templateObject;
|
|
11383
|
-
function ownKeys$
|
|
11384
|
-
function _objectSpread$
|
|
11430
|
+
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; }
|
|
11431
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$b(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$b(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11385
11432
|
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
11433
|
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
11434
|
var styles$3 = {
|
|
@@ -11398,7 +11445,7 @@ const validateRequired = value => {
|
|
|
11398
11445
|
};
|
|
11399
11446
|
const VALIDATOR_REQUIRED = {
|
|
11400
11447
|
name: 'required',
|
|
11401
|
-
message: messages$
|
|
11448
|
+
message: messages$K.required,
|
|
11402
11449
|
permanent: true,
|
|
11403
11450
|
validators: {
|
|
11404
11451
|
change(value) {
|
|
@@ -11412,7 +11459,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11412
11459
|
};
|
|
11413
11460
|
const VALIDATOR_NUMERIC = {
|
|
11414
11461
|
name: 'numeric',
|
|
11415
|
-
message: messages$
|
|
11462
|
+
message: messages$K.numeric,
|
|
11416
11463
|
permanent: false,
|
|
11417
11464
|
validators: {
|
|
11418
11465
|
change: v => {
|
|
@@ -11427,7 +11474,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11427
11474
|
};
|
|
11428
11475
|
const VALIDATOR_INTEGER = {
|
|
11429
11476
|
name: 'integer',
|
|
11430
|
-
message: messages$
|
|
11477
|
+
message: messages$K.integer,
|
|
11431
11478
|
permanent: false,
|
|
11432
11479
|
validators: {
|
|
11433
11480
|
change: v => {
|
|
@@ -11442,7 +11489,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11442
11489
|
};
|
|
11443
11490
|
({
|
|
11444
11491
|
name: 'email',
|
|
11445
|
-
message: messages$
|
|
11492
|
+
message: messages$K.email,
|
|
11446
11493
|
permanent: false,
|
|
11447
11494
|
validators: {
|
|
11448
11495
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11525,7 +11572,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11525
11572
|
* so it must be an invalid numeric value
|
|
11526
11573
|
*/
|
|
11527
11574
|
_this.handleInvalid = () => {
|
|
11528
|
-
const nextValidStatus = _objectSpread$
|
|
11575
|
+
const nextValidStatus = _objectSpread$b({}, _this.state.validStatus);
|
|
11529
11576
|
if (has__default["default"](nextValidStatus, 'numeric')) {
|
|
11530
11577
|
nextValidStatus.numeric = false;
|
|
11531
11578
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11557,10 +11604,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11557
11604
|
key: "componentDidMount",
|
|
11558
11605
|
value: function componentDidMount() {
|
|
11559
11606
|
}
|
|
11560
|
-
// eslint-disable-next-line camelcase
|
|
11561
11607
|
}, {
|
|
11562
|
-
key: "
|
|
11563
|
-
value: function
|
|
11608
|
+
key: "componentDidUpdate",
|
|
11609
|
+
value: function componentDidUpdate() {
|
|
11610
|
+
const nextProps = this.props;
|
|
11564
11611
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11565
11612
|
this.resetValidity();
|
|
11566
11613
|
this.handleChange(nextProps.value, {
|
|
@@ -11575,7 +11622,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11575
11622
|
if (prev) return this.state.validStatus[v.name];
|
|
11576
11623
|
return prev;
|
|
11577
11624
|
}, true);
|
|
11578
|
-
const componentProps = _objectSpread$
|
|
11625
|
+
const componentProps = _objectSpread$b(_objectSpread$b({}, this.props), {}, {
|
|
11579
11626
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11580
11627
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11581
11628
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11592,7 +11639,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11592
11639
|
components: {
|
|
11593
11640
|
WrapperComponent: ToolTipWrapperComponent
|
|
11594
11641
|
},
|
|
11595
|
-
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$
|
|
11642
|
+
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$b({}, componentProps))
|
|
11596
11643
|
})
|
|
11597
11644
|
});
|
|
11598
11645
|
}
|
|
@@ -11647,7 +11694,7 @@ function simpleInput(type) {
|
|
|
11647
11694
|
}, _class;
|
|
11648
11695
|
}
|
|
11649
11696
|
|
|
11650
|
-
var messages$
|
|
11697
|
+
var messages$4 = reactIntl.defineMessages({
|
|
11651
11698
|
customFieldsError: {
|
|
11652
11699
|
id: 'CustomFieldsError.Error',
|
|
11653
11700
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11655,14 +11702,14 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
11655
11702
|
}
|
|
11656
11703
|
});
|
|
11657
11704
|
|
|
11658
|
-
function ownKeys$
|
|
11659
|
-
function _objectSpread$
|
|
11705
|
+
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; }
|
|
11706
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$a(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$a(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11660
11707
|
const CustomFieldsErrorTextNotification = props => {
|
|
11661
11708
|
var _context;
|
|
11662
11709
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
11663
11710
|
scale: "s",
|
|
11664
11711
|
children: [jsxRuntime.jsx(uiKit.Text.Wrap, {
|
|
11665
|
-
intlMessage: _objectSpread$
|
|
11712
|
+
intlMessage: _objectSpread$a({}, messages$4.customFieldsError)
|
|
11666
11713
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
11667
11714
|
scale: "xs",
|
|
11668
11715
|
children: _mapInstanceProperty__default["default"](_context = props.formErrors).call(_context, formError => jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -11674,7 +11721,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11674
11721
|
};
|
|
11675
11722
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11676
11723
|
|
|
11677
|
-
const messages$
|
|
11724
|
+
const messages$3 = reactIntl.defineMessages({
|
|
11678
11725
|
from: {
|
|
11679
11726
|
id: 'LabelRange.from',
|
|
11680
11727
|
description: 'The label for "from" range',
|
|
@@ -11687,8 +11734,8 @@ const messages$2 = reactIntl.defineMessages({
|
|
|
11687
11734
|
}
|
|
11688
11735
|
});
|
|
11689
11736
|
|
|
11690
|
-
function ownKeys$
|
|
11691
|
-
function _objectSpread$
|
|
11737
|
+
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; }
|
|
11738
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(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$9(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11692
11739
|
var styles$2 = {
|
|
11693
11740
|
"label": "label-range-module__label___3Tb0p"
|
|
11694
11741
|
};
|
|
@@ -11696,12 +11743,12 @@ const LabelRange = _ref => {
|
|
|
11696
11743
|
let type = _ref.type;
|
|
11697
11744
|
return jsxRuntime.jsx("label", {
|
|
11698
11745
|
className: styles$2.label,
|
|
11699
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11746
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$9({}, messages$3[type]))
|
|
11700
11747
|
});
|
|
11701
11748
|
};
|
|
11702
11749
|
LabelRange.displayName = 'LabelRange';
|
|
11703
11750
|
|
|
11704
|
-
var messages$
|
|
11751
|
+
var messages$2 = reactIntl.defineMessages({
|
|
11705
11752
|
filterWholeInput: {
|
|
11706
11753
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11707
11754
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11714,8 +11761,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
11714
11761
|
}
|
|
11715
11762
|
});
|
|
11716
11763
|
|
|
11717
|
-
function ownKeys$
|
|
11718
|
-
function _objectSpread$
|
|
11764
|
+
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; }
|
|
11765
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(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$8(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11719
11766
|
var styles$1 = {
|
|
11720
11767
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11721
11768
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11739,7 +11786,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11739
11786
|
}),
|
|
11740
11787
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11741
11788
|
truncate: true,
|
|
11742
|
-
intlMessage: _objectSpread$
|
|
11789
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterWholeInput), {}, {
|
|
11743
11790
|
values: {
|
|
11744
11791
|
values: "\"".concat(props.value, "\"")
|
|
11745
11792
|
}
|
|
@@ -11752,7 +11799,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11752
11799
|
}),
|
|
11753
11800
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11754
11801
|
truncate: true,
|
|
11755
|
-
intlMessage: _objectSpread$
|
|
11802
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterSeparateValues), {}, {
|
|
11756
11803
|
values: {
|
|
11757
11804
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11758
11805
|
}
|
|
@@ -11863,8 +11910,8 @@ const MultiValueSearchInput = props => {
|
|
|
11863
11910
|
};
|
|
11864
11911
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11865
11912
|
|
|
11866
|
-
function ownKeys$
|
|
11867
|
-
function _objectSpread$
|
|
11913
|
+
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; }
|
|
11914
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(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$7(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11868
11915
|
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
11916
|
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
11917
|
var styles = {
|
|
@@ -11886,7 +11933,9 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11886
11933
|
args[_key] = arguments[_key];
|
|
11887
11934
|
}
|
|
11888
11935
|
_this = _super.call(this, ...args);
|
|
11889
|
-
_this.
|
|
11936
|
+
_this.state = {
|
|
11937
|
+
parsedValue: _this.props.value
|
|
11938
|
+
};
|
|
11890
11939
|
_this.setValue = value => {
|
|
11891
11940
|
if (!isValidValue(value)) return;
|
|
11892
11941
|
const newValue = !isUndefined__default["default"](value) ? _this.props.formatNumber(value) : undefined;
|
|
@@ -11899,8 +11948,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11899
11948
|
_this.handleChange = event => {
|
|
11900
11949
|
const value = event.target.rawValue;
|
|
11901
11950
|
const parsedNumber = _this.props.parseNumber(value);
|
|
11902
|
-
if (_this.parsedValue === parsedNumber) return;
|
|
11903
|
-
_this.
|
|
11951
|
+
if (_this.state.parsedValue === parsedNumber) return;
|
|
11952
|
+
_this.setState({
|
|
11953
|
+
parsedValue: parsedNumber
|
|
11954
|
+
});
|
|
11904
11955
|
_this.props.onChangeValue(parsedNumber);
|
|
11905
11956
|
if (!isNumberish(value) && _this.props.onInvalidValue) _this.props.onInvalidValue(value);
|
|
11906
11957
|
};
|
|
@@ -11914,12 +11965,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11914
11965
|
return _this;
|
|
11915
11966
|
}
|
|
11916
11967
|
_createClass(NumericFormatInput, [{
|
|
11917
|
-
key: "
|
|
11918
|
-
value:
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
if (this.props.value !== nextProps.value && nextProps.value !== this.parsedValue) {
|
|
11922
|
-
this.setValue(nextProps.value);
|
|
11968
|
+
key: "componentDidUpdate",
|
|
11969
|
+
value: function componentDidUpdate(prevProps) {
|
|
11970
|
+
if (this.props.value !== prevProps.value && this.props.value !== this.state.parsedValue) {
|
|
11971
|
+
this.setValue(this.props.value);
|
|
11923
11972
|
}
|
|
11924
11973
|
}
|
|
11925
11974
|
}, {
|
|
@@ -11927,7 +11976,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11927
11976
|
value: function render() {
|
|
11928
11977
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11929
11978
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11930
|
-
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$
|
|
11979
|
+
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$7({
|
|
11931
11980
|
placeholder: this.props.placeholder,
|
|
11932
11981
|
htmlRef: this.registerInputRef,
|
|
11933
11982
|
options: {
|
|
@@ -12223,8 +12272,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12223
12272
|
}
|
|
12224
12273
|
};
|
|
12225
12274
|
|
|
12226
|
-
function ownKeys$
|
|
12227
|
-
function _objectSpread$
|
|
12275
|
+
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; }
|
|
12276
|
+
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; }
|
|
12228
12277
|
/**
|
|
12229
12278
|
* Creates reducer
|
|
12230
12279
|
* @param {Object} initialState
|
|
@@ -12240,13 +12289,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12240
12289
|
|
|
12241
12290
|
// In case reducer ignored action, avoid creating new object
|
|
12242
12291
|
const newSubstate = reduce(newState, action);
|
|
12243
|
-
if (newSubstate) return _objectSpread$
|
|
12292
|
+
if (newSubstate) return _objectSpread$6(_objectSpread$6({}, newState), newSubstate);
|
|
12244
12293
|
return newState;
|
|
12245
12294
|
};
|
|
12246
12295
|
}
|
|
12247
12296
|
|
|
12248
|
-
function ownKeys$
|
|
12249
|
-
function _objectSpread$
|
|
12297
|
+
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; }
|
|
12298
|
+
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; }
|
|
12250
12299
|
function updateStatusInList(mergeData) {
|
|
12251
12300
|
return (state, _ref) => {
|
|
12252
12301
|
let payload = _ref.payload;
|
|
@@ -12255,15 +12304,15 @@ function updateStatusInList(mergeData) {
|
|
|
12255
12304
|
results[index] = mergeData(payload, results[index]);
|
|
12256
12305
|
results[index].checked = false;
|
|
12257
12306
|
return {
|
|
12258
|
-
currentQueryResult: _objectSpread$
|
|
12307
|
+
currentQueryResult: _objectSpread$5(_objectSpread$5({}, state.currentQueryResult), {}, {
|
|
12259
12308
|
results
|
|
12260
12309
|
})
|
|
12261
12310
|
};
|
|
12262
12311
|
};
|
|
12263
12312
|
}
|
|
12264
12313
|
|
|
12265
|
-
function ownKeys$
|
|
12266
|
-
function _objectSpread$
|
|
12314
|
+
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; }
|
|
12315
|
+
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; }
|
|
12267
12316
|
const identity = value => value;
|
|
12268
12317
|
function createResourceReducer(options) {
|
|
12269
12318
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12273,7 +12322,7 @@ function createResourceReducer(options) {
|
|
|
12273
12322
|
_options$initialState = options.initialState,
|
|
12274
12323
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12275
12324
|
const mergeData = options.mergeData || identity;
|
|
12276
|
-
const initialState = _objectSpread$
|
|
12325
|
+
const initialState = _objectSpread$4({
|
|
12277
12326
|
currentQueryResult: {
|
|
12278
12327
|
count: 0,
|
|
12279
12328
|
offset: 0,
|
|
@@ -12293,7 +12342,7 @@ function createResourceReducer(options) {
|
|
|
12293
12342
|
let payload = _ref.payload;
|
|
12294
12343
|
const results = state.currentQueryResult.results;
|
|
12295
12344
|
return {
|
|
12296
|
-
currentQueryResult: _objectSpread$
|
|
12345
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12297
12346
|
results: _filterInstanceProperty__default["default"](results).call(results, _ref2 => {
|
|
12298
12347
|
let id = _ref2.id;
|
|
12299
12348
|
return id !== payload.id;
|
|
@@ -12371,17 +12420,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12371
12420
|
}
|
|
12372
12421
|
|
|
12373
12422
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12374
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12423
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12375
12424
|
return null;
|
|
12376
12425
|
};
|
|
12377
12426
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12378
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12427
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12379
12428
|
return null;
|
|
12380
12429
|
};
|
|
12381
12430
|
|
|
12382
12431
|
// eslint-disable-next-line import/prefer-default-export
|
|
12383
12432
|
const validateText = (text, intl) => {
|
|
12384
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12433
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12385
12434
|
return null;
|
|
12386
12435
|
};
|
|
12387
12436
|
|
|
@@ -12468,7 +12517,7 @@ const safelyAddFallback = function (string) {
|
|
|
12468
12517
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12469
12518
|
};
|
|
12470
12519
|
|
|
12471
|
-
var messages = reactIntl.defineMessages({
|
|
12520
|
+
var messages$1 = reactIntl.defineMessages({
|
|
12472
12521
|
booleanAttributeTrue: {
|
|
12473
12522
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12474
12523
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12661,7 +12710,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12661
12710
|
case 'boolean':
|
|
12662
12711
|
{
|
|
12663
12712
|
if (isNil__default["default"](value)) return constants.NO_VALUE_FALLBACK;
|
|
12664
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12713
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12665
12714
|
}
|
|
12666
12715
|
case 'reference':
|
|
12667
12716
|
return value.id || constants.NO_VALUE_FALLBACK;
|
|
@@ -12797,8 +12846,8 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
|
|
|
12797
12846
|
} else {
|
|
12798
12847
|
var _context3;
|
|
12799
12848
|
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
|
|
12849
|
+
var _timeZones$timeZoneId;
|
|
12850
|
+
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
12851
|
});
|
|
12803
12852
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12804
12853
|
return fallbackTimeZoneId.toString();
|
|
@@ -12814,8 +12863,8 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
12814
12863
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12815
12864
|
});
|
|
12816
12865
|
|
|
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; }
|
|
12866
|
+
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; }
|
|
12867
|
+
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; }
|
|
12819
12868
|
function withPendingRequests() {
|
|
12820
12869
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12821
12870
|
return Component => {
|
|
@@ -12824,13 +12873,280 @@ function withPendingRequests() {
|
|
|
12824
12873
|
const pendingProp = {
|
|
12825
12874
|
[propName]: pendingRequests
|
|
12826
12875
|
};
|
|
12827
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12876
|
+
return jsxRuntime.jsx(Component, _objectSpread$3(_objectSpread$3({}, props), pendingProp));
|
|
12828
12877
|
};
|
|
12829
12878
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12830
12879
|
return WrappedComponent;
|
|
12831
12880
|
};
|
|
12832
12881
|
}
|
|
12833
12882
|
|
|
12883
|
+
var messages = reactIntl.defineMessages({
|
|
12884
|
+
noCustomFields: {
|
|
12885
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12886
|
+
description: 'The label when there are no custom fields defined',
|
|
12887
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12888
|
+
},
|
|
12889
|
+
noCustomType: {
|
|
12890
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12891
|
+
description: 'The label when there is no custom type selected',
|
|
12892
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12893
|
+
},
|
|
12894
|
+
noTypes: {
|
|
12895
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12896
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12897
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12898
|
+
},
|
|
12899
|
+
title: {
|
|
12900
|
+
id: 'CustomTypesSubform.title',
|
|
12901
|
+
description: 'Fallback title for the subform',
|
|
12902
|
+
defaultMessage: 'Custom fields'
|
|
12903
|
+
},
|
|
12904
|
+
typesPlaceholder: {
|
|
12905
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12906
|
+
description: 'The placeholder for the types',
|
|
12907
|
+
defaultMessage: 'Select...'
|
|
12908
|
+
}
|
|
12909
|
+
});
|
|
12910
|
+
|
|
12911
|
+
const FIELD_NAME = 'custom';
|
|
12912
|
+
|
|
12913
|
+
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; }
|
|
12914
|
+
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; }
|
|
12915
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12916
|
+
return typeDefinitions.length > 0;
|
|
12917
|
+
};
|
|
12918
|
+
const typeDefinitionSelected = formValues => {
|
|
12919
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12920
|
+
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);
|
|
12921
|
+
};
|
|
12922
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12923
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12924
|
+
};
|
|
12925
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12926
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12927
|
+
isReadOnly = _ref.isReadOnly;
|
|
12928
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12929
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12930
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12931
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noTypes));
|
|
12932
|
+
}
|
|
12933
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12934
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomType));
|
|
12935
|
+
}
|
|
12936
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12937
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12938
|
+
}
|
|
12939
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12940
|
+
max: "scale",
|
|
12941
|
+
children: jsxRuntime.jsx(CustomFields, {
|
|
12942
|
+
isReadOnly: isReadOnly,
|
|
12943
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12944
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12945
|
+
})
|
|
12946
|
+
});
|
|
12947
|
+
};
|
|
12948
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12949
|
+
|
|
12950
|
+
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; }
|
|
12951
|
+
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; }
|
|
12952
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12953
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12954
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12955
|
+
value: typeDefinition.type.key,
|
|
12956
|
+
label: l10n.formatLocalizedString(typeDefinition.type, {
|
|
12957
|
+
key: 'name',
|
|
12958
|
+
locale: language,
|
|
12959
|
+
fallbackOrder: languages
|
|
12960
|
+
})
|
|
12961
|
+
}));
|
|
12962
|
+
};
|
|
12963
|
+
|
|
12964
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12965
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12966
|
+
return {
|
|
12967
|
+
type: {
|
|
12968
|
+
id: selectedTypeDefinition.type.id,
|
|
12969
|
+
obj: {
|
|
12970
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12971
|
+
key: selectedTypeDefinition.type.key
|
|
12972
|
+
}
|
|
12973
|
+
},
|
|
12974
|
+
fields: {}
|
|
12975
|
+
};
|
|
12976
|
+
};
|
|
12977
|
+
const CustomTypeSubform = _ref => {
|
|
12978
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12979
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12980
|
+
isReadOnly = _ref.isReadOnly,
|
|
12981
|
+
isCondensed = _ref.isCondensed;
|
|
12982
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12983
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12984
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
12985
|
+
validateForm = _useFormikContext.validateForm;
|
|
12986
|
+
const _useIntl = reactIntl.useIntl(),
|
|
12987
|
+
formatMessage = _useIntl.formatMessage;
|
|
12988
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
12989
|
+
language: applicationContext.dataLocale,
|
|
12990
|
+
languages: applicationContext.project.languages
|
|
12991
|
+
})),
|
|
12992
|
+
language = _useApplicationContex.language,
|
|
12993
|
+
languages = _useApplicationContex.languages;
|
|
12994
|
+
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
12995
|
+
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12996
|
+
if (selectedTypeDefinition) {
|
|
12997
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12998
|
+
setFieldValue(FIELD_NAME, nextCustom).then(() => {
|
|
12999
|
+
validateForm();
|
|
13000
|
+
});
|
|
13001
|
+
} else {
|
|
13002
|
+
// if the dropdown selector is cleared, remove the `custom` field from the form state entirely
|
|
13003
|
+
setFieldValue(FIELD_NAME, undefined).then(() => {
|
|
13004
|
+
validateForm();
|
|
13005
|
+
});
|
|
13006
|
+
}
|
|
13007
|
+
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
13008
|
+
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
13009
|
+
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
13010
|
+
isCondensed: isCondensed,
|
|
13011
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.title))
|
|
13012
|
+
}),
|
|
13013
|
+
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
13014
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + ("" ), "" ),
|
|
13015
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
13016
|
+
isClearable: true,
|
|
13017
|
+
"data-testid": "custom-type-select",
|
|
13018
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
13019
|
+
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),
|
|
13020
|
+
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,
|
|
13021
|
+
onChange: handleTypeDefinitionSelect,
|
|
13022
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
13023
|
+
isReadOnly: isReadOnly
|
|
13024
|
+
})
|
|
13025
|
+
}),
|
|
13026
|
+
headerControlsAlignment: "right",
|
|
13027
|
+
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
13028
|
+
typeDefinitions: typeDefinitions,
|
|
13029
|
+
isReadOnly: isReadOnly
|
|
13030
|
+
})
|
|
13031
|
+
});
|
|
13032
|
+
};
|
|
13033
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
13034
|
+
|
|
13035
|
+
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; }
|
|
13036
|
+
function _objectSpread(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(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(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
13037
|
+
const transformFieldType = fieldDefinition => {
|
|
13038
|
+
var _fieldDefinition$type, _fieldDefinition$type2;
|
|
13039
|
+
if (((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum') {
|
|
13040
|
+
var _context;
|
|
13041
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
13042
|
+
elementType: _objectSpread(_objectSpread({}, fieldDefinition.type.elementType), {}, {
|
|
13043
|
+
values: _mapInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context, value => ({
|
|
13044
|
+
key: value.key,
|
|
13045
|
+
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
13046
|
+
}))
|
|
13047
|
+
})
|
|
13048
|
+
});
|
|
13049
|
+
} else if (((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum') {
|
|
13050
|
+
var _context2;
|
|
13051
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
13052
|
+
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context2, value => ({
|
|
13053
|
+
key: value.key,
|
|
13054
|
+
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
13055
|
+
}))
|
|
13056
|
+
});
|
|
13057
|
+
} else {
|
|
13058
|
+
return fieldDefinition.type;
|
|
13059
|
+
}
|
|
13060
|
+
};
|
|
13061
|
+
const convertCustomField = resource => {
|
|
13062
|
+
var _context3, _context4;
|
|
13063
|
+
return {
|
|
13064
|
+
type: {
|
|
13065
|
+
typeId: 'type',
|
|
13066
|
+
id: resource.custom.type.id,
|
|
13067
|
+
obj: {
|
|
13068
|
+
key: resource.custom.type.key,
|
|
13069
|
+
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
13070
|
+
fieldDefinitions: _mapInstanceProperty__default["default"](_context3 = resource.custom.type.fieldDefinitions).call(_context3, fieldDefinition => ({
|
|
13071
|
+
name: fieldDefinition.name,
|
|
13072
|
+
required: fieldDefinition.required,
|
|
13073
|
+
inputHint: fieldDefinition.inputHint,
|
|
13074
|
+
type: transformFieldType(fieldDefinition),
|
|
13075
|
+
label: l10n.transformLocalizedFieldToLocalizedString(fieldDefinition.labelAllLocales)
|
|
13076
|
+
}))
|
|
13077
|
+
}
|
|
13078
|
+
},
|
|
13079
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread(_objectSpread({}, fields), {}, {
|
|
13080
|
+
[customField.name]: customField.value
|
|
13081
|
+
}), {})
|
|
13082
|
+
};
|
|
13083
|
+
};
|
|
13084
|
+
const createFormStateFromResource = resource => {
|
|
13085
|
+
// If there are no custom fields on the resource, don't create a form state
|
|
13086
|
+
if (!resource[FIELD_NAME]) {
|
|
13087
|
+
return {
|
|
13088
|
+
[FIELD_NAME]: undefined
|
|
13089
|
+
};
|
|
13090
|
+
}
|
|
13091
|
+
return {
|
|
13092
|
+
[FIELD_NAME]: convertCustomField(resource)
|
|
13093
|
+
};
|
|
13094
|
+
};
|
|
13095
|
+
const createGraphQlDocFromFormState = formState => {
|
|
13096
|
+
var _context5;
|
|
13097
|
+
// Unset the custom type if it's not in the form state
|
|
13098
|
+
if (!formState[FIELD_NAME]) {
|
|
13099
|
+
return {
|
|
13100
|
+
[FIELD_NAME]: {}
|
|
13101
|
+
};
|
|
13102
|
+
}
|
|
13103
|
+
return {
|
|
13104
|
+
[FIELD_NAME]: {
|
|
13105
|
+
type: {
|
|
13106
|
+
id: formState[FIELD_NAME].type.id,
|
|
13107
|
+
typeId: 'type'
|
|
13108
|
+
},
|
|
13109
|
+
fields: _mapInstanceProperty__default["default"](_context5 = _Object$entries__default["default"](formState[FIELD_NAME].fields)).call(_context5, _ref => {
|
|
13110
|
+
let _ref2 = _slicedToArray(_ref, 2),
|
|
13111
|
+
name = _ref2[0],
|
|
13112
|
+
value = _ref2[1];
|
|
13113
|
+
return {
|
|
13114
|
+
name,
|
|
13115
|
+
value: _JSON$stringify__default["default"](value)
|
|
13116
|
+
};
|
|
13117
|
+
})
|
|
13118
|
+
}
|
|
13119
|
+
};
|
|
13120
|
+
};
|
|
13121
|
+
|
|
13122
|
+
const CustomFieldsFormField = _ref => {
|
|
13123
|
+
let resources = _ref.resources,
|
|
13124
|
+
isReadOnly = _ref.isReadOnly,
|
|
13125
|
+
isCondensed = _ref.isCondensed;
|
|
13126
|
+
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13127
|
+
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13128
|
+
resources: resources,
|
|
13129
|
+
projectKey: projectKey,
|
|
13130
|
+
children: _ref2 => {
|
|
13131
|
+
var _context;
|
|
13132
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
13133
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13134
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13135
|
+
if (isLoading) {
|
|
13136
|
+
return jsxRuntime.jsx(uiKit.LoadingSpinner, {});
|
|
13137
|
+
}
|
|
13138
|
+
const typeDefinitions = _mapInstanceProperty__default["default"](_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13139
|
+
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13140
|
+
typeDefinitions: typeDefinitions,
|
|
13141
|
+
isReadOnly: isReadOnly,
|
|
13142
|
+
isCondensed: isCondensed
|
|
13143
|
+
});
|
|
13144
|
+
}
|
|
13145
|
+
});
|
|
13146
|
+
};
|
|
13147
|
+
CustomFieldsFormField.createFormStateFromResource = createFormStateFromResource;
|
|
13148
|
+
CustomFieldsFormField.createGraphQlDocFromFormState = createGraphQlDocFromFormState;
|
|
13149
|
+
|
|
12834
13150
|
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
13151
|
|
|
12836
13152
|
exports.BooleanField = booleanField;
|
|
@@ -12842,9 +13158,10 @@ exports.CenteredLoadingSpinner = CenteredLoadingSpinner;
|
|
|
12842
13158
|
exports.ChannelPickerInput = ChannelPickerInput;
|
|
12843
13159
|
exports.CountriesPicker = CountriesPicker;
|
|
12844
13160
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
12845
|
-
exports.CustomFieldTypeDefinitionsConnector =
|
|
13161
|
+
exports.CustomFieldTypeDefinitionsConnector = CustomFieldTypeDefinitionsConnector$1;
|
|
12846
13162
|
exports.CustomFields = CustomFields;
|
|
12847
13163
|
exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification;
|
|
13164
|
+
exports.CustomFieldsFormField = CustomFieldsFormField;
|
|
12848
13165
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput;
|
|
12849
13166
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
12850
13167
|
exports.Divider = Divider;
|
|
@@ -12877,10 +13194,10 @@ exports.allowedProperties = allowedProperties;
|
|
|
12877
13194
|
exports.and = and;
|
|
12878
13195
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
12879
13196
|
exports.base64ToString = base64ToString;
|
|
12880
|
-
exports.booleanMessages = messages$
|
|
13197
|
+
exports.booleanMessages = messages$8;
|
|
12881
13198
|
exports.buildSearchQuery = buildSearchQuery;
|
|
12882
13199
|
exports.businessRoleConstants = businessRoleConstants;
|
|
12883
|
-
exports.businessRoleMessages = messages$
|
|
13200
|
+
exports.businessRoleMessages = messages$r;
|
|
12884
13201
|
exports.businessRoles = businessRoleKeys;
|
|
12885
13202
|
exports.capitalizeFirst = capitalizeFirst;
|
|
12886
13203
|
exports.clone = clone;
|
|
@@ -12965,7 +13282,7 @@ exports.keepDisplayName = keepDisplayName;
|
|
|
12965
13282
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
12966
13283
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
12967
13284
|
exports.minusify = minusify;
|
|
12968
|
-
exports.missingValueMessages = messages$
|
|
13285
|
+
exports.missingValueMessages = messages$7;
|
|
12969
13286
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
12970
13287
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
12971
13288
|
exports.not = not;
|
|
@@ -12982,7 +13299,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
12982
13299
|
exports.safelyAddFallback = safelyAddFallback;
|
|
12983
13300
|
exports.sanitize = sanitize;
|
|
12984
13301
|
exports.searchCategories = searchCategories;
|
|
12985
|
-
exports.searchInputMessages = messages$
|
|
13302
|
+
exports.searchInputMessages = messages$F;
|
|
12986
13303
|
exports.setDisplayName = setDisplayName;
|
|
12987
13304
|
exports.setToArray = setToArray;
|
|
12988
13305
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13028,7 +13345,7 @@ exports.validateNumber = validateFilter;
|
|
|
13028
13345
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13029
13346
|
exports.validateText = validateText;
|
|
13030
13347
|
exports.validatedInput = validatedInput;
|
|
13031
|
-
exports.validationMessages = messages$
|
|
13348
|
+
exports.validationMessages = messages$K;
|
|
13032
13349
|
exports.withPendingRequests = withPendingRequests;
|
|
13033
13350
|
exports.withProps = withProps;
|
|
13034
13351
|
exports.withRedirectTo = withRedirectTo;
|