@commercetools-frontend/experimental-components 5.4.5 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +692 -373
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +685 -372
- package/dist/commercetools-frontend-experimental-components.esm.js +694 -375
- package/dist/styles.css +202 -183
- package/package.json +21 -22
|
@@ -14,9 +14,9 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
14
14
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
15
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
16
16
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
17
|
-
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
18
17
|
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
19
18
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
19
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
20
20
|
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
21
21
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
22
22
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
@@ -233,6 +233,9 @@ const INTERVALS_IN_SECONDS = {
|
|
|
233
233
|
};
|
|
234
234
|
const EXCLUDING_PRODUCTS = 'excludingProducts';
|
|
235
235
|
|
|
236
|
+
// TODO: apply a more robust solution to overlaying issues
|
|
237
|
+
const Z_INDEX_DROPDOWN = 30000;
|
|
238
|
+
|
|
236
239
|
const formats = {
|
|
237
240
|
en: [',', '.'],
|
|
238
241
|
de: ['.', ','],
|
|
@@ -411,6 +414,11 @@ const messages$K = reactIntl.defineMessages({
|
|
|
411
414
|
id: 'Validation.invalid',
|
|
412
415
|
description: 'An error message to show the id is invalid',
|
|
413
416
|
defaultMessage: 'The resource id is invalid'
|
|
417
|
+
},
|
|
418
|
+
uuid: {
|
|
419
|
+
id: 'Validation.uuid',
|
|
420
|
+
description: 'An error message to show the id is not a valid uuid',
|
|
421
|
+
defaultMessage: 'Invalid ID format. Please enter a valid ID.'
|
|
414
422
|
}
|
|
415
423
|
});
|
|
416
424
|
|
|
@@ -1673,8 +1681,8 @@ const getData = (code, field) => {
|
|
|
1673
1681
|
};
|
|
1674
1682
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1675
1683
|
|
|
1676
|
-
function ownKeys$
|
|
1677
|
-
function _objectSpread$
|
|
1684
|
+
function ownKeys$1q(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1685
|
+
function _objectSpread$1q(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1q(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1q(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1678
1686
|
function formatMoneyRangeValue(value, intl) {
|
|
1679
1687
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
1680
1688
|
if (value.from && value.to) return `${formatMoneyValue(value.from, value.currency, intl)} -
|
|
@@ -1684,7 +1692,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1684
1692
|
return '';
|
|
1685
1693
|
}
|
|
1686
1694
|
function formatMoneyValue(amount, currency, intl) {
|
|
1687
|
-
return formatMoney$2(_objectSpread$
|
|
1695
|
+
return formatMoney$2(_objectSpread$1q({
|
|
1688
1696
|
centAmount: amount,
|
|
1689
1697
|
fractionDigits: getFractionDigit(currency)
|
|
1690
1698
|
}, currency ? {
|
|
@@ -1700,7 +1708,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1700
1708
|
return amount / 10 ** fractionDigits;
|
|
1701
1709
|
}
|
|
1702
1710
|
function formatMoney$2(moneyValue, intl, options) {
|
|
1703
|
-
return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$
|
|
1711
|
+
return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$1q({
|
|
1704
1712
|
style: 'currency',
|
|
1705
1713
|
currency: moneyValue.currencyCode,
|
|
1706
1714
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1947,8 +1955,8 @@ const setDisplayName = nextDisplayName => Component => {
|
|
|
1947
1955
|
|
|
1948
1956
|
const wrapDisplayName = (BaseComponent, hocName) => `${hocName}(${getDisplayName(BaseComponent)})`;
|
|
1949
1957
|
|
|
1950
|
-
function ownKeys$
|
|
1951
|
-
function _objectSpread$
|
|
1958
|
+
function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1959
|
+
function _objectSpread$1p(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1p(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1p(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1952
1960
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1953
1961
|
const WithDataTablePaginationState = props => {
|
|
1954
1962
|
const _usePaginationState = uiKit.usePaginationState({
|
|
@@ -1961,7 +1969,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1961
1969
|
key: initialValues?.tableSorting?.key,
|
|
1962
1970
|
order: initialValues?.tableSorting?.order
|
|
1963
1971
|
});
|
|
1964
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1972
|
+
return jsxRuntime.jsx(Component, _objectSpread$1p(_objectSpread$1p({}, props), {}, {
|
|
1965
1973
|
dataTablePaginationState: {
|
|
1966
1974
|
page,
|
|
1967
1975
|
perPage,
|
|
@@ -1973,8 +1981,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1973
1981
|
return WithDataTablePaginationState;
|
|
1974
1982
|
};
|
|
1975
1983
|
|
|
1976
|
-
function ownKeys$
|
|
1977
|
-
function _objectSpread$
|
|
1984
|
+
function ownKeys$1o(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1985
|
+
function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1978
1986
|
const injectNotifications = function () {
|
|
1979
1987
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1980
1988
|
return Component => {
|
|
@@ -1989,7 +1997,7 @@ const injectNotifications = function () {
|
|
|
1989
1997
|
onActionError,
|
|
1990
1998
|
hideAllPageNotifications
|
|
1991
1999
|
};
|
|
1992
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2000
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1993
2001
|
[propName]: notifications
|
|
1994
2002
|
}));
|
|
1995
2003
|
};
|
|
@@ -1998,22 +2006,22 @@ const injectNotifications = function () {
|
|
|
1998
2006
|
};
|
|
1999
2007
|
};
|
|
2000
2008
|
|
|
2001
|
-
function ownKeys$
|
|
2002
|
-
function _objectSpread$
|
|
2009
|
+
function ownKeys$1n(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2010
|
+
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2003
2011
|
function isPropsMapper(mapProps) {
|
|
2004
2012
|
return typeof mapProps === 'function';
|
|
2005
2013
|
}
|
|
2006
2014
|
const withProps = mapProps => Component => {
|
|
2007
2015
|
const EnhancedWithProps = ownProps => {
|
|
2008
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2009
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2016
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps(ownProps)) : _objectSpread$1n(_objectSpread$1n({}, ownProps), mapProps);
|
|
2017
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n({}, enhancedProps));
|
|
2010
2018
|
};
|
|
2011
2019
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2012
2020
|
return EnhancedWithProps;
|
|
2013
2021
|
};
|
|
2014
2022
|
|
|
2015
|
-
function ownKeys$
|
|
2016
|
-
function _objectSpread$
|
|
2023
|
+
function ownKeys$1m(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2024
|
+
function _objectSpread$1m(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2017
2025
|
const useRedirectEffect = _ref => {
|
|
2018
2026
|
let goTo = _ref.goTo;
|
|
2019
2027
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2033,30 +2041,30 @@ const defaultOptions$5 = {
|
|
|
2033
2041
|
skip: () => false
|
|
2034
2042
|
};
|
|
2035
2043
|
const withRedirectTo = options => Component => {
|
|
2036
|
-
const mergedOptions = _objectSpread$
|
|
2044
|
+
const mergedOptions = _objectSpread$1m(_objectSpread$1m({}, defaultOptions$5), options);
|
|
2037
2045
|
const WithRedirectTo = props => {
|
|
2038
2046
|
if (!mergedOptions.skip(props)) {
|
|
2039
2047
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2040
2048
|
goTo: options.selectGoTo(props)
|
|
2041
2049
|
});
|
|
2042
2050
|
}
|
|
2043
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2051
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, props));
|
|
2044
2052
|
};
|
|
2045
2053
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2046
2054
|
return WithRedirectTo;
|
|
2047
2055
|
};
|
|
2048
2056
|
|
|
2049
|
-
function ownKeys$
|
|
2050
|
-
function _objectSpread$
|
|
2057
|
+
function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2058
|
+
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2051
2059
|
const defaultOptions$4 = {
|
|
2052
2060
|
propName: 'modalState',
|
|
2053
2061
|
isInitiallyOpen: false
|
|
2054
2062
|
};
|
|
2055
2063
|
const injectModalState$1 = options => Component => {
|
|
2056
|
-
const mergedOptions = _objectSpread$
|
|
2064
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$4), options);
|
|
2057
2065
|
const WithModalState = props => {
|
|
2058
2066
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2059
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2067
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l(_objectSpread$1l({}, props), {}, {
|
|
2060
2068
|
[mergedOptions.propName]: modalState
|
|
2061
2069
|
}));
|
|
2062
2070
|
};
|
|
@@ -2064,17 +2072,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2064
2072
|
return WithModalState;
|
|
2065
2073
|
};
|
|
2066
2074
|
|
|
2067
|
-
function ownKeys$
|
|
2068
|
-
function _objectSpread$
|
|
2075
|
+
function ownKeys$1k(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2076
|
+
function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2069
2077
|
const defaultOptions$3 = {
|
|
2070
2078
|
propName: 'toggleState',
|
|
2071
2079
|
isInitiallyOpen: false
|
|
2072
2080
|
};
|
|
2073
2081
|
const injectModalState = options => Component => {
|
|
2074
|
-
const mergedOptions = _objectSpread$
|
|
2082
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$3), options);
|
|
2075
2083
|
const WithToggleState = props => {
|
|
2076
2084
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2077
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2085
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2078
2086
|
[mergedOptions.propName]: toggleState
|
|
2079
2087
|
}));
|
|
2080
2088
|
};
|
|
@@ -2082,8 +2090,8 @@ const injectModalState = options => Component => {
|
|
|
2082
2090
|
return WithToggleState;
|
|
2083
2091
|
};
|
|
2084
2092
|
|
|
2085
|
-
function ownKeys$
|
|
2086
|
-
function _objectSpread$
|
|
2093
|
+
function ownKeys$1j(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2094
|
+
function _objectSpread$1j(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1j(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2087
2095
|
const defaultOptions$2 = {
|
|
2088
2096
|
storageType: 'local',
|
|
2089
2097
|
segregateByUser: true
|
|
@@ -2101,7 +2109,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2101
2109
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2102
2110
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2103
2111
|
var _context;
|
|
2104
|
-
const mergedOptions = _objectSpread$
|
|
2112
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$2), options);
|
|
2105
2113
|
const userId = applicationShellConnectors.useApplicationContext(context => context.user?.id);
|
|
2106
2114
|
const scopedStorageKey = _filterInstanceProperty__default["default"](_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
2107
2115
|
const readFromStorage = React.useCallback(() => {
|
|
@@ -2145,8 +2153,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2145
2153
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2146
2154
|
};
|
|
2147
2155
|
|
|
2148
|
-
function ownKeys$
|
|
2149
|
-
function _objectSpread$
|
|
2156
|
+
function ownKeys$1i(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2157
|
+
function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1i(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2150
2158
|
const defaultOptions$1 = {
|
|
2151
2159
|
propName: 'storage',
|
|
2152
2160
|
storageKey: '',
|
|
@@ -2159,7 +2167,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2159
2167
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2160
2168
|
* argument position does not allow passing specification of option(s).
|
|
2161
2169
|
*/
|
|
2162
|
-
const mergedOptions = _objectSpread$
|
|
2170
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$1), options);
|
|
2163
2171
|
const WithStorage = props => {
|
|
2164
2172
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2165
2173
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2173,7 +2181,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2173
2181
|
readFromStorage
|
|
2174
2182
|
}
|
|
2175
2183
|
};
|
|
2176
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2184
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1i(_objectSpread$1i({}, props), storageProp));
|
|
2177
2185
|
};
|
|
2178
2186
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2179
2187
|
return WithStorage;
|
|
@@ -2217,8 +2225,8 @@ const usePrevious = value => {
|
|
|
2217
2225
|
return ref.current;
|
|
2218
2226
|
};
|
|
2219
2227
|
|
|
2220
|
-
function ownKeys$
|
|
2221
|
-
function _objectSpread$
|
|
2228
|
+
function ownKeys$1h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2229
|
+
function _objectSpread$1h(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1h(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2222
2230
|
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 } } } };
|
|
2223
2231
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2224
2232
|
if (!storesQueryResult) return null;
|
|
@@ -2227,7 +2235,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2227
2235
|
count: storesQueryResult.count,
|
|
2228
2236
|
offset: storesQueryResult.offset,
|
|
2229
2237
|
results: storesQueryResult.results?.map(store => {
|
|
2230
|
-
return _objectSpread$
|
|
2238
|
+
return _objectSpread$1h(_objectSpread$1h({}, store), {}, {
|
|
2231
2239
|
productSelections: store.productSelections?.filter(productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2232
2240
|
});
|
|
2233
2241
|
})
|
|
@@ -2235,7 +2243,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2235
2243
|
};
|
|
2236
2244
|
const createQueryVariables$6 = ownProps => {
|
|
2237
2245
|
var _context;
|
|
2238
|
-
return _objectSpread$
|
|
2246
|
+
return _objectSpread$1h(_objectSpread$1h({
|
|
2239
2247
|
limit: ownProps.limit,
|
|
2240
2248
|
offset: ownProps.offset,
|
|
2241
2249
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2381,8 +2389,8 @@ function useDidFormValidationFail() {
|
|
|
2381
2389
|
return Boolean(didFormValidationFail);
|
|
2382
2390
|
}
|
|
2383
2391
|
|
|
2384
|
-
function ownKeys$
|
|
2385
|
-
function _objectSpread$
|
|
2392
|
+
function ownKeys$1g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2393
|
+
function _objectSpread$1g(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1g(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2386
2394
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2387
2395
|
const defaultOptions = {
|
|
2388
2396
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2410,7 +2418,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2410
2418
|
};
|
|
2411
2419
|
const usePersistedReminder = function () {
|
|
2412
2420
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2413
|
-
const mergedOptions = _objectSpread$
|
|
2421
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions), options);
|
|
2414
2422
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2415
2423
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2416
2424
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2474,8 +2482,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2474
2482
|
}
|
|
2475
2483
|
});
|
|
2476
2484
|
|
|
2477
|
-
function ownKeys$
|
|
2478
|
-
function _objectSpread$
|
|
2485
|
+
function ownKeys$1f(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2486
|
+
function _objectSpread$1f(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2479
2487
|
const LinkToProfile = props => {
|
|
2480
2488
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2481
2489
|
to: "/account/profile",
|
|
@@ -2495,7 +2503,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2495
2503
|
isBold: true,
|
|
2496
2504
|
intlMessage: messages$I.profileUpdated
|
|
2497
2505
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2498
|
-
intlMessage: _objectSpread$
|
|
2506
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$I.addMoreInformation), {}, {
|
|
2499
2507
|
values: {
|
|
2500
2508
|
newline: getNewLine
|
|
2501
2509
|
}
|
|
@@ -2504,7 +2512,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2504
2512
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2505
2513
|
scale: "xs",
|
|
2506
2514
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2507
|
-
intlMessage: _objectSpread$
|
|
2515
|
+
intlMessage: _objectSpread$1f(_objectSpread$1f({}, messages$I.informationAndProfileLink), {}, {
|
|
2508
2516
|
values: {
|
|
2509
2517
|
newline: getNewLine,
|
|
2510
2518
|
link: getLinkToProfile
|
|
@@ -2661,8 +2669,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2661
2669
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2662
2670
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2663
2671
|
|
|
2664
|
-
function ownKeys$
|
|
2665
|
-
function _objectSpread$
|
|
2672
|
+
function ownKeys$1e(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2673
|
+
function _objectSpread$1e(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1e(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2666
2674
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2667
2675
|
const updatedColumnProps = {};
|
|
2668
2676
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2682,14 +2690,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2682
2690
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2683
2691
|
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 => {
|
|
2684
2692
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2685
|
-
return _objectSpread$
|
|
2693
|
+
return _objectSpread$1e(_objectSpread$1e({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2686
2694
|
});
|
|
2687
2695
|
};
|
|
2688
2696
|
const handleCacheUpdate = _ref2 => {
|
|
2689
2697
|
let update = _ref2.update,
|
|
2690
2698
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2691
2699
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2692
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2700
|
+
return updateCachedTableConfiguration(_objectSpread$1e(_objectSpread$1e({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2693
2701
|
};
|
|
2694
2702
|
|
|
2695
2703
|
// Signature:
|
|
@@ -2718,7 +2726,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2718
2726
|
return {
|
|
2719
2727
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2720
2728
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2721
|
-
return _objectSpread$
|
|
2729
|
+
return _objectSpread$1e({
|
|
2722
2730
|
key: visibleColumnKey
|
|
2723
2731
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2724
2732
|
}),
|
|
@@ -2788,14 +2796,14 @@ const handlers$4 = {
|
|
|
2788
2796
|
}
|
|
2789
2797
|
};
|
|
2790
2798
|
|
|
2791
|
-
function ownKeys$
|
|
2792
|
-
function _objectSpread$
|
|
2799
|
+
function ownKeys$1d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2800
|
+
function _objectSpread$1d(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2793
2801
|
|
|
2794
2802
|
// eslint-disable-next-line import/prefer-default-export
|
|
2795
2803
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2796
2804
|
var _context;
|
|
2797
|
-
return productSelections?.results && _objectSpread$
|
|
2798
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2805
|
+
return productSelections?.results && _objectSpread$1d(_objectSpread$1d({}, productSelections), {}, {
|
|
2806
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1d({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2799
2807
|
from: 'nameAllLocales',
|
|
2800
2808
|
to: 'name'
|
|
2801
2809
|
}])))
|
|
@@ -2931,7 +2939,7 @@ var localizedTextTransformer = (localizedString => {
|
|
|
2931
2939
|
return _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](localizedString)).call(_context, locale => `${locale} = "${localizedString[locale]}"`).join(' and ');
|
|
2932
2940
|
});
|
|
2933
2941
|
|
|
2934
|
-
var styles$
|
|
2942
|
+
var styles$j = {
|
|
2935
2943
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
2936
2944
|
};
|
|
2937
2945
|
/**
|
|
@@ -2939,7 +2947,7 @@ var styles$i = {
|
|
|
2939
2947
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
2940
2948
|
*/
|
|
2941
2949
|
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
2942
|
-
className: styles$
|
|
2950
|
+
className: styles$j['loading-container'],
|
|
2943
2951
|
"data-testid": "centered-loading-spinner",
|
|
2944
2952
|
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
2945
2953
|
});
|
|
@@ -2971,11 +2979,12 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2971
2979
|
}
|
|
2972
2980
|
});
|
|
2973
2981
|
|
|
2974
|
-
function ownKeys$
|
|
2975
|
-
function _objectSpread$
|
|
2982
|
+
function ownKeys$1c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2983
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2976
2984
|
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 } } } };
|
|
2977
2985
|
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 } } } };
|
|
2978
2986
|
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 } } } };
|
|
2987
|
+
const getRolesClause = roles => roles && roles.length > 0 ? `roles contains any (${_mapInstanceProperty__default["default"](roles).call(roles, role => `"${role}"`).join(',')})` : undefined;
|
|
2979
2988
|
const ChannelPickerInput = _ref => {
|
|
2980
2989
|
let isClearable = _ref.isClearable,
|
|
2981
2990
|
isDisabled = _ref.isDisabled,
|
|
@@ -2987,16 +2996,20 @@ const ChannelPickerInput = _ref => {
|
|
|
2987
2996
|
hasError = _ref.hasError,
|
|
2988
2997
|
onError = _ref.onError,
|
|
2989
2998
|
placeholder = _ref.placeholder,
|
|
2990
|
-
|
|
2999
|
+
roles = _ref.roles,
|
|
3000
|
+
hasWarning = _ref.hasWarning;
|
|
2991
3001
|
const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
|
|
2992
3002
|
const _useIntl = reactIntl.useIntl(),
|
|
2993
3003
|
formatMessage = _useIntl.formatMessage;
|
|
2994
3004
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
2995
|
-
const variables = React.useMemo(() =>
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3005
|
+
const variables = React.useMemo(() => {
|
|
3006
|
+
const rolesClause = getRolesClause(roles);
|
|
3007
|
+
return _objectSpread$1c({
|
|
3008
|
+
sortByNamePath: `name.${dataLocale}`
|
|
3009
|
+
}, rolesClause && {
|
|
3010
|
+
extraWhere: rolesClause
|
|
3011
|
+
});
|
|
3012
|
+
}, [dataLocale, roles]);
|
|
3000
3013
|
const _useState = React.useState(),
|
|
3001
3014
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3002
3015
|
loadingError = _useState2[0],
|
|
@@ -3079,7 +3092,10 @@ const ChannelPickerInput = _ref => {
|
|
|
3079
3092
|
onBlur: onBlur,
|
|
3080
3093
|
value: currentOption.data,
|
|
3081
3094
|
noOptionsMessage: handleNoOptions,
|
|
3082
|
-
hasError: hasError || isLoadingFailed
|
|
3095
|
+
hasError: hasError || isLoadingFailed,
|
|
3096
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
3097
|
+
menuPortalTarget: document.body,
|
|
3098
|
+
hasWarning: hasWarning
|
|
3083
3099
|
})
|
|
3084
3100
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
3085
3101
|
tone: "negative",
|
|
@@ -3090,14 +3106,25 @@ const ChannelPickerInput = _ref => {
|
|
|
3090
3106
|
};
|
|
3091
3107
|
ChannelPickerInput.displayName = 'ChannelPickerInput';
|
|
3092
3108
|
|
|
3093
|
-
function
|
|
3094
|
-
function
|
|
3109
|
+
function _callSuper$9(_this, derived, args) {
|
|
3110
|
+
function isNativeReflectConstruct() {
|
|
3111
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
3112
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
3113
|
+
if (typeof Proxy === "function") return true;
|
|
3114
|
+
try {
|
|
3115
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
3116
|
+
} catch (e) {
|
|
3117
|
+
return false;
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
derived = _getPrototypeOf(derived);
|
|
3121
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
3122
|
+
}
|
|
3095
3123
|
let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
3096
3124
|
_inherits(FormattedDateTime, _PureComponent);
|
|
3097
|
-
var _super = _createSuper$9(FormattedDateTime);
|
|
3098
3125
|
function FormattedDateTime() {
|
|
3099
3126
|
_classCallCheck(this, FormattedDateTime);
|
|
3100
|
-
return
|
|
3127
|
+
return _callSuper$9(this, FormattedDateTime, arguments);
|
|
3101
3128
|
}
|
|
3102
3129
|
_createClass(FormattedDateTime, [{
|
|
3103
3130
|
key: "render",
|
|
@@ -3120,21 +3147,32 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3120
3147
|
|
|
3121
3148
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3122
3149
|
|
|
3123
|
-
function ownKeys$
|
|
3124
|
-
function _objectSpread$
|
|
3125
|
-
function
|
|
3126
|
-
function
|
|
3150
|
+
function ownKeys$1b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3151
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1b(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3152
|
+
function _callSuper$8(_this, derived, args) {
|
|
3153
|
+
function isNativeReflectConstruct() {
|
|
3154
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
3155
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
3156
|
+
if (typeof Proxy === "function") return true;
|
|
3157
|
+
try {
|
|
3158
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
3159
|
+
} catch (e) {
|
|
3160
|
+
return false;
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
derived = _getPrototypeOf(derived);
|
|
3164
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
3165
|
+
}
|
|
3127
3166
|
const withMouseOverState = BaseComponent => {
|
|
3128
3167
|
let WithMouseOverState = /*#__PURE__*/function (_Component) {
|
|
3129
3168
|
_inherits(WithMouseOverState, _Component);
|
|
3130
|
-
var _super = _createSuper$8(WithMouseOverState);
|
|
3131
3169
|
function WithMouseOverState() {
|
|
3132
3170
|
var _this;
|
|
3133
3171
|
_classCallCheck(this, WithMouseOverState);
|
|
3134
3172
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3135
3173
|
args[_key] = arguments[_key];
|
|
3136
3174
|
}
|
|
3137
|
-
_this =
|
|
3175
|
+
_this = _callSuper$8(this, WithMouseOverState, [...args]);
|
|
3138
3176
|
_this.state = {
|
|
3139
3177
|
isMouseOver: false
|
|
3140
3178
|
};
|
|
@@ -3153,7 +3191,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3153
3191
|
handleMouseOver: this.handleMouseOver,
|
|
3154
3192
|
handleMouseOut: this.handleMouseOut
|
|
3155
3193
|
};
|
|
3156
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3194
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$1b({}, _objectSpread$1b(_objectSpread$1b({}, this.props), injectedProps)));
|
|
3157
3195
|
}
|
|
3158
3196
|
}]);
|
|
3159
3197
|
return WithMouseOverState;
|
|
@@ -3162,11 +3200,23 @@ const withMouseOverState = BaseComponent => {
|
|
|
3162
3200
|
return WithMouseOverState;
|
|
3163
3201
|
};
|
|
3164
3202
|
|
|
3165
|
-
function ownKeys$
|
|
3166
|
-
function _objectSpread$
|
|
3167
|
-
function
|
|
3168
|
-
function
|
|
3169
|
-
|
|
3203
|
+
function ownKeys$1a(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3204
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1a(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3205
|
+
function _callSuper$7(_this, derived, args) {
|
|
3206
|
+
function isNativeReflectConstruct() {
|
|
3207
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
3208
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
3209
|
+
if (typeof Proxy === "function") return true;
|
|
3210
|
+
try {
|
|
3211
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
3212
|
+
} catch (e) {
|
|
3213
|
+
return false;
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
derived = _getPrototypeOf(derived);
|
|
3217
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
3218
|
+
}
|
|
3219
|
+
var styles$i = {
|
|
3170
3220
|
"size": "throttled-field-module__size___324jx",
|
|
3171
3221
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
3172
3222
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -3180,14 +3230,13 @@ var styles$h = {
|
|
|
3180
3230
|
};
|
|
3181
3231
|
let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
3182
3232
|
_inherits(ThrottledField, _PureComponent);
|
|
3183
|
-
var _super = _createSuper$7(ThrottledField);
|
|
3184
3233
|
function ThrottledField() {
|
|
3185
3234
|
var _this;
|
|
3186
3235
|
_classCallCheck(this, ThrottledField);
|
|
3187
3236
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3188
3237
|
args[_key] = arguments[_key];
|
|
3189
3238
|
}
|
|
3190
|
-
_this =
|
|
3239
|
+
_this = _callSuper$7(this, ThrottledField, [...args]);
|
|
3191
3240
|
_this.state = {
|
|
3192
3241
|
draftValue: '',
|
|
3193
3242
|
prevValue: ''
|
|
@@ -3255,7 +3304,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3255
3304
|
}, {
|
|
3256
3305
|
key: "render",
|
|
3257
3306
|
value: function render() {
|
|
3258
|
-
const commonProps = _objectSpread$
|
|
3307
|
+
const commonProps = _objectSpread$1a(_objectSpread$1a({
|
|
3259
3308
|
value: this.state.draftValue,
|
|
3260
3309
|
autoComplete: this.props.autoComplete,
|
|
3261
3310
|
onChange: this.handleChange,
|
|
@@ -3274,23 +3323,23 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3274
3323
|
htmlFor: inputId,
|
|
3275
3324
|
children: this.props.label
|
|
3276
3325
|
})
|
|
3277
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3326
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3278
3327
|
id: inputId,
|
|
3279
|
-
className: classnames__default["default"](styles$
|
|
3280
|
-
[styles$
|
|
3281
|
-
[styles$
|
|
3328
|
+
className: classnames__default["default"](styles$i.textarea, styles$i[`textarea-${this.props.style}`], {
|
|
3329
|
+
[styles$i.invalid]: !this.props.isValid,
|
|
3330
|
+
[styles$i.disabled]: this.props.disabled
|
|
3282
3331
|
}),
|
|
3283
3332
|
rows: 1,
|
|
3284
3333
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3285
3334
|
cacheMeasurements: true
|
|
3286
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3335
|
+
})) : jsxRuntime.jsx("input", _objectSpread$1a(_objectSpread$1a({}, commonProps), {}, {
|
|
3287
3336
|
id: inputId,
|
|
3288
3337
|
ref: this.props.inputRef,
|
|
3289
3338
|
type: this.props.as,
|
|
3290
|
-
className: classnames__default["default"](styles$
|
|
3291
|
-
[styles$
|
|
3292
|
-
[styles$
|
|
3293
|
-
[styles$
|
|
3339
|
+
className: classnames__default["default"](styles$i[`input-${this.props.style}`], {
|
|
3340
|
+
[styles$i.invalid]: !this.props.isValid,
|
|
3341
|
+
[styles$i.disabled]: this.props.disabled,
|
|
3342
|
+
[styles$i.granular]: this.props.isGranular
|
|
3294
3343
|
})
|
|
3295
3344
|
}))]
|
|
3296
3345
|
});
|
|
@@ -3334,9 +3383,21 @@ var messages$F = reactIntl.defineMessages({
|
|
|
3334
3383
|
}
|
|
3335
3384
|
});
|
|
3336
3385
|
|
|
3337
|
-
function
|
|
3338
|
-
function
|
|
3339
|
-
|
|
3386
|
+
function _callSuper$6(_this, derived, args) {
|
|
3387
|
+
function isNativeReflectConstruct() {
|
|
3388
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
3389
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
3390
|
+
if (typeof Proxy === "function") return true;
|
|
3391
|
+
try {
|
|
3392
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
3393
|
+
} catch (e) {
|
|
3394
|
+
return false;
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
derived = _getPrototypeOf(derived);
|
|
3398
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
3399
|
+
}
|
|
3400
|
+
var styles$h = {
|
|
3340
3401
|
"block": "search-input-module__block___1uM-y",
|
|
3341
3402
|
"container": "search-input-module__container___9u6if",
|
|
3342
3403
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -3353,14 +3414,13 @@ var styles$g = {
|
|
|
3353
3414
|
};
|
|
3354
3415
|
let SearchInput = /*#__PURE__*/function (_Component) {
|
|
3355
3416
|
_inherits(SearchInput, _Component);
|
|
3356
|
-
var _super = _createSuper$6(SearchInput);
|
|
3357
3417
|
function SearchInput() {
|
|
3358
3418
|
var _this;
|
|
3359
3419
|
_classCallCheck(this, SearchInput);
|
|
3360
3420
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3361
3421
|
args[_key] = arguments[_key];
|
|
3362
3422
|
}
|
|
3363
|
-
_this =
|
|
3423
|
+
_this = _callSuper$6(this, SearchInput, [...args]);
|
|
3364
3424
|
_this.state = {
|
|
3365
3425
|
initialValue: _this.props.initialValue,
|
|
3366
3426
|
text: _this.props.initialValue || ''
|
|
@@ -3412,14 +3472,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3412
3472
|
key: "render",
|
|
3413
3473
|
value: function render() {
|
|
3414
3474
|
return jsxRuntime.jsx("div", {
|
|
3415
|
-
className: classnames__default["default"](this.props.blockClassName, styles$
|
|
3475
|
+
className: classnames__default["default"](this.props.blockClassName, styles$h.block),
|
|
3416
3476
|
children: jsxRuntime.jsxs("div", {
|
|
3417
|
-
className: classnames__default["default"](this.props.containerClassName, styles$
|
|
3477
|
+
className: classnames__default["default"](this.props.containerClassName, styles$h.container),
|
|
3418
3478
|
children: [jsxRuntime.jsx("div", {
|
|
3419
|
-
className: classnames__default["default"](styles$
|
|
3420
|
-
[styles$
|
|
3421
|
-
[styles$
|
|
3422
|
-
[styles$
|
|
3479
|
+
className: classnames__default["default"](styles$h['input-container'], {
|
|
3480
|
+
[styles$h['input-container-hoverable']]: !this.props.disabled,
|
|
3481
|
+
[styles$h['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
3482
|
+
[styles$h['input-container-granular']]: this.props.isGranular
|
|
3423
3483
|
}),
|
|
3424
3484
|
children: jsxRuntime.jsx(ThrottledField, {
|
|
3425
3485
|
style: "primary",
|
|
@@ -3437,8 +3497,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3437
3497
|
isGranular: this.props.isGranular
|
|
3438
3498
|
})
|
|
3439
3499
|
}), this.state.text && jsxRuntime.jsx(uiKit.SecondaryIconButton, {
|
|
3440
|
-
className: classnames__default["default"](styles$
|
|
3441
|
-
[styles$
|
|
3500
|
+
className: classnames__default["default"](styles$h['clear-icon-container'], {
|
|
3501
|
+
[styles$h['clear-icon-container-granular']]: this.props.isGranular
|
|
3442
3502
|
}),
|
|
3443
3503
|
icon: jsxRuntime.jsx(uiKit.CloseIcon, {}),
|
|
3444
3504
|
size: "medium",
|
|
@@ -3446,9 +3506,9 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3446
3506
|
onClick: this.handleClear
|
|
3447
3507
|
}), jsxRuntime.jsx("div", {
|
|
3448
3508
|
"data-testid": "search-button",
|
|
3449
|
-
className: classnames__default["default"](styles$
|
|
3450
|
-
[styles$
|
|
3451
|
-
[styles$
|
|
3509
|
+
className: classnames__default["default"](styles$h['search-icon-container'], {
|
|
3510
|
+
[styles$h['search-icon-container-hoverable']]: !this.props.disabled,
|
|
3511
|
+
[styles$h['search-icon-container-granular']]: this.props.isGranular
|
|
3452
3512
|
}),
|
|
3453
3513
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
3454
3514
|
label: "search-button",
|
|
@@ -3642,8 +3702,8 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3642
3702
|
}
|
|
3643
3703
|
});
|
|
3644
3704
|
|
|
3645
|
-
function ownKeys$
|
|
3646
|
-
function _objectSpread$
|
|
3705
|
+
function ownKeys$19(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3706
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3647
3707
|
const getBottomOption = formatMessage => ({
|
|
3648
3708
|
options: [{
|
|
3649
3709
|
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
@@ -3654,7 +3714,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3654
3714
|
const Option$2 = props => {
|
|
3655
3715
|
const _useIntl = reactIntl.useIntl(),
|
|
3656
3716
|
formatMessage = _useIntl.formatMessage;
|
|
3657
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3717
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$19(_objectSpread$19({}, props), {}, {
|
|
3658
3718
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3659
3719
|
tone: "secondary",
|
|
3660
3720
|
children: formatMessage(props.data.label)
|
|
@@ -3671,8 +3731,8 @@ const Option$2 = props => {
|
|
|
3671
3731
|
};
|
|
3672
3732
|
Option$2.displayName = 'Option';
|
|
3673
3733
|
|
|
3674
|
-
function ownKeys$
|
|
3675
|
-
function _objectSpread$
|
|
3734
|
+
function ownKeys$18(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3735
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$18(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3676
3736
|
const useHandlers = onChange => {
|
|
3677
3737
|
const _useState = React.useState(),
|
|
3678
3738
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3682,8 +3742,8 @@ const useHandlers = onChange => {
|
|
|
3682
3742
|
setInputValue(changedValue);
|
|
3683
3743
|
}, []);
|
|
3684
3744
|
const handleChange = useEventCallback(event => {
|
|
3685
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3686
|
-
target: _objectSpread$
|
|
3745
|
+
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3746
|
+
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3687
3747
|
value: event.target.value?.value
|
|
3688
3748
|
})
|
|
3689
3749
|
});
|
|
@@ -3692,9 +3752,9 @@ const useHandlers = onChange => {
|
|
|
3692
3752
|
return [handleInputChange, handleChange];
|
|
3693
3753
|
};
|
|
3694
3754
|
|
|
3695
|
-
const _excluded$
|
|
3696
|
-
function ownKeys$
|
|
3697
|
-
function _objectSpread$
|
|
3755
|
+
const _excluded$3 = ["extraWhere"];
|
|
3756
|
+
function ownKeys$17(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3757
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$17(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3698
3758
|
const constructPrefixSearchPredicate = function () {
|
|
3699
3759
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3700
3760
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3735,13 +3795,13 @@ const useLoadOptions = _ref => {
|
|
|
3735
3795
|
}
|
|
3736
3796
|
const _ref2 = variables ?? {},
|
|
3737
3797
|
extraWhere = _ref2.extraWhere,
|
|
3738
|
-
restVariables = _objectWithoutProperties(_ref2, _excluded$
|
|
3798
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$3);
|
|
3739
3799
|
if (typeof extraWhere === 'string') {
|
|
3740
3800
|
where = where ? `(${where}) and ${variables.extraWhere}` : variables.extraWhere;
|
|
3741
3801
|
}
|
|
3742
3802
|
return client$1.query({
|
|
3743
3803
|
query,
|
|
3744
|
-
variables: _objectSpread$
|
|
3804
|
+
variables: _objectSpread$17({
|
|
3745
3805
|
where
|
|
3746
3806
|
}, restVariables),
|
|
3747
3807
|
context: {
|
|
@@ -3830,7 +3890,8 @@ const ProductTypePickerInput = _ref => {
|
|
|
3830
3890
|
onBlur = _ref.onBlur,
|
|
3831
3891
|
value = _ref.value,
|
|
3832
3892
|
hasError = _ref.hasError,
|
|
3833
|
-
onError = _ref.onError
|
|
3893
|
+
onError = _ref.onError,
|
|
3894
|
+
hasWarning = _ref.hasWarning;
|
|
3834
3895
|
const _useIntl = reactIntl.useIntl(),
|
|
3835
3896
|
formatMessage = _useIntl.formatMessage;
|
|
3836
3897
|
const prefixSearchFields = React.useMemo(() => ['name'], []);
|
|
@@ -3896,7 +3957,10 @@ const ProductTypePickerInput = _ref => {
|
|
|
3896
3957
|
onBlur: onBlur,
|
|
3897
3958
|
value: currentOption.data,
|
|
3898
3959
|
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3899
|
-
hasError: hasError || isLoadingFailed
|
|
3960
|
+
hasError: hasError || isLoadingFailed,
|
|
3961
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
3962
|
+
menuPortalTarget: document.body,
|
|
3963
|
+
hasWarning: hasWarning
|
|
3900
3964
|
})
|
|
3901
3965
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
3902
3966
|
tone: "negative",
|
|
@@ -3931,7 +3995,8 @@ const StatePickerInput = _ref => {
|
|
|
3931
3995
|
onBlur = _ref.onBlur,
|
|
3932
3996
|
value = _ref.value,
|
|
3933
3997
|
hasError = _ref.hasError,
|
|
3934
|
-
onError = _ref.onError
|
|
3998
|
+
onError = _ref.onError,
|
|
3999
|
+
hasWarning = _ref.hasWarning;
|
|
3935
4000
|
const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
|
|
3936
4001
|
const _useIntl = reactIntl.useIntl(),
|
|
3937
4002
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -4017,7 +4082,10 @@ const StatePickerInput = _ref => {
|
|
|
4017
4082
|
onBlur: onBlur,
|
|
4018
4083
|
value: currentOption.data,
|
|
4019
4084
|
noOptionsMessage: handleNoOptions,
|
|
4020
|
-
hasError: hasError || isLoadingFailed
|
|
4085
|
+
hasError: hasError || isLoadingFailed,
|
|
4086
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
4087
|
+
menuPortalTarget: document.body,
|
|
4088
|
+
hasWarning: hasWarning
|
|
4021
4089
|
}, dataLocale)
|
|
4022
4090
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
4023
4091
|
tone: "negative",
|
|
@@ -4028,9 +4096,9 @@ const StatePickerInput = _ref => {
|
|
|
4028
4096
|
};
|
|
4029
4097
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4030
4098
|
|
|
4031
|
-
function ownKeys$
|
|
4032
|
-
function _objectSpread$
|
|
4033
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4099
|
+
function ownKeys$16(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4100
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$16(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4101
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$16({
|
|
4034
4102
|
ref: ref,
|
|
4035
4103
|
style: {
|
|
4036
4104
|
display: 'block',
|
|
@@ -4167,9 +4235,9 @@ const getPrefixSearchBounds = input => {
|
|
|
4167
4235
|
return [input, `${_sliceInstanceProperty__default["default"](input).call(input, 0, input.length - 1)}${getNextCharacter(_sliceInstanceProperty__default["default"](input).call(input, input.length - 1))}`];
|
|
4168
4236
|
};
|
|
4169
4237
|
|
|
4170
|
-
const _excluded = ["action"];
|
|
4171
|
-
function ownKeys$
|
|
4172
|
-
function _objectSpread$
|
|
4238
|
+
const _excluded$2 = ["action"];
|
|
4239
|
+
function ownKeys$15(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4240
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$15(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$15(Object(t))).call(_context9, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4173
4241
|
|
|
4174
4242
|
/**
|
|
4175
4243
|
* Checks if a value is a LocalizedString
|
|
@@ -4191,7 +4259,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4191
4259
|
*/
|
|
4192
4260
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4193
4261
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4194
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4262
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$15(_objectSpread$15({}, customFields), {}, {
|
|
4195
4263
|
[customField.name]: customField.value
|
|
4196
4264
|
}), {});
|
|
4197
4265
|
};
|
|
@@ -4215,7 +4283,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4215
4283
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4216
4284
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4217
4285
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4218
|
-
return _objectSpread$
|
|
4286
|
+
return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, transformedData), parent ? {
|
|
4219
4287
|
parent
|
|
4220
4288
|
} : {}), ancestors ? {
|
|
4221
4289
|
ancestors
|
|
@@ -4306,7 +4374,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4306
4374
|
const formatMoney = valueType => money => {
|
|
4307
4375
|
if (valueType === 'fixed') {
|
|
4308
4376
|
return {
|
|
4309
|
-
[money.type]: _objectSpread$
|
|
4377
|
+
[money.type]: _objectSpread$15({
|
|
4310
4378
|
centAmount: money.centAmount,
|
|
4311
4379
|
currencyCode: money.currencyCode
|
|
4312
4380
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4397,7 +4465,6 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4397
4465
|
}
|
|
4398
4466
|
};
|
|
4399
4467
|
case 'setLineItemCustomField':
|
|
4400
|
-
case 'setCustomLineItemCustomField':
|
|
4401
4468
|
return {
|
|
4402
4469
|
[actionName]: {
|
|
4403
4470
|
lineItemId: actionPayload.lineItemId,
|
|
@@ -4405,6 +4472,14 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4405
4472
|
value: _JSON$stringify__default["default"](actionPayload.value)
|
|
4406
4473
|
}
|
|
4407
4474
|
};
|
|
4475
|
+
case 'setCustomLineItemCustomField':
|
|
4476
|
+
return {
|
|
4477
|
+
[actionName]: {
|
|
4478
|
+
customLineItemId: actionPayload.customLineItemId,
|
|
4479
|
+
name: actionPayload.name,
|
|
4480
|
+
value: _JSON$stringify__default["default"](actionPayload.value)
|
|
4481
|
+
}
|
|
4482
|
+
};
|
|
4408
4483
|
case 'setCustomField':
|
|
4409
4484
|
return {
|
|
4410
4485
|
[actionName]: {
|
|
@@ -4471,7 +4546,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4471
4546
|
case 'addAttributeDefinition':
|
|
4472
4547
|
return {
|
|
4473
4548
|
[actionName]: {
|
|
4474
|
-
attributeDefinition: _objectSpread$
|
|
4549
|
+
attributeDefinition: _objectSpread$15(_objectSpread$15({}, actionPayload.attribute), {}, {
|
|
4475
4550
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4476
4551
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4477
4552
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4567,7 +4642,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4567
4642
|
return {
|
|
4568
4643
|
[actionName]: {
|
|
4569
4644
|
attributeName: actionPayload.attributeName,
|
|
4570
|
-
value: _objectSpread$
|
|
4645
|
+
value: _objectSpread$15(_objectSpread$15({}, actionPayload.value), {}, {
|
|
4571
4646
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4572
4647
|
})
|
|
4573
4648
|
}
|
|
@@ -4576,7 +4651,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4576
4651
|
return {
|
|
4577
4652
|
[actionName]: {
|
|
4578
4653
|
attributeName: actionPayload.attributeName,
|
|
4579
|
-
newValue: _objectSpread$
|
|
4654
|
+
newValue: _objectSpread$15(_objectSpread$15({}, actionPayload.newValue), {}, {
|
|
4580
4655
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4581
4656
|
})
|
|
4582
4657
|
}
|
|
@@ -4603,7 +4678,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4603
4678
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4604
4679
|
taxCategory: actionPayload.taxCategory,
|
|
4605
4680
|
money: {
|
|
4606
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4681
|
+
[actionPayload.money.type]: _objectSpread$15({
|
|
4607
4682
|
centAmount: actionPayload.money.centAmount,
|
|
4608
4683
|
currencyCode: actionPayload.money.currencyCode
|
|
4609
4684
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4658,8 +4733,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4658
4733
|
fields: customFields
|
|
4659
4734
|
} : null;
|
|
4660
4735
|
return {
|
|
4661
|
-
[actionName]: _objectSpread$
|
|
4662
|
-
address: _objectSpread$
|
|
4736
|
+
[actionName]: _objectSpread$15(_objectSpread$15({}, actionPayload), {}, {
|
|
4737
|
+
address: _objectSpread$15(_objectSpread$15({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4663
4738
|
custom
|
|
4664
4739
|
})
|
|
4665
4740
|
})
|
|
@@ -4701,7 +4776,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4701
4776
|
};
|
|
4702
4777
|
const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["default"](actions).call(actions, (previousActions, _ref9) => {
|
|
4703
4778
|
let actionName = _ref9.action,
|
|
4704
|
-
actionPayload = _objectWithoutProperties(_ref9, _excluded);
|
|
4779
|
+
actionPayload = _objectWithoutProperties(_ref9, _excluded$2);
|
|
4705
4780
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4706
4781
|
}, []);
|
|
4707
4782
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
@@ -4734,8 +4809,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4734
4809
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4735
4810
|
}
|
|
4736
4811
|
|
|
4737
|
-
function ownKeys$
|
|
4738
|
-
function _objectSpread$
|
|
4812
|
+
function ownKeys$14(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4813
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$14(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4739
4814
|
function getPriceChannelName(price) {
|
|
4740
4815
|
return price.channel?.name ?? price.channel?.key ?? null;
|
|
4741
4816
|
}
|
|
@@ -4747,11 +4822,11 @@ function getDiscountValue(price) {
|
|
|
4747
4822
|
} else if (price.value?.type === PRECISION_TYPES.highPrecision && price.discounted?.value?.type === PRECISION_TYPES.centPrecision) {
|
|
4748
4823
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4749
4824
|
}
|
|
4750
|
-
return price.discounted ? _objectSpread$
|
|
4825
|
+
return price.discounted ? _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4751
4826
|
fractionedAmount,
|
|
4752
4827
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4753
4828
|
preciseAmount
|
|
4754
|
-
}) : _objectSpread$
|
|
4829
|
+
}) : _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4755
4830
|
centAmount: 0
|
|
4756
4831
|
});
|
|
4757
4832
|
}
|
|
@@ -4775,7 +4850,7 @@ function getNetUnitPrice(_ref) {
|
|
|
4775
4850
|
}
|
|
4776
4851
|
let preciseAmount;
|
|
4777
4852
|
if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4778
|
-
return _objectSpread$
|
|
4853
|
+
return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4779
4854
|
centAmount,
|
|
4780
4855
|
preciseAmount
|
|
4781
4856
|
});
|
|
@@ -4791,7 +4866,7 @@ function getNetUnitPrice(_ref) {
|
|
|
4791
4866
|
}
|
|
4792
4867
|
let preciseAmount;
|
|
4793
4868
|
if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4794
|
-
return _objectSpread$
|
|
4869
|
+
return _objectSpread$14(_objectSpread$14({}, price.value), {}, {
|
|
4795
4870
|
centAmount,
|
|
4796
4871
|
preciseAmount
|
|
4797
4872
|
});
|
|
@@ -4803,7 +4878,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4803
4878
|
const currencyCode = price.value.currencyCode;
|
|
4804
4879
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4805
4880
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4806
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4881
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$14(_objectSpread$14({}, minPrices), {}, {
|
|
4807
4882
|
[currencyCode]: price.value
|
|
4808
4883
|
});
|
|
4809
4884
|
}
|
|
@@ -4812,8 +4887,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4812
4887
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4813
4888
|
}
|
|
4814
4889
|
|
|
4815
|
-
function ownKeys$
|
|
4816
|
-
function _objectSpread$
|
|
4890
|
+
function ownKeys$13(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4891
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$13(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$13(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4817
4892
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4818
4893
|
var _context, _context4;
|
|
4819
4894
|
return {
|
|
@@ -4828,14 +4903,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4828
4903
|
return {
|
|
4829
4904
|
name: fieldDefinition.name,
|
|
4830
4905
|
required: fieldDefinition.required,
|
|
4831
|
-
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$
|
|
4832
|
-
elementType: _objectSpread$
|
|
4906
|
+
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4907
|
+
elementType: _objectSpread$13(_objectSpread$13({}, fieldDefinition.type.elementType), {}, {
|
|
4833
4908
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4834
4909
|
key: value.key,
|
|
4835
4910
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4836
4911
|
}))
|
|
4837
4912
|
})
|
|
4838
|
-
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$
|
|
4913
|
+
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$13(_objectSpread$13({}, fieldDefinition.type), {}, {
|
|
4839
4914
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4840
4915
|
key: value.key,
|
|
4841
4916
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4846,7 +4921,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4846
4921
|
})
|
|
4847
4922
|
}
|
|
4848
4923
|
},
|
|
4849
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4924
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$13(_objectSpread$13({}, fields), {}, {
|
|
4850
4925
|
[customField.name]: customField.value
|
|
4851
4926
|
}), {})
|
|
4852
4927
|
};
|
|
@@ -4858,7 +4933,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4858
4933
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4859
4934
|
// in either case we return null
|
|
4860
4935
|
if (!productSelection) return null;
|
|
4861
|
-
return _objectSpread$
|
|
4936
|
+
return _objectSpread$13(_objectSpread$13({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4862
4937
|
from: 'nameAllLocales',
|
|
4863
4938
|
to: 'name'
|
|
4864
4939
|
}])), {}, {
|
|
@@ -4881,8 +4956,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4881
4956
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4882
4957
|
};
|
|
4883
4958
|
|
|
4884
|
-
function ownKeys$
|
|
4885
|
-
function _objectSpread$
|
|
4959
|
+
function ownKeys$12(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4960
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$12(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$12(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4886
4961
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4887
4962
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4888
4963
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4899,7 +4974,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4899
4974
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4900
4975
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4901
4976
|
const definitionName = definition.type.elementType.name;
|
|
4902
|
-
return _objectSpread$
|
|
4977
|
+
return _objectSpread$12(_objectSpread$12({}, updateAction), {}, {
|
|
4903
4978
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4904
4979
|
});
|
|
4905
4980
|
}
|
|
@@ -4973,18 +5048,29 @@ function omitSetsOfSets() {
|
|
|
4973
5048
|
|
|
4974
5049
|
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 } } } };
|
|
4975
5050
|
|
|
4976
|
-
function ownKeys$
|
|
4977
|
-
function _objectSpread$
|
|
4978
|
-
function
|
|
4979
|
-
function
|
|
5051
|
+
function ownKeys$11(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5052
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$11(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$11(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5053
|
+
function _callSuper$5(_this, derived, args) {
|
|
5054
|
+
function isNativeReflectConstruct() {
|
|
5055
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
5056
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
5057
|
+
if (typeof Proxy === "function") return true;
|
|
5058
|
+
try {
|
|
5059
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
5060
|
+
} catch (e) {
|
|
5061
|
+
return false;
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5064
|
+
derived = _getPrototypeOf(derived);
|
|
5065
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
5066
|
+
}
|
|
4980
5067
|
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 } } } };
|
|
4981
5068
|
const customizableResources$1 = ['asset', 'category', 'channel', 'customer', 'order', 'discount-code', 'cart-discount', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review'];
|
|
4982
5069
|
let CustomFieldDefinitionsConnector = /*#__PURE__*/function (_Component) {
|
|
4983
5070
|
_inherits(CustomFieldDefinitionsConnector, _Component);
|
|
4984
|
-
var _super = _createSuper$5(CustomFieldDefinitionsConnector);
|
|
4985
5071
|
function CustomFieldDefinitionsConnector() {
|
|
4986
5072
|
_classCallCheck(this, CustomFieldDefinitionsConnector);
|
|
4987
|
-
return
|
|
5073
|
+
return _callSuper$5(this, CustomFieldDefinitionsConnector, arguments);
|
|
4988
5074
|
}
|
|
4989
5075
|
_createClass(CustomFieldDefinitionsConnector, [{
|
|
4990
5076
|
key: "componentDidMount",
|
|
@@ -5034,7 +5120,7 @@ const mapDataToProps = _ref => {
|
|
|
5034
5120
|
return {
|
|
5035
5121
|
fetchTypeDefinitionsQuery: {
|
|
5036
5122
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5037
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5123
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$11({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5038
5124
|
isImmutable: true
|
|
5039
5125
|
}), [{
|
|
5040
5126
|
from: 'labelAllLocales',
|
|
@@ -5062,12 +5148,12 @@ const handlers$2 = {
|
|
|
5062
5148
|
}
|
|
5063
5149
|
};
|
|
5064
5150
|
|
|
5065
|
-
function ownKeys
|
|
5066
|
-
function _objectSpread
|
|
5151
|
+
function ownKeys$10(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5152
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$10(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$10(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5067
5153
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5068
5154
|
return {
|
|
5069
5155
|
fields: customFieldsFromRestResponse.fields,
|
|
5070
|
-
type: _objectSpread
|
|
5156
|
+
type: _objectSpread$10({
|
|
5071
5157
|
id: customFieldsFromRestResponse.type.id
|
|
5072
5158
|
}, customFieldsFromRestResponse.type.obj)
|
|
5073
5159
|
};
|
|
@@ -5086,14 +5172,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5086
5172
|
name: fieldDefinition.name,
|
|
5087
5173
|
required: fieldDefinition.required,
|
|
5088
5174
|
inputHint: fieldDefinition.inputHint,
|
|
5089
|
-
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread
|
|
5090
|
-
elementType: _objectSpread
|
|
5175
|
+
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5176
|
+
elementType: _objectSpread$10(_objectSpread$10({}, fieldDefinition.type.elementType), {}, {
|
|
5091
5177
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5092
5178
|
key: value.key,
|
|
5093
5179
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5094
5180
|
}))
|
|
5095
5181
|
})
|
|
5096
|
-
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread
|
|
5182
|
+
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$10(_objectSpread$10({}, fieldDefinition.type), {}, {
|
|
5097
5183
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5098
5184
|
key: value.key,
|
|
5099
5185
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5109,7 +5195,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5109
5195
|
type: {
|
|
5110
5196
|
id: formCustomFields.type.id,
|
|
5111
5197
|
typeId: 'type',
|
|
5112
|
-
obj: _objectSpread
|
|
5198
|
+
obj: _objectSpread$10({}, formCustomFields.type)
|
|
5113
5199
|
},
|
|
5114
5200
|
fields: formCustomFields.fields
|
|
5115
5201
|
});
|
|
@@ -5117,7 +5203,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5117
5203
|
type: {
|
|
5118
5204
|
id: formCustomFields.type.id,
|
|
5119
5205
|
typeId: 'type',
|
|
5120
|
-
obj: _objectSpread
|
|
5206
|
+
obj: _objectSpread$10({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5121
5207
|
},
|
|
5122
5208
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5123
5209
|
});
|
|
@@ -5130,10 +5216,22 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5130
5216
|
}
|
|
5131
5217
|
});
|
|
5132
5218
|
|
|
5133
|
-
function
|
|
5134
|
-
function
|
|
5219
|
+
function _callSuper$4(_this, derived, args) {
|
|
5220
|
+
function isNativeReflectConstruct() {
|
|
5221
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
5222
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
5223
|
+
if (typeof Proxy === "function") return true;
|
|
5224
|
+
try {
|
|
5225
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
5226
|
+
} catch (e) {
|
|
5227
|
+
return false;
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5230
|
+
derived = _getPrototypeOf(derived);
|
|
5231
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
5232
|
+
}
|
|
5135
5233
|
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 } } } };
|
|
5136
|
-
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', 'order-return-item'];
|
|
5234
|
+
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'quote', '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', 'order-return-item', 'order-parcel'];
|
|
5137
5235
|
const emptyTypeDefinitions = {
|
|
5138
5236
|
total: 0,
|
|
5139
5237
|
count: 0,
|
|
@@ -5141,10 +5239,9 @@ const emptyTypeDefinitions = {
|
|
|
5141
5239
|
};
|
|
5142
5240
|
let CustomFieldTypeDefinitionsConnector = /*#__PURE__*/function (_Component) {
|
|
5143
5241
|
_inherits(CustomFieldTypeDefinitionsConnector, _Component);
|
|
5144
|
-
var _super = _createSuper$4(CustomFieldTypeDefinitionsConnector);
|
|
5145
5242
|
function CustomFieldTypeDefinitionsConnector() {
|
|
5146
5243
|
_classCallCheck(this, CustomFieldTypeDefinitionsConnector);
|
|
5147
|
-
return
|
|
5244
|
+
return _callSuper$4(this, CustomFieldTypeDefinitionsConnector, arguments);
|
|
5148
5245
|
}
|
|
5149
5246
|
_createClass(CustomFieldTypeDefinitionsConnector, [{
|
|
5150
5247
|
key: "componentDidMount",
|
|
@@ -5248,8 +5345,8 @@ const REFERENCED_TYPES = {
|
|
|
5248
5345
|
zone: 'zone'
|
|
5249
5346
|
};
|
|
5250
5347
|
|
|
5251
|
-
function ownKeys
|
|
5252
|
-
function _objectSpread
|
|
5348
|
+
function ownKeys$$(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5349
|
+
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$$(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$$(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5253
5350
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5254
5351
|
let validatedValues = [];
|
|
5255
5352
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5316,14 +5413,14 @@ function validations (formValues, language, languages) {
|
|
|
5316
5413
|
var _context2;
|
|
5317
5414
|
// Collect all required and set type fields
|
|
5318
5415
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5319
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread
|
|
5320
|
-
[fieldDefinition.name]: _objectSpread
|
|
5416
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$$(_objectSpread$$({}, acc), {}, {
|
|
5417
|
+
[fieldDefinition.name]: _objectSpread$$(_objectSpread$$({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5321
5418
|
}), {});
|
|
5322
5419
|
return withoutEmptyErrorsByField(errors);
|
|
5323
5420
|
}
|
|
5324
5421
|
|
|
5325
|
-
function ownKeys$
|
|
5326
|
-
function _objectSpread$
|
|
5422
|
+
function ownKeys$_(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5423
|
+
function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$_(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$_(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5327
5424
|
const DroppableWrapper = _ref => {
|
|
5328
5425
|
let children = _ref.children,
|
|
5329
5426
|
onDragEnd = _ref.onDragEnd;
|
|
@@ -5331,7 +5428,7 @@ const DroppableWrapper = _ref => {
|
|
|
5331
5428
|
onDragEnd: onDragEnd,
|
|
5332
5429
|
children: jsxRuntime.jsx(reactBeautifulDnd.Droppable, {
|
|
5333
5430
|
droppableId: "droppable",
|
|
5334
|
-
children: provided => jsxRuntime.jsxs("div", _objectSpread$
|
|
5431
|
+
children: provided => jsxRuntime.jsxs("div", _objectSpread$_(_objectSpread$_({
|
|
5335
5432
|
ref: provided.innerRef
|
|
5336
5433
|
}, provided.droppableProps), {}, {
|
|
5337
5434
|
children: [children, provided.placeholder]
|
|
@@ -5340,10 +5437,10 @@ const DroppableWrapper = _ref => {
|
|
|
5340
5437
|
});
|
|
5341
5438
|
};
|
|
5342
5439
|
|
|
5343
|
-
function ownKeys$
|
|
5344
|
-
function _objectSpread$
|
|
5440
|
+
function ownKeys$Z(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5441
|
+
function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Z(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Z(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5345
5442
|
function DragHandle(props) {
|
|
5346
|
-
return jsxRuntime.jsx("div", _objectSpread$
|
|
5443
|
+
return jsxRuntime.jsx("div", _objectSpread$Z(_objectSpread$Z({}, props), {}, {
|
|
5347
5444
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
5348
5445
|
icon: jsxRuntime.jsx(uiKit.DragIcon, {}),
|
|
5349
5446
|
size: "medium",
|
|
@@ -5353,32 +5450,53 @@ function DragHandle(props) {
|
|
|
5353
5450
|
}
|
|
5354
5451
|
DragHandle.displayName = 'DragHandle';
|
|
5355
5452
|
|
|
5356
|
-
function ownKeys$
|
|
5357
|
-
function _objectSpread$
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5453
|
+
function ownKeys$Y(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5454
|
+
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Y(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Y(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5455
|
+
var _ref$1 = {
|
|
5456
|
+
name: "1onfs6j",
|
|
5457
|
+
styles: "z-index:100000!important"
|
|
5458
|
+
} ;
|
|
5459
|
+
const DraggableWrapper = _ref2 => {
|
|
5460
|
+
let children = _ref2.children,
|
|
5461
|
+
draggableKey = _ref2.draggableKey,
|
|
5462
|
+
draggableId = _ref2.draggableId,
|
|
5463
|
+
index = _ref2.index;
|
|
5363
5464
|
const portal = document.createElement('div');
|
|
5364
5465
|
portal.id = 'drag-rbd-portal';
|
|
5365
5466
|
document.body.appendChild(portal);
|
|
5467
|
+
const DraggingCard = _ref3 => {
|
|
5468
|
+
let isDragging = _ref3.isDragging,
|
|
5469
|
+
children = _ref3.children;
|
|
5470
|
+
if (isDragging) {
|
|
5471
|
+
return jsxRuntime.jsx(uiKit.Card, {
|
|
5472
|
+
theme: "light",
|
|
5473
|
+
insetScale: "m",
|
|
5474
|
+
children: children
|
|
5475
|
+
});
|
|
5476
|
+
} else {
|
|
5477
|
+
return children;
|
|
5478
|
+
}
|
|
5479
|
+
};
|
|
5366
5480
|
return jsxRuntime.jsx(reactBeautifulDnd.Draggable, {
|
|
5367
5481
|
draggableId: draggableId,
|
|
5368
5482
|
index: index,
|
|
5369
5483
|
children: (provided, snapshot) => {
|
|
5370
|
-
const child = jsxRuntime.jsx("div", _objectSpread$
|
|
5484
|
+
const child = jsxRuntime.jsx("div", _objectSpread$Y(_objectSpread$Y({
|
|
5371
5485
|
ref: provided.innerRef
|
|
5372
5486
|
}, provided.draggableProps), {}, {
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
children:
|
|
5381
|
-
|
|
5487
|
+
css: _ref$1,
|
|
5488
|
+
children: jsxRuntime.jsx(DraggingCard, {
|
|
5489
|
+
isDragging: snapshot.isDragging,
|
|
5490
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
5491
|
+
gridTemplateColumns: '1fr 20fr',
|
|
5492
|
+
gridTemplateRows: "auto 1fr auto",
|
|
5493
|
+
gridGap: snapshot.isDragging ? uiKit.customProperties.spacingS : uiKit.customProperties.spacingM,
|
|
5494
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5495
|
+
children: jsxRuntime.jsx(DragHandle, _objectSpread$Y({}, provided.dragHandleProps))
|
|
5496
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5497
|
+
children: children
|
|
5498
|
+
})]
|
|
5499
|
+
})
|
|
5382
5500
|
})
|
|
5383
5501
|
}));
|
|
5384
5502
|
if (!snapshot.isDragging) {
|
|
@@ -5393,8 +5511,8 @@ const DraggableWrapper = _ref => {
|
|
|
5393
5511
|
}, draggableKey);
|
|
5394
5512
|
};
|
|
5395
5513
|
|
|
5396
|
-
function ownKeys$
|
|
5397
|
-
function _objectSpread$
|
|
5514
|
+
function ownKeys$X(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5515
|
+
function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$X(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$X(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5398
5516
|
const DefaultWrapper = _ref => {
|
|
5399
5517
|
let children = _ref.children;
|
|
5400
5518
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
@@ -5415,24 +5533,24 @@ const DndProvider = _ref2 => {
|
|
|
5415
5533
|
children = _ref2.children;
|
|
5416
5534
|
const _useToggleState = uiKit.useToggleState(false),
|
|
5417
5535
|
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
if (
|
|
5536
|
+
isDnDMode = _useToggleState2[0],
|
|
5537
|
+
setDnDMode = _useToggleState2[1];
|
|
5538
|
+
if (isDnDMode) {
|
|
5421
5539
|
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5422
5540
|
value: {
|
|
5423
5541
|
onDragEnd,
|
|
5424
5542
|
DroppableWrapper,
|
|
5425
5543
|
DraggableWrapper,
|
|
5426
|
-
|
|
5427
|
-
|
|
5544
|
+
setDnDMode,
|
|
5545
|
+
isDnDMode
|
|
5428
5546
|
},
|
|
5429
5547
|
children: children
|
|
5430
5548
|
});
|
|
5431
5549
|
}
|
|
5432
5550
|
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5433
|
-
value: _objectSpread$
|
|
5434
|
-
|
|
5435
|
-
|
|
5551
|
+
value: _objectSpread$X(_objectSpread$X({}, dndContextDefaultValues), {}, {
|
|
5552
|
+
isDnDMode,
|
|
5553
|
+
setDnDMode
|
|
5436
5554
|
}),
|
|
5437
5555
|
children: children
|
|
5438
5556
|
});
|
|
@@ -5445,7 +5563,10 @@ function CustomTextInput(props) {
|
|
|
5445
5563
|
const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
|
|
5446
5564
|
const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
|
|
5447
5565
|
const value = props.value || '';
|
|
5448
|
-
const handleChange = makeChangeHandler(rawValue =>
|
|
5566
|
+
const handleChange = makeChangeHandler(rawValue => {
|
|
5567
|
+
props.setFieldValue(props.name, rawValue || undefined);
|
|
5568
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5569
|
+
});
|
|
5449
5570
|
const tooltipValue = isMultiLine ? '' : value;
|
|
5450
5571
|
return jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5451
5572
|
title: tooltipValue,
|
|
@@ -5457,14 +5578,15 @@ function CustomTextInput(props) {
|
|
|
5457
5578
|
onBlur: props.onBlur,
|
|
5458
5579
|
hasError: props.hasError,
|
|
5459
5580
|
isDisabled: props.isDisabled,
|
|
5460
|
-
isReadOnly: props.isReadOnly
|
|
5581
|
+
isReadOnly: props.isReadOnly,
|
|
5582
|
+
hasWarning: props.hasWarning
|
|
5461
5583
|
})
|
|
5462
5584
|
});
|
|
5463
5585
|
}
|
|
5464
5586
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5465
5587
|
|
|
5466
|
-
function ownKeys$
|
|
5467
|
-
function _objectSpread$
|
|
5588
|
+
function ownKeys$W(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5589
|
+
function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$W(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$W(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5468
5590
|
const getSubfieldLanguage = subfieldName => {
|
|
5469
5591
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5470
5592
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5487,11 +5609,12 @@ function CustomLocalizedTextInput(props) {
|
|
|
5487
5609
|
// as a whole.
|
|
5488
5610
|
|
|
5489
5611
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5490
|
-
const newValue = _objectSpread$
|
|
5612
|
+
const newValue = _objectSpread$W(_objectSpread$W({}, props.value), {}, {
|
|
5491
5613
|
[fieldLanguage]: rawValue
|
|
5492
5614
|
});
|
|
5493
5615
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
5494
5616
|
props.setFieldValue(props.name, nullifiedIfNeeded);
|
|
5617
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5495
5618
|
});
|
|
5496
5619
|
const InputComponent = isMultiLine ? uiKit.LocalizedMultilineTextInput : uiKit.LocalizedTextInput;
|
|
5497
5620
|
const tooltipTitle = isMultiLine ? '' : value ? value[language] ?? '' : '';
|
|
@@ -5506,7 +5629,8 @@ function CustomLocalizedTextInput(props) {
|
|
|
5506
5629
|
selectedLanguage: language,
|
|
5507
5630
|
hasError: props.hasError,
|
|
5508
5631
|
isDisabled: props.isDisabled,
|
|
5509
|
-
isReadOnly: props.isReadOnly
|
|
5632
|
+
isReadOnly: props.isReadOnly,
|
|
5633
|
+
hasWarning: props.hasWarning
|
|
5510
5634
|
})
|
|
5511
5635
|
});
|
|
5512
5636
|
}
|
|
@@ -5521,7 +5645,10 @@ const options$1 = [{
|
|
|
5521
5645
|
}];
|
|
5522
5646
|
function CustomBooleanInput(props) {
|
|
5523
5647
|
const value = isNil__default["default"](props.value) ? props.value : String(props.value);
|
|
5524
|
-
const handleChange = makeChangeHandler(rawValue =>
|
|
5648
|
+
const handleChange = makeChangeHandler(rawValue => {
|
|
5649
|
+
props.setFieldValue(props.name, isNil__default["default"](rawValue) ? undefined : rawValue === 'true');
|
|
5650
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5651
|
+
});
|
|
5525
5652
|
return jsxRuntime.jsx(uiKit.SelectInput, {
|
|
5526
5653
|
id: props.name,
|
|
5527
5654
|
name: props.name,
|
|
@@ -5532,14 +5659,20 @@ function CustomBooleanInput(props) {
|
|
|
5532
5659
|
isClearable: !props.fieldDefinition.required,
|
|
5533
5660
|
isDisabled: props.isDisabled,
|
|
5534
5661
|
isReadOnly: props.isReadOnly,
|
|
5535
|
-
hasError: props.hasError
|
|
5662
|
+
hasError: props.hasError,
|
|
5663
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
5664
|
+
menuPortalTarget: document.body,
|
|
5665
|
+
hasWarning: props.hasWarning
|
|
5536
5666
|
});
|
|
5537
5667
|
}
|
|
5538
5668
|
CustomBooleanInput.displayName = 'CustomBooleanInput';
|
|
5539
5669
|
|
|
5540
5670
|
function CustomNumberInput(props) {
|
|
5541
5671
|
const value = props.value ?? '';
|
|
5542
|
-
const handleChange = makeChangeHandler(rawValue =>
|
|
5672
|
+
const handleChange = makeChangeHandler(rawValue => {
|
|
5673
|
+
props.setFieldValue(props.name, !rawValue ? undefined : Number(rawValue));
|
|
5674
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5675
|
+
});
|
|
5543
5676
|
return jsxRuntime.jsx(uiKit.NumberInput, {
|
|
5544
5677
|
id: props.name,
|
|
5545
5678
|
name: props.name,
|
|
@@ -5548,26 +5681,27 @@ function CustomNumberInput(props) {
|
|
|
5548
5681
|
onBlur: props.onBlur,
|
|
5549
5682
|
hasError: props.hasError,
|
|
5550
5683
|
isDisabled: props.isDisabled,
|
|
5551
|
-
isReadOnly: props.isReadOnly
|
|
5684
|
+
isReadOnly: props.isReadOnly,
|
|
5685
|
+
hasWarning: props.hasWarning
|
|
5552
5686
|
});
|
|
5553
5687
|
}
|
|
5554
5688
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5555
5689
|
|
|
5556
|
-
function ownKeys$
|
|
5557
|
-
function _objectSpread$
|
|
5558
|
-
var styles$
|
|
5690
|
+
function ownKeys$V(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5691
|
+
function _objectSpread$V(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$V(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$V(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5692
|
+
var styles$g = {
|
|
5559
5693
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5560
5694
|
};
|
|
5561
5695
|
const fixCurrencyCode = (value, currencies) => {
|
|
5562
5696
|
if (value.currencyCode) return value;
|
|
5563
5697
|
const firstCurrency = currencies[0];
|
|
5564
|
-
return _objectSpread$
|
|
5698
|
+
return _objectSpread$V(_objectSpread$V({}, value), {}, {
|
|
5565
5699
|
currencyCode: firstCurrency
|
|
5566
5700
|
});
|
|
5567
5701
|
};
|
|
5568
5702
|
const fixAmount = value => {
|
|
5569
5703
|
if (!value.amount) {
|
|
5570
|
-
return _objectSpread$
|
|
5704
|
+
return _objectSpread$V(_objectSpread$V({}, value), {}, {
|
|
5571
5705
|
amount: '0'
|
|
5572
5706
|
});
|
|
5573
5707
|
}
|
|
@@ -5609,17 +5743,18 @@ function CustomMoneyInput(props) {
|
|
|
5609
5743
|
}
|
|
5610
5744
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5611
5745
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5612
|
-
const newValue = _objectSpread$
|
|
5746
|
+
const newValue = _objectSpread$V({}, internalValue.current);
|
|
5613
5747
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5614
5748
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5615
5749
|
internalValue.current = fixedValue;
|
|
5616
5750
|
const converted = uiKit.MoneyInput.convertToMoneyValue(fixedValue, locale);
|
|
5617
5751
|
props.setFieldValue(props.name, converted || undefined);
|
|
5752
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5618
5753
|
});
|
|
5619
5754
|
|
|
5620
5755
|
// TODO(pa3): fix setting proper id in UIKit
|
|
5621
5756
|
return jsxRuntime.jsxs("div", {
|
|
5622
|
-
className: styles$
|
|
5757
|
+
className: styles$g.container,
|
|
5623
5758
|
"aria-labelledby": props.name,
|
|
5624
5759
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
5625
5760
|
children: jsxRuntime.jsx("label", {
|
|
@@ -5636,7 +5771,10 @@ function CustomMoneyInput(props) {
|
|
|
5636
5771
|
isReadOnly: props.isReadOnly,
|
|
5637
5772
|
isDisabled: props.isDisabled,
|
|
5638
5773
|
hasError: props.hasError,
|
|
5639
|
-
horizontalConstraint: "scale"
|
|
5774
|
+
horizontalConstraint: "scale",
|
|
5775
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
5776
|
+
menuPortalTarget: document.body,
|
|
5777
|
+
hasWarning: props.hasWarning
|
|
5640
5778
|
})]
|
|
5641
5779
|
});
|
|
5642
5780
|
}
|
|
@@ -5662,7 +5800,10 @@ function CustomLocalizedEnumInput(props) {
|
|
|
5662
5800
|
languages = _useApplicationContex.languages,
|
|
5663
5801
|
dataLocale = _useApplicationContex.dataLocale;
|
|
5664
5802
|
const options = convertTypeValuesToOptions$1(props.fieldDefinition.type, dataLocale, languages);
|
|
5665
|
-
const handleChange = makeChangeHandler(rawValue =>
|
|
5803
|
+
const handleChange = makeChangeHandler(rawValue => {
|
|
5804
|
+
props.setFieldValue(props.name, rawValue);
|
|
5805
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
5806
|
+
});
|
|
5666
5807
|
const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
|
|
5667
5808
|
return jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5668
5809
|
title: tooltipTitle,
|
|
@@ -5676,7 +5817,10 @@ function CustomLocalizedEnumInput(props) {
|
|
|
5676
5817
|
isClearable: !props.fieldDefinition.required,
|
|
5677
5818
|
hasError: props.hasError,
|
|
5678
5819
|
isDisabled: props.isDisabled,
|
|
5679
|
-
isReadOnly: props.isReadOnly
|
|
5820
|
+
isReadOnly: props.isReadOnly,
|
|
5821
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
5822
|
+
menuPortalTarget: document.body,
|
|
5823
|
+
hasWarning: props.hasWarning
|
|
5680
5824
|
})
|
|
5681
5825
|
});
|
|
5682
5826
|
}
|
|
@@ -5693,7 +5837,8 @@ function CustomRawIdReferenceInput(props) {
|
|
|
5693
5837
|
onBlur: props.onBlur,
|
|
5694
5838
|
hasError: props.hasError,
|
|
5695
5839
|
isDisabled: props.isDisabled,
|
|
5696
|
-
isReadOnly: props.isReadOnly
|
|
5840
|
+
isReadOnly: props.isReadOnly,
|
|
5841
|
+
hasWarning: props.hasWarning
|
|
5697
5842
|
})
|
|
5698
5843
|
});
|
|
5699
5844
|
}
|
|
@@ -5745,7 +5890,7 @@ function getCategoriesByIds(apolloClient, options) {
|
|
|
5745
5890
|
});
|
|
5746
5891
|
}
|
|
5747
5892
|
|
|
5748
|
-
var styles$
|
|
5893
|
+
var styles$f = {
|
|
5749
5894
|
"container": "reference-search-module__container___3-iK3",
|
|
5750
5895
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5751
5896
|
};
|
|
@@ -5852,9 +5997,9 @@ function ReferenceSearch(props) {
|
|
|
5852
5997
|
props.onChange(option);
|
|
5853
5998
|
};
|
|
5854
5999
|
return jsxRuntime.jsxs("div", {
|
|
5855
|
-
className: styles$
|
|
6000
|
+
className: styles$f.container,
|
|
5856
6001
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
5857
|
-
className: styles$
|
|
6002
|
+
className: styles$f['missing-label'],
|
|
5858
6003
|
children: props.referenceIsMissingLabel
|
|
5859
6004
|
}), jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5860
6005
|
title: tooltipTitle,
|
|
@@ -5878,7 +6023,10 @@ function ReferenceSearch(props) {
|
|
|
5878
6023
|
isReadOnly: props.isReadOnly,
|
|
5879
6024
|
onBlur: props.onBlur,
|
|
5880
6025
|
hasError: props.hasError,
|
|
5881
|
-
noOptionsMessage: () => props.noResultsLabel
|
|
6026
|
+
noOptionsMessage: () => props.noResultsLabel,
|
|
6027
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
6028
|
+
menuPortalTarget: document.body,
|
|
6029
|
+
hasWarning: props.hasWarning
|
|
5882
6030
|
})]
|
|
5883
6031
|
})
|
|
5884
6032
|
})]
|
|
@@ -5918,8 +6066,8 @@ const messages$B = reactIntl.defineMessages({
|
|
|
5918
6066
|
}
|
|
5919
6067
|
});
|
|
5920
6068
|
|
|
5921
|
-
function ownKeys$
|
|
5922
|
-
function _objectSpread$
|
|
6069
|
+
function ownKeys$U(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6070
|
+
function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$U(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$U(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5923
6071
|
function Option$1(props) {
|
|
5924
6072
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
5925
6073
|
language: applicationContext.dataLocale,
|
|
@@ -5930,7 +6078,7 @@ function Option$1(props) {
|
|
|
5930
6078
|
const _useIntl = reactIntl.useIntl(),
|
|
5931
6079
|
formatMessage = _useIntl.formatMessage;
|
|
5932
6080
|
const category = props.data;
|
|
5933
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6081
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$U(_objectSpread$U({}, props), {}, {
|
|
5934
6082
|
children: jsxRuntime.jsxs("div", {
|
|
5935
6083
|
"data-testid": "category-option",
|
|
5936
6084
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5959,8 +6107,8 @@ function Option$1(props) {
|
|
|
5959
6107
|
}));
|
|
5960
6108
|
}
|
|
5961
6109
|
|
|
5962
|
-
function ownKeys$
|
|
5963
|
-
function _objectSpread$
|
|
6110
|
+
function ownKeys$T(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6111
|
+
function _objectSpread$T(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$T(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$T(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5964
6112
|
const filterOption$1 = () => true;
|
|
5965
6113
|
function CategoryReferenceSearch(props) {
|
|
5966
6114
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5972,7 +6120,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5972
6120
|
})),
|
|
5973
6121
|
language = _useApplicationContex.language,
|
|
5974
6122
|
languages = _useApplicationContex.languages;
|
|
5975
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
6123
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$T(_objectSpread$T({}, category), {}, {
|
|
5976
6124
|
value: category.id,
|
|
5977
6125
|
label: l10n.formatLocalizedString(category, {
|
|
5978
6126
|
key: 'name',
|
|
@@ -5990,7 +6138,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5990
6138
|
}), [apolloClient]);
|
|
5991
6139
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5992
6140
|
id: props.id,
|
|
5993
|
-
components: _objectSpread$
|
|
6141
|
+
components: _objectSpread$T({
|
|
5994
6142
|
Option: Option$1
|
|
5995
6143
|
}, props.components),
|
|
5996
6144
|
isClearable: props.isClearable,
|
|
@@ -6008,7 +6156,8 @@ function CategoryReferenceSearch(props) {
|
|
|
6008
6156
|
mapItemToOption: mapItemToOption,
|
|
6009
6157
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6010
6158
|
loadItemsByIds: loadItemsByIds,
|
|
6011
|
-
filterOption: filterOption$1
|
|
6159
|
+
filterOption: filterOption$1,
|
|
6160
|
+
hasWarning: props.hasWarning
|
|
6012
6161
|
});
|
|
6013
6162
|
}
|
|
6014
6163
|
|
|
@@ -6105,8 +6254,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
6105
6254
|
}
|
|
6106
6255
|
});
|
|
6107
6256
|
|
|
6108
|
-
function ownKeys$
|
|
6109
|
-
function _objectSpread$
|
|
6257
|
+
function ownKeys$S(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6258
|
+
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$S(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$S(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6110
6259
|
function Option(props) {
|
|
6111
6260
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6112
6261
|
language: applicationContext.dataLocale,
|
|
@@ -6117,7 +6266,7 @@ function Option(props) {
|
|
|
6117
6266
|
const _useIntl = reactIntl.useIntl(),
|
|
6118
6267
|
formatMessage = _useIntl.formatMessage;
|
|
6119
6268
|
const cartDiscount = props.data;
|
|
6120
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6269
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$S(_objectSpread$S({}, props), {}, {
|
|
6121
6270
|
children: jsxRuntime.jsxs("div", {
|
|
6122
6271
|
"data-testid": "cart-discount-option",
|
|
6123
6272
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6134,8 +6283,8 @@ function Option(props) {
|
|
|
6134
6283
|
}));
|
|
6135
6284
|
}
|
|
6136
6285
|
|
|
6137
|
-
function ownKeys$
|
|
6138
|
-
function _objectSpread$
|
|
6286
|
+
function ownKeys$R(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6287
|
+
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$R(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$R(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6139
6288
|
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 } } } };
|
|
6140
6289
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6141
6290
|
const filterOption = (option, text) => {
|
|
@@ -6161,7 +6310,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6161
6310
|
})),
|
|
6162
6311
|
language = _useApplicationContex.language,
|
|
6163
6312
|
languages = _useApplicationContex.languages;
|
|
6164
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6313
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$R(_objectSpread$R({}, cartDiscount), {}, {
|
|
6165
6314
|
value: cartDiscount.id,
|
|
6166
6315
|
key: cartDiscount.key,
|
|
6167
6316
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6211,7 +6360,8 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6211
6360
|
mapItemToOption: mapItemToOption,
|
|
6212
6361
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6213
6362
|
loadItemsByIds: loadItemsByIds,
|
|
6214
|
-
filterOption: filterOption
|
|
6363
|
+
filterOption: filterOption,
|
|
6364
|
+
hasWarning: props.hasWarning
|
|
6215
6365
|
})
|
|
6216
6366
|
});
|
|
6217
6367
|
}
|
|
@@ -6238,7 +6388,8 @@ function CustomCategoryReferenceInput(props) {
|
|
|
6238
6388
|
hasError: props.hasError,
|
|
6239
6389
|
isReadOnly: props.isReadOnly,
|
|
6240
6390
|
isDisabled: props.isDisabled,
|
|
6241
|
-
isClearable: !props.fieldDefinition.required
|
|
6391
|
+
isClearable: !props.fieldDefinition.required,
|
|
6392
|
+
hasWarning: props.hasWarning
|
|
6242
6393
|
});
|
|
6243
6394
|
}
|
|
6244
6395
|
CustomCategoryReferenceInput.displayName = 'CustomCategoryReferenceInput';
|
|
@@ -6264,7 +6415,8 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6264
6415
|
onBlur: handleBlur,
|
|
6265
6416
|
hasError: props.hasError,
|
|
6266
6417
|
isDisabled: props.isDisabled || props.isReadOnly,
|
|
6267
|
-
isClearable: !props.fieldDefinition.required
|
|
6418
|
+
isClearable: !props.fieldDefinition.required,
|
|
6419
|
+
hasWarning: props.hasWarning
|
|
6268
6420
|
});
|
|
6269
6421
|
}
|
|
6270
6422
|
|
|
@@ -6297,7 +6449,8 @@ const ProductPickerInput = _ref => {
|
|
|
6297
6449
|
value = _ref.value,
|
|
6298
6450
|
hasError = _ref.hasError,
|
|
6299
6451
|
onError = _ref.onError,
|
|
6300
|
-
showLoadingErrorMessage = _ref.showLoadingErrorMessage
|
|
6452
|
+
showLoadingErrorMessage = _ref.showLoadingErrorMessage,
|
|
6453
|
+
hasWarning = _ref.hasWarning;
|
|
6301
6454
|
const formatLocalizedFieldToString = useFormatLocalizedFieldToString();
|
|
6302
6455
|
const _useIntl = reactIntl.useIntl(),
|
|
6303
6456
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -6380,7 +6533,10 @@ const ProductPickerInput = _ref => {
|
|
|
6380
6533
|
onBlur: onBlur,
|
|
6381
6534
|
value: currentOption.data,
|
|
6382
6535
|
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6383
|
-
hasError: hasError || isLoadingFailed
|
|
6536
|
+
hasError: hasError || isLoadingFailed,
|
|
6537
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
6538
|
+
menuPortalTarget: document.body,
|
|
6539
|
+
hasWarning: hasWarning
|
|
6384
6540
|
})
|
|
6385
6541
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6386
6542
|
tone: "negative",
|
|
@@ -6403,7 +6559,8 @@ function CustomProductReferenceInput(props) {
|
|
|
6403
6559
|
onChange: props.onChange,
|
|
6404
6560
|
hasError: props.hasError,
|
|
6405
6561
|
onError: () => null,
|
|
6406
|
-
showLoadingErrorMessage: true
|
|
6562
|
+
showLoadingErrorMessage: true,
|
|
6563
|
+
hasWarning: props.hasWarning
|
|
6407
6564
|
});
|
|
6408
6565
|
}
|
|
6409
6566
|
CustomProductReferenceInput.displayName = 'CustomProductReferenceInput';
|
|
@@ -6419,7 +6576,8 @@ function CustomProductTypeReferenceInput(props) {
|
|
|
6419
6576
|
onBlur: props.onBlur,
|
|
6420
6577
|
onChange: props.onChange,
|
|
6421
6578
|
hasError: props.hasError,
|
|
6422
|
-
onError: () => null
|
|
6579
|
+
onError: () => null,
|
|
6580
|
+
hasWarning: props.hasWarning
|
|
6423
6581
|
});
|
|
6424
6582
|
}
|
|
6425
6583
|
CustomProductTypeReferenceInput.displayName = 'CustomProductTypeReferenceInput';
|
|
@@ -6435,7 +6593,8 @@ function CustomChannelReferenceInput(props) {
|
|
|
6435
6593
|
onBlur: props.onBlur,
|
|
6436
6594
|
onChange: props.onChange,
|
|
6437
6595
|
hasError: props.hasError,
|
|
6438
|
-
onError: () => null
|
|
6596
|
+
onError: () => null,
|
|
6597
|
+
hasWarning: props.hasWarning
|
|
6439
6598
|
});
|
|
6440
6599
|
}
|
|
6441
6600
|
CustomChannelReferenceInput.displayName = 'CustomChannelReferenceInput';
|
|
@@ -6451,7 +6610,8 @@ function CustomStateReferenceInput(props) {
|
|
|
6451
6610
|
onBlur: props.onBlur,
|
|
6452
6611
|
onChange: props.onChange,
|
|
6453
6612
|
hasError: props.hasError,
|
|
6454
|
-
onError: () => null
|
|
6613
|
+
onError: () => null,
|
|
6614
|
+
hasWarning: props.hasWarning
|
|
6455
6615
|
});
|
|
6456
6616
|
}
|
|
6457
6617
|
CustomStateReferenceInput.displayName = 'CustomStateReferenceInput';
|
|
@@ -6465,6 +6625,7 @@ function CustomReferenceInput(props) {
|
|
|
6465
6625
|
typeId: referenceTypeId
|
|
6466
6626
|
} : undefined;
|
|
6467
6627
|
props.setFieldValue(props.name, nullifiedIfNeeded);
|
|
6628
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6468
6629
|
});
|
|
6469
6630
|
const ReferenceInputComponent = referenceTypeId === SEARCHABLE_REFERENCES.category ? CustomCategoryReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount ? CustomCartDiscountReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.product ? CustomProductReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.productType ? CustomProductTypeReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.channel ? CustomChannelReferenceInput : referenceTypeId === SEARCHABLE_REFERENCES.state ? CustomStateReferenceInput : CustomRawIdReferenceInput;
|
|
6470
6631
|
return jsxRuntime.jsx(ReferenceInputComponent, {
|
|
@@ -6477,7 +6638,8 @@ function CustomReferenceInput(props) {
|
|
|
6477
6638
|
isReadOnly: props.isReadOnly,
|
|
6478
6639
|
onBlur: props.onBlur,
|
|
6479
6640
|
hasError: props.hasError,
|
|
6480
|
-
onChange: handleChange
|
|
6641
|
+
onChange: handleChange,
|
|
6642
|
+
hasWarning: props.hasWarning
|
|
6481
6643
|
});
|
|
6482
6644
|
}
|
|
6483
6645
|
CustomReferenceInput.displayName = 'CustomReferenceInput';
|
|
@@ -6488,6 +6650,7 @@ function CustomDateTimeInput(props) {
|
|
|
6488
6650
|
const typeName = props.fieldDefinition.type.name.toLowerCase();
|
|
6489
6651
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6490
6652
|
props.setFieldValue(props.name, rawValue || undefined);
|
|
6653
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6491
6654
|
});
|
|
6492
6655
|
const InputComponent = typeName === 'date' ? uiKit.DateInput : uiKit.DateTimeInput;
|
|
6493
6656
|
return jsxRuntime.jsx(InputComponent, {
|
|
@@ -6499,7 +6662,8 @@ function CustomDateTimeInput(props) {
|
|
|
6499
6662
|
timeZone: timeZone,
|
|
6500
6663
|
hasError: props.hasError,
|
|
6501
6664
|
isDisabled: props.isDisabled,
|
|
6502
|
-
isReadOnly: props.isReadOnly
|
|
6665
|
+
isReadOnly: props.isReadOnly,
|
|
6666
|
+
hasWarning: props.hasWarning
|
|
6503
6667
|
});
|
|
6504
6668
|
}
|
|
6505
6669
|
CustomDateTimeInput.displayName = 'CustomDateTimeInput';
|
|
@@ -6534,6 +6698,7 @@ function CustomTimeInput(props) {
|
|
|
6534
6698
|
lastValueSentToFormik.current = in24hFormat;
|
|
6535
6699
|
props.setFieldValue(props.name, in24hFormat);
|
|
6536
6700
|
}
|
|
6701
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6537
6702
|
});
|
|
6538
6703
|
return jsxRuntime.jsx(uiKit.TimeInput, {
|
|
6539
6704
|
id: props.name,
|
|
@@ -6544,7 +6709,8 @@ function CustomTimeInput(props) {
|
|
|
6544
6709
|
timeZone: timeZone,
|
|
6545
6710
|
hasError: props.hasError,
|
|
6546
6711
|
isDisabled: props.isDisabled,
|
|
6547
|
-
isReadOnly: props.isReadOnly
|
|
6712
|
+
isReadOnly: props.isReadOnly,
|
|
6713
|
+
hasWarning: props.hasWarning
|
|
6548
6714
|
});
|
|
6549
6715
|
}
|
|
6550
6716
|
CustomTimeInput.displayName = 'CustomTimeInput';
|
|
@@ -6555,7 +6721,10 @@ const convertTypeValuesToOptions = reselect.defaultMemoize(typeValues => _mapIns
|
|
|
6555
6721
|
})));
|
|
6556
6722
|
function CustomEnumInput(props) {
|
|
6557
6723
|
const options = convertTypeValuesToOptions(_valuesInstanceProperty__default["default"](props.fieldDefinition.type));
|
|
6558
|
-
const handleChange = makeChangeHandler(rawValue =>
|
|
6724
|
+
const handleChange = makeChangeHandler(rawValue => {
|
|
6725
|
+
props.setFieldValue(props.name, rawValue);
|
|
6726
|
+
props.renderWarnings && props.handleWarningChange(props.name, props.fieldDefinition, rawValue);
|
|
6727
|
+
});
|
|
6559
6728
|
const tooltipTitle = props.value ? _findInstanceProperty__default["default"](options).call(options, option => option.value === props.value)?.label ?? '' : '';
|
|
6560
6729
|
return jsxRuntime.jsx(CustomFieldTooltip, {
|
|
6561
6730
|
title: tooltipTitle,
|
|
@@ -6569,7 +6738,10 @@ function CustomEnumInput(props) {
|
|
|
6569
6738
|
options: options,
|
|
6570
6739
|
hasError: props.hasError,
|
|
6571
6740
|
isDisabled: props.isDisabled,
|
|
6572
|
-
isReadOnly: props.isReadOnly
|
|
6741
|
+
isReadOnly: props.isReadOnly,
|
|
6742
|
+
hasWarning: props.hasWarning,
|
|
6743
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
6744
|
+
menuPortalTarget: document.body
|
|
6573
6745
|
})
|
|
6574
6746
|
});
|
|
6575
6747
|
}
|
|
@@ -6618,14 +6790,17 @@ function CustomBooleanInputSet(props) {
|
|
|
6618
6790
|
onBlur: props.onBlur,
|
|
6619
6791
|
isClearable: !props.fieldDefinition.required,
|
|
6620
6792
|
hasError: props.hasError,
|
|
6793
|
+
hasWarning: props.hasWarning,
|
|
6621
6794
|
isDisabled: props.isDisabled,
|
|
6622
|
-
isReadOnly: props.isReadOnly
|
|
6795
|
+
isReadOnly: props.isReadOnly,
|
|
6796
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
6797
|
+
menuPortalTarget: document.body
|
|
6623
6798
|
});
|
|
6624
6799
|
}
|
|
6625
6800
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6626
6801
|
|
|
6627
|
-
function ownKeys$
|
|
6628
|
-
function _objectSpread$
|
|
6802
|
+
function ownKeys$Q(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6803
|
+
function _objectSpread$Q(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$Q(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$Q(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6629
6804
|
const getTypeName = type => type.name.toLowerCase();
|
|
6630
6805
|
const findLabel = (enumType, key) => {
|
|
6631
6806
|
var _context;
|
|
@@ -6670,12 +6845,13 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6670
6845
|
inputTip: attributeDefinition.inputTip,
|
|
6671
6846
|
required: attributeDefinition.isRequired,
|
|
6672
6847
|
type: attributeDefinition.type,
|
|
6673
|
-
assignedAttributeGroups: attributeDefinition.assignedAttributeGroups
|
|
6848
|
+
assignedAttributeGroups: attributeDefinition.assignedAttributeGroups,
|
|
6849
|
+
attributeConstraint: attributeDefinition.attributeConstraint
|
|
6674
6850
|
});
|
|
6675
6851
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6676
6852
|
let name = _ref2.name,
|
|
6677
6853
|
value = _ref2.value;
|
|
6678
|
-
return _objectSpread$
|
|
6854
|
+
return _objectSpread$Q(_objectSpread$Q({}, result), {}, {
|
|
6679
6855
|
[name]: value
|
|
6680
6856
|
});
|
|
6681
6857
|
}, {});
|
|
@@ -6692,11 +6868,14 @@ const attributesMapToNameValuePairs = map => {
|
|
|
6692
6868
|
});
|
|
6693
6869
|
};
|
|
6694
6870
|
|
|
6871
|
+
const _excluded$1 = ["WrapperComponent"];
|
|
6695
6872
|
const getAttributeShortName = (fullName, attributesPrefix) => {
|
|
6696
6873
|
if (!attributesPrefix) return fullName;
|
|
6697
6874
|
return fullName.replace(`${attributesPrefix}.`, '');
|
|
6698
6875
|
};
|
|
6699
|
-
function ProductAttributes(
|
|
6876
|
+
function ProductAttributes(_ref) {
|
|
6877
|
+
let WrapperComponent = _ref.WrapperComponent,
|
|
6878
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
6700
6879
|
const formik$1 = formik.useFormikContext();
|
|
6701
6880
|
const fieldDefinitions = React.useMemo(() => {
|
|
6702
6881
|
var _context;
|
|
@@ -6720,7 +6899,11 @@ function ProductAttributes(props) {
|
|
|
6720
6899
|
isDisabled: props.isDisabled,
|
|
6721
6900
|
fieldDefinitions: fieldDefinitions,
|
|
6722
6901
|
setFieldValue: setFieldValue,
|
|
6723
|
-
inputValuesConverter: convertInputValue
|
|
6902
|
+
inputValuesConverter: convertInputValue,
|
|
6903
|
+
WrapperComponent: WrapperComponent,
|
|
6904
|
+
renderWarnings: props.renderWarnings,
|
|
6905
|
+
renderCustomWarnings: props.renderCustomWarnings,
|
|
6906
|
+
handleWarningChange: props.handleWarningChange
|
|
6724
6907
|
})
|
|
6725
6908
|
})
|
|
6726
6909
|
});
|
|
@@ -6772,23 +6955,23 @@ const messages$y = reactIntl.defineMessages({
|
|
|
6772
6955
|
}
|
|
6773
6956
|
});
|
|
6774
6957
|
|
|
6775
|
-
function ownKeys$
|
|
6776
|
-
function _objectSpread$
|
|
6958
|
+
function ownKeys$P(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6959
|
+
function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$P(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$P(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6777
6960
|
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 } } } };
|
|
6778
6961
|
const mapAttributeDefinition = definition => {
|
|
6779
6962
|
var _context, _context2, _context3, _context4;
|
|
6780
|
-
return _objectSpread$
|
|
6963
|
+
return _objectSpread$P(_objectSpread$P({}, definition), {}, {
|
|
6781
6964
|
required: definition.isRequired,
|
|
6782
6965
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6783
6966
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6784
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, definition.type?.elementType?.name) ? _objectSpread$
|
|
6785
|
-
elementType: _objectSpread$
|
|
6967
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, definition.type?.elementType?.name) ? _objectSpread$P(_objectSpread$P({}, definition.type), {}, {
|
|
6968
|
+
elementType: _objectSpread$P(_objectSpread$P({}, definition.type.elementType), {}, {
|
|
6786
6969
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6787
6970
|
key: value.key,
|
|
6788
6971
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6789
6972
|
}))
|
|
6790
6973
|
})
|
|
6791
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, definition.type?.name) ? _objectSpread$
|
|
6974
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, definition.type?.name) ? _objectSpread$P(_objectSpread$P({}, definition.type), {}, {
|
|
6792
6975
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6793
6976
|
key: value.key,
|
|
6794
6977
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6909,8 +7092,8 @@ var messages$x = reactIntl.defineMessages({
|
|
|
6909
7092
|
|
|
6910
7093
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6911
7094
|
|
|
6912
|
-
function ownKeys$
|
|
6913
|
-
function _objectSpread$
|
|
7095
|
+
function ownKeys$O(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7096
|
+
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$O(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$O(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
6914
7097
|
const EditButton = props => {
|
|
6915
7098
|
const _useIntl = reactIntl.useIntl(),
|
|
6916
7099
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -6980,7 +7163,8 @@ const NestedAttributeModalPage = props => {
|
|
|
6980
7163
|
children: jsxRuntime.jsx(ProductAttributes, {
|
|
6981
7164
|
isDisabled: props.isDisabled,
|
|
6982
7165
|
isReadOnly: props.isReadOnly,
|
|
6983
|
-
attributeDefinitions: props.productType.attributeDefinitions
|
|
7166
|
+
attributeDefinitions: props.productType.attributeDefinitions,
|
|
7167
|
+
WrapperComponent: props.WrapperComponent
|
|
6984
7168
|
})
|
|
6985
7169
|
})
|
|
6986
7170
|
})
|
|
@@ -7057,13 +7241,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7057
7241
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7058
7242
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7059
7243
|
const openNestedAttributesForm = () => {
|
|
7060
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7244
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7061
7245
|
hideSaveToolbar: true
|
|
7062
7246
|
}));
|
|
7063
7247
|
attributesForm.openModal();
|
|
7064
7248
|
};
|
|
7065
7249
|
const closeNestedAttributesForm = () => {
|
|
7066
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
7250
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$O(_objectSpread$O({}, parentFormik.status), {}, {
|
|
7067
7251
|
hideSaveToolbar: false
|
|
7068
7252
|
}));
|
|
7069
7253
|
attributesForm.closeModal();
|
|
@@ -7099,7 +7283,8 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7099
7283
|
isOpen: attributesForm.isModalOpen,
|
|
7100
7284
|
title: formTitle,
|
|
7101
7285
|
onClose: closeNestedAttributesForm,
|
|
7102
|
-
productType: productType
|
|
7286
|
+
productType: productType,
|
|
7287
|
+
WrapperComponent: props.WrapperComponent
|
|
7103
7288
|
})]
|
|
7104
7289
|
})
|
|
7105
7290
|
})
|
|
@@ -7109,7 +7294,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7109
7294
|
});
|
|
7110
7295
|
CustomNestedInput.displayName = 'CustomNestedInput';
|
|
7111
7296
|
|
|
7112
|
-
var styles$
|
|
7297
|
+
var styles$e = {
|
|
7113
7298
|
"divider": "divider-module__divider___4-vdy",
|
|
7114
7299
|
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
7115
7300
|
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
@@ -7122,10 +7307,10 @@ function Divider(_ref) {
|
|
|
7122
7307
|
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
7123
7308
|
return jsxRuntime.jsx("hr", {
|
|
7124
7309
|
className: classnames__default["default"]({
|
|
7125
|
-
[styles$
|
|
7126
|
-
[styles$
|
|
7127
|
-
[styles$
|
|
7128
|
-
[styles$
|
|
7310
|
+
[styles$e['divider-solid']]: !isDashed,
|
|
7311
|
+
[styles$e['divider-dashed']]: isDashed,
|
|
7312
|
+
[styles$e['divider-horizontal']]: orientation === 'horizontal',
|
|
7313
|
+
[styles$e['divider-vertical']]: orientation === 'vertical'
|
|
7129
7314
|
})
|
|
7130
7315
|
});
|
|
7131
7316
|
}
|
|
@@ -7145,7 +7330,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
|
|
|
7145
7330
|
}) : null;
|
|
7146
7331
|
ExpandButton.displayName = 'ExpandButton';
|
|
7147
7332
|
|
|
7148
|
-
var styles$
|
|
7333
|
+
var styles$d = {
|
|
7149
7334
|
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
7150
7335
|
"gap": "set-buttons-module__gap___38Qr0"
|
|
7151
7336
|
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
@@ -7166,15 +7351,15 @@ const SetButtons = props => {
|
|
|
7166
7351
|
size: "big",
|
|
7167
7352
|
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
7168
7353
|
}) : jsxRuntime.jsx("div", {
|
|
7169
|
-
className: styles$
|
|
7354
|
+
className: styles$d.gap
|
|
7170
7355
|
})]
|
|
7171
7356
|
})
|
|
7172
7357
|
});
|
|
7173
7358
|
};
|
|
7174
7359
|
SetButtons.displayName = 'SetButtons';
|
|
7175
7360
|
|
|
7176
|
-
function ownKeys$
|
|
7177
|
-
function _objectSpread$
|
|
7361
|
+
function ownKeys$N(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7362
|
+
function _objectSpread$N(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$N(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7178
7363
|
const getDuplicateErrors = setValues => {
|
|
7179
7364
|
/* eslint-disable no-plusplus */
|
|
7180
7365
|
const result = [];
|
|
@@ -7228,7 +7413,7 @@ function CustomInputSet(props) {
|
|
|
7228
7413
|
touched = _useFormikContext.touched,
|
|
7229
7414
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7230
7415
|
dirty = _useFormikContext.dirty;
|
|
7231
|
-
const itemFieldDefinition = _objectSpread$
|
|
7416
|
+
const itemFieldDefinition = _objectSpread$N(_objectSpread$N({}, props.fieldDefinition), {}, {
|
|
7232
7417
|
type: props.fieldDefinition.type.elementType
|
|
7233
7418
|
});
|
|
7234
7419
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7325,7 +7510,11 @@ function CustomInputSet(props) {
|
|
|
7325
7510
|
onBlur: props.onBlur,
|
|
7326
7511
|
setFieldValue: setItemValue,
|
|
7327
7512
|
value: fieldValue,
|
|
7328
|
-
hasError: props.hasError
|
|
7513
|
+
hasError: props.hasError,
|
|
7514
|
+
hasWarning: props.hasWarning,
|
|
7515
|
+
WrapperComponent: props.WrapperComponent,
|
|
7516
|
+
renderWarnings: props.renderWarnings,
|
|
7517
|
+
handleWarningChange: props.handleWarningChange
|
|
7329
7518
|
}), jsxRuntime.jsx(SetButtons, {
|
|
7330
7519
|
index: index,
|
|
7331
7520
|
isFirstItem: !isExpanded || index === 0,
|
|
@@ -7388,7 +7577,10 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7388
7577
|
isReadOnly: props.isReadOnly,
|
|
7389
7578
|
onBlur: props.onBlur,
|
|
7390
7579
|
setFieldValue: props.setFieldValue,
|
|
7391
|
-
hasError: props.hasError
|
|
7580
|
+
hasError: props.hasError,
|
|
7581
|
+
hasWarning: props.hasWarning,
|
|
7582
|
+
handleWarningChange: props.handleWarningChange,
|
|
7583
|
+
renderWarnings: props.renderWarnings
|
|
7392
7584
|
});
|
|
7393
7585
|
});
|
|
7394
7586
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
@@ -7401,10 +7593,10 @@ var messages$w = reactIntl.defineMessages({
|
|
|
7401
7593
|
}
|
|
7402
7594
|
});
|
|
7403
7595
|
|
|
7404
|
-
function ownKeys$
|
|
7405
|
-
function _objectSpread$
|
|
7596
|
+
function ownKeys$M(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7597
|
+
function _objectSpread$M(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$M(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$M(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7406
7598
|
function ProductTypeReference(props) {
|
|
7407
|
-
const productTypeMessage = _objectSpread$
|
|
7599
|
+
const productTypeMessage = _objectSpread$M(_objectSpread$M({}, messages$w.referencedProductType), {}, {
|
|
7408
7600
|
values: {
|
|
7409
7601
|
productTypeName: props.productType.name
|
|
7410
7602
|
}
|
|
@@ -7444,15 +7636,18 @@ function CustomNestedFieldInput(props) {
|
|
|
7444
7636
|
isDisabled: props.isDisabled,
|
|
7445
7637
|
isReadOnly: props.isReadOnly,
|
|
7446
7638
|
setFieldValue: props.setFieldValue,
|
|
7447
|
-
onBlur: props.onBlur
|
|
7639
|
+
onBlur: props.onBlur,
|
|
7640
|
+
hasWarning: props.hasWarning,
|
|
7641
|
+
handleWarningChange: props.handleWarningChange,
|
|
7642
|
+
renderWarnings: props.renderWarnings
|
|
7448
7643
|
})]
|
|
7449
7644
|
});
|
|
7450
7645
|
}
|
|
7451
7646
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7452
7647
|
|
|
7453
|
-
function ownKeys$
|
|
7454
|
-
function _objectSpread$
|
|
7455
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7648
|
+
function ownKeys$L(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7649
|
+
function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$L(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$L(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7650
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$L(_objectSpread$L({}, result), itemErrors), {});
|
|
7456
7651
|
|
|
7457
7652
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7458
7653
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7509,8 +7704,8 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7509
7704
|
}
|
|
7510
7705
|
});
|
|
7511
7706
|
|
|
7512
|
-
function ownKeys$
|
|
7513
|
-
function _objectSpread$
|
|
7707
|
+
function ownKeys$K(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7708
|
+
function _objectSpread$K(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$K(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$K(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7514
7709
|
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 } } } };
|
|
7515
7710
|
const CustomFieldsLabelHint = _ref2 => {
|
|
7516
7711
|
let fieldDefinition = _ref2.fieldDefinition;
|
|
@@ -7539,7 +7734,7 @@ const CustomFieldsLabelHint = _ref2 => {
|
|
|
7539
7734
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7540
7735
|
size: "medium",
|
|
7541
7736
|
color: "warning"
|
|
7542
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7737
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$K({}, messages$v.cartDiscountMoreThan500))]
|
|
7543
7738
|
});
|
|
7544
7739
|
}
|
|
7545
7740
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7639,6 +7834,9 @@ const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref5 => {
|
|
|
7639
7834
|
});
|
|
7640
7835
|
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
7641
7836
|
|
|
7837
|
+
const _excluded = ["WrapperComponent"];
|
|
7838
|
+
function ownKeys$J(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7839
|
+
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$J(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$J(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7642
7840
|
const getFieldName = (parentName, fieldName) => {
|
|
7643
7841
|
if (!parentName) return fieldName;
|
|
7644
7842
|
return `${parentName}.${fieldName}`;
|
|
@@ -7652,24 +7850,31 @@ const isNested = fieldDefinition => {
|
|
|
7652
7850
|
}
|
|
7653
7851
|
return typeName === CUSTOM_FIELD_TYPES.nested;
|
|
7654
7852
|
};
|
|
7655
|
-
const CustomFieldsInternal =
|
|
7853
|
+
const CustomFieldsInternal = _ref => {
|
|
7854
|
+
let WrapperComponent = _ref.WrapperComponent,
|
|
7855
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7656
7856
|
const _useFormikContext = formik.useFormikContext(),
|
|
7657
7857
|
errors = _useFormikContext.errors,
|
|
7658
7858
|
touched = _useFormikContext.touched,
|
|
7659
7859
|
values = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
7660
|
-
handleBlur = _useFormikContext.handleBlur
|
|
7860
|
+
handleBlur = _useFormikContext.handleBlur,
|
|
7861
|
+
status = _useFormikContext.status;
|
|
7661
7862
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7662
7863
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7663
7864
|
const _useDnDContext = useDnDContext(),
|
|
7664
7865
|
DroppableWrapper = _useDnDContext.DroppableWrapper,
|
|
7665
7866
|
DraggableWrapper = _useDnDContext.DraggableWrapper,
|
|
7666
|
-
|
|
7867
|
+
isDnDMode = _useDnDContext.isDnDMode,
|
|
7868
|
+
onDragEnd = _useDnDContext.onDragEnd;
|
|
7869
|
+
const fieldKey = props.isDisabled ? 'disabled' : 'enabled';
|
|
7667
7870
|
return jsxRuntime.jsx(DroppableWrapper, {
|
|
7871
|
+
onDragEnd: onDragEnd,
|
|
7668
7872
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7669
7873
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
7670
7874
|
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7671
7875
|
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7672
7876
|
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7877
|
+
|
|
7673
7878
|
// We want to highlight fields with errors not only after a form submission,
|
|
7674
7879
|
// but also after manually triggered form validation.
|
|
7675
7880
|
const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
|
|
@@ -7679,6 +7884,21 @@ const CustomFieldsInternal = props => {
|
|
|
7679
7884
|
};
|
|
7680
7885
|
return undefined;
|
|
7681
7886
|
};
|
|
7887
|
+
const FieldComponent = isNested(fieldDefinition) ? CustomNestedFieldInput : CustomFieldInput;
|
|
7888
|
+
const fieldProps = {
|
|
7889
|
+
name: fieldName,
|
|
7890
|
+
value: value,
|
|
7891
|
+
fieldDefinition: fieldDefinition,
|
|
7892
|
+
isDisabled: props.isDisabled || isDnDMode,
|
|
7893
|
+
isReadOnly: props.isReadOnly,
|
|
7894
|
+
onBlur: handleBlur,
|
|
7895
|
+
setFieldValue: props.setFieldValue,
|
|
7896
|
+
hasError: hasError,
|
|
7897
|
+
hasWarning: props.renderWarnings && status?.warnings[fieldName],
|
|
7898
|
+
handleWarningChange: props.handleWarningChange,
|
|
7899
|
+
renderWarnings: props.renderWarnings
|
|
7900
|
+
};
|
|
7901
|
+
const Field = jsxRuntime.jsx(FieldComponent, _objectSpread$J({}, fieldProps));
|
|
7682
7902
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7683
7903
|
name: fieldName,
|
|
7684
7904
|
validate: validate,
|
|
@@ -7698,24 +7918,9 @@ const CustomFieldsInternal = props => {
|
|
|
7698
7918
|
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7699
7919
|
scale: "xs",
|
|
7700
7920
|
alignItems: "stretch",
|
|
7701
|
-
children: [
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
fieldDefinition: fieldDefinition,
|
|
7705
|
-
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7706
|
-
isReadOnly: props.isReadOnly,
|
|
7707
|
-
onBlur: handleBlur,
|
|
7708
|
-
setFieldValue: props.setFieldValue
|
|
7709
|
-
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7710
|
-
name: fieldName,
|
|
7711
|
-
value: value,
|
|
7712
|
-
fieldDefinition: fieldDefinition,
|
|
7713
|
-
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7714
|
-
isReadOnly: props.isReadOnly,
|
|
7715
|
-
onBlur: handleBlur,
|
|
7716
|
-
setFieldValue: props.setFieldValue,
|
|
7717
|
-
hasError: hasError
|
|
7718
|
-
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7921
|
+
children: [WrapperComponent ? jsxRuntime.jsx(WrapperComponent, {
|
|
7922
|
+
children: Field
|
|
7923
|
+
}) : Field, props.renderWarnings && status?.warnings[fieldName] && props.renderCustomWarnings(fieldDefinition), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7719
7924
|
isTouched: isTouched,
|
|
7720
7925
|
errors: fieldErrors
|
|
7721
7926
|
})]
|
|
@@ -7723,11 +7928,14 @@ const CustomFieldsInternal = props => {
|
|
|
7723
7928
|
})
|
|
7724
7929
|
})
|
|
7725
7930
|
})
|
|
7726
|
-
}, `${fieldName}-${index}`);
|
|
7931
|
+
}, `${fieldName}-${index}-${fieldKey}`);
|
|
7727
7932
|
})
|
|
7728
7933
|
});
|
|
7729
7934
|
};
|
|
7730
7935
|
CustomFieldsInternal.displayName = 'CustomFieldsInternal';
|
|
7936
|
+
CustomFieldsInternal.defaultProps = {
|
|
7937
|
+
renderCustomWarnings: () => null
|
|
7938
|
+
};
|
|
7731
7939
|
|
|
7732
7940
|
const nopConverter = (fieldName, fieldValue) => fieldValue;
|
|
7733
7941
|
const CustomFields = props => {
|
|
@@ -7746,7 +7954,8 @@ const CustomFields = props => {
|
|
|
7746
7954
|
isDisabled: props.isDisabled,
|
|
7747
7955
|
fieldDefinitions: props.fieldDefinitions,
|
|
7748
7956
|
setFieldValue: setFieldValue,
|
|
7749
|
-
inputValuesConverter: nopConverter
|
|
7957
|
+
inputValuesConverter: nopConverter,
|
|
7958
|
+
WrapperComponent: props.WrapperComponent
|
|
7750
7959
|
})
|
|
7751
7960
|
})
|
|
7752
7961
|
});
|
|
@@ -7859,6 +8068,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7859
8068
|
isReadOnly: props.isReadOnly,
|
|
7860
8069
|
hasWarning: props.hasWarning,
|
|
7861
8070
|
hasError: props.hasError,
|
|
8071
|
+
errors: {
|
|
8072
|
+
missing: props.hasError
|
|
8073
|
+
},
|
|
8074
|
+
touched: props.touched,
|
|
7862
8075
|
isClearable: props.isClearable,
|
|
7863
8076
|
menuPortalTarget: props.menuPortalTarget,
|
|
7864
8077
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
@@ -7978,6 +8191,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7978
8191
|
defaultOptions: getDefaultOptions(),
|
|
7979
8192
|
hasWarning: props.hasWarning,
|
|
7980
8193
|
hasError: props.hasError,
|
|
8194
|
+
errors: {
|
|
8195
|
+
missing: props.hasError
|
|
8196
|
+
},
|
|
8197
|
+
touched: props.touched,
|
|
7981
8198
|
isClearable: props.isClearable,
|
|
7982
8199
|
menuPortalTarget: props.menuPortalTarget,
|
|
7983
8200
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
@@ -8122,6 +8339,10 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8122
8339
|
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8123
8340
|
isReadOnly: props.isReadOnly,
|
|
8124
8341
|
hasWarning: props.hasWarning,
|
|
8342
|
+
errors: {
|
|
8343
|
+
missing: props.hasError
|
|
8344
|
+
},
|
|
8345
|
+
touched: props.touched,
|
|
8125
8346
|
isClearable: props.isClearable,
|
|
8126
8347
|
hasError: props.hasError,
|
|
8127
8348
|
menuPortalTarget: props.menuPortalTarget,
|
|
@@ -8472,6 +8693,11 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8472
8693
|
const currentValuesLength = _Array$isArray__default["default"](currentValues) ? currentValues.length : 1;
|
|
8473
8694
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8474
8695
|
};
|
|
8696
|
+
const getCustomGroupLabelOption = customLabel => [{
|
|
8697
|
+
label: customLabel,
|
|
8698
|
+
value: '',
|
|
8699
|
+
isDisabled: true
|
|
8700
|
+
}];
|
|
8475
8701
|
|
|
8476
8702
|
var messages$s = reactIntl.defineMessages({
|
|
8477
8703
|
basicSelectInputPlaceholder: {
|
|
@@ -8567,16 +8793,23 @@ const StoresAsyncSelectInput = props => {
|
|
|
8567
8793
|
}));
|
|
8568
8794
|
}, [dataLocale, storesListFetcher.stores, props.renderSelectInputOptionValuesByField]);
|
|
8569
8795
|
const handleLoadOptions = async searchTerm => {
|
|
8570
|
-
if (!searchTerm)
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8796
|
+
if (!searchTerm) {
|
|
8797
|
+
const result = [...(props.renderLabel ? [{
|
|
8798
|
+
options: getCustomGroupLabelOption(props.renderLabel)
|
|
8799
|
+
}] : []), {
|
|
8800
|
+
options: getFirst60Options(mappedStoresListOptions, props.value)
|
|
8801
|
+
}, {
|
|
8802
|
+
options: emptyStoreOption(intl)
|
|
8803
|
+
}];
|
|
8804
|
+
return result;
|
|
8805
|
+
}
|
|
8575
8806
|
const filteredOptions = _filterInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, storeOption => {
|
|
8576
8807
|
var _context3, _context4;
|
|
8577
8808
|
return _includesInstanceProperty__default["default"](_context3 = storeOption.label.toLowerCase()).call(_context3, searchTerm.toLowerCase()) || storeOption.key && _includesInstanceProperty__default["default"](_context4 = storeOption.key.toLowerCase()).call(_context4, searchTerm.toLowerCase());
|
|
8578
8809
|
});
|
|
8579
|
-
return [{
|
|
8810
|
+
return [...(props.renderLabel ? [{
|
|
8811
|
+
options: getCustomGroupLabelOption(props.renderLabel)
|
|
8812
|
+
}] : []), {
|
|
8580
8813
|
options: getFirst60Options(filteredOptions, props.value)
|
|
8581
8814
|
}, {
|
|
8582
8815
|
options: emptyStoreOption(intl)
|
|
@@ -8584,7 +8817,7 @@ const StoresAsyncSelectInput = props => {
|
|
|
8584
8817
|
};
|
|
8585
8818
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8586
8819
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8587
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$D(_objectSpread$D({
|
|
8820
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$D(_objectSpread$D(_objectSpread$D({
|
|
8588
8821
|
id: props.id,
|
|
8589
8822
|
name: props.name,
|
|
8590
8823
|
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
@@ -8613,9 +8846,12 @@ const StoresAsyncSelectInput = props => {
|
|
|
8613
8846
|
maxMenuHeight: props.maxMenuHeight,
|
|
8614
8847
|
menuPortalTarget: props.menuPortalTarget,
|
|
8615
8848
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
8849
|
+
menuIsOpen: props.menuIsOpen,
|
|
8616
8850
|
components: props.components,
|
|
8617
8851
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
8618
|
-
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props))
|
|
8852
|
+
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)), props.iconLeft && {
|
|
8853
|
+
iconLeft: props.iconLeft
|
|
8854
|
+
})), jsxRuntime.jsx(uiKit.FieldErrors, {
|
|
8619
8855
|
errors: props.errors,
|
|
8620
8856
|
isVisible: hasError,
|
|
8621
8857
|
renderError: props.renderError
|
|
@@ -8652,12 +8888,17 @@ const StoresBasicSelectInput = props => {
|
|
|
8652
8888
|
const hasError = uiKit.SelectInput.isTouched(props.touched) && hasErrors$1(props.errors) || props.hasError;
|
|
8653
8889
|
const mappedStoresListOptions = React.useMemo(() => {
|
|
8654
8890
|
var _context2;
|
|
8655
|
-
|
|
8891
|
+
const results = _mapInstanceProperty__default["default"](_context2 = storesListFetcher.stores?.results || []).call(_context2, store => mapStoresToOptions({
|
|
8656
8892
|
store,
|
|
8657
8893
|
dataLocale,
|
|
8658
8894
|
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8659
8895
|
}));
|
|
8660
|
-
|
|
8896
|
+
return props?.renderLabel ? [{
|
|
8897
|
+
options: getCustomGroupLabelOption(props.renderLabel)
|
|
8898
|
+
}, {
|
|
8899
|
+
options: results
|
|
8900
|
+
}] : results;
|
|
8901
|
+
}, [dataLocale, storesListFetcher.stores, props.renderSelectInputOptionValuesByField, props?.renderLabel]);
|
|
8661
8902
|
const handleChange = event => {
|
|
8662
8903
|
const value = event.target.value?.value ?? event.target.value;
|
|
8663
8904
|
const currentStore = _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => store.value === value);
|
|
@@ -8675,10 +8916,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8675
8916
|
};
|
|
8676
8917
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8677
8918
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8678
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$C(_objectSpread$C({
|
|
8919
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$C(_objectSpread$C(_objectSpread$C({
|
|
8679
8920
|
id: props.id,
|
|
8680
8921
|
name: props.name,
|
|
8681
|
-
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8922
|
+
placeholder: props.placeholder || intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8682
8923
|
horizontalConstraint: props.horizontalConstraint,
|
|
8683
8924
|
options: mappedStoresListOptions,
|
|
8684
8925
|
isMulti: props.isMulti,
|
|
@@ -8698,9 +8939,12 @@ const StoresBasicSelectInput = props => {
|
|
|
8698
8939
|
maxMenuHeight: props.maxMenuHeight,
|
|
8699
8940
|
menuPortalTarget: props.menuPortalTarget,
|
|
8700
8941
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
8942
|
+
menuIsOpen: props.menuIsOpen,
|
|
8701
8943
|
components: props.components,
|
|
8702
8944
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
8703
|
-
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props))
|
|
8945
|
+
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props)), props.iconLeft && {
|
|
8946
|
+
iconLeft: props.iconLeft
|
|
8947
|
+
})), jsxRuntime.jsx(uiKit.FieldErrors, {
|
|
8704
8948
|
errors: props.errors,
|
|
8705
8949
|
isVisible: hasError,
|
|
8706
8950
|
renderError: props.renderError
|
|
@@ -8769,6 +9013,10 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8769
9013
|
function ownKeys$B(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8770
9014
|
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$B(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$B(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
8771
9015
|
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 } } } };
|
|
9016
|
+
var styles$c = {
|
|
9017
|
+
"renderLabelContainer": "stores-search-selector-module__renderLabelContainer___3_PBc",
|
|
9018
|
+
"customLabel": "stores-search-selector-module__customLabel___1Xse8"
|
|
9019
|
+
};
|
|
8772
9020
|
const hasErrors = errors => {
|
|
8773
9021
|
var _context;
|
|
8774
9022
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8856,15 +9104,33 @@ const StoresSearchSelectInput = props => {
|
|
|
8856
9104
|
fetchPolicy: 'network-only'
|
|
8857
9105
|
}).then(_ref3 => {
|
|
8858
9106
|
let data = _ref3.data;
|
|
8859
|
-
|
|
9107
|
+
const result = data.storesByWherePredicate?.results.map(store => mapStoresToOptions({
|
|
8860
9108
|
store,
|
|
8861
9109
|
dataLocale,
|
|
8862
9110
|
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8863
9111
|
}));
|
|
9112
|
+
if (!props.renderLabel) {
|
|
9113
|
+
return result;
|
|
9114
|
+
}
|
|
9115
|
+
return [...(props.renderLabel && result.length > 0 ? [{
|
|
9116
|
+
options: getCustomGroupLabelOption(props.renderLabel)
|
|
9117
|
+
}] : null), ...result];
|
|
8864
9118
|
});
|
|
8865
9119
|
return extractMatchedStores;
|
|
8866
9120
|
};
|
|
8867
9121
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
9122
|
+
const renderNoOptions = _ref4 => {
|
|
9123
|
+
let inputValue = _ref4.inputValue;
|
|
9124
|
+
return jsxRuntime.jsxs("div", {
|
|
9125
|
+
className: styles$c.renderLabelContainer,
|
|
9126
|
+
children: [jsxRuntime.jsx("div", {
|
|
9127
|
+
className: styles$c.customLabel,
|
|
9128
|
+
children: props?.renderLabel && props?.renderLabel
|
|
9129
|
+
}), jsxRuntime.jsx("div", {
|
|
9130
|
+
children: intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage)
|
|
9131
|
+
})]
|
|
9132
|
+
});
|
|
9133
|
+
};
|
|
8868
9134
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8869
9135
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8870
9136
|
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$B(_objectSpread$B({
|
|
@@ -8885,10 +9151,7 @@ const StoresSearchSelectInput = props => {
|
|
|
8885
9151
|
onChange: props.onChange,
|
|
8886
9152
|
onBlur: props.onBlur,
|
|
8887
9153
|
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8888
|
-
noOptionsMessage:
|
|
8889
|
-
let inputValue = _ref4.inputValue;
|
|
8890
|
-
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8891
|
-
},
|
|
9154
|
+
noOptionsMessage: renderNoOptions,
|
|
8892
9155
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8893
9156
|
isReadOnly: props.isReadOnly,
|
|
8894
9157
|
isClearable: props.isClearable,
|
|
@@ -8902,6 +9165,7 @@ const StoresSearchSelectInput = props => {
|
|
|
8902
9165
|
maxMenuHeight: props.maxMenuHeight,
|
|
8903
9166
|
menuPortalTarget: props.menuPortalTarget,
|
|
8904
9167
|
menuPortalZIndex: props.menuPortalZIndex,
|
|
9168
|
+
menuIsOpen: props.menuIsOpen,
|
|
8905
9169
|
components: props.components,
|
|
8906
9170
|
controlShouldRenderValue: props.controlShouldRenderValue
|
|
8907
9171
|
}, utils.filterDataAttributes(props)), utils.filterAriaAttributes(props))), jsxRuntime.jsx(uiKit.FieldErrors, {
|
|
@@ -8937,6 +9201,9 @@ const StoreSelectInput = props => {
|
|
|
8937
9201
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8938
9202
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8939
9203
|
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$A(_objectSpread$A({
|
|
9204
|
+
menuIsOpen: props.menuIsOpen,
|
|
9205
|
+
placeholder: props.placeholder,
|
|
9206
|
+
iconLeft: props.iconLeft,
|
|
8940
9207
|
projectKey: props.projectKey,
|
|
8941
9208
|
id: props.id,
|
|
8942
9209
|
name: props.name,
|
|
@@ -8955,6 +9222,7 @@ const StoreSelectInput = props => {
|
|
|
8955
9222
|
hasWarning: props.hasWarning,
|
|
8956
9223
|
errors: props.errors,
|
|
8957
9224
|
renderError: props.renderError,
|
|
9225
|
+
renderLabel: props.renderLabel,
|
|
8958
9226
|
touched: props.touched,
|
|
8959
9227
|
maxMenuHeight: props.maxMenuHeight,
|
|
8960
9228
|
menuPortalTarget: props.menuPortalTarget,
|
|
@@ -9224,9 +9492,9 @@ function numberTransformer(filterKey, filters) {
|
|
|
9224
9492
|
})) return '';
|
|
9225
9493
|
switch (type) {
|
|
9226
9494
|
case 'lessThan':
|
|
9227
|
-
return `(* to ${value - 1})`;
|
|
9495
|
+
return `(* to ${_parseInt__default["default"](value) - 1})`;
|
|
9228
9496
|
case 'moreThan':
|
|
9229
|
-
return `(${value + 1} to *)`;
|
|
9497
|
+
return `(${_parseInt__default["default"](value) + 1} to *)`;
|
|
9230
9498
|
case 'equalTo':
|
|
9231
9499
|
return `(${value} to ${value})`;
|
|
9232
9500
|
case 'range':
|
|
@@ -10902,8 +11170,20 @@ const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
|
10902
11170
|
|
|
10903
11171
|
function ownKeys$h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10904
11172
|
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$h(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$h(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
10905
|
-
function
|
|
10906
|
-
function
|
|
11173
|
+
function _callSuper$3(_this, derived, args) {
|
|
11174
|
+
function isNativeReflectConstruct() {
|
|
11175
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
11176
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
11177
|
+
if (typeof Proxy === "function") return true;
|
|
11178
|
+
try {
|
|
11179
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
11180
|
+
} catch (e) {
|
|
11181
|
+
return false;
|
|
11182
|
+
}
|
|
11183
|
+
}
|
|
11184
|
+
derived = _getPrototypeOf(derived);
|
|
11185
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
11186
|
+
}
|
|
10907
11187
|
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 } } } };
|
|
10908
11188
|
var IndexProject = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "IndexProject" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "reIndexAllProducts" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "reIndexAllProductTypes" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIndexProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indexingJobId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "existingIndexingJobId" }, 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 } } } };
|
|
10909
11189
|
var GetIndexingProgress = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetIndexingProgress" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", alias: { kind: "Name", value: "products" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productsJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, arguments: [], directives: [] }] } }, { kind: "Field", alias: { kind: "Name", value: "productTypes" }, name: { kind: "Name", value: "getReindexingStatus" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "productTypesJobId" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "include" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldIncludeProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "percentCompleted" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "completed" }, 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 } } } };
|
|
@@ -10923,14 +11203,13 @@ const getIndexingJobIds = _ref => {
|
|
|
10923
11203
|
};
|
|
10924
11204
|
let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
10925
11205
|
_inherits(PimIndexerProvider, _PureComponent);
|
|
10926
|
-
var _super = _createSuper$3(PimIndexerProvider);
|
|
10927
11206
|
function PimIndexerProvider() {
|
|
10928
11207
|
var _this;
|
|
10929
11208
|
_classCallCheck(this, PimIndexerProvider);
|
|
10930
11209
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10931
11210
|
args[_key] = arguments[_key];
|
|
10932
11211
|
}
|
|
10933
|
-
_this =
|
|
11212
|
+
_this = _callSuper$3(this, PimIndexerProvider, [...args]);
|
|
10934
11213
|
_this.state = {
|
|
10935
11214
|
isLoading: true,
|
|
10936
11215
|
isPimIndexerUnreachable: false,
|
|
@@ -11123,14 +11402,25 @@ var pimIndexerProvider = flowRight__default["default"](applicationShellConnector
|
|
|
11123
11402
|
name: 'indexProject'
|
|
11124
11403
|
}), hoc.withApollo, reactIntl.injectIntl, injectNotifications())(PimIndexerProvider);
|
|
11125
11404
|
|
|
11126
|
-
function
|
|
11127
|
-
function
|
|
11405
|
+
function _callSuper$2(_this, derived, args) {
|
|
11406
|
+
function isNativeReflectConstruct() {
|
|
11407
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
11408
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
11409
|
+
if (typeof Proxy === "function") return true;
|
|
11410
|
+
try {
|
|
11411
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
11412
|
+
} catch (e) {
|
|
11413
|
+
return false;
|
|
11414
|
+
}
|
|
11415
|
+
}
|
|
11416
|
+
derived = _getPrototypeOf(derived);
|
|
11417
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
11418
|
+
}
|
|
11128
11419
|
let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
11129
11420
|
_inherits(WithPimIndexer, _PureComponent);
|
|
11130
|
-
var _super = _createSuper$2(WithPimIndexer);
|
|
11131
11421
|
function WithPimIndexer() {
|
|
11132
11422
|
_classCallCheck(this, WithPimIndexer);
|
|
11133
|
-
return
|
|
11423
|
+
return _callSuper$2(this, WithPimIndexer, arguments);
|
|
11134
11424
|
}
|
|
11135
11425
|
_createClass(WithPimIndexer, [{
|
|
11136
11426
|
key: "render",
|
|
@@ -11496,8 +11786,20 @@ StoreSelectField.defaultProps = {
|
|
|
11496
11786
|
|
|
11497
11787
|
function ownKeys$b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11498
11788
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$b(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$b(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
11499
|
-
function
|
|
11500
|
-
function
|
|
11789
|
+
function _callSuper$1(_this, derived, args) {
|
|
11790
|
+
function isNativeReflectConstruct() {
|
|
11791
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
11792
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
11793
|
+
if (typeof Proxy === "function") return true;
|
|
11794
|
+
try {
|
|
11795
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
11796
|
+
} catch (e) {
|
|
11797
|
+
return false;
|
|
11798
|
+
}
|
|
11799
|
+
}
|
|
11800
|
+
derived = _getPrototypeOf(derived);
|
|
11801
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
11802
|
+
}
|
|
11501
11803
|
var styles$3 = {
|
|
11502
11804
|
"invalid": "validated-input-module__invalid___380EL",
|
|
11503
11805
|
"container": "validated-input-module__container___3L2KB"
|
|
@@ -11603,14 +11905,13 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11603
11905
|
});
|
|
11604
11906
|
let ValidatedInput = /*#__PURE__*/function (_PureComponent) {
|
|
11605
11907
|
_inherits(ValidatedInput, _PureComponent);
|
|
11606
|
-
var _super = _createSuper$1(ValidatedInput);
|
|
11607
11908
|
function ValidatedInput() {
|
|
11608
11909
|
var _this;
|
|
11609
11910
|
_classCallCheck(this, ValidatedInput);
|
|
11610
11911
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11611
11912
|
args[_key] = arguments[_key];
|
|
11612
11913
|
}
|
|
11613
|
-
_this =
|
|
11914
|
+
_this = _callSuper$1(this, ValidatedInput, [...args]);
|
|
11614
11915
|
_this.state = {
|
|
11615
11916
|
validStatus: _initialValidState
|
|
11616
11917
|
};
|
|
@@ -11727,14 +12028,13 @@ function simpleInput(type) {
|
|
|
11727
12028
|
var _class2;
|
|
11728
12029
|
return _class2 = /*#__PURE__*/function (_PureComponent2) {
|
|
11729
12030
|
_inherits(_class2, _PureComponent2);
|
|
11730
|
-
var _super2 = _createSuper$1(_class2);
|
|
11731
12031
|
function _class2() {
|
|
11732
12032
|
var _this2;
|
|
11733
12033
|
_classCallCheck(this, _class2);
|
|
11734
12034
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
11735
12035
|
args[_key2] = arguments[_key2];
|
|
11736
12036
|
}
|
|
11737
|
-
_this2 =
|
|
12037
|
+
_this2 = _callSuper$1(this, _class2, [...args]);
|
|
11738
12038
|
_this2.handleBlur = event => {
|
|
11739
12039
|
if (_this2.props.onBlurValue) _this2.props.onBlurValue(event.target.value);
|
|
11740
12040
|
};
|
|
@@ -11982,8 +12282,20 @@ MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
|
11982
12282
|
|
|
11983
12283
|
function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11984
12284
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
11985
|
-
function
|
|
11986
|
-
function
|
|
12285
|
+
function _callSuper(_this, derived, args) {
|
|
12286
|
+
function isNativeReflectConstruct() {
|
|
12287
|
+
if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false;
|
|
12288
|
+
if (_Reflect$construct__default["default"].sham) return false;
|
|
12289
|
+
if (typeof Proxy === "function") return true;
|
|
12290
|
+
try {
|
|
12291
|
+
return !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {}));
|
|
12292
|
+
} catch (e) {
|
|
12293
|
+
return false;
|
|
12294
|
+
}
|
|
12295
|
+
}
|
|
12296
|
+
derived = _getPrototypeOf(derived);
|
|
12297
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? _Reflect$construct__default["default"](derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
12298
|
+
}
|
|
11987
12299
|
var styles = {
|
|
11988
12300
|
"invalid": "numeric-format-input-module__invalid___3LcyE",
|
|
11989
12301
|
"disabled": "numeric-format-input-module__disabled___hb6h4"
|
|
@@ -11995,14 +12307,13 @@ Cleave__default["default"].displayName = 'Cleave';
|
|
|
11995
12307
|
const isValidValue = value => isFinite__default["default"](value) || isNil__default["default"](value);
|
|
11996
12308
|
let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
11997
12309
|
_inherits(NumericFormatInput, _PureComponent);
|
|
11998
|
-
var _super = _createSuper(NumericFormatInput);
|
|
11999
12310
|
function NumericFormatInput() {
|
|
12000
12311
|
var _this;
|
|
12001
12312
|
_classCallCheck(this, NumericFormatInput);
|
|
12002
12313
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12003
12314
|
args[_key] = arguments[_key];
|
|
12004
12315
|
}
|
|
12005
|
-
_this =
|
|
12316
|
+
_this = _callSuper(this, NumericFormatInput, [...args]);
|
|
12006
12317
|
_this.state = {
|
|
12007
12318
|
parsedValue: _this.props.value
|
|
12008
12319
|
};
|
|
@@ -12497,8 +12808,10 @@ const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
|
12497
12808
|
};
|
|
12498
12809
|
|
|
12499
12810
|
// eslint-disable-next-line import/prefer-default-export
|
|
12500
|
-
const validateText = (text, intl)
|
|
12811
|
+
const validateText = function (text, intl) {
|
|
12812
|
+
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
12501
12813
|
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12814
|
+
if (type === 'id' && !isUUID(text.value)) return intl.formatMessage(messages$K.uuid);
|
|
12502
12815
|
return null;
|
|
12503
12816
|
};
|
|
12504
12817
|
|