@commercetools-frontend/experimental-components 5.4.2 → 5.4.4
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 +323 -173
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +323 -173
- package/dist/commercetools-frontend-experimental-components.esm.js +324 -175
- package/dist/styles.css +69 -60
- package/package.json +16 -15
|
@@ -72,8 +72,8 @@ var has = require('lodash/has');
|
|
|
72
72
|
var _toArray = require('@babel/runtime-corejs3/helpers/toArray');
|
|
73
73
|
var _reverseInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
|
|
74
74
|
var sdk = require('@commercetools-frontend/sdk');
|
|
75
|
-
var client = require('@apollo/client');
|
|
76
75
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
76
|
+
var client = require('@apollo/client');
|
|
77
77
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
78
78
|
var _parseFloat = require('@babel/runtime-corejs3/core-js-stable/parse-float');
|
|
79
79
|
var omit = require('lodash/omit');
|
|
@@ -89,6 +89,8 @@ var omitBy = require('lodash/omitBy');
|
|
|
89
89
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
90
90
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
91
91
|
var react$1 = require('@emotion/react');
|
|
92
|
+
var reactBeautifulDnd = require('react-beautiful-dnd');
|
|
93
|
+
var ReactDOM = require('react-dom');
|
|
92
94
|
var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
|
|
93
95
|
var reselect = require('reselect');
|
|
94
96
|
var _Map = require('@babel/runtime-corejs3/core-js-stable/map');
|
|
@@ -99,7 +101,6 @@ var merge = require('lodash/merge');
|
|
|
99
101
|
var set = require('lodash/set');
|
|
100
102
|
var uuid = require('uuid');
|
|
101
103
|
var _ = require('@commercetools-frontend/ui-kit/');
|
|
102
|
-
var ReactDOM = require('react-dom');
|
|
103
104
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
104
105
|
var memoize = require('memoize-one');
|
|
105
106
|
var utils = require('@commercetools-uikit/utils');
|
|
@@ -176,6 +177,7 @@ var hoistNonReactStatics__default = /*#__PURE__*/_interopDefault(hoistNonReactSt
|
|
|
176
177
|
var omitBy__default = /*#__PURE__*/_interopDefault(omitBy);
|
|
177
178
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
178
179
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
180
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
179
181
|
var _endsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_endsWithInstanceProperty);
|
|
180
182
|
var _Map__default = /*#__PURE__*/_interopDefault(_Map);
|
|
181
183
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
@@ -183,7 +185,6 @@ var keyBy__default = /*#__PURE__*/_interopDefault(keyBy);
|
|
|
183
185
|
var times__default = /*#__PURE__*/_interopDefault(times);
|
|
184
186
|
var merge__default = /*#__PURE__*/_interopDefault(merge);
|
|
185
187
|
var set__default = /*#__PURE__*/_interopDefault(set);
|
|
186
|
-
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
187
188
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
188
189
|
var flatMap__default = /*#__PURE__*/_interopDefault(flatMap);
|
|
189
190
|
var _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
@@ -1672,8 +1673,8 @@ const getData = (code, field) => {
|
|
|
1672
1673
|
};
|
|
1673
1674
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1674
1675
|
|
|
1675
|
-
function ownKeys$
|
|
1676
|
-
function _objectSpread$
|
|
1676
|
+
function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1677
|
+
function _objectSpread$1p(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1p(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1p(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1677
1678
|
function formatMoneyRangeValue(value, intl) {
|
|
1678
1679
|
var _context;
|
|
1679
1680
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1683,7 +1684,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1683
1684
|
return '';
|
|
1684
1685
|
}
|
|
1685
1686
|
function formatMoneyValue(amount, currency, intl) {
|
|
1686
|
-
return formatMoney$2(_objectSpread$
|
|
1687
|
+
return formatMoney$2(_objectSpread$1p({
|
|
1687
1688
|
centAmount: amount,
|
|
1688
1689
|
fractionDigits: getFractionDigit(currency)
|
|
1689
1690
|
}, currency ? {
|
|
@@ -1700,7 +1701,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1700
1701
|
}
|
|
1701
1702
|
function formatMoney$2(moneyValue, intl, options) {
|
|
1702
1703
|
var _moneyValue$fractione;
|
|
1703
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1704
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1p({
|
|
1704
1705
|
style: 'currency',
|
|
1705
1706
|
currency: moneyValue.currencyCode,
|
|
1706
1707
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1954,8 +1955,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1954
1955
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1955
1956
|
};
|
|
1956
1957
|
|
|
1957
|
-
function ownKeys$
|
|
1958
|
-
function _objectSpread$
|
|
1958
|
+
function ownKeys$1o(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1959
|
+
function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1959
1960
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1960
1961
|
const WithDataTablePaginationState = props => {
|
|
1961
1962
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1969,7 +1970,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1969
1970
|
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1970
1971
|
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1971
1972
|
});
|
|
1972
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1973
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1973
1974
|
dataTablePaginationState: {
|
|
1974
1975
|
page,
|
|
1975
1976
|
perPage,
|
|
@@ -1981,8 +1982,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1981
1982
|
return WithDataTablePaginationState;
|
|
1982
1983
|
};
|
|
1983
1984
|
|
|
1984
|
-
function ownKeys$
|
|
1985
|
-
function _objectSpread$
|
|
1985
|
+
function ownKeys$1n(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1986
|
+
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1986
1987
|
const injectNotifications = function () {
|
|
1987
1988
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1988
1989
|
return Component => {
|
|
@@ -1997,7 +1998,7 @@ const injectNotifications = function () {
|
|
|
1997
1998
|
onActionError,
|
|
1998
1999
|
hideAllPageNotifications
|
|
1999
2000
|
};
|
|
2000
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2001
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), {}, {
|
|
2001
2002
|
[propName]: notifications
|
|
2002
2003
|
}));
|
|
2003
2004
|
};
|
|
@@ -2006,22 +2007,22 @@ const injectNotifications = function () {
|
|
|
2006
2007
|
};
|
|
2007
2008
|
};
|
|
2008
2009
|
|
|
2009
|
-
function ownKeys$
|
|
2010
|
-
function _objectSpread$
|
|
2010
|
+
function ownKeys$1m(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2011
|
+
function _objectSpread$1m(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2011
2012
|
function isPropsMapper(mapProps) {
|
|
2012
2013
|
return typeof mapProps === 'function';
|
|
2013
2014
|
}
|
|
2014
2015
|
const withProps = mapProps => Component => {
|
|
2015
2016
|
const EnhancedWithProps = ownProps => {
|
|
2016
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2017
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2017
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
2018
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
2018
2019
|
};
|
|
2019
2020
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2020
2021
|
return EnhancedWithProps;
|
|
2021
2022
|
};
|
|
2022
2023
|
|
|
2023
|
-
function ownKeys$
|
|
2024
|
-
function _objectSpread$
|
|
2024
|
+
function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2025
|
+
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2025
2026
|
const useRedirectEffect = _ref => {
|
|
2026
2027
|
let goTo = _ref.goTo;
|
|
2027
2028
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2041,30 +2042,30 @@ const defaultOptions$5 = {
|
|
|
2041
2042
|
skip: () => false
|
|
2042
2043
|
};
|
|
2043
2044
|
const withRedirectTo = options => Component => {
|
|
2044
|
-
const mergedOptions = _objectSpread$
|
|
2045
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
2045
2046
|
const WithRedirectTo = props => {
|
|
2046
2047
|
if (!mergedOptions.skip(props)) {
|
|
2047
2048
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2048
2049
|
goTo: options.selectGoTo(props)
|
|
2049
2050
|
});
|
|
2050
2051
|
}
|
|
2051
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2052
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l({}, props));
|
|
2052
2053
|
};
|
|
2053
2054
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2054
2055
|
return WithRedirectTo;
|
|
2055
2056
|
};
|
|
2056
2057
|
|
|
2057
|
-
function ownKeys$
|
|
2058
|
-
function _objectSpread$
|
|
2058
|
+
function ownKeys$1k(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2059
|
+
function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2059
2060
|
const defaultOptions$4 = {
|
|
2060
2061
|
propName: 'modalState',
|
|
2061
2062
|
isInitiallyOpen: false
|
|
2062
2063
|
};
|
|
2063
2064
|
const injectModalState$1 = options => Component => {
|
|
2064
|
-
const mergedOptions = _objectSpread$
|
|
2065
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
2065
2066
|
const WithModalState = props => {
|
|
2066
2067
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2067
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2068
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2068
2069
|
[mergedOptions.propName]: modalState
|
|
2069
2070
|
}));
|
|
2070
2071
|
};
|
|
@@ -2072,17 +2073,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2072
2073
|
return WithModalState;
|
|
2073
2074
|
};
|
|
2074
2075
|
|
|
2075
|
-
function ownKeys$
|
|
2076
|
-
function _objectSpread$
|
|
2076
|
+
function ownKeys$1j(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2077
|
+
function _objectSpread$1j(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1j(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2077
2078
|
const defaultOptions$3 = {
|
|
2078
2079
|
propName: 'toggleState',
|
|
2079
2080
|
isInitiallyOpen: false
|
|
2080
2081
|
};
|
|
2081
2082
|
const injectModalState = options => Component => {
|
|
2082
|
-
const mergedOptions = _objectSpread$
|
|
2083
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
2083
2084
|
const WithToggleState = props => {
|
|
2084
2085
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2085
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2086
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
2086
2087
|
[mergedOptions.propName]: toggleState
|
|
2087
2088
|
}));
|
|
2088
2089
|
};
|
|
@@ -2090,8 +2091,8 @@ const injectModalState = options => Component => {
|
|
|
2090
2091
|
return WithToggleState;
|
|
2091
2092
|
};
|
|
2092
2093
|
|
|
2093
|
-
function ownKeys$
|
|
2094
|
-
function _objectSpread$
|
|
2094
|
+
function ownKeys$1i(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2095
|
+
function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1i(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2095
2096
|
const defaultOptions$2 = {
|
|
2096
2097
|
storageType: 'local',
|
|
2097
2098
|
segregateByUser: true
|
|
@@ -2109,7 +2110,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2109
2110
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2110
2111
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2111
2112
|
var _context;
|
|
2112
|
-
const mergedOptions = _objectSpread$
|
|
2113
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
2113
2114
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2114
2115
|
var _context$user;
|
|
2115
2116
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2157,8 +2158,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2157
2158
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2158
2159
|
};
|
|
2159
2160
|
|
|
2160
|
-
function ownKeys$
|
|
2161
|
-
function _objectSpread$
|
|
2161
|
+
function ownKeys$1h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2162
|
+
function _objectSpread$1h(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1h(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2162
2163
|
const defaultOptions$1 = {
|
|
2163
2164
|
propName: 'storage',
|
|
2164
2165
|
storageKey: '',
|
|
@@ -2171,7 +2172,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2171
2172
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2172
2173
|
* argument position does not allow passing specification of option(s).
|
|
2173
2174
|
*/
|
|
2174
|
-
const mergedOptions = _objectSpread$
|
|
2175
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
2175
2176
|
const WithStorage = props => {
|
|
2176
2177
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2177
2178
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2185,7 +2186,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2185
2186
|
readFromStorage
|
|
2186
2187
|
}
|
|
2187
2188
|
};
|
|
2188
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2189
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
2189
2190
|
};
|
|
2190
2191
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2191
2192
|
return WithStorage;
|
|
@@ -2229,8 +2230,8 @@ const usePrevious = value => {
|
|
|
2229
2230
|
return ref.current;
|
|
2230
2231
|
};
|
|
2231
2232
|
|
|
2232
|
-
function ownKeys$
|
|
2233
|
-
function _objectSpread$
|
|
2233
|
+
function ownKeys$1g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2234
|
+
function _objectSpread$1g(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1g(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2234
2235
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2235
2236
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2236
2237
|
var _storesQueryResult$re;
|
|
@@ -2241,7 +2242,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2241
2242
|
offset: storesQueryResult.offset,
|
|
2242
2243
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2243
2244
|
var _store$productSelecti;
|
|
2244
|
-
return _objectSpread$
|
|
2245
|
+
return _objectSpread$1g(_objectSpread$1g({}, store), {}, {
|
|
2245
2246
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2246
2247
|
});
|
|
2247
2248
|
})
|
|
@@ -2249,7 +2250,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2249
2250
|
};
|
|
2250
2251
|
const createQueryVariables$6 = ownProps => {
|
|
2251
2252
|
var _context;
|
|
2252
|
-
return _objectSpread$
|
|
2253
|
+
return _objectSpread$1g(_objectSpread$1g({
|
|
2253
2254
|
limit: ownProps.limit,
|
|
2254
2255
|
offset: ownProps.offset,
|
|
2255
2256
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2404,8 +2405,8 @@ function useDidFormValidationFail() {
|
|
|
2404
2405
|
return Boolean(didFormValidationFail);
|
|
2405
2406
|
}
|
|
2406
2407
|
|
|
2407
|
-
function ownKeys$
|
|
2408
|
-
function _objectSpread$
|
|
2408
|
+
function ownKeys$1f(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2409
|
+
function _objectSpread$1f(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2409
2410
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2410
2411
|
const defaultOptions = {
|
|
2411
2412
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2433,7 +2434,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2433
2434
|
};
|
|
2434
2435
|
const usePersistedReminder = function () {
|
|
2435
2436
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2436
|
-
const mergedOptions = _objectSpread$
|
|
2437
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions), options);
|
|
2437
2438
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2438
2439
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2439
2440
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2497,8 +2498,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2497
2498
|
}
|
|
2498
2499
|
});
|
|
2499
2500
|
|
|
2500
|
-
function ownKeys$
|
|
2501
|
-
function _objectSpread$
|
|
2501
|
+
function ownKeys$1e(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2502
|
+
function _objectSpread$1e(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2502
2503
|
const LinkToProfile = props => {
|
|
2503
2504
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2504
2505
|
to: "/account/profile",
|
|
@@ -2518,7 +2519,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2518
2519
|
isBold: true,
|
|
2519
2520
|
intlMessage: messages$I.profileUpdated
|
|
2520
2521
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2521
|
-
intlMessage: _objectSpread$
|
|
2522
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.addMoreInformation), {}, {
|
|
2522
2523
|
values: {
|
|
2523
2524
|
newline: getNewLine
|
|
2524
2525
|
}
|
|
@@ -2527,7 +2528,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2527
2528
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2528
2529
|
scale: "xs",
|
|
2529
2530
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2530
|
-
intlMessage: _objectSpread$
|
|
2531
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.informationAndProfileLink), {}, {
|
|
2531
2532
|
values: {
|
|
2532
2533
|
newline: getNewLine,
|
|
2533
2534
|
link: getLinkToProfile
|
|
@@ -2684,8 +2685,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2684
2685
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2685
2686
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2686
2687
|
|
|
2687
|
-
function ownKeys$
|
|
2688
|
-
function _objectSpread$
|
|
2688
|
+
function ownKeys$1d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2689
|
+
function _objectSpread$1d(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2689
2690
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2690
2691
|
const updatedColumnProps = {};
|
|
2691
2692
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2705,14 +2706,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2705
2706
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2706
2707
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2707
2708
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2708
|
-
return _objectSpread$
|
|
2709
|
+
return _objectSpread$1d(_objectSpread$1d({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2709
2710
|
});
|
|
2710
2711
|
};
|
|
2711
2712
|
const handleCacheUpdate = _ref2 => {
|
|
2712
2713
|
let update = _ref2.update,
|
|
2713
2714
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2714
2715
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2715
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2716
|
+
return updateCachedTableConfiguration(_objectSpread$1d(_objectSpread$1d({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2716
2717
|
};
|
|
2717
2718
|
|
|
2718
2719
|
// Signature:
|
|
@@ -2741,7 +2742,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2741
2742
|
return {
|
|
2742
2743
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2743
2744
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2744
|
-
return _objectSpread$
|
|
2745
|
+
return _objectSpread$1d({
|
|
2745
2746
|
key: visibleColumnKey
|
|
2746
2747
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2747
2748
|
}),
|
|
@@ -2812,14 +2813,14 @@ const handlers$4 = {
|
|
|
2812
2813
|
}
|
|
2813
2814
|
};
|
|
2814
2815
|
|
|
2815
|
-
function ownKeys$
|
|
2816
|
-
function _objectSpread$
|
|
2816
|
+
function ownKeys$1c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2817
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2817
2818
|
|
|
2818
2819
|
// eslint-disable-next-line import/prefer-default-export
|
|
2819
2820
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2820
2821
|
var _context;
|
|
2821
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2822
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2822
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1c(_objectSpread$1c({}, productSelections), {}, {
|
|
2823
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1c({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2823
2824
|
from: 'nameAllLocales',
|
|
2824
2825
|
to: 'name'
|
|
2825
2826
|
}])))
|
|
@@ -2995,8 +2996,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2995
2996
|
}
|
|
2996
2997
|
});
|
|
2997
2998
|
|
|
2998
|
-
function ownKeys$
|
|
2999
|
-
function _objectSpread$
|
|
2999
|
+
function ownKeys$1b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3000
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3000
3001
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3001
3002
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3002
3003
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -3017,10 +3018,10 @@ const ChannelPickerInput = _ref => {
|
|
|
3017
3018
|
const _useIntl = reactIntl.useIntl(),
|
|
3018
3019
|
formatMessage = _useIntl.formatMessage;
|
|
3019
3020
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3020
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3021
|
+
const variables = React.useMemo(() => _objectSpread$1b({
|
|
3021
3022
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3022
3023
|
}, role && {
|
|
3023
|
-
|
|
3024
|
+
extraWhere: "roles contains any (\"".concat(role, "\")")
|
|
3024
3025
|
}), [dataLocale, role]);
|
|
3025
3026
|
const _useState = React.useState(),
|
|
3026
3027
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3146,8 +3147,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3146
3147
|
|
|
3147
3148
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3148
3149
|
|
|
3149
|
-
function ownKeys$
|
|
3150
|
-
function _objectSpread$
|
|
3150
|
+
function ownKeys$1a(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3151
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1a(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3151
3152
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3152
3153
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3153
3154
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3179,7 +3180,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3179
3180
|
handleMouseOver: this.handleMouseOver,
|
|
3180
3181
|
handleMouseOut: this.handleMouseOut
|
|
3181
3182
|
};
|
|
3182
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3183
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$1a({}, _objectSpread$1a(_objectSpread$1a({}, this.props), injectedProps)));
|
|
3183
3184
|
}
|
|
3184
3185
|
}]);
|
|
3185
3186
|
return WithMouseOverState;
|
|
@@ -3188,8 +3189,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3188
3189
|
return WithMouseOverState;
|
|
3189
3190
|
};
|
|
3190
3191
|
|
|
3191
|
-
function ownKeys$
|
|
3192
|
-
function _objectSpread$
|
|
3192
|
+
function ownKeys$19(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3193
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3193
3194
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3194
3195
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3195
3196
|
var styles$h = {
|
|
@@ -3281,7 +3282,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3281
3282
|
}, {
|
|
3282
3283
|
key: "render",
|
|
3283
3284
|
value: function render() {
|
|
3284
|
-
const commonProps = _objectSpread$
|
|
3285
|
+
const commonProps = _objectSpread$19(_objectSpread$19({
|
|
3285
3286
|
value: this.state.draftValue,
|
|
3286
3287
|
autoComplete: this.props.autoComplete,
|
|
3287
3288
|
onChange: this.handleChange,
|
|
@@ -3300,7 +3301,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3300
3301
|
htmlFor: inputId,
|
|
3301
3302
|
children: this.props.label
|
|
3302
3303
|
})
|
|
3303
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3304
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3304
3305
|
id: inputId,
|
|
3305
3306
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3306
3307
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3309,7 +3310,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3309
3310
|
rows: 1,
|
|
3310
3311
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3311
3312
|
cacheMeasurements: true
|
|
3312
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3313
|
+
})) : jsxRuntime.jsx("input", _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3313
3314
|
id: inputId,
|
|
3314
3315
|
ref: this.props.inputRef,
|
|
3315
3316
|
type: this.props.as,
|
|
@@ -3677,8 +3678,8 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3677
3678
|
}
|
|
3678
3679
|
});
|
|
3679
3680
|
|
|
3680
|
-
function ownKeys$
|
|
3681
|
-
function _objectSpread$
|
|
3681
|
+
function ownKeys$18(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3682
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$18(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3682
3683
|
const getBottomOption = formatMessage => ({
|
|
3683
3684
|
options: [{
|
|
3684
3685
|
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
@@ -3689,7 +3690,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3689
3690
|
const Option$2 = props => {
|
|
3690
3691
|
const _useIntl = reactIntl.useIntl(),
|
|
3691
3692
|
formatMessage = _useIntl.formatMessage;
|
|
3692
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3693
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$18(_objectSpread$18({}, props), {}, {
|
|
3693
3694
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3694
3695
|
tone: "secondary",
|
|
3695
3696
|
children: formatMessage(props.data.label)
|
|
@@ -3706,8 +3707,8 @@ const Option$2 = props => {
|
|
|
3706
3707
|
};
|
|
3707
3708
|
Option$2.displayName = 'Option';
|
|
3708
3709
|
|
|
3709
|
-
function ownKeys$
|
|
3710
|
-
function _objectSpread$
|
|
3710
|
+
function ownKeys$17(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3711
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$17(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3711
3712
|
const useHandlers = onChange => {
|
|
3712
3713
|
const _useState = React.useState(),
|
|
3713
3714
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3718,8 +3719,8 @@ const useHandlers = onChange => {
|
|
|
3718
3719
|
}, []);
|
|
3719
3720
|
const handleChange = useEventCallback(event => {
|
|
3720
3721
|
var _event$target$value;
|
|
3721
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3722
|
-
target: _objectSpread$
|
|
3722
|
+
const eventWithExtractedValue = _objectSpread$17(_objectSpread$17({}, event), {}, {
|
|
3723
|
+
target: _objectSpread$17(_objectSpread$17({}, event.target), {}, {
|
|
3723
3724
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3724
3725
|
})
|
|
3725
3726
|
});
|
|
@@ -3728,8 +3729,9 @@ const useHandlers = onChange => {
|
|
|
3728
3729
|
return [handleInputChange, handleChange];
|
|
3729
3730
|
};
|
|
3730
3731
|
|
|
3731
|
-
|
|
3732
|
-
function
|
|
3732
|
+
const _excluded$1 = ["extraWhere"];
|
|
3733
|
+
function ownKeys$16(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3734
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$16(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$16(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3733
3735
|
const constructPrefixSearchPredicate = function () {
|
|
3734
3736
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3735
3737
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3759,22 +3761,30 @@ const useLoadOptions = _ref => {
|
|
|
3759
3761
|
const client$1 = client.useApolloClient();
|
|
3760
3762
|
const loadOptions = React.useCallback(function () {
|
|
3761
3763
|
let inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3764
|
+
let where;
|
|
3765
|
+
if (inputValue.length) {
|
|
3766
|
+
if (isUUID(inputValue)) {
|
|
3767
|
+
where = "id = \"".concat(inputValue, "\"");
|
|
3768
|
+
} else {
|
|
3769
|
+
const _getPrefixSearchBound = getPrefixSearchBounds(inputValue),
|
|
3770
|
+
_getPrefixSearchBound2 = _slicedToArray(_getPrefixSearchBound, 2),
|
|
3771
|
+
lowerBound = _getPrefixSearchBound2[0],
|
|
3772
|
+
upperBound = _getPrefixSearchBound2[1];
|
|
3773
|
+
where = constructPrefixSearchPredicate(prefixSearchFields, lowerBound, upperBound);
|
|
3771
3774
|
}
|
|
3772
|
-
}
|
|
3775
|
+
}
|
|
3776
|
+
const _ref2 = variables !== null && variables !== void 0 ? variables : {},
|
|
3777
|
+
extraWhere = _ref2.extraWhere,
|
|
3778
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$1);
|
|
3779
|
+
if (typeof extraWhere === 'string') {
|
|
3780
|
+
var _context6;
|
|
3781
|
+
where = where ? _concatInstanceProperty__default["default"](_context6 = "(".concat(where, ") and ")).call(_context6, variables.extraWhere) : variables.extraWhere;
|
|
3782
|
+
}
|
|
3773
3783
|
return client$1.query({
|
|
3774
3784
|
query,
|
|
3775
|
-
variables: _objectSpread$
|
|
3785
|
+
variables: _objectSpread$16({
|
|
3776
3786
|
where
|
|
3777
|
-
},
|
|
3787
|
+
}, restVariables),
|
|
3778
3788
|
context: {
|
|
3779
3789
|
target: constants.MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM
|
|
3780
3790
|
},
|
|
@@ -4063,9 +4073,9 @@ const StatePickerInput = _ref => {
|
|
|
4063
4073
|
};
|
|
4064
4074
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4065
4075
|
|
|
4066
|
-
function ownKeys$
|
|
4067
|
-
function _objectSpread$
|
|
4068
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4076
|
+
function ownKeys$15(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4077
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$15(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$15(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4078
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$15({
|
|
4069
4079
|
ref: ref,
|
|
4070
4080
|
style: {
|
|
4071
4081
|
display: 'block',
|
|
@@ -4203,8 +4213,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4203
4213
|
};
|
|
4204
4214
|
|
|
4205
4215
|
const _excluded = ["action"];
|
|
4206
|
-
function ownKeys$
|
|
4207
|
-
function _objectSpread$
|
|
4216
|
+
function ownKeys$14(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4217
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$14(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$14(Object(t))).call(_context9, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4208
4218
|
|
|
4209
4219
|
/**
|
|
4210
4220
|
* Checks if a value is a LocalizedString
|
|
@@ -4226,7 +4236,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4226
4236
|
*/
|
|
4227
4237
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4228
4238
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4229
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4239
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$14(_objectSpread$14({}, customFields), {}, {
|
|
4230
4240
|
[customField.name]: customField.value
|
|
4231
4241
|
}), {});
|
|
4232
4242
|
};
|
|
@@ -4250,7 +4260,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4250
4260
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4251
4261
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4252
4262
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4253
|
-
return _objectSpread$
|
|
4263
|
+
return _objectSpread$14(_objectSpread$14(_objectSpread$14({}, transformedData), parent ? {
|
|
4254
4264
|
parent
|
|
4255
4265
|
} : {}), ancestors ? {
|
|
4256
4266
|
ancestors
|
|
@@ -4341,7 +4351,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4341
4351
|
const formatMoney = valueType => money => {
|
|
4342
4352
|
if (valueType === 'fixed') {
|
|
4343
4353
|
return {
|
|
4344
|
-
[money.type]: _objectSpread$
|
|
4354
|
+
[money.type]: _objectSpread$14({
|
|
4345
4355
|
centAmount: money.centAmount,
|
|
4346
4356
|
currencyCode: money.currencyCode
|
|
4347
4357
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4506,7 +4516,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4506
4516
|
case 'addAttributeDefinition':
|
|
4507
4517
|
return {
|
|
4508
4518
|
[actionName]: {
|
|
4509
|
-
attributeDefinition: _objectSpread$
|
|
4519
|
+
attributeDefinition: _objectSpread$14(_objectSpread$14({}, actionPayload.attribute), {}, {
|
|
4510
4520
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4511
4521
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4512
4522
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4602,7 +4612,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4602
4612
|
return {
|
|
4603
4613
|
[actionName]: {
|
|
4604
4614
|
attributeName: actionPayload.attributeName,
|
|
4605
|
-
value: _objectSpread$
|
|
4615
|
+
value: _objectSpread$14(_objectSpread$14({}, actionPayload.value), {}, {
|
|
4606
4616
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4607
4617
|
})
|
|
4608
4618
|
}
|
|
@@ -4611,7 +4621,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4611
4621
|
return {
|
|
4612
4622
|
[actionName]: {
|
|
4613
4623
|
attributeName: actionPayload.attributeName,
|
|
4614
|
-
newValue: _objectSpread$
|
|
4624
|
+
newValue: _objectSpread$14(_objectSpread$14({}, actionPayload.newValue), {}, {
|
|
4615
4625
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4616
4626
|
})
|
|
4617
4627
|
}
|
|
@@ -4638,7 +4648,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4638
4648
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4639
4649
|
taxCategory: actionPayload.taxCategory,
|
|
4640
4650
|
money: {
|
|
4641
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4651
|
+
[actionPayload.money.type]: _objectSpread$14({
|
|
4642
4652
|
centAmount: actionPayload.money.centAmount,
|
|
4643
4653
|
currencyCode: actionPayload.money.currencyCode
|
|
4644
4654
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4693,8 +4703,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4693
4703
|
fields: customFields
|
|
4694
4704
|
} : null;
|
|
4695
4705
|
return {
|
|
4696
|
-
[actionName]: _objectSpread$
|
|
4697
|
-
address: _objectSpread$
|
|
4706
|
+
[actionName]: _objectSpread$14(_objectSpread$14({}, actionPayload), {}, {
|
|
4707
|
+
address: _objectSpread$14(_objectSpread$14({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4698
4708
|
custom
|
|
4699
4709
|
})
|
|
4700
4710
|
})
|
|
@@ -4770,8 +4780,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4770
4780
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4771
4781
|
}
|
|
4772
4782
|
|
|
4773
|
-
function ownKeys
|
|
4774
|
-
function _objectSpread
|
|
4783
|
+
function ownKeys$13(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4784
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$13(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$13(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4775
4785
|
function getPriceChannelName(price) {
|
|
4776
4786
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4777
4787
|
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;
|
|
@@ -4785,11 +4795,11 @@ function getDiscountValue(price) {
|
|
|
4785
4795
|
} 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) {
|
|
4786
4796
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4787
4797
|
}
|
|
4788
|
-
return price.discounted ? _objectSpread
|
|
4798
|
+
return price.discounted ? _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4789
4799
|
fractionedAmount,
|
|
4790
4800
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4791
4801
|
preciseAmount
|
|
4792
|
-
}) : _objectSpread
|
|
4802
|
+
}) : _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4793
4803
|
centAmount: 0
|
|
4794
4804
|
});
|
|
4795
4805
|
}
|
|
@@ -4818,7 +4828,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4818
4828
|
}
|
|
4819
4829
|
let preciseAmount;
|
|
4820
4830
|
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);
|
|
4821
|
-
return _objectSpread
|
|
4831
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4822
4832
|
centAmount,
|
|
4823
4833
|
preciseAmount
|
|
4824
4834
|
});
|
|
@@ -4835,7 +4845,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4835
4845
|
}
|
|
4836
4846
|
let preciseAmount;
|
|
4837
4847
|
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);
|
|
4838
|
-
return _objectSpread
|
|
4848
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4839
4849
|
centAmount,
|
|
4840
4850
|
preciseAmount
|
|
4841
4851
|
});
|
|
@@ -4847,7 +4857,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4847
4857
|
const currencyCode = price.value.currencyCode;
|
|
4848
4858
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4849
4859
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4850
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4860
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$13(_objectSpread$13({}, minPrices), {}, {
|
|
4851
4861
|
[currencyCode]: price.value
|
|
4852
4862
|
});
|
|
4853
4863
|
}
|
|
@@ -4856,8 +4866,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4856
4866
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4857
4867
|
}
|
|
4858
4868
|
|
|
4859
|
-
function ownKeys$
|
|
4860
|
-
function _objectSpread$
|
|
4869
|
+
function ownKeys$12(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4870
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$12(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$12(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4861
4871
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4862
4872
|
var _context, _context4;
|
|
4863
4873
|
return {
|
|
@@ -4872,14 +4882,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4872
4882
|
return {
|
|
4873
4883
|
name: fieldDefinition.name,
|
|
4874
4884
|
required: fieldDefinition.required,
|
|
4875
|
-
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$
|
|
4876
|
-
elementType: _objectSpread$
|
|
4885
|
+
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$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4886
|
+
elementType: _objectSpread$12(_objectSpread$12({}, fieldDefinition.type.elementType), {}, {
|
|
4877
4887
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4878
4888
|
key: value.key,
|
|
4879
4889
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4880
4890
|
}))
|
|
4881
4891
|
})
|
|
4882
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4892
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4883
4893
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4884
4894
|
key: value.key,
|
|
4885
4895
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4890,7 +4900,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4890
4900
|
})
|
|
4891
4901
|
}
|
|
4892
4902
|
},
|
|
4893
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4903
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$12(_objectSpread$12({}, fields), {}, {
|
|
4894
4904
|
[customField.name]: customField.value
|
|
4895
4905
|
}), {})
|
|
4896
4906
|
};
|
|
@@ -4902,7 +4912,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4902
4912
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4903
4913
|
// in either case we return null
|
|
4904
4914
|
if (!productSelection) return null;
|
|
4905
|
-
return _objectSpread$
|
|
4915
|
+
return _objectSpread$12(_objectSpread$12({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4906
4916
|
from: 'nameAllLocales',
|
|
4907
4917
|
to: 'name'
|
|
4908
4918
|
}])), {}, {
|
|
@@ -4925,8 +4935,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4925
4935
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4926
4936
|
};
|
|
4927
4937
|
|
|
4928
|
-
function ownKeys$
|
|
4929
|
-
function _objectSpread$
|
|
4938
|
+
function ownKeys$11(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4939
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$11(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$11(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4930
4940
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4931
4941
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4932
4942
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4943,7 +4953,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4943
4953
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4944
4954
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4945
4955
|
const definitionName = definition.type.elementType.name;
|
|
4946
|
-
return _objectSpread$
|
|
4956
|
+
return _objectSpread$11(_objectSpread$11({}, updateAction), {}, {
|
|
4947
4957
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4948
4958
|
});
|
|
4949
4959
|
}
|
|
@@ -5017,8 +5027,8 @@ function omitSetsOfSets() {
|
|
|
5017
5027
|
|
|
5018
5028
|
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 } } } };
|
|
5019
5029
|
|
|
5020
|
-
function ownKeys$
|
|
5021
|
-
function _objectSpread$
|
|
5030
|
+
function ownKeys$10(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5031
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$10(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$10(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5022
5032
|
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); }; }
|
|
5023
5033
|
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; } }
|
|
5024
5034
|
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 } } } };
|
|
@@ -5078,7 +5088,7 @@ const mapDataToProps = _ref => {
|
|
|
5078
5088
|
return {
|
|
5079
5089
|
fetchTypeDefinitionsQuery: {
|
|
5080
5090
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5081
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5091
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$10({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5082
5092
|
isImmutable: true
|
|
5083
5093
|
}), [{
|
|
5084
5094
|
from: 'labelAllLocales',
|
|
@@ -5106,12 +5116,12 @@ const handlers$2 = {
|
|
|
5106
5116
|
}
|
|
5107
5117
|
};
|
|
5108
5118
|
|
|
5109
|
-
function ownKeys
|
|
5110
|
-
function _objectSpread
|
|
5119
|
+
function ownKeys$$(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5120
|
+
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$$(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$$(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5111
5121
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5112
5122
|
return {
|
|
5113
5123
|
fields: customFieldsFromRestResponse.fields,
|
|
5114
|
-
type: _objectSpread
|
|
5124
|
+
type: _objectSpread$$({
|
|
5115
5125
|
id: customFieldsFromRestResponse.type.id
|
|
5116
5126
|
}, customFieldsFromRestResponse.type.obj)
|
|
5117
5127
|
};
|
|
@@ -5130,14 +5140,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5130
5140
|
name: fieldDefinition.name,
|
|
5131
5141
|
required: fieldDefinition.required,
|
|
5132
5142
|
inputHint: fieldDefinition.inputHint,
|
|
5133
|
-
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
|
|
5134
|
-
elementType: _objectSpread
|
|
5143
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5144
|
+
elementType: _objectSpread$$(_objectSpread$$({}, fieldDefinition.type.elementType), {}, {
|
|
5135
5145
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5136
5146
|
key: value.key,
|
|
5137
5147
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5138
5148
|
}))
|
|
5139
5149
|
})
|
|
5140
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread
|
|
5150
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5141
5151
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5142
5152
|
key: value.key,
|
|
5143
5153
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5153,7 +5163,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5153
5163
|
type: {
|
|
5154
5164
|
id: formCustomFields.type.id,
|
|
5155
5165
|
typeId: 'type',
|
|
5156
|
-
obj: _objectSpread
|
|
5166
|
+
obj: _objectSpread$$({}, formCustomFields.type)
|
|
5157
5167
|
},
|
|
5158
5168
|
fields: formCustomFields.fields
|
|
5159
5169
|
});
|
|
@@ -5161,7 +5171,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5161
5171
|
type: {
|
|
5162
5172
|
id: formCustomFields.type.id,
|
|
5163
5173
|
typeId: 'type',
|
|
5164
|
-
obj: _objectSpread
|
|
5174
|
+
obj: _objectSpread$$({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5165
5175
|
},
|
|
5166
5176
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5167
5177
|
});
|
|
@@ -5292,8 +5302,8 @@ const REFERENCED_TYPES = {
|
|
|
5292
5302
|
zone: 'zone'
|
|
5293
5303
|
};
|
|
5294
5304
|
|
|
5295
|
-
function ownKeys$
|
|
5296
|
-
function _objectSpread$
|
|
5305
|
+
function ownKeys$_(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5306
|
+
function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$_(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$_(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5297
5307
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5298
5308
|
let validatedValues = [];
|
|
5299
5309
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5360,12 +5370,131 @@ function validations (formValues, language, languages) {
|
|
|
5360
5370
|
var _context2;
|
|
5361
5371
|
// Collect all required and set type fields
|
|
5362
5372
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5363
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5364
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5373
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$_(_objectSpread$_({}, acc), {}, {
|
|
5374
|
+
[fieldDefinition.name]: _objectSpread$_(_objectSpread$_({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5365
5375
|
}), {});
|
|
5366
5376
|
return withoutEmptyErrorsByField(errors);
|
|
5367
5377
|
}
|
|
5368
5378
|
|
|
5379
|
+
function ownKeys$Z(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5380
|
+
function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Z(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Z(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5381
|
+
const DroppableWrapper = _ref => {
|
|
5382
|
+
let children = _ref.children,
|
|
5383
|
+
onDragEnd = _ref.onDragEnd;
|
|
5384
|
+
return jsxRuntime.jsx(reactBeautifulDnd.DragDropContext, {
|
|
5385
|
+
onDragEnd: onDragEnd,
|
|
5386
|
+
children: jsxRuntime.jsx(reactBeautifulDnd.Droppable, {
|
|
5387
|
+
droppableId: "droppable",
|
|
5388
|
+
children: provided => jsxRuntime.jsxs("div", _objectSpread$Z(_objectSpread$Z({
|
|
5389
|
+
ref: provided.innerRef
|
|
5390
|
+
}, provided.droppableProps), {}, {
|
|
5391
|
+
children: [children, provided.placeholder]
|
|
5392
|
+
}))
|
|
5393
|
+
})
|
|
5394
|
+
});
|
|
5395
|
+
};
|
|
5396
|
+
|
|
5397
|
+
function ownKeys$Y(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5398
|
+
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$Y(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$Y(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5399
|
+
function DragHandle(props) {
|
|
5400
|
+
return jsxRuntime.jsx("div", _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5401
|
+
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
5402
|
+
icon: jsxRuntime.jsx(uiKit.DragIcon, {}),
|
|
5403
|
+
size: "medium",
|
|
5404
|
+
label: "reorder drag handle"
|
|
5405
|
+
})
|
|
5406
|
+
}));
|
|
5407
|
+
}
|
|
5408
|
+
DragHandle.displayName = 'DragHandle';
|
|
5409
|
+
|
|
5410
|
+
function ownKeys$X(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5411
|
+
function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$X(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$X(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5412
|
+
const DraggableWrapper = _ref => {
|
|
5413
|
+
let children = _ref.children,
|
|
5414
|
+
draggableKey = _ref.draggableKey,
|
|
5415
|
+
draggableId = _ref.draggableId,
|
|
5416
|
+
index = _ref.index;
|
|
5417
|
+
const portal = document.createElement('div');
|
|
5418
|
+
portal.id = 'drag-rbd-portal';
|
|
5419
|
+
document.body.appendChild(portal);
|
|
5420
|
+
return jsxRuntime.jsx(reactBeautifulDnd.Draggable, {
|
|
5421
|
+
draggableId: draggableId,
|
|
5422
|
+
index: index,
|
|
5423
|
+
children: (provided, snapshot) => {
|
|
5424
|
+
const child = jsxRuntime.jsx("div", _objectSpread$X(_objectSpread$X({
|
|
5425
|
+
ref: provided.innerRef
|
|
5426
|
+
}, provided.draggableProps), {}, {
|
|
5427
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
5428
|
+
gridTemplateColumns: '1fr 20fr',
|
|
5429
|
+
gridTemplateRows: "auto 1fr auto",
|
|
5430
|
+
gridGap: uiKit.customProperties.spacingM,
|
|
5431
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5432
|
+
children: jsxRuntime.jsx(DragHandle, _objectSpread$X({}, provided.dragHandleProps))
|
|
5433
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5434
|
+
children: children
|
|
5435
|
+
})]
|
|
5436
|
+
})
|
|
5437
|
+
}));
|
|
5438
|
+
if (!snapshot.isDragging) {
|
|
5439
|
+
return child;
|
|
5440
|
+
}
|
|
5441
|
+
|
|
5442
|
+
// render the draggable in the portal when it's being dragged
|
|
5443
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", {
|
|
5444
|
+
children: child
|
|
5445
|
+
}), portal);
|
|
5446
|
+
}
|
|
5447
|
+
}, draggableKey);
|
|
5448
|
+
};
|
|
5449
|
+
|
|
5450
|
+
function ownKeys$W(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5451
|
+
function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$W(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$W(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5452
|
+
const DefaultWrapper = _ref => {
|
|
5453
|
+
let children = _ref.children;
|
|
5454
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5455
|
+
children: children
|
|
5456
|
+
});
|
|
5457
|
+
};
|
|
5458
|
+
DefaultWrapper.propTypes = {
|
|
5459
|
+
children: PropTypes__default["default"].node.isRequired
|
|
5460
|
+
};
|
|
5461
|
+
const dndContextDefaultValues = {
|
|
5462
|
+
onDragEnd: () => {},
|
|
5463
|
+
DroppableWrapper: DefaultWrapper,
|
|
5464
|
+
DraggableWrapper: DefaultWrapper
|
|
5465
|
+
};
|
|
5466
|
+
const DnDContext = /*#__PURE__*/React.createContext(dndContextDefaultValues);
|
|
5467
|
+
const DndProvider = _ref2 => {
|
|
5468
|
+
let onDragEnd = _ref2.onDragEnd,
|
|
5469
|
+
children = _ref2.children;
|
|
5470
|
+
const _useToggleState = uiKit.useToggleState(false),
|
|
5471
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
5472
|
+
isDragAndDropMode = _useToggleState2[0],
|
|
5473
|
+
setDragAndDropMode = _useToggleState2[1];
|
|
5474
|
+
if (isDragAndDropMode) {
|
|
5475
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5476
|
+
value: {
|
|
5477
|
+
onDragEnd,
|
|
5478
|
+
DroppableWrapper,
|
|
5479
|
+
DraggableWrapper,
|
|
5480
|
+
setDragAndDropMode,
|
|
5481
|
+
isDragAndDropMode
|
|
5482
|
+
},
|
|
5483
|
+
children: children
|
|
5484
|
+
});
|
|
5485
|
+
}
|
|
5486
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5487
|
+
value: _objectSpread$W(_objectSpread$W({}, dndContextDefaultValues), {}, {
|
|
5488
|
+
isDragAndDropMode,
|
|
5489
|
+
setDragAndDropMode
|
|
5490
|
+
}),
|
|
5491
|
+
children: children
|
|
5492
|
+
});
|
|
5493
|
+
};
|
|
5494
|
+
const useDnDContext = () => {
|
|
5495
|
+
return React.useContext(DnDContext);
|
|
5496
|
+
};
|
|
5497
|
+
|
|
5369
5498
|
function CustomTextInput(props) {
|
|
5370
5499
|
const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
|
|
5371
5500
|
const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
|
|
@@ -7054,15 +7183,21 @@ CustomNestedInput.displayName = 'CustomNestedInput';
|
|
|
7054
7183
|
|
|
7055
7184
|
var styles$d = {
|
|
7056
7185
|
"divider": "divider-module__divider___4-vdy",
|
|
7186
|
+
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
7187
|
+
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
7057
7188
|
"divider-solid": "divider-module__divider-solid___3Fs4q divider-module__divider___4-vdy",
|
|
7058
7189
|
"divider-dashed": "divider-module__divider-dashed___2Em8A divider-module__divider___4-vdy"
|
|
7059
7190
|
};
|
|
7060
7191
|
function Divider(_ref) {
|
|
7061
|
-
let isDashed = _ref.isDashed
|
|
7192
|
+
let isDashed = _ref.isDashed,
|
|
7193
|
+
_ref$orientation = _ref.orientation,
|
|
7194
|
+
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
7062
7195
|
return jsxRuntime.jsx("hr", {
|
|
7063
7196
|
className: classnames__default["default"]({
|
|
7064
7197
|
[styles$d['divider-solid']]: !isDashed,
|
|
7065
|
-
[styles$d['divider-dashed']]: isDashed
|
|
7198
|
+
[styles$d['divider-dashed']]: isDashed,
|
|
7199
|
+
[styles$d['divider-horizontal']]: orientation === 'horizontal',
|
|
7200
|
+
[styles$d['divider-vertical']]: orientation === 'vertical'
|
|
7066
7201
|
})
|
|
7067
7202
|
});
|
|
7068
7203
|
}
|
|
@@ -7604,7 +7739,11 @@ const CustomFieldsInternal = props => {
|
|
|
7604
7739
|
handleBlur = _useFormikContext.handleBlur;
|
|
7605
7740
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7606
7741
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7607
|
-
|
|
7742
|
+
const _useDnDContext = useDnDContext(),
|
|
7743
|
+
DroppableWrapper = _useDnDContext.DroppableWrapper,
|
|
7744
|
+
DraggableWrapper = _useDnDContext.DraggableWrapper,
|
|
7745
|
+
isDragAndDropMode = _useDnDContext.isDragAndDropMode;
|
|
7746
|
+
return jsxRuntime.jsx(DroppableWrapper, {
|
|
7608
7747
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7609
7748
|
var _context2;
|
|
7610
7749
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
@@ -7623,42 +7762,50 @@ const CustomFieldsInternal = props => {
|
|
|
7623
7762
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7624
7763
|
name: fieldName,
|
|
7625
7764
|
validate: validate,
|
|
7626
|
-
children: () =>
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
"
|
|
7631
|
-
|
|
7632
|
-
children:
|
|
7633
|
-
name: fieldName,
|
|
7634
|
-
fieldDefinition: fieldDefinition
|
|
7635
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7765
|
+
children: () => {
|
|
7766
|
+
var _context3, _context4;
|
|
7767
|
+
return jsxRuntime.jsx(DraggableWrapper, {
|
|
7768
|
+
draggableKey: _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, "-")).call(_context3, index),
|
|
7769
|
+
draggableId: _concatInstanceProperty__default["default"](_context4 = "".concat(fieldName, "-")).call(_context4, index),
|
|
7770
|
+
index: index,
|
|
7771
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7636
7772
|
scale: "xs",
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7773
|
+
children: jsxRuntime.jsxs("div", {
|
|
7774
|
+
"aria-invalid": _Object$keys__default["default"](fieldErrors !== null && fieldErrors !== void 0 ? fieldErrors : {}).length > 0,
|
|
7775
|
+
"aria-errormessage": "".concat(fieldName, "-error"),
|
|
7776
|
+
id: "".concat(fieldName, "-error"),
|
|
7777
|
+
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7778
|
+
name: fieldName,
|
|
7779
|
+
fieldDefinition: fieldDefinition
|
|
7780
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7781
|
+
scale: "xs",
|
|
7782
|
+
alignItems: "stretch",
|
|
7783
|
+
children: [isNested(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7784
|
+
name: fieldName,
|
|
7785
|
+
value: value,
|
|
7786
|
+
fieldDefinition: fieldDefinition,
|
|
7787
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7788
|
+
isReadOnly: props.isReadOnly,
|
|
7789
|
+
onBlur: handleBlur,
|
|
7790
|
+
setFieldValue: props.setFieldValue
|
|
7791
|
+
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7792
|
+
name: fieldName,
|
|
7793
|
+
value: value,
|
|
7794
|
+
fieldDefinition: fieldDefinition,
|
|
7795
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7796
|
+
isReadOnly: props.isReadOnly,
|
|
7797
|
+
onBlur: handleBlur,
|
|
7798
|
+
setFieldValue: props.setFieldValue,
|
|
7799
|
+
hasError: hasError
|
|
7800
|
+
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7801
|
+
isTouched: isTouched,
|
|
7802
|
+
errors: fieldErrors
|
|
7803
|
+
})]
|
|
7804
|
+
})]
|
|
7805
|
+
})
|
|
7806
|
+
})
|
|
7807
|
+
});
|
|
7808
|
+
}
|
|
7662
7809
|
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7663
7810
|
})
|
|
7664
7811
|
});
|
|
@@ -7689,6 +7836,8 @@ const CustomFields = props => {
|
|
|
7689
7836
|
};
|
|
7690
7837
|
CustomFields.displayName = 'CustomFields';
|
|
7691
7838
|
|
|
7839
|
+
CustomFields.DndProvider = DndProvider;
|
|
7840
|
+
|
|
7692
7841
|
var pickerMessages = reactIntl.defineMessages({
|
|
7693
7842
|
productSelectionsBasicSelectPlaceholder: {
|
|
7694
7843
|
id: 'ProductSelectionPicker.productSelectionsBasicSelectPlaceholder',
|
|
@@ -13399,6 +13548,7 @@ exports.truncate = truncate;
|
|
|
13399
13548
|
exports.unique = unique;
|
|
13400
13549
|
exports.uniqueObjects = uniqueObjects;
|
|
13401
13550
|
exports.useCachedCategoryOptions = useCachedCategoryOptions;
|
|
13551
|
+
exports.useCustomFieldsDnDContext = useDnDContext;
|
|
13402
13552
|
exports.useCustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits;
|
|
13403
13553
|
exports.useCustomersPlatformLimits = useCustomersPlatformLimits;
|
|
13404
13554
|
exports.useDebouncedPromiseCallback = useDebouncedPromiseCallback;
|