@commercetools-frontend/experimental-components 5.4.2 → 5.4.3
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 +293 -158
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +293 -158
- package/dist/commercetools-frontend-experimental-components.esm.js +294 -160
- package/dist/styles.css +127 -127
- package/package.json +16 -15
|
@@ -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,7 +3019,7 @@ 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
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -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,8 @@ const useHandlers = onChange => {
|
|
|
3729
3730
|
return [handleInputChange, handleChange];
|
|
3730
3731
|
};
|
|
3731
3732
|
|
|
3732
|
-
function ownKeys$
|
|
3733
|
-
function _objectSpread$
|
|
3733
|
+
function ownKeys$16(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3734
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$16(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$16(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3734
3735
|
const constructPrefixSearchPredicate = function () {
|
|
3735
3736
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3736
3737
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3773,7 +3774,7 @@ const useLoadOptions = _ref => {
|
|
|
3773
3774
|
}();
|
|
3774
3775
|
return client$1.query({
|
|
3775
3776
|
query,
|
|
3776
|
-
variables: _objectSpread$
|
|
3777
|
+
variables: _objectSpread$16({
|
|
3777
3778
|
where
|
|
3778
3779
|
}, variables),
|
|
3779
3780
|
context: {
|
|
@@ -4064,9 +4065,9 @@ const StatePickerInput = _ref => {
|
|
|
4064
4065
|
};
|
|
4065
4066
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4066
4067
|
|
|
4067
|
-
function ownKeys$
|
|
4068
|
-
function _objectSpread$
|
|
4069
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4068
|
+
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; }
|
|
4069
|
+
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; }
|
|
4070
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$15({
|
|
4070
4071
|
ref: ref,
|
|
4071
4072
|
style: {
|
|
4072
4073
|
display: 'block',
|
|
@@ -4204,8 +4205,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4204
4205
|
};
|
|
4205
4206
|
|
|
4206
4207
|
const _excluded = ["action"];
|
|
4207
|
-
function ownKeys$
|
|
4208
|
-
function _objectSpread$
|
|
4208
|
+
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; }
|
|
4209
|
+
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
4210
|
|
|
4210
4211
|
/**
|
|
4211
4212
|
* Checks if a value is a LocalizedString
|
|
@@ -4227,7 +4228,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4227
4228
|
*/
|
|
4228
4229
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4229
4230
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4230
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4231
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$14(_objectSpread$14({}, customFields), {}, {
|
|
4231
4232
|
[customField.name]: customField.value
|
|
4232
4233
|
}), {});
|
|
4233
4234
|
};
|
|
@@ -4251,7 +4252,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4251
4252
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4252
4253
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4253
4254
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4254
|
-
return _objectSpread$
|
|
4255
|
+
return _objectSpread$14(_objectSpread$14(_objectSpread$14({}, transformedData), parent ? {
|
|
4255
4256
|
parent
|
|
4256
4257
|
} : {}), ancestors ? {
|
|
4257
4258
|
ancestors
|
|
@@ -4342,7 +4343,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4342
4343
|
const formatMoney = valueType => money => {
|
|
4343
4344
|
if (valueType === 'fixed') {
|
|
4344
4345
|
return {
|
|
4345
|
-
[money.type]: _objectSpread$
|
|
4346
|
+
[money.type]: _objectSpread$14({
|
|
4346
4347
|
centAmount: money.centAmount,
|
|
4347
4348
|
currencyCode: money.currencyCode
|
|
4348
4349
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4507,7 +4508,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4507
4508
|
case 'addAttributeDefinition':
|
|
4508
4509
|
return {
|
|
4509
4510
|
[actionName]: {
|
|
4510
|
-
attributeDefinition: _objectSpread$
|
|
4511
|
+
attributeDefinition: _objectSpread$14(_objectSpread$14({}, actionPayload.attribute), {}, {
|
|
4511
4512
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4512
4513
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4513
4514
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4603,7 +4604,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4603
4604
|
return {
|
|
4604
4605
|
[actionName]: {
|
|
4605
4606
|
attributeName: actionPayload.attributeName,
|
|
4606
|
-
value: _objectSpread$
|
|
4607
|
+
value: _objectSpread$14(_objectSpread$14({}, actionPayload.value), {}, {
|
|
4607
4608
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4608
4609
|
})
|
|
4609
4610
|
}
|
|
@@ -4612,7 +4613,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4612
4613
|
return {
|
|
4613
4614
|
[actionName]: {
|
|
4614
4615
|
attributeName: actionPayload.attributeName,
|
|
4615
|
-
newValue: _objectSpread$
|
|
4616
|
+
newValue: _objectSpread$14(_objectSpread$14({}, actionPayload.newValue), {}, {
|
|
4616
4617
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4617
4618
|
})
|
|
4618
4619
|
}
|
|
@@ -4639,7 +4640,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4639
4640
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4640
4641
|
taxCategory: actionPayload.taxCategory,
|
|
4641
4642
|
money: {
|
|
4642
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4643
|
+
[actionPayload.money.type]: _objectSpread$14({
|
|
4643
4644
|
centAmount: actionPayload.money.centAmount,
|
|
4644
4645
|
currencyCode: actionPayload.money.currencyCode
|
|
4645
4646
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4694,8 +4695,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4694
4695
|
fields: customFields
|
|
4695
4696
|
} : null;
|
|
4696
4697
|
return {
|
|
4697
|
-
[actionName]: _objectSpread$
|
|
4698
|
-
address: _objectSpread$
|
|
4698
|
+
[actionName]: _objectSpread$14(_objectSpread$14({}, actionPayload), {}, {
|
|
4699
|
+
address: _objectSpread$14(_objectSpread$14({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4699
4700
|
custom
|
|
4700
4701
|
})
|
|
4701
4702
|
})
|
|
@@ -4771,8 +4772,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4771
4772
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4772
4773
|
}
|
|
4773
4774
|
|
|
4774
|
-
function ownKeys
|
|
4775
|
-
function _objectSpread
|
|
4775
|
+
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; }
|
|
4776
|
+
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
4777
|
function getPriceChannelName(price) {
|
|
4777
4778
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4778
4779
|
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 +4787,11 @@ function getDiscountValue(price) {
|
|
|
4786
4787
|
} 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
4788
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4788
4789
|
}
|
|
4789
|
-
return price.discounted ? _objectSpread
|
|
4790
|
+
return price.discounted ? _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4790
4791
|
fractionedAmount,
|
|
4791
4792
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4792
4793
|
preciseAmount
|
|
4793
|
-
}) : _objectSpread
|
|
4794
|
+
}) : _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4794
4795
|
centAmount: 0
|
|
4795
4796
|
});
|
|
4796
4797
|
}
|
|
@@ -4819,7 +4820,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4819
4820
|
}
|
|
4820
4821
|
let preciseAmount;
|
|
4821
4822
|
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
|
|
4823
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4823
4824
|
centAmount,
|
|
4824
4825
|
preciseAmount
|
|
4825
4826
|
});
|
|
@@ -4836,7 +4837,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4836
4837
|
}
|
|
4837
4838
|
let preciseAmount;
|
|
4838
4839
|
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
|
|
4840
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4840
4841
|
centAmount,
|
|
4841
4842
|
preciseAmount
|
|
4842
4843
|
});
|
|
@@ -4848,7 +4849,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4848
4849
|
const currencyCode = price.value.currencyCode;
|
|
4849
4850
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4850
4851
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4851
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4852
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$13(_objectSpread$13({}, minPrices), {}, {
|
|
4852
4853
|
[currencyCode]: price.value
|
|
4853
4854
|
});
|
|
4854
4855
|
}
|
|
@@ -4857,8 +4858,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4857
4858
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4858
4859
|
}
|
|
4859
4860
|
|
|
4860
|
-
function ownKeys$
|
|
4861
|
-
function _objectSpread$
|
|
4861
|
+
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; }
|
|
4862
|
+
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
4863
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4863
4864
|
var _context, _context4;
|
|
4864
4865
|
return {
|
|
@@ -4873,14 +4874,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4873
4874
|
return {
|
|
4874
4875
|
name: fieldDefinition.name,
|
|
4875
4876
|
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$
|
|
4877
|
+
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), {}, {
|
|
4878
|
+
elementType: _objectSpread$12(_objectSpread$12({}, fieldDefinition.type.elementType), {}, {
|
|
4878
4879
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4879
4880
|
key: value.key,
|
|
4880
4881
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4881
4882
|
}))
|
|
4882
4883
|
})
|
|
4883
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4884
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4884
4885
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4885
4886
|
key: value.key,
|
|
4886
4887
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4891,7 +4892,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4891
4892
|
})
|
|
4892
4893
|
}
|
|
4893
4894
|
},
|
|
4894
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4895
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$12(_objectSpread$12({}, fields), {}, {
|
|
4895
4896
|
[customField.name]: customField.value
|
|
4896
4897
|
}), {})
|
|
4897
4898
|
};
|
|
@@ -4903,7 +4904,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4903
4904
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4904
4905
|
// in either case we return null
|
|
4905
4906
|
if (!productSelection) return null;
|
|
4906
|
-
return _objectSpread$
|
|
4907
|
+
return _objectSpread$12(_objectSpread$12({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4907
4908
|
from: 'nameAllLocales',
|
|
4908
4909
|
to: 'name'
|
|
4909
4910
|
}])), {}, {
|
|
@@ -4926,8 +4927,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4926
4927
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4927
4928
|
};
|
|
4928
4929
|
|
|
4929
|
-
function ownKeys$
|
|
4930
|
-
function _objectSpread$
|
|
4930
|
+
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; }
|
|
4931
|
+
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
4932
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4932
4933
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4933
4934
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4944,7 +4945,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4944
4945
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4945
4946
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4946
4947
|
const definitionName = definition.type.elementType.name;
|
|
4947
|
-
return _objectSpread$
|
|
4948
|
+
return _objectSpread$11(_objectSpread$11({}, updateAction), {}, {
|
|
4948
4949
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4949
4950
|
});
|
|
4950
4951
|
}
|
|
@@ -5018,8 +5019,8 @@ function omitSetsOfSets() {
|
|
|
5018
5019
|
|
|
5019
5020
|
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
5021
|
|
|
5021
|
-
function ownKeys$
|
|
5022
|
-
function _objectSpread$
|
|
5022
|
+
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; }
|
|
5023
|
+
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
5024
|
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
5025
|
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
5026
|
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 +5080,7 @@ const mapDataToProps = _ref => {
|
|
|
5079
5080
|
return {
|
|
5080
5081
|
fetchTypeDefinitionsQuery: {
|
|
5081
5082
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5082
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5083
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$10({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5083
5084
|
isImmutable: true
|
|
5084
5085
|
}), [{
|
|
5085
5086
|
from: 'labelAllLocales',
|
|
@@ -5107,12 +5108,12 @@ const handlers$2 = {
|
|
|
5107
5108
|
}
|
|
5108
5109
|
};
|
|
5109
5110
|
|
|
5110
|
-
function ownKeys
|
|
5111
|
-
function _objectSpread
|
|
5111
|
+
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; }
|
|
5112
|
+
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
5113
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5113
5114
|
return {
|
|
5114
5115
|
fields: customFieldsFromRestResponse.fields,
|
|
5115
|
-
type: _objectSpread
|
|
5116
|
+
type: _objectSpread$$({
|
|
5116
5117
|
id: customFieldsFromRestResponse.type.id
|
|
5117
5118
|
}, customFieldsFromRestResponse.type.obj)
|
|
5118
5119
|
};
|
|
@@ -5131,14 +5132,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5131
5132
|
name: fieldDefinition.name,
|
|
5132
5133
|
required: fieldDefinition.required,
|
|
5133
5134
|
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
|
|
5135
|
+
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), {}, {
|
|
5136
|
+
elementType: _objectSpread$$(_objectSpread$$({}, fieldDefinition.type.elementType), {}, {
|
|
5136
5137
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5137
5138
|
key: value.key,
|
|
5138
5139
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5139
5140
|
}))
|
|
5140
5141
|
})
|
|
5141
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread
|
|
5142
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5142
5143
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5143
5144
|
key: value.key,
|
|
5144
5145
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5154,7 +5155,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5154
5155
|
type: {
|
|
5155
5156
|
id: formCustomFields.type.id,
|
|
5156
5157
|
typeId: 'type',
|
|
5157
|
-
obj: _objectSpread
|
|
5158
|
+
obj: _objectSpread$$({}, formCustomFields.type)
|
|
5158
5159
|
},
|
|
5159
5160
|
fields: formCustomFields.fields
|
|
5160
5161
|
});
|
|
@@ -5162,7 +5163,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5162
5163
|
type: {
|
|
5163
5164
|
id: formCustomFields.type.id,
|
|
5164
5165
|
typeId: 'type',
|
|
5165
|
-
obj: _objectSpread
|
|
5166
|
+
obj: _objectSpread$$({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5166
5167
|
},
|
|
5167
5168
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5168
5169
|
});
|
|
@@ -5293,8 +5294,8 @@ const REFERENCED_TYPES = {
|
|
|
5293
5294
|
zone: 'zone'
|
|
5294
5295
|
};
|
|
5295
5296
|
|
|
5296
|
-
function ownKeys$
|
|
5297
|
-
function _objectSpread$
|
|
5297
|
+
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; }
|
|
5298
|
+
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
5299
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5299
5300
|
let validatedValues = [];
|
|
5300
5301
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5361,12 +5362,131 @@ function validations (formValues, language, languages) {
|
|
|
5361
5362
|
var _context2;
|
|
5362
5363
|
// Collect all required and set type fields
|
|
5363
5364
|
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$
|
|
5365
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$_(_objectSpread$_({}, acc), {}, {
|
|
5366
|
+
[fieldDefinition.name]: _objectSpread$_(_objectSpread$_({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5366
5367
|
}), {});
|
|
5367
5368
|
return withoutEmptyErrorsByField(errors);
|
|
5368
5369
|
}
|
|
5369
5370
|
|
|
5371
|
+
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; }
|
|
5372
|
+
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; }
|
|
5373
|
+
const DroppableWrapper = _ref => {
|
|
5374
|
+
let children = _ref.children,
|
|
5375
|
+
onDragEnd = _ref.onDragEnd;
|
|
5376
|
+
return jsxRuntime.jsx(reactBeautifulDnd.DragDropContext, {
|
|
5377
|
+
onDragEnd: onDragEnd,
|
|
5378
|
+
children: jsxRuntime.jsx(reactBeautifulDnd.Droppable, {
|
|
5379
|
+
droppableId: "droppable",
|
|
5380
|
+
children: provided => jsxRuntime.jsxs("div", _objectSpread$Z(_objectSpread$Z({
|
|
5381
|
+
ref: provided.innerRef
|
|
5382
|
+
}, provided.droppableProps), {}, {
|
|
5383
|
+
children: [children, provided.placeholder]
|
|
5384
|
+
}))
|
|
5385
|
+
})
|
|
5386
|
+
});
|
|
5387
|
+
};
|
|
5388
|
+
|
|
5389
|
+
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; }
|
|
5390
|
+
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; }
|
|
5391
|
+
function DragHandle(props) {
|
|
5392
|
+
return jsxRuntime.jsx("div", _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5393
|
+
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
5394
|
+
icon: jsxRuntime.jsx(uiKit.DragIcon, {}),
|
|
5395
|
+
size: "medium",
|
|
5396
|
+
label: "reorder drag handle"
|
|
5397
|
+
})
|
|
5398
|
+
}));
|
|
5399
|
+
}
|
|
5400
|
+
DragHandle.displayName = 'DragHandle';
|
|
5401
|
+
|
|
5402
|
+
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; }
|
|
5403
|
+
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; }
|
|
5404
|
+
const DraggableWrapper = _ref => {
|
|
5405
|
+
let children = _ref.children,
|
|
5406
|
+
draggableKey = _ref.draggableKey,
|
|
5407
|
+
draggableId = _ref.draggableId,
|
|
5408
|
+
index = _ref.index;
|
|
5409
|
+
const portal = document.createElement('div');
|
|
5410
|
+
portal.id = 'drag-rbd-portal';
|
|
5411
|
+
document.body.appendChild(portal);
|
|
5412
|
+
return jsxRuntime.jsx(reactBeautifulDnd.Draggable, {
|
|
5413
|
+
draggableId: draggableId,
|
|
5414
|
+
index: index,
|
|
5415
|
+
children: (provided, snapshot) => {
|
|
5416
|
+
const child = jsxRuntime.jsx("div", _objectSpread$X(_objectSpread$X({
|
|
5417
|
+
ref: provided.innerRef
|
|
5418
|
+
}, provided.draggableProps), {}, {
|
|
5419
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
5420
|
+
gridTemplateColumns: '1fr 20fr',
|
|
5421
|
+
gridTemplateRows: "auto 1fr auto",
|
|
5422
|
+
gridGap: uiKit.customProperties.spacingL,
|
|
5423
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5424
|
+
children: jsxRuntime.jsx(DragHandle, _objectSpread$X({}, provided.dragHandleProps))
|
|
5425
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5426
|
+
children: children
|
|
5427
|
+
})]
|
|
5428
|
+
})
|
|
5429
|
+
}));
|
|
5430
|
+
if (!snapshot.isDragging) {
|
|
5431
|
+
return child;
|
|
5432
|
+
}
|
|
5433
|
+
|
|
5434
|
+
// render the draggable in the portal when it's being dragged
|
|
5435
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", {
|
|
5436
|
+
children: child
|
|
5437
|
+
}), portal);
|
|
5438
|
+
}
|
|
5439
|
+
}, draggableKey);
|
|
5440
|
+
};
|
|
5441
|
+
|
|
5442
|
+
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; }
|
|
5443
|
+
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; }
|
|
5444
|
+
const DefaultWrapper = _ref => {
|
|
5445
|
+
let children = _ref.children;
|
|
5446
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5447
|
+
children: children
|
|
5448
|
+
});
|
|
5449
|
+
};
|
|
5450
|
+
DefaultWrapper.propTypes = {
|
|
5451
|
+
children: PropTypes__default["default"].node.isRequired
|
|
5452
|
+
};
|
|
5453
|
+
const dndContextDefaultValues = {
|
|
5454
|
+
onDragEnd: () => {},
|
|
5455
|
+
DroppableWrapper: DefaultWrapper,
|
|
5456
|
+
DraggableWrapper: DefaultWrapper
|
|
5457
|
+
};
|
|
5458
|
+
const DnDContext = /*#__PURE__*/React.createContext(dndContextDefaultValues);
|
|
5459
|
+
const DndProvider = _ref2 => {
|
|
5460
|
+
let onDragEnd = _ref2.onDragEnd,
|
|
5461
|
+
children = _ref2.children;
|
|
5462
|
+
const _useToggleState = uiKit.useToggleState(false),
|
|
5463
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
5464
|
+
isDragAndDropMode = _useToggleState2[0],
|
|
5465
|
+
setDragAndDropMode = _useToggleState2[1];
|
|
5466
|
+
if (isDragAndDropMode) {
|
|
5467
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5468
|
+
value: {
|
|
5469
|
+
onDragEnd,
|
|
5470
|
+
DroppableWrapper,
|
|
5471
|
+
DraggableWrapper,
|
|
5472
|
+
setDragAndDropMode,
|
|
5473
|
+
isDragAndDropMode
|
|
5474
|
+
},
|
|
5475
|
+
children: children
|
|
5476
|
+
});
|
|
5477
|
+
}
|
|
5478
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5479
|
+
value: _objectSpread$W(_objectSpread$W({}, dndContextDefaultValues), {}, {
|
|
5480
|
+
isDragAndDropMode,
|
|
5481
|
+
setDragAndDropMode
|
|
5482
|
+
}),
|
|
5483
|
+
children: children
|
|
5484
|
+
});
|
|
5485
|
+
};
|
|
5486
|
+
const useDnDContext = () => {
|
|
5487
|
+
return React.useContext(DnDContext);
|
|
5488
|
+
};
|
|
5489
|
+
|
|
5370
5490
|
function CustomTextInput(props) {
|
|
5371
5491
|
const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
|
|
5372
5492
|
const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
|
|
@@ -7611,7 +7731,11 @@ const CustomFieldsInternal = props => {
|
|
|
7611
7731
|
handleBlur = _useFormikContext.handleBlur;
|
|
7612
7732
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7613
7733
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7614
|
-
|
|
7734
|
+
const _useDnDContext = useDnDContext(),
|
|
7735
|
+
DroppableWrapper = _useDnDContext.DroppableWrapper,
|
|
7736
|
+
DraggableWrapper = _useDnDContext.DraggableWrapper,
|
|
7737
|
+
isDragAndDropMode = _useDnDContext.isDragAndDropMode;
|
|
7738
|
+
return jsxRuntime.jsx(DroppableWrapper, {
|
|
7615
7739
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7616
7740
|
var _context2;
|
|
7617
7741
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
@@ -7630,42 +7754,50 @@ const CustomFieldsInternal = props => {
|
|
|
7630
7754
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7631
7755
|
name: fieldName,
|
|
7632
7756
|
validate: validate,
|
|
7633
|
-
children: () =>
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
"
|
|
7638
|
-
|
|
7639
|
-
children:
|
|
7640
|
-
name: fieldName,
|
|
7641
|
-
fieldDefinition: fieldDefinition
|
|
7642
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7757
|
+
children: () => {
|
|
7758
|
+
var _context3, _context4;
|
|
7759
|
+
return jsxRuntime.jsx(DraggableWrapper, {
|
|
7760
|
+
draggableKey: _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, "-")).call(_context3, index),
|
|
7761
|
+
draggableId: _concatInstanceProperty__default["default"](_context4 = "".concat(fieldName, "-")).call(_context4, index),
|
|
7762
|
+
index: index,
|
|
7763
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7643
7764
|
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
|
-
|
|
7765
|
+
children: jsxRuntime.jsxs("div", {
|
|
7766
|
+
"aria-invalid": _Object$keys__default["default"](fieldErrors !== null && fieldErrors !== void 0 ? fieldErrors : {}).length > 0,
|
|
7767
|
+
"aria-errormessage": "".concat(fieldName, "-error"),
|
|
7768
|
+
id: "".concat(fieldName, "-error"),
|
|
7769
|
+
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7770
|
+
name: fieldName,
|
|
7771
|
+
fieldDefinition: fieldDefinition
|
|
7772
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7773
|
+
scale: "xs",
|
|
7774
|
+
alignItems: "stretch",
|
|
7775
|
+
children: [isNested(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7776
|
+
name: fieldName,
|
|
7777
|
+
value: value,
|
|
7778
|
+
fieldDefinition: fieldDefinition,
|
|
7779
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7780
|
+
isReadOnly: props.isReadOnly,
|
|
7781
|
+
onBlur: handleBlur,
|
|
7782
|
+
setFieldValue: props.setFieldValue
|
|
7783
|
+
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7784
|
+
name: fieldName,
|
|
7785
|
+
value: value,
|
|
7786
|
+
fieldDefinition: fieldDefinition,
|
|
7787
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7788
|
+
isReadOnly: props.isReadOnly,
|
|
7789
|
+
onBlur: handleBlur,
|
|
7790
|
+
setFieldValue: props.setFieldValue,
|
|
7791
|
+
hasError: hasError
|
|
7792
|
+
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7793
|
+
isTouched: isTouched,
|
|
7794
|
+
errors: fieldErrors
|
|
7795
|
+
})]
|
|
7796
|
+
})]
|
|
7797
|
+
})
|
|
7798
|
+
})
|
|
7799
|
+
});
|
|
7800
|
+
}
|
|
7669
7801
|
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7670
7802
|
})
|
|
7671
7803
|
});
|
|
@@ -7696,6 +7828,8 @@ const CustomFields = props => {
|
|
|
7696
7828
|
};
|
|
7697
7829
|
CustomFields.displayName = 'CustomFields';
|
|
7698
7830
|
|
|
7831
|
+
CustomFields.DndProvider = DndProvider;
|
|
7832
|
+
|
|
7699
7833
|
var pickerMessages = reactIntl.defineMessages({
|
|
7700
7834
|
productSelectionsBasicSelectPlaceholder: {
|
|
7701
7835
|
id: 'ProductSelectionPicker.productSelectionsBasicSelectPlaceholder',
|
|
@@ -13414,6 +13548,7 @@ exports.truncate = truncate;
|
|
|
13414
13548
|
exports.unique = unique;
|
|
13415
13549
|
exports.uniqueObjects = uniqueObjects;
|
|
13416
13550
|
exports.useCachedCategoryOptions = useCachedCategoryOptions;
|
|
13551
|
+
exports.useCustomFieldsDnDContext = useDnDContext;
|
|
13417
13552
|
exports.useCustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits;
|
|
13418
13553
|
exports.useCustomersPlatformLimits = useCustomersPlatformLimits;
|
|
13419
13554
|
exports.useDebouncedPromiseCallback = useDebouncedPromiseCallback;
|