@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 warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
@@ -1673,8 +1674,8 @@ const getData = (code, field) => {
|
|
|
1673
1674
|
};
|
|
1674
1675
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1675
1676
|
|
|
1676
|
-
function ownKeys$
|
|
1677
|
-
function _objectSpread$
|
|
1677
|
+
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; }
|
|
1678
|
+
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; }
|
|
1678
1679
|
function formatMoneyRangeValue(value, intl) {
|
|
1679
1680
|
var _context;
|
|
1680
1681
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1684,7 +1685,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1684
1685
|
return '';
|
|
1685
1686
|
}
|
|
1686
1687
|
function formatMoneyValue(amount, currency, intl) {
|
|
1687
|
-
return formatMoney$2(_objectSpread$
|
|
1688
|
+
return formatMoney$2(_objectSpread$1p({
|
|
1688
1689
|
centAmount: amount,
|
|
1689
1690
|
fractionDigits: getFractionDigit(currency)
|
|
1690
1691
|
}, currency ? {
|
|
@@ -1701,7 +1702,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1701
1702
|
}
|
|
1702
1703
|
function formatMoney$2(moneyValue, intl, options) {
|
|
1703
1704
|
var _moneyValue$fractione;
|
|
1704
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1705
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1p({
|
|
1705
1706
|
style: 'currency',
|
|
1706
1707
|
currency: moneyValue.currencyCode,
|
|
1707
1708
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1955,8 +1956,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1955
1956
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1956
1957
|
};
|
|
1957
1958
|
|
|
1958
|
-
function ownKeys$
|
|
1959
|
-
function _objectSpread$
|
|
1959
|
+
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; }
|
|
1960
|
+
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; }
|
|
1960
1961
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1961
1962
|
const WithDataTablePaginationState = props => {
|
|
1962
1963
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1970,7 +1971,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1970
1971
|
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1971
1972
|
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1972
1973
|
});
|
|
1973
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1974
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1974
1975
|
dataTablePaginationState: {
|
|
1975
1976
|
page,
|
|
1976
1977
|
perPage,
|
|
@@ -1982,8 +1983,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1982
1983
|
return WithDataTablePaginationState;
|
|
1983
1984
|
};
|
|
1984
1985
|
|
|
1985
|
-
function ownKeys$
|
|
1986
|
-
function _objectSpread$
|
|
1986
|
+
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; }
|
|
1987
|
+
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; }
|
|
1987
1988
|
const injectNotifications = function () {
|
|
1988
1989
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1989
1990
|
return Component => {
|
|
@@ -1998,7 +1999,7 @@ const injectNotifications = function () {
|
|
|
1998
1999
|
onActionError,
|
|
1999
2000
|
hideAllPageNotifications
|
|
2000
2001
|
};
|
|
2001
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2002
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), {}, {
|
|
2002
2003
|
[propName]: notifications
|
|
2003
2004
|
}));
|
|
2004
2005
|
};
|
|
@@ -2007,22 +2008,22 @@ const injectNotifications = function () {
|
|
|
2007
2008
|
};
|
|
2008
2009
|
};
|
|
2009
2010
|
|
|
2010
|
-
function ownKeys$
|
|
2011
|
-
function _objectSpread$
|
|
2011
|
+
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; }
|
|
2012
|
+
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; }
|
|
2012
2013
|
function isPropsMapper(mapProps) {
|
|
2013
2014
|
return typeof mapProps === 'function';
|
|
2014
2015
|
}
|
|
2015
2016
|
const withProps = mapProps => Component => {
|
|
2016
2017
|
const EnhancedWithProps = ownProps => {
|
|
2017
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2018
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2018
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
2019
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
2019
2020
|
};
|
|
2020
2021
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2021
2022
|
return EnhancedWithProps;
|
|
2022
2023
|
};
|
|
2023
2024
|
|
|
2024
|
-
function ownKeys$
|
|
2025
|
-
function _objectSpread$
|
|
2025
|
+
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; }
|
|
2026
|
+
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; }
|
|
2026
2027
|
const useRedirectEffect = _ref => {
|
|
2027
2028
|
let goTo = _ref.goTo;
|
|
2028
2029
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2042,30 +2043,30 @@ const defaultOptions$5 = {
|
|
|
2042
2043
|
skip: () => false
|
|
2043
2044
|
};
|
|
2044
2045
|
const withRedirectTo = options => Component => {
|
|
2045
|
-
const mergedOptions = _objectSpread$
|
|
2046
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
2046
2047
|
const WithRedirectTo = props => {
|
|
2047
2048
|
if (!mergedOptions.skip(props)) {
|
|
2048
2049
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2049
2050
|
goTo: options.selectGoTo(props)
|
|
2050
2051
|
});
|
|
2051
2052
|
}
|
|
2052
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2053
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l({}, props));
|
|
2053
2054
|
};
|
|
2054
2055
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2055
2056
|
return WithRedirectTo;
|
|
2056
2057
|
};
|
|
2057
2058
|
|
|
2058
|
-
function ownKeys$
|
|
2059
|
-
function _objectSpread$
|
|
2059
|
+
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; }
|
|
2060
|
+
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; }
|
|
2060
2061
|
const defaultOptions$4 = {
|
|
2061
2062
|
propName: 'modalState',
|
|
2062
2063
|
isInitiallyOpen: false
|
|
2063
2064
|
};
|
|
2064
2065
|
const injectModalState$1 = options => Component => {
|
|
2065
|
-
const mergedOptions = _objectSpread$
|
|
2066
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
2066
2067
|
const WithModalState = props => {
|
|
2067
2068
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2068
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2069
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2069
2070
|
[mergedOptions.propName]: modalState
|
|
2070
2071
|
}));
|
|
2071
2072
|
};
|
|
@@ -2073,17 +2074,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2073
2074
|
return WithModalState;
|
|
2074
2075
|
};
|
|
2075
2076
|
|
|
2076
|
-
function ownKeys$
|
|
2077
|
-
function _objectSpread$
|
|
2077
|
+
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; }
|
|
2078
|
+
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; }
|
|
2078
2079
|
const defaultOptions$3 = {
|
|
2079
2080
|
propName: 'toggleState',
|
|
2080
2081
|
isInitiallyOpen: false
|
|
2081
2082
|
};
|
|
2082
2083
|
const injectModalState = options => Component => {
|
|
2083
|
-
const mergedOptions = _objectSpread$
|
|
2084
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
2084
2085
|
const WithToggleState = props => {
|
|
2085
2086
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2086
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2087
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
2087
2088
|
[mergedOptions.propName]: toggleState
|
|
2088
2089
|
}));
|
|
2089
2090
|
};
|
|
@@ -2091,8 +2092,8 @@ const injectModalState = options => Component => {
|
|
|
2091
2092
|
return WithToggleState;
|
|
2092
2093
|
};
|
|
2093
2094
|
|
|
2094
|
-
function ownKeys$
|
|
2095
|
-
function _objectSpread$
|
|
2095
|
+
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; }
|
|
2096
|
+
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; }
|
|
2096
2097
|
const defaultOptions$2 = {
|
|
2097
2098
|
storageType: 'local',
|
|
2098
2099
|
segregateByUser: true
|
|
@@ -2110,7 +2111,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2110
2111
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2111
2112
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2112
2113
|
var _context;
|
|
2113
|
-
const mergedOptions = _objectSpread$
|
|
2114
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
2114
2115
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2115
2116
|
var _context$user;
|
|
2116
2117
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2158,8 +2159,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2158
2159
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2159
2160
|
};
|
|
2160
2161
|
|
|
2161
|
-
function ownKeys$
|
|
2162
|
-
function _objectSpread$
|
|
2162
|
+
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; }
|
|
2163
|
+
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; }
|
|
2163
2164
|
const defaultOptions$1 = {
|
|
2164
2165
|
propName: 'storage',
|
|
2165
2166
|
storageKey: '',
|
|
@@ -2172,7 +2173,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2172
2173
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2173
2174
|
* argument position does not allow passing specification of option(s).
|
|
2174
2175
|
*/
|
|
2175
|
-
const mergedOptions = _objectSpread$
|
|
2176
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
2176
2177
|
const WithStorage = props => {
|
|
2177
2178
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2178
2179
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2186,7 +2187,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2186
2187
|
readFromStorage
|
|
2187
2188
|
}
|
|
2188
2189
|
};
|
|
2189
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2190
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
2190
2191
|
};
|
|
2191
2192
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2192
2193
|
return WithStorage;
|
|
@@ -2230,8 +2231,8 @@ const usePrevious = value => {
|
|
|
2230
2231
|
return ref.current;
|
|
2231
2232
|
};
|
|
2232
2233
|
|
|
2233
|
-
function ownKeys$
|
|
2234
|
-
function _objectSpread$
|
|
2234
|
+
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; }
|
|
2235
|
+
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; }
|
|
2235
2236
|
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 } } } };
|
|
2236
2237
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2237
2238
|
var _storesQueryResult$re;
|
|
@@ -2242,7 +2243,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2242
2243
|
offset: storesQueryResult.offset,
|
|
2243
2244
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2244
2245
|
var _store$productSelecti;
|
|
2245
|
-
return _objectSpread$
|
|
2246
|
+
return _objectSpread$1g(_objectSpread$1g({}, store), {}, {
|
|
2246
2247
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2247
2248
|
});
|
|
2248
2249
|
})
|
|
@@ -2250,7 +2251,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2250
2251
|
};
|
|
2251
2252
|
const createQueryVariables$6 = ownProps => {
|
|
2252
2253
|
var _context;
|
|
2253
|
-
return _objectSpread$
|
|
2254
|
+
return _objectSpread$1g(_objectSpread$1g({
|
|
2254
2255
|
limit: ownProps.limit,
|
|
2255
2256
|
offset: ownProps.offset,
|
|
2256
2257
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2405,8 +2406,8 @@ function useDidFormValidationFail() {
|
|
|
2405
2406
|
return Boolean(didFormValidationFail);
|
|
2406
2407
|
}
|
|
2407
2408
|
|
|
2408
|
-
function ownKeys$
|
|
2409
|
-
function _objectSpread$
|
|
2409
|
+
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; }
|
|
2410
|
+
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; }
|
|
2410
2411
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2411
2412
|
const defaultOptions = {
|
|
2412
2413
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2434,7 +2435,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2434
2435
|
};
|
|
2435
2436
|
const usePersistedReminder = function () {
|
|
2436
2437
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2437
|
-
const mergedOptions = _objectSpread$
|
|
2438
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions), options);
|
|
2438
2439
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2439
2440
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2440
2441
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2498,8 +2499,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2498
2499
|
}
|
|
2499
2500
|
});
|
|
2500
2501
|
|
|
2501
|
-
function ownKeys$
|
|
2502
|
-
function _objectSpread$
|
|
2502
|
+
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; }
|
|
2503
|
+
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; }
|
|
2503
2504
|
const LinkToProfile = props => {
|
|
2504
2505
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2505
2506
|
to: "/account/profile",
|
|
@@ -2519,7 +2520,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2519
2520
|
isBold: true,
|
|
2520
2521
|
intlMessage: messages$I.profileUpdated
|
|
2521
2522
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2522
|
-
intlMessage: _objectSpread$
|
|
2523
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.addMoreInformation), {}, {
|
|
2523
2524
|
values: {
|
|
2524
2525
|
newline: getNewLine
|
|
2525
2526
|
}
|
|
@@ -2528,7 +2529,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2528
2529
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2529
2530
|
scale: "xs",
|
|
2530
2531
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2531
|
-
intlMessage: _objectSpread$
|
|
2532
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.informationAndProfileLink), {}, {
|
|
2532
2533
|
values: {
|
|
2533
2534
|
newline: getNewLine,
|
|
2534
2535
|
link: getLinkToProfile
|
|
@@ -2685,8 +2686,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2685
2686
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2686
2687
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2687
2688
|
|
|
2688
|
-
function ownKeys$
|
|
2689
|
-
function _objectSpread$
|
|
2689
|
+
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; }
|
|
2690
|
+
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; }
|
|
2690
2691
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2691
2692
|
const updatedColumnProps = {};
|
|
2692
2693
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2706,14 +2707,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2706
2707
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2707
2708
|
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 => {
|
|
2708
2709
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2709
|
-
return _objectSpread$
|
|
2710
|
+
return _objectSpread$1d(_objectSpread$1d({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2710
2711
|
});
|
|
2711
2712
|
};
|
|
2712
2713
|
const handleCacheUpdate = _ref2 => {
|
|
2713
2714
|
let update = _ref2.update,
|
|
2714
2715
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2715
2716
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2716
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2717
|
+
return updateCachedTableConfiguration(_objectSpread$1d(_objectSpread$1d({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2717
2718
|
};
|
|
2718
2719
|
|
|
2719
2720
|
// Signature:
|
|
@@ -2742,7 +2743,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2742
2743
|
return {
|
|
2743
2744
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2744
2745
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2745
|
-
return _objectSpread$
|
|
2746
|
+
return _objectSpread$1d({
|
|
2746
2747
|
key: visibleColumnKey
|
|
2747
2748
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2748
2749
|
}),
|
|
@@ -2813,14 +2814,14 @@ const handlers$4 = {
|
|
|
2813
2814
|
}
|
|
2814
2815
|
};
|
|
2815
2816
|
|
|
2816
|
-
function ownKeys$
|
|
2817
|
-
function _objectSpread$
|
|
2817
|
+
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; }
|
|
2818
|
+
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; }
|
|
2818
2819
|
|
|
2819
2820
|
// eslint-disable-next-line import/prefer-default-export
|
|
2820
2821
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2821
2822
|
var _context;
|
|
2822
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2823
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2823
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1c(_objectSpread$1c({}, productSelections), {}, {
|
|
2824
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1c({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2824
2825
|
from: 'nameAllLocales',
|
|
2825
2826
|
to: 'name'
|
|
2826
2827
|
}])))
|
|
@@ -2996,8 +2997,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2996
2997
|
}
|
|
2997
2998
|
});
|
|
2998
2999
|
|
|
2999
|
-
function ownKeys$
|
|
3000
|
-
function _objectSpread$
|
|
3000
|
+
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; }
|
|
3001
|
+
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; }
|
|
3001
3002
|
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 } } } };
|
|
3002
3003
|
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 } } } };
|
|
3003
3004
|
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 } } } };
|
|
@@ -3018,10 +3019,10 @@ const ChannelPickerInput = _ref => {
|
|
|
3018
3019
|
const _useIntl = reactIntl.useIntl(),
|
|
3019
3020
|
formatMessage = _useIntl.formatMessage;
|
|
3020
3021
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3021
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3022
|
+
const variables = React.useMemo(() => _objectSpread$1b({
|
|
3022
3023
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3023
3024
|
}, role && {
|
|
3024
|
-
|
|
3025
|
+
extraWhere: "roles contains any (\"".concat(role, "\")")
|
|
3025
3026
|
}), [dataLocale, role]);
|
|
3026
3027
|
const _useState = React.useState(),
|
|
3027
3028
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3147,8 +3148,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3147
3148
|
|
|
3148
3149
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3149
3150
|
|
|
3150
|
-
function ownKeys$
|
|
3151
|
-
function _objectSpread$
|
|
3151
|
+
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; }
|
|
3152
|
+
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; }
|
|
3152
3153
|
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); }; }
|
|
3153
3154
|
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; } }
|
|
3154
3155
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3180,7 +3181,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3180
3181
|
handleMouseOver: this.handleMouseOver,
|
|
3181
3182
|
handleMouseOut: this.handleMouseOut
|
|
3182
3183
|
};
|
|
3183
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3184
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$1a({}, _objectSpread$1a(_objectSpread$1a({}, this.props), injectedProps)));
|
|
3184
3185
|
}
|
|
3185
3186
|
}]);
|
|
3186
3187
|
return WithMouseOverState;
|
|
@@ -3189,8 +3190,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3189
3190
|
return WithMouseOverState;
|
|
3190
3191
|
};
|
|
3191
3192
|
|
|
3192
|
-
function ownKeys$
|
|
3193
|
-
function _objectSpread$
|
|
3193
|
+
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; }
|
|
3194
|
+
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; }
|
|
3194
3195
|
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); }; }
|
|
3195
3196
|
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; } }
|
|
3196
3197
|
var styles$h = {
|
|
@@ -3282,7 +3283,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3282
3283
|
}, {
|
|
3283
3284
|
key: "render",
|
|
3284
3285
|
value: function render() {
|
|
3285
|
-
const commonProps = _objectSpread$
|
|
3286
|
+
const commonProps = _objectSpread$19(_objectSpread$19({
|
|
3286
3287
|
value: this.state.draftValue,
|
|
3287
3288
|
autoComplete: this.props.autoComplete,
|
|
3288
3289
|
onChange: this.handleChange,
|
|
@@ -3301,7 +3302,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3301
3302
|
htmlFor: inputId,
|
|
3302
3303
|
children: this.props.label
|
|
3303
3304
|
})
|
|
3304
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3305
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3305
3306
|
id: inputId,
|
|
3306
3307
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3307
3308
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3310,7 +3311,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3310
3311
|
rows: 1,
|
|
3311
3312
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3312
3313
|
cacheMeasurements: true
|
|
3313
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3314
|
+
})) : jsxRuntime.jsx("input", _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3314
3315
|
id: inputId,
|
|
3315
3316
|
ref: this.props.inputRef,
|
|
3316
3317
|
type: this.props.as,
|
|
@@ -3678,8 +3679,8 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3678
3679
|
}
|
|
3679
3680
|
});
|
|
3680
3681
|
|
|
3681
|
-
function ownKeys$
|
|
3682
|
-
function _objectSpread$
|
|
3682
|
+
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; }
|
|
3683
|
+
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; }
|
|
3683
3684
|
const getBottomOption = formatMessage => ({
|
|
3684
3685
|
options: [{
|
|
3685
3686
|
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
@@ -3690,7 +3691,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3690
3691
|
const Option$2 = props => {
|
|
3691
3692
|
const _useIntl = reactIntl.useIntl(),
|
|
3692
3693
|
formatMessage = _useIntl.formatMessage;
|
|
3693
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3694
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$18(_objectSpread$18({}, props), {}, {
|
|
3694
3695
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3695
3696
|
tone: "secondary",
|
|
3696
3697
|
children: formatMessage(props.data.label)
|
|
@@ -3707,8 +3708,8 @@ const Option$2 = props => {
|
|
|
3707
3708
|
};
|
|
3708
3709
|
Option$2.displayName = 'Option';
|
|
3709
3710
|
|
|
3710
|
-
function ownKeys$
|
|
3711
|
-
function _objectSpread$
|
|
3711
|
+
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; }
|
|
3712
|
+
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; }
|
|
3712
3713
|
const useHandlers = onChange => {
|
|
3713
3714
|
const _useState = React.useState(),
|
|
3714
3715
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3719,8 +3720,8 @@ const useHandlers = onChange => {
|
|
|
3719
3720
|
}, []);
|
|
3720
3721
|
const handleChange = useEventCallback(event => {
|
|
3721
3722
|
var _event$target$value;
|
|
3722
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3723
|
-
target: _objectSpread$
|
|
3723
|
+
const eventWithExtractedValue = _objectSpread$17(_objectSpread$17({}, event), {}, {
|
|
3724
|
+
target: _objectSpread$17(_objectSpread$17({}, event.target), {}, {
|
|
3724
3725
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3725
3726
|
})
|
|
3726
3727
|
});
|
|
@@ -3729,8 +3730,9 @@ const useHandlers = onChange => {
|
|
|
3729
3730
|
return [handleInputChange, handleChange];
|
|
3730
3731
|
};
|
|
3731
3732
|
|
|
3732
|
-
|
|
3733
|
-
function
|
|
3733
|
+
const _excluded$1 = ["extraWhere"];
|
|
3734
|
+
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; }
|
|
3735
|
+
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; }
|
|
3734
3736
|
const constructPrefixSearchPredicate = function () {
|
|
3735
3737
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3736
3738
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3760,22 +3762,30 @@ const useLoadOptions = _ref => {
|
|
|
3760
3762
|
const client$1 = client.useApolloClient();
|
|
3761
3763
|
const loadOptions = React.useCallback(function () {
|
|
3762
3764
|
let inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3765
|
+
let where;
|
|
3766
|
+
if (inputValue.length) {
|
|
3767
|
+
if (isUUID(inputValue)) {
|
|
3768
|
+
where = "id = \"".concat(inputValue, "\"");
|
|
3769
|
+
} else {
|
|
3770
|
+
const _getPrefixSearchBound = getPrefixSearchBounds(inputValue),
|
|
3771
|
+
_getPrefixSearchBound2 = _slicedToArray(_getPrefixSearchBound, 2),
|
|
3772
|
+
lowerBound = _getPrefixSearchBound2[0],
|
|
3773
|
+
upperBound = _getPrefixSearchBound2[1];
|
|
3774
|
+
where = constructPrefixSearchPredicate(prefixSearchFields, lowerBound, upperBound);
|
|
3772
3775
|
}
|
|
3773
|
-
}
|
|
3776
|
+
}
|
|
3777
|
+
const _ref2 = variables !== null && variables !== void 0 ? variables : {},
|
|
3778
|
+
extraWhere = _ref2.extraWhere,
|
|
3779
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$1);
|
|
3780
|
+
if (typeof extraWhere === 'string') {
|
|
3781
|
+
var _context6;
|
|
3782
|
+
where = where ? _concatInstanceProperty__default["default"](_context6 = "(".concat(where, ") and ")).call(_context6, variables.extraWhere) : variables.extraWhere;
|
|
3783
|
+
}
|
|
3774
3784
|
return client$1.query({
|
|
3775
3785
|
query,
|
|
3776
|
-
variables: _objectSpread$
|
|
3786
|
+
variables: _objectSpread$16({
|
|
3777
3787
|
where
|
|
3778
|
-
},
|
|
3788
|
+
}, restVariables),
|
|
3779
3789
|
context: {
|
|
3780
3790
|
target: constants.MC_API_PROXY_TARGETS.COMMERCETOOLS_PLATFORM
|
|
3781
3791
|
},
|
|
@@ -4064,9 +4074,9 @@ const StatePickerInput = _ref => {
|
|
|
4064
4074
|
};
|
|
4065
4075
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4066
4076
|
|
|
4067
|
-
function ownKeys$
|
|
4068
|
-
function _objectSpread$
|
|
4069
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4077
|
+
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; }
|
|
4078
|
+
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; }
|
|
4079
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$15({
|
|
4070
4080
|
ref: ref,
|
|
4071
4081
|
style: {
|
|
4072
4082
|
display: 'block',
|
|
@@ -4204,8 +4214,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4204
4214
|
};
|
|
4205
4215
|
|
|
4206
4216
|
const _excluded = ["action"];
|
|
4207
|
-
function ownKeys$
|
|
4208
|
-
function _objectSpread$
|
|
4217
|
+
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; }
|
|
4218
|
+
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; }
|
|
4209
4219
|
|
|
4210
4220
|
/**
|
|
4211
4221
|
* Checks if a value is a LocalizedString
|
|
@@ -4227,7 +4237,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4227
4237
|
*/
|
|
4228
4238
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4229
4239
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4230
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4240
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$14(_objectSpread$14({}, customFields), {}, {
|
|
4231
4241
|
[customField.name]: customField.value
|
|
4232
4242
|
}), {});
|
|
4233
4243
|
};
|
|
@@ -4251,7 +4261,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4251
4261
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4252
4262
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4253
4263
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4254
|
-
return _objectSpread$
|
|
4264
|
+
return _objectSpread$14(_objectSpread$14(_objectSpread$14({}, transformedData), parent ? {
|
|
4255
4265
|
parent
|
|
4256
4266
|
} : {}), ancestors ? {
|
|
4257
4267
|
ancestors
|
|
@@ -4342,7 +4352,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4342
4352
|
const formatMoney = valueType => money => {
|
|
4343
4353
|
if (valueType === 'fixed') {
|
|
4344
4354
|
return {
|
|
4345
|
-
[money.type]: _objectSpread$
|
|
4355
|
+
[money.type]: _objectSpread$14({
|
|
4346
4356
|
centAmount: money.centAmount,
|
|
4347
4357
|
currencyCode: money.currencyCode
|
|
4348
4358
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4507,7 +4517,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4507
4517
|
case 'addAttributeDefinition':
|
|
4508
4518
|
return {
|
|
4509
4519
|
[actionName]: {
|
|
4510
|
-
attributeDefinition: _objectSpread$
|
|
4520
|
+
attributeDefinition: _objectSpread$14(_objectSpread$14({}, actionPayload.attribute), {}, {
|
|
4511
4521
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4512
4522
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4513
4523
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4603,7 +4613,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4603
4613
|
return {
|
|
4604
4614
|
[actionName]: {
|
|
4605
4615
|
attributeName: actionPayload.attributeName,
|
|
4606
|
-
value: _objectSpread$
|
|
4616
|
+
value: _objectSpread$14(_objectSpread$14({}, actionPayload.value), {}, {
|
|
4607
4617
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4608
4618
|
})
|
|
4609
4619
|
}
|
|
@@ -4612,7 +4622,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4612
4622
|
return {
|
|
4613
4623
|
[actionName]: {
|
|
4614
4624
|
attributeName: actionPayload.attributeName,
|
|
4615
|
-
newValue: _objectSpread$
|
|
4625
|
+
newValue: _objectSpread$14(_objectSpread$14({}, actionPayload.newValue), {}, {
|
|
4616
4626
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4617
4627
|
})
|
|
4618
4628
|
}
|
|
@@ -4639,7 +4649,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4639
4649
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4640
4650
|
taxCategory: actionPayload.taxCategory,
|
|
4641
4651
|
money: {
|
|
4642
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4652
|
+
[actionPayload.money.type]: _objectSpread$14({
|
|
4643
4653
|
centAmount: actionPayload.money.centAmount,
|
|
4644
4654
|
currencyCode: actionPayload.money.currencyCode
|
|
4645
4655
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4694,8 +4704,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4694
4704
|
fields: customFields
|
|
4695
4705
|
} : null;
|
|
4696
4706
|
return {
|
|
4697
|
-
[actionName]: _objectSpread$
|
|
4698
|
-
address: _objectSpread$
|
|
4707
|
+
[actionName]: _objectSpread$14(_objectSpread$14({}, actionPayload), {}, {
|
|
4708
|
+
address: _objectSpread$14(_objectSpread$14({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4699
4709
|
custom
|
|
4700
4710
|
})
|
|
4701
4711
|
})
|
|
@@ -4771,8 +4781,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4771
4781
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4772
4782
|
}
|
|
4773
4783
|
|
|
4774
|
-
function ownKeys
|
|
4775
|
-
function _objectSpread
|
|
4784
|
+
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; }
|
|
4785
|
+
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; }
|
|
4776
4786
|
function getPriceChannelName(price) {
|
|
4777
4787
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4778
4788
|
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;
|
|
@@ -4786,11 +4796,11 @@ function getDiscountValue(price) {
|
|
|
4786
4796
|
} 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) {
|
|
4787
4797
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4788
4798
|
}
|
|
4789
|
-
return price.discounted ? _objectSpread
|
|
4799
|
+
return price.discounted ? _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4790
4800
|
fractionedAmount,
|
|
4791
4801
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4792
4802
|
preciseAmount
|
|
4793
|
-
}) : _objectSpread
|
|
4803
|
+
}) : _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4794
4804
|
centAmount: 0
|
|
4795
4805
|
});
|
|
4796
4806
|
}
|
|
@@ -4819,7 +4829,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4819
4829
|
}
|
|
4820
4830
|
let preciseAmount;
|
|
4821
4831
|
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);
|
|
4822
|
-
return _objectSpread
|
|
4832
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4823
4833
|
centAmount,
|
|
4824
4834
|
preciseAmount
|
|
4825
4835
|
});
|
|
@@ -4836,7 +4846,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4836
4846
|
}
|
|
4837
4847
|
let preciseAmount;
|
|
4838
4848
|
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);
|
|
4839
|
-
return _objectSpread
|
|
4849
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4840
4850
|
centAmount,
|
|
4841
4851
|
preciseAmount
|
|
4842
4852
|
});
|
|
@@ -4848,7 +4858,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4848
4858
|
const currencyCode = price.value.currencyCode;
|
|
4849
4859
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4850
4860
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4851
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4861
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$13(_objectSpread$13({}, minPrices), {}, {
|
|
4852
4862
|
[currencyCode]: price.value
|
|
4853
4863
|
});
|
|
4854
4864
|
}
|
|
@@ -4857,8 +4867,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4857
4867
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4858
4868
|
}
|
|
4859
4869
|
|
|
4860
|
-
function ownKeys$
|
|
4861
|
-
function _objectSpread$
|
|
4870
|
+
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; }
|
|
4871
|
+
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; }
|
|
4862
4872
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4863
4873
|
var _context, _context4;
|
|
4864
4874
|
return {
|
|
@@ -4873,14 +4883,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4873
4883
|
return {
|
|
4874
4884
|
name: fieldDefinition.name,
|
|
4875
4885
|
required: fieldDefinition.required,
|
|
4876
|
-
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$
|
|
4877
|
-
elementType: _objectSpread$
|
|
4886
|
+
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), {}, {
|
|
4887
|
+
elementType: _objectSpread$12(_objectSpread$12({}, fieldDefinition.type.elementType), {}, {
|
|
4878
4888
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4879
4889
|
key: value.key,
|
|
4880
4890
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4881
4891
|
}))
|
|
4882
4892
|
})
|
|
4883
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4893
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4884
4894
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4885
4895
|
key: value.key,
|
|
4886
4896
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4891,7 +4901,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4891
4901
|
})
|
|
4892
4902
|
}
|
|
4893
4903
|
},
|
|
4894
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4904
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$12(_objectSpread$12({}, fields), {}, {
|
|
4895
4905
|
[customField.name]: customField.value
|
|
4896
4906
|
}), {})
|
|
4897
4907
|
};
|
|
@@ -4903,7 +4913,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4903
4913
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4904
4914
|
// in either case we return null
|
|
4905
4915
|
if (!productSelection) return null;
|
|
4906
|
-
return _objectSpread$
|
|
4916
|
+
return _objectSpread$12(_objectSpread$12({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4907
4917
|
from: 'nameAllLocales',
|
|
4908
4918
|
to: 'name'
|
|
4909
4919
|
}])), {}, {
|
|
@@ -4926,8 +4936,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4926
4936
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4927
4937
|
};
|
|
4928
4938
|
|
|
4929
|
-
function ownKeys$
|
|
4930
|
-
function _objectSpread$
|
|
4939
|
+
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; }
|
|
4940
|
+
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; }
|
|
4931
4941
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4932
4942
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4933
4943
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4944,7 +4954,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4944
4954
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4945
4955
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4946
4956
|
const definitionName = definition.type.elementType.name;
|
|
4947
|
-
return _objectSpread$
|
|
4957
|
+
return _objectSpread$11(_objectSpread$11({}, updateAction), {}, {
|
|
4948
4958
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4949
4959
|
});
|
|
4950
4960
|
}
|
|
@@ -5018,8 +5028,8 @@ function omitSetsOfSets() {
|
|
|
5018
5028
|
|
|
5019
5029
|
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 } } } };
|
|
5020
5030
|
|
|
5021
|
-
function ownKeys$
|
|
5022
|
-
function _objectSpread$
|
|
5031
|
+
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; }
|
|
5032
|
+
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; }
|
|
5023
5033
|
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); }; }
|
|
5024
5034
|
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; } }
|
|
5025
5035
|
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 } } } };
|
|
@@ -5079,7 +5089,7 @@ const mapDataToProps = _ref => {
|
|
|
5079
5089
|
return {
|
|
5080
5090
|
fetchTypeDefinitionsQuery: {
|
|
5081
5091
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5082
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5092
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$10({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5083
5093
|
isImmutable: true
|
|
5084
5094
|
}), [{
|
|
5085
5095
|
from: 'labelAllLocales',
|
|
@@ -5107,12 +5117,12 @@ const handlers$2 = {
|
|
|
5107
5117
|
}
|
|
5108
5118
|
};
|
|
5109
5119
|
|
|
5110
|
-
function ownKeys
|
|
5111
|
-
function _objectSpread
|
|
5120
|
+
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; }
|
|
5121
|
+
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; }
|
|
5112
5122
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5113
5123
|
return {
|
|
5114
5124
|
fields: customFieldsFromRestResponse.fields,
|
|
5115
|
-
type: _objectSpread
|
|
5125
|
+
type: _objectSpread$$({
|
|
5116
5126
|
id: customFieldsFromRestResponse.type.id
|
|
5117
5127
|
}, customFieldsFromRestResponse.type.obj)
|
|
5118
5128
|
};
|
|
@@ -5131,14 +5141,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5131
5141
|
name: fieldDefinition.name,
|
|
5132
5142
|
required: fieldDefinition.required,
|
|
5133
5143
|
inputHint: fieldDefinition.inputHint,
|
|
5134
|
-
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
|
|
5135
|
-
elementType: _objectSpread
|
|
5144
|
+
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), {}, {
|
|
5145
|
+
elementType: _objectSpread$$(_objectSpread$$({}, fieldDefinition.type.elementType), {}, {
|
|
5136
5146
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5137
5147
|
key: value.key,
|
|
5138
5148
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5139
5149
|
}))
|
|
5140
5150
|
})
|
|
5141
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread
|
|
5151
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5142
5152
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5143
5153
|
key: value.key,
|
|
5144
5154
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5154,7 +5164,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5154
5164
|
type: {
|
|
5155
5165
|
id: formCustomFields.type.id,
|
|
5156
5166
|
typeId: 'type',
|
|
5157
|
-
obj: _objectSpread
|
|
5167
|
+
obj: _objectSpread$$({}, formCustomFields.type)
|
|
5158
5168
|
},
|
|
5159
5169
|
fields: formCustomFields.fields
|
|
5160
5170
|
});
|
|
@@ -5162,7 +5172,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5162
5172
|
type: {
|
|
5163
5173
|
id: formCustomFields.type.id,
|
|
5164
5174
|
typeId: 'type',
|
|
5165
|
-
obj: _objectSpread
|
|
5175
|
+
obj: _objectSpread$$({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5166
5176
|
},
|
|
5167
5177
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5168
5178
|
});
|
|
@@ -5293,8 +5303,8 @@ const REFERENCED_TYPES = {
|
|
|
5293
5303
|
zone: 'zone'
|
|
5294
5304
|
};
|
|
5295
5305
|
|
|
5296
|
-
function ownKeys$
|
|
5297
|
-
function _objectSpread$
|
|
5306
|
+
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; }
|
|
5307
|
+
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; }
|
|
5298
5308
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5299
5309
|
let validatedValues = [];
|
|
5300
5310
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5361,12 +5371,131 @@ function validations (formValues, language, languages) {
|
|
|
5361
5371
|
var _context2;
|
|
5362
5372
|
// Collect all required and set type fields
|
|
5363
5373
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5364
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5365
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5374
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$_(_objectSpread$_({}, acc), {}, {
|
|
5375
|
+
[fieldDefinition.name]: _objectSpread$_(_objectSpread$_({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5366
5376
|
}), {});
|
|
5367
5377
|
return withoutEmptyErrorsByField(errors);
|
|
5368
5378
|
}
|
|
5369
5379
|
|
|
5380
|
+
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; }
|
|
5381
|
+
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; }
|
|
5382
|
+
const DroppableWrapper = _ref => {
|
|
5383
|
+
let children = _ref.children,
|
|
5384
|
+
onDragEnd = _ref.onDragEnd;
|
|
5385
|
+
return jsxRuntime.jsx(reactBeautifulDnd.DragDropContext, {
|
|
5386
|
+
onDragEnd: onDragEnd,
|
|
5387
|
+
children: jsxRuntime.jsx(reactBeautifulDnd.Droppable, {
|
|
5388
|
+
droppableId: "droppable",
|
|
5389
|
+
children: provided => jsxRuntime.jsxs("div", _objectSpread$Z(_objectSpread$Z({
|
|
5390
|
+
ref: provided.innerRef
|
|
5391
|
+
}, provided.droppableProps), {}, {
|
|
5392
|
+
children: [children, provided.placeholder]
|
|
5393
|
+
}))
|
|
5394
|
+
})
|
|
5395
|
+
});
|
|
5396
|
+
};
|
|
5397
|
+
|
|
5398
|
+
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; }
|
|
5399
|
+
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; }
|
|
5400
|
+
function DragHandle(props) {
|
|
5401
|
+
return jsxRuntime.jsx("div", _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5402
|
+
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
5403
|
+
icon: jsxRuntime.jsx(uiKit.DragIcon, {}),
|
|
5404
|
+
size: "medium",
|
|
5405
|
+
label: "reorder drag handle"
|
|
5406
|
+
})
|
|
5407
|
+
}));
|
|
5408
|
+
}
|
|
5409
|
+
DragHandle.displayName = 'DragHandle';
|
|
5410
|
+
|
|
5411
|
+
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; }
|
|
5412
|
+
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; }
|
|
5413
|
+
const DraggableWrapper = _ref => {
|
|
5414
|
+
let children = _ref.children,
|
|
5415
|
+
draggableKey = _ref.draggableKey,
|
|
5416
|
+
draggableId = _ref.draggableId,
|
|
5417
|
+
index = _ref.index;
|
|
5418
|
+
const portal = document.createElement('div');
|
|
5419
|
+
portal.id = 'drag-rbd-portal';
|
|
5420
|
+
document.body.appendChild(portal);
|
|
5421
|
+
return jsxRuntime.jsx(reactBeautifulDnd.Draggable, {
|
|
5422
|
+
draggableId: draggableId,
|
|
5423
|
+
index: index,
|
|
5424
|
+
children: (provided, snapshot) => {
|
|
5425
|
+
const child = jsxRuntime.jsx("div", _objectSpread$X(_objectSpread$X({
|
|
5426
|
+
ref: provided.innerRef
|
|
5427
|
+
}, provided.draggableProps), {}, {
|
|
5428
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
5429
|
+
gridTemplateColumns: '1fr 20fr',
|
|
5430
|
+
gridTemplateRows: "auto 1fr auto",
|
|
5431
|
+
gridGap: uiKit.customProperties.spacingM,
|
|
5432
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5433
|
+
children: jsxRuntime.jsx(DragHandle, _objectSpread$X({}, provided.dragHandleProps))
|
|
5434
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5435
|
+
children: children
|
|
5436
|
+
})]
|
|
5437
|
+
})
|
|
5438
|
+
}));
|
|
5439
|
+
if (!snapshot.isDragging) {
|
|
5440
|
+
return child;
|
|
5441
|
+
}
|
|
5442
|
+
|
|
5443
|
+
// render the draggable in the portal when it's being dragged
|
|
5444
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", {
|
|
5445
|
+
children: child
|
|
5446
|
+
}), portal);
|
|
5447
|
+
}
|
|
5448
|
+
}, draggableKey);
|
|
5449
|
+
};
|
|
5450
|
+
|
|
5451
|
+
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; }
|
|
5452
|
+
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; }
|
|
5453
|
+
const DefaultWrapper = _ref => {
|
|
5454
|
+
let children = _ref.children;
|
|
5455
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5456
|
+
children: children
|
|
5457
|
+
});
|
|
5458
|
+
};
|
|
5459
|
+
DefaultWrapper.propTypes = {
|
|
5460
|
+
children: PropTypes__default["default"].node.isRequired
|
|
5461
|
+
};
|
|
5462
|
+
const dndContextDefaultValues = {
|
|
5463
|
+
onDragEnd: () => {},
|
|
5464
|
+
DroppableWrapper: DefaultWrapper,
|
|
5465
|
+
DraggableWrapper: DefaultWrapper
|
|
5466
|
+
};
|
|
5467
|
+
const DnDContext = /*#__PURE__*/React.createContext(dndContextDefaultValues);
|
|
5468
|
+
const DndProvider = _ref2 => {
|
|
5469
|
+
let onDragEnd = _ref2.onDragEnd,
|
|
5470
|
+
children = _ref2.children;
|
|
5471
|
+
const _useToggleState = uiKit.useToggleState(false),
|
|
5472
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
5473
|
+
isDragAndDropMode = _useToggleState2[0],
|
|
5474
|
+
setDragAndDropMode = _useToggleState2[1];
|
|
5475
|
+
if (isDragAndDropMode) {
|
|
5476
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5477
|
+
value: {
|
|
5478
|
+
onDragEnd,
|
|
5479
|
+
DroppableWrapper,
|
|
5480
|
+
DraggableWrapper,
|
|
5481
|
+
setDragAndDropMode,
|
|
5482
|
+
isDragAndDropMode
|
|
5483
|
+
},
|
|
5484
|
+
children: children
|
|
5485
|
+
});
|
|
5486
|
+
}
|
|
5487
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5488
|
+
value: _objectSpread$W(_objectSpread$W({}, dndContextDefaultValues), {}, {
|
|
5489
|
+
isDragAndDropMode,
|
|
5490
|
+
setDragAndDropMode
|
|
5491
|
+
}),
|
|
5492
|
+
children: children
|
|
5493
|
+
});
|
|
5494
|
+
};
|
|
5495
|
+
const useDnDContext = () => {
|
|
5496
|
+
return React.useContext(DnDContext);
|
|
5497
|
+
};
|
|
5498
|
+
|
|
5370
5499
|
function CustomTextInput(props) {
|
|
5371
5500
|
const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
|
|
5372
5501
|
const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
|
|
@@ -7055,15 +7184,21 @@ CustomNestedInput.displayName = 'CustomNestedInput';
|
|
|
7055
7184
|
|
|
7056
7185
|
var styles$d = {
|
|
7057
7186
|
"divider": "divider-module__divider___4-vdy",
|
|
7187
|
+
"divider-horizontal": "divider-module__divider-horizontal___RuUcj",
|
|
7188
|
+
"divider-vertical": "divider-module__divider-vertical___32kJG",
|
|
7058
7189
|
"divider-solid": "divider-module__divider-solid___3Fs4q divider-module__divider___4-vdy",
|
|
7059
7190
|
"divider-dashed": "divider-module__divider-dashed___2Em8A divider-module__divider___4-vdy"
|
|
7060
7191
|
};
|
|
7061
7192
|
function Divider(_ref) {
|
|
7062
|
-
let isDashed = _ref.isDashed
|
|
7193
|
+
let isDashed = _ref.isDashed,
|
|
7194
|
+
_ref$orientation = _ref.orientation,
|
|
7195
|
+
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
7063
7196
|
return jsxRuntime.jsx("hr", {
|
|
7064
7197
|
className: classnames__default["default"]({
|
|
7065
7198
|
[styles$d['divider-solid']]: !isDashed,
|
|
7066
|
-
[styles$d['divider-dashed']]: isDashed
|
|
7199
|
+
[styles$d['divider-dashed']]: isDashed,
|
|
7200
|
+
[styles$d['divider-horizontal']]: orientation === 'horizontal',
|
|
7201
|
+
[styles$d['divider-vertical']]: orientation === 'vertical'
|
|
7067
7202
|
})
|
|
7068
7203
|
});
|
|
7069
7204
|
}
|
|
@@ -7611,7 +7746,11 @@ const CustomFieldsInternal = props => {
|
|
|
7611
7746
|
handleBlur = _useFormikContext.handleBlur;
|
|
7612
7747
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7613
7748
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7614
|
-
|
|
7749
|
+
const _useDnDContext = useDnDContext(),
|
|
7750
|
+
DroppableWrapper = _useDnDContext.DroppableWrapper,
|
|
7751
|
+
DraggableWrapper = _useDnDContext.DraggableWrapper,
|
|
7752
|
+
isDragAndDropMode = _useDnDContext.isDragAndDropMode;
|
|
7753
|
+
return jsxRuntime.jsx(DroppableWrapper, {
|
|
7615
7754
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7616
7755
|
var _context2;
|
|
7617
7756
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
@@ -7630,42 +7769,50 @@ const CustomFieldsInternal = props => {
|
|
|
7630
7769
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7631
7770
|
name: fieldName,
|
|
7632
7771
|
validate: validate,
|
|
7633
|
-
children: () =>
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
"
|
|
7638
|
-
|
|
7639
|
-
children:
|
|
7640
|
-
name: fieldName,
|
|
7641
|
-
fieldDefinition: fieldDefinition
|
|
7642
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7772
|
+
children: () => {
|
|
7773
|
+
var _context3, _context4;
|
|
7774
|
+
return jsxRuntime.jsx(DraggableWrapper, {
|
|
7775
|
+
draggableKey: _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, "-")).call(_context3, index),
|
|
7776
|
+
draggableId: _concatInstanceProperty__default["default"](_context4 = "".concat(fieldName, "-")).call(_context4, index),
|
|
7777
|
+
index: index,
|
|
7778
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7643
7779
|
scale: "xs",
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7780
|
+
children: jsxRuntime.jsxs("div", {
|
|
7781
|
+
"aria-invalid": _Object$keys__default["default"](fieldErrors !== null && fieldErrors !== void 0 ? fieldErrors : {}).length > 0,
|
|
7782
|
+
"aria-errormessage": "".concat(fieldName, "-error"),
|
|
7783
|
+
id: "".concat(fieldName, "-error"),
|
|
7784
|
+
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7785
|
+
name: fieldName,
|
|
7786
|
+
fieldDefinition: fieldDefinition
|
|
7787
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7788
|
+
scale: "xs",
|
|
7789
|
+
alignItems: "stretch",
|
|
7790
|
+
children: [isNested(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7791
|
+
name: fieldName,
|
|
7792
|
+
value: value,
|
|
7793
|
+
fieldDefinition: fieldDefinition,
|
|
7794
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7795
|
+
isReadOnly: props.isReadOnly,
|
|
7796
|
+
onBlur: handleBlur,
|
|
7797
|
+
setFieldValue: props.setFieldValue
|
|
7798
|
+
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7799
|
+
name: fieldName,
|
|
7800
|
+
value: value,
|
|
7801
|
+
fieldDefinition: fieldDefinition,
|
|
7802
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7803
|
+
isReadOnly: props.isReadOnly,
|
|
7804
|
+
onBlur: handleBlur,
|
|
7805
|
+
setFieldValue: props.setFieldValue,
|
|
7806
|
+
hasError: hasError
|
|
7807
|
+
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7808
|
+
isTouched: isTouched,
|
|
7809
|
+
errors: fieldErrors
|
|
7810
|
+
})]
|
|
7811
|
+
})]
|
|
7812
|
+
})
|
|
7813
|
+
})
|
|
7814
|
+
});
|
|
7815
|
+
}
|
|
7669
7816
|
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7670
7817
|
})
|
|
7671
7818
|
});
|
|
@@ -7696,6 +7843,8 @@ const CustomFields = props => {
|
|
|
7696
7843
|
};
|
|
7697
7844
|
CustomFields.displayName = 'CustomFields';
|
|
7698
7845
|
|
|
7846
|
+
CustomFields.DndProvider = DndProvider;
|
|
7847
|
+
|
|
7699
7848
|
var pickerMessages = reactIntl.defineMessages({
|
|
7700
7849
|
productSelectionsBasicSelectPlaceholder: {
|
|
7701
7850
|
id: 'ProductSelectionPicker.productSelectionsBasicSelectPlaceholder',
|
|
@@ -13414,6 +13563,7 @@ exports.truncate = truncate;
|
|
|
13414
13563
|
exports.unique = unique;
|
|
13415
13564
|
exports.uniqueObjects = uniqueObjects;
|
|
13416
13565
|
exports.useCachedCategoryOptions = useCachedCategoryOptions;
|
|
13566
|
+
exports.useCustomFieldsDnDContext = useDnDContext;
|
|
13417
13567
|
exports.useCustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits;
|
|
13418
13568
|
exports.useCustomersPlatformLimits = useCustomersPlatformLimits;
|
|
13419
13569
|
exports.useDebouncedPromiseCallback = useDebouncedPromiseCallback;
|