@commercetools-frontend/experimental-components 5.0.1 → 5.0.2
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 +1008 -1257
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +1007 -1256
- package/dist/commercetools-frontend-experimental-components.esm.js +1005 -1252
- package/dist/styles.css +16 -97
- package/package.json +12 -11
|
@@ -66,7 +66,6 @@ var hooks = require('@apollo/client/react/hooks');
|
|
|
66
66
|
var moment$1 = require('moment');
|
|
67
67
|
var classnames = require('classnames');
|
|
68
68
|
require('react-required-if');
|
|
69
|
-
var designSystem = require('@commercetools-uikit/design-system');
|
|
70
69
|
var _assertThisInitialized = require('@babel/runtime-corejs3/helpers/assertThisInitialized');
|
|
71
70
|
var Textarea = require('react-textarea-autosize');
|
|
72
71
|
var has = require('lodash/has');
|
|
@@ -80,6 +79,7 @@ var omit = require('lodash/omit');
|
|
|
80
79
|
var isEmpty$3 = require('lodash/isEmpty');
|
|
81
80
|
var _Object$freeze = require('@babel/runtime-corejs3/core-js-stable/object/freeze');
|
|
82
81
|
var originalOmitDeep = require('omit-deep');
|
|
82
|
+
var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
|
|
83
83
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
84
84
|
var _parseInt = require('@babel/runtime-corejs3/core-js-stable/parse-int');
|
|
85
85
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
@@ -112,7 +112,6 @@ var isUndefined = require('lodash/isUndefined');
|
|
|
112
112
|
var isFinite = require('lodash/isFinite');
|
|
113
113
|
var Cleave = require('cleave.js/react');
|
|
114
114
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
115
|
-
var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
|
|
116
115
|
var compact = require('lodash/compact');
|
|
117
116
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
118
117
|
require('@babel/runtime-corejs3/helpers/get');
|
|
@@ -167,6 +166,7 @@ var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
|
167
166
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty$3);
|
|
168
167
|
var _Object$freeze__default = /*#__PURE__*/_interopDefault(_Object$freeze);
|
|
169
168
|
var originalOmitDeep__default = /*#__PURE__*/_interopDefault(originalOmitDeep);
|
|
169
|
+
var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
|
|
170
170
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
171
171
|
var _parseInt__default = /*#__PURE__*/_interopDefault(_parseInt);
|
|
172
172
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
@@ -190,7 +190,6 @@ var isUndefined__default = /*#__PURE__*/_interopDefault(isUndefined);
|
|
|
190
190
|
var isFinite__default = /*#__PURE__*/_interopDefault(isFinite);
|
|
191
191
|
var Cleave__default = /*#__PURE__*/_interopDefault(Cleave);
|
|
192
192
|
var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
|
|
193
|
-
var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
|
|
194
193
|
var compact__default = /*#__PURE__*/_interopDefault(compact);
|
|
195
194
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
196
195
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
@@ -376,7 +375,7 @@ function uniqueObjects(items) {
|
|
|
376
375
|
|
|
377
376
|
*/
|
|
378
377
|
|
|
379
|
-
const messages$
|
|
378
|
+
const messages$J = reactIntl.defineMessages({
|
|
380
379
|
unique: {
|
|
381
380
|
id: 'Validation.unique',
|
|
382
381
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1671,8 +1670,8 @@ const getData = (code, field) => {
|
|
|
1671
1670
|
};
|
|
1672
1671
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1673
1672
|
|
|
1674
|
-
function ownKeys$
|
|
1675
|
-
function _objectSpread$
|
|
1673
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1674
|
+
function _objectSpread$1i(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1i(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1676
1675
|
function formatMoneyRangeValue(value, intl) {
|
|
1677
1676
|
var _context;
|
|
1678
1677
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1682,7 +1681,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1682
1681
|
return '';
|
|
1683
1682
|
}
|
|
1684
1683
|
function formatMoneyValue(amount, currency, intl) {
|
|
1685
|
-
return formatMoney$1(_objectSpread$
|
|
1684
|
+
return formatMoney$1(_objectSpread$1i({
|
|
1686
1685
|
centAmount: amount,
|
|
1687
1686
|
fractionDigits: getFractionDigit(currency)
|
|
1688
1687
|
}, currency ? {
|
|
@@ -1699,14 +1698,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1699
1698
|
}
|
|
1700
1699
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1701
1700
|
var _moneyValue$fractione;
|
|
1702
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1701
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1i({
|
|
1703
1702
|
style: 'currency',
|
|
1704
1703
|
currency: moneyValue.currencyCode,
|
|
1705
1704
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1706
1705
|
}, options));
|
|
1707
1706
|
}
|
|
1708
1707
|
|
|
1709
|
-
var messages$
|
|
1708
|
+
var messages$I = reactIntl.defineMessages({
|
|
1710
1709
|
booleanYes: {
|
|
1711
1710
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1712
1711
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1791,7 +1790,7 @@ const formatDateTime = _ref7 => {
|
|
|
1791
1790
|
const formatBoolean = _ref8 => {
|
|
1792
1791
|
let value = _ref8.value,
|
|
1793
1792
|
intl = _ref8.intl;
|
|
1794
|
-
return value ? intl.formatMessage(messages$
|
|
1793
|
+
return value ? intl.formatMessage(messages$I.booleanYes) : intl.formatMessage(messages$I.booleanNo);
|
|
1795
1794
|
};
|
|
1796
1795
|
const formatNilType = _ref9 => {
|
|
1797
1796
|
let value = _ref9.value,
|
|
@@ -1953,8 +1952,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1953
1952
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1954
1953
|
};
|
|
1955
1954
|
|
|
1956
|
-
function ownKeys$
|
|
1957
|
-
function _objectSpread$
|
|
1955
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1956
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1958
1957
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1959
1958
|
const WithDataTablePaginationState = props => {
|
|
1960
1959
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1968,7 +1967,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1968
1967
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1969
1968
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1970
1969
|
});
|
|
1971
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1970
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h(_objectSpread$1h({}, props), {}, {
|
|
1972
1971
|
dataTablePaginationState: {
|
|
1973
1972
|
page,
|
|
1974
1973
|
perPage,
|
|
@@ -1980,8 +1979,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1980
1979
|
return WithDataTablePaginationState;
|
|
1981
1980
|
};
|
|
1982
1981
|
|
|
1983
|
-
function ownKeys$
|
|
1984
|
-
function _objectSpread$
|
|
1982
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1983
|
+
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1985
1984
|
const injectNotifications = function () {
|
|
1986
1985
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1987
1986
|
return Component => {
|
|
@@ -1996,7 +1995,7 @@ const injectNotifications = function () {
|
|
|
1996
1995
|
onActionError,
|
|
1997
1996
|
hideAllPageNotifications
|
|
1998
1997
|
};
|
|
1999
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1998
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g(_objectSpread$1g({}, props), {}, {
|
|
2000
1999
|
[propName]: notifications
|
|
2001
2000
|
}));
|
|
2002
2001
|
};
|
|
@@ -2005,22 +2004,22 @@ const injectNotifications = function () {
|
|
|
2005
2004
|
};
|
|
2006
2005
|
};
|
|
2007
2006
|
|
|
2008
|
-
function ownKeys$
|
|
2009
|
-
function _objectSpread$
|
|
2007
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2008
|
+
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2010
2009
|
function isPropsMapper(mapProps) {
|
|
2011
2010
|
return typeof mapProps === 'function';
|
|
2012
2011
|
}
|
|
2013
2012
|
const withProps = mapProps => Component => {
|
|
2014
2013
|
const EnhancedWithProps = ownProps => {
|
|
2015
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2016
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2014
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1f(_objectSpread$1f({}, ownProps), mapProps(ownProps)) : _objectSpread$1f(_objectSpread$1f({}, ownProps), mapProps);
|
|
2015
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f({}, enhancedProps));
|
|
2017
2016
|
};
|
|
2018
2017
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2019
2018
|
return EnhancedWithProps;
|
|
2020
2019
|
};
|
|
2021
2020
|
|
|
2022
|
-
function ownKeys$
|
|
2023
|
-
function _objectSpread$
|
|
2021
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2022
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2024
2023
|
const useRedirectEffect = _ref => {
|
|
2025
2024
|
let goTo = _ref.goTo;
|
|
2026
2025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2040,30 +2039,30 @@ const defaultOptions$5 = {
|
|
|
2040
2039
|
skip: () => false
|
|
2041
2040
|
};
|
|
2042
2041
|
const withRedirectTo = options => Component => {
|
|
2043
|
-
const mergedOptions = _objectSpread$
|
|
2042
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$5), options);
|
|
2044
2043
|
const WithRedirectTo = props => {
|
|
2045
2044
|
if (!mergedOptions.skip(props)) {
|
|
2046
2045
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2047
2046
|
goTo: options.selectGoTo(props)
|
|
2048
2047
|
});
|
|
2049
2048
|
}
|
|
2050
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2049
|
+
return jsxRuntime.jsx(Component, _objectSpread$1e({}, props));
|
|
2051
2050
|
};
|
|
2052
2051
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2053
2052
|
return WithRedirectTo;
|
|
2054
2053
|
};
|
|
2055
2054
|
|
|
2056
|
-
function ownKeys$
|
|
2057
|
-
function _objectSpread$
|
|
2055
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2056
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2058
2057
|
const defaultOptions$4 = {
|
|
2059
2058
|
propName: 'modalState',
|
|
2060
2059
|
isInitiallyOpen: false
|
|
2061
2060
|
};
|
|
2062
2061
|
const injectModalState$1 = options => Component => {
|
|
2063
|
-
const mergedOptions = _objectSpread$
|
|
2062
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$4), options);
|
|
2064
2063
|
const WithModalState = props => {
|
|
2065
2064
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2066
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2065
|
+
return jsxRuntime.jsx(Component, _objectSpread$1d(_objectSpread$1d({}, props), {}, {
|
|
2067
2066
|
[mergedOptions.propName]: modalState
|
|
2068
2067
|
}));
|
|
2069
2068
|
};
|
|
@@ -2071,17 +2070,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2071
2070
|
return WithModalState;
|
|
2072
2071
|
};
|
|
2073
2072
|
|
|
2074
|
-
function ownKeys$
|
|
2075
|
-
function _objectSpread$
|
|
2073
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2074
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2076
2075
|
const defaultOptions$3 = {
|
|
2077
2076
|
propName: 'toggleState',
|
|
2078
2077
|
isInitiallyOpen: false
|
|
2079
2078
|
};
|
|
2080
2079
|
const injectModalState = options => Component => {
|
|
2081
|
-
const mergedOptions = _objectSpread$
|
|
2080
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$3), options);
|
|
2082
2081
|
const WithToggleState = props => {
|
|
2083
2082
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2084
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2083
|
+
return jsxRuntime.jsx(Component, _objectSpread$1c(_objectSpread$1c({}, props), {}, {
|
|
2085
2084
|
[mergedOptions.propName]: toggleState
|
|
2086
2085
|
}));
|
|
2087
2086
|
};
|
|
@@ -2089,8 +2088,8 @@ const injectModalState = options => Component => {
|
|
|
2089
2088
|
return WithToggleState;
|
|
2090
2089
|
};
|
|
2091
2090
|
|
|
2092
|
-
function ownKeys$
|
|
2093
|
-
function _objectSpread$
|
|
2091
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2092
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2094
2093
|
const defaultOptions$2 = {
|
|
2095
2094
|
storageType: 'local',
|
|
2096
2095
|
segregateByUser: true
|
|
@@ -2108,7 +2107,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2108
2107
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2109
2108
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2110
2109
|
var _context;
|
|
2111
|
-
const mergedOptions = _objectSpread$
|
|
2110
|
+
const mergedOptions = _objectSpread$1b(_objectSpread$1b({}, defaultOptions$2), options);
|
|
2112
2111
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2113
2112
|
var _context$user;
|
|
2114
2113
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2156,8 +2155,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2156
2155
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2157
2156
|
};
|
|
2158
2157
|
|
|
2159
|
-
function ownKeys$
|
|
2160
|
-
function _objectSpread$
|
|
2158
|
+
function ownKeys$1a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2159
|
+
function _objectSpread$1a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2161
2160
|
const defaultOptions$1 = {
|
|
2162
2161
|
propName: 'storage',
|
|
2163
2162
|
storageKey: '',
|
|
@@ -2170,7 +2169,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2170
2169
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2171
2170
|
* argument position does not allow passing specification of option(s).
|
|
2172
2171
|
*/
|
|
2173
|
-
const mergedOptions = _objectSpread$
|
|
2172
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions$1), options);
|
|
2174
2173
|
const WithStorage = props => {
|
|
2175
2174
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2176
2175
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2184,7 +2183,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2184
2183
|
readFromStorage
|
|
2185
2184
|
}
|
|
2186
2185
|
};
|
|
2187
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2186
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1a(_objectSpread$1a({}, props), storageProp));
|
|
2188
2187
|
};
|
|
2189
2188
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2190
2189
|
return WithStorage;
|
|
@@ -2228,8 +2227,8 @@ const usePrevious = value => {
|
|
|
2228
2227
|
return ref.current;
|
|
2229
2228
|
};
|
|
2230
2229
|
|
|
2231
|
-
function ownKeys$
|
|
2232
|
-
function _objectSpread$
|
|
2230
|
+
function ownKeys$19(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2231
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$19(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2233
2232
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n type\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2234
2233
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2235
2234
|
var _storesQueryResult$re;
|
|
@@ -2240,7 +2239,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2240
2239
|
offset: storesQueryResult.offset,
|
|
2241
2240
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2242
2241
|
var _store$productSelecti;
|
|
2243
|
-
return _objectSpread$
|
|
2242
|
+
return _objectSpread$19(_objectSpread$19({}, store), {}, {
|
|
2244
2243
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2245
2244
|
});
|
|
2246
2245
|
})
|
|
@@ -2248,7 +2247,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2248
2247
|
};
|
|
2249
2248
|
const createQueryVariables$6 = ownProps => {
|
|
2250
2249
|
var _context;
|
|
2251
|
-
return _objectSpread$
|
|
2250
|
+
return _objectSpread$19(_objectSpread$19({
|
|
2252
2251
|
limit: ownProps.limit,
|
|
2253
2252
|
offset: ownProps.offset,
|
|
2254
2253
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2403,8 +2402,8 @@ function useDidFormValidationFail() {
|
|
|
2403
2402
|
return Boolean(didFormValidationFail);
|
|
2404
2403
|
}
|
|
2405
2404
|
|
|
2406
|
-
function ownKeys$
|
|
2407
|
-
function _objectSpread$
|
|
2405
|
+
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2406
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2408
2407
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2409
2408
|
const defaultOptions = {
|
|
2410
2409
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2432,7 +2431,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2432
2431
|
};
|
|
2433
2432
|
const usePersistedReminder = function () {
|
|
2434
2433
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2435
|
-
const mergedOptions = _objectSpread$
|
|
2434
|
+
const mergedOptions = _objectSpread$18(_objectSpread$18({}, defaultOptions), options);
|
|
2436
2435
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2437
2436
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2438
2437
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2478,7 +2477,7 @@ const usePersistedReminder = function () {
|
|
|
2478
2477
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2479
2478
|
};
|
|
2480
2479
|
|
|
2481
|
-
var messages$
|
|
2480
|
+
var messages$H = reactIntl.defineMessages({
|
|
2482
2481
|
profileUpdated: {
|
|
2483
2482
|
id: 'NotificationText.profileUpdated',
|
|
2484
2483
|
description: 'Label for the notification header',
|
|
@@ -2496,8 +2495,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2496
2495
|
}
|
|
2497
2496
|
});
|
|
2498
2497
|
|
|
2499
|
-
function ownKeys$
|
|
2500
|
-
function _objectSpread$
|
|
2498
|
+
function ownKeys$17(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2499
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$17(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2501
2500
|
const LinkToProfile = props => {
|
|
2502
2501
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2503
2502
|
to: "/account/profile",
|
|
@@ -2515,9 +2514,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2515
2514
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2516
2515
|
as: "p",
|
|
2517
2516
|
isBold: true,
|
|
2518
|
-
intlMessage: messages$
|
|
2517
|
+
intlMessage: messages$H.profileUpdated
|
|
2519
2518
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2520
|
-
intlMessage: _objectSpread$
|
|
2519
|
+
intlMessage: _objectSpread$17(_objectSpread$17({}, messages$H.addMoreInformation), {}, {
|
|
2521
2520
|
values: {
|
|
2522
2521
|
newline: getNewLine
|
|
2523
2522
|
}
|
|
@@ -2526,7 +2525,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2526
2525
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2527
2526
|
scale: "xs",
|
|
2528
2527
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2529
|
-
intlMessage: _objectSpread$
|
|
2528
|
+
intlMessage: _objectSpread$17(_objectSpread$17({}, messages$H.informationAndProfileLink), {}, {
|
|
2530
2529
|
values: {
|
|
2531
2530
|
newline: getNewLine,
|
|
2532
2531
|
link: getLinkToProfile
|
|
@@ -2647,7 +2646,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2647
2646
|
}, [ref]);
|
|
2648
2647
|
};
|
|
2649
2648
|
|
|
2650
|
-
var messages$
|
|
2649
|
+
var messages$G = reactIntl.defineMessages({
|
|
2651
2650
|
fallbackHint: {
|
|
2652
2651
|
id: 'KeyFallback.fallbackHint',
|
|
2653
2652
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2671,7 +2670,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2671
2670
|
return values => {
|
|
2672
2671
|
if (!values.resource) return null;
|
|
2673
2672
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2674
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2673
|
+
const fallbackHintWithKey = intl.formatMessage(messages$G.fallbackHint, {
|
|
2675
2674
|
key: values.resource.key
|
|
2676
2675
|
});
|
|
2677
2676
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2683,8 +2682,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2683
2682
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2684
2683
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2685
2684
|
|
|
2686
|
-
function ownKeys$
|
|
2687
|
-
function _objectSpread$
|
|
2685
|
+
function ownKeys$16(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2686
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$16(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$16(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2688
2687
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2689
2688
|
const updatedColumnProps = {};
|
|
2690
2689
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2704,14 +2703,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2704
2703
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2705
2704
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2706
2705
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2707
|
-
return _objectSpread$
|
|
2706
|
+
return _objectSpread$16(_objectSpread$16({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2708
2707
|
});
|
|
2709
2708
|
};
|
|
2710
2709
|
const handleCacheUpdate = _ref2 => {
|
|
2711
2710
|
let update = _ref2.update,
|
|
2712
2711
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2713
2712
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2714
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2713
|
+
return updateCachedTableConfiguration(_objectSpread$16(_objectSpread$16({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2715
2714
|
};
|
|
2716
2715
|
|
|
2717
2716
|
// Signature:
|
|
@@ -2740,7 +2739,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2740
2739
|
return {
|
|
2741
2740
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2742
2741
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2743
|
-
return _objectSpread$
|
|
2742
|
+
return _objectSpread$16({
|
|
2744
2743
|
key: visibleColumnKey
|
|
2745
2744
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2746
2745
|
}),
|
|
@@ -2811,14 +2810,14 @@ const handlers$4 = {
|
|
|
2811
2810
|
}
|
|
2812
2811
|
};
|
|
2813
2812
|
|
|
2814
|
-
function ownKeys$
|
|
2815
|
-
function _objectSpread$
|
|
2813
|
+
function ownKeys$15(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2814
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$15(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$15(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2816
2815
|
|
|
2817
2816
|
// eslint-disable-next-line import/prefer-default-export
|
|
2818
2817
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2819
2818
|
var _context;
|
|
2820
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2821
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2819
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$15(_objectSpread$15({}, productSelections), {}, {
|
|
2820
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$15({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2822
2821
|
from: 'nameAllLocales',
|
|
2823
2822
|
to: 'name'
|
|
2824
2823
|
}])))
|
|
@@ -2954,7 +2953,7 @@ var localizedTextTransformer = (localizedString => {
|
|
|
2954
2953
|
}).join(' and ');
|
|
2955
2954
|
});
|
|
2956
2955
|
|
|
2957
|
-
var styles$
|
|
2956
|
+
var styles$i = {
|
|
2958
2957
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
2959
2958
|
};
|
|
2960
2959
|
/**
|
|
@@ -2962,13 +2961,13 @@ var styles$j = {
|
|
|
2962
2961
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
2963
2962
|
*/
|
|
2964
2963
|
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
2965
|
-
className: styles$
|
|
2964
|
+
className: styles$i['loading-container'],
|
|
2966
2965
|
"data-testid": "centered-loading-spinner",
|
|
2967
2966
|
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
2968
2967
|
});
|
|
2969
2968
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2970
2969
|
|
|
2971
|
-
var messages$
|
|
2970
|
+
var messages$F = reactIntl.defineMessages({
|
|
2972
2971
|
noChannelsFound: {
|
|
2973
2972
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2974
2973
|
description: 'The message to display when no channels were found',
|
|
@@ -2994,8 +2993,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2994
2993
|
}
|
|
2995
2994
|
});
|
|
2996
2995
|
|
|
2997
|
-
function ownKeys$
|
|
2998
|
-
function _objectSpread$
|
|
2996
|
+
function ownKeys$14(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2997
|
+
function _objectSpread$14(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$14(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2999
2998
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3000
2999
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3001
3000
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -3016,7 +3015,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3016
3015
|
const _useIntl = reactIntl.useIntl(),
|
|
3017
3016
|
formatMessage = _useIntl.formatMessage;
|
|
3018
3017
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3019
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3018
|
+
const variables = React.useMemo(() => _objectSpread$14({
|
|
3020
3019
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3021
3020
|
}, role && {
|
|
3022
3021
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3077,7 +3076,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3077
3076
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3078
3077
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3079
3078
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3080
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3079
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$F.noChannelsFound), [loadingError, formatMessage]);
|
|
3081
3080
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3082
3081
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3083
3082
|
max: "scale",
|
|
@@ -3088,7 +3087,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3088
3087
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3089
3088
|
id: name,
|
|
3090
3089
|
name: name,
|
|
3091
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3090
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$F.placeholder),
|
|
3092
3091
|
loadOptions: loadOptionsDebounced,
|
|
3093
3092
|
defaultOptions: true,
|
|
3094
3093
|
showOptionGroupDivider: true,
|
|
@@ -3145,8 +3144,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3145
3144
|
|
|
3146
3145
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3147
3146
|
|
|
3148
|
-
function ownKeys$
|
|
3149
|
-
function _objectSpread$
|
|
3147
|
+
function ownKeys$13(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3148
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$13(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$13(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3150
3149
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3151
3150
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3152
3151
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3178,7 +3177,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3178
3177
|
handleMouseOver: this.handleMouseOver,
|
|
3179
3178
|
handleMouseOut: this.handleMouseOut
|
|
3180
3179
|
};
|
|
3181
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3180
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$13({}, _objectSpread$13(_objectSpread$13({}, this.props), injectedProps)));
|
|
3182
3181
|
}
|
|
3183
3182
|
}]);
|
|
3184
3183
|
return WithMouseOverState;
|
|
@@ -3187,11 +3186,11 @@ const withMouseOverState = BaseComponent => {
|
|
|
3187
3186
|
return WithMouseOverState;
|
|
3188
3187
|
};
|
|
3189
3188
|
|
|
3190
|
-
function ownKeys$
|
|
3191
|
-
function _objectSpread$
|
|
3189
|
+
function ownKeys$12(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3190
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$12(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$12(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3192
3191
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3193
3192
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3194
|
-
var styles$
|
|
3193
|
+
var styles$h = {
|
|
3195
3194
|
"size": "throttled-field-module__size___324jx",
|
|
3196
3195
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
3197
3196
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -3299,7 +3298,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3299
3298
|
}, {
|
|
3300
3299
|
key: "render",
|
|
3301
3300
|
value: function render() {
|
|
3302
|
-
const commonProps = _objectSpread$
|
|
3301
|
+
const commonProps = _objectSpread$12(_objectSpread$12({
|
|
3303
3302
|
value: this.state.draftValue,
|
|
3304
3303
|
autoComplete: this.props.autoComplete,
|
|
3305
3304
|
onChange: this.handleChange,
|
|
@@ -3318,23 +3317,23 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3318
3317
|
htmlFor: inputId,
|
|
3319
3318
|
children: this.props.label
|
|
3320
3319
|
})
|
|
3321
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3320
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$12(_objectSpread$12({}, commonProps), {}, {
|
|
3322
3321
|
id: inputId,
|
|
3323
|
-
className: classnames__default["default"](styles$
|
|
3324
|
-
[styles$
|
|
3325
|
-
[styles$
|
|
3322
|
+
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3323
|
+
[styles$h.invalid]: !this.props.isValid,
|
|
3324
|
+
[styles$h.disabled]: this.props.disabled
|
|
3326
3325
|
}),
|
|
3327
3326
|
rows: 1,
|
|
3328
3327
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3329
3328
|
cacheMeasurements: true
|
|
3330
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3329
|
+
})) : jsxRuntime.jsx("input", _objectSpread$12(_objectSpread$12({}, commonProps), {}, {
|
|
3331
3330
|
id: inputId,
|
|
3332
3331
|
ref: this.props.inputRef,
|
|
3333
3332
|
type: this.props.as,
|
|
3334
|
-
className: classnames__default["default"](styles$
|
|
3335
|
-
[styles$
|
|
3336
|
-
[styles$
|
|
3337
|
-
[styles$
|
|
3333
|
+
className: classnames__default["default"](styles$h["input-".concat(this.props.style)], {
|
|
3334
|
+
[styles$h.invalid]: !this.props.isValid,
|
|
3335
|
+
[styles$h.disabled]: this.props.disabled,
|
|
3336
|
+
[styles$h.granular]: this.props.isGranular
|
|
3338
3337
|
})
|
|
3339
3338
|
}))]
|
|
3340
3339
|
});
|
|
@@ -3354,7 +3353,7 @@ ThrottledField.defaultProps = {
|
|
|
3354
3353
|
label: 'Throttled field'
|
|
3355
3354
|
};
|
|
3356
3355
|
|
|
3357
|
-
var messages$
|
|
3356
|
+
var messages$E = reactIntl.defineMessages({
|
|
3358
3357
|
buttonLabel: {
|
|
3359
3358
|
id: 'SearchInput.buttonLabel',
|
|
3360
3359
|
description: 'Label for "Search" button.',
|
|
@@ -3369,7 +3368,7 @@ var messages$F = reactIntl.defineMessages({
|
|
|
3369
3368
|
|
|
3370
3369
|
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3371
3370
|
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3372
|
-
var styles$
|
|
3371
|
+
var styles$g = {
|
|
3373
3372
|
"block": "search-input-module__block___1uM-y",
|
|
3374
3373
|
"container": "search-input-module__container___9u6if",
|
|
3375
3374
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -3446,14 +3445,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3446
3445
|
key: "render",
|
|
3447
3446
|
value: function render() {
|
|
3448
3447
|
return jsxRuntime.jsx("div", {
|
|
3449
|
-
className: classnames__default["default"](this.props.blockClassName, styles$
|
|
3448
|
+
className: classnames__default["default"](this.props.blockClassName, styles$g.block),
|
|
3450
3449
|
children: jsxRuntime.jsxs("div", {
|
|
3451
|
-
className: classnames__default["default"](this.props.containerClassName, styles$
|
|
3450
|
+
className: classnames__default["default"](this.props.containerClassName, styles$g.container),
|
|
3452
3451
|
children: [jsxRuntime.jsx("div", {
|
|
3453
|
-
className: classnames__default["default"](styles$
|
|
3454
|
-
[styles$
|
|
3455
|
-
[styles$
|
|
3456
|
-
[styles$
|
|
3452
|
+
className: classnames__default["default"](styles$g['input-container'], {
|
|
3453
|
+
[styles$g['input-container-hoverable']]: !this.props.disabled,
|
|
3454
|
+
[styles$g['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
3455
|
+
[styles$g['input-container-granular']]: this.props.isGranular
|
|
3457
3456
|
}),
|
|
3458
3457
|
children: jsxRuntime.jsx(ThrottledField, {
|
|
3459
3458
|
style: "primary",
|
|
@@ -3461,7 +3460,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3461
3460
|
"data-testid": this.props.testId || 'search-input',
|
|
3462
3461
|
value: this.state.text,
|
|
3463
3462
|
label: this.props.label,
|
|
3464
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3463
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$E.placeholder),
|
|
3465
3464
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3466
3465
|
onChange: this.handleInputChange,
|
|
3467
3466
|
onEnter: this.handleEnter,
|
|
@@ -3471,8 +3470,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3471
3470
|
isGranular: this.props.isGranular
|
|
3472
3471
|
})
|
|
3473
3472
|
}), this.state.text && jsxRuntime.jsx(uiKit.SecondaryIconButton, {
|
|
3474
|
-
className: classnames__default["default"](styles$
|
|
3475
|
-
[styles$
|
|
3473
|
+
className: classnames__default["default"](styles$g['clear-icon-container'], {
|
|
3474
|
+
[styles$g['clear-icon-container-granular']]: this.props.isGranular
|
|
3476
3475
|
}),
|
|
3477
3476
|
icon: jsxRuntime.jsx(uiKit.CloseIcon, {}),
|
|
3478
3477
|
size: "medium",
|
|
@@ -3480,16 +3479,16 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3480
3479
|
onClick: this.handleClear
|
|
3481
3480
|
}), jsxRuntime.jsx("div", {
|
|
3482
3481
|
"data-testid": "search-button",
|
|
3483
|
-
className: classnames__default["default"](styles$
|
|
3484
|
-
[styles$
|
|
3485
|
-
[styles$
|
|
3482
|
+
className: classnames__default["default"](styles$g['search-icon-container'], {
|
|
3483
|
+
[styles$g['search-icon-container-hoverable']]: !this.props.disabled,
|
|
3484
|
+
[styles$g['search-icon-container-granular']]: this.props.isGranular
|
|
3486
3485
|
}),
|
|
3487
3486
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
3488
3487
|
label: "search-button",
|
|
3489
3488
|
onMouseOver: this.props.handleMouseOver,
|
|
3490
3489
|
onMouseOut: this.props.handleMouseOut,
|
|
3491
3490
|
children: jsxRuntime.jsx(uiKit.SearchIcon, {
|
|
3492
|
-
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' :
|
|
3491
|
+
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' : 'neutral60',
|
|
3493
3492
|
size: "big"
|
|
3494
3493
|
})
|
|
3495
3494
|
})]
|
|
@@ -3517,7 +3516,7 @@ SearchInput.defaultProps = {
|
|
|
3517
3516
|
label: 'Search input',
|
|
3518
3517
|
onChange: () => null
|
|
3519
3518
|
};
|
|
3520
|
-
var searchInput = flowRight__default["default"](keepDisplayName(SearchInput), withMouseOverState, reactIntl.injectIntl
|
|
3519
|
+
var searchInput = flowRight__default["default"](keepDisplayName(SearchInput), withMouseOverState, reactIntl.injectIntl)(SearchInput);
|
|
3521
3520
|
|
|
3522
3521
|
var FetchIndicesExist$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchIndicesExist" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indicesExist" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "products" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 191, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3523
3522
|
const useExecuteGraphQLRequest = () => {
|
|
@@ -3676,7 +3675,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3676
3675
|
};
|
|
3677
3676
|
};
|
|
3678
3677
|
|
|
3679
|
-
var messages$
|
|
3678
|
+
var messages$D = reactIntl.defineMessages({
|
|
3680
3679
|
bottomOption: {
|
|
3681
3680
|
id: 'Products.Pickers.bottomOption',
|
|
3682
3681
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3684,11 +3683,11 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3684
3683
|
}
|
|
3685
3684
|
});
|
|
3686
3685
|
|
|
3687
|
-
function ownKeys$
|
|
3688
|
-
function _objectSpread$
|
|
3686
|
+
function ownKeys$11(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3687
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$11(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$11(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3689
3688
|
const getBottomOption = () => ({
|
|
3690
3689
|
options: [{
|
|
3691
|
-
label: messages$
|
|
3690
|
+
label: messages$D.bottomOption,
|
|
3692
3691
|
isBottomOption: true,
|
|
3693
3692
|
isDisabled: true
|
|
3694
3693
|
}]
|
|
@@ -3696,7 +3695,7 @@ const getBottomOption = () => ({
|
|
|
3696
3695
|
const Option$2 = props => {
|
|
3697
3696
|
const _useIntl = reactIntl.useIntl(),
|
|
3698
3697
|
formatMessage = _useIntl.formatMessage;
|
|
3699
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3698
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$11(_objectSpread$11({}, props), {}, {
|
|
3700
3699
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3701
3700
|
tone: "secondary",
|
|
3702
3701
|
children: formatMessage(props.data.label)
|
|
@@ -3713,8 +3712,8 @@ const Option$2 = props => {
|
|
|
3713
3712
|
};
|
|
3714
3713
|
Option$2.displayName = 'Option';
|
|
3715
3714
|
|
|
3716
|
-
function ownKeys$
|
|
3717
|
-
function _objectSpread$
|
|
3715
|
+
function ownKeys$10(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3716
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$10(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$10(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3718
3717
|
const useHandlers = onChange => {
|
|
3719
3718
|
const _useState = React.useState(),
|
|
3720
3719
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3725,8 +3724,8 @@ const useHandlers = onChange => {
|
|
|
3725
3724
|
}, []);
|
|
3726
3725
|
const handleChange = useEventCallback(event => {
|
|
3727
3726
|
var _event$target$value;
|
|
3728
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3729
|
-
target: _objectSpread$
|
|
3727
|
+
const eventWithExtractedValue = _objectSpread$10(_objectSpread$10({}, event), {}, {
|
|
3728
|
+
target: _objectSpread$10(_objectSpread$10({}, event.target), {}, {
|
|
3730
3729
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3731
3730
|
})
|
|
3732
3731
|
});
|
|
@@ -3735,8 +3734,8 @@ const useHandlers = onChange => {
|
|
|
3735
3734
|
return [handleInputChange, handleChange];
|
|
3736
3735
|
};
|
|
3737
3736
|
|
|
3738
|
-
function ownKeys
|
|
3739
|
-
function _objectSpread
|
|
3737
|
+
function ownKeys$$(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3738
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$$(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$$(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3740
3739
|
const constructPrefixSearchPredicate = function () {
|
|
3741
3740
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3742
3741
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3779,7 +3778,7 @@ const useLoadOptions = _ref => {
|
|
|
3779
3778
|
}();
|
|
3780
3779
|
return client$1.query({
|
|
3781
3780
|
query,
|
|
3782
|
-
variables: _objectSpread
|
|
3781
|
+
variables: _objectSpread$$({
|
|
3783
3782
|
where
|
|
3784
3783
|
}, variables),
|
|
3785
3784
|
context: {
|
|
@@ -3833,7 +3832,7 @@ function useCurrentOption(_ref) {
|
|
|
3833
3832
|
};
|
|
3834
3833
|
}
|
|
3835
3834
|
|
|
3836
|
-
var messages$
|
|
3835
|
+
var messages$C = reactIntl.defineMessages({
|
|
3837
3836
|
noProductTypesFound: {
|
|
3838
3837
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3839
3838
|
description: 'The message to display when no product types were found',
|
|
@@ -3923,7 +3922,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3923
3922
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3924
3923
|
id: name,
|
|
3925
3924
|
name: name,
|
|
3926
|
-
placeholder: formatMessage(messages$
|
|
3925
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
3927
3926
|
loadOptions: loadOptionsDebounced,
|
|
3928
3927
|
defaultOptions: [],
|
|
3929
3928
|
isClearable: isClearable,
|
|
@@ -3936,7 +3935,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3936
3935
|
onInputChange: handleInputChange,
|
|
3937
3936
|
onBlur: onBlur,
|
|
3938
3937
|
value: currentOption.data,
|
|
3939
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3938
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$C.noProductTypesFound),
|
|
3940
3939
|
hasError: hasError || isLoadingFailed
|
|
3941
3940
|
})
|
|
3942
3941
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3948,7 +3947,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3948
3947
|
};
|
|
3949
3948
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3950
3949
|
|
|
3951
|
-
var messages$
|
|
3950
|
+
var messages$B = reactIntl.defineMessages({
|
|
3952
3951
|
noStatesFound: {
|
|
3953
3952
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3954
3953
|
description: 'The message to display when no states were found',
|
|
@@ -4032,7 +4031,7 @@ const StatePickerInput = _ref => {
|
|
|
4032
4031
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4033
4032
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4034
4033
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4035
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4034
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$B.noStatesFound), [loadingError, formatMessage]);
|
|
4036
4035
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
4037
4036
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4038
4037
|
max: "scale",
|
|
@@ -4044,7 +4043,7 @@ const StatePickerInput = _ref => {
|
|
|
4044
4043
|
id: name,
|
|
4045
4044
|
name: name,
|
|
4046
4045
|
horizontalConstraint: "scale",
|
|
4047
|
-
placeholder: formatMessage(messages$
|
|
4046
|
+
placeholder: formatMessage(messages$B.placeholder),
|
|
4048
4047
|
loadOptions: loadOptionsDebounced,
|
|
4049
4048
|
defaultOptions: true,
|
|
4050
4049
|
showOptionGroupDivider: true,
|
|
@@ -4070,9 +4069,9 @@ const StatePickerInput = _ref => {
|
|
|
4070
4069
|
};
|
|
4071
4070
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4072
4071
|
|
|
4073
|
-
function ownKeys$
|
|
4074
|
-
function _objectSpread$
|
|
4075
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4072
|
+
function ownKeys$_(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4073
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4074
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$_({
|
|
4076
4075
|
ref: ref,
|
|
4077
4076
|
style: {
|
|
4078
4077
|
display: 'block',
|
|
@@ -4210,8 +4209,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4210
4209
|
};
|
|
4211
4210
|
|
|
4212
4211
|
const _excluded = ["action"];
|
|
4213
|
-
function ownKeys
|
|
4214
|
-
function _objectSpread
|
|
4212
|
+
function ownKeys$Z(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4213
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$Z(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$Z(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4215
4214
|
|
|
4216
4215
|
/**
|
|
4217
4216
|
* Checks if a value is a LocalizedString
|
|
@@ -4233,7 +4232,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4233
4232
|
*/
|
|
4234
4233
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4235
4234
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4236
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4235
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$Z(_objectSpread$Z({}, customFields), {}, {
|
|
4237
4236
|
[customField.name]: customField.value
|
|
4238
4237
|
}), {});
|
|
4239
4238
|
};
|
|
@@ -4257,7 +4256,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4257
4256
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4258
4257
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4259
4258
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4260
|
-
return _objectSpread
|
|
4259
|
+
return _objectSpread$Z(_objectSpread$Z(_objectSpread$Z({}, transformedData), parent ? {
|
|
4261
4260
|
parent
|
|
4262
4261
|
} : {}), ancestors ? {
|
|
4263
4262
|
ancestors
|
|
@@ -4471,7 +4470,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4471
4470
|
case 'addAttributeDefinition':
|
|
4472
4471
|
return {
|
|
4473
4472
|
[actionName]: {
|
|
4474
|
-
attributeDefinition: _objectSpread
|
|
4473
|
+
attributeDefinition: _objectSpread$Z(_objectSpread$Z({}, actionPayload.attribute), {}, {
|
|
4475
4474
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4476
4475
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4477
4476
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4567,7 +4566,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4567
4566
|
return {
|
|
4568
4567
|
[actionName]: {
|
|
4569
4568
|
attributeName: actionPayload.attributeName,
|
|
4570
|
-
value: _objectSpread
|
|
4569
|
+
value: _objectSpread$Z(_objectSpread$Z({}, actionPayload.value), {}, {
|
|
4571
4570
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4572
4571
|
})
|
|
4573
4572
|
}
|
|
@@ -4576,7 +4575,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4576
4575
|
return {
|
|
4577
4576
|
[actionName]: {
|
|
4578
4577
|
attributeName: actionPayload.attributeName,
|
|
4579
|
-
newValue: _objectSpread
|
|
4578
|
+
newValue: _objectSpread$Z(_objectSpread$Z({}, actionPayload.newValue), {}, {
|
|
4580
4579
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4581
4580
|
})
|
|
4582
4581
|
}
|
|
@@ -4603,7 +4602,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4603
4602
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4604
4603
|
taxCategory: actionPayload.taxCategory,
|
|
4605
4604
|
money: {
|
|
4606
|
-
[actionPayload.money.type]: _objectSpread
|
|
4605
|
+
[actionPayload.money.type]: _objectSpread$Z({
|
|
4607
4606
|
centAmount: actionPayload.money.centAmount,
|
|
4608
4607
|
currencyCode: actionPayload.money.currencyCode
|
|
4609
4608
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4658,8 +4657,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4658
4657
|
fields: customFields
|
|
4659
4658
|
} : null;
|
|
4660
4659
|
return {
|
|
4661
|
-
[actionName]: _objectSpread
|
|
4662
|
-
address: _objectSpread
|
|
4660
|
+
[actionName]: _objectSpread$Z(_objectSpread$Z({}, actionPayload), {}, {
|
|
4661
|
+
address: _objectSpread$Z(_objectSpread$Z({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4663
4662
|
custom
|
|
4664
4663
|
})
|
|
4665
4664
|
})
|
|
@@ -4735,8 +4734,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4735
4734
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4736
4735
|
}
|
|
4737
4736
|
|
|
4738
|
-
function ownKeys$
|
|
4739
|
-
function _objectSpread$
|
|
4737
|
+
function ownKeys$Y(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4738
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Y(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Y(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4740
4739
|
function getPriceChannelName(price) {
|
|
4741
4740
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4742
4741
|
return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -4750,11 +4749,11 @@ function getDiscountValue(price) {
|
|
|
4750
4749
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 ? void 0 : (_price$discounted$val = _price$discounted.value) === null || _price$discounted$val === void 0 ? void 0 : _price$discounted$val.type) === PRECISION_TYPES.centPrecision) {
|
|
4751
4750
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4752
4751
|
}
|
|
4753
|
-
return price.discounted ? _objectSpread$
|
|
4752
|
+
return price.discounted ? _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4754
4753
|
fractionedAmount,
|
|
4755
4754
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4756
4755
|
preciseAmount
|
|
4757
|
-
}) : _objectSpread$
|
|
4756
|
+
}) : _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4758
4757
|
centAmount: 0
|
|
4759
4758
|
});
|
|
4760
4759
|
}
|
|
@@ -4762,20 +4761,45 @@ function getSelectedPrice(price) {
|
|
|
4762
4761
|
return price.discounted ? price.discounted : price;
|
|
4763
4762
|
}
|
|
4764
4763
|
function getNetUnitPrice(_ref2) {
|
|
4764
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax, _filteredPerMethodTax2;
|
|
4765
4765
|
let lineItem = _ref2.lineItem,
|
|
4766
4766
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4767
4767
|
const price = getSelectedPrice(lineItem.price);
|
|
4768
|
-
|
|
4768
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 ? void 0 : (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4769
|
+
var _lineItem$shippingDet, _lineItem$shippingDet2;
|
|
4770
|
+
return (lineItem === null || lineItem === void 0 ? void 0 : (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 ? void 0 : (_lineItem$shippingDet2 = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet2 === void 0 ? void 0 : _findIndexInstanceProperty__default["default"](_lineItem$shippingDet2).call(_lineItem$shippingDet2, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
|
|
4771
|
+
});
|
|
4772
|
+
|
|
4773
|
+
// when shipping mode is multi with the same tax rate
|
|
4774
|
+
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax2 = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax2 !== void 0 && _filteredPerMethodTax2.includedInPrice) {
|
|
4769
4775
|
var _price$value3, _price$value4;
|
|
4776
|
+
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4770
4777
|
let centAmount;
|
|
4771
4778
|
// should accept 0 value
|
|
4772
4779
|
if (typeof ((_price$value3 = price.value) === null || _price$value3 === void 0 ? void 0 : _price$value3.centAmount) === 'number') {
|
|
4780
|
+
const amount = price.value.centAmount / (1 + taxRate.amount);
|
|
4781
|
+
centAmount = shouldRoundAmount ? Math.round(amount) : amount;
|
|
4782
|
+
}
|
|
4783
|
+
let preciseAmount;
|
|
4784
|
+
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4785
|
+
return _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4786
|
+
centAmount,
|
|
4787
|
+
preciseAmount
|
|
4788
|
+
});
|
|
4789
|
+
}
|
|
4790
|
+
|
|
4791
|
+
// when shipping mode is single
|
|
4792
|
+
if (lineItem.taxRate && lineItem.taxRate.includedInPrice) {
|
|
4793
|
+
var _price$value5, _price$value6;
|
|
4794
|
+
let centAmount;
|
|
4795
|
+
// should accept 0 value
|
|
4796
|
+
if (typeof ((_price$value5 = price.value) === null || _price$value5 === void 0 ? void 0 : _price$value5.centAmount) === 'number') {
|
|
4773
4797
|
const amount = price.value.centAmount / (1 + lineItem.taxRate.amount);
|
|
4774
4798
|
centAmount = shouldRoundAmount ? Math.round(amount) : amount;
|
|
4775
4799
|
}
|
|
4776
4800
|
let preciseAmount;
|
|
4777
|
-
if (((_price$
|
|
4778
|
-
return _objectSpread$
|
|
4801
|
+
if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4802
|
+
return _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4779
4803
|
centAmount,
|
|
4780
4804
|
preciseAmount
|
|
4781
4805
|
});
|
|
@@ -4787,7 +4811,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4787
4811
|
const currencyCode = price.value.currencyCode;
|
|
4788
4812
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4789
4813
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4790
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4814
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$Y(_objectSpread$Y({}, minPrices), {}, {
|
|
4791
4815
|
[currencyCode]: price.value
|
|
4792
4816
|
});
|
|
4793
4817
|
}
|
|
@@ -4796,8 +4820,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4796
4820
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4797
4821
|
}
|
|
4798
4822
|
|
|
4799
|
-
function ownKeys$
|
|
4800
|
-
function _objectSpread$
|
|
4823
|
+
function ownKeys$X(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4824
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$X(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$X(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4801
4825
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4802
4826
|
var _context, _context4;
|
|
4803
4827
|
return {
|
|
@@ -4812,14 +4836,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4812
4836
|
return {
|
|
4813
4837
|
name: fieldDefinition.name,
|
|
4814
4838
|
required: fieldDefinition.required,
|
|
4815
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4816
|
-
elementType: _objectSpread$
|
|
4839
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
4840
|
+
elementType: _objectSpread$X(_objectSpread$X({}, fieldDefinition.type.elementType), {}, {
|
|
4817
4841
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4818
4842
|
key: value.key,
|
|
4819
4843
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4820
4844
|
}))
|
|
4821
4845
|
})
|
|
4822
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4846
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
4823
4847
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4824
4848
|
key: value.key,
|
|
4825
4849
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4830,7 +4854,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4830
4854
|
})
|
|
4831
4855
|
}
|
|
4832
4856
|
},
|
|
4833
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4857
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$X(_objectSpread$X({}, fields), {}, {
|
|
4834
4858
|
[customField.name]: customField.value
|
|
4835
4859
|
}), {})
|
|
4836
4860
|
};
|
|
@@ -4842,7 +4866,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4842
4866
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4843
4867
|
// in either case we return null
|
|
4844
4868
|
if (!productSelection) return null;
|
|
4845
|
-
return _objectSpread$
|
|
4869
|
+
return _objectSpread$X(_objectSpread$X({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4846
4870
|
from: 'nameAllLocales',
|
|
4847
4871
|
to: 'name'
|
|
4848
4872
|
}])), {}, {
|
|
@@ -4865,8 +4889,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4865
4889
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4866
4890
|
};
|
|
4867
4891
|
|
|
4868
|
-
function ownKeys$
|
|
4869
|
-
function _objectSpread$
|
|
4892
|
+
function ownKeys$W(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4893
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$W(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$W(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4870
4894
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4871
4895
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4872
4896
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4883,7 +4907,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4883
4907
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4884
4908
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4885
4909
|
const definitionName = definition.type.elementType.name;
|
|
4886
|
-
return _objectSpread$
|
|
4910
|
+
return _objectSpread$W(_objectSpread$W({}, updateAction), {}, {
|
|
4887
4911
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4888
4912
|
});
|
|
4889
4913
|
}
|
|
@@ -4957,8 +4981,8 @@ function omitSetsOfSets() {
|
|
|
4957
4981
|
|
|
4958
4982
|
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 } } } };
|
|
4959
4983
|
|
|
4960
|
-
function ownKeys$
|
|
4961
|
-
function _objectSpread$
|
|
4984
|
+
function ownKeys$V(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4985
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$V(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$V(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4962
4986
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4963
4987
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4964
4988
|
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 } } } };
|
|
@@ -5018,7 +5042,7 @@ const mapDataToProps = _ref => {
|
|
|
5018
5042
|
return {
|
|
5019
5043
|
fetchTypeDefinitionsQuery: {
|
|
5020
5044
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5021
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5045
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$V({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5022
5046
|
isImmutable: true
|
|
5023
5047
|
}), [{
|
|
5024
5048
|
from: 'labelAllLocales',
|
|
@@ -5046,12 +5070,12 @@ const handlers$2 = {
|
|
|
5046
5070
|
}
|
|
5047
5071
|
};
|
|
5048
5072
|
|
|
5049
|
-
function ownKeys$
|
|
5050
|
-
function _objectSpread$
|
|
5073
|
+
function ownKeys$U(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5074
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$U(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$U(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5051
5075
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5052
5076
|
return {
|
|
5053
5077
|
fields: customFieldsFromRestResponse.fields,
|
|
5054
|
-
type: _objectSpread$
|
|
5078
|
+
type: _objectSpread$U({
|
|
5055
5079
|
id: customFieldsFromRestResponse.type.id
|
|
5056
5080
|
}, customFieldsFromRestResponse.type.obj)
|
|
5057
5081
|
};
|
|
@@ -5070,14 +5094,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5070
5094
|
name: fieldDefinition.name,
|
|
5071
5095
|
required: fieldDefinition.required,
|
|
5072
5096
|
inputHint: fieldDefinition.inputHint,
|
|
5073
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5074
|
-
elementType: _objectSpread$
|
|
5097
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$U(_objectSpread$U({}, fieldDefinition.type), {}, {
|
|
5098
|
+
elementType: _objectSpread$U(_objectSpread$U({}, fieldDefinition.type.elementType), {}, {
|
|
5075
5099
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5076
5100
|
key: value.key,
|
|
5077
5101
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5078
5102
|
}))
|
|
5079
5103
|
})
|
|
5080
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5104
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$U(_objectSpread$U({}, fieldDefinition.type), {}, {
|
|
5081
5105
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5082
5106
|
key: value.key,
|
|
5083
5107
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5093,7 +5117,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5093
5117
|
type: {
|
|
5094
5118
|
id: formCustomFields.type.id,
|
|
5095
5119
|
typeId: 'type',
|
|
5096
|
-
obj: _objectSpread$
|
|
5120
|
+
obj: _objectSpread$U({}, formCustomFields.type)
|
|
5097
5121
|
},
|
|
5098
5122
|
fields: formCustomFields.fields
|
|
5099
5123
|
});
|
|
@@ -5101,7 +5125,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5101
5125
|
type: {
|
|
5102
5126
|
id: formCustomFields.type.id,
|
|
5103
5127
|
typeId: 'type',
|
|
5104
|
-
obj: _objectSpread$
|
|
5128
|
+
obj: _objectSpread$U({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5105
5129
|
},
|
|
5106
5130
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5107
5131
|
});
|
|
@@ -5232,8 +5256,8 @@ const REFERENCED_TYPES = {
|
|
|
5232
5256
|
zone: 'zone'
|
|
5233
5257
|
};
|
|
5234
5258
|
|
|
5235
|
-
function ownKeys$
|
|
5236
|
-
function _objectSpread$
|
|
5259
|
+
function ownKeys$T(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5260
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$T(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$T(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5237
5261
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5238
5262
|
let validatedValues = [];
|
|
5239
5263
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5300,8 +5324,8 @@ function validations (formValues, language, languages) {
|
|
|
5300
5324
|
var _context2;
|
|
5301
5325
|
// Collect all required and set type fields
|
|
5302
5326
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5303
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5304
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5327
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$T(_objectSpread$T({}, acc), {}, {
|
|
5328
|
+
[fieldDefinition.name]: _objectSpread$T(_objectSpread$T({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5305
5329
|
}), {});
|
|
5306
5330
|
return withoutEmptyErrorsByField(errors);
|
|
5307
5331
|
}
|
|
@@ -5328,8 +5352,8 @@ function CustomTextInput(props) {
|
|
|
5328
5352
|
}
|
|
5329
5353
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5330
5354
|
|
|
5331
|
-
function ownKeys$
|
|
5332
|
-
function _objectSpread$
|
|
5355
|
+
function ownKeys$S(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5356
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$S(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$S(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5333
5357
|
const getSubfieldLanguage = subfieldName => {
|
|
5334
5358
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5335
5359
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5353,7 +5377,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5353
5377
|
// as a whole.
|
|
5354
5378
|
|
|
5355
5379
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5356
|
-
const newValue = _objectSpread$
|
|
5380
|
+
const newValue = _objectSpread$S(_objectSpread$S({}, props.value), {}, {
|
|
5357
5381
|
[fieldLanguage]: rawValue
|
|
5358
5382
|
});
|
|
5359
5383
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5420,21 +5444,21 @@ function CustomNumberInput(props) {
|
|
|
5420
5444
|
}
|
|
5421
5445
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5422
5446
|
|
|
5423
|
-
function ownKeys$
|
|
5424
|
-
function _objectSpread$
|
|
5425
|
-
var styles$
|
|
5447
|
+
function ownKeys$R(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5448
|
+
function _objectSpread$R(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5449
|
+
var styles$f = {
|
|
5426
5450
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5427
5451
|
};
|
|
5428
5452
|
const fixCurrencyCode = (value, currencies) => {
|
|
5429
5453
|
if (value.currencyCode) return value;
|
|
5430
5454
|
const firstCurrency = currencies[0];
|
|
5431
|
-
return _objectSpread$
|
|
5455
|
+
return _objectSpread$R(_objectSpread$R({}, value), {}, {
|
|
5432
5456
|
currencyCode: firstCurrency
|
|
5433
5457
|
});
|
|
5434
5458
|
};
|
|
5435
5459
|
const fixAmount = value => {
|
|
5436
5460
|
if (!value.amount) {
|
|
5437
|
-
return _objectSpread$
|
|
5461
|
+
return _objectSpread$R(_objectSpread$R({}, value), {}, {
|
|
5438
5462
|
amount: '0'
|
|
5439
5463
|
});
|
|
5440
5464
|
}
|
|
@@ -5476,7 +5500,7 @@ function CustomMoneyInput(props) {
|
|
|
5476
5500
|
}
|
|
5477
5501
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5478
5502
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5479
|
-
const newValue = _objectSpread$
|
|
5503
|
+
const newValue = _objectSpread$R({}, internalValue.current);
|
|
5480
5504
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5481
5505
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5482
5506
|
internalValue.current = fixedValue;
|
|
@@ -5486,7 +5510,7 @@ function CustomMoneyInput(props) {
|
|
|
5486
5510
|
|
|
5487
5511
|
// TODO(pa3): fix setting proper id in UIKit
|
|
5488
5512
|
return jsxRuntime.jsxs("div", {
|
|
5489
|
-
className: styles$
|
|
5513
|
+
className: styles$f.container,
|
|
5490
5514
|
"aria-labelledby": props.name,
|
|
5491
5515
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
5492
5516
|
children: jsxRuntime.jsx("label", {
|
|
@@ -5614,7 +5638,7 @@ function getCategoriesByIds(apolloClient, options) {
|
|
|
5614
5638
|
});
|
|
5615
5639
|
}
|
|
5616
5640
|
|
|
5617
|
-
var styles$
|
|
5641
|
+
var styles$e = {
|
|
5618
5642
|
"container": "reference-search-module__container___3-iK3",
|
|
5619
5643
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5620
5644
|
};
|
|
@@ -5724,9 +5748,9 @@ function ReferenceSearch(props) {
|
|
|
5724
5748
|
props.onChange(option);
|
|
5725
5749
|
};
|
|
5726
5750
|
return jsxRuntime.jsxs("div", {
|
|
5727
|
-
className: styles$
|
|
5751
|
+
className: styles$e.container,
|
|
5728
5752
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
5729
|
-
className: styles$
|
|
5753
|
+
className: styles$e['missing-label'],
|
|
5730
5754
|
children: props.referenceIsMissingLabel
|
|
5731
5755
|
}), jsxRuntime.jsx(CustomFieldTooltip, {
|
|
5732
5756
|
title: tooltipTitle,
|
|
@@ -5757,7 +5781,7 @@ function ReferenceSearch(props) {
|
|
|
5757
5781
|
});
|
|
5758
5782
|
}
|
|
5759
5783
|
|
|
5760
|
-
const messages$
|
|
5784
|
+
const messages$A = reactIntl.defineMessages({
|
|
5761
5785
|
placeholder: {
|
|
5762
5786
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5763
5787
|
description: 'Placeholder for search for a category',
|
|
@@ -5790,8 +5814,8 @@ const messages$B = reactIntl.defineMessages({
|
|
|
5790
5814
|
}
|
|
5791
5815
|
});
|
|
5792
5816
|
|
|
5793
|
-
function ownKeys$
|
|
5794
|
-
function _objectSpread$
|
|
5817
|
+
function ownKeys$Q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5818
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$Q(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$Q(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5795
5819
|
function Option$1(props) {
|
|
5796
5820
|
var _context, _context2;
|
|
5797
5821
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5803,7 +5827,7 @@ function Option$1(props) {
|
|
|
5803
5827
|
const _useIntl = reactIntl.useIntl(),
|
|
5804
5828
|
formatMessage = _useIntl.formatMessage;
|
|
5805
5829
|
const category = props.data;
|
|
5806
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5830
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
5807
5831
|
children: jsxRuntime.jsxs("div", {
|
|
5808
5832
|
"data-testid": "category-option",
|
|
5809
5833
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5814,7 +5838,7 @@ function Option$1(props) {
|
|
|
5814
5838
|
fallbackOrder: languages
|
|
5815
5839
|
})
|
|
5816
5840
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5817
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5841
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$A.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5818
5842
|
key: 'name',
|
|
5819
5843
|
locale: language,
|
|
5820
5844
|
fallbackOrder: languages
|
|
@@ -5826,14 +5850,14 @@ function Option$1(props) {
|
|
|
5826
5850
|
fallbackOrder: languages
|
|
5827
5851
|
}))
|
|
5828
5852
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5829
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5853
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$A.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5830
5854
|
})]
|
|
5831
5855
|
})
|
|
5832
5856
|
}));
|
|
5833
5857
|
}
|
|
5834
5858
|
|
|
5835
|
-
function ownKeys$
|
|
5836
|
-
function _objectSpread$
|
|
5859
|
+
function ownKeys$P(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5860
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$P(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$P(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5837
5861
|
const filterOption$1 = () => true;
|
|
5838
5862
|
function CategoryReferenceSearch(props) {
|
|
5839
5863
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5845,7 +5869,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5845
5869
|
})),
|
|
5846
5870
|
language = _useApplicationContex.language,
|
|
5847
5871
|
languages = _useApplicationContex.languages;
|
|
5848
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5872
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$P(_objectSpread$P({}, category), {}, {
|
|
5849
5873
|
value: category.id,
|
|
5850
5874
|
label: l10n.formatLocalizedString(category, {
|
|
5851
5875
|
key: 'name',
|
|
@@ -5863,7 +5887,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5863
5887
|
}), [apolloClient]);
|
|
5864
5888
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5865
5889
|
id: props.id,
|
|
5866
|
-
components: _objectSpread$
|
|
5890
|
+
components: _objectSpread$P({
|
|
5867
5891
|
Option: Option$1
|
|
5868
5892
|
}, props.components),
|
|
5869
5893
|
isClearable: props.isClearable,
|
|
@@ -5874,10 +5898,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5874
5898
|
onBlur: props.onBlur,
|
|
5875
5899
|
onChange: props.onChange,
|
|
5876
5900
|
value: props.value,
|
|
5877
|
-
placeholderLabel: formatMessage(messages$
|
|
5878
|
-
searchPromptLabel: formatMessage(messages$
|
|
5879
|
-
noResultsLabel: formatMessage(messages$
|
|
5880
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5901
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
5902
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
5903
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
5904
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
5881
5905
|
mapItemToOption: mapItemToOption,
|
|
5882
5906
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5883
5907
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5953,7 +5977,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5953
5977
|
});
|
|
5954
5978
|
}
|
|
5955
5979
|
|
|
5956
|
-
const messages$
|
|
5980
|
+
const messages$z = reactIntl.defineMessages({
|
|
5957
5981
|
placeholder: {
|
|
5958
5982
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5959
5983
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5981,8 +6005,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5981
6005
|
}
|
|
5982
6006
|
});
|
|
5983
6007
|
|
|
5984
|
-
function ownKeys$
|
|
5985
|
-
function _objectSpread$
|
|
6008
|
+
function ownKeys$O(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6009
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$O(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$O(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5986
6010
|
function Option(props) {
|
|
5987
6011
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
5988
6012
|
language: applicationContext.dataLocale,
|
|
@@ -5993,7 +6017,7 @@ function Option(props) {
|
|
|
5993
6017
|
const _useIntl = reactIntl.useIntl(),
|
|
5994
6018
|
formatMessage = _useIntl.formatMessage;
|
|
5995
6019
|
const cartDiscount = props.data;
|
|
5996
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6020
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$O(_objectSpread$O({}, props), {}, {
|
|
5997
6021
|
children: jsxRuntime.jsxs("div", {
|
|
5998
6022
|
"data-testid": "cart-discount-option",
|
|
5999
6023
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6004,14 +6028,14 @@ function Option(props) {
|
|
|
6004
6028
|
fallbackOrder: languages
|
|
6005
6029
|
})
|
|
6006
6030
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6007
|
-
children: [formatMessage(messages$
|
|
6031
|
+
children: [formatMessage(messages$z.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6008
6032
|
})]
|
|
6009
6033
|
})
|
|
6010
6034
|
}));
|
|
6011
6035
|
}
|
|
6012
6036
|
|
|
6013
|
-
function ownKeys$
|
|
6014
|
-
function _objectSpread$
|
|
6037
|
+
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6038
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$N(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6015
6039
|
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 } } } };
|
|
6016
6040
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6017
6041
|
const filterOption = (option, text) => {
|
|
@@ -6037,7 +6061,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6037
6061
|
})),
|
|
6038
6062
|
language = _useApplicationContex.language,
|
|
6039
6063
|
languages = _useApplicationContex.languages;
|
|
6040
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6064
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$N(_objectSpread$N({}, cartDiscount), {}, {
|
|
6041
6065
|
value: cartDiscount.id,
|
|
6042
6066
|
key: cartDiscount.key,
|
|
6043
6067
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6080,10 +6104,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6080
6104
|
onBlur: props.onBlur,
|
|
6081
6105
|
onChange: props.onChange,
|
|
6082
6106
|
value: returnNullIfEmpty(props.value),
|
|
6083
|
-
placeholderLabel: formatMessage(messages$
|
|
6084
|
-
searchPromptLabel: formatMessage(messages$
|
|
6085
|
-
noResultsLabel: formatMessage(messages$
|
|
6086
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6107
|
+
placeholderLabel: formatMessage(messages$z.placeholder),
|
|
6108
|
+
searchPromptLabel: formatMessage(messages$z.searchPrompt),
|
|
6109
|
+
noResultsLabel: formatMessage(messages$z.noResults),
|
|
6110
|
+
referenceIsMissingLabel: formatMessage(messages$z.isMissing),
|
|
6087
6111
|
mapItemToOption: mapItemToOption,
|
|
6088
6112
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6089
6113
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6144,7 +6168,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6144
6168
|
});
|
|
6145
6169
|
}
|
|
6146
6170
|
|
|
6147
|
-
var messages$
|
|
6171
|
+
var messages$y = reactIntl.defineMessages({
|
|
6148
6172
|
noProductsFound: {
|
|
6149
6173
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6150
6174
|
description: 'The message to display when no products were found',
|
|
@@ -6243,7 +6267,7 @@ const ProductPickerInput = _ref => {
|
|
|
6243
6267
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6244
6268
|
id: name,
|
|
6245
6269
|
name: name,
|
|
6246
|
-
placeholder: formatMessage(messages$
|
|
6270
|
+
placeholder: formatMessage(messages$y.placeholder),
|
|
6247
6271
|
loadOptions: loadOptionsDebounced,
|
|
6248
6272
|
defaultOptions: [],
|
|
6249
6273
|
isClearable: isClearable,
|
|
@@ -6257,7 +6281,7 @@ const ProductPickerInput = _ref => {
|
|
|
6257
6281
|
onInputChange: handleInputChange,
|
|
6258
6282
|
onBlur: onBlur,
|
|
6259
6283
|
value: currentOption.data,
|
|
6260
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6284
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$y.noProductsFound),
|
|
6261
6285
|
hasError: hasError || isLoadingFailed
|
|
6262
6286
|
})
|
|
6263
6287
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6507,630 +6531,44 @@ function CustomBooleanInputSet(props) {
|
|
|
6507
6531
|
}
|
|
6508
6532
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6509
6533
|
|
|
6510
|
-
var
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6534
|
+
function ownKeys$M(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6535
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$M(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$M(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6536
|
+
const getTypeName = type => type.name.toLowerCase();
|
|
6537
|
+
const findLabel = (enumType, key) => {
|
|
6538
|
+
var _enumType$values$find, _enumType$values$find2, _context;
|
|
6539
|
+
const emptyValue = getTypeName(enumType) === 'enum' ? '' : {};
|
|
6540
|
+
return (_enumType$values$find = (_enumType$values$find2 = _findInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](enumType)).call(_context, value => value.key === key)) === null || _enumType$values$find2 === void 0 ? void 0 : _enumType$values$find2.label) !== null && _enumType$values$find !== void 0 ? _enumType$values$find : emptyValue;
|
|
6516
6541
|
};
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
[styles$e.size_s]: size === 's',
|
|
6526
|
-
[styles$e.size_m]: size === 'm'
|
|
6527
|
-
})
|
|
6528
|
-
});
|
|
6529
|
-
}
|
|
6530
|
-
Divider.displayName = 'Divider';
|
|
6531
|
-
|
|
6532
|
-
const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
6533
|
-
scale: "s",
|
|
6534
|
-
alignItems: "center",
|
|
6535
|
-
children: [jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6536
|
-
children: jsxRuntime.jsx(Divider, {})
|
|
6537
|
-
}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
6538
|
-
tone: "primary",
|
|
6539
|
-
icon: props.isExpanded ? jsxRuntime.jsx(uiKit.AngleUpIcon, {}) : jsxRuntime.jsx(uiKit.AngleDownIcon, {}),
|
|
6540
|
-
label: props.isExpanded ? "Hide set items (".concat(props.totalValues, ")") : "Show all set items (".concat(props.totalValues, ")"),
|
|
6541
|
-
onClick: props.onExpand
|
|
6542
|
-
})]
|
|
6543
|
-
}) : null;
|
|
6544
|
-
ExpandButton.displayName = 'ExpandButton';
|
|
6545
|
-
|
|
6546
|
-
// @redesign cleanup
|
|
6547
|
-
var styles$d = {
|
|
6548
|
-
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6549
|
-
"gap": "set-buttons-module__gap___38Qr0"
|
|
6550
|
-
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
6551
|
-
// have to find a better way to do it.
|
|
6552
|
-
const SetButtons = props => {
|
|
6553
|
-
const _useTheme = designSystem.useTheme(),
|
|
6554
|
-
themedValue = _useTheme.themedValue;
|
|
6555
|
-
return jsxRuntime.jsx("div", {
|
|
6556
|
-
className: themedValue(props.isTopAligned ? styles$d.topAlign : undefined, undefined),
|
|
6557
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
6558
|
-
children: [jsxRuntime.jsx(uiKit.IconButton, {
|
|
6559
|
-
label: "Remove value",
|
|
6560
|
-
onClick: props.onRemoveItem,
|
|
6561
|
-
isDisabled: props.isRemoveDisabled,
|
|
6562
|
-
size: themedValue('medium', 'big'),
|
|
6563
|
-
icon: themedValue(jsxRuntime.jsx(uiKit.BinFilledIcon, {}), jsxRuntime.jsx(uiKit.BinLinearIcon, {}))
|
|
6564
|
-
}), props.isFirstItem ? jsxRuntime.jsx(uiKit.IconButton, {
|
|
6565
|
-
label: "Add value",
|
|
6566
|
-
onClick: props.onAddItem,
|
|
6567
|
-
isDisabled: props.isAddDisabled,
|
|
6568
|
-
size: themedValue('medium', 'big'),
|
|
6569
|
-
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
6570
|
-
}) : jsxRuntime.jsx("div", {
|
|
6571
|
-
className: styles$d.gap
|
|
6572
|
-
})]
|
|
6573
|
-
})
|
|
6542
|
+
const convertEnumValues = (value, attributeDefinition) => {
|
|
6543
|
+
var _context2, _context3;
|
|
6544
|
+
if (isNil__default["default"](value)) return value;
|
|
6545
|
+
const typeName = getTypeName(attributeDefinition.type);
|
|
6546
|
+
if (_includesInstanceProperty__default["default"](_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
6547
|
+
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, _ref => {
|
|
6548
|
+
let key = _ref.key;
|
|
6549
|
+
return key;
|
|
6574
6550
|
});
|
|
6551
|
+
return value;
|
|
6575
6552
|
};
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
const
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
duplicated: true
|
|
6592
|
-
};
|
|
6593
|
-
}
|
|
6594
|
-
}
|
|
6595
|
-
}
|
|
6596
|
-
return result;
|
|
6597
|
-
/* eslint-enable no-plusplus */
|
|
6598
|
-
};
|
|
6599
|
-
|
|
6600
|
-
const isEmpty$1 = value => value.length === 0;
|
|
6601
|
-
const nullifyIfEmpty = value => isEmpty$1(value) ? undefined : value;
|
|
6602
|
-
const dropEmptyEntries = value => _Array$isArray__default["default"](value) ? _filterInstanceProperty__default["default"](value).call(value, item => !isNil__default["default"](item)) : value;
|
|
6603
|
-
const removeArrayItem = (array, index) => {
|
|
6604
|
-
const head = _sliceInstanceProperty__default["default"](array).call(array, 0, index);
|
|
6605
|
-
const tail = _sliceInstanceProperty__default["default"](array).call(array, index + 1);
|
|
6606
|
-
return [...head, ...tail];
|
|
6553
|
+
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
6554
|
+
var _context4, _context5;
|
|
6555
|
+
if (isNil__default["default"](value)) return value;
|
|
6556
|
+
if (!attributeDefinition) return value;
|
|
6557
|
+
const type = attributeDefinition.type;
|
|
6558
|
+
const typeName = getTypeName(type);
|
|
6559
|
+
if (_includesInstanceProperty__default["default"](_context4 = ['enum', 'lenum']).call(_context4, typeName)) return {
|
|
6560
|
+
key: value,
|
|
6561
|
+
label: findLabel(type, value)
|
|
6562
|
+
};
|
|
6563
|
+
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context5 = ['enum', 'lenum']).call(_context5, getTypeName(type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, val => ({
|
|
6564
|
+
key: val,
|
|
6565
|
+
label: findLabel(type.elementType, val)
|
|
6566
|
+
}));
|
|
6567
|
+
return value;
|
|
6607
6568
|
};
|
|
6608
|
-
const
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
return [...head, newItem, ...tail];
|
|
6612
|
-
};
|
|
6613
|
-
const getItemIndex = name => {
|
|
6614
|
-
const indexPartStart = _lastIndexOfInstanceProperty__default["default"](name).call(name, '[');
|
|
6615
|
-
const indexPartEnd = _lastIndexOfInstanceProperty__default["default"](name).call(name, ']');
|
|
6616
|
-
const rawIndex = name.substring(indexPartStart + 1, indexPartEnd);
|
|
6617
|
-
return _parseInt__default["default"](rawIndex, 10);
|
|
6618
|
-
};
|
|
6619
|
-
const makeKeys = amount => times__default["default"](amount, () => uuid.v4());
|
|
6620
|
-
const makeItemFieldName = (fieldName, index) => {
|
|
6621
|
-
var _context;
|
|
6622
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(fieldName, ".[")).call(_context, index, "]");
|
|
6623
|
-
};
|
|
6624
|
-
const makeMapForAllItems = (fieldName, items, value) => _reduceInstanceProperty__default["default"](items).call(items, (result, item, index) => set__default["default"](result, makeItemFieldName(fieldName, index), value), {});
|
|
6625
|
-
function CustomInputSet(props) {
|
|
6626
|
-
var _context2;
|
|
6627
|
-
const _useToggleState = uiKit.useToggleState(false),
|
|
6628
|
-
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
6629
|
-
isExpanded = _useToggleState2[0],
|
|
6630
|
-
toggleExpansion = _useToggleState2[1];
|
|
6631
|
-
const _useFormikContext = formik.useFormikContext(),
|
|
6632
|
-
setTouched = _useFormikContext.setTouched,
|
|
6633
|
-
touched = _useFormikContext.touched,
|
|
6634
|
-
isSubmitting = _useFormikContext.isSubmitting,
|
|
6635
|
-
dirty = _useFormikContext.dirty;
|
|
6636
|
-
const itemFieldDefinition = _objectSpread$O(_objectSpread$O({}, props.fieldDefinition), {}, {
|
|
6637
|
-
type: props.fieldDefinition.type.elementType
|
|
6638
|
-
});
|
|
6639
|
-
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
6640
|
-
const _useState = React.useState(value),
|
|
6641
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
6642
|
-
internalValue = _useState2[0],
|
|
6643
|
-
setInternalValue = _useState2[1];
|
|
6644
|
-
const _useState3 = React.useState(makeKeys(internalValue.length)),
|
|
6645
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
6646
|
-
keys = _useState4[0],
|
|
6647
|
-
setKeys = _useState4[1];
|
|
6648
|
-
const totalAmount = internalValue === null || internalValue === void 0 ? void 0 : internalValue.length;
|
|
6649
|
-
const amountToRender = isExpanded ? totalAmount : 1;
|
|
6650
|
-
const updateInternalValue = newValue => {
|
|
6651
|
-
const valueToSet = isEmpty$1(newValue) ? [undefined] : newValue;
|
|
6652
|
-
setInternalValue(valueToSet);
|
|
6653
|
-
if (valueToSet.length !== keys.length) {
|
|
6654
|
-
setKeys(makeKeys(valueToSet.length));
|
|
6655
|
-
}
|
|
6656
|
-
};
|
|
6657
|
-
|
|
6658
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6659
|
-
React.useEffect(() => updateInternalValue(value), [value]);
|
|
6660
|
-
|
|
6661
|
-
// Filter out all empty values on form submit
|
|
6662
|
-
React.useEffect(() => {
|
|
6663
|
-
if (isSubmitting || !dirty) {
|
|
6664
|
-
const withoutEmpty = dropEmptyEntries(value);
|
|
6665
|
-
if (!fastEquals.deepEqual(withoutEmpty, dropEmptyEntries(internalValue))) {
|
|
6666
|
-
setKeys(makeKeys(withoutEmpty.length || 1));
|
|
6667
|
-
}
|
|
6668
|
-
updateInternalValue(withoutEmpty);
|
|
6669
|
-
}
|
|
6670
|
-
// I do really want to run it only when isSubmitting or dirty values change.
|
|
6671
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6672
|
-
}, [isSubmitting, dirty]);
|
|
6673
|
-
const markAllItemsAsTouched = items => setTouched(merge__default["default"]({}, touched, makeMapForAllItems(props.name, items, true)));
|
|
6674
|
-
const setNewValue = newValue => {
|
|
6675
|
-
const withoutEmpty = dropEmptyEntries(newValue);
|
|
6676
|
-
const nullified = nullifyIfEmpty(withoutEmpty);
|
|
6677
|
-
updateInternalValue(withoutEmpty);
|
|
6678
|
-
markAllItemsAsTouched(withoutEmpty);
|
|
6679
|
-
props.setFieldValue(props.name, nullified);
|
|
6680
|
-
};
|
|
6681
|
-
const addNewItem = () => updateInternalValue([undefined, ...internalValue]);
|
|
6682
|
-
const removeItem = index => {
|
|
6683
|
-
setNewValue(removeArrayItem(internalValue, index));
|
|
6684
|
-
};
|
|
6685
|
-
const setItemValue = (itemName, itemValue) => {
|
|
6686
|
-
const index = getItemIndex(itemName);
|
|
6687
|
-
const newValue = replaceArrayItem(internalValue, index, itemValue);
|
|
6688
|
-
setNewValue(newValue);
|
|
6689
|
-
};
|
|
6690
|
-
|
|
6691
|
-
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
6692
|
-
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
6693
|
-
// type is selected.
|
|
6694
|
-
const type = getType$1(props.fieldDefinition);
|
|
6695
|
-
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
6696
|
-
const areButtonsTopAligned = _includesInstanceProperty__default["default"](_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
|
|
6697
|
-
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6698
|
-
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
6699
|
-
children: jsxRuntime.jsx("label", {
|
|
6700
|
-
id: props.name,
|
|
6701
|
-
children: props.name
|
|
6702
|
-
})
|
|
6703
|
-
}), jsxRuntime.jsx("div", {
|
|
6704
|
-
children: jsxRuntime.jsx(formik.Field, {
|
|
6705
|
-
name: props.name,
|
|
6706
|
-
validate: values => {
|
|
6707
|
-
const errors = getDuplicateErrors(values);
|
|
6708
|
-
return errors.length > 0 ? errors : undefined;
|
|
6709
|
-
},
|
|
6710
|
-
children: () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
6711
|
-
scale: "s",
|
|
6712
|
-
"data-testid": props.name,
|
|
6713
|
-
children: [times__default["default"](amountToRender, index => {
|
|
6714
|
-
const fieldName = makeItemFieldName(props.name, index);
|
|
6715
|
-
const fieldValue = internalValue[index];
|
|
6716
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
6717
|
-
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
6718
|
-
children: [jsxRuntime.jsx(CustomFieldInput, {
|
|
6719
|
-
name: fieldName,
|
|
6720
|
-
fieldDefinition: itemFieldDefinition,
|
|
6721
|
-
isDisabled: props.isDisabled,
|
|
6722
|
-
isReadOnly: props.isReadOnly,
|
|
6723
|
-
onBlur: props.onBlur,
|
|
6724
|
-
setFieldValue: setItemValue,
|
|
6725
|
-
value: fieldValue,
|
|
6726
|
-
hasError: props.hasError
|
|
6727
|
-
}), jsxRuntime.jsx(SetButtons, {
|
|
6728
|
-
index: index,
|
|
6729
|
-
isFirstItem: !isExpanded || index === 0,
|
|
6730
|
-
onAddItem: addNewItem,
|
|
6731
|
-
onRemoveItem: () => removeItem(index),
|
|
6732
|
-
isRemoveDisabled: props.isDisabled || props.isReadOnly || internalValue.length === 1,
|
|
6733
|
-
isAddDisabled: props.isDisabled || props.isReadOnly || !internalValue[0],
|
|
6734
|
-
isTopAligned: areButtonsTopAligned
|
|
6735
|
-
})]
|
|
6736
|
-
}, keys[index]);
|
|
6737
|
-
}), jsxRuntime.jsx(ExpandButton, {
|
|
6738
|
-
totalValues: totalAmount,
|
|
6739
|
-
isExpanded: isExpanded,
|
|
6740
|
-
onExpand: toggleExpansion
|
|
6741
|
-
})]
|
|
6742
|
-
})
|
|
6743
|
-
})
|
|
6744
|
-
})]
|
|
6745
|
-
});
|
|
6746
|
-
}
|
|
6747
|
-
|
|
6748
|
-
var messages$y = reactIntl.defineMessages({
|
|
6749
|
-
referencedProductType: {
|
|
6750
|
-
id: 'NestedAttributes.referencedProductType',
|
|
6751
|
-
description: 'Product type referenced hint',
|
|
6752
|
-
defaultMessage: 'Product type referenced: {productTypeName}'
|
|
6753
|
-
}
|
|
6754
|
-
});
|
|
6755
|
-
|
|
6756
|
-
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6757
|
-
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6758
|
-
function ProductTypeReference(props) {
|
|
6759
|
-
const productTypeMessage = _objectSpread$N(_objectSpread$N({}, messages$y.referencedProductType), {}, {
|
|
6760
|
-
values: {
|
|
6761
|
-
productTypeName: props.productType.name
|
|
6762
|
-
}
|
|
6763
|
-
});
|
|
6764
|
-
return jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
6765
|
-
intlMessage: productTypeMessage
|
|
6766
|
-
});
|
|
6767
|
-
}
|
|
6768
|
-
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
6769
|
-
|
|
6770
|
-
function ownKeys$M(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6771
|
-
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$M(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$M(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6772
|
-
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 } } } };
|
|
6773
|
-
const mapAttributeDefinition = definition => {
|
|
6774
|
-
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6775
|
-
return _objectSpread$M(_objectSpread$M({}, definition), {}, {
|
|
6776
|
-
required: definition.isRequired,
|
|
6777
|
-
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6778
|
-
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6779
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$M(_objectSpread$M({}, definition.type), {}, {
|
|
6780
|
-
elementType: _objectSpread$M(_objectSpread$M({}, definition.type.elementType), {}, {
|
|
6781
|
-
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6782
|
-
key: value.key,
|
|
6783
|
-
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6784
|
-
}))
|
|
6785
|
-
})
|
|
6786
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$M(_objectSpread$M({}, definition.type), {}, {
|
|
6787
|
-
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6788
|
-
key: value.key,
|
|
6789
|
-
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6790
|
-
}))
|
|
6791
|
-
}) : definition.type
|
|
6792
|
-
});
|
|
6793
|
-
};
|
|
6794
|
-
function useNestedProductType(fieldDefinition) {
|
|
6795
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
6796
|
-
const isSet = typeName === 'set';
|
|
6797
|
-
const productTypeId = isSet ? fieldDefinition.type.elementType.typeRef.id : fieldDefinition.type.typeRef.id;
|
|
6798
|
-
const _useQuery = react.useQuery(FetchProductTypeQuery, {
|
|
6799
|
-
variables: {
|
|
6800
|
-
id: productTypeId
|
|
6801
|
-
},
|
|
6802
|
-
context: {
|
|
6803
|
-
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6804
|
-
}
|
|
6805
|
-
}),
|
|
6806
|
-
data = _useQuery.data,
|
|
6807
|
-
loading = _useQuery.loading,
|
|
6808
|
-
error = _useQuery.error;
|
|
6809
|
-
if (!loading && !error) {
|
|
6810
|
-
var _context5;
|
|
6811
|
-
const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6812
|
-
return {
|
|
6813
|
-
loading: false,
|
|
6814
|
-
error: false,
|
|
6815
|
-
productType: {
|
|
6816
|
-
name: data.productType.name,
|
|
6817
|
-
attributeDefinitions
|
|
6818
|
-
}
|
|
6819
|
-
};
|
|
6820
|
-
}
|
|
6821
|
-
return {
|
|
6822
|
-
loading,
|
|
6823
|
-
error
|
|
6824
|
-
};
|
|
6825
|
-
}
|
|
6826
|
-
|
|
6827
|
-
function CustomNestedFieldInput(props) {
|
|
6828
|
-
const typeName = props.fieldDefinition.type.name.toLowerCase();
|
|
6829
|
-
const isSet = typeName === 'set';
|
|
6830
|
-
const _useNestedProductType = useNestedProductType(props.fieldDefinition),
|
|
6831
|
-
productType = _useNestedProductType.productType,
|
|
6832
|
-
error = _useNestedProductType.error;
|
|
6833
|
-
if (error) return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
6834
|
-
scale: "s",
|
|
6835
|
-
alignItems: "center",
|
|
6836
|
-
children: [jsxRuntime.jsx(uiKit.ErrorIcon, {
|
|
6837
|
-
color: "error"
|
|
6838
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6839
|
-
tone: "negative",
|
|
6840
|
-
intlMessage: commonPickerMessages.loadingErrorMessage
|
|
6841
|
-
})]
|
|
6842
|
-
});
|
|
6843
|
-
if (!productType) return null;
|
|
6844
|
-
const InputComponent = isSet ? CustomInputSet : CustomNestedInput;
|
|
6845
|
-
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6846
|
-
children: [jsxRuntime.jsx(ProductTypeReference, {
|
|
6847
|
-
productType: productType
|
|
6848
|
-
}), jsxRuntime.jsx(InputComponent, {
|
|
6849
|
-
name: props.name,
|
|
6850
|
-
productType: productType,
|
|
6851
|
-
fieldDefinition: props.fieldDefinition,
|
|
6852
|
-
value: props.value,
|
|
6853
|
-
isDisabled: props.isDisabled,
|
|
6854
|
-
isReadOnly: props.isReadOnly,
|
|
6855
|
-
setFieldValue: props.setFieldValue,
|
|
6856
|
-
onBlur: props.onBlur
|
|
6857
|
-
})]
|
|
6858
|
-
});
|
|
6859
|
-
}
|
|
6860
|
-
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
6861
|
-
|
|
6862
|
-
function ownKeys$L(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6863
|
-
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$L(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$L(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6864
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$L(_objectSpread$L({}, result), itemErrors), {});
|
|
6865
|
-
|
|
6866
|
-
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
6867
|
-
// all the other types of fields. So that there will be no isArray check.
|
|
6868
|
-
const CustomFieldErrors = props => {
|
|
6869
|
-
// We want to highlight fields with errors not only after a form submission,
|
|
6870
|
-
// but also after manually triggered form validation.
|
|
6871
|
-
const didFormValidationFail = useDidFormValidationFail();
|
|
6872
|
-
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
6873
|
-
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6874
|
-
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
6875
|
-
intlMessage: messages$K.required
|
|
6876
|
-
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
6877
|
-
intlMessage: messages$K.unique
|
|
6878
|
-
})]
|
|
6879
|
-
});
|
|
6880
|
-
};
|
|
6881
|
-
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
6882
|
-
|
|
6883
|
-
var messages$x = reactIntl.defineMessages({
|
|
6884
|
-
productReferenceLabel: {
|
|
6885
|
-
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
6886
|
-
description: 'Label shown above the product picker input.',
|
|
6887
|
-
defaultMessage: 'Product (case sensitive field)'
|
|
6888
|
-
},
|
|
6889
|
-
productTypeReferenceLabel: {
|
|
6890
|
-
id: 'CustomFieldsLabel.productTypeReferenceLabel',
|
|
6891
|
-
description: 'Label shown above the product type picker input.',
|
|
6892
|
-
defaultMessage: 'Product type (case sensitive field)'
|
|
6893
|
-
},
|
|
6894
|
-
productTypeReferenceLabelI: {
|
|
6895
|
-
id: 'CustomFieldsLabel.productTypeReferenceLabelI',
|
|
6896
|
-
description: 'Label shown above the product type picker input for indexed project.',
|
|
6897
|
-
defaultMessage: 'Product type'
|
|
6898
|
-
},
|
|
6899
|
-
stateReferenceLabel: {
|
|
6900
|
-
id: 'CustomFieldsLabel.stateReferenceLabel',
|
|
6901
|
-
description: 'Label shown above the state picker input.',
|
|
6902
|
-
defaultMessage: 'State (case sensitive field)'
|
|
6903
|
-
},
|
|
6904
|
-
channelReferenceLabel: {
|
|
6905
|
-
id: 'CustomFieldsLabel.channelReferenceLabel',
|
|
6906
|
-
description: 'Label shown above the channel picker input.',
|
|
6907
|
-
defaultMessage: 'Channel (case sensitive field)'
|
|
6908
|
-
},
|
|
6909
|
-
cartDiscountMoreThan500: {
|
|
6910
|
-
id: 'cartDiscountMoreThan500',
|
|
6911
|
-
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
6912
|
-
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
6913
|
-
}
|
|
6914
|
-
});
|
|
6915
|
-
|
|
6916
|
-
function ownKeys$K(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6917
|
-
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$K(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$K(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6918
|
-
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 } } } };
|
|
6919
|
-
const CustomFieldsLabelHint = _ref => {
|
|
6920
|
-
var _type$name;
|
|
6921
|
-
let fieldDefinition = _ref.fieldDefinition;
|
|
6922
|
-
const type = getType$1(fieldDefinition);
|
|
6923
|
-
const _useTheme = designSystem.useTheme(),
|
|
6924
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
6925
|
-
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
6926
|
-
const referenceTypeId = type.referenceTypeId;
|
|
6927
|
-
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
6928
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6929
|
-
languages: applicationContext.project.languages,
|
|
6930
|
-
dataLocale: applicationContext.dataLocale
|
|
6931
|
-
})),
|
|
6932
|
-
languages = _useApplicationContex.languages,
|
|
6933
|
-
dataLocale = _useApplicationContex.dataLocale;
|
|
6934
|
-
const _useQuery = react.useQuery(CartDiscountsCount, {
|
|
6935
|
-
skip: !isCartDiscountsReference,
|
|
6936
|
-
context: {
|
|
6937
|
-
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6938
|
-
}
|
|
6939
|
-
}),
|
|
6940
|
-
data = _useQuery.data,
|
|
6941
|
-
loading = _useQuery.loading;
|
|
6942
|
-
if (loading) return null;
|
|
6943
|
-
if ((data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT) {
|
|
6944
|
-
return isNewTheme ? jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
6945
|
-
alignItems: "center",
|
|
6946
|
-
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
6947
|
-
size: "medium",
|
|
6948
|
-
color: "warning"
|
|
6949
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$K({}, messages$x.cartDiscountMoreThan500))]
|
|
6950
|
-
}) : jsxRuntime.jsx(uiKit.Spacings.Inset, {
|
|
6951
|
-
scale: "xs",
|
|
6952
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
6953
|
-
alignItems: "flex-start",
|
|
6954
|
-
children: [jsxRuntime.jsx(uiKit.InformationIcon, {
|
|
6955
|
-
size: "medium"
|
|
6956
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$K({}, messages$x.cartDiscountMoreThan500))]
|
|
6957
|
-
})
|
|
6958
|
-
});
|
|
6959
|
-
}
|
|
6960
|
-
return l10n.formatLocalizedString(fieldDefinition, {
|
|
6961
|
-
key: 'inputTip',
|
|
6962
|
-
locale: dataLocale,
|
|
6963
|
-
fallbackOrder: languages
|
|
6964
|
-
});
|
|
6965
|
-
};
|
|
6966
|
-
function CustomFieldsProductTypeReferenceSubtitle() {
|
|
6967
|
-
const _useIntl = reactIntl.useIntl(),
|
|
6968
|
-
formatMessage = _useIntl.formatMessage;
|
|
6969
|
-
const _usePimStatus = usePimStatus(),
|
|
6970
|
-
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
6971
|
-
if (isProjectIndexed) return formatMessage(messages$x.productTypeReferenceLabelI);
|
|
6972
|
-
return formatMessage(messages$x.productTypeReferenceLabel);
|
|
6973
|
-
}
|
|
6974
|
-
|
|
6975
|
-
// TODO(pa3): this logic may be misplaced and probably
|
|
6976
|
-
// should belong to <CustomReferenceInput /> component instead.
|
|
6977
|
-
function CustomFieldsLabelSubtitle(_ref2) {
|
|
6978
|
-
var _type$name2, _context;
|
|
6979
|
-
let fieldDefinition = _ref2.fieldDefinition;
|
|
6980
|
-
const _useIntl2 = reactIntl.useIntl(),
|
|
6981
|
-
formatMessage = _useIntl2.formatMessage;
|
|
6982
|
-
const type = getType$1(fieldDefinition);
|
|
6983
|
-
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
6984
|
-
if (!isReference) return null;
|
|
6985
|
-
const referenceTypeId = type.referenceTypeId;
|
|
6986
|
-
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
6987
|
-
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
6988
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$x.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$x.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$x.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
6989
|
-
}
|
|
6990
|
-
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
6991
|
-
let name = _ref3.name,
|
|
6992
|
-
fieldDefinition = _ref3.fieldDefinition;
|
|
6993
|
-
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6994
|
-
languages: applicationContext.project.languages,
|
|
6995
|
-
language: applicationContext.dataLocale
|
|
6996
|
-
})),
|
|
6997
|
-
languages = _useApplicationContex2.languages,
|
|
6998
|
-
language = _useApplicationContex2.language;
|
|
6999
|
-
return jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
7000
|
-
htmlFor: name,
|
|
7001
|
-
title: l10n.formatLocalizedString(fieldDefinition, {
|
|
7002
|
-
key: 'label',
|
|
7003
|
-
locale: language,
|
|
7004
|
-
fallbackOrder: languages,
|
|
7005
|
-
fallback: fieldDefinition.name
|
|
7006
|
-
}),
|
|
7007
|
-
description: jsxRuntime.jsx(CustomFieldsLabelSubtitle, {
|
|
7008
|
-
fieldDefinition: fieldDefinition
|
|
7009
|
-
}),
|
|
7010
|
-
hint: jsxRuntime.jsx(CustomFieldsLabelHint, {
|
|
7011
|
-
fieldDefinition: fieldDefinition
|
|
7012
|
-
}),
|
|
7013
|
-
hasRequiredIndicator: fieldDefinition.required
|
|
7014
|
-
});
|
|
7015
|
-
});
|
|
7016
|
-
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
7017
|
-
|
|
7018
|
-
const getFieldName$1 = (parentName, fieldName) => {
|
|
7019
|
-
var _context;
|
|
7020
|
-
if (!parentName) return fieldName;
|
|
7021
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(parentName, ".")).call(_context, fieldName);
|
|
7022
|
-
};
|
|
7023
|
-
const isNested$1 = fieldDefinition => {
|
|
7024
|
-
const type = fieldDefinition.type;
|
|
7025
|
-
const typeName = type.name.toLowerCase();
|
|
7026
|
-
if (typeName === 'set') {
|
|
7027
|
-
const elementTypeName = type.elementType.name.toLowerCase();
|
|
7028
|
-
return elementTypeName === CUSTOM_FIELD_TYPES.nested;
|
|
7029
|
-
}
|
|
7030
|
-
return typeName === CUSTOM_FIELD_TYPES.nested;
|
|
7031
|
-
};
|
|
7032
|
-
const ThemedCustomFieldsInternal = props => {
|
|
7033
|
-
const _useFormikContext = formik.useFormikContext(),
|
|
7034
|
-
errors = _useFormikContext.errors,
|
|
7035
|
-
touched = _useFormikContext.touched,
|
|
7036
|
-
values = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
7037
|
-
handleBlur = _useFormikContext.handleBlur;
|
|
7038
|
-
const didFormValidationFail = useDidFormValidationFail();
|
|
7039
|
-
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7040
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
7041
|
-
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7042
|
-
var _context2;
|
|
7043
|
-
const fieldName = getFieldName$1(props.name, fieldDefinition.name);
|
|
7044
|
-
const isTouched = Boolean(formik.getIn(touched, fieldName));
|
|
7045
|
-
const fieldErrors = formik.getIn(errors, fieldName);
|
|
7046
|
-
const value = props.inputValuesConverter(fieldName, formik.getIn(values, fieldName));
|
|
7047
|
-
// We want to highlight fields with errors not only after a form submission,
|
|
7048
|
-
// but also after manually triggered form validation.
|
|
7049
|
-
const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
|
|
7050
|
-
const validate = value => {
|
|
7051
|
-
if (fieldDefinition.required && isNil__default["default"](value)) return {
|
|
7052
|
-
missing: true
|
|
7053
|
-
};
|
|
7054
|
-
return undefined;
|
|
7055
|
-
};
|
|
7056
|
-
return jsxRuntime.jsx(formik.FastField, {
|
|
7057
|
-
name: fieldName,
|
|
7058
|
-
validate: validate,
|
|
7059
|
-
children: () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7060
|
-
scale: "xs",
|
|
7061
|
-
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7062
|
-
name: fieldName,
|
|
7063
|
-
fieldDefinition: fieldDefinition
|
|
7064
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7065
|
-
scale: "xs",
|
|
7066
|
-
alignItems: "stretch",
|
|
7067
|
-
children: [isNested$1(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7068
|
-
name: fieldName,
|
|
7069
|
-
value: value,
|
|
7070
|
-
fieldDefinition: fieldDefinition,
|
|
7071
|
-
isDisabled: props.isDisabled,
|
|
7072
|
-
isReadOnly: props.isReadOnly,
|
|
7073
|
-
onBlur: handleBlur,
|
|
7074
|
-
setFieldValue: props.setFieldValue
|
|
7075
|
-
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7076
|
-
name: fieldName,
|
|
7077
|
-
value: value,
|
|
7078
|
-
fieldDefinition: fieldDefinition,
|
|
7079
|
-
isDisabled: props.isDisabled,
|
|
7080
|
-
isReadOnly: props.isReadOnly,
|
|
7081
|
-
onBlur: handleBlur,
|
|
7082
|
-
setFieldValue: props.setFieldValue,
|
|
7083
|
-
hasError: hasError
|
|
7084
|
-
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7085
|
-
isTouched: isTouched,
|
|
7086
|
-
errors: fieldErrors
|
|
7087
|
-
})]
|
|
7088
|
-
})]
|
|
7089
|
-
})
|
|
7090
|
-
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7091
|
-
})
|
|
7092
|
-
});
|
|
7093
|
-
};
|
|
7094
|
-
ThemedCustomFieldsInternal.displayName = 'ThemedCustomFieldsInternal';
|
|
7095
|
-
|
|
7096
|
-
function ownKeys$J(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7097
|
-
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$J(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$J(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7098
|
-
const getTypeName = type => type.name.toLowerCase();
|
|
7099
|
-
const findLabel = (enumType, key) => {
|
|
7100
|
-
var _enumType$values$find, _enumType$values$find2, _context;
|
|
7101
|
-
const emptyValue = getTypeName(enumType) === 'enum' ? '' : {};
|
|
7102
|
-
return (_enumType$values$find = (_enumType$values$find2 = _findInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](enumType)).call(_context, value => value.key === key)) === null || _enumType$values$find2 === void 0 ? void 0 : _enumType$values$find2.label) !== null && _enumType$values$find !== void 0 ? _enumType$values$find : emptyValue;
|
|
7103
|
-
};
|
|
7104
|
-
const convertEnumValues = (value, attributeDefinition) => {
|
|
7105
|
-
var _context2, _context3;
|
|
7106
|
-
if (isNil__default["default"](value)) return value;
|
|
7107
|
-
const typeName = getTypeName(attributeDefinition.type);
|
|
7108
|
-
if (_includesInstanceProperty__default["default"](_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
7109
|
-
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, _ref => {
|
|
7110
|
-
let key = _ref.key;
|
|
7111
|
-
return key;
|
|
7112
|
-
});
|
|
7113
|
-
return value;
|
|
7114
|
-
};
|
|
7115
|
-
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
7116
|
-
var _context4, _context5;
|
|
7117
|
-
if (isNil__default["default"](value)) return value;
|
|
7118
|
-
if (!attributeDefinition) return value;
|
|
7119
|
-
const type = attributeDefinition.type;
|
|
7120
|
-
const typeName = getTypeName(type);
|
|
7121
|
-
if (_includesInstanceProperty__default["default"](_context4 = ['enum', 'lenum']).call(_context4, typeName)) return {
|
|
7122
|
-
key: value,
|
|
7123
|
-
label: findLabel(type, value)
|
|
7124
|
-
};
|
|
7125
|
-
if (typeName === 'set' && _includesInstanceProperty__default["default"](_context5 = ['enum', 'lenum']).call(_context5, getTypeName(type.elementType))) return _mapInstanceProperty__default["default"](value).call(value, val => ({
|
|
7126
|
-
key: val,
|
|
7127
|
-
label: findLabel(type.elementType, val)
|
|
7128
|
-
}));
|
|
7129
|
-
return value;
|
|
7130
|
-
};
|
|
7131
|
-
const attributeToCustomField = (attributeValue, attributeDefinition) => {
|
|
7132
|
-
if (!attributeDefinition) return attributeValue;
|
|
7133
|
-
return convertEnumValues(attributeValue, attributeDefinition);
|
|
6569
|
+
const attributeToCustomField = (attributeValue, attributeDefinition) => {
|
|
6570
|
+
if (!attributeDefinition) return attributeValue;
|
|
6571
|
+
return convertEnumValues(attributeValue, attributeDefinition);
|
|
7134
6572
|
};
|
|
7135
6573
|
const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
7136
6574
|
name: attributeDefinition.name,
|
|
@@ -7143,7 +6581,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
7143
6581
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
7144
6582
|
let name = _ref2.name,
|
|
7145
6583
|
value = _ref2.value;
|
|
7146
|
-
return _objectSpread$
|
|
6584
|
+
return _objectSpread$M(_objectSpread$M({}, result), {}, {
|
|
7147
6585
|
[name]: value
|
|
7148
6586
|
});
|
|
7149
6587
|
}, {});
|
|
@@ -7166,8 +6604,6 @@ const getAttributeShortName = (fullName, attributesPrefix) => {
|
|
|
7166
6604
|
};
|
|
7167
6605
|
function ProductAttributes(props) {
|
|
7168
6606
|
const formik$1 = formik.useFormikContext();
|
|
7169
|
-
const _useTheme = designSystem.useTheme(),
|
|
7170
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7171
6607
|
const fieldDefinitions = React.useMemo(() => {
|
|
7172
6608
|
var _context;
|
|
7173
6609
|
return _mapInstanceProperty__default["default"](_context = props.attributeDefinitions).call(_context, attributeDefinitionToFieldDefinition);
|
|
@@ -7180,11 +6616,11 @@ function ProductAttributes(props) {
|
|
|
7180
6616
|
formikSetFieldValue(name, converted);
|
|
7181
6617
|
}, [props.name, attributeDefinitionsAsMap, formikSetFieldValue]);
|
|
7182
6618
|
const convertInputValue = (attributeName, attributeValue) => attributeToCustomField(attributeValue, attributeDefinitionsAsMap[getAttributeShortName(attributeName, props.name)]);
|
|
7183
|
-
return
|
|
6619
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
7184
6620
|
max: "scale",
|
|
7185
6621
|
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7186
6622
|
scale: "xl",
|
|
7187
|
-
children: jsxRuntime.jsx(
|
|
6623
|
+
children: jsxRuntime.jsx(CustomFieldsInternal, {
|
|
7188
6624
|
name: props.name,
|
|
7189
6625
|
isReadOnly: props.isReadOnly,
|
|
7190
6626
|
isDisabled: props.isDisabled,
|
|
@@ -7193,13 +6629,6 @@ function ProductAttributes(props) {
|
|
|
7193
6629
|
inputValuesConverter: convertInputValue
|
|
7194
6630
|
})
|
|
7195
6631
|
})
|
|
7196
|
-
}) : jsxRuntime.jsx(CustomFieldsInternal, {
|
|
7197
|
-
name: props.name,
|
|
7198
|
-
isDisabled: props.isDisabled,
|
|
7199
|
-
isReadOnly: props.isReadOnly,
|
|
7200
|
-
fieldDefinitions: fieldDefinitions,
|
|
7201
|
-
setFieldValue: setFieldValue,
|
|
7202
|
-
inputValuesConverter: convertInputValue
|
|
7203
6632
|
});
|
|
7204
6633
|
}
|
|
7205
6634
|
|
|
@@ -7236,7 +6665,7 @@ function ProductAttributeInput(props) {
|
|
|
7236
6665
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
7237
6666
|
|
|
7238
6667
|
// eslint-disable-next-line import/prefer-default-export
|
|
7239
|
-
const messages$
|
|
6668
|
+
const messages$x = reactIntl.defineMessages({
|
|
7240
6669
|
aboveFifthLevelWarning: {
|
|
7241
6670
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
7242
6671
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -7249,7 +6678,64 @@ const messages$w = reactIntl.defineMessages({
|
|
|
7249
6678
|
}
|
|
7250
6679
|
});
|
|
7251
6680
|
|
|
7252
|
-
var
|
|
6681
|
+
function ownKeys$L(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6682
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$L(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$L(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6683
|
+
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 } } } };
|
|
6684
|
+
const mapAttributeDefinition = definition => {
|
|
6685
|
+
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6686
|
+
return _objectSpread$L(_objectSpread$L({}, definition), {}, {
|
|
6687
|
+
required: definition.isRequired,
|
|
6688
|
+
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6689
|
+
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6690
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$L(_objectSpread$L({}, definition.type), {}, {
|
|
6691
|
+
elementType: _objectSpread$L(_objectSpread$L({}, definition.type.elementType), {}, {
|
|
6692
|
+
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6693
|
+
key: value.key,
|
|
6694
|
+
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6695
|
+
}))
|
|
6696
|
+
})
|
|
6697
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$L(_objectSpread$L({}, definition.type), {}, {
|
|
6698
|
+
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6699
|
+
key: value.key,
|
|
6700
|
+
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6701
|
+
}))
|
|
6702
|
+
}) : definition.type
|
|
6703
|
+
});
|
|
6704
|
+
};
|
|
6705
|
+
function useNestedProductType(fieldDefinition) {
|
|
6706
|
+
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
6707
|
+
const isSet = typeName === 'set';
|
|
6708
|
+
const productTypeId = isSet ? fieldDefinition.type.elementType.typeRef.id : fieldDefinition.type.typeRef.id;
|
|
6709
|
+
const _useQuery = react.useQuery(FetchProductTypeQuery, {
|
|
6710
|
+
variables: {
|
|
6711
|
+
id: productTypeId
|
|
6712
|
+
},
|
|
6713
|
+
context: {
|
|
6714
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6715
|
+
}
|
|
6716
|
+
}),
|
|
6717
|
+
data = _useQuery.data,
|
|
6718
|
+
loading = _useQuery.loading,
|
|
6719
|
+
error = _useQuery.error;
|
|
6720
|
+
if (!loading && !error) {
|
|
6721
|
+
var _context5;
|
|
6722
|
+
const attributeDefinitions = _mapInstanceProperty__default["default"](_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6723
|
+
return {
|
|
6724
|
+
loading: false,
|
|
6725
|
+
error: false,
|
|
6726
|
+
productType: {
|
|
6727
|
+
name: data.productType.name,
|
|
6728
|
+
attributeDefinitions
|
|
6729
|
+
}
|
|
6730
|
+
};
|
|
6731
|
+
}
|
|
6732
|
+
return {
|
|
6733
|
+
loading,
|
|
6734
|
+
error
|
|
6735
|
+
};
|
|
6736
|
+
}
|
|
6737
|
+
|
|
6738
|
+
var messages$w = reactIntl.defineMessages({
|
|
7253
6739
|
updateButton: {
|
|
7254
6740
|
id: 'NestedAttributes.Details.updateButton',
|
|
7255
6741
|
description: 'Update button label',
|
|
@@ -7329,14 +6815,14 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7329
6815
|
|
|
7330
6816
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
7331
6817
|
|
|
7332
|
-
function ownKeys$
|
|
7333
|
-
function _objectSpread$
|
|
6818
|
+
function ownKeys$K(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6819
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$K(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$K(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7334
6820
|
const EditButton = props => {
|
|
7335
6821
|
const _useIntl = reactIntl.useIntl(),
|
|
7336
6822
|
formatMessage = _useIntl.formatMessage;
|
|
7337
6823
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7338
6824
|
placement: "top",
|
|
7339
|
-
title: formatMessage(messages$
|
|
6825
|
+
title: formatMessage(messages$w.editTooltip),
|
|
7340
6826
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
7341
6827
|
label: "Edit",
|
|
7342
6828
|
isDisabled: props.isDisabled,
|
|
@@ -7352,12 +6838,12 @@ const DropChangesConfirmation = props => {
|
|
|
7352
6838
|
formatMessage = _useIntl2.formatMessage;
|
|
7353
6839
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
7354
6840
|
isOpen: props.isOpen || false,
|
|
7355
|
-
title: formatMessage(messages$
|
|
7356
|
-
labelPrimary: formatMessage(messages$
|
|
6841
|
+
title: formatMessage(messages$w.confirmationDialogTitle),
|
|
6842
|
+
labelPrimary: formatMessage(messages$w.nestedAttributesConfirmLabel),
|
|
7357
6843
|
onConfirm: props.onConfirm,
|
|
7358
6844
|
onCancel: props.onCancel,
|
|
7359
6845
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7360
|
-
intlMessage: messages$
|
|
6846
|
+
intlMessage: messages$w.confirmationDialogBody
|
|
7361
6847
|
})
|
|
7362
6848
|
});
|
|
7363
6849
|
};
|
|
@@ -7366,10 +6852,7 @@ const NestedAttributeModalPage = props => {
|
|
|
7366
6852
|
const _useIntl3 = reactIntl.useIntl(),
|
|
7367
6853
|
formatMessage = _useIntl3.formatMessage;
|
|
7368
6854
|
const formik$1 = formik.useFormikContext();
|
|
7369
|
-
const _useTheme = designSystem.useTheme(),
|
|
7370
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7371
6855
|
const confirmationModal = applicationComponents.useModalState();
|
|
7372
|
-
const nestingLevel = React.useContext(NestingLevelContext);
|
|
7373
6856
|
const handleClose = () => {
|
|
7374
6857
|
if (!formik$1.dirty) props.onClose();else confirmationModal.openModal();
|
|
7375
6858
|
};
|
|
@@ -7378,7 +6861,6 @@ const NestedAttributeModalPage = props => {
|
|
|
7378
6861
|
confirmationModal.closeModal();
|
|
7379
6862
|
props.onClose();
|
|
7380
6863
|
};
|
|
7381
|
-
const columnsTemplate = isNewTheme ? "".concat(uiKit.customProperties.constraint15) : nestingLevel === 1 ? "repeat(2, ".concat(uiKit.customProperties.constraint11, ")") : nestingLevel === 5 ? "".concat(uiKit.customProperties.constraint10) : "repeat(2, ".concat(uiKit.customProperties.constraint10, ")");
|
|
7382
6864
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7383
6865
|
children: [jsxRuntime.jsx(applicationComponents.CustomFormModalPage, {
|
|
7384
6866
|
isOpen: props.isOpen,
|
|
@@ -7386,11 +6868,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7386
6868
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
7387
6869
|
isDisabled: !formik$1.dirty,
|
|
7388
6870
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
7389
|
-
label: formatMessage(messages$
|
|
6871
|
+
label: formatMessage(messages$w.cancelButton),
|
|
7390
6872
|
onClick: formik$1.resetForm
|
|
7391
6873
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
7392
6874
|
isDisabled: !formik$1.dirty,
|
|
7393
|
-
label: formatMessage(messages$
|
|
6875
|
+
label: formatMessage(messages$w.updateButton),
|
|
7394
6876
|
onClick: formik$1.handleSubmit
|
|
7395
6877
|
})]
|
|
7396
6878
|
}),
|
|
@@ -7399,7 +6881,7 @@ const NestedAttributeModalPage = props => {
|
|
|
7399
6881
|
title: props.title,
|
|
7400
6882
|
children: jsxRuntime.jsx(applicationComponents.PageContentNarrow, {
|
|
7401
6883
|
children: props.isOpen && jsxRuntime.jsx(uiKit.Grid, {
|
|
7402
|
-
gridTemplateColumns:
|
|
6884
|
+
gridTemplateColumns: uiKit.customProperties.constraint15,
|
|
7403
6885
|
gridGap: uiKit.customProperties.spacingM,
|
|
7404
6886
|
children: jsxRuntime.jsx(ProductAttributes, {
|
|
7405
6887
|
isDisabled: props.isDisabled,
|
|
@@ -7419,7 +6901,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
7419
6901
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
7420
6902
|
title: "",
|
|
7421
6903
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7422
|
-
intlMessage: messages$
|
|
6904
|
+
intlMessage: messages$x.aboveFifthLevelWarning
|
|
7423
6905
|
}),
|
|
7424
6906
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
7425
6907
|
});
|
|
@@ -7431,7 +6913,7 @@ const NestedInputControls = props => {
|
|
|
7431
6913
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
7432
6914
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7433
6915
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7434
|
-
intlMessage: messages$
|
|
6916
|
+
intlMessage: messages$w.emptyProductType,
|
|
7435
6917
|
tone: "secondary"
|
|
7436
6918
|
});
|
|
7437
6919
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -7445,7 +6927,7 @@ const NestedInputControls = props => {
|
|
|
7445
6927
|
children: props.productType.name
|
|
7446
6928
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
7447
6929
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
7448
|
-
children: formatMessage(messages$
|
|
6930
|
+
children: formatMessage(messages$x.emptySetItem)
|
|
7449
6931
|
})
|
|
7450
6932
|
})]
|
|
7451
6933
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -7481,13 +6963,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7481
6963
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7482
6964
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7483
6965
|
const openNestedAttributesForm = () => {
|
|
7484
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6966
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$K(_objectSpread$K({}, parentFormik.status), {}, {
|
|
7485
6967
|
hideSaveToolbar: true
|
|
7486
6968
|
}));
|
|
7487
6969
|
attributesForm.openModal();
|
|
7488
6970
|
};
|
|
7489
6971
|
const closeNestedAttributesForm = () => {
|
|
7490
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6972
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$K(_objectSpread$K({}, parentFormik.status), {}, {
|
|
7491
6973
|
hideSaveToolbar: false
|
|
7492
6974
|
}));
|
|
7493
6975
|
attributesForm.closeModal();
|
|
@@ -7507,7 +6989,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7507
6989
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7508
6990
|
kind: 'success',
|
|
7509
6991
|
domain: constants.DOMAINS.SIDE,
|
|
7510
|
-
text: formatMessage(messages$
|
|
6992
|
+
text: formatMessage(messages$w.attributeUpdateSucceeded)
|
|
7511
6993
|
});
|
|
7512
6994
|
setSubmitting(false);
|
|
7513
6995
|
},
|
|
@@ -7528,10 +7010,238 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7528
7010
|
})
|
|
7529
7011
|
})
|
|
7530
7012
|
})
|
|
7531
|
-
})
|
|
7013
|
+
})
|
|
7014
|
+
});
|
|
7015
|
+
});
|
|
7016
|
+
CustomNestedInput.displayName = 'CustomNestedInput';
|
|
7017
|
+
|
|
7018
|
+
var styles$d = {
|
|
7019
|
+
"divider": "divider-module__divider___4-vdy",
|
|
7020
|
+
"divider-solid": "divider-module__divider-solid___3Fs4q divider-module__divider___4-vdy",
|
|
7021
|
+
"divider-dashed": "divider-module__divider-dashed___2Em8A divider-module__divider___4-vdy"
|
|
7022
|
+
};
|
|
7023
|
+
function Divider(_ref) {
|
|
7024
|
+
let isDashed = _ref.isDashed;
|
|
7025
|
+
return jsxRuntime.jsx("hr", {
|
|
7026
|
+
className: classnames__default["default"]({
|
|
7027
|
+
[styles$d['divider-solid']]: !isDashed,
|
|
7028
|
+
[styles$d['divider-dashed']]: isDashed
|
|
7029
|
+
})
|
|
7030
|
+
});
|
|
7031
|
+
}
|
|
7032
|
+
Divider.displayName = 'Divider';
|
|
7033
|
+
|
|
7034
|
+
const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7035
|
+
scale: "s",
|
|
7036
|
+
alignItems: "center",
|
|
7037
|
+
children: [jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
7038
|
+
children: jsxRuntime.jsx(Divider, {})
|
|
7039
|
+
}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
7040
|
+
tone: "primary",
|
|
7041
|
+
icon: props.isExpanded ? jsxRuntime.jsx(uiKit.AngleUpIcon, {}) : jsxRuntime.jsx(uiKit.AngleDownIcon, {}),
|
|
7042
|
+
label: props.isExpanded ? "Hide set items (".concat(props.totalValues, ")") : "Show all set items (".concat(props.totalValues, ")"),
|
|
7043
|
+
onClick: props.onExpand
|
|
7044
|
+
})]
|
|
7045
|
+
}) : null;
|
|
7046
|
+
ExpandButton.displayName = 'ExpandButton';
|
|
7047
|
+
|
|
7048
|
+
var styles$c = {
|
|
7049
|
+
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
7050
|
+
"gap": "set-buttons-module__gap___38Qr0"
|
|
7051
|
+
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
7052
|
+
// have to find a better way to do it.
|
|
7053
|
+
const SetButtons = props => {
|
|
7054
|
+
return jsxRuntime.jsx("div", {
|
|
7055
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7056
|
+
children: [jsxRuntime.jsx(uiKit.IconButton, {
|
|
7057
|
+
label: "Remove value",
|
|
7058
|
+
onClick: props.onRemoveItem,
|
|
7059
|
+
isDisabled: props.isRemoveDisabled,
|
|
7060
|
+
size: "big",
|
|
7061
|
+
icon: jsxRuntime.jsx(uiKit.BinLinearIcon, {})
|
|
7062
|
+
}), props.isFirstItem ? jsxRuntime.jsx(uiKit.IconButton, {
|
|
7063
|
+
label: "Add value",
|
|
7064
|
+
onClick: props.onAddItem,
|
|
7065
|
+
isDisabled: props.isAddDisabled,
|
|
7066
|
+
size: "big",
|
|
7067
|
+
icon: jsxRuntime.jsx(uiKit.PlusBoldIcon, {})
|
|
7068
|
+
}) : jsxRuntime.jsx("div", {
|
|
7069
|
+
className: styles$c.gap
|
|
7070
|
+
})]
|
|
7071
|
+
})
|
|
7072
|
+
});
|
|
7073
|
+
};
|
|
7074
|
+
SetButtons.displayName = 'SetButtons';
|
|
7075
|
+
|
|
7076
|
+
function ownKeys$J(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7077
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$J(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$J(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7078
|
+
const getDuplicateErrors = setValues => {
|
|
7079
|
+
/* eslint-disable no-plusplus */
|
|
7080
|
+
const result = [];
|
|
7081
|
+
if (!setValues) return result;
|
|
7082
|
+
for (let i = 0; i < setValues.length; i++) {
|
|
7083
|
+
for (let j = i + 1; j < setValues.length; j++) {
|
|
7084
|
+
if (fastEquals.deepEqual(setValues[i], setValues[j])) {
|
|
7085
|
+
result[i] = {
|
|
7086
|
+
duplicated: true
|
|
7087
|
+
};
|
|
7088
|
+
result[j] = {
|
|
7089
|
+
duplicated: true
|
|
7090
|
+
};
|
|
7091
|
+
}
|
|
7092
|
+
}
|
|
7093
|
+
}
|
|
7094
|
+
return result;
|
|
7095
|
+
/* eslint-enable no-plusplus */
|
|
7096
|
+
};
|
|
7097
|
+
|
|
7098
|
+
const isEmpty$1 = value => value.length === 0;
|
|
7099
|
+
const nullifyIfEmpty = value => isEmpty$1(value) ? undefined : value;
|
|
7100
|
+
const dropEmptyEntries = value => _Array$isArray__default["default"](value) ? _filterInstanceProperty__default["default"](value).call(value, item => !isNil__default["default"](item)) : value;
|
|
7101
|
+
const removeArrayItem = (array, index) => {
|
|
7102
|
+
const head = _sliceInstanceProperty__default["default"](array).call(array, 0, index);
|
|
7103
|
+
const tail = _sliceInstanceProperty__default["default"](array).call(array, index + 1);
|
|
7104
|
+
return [...head, ...tail];
|
|
7105
|
+
};
|
|
7106
|
+
const replaceArrayItem = (array, index, newItem) => {
|
|
7107
|
+
const head = _sliceInstanceProperty__default["default"](array).call(array, 0, index);
|
|
7108
|
+
const tail = _sliceInstanceProperty__default["default"](array).call(array, index + 1);
|
|
7109
|
+
return [...head, newItem, ...tail];
|
|
7110
|
+
};
|
|
7111
|
+
const getItemIndex = name => {
|
|
7112
|
+
const indexPartStart = _lastIndexOfInstanceProperty__default["default"](name).call(name, '[');
|
|
7113
|
+
const indexPartEnd = _lastIndexOfInstanceProperty__default["default"](name).call(name, ']');
|
|
7114
|
+
const rawIndex = name.substring(indexPartStart + 1, indexPartEnd);
|
|
7115
|
+
return _parseInt__default["default"](rawIndex, 10);
|
|
7116
|
+
};
|
|
7117
|
+
const makeKeys = amount => times__default["default"](amount, () => uuid.v4());
|
|
7118
|
+
const makeItemFieldName = (fieldName, index) => {
|
|
7119
|
+
var _context;
|
|
7120
|
+
return _concatInstanceProperty__default["default"](_context = "".concat(fieldName, ".[")).call(_context, index, "]");
|
|
7121
|
+
};
|
|
7122
|
+
const makeMapForAllItems = (fieldName, items, value) => _reduceInstanceProperty__default["default"](items).call(items, (result, item, index) => set__default["default"](result, makeItemFieldName(fieldName, index), value), {});
|
|
7123
|
+
function CustomInputSet(props) {
|
|
7124
|
+
var _context2;
|
|
7125
|
+
const _useToggleState = uiKit.useToggleState(false),
|
|
7126
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
7127
|
+
isExpanded = _useToggleState2[0],
|
|
7128
|
+
toggleExpansion = _useToggleState2[1];
|
|
7129
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
7130
|
+
setTouched = _useFormikContext.setTouched,
|
|
7131
|
+
touched = _useFormikContext.touched,
|
|
7132
|
+
isSubmitting = _useFormikContext.isSubmitting,
|
|
7133
|
+
dirty = _useFormikContext.dirty;
|
|
7134
|
+
const itemFieldDefinition = _objectSpread$J(_objectSpread$J({}, props.fieldDefinition), {}, {
|
|
7135
|
+
type: props.fieldDefinition.type.elementType
|
|
7136
|
+
});
|
|
7137
|
+
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
7138
|
+
const _useState = React.useState(value),
|
|
7139
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7140
|
+
internalValue = _useState2[0],
|
|
7141
|
+
setInternalValue = _useState2[1];
|
|
7142
|
+
const _useState3 = React.useState(makeKeys(internalValue.length)),
|
|
7143
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
7144
|
+
keys = _useState4[0],
|
|
7145
|
+
setKeys = _useState4[1];
|
|
7146
|
+
const totalAmount = internalValue === null || internalValue === void 0 ? void 0 : internalValue.length;
|
|
7147
|
+
const amountToRender = isExpanded ? totalAmount : 1;
|
|
7148
|
+
const updateInternalValue = newValue => {
|
|
7149
|
+
const valueToSet = isEmpty$1(newValue) ? [undefined] : newValue;
|
|
7150
|
+
setInternalValue(valueToSet);
|
|
7151
|
+
if (valueToSet.length !== keys.length) {
|
|
7152
|
+
setKeys(makeKeys(valueToSet.length));
|
|
7153
|
+
}
|
|
7154
|
+
};
|
|
7155
|
+
|
|
7156
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7157
|
+
React.useEffect(() => updateInternalValue(value), [value]);
|
|
7158
|
+
|
|
7159
|
+
// Filter out all empty values on form submit
|
|
7160
|
+
React.useEffect(() => {
|
|
7161
|
+
if (isSubmitting || !dirty) {
|
|
7162
|
+
const withoutEmpty = dropEmptyEntries(value);
|
|
7163
|
+
if (!fastEquals.deepEqual(withoutEmpty, dropEmptyEntries(internalValue))) {
|
|
7164
|
+
setKeys(makeKeys(withoutEmpty.length || 1));
|
|
7165
|
+
}
|
|
7166
|
+
updateInternalValue(withoutEmpty);
|
|
7167
|
+
}
|
|
7168
|
+
// I do really want to run it only when isSubmitting or dirty values change.
|
|
7169
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7170
|
+
}, [isSubmitting, dirty]);
|
|
7171
|
+
const markAllItemsAsTouched = items => setTouched(merge__default["default"]({}, touched, makeMapForAllItems(props.name, items, true)));
|
|
7172
|
+
const setNewValue = newValue => {
|
|
7173
|
+
const withoutEmpty = dropEmptyEntries(newValue);
|
|
7174
|
+
const nullified = nullifyIfEmpty(withoutEmpty);
|
|
7175
|
+
updateInternalValue(withoutEmpty);
|
|
7176
|
+
markAllItemsAsTouched(withoutEmpty);
|
|
7177
|
+
props.setFieldValue(props.name, nullified);
|
|
7178
|
+
};
|
|
7179
|
+
const addNewItem = () => updateInternalValue([undefined, ...internalValue]);
|
|
7180
|
+
const removeItem = index => {
|
|
7181
|
+
setNewValue(removeArrayItem(internalValue, index));
|
|
7182
|
+
};
|
|
7183
|
+
const setItemValue = (itemName, itemValue) => {
|
|
7184
|
+
const index = getItemIndex(itemName);
|
|
7185
|
+
const newValue = replaceArrayItem(internalValue, index, itemValue);
|
|
7186
|
+
setNewValue(newValue);
|
|
7187
|
+
};
|
|
7188
|
+
|
|
7189
|
+
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
7190
|
+
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
7191
|
+
// type is selected.
|
|
7192
|
+
const type = getType$1(props.fieldDefinition);
|
|
7193
|
+
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
7194
|
+
const areButtonsTopAligned = _includesInstanceProperty__default["default"](_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
|
|
7195
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7196
|
+
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
7197
|
+
children: jsxRuntime.jsx("label", {
|
|
7198
|
+
id: props.name,
|
|
7199
|
+
children: props.name
|
|
7200
|
+
})
|
|
7201
|
+
}), jsxRuntime.jsx("div", {
|
|
7202
|
+
children: jsxRuntime.jsx(formik.Field, {
|
|
7203
|
+
name: props.name,
|
|
7204
|
+
validate: values => {
|
|
7205
|
+
const errors = getDuplicateErrors(values);
|
|
7206
|
+
return errors.length > 0 ? errors : undefined;
|
|
7207
|
+
},
|
|
7208
|
+
children: () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7209
|
+
scale: "s",
|
|
7210
|
+
"data-testid": props.name,
|
|
7211
|
+
children: [times__default["default"](amountToRender, index => {
|
|
7212
|
+
const fieldName = makeItemFieldName(props.name, index);
|
|
7213
|
+
const fieldValue = internalValue[index];
|
|
7214
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7215
|
+
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
7216
|
+
children: [jsxRuntime.jsx(CustomFieldInput, {
|
|
7217
|
+
name: fieldName,
|
|
7218
|
+
fieldDefinition: itemFieldDefinition,
|
|
7219
|
+
isDisabled: props.isDisabled,
|
|
7220
|
+
isReadOnly: props.isReadOnly,
|
|
7221
|
+
onBlur: props.onBlur,
|
|
7222
|
+
setFieldValue: setItemValue,
|
|
7223
|
+
value: fieldValue,
|
|
7224
|
+
hasError: props.hasError
|
|
7225
|
+
}), jsxRuntime.jsx(SetButtons, {
|
|
7226
|
+
index: index,
|
|
7227
|
+
isFirstItem: !isExpanded || index === 0,
|
|
7228
|
+
onAddItem: addNewItem,
|
|
7229
|
+
onRemoveItem: () => removeItem(index),
|
|
7230
|
+
isRemoveDisabled: props.isDisabled || props.isReadOnly || internalValue.length === 1,
|
|
7231
|
+
isAddDisabled: props.isDisabled || props.isReadOnly || !internalValue[0],
|
|
7232
|
+
isTopAligned: areButtonsTopAligned
|
|
7233
|
+
})]
|
|
7234
|
+
}, keys[index]);
|
|
7235
|
+
}), jsxRuntime.jsx(ExpandButton, {
|
|
7236
|
+
totalValues: totalAmount,
|
|
7237
|
+
isExpanded: isExpanded,
|
|
7238
|
+
onExpand: toggleExpansion
|
|
7239
|
+
})]
|
|
7240
|
+
})
|
|
7241
|
+
})
|
|
7242
|
+
})]
|
|
7532
7243
|
});
|
|
7533
|
-
}
|
|
7534
|
-
CustomNestedInput.displayName = 'CustomNestedInput';
|
|
7244
|
+
}
|
|
7535
7245
|
|
|
7536
7246
|
const nonSetComponents = {
|
|
7537
7247
|
[CUSTOM_FIELD_TYPES.text]: CustomTextInput,
|
|
@@ -7581,6 +7291,209 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7581
7291
|
});
|
|
7582
7292
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7583
7293
|
|
|
7294
|
+
var messages$v = reactIntl.defineMessages({
|
|
7295
|
+
referencedProductType: {
|
|
7296
|
+
id: 'NestedAttributes.referencedProductType',
|
|
7297
|
+
description: 'Product type referenced hint',
|
|
7298
|
+
defaultMessage: 'Product type referenced: {productTypeName}'
|
|
7299
|
+
}
|
|
7300
|
+
});
|
|
7301
|
+
|
|
7302
|
+
function ownKeys$I(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7303
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$I(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$I(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7304
|
+
function ProductTypeReference(props) {
|
|
7305
|
+
const productTypeMessage = _objectSpread$I(_objectSpread$I({}, messages$v.referencedProductType), {}, {
|
|
7306
|
+
values: {
|
|
7307
|
+
productTypeName: props.productType.name
|
|
7308
|
+
}
|
|
7309
|
+
});
|
|
7310
|
+
return jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
7311
|
+
intlMessage: productTypeMessage
|
|
7312
|
+
});
|
|
7313
|
+
}
|
|
7314
|
+
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
7315
|
+
|
|
7316
|
+
function CustomNestedFieldInput(props) {
|
|
7317
|
+
const typeName = props.fieldDefinition.type.name.toLowerCase();
|
|
7318
|
+
const isSet = typeName === 'set';
|
|
7319
|
+
const _useNestedProductType = useNestedProductType(props.fieldDefinition),
|
|
7320
|
+
productType = _useNestedProductType.productType,
|
|
7321
|
+
error = _useNestedProductType.error;
|
|
7322
|
+
if (error) return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7323
|
+
scale: "s",
|
|
7324
|
+
alignItems: "center",
|
|
7325
|
+
children: [jsxRuntime.jsx(uiKit.ErrorIcon, {
|
|
7326
|
+
color: "error"
|
|
7327
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7328
|
+
tone: "negative",
|
|
7329
|
+
intlMessage: commonPickerMessages.loadingErrorMessage
|
|
7330
|
+
})]
|
|
7331
|
+
});
|
|
7332
|
+
if (!productType) return null;
|
|
7333
|
+
const InputComponent = isSet ? CustomInputSet : CustomNestedInput;
|
|
7334
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7335
|
+
children: [jsxRuntime.jsx(ProductTypeReference, {
|
|
7336
|
+
productType: productType
|
|
7337
|
+
}), jsxRuntime.jsx(InputComponent, {
|
|
7338
|
+
name: props.name,
|
|
7339
|
+
productType: productType,
|
|
7340
|
+
fieldDefinition: props.fieldDefinition,
|
|
7341
|
+
value: props.value,
|
|
7342
|
+
isDisabled: props.isDisabled,
|
|
7343
|
+
isReadOnly: props.isReadOnly,
|
|
7344
|
+
setFieldValue: props.setFieldValue,
|
|
7345
|
+
onBlur: props.onBlur
|
|
7346
|
+
})]
|
|
7347
|
+
});
|
|
7348
|
+
}
|
|
7349
|
+
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7350
|
+
|
|
7351
|
+
function ownKeys$H(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7352
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$H(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$H(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7353
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$H(_objectSpread$H({}, result), itemErrors), {});
|
|
7354
|
+
|
|
7355
|
+
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7356
|
+
// all the other types of fields. So that there will be no isArray check.
|
|
7357
|
+
const CustomFieldErrors = props => {
|
|
7358
|
+
// We want to highlight fields with errors not only after a form submission,
|
|
7359
|
+
// but also after manually triggered form validation.
|
|
7360
|
+
const didFormValidationFail = useDidFormValidationFail();
|
|
7361
|
+
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7362
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7363
|
+
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7364
|
+
intlMessage: messages$J.required
|
|
7365
|
+
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7366
|
+
intlMessage: messages$J.unique
|
|
7367
|
+
})]
|
|
7368
|
+
});
|
|
7369
|
+
};
|
|
7370
|
+
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7371
|
+
|
|
7372
|
+
var messages$u = reactIntl.defineMessages({
|
|
7373
|
+
productReferenceLabel: {
|
|
7374
|
+
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7375
|
+
description: 'Label shown above the product picker input.',
|
|
7376
|
+
defaultMessage: 'Product (case sensitive field)'
|
|
7377
|
+
},
|
|
7378
|
+
productTypeReferenceLabel: {
|
|
7379
|
+
id: 'CustomFieldsLabel.productTypeReferenceLabel',
|
|
7380
|
+
description: 'Label shown above the product type picker input.',
|
|
7381
|
+
defaultMessage: 'Product type (case sensitive field)'
|
|
7382
|
+
},
|
|
7383
|
+
productTypeReferenceLabelI: {
|
|
7384
|
+
id: 'CustomFieldsLabel.productTypeReferenceLabelI',
|
|
7385
|
+
description: 'Label shown above the product type picker input for indexed project.',
|
|
7386
|
+
defaultMessage: 'Product type'
|
|
7387
|
+
},
|
|
7388
|
+
stateReferenceLabel: {
|
|
7389
|
+
id: 'CustomFieldsLabel.stateReferenceLabel',
|
|
7390
|
+
description: 'Label shown above the state picker input.',
|
|
7391
|
+
defaultMessage: 'State (case sensitive field)'
|
|
7392
|
+
},
|
|
7393
|
+
channelReferenceLabel: {
|
|
7394
|
+
id: 'CustomFieldsLabel.channelReferenceLabel',
|
|
7395
|
+
description: 'Label shown above the channel picker input.',
|
|
7396
|
+
defaultMessage: 'Channel (case sensitive field)'
|
|
7397
|
+
},
|
|
7398
|
+
cartDiscountMoreThan500: {
|
|
7399
|
+
id: 'cartDiscountMoreThan500',
|
|
7400
|
+
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
7401
|
+
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
7402
|
+
}
|
|
7403
|
+
});
|
|
7404
|
+
|
|
7405
|
+
function ownKeys$G(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7406
|
+
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$G(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$G(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7407
|
+
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 } } } };
|
|
7408
|
+
const CustomFieldsLabelHint = _ref => {
|
|
7409
|
+
var _type$name;
|
|
7410
|
+
let fieldDefinition = _ref.fieldDefinition;
|
|
7411
|
+
const type = getType$1(fieldDefinition);
|
|
7412
|
+
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
7413
|
+
const referenceTypeId = type.referenceTypeId;
|
|
7414
|
+
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
7415
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
7416
|
+
languages: applicationContext.project.languages,
|
|
7417
|
+
dataLocale: applicationContext.dataLocale
|
|
7418
|
+
})),
|
|
7419
|
+
languages = _useApplicationContex.languages,
|
|
7420
|
+
dataLocale = _useApplicationContex.dataLocale;
|
|
7421
|
+
const _useQuery = react.useQuery(CartDiscountsCount, {
|
|
7422
|
+
skip: !isCartDiscountsReference,
|
|
7423
|
+
context: {
|
|
7424
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
7425
|
+
}
|
|
7426
|
+
}),
|
|
7427
|
+
data = _useQuery.data,
|
|
7428
|
+
loading = _useQuery.loading;
|
|
7429
|
+
if (loading) return null;
|
|
7430
|
+
if ((data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT) {
|
|
7431
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
7432
|
+
alignItems: "center",
|
|
7433
|
+
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7434
|
+
size: "medium",
|
|
7435
|
+
color: "warning"
|
|
7436
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$G({}, messages$u.cartDiscountMoreThan500))]
|
|
7437
|
+
});
|
|
7438
|
+
}
|
|
7439
|
+
return l10n.formatLocalizedString(fieldDefinition, {
|
|
7440
|
+
key: 'inputTip',
|
|
7441
|
+
locale: dataLocale,
|
|
7442
|
+
fallbackOrder: languages
|
|
7443
|
+
});
|
|
7444
|
+
};
|
|
7445
|
+
function CustomFieldsProductTypeReferenceSubtitle() {
|
|
7446
|
+
const _useIntl = reactIntl.useIntl(),
|
|
7447
|
+
formatMessage = _useIntl.formatMessage;
|
|
7448
|
+
const _usePimStatus = usePimStatus(),
|
|
7449
|
+
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7450
|
+
if (isProjectIndexed) return formatMessage(messages$u.productTypeReferenceLabelI);
|
|
7451
|
+
return formatMessage(messages$u.productTypeReferenceLabel);
|
|
7452
|
+
}
|
|
7453
|
+
|
|
7454
|
+
// TODO(pa3): this logic may be misplaced and probably
|
|
7455
|
+
// should belong to <CustomReferenceInput /> component instead.
|
|
7456
|
+
function CustomFieldsLabelSubtitle(_ref2) {
|
|
7457
|
+
var _type$name2, _context;
|
|
7458
|
+
let fieldDefinition = _ref2.fieldDefinition;
|
|
7459
|
+
const _useIntl2 = reactIntl.useIntl(),
|
|
7460
|
+
formatMessage = _useIntl2.formatMessage;
|
|
7461
|
+
const type = getType$1(fieldDefinition);
|
|
7462
|
+
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
7463
|
+
if (!isReference) return null;
|
|
7464
|
+
const referenceTypeId = type.referenceTypeId;
|
|
7465
|
+
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7466
|
+
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7467
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$u.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$u.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$u.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7468
|
+
}
|
|
7469
|
+
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
7470
|
+
let name = _ref3.name,
|
|
7471
|
+
fieldDefinition = _ref3.fieldDefinition;
|
|
7472
|
+
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
7473
|
+
languages: applicationContext.project.languages,
|
|
7474
|
+
language: applicationContext.dataLocale
|
|
7475
|
+
})),
|
|
7476
|
+
languages = _useApplicationContex2.languages,
|
|
7477
|
+
language = _useApplicationContex2.language;
|
|
7478
|
+
return jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
7479
|
+
htmlFor: name,
|
|
7480
|
+
title: l10n.formatLocalizedString(fieldDefinition, {
|
|
7481
|
+
key: 'label',
|
|
7482
|
+
locale: language,
|
|
7483
|
+
fallbackOrder: languages,
|
|
7484
|
+
fallback: fieldDefinition.name
|
|
7485
|
+
}),
|
|
7486
|
+
description: jsxRuntime.jsx(CustomFieldsLabelSubtitle, {
|
|
7487
|
+
fieldDefinition: fieldDefinition
|
|
7488
|
+
}),
|
|
7489
|
+
hint: jsxRuntime.jsx(CustomFieldsLabelHint, {
|
|
7490
|
+
fieldDefinition: fieldDefinition
|
|
7491
|
+
}),
|
|
7492
|
+
hasRequiredIndicator: fieldDefinition.required
|
|
7493
|
+
});
|
|
7494
|
+
});
|
|
7495
|
+
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
7496
|
+
|
|
7584
7497
|
const getFieldName = (parentName, fieldName) => {
|
|
7585
7498
|
var _context;
|
|
7586
7499
|
if (!parentName) return fieldName;
|
|
@@ -7603,8 +7516,6 @@ const CustomFieldsInternal = props => {
|
|
|
7603
7516
|
handleBlur = _useFormikContext.handleBlur;
|
|
7604
7517
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7605
7518
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7606
|
-
const nestingLevel = React.useContext(NestingLevelContext);
|
|
7607
|
-
const isCurrentFieldNested = nestingLevel > 0;
|
|
7608
7519
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
7609
7520
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7610
7521
|
var _context2;
|
|
@@ -7624,43 +7535,36 @@ const CustomFieldsInternal = props => {
|
|
|
7624
7535
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7625
7536
|
name: fieldName,
|
|
7626
7537
|
validate: validate,
|
|
7627
|
-
children: () => jsxRuntime.
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7658
|
-
isTouched: isTouched,
|
|
7659
|
-
errors: fieldErrors
|
|
7660
|
-
})]
|
|
7661
|
-
})]
|
|
7662
|
-
})
|
|
7663
|
-
})
|
|
7538
|
+
children: () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7539
|
+
scale: "xs",
|
|
7540
|
+
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7541
|
+
name: fieldName,
|
|
7542
|
+
fieldDefinition: fieldDefinition
|
|
7543
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7544
|
+
scale: "xs",
|
|
7545
|
+
alignItems: "stretch",
|
|
7546
|
+
children: [isNested(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7547
|
+
name: fieldName,
|
|
7548
|
+
value: value,
|
|
7549
|
+
fieldDefinition: fieldDefinition,
|
|
7550
|
+
isDisabled: props.isDisabled,
|
|
7551
|
+
isReadOnly: props.isReadOnly,
|
|
7552
|
+
onBlur: handleBlur,
|
|
7553
|
+
setFieldValue: props.setFieldValue
|
|
7554
|
+
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7555
|
+
name: fieldName,
|
|
7556
|
+
value: value,
|
|
7557
|
+
fieldDefinition: fieldDefinition,
|
|
7558
|
+
isDisabled: props.isDisabled,
|
|
7559
|
+
isReadOnly: props.isReadOnly,
|
|
7560
|
+
onBlur: handleBlur,
|
|
7561
|
+
setFieldValue: props.setFieldValue,
|
|
7562
|
+
hasError: hasError
|
|
7563
|
+
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7564
|
+
isTouched: isTouched,
|
|
7565
|
+
errors: fieldErrors
|
|
7566
|
+
})]
|
|
7567
|
+
})]
|
|
7664
7568
|
})
|
|
7665
7569
|
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7666
7570
|
})
|
|
@@ -7668,21 +7572,18 @@ const CustomFieldsInternal = props => {
|
|
|
7668
7572
|
};
|
|
7669
7573
|
CustomFieldsInternal.displayName = 'CustomFieldsInternal';
|
|
7670
7574
|
|
|
7671
|
-
// TODO: @redesign cleanup
|
|
7672
7575
|
const nopConverter = (fieldName, fieldValue) => fieldValue;
|
|
7673
7576
|
const CustomFields = props => {
|
|
7674
7577
|
const _useFormikContext = formik.useFormikContext(),
|
|
7675
7578
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
7676
|
-
const _useTheme = designSystem.useTheme(),
|
|
7677
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7678
7579
|
|
|
7679
7580
|
// Ensure you pass isWidthExpanded=true when adding the new layout component so the custom fields
|
|
7680
7581
|
// can expand to fill the width of the layout.
|
|
7681
|
-
return
|
|
7582
|
+
return jsxRuntime.jsx("div", {
|
|
7682
7583
|
css: /*#__PURE__*/react$1.css("min-width:", props.isWidthExpanded ? '100%' : uiKit.customProperties.constraint11, ";" + ("" ), "" ),
|
|
7683
7584
|
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7684
7585
|
scale: "xl",
|
|
7685
|
-
children: jsxRuntime.jsx(
|
|
7586
|
+
children: jsxRuntime.jsx(CustomFieldsInternal, {
|
|
7686
7587
|
name: props.name,
|
|
7687
7588
|
isReadOnly: props.isReadOnly,
|
|
7688
7589
|
isDisabled: props.isDisabled,
|
|
@@ -7691,21 +7592,6 @@ const CustomFields = props => {
|
|
|
7691
7592
|
inputValuesConverter: nopConverter
|
|
7692
7593
|
})
|
|
7693
7594
|
})
|
|
7694
|
-
}) : jsxRuntime.jsx(uiKit.Grid, {
|
|
7695
|
-
"data-testid": "custom-fields",
|
|
7696
|
-
gridTemplateColumns:
|
|
7697
|
-
// TODO: @redesign cleanup
|
|
7698
|
-
isNewTheme ? 'repeat(1, 1fr)' : "repeat(2, minmax(0, ".concat(uiKit.customProperties.constraint11, "))"),
|
|
7699
|
-
gridGap: uiKit.customProperties.spacingM,
|
|
7700
|
-
isWidthExpanded: isNewTheme,
|
|
7701
|
-
children: jsxRuntime.jsx(CustomFieldsInternal, {
|
|
7702
|
-
name: props.name,
|
|
7703
|
-
isReadOnly: props.isReadOnly,
|
|
7704
|
-
isDisabled: props.isDisabled,
|
|
7705
|
-
fieldDefinitions: props.fieldDefinitions,
|
|
7706
|
-
setFieldValue: setFieldValue,
|
|
7707
|
-
inputValuesConverter: nopConverter
|
|
7708
|
-
})
|
|
7709
7595
|
});
|
|
7710
7596
|
};
|
|
7711
7597
|
CustomFields.displayName = 'CustomFields';
|
|
@@ -7733,8 +7619,8 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7733
7619
|
}
|
|
7734
7620
|
});
|
|
7735
7621
|
|
|
7736
|
-
function ownKeys$
|
|
7737
|
-
function _objectSpread$
|
|
7622
|
+
function ownKeys$F(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7623
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$F(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$F(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7738
7624
|
const PRODUCT_SELECTION_TYPES = {
|
|
7739
7625
|
INCLUSION: 'individual',
|
|
7740
7626
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7748,7 +7634,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7748
7634
|
var _context;
|
|
7749
7635
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7750
7636
|
if (!ps) return undefined;
|
|
7751
|
-
return _objectSpread$
|
|
7637
|
+
return _objectSpread$F(_objectSpread$F({}, ps), {}, {
|
|
7752
7638
|
label: _concatInstanceProperty__default["default"](_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getType(ps === null || ps === void 0 ? void 0 : ps.type), ")") : '')
|
|
7753
7639
|
});
|
|
7754
7640
|
};
|
|
@@ -8099,12 +7985,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8099
7985
|
});
|
|
8100
7986
|
}
|
|
8101
7987
|
|
|
8102
|
-
function ownKeys$
|
|
8103
|
-
function _objectSpread$
|
|
7988
|
+
function ownKeys$E(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7989
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$E(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$E(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8104
7990
|
function TypeSelectInputOption(props) {
|
|
8105
7991
|
const data = props.data;
|
|
8106
7992
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
8107
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
7993
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$E(_objectSpread$E({}, props), {}, {
|
|
8108
7994
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
8109
7995
|
scale: "xs",
|
|
8110
7996
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8119,18 +8005,18 @@ function TypeSelectInputOption(props) {
|
|
|
8119
8005
|
}));
|
|
8120
8006
|
}
|
|
8121
8007
|
|
|
8122
|
-
function ownKeys$
|
|
8123
|
-
function _objectSpread$
|
|
8008
|
+
function ownKeys$D(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8009
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$D(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$D(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8124
8010
|
function ProductSelectionsPicker(props) {
|
|
8125
8011
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8126
8012
|
const components = React.useMemo(() => {
|
|
8127
8013
|
return {
|
|
8128
8014
|
Option: optionInnerProps => {
|
|
8129
8015
|
if (optionInnerProps.isDisabled) {
|
|
8130
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8016
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$D({}, optionInnerProps));
|
|
8131
8017
|
}
|
|
8132
8018
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8133
|
-
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$
|
|
8019
|
+
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$D({}, optionInnerProps));
|
|
8134
8020
|
}
|
|
8135
8021
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8136
8022
|
optionType: props.optionType,
|
|
@@ -8142,7 +8028,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8142
8028
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8143
8029
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8144
8030
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8145
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8031
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$D(_objectSpread$D({}, props), {}, {
|
|
8146
8032
|
components: components
|
|
8147
8033
|
}))
|
|
8148
8034
|
});
|
|
@@ -8165,7 +8051,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8165
8051
|
|
|
8166
8052
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8167
8053
|
|
|
8168
|
-
var messages$
|
|
8054
|
+
var messages$t = reactIntl.defineMessages({
|
|
8169
8055
|
countriesBasicSelectPlaceholder: {
|
|
8170
8056
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8171
8057
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8193,7 +8079,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8193
8079
|
value: props.value,
|
|
8194
8080
|
isRequired: props.isRequired,
|
|
8195
8081
|
description: props.description,
|
|
8196
|
-
placeholder: intl.formatMessage(messages$
|
|
8082
|
+
placeholder: intl.formatMessage(messages$t.countriesBasicSelectPlaceholder),
|
|
8197
8083
|
options: props.options,
|
|
8198
8084
|
onChange: props.onChange,
|
|
8199
8085
|
isDisabled: props.isDisabled,
|
|
@@ -8203,10 +8089,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8203
8089
|
});
|
|
8204
8090
|
}
|
|
8205
8091
|
|
|
8206
|
-
function ownKeys$
|
|
8207
|
-
function _objectSpread$
|
|
8092
|
+
function ownKeys$C(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8093
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$C(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$C(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8208
8094
|
const emptyCountryOption = intl => [{
|
|
8209
|
-
label: intl.formatMessage(messages$
|
|
8095
|
+
label: intl.formatMessage(messages$t.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8210
8096
|
value: undefined,
|
|
8211
8097
|
isDisabled: true
|
|
8212
8098
|
}];
|
|
@@ -8231,7 +8117,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8231
8117
|
const onOptionChange = event => {
|
|
8232
8118
|
const countries = event.target.value;
|
|
8233
8119
|
props.onChange({
|
|
8234
|
-
target: _objectSpread$
|
|
8120
|
+
target: _objectSpread$C(_objectSpread$C({}, event.target), {}, {
|
|
8235
8121
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8236
8122
|
var _country$value;
|
|
8237
8123
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8252,7 +8138,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8252
8138
|
var _context3;
|
|
8253
8139
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8254
8140
|
}),
|
|
8255
|
-
placeholder: intl.formatMessage(messages$
|
|
8141
|
+
placeholder: intl.formatMessage(messages$t.countriesAsyncSelectPlaceholder),
|
|
8256
8142
|
loadOptions: handleLoadOptions,
|
|
8257
8143
|
onChange: onOptionChange,
|
|
8258
8144
|
isDisabled: props.isDisabled,
|
|
@@ -8262,13 +8148,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8262
8148
|
});
|
|
8263
8149
|
}
|
|
8264
8150
|
|
|
8265
|
-
function ownKeys$
|
|
8266
|
-
function _objectSpread$
|
|
8151
|
+
function ownKeys$B(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8152
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$B(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$B(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8267
8153
|
function CountriesPicker(props) {
|
|
8268
8154
|
var _props$options;
|
|
8269
8155
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8270
8156
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8271
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8157
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$B({}, props))
|
|
8272
8158
|
});
|
|
8273
8159
|
}
|
|
8274
8160
|
CountriesPicker.defaultProps = {
|
|
@@ -8278,7 +8164,7 @@ CountriesPicker.defaultProps = {
|
|
|
8278
8164
|
hasWarning: false
|
|
8279
8165
|
};
|
|
8280
8166
|
|
|
8281
|
-
var messages$
|
|
8167
|
+
var messages$s = reactIntl.defineMessages({
|
|
8282
8168
|
noCustomerGroupsFound: {
|
|
8283
8169
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8284
8170
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8369,7 +8255,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8369
8255
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8370
8256
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8371
8257
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8372
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8258
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$s.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8373
8259
|
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8374
8260
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8375
8261
|
max: "scale",
|
|
@@ -8380,7 +8266,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8380
8266
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8381
8267
|
id: name,
|
|
8382
8268
|
name: name,
|
|
8383
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8269
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$s.placeholder),
|
|
8384
8270
|
loadOptions: loadOptionsDebounced,
|
|
8385
8271
|
defaultOptions: true,
|
|
8386
8272
|
showOptionGroupDivider: true,
|
|
@@ -8450,7 +8336,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8450
8336
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8451
8337
|
};
|
|
8452
8338
|
|
|
8453
|
-
var messages$
|
|
8339
|
+
var messages$r = reactIntl.defineMessages({
|
|
8454
8340
|
basicSelectInputPlaceholder: {
|
|
8455
8341
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8456
8342
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8483,8 +8369,8 @@ var messages$s = reactIntl.defineMessages({
|
|
|
8483
8369
|
}
|
|
8484
8370
|
});
|
|
8485
8371
|
|
|
8486
|
-
function ownKeys$
|
|
8487
|
-
function _objectSpread$
|
|
8372
|
+
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8373
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$A(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$A(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8488
8374
|
const hasErrors$2 = errors => {
|
|
8489
8375
|
var _context;
|
|
8490
8376
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8509,7 +8395,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8509
8395
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8510
8396
|
};
|
|
8511
8397
|
const emptyStoreOption = intl => [{
|
|
8512
|
-
label: intl.formatMessage(messages$
|
|
8398
|
+
label: intl.formatMessage(messages$r.asyncSelectDropdownTypeAheadPrompt),
|
|
8513
8399
|
value: undefined,
|
|
8514
8400
|
isDisabled: true
|
|
8515
8401
|
}];
|
|
@@ -8529,7 +8415,7 @@ const StoresAsyncSelectInput = props => {
|
|
|
8529
8415
|
stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
|
|
8530
8416
|
projectKey: props.projectKey
|
|
8531
8417
|
});
|
|
8532
|
-
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors$2(props.errors);
|
|
8418
|
+
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors$2(props.errors) || props.hasError;
|
|
8533
8419
|
const mappedStoresListOptions = React.useMemo(() => {
|
|
8534
8420
|
var _context2, _storesListFetcher$st;
|
|
8535
8421
|
return _mapInstanceProperty__default["default"](_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
|
|
@@ -8556,10 +8442,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8556
8442
|
};
|
|
8557
8443
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8558
8444
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8559
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8445
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8560
8446
|
id: props.id,
|
|
8561
8447
|
name: props.name,
|
|
8562
|
-
placeholder: intl.formatMessage(messages$
|
|
8448
|
+
placeholder: intl.formatMessage(messages$r.basicSelectInputPlaceholder),
|
|
8563
8449
|
horizontalConstraint: props.horizontalConstraint,
|
|
8564
8450
|
loadOptions: handleLoadOptions,
|
|
8565
8451
|
defaultOptions: true,
|
|
@@ -8599,8 +8485,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8599
8485
|
shouldFetchProductSelections: false
|
|
8600
8486
|
};
|
|
8601
8487
|
|
|
8602
|
-
function ownKeys$
|
|
8603
|
-
function _objectSpread$
|
|
8488
|
+
function ownKeys$z(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8489
|
+
function _objectSpread$z(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$z(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$z(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8604
8490
|
const hasErrors$1 = errors => {
|
|
8605
8491
|
var _context;
|
|
8606
8492
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8621,7 +8507,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8621
8507
|
stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
|
|
8622
8508
|
projectKey: props.projectKey
|
|
8623
8509
|
});
|
|
8624
|
-
const hasError = uiKit.SelectInput.isTouched(props.touched) &&
|
|
8510
|
+
const hasError = uiKit.SelectInput.isTouched(props.touched) && hasErrors$1(props.errors) || props.hasError;
|
|
8625
8511
|
const mappedStoresListOptions = React.useMemo(() => {
|
|
8626
8512
|
var _context2, _storesListFetcher$st;
|
|
8627
8513
|
return _mapInstanceProperty__default["default"](_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
|
|
@@ -8648,10 +8534,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8648
8534
|
};
|
|
8649
8535
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8650
8536
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8651
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8537
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$z(_objectSpread$z({
|
|
8652
8538
|
id: props.id,
|
|
8653
8539
|
name: props.name,
|
|
8654
|
-
placeholder: intl.formatMessage(messages$
|
|
8540
|
+
placeholder: intl.formatMessage(messages$r.basicSelectInputPlaceholder),
|
|
8655
8541
|
horizontalConstraint: props.horizontalConstraint,
|
|
8656
8542
|
options: mappedStoresListOptions,
|
|
8657
8543
|
isMulti: props.isMulti,
|
|
@@ -8744,8 +8630,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8744
8630
|
};
|
|
8745
8631
|
};
|
|
8746
8632
|
|
|
8747
|
-
function ownKeys$
|
|
8748
|
-
function _objectSpread$
|
|
8633
|
+
function ownKeys$y(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8634
|
+
function _objectSpread$y(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$y(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$y(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8749
8635
|
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 } } } };
|
|
8750
8636
|
const hasErrors = errors => {
|
|
8751
8637
|
var _context;
|
|
@@ -8818,7 +8704,7 @@ const StoresSearchSelectInput = props => {
|
|
|
8818
8704
|
const intl = reactIntl.useIntl();
|
|
8819
8705
|
const client$1 = client.useApolloClient();
|
|
8820
8706
|
const storesByFieldFetcher = useStoresByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField, props.projectKey, props.shouldFetchProductSelections);
|
|
8821
|
-
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors);
|
|
8707
|
+
const hasError = uiKit.AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors) || props.hasError;
|
|
8822
8708
|
const handleLoadOptions = searchText => {
|
|
8823
8709
|
const extractMatchedStores = client$1.query({
|
|
8824
8710
|
query: FetchStoresByWherePredicate,
|
|
@@ -8847,10 +8733,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8847
8733
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8848
8734
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8849
8735
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8850
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8736
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$y(_objectSpread$y({
|
|
8851
8737
|
id: props.id,
|
|
8852
8738
|
name: props.name,
|
|
8853
|
-
placeholder: intl.formatMessage(messages$
|
|
8739
|
+
placeholder: intl.formatMessage(messages$r.searchSelectInputPlaceholder),
|
|
8854
8740
|
horizontalConstraint: props.horizontalConstraint,
|
|
8855
8741
|
loadOptions: loadOptionsDebounced,
|
|
8856
8742
|
defaultOptions: false,
|
|
@@ -8864,8 +8750,8 @@ const StoresSearchSelectInput = props => {
|
|
|
8864
8750
|
}),
|
|
8865
8751
|
onChange: props.onChange,
|
|
8866
8752
|
onBlur: props.onBlur,
|
|
8867
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8868
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
8753
|
+
loadingMessage: intl.formatMessage(messages$r.searchSelectInputLoadingMessage),
|
|
8754
|
+
noOptionsMessage: () => intl.formatMessage(messages$r.searchSelectInputNoOptionsFoundMessage),
|
|
8869
8755
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8870
8756
|
isReadOnly: props.isReadOnly,
|
|
8871
8757
|
isClearable: props.isClearable,
|
|
@@ -8893,8 +8779,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8893
8779
|
shouldFetchProductSelections: false
|
|
8894
8780
|
};
|
|
8895
8781
|
|
|
8896
|
-
function ownKeys$
|
|
8897
|
-
function _objectSpread$
|
|
8782
|
+
function ownKeys$x(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8783
|
+
function _objectSpread$x(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$x(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$x(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8898
8784
|
const StoreSelectInput = props => {
|
|
8899
8785
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8900
8786
|
const components = React.useMemo(() => {
|
|
@@ -8902,7 +8788,7 @@ const StoreSelectInput = props => {
|
|
|
8902
8788
|
// eslint-disable-next-line react/display-name
|
|
8903
8789
|
Option: optionInnerProps => {
|
|
8904
8790
|
if (optionInnerProps.isDisabled) {
|
|
8905
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8791
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$x({}, optionInnerProps));
|
|
8906
8792
|
}
|
|
8907
8793
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8908
8794
|
optionType: props.optionType,
|
|
@@ -8913,7 +8799,7 @@ const StoreSelectInput = props => {
|
|
|
8913
8799
|
}, [props.optionType]);
|
|
8914
8800
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8915
8801
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8916
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8802
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$x(_objectSpread$x({
|
|
8917
8803
|
projectKey: props.projectKey,
|
|
8918
8804
|
id: props.id,
|
|
8919
8805
|
name: props.name,
|
|
@@ -8957,7 +8843,7 @@ StoreSelectInput.defaultProps = {
|
|
|
8957
8843
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
8958
8844
|
const businessRoleKeys = ['ExecutiveManagement', 'Architect', 'Engineer', 'ProductProjectManagerOrOwner', 'Marketing', 'CustomerService', 'SalesAndECommerceManager', 'Other'];
|
|
8959
8845
|
|
|
8960
|
-
var messages$
|
|
8846
|
+
var messages$q = reactIntl.defineMessages({
|
|
8961
8847
|
ExecutiveManagement: {
|
|
8962
8848
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8963
8849
|
description: 'The label for one of the selectable business roles',
|
|
@@ -9015,7 +8901,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
9015
8901
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
9016
8902
|
}
|
|
9017
8903
|
|
|
9018
|
-
const messages$
|
|
8904
|
+
const messages$p = reactIntl.defineMessages({
|
|
9019
8905
|
inputFieldError: {
|
|
9020
8906
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
9021
8907
|
description: 'Error message for empty input field ',
|
|
@@ -9036,14 +8922,14 @@ const validateValue = (value, type, intl) => {
|
|
|
9036
8922
|
if (validateSingleFilter({
|
|
9037
8923
|
value
|
|
9038
8924
|
})) {
|
|
9039
|
-
return intl.formatMessage(messages$
|
|
8925
|
+
return intl.formatMessage(messages$p.inputFieldError);
|
|
9040
8926
|
}
|
|
9041
8927
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
9042
8928
|
value: value.currencyCode
|
|
9043
8929
|
}) || validateSingleFilter({
|
|
9044
8930
|
value: value.amount
|
|
9045
8931
|
}))) {
|
|
9046
|
-
return intl.formatMessage(messages$
|
|
8932
|
+
return intl.formatMessage(messages$p.inputFieldError);
|
|
9047
8933
|
}
|
|
9048
8934
|
return null;
|
|
9049
8935
|
};
|
|
@@ -9051,7 +8937,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
9051
8937
|
let value = _ref.value;
|
|
9052
8938
|
if (!value || !value.type) {
|
|
9053
8939
|
return {
|
|
9054
|
-
type: intl.formatMessage(messages$
|
|
8940
|
+
type: intl.formatMessage(messages$p.optionFieldError)
|
|
9055
8941
|
};
|
|
9056
8942
|
}
|
|
9057
8943
|
const typeName = value.type.name;
|
|
@@ -9059,7 +8945,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
9059
8945
|
const filterValue = value.value;
|
|
9060
8946
|
if (hasOption && !value.option) {
|
|
9061
8947
|
return {
|
|
9062
|
-
option: intl.formatMessage(messages$
|
|
8948
|
+
option: intl.formatMessage(messages$p.optionFieldError)
|
|
9063
8949
|
};
|
|
9064
8950
|
}
|
|
9065
8951
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -9078,7 +8964,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
9078
8964
|
} : null;
|
|
9079
8965
|
}
|
|
9080
8966
|
|
|
9081
|
-
const messages$
|
|
8967
|
+
const messages$o = reactIntl.defineMessages({
|
|
9082
8968
|
rangeMissingValue: {
|
|
9083
8969
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
9084
8970
|
description: 'error message if missing a value in a range',
|
|
@@ -9103,25 +8989,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
9103
8989
|
if (validateSingleFilter({
|
|
9104
8990
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
9105
8991
|
})) return {
|
|
9106
|
-
from: intl.formatMessage(messages$
|
|
8992
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9107
8993
|
};
|
|
9108
8994
|
if (validateSingleFilter({
|
|
9109
8995
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
9110
8996
|
})) return {
|
|
9111
|
-
to: intl.formatMessage(messages$
|
|
8997
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9112
8998
|
};
|
|
9113
8999
|
if (moment__default$1["default"](value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
9114
|
-
from: intl.formatMessage(messages$
|
|
9000
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9115
9001
|
};
|
|
9116
9002
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9117
9003
|
if (validateSingleFilter({
|
|
9118
9004
|
value
|
|
9119
|
-
})) return intl.formatMessage(messages$
|
|
9005
|
+
})) return intl.formatMessage(messages$o.missingValue);
|
|
9120
9006
|
}
|
|
9121
9007
|
return null;
|
|
9122
9008
|
}
|
|
9123
9009
|
|
|
9124
|
-
const messages$
|
|
9010
|
+
const messages$n = reactIntl.defineMessages({
|
|
9125
9011
|
rangeMissingValue: {
|
|
9126
9012
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9127
9013
|
description: 'error message if missing a value in a range',
|
|
@@ -9140,30 +9026,30 @@ function validateFilter(_ref, intl) {
|
|
|
9140
9026
|
_ref$allowFloat = _ref.allowFloat,
|
|
9141
9027
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9142
9028
|
if (type !== 'range') {
|
|
9143
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9029
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$J.integer);
|
|
9144
9030
|
return null;
|
|
9145
9031
|
}
|
|
9146
9032
|
|
|
9147
9033
|
// only range types from here
|
|
9148
9034
|
|
|
9149
9035
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9150
|
-
from: intl.formatMessage(messages$
|
|
9036
|
+
from: intl.formatMessage(messages$J.integer)
|
|
9151
9037
|
};
|
|
9152
9038
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9153
|
-
to: intl.formatMessage(messages$
|
|
9039
|
+
to: intl.formatMessage(messages$J.integer)
|
|
9154
9040
|
};
|
|
9155
9041
|
if (validateSingleFilter({
|
|
9156
9042
|
value: value.from
|
|
9157
9043
|
})) return {
|
|
9158
|
-
from: intl.formatMessage(messages$
|
|
9044
|
+
from: intl.formatMessage(messages$n.rangeMissingValue)
|
|
9159
9045
|
};
|
|
9160
9046
|
if (validateSingleFilter({
|
|
9161
9047
|
value: value.to
|
|
9162
9048
|
})) return {
|
|
9163
|
-
to: intl.formatMessage(messages$
|
|
9049
|
+
to: intl.formatMessage(messages$n.rangeMissingValue)
|
|
9164
9050
|
};
|
|
9165
9051
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9166
|
-
from: intl.formatMessage(messages$
|
|
9052
|
+
from: intl.formatMessage(messages$n.rangeToSmallerThanFrom)
|
|
9167
9053
|
};
|
|
9168
9054
|
return null;
|
|
9169
9055
|
}
|
|
@@ -9457,10 +9343,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9457
9343
|
carts: 'carts'
|
|
9458
9344
|
};
|
|
9459
9345
|
|
|
9460
|
-
function ownKeys$
|
|
9461
|
-
function _objectSpread$
|
|
9346
|
+
function ownKeys$w(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9347
|
+
function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$w(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$w(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9462
9348
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9463
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9349
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$w({
|
|
9464
9350
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9465
9351
|
}, previousIncludedLimits), {});
|
|
9466
9352
|
|
|
@@ -9522,7 +9408,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9522
9408
|
};
|
|
9523
9409
|
};
|
|
9524
9410
|
|
|
9525
|
-
var messages$
|
|
9411
|
+
var messages$m = reactIntl.defineMessages({
|
|
9526
9412
|
shippingMethods: {
|
|
9527
9413
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9528
9414
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9550,8 +9436,8 @@ var messages$n = reactIntl.defineMessages({
|
|
|
9550
9436
|
}
|
|
9551
9437
|
});
|
|
9552
9438
|
|
|
9553
|
-
function ownKeys$
|
|
9554
|
-
function _objectSpread$
|
|
9439
|
+
function ownKeys$v(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9440
|
+
function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$v(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$v(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9555
9441
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9556
9442
|
isExternal: true,
|
|
9557
9443
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9562,7 +9448,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9562
9448
|
limit = _ref.limit;
|
|
9563
9449
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9564
9450
|
type: "warning",
|
|
9565
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9451
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$v(_objectSpread$v({}, messages$m[resource]), {}, {
|
|
9566
9452
|
values: {
|
|
9567
9453
|
limit,
|
|
9568
9454
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9575,7 +9461,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9575
9461
|
};
|
|
9576
9462
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9577
9463
|
|
|
9578
|
-
var messages$
|
|
9464
|
+
var messages$l = reactIntl.defineMessages({
|
|
9579
9465
|
shippingMethods: {
|
|
9580
9466
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9581
9467
|
description: 'error message about platform limit exceeded',
|
|
@@ -9603,8 +9489,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9603
9489
|
}
|
|
9604
9490
|
});
|
|
9605
9491
|
|
|
9606
|
-
function ownKeys$
|
|
9607
|
-
function _objectSpread$
|
|
9492
|
+
function ownKeys$u(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9493
|
+
function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$u(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$u(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9608
9494
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9609
9495
|
isExternal: true,
|
|
9610
9496
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9615,7 +9501,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9615
9501
|
limit = _ref.limit;
|
|
9616
9502
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9617
9503
|
type: "error",
|
|
9618
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9504
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$u(_objectSpread$u({}, messages$l[resource]), {}, {
|
|
9619
9505
|
values: {
|
|
9620
9506
|
limit,
|
|
9621
9507
|
customersupport: getCustomerSupportLink
|
|
@@ -9633,8 +9519,8 @@ const Notifications = {
|
|
|
9633
9519
|
Error: PlatformLimitErrorNotification
|
|
9634
9520
|
};
|
|
9635
9521
|
|
|
9636
|
-
function ownKeys$
|
|
9637
|
-
function _objectSpread$
|
|
9522
|
+
function ownKeys$t(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9523
|
+
function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$t(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$t(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9638
9524
|
const PlatformLimitsStatusText = _ref => {
|
|
9639
9525
|
let intlMessage = _ref.intlMessage,
|
|
9640
9526
|
children = _ref.children;
|
|
@@ -9643,7 +9529,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9643
9529
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9644
9530
|
size: "xs",
|
|
9645
9531
|
children: [jsxRuntime.jsx("span", {
|
|
9646
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9532
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$t({}, intlMessage))
|
|
9647
9533
|
}), jsxRuntime.jsx("span", {
|
|
9648
9534
|
children: children
|
|
9649
9535
|
})]
|
|
@@ -9744,7 +9630,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9744
9630
|
};
|
|
9745
9631
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9746
9632
|
|
|
9747
|
-
var messages$
|
|
9633
|
+
var messages$k = reactIntl.defineMessages({
|
|
9748
9634
|
shippingMethodsPlatformLimitReached: {
|
|
9749
9635
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9750
9636
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9752,17 +9638,17 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9752
9638
|
}
|
|
9753
9639
|
});
|
|
9754
9640
|
|
|
9755
|
-
function ownKeys$
|
|
9756
|
-
function _objectSpread$
|
|
9641
|
+
function ownKeys$s(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9642
|
+
function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$s(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$s(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9757
9643
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9758
9644
|
const intl = reactIntl.useIntl();
|
|
9759
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9760
|
-
title: intl.formatMessage(messages$
|
|
9645
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9646
|
+
title: intl.formatMessage(messages$k.shippingMethodsPlatformLimitReached)
|
|
9761
9647
|
}));
|
|
9762
9648
|
};
|
|
9763
9649
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9764
9650
|
|
|
9765
|
-
var messages$
|
|
9651
|
+
var messages$j = reactIntl.defineMessages({
|
|
9766
9652
|
shippingMethodsStatus: {
|
|
9767
9653
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9768
9654
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9779,7 +9665,7 @@ const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
|
9779
9665
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 ? void 0 : (_platformLimits$shipp2 = _platformLimits$shipp.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.current;
|
|
9780
9666
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp3 = platformLimits.shippingMethods) === null || _platformLimits$shipp3 === void 0 ? void 0 : (_platformLimits$shipp4 = _platformLimits$shipp3.total) === null || _platformLimits$shipp4 === void 0 ? void 0 : _platformLimits$shipp4.limit;
|
|
9781
9667
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9782
|
-
intlMessage: messages$
|
|
9668
|
+
intlMessage: messages$j.shippingMethodsStatus,
|
|
9783
9669
|
children: getPlatformLimitsStatus({
|
|
9784
9670
|
limit,
|
|
9785
9671
|
current,
|
|
@@ -9810,15 +9696,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9810
9696
|
};
|
|
9811
9697
|
};
|
|
9812
9698
|
|
|
9813
|
-
function ownKeys$
|
|
9814
|
-
function _objectSpread$
|
|
9699
|
+
function ownKeys$r(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9700
|
+
function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$r(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$r(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9815
9701
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9816
9702
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9817
9703
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9818
9704
|
const shippingMethodsProps = {
|
|
9819
9705
|
platformLimits: shippingMethodsPlatformLimits
|
|
9820
9706
|
};
|
|
9821
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9707
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), shippingMethodsProps));
|
|
9822
9708
|
};
|
|
9823
9709
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9824
9710
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9891,7 +9777,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9891
9777
|
};
|
|
9892
9778
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9893
9779
|
|
|
9894
|
-
var messages$
|
|
9780
|
+
var messages$i = reactIntl.defineMessages({
|
|
9895
9781
|
taxCategoriesPlatformLimitReached: {
|
|
9896
9782
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9897
9783
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9899,17 +9785,17 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9899
9785
|
}
|
|
9900
9786
|
});
|
|
9901
9787
|
|
|
9902
|
-
function ownKeys$
|
|
9903
|
-
function _objectSpread$
|
|
9788
|
+
function ownKeys$q(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9789
|
+
function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$q(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9904
9790
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9905
9791
|
const intl = reactIntl.useIntl();
|
|
9906
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9907
|
-
title: intl.formatMessage(messages$
|
|
9792
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9793
|
+
title: intl.formatMessage(messages$i.taxCategoriesPlatformLimitReached)
|
|
9908
9794
|
}));
|
|
9909
9795
|
};
|
|
9910
9796
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9911
9797
|
|
|
9912
|
-
var messages$
|
|
9798
|
+
var messages$h = reactIntl.defineMessages({
|
|
9913
9799
|
taxCategoriesStatus: {
|
|
9914
9800
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9915
9801
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9926,7 +9812,7 @@ const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
|
9926
9812
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 ? void 0 : (_platformLimits$taxCa2 = _platformLimits$taxCa.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.current;
|
|
9927
9813
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa3 = platformLimits.taxCategories) === null || _platformLimits$taxCa3 === void 0 ? void 0 : (_platformLimits$taxCa4 = _platformLimits$taxCa3.total) === null || _platformLimits$taxCa4 === void 0 ? void 0 : _platformLimits$taxCa4.limit;
|
|
9928
9814
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9929
|
-
intlMessage: messages$
|
|
9815
|
+
intlMessage: messages$h.taxCategoriesStatus,
|
|
9930
9816
|
children: getPlatformLimitsStatus({
|
|
9931
9817
|
limit,
|
|
9932
9818
|
current,
|
|
@@ -9957,15 +9843,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9957
9843
|
};
|
|
9958
9844
|
};
|
|
9959
9845
|
|
|
9960
|
-
function ownKeys$
|
|
9961
|
-
function _objectSpread$
|
|
9846
|
+
function ownKeys$p(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9847
|
+
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$p(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9962
9848
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9963
9849
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9964
9850
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9965
9851
|
const taxCategoriesProps = {
|
|
9966
9852
|
platformLimits: taxCategoriesPlatformLimits
|
|
9967
9853
|
};
|
|
9968
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9854
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), taxCategoriesProps));
|
|
9969
9855
|
};
|
|
9970
9856
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9971
9857
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -10038,7 +9924,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
10038
9924
|
};
|
|
10039
9925
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
10040
9926
|
|
|
10041
|
-
var messages$
|
|
9927
|
+
var messages$g = reactIntl.defineMessages({
|
|
10042
9928
|
zonesPlatformLimitReached: {
|
|
10043
9929
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
10044
9930
|
description: 'The message for zones platform limit being reached',
|
|
@@ -10046,17 +9932,17 @@ var messages$h = reactIntl.defineMessages({
|
|
|
10046
9932
|
}
|
|
10047
9933
|
});
|
|
10048
9934
|
|
|
10049
|
-
function ownKeys$
|
|
10050
|
-
function _objectSpread$
|
|
9935
|
+
function ownKeys$o(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9936
|
+
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$o(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10051
9937
|
const PlatformLimitsZonesTooltip = props => {
|
|
10052
9938
|
const intl = reactIntl.useIntl();
|
|
10053
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10054
|
-
title: intl.formatMessage(messages$
|
|
9939
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
9940
|
+
title: intl.formatMessage(messages$g.zonesPlatformLimitReached)
|
|
10055
9941
|
}));
|
|
10056
9942
|
};
|
|
10057
9943
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
10058
9944
|
|
|
10059
|
-
var messages$
|
|
9945
|
+
var messages$f = reactIntl.defineMessages({
|
|
10060
9946
|
zonesStatus: {
|
|
10061
9947
|
id: 'PlatformLimits.Status.zones',
|
|
10062
9948
|
description: 'The message for zones platform limit values',
|
|
@@ -10073,7 +9959,7 @@ const PlatformLimitsZonesStatus = _ref => {
|
|
|
10073
9959
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 ? void 0 : (_platformLimits$zones2 = _platformLimits$zones.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.current;
|
|
10074
9960
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones3 = platformLimits.zones) === null || _platformLimits$zones3 === void 0 ? void 0 : (_platformLimits$zones4 = _platformLimits$zones3.total) === null || _platformLimits$zones4 === void 0 ? void 0 : _platformLimits$zones4.limit;
|
|
10075
9961
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
10076
|
-
intlMessage: messages$
|
|
9962
|
+
intlMessage: messages$f.zonesStatus,
|
|
10077
9963
|
children: getPlatformLimitsStatus({
|
|
10078
9964
|
limit,
|
|
10079
9965
|
current,
|
|
@@ -10104,15 +9990,15 @@ const useZonesLimits = () => {
|
|
|
10104
9990
|
};
|
|
10105
9991
|
};
|
|
10106
9992
|
|
|
10107
|
-
function ownKeys$
|
|
10108
|
-
function _objectSpread$
|
|
9993
|
+
function ownKeys$n(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9994
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$n(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10109
9995
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
10110
9996
|
const WithZonesPlatformLimits = props => {
|
|
10111
9997
|
const zonesPlatformLimits = useZonesLimits();
|
|
10112
9998
|
const zonesProps = {
|
|
10113
9999
|
platformLimits: zonesPlatformLimits
|
|
10114
10000
|
};
|
|
10115
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10001
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$n(_objectSpread$n({}, props), zonesProps));
|
|
10116
10002
|
};
|
|
10117
10003
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10118
10004
|
return WithZonesPlatformLimits;
|
|
@@ -10198,7 +10084,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10198
10084
|
};
|
|
10199
10085
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10200
10086
|
|
|
10201
|
-
var messages$
|
|
10087
|
+
var messages$e = reactIntl.defineMessages({
|
|
10202
10088
|
customersPlatformLimitReached: {
|
|
10203
10089
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10204
10090
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10206,17 +10092,17 @@ var messages$f = reactIntl.defineMessages({
|
|
|
10206
10092
|
}
|
|
10207
10093
|
});
|
|
10208
10094
|
|
|
10209
|
-
function ownKeys$
|
|
10210
|
-
function _objectSpread$
|
|
10095
|
+
function ownKeys$m(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10096
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$m(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10211
10097
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10212
10098
|
const intl = reactIntl.useIntl();
|
|
10213
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10214
|
-
title: intl.formatMessage(messages$
|
|
10099
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10100
|
+
title: intl.formatMessage(messages$e.customersPlatformLimitReached)
|
|
10215
10101
|
}));
|
|
10216
10102
|
};
|
|
10217
10103
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10218
10104
|
|
|
10219
|
-
var messages$
|
|
10105
|
+
var messages$d = reactIntl.defineMessages({
|
|
10220
10106
|
customersStatus: {
|
|
10221
10107
|
id: 'PlatformLimits.Status.customers',
|
|
10222
10108
|
description: 'The message for customers platform limit values',
|
|
@@ -10224,9 +10110,9 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10224
10110
|
}
|
|
10225
10111
|
});
|
|
10226
10112
|
|
|
10227
|
-
function ownKeys$
|
|
10228
|
-
function _objectSpread$
|
|
10229
|
-
var styles$
|
|
10113
|
+
function ownKeys$l(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10114
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$l(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10115
|
+
var styles$b = {
|
|
10230
10116
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10231
10117
|
};
|
|
10232
10118
|
const PlatformLimitsCustomersStatus = () => {
|
|
@@ -10241,11 +10127,11 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10241
10127
|
current = _platformLimits$custo2.current,
|
|
10242
10128
|
limit = _platformLimits$custo2.limit;
|
|
10243
10129
|
return jsxRuntime.jsx("div", {
|
|
10244
|
-
className: styles$
|
|
10130
|
+
className: styles$b.status,
|
|
10245
10131
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10246
10132
|
tone: "secondary",
|
|
10247
10133
|
isInline: true,
|
|
10248
|
-
intlMessage: _objectSpread$
|
|
10134
|
+
intlMessage: _objectSpread$l(_objectSpread$l({}, messages$d.customersStatus), {}, {
|
|
10249
10135
|
values: {
|
|
10250
10136
|
current: intl.formatNumber(current),
|
|
10251
10137
|
limit: intl.formatNumber(limit)
|
|
@@ -10256,7 +10142,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10256
10142
|
};
|
|
10257
10143
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10258
10144
|
|
|
10259
|
-
var messages$
|
|
10145
|
+
var messages$c = reactIntl.defineMessages({
|
|
10260
10146
|
title: {
|
|
10261
10147
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10262
10148
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10269,10 +10155,10 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10269
10155
|
}
|
|
10270
10156
|
});
|
|
10271
10157
|
|
|
10272
|
-
function ownKeys$
|
|
10273
|
-
function _objectSpread$
|
|
10158
|
+
function ownKeys$k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10159
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10274
10160
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10275
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10161
|
+
return jsxRuntime.jsxs("svg", _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10276
10162
|
children: [jsxRuntime.jsx("defs", {
|
|
10277
10163
|
children: jsxRuntime.jsx("path", {
|
|
10278
10164
|
id: "a",
|
|
@@ -10380,7 +10266,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10380
10266
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10381
10267
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10382
10268
|
onClose: onClose,
|
|
10383
|
-
title: intl.formatMessage(messages$
|
|
10269
|
+
title: intl.formatMessage(messages$c.title),
|
|
10384
10270
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10385
10271
|
scale: "m",
|
|
10386
10272
|
alignItems: "center",
|
|
@@ -10389,7 +10275,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10389
10275
|
alignItems: "center",
|
|
10390
10276
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10391
10277
|
onClick: onClose,
|
|
10392
|
-
label: intl.formatMessage(messages$
|
|
10278
|
+
label: intl.formatMessage(messages$c.backToList),
|
|
10393
10279
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10394
10280
|
size: "medium",
|
|
10395
10281
|
color: "primary"
|
|
@@ -10401,7 +10287,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10401
10287
|
};
|
|
10402
10288
|
PlatformLimitsCustomersErrorModal.displayName = 'PlatformLimitsCustomersErrorModal';
|
|
10403
10289
|
|
|
10404
|
-
var styles$
|
|
10290
|
+
var styles$a = {
|
|
10405
10291
|
"combined": "platform-limits-customers-combined-module__combined___OszDd"
|
|
10406
10292
|
};
|
|
10407
10293
|
const PlatformLimitsCustomersCombined = () => {
|
|
@@ -10409,14 +10295,12 @@ const PlatformLimitsCustomersCombined = () => {
|
|
|
10409
10295
|
const _useCustomersPlatform = useCustomersPlatformLimits$1(),
|
|
10410
10296
|
hasReachedCustomersErrorLimit = _useCustomersPlatform.hasReachedCustomersErrorLimit,
|
|
10411
10297
|
hasReachedCustomersWarningLimit = _useCustomersPlatform.hasReachedCustomersWarningLimit;
|
|
10412
|
-
const _useTheme = designSystem.useTheme(),
|
|
10413
|
-
themedValue = _useTheme.themedValue;
|
|
10414
10298
|
return jsxRuntime.jsx("div", {
|
|
10415
|
-
className: styles$
|
|
10299
|
+
className: styles$a.combined,
|
|
10416
10300
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
10417
10301
|
scale: "xl",
|
|
10418
10302
|
justifyContent: "space-between",
|
|
10419
|
-
children: [hasReachedCustomersWarningLimit && !hasReachedCustomersErrorLimit ? jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}) :
|
|
10303
|
+
children: [hasReachedCustomersWarningLimit && !hasReachedCustomersErrorLimit ? jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}) : null, jsxRuntime.jsx(PlatformLimitsCustomersStatus, {})]
|
|
10420
10304
|
})
|
|
10421
10305
|
});
|
|
10422
10306
|
};
|
|
@@ -10446,15 +10330,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10446
10330
|
};
|
|
10447
10331
|
};
|
|
10448
10332
|
|
|
10449
|
-
function ownKeys$
|
|
10450
|
-
function _objectSpread$
|
|
10333
|
+
function ownKeys$j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10334
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10451
10335
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10452
10336
|
const WithCustomersPlatformLimits = props => {
|
|
10453
10337
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10454
10338
|
const customersProps = {
|
|
10455
10339
|
platformLimits: CustomersPlatformLimits
|
|
10456
10340
|
};
|
|
10457
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10341
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$j(_objectSpread$j({}, props), customersProps));
|
|
10458
10342
|
};
|
|
10459
10343
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10460
10344
|
return WithCustomersPlatformLimits;
|
|
@@ -10540,7 +10424,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10540
10424
|
};
|
|
10541
10425
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10542
10426
|
|
|
10543
|
-
var messages$
|
|
10427
|
+
var messages$b = reactIntl.defineMessages({
|
|
10544
10428
|
customerGroupsPlatformLimitReached: {
|
|
10545
10429
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10546
10430
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10548,17 +10432,17 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10548
10432
|
}
|
|
10549
10433
|
});
|
|
10550
10434
|
|
|
10551
|
-
function ownKeys$
|
|
10552
|
-
function _objectSpread$
|
|
10435
|
+
function ownKeys$i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10436
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10553
10437
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10554
10438
|
const intl = reactIntl.useIntl();
|
|
10555
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10556
|
-
title: intl.formatMessage(messages$
|
|
10439
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10440
|
+
title: intl.formatMessage(messages$b.customerGroupsPlatformLimitReached)
|
|
10557
10441
|
}));
|
|
10558
10442
|
};
|
|
10559
10443
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10560
10444
|
|
|
10561
|
-
var messages$
|
|
10445
|
+
var messages$a = reactIntl.defineMessages({
|
|
10562
10446
|
customerGroupsStatus: {
|
|
10563
10447
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10564
10448
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10566,9 +10450,9 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10566
10450
|
}
|
|
10567
10451
|
});
|
|
10568
10452
|
|
|
10569
|
-
function ownKeys$
|
|
10570
|
-
function _objectSpread$
|
|
10571
|
-
var styles$
|
|
10453
|
+
function ownKeys$h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10454
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10455
|
+
var styles$9 = {
|
|
10572
10456
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10573
10457
|
};
|
|
10574
10458
|
const PlatformLimitsCustomerGroupsStatus = () => {
|
|
@@ -10583,11 +10467,11 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10583
10467
|
current = _platformLimits$custo2.current,
|
|
10584
10468
|
limit = _platformLimits$custo2.limit;
|
|
10585
10469
|
return jsxRuntime.jsx("div", {
|
|
10586
|
-
className: styles$
|
|
10470
|
+
className: styles$9.status,
|
|
10587
10471
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10588
10472
|
tone: "secondary",
|
|
10589
10473
|
isInline: true,
|
|
10590
|
-
intlMessage: _objectSpread$
|
|
10474
|
+
intlMessage: _objectSpread$h(_objectSpread$h({}, messages$a.customerGroupsStatus), {}, {
|
|
10591
10475
|
values: {
|
|
10592
10476
|
current: intl.formatNumber(current),
|
|
10593
10477
|
limit: intl.formatNumber(limit)
|
|
@@ -10598,7 +10482,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10598
10482
|
};
|
|
10599
10483
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10600
10484
|
|
|
10601
|
-
var messages$
|
|
10485
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10602
10486
|
title: {
|
|
10603
10487
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10604
10488
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10611,10 +10495,10 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10611
10495
|
}
|
|
10612
10496
|
});
|
|
10613
10497
|
|
|
10614
|
-
function ownKeys$
|
|
10615
|
-
function _objectSpread$
|
|
10498
|
+
function ownKeys$g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10499
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$g(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10616
10500
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10617
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10501
|
+
return jsxRuntime.jsxs("svg", _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
10618
10502
|
children: [jsxRuntime.jsx("defs", {
|
|
10619
10503
|
children: jsxRuntime.jsx("path", {
|
|
10620
10504
|
id: "a",
|
|
@@ -10722,7 +10606,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10722
10606
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10723
10607
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10724
10608
|
onClose: onClose,
|
|
10725
|
-
title: intl.formatMessage(messages$
|
|
10609
|
+
title: intl.formatMessage(messages$9.title),
|
|
10726
10610
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10727
10611
|
scale: "m",
|
|
10728
10612
|
alignItems: "center",
|
|
@@ -10731,7 +10615,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10731
10615
|
alignItems: "center",
|
|
10732
10616
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10733
10617
|
onClick: onClose,
|
|
10734
|
-
label: intl.formatMessage(messages$
|
|
10618
|
+
label: intl.formatMessage(messages$9.backToList),
|
|
10735
10619
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10736
10620
|
size: "medium",
|
|
10737
10621
|
color: "primary"
|
|
@@ -10743,7 +10627,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10743
10627
|
};
|
|
10744
10628
|
PlatformLimitsCustomerGroupsErrorModal.displayName = 'PlatformLimitsCustomerGroupsErrorModal';
|
|
10745
10629
|
|
|
10746
|
-
var styles$
|
|
10630
|
+
var styles$8 = {
|
|
10747
10631
|
"combined": "platform-limits-customer-groups-combined-module__combined___WjRoI"
|
|
10748
10632
|
};
|
|
10749
10633
|
const PlatformLimitsCustomerGroupsCombined = () => {
|
|
@@ -10751,14 +10635,12 @@ const PlatformLimitsCustomerGroupsCombined = () => {
|
|
|
10751
10635
|
const _useCustomerGroupsPla = useCustomerGroupsPlatformLimitsStatus(),
|
|
10752
10636
|
hasReachedCustomerGroupsErrorLimit = _useCustomerGroupsPla.hasReachedCustomerGroupsErrorLimit,
|
|
10753
10637
|
hasReachedCustomerGroupsWarningLimit = _useCustomerGroupsPla.hasReachedCustomerGroupsWarningLimit;
|
|
10754
|
-
const _useTheme = designSystem.useTheme(),
|
|
10755
|
-
themedValue = _useTheme.themedValue;
|
|
10756
10638
|
return jsxRuntime.jsx("div", {
|
|
10757
|
-
className: styles$
|
|
10639
|
+
className: styles$8.combined,
|
|
10758
10640
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
10759
10641
|
scale: "xl",
|
|
10760
10642
|
justifyContent: "space-between",
|
|
10761
|
-
children: [hasReachedCustomerGroupsWarningLimit && !hasReachedCustomerGroupsErrorLimit ? jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}) :
|
|
10643
|
+
children: [hasReachedCustomerGroupsWarningLimit && !hasReachedCustomerGroupsErrorLimit ? jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}) : null, jsxRuntime.jsx(PlatformLimitsCustomerGroupsStatus, {})]
|
|
10762
10644
|
})
|
|
10763
10645
|
});
|
|
10764
10646
|
};
|
|
@@ -10788,15 +10670,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10788
10670
|
};
|
|
10789
10671
|
};
|
|
10790
10672
|
|
|
10791
|
-
function ownKeys$
|
|
10792
|
-
function _objectSpread$
|
|
10673
|
+
function ownKeys$f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10674
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10793
10675
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10794
10676
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10795
10677
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10796
10678
|
const customersProps = {
|
|
10797
10679
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10798
10680
|
};
|
|
10799
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10681
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$f(_objectSpread$f({}, props), customersProps));
|
|
10800
10682
|
};
|
|
10801
10683
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10802
10684
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10851,7 +10733,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10851
10733
|
}
|
|
10852
10734
|
});
|
|
10853
10735
|
|
|
10854
|
-
var messages$
|
|
10736
|
+
var messages$8 = reactIntl.defineMessages({
|
|
10855
10737
|
indexingSucceed: {
|
|
10856
10738
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10857
10739
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10889,8 +10771,8 @@ const defaultValue = {
|
|
|
10889
10771
|
*/
|
|
10890
10772
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10891
10773
|
|
|
10892
|
-
function ownKeys$
|
|
10893
|
-
function _objectSpread$
|
|
10774
|
+
function ownKeys$e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10775
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$e(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
10894
10776
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10895
10777
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10896
10778
|
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 } } } };
|
|
@@ -10976,7 +10858,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10976
10858
|
_this.props.notifications.showNotification({
|
|
10977
10859
|
kind: 'error',
|
|
10978
10860
|
domain: constants.DOMAINS.SIDE,
|
|
10979
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10861
|
+
text: _this.props.intl.formatMessage(messages$8.indexingFailed)
|
|
10980
10862
|
});
|
|
10981
10863
|
};
|
|
10982
10864
|
_this.getIndexingProgress = async () => {
|
|
@@ -11017,7 +10899,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
11017
10899
|
_this.props.notifications.showNotification({
|
|
11018
10900
|
kind: 'success',
|
|
11019
10901
|
domain: constants.DOMAINS.SIDE,
|
|
11020
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10902
|
+
text: _this.props.intl.formatMessage(messages$8.indexingSucceed)
|
|
11021
10903
|
},
|
|
11022
10904
|
// because the indexing may take so long, the success notification
|
|
11023
10905
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -11066,7 +10948,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
11066
10948
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
11067
10949
|
}
|
|
11068
10950
|
});
|
|
11069
|
-
_this.setState(_objectSpread$
|
|
10951
|
+
_this.setState(_objectSpread$e(_objectSpread$e({
|
|
11070
10952
|
isLoading: false,
|
|
11071
10953
|
isProjectBeingIndexedByPim: true
|
|
11072
10954
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -11091,7 +10973,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
11091
10973
|
key: "render",
|
|
11092
10974
|
value: function render() {
|
|
11093
10975
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
11094
|
-
value: _objectSpread$
|
|
10976
|
+
value: _objectSpread$e(_objectSpread$e({}, this.state), {}, {
|
|
11095
10977
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
11096
10978
|
indexProject: this.indexProject
|
|
11097
10979
|
}),
|
|
@@ -11133,13 +11015,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11133
11015
|
}(React.PureComponent);
|
|
11134
11016
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11135
11017
|
|
|
11136
|
-
function ownKeys$
|
|
11137
|
-
function _objectSpread$
|
|
11018
|
+
function ownKeys$d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11019
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$d(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11138
11020
|
var injectPimIndexer = (function () {
|
|
11139
11021
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11140
11022
|
return Component => {
|
|
11141
11023
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11142
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11024
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
11143
11025
|
[propName]: pimIndexerProps
|
|
11144
11026
|
}))
|
|
11145
11027
|
});
|
|
@@ -11152,7 +11034,7 @@ function usePimIndexer() {
|
|
|
11152
11034
|
return React.useContext(PimIndexerContext);
|
|
11153
11035
|
}
|
|
11154
11036
|
|
|
11155
|
-
var messages$
|
|
11037
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11156
11038
|
yes: {
|
|
11157
11039
|
id: 'BooleanField.yes',
|
|
11158
11040
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11174,8 +11056,8 @@ const BooleanField = props => {
|
|
|
11174
11056
|
var _context;
|
|
11175
11057
|
let selectedValue;
|
|
11176
11058
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray__default["default"](props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
11177
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11178
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11059
|
+
const yesLabel = props.intl.formatMessage(messages$7.yes);
|
|
11060
|
+
const noLabel = props.intl.formatMessage(messages$7.no);
|
|
11179
11061
|
const options = [{
|
|
11180
11062
|
value: 'yes',
|
|
11181
11063
|
label: yesLabel
|
|
@@ -11213,7 +11095,7 @@ function getBooleanValue(value) {
|
|
|
11213
11095
|
return value === false ? 'no' : 'yes';
|
|
11214
11096
|
}
|
|
11215
11097
|
|
|
11216
|
-
var messages$
|
|
11098
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11217
11099
|
label: {
|
|
11218
11100
|
id: 'MissingValueField.label',
|
|
11219
11101
|
description: 'The label text for the missing values option',
|
|
@@ -11221,21 +11103,21 @@ var messages$7 = reactIntl.defineMessages({
|
|
|
11221
11103
|
}
|
|
11222
11104
|
});
|
|
11223
11105
|
|
|
11224
|
-
function ownKeys$
|
|
11225
|
-
function _objectSpread$
|
|
11106
|
+
function ownKeys$c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11107
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$c(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11226
11108
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11227
11109
|
name: "missing-value",
|
|
11228
11110
|
isChecked: props.isChecked,
|
|
11229
11111
|
onChange: props.onChange,
|
|
11230
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11112
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$c({}, messages$6.label))
|
|
11231
11113
|
});
|
|
11232
11114
|
MissingValueField.defaultProps = {
|
|
11233
11115
|
isChecked: false
|
|
11234
11116
|
};
|
|
11235
11117
|
|
|
11236
|
-
function ownKeys$
|
|
11237
|
-
function _objectSpread$
|
|
11238
|
-
var styles$
|
|
11118
|
+
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11119
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11120
|
+
var styles$7 = {
|
|
11239
11121
|
"button": "button-module__button___1OzVf",
|
|
11240
11122
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
11241
11123
|
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
@@ -11268,10 +11150,10 @@ const Button = props => {
|
|
|
11268
11150
|
|
|
11269
11151
|
// Pass only `data-*` props
|
|
11270
11152
|
const dataProps = filterDataAttributes(props);
|
|
11271
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11153
|
+
return jsxRuntime.jsx("button", _objectSpread$b(_objectSpread$b({
|
|
11272
11154
|
onClick: isDisabled ? null : onClick,
|
|
11273
11155
|
type: props.type,
|
|
11274
|
-
className: classnames__default["default"](styles$
|
|
11156
|
+
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
11275
11157
|
disabled: isDisabled,
|
|
11276
11158
|
"aria-label": props['aria-label']
|
|
11277
11159
|
}, dataProps), {}, {
|
|
@@ -11283,7 +11165,7 @@ Button.defaultProps = {
|
|
|
11283
11165
|
type: 'button'
|
|
11284
11166
|
};
|
|
11285
11167
|
|
|
11286
|
-
var messages$
|
|
11168
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11287
11169
|
chooseFile: {
|
|
11288
11170
|
id: 'ButtonFileInput.chooseFile',
|
|
11289
11171
|
description: 'The label text of the field for upload local file',
|
|
@@ -11291,17 +11173,17 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11291
11173
|
}
|
|
11292
11174
|
});
|
|
11293
11175
|
|
|
11294
|
-
function ownKeys$
|
|
11295
|
-
function _objectSpread$
|
|
11296
|
-
var styles$
|
|
11176
|
+
function ownKeys$a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11177
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11178
|
+
var styles$6 = {
|
|
11297
11179
|
"button": "file-input-module__button___2KypN",
|
|
11298
11180
|
"input": "file-input-module__input___3MP4D"
|
|
11299
11181
|
};
|
|
11300
11182
|
const FileInput = props => jsxRuntime.jsx("label", {
|
|
11301
11183
|
children: jsxRuntime.jsxs("span", {
|
|
11302
|
-
className: styles$
|
|
11184
|
+
className: styles$6.button,
|
|
11303
11185
|
children: [jsxRuntime.jsx("input", {
|
|
11304
|
-
className: styles$
|
|
11186
|
+
className: styles$6.input,
|
|
11305
11187
|
type: "file",
|
|
11306
11188
|
accept: props.acceptTypes,
|
|
11307
11189
|
name: props.name,
|
|
@@ -11312,140 +11194,11 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11312
11194
|
});
|
|
11313
11195
|
FileInput.displayName = 'FileInput';
|
|
11314
11196
|
FileInput.defaultProps = {
|
|
11315
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11197
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$5.chooseFile)),
|
|
11316
11198
|
allowMultiple: false,
|
|
11317
11199
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11318
11200
|
};
|
|
11319
11201
|
|
|
11320
|
-
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11321
|
-
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11322
|
-
var styles$6 = {
|
|
11323
|
-
"button": "button-module__button___1OzVf",
|
|
11324
|
-
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
11325
|
-
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
11326
|
-
"save": "button-module__save___1-KXp button-module__confirm___-W92x button-module__button___1OzVf",
|
|
11327
|
-
"add": "button-module__add___1fbPS button-module__button___1OzVf",
|
|
11328
|
-
"add-url": "button-module__add-url___1e6xE button-module__add___1fbPS button-module__button___1OzVf",
|
|
11329
|
-
"icon-add": "button-module__icon-add___2X7fc",
|
|
11330
|
-
"icon-chain": "button-module__icon-chain___1pvWT",
|
|
11331
|
-
"switch": "button-module__switch___2bt5z",
|
|
11332
|
-
"icon": "button-module__icon___wuw4Z",
|
|
11333
|
-
"switch--active": "button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11334
|
-
"switch-squared": "button-module__switch-squared___QnrOG button-module__button___1OzVf button-module__switch___2bt5z",
|
|
11335
|
-
"switch-squared--active": "button-module__switch-squared--active___2ZbEC button-module__switch-squared___QnrOG button-module__button___1OzVf button-module__switch___2bt5z button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11336
|
-
"switch-rounded": "button-module__switch-rounded___1CBs_ button-module__switch___2bt5z",
|
|
11337
|
-
"switch-rounded--active": "button-module__switch-rounded--active___2Ckga button-module__switch-rounded___1CBs_ button-module__switch___2bt5z button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11338
|
-
"switch-label": "button-module__switch-label___2FAdy",
|
|
11339
|
-
"disabled": "button-module__disabled___2Azpu",
|
|
11340
|
-
"full": "button-module__full___264Zw",
|
|
11341
|
-
"alt": "button-module__alt___Z6PWx",
|
|
11342
|
-
"confirm-alt": "button-module__confirm-alt___2Zcqz button-module__confirm___-W92x button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11343
|
-
"cancel-alt": "button-module__cancel-alt___u5EAw button-module__cancel___1-jYL button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11344
|
-
"save-alt": "button-module__save-alt___6iHMF button-module__save___1-KXp button-module__confirm___-W92x button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11345
|
-
"add-button": "button-module__add-button___1f093"
|
|
11346
|
-
};
|
|
11347
|
-
/**
|
|
11348
|
-
* Button-Typed
|
|
11349
|
-
*
|
|
11350
|
-
* This module generates button components based on a name, type and several
|
|
11351
|
-
* default options.
|
|
11352
|
-
*
|
|
11353
|
-
* Each button has a TYPE (save, confirm, cancel, add) and may have a STYLE
|
|
11354
|
-
* (default, alternative)
|
|
11355
|
-
*
|
|
11356
|
-
* Each button may or may not have a default label and icon. If no default label
|
|
11357
|
-
* is provided, then label becomes a required prop. If no default icon is
|
|
11358
|
-
* provided then icon is still an optional prop.
|
|
11359
|
-
*
|
|
11360
|
-
* If the option hasAlternativeStyle is true, then the `style` prop may be either
|
|
11361
|
-
* "default" or "alternative", otherwise the style prop will default to "default"
|
|
11362
|
-
* and can not be set to anything else.
|
|
11363
|
-
*/
|
|
11364
|
-
function ButtonTyped (name, options) {
|
|
11365
|
-
const defaultLabel = options.defaultLabel,
|
|
11366
|
-
defaultIcon = options.defaultIcon,
|
|
11367
|
-
type = options.type,
|
|
11368
|
-
hasAlternativeStyle = options.hasAlternativeStyle,
|
|
11369
|
-
buttonWrapperClassName = options.buttonWrapperClassName;
|
|
11370
|
-
const validTypes = ['save', 'cancel', 'confirm', 'add'];
|
|
11371
|
-
if (!_includesInstanceProperty__default["default"](validTypes).call(validTypes, type)) throw new Error('Invalid button type provided to ButtonTyped');
|
|
11372
|
-
const ButtonTyped = props => {
|
|
11373
|
-
const label = props.label,
|
|
11374
|
-
onClick = props.onClick,
|
|
11375
|
-
isDisabled = props.isDisabled,
|
|
11376
|
-
fullWidth = props.fullWidth,
|
|
11377
|
-
style = props.style,
|
|
11378
|
-
icon = props.icon,
|
|
11379
|
-
url = props.url,
|
|
11380
|
-
className = props.className;
|
|
11381
|
-
const isAlternativeStyle = hasAlternativeStyle && style === 'alternative';
|
|
11382
|
-
const hasIcon = defaultIcon || icon;
|
|
11383
|
-
const classNames = classnames__default["default"]({
|
|
11384
|
-
[styles$6.full]: fullWidth
|
|
11385
|
-
}, isAlternativeStyle ? styles$6["".concat(type, "-alt")] : styles$6[type], className);
|
|
11386
|
-
const computedLabel = label || defaultLabel;
|
|
11387
|
-
const dataAttrs = filterDataAttributes(props);
|
|
11388
|
-
return jsxRuntime.jsx(Button, _objectSpread$b(_objectSpread$b({
|
|
11389
|
-
onClick: isDisabled ? null : onClick,
|
|
11390
|
-
url: url,
|
|
11391
|
-
isDisabled: isDisabled,
|
|
11392
|
-
className: classNames
|
|
11393
|
-
}, dataAttrs), {}, {
|
|
11394
|
-
children: jsxRuntime.jsxs("div", {
|
|
11395
|
-
className: buttonWrapperClassName,
|
|
11396
|
-
children: [/*#__PURE__*/React.isValidElement(computedLabel) ? computedLabel : jsxRuntime.jsx("span", {
|
|
11397
|
-
children: computedLabel
|
|
11398
|
-
}), hasIcon ? icon || defaultIcon : null]
|
|
11399
|
-
})
|
|
11400
|
-
}));
|
|
11401
|
-
};
|
|
11402
|
-
ButtonTyped.displayName = name;
|
|
11403
|
-
ButtonTyped.defaultProps = {
|
|
11404
|
-
isDisabled: false,
|
|
11405
|
-
fullWidth: false,
|
|
11406
|
-
style: 'default',
|
|
11407
|
-
icon: null,
|
|
11408
|
-
className: null
|
|
11409
|
-
};
|
|
11410
|
-
return ButtonTyped;
|
|
11411
|
-
}
|
|
11412
|
-
|
|
11413
|
-
const messages$5 = reactIntl.defineMessages({
|
|
11414
|
-
cancel: {
|
|
11415
|
-
id: 'Button.cancel',
|
|
11416
|
-
description: 'Label for the cancel button',
|
|
11417
|
-
defaultMessage: 'Cancel'
|
|
11418
|
-
},
|
|
11419
|
-
confirm: {
|
|
11420
|
-
id: 'Button.confirm',
|
|
11421
|
-
description: 'Label for the confirm button',
|
|
11422
|
-
defaultMessage: 'Confirm'
|
|
11423
|
-
},
|
|
11424
|
-
save: {
|
|
11425
|
-
id: 'Button.save',
|
|
11426
|
-
description: 'Label for the save button',
|
|
11427
|
-
defaultMessage: 'Save'
|
|
11428
|
-
}
|
|
11429
|
-
});
|
|
11430
|
-
|
|
11431
|
-
function ownKeys$a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11432
|
-
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11433
|
-
const ButtonCancel = ButtonTyped('ButtonCancel', {
|
|
11434
|
-
type: 'cancel',
|
|
11435
|
-
defaultLabel: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$5.cancel)),
|
|
11436
|
-
hasAlternativeStyle: true
|
|
11437
|
-
});
|
|
11438
|
-
const ButtonConfirm = ButtonTyped('ButtonConfirm', {
|
|
11439
|
-
type: 'confirm',
|
|
11440
|
-
defaultLabel: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$5.confirm)),
|
|
11441
|
-
hasAlternativeStyle: true
|
|
11442
|
-
});
|
|
11443
|
-
const ButtonSave = ButtonTyped('ButtonSave', {
|
|
11444
|
-
type: 'save',
|
|
11445
|
-
defaultLabel: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$5.save)),
|
|
11446
|
-
hasAlternativeStyle: true
|
|
11447
|
-
});
|
|
11448
|
-
|
|
11449
11202
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
11450
11203
|
var styles$5 = {
|
|
11451
11204
|
"colored": "required-indicator-module__colored____YUFm",
|
|
@@ -11623,7 +11376,7 @@ const validateRequired = value => {
|
|
|
11623
11376
|
};
|
|
11624
11377
|
const VALIDATOR_REQUIRED = {
|
|
11625
11378
|
name: 'required',
|
|
11626
|
-
message: messages$
|
|
11379
|
+
message: messages$J.required,
|
|
11627
11380
|
permanent: true,
|
|
11628
11381
|
validators: {
|
|
11629
11382
|
change(value) {
|
|
@@ -11637,7 +11390,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11637
11390
|
};
|
|
11638
11391
|
const VALIDATOR_NUMERIC = {
|
|
11639
11392
|
name: 'numeric',
|
|
11640
|
-
message: messages$
|
|
11393
|
+
message: messages$J.numeric,
|
|
11641
11394
|
permanent: false,
|
|
11642
11395
|
validators: {
|
|
11643
11396
|
change: v => {
|
|
@@ -11652,7 +11405,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11652
11405
|
};
|
|
11653
11406
|
const VALIDATOR_INTEGER = {
|
|
11654
11407
|
name: 'integer',
|
|
11655
|
-
message: messages$
|
|
11408
|
+
message: messages$J.integer,
|
|
11656
11409
|
permanent: false,
|
|
11657
11410
|
validators: {
|
|
11658
11411
|
change: v => {
|
|
@@ -11667,7 +11420,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11667
11420
|
};
|
|
11668
11421
|
({
|
|
11669
11422
|
name: 'email',
|
|
11670
|
-
message: messages$
|
|
11423
|
+
message: messages$J.email,
|
|
11671
11424
|
permanent: false,
|
|
11672
11425
|
validators: {
|
|
11673
11426
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -12596,17 +12349,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12596
12349
|
}
|
|
12597
12350
|
|
|
12598
12351
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12599
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12352
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$J.required);
|
|
12600
12353
|
return null;
|
|
12601
12354
|
};
|
|
12602
12355
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12603
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12356
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$J.required);
|
|
12604
12357
|
return null;
|
|
12605
12358
|
};
|
|
12606
12359
|
|
|
12607
12360
|
// eslint-disable-next-line import/prefer-default-export
|
|
12608
12361
|
const validateText = (text, intl) => {
|
|
12609
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12362
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$J.required);
|
|
12610
12363
|
return null;
|
|
12611
12364
|
};
|
|
12612
12365
|
|
|
@@ -13060,9 +12813,6 @@ var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kin
|
|
|
13060
12813
|
|
|
13061
12814
|
exports.BooleanField = booleanField;
|
|
13062
12815
|
exports.Button = Button;
|
|
13063
|
-
exports.ButtonCancel = ButtonCancel;
|
|
13064
|
-
exports.ButtonConfirm = ButtonConfirm;
|
|
13065
|
-
exports.ButtonSave = ButtonSave;
|
|
13066
12816
|
exports.CartDiscountReferenceSearch = CartDiscountReferenceSearch;
|
|
13067
12817
|
exports.CategoryReferenceSearch = CategoryReferenceSearch;
|
|
13068
12818
|
exports.CategorySearchPickerOptionFragment = CategorySearchPickerOptionFragment;
|
|
@@ -13105,9 +12855,9 @@ exports.allowedProperties = allowedProperties;
|
|
|
13105
12855
|
exports.and = and;
|
|
13106
12856
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
13107
12857
|
exports.base64ToString = base64ToString;
|
|
13108
|
-
exports.booleanMessages = messages$
|
|
12858
|
+
exports.booleanMessages = messages$7;
|
|
13109
12859
|
exports.buildSearchQuery = buildSearchQuery;
|
|
13110
|
-
exports.businessRoleMessages = messages$
|
|
12860
|
+
exports.businessRoleMessages = messages$q;
|
|
13111
12861
|
exports.businessRoles = businessRoleKeys;
|
|
13112
12862
|
exports.capitalizeFirst = capitalizeFirst;
|
|
13113
12863
|
exports.clone = clone;
|
|
@@ -13189,9 +12939,10 @@ exports.isValidISODate = isValidISODate;
|
|
|
13189
12939
|
exports.isValidISODateTime = isValidISODateTime;
|
|
13190
12940
|
exports.isValidISOTime = isValidISOTime;
|
|
13191
12941
|
exports.keepDisplayName = keepDisplayName;
|
|
12942
|
+
exports.mapStoresToOptions = mapStoresToOptions;
|
|
13192
12943
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
13193
12944
|
exports.minusify = minusify;
|
|
13194
|
-
exports.missingValueMessages = messages$
|
|
12945
|
+
exports.missingValueMessages = messages$6;
|
|
13195
12946
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
13196
12947
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
13197
12948
|
exports.not = not;
|
|
@@ -13208,7 +12959,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
13208
12959
|
exports.safelyAddFallback = safelyAddFallback;
|
|
13209
12960
|
exports.sanitize = sanitize;
|
|
13210
12961
|
exports.searchCategories = searchCategories;
|
|
13211
|
-
exports.searchInputMessages = messages$
|
|
12962
|
+
exports.searchInputMessages = messages$E;
|
|
13212
12963
|
exports.setDisplayName = setDisplayName;
|
|
13213
12964
|
exports.setToArray = setToArray;
|
|
13214
12965
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13254,7 +13005,7 @@ exports.validateNumber = validateFilter;
|
|
|
13254
13005
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13255
13006
|
exports.validateText = validateText;
|
|
13256
13007
|
exports.validatedInput = validatedInput;
|
|
13257
|
-
exports.validationMessages = messages$
|
|
13008
|
+
exports.validationMessages = messages$J;
|
|
13258
13009
|
exports.withPendingRequests = withPendingRequests;
|
|
13259
13010
|
exports.withProps = withProps;
|
|
13260
13011
|
exports.withRedirectTo = withRedirectTo;
|