@commercetools-frontend/experimental-components 5.4.1 → 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 +67 -67
- 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 _Math$trunc__default = /*#__PURE__*/_interopDefault(_Math$trunc);
|
|
@@ -1672,8 +1673,8 @@ const getData = (code, field) => {
|
|
|
1672
1673
|
};
|
|
1673
1674
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1674
1675
|
|
|
1675
|
-
function ownKeys$
|
|
1676
|
-
function _objectSpread$
|
|
1676
|
+
function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1677
|
+
function _objectSpread$1p(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1p(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1p(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1677
1678
|
function formatMoneyRangeValue(value, intl) {
|
|
1678
1679
|
var _context;
|
|
1679
1680
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1683,7 +1684,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1683
1684
|
return '';
|
|
1684
1685
|
}
|
|
1685
1686
|
function formatMoneyValue(amount, currency, intl) {
|
|
1686
|
-
return formatMoney$2(_objectSpread$
|
|
1687
|
+
return formatMoney$2(_objectSpread$1p({
|
|
1687
1688
|
centAmount: amount,
|
|
1688
1689
|
fractionDigits: getFractionDigit(currency)
|
|
1689
1690
|
}, currency ? {
|
|
@@ -1700,7 +1701,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1700
1701
|
}
|
|
1701
1702
|
function formatMoney$2(moneyValue, intl, options) {
|
|
1702
1703
|
var _moneyValue$fractione;
|
|
1703
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1704
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1p({
|
|
1704
1705
|
style: 'currency',
|
|
1705
1706
|
currency: moneyValue.currencyCode,
|
|
1706
1707
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1954,8 +1955,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1954
1955
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1955
1956
|
};
|
|
1956
1957
|
|
|
1957
|
-
function ownKeys$
|
|
1958
|
-
function _objectSpread$
|
|
1958
|
+
function ownKeys$1o(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1959
|
+
function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1959
1960
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1960
1961
|
const WithDataTablePaginationState = props => {
|
|
1961
1962
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1969,7 +1970,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1969
1970
|
key: initialValues === null || initialValues === void 0 || (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1970
1971
|
order: initialValues === null || initialValues === void 0 || (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1971
1972
|
});
|
|
1972
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1973
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1973
1974
|
dataTablePaginationState: {
|
|
1974
1975
|
page,
|
|
1975
1976
|
perPage,
|
|
@@ -1981,8 +1982,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1981
1982
|
return WithDataTablePaginationState;
|
|
1982
1983
|
};
|
|
1983
1984
|
|
|
1984
|
-
function ownKeys$
|
|
1985
|
-
function _objectSpread$
|
|
1985
|
+
function ownKeys$1n(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1986
|
+
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1986
1987
|
const injectNotifications = function () {
|
|
1987
1988
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1988
1989
|
return Component => {
|
|
@@ -1997,7 +1998,7 @@ const injectNotifications = function () {
|
|
|
1997
1998
|
onActionError,
|
|
1998
1999
|
hideAllPageNotifications
|
|
1999
2000
|
};
|
|
2000
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2001
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), {}, {
|
|
2001
2002
|
[propName]: notifications
|
|
2002
2003
|
}));
|
|
2003
2004
|
};
|
|
@@ -2006,22 +2007,22 @@ const injectNotifications = function () {
|
|
|
2006
2007
|
};
|
|
2007
2008
|
};
|
|
2008
2009
|
|
|
2009
|
-
function ownKeys$
|
|
2010
|
-
function _objectSpread$
|
|
2010
|
+
function ownKeys$1m(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2011
|
+
function _objectSpread$1m(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2011
2012
|
function isPropsMapper(mapProps) {
|
|
2012
2013
|
return typeof mapProps === 'function';
|
|
2013
2014
|
}
|
|
2014
2015
|
const withProps = mapProps => Component => {
|
|
2015
2016
|
const EnhancedWithProps = ownProps => {
|
|
2016
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2017
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2017
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
2018
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
2018
2019
|
};
|
|
2019
2020
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2020
2021
|
return EnhancedWithProps;
|
|
2021
2022
|
};
|
|
2022
2023
|
|
|
2023
|
-
function ownKeys$
|
|
2024
|
-
function _objectSpread$
|
|
2024
|
+
function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2025
|
+
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2025
2026
|
const useRedirectEffect = _ref => {
|
|
2026
2027
|
let goTo = _ref.goTo;
|
|
2027
2028
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2041,30 +2042,30 @@ const defaultOptions$5 = {
|
|
|
2041
2042
|
skip: () => false
|
|
2042
2043
|
};
|
|
2043
2044
|
const withRedirectTo = options => Component => {
|
|
2044
|
-
const mergedOptions = _objectSpread$
|
|
2045
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
2045
2046
|
const WithRedirectTo = props => {
|
|
2046
2047
|
if (!mergedOptions.skip(props)) {
|
|
2047
2048
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2048
2049
|
goTo: options.selectGoTo(props)
|
|
2049
2050
|
});
|
|
2050
2051
|
}
|
|
2051
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2052
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l({}, props));
|
|
2052
2053
|
};
|
|
2053
2054
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2054
2055
|
return WithRedirectTo;
|
|
2055
2056
|
};
|
|
2056
2057
|
|
|
2057
|
-
function ownKeys$
|
|
2058
|
-
function _objectSpread$
|
|
2058
|
+
function ownKeys$1k(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2059
|
+
function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2059
2060
|
const defaultOptions$4 = {
|
|
2060
2061
|
propName: 'modalState',
|
|
2061
2062
|
isInitiallyOpen: false
|
|
2062
2063
|
};
|
|
2063
2064
|
const injectModalState$1 = options => Component => {
|
|
2064
|
-
const mergedOptions = _objectSpread$
|
|
2065
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
2065
2066
|
const WithModalState = props => {
|
|
2066
2067
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2067
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2068
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
2068
2069
|
[mergedOptions.propName]: modalState
|
|
2069
2070
|
}));
|
|
2070
2071
|
};
|
|
@@ -2072,17 +2073,17 @@ const injectModalState$1 = options => Component => {
|
|
|
2072
2073
|
return WithModalState;
|
|
2073
2074
|
};
|
|
2074
2075
|
|
|
2075
|
-
function ownKeys$
|
|
2076
|
-
function _objectSpread$
|
|
2076
|
+
function ownKeys$1j(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2077
|
+
function _objectSpread$1j(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1j(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2077
2078
|
const defaultOptions$3 = {
|
|
2078
2079
|
propName: 'toggleState',
|
|
2079
2080
|
isInitiallyOpen: false
|
|
2080
2081
|
};
|
|
2081
2082
|
const injectModalState = options => Component => {
|
|
2082
|
-
const mergedOptions = _objectSpread$
|
|
2083
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
2083
2084
|
const WithToggleState = props => {
|
|
2084
2085
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2085
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2086
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
2086
2087
|
[mergedOptions.propName]: toggleState
|
|
2087
2088
|
}));
|
|
2088
2089
|
};
|
|
@@ -2090,8 +2091,8 @@ const injectModalState = options => Component => {
|
|
|
2090
2091
|
return WithToggleState;
|
|
2091
2092
|
};
|
|
2092
2093
|
|
|
2093
|
-
function ownKeys$
|
|
2094
|
-
function _objectSpread$
|
|
2094
|
+
function ownKeys$1i(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2095
|
+
function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1i(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2095
2096
|
const defaultOptions$2 = {
|
|
2096
2097
|
storageType: 'local',
|
|
2097
2098
|
segregateByUser: true
|
|
@@ -2109,7 +2110,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2109
2110
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2110
2111
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2111
2112
|
var _context;
|
|
2112
|
-
const mergedOptions = _objectSpread$
|
|
2113
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
2113
2114
|
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
2114
2115
|
var _context$user;
|
|
2115
2116
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2157,8 +2158,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2157
2158
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2158
2159
|
};
|
|
2159
2160
|
|
|
2160
|
-
function ownKeys$
|
|
2161
|
-
function _objectSpread$
|
|
2161
|
+
function ownKeys$1h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2162
|
+
function _objectSpread$1h(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1h(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2162
2163
|
const defaultOptions$1 = {
|
|
2163
2164
|
propName: 'storage',
|
|
2164
2165
|
storageKey: '',
|
|
@@ -2171,7 +2172,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2171
2172
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2172
2173
|
* argument position does not allow passing specification of option(s).
|
|
2173
2174
|
*/
|
|
2174
|
-
const mergedOptions = _objectSpread$
|
|
2175
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
2175
2176
|
const WithStorage = props => {
|
|
2176
2177
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2177
2178
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2185,7 +2186,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2185
2186
|
readFromStorage
|
|
2186
2187
|
}
|
|
2187
2188
|
};
|
|
2188
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2189
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
2189
2190
|
};
|
|
2190
2191
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2191
2192
|
return WithStorage;
|
|
@@ -2229,8 +2230,8 @@ const usePrevious = value => {
|
|
|
2229
2230
|
return ref.current;
|
|
2230
2231
|
};
|
|
2231
2232
|
|
|
2232
|
-
function ownKeys$
|
|
2233
|
-
function _objectSpread$
|
|
2233
|
+
function ownKeys$1g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2234
|
+
function _objectSpread$1g(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1g(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2234
2235
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2235
2236
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2236
2237
|
var _storesQueryResult$re;
|
|
@@ -2241,7 +2242,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2241
2242
|
offset: storesQueryResult.offset,
|
|
2242
2243
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2243
2244
|
var _store$productSelecti;
|
|
2244
|
-
return _objectSpread$
|
|
2245
|
+
return _objectSpread$1g(_objectSpread$1g({}, store), {}, {
|
|
2245
2246
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2246
2247
|
});
|
|
2247
2248
|
})
|
|
@@ -2249,7 +2250,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2249
2250
|
};
|
|
2250
2251
|
const createQueryVariables$6 = ownProps => {
|
|
2251
2252
|
var _context;
|
|
2252
|
-
return _objectSpread$
|
|
2253
|
+
return _objectSpread$1g(_objectSpread$1g({
|
|
2253
2254
|
limit: ownProps.limit,
|
|
2254
2255
|
offset: ownProps.offset,
|
|
2255
2256
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2404,8 +2405,8 @@ function useDidFormValidationFail() {
|
|
|
2404
2405
|
return Boolean(didFormValidationFail);
|
|
2405
2406
|
}
|
|
2406
2407
|
|
|
2407
|
-
function ownKeys$
|
|
2408
|
-
function _objectSpread$
|
|
2408
|
+
function ownKeys$1f(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2409
|
+
function _objectSpread$1f(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2409
2410
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2410
2411
|
const defaultOptions = {
|
|
2411
2412
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2433,7 +2434,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2433
2434
|
};
|
|
2434
2435
|
const usePersistedReminder = function () {
|
|
2435
2436
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2436
|
-
const mergedOptions = _objectSpread$
|
|
2437
|
+
const mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions), options);
|
|
2437
2438
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2438
2439
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2439
2440
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2497,8 +2498,8 @@ var messages$I = reactIntl.defineMessages({
|
|
|
2497
2498
|
}
|
|
2498
2499
|
});
|
|
2499
2500
|
|
|
2500
|
-
function ownKeys$
|
|
2501
|
-
function _objectSpread$
|
|
2501
|
+
function ownKeys$1e(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2502
|
+
function _objectSpread$1e(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2502
2503
|
const LinkToProfile = props => {
|
|
2503
2504
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2504
2505
|
to: "/account/profile",
|
|
@@ -2518,7 +2519,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2518
2519
|
isBold: true,
|
|
2519
2520
|
intlMessage: messages$I.profileUpdated
|
|
2520
2521
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2521
|
-
intlMessage: _objectSpread$
|
|
2522
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.addMoreInformation), {}, {
|
|
2522
2523
|
values: {
|
|
2523
2524
|
newline: getNewLine
|
|
2524
2525
|
}
|
|
@@ -2527,7 +2528,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2527
2528
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2528
2529
|
scale: "xs",
|
|
2529
2530
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2530
|
-
intlMessage: _objectSpread$
|
|
2531
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$I.informationAndProfileLink), {}, {
|
|
2531
2532
|
values: {
|
|
2532
2533
|
newline: getNewLine,
|
|
2533
2534
|
link: getLinkToProfile
|
|
@@ -2684,8 +2685,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2684
2685
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2685
2686
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2686
2687
|
|
|
2687
|
-
function ownKeys$
|
|
2688
|
-
function _objectSpread$
|
|
2688
|
+
function ownKeys$1d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2689
|
+
function _objectSpread$1d(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2689
2690
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2690
2691
|
const updatedColumnProps = {};
|
|
2691
2692
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2705,14 +2706,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2705
2706
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2706
2707
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2707
2708
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2708
|
-
return _objectSpread$
|
|
2709
|
+
return _objectSpread$1d(_objectSpread$1d({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2709
2710
|
});
|
|
2710
2711
|
};
|
|
2711
2712
|
const handleCacheUpdate = _ref2 => {
|
|
2712
2713
|
let update = _ref2.update,
|
|
2713
2714
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2714
2715
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2715
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2716
|
+
return updateCachedTableConfiguration(_objectSpread$1d(_objectSpread$1d({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2716
2717
|
};
|
|
2717
2718
|
|
|
2718
2719
|
// Signature:
|
|
@@ -2741,7 +2742,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2741
2742
|
return {
|
|
2742
2743
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2743
2744
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2744
|
-
return _objectSpread$
|
|
2745
|
+
return _objectSpread$1d({
|
|
2745
2746
|
key: visibleColumnKey
|
|
2746
2747
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2747
2748
|
}),
|
|
@@ -2812,14 +2813,14 @@ const handlers$4 = {
|
|
|
2812
2813
|
}
|
|
2813
2814
|
};
|
|
2814
2815
|
|
|
2815
|
-
function ownKeys$
|
|
2816
|
-
function _objectSpread$
|
|
2816
|
+
function ownKeys$1c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2817
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2817
2818
|
|
|
2818
2819
|
// eslint-disable-next-line import/prefer-default-export
|
|
2819
2820
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2820
2821
|
var _context;
|
|
2821
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2822
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2822
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1c(_objectSpread$1c({}, productSelections), {}, {
|
|
2823
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1c({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2823
2824
|
from: 'nameAllLocales',
|
|
2824
2825
|
to: 'name'
|
|
2825
2826
|
}])))
|
|
@@ -2995,8 +2996,8 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
2995
2996
|
}
|
|
2996
2997
|
});
|
|
2997
2998
|
|
|
2998
|
-
function ownKeys$
|
|
2999
|
-
function _objectSpread$
|
|
2999
|
+
function ownKeys$1b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3000
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3000
3001
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3001
3002
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3002
3003
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -3017,7 +3018,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3017
3018
|
const _useIntl = reactIntl.useIntl(),
|
|
3018
3019
|
formatMessage = _useIntl.formatMessage;
|
|
3019
3020
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
3020
|
-
const variables = React.useMemo(() => _objectSpread$
|
|
3021
|
+
const variables = React.useMemo(() => _objectSpread$1b({
|
|
3021
3022
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3022
3023
|
}, role && {
|
|
3023
3024
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -3146,8 +3147,8 @@ var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
|
3146
3147
|
|
|
3147
3148
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3148
3149
|
|
|
3149
|
-
function ownKeys$
|
|
3150
|
-
function _objectSpread$
|
|
3150
|
+
function ownKeys$1a(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3151
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1a(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3151
3152
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3152
3153
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3153
3154
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3179,7 +3180,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3179
3180
|
handleMouseOver: this.handleMouseOver,
|
|
3180
3181
|
handleMouseOut: this.handleMouseOut
|
|
3181
3182
|
};
|
|
3182
|
-
return jsxRuntime.jsx(BaseComponent, _objectSpread$
|
|
3183
|
+
return jsxRuntime.jsx(BaseComponent, _objectSpread$1a({}, _objectSpread$1a(_objectSpread$1a({}, this.props), injectedProps)));
|
|
3183
3184
|
}
|
|
3184
3185
|
}]);
|
|
3185
3186
|
return WithMouseOverState;
|
|
@@ -3188,8 +3189,8 @@ const withMouseOverState = BaseComponent => {
|
|
|
3188
3189
|
return WithMouseOverState;
|
|
3189
3190
|
};
|
|
3190
3191
|
|
|
3191
|
-
function ownKeys$
|
|
3192
|
-
function _objectSpread$
|
|
3192
|
+
function ownKeys$19(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3193
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3193
3194
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3194
3195
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3195
3196
|
var styles$h = {
|
|
@@ -3281,7 +3282,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3281
3282
|
}, {
|
|
3282
3283
|
key: "render",
|
|
3283
3284
|
value: function render() {
|
|
3284
|
-
const commonProps = _objectSpread$
|
|
3285
|
+
const commonProps = _objectSpread$19(_objectSpread$19({
|
|
3285
3286
|
value: this.state.draftValue,
|
|
3286
3287
|
autoComplete: this.props.autoComplete,
|
|
3287
3288
|
onChange: this.handleChange,
|
|
@@ -3300,7 +3301,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3300
3301
|
htmlFor: inputId,
|
|
3301
3302
|
children: this.props.label
|
|
3302
3303
|
})
|
|
3303
|
-
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$
|
|
3304
|
+
}), this.props.as === 'textarea' ? jsxRuntime.jsx(Textarea__default["default"], _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3304
3305
|
id: inputId,
|
|
3305
3306
|
className: classnames__default["default"](styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3306
3307
|
[styles$h.invalid]: !this.props.isValid,
|
|
@@ -3309,7 +3310,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3309
3310
|
rows: 1,
|
|
3310
3311
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3311
3312
|
cacheMeasurements: true
|
|
3312
|
-
})) : jsxRuntime.jsx("input", _objectSpread$
|
|
3313
|
+
})) : jsxRuntime.jsx("input", _objectSpread$19(_objectSpread$19({}, commonProps), {}, {
|
|
3313
3314
|
id: inputId,
|
|
3314
3315
|
ref: this.props.inputRef,
|
|
3315
3316
|
type: this.props.as,
|
|
@@ -3677,8 +3678,8 @@ var messages$E = reactIntl.defineMessages({
|
|
|
3677
3678
|
}
|
|
3678
3679
|
});
|
|
3679
3680
|
|
|
3680
|
-
function ownKeys$
|
|
3681
|
-
function _objectSpread$
|
|
3681
|
+
function ownKeys$18(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3682
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$18(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3682
3683
|
const getBottomOption = formatMessage => ({
|
|
3683
3684
|
options: [{
|
|
3684
3685
|
label: formatMessage ? formatMessage(messages$E.bottomOption) : messages$E.bottomOption,
|
|
@@ -3689,7 +3690,7 @@ const getBottomOption = formatMessage => ({
|
|
|
3689
3690
|
const Option$2 = props => {
|
|
3690
3691
|
const _useIntl = reactIntl.useIntl(),
|
|
3691
3692
|
formatMessage = _useIntl.formatMessage;
|
|
3692
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
3693
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$18(_objectSpread$18({}, props), {}, {
|
|
3693
3694
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3694
3695
|
tone: "secondary",
|
|
3695
3696
|
children: formatMessage(props.data.label)
|
|
@@ -3706,8 +3707,8 @@ const Option$2 = props => {
|
|
|
3706
3707
|
};
|
|
3707
3708
|
Option$2.displayName = 'Option';
|
|
3708
3709
|
|
|
3709
|
-
function ownKeys$
|
|
3710
|
-
function _objectSpread$
|
|
3710
|
+
function ownKeys$17(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3711
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$17(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$17(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3711
3712
|
const useHandlers = onChange => {
|
|
3712
3713
|
const _useState = React.useState(),
|
|
3713
3714
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3718,8 +3719,8 @@ const useHandlers = onChange => {
|
|
|
3718
3719
|
}, []);
|
|
3719
3720
|
const handleChange = useEventCallback(event => {
|
|
3720
3721
|
var _event$target$value;
|
|
3721
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3722
|
-
target: _objectSpread$
|
|
3722
|
+
const eventWithExtractedValue = _objectSpread$17(_objectSpread$17({}, event), {}, {
|
|
3723
|
+
target: _objectSpread$17(_objectSpread$17({}, event.target), {}, {
|
|
3723
3724
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3724
3725
|
})
|
|
3725
3726
|
});
|
|
@@ -3728,8 +3729,8 @@ const useHandlers = onChange => {
|
|
|
3728
3729
|
return [handleInputChange, handleChange];
|
|
3729
3730
|
};
|
|
3730
3731
|
|
|
3731
|
-
function ownKeys$
|
|
3732
|
-
function _objectSpread$
|
|
3732
|
+
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; }
|
|
3733
|
+
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; }
|
|
3733
3734
|
const constructPrefixSearchPredicate = function () {
|
|
3734
3735
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3735
3736
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3772,7 +3773,7 @@ const useLoadOptions = _ref => {
|
|
|
3772
3773
|
}();
|
|
3773
3774
|
return client$1.query({
|
|
3774
3775
|
query,
|
|
3775
|
-
variables: _objectSpread$
|
|
3776
|
+
variables: _objectSpread$16({
|
|
3776
3777
|
where
|
|
3777
3778
|
}, variables),
|
|
3778
3779
|
context: {
|
|
@@ -4063,9 +4064,9 @@ const StatePickerInput = _ref => {
|
|
|
4063
4064
|
};
|
|
4064
4065
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
4065
4066
|
|
|
4066
|
-
function ownKeys$
|
|
4067
|
-
function _objectSpread$
|
|
4068
|
-
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
4067
|
+
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; }
|
|
4068
|
+
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; }
|
|
4069
|
+
const TooltipWrapper = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$15({
|
|
4069
4070
|
ref: ref,
|
|
4070
4071
|
style: {
|
|
4071
4072
|
display: 'block',
|
|
@@ -4203,8 +4204,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4203
4204
|
};
|
|
4204
4205
|
|
|
4205
4206
|
const _excluded = ["action"];
|
|
4206
|
-
function ownKeys$
|
|
4207
|
-
function _objectSpread$
|
|
4207
|
+
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; }
|
|
4208
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$14(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$14(Object(t))).call(_context9, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4208
4209
|
|
|
4209
4210
|
/**
|
|
4210
4211
|
* Checks if a value is a LocalizedString
|
|
@@ -4226,7 +4227,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4226
4227
|
*/
|
|
4227
4228
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4228
4229
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4229
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4230
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$14(_objectSpread$14({}, customFields), {}, {
|
|
4230
4231
|
[customField.name]: customField.value
|
|
4231
4232
|
}), {});
|
|
4232
4233
|
};
|
|
@@ -4250,7 +4251,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4250
4251
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4251
4252
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4252
4253
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4253
|
-
return _objectSpread$
|
|
4254
|
+
return _objectSpread$14(_objectSpread$14(_objectSpread$14({}, transformedData), parent ? {
|
|
4254
4255
|
parent
|
|
4255
4256
|
} : {}), ancestors ? {
|
|
4256
4257
|
ancestors
|
|
@@ -4341,7 +4342,7 @@ const createAttributeTypeValue = attribute => {
|
|
|
4341
4342
|
const formatMoney = valueType => money => {
|
|
4342
4343
|
if (valueType === 'fixed') {
|
|
4343
4344
|
return {
|
|
4344
|
-
[money.type]: _objectSpread$
|
|
4345
|
+
[money.type]: _objectSpread$14({
|
|
4345
4346
|
centAmount: money.centAmount,
|
|
4346
4347
|
currencyCode: money.currencyCode
|
|
4347
4348
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4506,7 +4507,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4506
4507
|
case 'addAttributeDefinition':
|
|
4507
4508
|
return {
|
|
4508
4509
|
[actionName]: {
|
|
4509
|
-
attributeDefinition: _objectSpread$
|
|
4510
|
+
attributeDefinition: _objectSpread$14(_objectSpread$14({}, actionPayload.attribute), {}, {
|
|
4510
4511
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4511
4512
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4512
4513
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4602,7 +4603,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4602
4603
|
return {
|
|
4603
4604
|
[actionName]: {
|
|
4604
4605
|
attributeName: actionPayload.attributeName,
|
|
4605
|
-
value: _objectSpread$
|
|
4606
|
+
value: _objectSpread$14(_objectSpread$14({}, actionPayload.value), {}, {
|
|
4606
4607
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4607
4608
|
})
|
|
4608
4609
|
}
|
|
@@ -4611,7 +4612,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4611
4612
|
return {
|
|
4612
4613
|
[actionName]: {
|
|
4613
4614
|
attributeName: actionPayload.attributeName,
|
|
4614
|
-
newValue: _objectSpread$
|
|
4615
|
+
newValue: _objectSpread$14(_objectSpread$14({}, actionPayload.newValue), {}, {
|
|
4615
4616
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4616
4617
|
})
|
|
4617
4618
|
}
|
|
@@ -4638,7 +4639,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4638
4639
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4639
4640
|
taxCategory: actionPayload.taxCategory,
|
|
4640
4641
|
money: {
|
|
4641
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4642
|
+
[actionPayload.money.type]: _objectSpread$14({
|
|
4642
4643
|
centAmount: actionPayload.money.centAmount,
|
|
4643
4644
|
currencyCode: actionPayload.money.currencyCode
|
|
4644
4645
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4693,8 +4694,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4693
4694
|
fields: customFields
|
|
4694
4695
|
} : null;
|
|
4695
4696
|
return {
|
|
4696
|
-
[actionName]: _objectSpread$
|
|
4697
|
-
address: _objectSpread$
|
|
4697
|
+
[actionName]: _objectSpread$14(_objectSpread$14({}, actionPayload), {}, {
|
|
4698
|
+
address: _objectSpread$14(_objectSpread$14({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4698
4699
|
custom
|
|
4699
4700
|
})
|
|
4700
4701
|
})
|
|
@@ -4770,8 +4771,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4770
4771
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4771
4772
|
}
|
|
4772
4773
|
|
|
4773
|
-
function ownKeys
|
|
4774
|
-
function _objectSpread
|
|
4774
|
+
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; }
|
|
4775
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$13(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$13(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4775
4776
|
function getPriceChannelName(price) {
|
|
4776
4777
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4777
4778
|
return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -4785,11 +4786,11 @@ function getDiscountValue(price) {
|
|
|
4785
4786
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 || (_price$discounted = _price$discounted.value) === null || _price$discounted === void 0 ? void 0 : _price$discounted.type) === PRECISION_TYPES.centPrecision) {
|
|
4786
4787
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4787
4788
|
}
|
|
4788
|
-
return price.discounted ? _objectSpread
|
|
4789
|
+
return price.discounted ? _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4789
4790
|
fractionedAmount,
|
|
4790
4791
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4791
4792
|
preciseAmount
|
|
4792
|
-
}) : _objectSpread
|
|
4793
|
+
}) : _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4793
4794
|
centAmount: 0
|
|
4794
4795
|
});
|
|
4795
4796
|
}
|
|
@@ -4818,7 +4819,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4818
4819
|
}
|
|
4819
4820
|
let preciseAmount;
|
|
4820
4821
|
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4821
|
-
return _objectSpread
|
|
4822
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4822
4823
|
centAmount,
|
|
4823
4824
|
preciseAmount
|
|
4824
4825
|
});
|
|
@@ -4835,7 +4836,7 @@ function getNetUnitPrice(_ref2) {
|
|
|
4835
4836
|
}
|
|
4836
4837
|
let preciseAmount;
|
|
4837
4838
|
if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4838
|
-
return _objectSpread
|
|
4839
|
+
return _objectSpread$13(_objectSpread$13({}, price.value), {}, {
|
|
4839
4840
|
centAmount,
|
|
4840
4841
|
preciseAmount
|
|
4841
4842
|
});
|
|
@@ -4847,7 +4848,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4847
4848
|
const currencyCode = price.value.currencyCode;
|
|
4848
4849
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4849
4850
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4850
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread
|
|
4851
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$13(_objectSpread$13({}, minPrices), {}, {
|
|
4851
4852
|
[currencyCode]: price.value
|
|
4852
4853
|
});
|
|
4853
4854
|
}
|
|
@@ -4856,8 +4857,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4856
4857
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4857
4858
|
}
|
|
4858
4859
|
|
|
4859
|
-
function ownKeys$
|
|
4860
|
-
function _objectSpread$
|
|
4860
|
+
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; }
|
|
4861
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$12(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$12(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4861
4862
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4862
4863
|
var _context, _context4;
|
|
4863
4864
|
return {
|
|
@@ -4872,14 +4873,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4872
4873
|
return {
|
|
4873
4874
|
name: fieldDefinition.name,
|
|
4874
4875
|
required: fieldDefinition.required,
|
|
4875
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4876
|
-
elementType: _objectSpread$
|
|
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$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4877
|
+
elementType: _objectSpread$12(_objectSpread$12({}, fieldDefinition.type.elementType), {}, {
|
|
4877
4878
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4878
4879
|
key: value.key,
|
|
4879
4880
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4880
4881
|
}))
|
|
4881
4882
|
})
|
|
4882
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4883
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$12(_objectSpread$12({}, fieldDefinition.type), {}, {
|
|
4883
4884
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4884
4885
|
key: value.key,
|
|
4885
4886
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4890,7 +4891,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4890
4891
|
})
|
|
4891
4892
|
}
|
|
4892
4893
|
},
|
|
4893
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4894
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$12(_objectSpread$12({}, fields), {}, {
|
|
4894
4895
|
[customField.name]: customField.value
|
|
4895
4896
|
}), {})
|
|
4896
4897
|
};
|
|
@@ -4902,7 +4903,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4902
4903
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4903
4904
|
// in either case we return null
|
|
4904
4905
|
if (!productSelection) return null;
|
|
4905
|
-
return _objectSpread$
|
|
4906
|
+
return _objectSpread$12(_objectSpread$12({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4906
4907
|
from: 'nameAllLocales',
|
|
4907
4908
|
to: 'name'
|
|
4908
4909
|
}])), {}, {
|
|
@@ -4925,8 +4926,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4925
4926
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4926
4927
|
};
|
|
4927
4928
|
|
|
4928
|
-
function ownKeys$
|
|
4929
|
-
function _objectSpread$
|
|
4929
|
+
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; }
|
|
4930
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$11(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$11(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4930
4931
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4931
4932
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4932
4933
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4943,7 +4944,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4943
4944
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4944
4945
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4945
4946
|
const definitionName = definition.type.elementType.name;
|
|
4946
|
-
return _objectSpread$
|
|
4947
|
+
return _objectSpread$11(_objectSpread$11({}, updateAction), {}, {
|
|
4947
4948
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4948
4949
|
});
|
|
4949
4950
|
}
|
|
@@ -5017,8 +5018,8 @@ function omitSetsOfSets() {
|
|
|
5017
5018
|
|
|
5018
5019
|
var GetProductTypesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductTypesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query GetProductTypesQuery($where: String) {\n productTypes(where: $where) {\n results {\n id\n name\n }\n }\n}\n\nquery GetProductTypeQuery($id: String) {\n productType(id: $id) {\n id\n name\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5019
5020
|
|
|
5020
|
-
function ownKeys$
|
|
5021
|
-
function _objectSpread$
|
|
5021
|
+
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; }
|
|
5022
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$10(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$10(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5022
5023
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
5023
5024
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
5024
5025
|
var FetchTypeDefinitionsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1172, source: { body: "query FetchTypeDefinitionsQuery($where: String, $limit: Int, $offset: Int) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n fieldDefinitions {\n type {\n name\n ... on SetType {\n elementType {\n name\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n ... on ReferenceType {\n referenceTypeId\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -5078,7 +5079,7 @@ const mapDataToProps = _ref => {
|
|
|
5078
5079
|
return {
|
|
5079
5080
|
fetchTypeDefinitionsQuery: {
|
|
5080
5081
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
5081
|
-
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
5082
|
+
customFieldDefinitions: uniqBy__default["default"](_mapInstanceProperty__default["default"](fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$10({}, l10n.applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
5082
5083
|
isImmutable: true
|
|
5083
5084
|
}), [{
|
|
5084
5085
|
from: 'labelAllLocales',
|
|
@@ -5106,12 +5107,12 @@ const handlers$2 = {
|
|
|
5106
5107
|
}
|
|
5107
5108
|
};
|
|
5108
5109
|
|
|
5109
|
-
function ownKeys
|
|
5110
|
-
function _objectSpread
|
|
5110
|
+
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; }
|
|
5111
|
+
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$$(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$$(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5111
5112
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
5112
5113
|
return {
|
|
5113
5114
|
fields: customFieldsFromRestResponse.fields,
|
|
5114
|
-
type: _objectSpread
|
|
5115
|
+
type: _objectSpread$$({
|
|
5115
5116
|
id: customFieldsFromRestResponse.type.id
|
|
5116
5117
|
}, customFieldsFromRestResponse.type.obj)
|
|
5117
5118
|
};
|
|
@@ -5130,14 +5131,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
5130
5131
|
name: fieldDefinition.name,
|
|
5131
5132
|
required: fieldDefinition.required,
|
|
5132
5133
|
inputHint: fieldDefinition.inputHint,
|
|
5133
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 || (_fieldDefinition$type = _fieldDefinition$type.elementType) === null || _fieldDefinition$type === void 0 ? void 0 : _fieldDefinition$type.name) === 'LocalizedEnum' ? _objectSpread
|
|
5134
|
-
elementType: _objectSpread
|
|
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$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5135
|
+
elementType: _objectSpread$$(_objectSpread$$({}, fieldDefinition.type.elementType), {}, {
|
|
5135
5136
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
5136
5137
|
key: value.key,
|
|
5137
5138
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
5138
5139
|
}))
|
|
5139
5140
|
})
|
|
5140
|
-
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread
|
|
5141
|
+
}) : ((_fieldDefinition$type2 = fieldDefinition.type) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$$(_objectSpread$$({}, fieldDefinition.type), {}, {
|
|
5141
5142
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
5142
5143
|
key: value.key,
|
|
5143
5144
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5153,7 +5154,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5153
5154
|
type: {
|
|
5154
5155
|
id: formCustomFields.type.id,
|
|
5155
5156
|
typeId: 'type',
|
|
5156
|
-
obj: _objectSpread
|
|
5157
|
+
obj: _objectSpread$$({}, formCustomFields.type)
|
|
5157
5158
|
},
|
|
5158
5159
|
fields: formCustomFields.fields
|
|
5159
5160
|
});
|
|
@@ -5161,7 +5162,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5161
5162
|
type: {
|
|
5162
5163
|
id: formCustomFields.type.id,
|
|
5163
5164
|
typeId: 'type',
|
|
5164
|
-
obj: _objectSpread
|
|
5165
|
+
obj: _objectSpread$$({}, omit__default["default"](formCustomFields.type, ['id']))
|
|
5165
5166
|
},
|
|
5166
5167
|
fields: omitBy__default["default"](formCustomFields.fields || {}, isNil__default["default"])
|
|
5167
5168
|
});
|
|
@@ -5292,8 +5293,8 @@ const REFERENCED_TYPES = {
|
|
|
5292
5293
|
zone: 'zone'
|
|
5293
5294
|
};
|
|
5294
5295
|
|
|
5295
|
-
function ownKeys$
|
|
5296
|
-
function _objectSpread$
|
|
5296
|
+
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; }
|
|
5297
|
+
function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$_(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$_(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5297
5298
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5298
5299
|
let validatedValues = [];
|
|
5299
5300
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5360,12 +5361,131 @@ function validations (formValues, language, languages) {
|
|
|
5360
5361
|
var _context2;
|
|
5361
5362
|
// Collect all required and set type fields
|
|
5362
5363
|
const fieldDefinitionsToValidate = _filterInstanceProperty__default["default"](_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5363
|
-
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5364
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5364
|
+
const errors = _reduceInstanceProperty__default["default"](fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$_(_objectSpread$_({}, acc), {}, {
|
|
5365
|
+
[fieldDefinition.name]: _objectSpread$_(_objectSpread$_({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5365
5366
|
}), {});
|
|
5366
5367
|
return withoutEmptyErrorsByField(errors);
|
|
5367
5368
|
}
|
|
5368
5369
|
|
|
5370
|
+
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; }
|
|
5371
|
+
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; }
|
|
5372
|
+
const DroppableWrapper = _ref => {
|
|
5373
|
+
let children = _ref.children,
|
|
5374
|
+
onDragEnd = _ref.onDragEnd;
|
|
5375
|
+
return jsxRuntime.jsx(reactBeautifulDnd.DragDropContext, {
|
|
5376
|
+
onDragEnd: onDragEnd,
|
|
5377
|
+
children: jsxRuntime.jsx(reactBeautifulDnd.Droppable, {
|
|
5378
|
+
droppableId: "droppable",
|
|
5379
|
+
children: provided => jsxRuntime.jsxs("div", _objectSpread$Z(_objectSpread$Z({
|
|
5380
|
+
ref: provided.innerRef
|
|
5381
|
+
}, provided.droppableProps), {}, {
|
|
5382
|
+
children: [children, provided.placeholder]
|
|
5383
|
+
}))
|
|
5384
|
+
})
|
|
5385
|
+
});
|
|
5386
|
+
};
|
|
5387
|
+
|
|
5388
|
+
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; }
|
|
5389
|
+
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; }
|
|
5390
|
+
function DragHandle(props) {
|
|
5391
|
+
return jsxRuntime.jsx("div", _objectSpread$Y(_objectSpread$Y({}, props), {}, {
|
|
5392
|
+
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
5393
|
+
icon: jsxRuntime.jsx(uiKit.DragIcon, {}),
|
|
5394
|
+
size: "medium",
|
|
5395
|
+
label: "reorder drag handle"
|
|
5396
|
+
})
|
|
5397
|
+
}));
|
|
5398
|
+
}
|
|
5399
|
+
DragHandle.displayName = 'DragHandle';
|
|
5400
|
+
|
|
5401
|
+
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; }
|
|
5402
|
+
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; }
|
|
5403
|
+
const DraggableWrapper = _ref => {
|
|
5404
|
+
let children = _ref.children,
|
|
5405
|
+
draggableKey = _ref.draggableKey,
|
|
5406
|
+
draggableId = _ref.draggableId,
|
|
5407
|
+
index = _ref.index;
|
|
5408
|
+
const portal = document.createElement('div');
|
|
5409
|
+
portal.id = 'drag-rbd-portal';
|
|
5410
|
+
document.body.appendChild(portal);
|
|
5411
|
+
return jsxRuntime.jsx(reactBeautifulDnd.Draggable, {
|
|
5412
|
+
draggableId: draggableId,
|
|
5413
|
+
index: index,
|
|
5414
|
+
children: (provided, snapshot) => {
|
|
5415
|
+
const child = jsxRuntime.jsx("div", _objectSpread$X(_objectSpread$X({
|
|
5416
|
+
ref: provided.innerRef
|
|
5417
|
+
}, provided.draggableProps), {}, {
|
|
5418
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
5419
|
+
gridTemplateColumns: '1fr 20fr',
|
|
5420
|
+
gridTemplateRows: "auto 1fr auto",
|
|
5421
|
+
gridGap: uiKit.customProperties.spacingL,
|
|
5422
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5423
|
+
children: jsxRuntime.jsx(DragHandle, _objectSpread$X({}, provided.dragHandleProps))
|
|
5424
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
5425
|
+
children: children
|
|
5426
|
+
})]
|
|
5427
|
+
})
|
|
5428
|
+
}));
|
|
5429
|
+
if (!snapshot.isDragging) {
|
|
5430
|
+
return child;
|
|
5431
|
+
}
|
|
5432
|
+
|
|
5433
|
+
// render the draggable in the portal when it's being dragged
|
|
5434
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal(jsxRuntime.jsx("div", {
|
|
5435
|
+
children: child
|
|
5436
|
+
}), portal);
|
|
5437
|
+
}
|
|
5438
|
+
}, draggableKey);
|
|
5439
|
+
};
|
|
5440
|
+
|
|
5441
|
+
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; }
|
|
5442
|
+
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; }
|
|
5443
|
+
const DefaultWrapper = _ref => {
|
|
5444
|
+
let children = _ref.children;
|
|
5445
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
5446
|
+
children: children
|
|
5447
|
+
});
|
|
5448
|
+
};
|
|
5449
|
+
DefaultWrapper.propTypes = {
|
|
5450
|
+
children: PropTypes__default["default"].node.isRequired
|
|
5451
|
+
};
|
|
5452
|
+
const dndContextDefaultValues = {
|
|
5453
|
+
onDragEnd: () => {},
|
|
5454
|
+
DroppableWrapper: DefaultWrapper,
|
|
5455
|
+
DraggableWrapper: DefaultWrapper
|
|
5456
|
+
};
|
|
5457
|
+
const DnDContext = /*#__PURE__*/React.createContext(dndContextDefaultValues);
|
|
5458
|
+
const DndProvider = _ref2 => {
|
|
5459
|
+
let onDragEnd = _ref2.onDragEnd,
|
|
5460
|
+
children = _ref2.children;
|
|
5461
|
+
const _useToggleState = uiKit.useToggleState(false),
|
|
5462
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
5463
|
+
isDragAndDropMode = _useToggleState2[0],
|
|
5464
|
+
setDragAndDropMode = _useToggleState2[1];
|
|
5465
|
+
if (isDragAndDropMode) {
|
|
5466
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5467
|
+
value: {
|
|
5468
|
+
onDragEnd,
|
|
5469
|
+
DroppableWrapper,
|
|
5470
|
+
DraggableWrapper,
|
|
5471
|
+
setDragAndDropMode,
|
|
5472
|
+
isDragAndDropMode
|
|
5473
|
+
},
|
|
5474
|
+
children: children
|
|
5475
|
+
});
|
|
5476
|
+
}
|
|
5477
|
+
return jsxRuntime.jsx(DnDContext.Provider, {
|
|
5478
|
+
value: _objectSpread$W(_objectSpread$W({}, dndContextDefaultValues), {}, {
|
|
5479
|
+
isDragAndDropMode,
|
|
5480
|
+
setDragAndDropMode
|
|
5481
|
+
}),
|
|
5482
|
+
children: children
|
|
5483
|
+
});
|
|
5484
|
+
};
|
|
5485
|
+
const useDnDContext = () => {
|
|
5486
|
+
return React.useContext(DnDContext);
|
|
5487
|
+
};
|
|
5488
|
+
|
|
5369
5489
|
function CustomTextInput(props) {
|
|
5370
5490
|
const isMultiLine = props.fieldDefinition.inputHint === 'MultiLine';
|
|
5371
5491
|
const InputComponent = isMultiLine ? uiKit.MultilineTextInput : uiKit.TextInput;
|
|
@@ -7604,7 +7724,11 @@ const CustomFieldsInternal = props => {
|
|
|
7604
7724
|
handleBlur = _useFormikContext.handleBlur;
|
|
7605
7725
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7606
7726
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7607
|
-
|
|
7727
|
+
const _useDnDContext = useDnDContext(),
|
|
7728
|
+
DroppableWrapper = _useDnDContext.DroppableWrapper,
|
|
7729
|
+
DraggableWrapper = _useDnDContext.DraggableWrapper,
|
|
7730
|
+
isDragAndDropMode = _useDnDContext.isDragAndDropMode;
|
|
7731
|
+
return jsxRuntime.jsx(DroppableWrapper, {
|
|
7608
7732
|
children: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7609
7733
|
var _context2;
|
|
7610
7734
|
const fieldName = getFieldName(props.name, fieldDefinition.name);
|
|
@@ -7623,42 +7747,50 @@ const CustomFieldsInternal = props => {
|
|
|
7623
7747
|
return jsxRuntime.jsx(formik.FastField, {
|
|
7624
7748
|
name: fieldName,
|
|
7625
7749
|
validate: validate,
|
|
7626
|
-
children: () =>
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
"
|
|
7631
|
-
|
|
7632
|
-
children:
|
|
7633
|
-
name: fieldName,
|
|
7634
|
-
fieldDefinition: fieldDefinition
|
|
7635
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7750
|
+
children: () => {
|
|
7751
|
+
var _context3, _context4;
|
|
7752
|
+
return jsxRuntime.jsx(DraggableWrapper, {
|
|
7753
|
+
draggableKey: _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, "-")).call(_context3, index),
|
|
7754
|
+
draggableId: _concatInstanceProperty__default["default"](_context4 = "".concat(fieldName, "-")).call(_context4, index),
|
|
7755
|
+
index: index,
|
|
7756
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
7636
7757
|
scale: "xs",
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7758
|
+
children: jsxRuntime.jsxs("div", {
|
|
7759
|
+
"aria-invalid": _Object$keys__default["default"](fieldErrors !== null && fieldErrors !== void 0 ? fieldErrors : {}).length > 0,
|
|
7760
|
+
"aria-errormessage": "".concat(fieldName, "-error"),
|
|
7761
|
+
id: "".concat(fieldName, "-error"),
|
|
7762
|
+
children: [jsxRuntime.jsx(CustomFieldsLabel, {
|
|
7763
|
+
name: fieldName,
|
|
7764
|
+
fieldDefinition: fieldDefinition
|
|
7765
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7766
|
+
scale: "xs",
|
|
7767
|
+
alignItems: "stretch",
|
|
7768
|
+
children: [isNested(fieldDefinition) ? jsxRuntime.jsx(CustomNestedFieldInput, {
|
|
7769
|
+
name: fieldName,
|
|
7770
|
+
value: value,
|
|
7771
|
+
fieldDefinition: fieldDefinition,
|
|
7772
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7773
|
+
isReadOnly: props.isReadOnly,
|
|
7774
|
+
onBlur: handleBlur,
|
|
7775
|
+
setFieldValue: props.setFieldValue
|
|
7776
|
+
}) : jsxRuntime.jsx(CustomFieldInput, {
|
|
7777
|
+
name: fieldName,
|
|
7778
|
+
value: value,
|
|
7779
|
+
fieldDefinition: fieldDefinition,
|
|
7780
|
+
isDisabled: props.isDisabled || isDragAndDropMode,
|
|
7781
|
+
isReadOnly: props.isReadOnly,
|
|
7782
|
+
onBlur: handleBlur,
|
|
7783
|
+
setFieldValue: props.setFieldValue,
|
|
7784
|
+
hasError: hasError
|
|
7785
|
+
}), jsxRuntime.jsx(CustomFieldErrors, {
|
|
7786
|
+
isTouched: isTouched,
|
|
7787
|
+
errors: fieldErrors
|
|
7788
|
+
})]
|
|
7789
|
+
})]
|
|
7790
|
+
})
|
|
7791
|
+
})
|
|
7792
|
+
});
|
|
7793
|
+
}
|
|
7662
7794
|
}, _concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7663
7795
|
})
|
|
7664
7796
|
});
|
|
@@ -7689,6 +7821,8 @@ const CustomFields = props => {
|
|
|
7689
7821
|
};
|
|
7690
7822
|
CustomFields.displayName = 'CustomFields';
|
|
7691
7823
|
|
|
7824
|
+
CustomFields.DndProvider = DndProvider;
|
|
7825
|
+
|
|
7692
7826
|
var pickerMessages = reactIntl.defineMessages({
|
|
7693
7827
|
productSelectionsBasicSelectPlaceholder: {
|
|
7694
7828
|
id: 'ProductSelectionPicker.productSelectionsBasicSelectPlaceholder',
|
|
@@ -13399,6 +13533,7 @@ exports.truncate = truncate;
|
|
|
13399
13533
|
exports.unique = unique;
|
|
13400
13534
|
exports.uniqueObjects = uniqueObjects;
|
|
13401
13535
|
exports.useCachedCategoryOptions = useCachedCategoryOptions;
|
|
13536
|
+
exports.useCustomFieldsDnDContext = useDnDContext;
|
|
13402
13537
|
exports.useCustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits;
|
|
13403
13538
|
exports.useCustomersPlatformLimits = useCustomersPlatformLimits;
|
|
13404
13539
|
exports.useDebouncedPromiseCallback = useDebouncedPromiseCallback;
|