@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 warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
@@ -376,7 +378,7 @@ function uniqueObjects(items) {
|
|
|
376
378
|
|
|
377
379
|
*/
|
|
378
380
|
|
|
379
|
-
const messages$
|
|
381
|
+
const messages$K = reactIntl.defineMessages({
|
|
380
382
|
unique: {
|
|
381
383
|
id: 'Validation.unique',
|
|
382
384
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1671,8 +1673,8 @@ const getData = (code, field) => {
|
|
|
1671
1673
|
};
|
|
1672
1674
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1673
1675
|
|
|
1674
|
-
function ownKeys$
|
|
1675
|
-
function _objectSpread$
|
|
1676
|
+
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; }
|
|
1677
|
+
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; }
|
|
1676
1678
|
function formatMoneyRangeValue(value, intl) {
|
|
1677
1679
|
var _context;
|
|
1678
1680
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1682,7 +1684,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1682
1684
|
return '';
|
|
1683
1685
|
}
|
|
1684
1686
|
function formatMoneyValue(amount, currency, intl) {
|
|
1685
|
-
return formatMoney$1(_objectSpread$
|
|
1687
|
+
return formatMoney$1(_objectSpread$1l({
|
|
1686
1688
|
centAmount: amount,
|
|
1687
1689
|
fractionDigits: getFractionDigit(currency)
|
|
1688
1690
|
}, currency ? {
|
|
@@ -1699,14 +1701,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1699
1701
|
}
|
|
1700
1702
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1701
1703
|
var _moneyValue$fractione;
|
|
1702
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1704
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1l({
|
|
1703
1705
|
style: 'currency',
|
|
1704
1706
|
currency: moneyValue.currencyCode,
|
|
1705
1707
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1706
1708
|
}, options));
|
|
1707
1709
|
}
|
|
1708
1710
|
|
|
1709
|
-
var messages$
|
|
1711
|
+
var messages$J = reactIntl.defineMessages({
|
|
1710
1712
|
booleanYes: {
|
|
1711
1713
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1712
1714
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1791,7 +1793,7 @@ const formatDateTime = _ref7 => {
|
|
|
1791
1793
|
const formatBoolean = _ref8 => {
|
|
1792
1794
|
let value = _ref8.value,
|
|
1793
1795
|
intl = _ref8.intl;
|
|
1794
|
-
return value ? intl.formatMessage(messages$
|
|
1796
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1795
1797
|
};
|
|
1796
1798
|
const formatNilType = _ref9 => {
|
|
1797
1799
|
let value = _ref9.value,
|
|
@@ -1953,8 +1955,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1953
1955
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1954
1956
|
};
|
|
1955
1957
|
|
|
1956
|
-
function ownKeys$
|
|
1957
|
-
function _objectSpread$
|
|
1958
|
+
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; }
|
|
1959
|
+
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; }
|
|
1958
1960
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1959
1961
|
const WithDataTablePaginationState = props => {
|
|
1960
1962
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1965,10 +1967,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1965
1967
|
page = _usePaginationState.page,
|
|
1966
1968
|
perPage = _usePaginationState.perPage;
|
|
1967
1969
|
const tableSorting = uiKit.useDataTableSortingState({
|
|
1968
|
-
key: initialValues === null || initialValues === void 0
|
|
1969
|
-
order: initialValues === null || initialValues === void 0
|
|
1970
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1971
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1970
1972
|
});
|
|
1971
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1973
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
1972
1974
|
dataTablePaginationState: {
|
|
1973
1975
|
page,
|
|
1974
1976
|
perPage,
|
|
@@ -1980,8 +1982,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1980
1982
|
return WithDataTablePaginationState;
|
|
1981
1983
|
};
|
|
1982
1984
|
|
|
1983
|
-
function ownKeys$
|
|
1984
|
-
function _objectSpread$
|
|
1985
|
+
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; }
|
|
1986
|
+
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; }
|
|
1985
1987
|
const injectNotifications = function () {
|
|
1986
1988
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1987
1989
|
return Component => {
|
|
@@ -1996,7 +1998,7 @@ const injectNotifications = function () {
|
|
|
1996
1998
|
onActionError,
|
|
1997
1999
|
hideAllPageNotifications
|
|
1998
2000
|
};
|
|
1999
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2001
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
2000
2002
|
[propName]: notifications
|
|
2001
2003
|
}));
|
|
2002
2004
|
};
|
|
@@ -2005,22 +2007,22 @@ const injectNotifications = function () {
|
|
|
2005
2007
|
};
|
|
2006
2008
|
};
|
|
2007
2009
|
|
|
2008
|
-
function ownKeys$
|
|
2009
|
-
function _objectSpread$
|
|
2010
|
+
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; }
|
|
2011
|
+
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; }
|
|
2010
2012
|
function isPropsMapper(mapProps) {
|
|
2011
2013
|
return typeof mapProps === 'function';
|
|
2012
2014
|
}
|
|
2013
2015
|
const withProps = mapProps => Component => {
|
|
2014
2016
|
const EnhancedWithProps = ownProps => {
|
|
2015
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2016
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2017
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps(ownProps)) : _objectSpread$1i(_objectSpread$1i({}, ownProps), mapProps);
|
|
2018
|
+
return jsxRuntime.jsx(Component, _objectSpread$1i({}, enhancedProps));
|
|
2017
2019
|
};
|
|
2018
2020
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2019
2021
|
return EnhancedWithProps;
|
|
2020
2022
|
};
|
|
2021
2023
|
|
|
2022
|
-
function ownKeys$
|
|
2023
|
-
function _objectSpread$
|
|
2024
|
+
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; }
|
|
2025
|
+
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; }
|
|
2024
2026
|
const useRedirectEffect = _ref => {
|
|
2025
2027
|
let goTo = _ref.goTo;
|
|
2026
2028
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2040,30 +2042,30 @@ const defaultOptions$5 = {
|
|
|
2040
2042
|
skip: () => false
|
|
2041
2043
|
};
|
|
2042
2044
|
const withRedirectTo = options => Component => {
|
|
2043
|
-
const mergedOptions = _objectSpread$
|
|
2045
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$5), options);
|
|
2044
2046
|
const WithRedirectTo = props => {
|
|
2045
2047
|
if (!mergedOptions.skip(props)) {
|
|
2046
2048
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2047
2049
|
goTo: options.selectGoTo(props)
|
|
2048
2050
|
});
|
|
2049
2051
|
}
|
|
2050
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2052
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h({}, props));
|
|
2051
2053
|
};
|
|
2052
2054
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2053
2055
|
return WithRedirectTo;
|
|
2054
2056
|
};
|
|
2055
2057
|
|
|
2056
|
-
function ownKeys$
|
|
2057
|
-
function _objectSpread$
|
|
2058
|
+
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; }
|
|
2059
|
+
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; }
|
|
2058
2060
|
const defaultOptions$4 = {
|
|
2059
2061
|
propName: 'modalState',
|
|
2060
2062
|
isInitiallyOpen: false
|
|
2061
2063
|
};
|
|
2062
2064
|
const injectModalState$1 = options => Component => {
|
|
2063
|
-
const mergedOptions = _objectSpread$
|
|
2065
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$4), options);
|
|
2064
2066
|
const WithModalState = props => {
|
|
2065
2067
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2066
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2068
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g(_objectSpread$1g({}, props), {}, {
|
|
2067
2069
|
[mergedOptions.propName]: modalState
|
|
2068
2070
|
}));
|
|
2069
2071
|
};
|
|
@@ -2071,17 +2073,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2071
2073
|
return WithModalState;
|
|
2072
2074
|
};
|
|
2073
2075
|
|
|
2074
|
-
function ownKeys$
|
|
2075
|
-
function _objectSpread$
|
|
2076
|
+
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; }
|
|
2077
|
+
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; }
|
|
2076
2078
|
const defaultOptions$3 = {
|
|
2077
2079
|
propName: 'toggleState',
|
|
2078
2080
|
isInitiallyOpen: false
|
|
2079
2081
|
};
|
|
2080
2082
|
const injectModalState = options => Component => {
|
|
2081
|
-
const mergedOptions = _objectSpread$
|
|
2083
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$3), options);
|
|
2082
2084
|
const WithToggleState = props => {
|
|
2083
2085
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2084
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2086
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2085
2087
|
[mergedOptions.propName]: toggleState
|
|
2086
2088
|
}));
|
|
2087
2089
|
};
|
|
@@ -2089,8 +2091,8 @@ const injectModalState = options => Component => {
|
|
|
2089
2091
|
return WithToggleState;
|
|
2090
2092
|
};
|
|
2091
2093
|
|
|
2092
|
-
function ownKeys$
|
|
2093
|
-
function _objectSpread$
|
|
2094
|
+
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; }
|
|
2095
|
+
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; }
|
|
2094
2096
|
const defaultOptions$2 = {
|
|
2095
2097
|
storageType: 'local',
|
|
2096
2098
|
segregateByUser: true
|
|
@@ -2108,7 +2110,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2108
2110
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2109
2111
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2110
2112
|
var _context;
|
|
2111
|
-
const mergedOptions = _objectSpread$
|
|
2113
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$2), options);
|
|
2112
2114
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2113
2115
|
var _context$user;
|
|
2114
2116
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2156,8 +2158,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2156
2158
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2157
2159
|
};
|
|
2158
2160
|
|
|
2159
|
-
function ownKeys$
|
|
2160
|
-
function _objectSpread$
|
|
2161
|
+
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; }
|
|
2162
|
+
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; }
|
|
2161
2163
|
const defaultOptions$1 = {
|
|
2162
2164
|
propName: 'storage',
|
|
2163
2165
|
storageKey: '',
|
|
@@ -2170,7 +2172,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2170
2172
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2171
2173
|
* argument position does not allow passing specification of option(s).
|
|
2172
2174
|
*/
|
|
2173
|
-
const mergedOptions = _objectSpread$
|
|
2175
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$1), options);
|
|
2174
2176
|
const WithStorage = props => {
|
|
2175
2177
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2176
2178
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2184,7 +2186,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2184
2186
|
readFromStorage
|
|
2185
2187
|
}
|
|
2186
2188
|
};
|
|
2187
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2189
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1d(_objectSpread$1d({}, props), storageProp));
|
|
2188
2190
|
};
|
|
2189
2191
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2190
2192
|
return WithStorage;
|
|
@@ -2228,9 +2230,9 @@ const usePrevious = value => {
|
|
|
2228
2230
|
return ref.current;
|
|
2229
2231
|
};
|
|
2230
2232
|
|
|
2231
|
-
function ownKeys$
|
|
2232
|
-
function _objectSpread$
|
|
2233
|
-
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: "
|
|
2233
|
+
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; }
|
|
2234
|
+
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; }
|
|
2235
|
+
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 } } } };
|
|
2234
2236
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2235
2237
|
var _storesQueryResult$re;
|
|
2236
2238
|
if (!storesQueryResult) return null;
|
|
@@ -2240,7 +2242,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2240
2242
|
offset: storesQueryResult.offset,
|
|
2241
2243
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2242
2244
|
var _store$productSelecti;
|
|
2243
|
-
return _objectSpread$
|
|
2245
|
+
return _objectSpread$1c(_objectSpread$1c({}, store), {}, {
|
|
2244
2246
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2245
2247
|
});
|
|
2246
2248
|
})
|
|
@@ -2248,7 +2250,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2248
2250
|
};
|
|
2249
2251
|
const createQueryVariables$6 = ownProps => {
|
|
2250
2252
|
var _context;
|
|
2251
|
-
return _objectSpread$
|
|
2253
|
+
return _objectSpread$1c(_objectSpread$1c({
|
|
2252
2254
|
limit: ownProps.limit,
|
|
2253
2255
|
offset: ownProps.offset,
|
|
2254
2256
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2403,8 +2405,8 @@ function useDidFormValidationFail() {
|
|
|
2403
2405
|
return Boolean(didFormValidationFail);
|
|
2404
2406
|
}
|
|
2405
2407
|
|
|
2406
|
-
function ownKeys$
|
|
2407
|
-
function _objectSpread$
|
|
2408
|
+
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; }
|
|
2409
|
+
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; }
|
|
2408
2410
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2409
2411
|
const defaultOptions = {
|
|
2410
2412
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2432,7 +2434,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2432
2434
|
};
|
|
2433
2435
|
const usePersistedReminder = function () {
|
|
2434
2436
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2435
|
-
const mergedOptions = _objectSpread$
|
|
2437
|
+
const mergedOptions = _objectSpread$1b(_objectSpread$1b({}, defaultOptions), options);
|
|
2436
2438
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2437
2439
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2438
2440
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2478,7 +2480,7 @@ const usePersistedReminder = function () {
|
|
|
2478
2480
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2479
2481
|
};
|
|
2480
2482
|
|
|
2481
|
-
var messages$
|
|
2483
|
+
var messages$I = reactIntl.defineMessages({
|
|
2482
2484
|
profileUpdated: {
|
|
2483
2485
|
id: 'NotificationText.profileUpdated',
|
|
2484
2486
|
description: 'Label for the notification header',
|
|
@@ -2496,8 +2498,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2496
2498
|
}
|
|
2497
2499
|
});
|
|
2498
2500
|
|
|
2499
|
-
function ownKeys$
|
|
2500
|
-
function _objectSpread$
|
|
2501
|
+
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; }
|
|
2502
|
+
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; }
|
|
2501
2503
|
const LinkToProfile = props => {
|
|
2502
2504
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2503
2505
|
to: "/account/profile",
|
|
@@ -2515,9 +2517,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2515
2517
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2516
2518
|
as: "p",
|
|
2517
2519
|
isBold: true,
|
|
2518
|
-
intlMessage: messages$
|
|
2520
|
+
intlMessage: messages$I.profileUpdated
|
|
2519
2521
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2520
|
-
intlMessage: _objectSpread$
|
|
2522
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.addMoreInformation), {}, {
|
|
2521
2523
|
values: {
|
|
2522
2524
|
newline: getNewLine
|
|
2523
2525
|
}
|
|
@@ -2526,7 +2528,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2526
2528
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2527
2529
|
scale: "xs",
|
|
2528
2530
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2529
|
-
intlMessage: _objectSpread$
|
|
2531
|
+
intlMessage: _objectSpread$1a(_objectSpread$1a({}, messages$I.informationAndProfileLink), {}, {
|
|
2530
2532
|
values: {
|
|
2531
2533
|
newline: getNewLine,
|
|
2532
2534
|
link: getLinkToProfile
|
|
@@ -2647,7 +2649,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2647
2649
|
}, [ref]);
|
|
2648
2650
|
};
|
|
2649
2651
|
|
|
2650
|
-
var messages$
|
|
2652
|
+
var messages$H = reactIntl.defineMessages({
|
|
2651
2653
|
fallbackHint: {
|
|
2652
2654
|
id: 'KeyFallback.fallbackHint',
|
|
2653
2655
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2671,7 +2673,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2671
2673
|
return values => {
|
|
2672
2674
|
if (!values.resource) return null;
|
|
2673
2675
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2674
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2676
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2675
2677
|
key: values.resource.key
|
|
2676
2678
|
});
|
|
2677
2679
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2683,8 +2685,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2683
2685
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2684
2686
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2685
2687
|
|
|
2686
|
-
function ownKeys$
|
|
2687
|
-
function _objectSpread$
|
|
2688
|
+
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; }
|
|
2689
|
+
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; }
|
|
2688
2690
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2689
2691
|
const updatedColumnProps = {};
|
|
2690
2692
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2704,14 +2706,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2704
2706
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2705
2707
|
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 => {
|
|
2706
2708
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2707
|
-
return _objectSpread$
|
|
2709
|
+
return _objectSpread$19(_objectSpread$19({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2708
2710
|
});
|
|
2709
2711
|
};
|
|
2710
2712
|
const handleCacheUpdate = _ref2 => {
|
|
2711
2713
|
let update = _ref2.update,
|
|
2712
2714
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2713
2715
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2714
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2716
|
+
return updateCachedTableConfiguration(_objectSpread$19(_objectSpread$19({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2715
2717
|
};
|
|
2716
2718
|
|
|
2717
2719
|
// Signature:
|
|
@@ -2740,7 +2742,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2740
2742
|
return {
|
|
2741
2743
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2742
2744
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2743
|
-
return _objectSpread$
|
|
2745
|
+
return _objectSpread$19({
|
|
2744
2746
|
key: visibleColumnKey
|
|
2745
2747
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2746
2748
|
}),
|
|
@@ -2796,7 +2798,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2796
2798
|
data = _useQuery.data;
|
|
2797
2799
|
return {
|
|
2798
2800
|
isLoading: loading,
|
|
2799
|
-
total: data === null || data === void 0
|
|
2801
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2800
2802
|
};
|
|
2801
2803
|
};
|
|
2802
2804
|
|
|
@@ -2811,21 +2813,21 @@ const handlers$4 = {
|
|
|
2811
2813
|
}
|
|
2812
2814
|
};
|
|
2813
2815
|
|
|
2814
|
-
function ownKeys$
|
|
2815
|
-
function _objectSpread$
|
|
2816
|
+
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; }
|
|
2817
|
+
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; }
|
|
2816
2818
|
|
|
2817
2819
|
// eslint-disable-next-line import/prefer-default-export
|
|
2818
2820
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2819
2821
|
var _context;
|
|
2820
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2821
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2822
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$18(_objectSpread$18({}, productSelections), {}, {
|
|
2823
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$18({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2822
2824
|
from: 'nameAllLocales',
|
|
2823
2825
|
to: 'name'
|
|
2824
2826
|
}])))
|
|
2825
2827
|
});
|
|
2826
2828
|
};
|
|
2827
2829
|
|
|
2828
|
-
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: "
|
|
2830
|
+
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 } } } };
|
|
2829
2831
|
const createQueryVariables$5 = ownProps => ({
|
|
2830
2832
|
limit: ownProps.limit,
|
|
2831
2833
|
offset: ownProps.offset,
|
|
@@ -2968,7 +2970,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
2968
2970
|
});
|
|
2969
2971
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2970
2972
|
|
|
2971
|
-
var messages$
|
|
2973
|
+
var messages$G = reactIntl.defineMessages({
|
|
2972
2974
|
noChannelsFound: {
|
|
2973
2975
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2974
2976
|
description: 'The message to display when no channels were found',
|
|
@@ -2994,8 +2996,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2994
2996
|
}
|
|
2995
2997
|
});
|
|
2996
2998
|
|
|
2997
|
-
function ownKeys$
|
|
2998
|
-
function _objectSpread$
|
|
2999
|
+
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; }
|
|
3000
|
+
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; }
|
|
2999
3001
|
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 } } } };
|
|
3000
3002
|
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 } } } };
|
|
3001
3003
|
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 } } } };
|
|
@@ -3016,7 +3018,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3016
3018
|
const _useIntl = reactIntl.useIntl(),
|
|
3017
3019
|
formatMessage = _useIntl.formatMessage;
|
|
3018
3020
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3019
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3021
|
+
const variables = React.useMemo(() => _objectSpread$17({
|
|
3020
3022
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3021
3023
|
}, role && {
|
|
3022
3024
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3077,8 +3079,8 @@ const ChannelPickerInput = _ref => {
|
|
|
3077
3079
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3078
3080
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3079
3081
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3080
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3081
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3082
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3083
|
+
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 : '';
|
|
3082
3084
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3083
3085
|
max: "scale",
|
|
3084
3086
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3088,7 +3090,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3088
3090
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3089
3091
|
id: name,
|
|
3090
3092
|
name: name,
|
|
3091
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3093
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3092
3094
|
loadOptions: loadOptionsDebounced,
|
|
3093
3095
|
defaultOptions: true,
|
|
3094
3096
|
showOptionGroupDivider: true,
|
|
@@ -3131,7 +3133,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3131
3133
|
var _this$props;
|
|
3132
3134
|
let user = _ref.user;
|
|
3133
3135
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3134
|
-
timeZone: (this === null || this === void 0
|
|
3136
|
+
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),
|
|
3135
3137
|
locale: this.props.intl.locale
|
|
3136
3138
|
});
|
|
3137
3139
|
}
|
|
@@ -3145,8 +3147,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3145
3147
|
|
|
3146
3148
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3147
3149
|
|
|
3148
|
-
function ownKeys$
|
|
3149
|
-
function _objectSpread$
|
|
3150
|
+
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; }
|
|
3151
|
+
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; }
|
|
3150
3152
|
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); }; }
|
|
3151
3153
|
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; } }
|
|
3152
3154
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3178,7 +3180,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3178
3180
|
handleMouseOver: this.handleMouseOver,
|
|
3179
3181
|
handleMouseOut: this.handleMouseOut
|
|
3180
3182
|
};
|
|
3181
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3183
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$16({}, _objectSpread$16(_objectSpread$16({}, this.props), injectedProps)));
|
|
3182
3184
|
}
|
|
3183
3185
|
}]);
|
|
3184
3186
|
return WithMouseOverState;
|
|
@@ -3187,8 +3189,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3187
3189
|
return WithMouseOverState;
|
|
3188
3190
|
};
|
|
3189
3191
|
|
|
3190
|
-
function ownKeys$
|
|
3191
|
-
function _objectSpread$
|
|
3192
|
+
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; }
|
|
3193
|
+
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; }
|
|
3192
3194
|
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); }; }
|
|
3193
3195
|
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; } }
|
|
3194
3196
|
var styles$h = {
|
|
@@ -3214,7 +3216,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3214
3216
|
}
|
|
3215
3217
|
_this = _super.call(this, ...args);
|
|
3216
3218
|
_this.state = {
|
|
3217
|
-
draftValue:
|
|
3219
|
+
draftValue: '',
|
|
3220
|
+
prevValue: ''
|
|
3218
3221
|
};
|
|
3219
3222
|
_this.clearPendingUpdates = () => {
|
|
3220
3223
|
clearTimeout(_this.changeTimeout);
|
|
@@ -3261,8 +3264,8 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3261
3264
|
};
|
|
3262
3265
|
_this.doDelayedUpdate = (updateFunction, event, eventType) => {
|
|
3263
3266
|
const self = _assertThisInitialized(_this);
|
|
3264
|
-
// TODO: can't we just use one variable?
|
|
3265
3267
|
const timeoutKey = "".concat(eventType, "Timeout");
|
|
3268
|
+
// TODO: can't we just use one variable?
|
|
3266
3269
|
clearTimeout(_this[timeoutKey]);
|
|
3267
3270
|
_this[timeoutKey] = _setTimeout__default["default"](() => {
|
|
3268
3271
|
updateFunction.call(self, event);
|
|
@@ -3272,26 +3275,6 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3272
3275
|
return _this;
|
|
3273
3276
|
}
|
|
3274
3277
|
_createClass(ThrottledField, [{
|
|
3275
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
3276
|
-
value:
|
|
3277
|
-
// eslint-disable-next-line camelcase
|
|
3278
|
-
function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
3279
|
-
if (!has__default["default"](nextProps, 'value')) return;
|
|
3280
|
-
if (!nextProps.value && nextProps.value !== 0) {
|
|
3281
|
-
// let new value from props take precedence over pending updates
|
|
3282
|
-
this.clearPendingUpdates();
|
|
3283
|
-
this.setState({
|
|
3284
|
-
draftValue: ''
|
|
3285
|
-
});
|
|
3286
|
-
} else if (nextProps.value !== this.state.draftValue) {
|
|
3287
|
-
// let new value from props take precedence over pending updates
|
|
3288
|
-
this.clearPendingUpdates();
|
|
3289
|
-
this.setState({
|
|
3290
|
-
draftValue: nextProps.value
|
|
3291
|
-
});
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
}, {
|
|
3295
3278
|
key: "componentWillUnmount",
|
|
3296
3279
|
value: function componentWillUnmount() {
|
|
3297
3280
|
this.clearPendingUpdates();
|
|
@@ -3299,7 +3282,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3299
3282
|
}, {
|
|
3300
3283
|
key: "render",
|
|
3301
3284
|
value: function render() {
|
|
3302
|
-
const commonProps = _objectSpread$
|
|
3285
|
+
const commonProps = _objectSpread$15(_objectSpread$15({
|
|
3303
3286
|
value: this.state.draftValue,
|
|
3304
3287
|
autoComplete: this.props.autoComplete,
|
|
3305
3288
|
onChange: this.handleChange,
|
|
@@ -3318,7 +3301,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3318
3301
|
htmlFor: inputId,
|
|
3319
3302
|
children: this.props.label
|
|
3320
3303
|
})
|
|
3321
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3304
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3322
3305
|
id: inputId,
|
|
3323
3306
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3324
3307
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3327,7 +3310,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3327
3310
|
rows: 1,
|
|
3328
3311
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3329
3312
|
cacheMeasurements: true
|
|
3330
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3313
|
+
})) : jsxRuntime.jsx("input", _objectSpread$15(_objectSpread$15({}, commonProps), {}, {
|
|
3331
3314
|
id: inputId,
|
|
3332
3315
|
ref: this.props.inputRef,
|
|
3333
3316
|
type: this.props.as,
|
|
@@ -3339,6 +3322,17 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3339
3322
|
}))]
|
|
3340
3323
|
});
|
|
3341
3324
|
}
|
|
3325
|
+
}], [{
|
|
3326
|
+
key: "getDerivedStateFromProps",
|
|
3327
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
3328
|
+
if (nextProps.value !== prevState.prevValue) {
|
|
3329
|
+
return {
|
|
3330
|
+
draftValue: nextProps.value || nextProps.value === 0 ? nextProps.value : '',
|
|
3331
|
+
prevValue: nextProps.value
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
return null;
|
|
3335
|
+
}
|
|
3342
3336
|
}]);
|
|
3343
3337
|
return ThrottledField;
|
|
3344
3338
|
}(React.PureComponent);
|
|
@@ -3354,7 +3348,7 @@ ThrottledField.defaultProps = {
|
|
|
3354
3348
|
label: 'Throttled field'
|
|
3355
3349
|
};
|
|
3356
3350
|
|
|
3357
|
-
var messages$
|
|
3351
|
+
var messages$F = reactIntl.defineMessages({
|
|
3358
3352
|
buttonLabel: {
|
|
3359
3353
|
id: 'SearchInput.buttonLabel',
|
|
3360
3354
|
description: 'Label for "Search" button.',
|
|
@@ -3461,7 +3455,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3461
3455
|
"data-testid": this.props.testId || 'search-input',
|
|
3462
3456
|
value: this.state.text,
|
|
3463
3457
|
label: this.props.label,
|
|
3464
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3458
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3465
3459
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3466
3460
|
onChange: this.handleInputChange,
|
|
3467
3461
|
onEnter: this.handleEnter,
|
|
@@ -3554,7 +3548,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3554
3548
|
const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
|
|
3555
3549
|
var _result$hits$map, _result$hits;
|
|
3556
3550
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3557
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3551
|
+
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 : [];
|
|
3558
3552
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3559
3553
|
if (ids.length === 0) {
|
|
3560
3554
|
return {
|
|
@@ -3637,7 +3631,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3637
3631
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3638
3632
|
};
|
|
3639
3633
|
const usePimStatus = () => {
|
|
3640
|
-
var _data$indicesExist
|
|
3634
|
+
var _data$indicesExist;
|
|
3641
3635
|
const _useQuery = react.useQuery(FetchIndicesExist$1, {
|
|
3642
3636
|
context: {
|
|
3643
3637
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3647,7 +3641,7 @@ const usePimStatus = () => {
|
|
|
3647
3641
|
data = _useQuery.data;
|
|
3648
3642
|
return {
|
|
3649
3643
|
data,
|
|
3650
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3644
|
+
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)
|
|
3651
3645
|
};
|
|
3652
3646
|
};
|
|
3653
3647
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3676,7 +3670,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3676
3670
|
};
|
|
3677
3671
|
};
|
|
3678
3672
|
|
|
3679
|
-
var messages$
|
|
3673
|
+
var messages$E = reactIntl.defineMessages({
|
|
3680
3674
|
bottomOption: {
|
|
3681
3675
|
id: 'Products.Pickers.bottomOption',
|
|
3682
3676
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3684,11 +3678,11 @@ var messages$D = reactIntl.defineMessages({
|
|
|
3684
3678
|
}
|
|
3685
3679
|
});
|
|
3686
3680
|
|
|
3687
|
-
function ownKeys$
|
|
3688
|
-
function _objectSpread$
|
|
3681
|
+
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; }
|
|
3682
|
+
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; }
|
|
3689
3683
|
const getBottomOption = formatMessage => ({
|
|
3690
3684
|
options: [{
|
|
3691
|
-
label: formatMessage ? formatMessage(messages$
|
|
3685
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3692
3686
|
isBottomOption: true,
|
|
3693
3687
|
isDisabled: true
|
|
3694
3688
|
}]
|
|
@@ -3696,7 +3690,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3696
3690
|
const Option$2 = props => {
|
|
3697
3691
|
const _useIntl = reactIntl.useIntl(),
|
|
3698
3692
|
formatMessage = _useIntl.formatMessage;
|
|
3699
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3693
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$14(_objectSpread$14({}, props), {}, {
|
|
3700
3694
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3701
3695
|
tone: "secondary",
|
|
3702
3696
|
children: formatMessage(props.data.label)
|
|
@@ -3713,8 +3707,8 @@ const Option$2 = props => {
|
|
|
3713
3707
|
};
|
|
3714
3708
|
Option$2.displayName = 'Option';
|
|
3715
3709
|
|
|
3716
|
-
function ownKeys$
|
|
3717
|
-
function _objectSpread$
|
|
3710
|
+
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; }
|
|
3711
|
+
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; }
|
|
3718
3712
|
const useHandlers = onChange => {
|
|
3719
3713
|
const _useState = React.useState(),
|
|
3720
3714
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3725,8 +3719,8 @@ const useHandlers = onChange => {
|
|
|
3725
3719
|
}, []);
|
|
3726
3720
|
const handleChange = useEventCallback(event => {
|
|
3727
3721
|
var _event$target$value;
|
|
3728
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3729
|
-
target: _objectSpread$
|
|
3722
|
+
const eventWithExtractedValue = _objectSpread$13(_objectSpread$13({}, event), {}, {
|
|
3723
|
+
target: _objectSpread$13(_objectSpread$13({}, event.target), {}, {
|
|
3730
3724
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3731
3725
|
})
|
|
3732
3726
|
});
|
|
@@ -3735,8 +3729,8 @@ const useHandlers = onChange => {
|
|
|
3735
3729
|
return [handleInputChange, handleChange];
|
|
3736
3730
|
};
|
|
3737
3731
|
|
|
3738
|
-
function ownKeys
|
|
3739
|
-
function _objectSpread
|
|
3732
|
+
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; }
|
|
3733
|
+
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; }
|
|
3740
3734
|
const constructPrefixSearchPredicate = function () {
|
|
3741
3735
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3742
3736
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3779,7 +3773,7 @@ const useLoadOptions = _ref => {
|
|
|
3779
3773
|
}();
|
|
3780
3774
|
return client$1.query({
|
|
3781
3775
|
query,
|
|
3782
|
-
variables: _objectSpread
|
|
3776
|
+
variables: _objectSpread$12({
|
|
3783
3777
|
where
|
|
3784
3778
|
}, variables),
|
|
3785
3779
|
context: {
|
|
@@ -3833,7 +3827,7 @@ function useCurrentOption(_ref) {
|
|
|
3833
3827
|
};
|
|
3834
3828
|
}
|
|
3835
3829
|
|
|
3836
|
-
var messages$
|
|
3830
|
+
var messages$D = reactIntl.defineMessages({
|
|
3837
3831
|
noProductTypesFound: {
|
|
3838
3832
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3839
3833
|
description: 'The message to display when no product types were found',
|
|
@@ -3913,7 +3907,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3913
3907
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3914
3908
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3915
3909
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3916
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3910
|
+
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 : '';
|
|
3917
3911
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3918
3912
|
max: "scale",
|
|
3919
3913
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3923,7 +3917,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3923
3917
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3924
3918
|
id: name,
|
|
3925
3919
|
name: name,
|
|
3926
|
-
placeholder: formatMessage(messages$
|
|
3920
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3927
3921
|
loadOptions: loadOptionsDebounced,
|
|
3928
3922
|
defaultOptions: [],
|
|
3929
3923
|
isClearable: isClearable,
|
|
@@ -3936,7 +3930,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3936
3930
|
onInputChange: handleInputChange,
|
|
3937
3931
|
onBlur: onBlur,
|
|
3938
3932
|
value: currentOption.data,
|
|
3939
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3933
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3940
3934
|
hasError: hasError || isLoadingFailed
|
|
3941
3935
|
})
|
|
3942
3936
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3948,7 +3942,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3948
3942
|
};
|
|
3949
3943
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3950
3944
|
|
|
3951
|
-
var messages$
|
|
3945
|
+
var messages$C = reactIntl.defineMessages({
|
|
3952
3946
|
noStatesFound: {
|
|
3953
3947
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3954
3948
|
description: 'The message to display when no states were found',
|
|
@@ -4032,8 +4026,8 @@ const StatePickerInput = _ref => {
|
|
|
4032
4026
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4033
4027
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4034
4028
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4035
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4036
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
4029
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
4030
|
+
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 : '';
|
|
4037
4031
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4038
4032
|
max: "scale",
|
|
4039
4033
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -4044,7 +4038,7 @@ const StatePickerInput = _ref => {
|
|
|
4044
4038
|
id: name,
|
|
4045
4039
|
name: name,
|
|
4046
4040
|
horizontalConstraint: "scale",
|
|
4047
|
-
placeholder: formatMessage(messages$
|
|
4041
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
4048
4042
|
loadOptions: loadOptionsDebounced,
|
|
4049
4043
|
defaultOptions: true,
|
|
4050
4044
|
showOptionGroupDivider: true,
|
|
@@ -4070,9 +4064,9 @@ const StatePickerInput = _ref => {
|
|
|
4070
4064
|
};
|
|
4071
4065
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4072
4066
|
|
|
4073
|
-
function ownKeys$
|
|
4074
|
-
function _objectSpread$
|
|
4075
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4067
|
+
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; }
|
|
4068
|
+
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; }
|
|
4069
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$11({
|
|
4076
4070
|
ref: ref,
|
|
4077
4071
|
style: {
|
|
4078
4072
|
display: 'block',
|
|
@@ -4210,8 +4204,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4210
4204
|
};
|
|
4211
4205
|
|
|
4212
4206
|
const _excluded = ["action"];
|
|
4213
|
-
function ownKeys$
|
|
4214
|
-
function _objectSpread$
|
|
4207
|
+
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; }
|
|
4208
|
+
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; }
|
|
4215
4209
|
|
|
4216
4210
|
/**
|
|
4217
4211
|
* Checks if a value is a LocalizedString
|
|
@@ -4233,7 +4227,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4233
4227
|
*/
|
|
4234
4228
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4235
4229
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4236
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4230
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$10(_objectSpread$10({}, customFields), {}, {
|
|
4237
4231
|
[customField.name]: customField.value
|
|
4238
4232
|
}), {});
|
|
4239
4233
|
};
|
|
@@ -4257,7 +4251,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4257
4251
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4258
4252
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4259
4253
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4260
|
-
return _objectSpread$
|
|
4254
|
+
return _objectSpread$10(_objectSpread$10(_objectSpread$10({}, transformedData), parent ? {
|
|
4261
4255
|
parent
|
|
4262
4256
|
} : {}), ancestors ? {
|
|
4263
4257
|
ancestors
|
|
@@ -4482,7 +4476,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4482
4476
|
case 'addAttributeDefinition':
|
|
4483
4477
|
return {
|
|
4484
4478
|
[actionName]: {
|
|
4485
|
-
attributeDefinition: _objectSpread$
|
|
4479
|
+
attributeDefinition: _objectSpread$10(_objectSpread$10({}, actionPayload.attribute), {}, {
|
|
4486
4480
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4487
4481
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4488
4482
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4578,7 +4572,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4578
4572
|
return {
|
|
4579
4573
|
[actionName]: {
|
|
4580
4574
|
attributeName: actionPayload.attributeName,
|
|
4581
|
-
value: _objectSpread$
|
|
4575
|
+
value: _objectSpread$10(_objectSpread$10({}, actionPayload.value), {}, {
|
|
4582
4576
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4583
4577
|
})
|
|
4584
4578
|
}
|
|
@@ -4587,7 +4581,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4587
4581
|
return {
|
|
4588
4582
|
[actionName]: {
|
|
4589
4583
|
attributeName: actionPayload.attributeName,
|
|
4590
|
-
newValue: _objectSpread$
|
|
4584
|
+
newValue: _objectSpread$10(_objectSpread$10({}, actionPayload.newValue), {}, {
|
|
4591
4585
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4592
4586
|
})
|
|
4593
4587
|
}
|
|
@@ -4614,7 +4608,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4614
4608
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4615
4609
|
taxCategory: actionPayload.taxCategory,
|
|
4616
4610
|
money: {
|
|
4617
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4611
|
+
[actionPayload.money.type]: _objectSpread$10({
|
|
4618
4612
|
centAmount: actionPayload.money.centAmount,
|
|
4619
4613
|
currencyCode: actionPayload.money.currencyCode
|
|
4620
4614
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4649,7 +4643,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4649
4643
|
case 'addAddress':
|
|
4650
4644
|
case 'changeAddress':
|
|
4651
4645
|
{
|
|
4652
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4646
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4653
4647
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4654
4648
|
_ref3$fields = _ref3.fields,
|
|
4655
4649
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4662,15 +4656,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4662
4656
|
value: _JSON$stringify__default["default"](value)
|
|
4663
4657
|
};
|
|
4664
4658
|
});
|
|
4665
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4659
|
+
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 ? {
|
|
4666
4660
|
type: {
|
|
4667
4661
|
id: actionPayload.address.custom.type.id
|
|
4668
4662
|
},
|
|
4669
4663
|
fields: customFields
|
|
4670
4664
|
} : null;
|
|
4671
4665
|
return {
|
|
4672
|
-
[actionName]: _objectSpread$
|
|
4673
|
-
address: _objectSpread$
|
|
4666
|
+
[actionName]: _objectSpread$10(_objectSpread$10({}, actionPayload), {}, {
|
|
4667
|
+
address: _objectSpread$10(_objectSpread$10({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4674
4668
|
custom
|
|
4675
4669
|
})
|
|
4676
4670
|
})
|
|
@@ -4716,8 +4710,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
|
|
|
4716
4710
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4717
4711
|
}, []);
|
|
4718
4712
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4719
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4720
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4713
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4714
|
+
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) {
|
|
4721
4715
|
return graphQlResponse.networkError.result.errors;
|
|
4722
4716
|
}
|
|
4723
4717
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4746,26 +4740,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4746
4740
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4747
4741
|
}
|
|
4748
4742
|
|
|
4749
|
-
function ownKeys
|
|
4750
|
-
function _objectSpread
|
|
4743
|
+
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; }
|
|
4744
|
+
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; }
|
|
4751
4745
|
function getPriceChannelName(price) {
|
|
4752
4746
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4753
4747
|
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;
|
|
4754
4748
|
}
|
|
4755
4749
|
function getDiscountValue(price) {
|
|
4756
|
-
var _price$value, _price$value2, _price$discounted
|
|
4750
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4757
4751
|
let preciseAmount;
|
|
4758
4752
|
let fractionedAmount;
|
|
4759
4753
|
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) {
|
|
4760
4754
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
4761
|
-
} 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
|
|
4755
|
+
} 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) {
|
|
4762
4756
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4763
4757
|
}
|
|
4764
|
-
return price.discounted ? _objectSpread
|
|
4758
|
+
return price.discounted ? _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4765
4759
|
fractionedAmount,
|
|
4766
4760
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4767
4761
|
preciseAmount
|
|
4768
|
-
}) : _objectSpread
|
|
4762
|
+
}) : _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4769
4763
|
centAmount: 0
|
|
4770
4764
|
});
|
|
4771
4765
|
}
|
|
@@ -4773,17 +4767,17 @@ function getSelectedPrice(price) {
|
|
|
4773
4767
|
return price.discounted ? price.discounted : price;
|
|
4774
4768
|
}
|
|
4775
4769
|
function getNetUnitPrice(_ref2) {
|
|
4776
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4770
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4777
4771
|
let lineItem = _ref2.lineItem,
|
|
4778
4772
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4779
4773
|
const price = getSelectedPrice(lineItem.price);
|
|
4780
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4781
|
-
var _lineItem$shippingDet
|
|
4782
|
-
return (lineItem === null || lineItem === void 0
|
|
4774
|
+
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 => {
|
|
4775
|
+
var _lineItem$shippingDet;
|
|
4776
|
+
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;
|
|
4783
4777
|
});
|
|
4784
4778
|
|
|
4785
4779
|
// when shipping mode is multi with the same tax rate
|
|
4786
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4780
|
+
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) {
|
|
4787
4781
|
var _price$value3, _price$value4;
|
|
4788
4782
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4789
4783
|
let centAmount;
|
|
@@ -4794,7 +4788,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4794
4788
|
}
|
|
4795
4789
|
let preciseAmount;
|
|
4796
4790
|
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);
|
|
4797
|
-
return _objectSpread
|
|
4791
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4798
4792
|
centAmount,
|
|
4799
4793
|
preciseAmount
|
|
4800
4794
|
});
|
|
@@ -4811,7 +4805,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4811
4805
|
}
|
|
4812
4806
|
let preciseAmount;
|
|
4813
4807
|
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);
|
|
4814
|
-
return _objectSpread
|
|
4808
|
+
return _objectSpread$$(_objectSpread$$({}, price.value), {}, {
|
|
4815
4809
|
centAmount,
|
|
4816
4810
|
preciseAmount
|
|
4817
4811
|
});
|
|
@@ -4823,7 +4817,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4823
4817
|
const currencyCode = price.value.currencyCode;
|
|
4824
4818
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4825
4819
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4826
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4820
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$$(_objectSpread$$({}, minPrices), {}, {
|
|
4827
4821
|
[currencyCode]: price.value
|
|
4828
4822
|
});
|
|
4829
4823
|
}
|
|
@@ -4832,8 +4826,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4832
4826
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4833
4827
|
}
|
|
4834
4828
|
|
|
4835
|
-
function ownKeys$
|
|
4836
|
-
function _objectSpread$
|
|
4829
|
+
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; }
|
|
4830
|
+
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; }
|
|
4837
4831
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4838
4832
|
var _context, _context4;
|
|
4839
4833
|
return {
|
|
@@ -4844,18 +4838,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4844
4838
|
key: resource.custom.type.key,
|
|
4845
4839
|
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4846
4840
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4847
|
-
var _fieldDefinition$type,
|
|
4841
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4848
4842
|
return {
|
|
4849
4843
|
name: fieldDefinition.name,
|
|
4850
4844
|
required: fieldDefinition.required,
|
|
4851
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4852
|
-
elementType: _objectSpread$
|
|
4845
|
+
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), {}, {
|
|
4846
|
+
elementType: _objectSpread$_(_objectSpread$_({}, fieldDefinition.type.elementType), {}, {
|
|
4853
4847
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4854
4848
|
key: value.key,
|
|
4855
4849
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4856
4850
|
}))
|
|
4857
4851
|
})
|
|
4858
|
-
}) : ((_fieldDefinition$
|
|
4852
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$_(_objectSpread$_({}, fieldDefinition.type), {}, {
|
|
4859
4853
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4860
4854
|
key: value.key,
|
|
4861
4855
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4866,7 +4860,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4866
4860
|
})
|
|
4867
4861
|
}
|
|
4868
4862
|
},
|
|
4869
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4863
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$_(_objectSpread$_({}, fields), {}, {
|
|
4870
4864
|
[customField.name]: customField.value
|
|
4871
4865
|
}), {})
|
|
4872
4866
|
};
|
|
@@ -4878,7 +4872,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4878
4872
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4879
4873
|
// in either case we return null
|
|
4880
4874
|
if (!productSelection) return null;
|
|
4881
|
-
return _objectSpread$
|
|
4875
|
+
return _objectSpread$_(_objectSpread$_({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4882
4876
|
from: 'nameAllLocales',
|
|
4883
4877
|
to: 'name'
|
|
4884
4878
|
}])), {}, {
|
|
@@ -4901,8 +4895,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4901
4895
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4902
4896
|
};
|
|
4903
4897
|
|
|
4904
|
-
function ownKeys$
|
|
4905
|
-
function _objectSpread$
|
|
4898
|
+
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; }
|
|
4899
|
+
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; }
|
|
4906
4900
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4907
4901
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4908
4902
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4919,7 +4913,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4919
4913
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4920
4914
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4921
4915
|
const definitionName = definition.type.elementType.name;
|
|
4922
|
-
return _objectSpread$
|
|
4916
|
+
return _objectSpread$Z(_objectSpread$Z({}, updateAction), {}, {
|
|
4923
4917
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4924
4918
|
});
|
|
4925
4919
|
}
|
|
@@ -4993,8 +4987,8 @@ function omitSetsOfSets() {
|
|
|
4993
4987
|
|
|
4994
4988
|
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 } } } };
|
|
4995
4989
|
|
|
4996
|
-
function ownKeys$
|
|
4997
|
-
function _objectSpread$
|
|
4990
|
+
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; }
|
|
4991
|
+
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; }
|
|
4998
4992
|
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); }; }
|
|
4999
4993
|
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; } }
|
|
5000
4994
|
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 } } } };
|
|
@@ -5054,7 +5048,7 @@ const mapDataToProps = _ref => {
|
|
|
5054
5048
|
return {
|
|
5055
5049
|
fetchTypeDefinitionsQuery: {
|
|
5056
5050
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5057
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5051
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$Y({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5058
5052
|
isImmutable: true
|
|
5059
5053
|
}), [{
|
|
5060
5054
|
from: 'labelAllLocales',
|
|
@@ -5082,12 +5076,12 @@ const handlers$2 = {
|
|
|
5082
5076
|
}
|
|
5083
5077
|
};
|
|
5084
5078
|
|
|
5085
|
-
function ownKeys$
|
|
5086
|
-
function _objectSpread$
|
|
5079
|
+
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; }
|
|
5080
|
+
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; }
|
|
5087
5081
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5088
5082
|
return {
|
|
5089
5083
|
fields: customFieldsFromRestResponse.fields,
|
|
5090
|
-
type: _objectSpread$
|
|
5084
|
+
type: _objectSpread$X({
|
|
5091
5085
|
id: customFieldsFromRestResponse.type.id
|
|
5092
5086
|
}, customFieldsFromRestResponse.type.obj)
|
|
5093
5087
|
};
|
|
@@ -5101,19 +5095,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5101
5095
|
key: typeDefinition.key,
|
|
5102
5096
|
name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5103
5097
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5104
|
-
var _fieldDefinition$type,
|
|
5098
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5105
5099
|
return {
|
|
5106
5100
|
name: fieldDefinition.name,
|
|
5107
5101
|
required: fieldDefinition.required,
|
|
5108
5102
|
inputHint: fieldDefinition.inputHint,
|
|
5109
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5110
|
-
elementType: _objectSpread$
|
|
5103
|
+
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), {}, {
|
|
5104
|
+
elementType: _objectSpread$X(_objectSpread$X({}, fieldDefinition.type.elementType), {}, {
|
|
5111
5105
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5112
5106
|
key: value.key,
|
|
5113
5107
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5114
5108
|
}))
|
|
5115
5109
|
})
|
|
5116
|
-
}) : ((_fieldDefinition$
|
|
5110
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
5117
5111
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5118
5112
|
key: value.key,
|
|
5119
5113
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5129,7 +5123,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5129
5123
|
type: {
|
|
5130
5124
|
id: formCustomFields.type.id,
|
|
5131
5125
|
typeId: 'type',
|
|
5132
|
-
obj: _objectSpread$
|
|
5126
|
+
obj: _objectSpread$X({}, formCustomFields.type)
|
|
5133
5127
|
},
|
|
5134
5128
|
fields: formCustomFields.fields
|
|
5135
5129
|
});
|
|
@@ -5137,7 +5131,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5137
5131
|
type: {
|
|
5138
5132
|
id: formCustomFields.type.id,
|
|
5139
5133
|
typeId: 'type',
|
|
5140
|
-
obj: _objectSpread$
|
|
5134
|
+
obj: _objectSpread$X({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5141
5135
|
},
|
|
5142
5136
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5143
5137
|
});
|
|
@@ -5153,7 +5147,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5153
5147
|
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); }; }
|
|
5154
5148
|
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; } }
|
|
5155
5149
|
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 } } } };
|
|
5156
|
-
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'];
|
|
5150
|
+
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'];
|
|
5157
5151
|
const emptyTypeDefinitions = {
|
|
5158
5152
|
total: 0,
|
|
5159
5153
|
count: 0,
|
|
@@ -5211,13 +5205,13 @@ const createGraphQlOptions = ownProps => {
|
|
|
5211
5205
|
}
|
|
5212
5206
|
};
|
|
5213
5207
|
};
|
|
5214
|
-
var
|
|
5208
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics__default["default"](hoc.graphql(FetchTypeDefinitionsWithNamesQuery, {
|
|
5215
5209
|
name: 'fetchTypeDefinitionsQuery',
|
|
5216
5210
|
skip: ownProps => ownProps.isDisabled,
|
|
5217
5211
|
options: createGraphQlOptions
|
|
5218
5212
|
})(CustomFieldTypeDefinitionsConnector), CustomFieldTypeDefinitionsConnector);
|
|
5219
5213
|
|
|
5220
|
-
const getType
|
|
5214
|
+
const getType = fieldDefinition => {
|
|
5221
5215
|
const fieldDefinitionType = fieldDefinition.type.name.toLowerCase() === 'set' ? fieldDefinition.type.elementType : fieldDefinition.type;
|
|
5222
5216
|
return fieldDefinitionType;
|
|
5223
5217
|
};
|
|
@@ -5268,8 +5262,8 @@ const REFERENCED_TYPES = {
|
|
|
5268
5262
|
zone: 'zone'
|
|
5269
5263
|
};
|
|
5270
5264
|
|
|
5271
|
-
function ownKeys$
|
|
5272
|
-
function _objectSpread$
|
|
5265
|
+
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; }
|
|
5266
|
+
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; }
|
|
5273
5267
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5274
5268
|
let validatedValues = [];
|
|
5275
5269
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5282,7 +5276,7 @@ const extractDuplicatedValues = (values, type, language, languages) => {
|
|
|
5282
5276
|
const setDuplicatedIfSet = (formValues, fieldDefinition, language, languages) => {
|
|
5283
5277
|
const fieldValue = formValues.custom.fields[fieldDefinition.name];
|
|
5284
5278
|
if (fieldDefinition.type.name.toLowerCase() === 'set' && _Array$isArray__default["default"](fieldValue)) {
|
|
5285
|
-
const duplicatedValues = extractDuplicatedValues(fieldValue, getType
|
|
5279
|
+
const duplicatedValues = extractDuplicatedValues(fieldValue, getType(fieldDefinition), language, languages);
|
|
5286
5280
|
return {
|
|
5287
5281
|
duplicated: {
|
|
5288
5282
|
// although this is mixing concerns, we pass down `duplicatedValues` to the form.
|
|
@@ -5336,8 +5330,8 @@ function validations (formValues, language, languages) {
|
|
|
5336
5330
|
var _context2;
|
|
5337
5331
|
// Collect all required and set type fields
|
|
5338
5332
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5339
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5340
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5333
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$W(_objectSpread$W({}, acc), {}, {
|
|
5334
|
+
[fieldDefinition.name]: _objectSpread$W(_objectSpread$W({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5341
5335
|
}), {});
|
|
5342
5336
|
return withoutEmptyErrorsByField(errors);
|
|
5343
5337
|
}
|
|
@@ -5364,8 +5358,8 @@ function CustomTextInput(props) {
|
|
|
5364
5358
|
}
|
|
5365
5359
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5366
5360
|
|
|
5367
|
-
function ownKeys$
|
|
5368
|
-
function _objectSpread$
|
|
5361
|
+
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; }
|
|
5362
|
+
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; }
|
|
5369
5363
|
const getSubfieldLanguage = subfieldName => {
|
|
5370
5364
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5371
5365
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5389,7 +5383,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5389
5383
|
// as a whole.
|
|
5390
5384
|
|
|
5391
5385
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5392
|
-
const newValue = _objectSpread$
|
|
5386
|
+
const newValue = _objectSpread$V(_objectSpread$V({}, props.value), {}, {
|
|
5393
5387
|
[fieldLanguage]: rawValue
|
|
5394
5388
|
});
|
|
5395
5389
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5456,21 +5450,21 @@ function CustomNumberInput(props) {
|
|
|
5456
5450
|
}
|
|
5457
5451
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5458
5452
|
|
|
5459
|
-
function ownKeys$
|
|
5460
|
-
function _objectSpread$
|
|
5453
|
+
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; }
|
|
5454
|
+
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; }
|
|
5461
5455
|
var styles$f = {
|
|
5462
5456
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5463
5457
|
};
|
|
5464
5458
|
const fixCurrencyCode = (value, currencies) => {
|
|
5465
5459
|
if (value.currencyCode) return value;
|
|
5466
5460
|
const firstCurrency = currencies[0];
|
|
5467
|
-
return _objectSpread$
|
|
5461
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5468
5462
|
currencyCode: firstCurrency
|
|
5469
5463
|
});
|
|
5470
5464
|
};
|
|
5471
5465
|
const fixAmount = value => {
|
|
5472
5466
|
if (!value.amount) {
|
|
5473
|
-
return _objectSpread$
|
|
5467
|
+
return _objectSpread$U(_objectSpread$U({}, value), {}, {
|
|
5474
5468
|
amount: '0'
|
|
5475
5469
|
});
|
|
5476
5470
|
}
|
|
@@ -5512,7 +5506,7 @@ function CustomMoneyInput(props) {
|
|
|
5512
5506
|
}
|
|
5513
5507
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5514
5508
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5515
|
-
const newValue = _objectSpread$
|
|
5509
|
+
const newValue = _objectSpread$U({}, internalValue.current);
|
|
5516
5510
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5517
5511
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5518
5512
|
internalValue.current = fixedValue;
|
|
@@ -5793,7 +5787,7 @@ function ReferenceSearch(props) {
|
|
|
5793
5787
|
});
|
|
5794
5788
|
}
|
|
5795
5789
|
|
|
5796
|
-
const messages$
|
|
5790
|
+
const messages$B = reactIntl.defineMessages({
|
|
5797
5791
|
placeholder: {
|
|
5798
5792
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5799
5793
|
description: 'Placeholder for search for a category',
|
|
@@ -5826,8 +5820,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5826
5820
|
}
|
|
5827
5821
|
});
|
|
5828
5822
|
|
|
5829
|
-
function ownKeys$
|
|
5830
|
-
function _objectSpread$
|
|
5823
|
+
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; }
|
|
5824
|
+
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; }
|
|
5831
5825
|
function Option$1(props) {
|
|
5832
5826
|
var _context, _context2;
|
|
5833
5827
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5839,7 +5833,7 @@ function Option$1(props) {
|
|
|
5839
5833
|
const _useIntl = reactIntl.useIntl(),
|
|
5840
5834
|
formatMessage = _useIntl.formatMessage;
|
|
5841
5835
|
const category = props.data;
|
|
5842
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5836
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$T(_objectSpread$T({}, props), {}, {
|
|
5843
5837
|
children: jsxRuntime.jsxs("div", {
|
|
5844
5838
|
"data-testid": "category-option",
|
|
5845
5839
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5850,7 +5844,7 @@ function Option$1(props) {
|
|
|
5850
5844
|
fallbackOrder: languages
|
|
5851
5845
|
})
|
|
5852
5846
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5853
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5847
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5854
5848
|
key: 'name',
|
|
5855
5849
|
locale: language,
|
|
5856
5850
|
fallbackOrder: languages
|
|
@@ -5862,14 +5856,14 @@ function Option$1(props) {
|
|
|
5862
5856
|
fallbackOrder: languages
|
|
5863
5857
|
}))
|
|
5864
5858
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5865
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5859
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5866
5860
|
})]
|
|
5867
5861
|
})
|
|
5868
5862
|
}));
|
|
5869
5863
|
}
|
|
5870
5864
|
|
|
5871
|
-
function ownKeys$
|
|
5872
|
-
function _objectSpread$
|
|
5865
|
+
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; }
|
|
5866
|
+
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; }
|
|
5873
5867
|
const filterOption$1 = () => true;
|
|
5874
5868
|
function CategoryReferenceSearch(props) {
|
|
5875
5869
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5881,7 +5875,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5881
5875
|
})),
|
|
5882
5876
|
language = _useApplicationContex.language,
|
|
5883
5877
|
languages = _useApplicationContex.languages;
|
|
5884
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5878
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$S(_objectSpread$S({}, category), {}, {
|
|
5885
5879
|
value: category.id,
|
|
5886
5880
|
label: l10n.formatLocalizedString(category, {
|
|
5887
5881
|
key: 'name',
|
|
@@ -5899,7 +5893,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5899
5893
|
}), [apolloClient]);
|
|
5900
5894
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5901
5895
|
id: props.id,
|
|
5902
|
-
components: _objectSpread$
|
|
5896
|
+
components: _objectSpread$S({
|
|
5903
5897
|
Option: Option$1
|
|
5904
5898
|
}, props.components),
|
|
5905
5899
|
isClearable: props.isClearable,
|
|
@@ -5910,10 +5904,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5910
5904
|
onBlur: props.onBlur,
|
|
5911
5905
|
onChange: props.onChange,
|
|
5912
5906
|
value: props.value,
|
|
5913
|
-
placeholderLabel: formatMessage(messages$
|
|
5914
|
-
searchPromptLabel: formatMessage(messages$
|
|
5915
|
-
noResultsLabel: formatMessage(messages$
|
|
5916
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5907
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5908
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5909
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5910
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5917
5911
|
mapItemToOption: mapItemToOption,
|
|
5918
5912
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5919
5913
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5989,7 +5983,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5989
5983
|
});
|
|
5990
5984
|
}
|
|
5991
5985
|
|
|
5992
|
-
const messages$
|
|
5986
|
+
const messages$A = reactIntl.defineMessages({
|
|
5993
5987
|
placeholder: {
|
|
5994
5988
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5995
5989
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6017,8 +6011,8 @@ const messages$z = reactIntl.defineMessages({
|
|
|
6017
6011
|
}
|
|
6018
6012
|
});
|
|
6019
6013
|
|
|
6020
|
-
function ownKeys$
|
|
6021
|
-
function _objectSpread$
|
|
6014
|
+
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; }
|
|
6015
|
+
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; }
|
|
6022
6016
|
function Option(props) {
|
|
6023
6017
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6024
6018
|
language: applicationContext.dataLocale,
|
|
@@ -6029,7 +6023,7 @@ function Option(props) {
|
|
|
6029
6023
|
const _useIntl = reactIntl.useIntl(),
|
|
6030
6024
|
formatMessage = _useIntl.formatMessage;
|
|
6031
6025
|
const cartDiscount = props.data;
|
|
6032
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6026
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$R(_objectSpread$R({}, props), {}, {
|
|
6033
6027
|
children: jsxRuntime.jsxs("div", {
|
|
6034
6028
|
"data-testid": "cart-discount-option",
|
|
6035
6029
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6040,14 +6034,14 @@ function Option(props) {
|
|
|
6040
6034
|
fallbackOrder: languages
|
|
6041
6035
|
})
|
|
6042
6036
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6043
|
-
children: [formatMessage(messages$
|
|
6037
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6044
6038
|
})]
|
|
6045
6039
|
})
|
|
6046
6040
|
}));
|
|
6047
6041
|
}
|
|
6048
6042
|
|
|
6049
|
-
function ownKeys$
|
|
6050
|
-
function _objectSpread$
|
|
6043
|
+
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; }
|
|
6044
|
+
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; }
|
|
6051
6045
|
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 } } } };
|
|
6052
6046
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6053
6047
|
const filterOption = (option, text) => {
|
|
@@ -6073,7 +6067,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6073
6067
|
})),
|
|
6074
6068
|
language = _useApplicationContex.language,
|
|
6075
6069
|
languages = _useApplicationContex.languages;
|
|
6076
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6070
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$Q(_objectSpread$Q({}, cartDiscount), {}, {
|
|
6077
6071
|
value: cartDiscount.id,
|
|
6078
6072
|
key: cartDiscount.key,
|
|
6079
6073
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6116,10 +6110,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6116
6110
|
onBlur: props.onBlur,
|
|
6117
6111
|
onChange: props.onChange,
|
|
6118
6112
|
value: returnNullIfEmpty(props.value),
|
|
6119
|
-
placeholderLabel: formatMessage(messages$
|
|
6120
|
-
searchPromptLabel: formatMessage(messages$
|
|
6121
|
-
noResultsLabel: formatMessage(messages$
|
|
6122
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6113
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6114
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6115
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6116
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6123
6117
|
mapItemToOption: mapItemToOption,
|
|
6124
6118
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6125
6119
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6180,7 +6174,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6180
6174
|
});
|
|
6181
6175
|
}
|
|
6182
6176
|
|
|
6183
|
-
var messages$
|
|
6177
|
+
var messages$z = reactIntl.defineMessages({
|
|
6184
6178
|
noProductsFound: {
|
|
6185
6179
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6186
6180
|
description: 'The message to display when no products were found',
|
|
@@ -6269,7 +6263,7 @@ const ProductPickerInput = _ref => {
|
|
|
6269
6263
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6270
6264
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6271
6265
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6272
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6266
|
+
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 : '';
|
|
6273
6267
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6274
6268
|
max: "scale",
|
|
6275
6269
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -6279,7 +6273,7 @@ const ProductPickerInput = _ref => {
|
|
|
6279
6273
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6280
6274
|
id: name,
|
|
6281
6275
|
name: name,
|
|
6282
|
-
placeholder: formatMessage(messages$
|
|
6276
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6283
6277
|
loadOptions: loadOptionsDebounced,
|
|
6284
6278
|
defaultOptions: [],
|
|
6285
6279
|
isClearable: isClearable,
|
|
@@ -6293,7 +6287,7 @@ const ProductPickerInput = _ref => {
|
|
|
6293
6287
|
onInputChange: handleInputChange,
|
|
6294
6288
|
onBlur: onBlur,
|
|
6295
6289
|
value: currentOption.data,
|
|
6296
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6290
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6297
6291
|
hasError: hasError || isLoadingFailed
|
|
6298
6292
|
})
|
|
6299
6293
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6543,8 +6537,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6543
6537
|
}
|
|
6544
6538
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6545
6539
|
|
|
6546
|
-
function ownKeys$
|
|
6547
|
-
function _objectSpread$
|
|
6540
|
+
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; }
|
|
6541
|
+
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; }
|
|
6548
6542
|
const getTypeName = type => type.name.toLowerCase();
|
|
6549
6543
|
const findLabel = (enumType, key) => {
|
|
6550
6544
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6588,12 +6582,13 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6588
6582
|
inputHint: attributeDefinition.inputHint,
|
|
6589
6583
|
inputTip: attributeDefinition.inputTip,
|
|
6590
6584
|
required: attributeDefinition.isRequired,
|
|
6591
|
-
type: attributeDefinition.type
|
|
6585
|
+
type: attributeDefinition.type,
|
|
6586
|
+
assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
|
|
6592
6587
|
});
|
|
6593
6588
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6594
6589
|
let name = _ref2.name,
|
|
6595
6590
|
value = _ref2.value;
|
|
6596
|
-
return _objectSpread$
|
|
6591
|
+
return _objectSpread$P(_objectSpread$P({}, result), {}, {
|
|
6597
6592
|
[name]: value
|
|
6598
6593
|
});
|
|
6599
6594
|
}, {});
|
|
@@ -6677,7 +6672,7 @@ function ProductAttributeInput(props) {
|
|
|
6677
6672
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6678
6673
|
|
|
6679
6674
|
// eslint-disable-next-line import/prefer-default-export
|
|
6680
|
-
const messages$
|
|
6675
|
+
const messages$y = reactIntl.defineMessages({
|
|
6681
6676
|
aboveFifthLevelWarning: {
|
|
6682
6677
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6683
6678
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6690,23 +6685,23 @@ const messages$x = reactIntl.defineMessages({
|
|
|
6690
6685
|
}
|
|
6691
6686
|
});
|
|
6692
6687
|
|
|
6693
|
-
function ownKeys$
|
|
6694
|
-
function _objectSpread$
|
|
6688
|
+
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; }
|
|
6689
|
+
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; }
|
|
6695
6690
|
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 } } } };
|
|
6696
6691
|
const mapAttributeDefinition = definition => {
|
|
6697
|
-
var _context, _definition$type,
|
|
6698
|
-
return _objectSpread$
|
|
6692
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6693
|
+
return _objectSpread$O(_objectSpread$O({}, definition), {}, {
|
|
6699
6694
|
required: definition.isRequired,
|
|
6700
6695
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6701
6696
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6702
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6703
|
-
elementType: _objectSpread$
|
|
6697
|
+
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), {}, {
|
|
6698
|
+
elementType: _objectSpread$O(_objectSpread$O({}, definition.type.elementType), {}, {
|
|
6704
6699
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6705
6700
|
key: value.key,
|
|
6706
6701
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6707
6702
|
}))
|
|
6708
6703
|
})
|
|
6709
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6704
|
+
}) : _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), {}, {
|
|
6710
6705
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6711
6706
|
key: value.key,
|
|
6712
6707
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6747,7 +6742,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6747
6742
|
};
|
|
6748
6743
|
}
|
|
6749
6744
|
|
|
6750
|
-
var messages$
|
|
6745
|
+
var messages$x = reactIntl.defineMessages({
|
|
6751
6746
|
updateButton: {
|
|
6752
6747
|
id: 'NestedAttributes.Details.updateButton',
|
|
6753
6748
|
description: 'Update button label',
|
|
@@ -6827,14 +6822,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
6827
6822
|
|
|
6828
6823
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6829
6824
|
|
|
6830
|
-
function ownKeys$
|
|
6831
|
-
function _objectSpread$
|
|
6825
|
+
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; }
|
|
6826
|
+
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; }
|
|
6832
6827
|
const EditButton = props => {
|
|
6833
6828
|
const _useIntl = reactIntl.useIntl(),
|
|
6834
6829
|
formatMessage = _useIntl.formatMessage;
|
|
6835
6830
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
6836
6831
|
placement: "top",
|
|
6837
|
-
title: formatMessage(messages$
|
|
6832
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6838
6833
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
6839
6834
|
label: "Edit",
|
|
6840
6835
|
isDisabled: props.isDisabled,
|
|
@@ -6850,12 +6845,12 @@ const DropChangesConfirmation = props => {
|
|
|
6850
6845
|
formatMessage = _useIntl2.formatMessage;
|
|
6851
6846
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
6852
6847
|
isOpen: props.isOpen || false,
|
|
6853
|
-
title: formatMessage(messages$
|
|
6854
|
-
labelPrimary: formatMessage(messages$
|
|
6848
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6849
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6855
6850
|
onConfirm: props.onConfirm,
|
|
6856
6851
|
onCancel: props.onCancel,
|
|
6857
6852
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6858
|
-
intlMessage: messages$
|
|
6853
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6859
6854
|
})
|
|
6860
6855
|
});
|
|
6861
6856
|
};
|
|
@@ -6880,11 +6875,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6880
6875
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
6881
6876
|
isDisabled: !formik$1.dirty,
|
|
6882
6877
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
6883
|
-
label: formatMessage(messages$
|
|
6878
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6884
6879
|
onClick: formik$1.resetForm
|
|
6885
6880
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
6886
6881
|
isDisabled: !formik$1.dirty,
|
|
6887
|
-
label: formatMessage(messages$
|
|
6882
|
+
label: formatMessage(messages$x.updateButton),
|
|
6888
6883
|
onClick: formik$1.handleSubmit
|
|
6889
6884
|
})]
|
|
6890
6885
|
}),
|
|
@@ -6913,7 +6908,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6913
6908
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
6914
6909
|
title: "",
|
|
6915
6910
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6916
|
-
intlMessage: messages$
|
|
6911
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6917
6912
|
}),
|
|
6918
6913
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
6919
6914
|
});
|
|
@@ -6925,7 +6920,7 @@ const NestedInputControls = props => {
|
|
|
6925
6920
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
6926
6921
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6927
6922
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6928
|
-
intlMessage: messages$
|
|
6923
|
+
intlMessage: messages$x.emptyProductType,
|
|
6929
6924
|
tone: "secondary"
|
|
6930
6925
|
});
|
|
6931
6926
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -6939,7 +6934,7 @@ const NestedInputControls = props => {
|
|
|
6939
6934
|
children: props.productType.name
|
|
6940
6935
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
6941
6936
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
6942
|
-
children: formatMessage(messages$
|
|
6937
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6943
6938
|
})
|
|
6944
6939
|
})]
|
|
6945
6940
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -6975,13 +6970,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6975
6970
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6976
6971
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6977
6972
|
const openNestedAttributesForm = () => {
|
|
6978
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6973
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6979
6974
|
hideSaveToolbar: true
|
|
6980
6975
|
}));
|
|
6981
6976
|
attributesForm.openModal();
|
|
6982
6977
|
};
|
|
6983
6978
|
const closeNestedAttributesForm = () => {
|
|
6984
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6979
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$N(_objectSpread$N({}, parentFormik.status), {}, {
|
|
6985
6980
|
hideSaveToolbar: false
|
|
6986
6981
|
}));
|
|
6987
6982
|
attributesForm.closeModal();
|
|
@@ -7001,7 +6996,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7001
6996
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7002
6997
|
kind: 'success',
|
|
7003
6998
|
domain: constants.DOMAINS.SIDE,
|
|
7004
|
-
text: formatMessage(messages$
|
|
6999
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
7005
7000
|
});
|
|
7006
7001
|
setSubmitting(false);
|
|
7007
7002
|
},
|
|
@@ -7085,8 +7080,8 @@ const SetButtons = props => {
|
|
|
7085
7080
|
};
|
|
7086
7081
|
SetButtons.displayName = 'SetButtons';
|
|
7087
7082
|
|
|
7088
|
-
function ownKeys$
|
|
7089
|
-
function _objectSpread$
|
|
7083
|
+
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; }
|
|
7084
|
+
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; }
|
|
7090
7085
|
const getDuplicateErrors = setValues => {
|
|
7091
7086
|
/* eslint-disable no-plusplus */
|
|
7092
7087
|
const result = [];
|
|
@@ -7143,7 +7138,7 @@ function CustomInputSet(props) {
|
|
|
7143
7138
|
touched = _useFormikContext.touched,
|
|
7144
7139
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7145
7140
|
dirty = _useFormikContext.dirty;
|
|
7146
|
-
const itemFieldDefinition = _objectSpread$
|
|
7141
|
+
const itemFieldDefinition = _objectSpread$M(_objectSpread$M({}, props.fieldDefinition), {}, {
|
|
7147
7142
|
type: props.fieldDefinition.type.elementType
|
|
7148
7143
|
});
|
|
7149
7144
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7201,7 +7196,7 @@ function CustomInputSet(props) {
|
|
|
7201
7196
|
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
7202
7197
|
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
7203
7198
|
// type is selected.
|
|
7204
|
-
const type = getType
|
|
7199
|
+
const type = getType(props.fieldDefinition);
|
|
7205
7200
|
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
7206
7201
|
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);
|
|
7207
7202
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -7281,7 +7276,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7281
7276
|
// Boolean is the only set element with peculiarities (i.e. way more
|
|
7282
7277
|
// convenient for user to work with it as with select input with three values:
|
|
7283
7278
|
// [true], [false] and [true, false]).
|
|
7284
|
-
if (((_getSetElementType = getType
|
|
7279
|
+
if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
|
|
7285
7280
|
return CustomBooleanInputSet;
|
|
7286
7281
|
}
|
|
7287
7282
|
// All the rest sets are just a fancy wrapper around single-item components
|
|
@@ -7303,7 +7298,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7303
7298
|
});
|
|
7304
7299
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7305
7300
|
|
|
7306
|
-
var messages$
|
|
7301
|
+
var messages$w = reactIntl.defineMessages({
|
|
7307
7302
|
referencedProductType: {
|
|
7308
7303
|
id: 'NestedAttributes.referencedProductType',
|
|
7309
7304
|
description: 'Product type referenced hint',
|
|
@@ -7311,10 +7306,10 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7311
7306
|
}
|
|
7312
7307
|
});
|
|
7313
7308
|
|
|
7314
|
-
function ownKeys$
|
|
7315
|
-
function _objectSpread$
|
|
7309
|
+
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; }
|
|
7310
|
+
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; }
|
|
7316
7311
|
function ProductTypeReference(props) {
|
|
7317
|
-
const productTypeMessage = _objectSpread$
|
|
7312
|
+
const productTypeMessage = _objectSpread$L(_objectSpread$L({}, messages$w.referencedProductType), {}, {
|
|
7318
7313
|
values: {
|
|
7319
7314
|
productTypeName: props.productType.name
|
|
7320
7315
|
}
|
|
@@ -7360,9 +7355,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7360
7355
|
}
|
|
7361
7356
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7362
7357
|
|
|
7363
|
-
function ownKeys$
|
|
7364
|
-
function _objectSpread$
|
|
7365
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7358
|
+
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; }
|
|
7359
|
+
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; }
|
|
7360
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$K(_objectSpread$K({}, result), itemErrors), {});
|
|
7366
7361
|
|
|
7367
7362
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7368
7363
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7373,15 +7368,15 @@ const CustomFieldErrors = props => {
|
|
|
7373
7368
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7374
7369
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7375
7370
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7376
|
-
intlMessage: messages$
|
|
7371
|
+
intlMessage: messages$K.required
|
|
7377
7372
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7378
|
-
intlMessage: messages$
|
|
7373
|
+
intlMessage: messages$K.unique
|
|
7379
7374
|
})]
|
|
7380
7375
|
});
|
|
7381
7376
|
};
|
|
7382
7377
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7383
7378
|
|
|
7384
|
-
var messages$
|
|
7379
|
+
var messages$v = reactIntl.defineMessages({
|
|
7385
7380
|
productReferenceLabel: {
|
|
7386
7381
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7387
7382
|
description: 'Label shown above the product picker input.',
|
|
@@ -7411,16 +7406,22 @@ var messages$u = reactIntl.defineMessages({
|
|
|
7411
7406
|
id: 'cartDiscountMoreThan500',
|
|
7412
7407
|
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
7413
7408
|
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
7409
|
+
},
|
|
7410
|
+
attributeGroupCountTooltip: {
|
|
7411
|
+
id: 'CustomFieldsLabel.attributeGroupCountTooltip',
|
|
7412
|
+
description: 'Tooltip message to display when the same attribute is assigned to multiple attribute groups',
|
|
7413
|
+
defaultMessage: 'Synced with {count} Attribute groups: {attributeGroups}'
|
|
7414
7414
|
}
|
|
7415
7415
|
});
|
|
7416
7416
|
|
|
7417
|
-
function ownKeys$
|
|
7418
|
-
function _objectSpread$
|
|
7417
|
+
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; }
|
|
7418
|
+
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; }
|
|
7419
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
7419
7420
|
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 } } } };
|
|
7420
|
-
const CustomFieldsLabelHint =
|
|
7421
|
+
const CustomFieldsLabelHint = _ref2 => {
|
|
7421
7422
|
var _type$name;
|
|
7422
|
-
let fieldDefinition =
|
|
7423
|
-
const type = getType
|
|
7423
|
+
let fieldDefinition = _ref2.fieldDefinition;
|
|
7424
|
+
const type = getType(fieldDefinition);
|
|
7424
7425
|
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
7425
7426
|
const referenceTypeId = type.referenceTypeId;
|
|
7426
7427
|
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
@@ -7445,7 +7446,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7445
7446
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7446
7447
|
size: "medium",
|
|
7447
7448
|
color: "warning"
|
|
7448
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7449
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$J({}, messages$v.cartDiscountMoreThan500))]
|
|
7449
7450
|
});
|
|
7450
7451
|
}
|
|
7451
7452
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7459,28 +7460,61 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7459
7460
|
formatMessage = _useIntl.formatMessage;
|
|
7460
7461
|
const _usePimStatus = usePimStatus(),
|
|
7461
7462
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7462
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7463
|
-
return formatMessage(messages$
|
|
7463
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7464
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7464
7465
|
}
|
|
7465
7466
|
|
|
7466
7467
|
// TODO(pa3): this logic may be misplaced and probably
|
|
7467
7468
|
// should belong to <CustomReferenceInput /> component instead.
|
|
7468
|
-
function CustomFieldsLabelSubtitle(
|
|
7469
|
+
function CustomFieldsLabelSubtitle(_ref3) {
|
|
7469
7470
|
var _type$name2, _context;
|
|
7470
|
-
let fieldDefinition =
|
|
7471
|
+
let fieldDefinition = _ref3.fieldDefinition;
|
|
7471
7472
|
const _useIntl2 = reactIntl.useIntl(),
|
|
7472
7473
|
formatMessage = _useIntl2.formatMessage;
|
|
7473
|
-
const type = getType
|
|
7474
|
+
const type = getType(fieldDefinition);
|
|
7474
7475
|
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
7475
7476
|
if (!isReference) return null;
|
|
7476
7477
|
const referenceTypeId = type.referenceTypeId;
|
|
7477
7478
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7478
7479
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7479
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7480
|
+
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");
|
|
7481
|
+
}
|
|
7482
|
+
const Portal = props => /*#__PURE__*/ReactDOM__default["default"].createPortal(props.children, document.body);
|
|
7483
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
7484
|
+
name: "ar8y70",
|
|
7485
|
+
styles: "cursor:pointer;line-height:normal"
|
|
7486
|
+
} : {
|
|
7487
|
+
name: "471ze2-CustomFieldsCountIndicator",
|
|
7488
|
+
styles: "cursor:pointer;line-height:normal;label:CustomFieldsCountIndicator;",
|
|
7489
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS1maWVsZHMtbGFiZWwuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9KZ0IiLCJmaWxlIjoiY3VzdG9tLWZpZWxkcy1sYWJlbC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBtZW1vIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFJlYWN0RE9NIGZyb20gJ3JlYWN0LWRvbSc7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQge1xuICBDb25zdHJhaW50cyxcbiAgRmllbGRMYWJlbCxcbiAgU3BhY2luZ3MsXG4gIFN3aXRjaGVySWNvbixcbiAgVG9vbHRpcCxcbiAgV2FybmluZ0ljb24sXG59IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5pbXBvcnQgeyBGb3JtYXR0ZWRNZXNzYWdlLCB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCc7XG5pbXBvcnQgeyBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9sMTBuJztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VBcHBsaWNhdGlvbkNvbnRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9hcHBsaWNhdGlvbi1zaGVsbC1jb25uZWN0b3JzJztcbmltcG9ydCB7IHVzZVF1ZXJ5IH0gZnJvbSAnQGFwb2xsby9jbGllbnQvcmVhY3QnO1xuaW1wb3J0IHsgR1JBUEhRTF9UQVJHRVRTIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJztcbmltcG9ydCB7IFFVRVJZX01BWF9MSU1JVCwgU0VBUkNIQUJMRV9SRUZFUkVOQ0VTIH0gZnJvbSAnLi4vLi4vLi4vY29uc3RhbnRzJztcbmltcG9ydCB7XG4gIHVzZVBpbVN0YXR1cyxcbiAgY2FwaXRhbGl6ZUZpcnN0LFxuICB1c2VGb3JtYXRMb2NhbGl6ZWRGaWVsZFRvU3RyaW5nLFxufSBmcm9tICcuLi8uLi8uLi9pbnRlcm5hbC1pbmRleCc7XG5cbmltcG9ydCB7IGdldFR5cGUgfSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgeyBDYXJ0RGlzY291bnRzQ291bnQgfSBmcm9tICcuL2NhcnQtZGlzY291bnRzLWNvdW50LmN0cC5ncmFwaHFsJztcblxuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuXG5jb25zdCBDdXN0b21GaWVsZHNMYWJlbEhpbnQgPSAoeyBmaWVsZERlZmluaXRpb24gfSkgPT4ge1xuICBjb25zdCB0eXBlID0gZ2V0VHlwZShmaWVsZERlZmluaXRpb24pO1xuICBjb25zdCBpc1JlZmVyZW5jZSA9IHR5cGUubmFtZT8udG9Mb3dlckNhc2UoKSA9PT0gJ3JlZmVyZW5jZSc7XG4gIGNvbnN0IHJlZmVyZW5jZVR5cGVJZCA9IHR5cGUucmVmZXJlbmNlVHlwZUlkO1xuICBjb25zdCBpc0NhcnREaXNjb3VudHNSZWZlcmVuY2UgPVxuICAgIGlzUmVmZXJlbmNlICYmIHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLmNhcnREaXNjb3VudDtcblxuICBjb25zdCB7IGxhbmd1YWdlcywgZGF0YUxvY2FsZSB9ID0gdXNlQXBwbGljYXRpb25Db250ZXh0KFxuICAgIChhcHBsaWNhdGlvbkNvbnRleHQpID0+ICh7XG4gICAgICBsYW5ndWFnZXM6IGFwcGxpY2F0aW9uQ29udGV4dC5wcm9qZWN0Lmxhbmd1YWdlcyxcbiAgICAgIGRhdGFMb2NhbGU6IGFwcGxpY2F0aW9uQ29udGV4dC5kYXRhTG9jYWxlLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgeyBkYXRhLCBsb2FkaW5nIH0gPSB1c2VRdWVyeShDYXJ0RGlzY291bnRzQ291bnQsIHtcbiAgICBza2lwOiAhaXNDYXJ0RGlzY291bnRzUmVmZXJlbmNlLFxuICAgIGNvbnRleHQ6IHtcbiAgICAgIHRhcmdldDogR1JBUEhRTF9UQVJHRVRTLkNPTU1FUkNFVE9PTFNfUExBVEZPUk0sXG4gICAgfSxcbiAgfSk7XG5cbiAgaWYgKGxvYWRpbmcpIHJldHVybiBudWxsO1xuXG4gIGlmIChkYXRhPy5jYXJ0RGlzY291bnRzLnRvdGFsID4gUVVFUllfTUFYX0xJTUlUKSB7XG4gICAgcmV0dXJuIChcbiAgICAgIDxTcGFjaW5ncy5JbmxpbmUgYWxpZ25JdGVtcz1cImNlbnRlclwiPlxuICAgICAgICA8V2FybmluZ0ljb24gc2l6ZT1cIm1lZGl1bVwiIGNvbG9yPVwid2FybmluZ1wiIC8+XG4gICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5jYXJ0RGlzY291bnRNb3JlVGhhbjUwMH0gLz5cbiAgICAgIDwvU3BhY2luZ3MuSW5saW5lPlxuICAgICk7XG4gIH1cblxuICByZXR1cm4gZm9ybWF0TG9jYWxpemVkU3RyaW5nKGZpZWxkRGVmaW5pdGlvbiwge1xuICAgIGtleTogJ2lucHV0VGlwJyxcbiAgICBsb2NhbGU6IGRhdGFMb2NhbGUsXG4gICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICB9KTtcbn07XG5DdXN0b21GaWVsZHNMYWJlbEhpbnQucHJvcFR5cGVzID0ge1xuICBmaWVsZERlZmluaXRpb246IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgbmFtZTogUHJvcFR5cGVzLnN0cmluZyxcbiAgICBpbnB1dFRpcDogUHJvcFR5cGVzLm9iamVjdCxcbiAgICByZXF1aXJlZDogUHJvcFR5cGVzLmJvb2wsXG4gIH0pLFxufTtcblxuZnVuY3Rpb24gQ3VzdG9tRmllbGRzUHJvZHVjdFR5cGVSZWZlcmVuY2VTdWJ0aXRsZSgpIHtcbiAgY29uc3QgeyBmb3JtYXRNZXNzYWdlIH0gPSB1c2VJbnRsKCk7XG4gIGNvbnN0IHsgaXNQcm9qZWN0SW5kZXhlZCB9ID0gdXNlUGltU3RhdHVzKCk7XG5cbiAgaWYgKGlzUHJvamVjdEluZGV4ZWQpXG4gICAgcmV0dXJuIGZvcm1hdE1lc3NhZ2UobWVzc2FnZXMucHJvZHVjdFR5cGVSZWZlcmVuY2VMYWJlbEkpO1xuICByZXR1cm4gZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5wcm9kdWN0VHlwZVJlZmVyZW5jZUxhYmVsKTtcbn1cblxuLy8gVE9ETyhwYTMpOiB0aGlzIGxvZ2ljIG1heSBiZSBtaXNwbGFjZWQgYW5kIHByb2JhYmx5XG4vLyBzaG91bGQgYmVsb25nIHRvIDxDdXN0b21SZWZlcmVuY2VJbnB1dCAvPiBjb21wb25lbnQgaW5zdGVhZC5cbmZ1bmN0aW9uIEN1c3RvbUZpZWxkc0xhYmVsU3VidGl0bGUoeyBmaWVsZERlZmluaXRpb24gfSkge1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgdHlwZSA9IGdldFR5cGUoZmllbGREZWZpbml0aW9uKTtcbiAgY29uc3QgaXNSZWZlcmVuY2UgPSB0eXBlLm5hbWU/LnRvTG93ZXJDYXNlKCkgPT09ICdyZWZlcmVuY2UnO1xuXG4gIGlmICghaXNSZWZlcmVuY2UpIHJldHVybiBudWxsO1xuXG4gIGNvbnN0IHJlZmVyZW5jZVR5cGVJZCA9IHR5cGUucmVmZXJlbmNlVHlwZUlkO1xuICBjb25zdCByZWZlcmVuY2VUeXBlTmFtZSA9IGNhcGl0YWxpemVGaXJzdChyZWZlcmVuY2VUeXBlSWQpO1xuXG4gIGlmIChcbiAgICBbXG4gICAgICBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMuY2F0ZWdvcnksXG4gICAgICBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMuY2FydERpc2NvdW50LFxuICAgIF0uaW5jbHVkZXMocmVmZXJlbmNlVHlwZUlkKVxuICApXG4gICAgcmV0dXJuIHJlZmVyZW5jZVR5cGVOYW1lO1xuXG4gIHJldHVybiBkbyB7XG4gICAgaWYgKHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLnByb2R1Y3QpXG4gICAgICBmb3JtYXRNZXNzYWdlKG1lc3NhZ2VzLnByb2R1Y3RSZWZlcmVuY2VMYWJlbCk7XG4gICAgZWxzZSBpZiAocmVmZXJlbmNlVHlwZUlkID09PSBTRUFSQ0hBQkxFX1JFRkVSRU5DRVMucHJvZHVjdFR5cGUpXG4gICAgICA8Q3VzdG9tRmllbGRzUHJvZHVjdFR5cGVSZWZlcmVuY2VTdWJ0aXRsZSAvPjtcbiAgICBlbHNlIGlmIChyZWZlcmVuY2VUeXBlSWQgPT09IFNFQVJDSEFCTEVfUkVGRVJFTkNFUy5jaGFubmVsKVxuICAgICAgZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5jaGFubmVsUmVmZXJlbmNlTGFiZWwpO1xuICAgIGVsc2UgaWYgKHJlZmVyZW5jZVR5cGVJZCA9PT0gU0VBUkNIQUJMRV9SRUZFUkVOQ0VTLnN0YXRlKVxuICAgICAgZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5zdGF0ZVJlZmVyZW5jZUxhYmVsKTtcbiAgICBlbHNlIGAke3JlZmVyZW5jZVR5cGVOYW1lfSBJRGA7XG4gIH07XG59XG5DdXN0b21GaWVsZHNMYWJlbFN1YnRpdGxlLnByb3BUeXBlcyA9IHtcbiAgZmllbGREZWZpbml0aW9uOiBQcm9wVHlwZXMuc2hhcGUoe1xuICAgIHR5cGU6IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICBuYW1lOiBQcm9wVHlwZXMuc3RyaW5nLFxuICAgICAgZWxlbWVudFR5cGU6IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICAgIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gICAgICB9KSxcbiAgICB9KSxcbiAgICBuYW1lOiBQcm9wVHlwZXMuc3RyaW5nLFxuICB9KS5pc1JlcXVpcmVkLFxufTtcblxuY29uc3QgUG9ydGFsID0gKHByb3BzKSA9PiBSZWFjdERPTS5jcmVhdGVQb3J0YWwocHJvcHMuY2hpbGRyZW4sIGRvY3VtZW50LmJvZHkpO1xuXG5mdW5jdGlvbiBDdXN0b21GaWVsZHNDb3VudEluZGljYXRvcih7IGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzIH0pIHtcbiAgY29uc3QgZm9ybWF0TG9jYWxpemVkRmllbGQgPSB1c2VGb3JtYXRMb2NhbGl6ZWRGaWVsZFRvU3RyaW5nKCk7XG4gIGNvbnN0IHsgZm9ybWF0TWVzc2FnZSB9ID0gdXNlSW50bCgpO1xuXG4gIHJldHVybiBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwcz8ubGVuZ3RoID4gMSA/IChcbiAgICA8VG9vbHRpcFxuICAgICAgdGl0bGU9e2Zvcm1hdE1lc3NhZ2UobWVzc2FnZXMuYXR0cmlidXRlR3JvdXBDb3VudFRvb2x0aXAsIHtcbiAgICAgICAgYXR0cmlidXRlR3JvdXBzOiBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwc1xuICAgICAgICAgIC5tYXAoKGFzc2lnbmVkQXR0cmlidXRlR3JvdXApID0+XG4gICAgICAgICAgICBmb3JtYXRMb2NhbGl6ZWRGaWVsZChhc3NpZ25lZEF0dHJpYnV0ZUdyb3VwLm5hbWVBbGxMb2NhbGVzKVxuICAgICAgICAgIClcbiAgICAgICAgICAuam9pbignLCAnKSxcbiAgICAgICAgY291bnQ6IGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzLmxlbmd0aCxcbiAgICAgIH0pfVxuICAgICAgaG9yaXpvbnRhbENvbnN0cmFpbnQ9ezd9XG4gICAgICBjb21wb25lbnRzPXt7IFRvb2x0aXBXcmFwcGVyQ29tcG9uZW50OiBQb3J0YWwgfX1cbiAgICA+XG4gICAgICA8ZGl2XG4gICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICBsaW5lLWhlaWdodDogbm9ybWFsO1xuICAgICAgICBgfVxuICAgICAgPlxuICAgICAgICA8U3dpdGNoZXJJY29uIGNvbG9yPVwiaW5mb1wiIHNpemU9XCJtZWRpdW1cIiAvPlxuICAgICAgPC9kaXY+XG4gICAgPC9Ub29sdGlwPlxuICApIDogbnVsbDtcbn1cblxuQ3VzdG9tRmllbGRzQ291bnRJbmRpY2F0b3IucHJvcFR5cGVzID0ge1xuICBhc3NpZ25lZEF0dHJpYnV0ZUdyb3VwczogUHJvcFR5cGVzLmFycmF5LFxufTtcblxuY29uc3QgQ3VzdG9tRmllbGRzTGFiZWwgPSBtZW1vKCh7IG5hbWUsIGZpZWxkRGVmaW5pdGlvbiB9KSA9PiB7XG4gIGNvbnN0IHsgbGFuZ3VhZ2VzLCBsYW5ndWFnZSB9ID0gdXNlQXBwbGljYXRpb25Db250ZXh0KFxuICAgIChhcHBsaWNhdGlvbkNvbnRleHQpID0+ICh7XG4gICAgICBsYW5ndWFnZXM6IGFwcGxpY2F0aW9uQ29udGV4dC5wcm9qZWN0Lmxhbmd1YWdlcyxcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICB9KVxuICApO1xuXG4gIHJldHVybiAoXG4gICAgPEZpZWxkTGFiZWxcbiAgICAgIGh0bWxGb3I9e25hbWV9XG4gICAgICB0aXRsZT17XG4gICAgICAgIDxDb25zdHJhaW50cy5Ib3Jpem9udGFsIG1heD1cInNjYWxlXCI+XG4gICAgICAgICAgPFNwYWNpbmdzLklubGluZSBzY2FsZT1cInNcIiBhbGlnbkl0ZW1zPVwiZmxleC1lbmRcIj5cbiAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgIHtmb3JtYXRMb2NhbGl6ZWRTdHJpbmcoZmllbGREZWZpbml0aW9uLCB7XG4gICAgICAgICAgICAgICAga2V5OiAnbGFiZWwnLFxuICAgICAgICAgICAgICAgIGxvY2FsZTogbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZhbGxiYWNrOiBmaWVsZERlZmluaXRpb24ubmFtZSxcbiAgICAgICAgICAgICAgfSl9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxDdXN0b21GaWVsZHNDb3VudEluZGljYXRvclxuICAgICAgICAgICAgICBhc3NpZ25lZEF0dHJpYnV0ZUdyb3Vwcz17ZmllbGREZWZpbml0aW9uLmFzc2lnbmVkQXR0cmlidXRlR3JvdXBzfVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICA8L1NwYWNpbmdzLklubGluZT5cbiAgICAgICAgPC9Db25zdHJhaW50cy5Ib3Jpem9udGFsPlxuICAgICAgfVxuICAgICAgZGVzY3JpcHRpb249e1xuICAgICAgICA8Q3VzdG9tRmllbGRzTGFiZWxTdWJ0aXRsZSBmaWVsZERlZmluaXRpb249e2ZpZWxkRGVmaW5pdGlvbn0gLz5cbiAgICAgIH1cbiAgICAgIGhpbnQ9ezxDdXN0b21GaWVsZHNMYWJlbEhpbnQgZmllbGREZWZpbml0aW9uPXtmaWVsZERlZmluaXRpb259IC8+fVxuICAgICAgaGFzUmVxdWlyZWRJbmRpY2F0b3I9e2ZpZWxkRGVmaW5pdGlvbi5yZXF1aXJlZH1cbiAgICAvPlxuICApO1xufSk7XG5DdXN0b21GaWVsZHNMYWJlbC5kaXNwbGF5TmFtZSA9ICdDdXN0b21GaWVsZHNUaXRsZSc7XG5DdXN0b21GaWVsZHNMYWJlbC5wcm9wVHlwZXMgPSB7XG4gIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcuaXNSZXF1aXJlZCxcbiAgZmllbGREZWZpbml0aW9uOiBQcm9wVHlwZXMuc2hhcGUoe1xuICAgIGFzc2lnbmVkQXR0cmlidXRlR3JvdXBzOiBQcm9wVHlwZXMuYXJyYXksXG4gICAgbmFtZTogUHJvcFR5cGVzLnN0cmluZyxcbiAgICBpbnB1dFRpcDogUHJvcFR5cGVzLm9iamVjdCxcbiAgICByZXF1aXJlZDogUHJvcFR5cGVzLmJvb2wsXG4gIH0pLFxufTtcbmV4cG9ydCBkZWZhdWx0IEN1c3RvbUZpZWxkc0xhYmVsO1xuIl19 */",
|
|
7490
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
7491
|
+
};
|
|
7492
|
+
function CustomFieldsCountIndicator(_ref4) {
|
|
7493
|
+
let assignedAttributeGroups = _ref4.assignedAttributeGroups;
|
|
7494
|
+
const formatLocalizedField = useFormatLocalizedFieldToString();
|
|
7495
|
+
const _useIntl3 = reactIntl.useIntl(),
|
|
7496
|
+
formatMessage = _useIntl3.formatMessage;
|
|
7497
|
+
return (assignedAttributeGroups === null || assignedAttributeGroups === void 0 ? void 0 : assignedAttributeGroups.length) > 1 ? jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7498
|
+
title: formatMessage(messages$v.attributeGroupCountTooltip, {
|
|
7499
|
+
attributeGroups: _mapInstanceProperty__default["default"](assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
|
|
7500
|
+
count: assignedAttributeGroups.length
|
|
7501
|
+
}),
|
|
7502
|
+
horizontalConstraint: 7,
|
|
7503
|
+
components: {
|
|
7504
|
+
TooltipWrapperComponent: Portal
|
|
7505
|
+
},
|
|
7506
|
+
children: jsxRuntime.jsx("div", {
|
|
7507
|
+
css: _ref,
|
|
7508
|
+
children: jsxRuntime.jsx(uiKit.SwitcherIcon, {
|
|
7509
|
+
color: "info",
|
|
7510
|
+
size: "medium"
|
|
7511
|
+
})
|
|
7512
|
+
})
|
|
7513
|
+
}) : null;
|
|
7480
7514
|
}
|
|
7481
|
-
const CustomFieldsLabel = /*#__PURE__*/React.memo(
|
|
7482
|
-
let name =
|
|
7483
|
-
fieldDefinition =
|
|
7515
|
+
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref5 => {
|
|
7516
|
+
let name = _ref5.name,
|
|
7517
|
+
fieldDefinition = _ref5.fieldDefinition;
|
|
7484
7518
|
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
7485
7519
|
languages: applicationContext.project.languages,
|
|
7486
7520
|
language: applicationContext.dataLocale
|
|
@@ -7489,11 +7523,22 @@ const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
|
7489
7523
|
language = _useApplicationContex2.language;
|
|
7490
7524
|
return jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
7491
7525
|
htmlFor: name,
|
|
7492
|
-
title:
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7526
|
+
title: jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
7527
|
+
max: "scale",
|
|
7528
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7529
|
+
scale: "s",
|
|
7530
|
+
alignItems: "flex-end",
|
|
7531
|
+
children: [jsxRuntime.jsx("div", {
|
|
7532
|
+
children: l10n.formatLocalizedString(fieldDefinition, {
|
|
7533
|
+
key: 'label',
|
|
7534
|
+
locale: language,
|
|
7535
|
+
fallbackOrder: languages,
|
|
7536
|
+
fallback: fieldDefinition.name
|
|
7537
|
+
})
|
|
7538
|
+
}), jsxRuntime.jsx(CustomFieldsCountIndicator, {
|
|
7539
|
+
assignedAttributeGroups: fieldDefinition.assignedAttributeGroups
|
|
7540
|
+
})]
|
|
7541
|
+
})
|
|
7497
7542
|
}),
|
|
7498
7543
|
description: jsxRuntime.jsx(CustomFieldsLabelSubtitle, {
|
|
7499
7544
|
fieldDefinition: fieldDefinition
|
|
@@ -7631,23 +7676,23 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7631
7676
|
}
|
|
7632
7677
|
});
|
|
7633
7678
|
|
|
7634
|
-
function ownKeys$
|
|
7635
|
-
function _objectSpread$
|
|
7636
|
-
const
|
|
7637
|
-
INCLUSION: '
|
|
7638
|
-
EXCLUSION: '
|
|
7679
|
+
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; }
|
|
7680
|
+
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; }
|
|
7681
|
+
const PRODUCT_SELECTION_MODES = {
|
|
7682
|
+
INCLUSION: 'Individual',
|
|
7683
|
+
EXCLUSION: 'IndividualExclusion'
|
|
7639
7684
|
};
|
|
7640
|
-
const
|
|
7685
|
+
const PRODUCT_SELECTION_MODES_LABELS = {
|
|
7641
7686
|
INCLUSION: 'inclusion',
|
|
7642
7687
|
EXCLUSION: 'exclusion'
|
|
7643
7688
|
};
|
|
7644
|
-
const
|
|
7645
|
-
const
|
|
7689
|
+
const getMode = mode => mode === PRODUCT_SELECTION_MODES.INCLUSION || mode === PRODUCT_SELECTION_MODES_LABELS.INCLUSION ? 'inclusion' : 'exclusion';
|
|
7690
|
+
const addModeToLabel = function (ps) {
|
|
7646
7691
|
var _context;
|
|
7647
7692
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7648
7693
|
if (!ps) return undefined;
|
|
7649
|
-
return _objectSpread$
|
|
7650
|
-
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(
|
|
7694
|
+
return _objectSpread$I(_objectSpread$I({}, ps), {}, {
|
|
7695
|
+
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), ")") : '')
|
|
7651
7696
|
});
|
|
7652
7697
|
};
|
|
7653
7698
|
|
|
@@ -7668,9 +7713,9 @@ const mapProductSelectionsToOptions$1 = memoize__default["default"](function ()
|
|
|
7668
7713
|
return {
|
|
7669
7714
|
id: productSelection.id,
|
|
7670
7715
|
value: productSelection.id,
|
|
7671
|
-
label: _concatInstanceProperty__default["default"](_context = "".concat(label)).call(_context, _includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(
|
|
7716
|
+
label: _concatInstanceProperty__default["default"](_context = "".concat(label)).call(_context, _includesInstanceProperty__default["default"](selectedPSList).call(selectedPSList, productSelection.id) && enableExcludingProducts ? " (type: ".concat(getMode(productSelection.mode), ")") : ''),
|
|
7672
7717
|
key: productSelection.key,
|
|
7673
|
-
|
|
7718
|
+
mode: getMode(productSelection.mode)
|
|
7674
7719
|
};
|
|
7675
7720
|
});
|
|
7676
7721
|
});
|
|
@@ -7740,11 +7785,11 @@ const getValueFromOptions$3 = _ref => {
|
|
|
7740
7785
|
// handle async-select-field value transformation
|
|
7741
7786
|
if (isMulti) {
|
|
7742
7787
|
var _context;
|
|
7743
|
-
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 =>
|
|
7788
|
+
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));
|
|
7744
7789
|
}
|
|
7745
7790
|
|
|
7746
7791
|
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
7747
|
-
return
|
|
7792
|
+
return addModeToLabel(_findInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value), enableExcludingProducts);
|
|
7748
7793
|
};
|
|
7749
7794
|
const emptyStoreOption$1 = intl => [{
|
|
7750
7795
|
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
@@ -7791,7 +7836,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7791
7836
|
value: productSelection.id,
|
|
7792
7837
|
name: localizedName,
|
|
7793
7838
|
key: productSelection.key,
|
|
7794
|
-
|
|
7839
|
+
mode: getMode(productSelection.mode)
|
|
7795
7840
|
};
|
|
7796
7841
|
});
|
|
7797
7842
|
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
@@ -7846,7 +7891,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7846
7891
|
});
|
|
7847
7892
|
}
|
|
7848
7893
|
|
|
7849
|
-
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: "
|
|
7894
|
+
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 } } } };
|
|
7850
7895
|
const createQueryVariables$4 = (productSelections, predicateField) => {
|
|
7851
7896
|
var _context;
|
|
7852
7897
|
return {
|
|
@@ -7870,7 +7915,7 @@ const useProductSelectionsByFieldFetcher = (productSelections, predicateField) =
|
|
|
7870
7915
|
};
|
|
7871
7916
|
};
|
|
7872
7917
|
|
|
7873
|
-
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: "
|
|
7918
|
+
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 } } } };
|
|
7874
7919
|
const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
7875
7920
|
let _ref$productSelection = _ref.productSelections,
|
|
7876
7921
|
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
@@ -7885,7 +7930,7 @@ const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
|
7885
7930
|
fallbackOrder: projectLanguages
|
|
7886
7931
|
}),
|
|
7887
7932
|
key: productSelection.key,
|
|
7888
|
-
|
|
7933
|
+
mode: getMode(productSelection.mode)
|
|
7889
7934
|
}));
|
|
7890
7935
|
});
|
|
7891
7936
|
const getValueFromOptions$2 = _ref2 => {
|
|
@@ -7897,10 +7942,10 @@ const getValueFromOptions$2 = _ref2 => {
|
|
|
7897
7942
|
return undefined;
|
|
7898
7943
|
}
|
|
7899
7944
|
if (isMulti) {
|
|
7900
|
-
return _mapInstanceProperty__default["default"](productSelectionFieldOptions).call(productSelectionFieldOptions, ps =>
|
|
7945
|
+
return _mapInstanceProperty__default["default"](productSelectionFieldOptions).call(productSelectionFieldOptions, ps => addModeToLabel(ps, enableExcludingProducts));
|
|
7901
7946
|
}
|
|
7902
7947
|
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
7903
|
-
return
|
|
7948
|
+
return addModeToLabel(productSelectionFieldOptions[0], enableExcludingProducts);
|
|
7904
7949
|
};
|
|
7905
7950
|
const createQueryVariables$3 = _ref3 => {
|
|
7906
7951
|
var _context;
|
|
@@ -7942,7 +7987,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7942
7987
|
fetchPolicy: 'network-only'
|
|
7943
7988
|
}),
|
|
7944
7989
|
data = _await$client$query.data;
|
|
7945
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7990
|
+
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 : [];
|
|
7946
7991
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7947
7992
|
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7948
7993
|
var _context2;
|
|
@@ -7997,12 +8042,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7997
8042
|
});
|
|
7998
8043
|
}
|
|
7999
8044
|
|
|
8000
|
-
function ownKeys$
|
|
8001
|
-
function _objectSpread$
|
|
8002
|
-
function
|
|
8045
|
+
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; }
|
|
8046
|
+
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; }
|
|
8047
|
+
function ModeSelectInputOption(props) {
|
|
8003
8048
|
const data = props.data;
|
|
8004
8049
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
8005
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8050
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$H(_objectSpread$H({}, props), {}, {
|
|
8006
8051
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
8007
8052
|
scale: "xs",
|
|
8008
8053
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8011,24 +8056,24 @@ function TypeSelectInputOption(props) {
|
|
|
8011
8056
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
8012
8057
|
children: ["Key: ", (data === null || data === void 0 ? void 0 : data.key) || noValueFallback]
|
|
8013
8058
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
8014
|
-
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.
|
|
8059
|
+
children: ["Type: ", (data === null || data === void 0 ? void 0 : data.mode) || noValueFallback]
|
|
8015
8060
|
})]
|
|
8016
8061
|
})
|
|
8017
8062
|
}));
|
|
8018
8063
|
}
|
|
8019
8064
|
|
|
8020
|
-
function ownKeys$
|
|
8021
|
-
function _objectSpread$
|
|
8065
|
+
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; }
|
|
8066
|
+
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; }
|
|
8022
8067
|
function ProductSelectionsPicker(props) {
|
|
8023
8068
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8024
8069
|
const components = React.useMemo(() => {
|
|
8025
8070
|
return {
|
|
8026
8071
|
Option: optionInnerProps => {
|
|
8027
8072
|
if (optionInnerProps.isDisabled) {
|
|
8028
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8073
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$G({}, optionInnerProps));
|
|
8029
8074
|
}
|
|
8030
8075
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8031
|
-
return jsxRuntime.jsx(
|
|
8076
|
+
return jsxRuntime.jsx(ModeSelectInputOption, _objectSpread$G({}, optionInnerProps));
|
|
8032
8077
|
}
|
|
8033
8078
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8034
8079
|
optionType: props.optionType,
|
|
@@ -8040,7 +8085,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8040
8085
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8041
8086
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8042
8087
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8043
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8088
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
8044
8089
|
components: components
|
|
8045
8090
|
}))
|
|
8046
8091
|
});
|
|
@@ -8063,7 +8108,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8063
8108
|
|
|
8064
8109
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8065
8110
|
|
|
8066
|
-
var messages$
|
|
8111
|
+
var messages$u = reactIntl.defineMessages({
|
|
8067
8112
|
countriesBasicSelectPlaceholder: {
|
|
8068
8113
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8069
8114
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8091,7 +8136,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8091
8136
|
value: props.value,
|
|
8092
8137
|
isRequired: props.isRequired,
|
|
8093
8138
|
description: props.description,
|
|
8094
|
-
placeholder: intl.formatMessage(messages$
|
|
8139
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8095
8140
|
options: props.options,
|
|
8096
8141
|
onChange: props.onChange,
|
|
8097
8142
|
isDisabled: props.isDisabled,
|
|
@@ -8101,10 +8146,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8101
8146
|
});
|
|
8102
8147
|
}
|
|
8103
8148
|
|
|
8104
|
-
function ownKeys$
|
|
8105
|
-
function _objectSpread$
|
|
8149
|
+
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; }
|
|
8150
|
+
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; }
|
|
8106
8151
|
const emptyCountryOption = intl => [{
|
|
8107
|
-
label: intl.formatMessage(messages$
|
|
8152
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8108
8153
|
value: undefined,
|
|
8109
8154
|
isDisabled: true
|
|
8110
8155
|
}];
|
|
@@ -8129,7 +8174,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8129
8174
|
const onOptionChange = event => {
|
|
8130
8175
|
const countries = event.target.value;
|
|
8131
8176
|
props.onChange({
|
|
8132
|
-
target: _objectSpread$
|
|
8177
|
+
target: _objectSpread$F(_objectSpread$F({}, event.target), {}, {
|
|
8133
8178
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8134
8179
|
var _country$value;
|
|
8135
8180
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8150,7 +8195,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8150
8195
|
var _context3;
|
|
8151
8196
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8152
8197
|
}),
|
|
8153
|
-
placeholder: intl.formatMessage(messages$
|
|
8198
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8154
8199
|
loadOptions: handleLoadOptions,
|
|
8155
8200
|
onChange: onOptionChange,
|
|
8156
8201
|
isDisabled: props.isDisabled,
|
|
@@ -8160,13 +8205,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8160
8205
|
});
|
|
8161
8206
|
}
|
|
8162
8207
|
|
|
8163
|
-
function ownKeys$
|
|
8164
|
-
function _objectSpread$
|
|
8208
|
+
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; }
|
|
8209
|
+
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; }
|
|
8165
8210
|
function CountriesPicker(props) {
|
|
8166
8211
|
var _props$options;
|
|
8167
8212
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8168
8213
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8169
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8214
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$E({}, props))
|
|
8170
8215
|
});
|
|
8171
8216
|
}
|
|
8172
8217
|
CountriesPicker.defaultProps = {
|
|
@@ -8176,7 +8221,7 @@ CountriesPicker.defaultProps = {
|
|
|
8176
8221
|
hasWarning: false
|
|
8177
8222
|
};
|
|
8178
8223
|
|
|
8179
|
-
var messages$
|
|
8224
|
+
var messages$t = reactIntl.defineMessages({
|
|
8180
8225
|
noCustomerGroupsFound: {
|
|
8181
8226
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8182
8227
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8267,8 +8312,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8267
8312
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8268
8313
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8269
8314
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8270
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8271
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8315
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8316
|
+
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 : '';
|
|
8272
8317
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8273
8318
|
max: "scale",
|
|
8274
8319
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -8278,7 +8323,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8278
8323
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8279
8324
|
id: name,
|
|
8280
8325
|
name: name,
|
|
8281
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8326
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8282
8327
|
loadOptions: loadOptionsDebounced,
|
|
8283
8328
|
defaultOptions: true,
|
|
8284
8329
|
showOptionGroupDivider: true,
|
|
@@ -8348,7 +8393,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8348
8393
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8349
8394
|
};
|
|
8350
8395
|
|
|
8351
|
-
var messages$
|
|
8396
|
+
var messages$s = reactIntl.defineMessages({
|
|
8352
8397
|
basicSelectInputPlaceholder: {
|
|
8353
8398
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8354
8399
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8374,6 +8419,11 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8374
8419
|
description: 'The message shown in search select input when matches are found',
|
|
8375
8420
|
defaultMessage: 'No matches found for your search term'
|
|
8376
8421
|
},
|
|
8422
|
+
searchSelectInputNoValueMessage: {
|
|
8423
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8424
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8425
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8426
|
+
},
|
|
8377
8427
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8378
8428
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8379
8429
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8381,8 +8431,8 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8381
8431
|
}
|
|
8382
8432
|
});
|
|
8383
8433
|
|
|
8384
|
-
function ownKeys$
|
|
8385
|
-
function _objectSpread$
|
|
8434
|
+
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; }
|
|
8435
|
+
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; }
|
|
8386
8436
|
const hasErrors$2 = errors => {
|
|
8387
8437
|
var _context;
|
|
8388
8438
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8407,7 +8457,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8407
8457
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8408
8458
|
};
|
|
8409
8459
|
const emptyStoreOption = intl => [{
|
|
8410
|
-
label: intl.formatMessage(messages$
|
|
8460
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8411
8461
|
value: undefined,
|
|
8412
8462
|
isDisabled: true
|
|
8413
8463
|
}];
|
|
@@ -8454,10 +8504,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8454
8504
|
};
|
|
8455
8505
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8456
8506
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8457
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8507
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$D(_objectSpread$D({
|
|
8458
8508
|
id: props.id,
|
|
8459
8509
|
name: props.name,
|
|
8460
|
-
placeholder: intl.formatMessage(messages$
|
|
8510
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8461
8511
|
horizontalConstraint: props.horizontalConstraint,
|
|
8462
8512
|
loadOptions: handleLoadOptions,
|
|
8463
8513
|
defaultOptions: true,
|
|
@@ -8497,8 +8547,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8497
8547
|
shouldFetchProductSelections: false
|
|
8498
8548
|
};
|
|
8499
8549
|
|
|
8500
|
-
function ownKeys$
|
|
8501
|
-
function _objectSpread$
|
|
8550
|
+
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; }
|
|
8551
|
+
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; }
|
|
8502
8552
|
const hasErrors$1 = errors => {
|
|
8503
8553
|
var _context;
|
|
8504
8554
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8546,10 +8596,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8546
8596
|
};
|
|
8547
8597
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8548
8598
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8549
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8599
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$C(_objectSpread$C({
|
|
8550
8600
|
id: props.id,
|
|
8551
8601
|
name: props.name,
|
|
8552
|
-
placeholder: intl.formatMessage(messages$
|
|
8602
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8553
8603
|
horizontalConstraint: props.horizontalConstraint,
|
|
8554
8604
|
options: mappedStoresListOptions,
|
|
8555
8605
|
isMulti: props.isMulti,
|
|
@@ -8642,8 +8692,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8642
8692
|
};
|
|
8643
8693
|
};
|
|
8644
8694
|
|
|
8645
|
-
function ownKeys$
|
|
8646
|
-
function _objectSpread$
|
|
8695
|
+
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; }
|
|
8696
|
+
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; }
|
|
8647
8697
|
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 } } } };
|
|
8648
8698
|
const hasErrors = errors => {
|
|
8649
8699
|
var _context;
|
|
@@ -8745,10 +8795,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8745
8795
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8746
8796
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8747
8797
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8748
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8798
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$B(_objectSpread$B({
|
|
8749
8799
|
id: props.id,
|
|
8750
8800
|
name: props.name,
|
|
8751
|
-
placeholder: intl.formatMessage(messages$
|
|
8801
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8752
8802
|
horizontalConstraint: props.horizontalConstraint,
|
|
8753
8803
|
loadOptions: loadOptionsDebounced,
|
|
8754
8804
|
defaultOptions: false,
|
|
@@ -8762,8 +8812,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8762
8812
|
}),
|
|
8763
8813
|
onChange: props.onChange,
|
|
8764
8814
|
onBlur: props.onBlur,
|
|
8765
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8766
|
-
noOptionsMessage:
|
|
8815
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8816
|
+
noOptionsMessage: _ref4 => {
|
|
8817
|
+
let inputValue = _ref4.inputValue;
|
|
8818
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8819
|
+
},
|
|
8767
8820
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8768
8821
|
isReadOnly: props.isReadOnly,
|
|
8769
8822
|
isClearable: props.isClearable,
|
|
@@ -8791,8 +8844,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8791
8844
|
shouldFetchProductSelections: false
|
|
8792
8845
|
};
|
|
8793
8846
|
|
|
8794
|
-
function ownKeys$
|
|
8795
|
-
function _objectSpread$
|
|
8847
|
+
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; }
|
|
8848
|
+
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; }
|
|
8796
8849
|
const StoreSelectInput = props => {
|
|
8797
8850
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8798
8851
|
const components = React.useMemo(() => {
|
|
@@ -8800,7 +8853,7 @@ const StoreSelectInput = props => {
|
|
|
8800
8853
|
// eslint-disable-next-line react/display-name
|
|
8801
8854
|
Option: optionInnerProps => {
|
|
8802
8855
|
if (optionInnerProps.isDisabled) {
|
|
8803
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8856
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$A({}, optionInnerProps));
|
|
8804
8857
|
}
|
|
8805
8858
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8806
8859
|
optionType: props.optionType,
|
|
@@ -8811,7 +8864,7 @@ const StoreSelectInput = props => {
|
|
|
8811
8864
|
}, [props.optionType]);
|
|
8812
8865
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8813
8866
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8814
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8867
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8815
8868
|
projectKey: props.projectKey,
|
|
8816
8869
|
id: props.id,
|
|
8817
8870
|
name: props.name,
|
|
@@ -8866,7 +8919,7 @@ const businessRoleConstants = {
|
|
|
8866
8919
|
|
|
8867
8920
|
const businessRoleKeys = _Object$values__default["default"](businessRoleConstants);
|
|
8868
8921
|
|
|
8869
|
-
var messages$
|
|
8922
|
+
var messages$r = reactIntl.defineMessages({
|
|
8870
8923
|
ExecutiveManagement: {
|
|
8871
8924
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8872
8925
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8924,7 +8977,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8924
8977
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
8925
8978
|
}
|
|
8926
8979
|
|
|
8927
|
-
const messages$
|
|
8980
|
+
const messages$q = reactIntl.defineMessages({
|
|
8928
8981
|
inputFieldError: {
|
|
8929
8982
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8930
8983
|
description: 'Error message for empty input field ',
|
|
@@ -8945,14 +8998,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8945
8998
|
if (validateSingleFilter({
|
|
8946
8999
|
value
|
|
8947
9000
|
})) {
|
|
8948
|
-
return intl.formatMessage(messages$
|
|
9001
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8949
9002
|
}
|
|
8950
9003
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8951
9004
|
value: value.currencyCode
|
|
8952
9005
|
}) || validateSingleFilter({
|
|
8953
9006
|
value: value.amount
|
|
8954
9007
|
}))) {
|
|
8955
|
-
return intl.formatMessage(messages$
|
|
9008
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8956
9009
|
}
|
|
8957
9010
|
return null;
|
|
8958
9011
|
};
|
|
@@ -8960,7 +9013,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8960
9013
|
let value = _ref.value;
|
|
8961
9014
|
if (!value || !value.type) {
|
|
8962
9015
|
return {
|
|
8963
|
-
type: intl.formatMessage(messages$
|
|
9016
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8964
9017
|
};
|
|
8965
9018
|
}
|
|
8966
9019
|
const typeName = value.type.name;
|
|
@@ -8968,7 +9021,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8968
9021
|
const filterValue = value.value;
|
|
8969
9022
|
if (hasOption && !value.option) {
|
|
8970
9023
|
return {
|
|
8971
|
-
option: intl.formatMessage(messages$
|
|
9024
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8972
9025
|
};
|
|
8973
9026
|
}
|
|
8974
9027
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8987,7 +9040,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8987
9040
|
} : null;
|
|
8988
9041
|
}
|
|
8989
9042
|
|
|
8990
|
-
const messages$
|
|
9043
|
+
const messages$p = reactIntl.defineMessages({
|
|
8991
9044
|
rangeMissingValue: {
|
|
8992
9045
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8993
9046
|
description: 'error message if missing a value in a range',
|
|
@@ -9012,25 +9065,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
9012
9065
|
if (validateSingleFilter({
|
|
9013
9066
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
9014
9067
|
})) return {
|
|
9015
|
-
from: intl.formatMessage(messages$
|
|
9068
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9016
9069
|
};
|
|
9017
9070
|
if (validateSingleFilter({
|
|
9018
9071
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
9019
9072
|
})) return {
|
|
9020
|
-
to: intl.formatMessage(messages$
|
|
9073
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
9021
9074
|
};
|
|
9022
9075
|
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 {
|
|
9023
|
-
from: intl.formatMessage(messages$
|
|
9076
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
9024
9077
|
};
|
|
9025
9078
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9026
9079
|
if (validateSingleFilter({
|
|
9027
9080
|
value
|
|
9028
|
-
})) return intl.formatMessage(messages$
|
|
9081
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
9029
9082
|
}
|
|
9030
9083
|
return null;
|
|
9031
9084
|
}
|
|
9032
9085
|
|
|
9033
|
-
const messages$
|
|
9086
|
+
const messages$o = reactIntl.defineMessages({
|
|
9034
9087
|
rangeMissingValue: {
|
|
9035
9088
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9036
9089
|
description: 'error message if missing a value in a range',
|
|
@@ -9049,30 +9102,30 @@ function validateFilter(_ref, intl) {
|
|
|
9049
9102
|
_ref$allowFloat = _ref.allowFloat,
|
|
9050
9103
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9051
9104
|
if (type !== 'range') {
|
|
9052
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9105
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
9053
9106
|
return null;
|
|
9054
9107
|
}
|
|
9055
9108
|
|
|
9056
9109
|
// only range types from here
|
|
9057
9110
|
|
|
9058
9111
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9059
|
-
from: intl.formatMessage(messages$
|
|
9112
|
+
from: intl.formatMessage(messages$K.integer)
|
|
9060
9113
|
};
|
|
9061
9114
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9062
|
-
to: intl.formatMessage(messages$
|
|
9115
|
+
to: intl.formatMessage(messages$K.integer)
|
|
9063
9116
|
};
|
|
9064
9117
|
if (validateSingleFilter({
|
|
9065
9118
|
value: value.from
|
|
9066
9119
|
})) return {
|
|
9067
|
-
from: intl.formatMessage(messages$
|
|
9120
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9068
9121
|
};
|
|
9069
9122
|
if (validateSingleFilter({
|
|
9070
9123
|
value: value.to
|
|
9071
9124
|
})) return {
|
|
9072
|
-
to: intl.formatMessage(messages$
|
|
9125
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9073
9126
|
};
|
|
9074
9127
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9075
|
-
from: intl.formatMessage(messages$
|
|
9128
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9076
9129
|
};
|
|
9077
9130
|
return null;
|
|
9078
9131
|
}
|
|
@@ -9366,10 +9419,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9366
9419
|
carts: 'carts'
|
|
9367
9420
|
};
|
|
9368
9421
|
|
|
9369
|
-
function ownKeys$
|
|
9370
|
-
function _objectSpread$
|
|
9422
|
+
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; }
|
|
9423
|
+
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; }
|
|
9371
9424
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9372
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9425
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$z({
|
|
9373
9426
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9374
9427
|
}, previousIncludedLimits), {});
|
|
9375
9428
|
|
|
@@ -9431,7 +9484,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9431
9484
|
};
|
|
9432
9485
|
};
|
|
9433
9486
|
|
|
9434
|
-
var messages$
|
|
9487
|
+
var messages$n = reactIntl.defineMessages({
|
|
9435
9488
|
shippingMethods: {
|
|
9436
9489
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9437
9490
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9459,8 +9512,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9459
9512
|
}
|
|
9460
9513
|
});
|
|
9461
9514
|
|
|
9462
|
-
function ownKeys$
|
|
9463
|
-
function _objectSpread$
|
|
9515
|
+
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; }
|
|
9516
|
+
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; }
|
|
9464
9517
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9465
9518
|
isExternal: true,
|
|
9466
9519
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9471,7 +9524,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9471
9524
|
limit = _ref.limit;
|
|
9472
9525
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9473
9526
|
type: "warning",
|
|
9474
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9527
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$y(_objectSpread$y({}, messages$n[resource]), {}, {
|
|
9475
9528
|
values: {
|
|
9476
9529
|
limit,
|
|
9477
9530
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9484,7 +9537,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9484
9537
|
};
|
|
9485
9538
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9486
9539
|
|
|
9487
|
-
var messages$
|
|
9540
|
+
var messages$m = reactIntl.defineMessages({
|
|
9488
9541
|
shippingMethods: {
|
|
9489
9542
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9490
9543
|
description: 'error message about platform limit exceeded',
|
|
@@ -9512,8 +9565,8 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9512
9565
|
}
|
|
9513
9566
|
});
|
|
9514
9567
|
|
|
9515
|
-
function ownKeys$
|
|
9516
|
-
function _objectSpread$
|
|
9568
|
+
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; }
|
|
9569
|
+
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; }
|
|
9517
9570
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9518
9571
|
isExternal: true,
|
|
9519
9572
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9524,7 +9577,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9524
9577
|
limit = _ref.limit;
|
|
9525
9578
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9526
9579
|
type: "error",
|
|
9527
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9580
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$m[resource]), {}, {
|
|
9528
9581
|
values: {
|
|
9529
9582
|
limit,
|
|
9530
9583
|
customersupport: getCustomerSupportLink
|
|
@@ -9542,8 +9595,8 @@ const Notifications = {
|
|
|
9542
9595
|
Error: PlatformLimitErrorNotification
|
|
9543
9596
|
};
|
|
9544
9597
|
|
|
9545
|
-
function ownKeys$
|
|
9546
|
-
function _objectSpread$
|
|
9598
|
+
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; }
|
|
9599
|
+
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; }
|
|
9547
9600
|
const PlatformLimitsStatusText = _ref => {
|
|
9548
9601
|
let intlMessage = _ref.intlMessage,
|
|
9549
9602
|
children = _ref.children;
|
|
@@ -9552,7 +9605,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9552
9605
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9553
9606
|
size: "xs",
|
|
9554
9607
|
children: [jsxRuntime.jsx("span", {
|
|
9555
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9608
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w({}, intlMessage))
|
|
9556
9609
|
}), jsxRuntime.jsx("span", {
|
|
9557
9610
|
children: children
|
|
9558
9611
|
})]
|
|
@@ -9653,7 +9706,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9653
9706
|
};
|
|
9654
9707
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9655
9708
|
|
|
9656
|
-
var messages$
|
|
9709
|
+
var messages$l = reactIntl.defineMessages({
|
|
9657
9710
|
shippingMethodsPlatformLimitReached: {
|
|
9658
9711
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9659
9712
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9661,17 +9714,17 @@ var messages$k = reactIntl.defineMessages({
|
|
|
9661
9714
|
}
|
|
9662
9715
|
});
|
|
9663
9716
|
|
|
9664
|
-
function ownKeys$
|
|
9665
|
-
function _objectSpread$
|
|
9717
|
+
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; }
|
|
9718
|
+
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; }
|
|
9666
9719
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9667
9720
|
const intl = reactIntl.useIntl();
|
|
9668
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9669
|
-
title: intl.formatMessage(messages$
|
|
9721
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$v(_objectSpread$v({}, props), {}, {
|
|
9722
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9670
9723
|
}));
|
|
9671
9724
|
};
|
|
9672
9725
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9673
9726
|
|
|
9674
|
-
var messages$
|
|
9727
|
+
var messages$k = reactIntl.defineMessages({
|
|
9675
9728
|
shippingMethodsStatus: {
|
|
9676
9729
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9677
9730
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9680,15 +9733,15 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9680
9733
|
});
|
|
9681
9734
|
|
|
9682
9735
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9683
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9736
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9684
9737
|
let total = _ref.total;
|
|
9685
9738
|
const intl = reactIntl.useIntl();
|
|
9686
9739
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9687
9740
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9688
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9689
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9741
|
+
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;
|
|
9742
|
+
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;
|
|
9690
9743
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9691
|
-
intlMessage: messages$
|
|
9744
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9692
9745
|
children: getPlatformLimitsStatus({
|
|
9693
9746
|
limit,
|
|
9694
9747
|
current,
|
|
@@ -9719,15 +9772,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9719
9772
|
};
|
|
9720
9773
|
};
|
|
9721
9774
|
|
|
9722
|
-
function ownKeys$
|
|
9723
|
-
function _objectSpread$
|
|
9775
|
+
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; }
|
|
9776
|
+
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; }
|
|
9724
9777
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9725
9778
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9726
9779
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9727
9780
|
const shippingMethodsProps = {
|
|
9728
9781
|
platformLimits: shippingMethodsPlatformLimits
|
|
9729
9782
|
};
|
|
9730
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9783
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$u(_objectSpread$u({}, props), shippingMethodsProps));
|
|
9731
9784
|
};
|
|
9732
9785
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9733
9786
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9800,7 +9853,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9800
9853
|
};
|
|
9801
9854
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9802
9855
|
|
|
9803
|
-
var messages$
|
|
9856
|
+
var messages$j = reactIntl.defineMessages({
|
|
9804
9857
|
taxCategoriesPlatformLimitReached: {
|
|
9805
9858
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9806
9859
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9808,17 +9861,17 @@ var messages$i = reactIntl.defineMessages({
|
|
|
9808
9861
|
}
|
|
9809
9862
|
});
|
|
9810
9863
|
|
|
9811
|
-
function ownKeys$
|
|
9812
|
-
function _objectSpread$
|
|
9864
|
+
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; }
|
|
9865
|
+
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; }
|
|
9813
9866
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9814
9867
|
const intl = reactIntl.useIntl();
|
|
9815
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9816
|
-
title: intl.formatMessage(messages$
|
|
9868
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$t(_objectSpread$t({}, props), {}, {
|
|
9869
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9817
9870
|
}));
|
|
9818
9871
|
};
|
|
9819
9872
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9820
9873
|
|
|
9821
|
-
var messages$
|
|
9874
|
+
var messages$i = reactIntl.defineMessages({
|
|
9822
9875
|
taxCategoriesStatus: {
|
|
9823
9876
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9824
9877
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9827,15 +9880,15 @@ var messages$h = reactIntl.defineMessages({
|
|
|
9827
9880
|
});
|
|
9828
9881
|
|
|
9829
9882
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9830
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9883
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9831
9884
|
let total = _ref.total;
|
|
9832
9885
|
const intl = reactIntl.useIntl();
|
|
9833
9886
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9834
9887
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9835
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9836
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9888
|
+
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;
|
|
9889
|
+
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;
|
|
9837
9890
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9838
|
-
intlMessage: messages$
|
|
9891
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9839
9892
|
children: getPlatformLimitsStatus({
|
|
9840
9893
|
limit,
|
|
9841
9894
|
current,
|
|
@@ -9866,15 +9919,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9866
9919
|
};
|
|
9867
9920
|
};
|
|
9868
9921
|
|
|
9869
|
-
function ownKeys$
|
|
9870
|
-
function _objectSpread$
|
|
9922
|
+
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; }
|
|
9923
|
+
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; }
|
|
9871
9924
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9872
9925
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9873
9926
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9874
9927
|
const taxCategoriesProps = {
|
|
9875
9928
|
platformLimits: taxCategoriesPlatformLimits
|
|
9876
9929
|
};
|
|
9877
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9930
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$s(_objectSpread$s({}, props), taxCategoriesProps));
|
|
9878
9931
|
};
|
|
9879
9932
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9880
9933
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9947,7 +10000,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9947
10000
|
};
|
|
9948
10001
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9949
10002
|
|
|
9950
|
-
var messages$
|
|
10003
|
+
var messages$h = reactIntl.defineMessages({
|
|
9951
10004
|
zonesPlatformLimitReached: {
|
|
9952
10005
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9953
10006
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9955,17 +10008,17 @@ var messages$g = reactIntl.defineMessages({
|
|
|
9955
10008
|
}
|
|
9956
10009
|
});
|
|
9957
10010
|
|
|
9958
|
-
function ownKeys$
|
|
9959
|
-
function _objectSpread$
|
|
10011
|
+
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; }
|
|
10012
|
+
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; }
|
|
9960
10013
|
const PlatformLimitsZonesTooltip = props => {
|
|
9961
10014
|
const intl = reactIntl.useIntl();
|
|
9962
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9963
|
-
title: intl.formatMessage(messages$
|
|
10015
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$r(_objectSpread$r({}, props), {}, {
|
|
10016
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9964
10017
|
}));
|
|
9965
10018
|
};
|
|
9966
10019
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9967
10020
|
|
|
9968
|
-
var messages$
|
|
10021
|
+
var messages$g = reactIntl.defineMessages({
|
|
9969
10022
|
zonesStatus: {
|
|
9970
10023
|
id: 'PlatformLimits.Status.zones',
|
|
9971
10024
|
description: 'The message for zones platform limit values',
|
|
@@ -9974,15 +10027,15 @@ var messages$f = reactIntl.defineMessages({
|
|
|
9974
10027
|
});
|
|
9975
10028
|
|
|
9976
10029
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9977
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
10030
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9978
10031
|
let total = _ref.total;
|
|
9979
10032
|
const intl = reactIntl.useIntl();
|
|
9980
10033
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9981
10034
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9982
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9983
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
10035
|
+
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;
|
|
10036
|
+
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;
|
|
9984
10037
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9985
|
-
intlMessage: messages$
|
|
10038
|
+
intlMessage: messages$g.zonesStatus,
|
|
9986
10039
|
children: getPlatformLimitsStatus({
|
|
9987
10040
|
limit,
|
|
9988
10041
|
current,
|
|
@@ -10013,15 +10066,15 @@ const useZonesLimits = () => {
|
|
|
10013
10066
|
};
|
|
10014
10067
|
};
|
|
10015
10068
|
|
|
10016
|
-
function ownKeys$
|
|
10017
|
-
function _objectSpread$
|
|
10069
|
+
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; }
|
|
10070
|
+
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; }
|
|
10018
10071
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
10019
10072
|
const WithZonesPlatformLimits = props => {
|
|
10020
10073
|
const zonesPlatformLimits = useZonesLimits();
|
|
10021
10074
|
const zonesProps = {
|
|
10022
10075
|
platformLimits: zonesPlatformLimits
|
|
10023
10076
|
};
|
|
10024
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10077
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$q(_objectSpread$q({}, props), zonesProps));
|
|
10025
10078
|
};
|
|
10026
10079
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10027
10080
|
return WithZonesPlatformLimits;
|
|
@@ -10107,7 +10160,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10107
10160
|
};
|
|
10108
10161
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10109
10162
|
|
|
10110
|
-
var messages$
|
|
10163
|
+
var messages$f = reactIntl.defineMessages({
|
|
10111
10164
|
customersPlatformLimitReached: {
|
|
10112
10165
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10113
10166
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10115,17 +10168,17 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10115
10168
|
}
|
|
10116
10169
|
});
|
|
10117
10170
|
|
|
10118
|
-
function ownKeys$
|
|
10119
|
-
function _objectSpread$
|
|
10171
|
+
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; }
|
|
10172
|
+
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; }
|
|
10120
10173
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10121
10174
|
const intl = reactIntl.useIntl();
|
|
10122
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10123
|
-
title: intl.formatMessage(messages$
|
|
10175
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$p(_objectSpread$p({}, props), {}, {
|
|
10176
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10124
10177
|
}));
|
|
10125
10178
|
};
|
|
10126
10179
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10127
10180
|
|
|
10128
|
-
var messages$
|
|
10181
|
+
var messages$e = reactIntl.defineMessages({
|
|
10129
10182
|
customersStatus: {
|
|
10130
10183
|
id: 'PlatformLimits.Status.customers',
|
|
10131
10184
|
description: 'The message for customers platform limit values',
|
|
@@ -10133,8 +10186,8 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10133
10186
|
}
|
|
10134
10187
|
});
|
|
10135
10188
|
|
|
10136
|
-
function ownKeys$
|
|
10137
|
-
function _objectSpread$
|
|
10189
|
+
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; }
|
|
10190
|
+
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; }
|
|
10138
10191
|
var styles$b = {
|
|
10139
10192
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10140
10193
|
};
|
|
@@ -10154,7 +10207,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10154
10207
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10155
10208
|
tone: "secondary",
|
|
10156
10209
|
isInline: true,
|
|
10157
|
-
intlMessage: _objectSpread$
|
|
10210
|
+
intlMessage: _objectSpread$o(_objectSpread$o({}, messages$e.customersStatus), {}, {
|
|
10158
10211
|
values: {
|
|
10159
10212
|
current: intl.formatNumber(current),
|
|
10160
10213
|
limit: intl.formatNumber(limit)
|
|
@@ -10165,7 +10218,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10165
10218
|
};
|
|
10166
10219
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10167
10220
|
|
|
10168
|
-
var messages$
|
|
10221
|
+
var messages$d = reactIntl.defineMessages({
|
|
10169
10222
|
title: {
|
|
10170
10223
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10171
10224
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10178,10 +10231,10 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10178
10231
|
}
|
|
10179
10232
|
});
|
|
10180
10233
|
|
|
10181
|
-
function ownKeys$
|
|
10182
|
-
function _objectSpread$
|
|
10234
|
+
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; }
|
|
10235
|
+
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; }
|
|
10183
10236
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10184
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10237
|
+
return jsxRuntime.jsxs("svg", _objectSpread$n(_objectSpread$n({}, props), {}, {
|
|
10185
10238
|
children: [jsxRuntime.jsx("defs", {
|
|
10186
10239
|
children: jsxRuntime.jsx("path", {
|
|
10187
10240
|
id: "a",
|
|
@@ -10289,7 +10342,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10289
10342
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10290
10343
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10291
10344
|
onClose: onClose,
|
|
10292
|
-
title: intl.formatMessage(messages$
|
|
10345
|
+
title: intl.formatMessage(messages$d.title),
|
|
10293
10346
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10294
10347
|
scale: "m",
|
|
10295
10348
|
alignItems: "center",
|
|
@@ -10298,7 +10351,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10298
10351
|
alignItems: "center",
|
|
10299
10352
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10300
10353
|
onClick: onClose,
|
|
10301
|
-
label: intl.formatMessage(messages$
|
|
10354
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10302
10355
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10303
10356
|
size: "medium",
|
|
10304
10357
|
color: "primary"
|
|
@@ -10353,15 +10406,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10353
10406
|
};
|
|
10354
10407
|
};
|
|
10355
10408
|
|
|
10356
|
-
function ownKeys$
|
|
10357
|
-
function _objectSpread$
|
|
10409
|
+
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; }
|
|
10410
|
+
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; }
|
|
10358
10411
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10359
10412
|
const WithCustomersPlatformLimits = props => {
|
|
10360
10413
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10361
10414
|
const customersProps = {
|
|
10362
10415
|
platformLimits: CustomersPlatformLimits
|
|
10363
10416
|
};
|
|
10364
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10417
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$m(_objectSpread$m({}, props), customersProps));
|
|
10365
10418
|
};
|
|
10366
10419
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10367
10420
|
return WithCustomersPlatformLimits;
|
|
@@ -10447,7 +10500,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10447
10500
|
};
|
|
10448
10501
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10449
10502
|
|
|
10450
|
-
var messages$
|
|
10503
|
+
var messages$c = reactIntl.defineMessages({
|
|
10451
10504
|
customerGroupsPlatformLimitReached: {
|
|
10452
10505
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10453
10506
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10455,17 +10508,17 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10455
10508
|
}
|
|
10456
10509
|
});
|
|
10457
10510
|
|
|
10458
|
-
function ownKeys$
|
|
10459
|
-
function _objectSpread$
|
|
10511
|
+
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; }
|
|
10512
|
+
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; }
|
|
10460
10513
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10461
10514
|
const intl = reactIntl.useIntl();
|
|
10462
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10463
|
-
title: intl.formatMessage(messages$
|
|
10515
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$l(_objectSpread$l({}, props), {}, {
|
|
10516
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10464
10517
|
}));
|
|
10465
10518
|
};
|
|
10466
10519
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10467
10520
|
|
|
10468
|
-
var messages$
|
|
10521
|
+
var messages$b = reactIntl.defineMessages({
|
|
10469
10522
|
customerGroupsStatus: {
|
|
10470
10523
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10471
10524
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10473,8 +10526,8 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10473
10526
|
}
|
|
10474
10527
|
});
|
|
10475
10528
|
|
|
10476
|
-
function ownKeys$
|
|
10477
|
-
function _objectSpread$
|
|
10529
|
+
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; }
|
|
10530
|
+
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; }
|
|
10478
10531
|
var styles$9 = {
|
|
10479
10532
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10480
10533
|
};
|
|
@@ -10494,7 +10547,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10494
10547
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10495
10548
|
tone: "secondary",
|
|
10496
10549
|
isInline: true,
|
|
10497
|
-
intlMessage: _objectSpread$
|
|
10550
|
+
intlMessage: _objectSpread$k(_objectSpread$k({}, messages$b.customerGroupsStatus), {}, {
|
|
10498
10551
|
values: {
|
|
10499
10552
|
current: intl.formatNumber(current),
|
|
10500
10553
|
limit: intl.formatNumber(limit)
|
|
@@ -10505,7 +10558,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10505
10558
|
};
|
|
10506
10559
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10507
10560
|
|
|
10508
|
-
var messages$
|
|
10561
|
+
var messages$a = reactIntl.defineMessages({
|
|
10509
10562
|
title: {
|
|
10510
10563
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10511
10564
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10518,10 +10571,10 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
10518
10571
|
}
|
|
10519
10572
|
});
|
|
10520
10573
|
|
|
10521
|
-
function ownKeys$
|
|
10522
|
-
function _objectSpread$
|
|
10574
|
+
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; }
|
|
10575
|
+
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; }
|
|
10523
10576
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10524
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10577
|
+
return jsxRuntime.jsxs("svg", _objectSpread$j(_objectSpread$j({}, props), {}, {
|
|
10525
10578
|
children: [jsxRuntime.jsx("defs", {
|
|
10526
10579
|
children: jsxRuntime.jsx("path", {
|
|
10527
10580
|
id: "a",
|
|
@@ -10629,7 +10682,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10629
10682
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10630
10683
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10631
10684
|
onClose: onClose,
|
|
10632
|
-
title: intl.formatMessage(messages$
|
|
10685
|
+
title: intl.formatMessage(messages$a.title),
|
|
10633
10686
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10634
10687
|
scale: "m",
|
|
10635
10688
|
alignItems: "center",
|
|
@@ -10638,7 +10691,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10638
10691
|
alignItems: "center",
|
|
10639
10692
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10640
10693
|
onClick: onClose,
|
|
10641
|
-
label: intl.formatMessage(messages$
|
|
10694
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10642
10695
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10643
10696
|
size: "medium",
|
|
10644
10697
|
color: "primary"
|
|
@@ -10693,15 +10746,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10693
10746
|
};
|
|
10694
10747
|
};
|
|
10695
10748
|
|
|
10696
|
-
function ownKeys$
|
|
10697
|
-
function _objectSpread$
|
|
10749
|
+
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; }
|
|
10750
|
+
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; }
|
|
10698
10751
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10699
10752
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10700
10753
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10701
10754
|
const customersProps = {
|
|
10702
10755
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10703
10756
|
};
|
|
10704
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10757
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$i(_objectSpread$i({}, props), customersProps));
|
|
10705
10758
|
};
|
|
10706
10759
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10707
10760
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10756,7 +10809,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10756
10809
|
}
|
|
10757
10810
|
});
|
|
10758
10811
|
|
|
10759
|
-
var messages$
|
|
10812
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10760
10813
|
indexingSucceed: {
|
|
10761
10814
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10762
10815
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10794,8 +10847,8 @@ const defaultValue = {
|
|
|
10794
10847
|
*/
|
|
10795
10848
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10796
10849
|
|
|
10797
|
-
function ownKeys$
|
|
10798
|
-
function _objectSpread$
|
|
10850
|
+
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; }
|
|
10851
|
+
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; }
|
|
10799
10852
|
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); }; }
|
|
10800
10853
|
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; } }
|
|
10801
10854
|
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 } } } };
|
|
@@ -10881,7 +10934,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10881
10934
|
_this.props.notifications.showNotification({
|
|
10882
10935
|
kind: 'error',
|
|
10883
10936
|
domain: constants.DOMAINS.SIDE,
|
|
10884
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10937
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10885
10938
|
});
|
|
10886
10939
|
};
|
|
10887
10940
|
_this.getIndexingProgress = async () => {
|
|
@@ -10922,7 +10975,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10922
10975
|
_this.props.notifications.showNotification({
|
|
10923
10976
|
kind: 'success',
|
|
10924
10977
|
domain: constants.DOMAINS.SIDE,
|
|
10925
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10978
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10926
10979
|
},
|
|
10927
10980
|
// because the indexing may take so long, the success notification
|
|
10928
10981
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10971,7 +11024,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10971
11024
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10972
11025
|
}
|
|
10973
11026
|
});
|
|
10974
|
-
_this.setState(_objectSpread$
|
|
11027
|
+
_this.setState(_objectSpread$h(_objectSpread$h({
|
|
10975
11028
|
isLoading: false,
|
|
10976
11029
|
isProjectBeingIndexedByPim: true
|
|
10977
11030
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10996,7 +11049,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10996
11049
|
key: "render",
|
|
10997
11050
|
value: function render() {
|
|
10998
11051
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
10999
|
-
value: _objectSpread$
|
|
11052
|
+
value: _objectSpread$h(_objectSpread$h({}, this.state), {}, {
|
|
11000
11053
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
11001
11054
|
indexProject: this.indexProject
|
|
11002
11055
|
}),
|
|
@@ -11038,13 +11091,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11038
11091
|
}(React.PureComponent);
|
|
11039
11092
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11040
11093
|
|
|
11041
|
-
function ownKeys$
|
|
11042
|
-
function _objectSpread$
|
|
11094
|
+
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; }
|
|
11095
|
+
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; }
|
|
11043
11096
|
var injectPimIndexer = (function () {
|
|
11044
11097
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11045
11098
|
return Component => {
|
|
11046
11099
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11047
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11100
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
11048
11101
|
[propName]: pimIndexerProps
|
|
11049
11102
|
}))
|
|
11050
11103
|
});
|
|
@@ -11057,7 +11110,7 @@ function usePimIndexer() {
|
|
|
11057
11110
|
return React.useContext(PimIndexerContext);
|
|
11058
11111
|
}
|
|
11059
11112
|
|
|
11060
|
-
var messages$
|
|
11113
|
+
var messages$8 = reactIntl.defineMessages({
|
|
11061
11114
|
yes: {
|
|
11062
11115
|
id: 'BooleanField.yes',
|
|
11063
11116
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11079,8 +11132,8 @@ const BooleanField = props => {
|
|
|
11079
11132
|
var _context;
|
|
11080
11133
|
let selectedValue;
|
|
11081
11134
|
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]);
|
|
11082
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11083
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11135
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11136
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11084
11137
|
const options = [{
|
|
11085
11138
|
value: 'yes',
|
|
11086
11139
|
label: yesLabel
|
|
@@ -11118,7 +11171,7 @@ function getBooleanValue(value) {
|
|
|
11118
11171
|
return value === false ? 'no' : 'yes';
|
|
11119
11172
|
}
|
|
11120
11173
|
|
|
11121
|
-
var messages$
|
|
11174
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11122
11175
|
label: {
|
|
11123
11176
|
id: 'MissingValueField.label',
|
|
11124
11177
|
description: 'The label text for the missing values option',
|
|
@@ -11126,20 +11179,20 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11126
11179
|
}
|
|
11127
11180
|
});
|
|
11128
11181
|
|
|
11129
|
-
function ownKeys$
|
|
11130
|
-
function _objectSpread$
|
|
11182
|
+
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; }
|
|
11183
|
+
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; }
|
|
11131
11184
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11132
11185
|
name: "missing-value",
|
|
11133
11186
|
isChecked: props.isChecked,
|
|
11134
11187
|
onChange: props.onChange,
|
|
11135
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11188
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$f({}, messages$7.label))
|
|
11136
11189
|
});
|
|
11137
11190
|
MissingValueField.defaultProps = {
|
|
11138
11191
|
isChecked: false
|
|
11139
11192
|
};
|
|
11140
11193
|
|
|
11141
|
-
function ownKeys$
|
|
11142
|
-
function _objectSpread$
|
|
11194
|
+
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; }
|
|
11195
|
+
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; }
|
|
11143
11196
|
var styles$7 = {
|
|
11144
11197
|
"button": "button-module__button___1OzVf",
|
|
11145
11198
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11173,7 +11226,7 @@ const Button = props => {
|
|
|
11173
11226
|
|
|
11174
11227
|
// Pass only `data-*` props
|
|
11175
11228
|
const dataProps = filterDataAttributes(props);
|
|
11176
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11229
|
+
return jsxRuntime.jsx("button", _objectSpread$e(_objectSpread$e({
|
|
11177
11230
|
onClick: isDisabled ? null : onClick,
|
|
11178
11231
|
type: props.type,
|
|
11179
11232
|
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11188,7 +11241,7 @@ Button.defaultProps = {
|
|
|
11188
11241
|
type: 'button'
|
|
11189
11242
|
};
|
|
11190
11243
|
|
|
11191
|
-
var messages$
|
|
11244
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11192
11245
|
chooseFile: {
|
|
11193
11246
|
id: 'ButtonFileInput.chooseFile',
|
|
11194
11247
|
description: 'The label text of the field for upload local file',
|
|
@@ -11196,8 +11249,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
11196
11249
|
}
|
|
11197
11250
|
});
|
|
11198
11251
|
|
|
11199
|
-
function ownKeys$
|
|
11200
|
-
function _objectSpread$
|
|
11252
|
+
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; }
|
|
11253
|
+
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; }
|
|
11201
11254
|
var styles$6 = {
|
|
11202
11255
|
"button": "file-input-module__button___2KypN",
|
|
11203
11256
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11217,7 +11270,7 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11217
11270
|
});
|
|
11218
11271
|
FileInput.displayName = 'FileInput';
|
|
11219
11272
|
FileInput.defaultProps = {
|
|
11220
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11273
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$d({}, messages$6.chooseFile)),
|
|
11221
11274
|
allowMultiple: false,
|
|
11222
11275
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11223
11276
|
};
|
|
@@ -11264,7 +11317,7 @@ const ScrollToFieldError = () => {
|
|
|
11264
11317
|
return null;
|
|
11265
11318
|
};
|
|
11266
11319
|
|
|
11267
|
-
var messages$
|
|
11320
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11268
11321
|
buttonLabel: {
|
|
11269
11322
|
id: 'SearchInput.buttonLabel',
|
|
11270
11323
|
description: 'Label for "Search" button.',
|
|
@@ -11319,15 +11372,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11319
11372
|
});
|
|
11320
11373
|
},
|
|
11321
11374
|
onReset: props.onReset,
|
|
11322
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11375
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11323
11376
|
isDisabled: props.disabled
|
|
11324
11377
|
})
|
|
11325
11378
|
});
|
|
11326
11379
|
};
|
|
11327
11380
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11328
11381
|
|
|
11329
|
-
function ownKeys$
|
|
11330
|
-
function _objectSpread$
|
|
11382
|
+
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; }
|
|
11383
|
+
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; }
|
|
11331
11384
|
const StoreSelectField = props => {
|
|
11332
11385
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
11333
11386
|
max: props.horizontalConstraint,
|
|
@@ -11341,7 +11394,7 @@ const StoreSelectField = props => {
|
|
|
11341
11394
|
htmlFor: props.id,
|
|
11342
11395
|
hasRequiredIndicator: props.isRequired,
|
|
11343
11396
|
isBold: true
|
|
11344
|
-
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$
|
|
11397
|
+
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$c(_objectSpread$c({
|
|
11345
11398
|
projectKey: props.projectKey,
|
|
11346
11399
|
id: props.id,
|
|
11347
11400
|
name: props.name,
|
|
@@ -11381,8 +11434,8 @@ StoreSelectField.defaultProps = {
|
|
|
11381
11434
|
};
|
|
11382
11435
|
|
|
11383
11436
|
var _templateObject;
|
|
11384
|
-
function ownKeys$
|
|
11385
|
-
function _objectSpread$
|
|
11437
|
+
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; }
|
|
11438
|
+
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; }
|
|
11386
11439
|
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); }; }
|
|
11387
11440
|
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; } }
|
|
11388
11441
|
var styles$3 = {
|
|
@@ -11399,7 +11452,7 @@ const validateRequired = value => {
|
|
|
11399
11452
|
};
|
|
11400
11453
|
const VALIDATOR_REQUIRED = {
|
|
11401
11454
|
name: 'required',
|
|
11402
|
-
message: messages$
|
|
11455
|
+
message: messages$K.required,
|
|
11403
11456
|
permanent: true,
|
|
11404
11457
|
validators: {
|
|
11405
11458
|
change(value) {
|
|
@@ -11413,7 +11466,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11413
11466
|
};
|
|
11414
11467
|
const VALIDATOR_NUMERIC = {
|
|
11415
11468
|
name: 'numeric',
|
|
11416
|
-
message: messages$
|
|
11469
|
+
message: messages$K.numeric,
|
|
11417
11470
|
permanent: false,
|
|
11418
11471
|
validators: {
|
|
11419
11472
|
change: v => {
|
|
@@ -11428,7 +11481,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11428
11481
|
};
|
|
11429
11482
|
const VALIDATOR_INTEGER = {
|
|
11430
11483
|
name: 'integer',
|
|
11431
|
-
message: messages$
|
|
11484
|
+
message: messages$K.integer,
|
|
11432
11485
|
permanent: false,
|
|
11433
11486
|
validators: {
|
|
11434
11487
|
change: v => {
|
|
@@ -11443,7 +11496,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11443
11496
|
};
|
|
11444
11497
|
({
|
|
11445
11498
|
name: 'email',
|
|
11446
|
-
message: messages$
|
|
11499
|
+
message: messages$K.email,
|
|
11447
11500
|
permanent: false,
|
|
11448
11501
|
validators: {
|
|
11449
11502
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11532,7 +11585,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11532
11585
|
* so it must be an invalid numeric value
|
|
11533
11586
|
*/
|
|
11534
11587
|
_this.handleInvalid = () => {
|
|
11535
|
-
const nextValidStatus = _objectSpread$
|
|
11588
|
+
const nextValidStatus = _objectSpread$b({}, _this.state.validStatus);
|
|
11536
11589
|
if (has__default["default"](nextValidStatus, 'numeric')) {
|
|
11537
11590
|
nextValidStatus.numeric = false;
|
|
11538
11591
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11566,10 +11619,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11566
11619
|
process.env.NODE_ENV !== "production" ? warning__default["default"](hasWarned, warningMessage) : void 0;
|
|
11567
11620
|
hasWarned = true;
|
|
11568
11621
|
}
|
|
11569
|
-
// eslint-disable-next-line camelcase
|
|
11570
11622
|
}, {
|
|
11571
|
-
key: "
|
|
11572
|
-
value: function
|
|
11623
|
+
key: "componentDidUpdate",
|
|
11624
|
+
value: function componentDidUpdate() {
|
|
11625
|
+
const nextProps = this.props;
|
|
11573
11626
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11574
11627
|
this.resetValidity();
|
|
11575
11628
|
this.handleChange(nextProps.value, {
|
|
@@ -11584,7 +11637,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11584
11637
|
if (prev) return this.state.validStatus[v.name];
|
|
11585
11638
|
return prev;
|
|
11586
11639
|
}, true);
|
|
11587
|
-
const componentProps = _objectSpread$
|
|
11640
|
+
const componentProps = _objectSpread$b(_objectSpread$b({}, this.props), {}, {
|
|
11588
11641
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11589
11642
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11590
11643
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11601,7 +11654,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11601
11654
|
components: {
|
|
11602
11655
|
WrapperComponent: ToolTipWrapperComponent
|
|
11603
11656
|
},
|
|
11604
|
-
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$
|
|
11657
|
+
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$b({}, componentProps))
|
|
11605
11658
|
})
|
|
11606
11659
|
});
|
|
11607
11660
|
}
|
|
@@ -11656,7 +11709,7 @@ function simpleInput(type) {
|
|
|
11656
11709
|
}, _class;
|
|
11657
11710
|
}
|
|
11658
11711
|
|
|
11659
|
-
var messages$
|
|
11712
|
+
var messages$4 = reactIntl.defineMessages({
|
|
11660
11713
|
customFieldsError: {
|
|
11661
11714
|
id: 'CustomFieldsError.Error',
|
|
11662
11715
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11664,14 +11717,14 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
11664
11717
|
}
|
|
11665
11718
|
});
|
|
11666
11719
|
|
|
11667
|
-
function ownKeys$
|
|
11668
|
-
function _objectSpread$
|
|
11720
|
+
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; }
|
|
11721
|
+
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; }
|
|
11669
11722
|
const CustomFieldsErrorTextNotification = props => {
|
|
11670
11723
|
var _context;
|
|
11671
11724
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
11672
11725
|
scale: "s",
|
|
11673
11726
|
children: [jsxRuntime.jsx(uiKit.Text.Wrap, {
|
|
11674
|
-
intlMessage: _objectSpread$
|
|
11727
|
+
intlMessage: _objectSpread$a({}, messages$4.customFieldsError)
|
|
11675
11728
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
11676
11729
|
scale: "xs",
|
|
11677
11730
|
children: _mapInstanceProperty__default["default"](_context = props.formErrors).call(_context, formError => jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -11683,7 +11736,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11683
11736
|
};
|
|
11684
11737
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11685
11738
|
|
|
11686
|
-
const messages$
|
|
11739
|
+
const messages$3 = reactIntl.defineMessages({
|
|
11687
11740
|
from: {
|
|
11688
11741
|
id: 'LabelRange.from',
|
|
11689
11742
|
description: 'The label for "from" range',
|
|
@@ -11696,8 +11749,8 @@ const messages$2 = reactIntl.defineMessages({
|
|
|
11696
11749
|
}
|
|
11697
11750
|
});
|
|
11698
11751
|
|
|
11699
|
-
function ownKeys$
|
|
11700
|
-
function _objectSpread$
|
|
11752
|
+
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; }
|
|
11753
|
+
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; }
|
|
11701
11754
|
var styles$2 = {
|
|
11702
11755
|
"label": "label-range-module__label___3Tb0p"
|
|
11703
11756
|
};
|
|
@@ -11705,12 +11758,12 @@ const LabelRange = _ref => {
|
|
|
11705
11758
|
let type = _ref.type;
|
|
11706
11759
|
return jsxRuntime.jsx("label", {
|
|
11707
11760
|
className: styles$2.label,
|
|
11708
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11761
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$9({}, messages$3[type]))
|
|
11709
11762
|
});
|
|
11710
11763
|
};
|
|
11711
11764
|
LabelRange.displayName = 'LabelRange';
|
|
11712
11765
|
|
|
11713
|
-
var messages$
|
|
11766
|
+
var messages$2 = reactIntl.defineMessages({
|
|
11714
11767
|
filterWholeInput: {
|
|
11715
11768
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11716
11769
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11723,8 +11776,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
11723
11776
|
}
|
|
11724
11777
|
});
|
|
11725
11778
|
|
|
11726
|
-
function ownKeys$
|
|
11727
|
-
function _objectSpread$
|
|
11779
|
+
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; }
|
|
11780
|
+
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; }
|
|
11728
11781
|
var styles$1 = {
|
|
11729
11782
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11730
11783
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11748,7 +11801,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11748
11801
|
}),
|
|
11749
11802
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11750
11803
|
truncate: true,
|
|
11751
|
-
intlMessage: _objectSpread$
|
|
11804
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterWholeInput), {}, {
|
|
11752
11805
|
values: {
|
|
11753
11806
|
values: "\"".concat(props.value, "\"")
|
|
11754
11807
|
}
|
|
@@ -11761,7 +11814,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11761
11814
|
}),
|
|
11762
11815
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11763
11816
|
truncate: true,
|
|
11764
|
-
intlMessage: _objectSpread$
|
|
11817
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages$2.filterSeparateValues), {}, {
|
|
11765
11818
|
values: {
|
|
11766
11819
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11767
11820
|
}
|
|
@@ -11872,8 +11925,8 @@ const MultiValueSearchInput = props => {
|
|
|
11872
11925
|
};
|
|
11873
11926
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11874
11927
|
|
|
11875
|
-
function ownKeys$
|
|
11876
|
-
function _objectSpread$
|
|
11928
|
+
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; }
|
|
11929
|
+
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; }
|
|
11877
11930
|
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); }; }
|
|
11878
11931
|
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; } }
|
|
11879
11932
|
var styles = {
|
|
@@ -11895,7 +11948,9 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11895
11948
|
args[_key] = arguments[_key];
|
|
11896
11949
|
}
|
|
11897
11950
|
_this = _super.call(this, ...args);
|
|
11898
|
-
_this.
|
|
11951
|
+
_this.state = {
|
|
11952
|
+
parsedValue: _this.props.value
|
|
11953
|
+
};
|
|
11899
11954
|
_this.setValue = value => {
|
|
11900
11955
|
if (!isValidValue(value)) return;
|
|
11901
11956
|
const newValue = !isUndefined__default["default"](value) ? _this.props.formatNumber(value) : undefined;
|
|
@@ -11908,8 +11963,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11908
11963
|
_this.handleChange = event => {
|
|
11909
11964
|
const value = event.target.rawValue;
|
|
11910
11965
|
const parsedNumber = _this.props.parseNumber(value);
|
|
11911
|
-
if (_this.parsedValue === parsedNumber) return;
|
|
11912
|
-
_this.
|
|
11966
|
+
if (_this.state.parsedValue === parsedNumber) return;
|
|
11967
|
+
_this.setState({
|
|
11968
|
+
parsedValue: parsedNumber
|
|
11969
|
+
});
|
|
11913
11970
|
_this.props.onChangeValue(parsedNumber);
|
|
11914
11971
|
if (!isNumberish(value) && _this.props.onInvalidValue) _this.props.onInvalidValue(value);
|
|
11915
11972
|
};
|
|
@@ -11923,12 +11980,10 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11923
11980
|
return _this;
|
|
11924
11981
|
}
|
|
11925
11982
|
_createClass(NumericFormatInput, [{
|
|
11926
|
-
key: "
|
|
11927
|
-
value:
|
|
11928
|
-
|
|
11929
|
-
|
|
11930
|
-
if (this.props.value !== nextProps.value && nextProps.value !== this.parsedValue) {
|
|
11931
|
-
this.setValue(nextProps.value);
|
|
11983
|
+
key: "componentDidUpdate",
|
|
11984
|
+
value: function componentDidUpdate(prevProps) {
|
|
11985
|
+
if (this.props.value !== prevProps.value && this.props.value !== this.state.parsedValue) {
|
|
11986
|
+
this.setValue(this.props.value);
|
|
11932
11987
|
}
|
|
11933
11988
|
}
|
|
11934
11989
|
}, {
|
|
@@ -11936,7 +11991,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11936
11991
|
value: function render() {
|
|
11937
11992
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11938
11993
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11939
|
-
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$
|
|
11994
|
+
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$7({
|
|
11940
11995
|
placeholder: this.props.placeholder,
|
|
11941
11996
|
htmlRef: this.registerInputRef,
|
|
11942
11997
|
options: {
|
|
@@ -12232,8 +12287,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12232
12287
|
}
|
|
12233
12288
|
};
|
|
12234
12289
|
|
|
12235
|
-
function ownKeys$
|
|
12236
|
-
function _objectSpread$
|
|
12290
|
+
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; }
|
|
12291
|
+
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; }
|
|
12237
12292
|
/**
|
|
12238
12293
|
* Creates reducer
|
|
12239
12294
|
* @param {Object} initialState
|
|
@@ -12249,13 +12304,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12249
12304
|
|
|
12250
12305
|
// In case reducer ignored action, avoid creating new object
|
|
12251
12306
|
const newSubstate = reduce(newState, action);
|
|
12252
|
-
if (newSubstate) return _objectSpread$
|
|
12307
|
+
if (newSubstate) return _objectSpread$6(_objectSpread$6({}, newState), newSubstate);
|
|
12253
12308
|
return newState;
|
|
12254
12309
|
};
|
|
12255
12310
|
}
|
|
12256
12311
|
|
|
12257
|
-
function ownKeys$
|
|
12258
|
-
function _objectSpread$
|
|
12312
|
+
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; }
|
|
12313
|
+
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; }
|
|
12259
12314
|
function updateStatusInList(mergeData) {
|
|
12260
12315
|
return (state, _ref) => {
|
|
12261
12316
|
let payload = _ref.payload;
|
|
@@ -12264,15 +12319,15 @@ function updateStatusInList(mergeData) {
|
|
|
12264
12319
|
results[index] = mergeData(payload, results[index]);
|
|
12265
12320
|
results[index].checked = false;
|
|
12266
12321
|
return {
|
|
12267
|
-
currentQueryResult: _objectSpread$
|
|
12322
|
+
currentQueryResult: _objectSpread$5(_objectSpread$5({}, state.currentQueryResult), {}, {
|
|
12268
12323
|
results
|
|
12269
12324
|
})
|
|
12270
12325
|
};
|
|
12271
12326
|
};
|
|
12272
12327
|
}
|
|
12273
12328
|
|
|
12274
|
-
function ownKeys$
|
|
12275
|
-
function _objectSpread$
|
|
12329
|
+
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; }
|
|
12330
|
+
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; }
|
|
12276
12331
|
const identity = value => value;
|
|
12277
12332
|
function createResourceReducer(options) {
|
|
12278
12333
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12282,7 +12337,7 @@ function createResourceReducer(options) {
|
|
|
12282
12337
|
_options$initialState = options.initialState,
|
|
12283
12338
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12284
12339
|
const mergeData = options.mergeData || identity;
|
|
12285
|
-
const initialState = _objectSpread$
|
|
12340
|
+
const initialState = _objectSpread$4({
|
|
12286
12341
|
currentQueryResult: {
|
|
12287
12342
|
count: 0,
|
|
12288
12343
|
offset: 0,
|
|
@@ -12302,7 +12357,7 @@ function createResourceReducer(options) {
|
|
|
12302
12357
|
let payload = _ref.payload;
|
|
12303
12358
|
const results = state.currentQueryResult.results;
|
|
12304
12359
|
return {
|
|
12305
|
-
currentQueryResult: _objectSpread$
|
|
12360
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12306
12361
|
results: _filterInstanceProperty__default["default"](results).call(results, _ref2 => {
|
|
12307
12362
|
let id = _ref2.id;
|
|
12308
12363
|
return id !== payload.id;
|
|
@@ -12380,17 +12435,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12380
12435
|
}
|
|
12381
12436
|
|
|
12382
12437
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12383
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12438
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12384
12439
|
return null;
|
|
12385
12440
|
};
|
|
12386
12441
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12387
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12442
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12388
12443
|
return null;
|
|
12389
12444
|
};
|
|
12390
12445
|
|
|
12391
12446
|
// eslint-disable-next-line import/prefer-default-export
|
|
12392
12447
|
const validateText = (text, intl) => {
|
|
12393
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12448
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12394
12449
|
return null;
|
|
12395
12450
|
};
|
|
12396
12451
|
|
|
@@ -12477,7 +12532,7 @@ const safelyAddFallback = function (string) {
|
|
|
12477
12532
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12478
12533
|
};
|
|
12479
12534
|
|
|
12480
|
-
var messages = reactIntl.defineMessages({
|
|
12535
|
+
var messages$1 = reactIntl.defineMessages({
|
|
12481
12536
|
booleanAttributeTrue: {
|
|
12482
12537
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12483
12538
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12670,7 +12725,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12670
12725
|
case 'boolean':
|
|
12671
12726
|
{
|
|
12672
12727
|
if (isNil__default["default"](value)) return constants.NO_VALUE_FALLBACK;
|
|
12673
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12728
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12674
12729
|
}
|
|
12675
12730
|
case 'reference':
|
|
12676
12731
|
return value.id || constants.NO_VALUE_FALLBACK;
|
|
@@ -12806,8 +12861,8 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
|
|
|
12806
12861
|
} else {
|
|
12807
12862
|
var _context3;
|
|
12808
12863
|
const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](timeZones)).call(_context3, timeZoneId => {
|
|
12809
|
-
var _timeZones$timeZoneId
|
|
12810
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12864
|
+
var _timeZones$timeZoneId;
|
|
12865
|
+
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);
|
|
12811
12866
|
});
|
|
12812
12867
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12813
12868
|
return fallbackTimeZoneId.toString();
|
|
@@ -12823,8 +12878,8 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
12823
12878
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12824
12879
|
});
|
|
12825
12880
|
|
|
12826
|
-
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; }
|
|
12827
|
-
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; }
|
|
12881
|
+
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; }
|
|
12882
|
+
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; }
|
|
12828
12883
|
function withPendingRequests() {
|
|
12829
12884
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12830
12885
|
return Component => {
|
|
@@ -12833,13 +12888,280 @@ function withPendingRequests() {
|
|
|
12833
12888
|
const pendingProp = {
|
|
12834
12889
|
[propName]: pendingRequests
|
|
12835
12890
|
};
|
|
12836
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12891
|
+
return jsxRuntime.jsx(Component, _objectSpread$3(_objectSpread$3({}, props), pendingProp));
|
|
12837
12892
|
};
|
|
12838
12893
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12839
12894
|
return WrappedComponent;
|
|
12840
12895
|
};
|
|
12841
12896
|
}
|
|
12842
12897
|
|
|
12898
|
+
var messages = reactIntl.defineMessages({
|
|
12899
|
+
noCustomFields: {
|
|
12900
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12901
|
+
description: 'The label when there are no custom fields defined',
|
|
12902
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12903
|
+
},
|
|
12904
|
+
noCustomType: {
|
|
12905
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12906
|
+
description: 'The label when there is no custom type selected',
|
|
12907
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12908
|
+
},
|
|
12909
|
+
noTypes: {
|
|
12910
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12911
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12912
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12913
|
+
},
|
|
12914
|
+
title: {
|
|
12915
|
+
id: 'CustomTypesSubform.title',
|
|
12916
|
+
description: 'Fallback title for the subform',
|
|
12917
|
+
defaultMessage: 'Custom fields'
|
|
12918
|
+
},
|
|
12919
|
+
typesPlaceholder: {
|
|
12920
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12921
|
+
description: 'The placeholder for the types',
|
|
12922
|
+
defaultMessage: 'Select...'
|
|
12923
|
+
}
|
|
12924
|
+
});
|
|
12925
|
+
|
|
12926
|
+
const FIELD_NAME = 'custom';
|
|
12927
|
+
|
|
12928
|
+
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; }
|
|
12929
|
+
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; }
|
|
12930
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12931
|
+
return typeDefinitions.length > 0;
|
|
12932
|
+
};
|
|
12933
|
+
const typeDefinitionSelected = formValues => {
|
|
12934
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12935
|
+
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);
|
|
12936
|
+
};
|
|
12937
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12938
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12939
|
+
};
|
|
12940
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12941
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12942
|
+
isReadOnly = _ref.isReadOnly;
|
|
12943
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12944
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12945
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12946
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noTypes));
|
|
12947
|
+
}
|
|
12948
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12949
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomType));
|
|
12950
|
+
}
|
|
12951
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12952
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.noCustomFields));
|
|
12953
|
+
}
|
|
12954
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12955
|
+
max: "scale",
|
|
12956
|
+
children: jsxRuntime.jsx(CustomFields, {
|
|
12957
|
+
isReadOnly: isReadOnly,
|
|
12958
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12959
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12960
|
+
})
|
|
12961
|
+
});
|
|
12962
|
+
};
|
|
12963
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12964
|
+
|
|
12965
|
+
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; }
|
|
12966
|
+
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; }
|
|
12967
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12968
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12969
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12970
|
+
value: typeDefinition.type.key,
|
|
12971
|
+
label: l10n.formatLocalizedString(typeDefinition.type, {
|
|
12972
|
+
key: 'name',
|
|
12973
|
+
locale: language,
|
|
12974
|
+
fallbackOrder: languages
|
|
12975
|
+
})
|
|
12976
|
+
}));
|
|
12977
|
+
};
|
|
12978
|
+
|
|
12979
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12980
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12981
|
+
return {
|
|
12982
|
+
type: {
|
|
12983
|
+
id: selectedTypeDefinition.type.id,
|
|
12984
|
+
obj: {
|
|
12985
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12986
|
+
key: selectedTypeDefinition.type.key
|
|
12987
|
+
}
|
|
12988
|
+
},
|
|
12989
|
+
fields: {}
|
|
12990
|
+
};
|
|
12991
|
+
};
|
|
12992
|
+
const CustomTypeSubform = _ref => {
|
|
12993
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12994
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12995
|
+
isReadOnly = _ref.isReadOnly,
|
|
12996
|
+
isCondensed = _ref.isCondensed;
|
|
12997
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12998
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12999
|
+
setFieldValue = _useFormikContext.setFieldValue,
|
|
13000
|
+
validateForm = _useFormikContext.validateForm;
|
|
13001
|
+
const _useIntl = reactIntl.useIntl(),
|
|
13002
|
+
formatMessage = _useIntl.formatMessage;
|
|
13003
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
13004
|
+
language: applicationContext.dataLocale,
|
|
13005
|
+
languages: applicationContext.project.languages
|
|
13006
|
+
})),
|
|
13007
|
+
language = _useApplicationContex.language,
|
|
13008
|
+
languages = _useApplicationContex.languages;
|
|
13009
|
+
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
13010
|
+
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
13011
|
+
if (selectedTypeDefinition) {
|
|
13012
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
13013
|
+
setFieldValue(FIELD_NAME, nextCustom).then(() => {
|
|
13014
|
+
validateForm();
|
|
13015
|
+
});
|
|
13016
|
+
} else {
|
|
13017
|
+
// if the dropdown selector is cleared, remove the `custom` field from the form state entirely
|
|
13018
|
+
setFieldValue(FIELD_NAME, undefined).then(() => {
|
|
13019
|
+
validateForm();
|
|
13020
|
+
});
|
|
13021
|
+
}
|
|
13022
|
+
}, [typeDefinitions, setFieldValue, validateForm]);
|
|
13023
|
+
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
13024
|
+
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
13025
|
+
isCondensed: isCondensed,
|
|
13026
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.title))
|
|
13027
|
+
}),
|
|
13028
|
+
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
13029
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0IH0gZnJvbSAnZm9ybWlrJztcbmltcG9ydCB7IEZvcm1hdHRlZE1lc3NhZ2UsIHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnO1xuaW1wb3J0IHsgZm9ybWF0TG9jYWxpemVkU3RyaW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvbDEwbic7XG5pbXBvcnQge1xuICBDb2xsYXBzaWJsZVBhbmVsLFxuICBTZWxlY3RJbnB1dCxcbiAgZGVzaWduVG9rZW5zLFxufSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnO1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnO1xuaW1wb3J0IEN1c3RvbUZpZWxkc0lucHV0V3JhcHBlciBmcm9tICcuL2N1c3RvbS1maWVsZHMtaW5wdXQtd3JhcHBlcic7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyBGSUVMRF9OQU1FIH0gZnJvbSAnLi9jb25zdGFudHMnO1xuXG4vLyBDcmVhdGVzIGRyb3Bkb3duIG9wdGlvbnNcbmV4cG9ydCBjb25zdCBtYXBUeXBlRGVmaW5pdGlvbnNUb09wdGlvbnMgPSAoXG4gIHR5cGVEZWZpbml0aW9ucyxcbiAgbGFuZ3VhZ2UsXG4gIGxhbmd1YWdlcyxcbiAgc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbklkXG4pID0+IHtcbiAgcmV0dXJuIHR5cGVEZWZpbml0aW9ucy5tYXAoKHR5cGVEZWZpbml0aW9uKSA9PiAoe1xuICAgIGlzRGlzYWJsZWQ6XG4gICAgICBzZWxlY3RlZFR5cGVEZWZpbml0aW9uSWQgJiZcbiAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25JZCA9PT0gdHlwZURlZmluaXRpb24udHlwZS5pZCxcbiAgICB2YWx1ZTogdHlwZURlZmluaXRpb24udHlwZS5rZXksXG4gICAgbGFiZWw6IGZvcm1hdExvY2FsaXplZFN0cmluZyh0eXBlRGVmaW5pdGlvbi50eXBlLCB7XG4gICAgICBrZXk6ICduYW1lJyxcbiAgICAgIGxvY2FsZTogbGFuZ3VhZ2UsXG4gICAgICBmYWxsYmFja09yZGVyOiBsYW5ndWFnZXMsXG4gICAgfSksXG4gIH0pKTtcbn07XG5cbi8vIFVzZWQgdG8gZ2VuZXJhdGUgZm9ybSBzdGF0ZSB3aGVuIHRoZSB1c2VyIHNlbGVjdHMgYSB0eXBlIGRlZmluaXRpb24gZnJvbSB0aGUgZHJvcGRvd25cbmNvbnN0IGNyZWF0ZUZvcm1TdGF0ZUZyb21UeXBlRGVmaW5pdGlvbiA9IChzZWxlY3RlZFR5cGVEZWZpbml0aW9uKSA9PiB7XG4gIHJldHVybiB7XG4gICAgdHlwZToge1xuICAgICAgaWQ6IHNlbGVjdGVkVHlwZURlZmluaXRpb24udHlwZS5pZCxcbiAgICAgIG9iajoge1xuICAgICAgICBmaWVsZERlZmluaXRpb25zOiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUuZmllbGREZWZpbml0aW9ucyxcbiAgICAgICAga2V5OiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUua2V5LFxuICAgICAgfSxcbiAgICB9LFxuICAgIGZpZWxkczoge30sXG4gIH07XG59O1xuXG5jb25zdCBDdXN0b21UeXBlU3ViZm9ybSA9ICh7IHR5cGVEZWZpbml0aW9ucywgaXNSZWFkT25seSwgaXNDb25kZW5zZWQgfSkgPT4ge1xuICBjb25zdCB7XG4gICAgdmFsdWVzOiBmb3JtVmFsdWVzLFxuICAgIHNldEZpZWxkVmFsdWUsXG4gICAgdmFsaWRhdGVGb3JtLFxuICB9ID0gdXNlRm9ybWlrQ29udGV4dCgpO1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgeyBsYW5ndWFnZSwgbGFuZ3VhZ2VzIH0gPSB1c2VBcHBsaWNhdGlvbkNvbnRleHQoXG4gICAgKGFwcGxpY2F0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICAgIGxhbmd1YWdlczogYXBwbGljYXRpb25Db250ZXh0LnByb2plY3QubGFuZ3VhZ2VzLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgaGFuZGxlVHlwZURlZmluaXRpb25TZWxlY3QgPSB1c2VDYWxsYmFjayhcbiAgICAoZXZlbnQpID0+IHtcbiAgICAgIGNvbnN0IHNlbGVjdGVkVHlwZURlZmluaXRpb24gPSB0eXBlRGVmaW5pdGlvbnMuZmluZChcbiAgICAgICAgKHR5cGVEZWZpbml0aW9uKSA9PiB0eXBlRGVmaW5pdGlvbi50eXBlLmtleSA9PT0gZXZlbnQudGFyZ2V0LnZhbHVlXG4gICAgICApO1xuXG4gICAgICBpZiAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikge1xuICAgICAgICBjb25zdCBuZXh0Q3VzdG9tID0gY3JlYXRlRm9ybVN0YXRlRnJvbVR5cGVEZWZpbml0aW9uKFxuICAgICAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25cbiAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIG5leHRDdXN0b20pLnRoZW4oKCkgPT4ge1xuICAgICAgICAgIHZhbGlkYXRlRm9ybSgpO1xuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIGlmIHRoZSBkcm9wZG93biBzZWxlY3RvciBpcyBjbGVhcmVkLCByZW1vdmUgdGhlIGBjdXN0b21gIGZpZWxkIGZyb20gdGhlIGZvcm0gc3RhdGUgZW50aXJlbHlcbiAgICAgICAgc2V0RmllbGRWYWx1ZShGSUVMRF9OQU1FLCB1bmRlZmluZWQpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgIHZhbGlkYXRlRm9ybSgpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9LFxuICAgIFt0eXBlRGVmaW5pdGlvbnMsIHNldEZpZWxkVmFsdWUsIHZhbGlkYXRlRm9ybV1cbiAgKTtcblxuICByZXR1cm4gKFxuICAgIDxDb2xsYXBzaWJsZVBhbmVsXG4gICAgICBoZWFkZXI9e1xuICAgICAgICA8Q29sbGFwc2libGVQYW5lbC5IZWFkZXIgaXNDb25kZW5zZWQ9e2lzQ29uZGVuc2VkfT5cbiAgICAgICAgICA8Rm9ybWF0dGVkTWVzc2FnZSB7Li4ubWVzc2FnZXMudGl0bGV9IC8+XG4gICAgICAgIDwvQ29sbGFwc2libGVQYW5lbC5IZWFkZXI+XG4gICAgICB9XG4gICAgICBoZWFkZXJDb250cm9scz17XG4gICAgICAgIHR5cGVEZWZpbml0aW9ucy5sZW5ndGggPiAwICYmIChcbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICAgICAgbWluLXdpZHRoOiAke2Rlc2lnblRva2Vucy5jb25zdHJhaW50MTF9O1xuICAgICAgICAgICAgYH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICA8U2VsZWN0SW5wdXRcbiAgICAgICAgICAgICAgaXNDbGVhcmFibGVcbiAgICAgICAgICAgICAgZGF0YS10ZXN0aWQ9XCJjdXN0b20tdHlwZS1zZWxlY3RcIlxuICAgICAgICAgICAgICBuYW1lPXtgJHtGSUVMRF9OQU1FfS50eXBlLm9iai5rZXlgfVxuICAgICAgICAgICAgICBvcHRpb25zPXttYXBUeXBlRGVmaW5pdGlvbnNUb09wdGlvbnMoXG4gICAgICAgICAgICAgICAgdHlwZURlZmluaXRpb25zLFxuICAgICAgICAgICAgICAgIGxhbmd1YWdlLFxuICAgICAgICAgICAgICAgIGxhbmd1YWdlcyxcbiAgICAgICAgICAgICAgICBmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5pZFxuICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICB2YWx1ZT17Zm9ybVZhbHVlc1tGSUVMRF9OQU1FXT8udHlwZT8ub2JqPy5rZXl9XG4gICAgICAgICAgICAgIG9uQ2hhbmdlPXtoYW5kbGVUeXBlRGVmaW5pdGlvblNlbGVjdH1cbiAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9e2Zvcm1hdE1lc3NhZ2UobWVzc2FnZXMudHlwZXNQbGFjZWhvbGRlcil9XG4gICAgICAgICAgICAgIGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9XG4gICAgICAgICAgICAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICApXG4gICAgICB9XG4gICAgICBoZWFkZXJDb250cm9sc0FsaWdubWVudD1cInJpZ2h0XCJcbiAgICA+XG4gICAgICA8Q3VzdG9tRmllbGRzSW5wdXRXcmFwcGVyXG4gICAgICAgIHR5cGVEZWZpbml0aW9ucz17dHlwZURlZmluaXRpb25zfVxuICAgICAgICBpc1JlYWRPbmx5PXtpc1JlYWRPbmx5fVxuICAgICAgLz5cbiAgICA8L0NvbGxhcHNpYmxlUGFuZWw+XG4gICk7XG59O1xuXG5DdXN0b21UeXBlU3ViZm9ybS5kaXNwbGF5TmFtZSA9ICdDdXN0b21UeXBlU3ViZm9ybSc7XG5DdXN0b21UeXBlU3ViZm9ybS5wcm9wVHlwZXMgPSB7XG4gIHR5cGVEZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0NvbmRlbnNlZDogUHJvcFR5cGVzLmJvb2wsXG59O1xuXG5leHBvcnQgZGVmYXVsdCBDdXN0b21UeXBlU3ViZm9ybTtcbiJdfQ== */"),
|
|
13030
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
13031
|
+
isClearable: true,
|
|
13032
|
+
"data-testid": "custom-type-select",
|
|
13033
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
13034
|
+
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),
|
|
13035
|
+
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,
|
|
13036
|
+
onChange: handleTypeDefinitionSelect,
|
|
13037
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
13038
|
+
isReadOnly: isReadOnly
|
|
13039
|
+
})
|
|
13040
|
+
}),
|
|
13041
|
+
headerControlsAlignment: "right",
|
|
13042
|
+
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
13043
|
+
typeDefinitions: typeDefinitions,
|
|
13044
|
+
isReadOnly: isReadOnly
|
|
13045
|
+
})
|
|
13046
|
+
});
|
|
13047
|
+
};
|
|
13048
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
13049
|
+
|
|
13050
|
+
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; }
|
|
13051
|
+
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; }
|
|
13052
|
+
const transformFieldType = fieldDefinition => {
|
|
13053
|
+
var _fieldDefinition$type, _fieldDefinition$type2;
|
|
13054
|
+
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') {
|
|
13055
|
+
var _context;
|
|
13056
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
13057
|
+
elementType: _objectSpread(_objectSpread({}, fieldDefinition.type.elementType), {}, {
|
|
13058
|
+
values: _mapInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context, value => ({
|
|
13059
|
+
key: value.key,
|
|
13060
|
+
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
13061
|
+
}))
|
|
13062
|
+
})
|
|
13063
|
+
});
|
|
13064
|
+
} else if (((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum') {
|
|
13065
|
+
var _context2;
|
|
13066
|
+
return _objectSpread(_objectSpread({}, fieldDefinition.type), {}, {
|
|
13067
|
+
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context2, value => ({
|
|
13068
|
+
key: value.key,
|
|
13069
|
+
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
13070
|
+
}))
|
|
13071
|
+
});
|
|
13072
|
+
} else {
|
|
13073
|
+
return fieldDefinition.type;
|
|
13074
|
+
}
|
|
13075
|
+
};
|
|
13076
|
+
const convertCustomField = resource => {
|
|
13077
|
+
var _context3, _context4;
|
|
13078
|
+
return {
|
|
13079
|
+
type: {
|
|
13080
|
+
typeId: 'type',
|
|
13081
|
+
id: resource.custom.type.id,
|
|
13082
|
+
obj: {
|
|
13083
|
+
key: resource.custom.type.key,
|
|
13084
|
+
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
13085
|
+
fieldDefinitions: _mapInstanceProperty__default["default"](_context3 = resource.custom.type.fieldDefinitions).call(_context3, fieldDefinition => ({
|
|
13086
|
+
name: fieldDefinition.name,
|
|
13087
|
+
required: fieldDefinition.required,
|
|
13088
|
+
inputHint: fieldDefinition.inputHint,
|
|
13089
|
+
type: transformFieldType(fieldDefinition),
|
|
13090
|
+
label: l10n.transformLocalizedFieldToLocalizedString(fieldDefinition.labelAllLocales)
|
|
13091
|
+
}))
|
|
13092
|
+
}
|
|
13093
|
+
},
|
|
13094
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread(_objectSpread({}, fields), {}, {
|
|
13095
|
+
[customField.name]: customField.value
|
|
13096
|
+
}), {})
|
|
13097
|
+
};
|
|
13098
|
+
};
|
|
13099
|
+
const createFormStateFromResource = resource => {
|
|
13100
|
+
// If there are no custom fields on the resource, don't create a form state
|
|
13101
|
+
if (!resource[FIELD_NAME]) {
|
|
13102
|
+
return {
|
|
13103
|
+
[FIELD_NAME]: undefined
|
|
13104
|
+
};
|
|
13105
|
+
}
|
|
13106
|
+
return {
|
|
13107
|
+
[FIELD_NAME]: convertCustomField(resource)
|
|
13108
|
+
};
|
|
13109
|
+
};
|
|
13110
|
+
const createGraphQlDocFromFormState = formState => {
|
|
13111
|
+
var _context5;
|
|
13112
|
+
// Unset the custom type if it's not in the form state
|
|
13113
|
+
if (!formState[FIELD_NAME]) {
|
|
13114
|
+
return {
|
|
13115
|
+
[FIELD_NAME]: {}
|
|
13116
|
+
};
|
|
13117
|
+
}
|
|
13118
|
+
return {
|
|
13119
|
+
[FIELD_NAME]: {
|
|
13120
|
+
type: {
|
|
13121
|
+
id: formState[FIELD_NAME].type.id,
|
|
13122
|
+
typeId: 'type'
|
|
13123
|
+
},
|
|
13124
|
+
fields: _mapInstanceProperty__default["default"](_context5 = _Object$entries__default["default"](formState[FIELD_NAME].fields)).call(_context5, _ref => {
|
|
13125
|
+
let _ref2 = _slicedToArray(_ref, 2),
|
|
13126
|
+
name = _ref2[0],
|
|
13127
|
+
value = _ref2[1];
|
|
13128
|
+
return {
|
|
13129
|
+
name,
|
|
13130
|
+
value: _JSON$stringify__default["default"](value)
|
|
13131
|
+
};
|
|
13132
|
+
})
|
|
13133
|
+
}
|
|
13134
|
+
};
|
|
13135
|
+
};
|
|
13136
|
+
|
|
13137
|
+
const CustomFieldsFormField = _ref => {
|
|
13138
|
+
let resources = _ref.resources,
|
|
13139
|
+
isReadOnly = _ref.isReadOnly,
|
|
13140
|
+
isCondensed = _ref.isCondensed;
|
|
13141
|
+
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13142
|
+
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13143
|
+
resources: resources,
|
|
13144
|
+
projectKey: projectKey,
|
|
13145
|
+
children: _ref2 => {
|
|
13146
|
+
var _context;
|
|
13147
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
13148
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13149
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13150
|
+
if (isLoading) {
|
|
13151
|
+
return jsxRuntime.jsx(uiKit.LoadingSpinner, {});
|
|
13152
|
+
}
|
|
13153
|
+
const typeDefinitions = _mapInstanceProperty__default["default"](_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13154
|
+
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13155
|
+
typeDefinitions: typeDefinitions,
|
|
13156
|
+
isReadOnly: isReadOnly,
|
|
13157
|
+
isCondensed: isCondensed
|
|
13158
|
+
});
|
|
13159
|
+
}
|
|
13160
|
+
});
|
|
13161
|
+
};
|
|
13162
|
+
CustomFieldsFormField.createFormStateFromResource = createFormStateFromResource;
|
|
13163
|
+
CustomFieldsFormField.createGraphQlDocFromFormState = createGraphQlDocFromFormState;
|
|
13164
|
+
|
|
12843
13165
|
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 } } } };
|
|
12844
13166
|
|
|
12845
13167
|
exports.BooleanField = booleanField;
|
|
@@ -12851,9 +13173,10 @@ exports.CenteredLoadingSpinner = CenteredLoadingSpinner;
|
|
|
12851
13173
|
exports.ChannelPickerInput = ChannelPickerInput;
|
|
12852
13174
|
exports.CountriesPicker = CountriesPicker;
|
|
12853
13175
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
12854
|
-
exports.CustomFieldTypeDefinitionsConnector =
|
|
13176
|
+
exports.CustomFieldTypeDefinitionsConnector = CustomFieldTypeDefinitionsConnector$1;
|
|
12855
13177
|
exports.CustomFields = CustomFields;
|
|
12856
13178
|
exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification;
|
|
13179
|
+
exports.CustomFieldsFormField = CustomFieldsFormField;
|
|
12857
13180
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput;
|
|
12858
13181
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
12859
13182
|
exports.Divider = Divider;
|
|
@@ -12886,10 +13209,10 @@ exports.allowedProperties = allowedProperties;
|
|
|
12886
13209
|
exports.and = and;
|
|
12887
13210
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
12888
13211
|
exports.base64ToString = base64ToString;
|
|
12889
|
-
exports.booleanMessages = messages$
|
|
13212
|
+
exports.booleanMessages = messages$8;
|
|
12890
13213
|
exports.buildSearchQuery = buildSearchQuery;
|
|
12891
13214
|
exports.businessRoleConstants = businessRoleConstants;
|
|
12892
|
-
exports.businessRoleMessages = messages$
|
|
13215
|
+
exports.businessRoleMessages = messages$r;
|
|
12893
13216
|
exports.businessRoles = businessRoleKeys;
|
|
12894
13217
|
exports.capitalizeFirst = capitalizeFirst;
|
|
12895
13218
|
exports.clone = clone;
|
|
@@ -12974,7 +13297,7 @@ exports.keepDisplayName = keepDisplayName;
|
|
|
12974
13297
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
12975
13298
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
12976
13299
|
exports.minusify = minusify;
|
|
12977
|
-
exports.missingValueMessages = messages$
|
|
13300
|
+
exports.missingValueMessages = messages$7;
|
|
12978
13301
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
12979
13302
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
12980
13303
|
exports.not = not;
|
|
@@ -12991,7 +13314,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
12991
13314
|
exports.safelyAddFallback = safelyAddFallback;
|
|
12992
13315
|
exports.sanitize = sanitize;
|
|
12993
13316
|
exports.searchCategories = searchCategories;
|
|
12994
|
-
exports.searchInputMessages = messages$
|
|
13317
|
+
exports.searchInputMessages = messages$F;
|
|
12995
13318
|
exports.setDisplayName = setDisplayName;
|
|
12996
13319
|
exports.setToArray = setToArray;
|
|
12997
13320
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13037,7 +13360,7 @@ exports.validateNumber = validateFilter;
|
|
|
13037
13360
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13038
13361
|
exports.validateText = validateText;
|
|
13039
13362
|
exports.validatedInput = validatedInput;
|
|
13040
|
-
exports.validationMessages = messages$
|
|
13363
|
+
exports.validationMessages = messages$K;
|
|
13041
13364
|
exports.withPendingRequests = withPendingRequests;
|
|
13042
13365
|
exports.withProps = withProps;
|
|
13043
13366
|
exports.withRedirectTo = withRedirectTo;
|