@commercetools-frontend/experimental-components 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +692 -489
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +692 -489
- package/dist/commercetools-frontend-experimental-components.esm.js +685 -484
- package/dist/styles.css +251 -251
- package/package.json +18 -18
|
@@ -75,6 +75,7 @@ var sdk = require('@commercetools-frontend/sdk');
|
|
|
75
75
|
var client = require('@apollo/client');
|
|
76
76
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
77
77
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
78
|
+
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
78
79
|
var omit = require('lodash/omit');
|
|
79
80
|
var isEmpty$3 = require('lodash/isEmpty');
|
|
80
81
|
var _Object$freeze = require('@babel/runtime-corejs3/core-js-stable/object/freeze');
|
|
@@ -101,7 +102,6 @@ var _ = require('@commercetools-frontend/ui-kit/');
|
|
|
101
102
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
102
103
|
var memoize = require('memoize-one');
|
|
103
104
|
var utils = require('@commercetools-uikit/utils');
|
|
104
|
-
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
105
105
|
var flatMap = require('lodash/flatMap');
|
|
106
106
|
var reactRedux = require('react-redux');
|
|
107
107
|
var commonTags = require('common-tags');
|
|
@@ -162,6 +162,7 @@ var Textarea__default = /*#__PURE__*/_interopDefault(Textarea);
|
|
|
162
162
|
var has__default = /*#__PURE__*/_interopDefault(has);
|
|
163
163
|
var _reverseInstanceProperty__default = /*#__PURE__*/_interopDefault(_reverseInstanceProperty);
|
|
164
164
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
165
|
+
var _parseFloat__default = /*#__PURE__*/_interopDefault(_parseFloat);
|
|
165
166
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
166
167
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty$3);
|
|
167
168
|
var _Object$freeze__default = /*#__PURE__*/_interopDefault(_Object$freeze);
|
|
@@ -182,7 +183,6 @@ var times__default = /*#__PURE__*/_interopDefault(times);
|
|
|
182
183
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
183
184
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
184
185
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
185
|
-
var _parseFloat__default = /*#__PURE__*/_interopDefault(_parseFloat);
|
|
186
186
|
var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
|
|
187
187
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
188
188
|
var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
@@ -376,7 +376,7 @@ function uniqueObjects(items) {
|
|
|
376
376
|
|
|
377
377
|
*/
|
|
378
378
|
|
|
379
|
-
const messages$
|
|
379
|
+
const messages$K = reactIntl.defineMessages({
|
|
380
380
|
unique: {
|
|
381
381
|
id: 'Validation.unique',
|
|
382
382
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1671,8 +1671,8 @@ const getData = (code, field) => {
|
|
|
1671
1671
|
};
|
|
1672
1672
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1673
1673
|
|
|
1674
|
-
function ownKeys$
|
|
1675
|
-
function _objectSpread$
|
|
1674
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1675
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1k(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1676
1676
|
function formatMoneyRangeValue(value, intl) {
|
|
1677
1677
|
var _context;
|
|
1678
1678
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1682,7 +1682,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1682
1682
|
return '';
|
|
1683
1683
|
}
|
|
1684
1684
|
function formatMoneyValue(amount, currency, intl) {
|
|
1685
|
-
return formatMoney$1(_objectSpread$
|
|
1685
|
+
return formatMoney$1(_objectSpread$1k({
|
|
1686
1686
|
centAmount: amount,
|
|
1687
1687
|
fractionDigits: getFractionDigit(currency)
|
|
1688
1688
|
}, currency ? {
|
|
@@ -1699,14 +1699,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1699
1699
|
}
|
|
1700
1700
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1701
1701
|
var _moneyValue$fractione;
|
|
1702
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1702
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1k({
|
|
1703
1703
|
style: 'currency',
|
|
1704
1704
|
currency: moneyValue.currencyCode,
|
|
1705
1705
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1706
1706
|
}, options));
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
|
-
var messages$
|
|
1709
|
+
var messages$J = reactIntl.defineMessages({
|
|
1710
1710
|
booleanYes: {
|
|
1711
1711
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1712
1712
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1791,7 +1791,7 @@ const formatDateTime = _ref7 => {
|
|
|
1791
1791
|
const formatBoolean = _ref8 => {
|
|
1792
1792
|
let value = _ref8.value,
|
|
1793
1793
|
intl = _ref8.intl;
|
|
1794
|
-
return value ? intl.formatMessage(messages$
|
|
1794
|
+
return value ? intl.formatMessage(messages$J.booleanYes) : intl.formatMessage(messages$J.booleanNo);
|
|
1795
1795
|
};
|
|
1796
1796
|
const formatNilType = _ref9 => {
|
|
1797
1797
|
let value = _ref9.value,
|
|
@@ -1953,8 +1953,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1953
1953
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1954
1954
|
};
|
|
1955
1955
|
|
|
1956
|
-
function ownKeys$
|
|
1957
|
-
function _objectSpread$
|
|
1956
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1957
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1958
1958
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1959
1959
|
const WithDataTablePaginationState = props => {
|
|
1960
1960
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1965,10 +1965,10 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1965
1965
|
page = _usePaginationState.page,
|
|
1966
1966
|
perPage = _usePaginationState.perPage;
|
|
1967
1967
|
const tableSorting = uiKit.useDataTableSortingState({
|
|
1968
|
-
key: initialValues === null || initialValues === void 0
|
|
1969
|
-
order: initialValues === null || initialValues === void 0
|
|
1968
|
+
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1969
|
+
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1970
1970
|
});
|
|
1971
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1971
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1972
1972
|
dataTablePaginationState: {
|
|
1973
1973
|
page,
|
|
1974
1974
|
perPage,
|
|
@@ -1980,8 +1980,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1980
1980
|
return WithDataTablePaginationState;
|
|
1981
1981
|
};
|
|
1982
1982
|
|
|
1983
|
-
function ownKeys$
|
|
1984
|
-
function _objectSpread$
|
|
1983
|
+
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; }
|
|
1984
|
+
function _objectSpread$1i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1985
1985
|
const injectNotifications = function () {
|
|
1986
1986
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1987
1987
|
return Component => {
|
|
@@ -1996,7 +1996,7 @@ const injectNotifications = function () {
|
|
|
1996
1996
|
onActionError,
|
|
1997
1997
|
hideAllPageNotifications
|
|
1998
1998
|
};
|
|
1999
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1999
|
+
return jsxRuntime.jsx(Component, _objectSpread$1i(_objectSpread$1i({}, props), {}, {
|
|
2000
2000
|
[propName]: notifications
|
|
2001
2001
|
}));
|
|
2002
2002
|
};
|
|
@@ -2005,22 +2005,22 @@ const injectNotifications = function () {
|
|
|
2005
2005
|
};
|
|
2006
2006
|
};
|
|
2007
2007
|
|
|
2008
|
-
function ownKeys$
|
|
2009
|
-
function _objectSpread$
|
|
2008
|
+
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; }
|
|
2009
|
+
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; }
|
|
2010
2010
|
function isPropsMapper(mapProps) {
|
|
2011
2011
|
return typeof mapProps === 'function';
|
|
2012
2012
|
}
|
|
2013
2013
|
const withProps = mapProps => Component => {
|
|
2014
2014
|
const EnhancedWithProps = ownProps => {
|
|
2015
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2016
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2015
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps(ownProps)) : _objectSpread$1h(_objectSpread$1h({}, ownProps), mapProps);
|
|
2016
|
+
return jsxRuntime.jsx(Component, _objectSpread$1h({}, enhancedProps));
|
|
2017
2017
|
};
|
|
2018
2018
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2019
2019
|
return EnhancedWithProps;
|
|
2020
2020
|
};
|
|
2021
2021
|
|
|
2022
|
-
function ownKeys$
|
|
2023
|
-
function _objectSpread$
|
|
2022
|
+
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; }
|
|
2023
|
+
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; }
|
|
2024
2024
|
const useRedirectEffect = _ref => {
|
|
2025
2025
|
let goTo = _ref.goTo;
|
|
2026
2026
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2040,30 +2040,30 @@ const defaultOptions$5 = {
|
|
|
2040
2040
|
skip: () => false
|
|
2041
2041
|
};
|
|
2042
2042
|
const withRedirectTo = options => Component => {
|
|
2043
|
-
const mergedOptions = _objectSpread$
|
|
2043
|
+
const mergedOptions = _objectSpread$1g(_objectSpread$1g({}, defaultOptions$5), options);
|
|
2044
2044
|
const WithRedirectTo = props => {
|
|
2045
2045
|
if (!mergedOptions.skip(props)) {
|
|
2046
2046
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2047
2047
|
goTo: options.selectGoTo(props)
|
|
2048
2048
|
});
|
|
2049
2049
|
}
|
|
2050
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2050
|
+
return jsxRuntime.jsx(Component, _objectSpread$1g({}, props));
|
|
2051
2051
|
};
|
|
2052
2052
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2053
2053
|
return WithRedirectTo;
|
|
2054
2054
|
};
|
|
2055
2055
|
|
|
2056
|
-
function ownKeys$
|
|
2057
|
-
function _objectSpread$
|
|
2056
|
+
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; }
|
|
2057
|
+
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; }
|
|
2058
2058
|
const defaultOptions$4 = {
|
|
2059
2059
|
propName: 'modalState',
|
|
2060
2060
|
isInitiallyOpen: false
|
|
2061
2061
|
};
|
|
2062
2062
|
const injectModalState$1 = options => Component => {
|
|
2063
|
-
const mergedOptions = _objectSpread$
|
|
2063
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions$4), options);
|
|
2064
2064
|
const WithModalState = props => {
|
|
2065
2065
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2066
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2066
|
+
return jsxRuntime.jsx(Component, _objectSpread$1f(_objectSpread$1f({}, props), {}, {
|
|
2067
2067
|
[mergedOptions.propName]: modalState
|
|
2068
2068
|
}));
|
|
2069
2069
|
};
|
|
@@ -2071,17 +2071,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2071
2071
|
return WithModalState;
|
|
2072
2072
|
};
|
|
2073
2073
|
|
|
2074
|
-
function ownKeys$
|
|
2075
|
-
function _objectSpread$
|
|
2074
|
+
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; }
|
|
2075
|
+
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; }
|
|
2076
2076
|
const defaultOptions$3 = {
|
|
2077
2077
|
propName: 'toggleState',
|
|
2078
2078
|
isInitiallyOpen: false
|
|
2079
2079
|
};
|
|
2080
2080
|
const injectModalState = options => Component => {
|
|
2081
|
-
const mergedOptions = _objectSpread$
|
|
2081
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$3), options);
|
|
2082
2082
|
const WithToggleState = props => {
|
|
2083
2083
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2084
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2084
|
+
return jsxRuntime.jsx(Component, _objectSpread$1e(_objectSpread$1e({}, props), {}, {
|
|
2085
2085
|
[mergedOptions.propName]: toggleState
|
|
2086
2086
|
}));
|
|
2087
2087
|
};
|
|
@@ -2089,8 +2089,8 @@ const injectModalState = options => Component => {
|
|
|
2089
2089
|
return WithToggleState;
|
|
2090
2090
|
};
|
|
2091
2091
|
|
|
2092
|
-
function ownKeys$
|
|
2093
|
-
function _objectSpread$
|
|
2092
|
+
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; }
|
|
2093
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2094
2094
|
const defaultOptions$2 = {
|
|
2095
2095
|
storageType: 'local',
|
|
2096
2096
|
segregateByUser: true
|
|
@@ -2108,7 +2108,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2108
2108
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2109
2109
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2110
2110
|
var _context;
|
|
2111
|
-
const mergedOptions = _objectSpread$
|
|
2111
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$2), options);
|
|
2112
2112
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2113
2113
|
var _context$user;
|
|
2114
2114
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2156,8 +2156,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2156
2156
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2157
2157
|
};
|
|
2158
2158
|
|
|
2159
|
-
function ownKeys$
|
|
2160
|
-
function _objectSpread$
|
|
2159
|
+
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; }
|
|
2160
|
+
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; }
|
|
2161
2161
|
const defaultOptions$1 = {
|
|
2162
2162
|
propName: 'storage',
|
|
2163
2163
|
storageKey: '',
|
|
@@ -2170,7 +2170,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2170
2170
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2171
2171
|
* argument position does not allow passing specification of option(s).
|
|
2172
2172
|
*/
|
|
2173
|
-
const mergedOptions = _objectSpread$
|
|
2173
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$1), options);
|
|
2174
2174
|
const WithStorage = props => {
|
|
2175
2175
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2176
2176
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2184,7 +2184,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2184
2184
|
readFromStorage
|
|
2185
2185
|
}
|
|
2186
2186
|
};
|
|
2187
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2187
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1c(_objectSpread$1c({}, props), storageProp));
|
|
2188
2188
|
};
|
|
2189
2189
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2190
2190
|
return WithStorage;
|
|
@@ -2228,8 +2228,8 @@ const usePrevious = value => {
|
|
|
2228
2228
|
return ref.current;
|
|
2229
2229
|
};
|
|
2230
2230
|
|
|
2231
|
-
function ownKeys$
|
|
2232
|
-
function _objectSpread$
|
|
2231
|
+
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; }
|
|
2232
|
+
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; }
|
|
2233
2233
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "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
2234
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2235
2235
|
var _storesQueryResult$re;
|
|
@@ -2240,7 +2240,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2240
2240
|
offset: storesQueryResult.offset,
|
|
2241
2241
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2242
2242
|
var _store$productSelecti;
|
|
2243
|
-
return _objectSpread$
|
|
2243
|
+
return _objectSpread$1b(_objectSpread$1b({}, store), {}, {
|
|
2244
2244
|
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
2245
|
});
|
|
2246
2246
|
})
|
|
@@ -2248,7 +2248,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2248
2248
|
};
|
|
2249
2249
|
const createQueryVariables$6 = ownProps => {
|
|
2250
2250
|
var _context;
|
|
2251
|
-
return _objectSpread$
|
|
2251
|
+
return _objectSpread$1b(_objectSpread$1b({
|
|
2252
2252
|
limit: ownProps.limit,
|
|
2253
2253
|
offset: ownProps.offset,
|
|
2254
2254
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2403,8 +2403,8 @@ function useDidFormValidationFail() {
|
|
|
2403
2403
|
return Boolean(didFormValidationFail);
|
|
2404
2404
|
}
|
|
2405
2405
|
|
|
2406
|
-
function ownKeys$
|
|
2407
|
-
function _objectSpread$
|
|
2406
|
+
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; }
|
|
2407
|
+
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; }
|
|
2408
2408
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2409
2409
|
const defaultOptions = {
|
|
2410
2410
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2432,7 +2432,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2432
2432
|
};
|
|
2433
2433
|
const usePersistedReminder = function () {
|
|
2434
2434
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2435
|
-
const mergedOptions = _objectSpread$
|
|
2435
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions), options);
|
|
2436
2436
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2437
2437
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2438
2438
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2478,7 +2478,7 @@ const usePersistedReminder = function () {
|
|
|
2478
2478
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2479
2479
|
};
|
|
2480
2480
|
|
|
2481
|
-
var messages$
|
|
2481
|
+
var messages$I = reactIntl.defineMessages({
|
|
2482
2482
|
profileUpdated: {
|
|
2483
2483
|
id: 'NotificationText.profileUpdated',
|
|
2484
2484
|
description: 'Label for the notification header',
|
|
@@ -2496,8 +2496,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2496
2496
|
}
|
|
2497
2497
|
});
|
|
2498
2498
|
|
|
2499
|
-
function ownKeys$
|
|
2500
|
-
function _objectSpread$
|
|
2499
|
+
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; }
|
|
2500
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2501
2501
|
const LinkToProfile = props => {
|
|
2502
2502
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2503
2503
|
to: "/account/profile",
|
|
@@ -2515,9 +2515,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2515
2515
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2516
2516
|
as: "p",
|
|
2517
2517
|
isBold: true,
|
|
2518
|
-
intlMessage: messages$
|
|
2518
|
+
intlMessage: messages$I.profileUpdated
|
|
2519
2519
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2520
|
-
intlMessage: _objectSpread$
|
|
2520
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.addMoreInformation), {}, {
|
|
2521
2521
|
values: {
|
|
2522
2522
|
newline: getNewLine
|
|
2523
2523
|
}
|
|
@@ -2526,7 +2526,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2526
2526
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2527
2527
|
scale: "xs",
|
|
2528
2528
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2529
|
-
intlMessage: _objectSpread$
|
|
2529
|
+
intlMessage: _objectSpread$19(_objectSpread$19({}, messages$I.informationAndProfileLink), {}, {
|
|
2530
2530
|
values: {
|
|
2531
2531
|
newline: getNewLine,
|
|
2532
2532
|
link: getLinkToProfile
|
|
@@ -2647,7 +2647,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2647
2647
|
}, [ref]);
|
|
2648
2648
|
};
|
|
2649
2649
|
|
|
2650
|
-
var messages$
|
|
2650
|
+
var messages$H = reactIntl.defineMessages({
|
|
2651
2651
|
fallbackHint: {
|
|
2652
2652
|
id: 'KeyFallback.fallbackHint',
|
|
2653
2653
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2671,7 +2671,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2671
2671
|
return values => {
|
|
2672
2672
|
if (!values.resource) return null;
|
|
2673
2673
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2674
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2674
|
+
const fallbackHintWithKey = intl.formatMessage(messages$H.fallbackHint, {
|
|
2675
2675
|
key: values.resource.key
|
|
2676
2676
|
});
|
|
2677
2677
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2683,8 +2683,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2683
2683
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2684
2684
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2685
2685
|
|
|
2686
|
-
function ownKeys$
|
|
2687
|
-
function _objectSpread$
|
|
2686
|
+
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; }
|
|
2687
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$18(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2688
2688
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2689
2689
|
const updatedColumnProps = {};
|
|
2690
2690
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2704,14 +2704,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2704
2704
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2705
2705
|
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
2706
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2707
|
-
return _objectSpread$
|
|
2707
|
+
return _objectSpread$18(_objectSpread$18({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2708
2708
|
});
|
|
2709
2709
|
};
|
|
2710
2710
|
const handleCacheUpdate = _ref2 => {
|
|
2711
2711
|
let update = _ref2.update,
|
|
2712
2712
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2713
2713
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2714
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2714
|
+
return updateCachedTableConfiguration(_objectSpread$18(_objectSpread$18({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2715
2715
|
};
|
|
2716
2716
|
|
|
2717
2717
|
// Signature:
|
|
@@ -2740,7 +2740,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2740
2740
|
return {
|
|
2741
2741
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2742
2742
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2743
|
-
return _objectSpread$
|
|
2743
|
+
return _objectSpread$18({
|
|
2744
2744
|
key: visibleColumnKey
|
|
2745
2745
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2746
2746
|
}),
|
|
@@ -2796,7 +2796,7 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2796
2796
|
data = _useQuery.data;
|
|
2797
2797
|
return {
|
|
2798
2798
|
isLoading: loading,
|
|
2799
|
-
total: data === null || data === void 0
|
|
2799
|
+
total: data === null || data === void 0 || (_data$productSelectio = data.productSelections) === null || _data$productSelectio === void 0 ? void 0 : _data$productSelectio.total
|
|
2800
2800
|
};
|
|
2801
2801
|
};
|
|
2802
2802
|
|
|
@@ -2811,14 +2811,14 @@ const handlers$4 = {
|
|
|
2811
2811
|
}
|
|
2812
2812
|
};
|
|
2813
2813
|
|
|
2814
|
-
function ownKeys$
|
|
2815
|
-
function _objectSpread$
|
|
2814
|
+
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; }
|
|
2815
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$17(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2816
2816
|
|
|
2817
2817
|
// eslint-disable-next-line import/prefer-default-export
|
|
2818
2818
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2819
2819
|
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$
|
|
2820
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$17(_objectSpread$17({}, productSelections), {}, {
|
|
2821
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$17({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2822
2822
|
from: 'nameAllLocales',
|
|
2823
2823
|
to: 'name'
|
|
2824
2824
|
}])))
|
|
@@ -2968,7 +2968,7 @@ const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
|
2968
2968
|
});
|
|
2969
2969
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2970
2970
|
|
|
2971
|
-
var messages$
|
|
2971
|
+
var messages$G = reactIntl.defineMessages({
|
|
2972
2972
|
noChannelsFound: {
|
|
2973
2973
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2974
2974
|
description: 'The message to display when no channels were found',
|
|
@@ -2994,8 +2994,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2994
2994
|
}
|
|
2995
2995
|
});
|
|
2996
2996
|
|
|
2997
|
-
function ownKeys$
|
|
2998
|
-
function _objectSpread$
|
|
2997
|
+
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; }
|
|
2998
|
+
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; }
|
|
2999
2999
|
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
3000
|
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
3001
|
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 +3016,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3016
3016
|
const _useIntl = reactIntl.useIntl(),
|
|
3017
3017
|
formatMessage = _useIntl.formatMessage;
|
|
3018
3018
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3019
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3019
|
+
const variables = React.useMemo(() => _objectSpread$16({
|
|
3020
3020
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3021
3021
|
}, role && {
|
|
3022
3022
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3077,8 +3077,8 @@ const ChannelPickerInput = _ref => {
|
|
|
3077
3077
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3078
3078
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3079
3079
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3080
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3081
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3080
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$G.noChannelsFound), [loadingError, formatMessage]);
|
|
3081
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3082
3082
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3083
3083
|
max: "scale",
|
|
3084
3084
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3088,7 +3088,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3088
3088
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3089
3089
|
id: name,
|
|
3090
3090
|
name: name,
|
|
3091
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3091
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$G.placeholder),
|
|
3092
3092
|
loadOptions: loadOptionsDebounced,
|
|
3093
3093
|
defaultOptions: true,
|
|
3094
3094
|
showOptionGroupDivider: true,
|
|
@@ -3131,7 +3131,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
3131
3131
|
var _this$props;
|
|
3132
3132
|
let user = _ref.user;
|
|
3133
3133
|
return formatDateTime$1(this.props.type, this.props.value, {
|
|
3134
|
-
timeZone: (this === null || this === void 0
|
|
3134
|
+
timeZone: (this === null || this === void 0 || (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.timeZone) || (user === null || user === void 0 ? void 0 : user.timeZone),
|
|
3135
3135
|
locale: this.props.intl.locale
|
|
3136
3136
|
});
|
|
3137
3137
|
}
|
|
@@ -3145,8 +3145,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3145
3145
|
|
|
3146
3146
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3147
3147
|
|
|
3148
|
-
function ownKeys$
|
|
3149
|
-
function _objectSpread$
|
|
3148
|
+
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; }
|
|
3149
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$15(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$15(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3150
3150
|
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
3151
|
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
3152
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3178,7 +3178,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3178
3178
|
handleMouseOver: this.handleMouseOver,
|
|
3179
3179
|
handleMouseOut: this.handleMouseOut
|
|
3180
3180
|
};
|
|
3181
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3181
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$15({}, _objectSpread$15(_objectSpread$15({}, this.props), injectedProps)));
|
|
3182
3182
|
}
|
|
3183
3183
|
}]);
|
|
3184
3184
|
return WithMouseOverState;
|
|
@@ -3187,8 +3187,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3187
3187
|
return WithMouseOverState;
|
|
3188
3188
|
};
|
|
3189
3189
|
|
|
3190
|
-
function ownKeys$
|
|
3191
|
-
function _objectSpread$
|
|
3190
|
+
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; }
|
|
3191
|
+
function _objectSpread$14(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$14(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3192
3192
|
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
3193
|
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
3194
|
var styles$h = {
|
|
@@ -3299,7 +3299,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3299
3299
|
}, {
|
|
3300
3300
|
key: "render",
|
|
3301
3301
|
value: function render() {
|
|
3302
|
-
const commonProps = _objectSpread$
|
|
3302
|
+
const commonProps = _objectSpread$14(_objectSpread$14({
|
|
3303
3303
|
value: this.state.draftValue,
|
|
3304
3304
|
autoComplete: this.props.autoComplete,
|
|
3305
3305
|
onChange: this.handleChange,
|
|
@@ -3318,7 +3318,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3318
3318
|
htmlFor: inputId,
|
|
3319
3319
|
children: this.props.label
|
|
3320
3320
|
})
|
|
3321
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3321
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3322
3322
|
id: inputId,
|
|
3323
3323
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3324
3324
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3327,7 +3327,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3327
3327
|
rows: 1,
|
|
3328
3328
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3329
3329
|
cacheMeasurements: true
|
|
3330
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3330
|
+
})) : jsxRuntime.jsx("input", _objectSpread$14(_objectSpread$14({}, commonProps), {}, {
|
|
3331
3331
|
id: inputId,
|
|
3332
3332
|
ref: this.props.inputRef,
|
|
3333
3333
|
type: this.props.as,
|
|
@@ -3354,7 +3354,7 @@ ThrottledField.defaultProps = {
|
|
|
3354
3354
|
label: 'Throttled field'
|
|
3355
3355
|
};
|
|
3356
3356
|
|
|
3357
|
-
var messages$
|
|
3357
|
+
var messages$F = reactIntl.defineMessages({
|
|
3358
3358
|
buttonLabel: {
|
|
3359
3359
|
id: 'SearchInput.buttonLabel',
|
|
3360
3360
|
description: 'Label for "Search" button.',
|
|
@@ -3461,7 +3461,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3461
3461
|
"data-testid": this.props.testId || 'search-input',
|
|
3462
3462
|
value: this.state.text,
|
|
3463
3463
|
label: this.props.label,
|
|
3464
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3464
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$F.placeholder),
|
|
3465
3465
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3466
3466
|
onChange: this.handleInputChange,
|
|
3467
3467
|
onEnter: this.handleEnter,
|
|
@@ -3554,7 +3554,7 @@ const useFetchProductTypesFromPIM = _ref => {
|
|
|
3554
3554
|
const fetchProductTypesFromPim = React.useCallback(async searchTerm => {
|
|
3555
3555
|
var _result$hits$map, _result$hits;
|
|
3556
3556
|
const result = await dispatch(createSearchProductsFromPIMAction(searchTerm, projectKey));
|
|
3557
|
-
const ids = (_result$hits$map = result === null || result === void 0
|
|
3557
|
+
const ids = (_result$hits$map = result === null || result === void 0 || (_result$hits = result.hits) === null || _result$hits === void 0 ? void 0 : _mapInstanceProperty__default["default"](_result$hits).call(_result$hits, hit => hit.id)) !== null && _result$hits$map !== void 0 ? _result$hits$map : [];
|
|
3558
3558
|
// Avoid sending any requests if it's clear that nothing is found
|
|
3559
3559
|
if (ids.length === 0) {
|
|
3560
3560
|
return {
|
|
@@ -3637,7 +3637,7 @@ const useFetchProductTypessFromCTP = _ref2 => {
|
|
|
3637
3637
|
}, [prefixSearchFields, executeGraphQLRequest]);
|
|
3638
3638
|
};
|
|
3639
3639
|
const usePimStatus = () => {
|
|
3640
|
-
var _data$indicesExist
|
|
3640
|
+
var _data$indicesExist;
|
|
3641
3641
|
const _useQuery = react.useQuery(FetchIndicesExist$1, {
|
|
3642
3642
|
context: {
|
|
3643
3643
|
target: constants.GRAPHQL_TARGETS.PIM_INDEXER
|
|
@@ -3647,7 +3647,7 @@ const usePimStatus = () => {
|
|
|
3647
3647
|
data = _useQuery.data;
|
|
3648
3648
|
return {
|
|
3649
3649
|
data,
|
|
3650
|
-
isProjectIndexed: Boolean(data === null || data === void 0
|
|
3650
|
+
isProjectIndexed: Boolean(data === null || data === void 0 || (_data$indicesExist = data.indicesExist) === null || _data$indicesExist === void 0 || (_data$indicesExist = _data$indicesExist.productTypes) === null || _data$indicesExist === void 0 ? void 0 : _data$indicesExist.searchableIndexExists)
|
|
3651
3651
|
};
|
|
3652
3652
|
};
|
|
3653
3653
|
const useProductTypeOptions = _ref3 => {
|
|
@@ -3676,7 +3676,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3676
3676
|
};
|
|
3677
3677
|
};
|
|
3678
3678
|
|
|
3679
|
-
var messages$
|
|
3679
|
+
var messages$E = reactIntl.defineMessages({
|
|
3680
3680
|
bottomOption: {
|
|
3681
3681
|
id: 'Products.Pickers.bottomOption',
|
|
3682
3682
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3684,11 +3684,11 @@ var messages$D = reactIntl.defineMessages({
|
|
|
3684
3684
|
}
|
|
3685
3685
|
});
|
|
3686
3686
|
|
|
3687
|
-
function ownKeys$
|
|
3688
|
-
function _objectSpread$
|
|
3689
|
-
const getBottomOption =
|
|
3687
|
+
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; }
|
|
3688
|
+
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; }
|
|
3689
|
+
const getBottomOption = formatMessage => ({
|
|
3690
3690
|
options: [{
|
|
3691
|
-
label: messages$
|
|
3691
|
+
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
3692
3692
|
isBottomOption: true,
|
|
3693
3693
|
isDisabled: true
|
|
3694
3694
|
}]
|
|
@@ -3696,7 +3696,7 @@ const getBottomOption = () => ({
|
|
|
3696
3696
|
const Option$2 = props => {
|
|
3697
3697
|
const _useIntl = reactIntl.useIntl(),
|
|
3698
3698
|
formatMessage = _useIntl.formatMessage;
|
|
3699
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3699
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$13(_objectSpread$13({}, props), {}, {
|
|
3700
3700
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3701
3701
|
tone: "secondary",
|
|
3702
3702
|
children: formatMessage(props.data.label)
|
|
@@ -3713,8 +3713,8 @@ const Option$2 = props => {
|
|
|
3713
3713
|
};
|
|
3714
3714
|
Option$2.displayName = 'Option';
|
|
3715
3715
|
|
|
3716
|
-
function ownKeys$
|
|
3717
|
-
function _objectSpread$
|
|
3716
|
+
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; }
|
|
3717
|
+
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; }
|
|
3718
3718
|
const useHandlers = onChange => {
|
|
3719
3719
|
const _useState = React.useState(),
|
|
3720
3720
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3725,8 +3725,8 @@ const useHandlers = onChange => {
|
|
|
3725
3725
|
}, []);
|
|
3726
3726
|
const handleChange = useEventCallback(event => {
|
|
3727
3727
|
var _event$target$value;
|
|
3728
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3729
|
-
target: _objectSpread$
|
|
3728
|
+
const eventWithExtractedValue = _objectSpread$12(_objectSpread$12({}, event), {}, {
|
|
3729
|
+
target: _objectSpread$12(_objectSpread$12({}, event.target), {}, {
|
|
3730
3730
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3731
3731
|
})
|
|
3732
3732
|
});
|
|
@@ -3735,8 +3735,8 @@ const useHandlers = onChange => {
|
|
|
3735
3735
|
return [handleInputChange, handleChange];
|
|
3736
3736
|
};
|
|
3737
3737
|
|
|
3738
|
-
function ownKeys
|
|
3739
|
-
function _objectSpread
|
|
3738
|
+
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; }
|
|
3739
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$11(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$11(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3740
3740
|
const constructPrefixSearchPredicate = function () {
|
|
3741
3741
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3742
3742
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3779,7 +3779,7 @@ const useLoadOptions = _ref => {
|
|
|
3779
3779
|
}();
|
|
3780
3780
|
return client$1.query({
|
|
3781
3781
|
query,
|
|
3782
|
-
variables: _objectSpread
|
|
3782
|
+
variables: _objectSpread$11({
|
|
3783
3783
|
where
|
|
3784
3784
|
}, variables),
|
|
3785
3785
|
context: {
|
|
@@ -3833,7 +3833,7 @@ function useCurrentOption(_ref) {
|
|
|
3833
3833
|
};
|
|
3834
3834
|
}
|
|
3835
3835
|
|
|
3836
|
-
var messages$
|
|
3836
|
+
var messages$D = reactIntl.defineMessages({
|
|
3837
3837
|
noProductTypesFound: {
|
|
3838
3838
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3839
3839
|
description: 'The message to display when no product types were found',
|
|
@@ -3913,7 +3913,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3913
3913
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3914
3914
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3915
3915
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3916
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
3916
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3917
3917
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3918
3918
|
max: "scale",
|
|
3919
3919
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3923,7 +3923,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3923
3923
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
3924
3924
|
id: name,
|
|
3925
3925
|
name: name,
|
|
3926
|
-
placeholder: formatMessage(messages$
|
|
3926
|
+
placeholder: formatMessage(messages$D.placeholder),
|
|
3927
3927
|
loadOptions: loadOptionsDebounced,
|
|
3928
3928
|
defaultOptions: [],
|
|
3929
3929
|
isClearable: isClearable,
|
|
@@ -3936,7 +3936,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3936
3936
|
onInputChange: handleInputChange,
|
|
3937
3937
|
onBlur: onBlur,
|
|
3938
3938
|
value: currentOption.data,
|
|
3939
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3939
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$D.noProductTypesFound),
|
|
3940
3940
|
hasError: hasError || isLoadingFailed
|
|
3941
3941
|
})
|
|
3942
3942
|
}), isLoadingFailed && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -3948,7 +3948,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3948
3948
|
};
|
|
3949
3949
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3950
3950
|
|
|
3951
|
-
var messages$
|
|
3951
|
+
var messages$C = reactIntl.defineMessages({
|
|
3952
3952
|
noStatesFound: {
|
|
3953
3953
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3954
3954
|
description: 'The message to display when no states were found',
|
|
@@ -4032,8 +4032,8 @@ const StatePickerInput = _ref => {
|
|
|
4032
4032
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
4033
4033
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
4034
4034
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
4035
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
4036
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
4035
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noStatesFound), [loadingError, formatMessage]);
|
|
4036
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
4037
4037
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
4038
4038
|
max: "scale",
|
|
4039
4039
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -4044,7 +4044,7 @@ const StatePickerInput = _ref => {
|
|
|
4044
4044
|
id: name,
|
|
4045
4045
|
name: name,
|
|
4046
4046
|
horizontalConstraint: "scale",
|
|
4047
|
-
placeholder: formatMessage(messages$
|
|
4047
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
4048
4048
|
loadOptions: loadOptionsDebounced,
|
|
4049
4049
|
defaultOptions: true,
|
|
4050
4050
|
showOptionGroupDivider: true,
|
|
@@ -4070,9 +4070,9 @@ const StatePickerInput = _ref => {
|
|
|
4070
4070
|
};
|
|
4071
4071
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4072
4072
|
|
|
4073
|
-
function ownKeys$
|
|
4074
|
-
function _objectSpread$
|
|
4075
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4073
|
+
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; }
|
|
4074
|
+
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; }
|
|
4075
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$10({
|
|
4076
4076
|
ref: ref,
|
|
4077
4077
|
style: {
|
|
4078
4078
|
display: 'block',
|
|
@@ -4210,8 +4210,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4210
4210
|
};
|
|
4211
4211
|
|
|
4212
4212
|
const _excluded = ["action"];
|
|
4213
|
-
function ownKeys
|
|
4214
|
-
function _objectSpread
|
|
4213
|
+
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; }
|
|
4214
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$$(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$$(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4215
4215
|
|
|
4216
4216
|
/**
|
|
4217
4217
|
* Checks if a value is a LocalizedString
|
|
@@ -4233,7 +4233,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4233
4233
|
*/
|
|
4234
4234
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4235
4235
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4236
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4236
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$$(_objectSpread$$({}, customFields), {}, {
|
|
4237
4237
|
[customField.name]: customField.value
|
|
4238
4238
|
}), {});
|
|
4239
4239
|
};
|
|
@@ -4257,7 +4257,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4257
4257
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4258
4258
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4259
4259
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4260
|
-
return _objectSpread
|
|
4260
|
+
return _objectSpread$$(_objectSpread$$(_objectSpread$$({}, transformedData), parent ? {
|
|
4261
4261
|
parent
|
|
4262
4262
|
} : {}), ancestors ? {
|
|
4263
4263
|
ancestors
|
|
@@ -4368,7 +4368,7 @@ const convertChangeValueAction = actionPayload => {
|
|
|
4368
4368
|
* as its dynamic content can not be typed in SDL for the mutation.
|
|
4369
4369
|
*/
|
|
4370
4370
|
const convertAction = (actionName, actionPayload) => {
|
|
4371
|
-
var _actionPayload$type, _context3, _actionPayload$shippi, _context4, _context5;
|
|
4371
|
+
var _actionPayload$type, _context3, _actionPayload$geoLoc, _actionPayload$geoLoc2, _actionPayload$shippi, _context4, _context5;
|
|
4372
4372
|
const getNameFromPayload = payload => {
|
|
4373
4373
|
// changeName for `Organizations`
|
|
4374
4374
|
if (typeof payload.name === 'string') return payload;
|
|
@@ -4454,6 +4454,17 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4454
4454
|
}
|
|
4455
4455
|
}
|
|
4456
4456
|
};
|
|
4457
|
+
case 'setGeoLocation':
|
|
4458
|
+
return {
|
|
4459
|
+
[actionName]: actionPayload !== null && actionPayload !== void 0 && actionPayload.geoLocation ? {
|
|
4460
|
+
geoLocation: {
|
|
4461
|
+
type: 'Point',
|
|
4462
|
+
coordinates: [_parseFloat__default["default"]((_actionPayload$geoLoc = actionPayload.geoLocation) === null || _actionPayload$geoLoc === void 0 ? void 0 : _actionPayload$geoLoc.longitude), _parseFloat__default["default"]((_actionPayload$geoLoc2 = actionPayload.geoLocation) === null || _actionPayload$geoLoc2 === void 0 ? void 0 : _actionPayload$geoLoc2.latitude)]
|
|
4463
|
+
}
|
|
4464
|
+
} : {
|
|
4465
|
+
undefined
|
|
4466
|
+
}
|
|
4467
|
+
};
|
|
4457
4468
|
case 'changeLabel':
|
|
4458
4469
|
return {
|
|
4459
4470
|
changeLabel: {
|
|
@@ -4471,7 +4482,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4471
4482
|
case 'addAttributeDefinition':
|
|
4472
4483
|
return {
|
|
4473
4484
|
[actionName]: {
|
|
4474
|
-
attributeDefinition: _objectSpread
|
|
4485
|
+
attributeDefinition: _objectSpread$$(_objectSpread$$({}, actionPayload.attribute), {}, {
|
|
4475
4486
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4476
4487
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4477
4488
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4567,7 +4578,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4567
4578
|
return {
|
|
4568
4579
|
[actionName]: {
|
|
4569
4580
|
attributeName: actionPayload.attributeName,
|
|
4570
|
-
value: _objectSpread
|
|
4581
|
+
value: _objectSpread$$(_objectSpread$$({}, actionPayload.value), {}, {
|
|
4571
4582
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4572
4583
|
})
|
|
4573
4584
|
}
|
|
@@ -4576,7 +4587,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4576
4587
|
return {
|
|
4577
4588
|
[actionName]: {
|
|
4578
4589
|
attributeName: actionPayload.attributeName,
|
|
4579
|
-
newValue: _objectSpread
|
|
4590
|
+
newValue: _objectSpread$$(_objectSpread$$({}, actionPayload.newValue), {}, {
|
|
4580
4591
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4581
4592
|
})
|
|
4582
4593
|
}
|
|
@@ -4603,7 +4614,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4603
4614
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4604
4615
|
taxCategory: actionPayload.taxCategory,
|
|
4605
4616
|
money: {
|
|
4606
|
-
[actionPayload.money.type]: _objectSpread
|
|
4617
|
+
[actionPayload.money.type]: _objectSpread$$({
|
|
4607
4618
|
centAmount: actionPayload.money.centAmount,
|
|
4608
4619
|
currencyCode: actionPayload.money.currencyCode
|
|
4609
4620
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4638,7 +4649,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4638
4649
|
case 'addAddress':
|
|
4639
4650
|
case 'changeAddress':
|
|
4640
4651
|
{
|
|
4641
|
-
var _actionPayload$addres, _context6, _actionPayload$addres2
|
|
4652
|
+
var _actionPayload$addres, _context6, _actionPayload$addres2;
|
|
4642
4653
|
const _ref3 = ((_actionPayload$addres = actionPayload.address) === null || _actionPayload$addres === void 0 ? void 0 : _actionPayload$addres.custom) || {},
|
|
4643
4654
|
_ref3$fields = _ref3.fields,
|
|
4644
4655
|
fields = _ref3$fields === void 0 ? {} : _ref3$fields;
|
|
@@ -4651,15 +4662,15 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4651
4662
|
value: _JSON$stringify__default["default"](value)
|
|
4652
4663
|
};
|
|
4653
4664
|
});
|
|
4654
|
-
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$
|
|
4665
|
+
const custom = (_actionPayload$addres2 = actionPayload.address) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.custom) !== null && _actionPayload$addres2 !== void 0 && (_actionPayload$addres2 = _actionPayload$addres2.type) !== null && _actionPayload$addres2 !== void 0 && _actionPayload$addres2.id ? {
|
|
4655
4666
|
type: {
|
|
4656
4667
|
id: actionPayload.address.custom.type.id
|
|
4657
4668
|
},
|
|
4658
4669
|
fields: customFields
|
|
4659
4670
|
} : null;
|
|
4660
4671
|
return {
|
|
4661
|
-
[actionName]: _objectSpread
|
|
4662
|
-
address: _objectSpread
|
|
4672
|
+
[actionName]: _objectSpread$$(_objectSpread$$({}, actionPayload), {}, {
|
|
4673
|
+
address: _objectSpread$$(_objectSpread$$({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4663
4674
|
custom
|
|
4664
4675
|
})
|
|
4665
4676
|
})
|
|
@@ -4705,8 +4716,8 @@ const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["
|
|
|
4705
4716
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4706
4717
|
}, []);
|
|
4707
4718
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
4708
|
-
var _graphQlResponse$netw, _graphQlResponse$
|
|
4709
|
-
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0
|
|
4719
|
+
var _graphQlResponse$netw, _graphQlResponse$grap;
|
|
4720
|
+
if (((_graphQlResponse$netw = graphQlResponse.networkError) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.result) === null || _graphQlResponse$netw === void 0 || (_graphQlResponse$netw = _graphQlResponse$netw.errors) === null || _graphQlResponse$netw === void 0 ? void 0 : _graphQlResponse$netw.length) > 0) {
|
|
4710
4721
|
return graphQlResponse.networkError.result.errors;
|
|
4711
4722
|
}
|
|
4712
4723
|
if (((_graphQlResponse$grap = graphQlResponse.graphQLErrors) === null || _graphQlResponse$grap === void 0 ? void 0 : _graphQlResponse$grap.length) > 0) {
|
|
@@ -4735,26 +4746,26 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4735
4746
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4736
4747
|
}
|
|
4737
4748
|
|
|
4738
|
-
function ownKeys$
|
|
4739
|
-
function _objectSpread$
|
|
4749
|
+
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; }
|
|
4750
|
+
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; }
|
|
4740
4751
|
function getPriceChannelName(price) {
|
|
4741
4752
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4742
4753
|
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;
|
|
4743
4754
|
}
|
|
4744
4755
|
function getDiscountValue(price) {
|
|
4745
|
-
var _price$value, _price$value2, _price$discounted
|
|
4756
|
+
var _price$value, _price$value2, _price$discounted;
|
|
4746
4757
|
let preciseAmount;
|
|
4747
4758
|
let fractionedAmount;
|
|
4748
4759
|
if (((_price$value = price.value) === null || _price$value === void 0 ? void 0 : _price$value.type) === PRECISION_TYPES.highPrecision && price.discounted.value.type === PRECISION_TYPES.highPrecision) {
|
|
4749
4760
|
preciseAmount = price.value.preciseAmount - price.discounted.value.preciseAmount;
|
|
4750
|
-
} 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
|
|
4761
|
+
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 || (_price$discounted = _price$discounted.value) === null || _price$discounted === void 0 ? void 0 : _price$discounted.type) === PRECISION_TYPES.centPrecision) {
|
|
4751
4762
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4752
4763
|
}
|
|
4753
|
-
return price.discounted ? _objectSpread$
|
|
4764
|
+
return price.discounted ? _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4754
4765
|
fractionedAmount,
|
|
4755
4766
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4756
4767
|
preciseAmount
|
|
4757
|
-
}) : _objectSpread$
|
|
4768
|
+
}) : _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4758
4769
|
centAmount: 0
|
|
4759
4770
|
});
|
|
4760
4771
|
}
|
|
@@ -4762,17 +4773,17 @@ function getSelectedPrice(price) {
|
|
|
4762
4773
|
return price.discounted ? price.discounted : price;
|
|
4763
4774
|
}
|
|
4764
4775
|
function getNetUnitPrice(_ref2) {
|
|
4765
|
-
var _lineItem$perMethodTa, _filteredPerMethodTax
|
|
4776
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax;
|
|
4766
4777
|
let lineItem = _ref2.lineItem,
|
|
4767
4778
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4768
4779
|
const price = getSelectedPrice(lineItem.price);
|
|
4769
|
-
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0
|
|
4770
|
-
var _lineItem$shippingDet
|
|
4771
|
-
return (lineItem === null || lineItem === void 0
|
|
4780
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 || (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4781
|
+
var _lineItem$shippingDet;
|
|
4782
|
+
return (lineItem === null || lineItem === void 0 || (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 || (_lineItem$shippingDet = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet === void 0 ? void 0 : _findIndexInstanceProperty__default["default"](_lineItem$shippingDet).call(_lineItem$shippingDet, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
|
|
4772
4783
|
});
|
|
4773
4784
|
|
|
4774
4785
|
// when shipping mode is multi with the same tax rate
|
|
4775
|
-
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (
|
|
4786
|
+
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax !== void 0 && _filteredPerMethodTax.includedInPrice) {
|
|
4776
4787
|
var _price$value3, _price$value4;
|
|
4777
4788
|
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4778
4789
|
let centAmount;
|
|
@@ -4783,7 +4794,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4783
4794
|
}
|
|
4784
4795
|
let preciseAmount;
|
|
4785
4796
|
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);
|
|
4786
|
-
return _objectSpread$
|
|
4797
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4787
4798
|
centAmount,
|
|
4788
4799
|
preciseAmount
|
|
4789
4800
|
});
|
|
@@ -4800,7 +4811,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4800
4811
|
}
|
|
4801
4812
|
let preciseAmount;
|
|
4802
4813
|
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);
|
|
4803
|
-
return _objectSpread$
|
|
4814
|
+
return _objectSpread$_(_objectSpread$_({}, price.value), {}, {
|
|
4804
4815
|
centAmount,
|
|
4805
4816
|
preciseAmount
|
|
4806
4817
|
});
|
|
@@ -4812,7 +4823,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4812
4823
|
const currencyCode = price.value.currencyCode;
|
|
4813
4824
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4814
4825
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4815
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4826
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$_(_objectSpread$_({}, minPrices), {}, {
|
|
4816
4827
|
[currencyCode]: price.value
|
|
4817
4828
|
});
|
|
4818
4829
|
}
|
|
@@ -4821,8 +4832,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4821
4832
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4822
4833
|
}
|
|
4823
4834
|
|
|
4824
|
-
function ownKeys$
|
|
4825
|
-
function _objectSpread$
|
|
4835
|
+
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; }
|
|
4836
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$Z(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$Z(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4826
4837
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4827
4838
|
var _context, _context4;
|
|
4828
4839
|
return {
|
|
@@ -4833,18 +4844,18 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4833
4844
|
key: resource.custom.type.key,
|
|
4834
4845
|
name: l10n.transformLocalizedFieldToLocalizedString(resource.custom.type.nameAllLocales),
|
|
4835
4846
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = resource.custom.type.fieldDefinitions).call(_context, fieldDefinition => {
|
|
4836
|
-
var _fieldDefinition$type,
|
|
4847
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
4837
4848
|
return {
|
|
4838
4849
|
name: fieldDefinition.name,
|
|
4839
4850
|
required: fieldDefinition.required,
|
|
4840
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
4841
|
-
elementType: _objectSpread$
|
|
4851
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4852
|
+
elementType: _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type.elementType), {}, {
|
|
4842
4853
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4843
4854
|
key: value.key,
|
|
4844
4855
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4845
4856
|
}))
|
|
4846
4857
|
})
|
|
4847
|
-
}) : ((_fieldDefinition$
|
|
4858
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$Z(_objectSpread$Z({}, fieldDefinition.type), {}, {
|
|
4848
4859
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4849
4860
|
key: value.key,
|
|
4850
4861
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4855,7 +4866,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4855
4866
|
})
|
|
4856
4867
|
}
|
|
4857
4868
|
},
|
|
4858
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4869
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$Z(_objectSpread$Z({}, fields), {}, {
|
|
4859
4870
|
[customField.name]: customField.value
|
|
4860
4871
|
}), {})
|
|
4861
4872
|
};
|
|
@@ -4867,7 +4878,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4867
4878
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4868
4879
|
// in either case we return null
|
|
4869
4880
|
if (!productSelection) return null;
|
|
4870
|
-
return _objectSpread$
|
|
4881
|
+
return _objectSpread$Z(_objectSpread$Z({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4871
4882
|
from: 'nameAllLocales',
|
|
4872
4883
|
to: 'name'
|
|
4873
4884
|
}])), {}, {
|
|
@@ -4890,8 +4901,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4890
4901
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4891
4902
|
};
|
|
4892
4903
|
|
|
4893
|
-
function ownKeys$
|
|
4894
|
-
function _objectSpread$
|
|
4904
|
+
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; }
|
|
4905
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$Y(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$Y(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4895
4906
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4896
4907
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4897
4908
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4908,7 +4919,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4908
4919
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4909
4920
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4910
4921
|
const definitionName = definition.type.elementType.name;
|
|
4911
|
-
return _objectSpread$
|
|
4922
|
+
return _objectSpread$Y(_objectSpread$Y({}, updateAction), {}, {
|
|
4912
4923
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4913
4924
|
});
|
|
4914
4925
|
}
|
|
@@ -4982,8 +4993,8 @@ function omitSetsOfSets() {
|
|
|
4982
4993
|
|
|
4983
4994
|
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 } } } };
|
|
4984
4995
|
|
|
4985
|
-
function ownKeys$
|
|
4986
|
-
function _objectSpread$
|
|
4996
|
+
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; }
|
|
4997
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$X(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$X(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
4987
4998
|
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); }; }
|
|
4988
4999
|
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; } }
|
|
4989
5000
|
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 } } } };
|
|
@@ -5043,7 +5054,7 @@ const mapDataToProps = _ref => {
|
|
|
5043
5054
|
return {
|
|
5044
5055
|
fetchTypeDefinitionsQuery: {
|
|
5045
5056
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5046
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5057
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$X({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5047
5058
|
isImmutable: true
|
|
5048
5059
|
}), [{
|
|
5049
5060
|
from: 'labelAllLocales',
|
|
@@ -5071,12 +5082,12 @@ const handlers$2 = {
|
|
|
5071
5082
|
}
|
|
5072
5083
|
};
|
|
5073
5084
|
|
|
5074
|
-
function ownKeys$
|
|
5075
|
-
function _objectSpread$
|
|
5085
|
+
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; }
|
|
5086
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$W(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$W(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5076
5087
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5077
5088
|
return {
|
|
5078
5089
|
fields: customFieldsFromRestResponse.fields,
|
|
5079
|
-
type: _objectSpread$
|
|
5090
|
+
type: _objectSpread$W({
|
|
5080
5091
|
id: customFieldsFromRestResponse.type.id
|
|
5081
5092
|
}, customFieldsFromRestResponse.type.obj)
|
|
5082
5093
|
};
|
|
@@ -5090,19 +5101,19 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5090
5101
|
key: typeDefinition.key,
|
|
5091
5102
|
name: l10n.transformLocalizedFieldToLocalizedString(typeDefinition.nameAllLocales),
|
|
5092
5103
|
fieldDefinitions: _mapInstanceProperty__default["default"](_context = typeDefinition.fieldDefinitions).call(_context, fieldDefinition => {
|
|
5093
|
-
var _fieldDefinition$type,
|
|
5104
|
+
var _fieldDefinition$type, _context2, _fieldDefinition$type2, _context3;
|
|
5094
5105
|
return {
|
|
5095
5106
|
name: fieldDefinition.name,
|
|
5096
5107
|
required: fieldDefinition.required,
|
|
5097
5108
|
inputHint: fieldDefinition.inputHint,
|
|
5098
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0
|
|
5099
|
-
elementType: _objectSpread$
|
|
5109
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5110
|
+
elementType: _objectSpread$W(_objectSpread$W({}, fieldDefinition.type.elementType), {}, {
|
|
5100
5111
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5101
5112
|
key: value.key,
|
|
5102
5113
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5103
5114
|
}))
|
|
5104
5115
|
})
|
|
5105
|
-
}) : ((_fieldDefinition$
|
|
5116
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$W(_objectSpread$W({}, fieldDefinition.type), {}, {
|
|
5106
5117
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5107
5118
|
key: value.key,
|
|
5108
5119
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5118,7 +5129,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5118
5129
|
type: {
|
|
5119
5130
|
id: formCustomFields.type.id,
|
|
5120
5131
|
typeId: 'type',
|
|
5121
|
-
obj: _objectSpread$
|
|
5132
|
+
obj: _objectSpread$W({}, formCustomFields.type)
|
|
5122
5133
|
},
|
|
5123
5134
|
fields: formCustomFields.fields
|
|
5124
5135
|
});
|
|
@@ -5126,7 +5137,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5126
5137
|
type: {
|
|
5127
5138
|
id: formCustomFields.type.id,
|
|
5128
5139
|
typeId: 'type',
|
|
5129
|
-
obj: _objectSpread$
|
|
5140
|
+
obj: _objectSpread$W({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5130
5141
|
},
|
|
5131
5142
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5132
5143
|
});
|
|
@@ -5142,7 +5153,7 @@ const createEmptyCustomFields = typeDefinition => ({
|
|
|
5142
5153
|
function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5143
5154
|
function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5144
5155
|
var FetchTypeDefinitionsWithNamesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsWithNamesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "required" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 1445, source: { body: "query FetchTypeDefinitionsWithNamesQuery(\n $where: String\n $limit: Int\n $offset: Int\n) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n id\n key\n nameAllLocales {\n value\n locale\n }\n fieldDefinitions {\n required\n type {\n name\n ... on ReferenceType {\n referenceTypeId\n }\n ... on SetType {\n elementType {\n name\n ... on ReferenceType {\n referenceTypeId\n name\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n name\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n inputHint\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5145
|
-
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5156
|
+
const customizableResources = ['asset', 'address', 'business-unit', 'category', 'channel', 'customer', 'customer-group', 'order', 'order-delivery', 'store', 'discount-code', 'inventory-entry', 'line-item', 'custom-line-item', 'product-price', 'payment', 'payment-interface-interaction', 'shipping-method', 'shopping-list', 'shopping-list-text-line-item', 'standalone-price', 'review', 'cart-discount', 'product-selection'];
|
|
5146
5157
|
const emptyTypeDefinitions = {
|
|
5147
5158
|
total: 0,
|
|
5148
5159
|
count: 0,
|
|
@@ -5200,7 +5211,7 @@ const createGraphQlOptions = ownProps => {
|
|
|
5200
5211
|
}
|
|
5201
5212
|
};
|
|
5202
5213
|
};
|
|
5203
|
-
var
|
|
5214
|
+
var CustomFieldTypeDefinitionsConnector$1 = hoistNonReactStatics__default["default"](hoc.graphql(FetchTypeDefinitionsWithNamesQuery, {
|
|
5204
5215
|
name: 'fetchTypeDefinitionsQuery',
|
|
5205
5216
|
skip: ownProps => ownProps.isDisabled,
|
|
5206
5217
|
options: createGraphQlOptions
|
|
@@ -5257,8 +5268,8 @@ const REFERENCED_TYPES = {
|
|
|
5257
5268
|
zone: 'zone'
|
|
5258
5269
|
};
|
|
5259
5270
|
|
|
5260
|
-
function ownKeys$
|
|
5261
|
-
function _objectSpread$
|
|
5271
|
+
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; }
|
|
5272
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$V(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$V(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5262
5273
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5263
5274
|
let validatedValues = [];
|
|
5264
5275
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5325,8 +5336,8 @@ function validations (formValues, language, languages) {
|
|
|
5325
5336
|
var _context2;
|
|
5326
5337
|
// Collect all required and set type fields
|
|
5327
5338
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5328
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5329
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5339
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$V(_objectSpread$V({}, acc), {}, {
|
|
5340
|
+
[fieldDefinition.name]: _objectSpread$V(_objectSpread$V({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5330
5341
|
}), {});
|
|
5331
5342
|
return withoutEmptyErrorsByField(errors);
|
|
5332
5343
|
}
|
|
@@ -5353,8 +5364,8 @@ function CustomTextInput(props) {
|
|
|
5353
5364
|
}
|
|
5354
5365
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5355
5366
|
|
|
5356
|
-
function ownKeys$
|
|
5357
|
-
function _objectSpread$
|
|
5367
|
+
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; }
|
|
5368
|
+
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; }
|
|
5358
5369
|
const getSubfieldLanguage = subfieldName => {
|
|
5359
5370
|
const lastDotIndex = _lastIndexOfInstanceProperty__default["default"](subfieldName).call(subfieldName, '.');
|
|
5360
5371
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5378,7 +5389,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5378
5389
|
// as a whole.
|
|
5379
5390
|
|
|
5380
5391
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5381
|
-
const newValue = _objectSpread$
|
|
5392
|
+
const newValue = _objectSpread$U(_objectSpread$U({}, props.value), {}, {
|
|
5382
5393
|
[fieldLanguage]: rawValue
|
|
5383
5394
|
});
|
|
5384
5395
|
const nullifiedIfNeeded = uiKit.LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5445,21 +5456,21 @@ function CustomNumberInput(props) {
|
|
|
5445
5456
|
}
|
|
5446
5457
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5447
5458
|
|
|
5448
|
-
function ownKeys$
|
|
5449
|
-
function _objectSpread$
|
|
5459
|
+
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; }
|
|
5460
|
+
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; }
|
|
5450
5461
|
var styles$f = {
|
|
5451
5462
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5452
5463
|
};
|
|
5453
5464
|
const fixCurrencyCode = (value, currencies) => {
|
|
5454
5465
|
if (value.currencyCode) return value;
|
|
5455
5466
|
const firstCurrency = currencies[0];
|
|
5456
|
-
return _objectSpread$
|
|
5467
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5457
5468
|
currencyCode: firstCurrency
|
|
5458
5469
|
});
|
|
5459
5470
|
};
|
|
5460
5471
|
const fixAmount = value => {
|
|
5461
5472
|
if (!value.amount) {
|
|
5462
|
-
return _objectSpread$
|
|
5473
|
+
return _objectSpread$T(_objectSpread$T({}, value), {}, {
|
|
5463
5474
|
amount: '0'
|
|
5464
5475
|
});
|
|
5465
5476
|
}
|
|
@@ -5501,7 +5512,7 @@ function CustomMoneyInput(props) {
|
|
|
5501
5512
|
}
|
|
5502
5513
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5503
5514
|
const isAmount = _endsWithInstanceProperty__default["default"](subfieldName).call(subfieldName, 'amount');
|
|
5504
|
-
const newValue = _objectSpread$
|
|
5515
|
+
const newValue = _objectSpread$T({}, internalValue.current);
|
|
5505
5516
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5506
5517
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5507
5518
|
internalValue.current = fixedValue;
|
|
@@ -5782,7 +5793,7 @@ function ReferenceSearch(props) {
|
|
|
5782
5793
|
});
|
|
5783
5794
|
}
|
|
5784
5795
|
|
|
5785
|
-
const messages$
|
|
5796
|
+
const messages$B = reactIntl.defineMessages({
|
|
5786
5797
|
placeholder: {
|
|
5787
5798
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5788
5799
|
description: 'Placeholder for search for a category',
|
|
@@ -5815,8 +5826,8 @@ const messages$A = reactIntl.defineMessages({
|
|
|
5815
5826
|
}
|
|
5816
5827
|
});
|
|
5817
5828
|
|
|
5818
|
-
function ownKeys$
|
|
5819
|
-
function _objectSpread$
|
|
5829
|
+
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; }
|
|
5830
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$S(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$S(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
5820
5831
|
function Option$1(props) {
|
|
5821
5832
|
var _context, _context2;
|
|
5822
5833
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
@@ -5828,7 +5839,7 @@ function Option$1(props) {
|
|
|
5828
5839
|
const _useIntl = reactIntl.useIntl(),
|
|
5829
5840
|
formatMessage = _useIntl.formatMessage;
|
|
5830
5841
|
const category = props.data;
|
|
5831
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5842
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$S(_objectSpread$S({}, props), {}, {
|
|
5832
5843
|
children: jsxRuntime.jsxs("div", {
|
|
5833
5844
|
"data-testid": "category-option",
|
|
5834
5845
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5839,7 +5850,7 @@ function Option$1(props) {
|
|
|
5839
5850
|
fallbackOrder: languages
|
|
5840
5851
|
})
|
|
5841
5852
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5842
|
-
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$
|
|
5853
|
+
children: _concatInstanceProperty__default["default"](_context = "".concat(formatMessage(messages$B.parentCategory), ": ")).call(_context, l10n.formatLocalizedString(category.parent, {
|
|
5843
5854
|
key: 'name',
|
|
5844
5855
|
locale: language,
|
|
5845
5856
|
fallbackOrder: languages
|
|
@@ -5851,14 +5862,14 @@ function Option$1(props) {
|
|
|
5851
5862
|
fallbackOrder: languages
|
|
5852
5863
|
}))
|
|
5853
5864
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5854
|
-
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$
|
|
5865
|
+
children: _concatInstanceProperty__default["default"](_context2 = "".concat(formatMessage(messages$B.externalId), ": ")).call(_context2, category.externalId || constants.NO_VALUE_FALLBACK)
|
|
5855
5866
|
})]
|
|
5856
5867
|
})
|
|
5857
5868
|
}));
|
|
5858
5869
|
}
|
|
5859
5870
|
|
|
5860
|
-
function ownKeys$
|
|
5861
|
-
function _objectSpread$
|
|
5871
|
+
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; }
|
|
5872
|
+
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; }
|
|
5862
5873
|
const filterOption$1 = () => true;
|
|
5863
5874
|
function CategoryReferenceSearch(props) {
|
|
5864
5875
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5870,7 +5881,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5870
5881
|
})),
|
|
5871
5882
|
language = _useApplicationContex.language,
|
|
5872
5883
|
languages = _useApplicationContex.languages;
|
|
5873
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5884
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$R(_objectSpread$R({}, category), {}, {
|
|
5874
5885
|
value: category.id,
|
|
5875
5886
|
label: l10n.formatLocalizedString(category, {
|
|
5876
5887
|
key: 'name',
|
|
@@ -5888,7 +5899,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5888
5899
|
}), [apolloClient]);
|
|
5889
5900
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5890
5901
|
id: props.id,
|
|
5891
|
-
components: _objectSpread$
|
|
5902
|
+
components: _objectSpread$R({
|
|
5892
5903
|
Option: Option$1
|
|
5893
5904
|
}, props.components),
|
|
5894
5905
|
isClearable: props.isClearable,
|
|
@@ -5899,10 +5910,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5899
5910
|
onBlur: props.onBlur,
|
|
5900
5911
|
onChange: props.onChange,
|
|
5901
5912
|
value: props.value,
|
|
5902
|
-
placeholderLabel: formatMessage(messages$
|
|
5903
|
-
searchPromptLabel: formatMessage(messages$
|
|
5904
|
-
noResultsLabel: formatMessage(messages$
|
|
5905
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5913
|
+
placeholderLabel: formatMessage(messages$B.placeholder),
|
|
5914
|
+
searchPromptLabel: formatMessage(messages$B.searchPrompt),
|
|
5915
|
+
noResultsLabel: formatMessage(messages$B.noResults),
|
|
5916
|
+
referenceIsMissingLabel: formatMessage(messages$B.isMissing),
|
|
5906
5917
|
mapItemToOption: mapItemToOption,
|
|
5907
5918
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5908
5919
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5978,7 +5989,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5978
5989
|
});
|
|
5979
5990
|
}
|
|
5980
5991
|
|
|
5981
|
-
const messages$
|
|
5992
|
+
const messages$A = reactIntl.defineMessages({
|
|
5982
5993
|
placeholder: {
|
|
5983
5994
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5984
5995
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -6006,8 +6017,8 @@ const messages$z = reactIntl.defineMessages({
|
|
|
6006
6017
|
}
|
|
6007
6018
|
});
|
|
6008
6019
|
|
|
6009
|
-
function ownKeys$
|
|
6010
|
-
function _objectSpread$
|
|
6020
|
+
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; }
|
|
6021
|
+
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; }
|
|
6011
6022
|
function Option(props) {
|
|
6012
6023
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
6013
6024
|
language: applicationContext.dataLocale,
|
|
@@ -6018,7 +6029,7 @@ function Option(props) {
|
|
|
6018
6029
|
const _useIntl = reactIntl.useIntl(),
|
|
6019
6030
|
formatMessage = _useIntl.formatMessage;
|
|
6020
6031
|
const cartDiscount = props.data;
|
|
6021
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
6032
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
6022
6033
|
children: jsxRuntime.jsxs("div", {
|
|
6023
6034
|
"data-testid": "cart-discount-option",
|
|
6024
6035
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -6029,14 +6040,14 @@ function Option(props) {
|
|
|
6029
6040
|
fallbackOrder: languages
|
|
6030
6041
|
})
|
|
6031
6042
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
6032
|
-
children: [formatMessage(messages$
|
|
6043
|
+
children: [formatMessage(messages$A.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
6033
6044
|
})]
|
|
6034
6045
|
})
|
|
6035
6046
|
}));
|
|
6036
6047
|
}
|
|
6037
6048
|
|
|
6038
|
-
function ownKeys$
|
|
6039
|
-
function _objectSpread$
|
|
6049
|
+
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; }
|
|
6050
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$P(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$P(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6040
6051
|
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 } } } };
|
|
6041
6052
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
6042
6053
|
const filterOption = (option, text) => {
|
|
@@ -6062,7 +6073,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6062
6073
|
})),
|
|
6063
6074
|
language = _useApplicationContex.language,
|
|
6064
6075
|
languages = _useApplicationContex.languages;
|
|
6065
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
6076
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$P(_objectSpread$P({}, cartDiscount), {}, {
|
|
6066
6077
|
value: cartDiscount.id,
|
|
6067
6078
|
key: cartDiscount.key,
|
|
6068
6079
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -6105,10 +6116,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
6105
6116
|
onBlur: props.onBlur,
|
|
6106
6117
|
onChange: props.onChange,
|
|
6107
6118
|
value: returnNullIfEmpty(props.value),
|
|
6108
|
-
placeholderLabel: formatMessage(messages$
|
|
6109
|
-
searchPromptLabel: formatMessage(messages$
|
|
6110
|
-
noResultsLabel: formatMessage(messages$
|
|
6111
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6119
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
6120
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
6121
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
6122
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
6112
6123
|
mapItemToOption: mapItemToOption,
|
|
6113
6124
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6114
6125
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6169,7 +6180,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6169
6180
|
});
|
|
6170
6181
|
}
|
|
6171
6182
|
|
|
6172
|
-
var messages$
|
|
6183
|
+
var messages$z = reactIntl.defineMessages({
|
|
6173
6184
|
noProductsFound: {
|
|
6174
6185
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6175
6186
|
description: 'The message to display when no products were found',
|
|
@@ -6258,7 +6269,7 @@ const ProductPickerInput = _ref => {
|
|
|
6258
6269
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6259
6270
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6260
6271
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6261
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
6272
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
6262
6273
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6263
6274
|
max: "scale",
|
|
6264
6275
|
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -6268,7 +6279,7 @@ const ProductPickerInput = _ref => {
|
|
|
6268
6279
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6269
6280
|
id: name,
|
|
6270
6281
|
name: name,
|
|
6271
|
-
placeholder: formatMessage(messages$
|
|
6282
|
+
placeholder: formatMessage(messages$z.placeholder),
|
|
6272
6283
|
loadOptions: loadOptionsDebounced,
|
|
6273
6284
|
defaultOptions: [],
|
|
6274
6285
|
isClearable: isClearable,
|
|
@@ -6282,7 +6293,7 @@ const ProductPickerInput = _ref => {
|
|
|
6282
6293
|
onInputChange: handleInputChange,
|
|
6283
6294
|
onBlur: onBlur,
|
|
6284
6295
|
value: currentOption.data,
|
|
6285
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6296
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$z.noProductsFound),
|
|
6286
6297
|
hasError: hasError || isLoadingFailed
|
|
6287
6298
|
})
|
|
6288
6299
|
}), isLoadingFailed && showLoadingErrorMessage && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -6532,8 +6543,8 @@ function CustomBooleanInputSet(props) {
|
|
|
6532
6543
|
}
|
|
6533
6544
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6534
6545
|
|
|
6535
|
-
function ownKeys$
|
|
6536
|
-
function _objectSpread$
|
|
6546
|
+
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; }
|
|
6547
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$O(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$O(Object(source))).call(_context8, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6537
6548
|
const getTypeName = type => type.name.toLowerCase();
|
|
6538
6549
|
const findLabel = (enumType, key) => {
|
|
6539
6550
|
var _enumType$values$find, _enumType$values$find2, _context;
|
|
@@ -6582,7 +6593,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
6582
6593
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty__default["default"](pairs).call(pairs, (result, _ref2) => {
|
|
6583
6594
|
let name = _ref2.name,
|
|
6584
6595
|
value = _ref2.value;
|
|
6585
|
-
return _objectSpread$
|
|
6596
|
+
return _objectSpread$O(_objectSpread$O({}, result), {}, {
|
|
6586
6597
|
[name]: value
|
|
6587
6598
|
});
|
|
6588
6599
|
}, {});
|
|
@@ -6666,7 +6677,7 @@ function ProductAttributeInput(props) {
|
|
|
6666
6677
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
6667
6678
|
|
|
6668
6679
|
// eslint-disable-next-line import/prefer-default-export
|
|
6669
|
-
const messages$
|
|
6680
|
+
const messages$y = reactIntl.defineMessages({
|
|
6670
6681
|
aboveFifthLevelWarning: {
|
|
6671
6682
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6672
6683
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6679,23 +6690,23 @@ const messages$x = reactIntl.defineMessages({
|
|
|
6679
6690
|
}
|
|
6680
6691
|
});
|
|
6681
6692
|
|
|
6682
|
-
function ownKeys$
|
|
6683
|
-
function _objectSpread$
|
|
6693
|
+
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; }
|
|
6694
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$N(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$N(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
6684
6695
|
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 } } } };
|
|
6685
6696
|
const mapAttributeDefinition = definition => {
|
|
6686
|
-
var _context, _definition$type,
|
|
6687
|
-
return _objectSpread$
|
|
6697
|
+
var _context, _definition$type, _context2, _context3, _definition$type2, _context4;
|
|
6698
|
+
return _objectSpread$N(_objectSpread$N({}, definition), {}, {
|
|
6688
6699
|
required: definition.isRequired,
|
|
6689
6700
|
inputTip: l10n.transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6690
6701
|
label: l10n.transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6691
|
-
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0
|
|
6692
|
-
elementType: _objectSpread$
|
|
6702
|
+
type: _includesInstanceProperty__default["default"](_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 || (_definition$type = _definition$type.elementType) === null || _definition$type === void 0 ? void 0 : _definition$type.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6703
|
+
elementType: _objectSpread$N(_objectSpread$N({}, definition.type.elementType), {}, {
|
|
6693
6704
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](definition.type.elementType).results).call(_context2, value => ({
|
|
6694
6705
|
key: value.key,
|
|
6695
6706
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6696
6707
|
}))
|
|
6697
6708
|
})
|
|
6698
|
-
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$
|
|
6709
|
+
}) : _includesInstanceProperty__default["default"](_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$N(_objectSpread$N({}, definition.type), {}, {
|
|
6699
6710
|
values: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](definition.type).results).call(_context4, value => ({
|
|
6700
6711
|
key: value.key,
|
|
6701
6712
|
label: value.label || l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -6736,7 +6747,7 @@ function useNestedProductType(fieldDefinition) {
|
|
|
6736
6747
|
};
|
|
6737
6748
|
}
|
|
6738
6749
|
|
|
6739
|
-
var messages$
|
|
6750
|
+
var messages$x = reactIntl.defineMessages({
|
|
6740
6751
|
updateButton: {
|
|
6741
6752
|
id: 'NestedAttributes.Details.updateButton',
|
|
6742
6753
|
description: 'Update button label',
|
|
@@ -6816,14 +6827,14 @@ var messages$w = reactIntl.defineMessages({
|
|
|
6816
6827
|
|
|
6817
6828
|
const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
6818
6829
|
|
|
6819
|
-
function ownKeys$
|
|
6820
|
-
function _objectSpread$
|
|
6830
|
+
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; }
|
|
6831
|
+
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; }
|
|
6821
6832
|
const EditButton = props => {
|
|
6822
6833
|
const _useIntl = reactIntl.useIntl(),
|
|
6823
6834
|
formatMessage = _useIntl.formatMessage;
|
|
6824
6835
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
6825
6836
|
placement: "top",
|
|
6826
|
-
title: formatMessage(messages$
|
|
6837
|
+
title: formatMessage(messages$x.editTooltip),
|
|
6827
6838
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
6828
6839
|
label: "Edit",
|
|
6829
6840
|
isDisabled: props.isDisabled,
|
|
@@ -6839,12 +6850,12 @@ const DropChangesConfirmation = props => {
|
|
|
6839
6850
|
formatMessage = _useIntl2.formatMessage;
|
|
6840
6851
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
6841
6852
|
isOpen: props.isOpen || false,
|
|
6842
|
-
title: formatMessage(messages$
|
|
6843
|
-
labelPrimary: formatMessage(messages$
|
|
6853
|
+
title: formatMessage(messages$x.confirmationDialogTitle),
|
|
6854
|
+
labelPrimary: formatMessage(messages$x.nestedAttributesConfirmLabel),
|
|
6844
6855
|
onConfirm: props.onConfirm,
|
|
6845
6856
|
onCancel: props.onCancel,
|
|
6846
6857
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6847
|
-
intlMessage: messages$
|
|
6858
|
+
intlMessage: messages$x.confirmationDialogBody
|
|
6848
6859
|
})
|
|
6849
6860
|
});
|
|
6850
6861
|
};
|
|
@@ -6869,11 +6880,11 @@ const NestedAttributeModalPage = props => {
|
|
|
6869
6880
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
6870
6881
|
isDisabled: !formik$1.dirty,
|
|
6871
6882
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
6872
|
-
label: formatMessage(messages$
|
|
6883
|
+
label: formatMessage(messages$x.cancelButton),
|
|
6873
6884
|
onClick: formik$1.resetForm
|
|
6874
6885
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
6875
6886
|
isDisabled: !formik$1.dirty,
|
|
6876
|
-
label: formatMessage(messages$
|
|
6887
|
+
label: formatMessage(messages$x.updateButton),
|
|
6877
6888
|
onClick: formik$1.handleSubmit
|
|
6878
6889
|
})]
|
|
6879
6890
|
}),
|
|
@@ -6902,7 +6913,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
6902
6913
|
const MaxNestingLevelReached = () => jsxRuntime.jsx(uiKit.FieldLabel, {
|
|
6903
6914
|
title: "",
|
|
6904
6915
|
hint: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6905
|
-
intlMessage: messages$
|
|
6916
|
+
intlMessage: messages$y.aboveFifthLevelWarning
|
|
6906
6917
|
}),
|
|
6907
6918
|
hintIcon: jsxRuntime.jsx(uiKit.WarningIcon, {})
|
|
6908
6919
|
});
|
|
@@ -6914,7 +6925,7 @@ const NestedInputControls = props => {
|
|
|
6914
6925
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
6915
6926
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
6916
6927
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
6917
|
-
intlMessage: messages$
|
|
6928
|
+
intlMessage: messages$x.emptyProductType,
|
|
6918
6929
|
tone: "secondary"
|
|
6919
6930
|
});
|
|
6920
6931
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -6928,7 +6939,7 @@ const NestedInputControls = props => {
|
|
|
6928
6939
|
children: props.productType.name
|
|
6929
6940
|
}), props.isEmpty && jsxRuntime.jsx("span", {
|
|
6930
6941
|
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
6931
|
-
children: formatMessage(messages$
|
|
6942
|
+
children: formatMessage(messages$y.emptySetItem)
|
|
6932
6943
|
})
|
|
6933
6944
|
})]
|
|
6934
6945
|
}), jsxRuntime.jsx(EditButton, {
|
|
@@ -6964,13 +6975,13 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6964
6975
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
6965
6976
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
6966
6977
|
const openNestedAttributesForm = () => {
|
|
6967
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6978
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6968
6979
|
hideSaveToolbar: true
|
|
6969
6980
|
}));
|
|
6970
6981
|
attributesForm.openModal();
|
|
6971
6982
|
};
|
|
6972
6983
|
const closeNestedAttributesForm = () => {
|
|
6973
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6984
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$M(_objectSpread$M({}, parentFormik.status), {}, {
|
|
6974
6985
|
hideSaveToolbar: false
|
|
6975
6986
|
}));
|
|
6976
6987
|
attributesForm.closeModal();
|
|
@@ -6990,7 +7001,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
6990
7001
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
6991
7002
|
kind: 'success',
|
|
6992
7003
|
domain: constants.DOMAINS.SIDE,
|
|
6993
|
-
text: formatMessage(messages$
|
|
7004
|
+
text: formatMessage(messages$x.attributeUpdateSucceeded)
|
|
6994
7005
|
});
|
|
6995
7006
|
setSubmitting(false);
|
|
6996
7007
|
},
|
|
@@ -7074,8 +7085,8 @@ const SetButtons = props => {
|
|
|
7074
7085
|
};
|
|
7075
7086
|
SetButtons.displayName = 'SetButtons';
|
|
7076
7087
|
|
|
7077
|
-
function ownKeys$
|
|
7078
|
-
function _objectSpread$
|
|
7088
|
+
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; }
|
|
7089
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$L(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$L(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7079
7090
|
const getDuplicateErrors = setValues => {
|
|
7080
7091
|
/* eslint-disable no-plusplus */
|
|
7081
7092
|
const result = [];
|
|
@@ -7132,7 +7143,7 @@ function CustomInputSet(props) {
|
|
|
7132
7143
|
touched = _useFormikContext.touched,
|
|
7133
7144
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
7134
7145
|
dirty = _useFormikContext.dirty;
|
|
7135
|
-
const itemFieldDefinition = _objectSpread$
|
|
7146
|
+
const itemFieldDefinition = _objectSpread$L(_objectSpread$L({}, props.fieldDefinition), {}, {
|
|
7136
7147
|
type: props.fieldDefinition.type.elementType
|
|
7137
7148
|
});
|
|
7138
7149
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -7292,7 +7303,7 @@ const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
|
7292
7303
|
});
|
|
7293
7304
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7294
7305
|
|
|
7295
|
-
var messages$
|
|
7306
|
+
var messages$w = reactIntl.defineMessages({
|
|
7296
7307
|
referencedProductType: {
|
|
7297
7308
|
id: 'NestedAttributes.referencedProductType',
|
|
7298
7309
|
description: 'Product type referenced hint',
|
|
@@ -7300,10 +7311,10 @@ var messages$v = reactIntl.defineMessages({
|
|
|
7300
7311
|
}
|
|
7301
7312
|
});
|
|
7302
7313
|
|
|
7303
|
-
function ownKeys$
|
|
7304
|
-
function _objectSpread$
|
|
7314
|
+
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; }
|
|
7315
|
+
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; }
|
|
7305
7316
|
function ProductTypeReference(props) {
|
|
7306
|
-
const productTypeMessage = _objectSpread$
|
|
7317
|
+
const productTypeMessage = _objectSpread$K(_objectSpread$K({}, messages$w.referencedProductType), {}, {
|
|
7307
7318
|
values: {
|
|
7308
7319
|
productTypeName: props.productType.name
|
|
7309
7320
|
}
|
|
@@ -7349,9 +7360,9 @@ function CustomNestedFieldInput(props) {
|
|
|
7349
7360
|
}
|
|
7350
7361
|
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7351
7362
|
|
|
7352
|
-
function ownKeys$
|
|
7353
|
-
function _objectSpread$
|
|
7354
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$
|
|
7363
|
+
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; }
|
|
7364
|
+
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; }
|
|
7365
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty__default["default"](errors).call(errors, (result, itemErrors) => _objectSpread$J(_objectSpread$J({}, result), itemErrors), {});
|
|
7355
7366
|
|
|
7356
7367
|
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7357
7368
|
// all the other types of fields. So that there will be no isArray check.
|
|
@@ -7362,15 +7373,15 @@ const CustomFieldErrors = props => {
|
|
|
7362
7373
|
const errors = _Array$isArray__default["default"](props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7363
7374
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7364
7375
|
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7365
|
-
intlMessage: messages$
|
|
7376
|
+
intlMessage: messages$K.required
|
|
7366
7377
|
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsxRuntime.jsx(_.ErrorMessage, {
|
|
7367
|
-
intlMessage: messages$
|
|
7378
|
+
intlMessage: messages$K.unique
|
|
7368
7379
|
})]
|
|
7369
7380
|
});
|
|
7370
7381
|
};
|
|
7371
7382
|
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7372
7383
|
|
|
7373
|
-
var messages$
|
|
7384
|
+
var messages$v = reactIntl.defineMessages({
|
|
7374
7385
|
productReferenceLabel: {
|
|
7375
7386
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7376
7387
|
description: 'Label shown above the product picker input.',
|
|
@@ -7403,8 +7414,8 @@ var messages$u = reactIntl.defineMessages({
|
|
|
7403
7414
|
}
|
|
7404
7415
|
});
|
|
7405
7416
|
|
|
7406
|
-
function ownKeys$
|
|
7407
|
-
function _objectSpread$
|
|
7417
|
+
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; }
|
|
7418
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$I(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$I(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7408
7419
|
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 } } } };
|
|
7409
7420
|
const CustomFieldsLabelHint = _ref => {
|
|
7410
7421
|
var _type$name;
|
|
@@ -7434,7 +7445,7 @@ const CustomFieldsLabelHint = _ref => {
|
|
|
7434
7445
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7435
7446
|
size: "medium",
|
|
7436
7447
|
color: "warning"
|
|
7437
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
7448
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$I({}, messages$v.cartDiscountMoreThan500))]
|
|
7438
7449
|
});
|
|
7439
7450
|
}
|
|
7440
7451
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7448,8 +7459,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7448
7459
|
formatMessage = _useIntl.formatMessage;
|
|
7449
7460
|
const _usePimStatus = usePimStatus(),
|
|
7450
7461
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7451
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7452
|
-
return formatMessage(messages$
|
|
7462
|
+
if (isProjectIndexed) return formatMessage(messages$v.productTypeReferenceLabelI);
|
|
7463
|
+
return formatMessage(messages$v.productTypeReferenceLabel);
|
|
7453
7464
|
}
|
|
7454
7465
|
|
|
7455
7466
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7465,7 +7476,7 @@ function CustomFieldsLabelSubtitle(_ref2) {
|
|
|
7465
7476
|
const referenceTypeId = type.referenceTypeId;
|
|
7466
7477
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7467
7478
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7468
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$
|
|
7479
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$v.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$v.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$v.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7469
7480
|
}
|
|
7470
7481
|
const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref3 => {
|
|
7471
7482
|
let name = _ref3.name,
|
|
@@ -7620,8 +7631,8 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7620
7631
|
}
|
|
7621
7632
|
});
|
|
7622
7633
|
|
|
7623
|
-
function ownKeys$
|
|
7624
|
-
function _objectSpread$
|
|
7634
|
+
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; }
|
|
7635
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$H(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$H(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
7625
7636
|
const PRODUCT_SELECTION_TYPES = {
|
|
7626
7637
|
INCLUSION: 'individual',
|
|
7627
7638
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7635,7 +7646,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7635
7646
|
var _context;
|
|
7636
7647
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7637
7648
|
if (!ps) return undefined;
|
|
7638
|
-
return _objectSpread$
|
|
7649
|
+
return _objectSpread$H(_objectSpread$H({}, ps), {}, {
|
|
7639
7650
|
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), ")") : '')
|
|
7640
7651
|
});
|
|
7641
7652
|
};
|
|
@@ -7931,7 +7942,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7931
7942
|
fetchPolicy: 'network-only'
|
|
7932
7943
|
}),
|
|
7933
7944
|
data = _await$client$query.data;
|
|
7934
|
-
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0
|
|
7945
|
+
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 || (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
7935
7946
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
7936
7947
|
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7937
7948
|
var _context2;
|
|
@@ -7986,12 +7997,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
7986
7997
|
});
|
|
7987
7998
|
}
|
|
7988
7999
|
|
|
7989
|
-
function ownKeys$
|
|
7990
|
-
function _objectSpread$
|
|
8000
|
+
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; }
|
|
8001
|
+
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; }
|
|
7991
8002
|
function TypeSelectInputOption(props) {
|
|
7992
8003
|
const data = props.data;
|
|
7993
8004
|
const noValueFallback = props.noValueFallback || constants.NO_VALUE_FALLBACK;
|
|
7994
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8005
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$G(_objectSpread$G({}, props), {}, {
|
|
7995
8006
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7996
8007
|
scale: "xs",
|
|
7997
8008
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -8006,18 +8017,18 @@ function TypeSelectInputOption(props) {
|
|
|
8006
8017
|
}));
|
|
8007
8018
|
}
|
|
8008
8019
|
|
|
8009
|
-
function ownKeys$
|
|
8010
|
-
function _objectSpread$
|
|
8020
|
+
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; }
|
|
8021
|
+
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; }
|
|
8011
8022
|
function ProductSelectionsPicker(props) {
|
|
8012
8023
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8013
8024
|
const components = React.useMemo(() => {
|
|
8014
8025
|
return {
|
|
8015
8026
|
Option: optionInnerProps => {
|
|
8016
8027
|
if (optionInnerProps.isDisabled) {
|
|
8017
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8028
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$F({}, optionInnerProps));
|
|
8018
8029
|
}
|
|
8019
8030
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8020
|
-
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$
|
|
8031
|
+
return jsxRuntime.jsx(TypeSelectInputOption, _objectSpread$F({}, optionInnerProps));
|
|
8021
8032
|
}
|
|
8022
8033
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8023
8034
|
optionType: props.optionType,
|
|
@@ -8029,7 +8040,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8029
8040
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8030
8041
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8031
8042
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8032
|
-
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
8043
|
+
children: jsxRuntime.jsx(CustomProductSelectionsPicker, _objectSpread$F(_objectSpread$F({}, props), {}, {
|
|
8033
8044
|
components: components
|
|
8034
8045
|
}))
|
|
8035
8046
|
});
|
|
@@ -8052,7 +8063,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8052
8063
|
|
|
8053
8064
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8054
8065
|
|
|
8055
|
-
var messages$
|
|
8066
|
+
var messages$u = reactIntl.defineMessages({
|
|
8056
8067
|
countriesBasicSelectPlaceholder: {
|
|
8057
8068
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8058
8069
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8080,7 +8091,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8080
8091
|
value: props.value,
|
|
8081
8092
|
isRequired: props.isRequired,
|
|
8082
8093
|
description: props.description,
|
|
8083
|
-
placeholder: intl.formatMessage(messages$
|
|
8094
|
+
placeholder: intl.formatMessage(messages$u.countriesBasicSelectPlaceholder),
|
|
8084
8095
|
options: props.options,
|
|
8085
8096
|
onChange: props.onChange,
|
|
8086
8097
|
isDisabled: props.isDisabled,
|
|
@@ -8090,10 +8101,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8090
8101
|
});
|
|
8091
8102
|
}
|
|
8092
8103
|
|
|
8093
|
-
function ownKeys$
|
|
8094
|
-
function _objectSpread$
|
|
8104
|
+
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; }
|
|
8105
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$E(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$E(Object(source))).call(_context5, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8095
8106
|
const emptyCountryOption = intl => [{
|
|
8096
|
-
label: intl.formatMessage(messages$
|
|
8107
|
+
label: intl.formatMessage(messages$u.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8097
8108
|
value: undefined,
|
|
8098
8109
|
isDisabled: true
|
|
8099
8110
|
}];
|
|
@@ -8118,7 +8129,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8118
8129
|
const onOptionChange = event => {
|
|
8119
8130
|
const countries = event.target.value;
|
|
8120
8131
|
props.onChange({
|
|
8121
|
-
target: _objectSpread$
|
|
8132
|
+
target: _objectSpread$E(_objectSpread$E({}, event.target), {}, {
|
|
8122
8133
|
value: _mapInstanceProperty__default["default"](countries).call(countries, country => {
|
|
8123
8134
|
var _country$value;
|
|
8124
8135
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8139,7 +8150,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8139
8150
|
var _context3;
|
|
8140
8151
|
return _findInstanceProperty__default["default"](_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8141
8152
|
}),
|
|
8142
|
-
placeholder: intl.formatMessage(messages$
|
|
8153
|
+
placeholder: intl.formatMessage(messages$u.countriesAsyncSelectPlaceholder),
|
|
8143
8154
|
loadOptions: handleLoadOptions,
|
|
8144
8155
|
onChange: onOptionChange,
|
|
8145
8156
|
isDisabled: props.isDisabled,
|
|
@@ -8149,13 +8160,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8149
8160
|
});
|
|
8150
8161
|
}
|
|
8151
8162
|
|
|
8152
|
-
function ownKeys$
|
|
8153
|
-
function _objectSpread$
|
|
8163
|
+
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; }
|
|
8164
|
+
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; }
|
|
8154
8165
|
function CountriesPicker(props) {
|
|
8155
8166
|
var _props$options;
|
|
8156
8167
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8157
8168
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
8158
|
-
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$
|
|
8169
|
+
children: jsxRuntime.jsx(CustomCountriesPicker, _objectSpread$D({}, props))
|
|
8159
8170
|
});
|
|
8160
8171
|
}
|
|
8161
8172
|
CountriesPicker.defaultProps = {
|
|
@@ -8165,7 +8176,7 @@ CountriesPicker.defaultProps = {
|
|
|
8165
8176
|
hasWarning: false
|
|
8166
8177
|
};
|
|
8167
8178
|
|
|
8168
|
-
var messages$
|
|
8179
|
+
var messages$t = reactIntl.defineMessages({
|
|
8169
8180
|
noCustomerGroupsFound: {
|
|
8170
8181
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8171
8182
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8256,8 +8267,8 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8256
8267
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8257
8268
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8258
8269
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8259
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8260
|
-
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0
|
|
8270
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$t.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8271
|
+
const tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 || (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8261
8272
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8262
8273
|
max: "scale",
|
|
8263
8274
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -8267,7 +8278,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8267
8278
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
8268
8279
|
id: name,
|
|
8269
8280
|
name: name,
|
|
8270
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8281
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$t.placeholder),
|
|
8271
8282
|
loadOptions: loadOptionsDebounced,
|
|
8272
8283
|
defaultOptions: true,
|
|
8273
8284
|
showOptionGroupDivider: true,
|
|
@@ -8337,7 +8348,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8337
8348
|
return _sliceInstanceProperty__default["default"](storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8338
8349
|
};
|
|
8339
8350
|
|
|
8340
|
-
var messages$
|
|
8351
|
+
var messages$s = reactIntl.defineMessages({
|
|
8341
8352
|
basicSelectInputPlaceholder: {
|
|
8342
8353
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8343
8354
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8363,6 +8374,11 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8363
8374
|
description: 'The message shown in search select input when matches are found',
|
|
8364
8375
|
defaultMessage: 'No matches found for your search term'
|
|
8365
8376
|
},
|
|
8377
|
+
searchSelectInputNoValueMessage: {
|
|
8378
|
+
id: 'Shared.StoreSelectInput.searchSelectInputNoValueMessage',
|
|
8379
|
+
description: 'The message shown in search select input when value of the input is empty',
|
|
8380
|
+
defaultMessage: 'No autosuggestions available. Start typing to load results based on case-sensitive exact matches'
|
|
8381
|
+
},
|
|
8366
8382
|
asyncSelectDropdownTypeAheadPrompt: {
|
|
8367
8383
|
id: 'Shared.StoreSelectInput.asyncSelectDropdownTypeAheadPrompt',
|
|
8368
8384
|
description: 'Message shown telling the user to start typing to load more channels',
|
|
@@ -8370,8 +8386,8 @@ var messages$r = reactIntl.defineMessages({
|
|
|
8370
8386
|
}
|
|
8371
8387
|
});
|
|
8372
8388
|
|
|
8373
|
-
function ownKeys$
|
|
8374
|
-
function _objectSpread$
|
|
8389
|
+
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; }
|
|
8390
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$C(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$C(Object(source))).call(_context6, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8375
8391
|
const hasErrors$2 = errors => {
|
|
8376
8392
|
var _context;
|
|
8377
8393
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8396,7 +8412,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8396
8412
|
return _findInstanceProperty__default["default"](mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8397
8413
|
};
|
|
8398
8414
|
const emptyStoreOption = intl => [{
|
|
8399
|
-
label: intl.formatMessage(messages$
|
|
8415
|
+
label: intl.formatMessage(messages$s.asyncSelectDropdownTypeAheadPrompt),
|
|
8400
8416
|
value: undefined,
|
|
8401
8417
|
isDisabled: true
|
|
8402
8418
|
}];
|
|
@@ -8443,10 +8459,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8443
8459
|
};
|
|
8444
8460
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8445
8461
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8446
|
-
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$
|
|
8462
|
+
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$C(_objectSpread$C({
|
|
8447
8463
|
id: props.id,
|
|
8448
8464
|
name: props.name,
|
|
8449
|
-
placeholder: intl.formatMessage(messages$
|
|
8465
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8450
8466
|
horizontalConstraint: props.horizontalConstraint,
|
|
8451
8467
|
loadOptions: handleLoadOptions,
|
|
8452
8468
|
defaultOptions: true,
|
|
@@ -8486,8 +8502,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8486
8502
|
shouldFetchProductSelections: false
|
|
8487
8503
|
};
|
|
8488
8504
|
|
|
8489
|
-
function ownKeys$
|
|
8490
|
-
function _objectSpread$
|
|
8505
|
+
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; }
|
|
8506
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$B(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$B(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8491
8507
|
const hasErrors$1 = errors => {
|
|
8492
8508
|
var _context;
|
|
8493
8509
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
@@ -8535,10 +8551,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8535
8551
|
};
|
|
8536
8552
|
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8537
8553
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8538
|
-
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$
|
|
8554
|
+
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$B(_objectSpread$B({
|
|
8539
8555
|
id: props.id,
|
|
8540
8556
|
name: props.name,
|
|
8541
|
-
placeholder: intl.formatMessage(messages$
|
|
8557
|
+
placeholder: intl.formatMessage(messages$s.basicSelectInputPlaceholder),
|
|
8542
8558
|
horizontalConstraint: props.horizontalConstraint,
|
|
8543
8559
|
options: mappedStoresListOptions,
|
|
8544
8560
|
isMulti: props.isMulti,
|
|
@@ -8631,8 +8647,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8631
8647
|
};
|
|
8632
8648
|
};
|
|
8633
8649
|
|
|
8634
|
-
function ownKeys$
|
|
8635
|
-
function _objectSpread$
|
|
8650
|
+
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; }
|
|
8651
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$A(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$A(Object(source))).call(_context7, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8636
8652
|
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 } } } };
|
|
8637
8653
|
const hasErrors = errors => {
|
|
8638
8654
|
var _context;
|
|
@@ -8734,10 +8750,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8734
8750
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8735
8751
|
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8736
8752
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
8737
|
-
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$
|
|
8753
|
+
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8738
8754
|
id: props.id,
|
|
8739
8755
|
name: props.name,
|
|
8740
|
-
placeholder: intl.formatMessage(messages$
|
|
8756
|
+
placeholder: intl.formatMessage(messages$s.searchSelectInputPlaceholder),
|
|
8741
8757
|
horizontalConstraint: props.horizontalConstraint,
|
|
8742
8758
|
loadOptions: loadOptionsDebounced,
|
|
8743
8759
|
defaultOptions: false,
|
|
@@ -8751,8 +8767,11 @@ const StoresSearchSelectInput = props => {
|
|
|
8751
8767
|
}),
|
|
8752
8768
|
onChange: props.onChange,
|
|
8753
8769
|
onBlur: props.onBlur,
|
|
8754
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8755
|
-
noOptionsMessage:
|
|
8770
|
+
loadingMessage: intl.formatMessage(messages$s.searchSelectInputLoadingMessage),
|
|
8771
|
+
noOptionsMessage: _ref4 => {
|
|
8772
|
+
let inputValue = _ref4.inputValue;
|
|
8773
|
+
return intl.formatMessage(inputValue ? messages$s.searchSelectInputNoOptionsFoundMessage : messages$s.searchSelectInputNoValueMessage);
|
|
8774
|
+
},
|
|
8756
8775
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8757
8776
|
isReadOnly: props.isReadOnly,
|
|
8758
8777
|
isClearable: props.isClearable,
|
|
@@ -8780,8 +8799,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8780
8799
|
shouldFetchProductSelections: false
|
|
8781
8800
|
};
|
|
8782
8801
|
|
|
8783
|
-
function ownKeys$
|
|
8784
|
-
function _objectSpread$
|
|
8802
|
+
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; }
|
|
8803
|
+
function _objectSpread$z(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$z(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$z(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8785
8804
|
const StoreSelectInput = props => {
|
|
8786
8805
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8787
8806
|
const components = React.useMemo(() => {
|
|
@@ -8789,7 +8808,7 @@ const StoreSelectInput = props => {
|
|
|
8789
8808
|
// eslint-disable-next-line react/display-name
|
|
8790
8809
|
Option: optionInnerProps => {
|
|
8791
8810
|
if (optionInnerProps.isDisabled) {
|
|
8792
|
-
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$
|
|
8811
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$z({}, optionInnerProps));
|
|
8793
8812
|
}
|
|
8794
8813
|
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8795
8814
|
optionType: props.optionType,
|
|
@@ -8800,7 +8819,7 @@ const StoreSelectInput = props => {
|
|
|
8800
8819
|
}, [props.optionType]);
|
|
8801
8820
|
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8802
8821
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8803
|
-
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$
|
|
8822
|
+
return jsxRuntime.jsx(CustomStoreSelectInput, _objectSpread$z(_objectSpread$z({
|
|
8804
8823
|
projectKey: props.projectKey,
|
|
8805
8824
|
id: props.id,
|
|
8806
8825
|
name: props.name,
|
|
@@ -8840,11 +8859,22 @@ StoreSelectInput.defaultProps = {
|
|
|
8840
8859
|
shouldFetchProductSelections: false
|
|
8841
8860
|
};
|
|
8842
8861
|
|
|
8843
|
-
//
|
|
8862
|
+
// Values have to match enum values on core ws
|
|
8844
8863
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
8845
|
-
const
|
|
8864
|
+
const businessRoleConstants = {
|
|
8865
|
+
ExecutiveManagement: 'ExecutiveManagement',
|
|
8866
|
+
Architect: 'Architect',
|
|
8867
|
+
Engineer: 'Engineer',
|
|
8868
|
+
ProductProjectManagerOrOwner: 'ProductProjectManagerOrOwner',
|
|
8869
|
+
Marketing: 'Marketing',
|
|
8870
|
+
CustomerService: 'CustomerService',
|
|
8871
|
+
SalesAndECommerceManager: 'SalesAndECommerceManager',
|
|
8872
|
+
Other: 'Other'
|
|
8873
|
+
};
|
|
8846
8874
|
|
|
8847
|
-
|
|
8875
|
+
const businessRoleKeys = _Object$values__default["default"](businessRoleConstants);
|
|
8876
|
+
|
|
8877
|
+
var messages$r = reactIntl.defineMessages({
|
|
8848
8878
|
ExecutiveManagement: {
|
|
8849
8879
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8850
8880
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8902,7 +8932,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8902
8932
|
return _parseFloat__default["default"]((ratio * 100).toFixed(2));
|
|
8903
8933
|
}
|
|
8904
8934
|
|
|
8905
|
-
const messages$
|
|
8935
|
+
const messages$q = reactIntl.defineMessages({
|
|
8906
8936
|
inputFieldError: {
|
|
8907
8937
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8908
8938
|
description: 'Error message for empty input field ',
|
|
@@ -8923,14 +8953,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8923
8953
|
if (validateSingleFilter({
|
|
8924
8954
|
value
|
|
8925
8955
|
})) {
|
|
8926
|
-
return intl.formatMessage(messages$
|
|
8956
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8927
8957
|
}
|
|
8928
8958
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8929
8959
|
value: value.currencyCode
|
|
8930
8960
|
}) || validateSingleFilter({
|
|
8931
8961
|
value: value.amount
|
|
8932
8962
|
}))) {
|
|
8933
|
-
return intl.formatMessage(messages$
|
|
8963
|
+
return intl.formatMessage(messages$q.inputFieldError);
|
|
8934
8964
|
}
|
|
8935
8965
|
return null;
|
|
8936
8966
|
};
|
|
@@ -8938,7 +8968,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8938
8968
|
let value = _ref.value;
|
|
8939
8969
|
if (!value || !value.type) {
|
|
8940
8970
|
return {
|
|
8941
|
-
type: intl.formatMessage(messages$
|
|
8971
|
+
type: intl.formatMessage(messages$q.optionFieldError)
|
|
8942
8972
|
};
|
|
8943
8973
|
}
|
|
8944
8974
|
const typeName = value.type.name;
|
|
@@ -8946,7 +8976,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8946
8976
|
const filterValue = value.value;
|
|
8947
8977
|
if (hasOption && !value.option) {
|
|
8948
8978
|
return {
|
|
8949
|
-
option: intl.formatMessage(messages$
|
|
8979
|
+
option: intl.formatMessage(messages$q.optionFieldError)
|
|
8950
8980
|
};
|
|
8951
8981
|
}
|
|
8952
8982
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8965,7 +8995,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8965
8995
|
} : null;
|
|
8966
8996
|
}
|
|
8967
8997
|
|
|
8968
|
-
const messages$
|
|
8998
|
+
const messages$p = reactIntl.defineMessages({
|
|
8969
8999
|
rangeMissingValue: {
|
|
8970
9000
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
8971
9001
|
description: 'error message if missing a value in a range',
|
|
@@ -8990,25 +9020,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
8990
9020
|
if (validateSingleFilter({
|
|
8991
9021
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
8992
9022
|
})) return {
|
|
8993
|
-
from: intl.formatMessage(messages$
|
|
9023
|
+
from: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8994
9024
|
};
|
|
8995
9025
|
if (validateSingleFilter({
|
|
8996
9026
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
8997
9027
|
})) return {
|
|
8998
|
-
to: intl.formatMessage(messages$
|
|
9028
|
+
to: intl.formatMessage(messages$p.rangeMissingValue)
|
|
8999
9029
|
};
|
|
9000
9030
|
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 {
|
|
9001
|
-
from: intl.formatMessage(messages$
|
|
9031
|
+
from: intl.formatMessage(messages$p.rangeToSmallerThanFrom)
|
|
9002
9032
|
};
|
|
9003
9033
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9004
9034
|
if (validateSingleFilter({
|
|
9005
9035
|
value
|
|
9006
|
-
})) return intl.formatMessage(messages$
|
|
9036
|
+
})) return intl.formatMessage(messages$p.missingValue);
|
|
9007
9037
|
}
|
|
9008
9038
|
return null;
|
|
9009
9039
|
}
|
|
9010
9040
|
|
|
9011
|
-
const messages$
|
|
9041
|
+
const messages$o = reactIntl.defineMessages({
|
|
9012
9042
|
rangeMissingValue: {
|
|
9013
9043
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9014
9044
|
description: 'error message if missing a value in a range',
|
|
@@ -9027,30 +9057,30 @@ function validateFilter(_ref, intl) {
|
|
|
9027
9057
|
_ref$allowFloat = _ref.allowFloat,
|
|
9028
9058
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9029
9059
|
if (type !== 'range') {
|
|
9030
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
9060
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$K.integer);
|
|
9031
9061
|
return null;
|
|
9032
9062
|
}
|
|
9033
9063
|
|
|
9034
9064
|
// only range types from here
|
|
9035
9065
|
|
|
9036
9066
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9037
|
-
from: intl.formatMessage(messages$
|
|
9067
|
+
from: intl.formatMessage(messages$K.integer)
|
|
9038
9068
|
};
|
|
9039
9069
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9040
|
-
to: intl.formatMessage(messages$
|
|
9070
|
+
to: intl.formatMessage(messages$K.integer)
|
|
9041
9071
|
};
|
|
9042
9072
|
if (validateSingleFilter({
|
|
9043
9073
|
value: value.from
|
|
9044
9074
|
})) return {
|
|
9045
|
-
from: intl.formatMessage(messages$
|
|
9075
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9046
9076
|
};
|
|
9047
9077
|
if (validateSingleFilter({
|
|
9048
9078
|
value: value.to
|
|
9049
9079
|
})) return {
|
|
9050
|
-
to: intl.formatMessage(messages$
|
|
9080
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9051
9081
|
};
|
|
9052
9082
|
if (_parseFloat__default["default"](value.to) < _parseFloat__default["default"](value.from)) return {
|
|
9053
|
-
from: intl.formatMessage(messages$
|
|
9083
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9054
9084
|
};
|
|
9055
9085
|
return null;
|
|
9056
9086
|
}
|
|
@@ -9344,10 +9374,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9344
9374
|
carts: 'carts'
|
|
9345
9375
|
};
|
|
9346
9376
|
|
|
9347
|
-
function ownKeys$
|
|
9348
|
-
function _objectSpread$
|
|
9377
|
+
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; }
|
|
9378
|
+
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; }
|
|
9349
9379
|
const resourcesWithPlatformLimits = _Object$keys__default["default"](RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9350
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9380
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty__default["default"](resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$y({
|
|
9351
9381
|
[camelCase__default["default"]("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9352
9382
|
}, previousIncludedLimits), {});
|
|
9353
9383
|
|
|
@@ -9409,7 +9439,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9409
9439
|
};
|
|
9410
9440
|
};
|
|
9411
9441
|
|
|
9412
|
-
var messages$
|
|
9442
|
+
var messages$n = reactIntl.defineMessages({
|
|
9413
9443
|
shippingMethods: {
|
|
9414
9444
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9415
9445
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9437,8 +9467,8 @@ var messages$m = reactIntl.defineMessages({
|
|
|
9437
9467
|
}
|
|
9438
9468
|
});
|
|
9439
9469
|
|
|
9440
|
-
function ownKeys$
|
|
9441
|
-
function _objectSpread$
|
|
9470
|
+
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; }
|
|
9471
|
+
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; }
|
|
9442
9472
|
const getCustomerSupportLink$1 = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9443
9473
|
isExternal: true,
|
|
9444
9474
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9449,7 +9479,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9449
9479
|
limit = _ref.limit;
|
|
9450
9480
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9451
9481
|
type: "warning",
|
|
9452
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9482
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$x(_objectSpread$x({}, messages$n[resource]), {}, {
|
|
9453
9483
|
values: {
|
|
9454
9484
|
limit,
|
|
9455
9485
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9462,7 +9492,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9462
9492
|
};
|
|
9463
9493
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9464
9494
|
|
|
9465
|
-
var messages$
|
|
9495
|
+
var messages$m = reactIntl.defineMessages({
|
|
9466
9496
|
shippingMethods: {
|
|
9467
9497
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9468
9498
|
description: 'error message about platform limit exceeded',
|
|
@@ -9490,8 +9520,8 @@ var messages$l = reactIntl.defineMessages({
|
|
|
9490
9520
|
}
|
|
9491
9521
|
});
|
|
9492
9522
|
|
|
9493
|
-
function ownKeys$
|
|
9494
|
-
function _objectSpread$
|
|
9523
|
+
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; }
|
|
9524
|
+
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; }
|
|
9495
9525
|
const getCustomerSupportLink = msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9496
9526
|
isExternal: true,
|
|
9497
9527
|
to: constants.SUPPORT_PORTAL_URL,
|
|
@@ -9502,7 +9532,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9502
9532
|
limit = _ref.limit;
|
|
9503
9533
|
return jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9504
9534
|
type: "error",
|
|
9505
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9535
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$w(_objectSpread$w({}, messages$m[resource]), {}, {
|
|
9506
9536
|
values: {
|
|
9507
9537
|
limit,
|
|
9508
9538
|
customersupport: getCustomerSupportLink
|
|
@@ -9520,8 +9550,8 @@ const Notifications = {
|
|
|
9520
9550
|
Error: PlatformLimitErrorNotification
|
|
9521
9551
|
};
|
|
9522
9552
|
|
|
9523
|
-
function ownKeys$
|
|
9524
|
-
function _objectSpread$
|
|
9553
|
+
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; }
|
|
9554
|
+
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; }
|
|
9525
9555
|
const PlatformLimitsStatusText = _ref => {
|
|
9526
9556
|
let intlMessage = _ref.intlMessage,
|
|
9527
9557
|
children = _ref.children;
|
|
@@ -9530,7 +9560,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9530
9560
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
9531
9561
|
size: "xs",
|
|
9532
9562
|
children: [jsxRuntime.jsx("span", {
|
|
9533
|
-
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
9563
|
+
children: intlMessage && jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$v({}, intlMessage))
|
|
9534
9564
|
}), jsxRuntime.jsx("span", {
|
|
9535
9565
|
children: children
|
|
9536
9566
|
})]
|
|
@@ -9631,7 +9661,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9631
9661
|
};
|
|
9632
9662
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9633
9663
|
|
|
9634
|
-
var messages$
|
|
9664
|
+
var messages$l = reactIntl.defineMessages({
|
|
9635
9665
|
shippingMethodsPlatformLimitReached: {
|
|
9636
9666
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9637
9667
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9639,17 +9669,17 @@ var messages$k = reactIntl.defineMessages({
|
|
|
9639
9669
|
}
|
|
9640
9670
|
});
|
|
9641
9671
|
|
|
9642
|
-
function ownKeys$
|
|
9643
|
-
function _objectSpread$
|
|
9672
|
+
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; }
|
|
9673
|
+
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; }
|
|
9644
9674
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9645
9675
|
const intl = reactIntl.useIntl();
|
|
9646
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9647
|
-
title: intl.formatMessage(messages$
|
|
9676
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$u(_objectSpread$u({}, props), {}, {
|
|
9677
|
+
title: intl.formatMessage(messages$l.shippingMethodsPlatformLimitReached)
|
|
9648
9678
|
}));
|
|
9649
9679
|
};
|
|
9650
9680
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9651
9681
|
|
|
9652
|
-
var messages$
|
|
9682
|
+
var messages$k = reactIntl.defineMessages({
|
|
9653
9683
|
shippingMethodsStatus: {
|
|
9654
9684
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9655
9685
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9658,15 +9688,15 @@ var messages$j = reactIntl.defineMessages({
|
|
|
9658
9688
|
});
|
|
9659
9689
|
|
|
9660
9690
|
const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
9661
|
-
var _platformLimits$shipp, _platformLimits$shipp2
|
|
9691
|
+
var _platformLimits$shipp, _platformLimits$shipp2;
|
|
9662
9692
|
let total = _ref.total;
|
|
9663
9693
|
const intl = reactIntl.useIntl();
|
|
9664
9694
|
const _useShippingMethodsPl = useShippingMethodsPlatformLimitsFetcher(),
|
|
9665
9695
|
platformLimits = _useShippingMethodsPl.platformLimits;
|
|
9666
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9667
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9696
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 || (_platformLimits$shipp = _platformLimits$shipp.total) === null || _platformLimits$shipp === void 0 ? void 0 : _platformLimits$shipp.current;
|
|
9697
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$shipp2 = platformLimits.shippingMethods) === null || _platformLimits$shipp2 === void 0 || (_platformLimits$shipp2 = _platformLimits$shipp2.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.limit;
|
|
9668
9698
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9669
|
-
intlMessage: messages$
|
|
9699
|
+
intlMessage: messages$k.shippingMethodsStatus,
|
|
9670
9700
|
children: getPlatformLimitsStatus({
|
|
9671
9701
|
limit,
|
|
9672
9702
|
current,
|
|
@@ -9697,15 +9727,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9697
9727
|
};
|
|
9698
9728
|
};
|
|
9699
9729
|
|
|
9700
|
-
function ownKeys$
|
|
9701
|
-
function _objectSpread$
|
|
9730
|
+
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; }
|
|
9731
|
+
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; }
|
|
9702
9732
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9703
9733
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9704
9734
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9705
9735
|
const shippingMethodsProps = {
|
|
9706
9736
|
platformLimits: shippingMethodsPlatformLimits
|
|
9707
9737
|
};
|
|
9708
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9738
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$t(_objectSpread$t({}, props), shippingMethodsProps));
|
|
9709
9739
|
};
|
|
9710
9740
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9711
9741
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9778,7 +9808,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9778
9808
|
};
|
|
9779
9809
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9780
9810
|
|
|
9781
|
-
var messages$
|
|
9811
|
+
var messages$j = reactIntl.defineMessages({
|
|
9782
9812
|
taxCategoriesPlatformLimitReached: {
|
|
9783
9813
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9784
9814
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9786,17 +9816,17 @@ var messages$i = reactIntl.defineMessages({
|
|
|
9786
9816
|
}
|
|
9787
9817
|
});
|
|
9788
9818
|
|
|
9789
|
-
function ownKeys$
|
|
9790
|
-
function _objectSpread$
|
|
9819
|
+
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; }
|
|
9820
|
+
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; }
|
|
9791
9821
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9792
9822
|
const intl = reactIntl.useIntl();
|
|
9793
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9794
|
-
title: intl.formatMessage(messages$
|
|
9823
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9824
|
+
title: intl.formatMessage(messages$j.taxCategoriesPlatformLimitReached)
|
|
9795
9825
|
}));
|
|
9796
9826
|
};
|
|
9797
9827
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9798
9828
|
|
|
9799
|
-
var messages$
|
|
9829
|
+
var messages$i = reactIntl.defineMessages({
|
|
9800
9830
|
taxCategoriesStatus: {
|
|
9801
9831
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9802
9832
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9805,15 +9835,15 @@ var messages$h = reactIntl.defineMessages({
|
|
|
9805
9835
|
});
|
|
9806
9836
|
|
|
9807
9837
|
const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
9808
|
-
var _platformLimits$taxCa, _platformLimits$taxCa2
|
|
9838
|
+
var _platformLimits$taxCa, _platformLimits$taxCa2;
|
|
9809
9839
|
let total = _ref.total;
|
|
9810
9840
|
const intl = reactIntl.useIntl();
|
|
9811
9841
|
const _useTaxCategoriesPlat = useTaxCategoriesPlatformLimitsFetcher(),
|
|
9812
9842
|
platformLimits = _useTaxCategoriesPlat.platformLimits;
|
|
9813
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9814
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9843
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 || (_platformLimits$taxCa = _platformLimits$taxCa.total) === null || _platformLimits$taxCa === void 0 ? void 0 : _platformLimits$taxCa.current;
|
|
9844
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$taxCa2 = platformLimits.taxCategories) === null || _platformLimits$taxCa2 === void 0 || (_platformLimits$taxCa2 = _platformLimits$taxCa2.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.limit;
|
|
9815
9845
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9816
|
-
intlMessage: messages$
|
|
9846
|
+
intlMessage: messages$i.taxCategoriesStatus,
|
|
9817
9847
|
children: getPlatformLimitsStatus({
|
|
9818
9848
|
limit,
|
|
9819
9849
|
current,
|
|
@@ -9844,15 +9874,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9844
9874
|
};
|
|
9845
9875
|
};
|
|
9846
9876
|
|
|
9847
|
-
function ownKeys$
|
|
9848
|
-
function _objectSpread$
|
|
9877
|
+
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; }
|
|
9878
|
+
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; }
|
|
9849
9879
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9850
9880
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9851
9881
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9852
9882
|
const taxCategoriesProps = {
|
|
9853
9883
|
platformLimits: taxCategoriesPlatformLimits
|
|
9854
9884
|
};
|
|
9855
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
9885
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), taxCategoriesProps));
|
|
9856
9886
|
};
|
|
9857
9887
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9858
9888
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9925,7 +9955,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9925
9955
|
};
|
|
9926
9956
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9927
9957
|
|
|
9928
|
-
var messages$
|
|
9958
|
+
var messages$h = reactIntl.defineMessages({
|
|
9929
9959
|
zonesPlatformLimitReached: {
|
|
9930
9960
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9931
9961
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9933,17 +9963,17 @@ var messages$g = reactIntl.defineMessages({
|
|
|
9933
9963
|
}
|
|
9934
9964
|
});
|
|
9935
9965
|
|
|
9936
|
-
function ownKeys$
|
|
9937
|
-
function _objectSpread$
|
|
9966
|
+
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; }
|
|
9967
|
+
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; }
|
|
9938
9968
|
const PlatformLimitsZonesTooltip = props => {
|
|
9939
9969
|
const intl = reactIntl.useIntl();
|
|
9940
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
9941
|
-
title: intl.formatMessage(messages$
|
|
9970
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9971
|
+
title: intl.formatMessage(messages$h.zonesPlatformLimitReached)
|
|
9942
9972
|
}));
|
|
9943
9973
|
};
|
|
9944
9974
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9945
9975
|
|
|
9946
|
-
var messages$
|
|
9976
|
+
var messages$g = reactIntl.defineMessages({
|
|
9947
9977
|
zonesStatus: {
|
|
9948
9978
|
id: 'PlatformLimits.Status.zones',
|
|
9949
9979
|
description: 'The message for zones platform limit values',
|
|
@@ -9952,15 +9982,15 @@ var messages$f = reactIntl.defineMessages({
|
|
|
9952
9982
|
});
|
|
9953
9983
|
|
|
9954
9984
|
const PlatformLimitsZonesStatus = _ref => {
|
|
9955
|
-
var _platformLimits$zones, _platformLimits$zones2
|
|
9985
|
+
var _platformLimits$zones, _platformLimits$zones2;
|
|
9956
9986
|
let total = _ref.total;
|
|
9957
9987
|
const intl = reactIntl.useIntl();
|
|
9958
9988
|
const _useZonesPlatformLimi = useZonesPlatformLimitsFetcher(),
|
|
9959
9989
|
platformLimits = _useZonesPlatformLimi.platformLimits;
|
|
9960
|
-
const current = platformLimits === null || platformLimits === void 0
|
|
9961
|
-
const limit = platformLimits === null || platformLimits === void 0
|
|
9990
|
+
const current = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 || (_platformLimits$zones = _platformLimits$zones.total) === null || _platformLimits$zones === void 0 ? void 0 : _platformLimits$zones.current;
|
|
9991
|
+
const limit = platformLimits === null || platformLimits === void 0 || (_platformLimits$zones2 = platformLimits.zones) === null || _platformLimits$zones2 === void 0 || (_platformLimits$zones2 = _platformLimits$zones2.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.limit;
|
|
9962
9992
|
return jsxRuntime.jsx(PlatformLimitsStatusText, {
|
|
9963
|
-
intlMessage: messages$
|
|
9993
|
+
intlMessage: messages$g.zonesStatus,
|
|
9964
9994
|
children: getPlatformLimitsStatus({
|
|
9965
9995
|
limit,
|
|
9966
9996
|
current,
|
|
@@ -9991,15 +10021,15 @@ const useZonesLimits = () => {
|
|
|
9991
10021
|
};
|
|
9992
10022
|
};
|
|
9993
10023
|
|
|
9994
|
-
function ownKeys$
|
|
9995
|
-
function _objectSpread$
|
|
10024
|
+
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; }
|
|
10025
|
+
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; }
|
|
9996
10026
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
9997
10027
|
const WithZonesPlatformLimits = props => {
|
|
9998
10028
|
const zonesPlatformLimits = useZonesLimits();
|
|
9999
10029
|
const zonesProps = {
|
|
10000
10030
|
platformLimits: zonesPlatformLimits
|
|
10001
10031
|
};
|
|
10002
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10032
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), zonesProps));
|
|
10003
10033
|
};
|
|
10004
10034
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10005
10035
|
return WithZonesPlatformLimits;
|
|
@@ -10085,7 +10115,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10085
10115
|
};
|
|
10086
10116
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10087
10117
|
|
|
10088
|
-
var messages$
|
|
10118
|
+
var messages$f = reactIntl.defineMessages({
|
|
10089
10119
|
customersPlatformLimitReached: {
|
|
10090
10120
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10091
10121
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10093,17 +10123,17 @@ var messages$e = reactIntl.defineMessages({
|
|
|
10093
10123
|
}
|
|
10094
10124
|
});
|
|
10095
10125
|
|
|
10096
|
-
function ownKeys$
|
|
10097
|
-
function _objectSpread$
|
|
10126
|
+
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; }
|
|
10127
|
+
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; }
|
|
10098
10128
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10099
10129
|
const intl = reactIntl.useIntl();
|
|
10100
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10101
|
-
title: intl.formatMessage(messages$
|
|
10130
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
10131
|
+
title: intl.formatMessage(messages$f.customersPlatformLimitReached)
|
|
10102
10132
|
}));
|
|
10103
10133
|
};
|
|
10104
10134
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10105
10135
|
|
|
10106
|
-
var messages$
|
|
10136
|
+
var messages$e = reactIntl.defineMessages({
|
|
10107
10137
|
customersStatus: {
|
|
10108
10138
|
id: 'PlatformLimits.Status.customers',
|
|
10109
10139
|
description: 'The message for customers platform limit values',
|
|
@@ -10111,8 +10141,8 @@ var messages$d = reactIntl.defineMessages({
|
|
|
10111
10141
|
}
|
|
10112
10142
|
});
|
|
10113
10143
|
|
|
10114
|
-
function ownKeys$
|
|
10115
|
-
function _objectSpread$
|
|
10144
|
+
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; }
|
|
10145
|
+
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; }
|
|
10116
10146
|
var styles$b = {
|
|
10117
10147
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10118
10148
|
};
|
|
@@ -10132,7 +10162,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10132
10162
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10133
10163
|
tone: "secondary",
|
|
10134
10164
|
isInline: true,
|
|
10135
|
-
intlMessage: _objectSpread$
|
|
10165
|
+
intlMessage: _objectSpread$n(_objectSpread$n({}, messages$e.customersStatus), {}, {
|
|
10136
10166
|
values: {
|
|
10137
10167
|
current: intl.formatNumber(current),
|
|
10138
10168
|
limit: intl.formatNumber(limit)
|
|
@@ -10143,7 +10173,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10143
10173
|
};
|
|
10144
10174
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10145
10175
|
|
|
10146
|
-
var messages$
|
|
10176
|
+
var messages$d = reactIntl.defineMessages({
|
|
10147
10177
|
title: {
|
|
10148
10178
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10149
10179
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10156,10 +10186,10 @@ var messages$c = reactIntl.defineMessages({
|
|
|
10156
10186
|
}
|
|
10157
10187
|
});
|
|
10158
10188
|
|
|
10159
|
-
function ownKeys$
|
|
10160
|
-
function _objectSpread$
|
|
10189
|
+
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; }
|
|
10190
|
+
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; }
|
|
10161
10191
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10162
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10192
|
+
return jsxRuntime.jsxs("svg", _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10163
10193
|
children: [jsxRuntime.jsx("defs", {
|
|
10164
10194
|
children: jsxRuntime.jsx("path", {
|
|
10165
10195
|
id: "a",
|
|
@@ -10267,7 +10297,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10267
10297
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10268
10298
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10269
10299
|
onClose: onClose,
|
|
10270
|
-
title: intl.formatMessage(messages$
|
|
10300
|
+
title: intl.formatMessage(messages$d.title),
|
|
10271
10301
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10272
10302
|
scale: "m",
|
|
10273
10303
|
alignItems: "center",
|
|
@@ -10276,7 +10306,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10276
10306
|
alignItems: "center",
|
|
10277
10307
|
children: [jsxRuntime.jsx(PlatformLimitsCustomersNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10278
10308
|
onClick: onClose,
|
|
10279
|
-
label: intl.formatMessage(messages$
|
|
10309
|
+
label: intl.formatMessage(messages$d.backToList),
|
|
10280
10310
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10281
10311
|
size: "medium",
|
|
10282
10312
|
color: "primary"
|
|
@@ -10331,15 +10361,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10331
10361
|
};
|
|
10332
10362
|
};
|
|
10333
10363
|
|
|
10334
|
-
function ownKeys$
|
|
10335
|
-
function _objectSpread$
|
|
10364
|
+
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; }
|
|
10365
|
+
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; }
|
|
10336
10366
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10337
10367
|
const WithCustomersPlatformLimits = props => {
|
|
10338
10368
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10339
10369
|
const customersProps = {
|
|
10340
10370
|
platformLimits: CustomersPlatformLimits
|
|
10341
10371
|
};
|
|
10342
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10372
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$l(_objectSpread$l({}, props), customersProps));
|
|
10343
10373
|
};
|
|
10344
10374
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10345
10375
|
return WithCustomersPlatformLimits;
|
|
@@ -10425,7 +10455,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10425
10455
|
};
|
|
10426
10456
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10427
10457
|
|
|
10428
|
-
var messages$
|
|
10458
|
+
var messages$c = reactIntl.defineMessages({
|
|
10429
10459
|
customerGroupsPlatformLimitReached: {
|
|
10430
10460
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10431
10461
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10433,17 +10463,17 @@ var messages$b = reactIntl.defineMessages({
|
|
|
10433
10463
|
}
|
|
10434
10464
|
});
|
|
10435
10465
|
|
|
10436
|
-
function ownKeys$
|
|
10437
|
-
function _objectSpread$
|
|
10466
|
+
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; }
|
|
10467
|
+
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; }
|
|
10438
10468
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10439
10469
|
const intl = reactIntl.useIntl();
|
|
10440
|
-
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$
|
|
10441
|
-
title: intl.formatMessage(messages$
|
|
10470
|
+
return jsxRuntime.jsx(uiKit.Tooltip, _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10471
|
+
title: intl.formatMessage(messages$c.customerGroupsPlatformLimitReached)
|
|
10442
10472
|
}));
|
|
10443
10473
|
};
|
|
10444
10474
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10445
10475
|
|
|
10446
|
-
var messages$
|
|
10476
|
+
var messages$b = reactIntl.defineMessages({
|
|
10447
10477
|
customerGroupsStatus: {
|
|
10448
10478
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10449
10479
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10451,8 +10481,8 @@ var messages$a = reactIntl.defineMessages({
|
|
|
10451
10481
|
}
|
|
10452
10482
|
});
|
|
10453
10483
|
|
|
10454
|
-
function ownKeys$
|
|
10455
|
-
function _objectSpread$
|
|
10484
|
+
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; }
|
|
10485
|
+
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; }
|
|
10456
10486
|
var styles$9 = {
|
|
10457
10487
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10458
10488
|
};
|
|
@@ -10472,7 +10502,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10472
10502
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
10473
10503
|
tone: "secondary",
|
|
10474
10504
|
isInline: true,
|
|
10475
|
-
intlMessage: _objectSpread$
|
|
10505
|
+
intlMessage: _objectSpread$j(_objectSpread$j({}, messages$b.customerGroupsStatus), {}, {
|
|
10476
10506
|
values: {
|
|
10477
10507
|
current: intl.formatNumber(current),
|
|
10478
10508
|
limit: intl.formatNumber(limit)
|
|
@@ -10483,7 +10513,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10483
10513
|
};
|
|
10484
10514
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10485
10515
|
|
|
10486
|
-
var messages$
|
|
10516
|
+
var messages$a = reactIntl.defineMessages({
|
|
10487
10517
|
title: {
|
|
10488
10518
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10489
10519
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10496,10 +10526,10 @@ var messages$9 = reactIntl.defineMessages({
|
|
|
10496
10526
|
}
|
|
10497
10527
|
});
|
|
10498
10528
|
|
|
10499
|
-
function ownKeys$
|
|
10500
|
-
function _objectSpread$
|
|
10529
|
+
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; }
|
|
10530
|
+
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; }
|
|
10501
10531
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10502
|
-
return jsxRuntime.jsxs("svg", _objectSpread$
|
|
10532
|
+
return jsxRuntime.jsxs("svg", _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10503
10533
|
children: [jsxRuntime.jsx("defs", {
|
|
10504
10534
|
children: jsxRuntime.jsx("path", {
|
|
10505
10535
|
id: "a",
|
|
@@ -10607,7 +10637,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10607
10637
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
10608
10638
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10609
10639
|
onClose: onClose,
|
|
10610
|
-
title: intl.formatMessage(messages$
|
|
10640
|
+
title: intl.formatMessage(messages$a.title),
|
|
10611
10641
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
10612
10642
|
scale: "m",
|
|
10613
10643
|
alignItems: "center",
|
|
@@ -10616,7 +10646,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10616
10646
|
alignItems: "center",
|
|
10617
10647
|
children: [jsxRuntime.jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
10618
10648
|
onClick: onClose,
|
|
10619
|
-
label: intl.formatMessage(messages$
|
|
10649
|
+
label: intl.formatMessage(messages$a.backToList),
|
|
10620
10650
|
icon: jsxRuntime.jsx(uiKit.ListIcon, {
|
|
10621
10651
|
size: "medium",
|
|
10622
10652
|
color: "primary"
|
|
@@ -10671,15 +10701,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10671
10701
|
};
|
|
10672
10702
|
};
|
|
10673
10703
|
|
|
10674
|
-
function ownKeys$
|
|
10675
|
-
function _objectSpread$
|
|
10704
|
+
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; }
|
|
10705
|
+
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; }
|
|
10676
10706
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10677
10707
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10678
10708
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10679
10709
|
const customersProps = {
|
|
10680
10710
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10681
10711
|
};
|
|
10682
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
10712
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$h(_objectSpread$h({}, props), customersProps));
|
|
10683
10713
|
};
|
|
10684
10714
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10685
10715
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10734,7 +10764,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10734
10764
|
}
|
|
10735
10765
|
});
|
|
10736
10766
|
|
|
10737
|
-
var messages$
|
|
10767
|
+
var messages$9 = reactIntl.defineMessages({
|
|
10738
10768
|
indexingSucceed: {
|
|
10739
10769
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10740
10770
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10772,8 +10802,8 @@ const defaultValue = {
|
|
|
10772
10802
|
*/
|
|
10773
10803
|
const PimIndexerContext = /*#__PURE__*/React.createContext(defaultValue);
|
|
10774
10804
|
|
|
10775
|
-
function ownKeys$
|
|
10776
|
-
function _objectSpread$
|
|
10805
|
+
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; }
|
|
10806
|
+
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; }
|
|
10777
10807
|
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); }; }
|
|
10778
10808
|
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; } }
|
|
10779
10809
|
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 } } } };
|
|
@@ -10859,7 +10889,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10859
10889
|
_this.props.notifications.showNotification({
|
|
10860
10890
|
kind: 'error',
|
|
10861
10891
|
domain: constants.DOMAINS.SIDE,
|
|
10862
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10892
|
+
text: _this.props.intl.formatMessage(messages$9.indexingFailed)
|
|
10863
10893
|
});
|
|
10864
10894
|
};
|
|
10865
10895
|
_this.getIndexingProgress = async () => {
|
|
@@ -10900,7 +10930,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10900
10930
|
_this.props.notifications.showNotification({
|
|
10901
10931
|
kind: 'success',
|
|
10902
10932
|
domain: constants.DOMAINS.SIDE,
|
|
10903
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10933
|
+
text: _this.props.intl.formatMessage(messages$9.indexingSucceed)
|
|
10904
10934
|
},
|
|
10905
10935
|
// because the indexing may take so long, the success notification
|
|
10906
10936
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10949,7 +10979,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10949
10979
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10950
10980
|
}
|
|
10951
10981
|
});
|
|
10952
|
-
_this.setState(_objectSpread$
|
|
10982
|
+
_this.setState(_objectSpread$g(_objectSpread$g({
|
|
10953
10983
|
isLoading: false,
|
|
10954
10984
|
isProjectBeingIndexedByPim: true
|
|
10955
10985
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -10974,7 +11004,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10974
11004
|
key: "render",
|
|
10975
11005
|
value: function render() {
|
|
10976
11006
|
return jsxRuntime.jsx(PimIndexerContext.Provider, {
|
|
10977
|
-
value: _objectSpread$
|
|
11007
|
+
value: _objectSpread$g(_objectSpread$g({}, this.state), {}, {
|
|
10978
11008
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
10979
11009
|
indexProject: this.indexProject
|
|
10980
11010
|
}),
|
|
@@ -11016,13 +11046,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11016
11046
|
}(React.PureComponent);
|
|
11017
11047
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11018
11048
|
|
|
11019
|
-
function ownKeys$
|
|
11020
|
-
function _objectSpread$
|
|
11049
|
+
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; }
|
|
11050
|
+
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; }
|
|
11021
11051
|
var injectPimIndexer = (function () {
|
|
11022
11052
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11023
11053
|
return Component => {
|
|
11024
11054
|
const WrappedComponent = props => jsxRuntime.jsx(WithPimIndexer, {
|
|
11025
|
-
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$
|
|
11055
|
+
children: pimIndexerProps => jsxRuntime.jsx(Component, _objectSpread$f(_objectSpread$f({}, props), {}, {
|
|
11026
11056
|
[propName]: pimIndexerProps
|
|
11027
11057
|
}))
|
|
11028
11058
|
});
|
|
@@ -11035,7 +11065,7 @@ function usePimIndexer() {
|
|
|
11035
11065
|
return React.useContext(PimIndexerContext);
|
|
11036
11066
|
}
|
|
11037
11067
|
|
|
11038
|
-
var messages$
|
|
11068
|
+
var messages$8 = reactIntl.defineMessages({
|
|
11039
11069
|
yes: {
|
|
11040
11070
|
id: 'BooleanField.yes',
|
|
11041
11071
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11057,8 +11087,8 @@ const BooleanField = props => {
|
|
|
11057
11087
|
var _context;
|
|
11058
11088
|
let selectedValue;
|
|
11059
11089
|
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]);
|
|
11060
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11061
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
11090
|
+
const yesLabel = props.intl.formatMessage(messages$8.yes);
|
|
11091
|
+
const noLabel = props.intl.formatMessage(messages$8.no);
|
|
11062
11092
|
const options = [{
|
|
11063
11093
|
value: 'yes',
|
|
11064
11094
|
label: yesLabel
|
|
@@ -11096,7 +11126,7 @@ function getBooleanValue(value) {
|
|
|
11096
11126
|
return value === false ? 'no' : 'yes';
|
|
11097
11127
|
}
|
|
11098
11128
|
|
|
11099
|
-
var messages$
|
|
11129
|
+
var messages$7 = reactIntl.defineMessages({
|
|
11100
11130
|
label: {
|
|
11101
11131
|
id: 'MissingValueField.label',
|
|
11102
11132
|
description: 'The label text for the missing values option',
|
|
@@ -11104,20 +11134,20 @@ var messages$6 = reactIntl.defineMessages({
|
|
|
11104
11134
|
}
|
|
11105
11135
|
});
|
|
11106
11136
|
|
|
11107
|
-
function ownKeys$
|
|
11108
|
-
function _objectSpread$
|
|
11137
|
+
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; }
|
|
11138
|
+
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; }
|
|
11109
11139
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
11110
11140
|
name: "missing-value",
|
|
11111
11141
|
isChecked: props.isChecked,
|
|
11112
11142
|
onChange: props.onChange,
|
|
11113
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11143
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$e({}, messages$7.label))
|
|
11114
11144
|
});
|
|
11115
11145
|
MissingValueField.defaultProps = {
|
|
11116
11146
|
isChecked: false
|
|
11117
11147
|
};
|
|
11118
11148
|
|
|
11119
|
-
function ownKeys$
|
|
11120
|
-
function _objectSpread$
|
|
11149
|
+
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; }
|
|
11150
|
+
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; }
|
|
11121
11151
|
var styles$7 = {
|
|
11122
11152
|
"button": "button-module__button___1OzVf",
|
|
11123
11153
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
@@ -11151,7 +11181,7 @@ const Button = props => {
|
|
|
11151
11181
|
|
|
11152
11182
|
// Pass only `data-*` props
|
|
11153
11183
|
const dataProps = filterDataAttributes(props);
|
|
11154
|
-
return jsxRuntime.jsx("button", _objectSpread$
|
|
11184
|
+
return jsxRuntime.jsx("button", _objectSpread$d(_objectSpread$d({
|
|
11155
11185
|
onClick: isDisabled ? null : onClick,
|
|
11156
11186
|
type: props.type,
|
|
11157
11187
|
className: classnames__default["default"](styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
@@ -11166,7 +11196,7 @@ Button.defaultProps = {
|
|
|
11166
11196
|
type: 'button'
|
|
11167
11197
|
};
|
|
11168
11198
|
|
|
11169
|
-
var messages$
|
|
11199
|
+
var messages$6 = reactIntl.defineMessages({
|
|
11170
11200
|
chooseFile: {
|
|
11171
11201
|
id: 'ButtonFileInput.chooseFile',
|
|
11172
11202
|
description: 'The label text of the field for upload local file',
|
|
@@ -11174,8 +11204,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
11174
11204
|
}
|
|
11175
11205
|
});
|
|
11176
11206
|
|
|
11177
|
-
function ownKeys$
|
|
11178
|
-
function _objectSpread$
|
|
11207
|
+
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; }
|
|
11208
|
+
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; }
|
|
11179
11209
|
var styles$6 = {
|
|
11180
11210
|
"button": "file-input-module__button___2KypN",
|
|
11181
11211
|
"input": "file-input-module__input___3MP4D"
|
|
@@ -11195,7 +11225,7 @@ const FileInput = props => jsxRuntime.jsx("label", {
|
|
|
11195
11225
|
});
|
|
11196
11226
|
FileInput.displayName = 'FileInput';
|
|
11197
11227
|
FileInput.defaultProps = {
|
|
11198
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11228
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$c({}, messages$6.chooseFile)),
|
|
11199
11229
|
allowMultiple: false,
|
|
11200
11230
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11201
11231
|
};
|
|
@@ -11242,7 +11272,7 @@ const ScrollToFieldError = () => {
|
|
|
11242
11272
|
return null;
|
|
11243
11273
|
};
|
|
11244
11274
|
|
|
11245
|
-
var messages$
|
|
11275
|
+
var messages$5 = reactIntl.defineMessages({
|
|
11246
11276
|
buttonLabel: {
|
|
11247
11277
|
id: 'SearchInput.buttonLabel',
|
|
11248
11278
|
description: 'Label for "Search" button.',
|
|
@@ -11297,15 +11327,15 @@ const SelectableFieldSearchInput = props => {
|
|
|
11297
11327
|
});
|
|
11298
11328
|
},
|
|
11299
11329
|
onReset: props.onReset,
|
|
11300
|
-
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$
|
|
11330
|
+
placeholder: (_props$placeholder = props.placeholder) !== null && _props$placeholder !== void 0 ? _props$placeholder : intl.formatMessage(messages$5.placeholder),
|
|
11301
11331
|
isDisabled: props.disabled
|
|
11302
11332
|
})
|
|
11303
11333
|
});
|
|
11304
11334
|
};
|
|
11305
11335
|
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
11306
11336
|
|
|
11307
|
-
function ownKeys$
|
|
11308
|
-
function _objectSpread$
|
|
11337
|
+
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; }
|
|
11338
|
+
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; }
|
|
11309
11339
|
const StoreSelectField = props => {
|
|
11310
11340
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
11311
11341
|
max: props.horizontalConstraint,
|
|
@@ -11319,7 +11349,7 @@ const StoreSelectField = props => {
|
|
|
11319
11349
|
htmlFor: props.id,
|
|
11320
11350
|
hasRequiredIndicator: props.isRequired,
|
|
11321
11351
|
isBold: true
|
|
11322
|
-
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$
|
|
11352
|
+
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$b(_objectSpread$b({
|
|
11323
11353
|
projectKey: props.projectKey,
|
|
11324
11354
|
id: props.id,
|
|
11325
11355
|
name: props.name,
|
|
@@ -11359,8 +11389,8 @@ StoreSelectField.defaultProps = {
|
|
|
11359
11389
|
};
|
|
11360
11390
|
|
|
11361
11391
|
var _templateObject;
|
|
11362
|
-
function ownKeys$
|
|
11363
|
-
function _objectSpread$
|
|
11392
|
+
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; }
|
|
11393
|
+
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; }
|
|
11364
11394
|
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11365
11395
|
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11366
11396
|
var styles$3 = {
|
|
@@ -11377,7 +11407,7 @@ const validateRequired = value => {
|
|
|
11377
11407
|
};
|
|
11378
11408
|
const VALIDATOR_REQUIRED = {
|
|
11379
11409
|
name: 'required',
|
|
11380
|
-
message: messages$
|
|
11410
|
+
message: messages$K.required,
|
|
11381
11411
|
permanent: true,
|
|
11382
11412
|
validators: {
|
|
11383
11413
|
change(value) {
|
|
@@ -11391,7 +11421,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11391
11421
|
};
|
|
11392
11422
|
const VALIDATOR_NUMERIC = {
|
|
11393
11423
|
name: 'numeric',
|
|
11394
|
-
message: messages$
|
|
11424
|
+
message: messages$K.numeric,
|
|
11395
11425
|
permanent: false,
|
|
11396
11426
|
validators: {
|
|
11397
11427
|
change: v => {
|
|
@@ -11406,7 +11436,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11406
11436
|
};
|
|
11407
11437
|
const VALIDATOR_INTEGER = {
|
|
11408
11438
|
name: 'integer',
|
|
11409
|
-
message: messages$
|
|
11439
|
+
message: messages$K.integer,
|
|
11410
11440
|
permanent: false,
|
|
11411
11441
|
validators: {
|
|
11412
11442
|
change: v => {
|
|
@@ -11421,7 +11451,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11421
11451
|
};
|
|
11422
11452
|
({
|
|
11423
11453
|
name: 'email',
|
|
11424
|
-
message: messages$
|
|
11454
|
+
message: messages$K.email,
|
|
11425
11455
|
permanent: false,
|
|
11426
11456
|
validators: {
|
|
11427
11457
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -11510,7 +11540,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11510
11540
|
* so it must be an invalid numeric value
|
|
11511
11541
|
*/
|
|
11512
11542
|
_this.handleInvalid = () => {
|
|
11513
|
-
const nextValidStatus = _objectSpread$
|
|
11543
|
+
const nextValidStatus = _objectSpread$a({}, _this.state.validStatus);
|
|
11514
11544
|
if (has__default["default"](nextValidStatus, 'numeric')) {
|
|
11515
11545
|
nextValidStatus.numeric = false;
|
|
11516
11546
|
_this.conditionalSetValidStatus(nextValidStatus);
|
|
@@ -11544,10 +11574,10 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11544
11574
|
process.env.NODE_ENV !== "production" ? warning__default["default"](hasWarned, warningMessage) : void 0;
|
|
11545
11575
|
hasWarned = true;
|
|
11546
11576
|
}
|
|
11547
|
-
// eslint-disable-next-line camelcase
|
|
11548
11577
|
}, {
|
|
11549
|
-
key: "
|
|
11550
|
-
value: function
|
|
11578
|
+
key: "componentDidUpdate",
|
|
11579
|
+
value: function componentDidUpdate() {
|
|
11580
|
+
const nextProps = this.props;
|
|
11551
11581
|
if (nextProps.attribute && nextProps.attribute.value || nextProps.value) {
|
|
11552
11582
|
this.resetValidity();
|
|
11553
11583
|
this.handleChange(nextProps.value, {
|
|
@@ -11562,7 +11592,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11562
11592
|
if (prev) return this.state.validStatus[v.name];
|
|
11563
11593
|
return prev;
|
|
11564
11594
|
}, true);
|
|
11565
|
-
const componentProps = _objectSpread$
|
|
11595
|
+
const componentProps = _objectSpread$a(_objectSpread$a({}, this.props), {}, {
|
|
11566
11596
|
[blurHandler || 'onBlurValue']: this.handleBlur,
|
|
11567
11597
|
[changeHandler || 'onChange']: this.handleChange,
|
|
11568
11598
|
onInvalidValue: this.handleInvalid,
|
|
@@ -11579,7 +11609,7 @@ function validatedInput(InnerComponent, validators) {
|
|
|
11579
11609
|
components: {
|
|
11580
11610
|
WrapperComponent: ToolTipWrapperComponent
|
|
11581
11611
|
},
|
|
11582
|
-
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$
|
|
11612
|
+
children: jsxRuntime.jsx(_InnerComponent, _objectSpread$a({}, componentProps))
|
|
11583
11613
|
})
|
|
11584
11614
|
});
|
|
11585
11615
|
}
|
|
@@ -11634,7 +11664,7 @@ function simpleInput(type) {
|
|
|
11634
11664
|
}, _class;
|
|
11635
11665
|
}
|
|
11636
11666
|
|
|
11637
|
-
var messages$
|
|
11667
|
+
var messages$4 = reactIntl.defineMessages({
|
|
11638
11668
|
customFieldsError: {
|
|
11639
11669
|
id: 'CustomFieldsError.Error',
|
|
11640
11670
|
description: 'The message when there are errors adding custom fields',
|
|
@@ -11642,14 +11672,14 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
11642
11672
|
}
|
|
11643
11673
|
});
|
|
11644
11674
|
|
|
11645
|
-
function ownKeys$
|
|
11646
|
-
function _objectSpread$
|
|
11675
|
+
function ownKeys$9(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11676
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$9(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11647
11677
|
const CustomFieldsErrorTextNotification = props => {
|
|
11648
11678
|
var _context;
|
|
11649
11679
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
11650
11680
|
scale: "s",
|
|
11651
11681
|
children: [jsxRuntime.jsx(uiKit.Text.Wrap, {
|
|
11652
|
-
intlMessage: _objectSpread$
|
|
11682
|
+
intlMessage: _objectSpread$9({}, messages$4.customFieldsError)
|
|
11653
11683
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
11654
11684
|
scale: "xs",
|
|
11655
11685
|
children: _mapInstanceProperty__default["default"](_context = props.formErrors).call(_context, formError => jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -11661,7 +11691,7 @@ const CustomFieldsErrorTextNotification = props => {
|
|
|
11661
11691
|
};
|
|
11662
11692
|
CustomFieldsErrorTextNotification.displayName = 'CustomFieldsErrorTextNotification';
|
|
11663
11693
|
|
|
11664
|
-
const messages$
|
|
11694
|
+
const messages$3 = reactIntl.defineMessages({
|
|
11665
11695
|
from: {
|
|
11666
11696
|
id: 'LabelRange.from',
|
|
11667
11697
|
description: 'The label for "from" range',
|
|
@@ -11674,8 +11704,8 @@ const messages$2 = reactIntl.defineMessages({
|
|
|
11674
11704
|
}
|
|
11675
11705
|
});
|
|
11676
11706
|
|
|
11677
|
-
function ownKeys$
|
|
11678
|
-
function _objectSpread$
|
|
11707
|
+
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11708
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11679
11709
|
var styles$2 = {
|
|
11680
11710
|
"label": "label-range-module__label___3Tb0p"
|
|
11681
11711
|
};
|
|
@@ -11683,12 +11713,12 @@ const LabelRange = _ref => {
|
|
|
11683
11713
|
let type = _ref.type;
|
|
11684
11714
|
return jsxRuntime.jsx("label", {
|
|
11685
11715
|
className: styles$2.label,
|
|
11686
|
-
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
11716
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$3[type]))
|
|
11687
11717
|
});
|
|
11688
11718
|
};
|
|
11689
11719
|
LabelRange.displayName = 'LabelRange';
|
|
11690
11720
|
|
|
11691
|
-
var messages$
|
|
11721
|
+
var messages$2 = reactIntl.defineMessages({
|
|
11692
11722
|
filterWholeInput: {
|
|
11693
11723
|
id: 'MultiValueSearchInput.buttonLabel',
|
|
11694
11724
|
description: 'Label for "MultiValueSearchInput" filter whole input.',
|
|
@@ -11701,8 +11731,8 @@ var messages$1 = reactIntl.defineMessages({
|
|
|
11701
11731
|
}
|
|
11702
11732
|
});
|
|
11703
11733
|
|
|
11704
|
-
function ownKeys$
|
|
11705
|
-
function _objectSpread$
|
|
11734
|
+
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11735
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$7(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11706
11736
|
var styles$1 = {
|
|
11707
11737
|
"container": "multi-value-search-input-module__container___2u64d",
|
|
11708
11738
|
"searchInput": "multi-value-search-input-module__searchInput___363nj",
|
|
@@ -11726,7 +11756,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11726
11756
|
}),
|
|
11727
11757
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11728
11758
|
truncate: true,
|
|
11729
|
-
intlMessage: _objectSpread$
|
|
11759
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterWholeInput), {}, {
|
|
11730
11760
|
values: {
|
|
11731
11761
|
values: "\"".concat(props.value, "\"")
|
|
11732
11762
|
}
|
|
@@ -11739,7 +11769,7 @@ const MultiValueSelectorDropdown = props => {
|
|
|
11739
11769
|
}),
|
|
11740
11770
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
11741
11771
|
truncate: true,
|
|
11742
|
-
intlMessage: _objectSpread$
|
|
11772
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$2.filterSeparateValues), {}, {
|
|
11743
11773
|
values: {
|
|
11744
11774
|
values: "\"".concat(props.multiValue.join('", "'), "\"") || props.value
|
|
11745
11775
|
}
|
|
@@ -11850,8 +11880,8 @@ const MultiValueSearchInput = props => {
|
|
|
11850
11880
|
};
|
|
11851
11881
|
MultiValueSearchInput.displayName = 'MultiValueSearchInput';
|
|
11852
11882
|
|
|
11853
|
-
function ownKeys$
|
|
11854
|
-
function _objectSpread$
|
|
11883
|
+
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11884
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$6(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
11855
11885
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11856
11886
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11857
11887
|
var styles = {
|
|
@@ -11914,7 +11944,7 @@ let NumericFormatInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
11914
11944
|
value: function render() {
|
|
11915
11945
|
const separators = getSeparatorsForLocale(this.props.numberFormat);
|
|
11916
11946
|
const dataAttributes = filterDataAttributes(this.props);
|
|
11917
|
-
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$
|
|
11947
|
+
return jsxRuntime.jsx(Cleave__default["default"], _objectSpread$6({
|
|
11918
11948
|
placeholder: this.props.placeholder,
|
|
11919
11949
|
htmlRef: this.registerInputRef,
|
|
11920
11950
|
options: {
|
|
@@ -12210,8 +12240,8 @@ const createNextSortDefinition = _ref => {
|
|
|
12210
12240
|
}
|
|
12211
12241
|
};
|
|
12212
12242
|
|
|
12213
|
-
function ownKeys$
|
|
12214
|
-
function _objectSpread$
|
|
12243
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12244
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12215
12245
|
/**
|
|
12216
12246
|
* Creates reducer
|
|
12217
12247
|
* @param {Object} initialState
|
|
@@ -12227,13 +12257,13 @@ function createReducer(initialState, actionHandlers) {
|
|
|
12227
12257
|
|
|
12228
12258
|
// In case reducer ignored action, avoid creating new object
|
|
12229
12259
|
const newSubstate = reduce(newState, action);
|
|
12230
|
-
if (newSubstate) return _objectSpread$
|
|
12260
|
+
if (newSubstate) return _objectSpread$5(_objectSpread$5({}, newState), newSubstate);
|
|
12231
12261
|
return newState;
|
|
12232
12262
|
};
|
|
12233
12263
|
}
|
|
12234
12264
|
|
|
12235
|
-
function ownKeys$
|
|
12236
|
-
function _objectSpread$
|
|
12265
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12266
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12237
12267
|
function updateStatusInList(mergeData) {
|
|
12238
12268
|
return (state, _ref) => {
|
|
12239
12269
|
let payload = _ref.payload;
|
|
@@ -12242,15 +12272,15 @@ function updateStatusInList(mergeData) {
|
|
|
12242
12272
|
results[index] = mergeData(payload, results[index]);
|
|
12243
12273
|
results[index].checked = false;
|
|
12244
12274
|
return {
|
|
12245
|
-
currentQueryResult: _objectSpread$
|
|
12275
|
+
currentQueryResult: _objectSpread$4(_objectSpread$4({}, state.currentQueryResult), {}, {
|
|
12246
12276
|
results
|
|
12247
12277
|
})
|
|
12248
12278
|
};
|
|
12249
12279
|
};
|
|
12250
12280
|
}
|
|
12251
12281
|
|
|
12252
|
-
function ownKeys$
|
|
12253
|
-
function _objectSpread$
|
|
12282
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12283
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12254
12284
|
const identity = value => value;
|
|
12255
12285
|
function createResourceReducer(options) {
|
|
12256
12286
|
const _options$constantsPre = options.constantsPrefix,
|
|
@@ -12260,7 +12290,7 @@ function createResourceReducer(options) {
|
|
|
12260
12290
|
_options$initialState = options.initialState,
|
|
12261
12291
|
extendInitialState = _options$initialState === void 0 ? {} : _options$initialState;
|
|
12262
12292
|
const mergeData = options.mergeData || identity;
|
|
12263
|
-
const initialState = _objectSpread$
|
|
12293
|
+
const initialState = _objectSpread$3({
|
|
12264
12294
|
currentQueryResult: {
|
|
12265
12295
|
count: 0,
|
|
12266
12296
|
offset: 0,
|
|
@@ -12280,7 +12310,7 @@ function createResourceReducer(options) {
|
|
|
12280
12310
|
let payload = _ref.payload;
|
|
12281
12311
|
const results = state.currentQueryResult.results;
|
|
12282
12312
|
return {
|
|
12283
|
-
currentQueryResult: _objectSpread$
|
|
12313
|
+
currentQueryResult: _objectSpread$3(_objectSpread$3({}, state.currentQueryResult), {}, {
|
|
12284
12314
|
results: _filterInstanceProperty__default["default"](results).call(results, _ref2 => {
|
|
12285
12315
|
let id = _ref2.id;
|
|
12286
12316
|
return id !== payload.id;
|
|
@@ -12358,17 +12388,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12358
12388
|
}
|
|
12359
12389
|
|
|
12360
12390
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12361
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12391
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$K.required);
|
|
12362
12392
|
return null;
|
|
12363
12393
|
};
|
|
12364
12394
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12365
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12395
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$K.required);
|
|
12366
12396
|
return null;
|
|
12367
12397
|
};
|
|
12368
12398
|
|
|
12369
12399
|
// eslint-disable-next-line import/prefer-default-export
|
|
12370
12400
|
const validateText = (text, intl) => {
|
|
12371
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12401
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$K.required);
|
|
12372
12402
|
return null;
|
|
12373
12403
|
};
|
|
12374
12404
|
|
|
@@ -12455,7 +12485,7 @@ const safelyAddFallback = function (string) {
|
|
|
12455
12485
|
return string === '' ? fallback : string !== null && string !== void 0 ? string : fallback;
|
|
12456
12486
|
};
|
|
12457
12487
|
|
|
12458
|
-
var messages = reactIntl.defineMessages({
|
|
12488
|
+
var messages$1 = reactIntl.defineMessages({
|
|
12459
12489
|
booleanAttributeTrue: {
|
|
12460
12490
|
id: 'Products.ProductList.column.booleanTrue',
|
|
12461
12491
|
description: 'The message to show to user for displaying boolean attribute value of true',
|
|
@@ -12648,7 +12678,7 @@ const getAttributeValueByType = _ref12 => {
|
|
|
12648
12678
|
case 'boolean':
|
|
12649
12679
|
{
|
|
12650
12680
|
if (isNil__default["default"](value)) return constants.NO_VALUE_FALLBACK;
|
|
12651
|
-
return value ? intl.formatMessage(messages.booleanAttributeTrue) : intl.formatMessage(messages.booleanAttributeFalse);
|
|
12681
|
+
return value ? intl.formatMessage(messages$1.booleanAttributeTrue) : intl.formatMessage(messages$1.booleanAttributeFalse);
|
|
12652
12682
|
}
|
|
12653
12683
|
case 'reference':
|
|
12654
12684
|
return value.id || constants.NO_VALUE_FALLBACK;
|
|
@@ -12784,8 +12814,8 @@ const getTimeZoneId = memoize__default["default"]((selectedTimeZone, timeZones)
|
|
|
12784
12814
|
} else {
|
|
12785
12815
|
var _context3;
|
|
12786
12816
|
const fallbackTimeZoneId = _findInstanceProperty__default["default"](_context3 = _Object$keys__default["default"](timeZones)).call(_context3, timeZoneId => {
|
|
12787
|
-
var _timeZones$timeZoneId
|
|
12788
|
-
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0
|
|
12817
|
+
var _timeZones$timeZoneId;
|
|
12818
|
+
return (_timeZones$timeZoneId = timeZones[timeZoneId]) === null || _timeZones$timeZoneId === void 0 || (_timeZones$timeZoneId = _timeZones$timeZoneId.translationFor) === null || _timeZones$timeZoneId === void 0 ? void 0 : _someInstanceProperty__default["default"](_timeZones$timeZoneId).call(_timeZones$timeZoneId, fallbackTimeZone => fallbackTimeZone === selectedTimeZone);
|
|
12789
12819
|
});
|
|
12790
12820
|
if (fallbackTimeZoneId !== null && fallbackTimeZoneId !== void 0 && fallbackTimeZoneId.length) {
|
|
12791
12821
|
return fallbackTimeZoneId.toString();
|
|
@@ -12801,8 +12831,8 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
12801
12831
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
12802
12832
|
});
|
|
12803
12833
|
|
|
12804
|
-
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; }
|
|
12805
|
-
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; }
|
|
12834
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12835
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12806
12836
|
function withPendingRequests() {
|
|
12807
12837
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pendingRequests';
|
|
12808
12838
|
return Component => {
|
|
@@ -12811,13 +12841,184 @@ function withPendingRequests() {
|
|
|
12811
12841
|
const pendingProp = {
|
|
12812
12842
|
[propName]: pendingRequests
|
|
12813
12843
|
};
|
|
12814
|
-
return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), pendingProp));
|
|
12844
|
+
return jsxRuntime.jsx(Component, _objectSpread$2(_objectSpread$2({}, props), pendingProp));
|
|
12815
12845
|
};
|
|
12816
12846
|
WrappedComponent.displayName = wrapDisplayName(Component, 'withPendingRequests');
|
|
12817
12847
|
return WrappedComponent;
|
|
12818
12848
|
};
|
|
12819
12849
|
}
|
|
12820
12850
|
|
|
12851
|
+
var messages = reactIntl.defineMessages({
|
|
12852
|
+
noCustomFields: {
|
|
12853
|
+
id: 'CustomTypesSubform.noCustomFields',
|
|
12854
|
+
description: 'The label when there are no custom fields defined',
|
|
12855
|
+
defaultMessage: 'There are no custom fields related to this type.'
|
|
12856
|
+
},
|
|
12857
|
+
noCustomType: {
|
|
12858
|
+
id: 'CustomTypesSubform.noCustomType',
|
|
12859
|
+
description: 'The label when there is no custom type selected',
|
|
12860
|
+
defaultMessage: 'No custom type is selected. Please select a custom type from the dropdown.'
|
|
12861
|
+
},
|
|
12862
|
+
noTypes: {
|
|
12863
|
+
id: 'CustomTypesSubform.noTypes',
|
|
12864
|
+
description: 'The label when there is no custom type defined in the project',
|
|
12865
|
+
defaultMessage: 'There are no custom types defined. To extend the information, create custom types through the API first.'
|
|
12866
|
+
},
|
|
12867
|
+
title: {
|
|
12868
|
+
id: 'CustomTypesSubform.title',
|
|
12869
|
+
description: 'Fallback title for the subform',
|
|
12870
|
+
defaultMessage: 'Custom fields'
|
|
12871
|
+
},
|
|
12872
|
+
typesPlaceholder: {
|
|
12873
|
+
id: 'CustomTypesSubform.typesPlaceholder',
|
|
12874
|
+
description: 'The placeholder for the types',
|
|
12875
|
+
defaultMessage: 'Select...'
|
|
12876
|
+
}
|
|
12877
|
+
});
|
|
12878
|
+
|
|
12879
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12880
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12881
|
+
const typeDefinitionsExist = typeDefinitions => {
|
|
12882
|
+
return typeDefinitions.length > 0;
|
|
12883
|
+
};
|
|
12884
|
+
const typeDefinitionSelected = formValues => {
|
|
12885
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12886
|
+
return ((_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.type) && ((_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.obj);
|
|
12887
|
+
};
|
|
12888
|
+
const typeDefinitionContainsFieldDefinitions = formValues => {
|
|
12889
|
+
return formValues[FIELD_NAME].type.obj.key && formValues[FIELD_NAME].type.obj.fieldDefinitions.length > 0;
|
|
12890
|
+
};
|
|
12891
|
+
const CustomFieldsInputWrapper = _ref => {
|
|
12892
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12893
|
+
isReadOnly = _ref.isReadOnly;
|
|
12894
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12895
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext);
|
|
12896
|
+
if (!typeDefinitionsExist(typeDefinitions)) {
|
|
12897
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noTypes));
|
|
12898
|
+
}
|
|
12899
|
+
if (!typeDefinitionSelected(formValues)) {
|
|
12900
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomType));
|
|
12901
|
+
}
|
|
12902
|
+
if (!typeDefinitionContainsFieldDefinitions(formValues)) {
|
|
12903
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.noCustomFields));
|
|
12904
|
+
}
|
|
12905
|
+
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
12906
|
+
max: "scale",
|
|
12907
|
+
children: jsxRuntime.jsx(CustomFields, {
|
|
12908
|
+
isReadOnly: isReadOnly,
|
|
12909
|
+
name: "".concat(FIELD_NAME, ".fields"),
|
|
12910
|
+
fieldDefinitions: formValues[FIELD_NAME].type.obj.fieldDefinitions
|
|
12911
|
+
})
|
|
12912
|
+
});
|
|
12913
|
+
};
|
|
12914
|
+
CustomFieldsInputWrapper.displayName = 'CustomFieldsInputWrapper';
|
|
12915
|
+
|
|
12916
|
+
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; }
|
|
12917
|
+
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; }
|
|
12918
|
+
const FIELD_NAME = 'custom';
|
|
12919
|
+
|
|
12920
|
+
// Creates dropdown options
|
|
12921
|
+
const mapTypeDefinitionsToOptions = (typeDefinitions, language, languages, selectedTypeDefinitionId) => {
|
|
12922
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => ({
|
|
12923
|
+
isDisabled: selectedTypeDefinitionId && selectedTypeDefinitionId === typeDefinition.type.id,
|
|
12924
|
+
value: typeDefinition.type.key,
|
|
12925
|
+
label: l10n.formatLocalizedString(typeDefinition.type, {
|
|
12926
|
+
key: 'name',
|
|
12927
|
+
locale: language,
|
|
12928
|
+
fallbackOrder: languages
|
|
12929
|
+
})
|
|
12930
|
+
}));
|
|
12931
|
+
};
|
|
12932
|
+
|
|
12933
|
+
// Used to generate form state when the user selects a type definition from the dropdown
|
|
12934
|
+
const createFormStateFromTypeDefinition = selectedTypeDefinition => {
|
|
12935
|
+
return {
|
|
12936
|
+
type: {
|
|
12937
|
+
id: selectedTypeDefinition.type.id,
|
|
12938
|
+
obj: {
|
|
12939
|
+
fieldDefinitions: selectedTypeDefinition.type.fieldDefinitions,
|
|
12940
|
+
key: selectedTypeDefinition.type.key
|
|
12941
|
+
}
|
|
12942
|
+
},
|
|
12943
|
+
fields: {}
|
|
12944
|
+
};
|
|
12945
|
+
};
|
|
12946
|
+
const CustomTypeSubform = _ref => {
|
|
12947
|
+
var _formValues$FIELD_NAM, _formValues$FIELD_NAM2;
|
|
12948
|
+
let typeDefinitions = _ref.typeDefinitions,
|
|
12949
|
+
isReadOnly = _ref.isReadOnly;
|
|
12950
|
+
const _useFormikContext = formik.useFormikContext(),
|
|
12951
|
+
formValues = _valuesInstanceProperty__default["default"](_useFormikContext),
|
|
12952
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
12953
|
+
const _useIntl = reactIntl.useIntl(),
|
|
12954
|
+
formatMessage = _useIntl.formatMessage;
|
|
12955
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
12956
|
+
language: applicationContext.dataLocale,
|
|
12957
|
+
languages: applicationContext.project.languages
|
|
12958
|
+
})),
|
|
12959
|
+
language = _useApplicationContex.language,
|
|
12960
|
+
languages = _useApplicationContex.languages;
|
|
12961
|
+
const handleTypeDefinitionSelect = React.useCallback(event => {
|
|
12962
|
+
const selectedTypeDefinition = _findInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, typeDefinition => typeDefinition.type.key === event.target.value);
|
|
12963
|
+
if (selectedTypeDefinition) {
|
|
12964
|
+
const nextCustom = createFormStateFromTypeDefinition(selectedTypeDefinition);
|
|
12965
|
+
setFieldValue(FIELD_NAME, nextCustom);
|
|
12966
|
+
} else {
|
|
12967
|
+
// if the dropdown selector is cleared
|
|
12968
|
+
const emptyFormState = CustomFieldTypeDefinitionsConnector$1.createEmptyCustomFields(formValues[FIELD_NAME].type);
|
|
12969
|
+
setFieldValue(FIELD_NAME, emptyFormState);
|
|
12970
|
+
}
|
|
12971
|
+
}, [typeDefinitions, setFieldValue, formValues]);
|
|
12972
|
+
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
12973
|
+
header: jsxRuntime.jsx(uiKit.CollapsiblePanel.Header, {
|
|
12974
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread({}, messages.title))
|
|
12975
|
+
}),
|
|
12976
|
+
headerControls: typeDefinitions.length > 0 && jsxRuntime.jsx("div", {
|
|
12977
|
+
css: /*#__PURE__*/react$1.css("min-width:", uiKit.designTokens.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomTypeSubform;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS10eXBlLXN1YmZvcm0uanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtHb0IiLCJmaWxlIjoiY3VzdG9tLXR5cGUtc3ViZm9ybS5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyB1c2VDYWxsYmFjayB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgeyB1c2VGb3JtaWtDb250ZXh0IH0gZnJvbSAnZm9ybWlrJztcbmltcG9ydCB7IEZvcm1hdHRlZE1lc3NhZ2UsIHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJztcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnO1xuaW1wb3J0IEN1c3RvbUZpZWxkVHlwZURlZmluaXRpb25zQ29ubmVjdG9yIGZyb20gJy4uL2N1c3RvbS1maWVsZC10eXBlLWRlZmluaXRpb25zLWNvbm5lY3Rvcic7XG5pbXBvcnQgeyBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9sMTBuJztcbmltcG9ydCB7XG4gIENvbGxhcHNpYmxlUGFuZWwsXG4gIFNlbGVjdElucHV0LFxuICBkZXNpZ25Ub2tlbnMsXG59IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5pbXBvcnQgbWVzc2FnZXMgZnJvbSAnLi9tZXNzYWdlcyc7XG5pbXBvcnQgQ3VzdG9tRmllbGRzSW5wdXRXcmFwcGVyIGZyb20gJy4vY3VzdG9tLWZpZWxkcy1pbnB1dC13cmFwcGVyJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gVE9ETzogbWFrZSBjb25maWd1cmFibGUgYnkgY29uc3VtZXJzP1xuZXhwb3J0IGNvbnN0IEZJRUxEX05BTUUgPSAnY3VzdG9tJztcblxuLy8gQ3JlYXRlcyBkcm9wZG93biBvcHRpb25zXG5leHBvcnQgY29uc3QgbWFwVHlwZURlZmluaXRpb25zVG9PcHRpb25zID0gKFxuICB0eXBlRGVmaW5pdGlvbnMsXG4gIGxhbmd1YWdlLFxuICBsYW5ndWFnZXMsXG4gIHNlbGVjdGVkVHlwZURlZmluaXRpb25JZFxuKSA9PiB7XG4gIHJldHVybiB0eXBlRGVmaW5pdGlvbnMubWFwKCh0eXBlRGVmaW5pdGlvbikgPT4gKHtcbiAgICBpc0Rpc2FibGVkOlxuICAgICAgc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbklkICYmXG4gICAgICBzZWxlY3RlZFR5cGVEZWZpbml0aW9uSWQgPT09IHR5cGVEZWZpbml0aW9uLnR5cGUuaWQsXG4gICAgdmFsdWU6IHR5cGVEZWZpbml0aW9uLnR5cGUua2V5LFxuICAgIGxhYmVsOiBmb3JtYXRMb2NhbGl6ZWRTdHJpbmcodHlwZURlZmluaXRpb24udHlwZSwge1xuICAgICAga2V5OiAnbmFtZScsXG4gICAgICBsb2NhbGU6IGxhbmd1YWdlLFxuICAgICAgZmFsbGJhY2tPcmRlcjogbGFuZ3VhZ2VzLFxuICAgIH0pLFxuICB9KSk7XG59O1xuXG4vLyBVc2VkIHRvIGdlbmVyYXRlIGZvcm0gc3RhdGUgd2hlbiB0aGUgdXNlciBzZWxlY3RzIGEgdHlwZSBkZWZpbml0aW9uIGZyb20gdGhlIGRyb3Bkb3duXG5jb25zdCBjcmVhdGVGb3JtU3RhdGVGcm9tVHlwZURlZmluaXRpb24gPSAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikgPT4ge1xuICByZXR1cm4ge1xuICAgIHR5cGU6IHtcbiAgICAgIGlkOiBzZWxlY3RlZFR5cGVEZWZpbml0aW9uLnR5cGUuaWQsXG4gICAgICBvYmo6IHtcbiAgICAgICAgZmllbGREZWZpbml0aW9uczogc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbi50eXBlLmZpZWxkRGVmaW5pdGlvbnMsXG4gICAgICAgIGtleTogc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbi50eXBlLmtleSxcbiAgICAgIH0sXG4gICAgfSxcbiAgICBmaWVsZHM6IHt9LFxuICB9O1xufTtcblxuY29uc3QgQ3VzdG9tVHlwZVN1YmZvcm0gPSAoeyB0eXBlRGVmaW5pdGlvbnMsIGlzUmVhZE9ubHkgfSkgPT4ge1xuICBjb25zdCB7IHZhbHVlczogZm9ybVZhbHVlcywgc2V0RmllbGRWYWx1ZSB9ID0gdXNlRm9ybWlrQ29udGV4dCgpO1xuICBjb25zdCB7IGZvcm1hdE1lc3NhZ2UgfSA9IHVzZUludGwoKTtcbiAgY29uc3QgeyBsYW5ndWFnZSwgbGFuZ3VhZ2VzIH0gPSB1c2VBcHBsaWNhdGlvbkNvbnRleHQoXG4gICAgKGFwcGxpY2F0aW9uQ29udGV4dCkgPT4gKHtcbiAgICAgIGxhbmd1YWdlOiBhcHBsaWNhdGlvbkNvbnRleHQuZGF0YUxvY2FsZSxcbiAgICAgIGxhbmd1YWdlczogYXBwbGljYXRpb25Db250ZXh0LnByb2plY3QubGFuZ3VhZ2VzLFxuICAgIH0pXG4gICk7XG5cbiAgY29uc3QgaGFuZGxlVHlwZURlZmluaXRpb25TZWxlY3QgPSB1c2VDYWxsYmFjayhcbiAgICAoZXZlbnQpID0+IHtcbiAgICAgIGNvbnN0IHNlbGVjdGVkVHlwZURlZmluaXRpb24gPSB0eXBlRGVmaW5pdGlvbnMuZmluZChcbiAgICAgICAgKHR5cGVEZWZpbml0aW9uKSA9PiB0eXBlRGVmaW5pdGlvbi50eXBlLmtleSA9PT0gZXZlbnQudGFyZ2V0LnZhbHVlXG4gICAgICApO1xuXG4gICAgICBpZiAoc2VsZWN0ZWRUeXBlRGVmaW5pdGlvbikge1xuICAgICAgICBjb25zdCBuZXh0Q3VzdG9tID0gY3JlYXRlRm9ybVN0YXRlRnJvbVR5cGVEZWZpbml0aW9uKFxuICAgICAgICAgIHNlbGVjdGVkVHlwZURlZmluaXRpb25cbiAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIG5leHRDdXN0b20pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gaWYgdGhlIGRyb3Bkb3duIHNlbGVjdG9yIGlzIGNsZWFyZWRcbiAgICAgICAgY29uc3QgZW1wdHlGb3JtU3RhdGUgPVxuICAgICAgICAgIEN1c3RvbUZpZWxkVHlwZURlZmluaXRpb25zQ29ubmVjdG9yLmNyZWF0ZUVtcHR5Q3VzdG9tRmllbGRzKFxuICAgICAgICAgICAgZm9ybVZhbHVlc1tGSUVMRF9OQU1FXS50eXBlXG4gICAgICAgICAgKTtcblxuICAgICAgICBzZXRGaWVsZFZhbHVlKEZJRUxEX05BTUUsIGVtcHR5Rm9ybVN0YXRlKTtcbiAgICAgIH1cbiAgICB9LFxuICAgIFt0eXBlRGVmaW5pdGlvbnMsIHNldEZpZWxkVmFsdWUsIGZvcm1WYWx1ZXNdXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8Q29sbGFwc2libGVQYW5lbFxuICAgICAgaGVhZGVyPXtcbiAgICAgICAgPENvbGxhcHNpYmxlUGFuZWwuSGVhZGVyPlxuICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy50aXRsZX0gLz5cbiAgICAgICAgPC9Db2xsYXBzaWJsZVBhbmVsLkhlYWRlcj5cbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzPXtcbiAgICAgICAgdHlwZURlZmluaXRpb25zLmxlbmd0aCA+IDAgJiYgKFxuICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgICAgICBtaW4td2lkdGg6ICR7ZGVzaWduVG9rZW5zLmNvbnN0cmFpbnQxMH07XG4gICAgICAgICAgICBgfVxuICAgICAgICAgID5cbiAgICAgICAgICAgIDxTZWxlY3RJbnB1dFxuICAgICAgICAgICAgICBpc0NsZWFyYWJsZVxuICAgICAgICAgICAgICBkYXRhLXRlc3RpZD1cImN1c3RvbS10eXBlLXNlbGVjdFwiXG4gICAgICAgICAgICAgIG5hbWU9e2Ake0ZJRUxEX05BTUV9LnR5cGUub2JqLmtleWB9XG4gICAgICAgICAgICAgIG9wdGlvbnM9e21hcFR5cGVEZWZpbml0aW9uc1RvT3B0aW9ucyhcbiAgICAgICAgICAgICAgICB0eXBlRGVmaW5pdGlvbnMsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2VzLFxuICAgICAgICAgICAgICAgIGZvcm1WYWx1ZXNbRklFTERfTkFNRV0/LnR5cGU/LmlkXG4gICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIHZhbHVlPXtmb3JtVmFsdWVzW0ZJRUxEX05BTUVdPy50eXBlPy5vYmo/LmtleX1cbiAgICAgICAgICAgICAgb25DaGFuZ2U9e2hhbmRsZVR5cGVEZWZpbml0aW9uU2VsZWN0fVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj17Zm9ybWF0TWVzc2FnZShtZXNzYWdlcy50eXBlc1BsYWNlaG9sZGVyKX1cbiAgICAgICAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgICAgICAgIC8+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICAgIH1cbiAgICAgIGhlYWRlckNvbnRyb2xzQWxpZ25tZW50PVwibGVmdFwiXG4gICAgPlxuICAgICAgPEN1c3RvbUZpZWxkc0lucHV0V3JhcHBlclxuICAgICAgICB0eXBlRGVmaW5pdGlvbnM9e3R5cGVEZWZpbml0aW9uc31cbiAgICAgICAgaXNSZWFkT25seT17aXNSZWFkT25seX1cbiAgICAgIC8+XG4gICAgPC9Db2xsYXBzaWJsZVBhbmVsPlxuICApO1xufTtcblxuQ3VzdG9tVHlwZVN1YmZvcm0uZGlzcGxheU5hbWUgPSAnQ3VzdG9tVHlwZVN1YmZvcm0nO1xuQ3VzdG9tVHlwZVN1YmZvcm0ucHJvcFR5cGVzID0ge1xuICB0eXBlRGVmaW5pdGlvbnM6IFByb3BUeXBlcy5hcnJheS5pc1JlcXVpcmVkLFxuICBpc1JlYWRPbmx5OiBQcm9wVHlwZXMuYm9vbCxcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEN1c3RvbVR5cGVTdWJmb3JtO1xuIl19 */"),
|
|
12978
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
12979
|
+
isClearable: true,
|
|
12980
|
+
"data-testid": "custom-type-select",
|
|
12981
|
+
name: "".concat(FIELD_NAME, ".type.obj.key"),
|
|
12982
|
+
options: mapTypeDefinitionsToOptions(typeDefinitions, language, languages, (_formValues$FIELD_NAM = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM === void 0 || (_formValues$FIELD_NAM = _formValues$FIELD_NAM.type) === null || _formValues$FIELD_NAM === void 0 ? void 0 : _formValues$FIELD_NAM.id),
|
|
12983
|
+
value: (_formValues$FIELD_NAM2 = formValues[FIELD_NAME]) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.type) === null || _formValues$FIELD_NAM2 === void 0 || (_formValues$FIELD_NAM2 = _formValues$FIELD_NAM2.obj) === null || _formValues$FIELD_NAM2 === void 0 ? void 0 : _formValues$FIELD_NAM2.key,
|
|
12984
|
+
onChange: handleTypeDefinitionSelect,
|
|
12985
|
+
placeholder: formatMessage(messages.typesPlaceholder),
|
|
12986
|
+
isReadOnly: isReadOnly
|
|
12987
|
+
})
|
|
12988
|
+
}),
|
|
12989
|
+
headerControlsAlignment: "left",
|
|
12990
|
+
children: jsxRuntime.jsx(CustomFieldsInputWrapper, {
|
|
12991
|
+
typeDefinitions: typeDefinitions,
|
|
12992
|
+
isReadOnly: isReadOnly
|
|
12993
|
+
})
|
|
12994
|
+
});
|
|
12995
|
+
};
|
|
12996
|
+
CustomTypeSubform.displayName = 'CustomTypeSubform';
|
|
12997
|
+
|
|
12998
|
+
const CustomFieldsFormField = _ref => {
|
|
12999
|
+
let resources = _ref.resources,
|
|
13000
|
+
isReadOnly = _ref.isReadOnly;
|
|
13001
|
+
const projectKey = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.project.key);
|
|
13002
|
+
return jsxRuntime.jsx(CustomFieldTypeDefinitionsConnector$1, {
|
|
13003
|
+
resources: resources,
|
|
13004
|
+
projectKey: projectKey,
|
|
13005
|
+
children: _ref2 => {
|
|
13006
|
+
var _context;
|
|
13007
|
+
let _ref2$customFieldType = _ref2.customFieldTypeDefinitionsFetcher,
|
|
13008
|
+
isLoading = _ref2$customFieldType.isLoading,
|
|
13009
|
+
customFieldTypeDefinitions = _ref2$customFieldType.customFieldTypeDefinitions;
|
|
13010
|
+
if (isLoading) {
|
|
13011
|
+
return jsxRuntime.jsx(uiKit.LoadingSpinner, {});
|
|
13012
|
+
}
|
|
13013
|
+
const typeDefinitions = _mapInstanceProperty__default["default"](_context = customFieldTypeDefinitions.results).call(_context, CustomFieldTypeDefinitionsConnector$1.graphQlDocToForm);
|
|
13014
|
+
return jsxRuntime.jsx(CustomTypeSubform, {
|
|
13015
|
+
typeDefinitions: typeDefinitions,
|
|
13016
|
+
isReadOnly: isReadOnly
|
|
13017
|
+
});
|
|
13018
|
+
}
|
|
13019
|
+
});
|
|
13020
|
+
};
|
|
13021
|
+
|
|
12821
13022
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "slugAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
12822
13023
|
|
|
12823
13024
|
exports.BooleanField = booleanField;
|
|
@@ -12829,9 +13030,10 @@ exports.CenteredLoadingSpinner = CenteredLoadingSpinner;
|
|
|
12829
13030
|
exports.ChannelPickerInput = ChannelPickerInput;
|
|
12830
13031
|
exports.CountriesPicker = CountriesPicker;
|
|
12831
13032
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
12832
|
-
exports.CustomFieldTypeDefinitionsConnector =
|
|
13033
|
+
exports.CustomFieldTypeDefinitionsConnector = CustomFieldTypeDefinitionsConnector$1;
|
|
12833
13034
|
exports.CustomFields = CustomFields;
|
|
12834
13035
|
exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification;
|
|
13036
|
+
exports.CustomFieldsFormField = CustomFieldsFormField;
|
|
12835
13037
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput;
|
|
12836
13038
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
12837
13039
|
exports.Divider = Divider;
|
|
@@ -12864,9 +13066,10 @@ exports.allowedProperties = allowedProperties;
|
|
|
12864
13066
|
exports.and = and;
|
|
12865
13067
|
exports.attributesMapToNameValuePairs = attributesMapToNameValuePairs;
|
|
12866
13068
|
exports.base64ToString = base64ToString;
|
|
12867
|
-
exports.booleanMessages = messages$
|
|
13069
|
+
exports.booleanMessages = messages$8;
|
|
12868
13070
|
exports.buildSearchQuery = buildSearchQuery;
|
|
12869
|
-
exports.
|
|
13071
|
+
exports.businessRoleConstants = businessRoleConstants;
|
|
13072
|
+
exports.businessRoleMessages = messages$r;
|
|
12870
13073
|
exports.businessRoles = businessRoleKeys;
|
|
12871
13074
|
exports.capitalizeFirst = capitalizeFirst;
|
|
12872
13075
|
exports.clone = clone;
|
|
@@ -12951,7 +13154,7 @@ exports.keepDisplayName = keepDisplayName;
|
|
|
12951
13154
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
12952
13155
|
exports.mapTimeZonesToOptions = mapTimeZonesToOptions;
|
|
12953
13156
|
exports.minusify = minusify;
|
|
12954
|
-
exports.missingValueMessages = messages$
|
|
13157
|
+
exports.missingValueMessages = messages$7;
|
|
12955
13158
|
exports.nameValuePairsToMap = nameValuePairsToMap;
|
|
12956
13159
|
exports.normalizeProductSettings = normalizeProductSettings;
|
|
12957
13160
|
exports.not = not;
|
|
@@ -12968,7 +13171,7 @@ exports.resolveStatusType = resolveStatusType;
|
|
|
12968
13171
|
exports.safelyAddFallback = safelyAddFallback;
|
|
12969
13172
|
exports.sanitize = sanitize;
|
|
12970
13173
|
exports.searchCategories = searchCategories;
|
|
12971
|
-
exports.searchInputMessages = messages$
|
|
13174
|
+
exports.searchInputMessages = messages$F;
|
|
12972
13175
|
exports.setDisplayName = setDisplayName;
|
|
12973
13176
|
exports.setToArray = setToArray;
|
|
12974
13177
|
exports.shallowEqual = shallowEqual;
|
|
@@ -13014,7 +13217,7 @@ exports.validateNumber = validateFilter;
|
|
|
13014
13217
|
exports.validateSingleOptionEnum = validateSingleOptionEnum;
|
|
13015
13218
|
exports.validateText = validateText;
|
|
13016
13219
|
exports.validatedInput = validatedInput;
|
|
13017
|
-
exports.validationMessages = messages$
|
|
13220
|
+
exports.validationMessages = messages$K;
|
|
13018
13221
|
exports.withPendingRequests = withPendingRequests;
|
|
13019
13222
|
exports.withProps = withProps;
|
|
13020
13223
|
exports.withRedirectTo = withRedirectTo;
|