@commercetools-frontend/experimental-components 3.0.0 → 3.1.1
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.
|
@@ -68,6 +68,7 @@ var moment$1 = require('moment');
|
|
|
68
68
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
69
69
|
var classnames = require('classnames');
|
|
70
70
|
require('react-required-if');
|
|
71
|
+
var designSystem = require('@commercetools-uikit/design-system');
|
|
71
72
|
var _assertThisInitialized = require('@babel/runtime-corejs3/helpers/assertThisInitialized');
|
|
72
73
|
var Textarea = require('react-textarea-autosize');
|
|
73
74
|
var has = require('lodash.has');
|
|
@@ -91,7 +92,6 @@ var omitBy = require('lodash.omitby');
|
|
|
91
92
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
92
93
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
93
94
|
var react$1 = require('@emotion/react');
|
|
94
|
-
var designSystem = require('@commercetools-uikit/design-system');
|
|
95
95
|
var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
|
|
96
96
|
var reselect = require('reselect');
|
|
97
97
|
var _Map = require('@babel/runtime-corejs3/core-js-stable/map');
|
|
@@ -1708,8 +1708,8 @@ var getFractionDigit = function getFractionDigit(code) {
|
|
|
1708
1708
|
return getData(code, 'fractionDigit');
|
|
1709
1709
|
};
|
|
1710
1710
|
|
|
1711
|
-
function ownKeys$
|
|
1712
|
-
function _objectSpread$
|
|
1711
|
+
function ownKeys$1p(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1712
|
+
function _objectSpread$1p(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1p(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1p(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1713
1713
|
function formatMoneyRangeValue(value, intl) {
|
|
1714
1714
|
var _context;
|
|
1715
1715
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1719,7 +1719,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1719
1719
|
return '';
|
|
1720
1720
|
}
|
|
1721
1721
|
function formatMoneyValue(amount, currency, intl) {
|
|
1722
|
-
return formatMoney$1(_objectSpread$
|
|
1722
|
+
return formatMoney$1(_objectSpread$1p({
|
|
1723
1723
|
centAmount: amount,
|
|
1724
1724
|
fractionDigits: getFractionDigit(currency)
|
|
1725
1725
|
}, currency ? {
|
|
@@ -1736,7 +1736,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1738
1738
|
var _moneyValue$fractione;
|
|
1739
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1739
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1p({
|
|
1740
1740
|
style: 'currency',
|
|
1741
1741
|
currency: moneyValue.currencyCode,
|
|
1742
1742
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1991,8 +1991,8 @@ var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
|
|
|
1991
1991
|
return _concatInstanceProperty__default["default"](_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1992
1992
|
};
|
|
1993
1993
|
|
|
1994
|
-
function ownKeys$
|
|
1995
|
-
function _objectSpread$
|
|
1994
|
+
function ownKeys$1o(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1995
|
+
function _objectSpread$1o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1996
1996
|
var injectDataTablePaginationState = function injectDataTablePaginationState(initialValues) {
|
|
1997
1997
|
return function (Component) {
|
|
1998
1998
|
var WithDataTablePaginationState = function WithDataTablePaginationState(props) {
|
|
@@ -2007,7 +2007,7 @@ var injectDataTablePaginationState = function injectDataTablePaginationState(ini
|
|
|
2007
2007
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
2008
2008
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
2009
2009
|
});
|
|
2010
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2010
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
2011
2011
|
dataTablePaginationState: {
|
|
2012
2012
|
page: page,
|
|
2013
2013
|
perPage: perPage,
|
|
@@ -2020,8 +2020,8 @@ var injectDataTablePaginationState = function injectDataTablePaginationState(ini
|
|
|
2020
2020
|
};
|
|
2021
2021
|
};
|
|
2022
2022
|
|
|
2023
|
-
function ownKeys$
|
|
2024
|
-
function _objectSpread$
|
|
2023
|
+
function ownKeys$1n(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2024
|
+
function _objectSpread$1n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2025
2025
|
var injectNotifications = function injectNotifications() {
|
|
2026
2026
|
var propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
2027
2027
|
return function (Component) {
|
|
@@ -2036,31 +2036,31 @@ var injectNotifications = function injectNotifications() {
|
|
|
2036
2036
|
onActionError: onActionError,
|
|
2037
2037
|
hideAllPageNotifications: hideAllPageNotifications
|
|
2038
2038
|
};
|
|
2039
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2039
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), _defineProperty({}, propName, notifications)));
|
|
2040
2040
|
};
|
|
2041
2041
|
WrappedComponent.displayName = "withNotifications(".concat(getDisplayName(Component));
|
|
2042
2042
|
return WrappedComponent;
|
|
2043
2043
|
};
|
|
2044
2044
|
};
|
|
2045
2045
|
|
|
2046
|
-
function ownKeys$
|
|
2047
|
-
function _objectSpread$
|
|
2046
|
+
function ownKeys$1m(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2047
|
+
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2048
2048
|
function isPropsMapper(mapProps) {
|
|
2049
2049
|
return typeof mapProps === 'function';
|
|
2050
2050
|
}
|
|
2051
2051
|
var withProps = function withProps(mapProps) {
|
|
2052
2052
|
return function (Component) {
|
|
2053
2053
|
var EnhancedWithProps = function EnhancedWithProps(ownProps) {
|
|
2054
|
-
var enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
2055
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2054
|
+
var enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
2055
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
2056
2056
|
};
|
|
2057
2057
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
2058
2058
|
return EnhancedWithProps;
|
|
2059
2059
|
};
|
|
2060
2060
|
};
|
|
2061
2061
|
|
|
2062
|
-
function ownKeys$
|
|
2063
|
-
function _objectSpread$
|
|
2062
|
+
function ownKeys$1l(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2063
|
+
function _objectSpread$1l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2064
2064
|
var useRedirectEffect = function useRedirectEffect(_ref) {
|
|
2065
2065
|
var goTo = _ref.goTo;
|
|
2066
2066
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -2083,58 +2083,58 @@ var defaultOptions$5 = {
|
|
|
2083
2083
|
};
|
|
2084
2084
|
var withRedirectTo = function withRedirectTo(options) {
|
|
2085
2085
|
return function (Component) {
|
|
2086
|
-
var mergedOptions = _objectSpread$
|
|
2086
|
+
var mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
2087
2087
|
var WithRedirectTo = function WithRedirectTo(props) {
|
|
2088
2088
|
if (!mergedOptions.skip(props)) {
|
|
2089
2089
|
return jsxRuntime.jsx(RedirectTo, {
|
|
2090
2090
|
goTo: options.selectGoTo(props)
|
|
2091
2091
|
});
|
|
2092
2092
|
}
|
|
2093
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2093
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l({}, props));
|
|
2094
2094
|
};
|
|
2095
2095
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2096
2096
|
return WithRedirectTo;
|
|
2097
2097
|
};
|
|
2098
2098
|
};
|
|
2099
2099
|
|
|
2100
|
-
function ownKeys$
|
|
2101
|
-
function _objectSpread$
|
|
2100
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2101
|
+
function _objectSpread$1k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2102
2102
|
var defaultOptions$4 = {
|
|
2103
2103
|
propName: 'modalState',
|
|
2104
2104
|
isInitiallyOpen: false
|
|
2105
2105
|
};
|
|
2106
2106
|
var injectModalState$1 = function injectModalState(options) {
|
|
2107
2107
|
return function (Component) {
|
|
2108
|
-
var mergedOptions = _objectSpread$
|
|
2108
|
+
var mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
2109
2109
|
var WithModalState = function WithModalState(props) {
|
|
2110
2110
|
var modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
2111
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2111
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), _defineProperty({}, mergedOptions.propName, modalState)));
|
|
2112
2112
|
};
|
|
2113
2113
|
WithModalState.displayName = wrapDisplayName(WithModalState, 'WithModalState');
|
|
2114
2114
|
return WithModalState;
|
|
2115
2115
|
};
|
|
2116
2116
|
};
|
|
2117
2117
|
|
|
2118
|
-
function ownKeys$
|
|
2119
|
-
function _objectSpread$
|
|
2118
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2119
|
+
function _objectSpread$1j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2120
2120
|
var defaultOptions$3 = {
|
|
2121
2121
|
propName: 'toggleState',
|
|
2122
2122
|
isInitiallyOpen: false
|
|
2123
2123
|
};
|
|
2124
2124
|
var injectModalState = function injectModalState(options) {
|
|
2125
2125
|
return function (Component) {
|
|
2126
|
-
var mergedOptions = _objectSpread$
|
|
2126
|
+
var mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
2127
2127
|
var WithToggleState = function WithToggleState(props) {
|
|
2128
2128
|
var toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
2129
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
2129
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), _defineProperty({}, mergedOptions.propName, toggleState)));
|
|
2130
2130
|
};
|
|
2131
2131
|
WithToggleState.displayName = wrapDisplayName(WithToggleState, 'WithToggleState');
|
|
2132
2132
|
return WithToggleState;
|
|
2133
2133
|
};
|
|
2134
2134
|
};
|
|
2135
2135
|
|
|
2136
|
-
function ownKeys$
|
|
2137
|
-
function _objectSpread$
|
|
2136
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2137
|
+
function _objectSpread$1i(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1i(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2138
2138
|
var defaultOptions$2 = {
|
|
2139
2139
|
storageType: 'local',
|
|
2140
2140
|
segregateByUser: true
|
|
@@ -2158,7 +2158,7 @@ var isNil = function isNil(value) {
|
|
|
2158
2158
|
};
|
|
2159
2159
|
var useStorage = function useStorage(storageKey, initialStorageValue, options) {
|
|
2160
2160
|
var _context;
|
|
2161
|
-
var mergedOptions = _objectSpread$
|
|
2161
|
+
var mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
2162
2162
|
var userId = applicationShellConnectors.useApplicationContext(function (context) {
|
|
2163
2163
|
var _context$user;
|
|
2164
2164
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2206,8 +2206,8 @@ var useStorage = function useStorage(storageKey, initialStorageValue, options) {
|
|
|
2206
2206
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2207
2207
|
};
|
|
2208
2208
|
|
|
2209
|
-
function ownKeys$
|
|
2210
|
-
function _objectSpread$
|
|
2209
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2210
|
+
function _objectSpread$1h(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2211
2211
|
var defaultOptions$1 = {
|
|
2212
2212
|
propName: 'storage',
|
|
2213
2213
|
storageKey: '',
|
|
@@ -2221,7 +2221,7 @@ var injectStorage = function injectStorage(options) {
|
|
|
2221
2221
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2222
2222
|
* argument position does not allow passing specification of option(s).
|
|
2223
2223
|
*/
|
|
2224
|
-
var mergedOptions = _objectSpread$
|
|
2224
|
+
var mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
2225
2225
|
var WithStorage = function WithStorage(props) {
|
|
2226
2226
|
var _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2227
2227
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2233,7 +2233,7 @@ var injectStorage = function injectStorage(options) {
|
|
|
2233
2233
|
writeToStorage: writeToStorage,
|
|
2234
2234
|
readFromStorage: readFromStorage
|
|
2235
2235
|
});
|
|
2236
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
2236
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
2237
2237
|
};
|
|
2238
2238
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2239
2239
|
return WithStorage;
|
|
@@ -2284,8 +2284,8 @@ var usePrevious = function usePrevious(value) {
|
|
|
2284
2284
|
return ref.current;
|
|
2285
2285
|
};
|
|
2286
2286
|
|
|
2287
|
-
function ownKeys$
|
|
2288
|
-
function _objectSpread$
|
|
2287
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2288
|
+
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1g(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2289
2289
|
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: "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: 1074, 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 nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2290
2290
|
var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdatedDanglingProductSelections(storesQueryResult) {
|
|
2291
2291
|
var _storesQueryResult$re;
|
|
@@ -2296,7 +2296,7 @@ var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdate
|
|
|
2296
2296
|
offset: storesQueryResult.offset,
|
|
2297
2297
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty__default["default"](_storesQueryResult$re).call(_storesQueryResult$re, function (store) {
|
|
2298
2298
|
var _store$productSelecti;
|
|
2299
|
-
return _objectSpread$
|
|
2299
|
+
return _objectSpread$1g(_objectSpread$1g({}, store), {}, {
|
|
2300
2300
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty__default["default"](_store$productSelecti).call(_store$productSelecti, function (productSelectionRef) {
|
|
2301
2301
|
return Boolean(productSelectionRef.productSelection);
|
|
2302
2302
|
})
|
|
@@ -2306,7 +2306,7 @@ var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdate
|
|
|
2306
2306
|
};
|
|
2307
2307
|
var createQueryVariables$8 = function createQueryVariables(ownProps) {
|
|
2308
2308
|
var _context;
|
|
2309
|
-
return _objectSpread$
|
|
2309
|
+
return _objectSpread$1g(_objectSpread$1g({
|
|
2310
2310
|
limit: ownProps.limit,
|
|
2311
2311
|
offset: ownProps.offset,
|
|
2312
2312
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2474,8 +2474,8 @@ function useDidFormValidationFail() {
|
|
|
2474
2474
|
return Boolean(didFormValidationFail);
|
|
2475
2475
|
}
|
|
2476
2476
|
|
|
2477
|
-
function ownKeys$
|
|
2478
|
-
function _objectSpread$
|
|
2477
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2478
|
+
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2479
2479
|
var TEN_MINUTES_IN_MS = 600000;
|
|
2480
2480
|
var defaultOptions = {
|
|
2481
2481
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2503,7 +2503,7 @@ var useHasReminderExpired = function useHasReminderExpired(readReminderInterval)
|
|
|
2503
2503
|
};
|
|
2504
2504
|
var usePersistedReminder = function usePersistedReminder() {
|
|
2505
2505
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2506
|
-
var mergedOptions = _objectSpread$
|
|
2506
|
+
var mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions), options);
|
|
2507
2507
|
var _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2508
2508
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2509
2509
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2571,8 +2571,8 @@ var messages$H = reactIntl.defineMessages({
|
|
|
2571
2571
|
}
|
|
2572
2572
|
});
|
|
2573
2573
|
|
|
2574
|
-
function ownKeys$
|
|
2575
|
-
function _objectSpread$
|
|
2574
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2575
|
+
function _objectSpread$1e(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2576
2576
|
var LinkToProfile = function LinkToProfile(props) {
|
|
2577
2577
|
var _useTrackingShared = useTrackingShared(),
|
|
2578
2578
|
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
@@ -2600,7 +2600,7 @@ var NotificationText = function NotificationText() {
|
|
|
2600
2600
|
isBold: true,
|
|
2601
2601
|
intlMessage: messages$H.profileUpdated
|
|
2602
2602
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2603
|
-
intlMessage: _objectSpread$
|
|
2603
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$H.addMoreInformation), {}, {
|
|
2604
2604
|
values: {
|
|
2605
2605
|
newline: getNewLine
|
|
2606
2606
|
}
|
|
@@ -2609,7 +2609,7 @@ var NotificationText = function NotificationText() {
|
|
|
2609
2609
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
2610
2610
|
scale: "xs",
|
|
2611
2611
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2612
|
-
intlMessage: _objectSpread$
|
|
2612
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$H.informationAndProfileLink), {}, {
|
|
2613
2613
|
values: {
|
|
2614
2614
|
newline: getNewLine,
|
|
2615
2615
|
link: getLinkToProfile
|
|
@@ -2829,8 +2829,8 @@ var useDebouncedPromiseCallback = function useDebouncedPromiseCallback(promiseCa
|
|
|
2829
2829
|
);
|
|
2830
2830
|
};
|
|
2831
2831
|
|
|
2832
|
-
function ownKeys$
|
|
2833
|
-
function _objectSpread$
|
|
2832
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2833
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2834
2834
|
var prepareMutableColumnProps = function prepareMutableColumnProps(columnConfig, mutableColumnProps) {
|
|
2835
2835
|
var updatedColumnProps = {};
|
|
2836
2836
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, function (columnProp) {
|
|
@@ -2856,14 +2856,14 @@ var retrieveColumnsWithCachedConfiguration = function retrieveColumnsWithCachedC
|
|
|
2856
2856
|
var initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, function (initialConfig) {
|
|
2857
2857
|
return initialConfig.key === cachedConfig.key;
|
|
2858
2858
|
});
|
|
2859
|
-
return _objectSpread$
|
|
2859
|
+
return _objectSpread$1d(_objectSpread$1d({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2860
2860
|
});
|
|
2861
2861
|
};
|
|
2862
2862
|
var handleCacheUpdate = function handleCacheUpdate(_ref2) {
|
|
2863
2863
|
var update = _ref2.update,
|
|
2864
2864
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2865
2865
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2866
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2866
|
+
return updateCachedTableConfiguration(_objectSpread$1d(_objectSpread$1d({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2867
2867
|
};
|
|
2868
2868
|
|
|
2869
2869
|
// Signature:
|
|
@@ -2894,7 +2894,7 @@ var usePersistedTableConfiguration = function usePersistedTableConfiguration(pro
|
|
|
2894
2894
|
var visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, function (columnConfig) {
|
|
2895
2895
|
return columnConfig.key === visibleColumnKey;
|
|
2896
2896
|
});
|
|
2897
|
-
return _objectSpread$
|
|
2897
|
+
return _objectSpread$1d({
|
|
2898
2898
|
key: visibleColumnKey
|
|
2899
2899
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2900
2900
|
}),
|
|
@@ -2973,15 +2973,15 @@ var handlers$6 = {
|
|
|
2973
2973
|
}
|
|
2974
2974
|
};
|
|
2975
2975
|
|
|
2976
|
-
function ownKeys$
|
|
2977
|
-
function _objectSpread$
|
|
2976
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2977
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2978
2978
|
|
|
2979
2979
|
// eslint-disable-next-line import/prefer-default-export
|
|
2980
2980
|
var convertProductSelectionsFromGraphQl = function convertProductSelectionsFromGraphQl(productSelections) {
|
|
2981
2981
|
var _context;
|
|
2982
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2982
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1c(_objectSpread$1c({}, productSelections), {}, {
|
|
2983
2983
|
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, function (productSelection) {
|
|
2984
|
-
return _objectSpread$
|
|
2984
|
+
return _objectSpread$1c({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2985
2985
|
from: 'nameAllLocales',
|
|
2986
2986
|
to: 'name'
|
|
2987
2987
|
}]));
|
|
@@ -3191,8 +3191,11 @@ var trackingEvents$4 = {
|
|
|
3191
3191
|
}
|
|
3192
3192
|
};
|
|
3193
3193
|
|
|
3194
|
-
|
|
3195
|
-
|
|
3194
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3195
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1b(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3196
|
+
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 } } } };
|
|
3197
|
+
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 } } } };
|
|
3198
|
+
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 } } } };
|
|
3196
3199
|
var getTrackingEvent$4 = function getTrackingEvent(inputValue, selectedValue) {
|
|
3197
3200
|
var id = selectedValue.value,
|
|
3198
3201
|
key = selectedValue.key,
|
|
@@ -3211,7 +3214,8 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3211
3214
|
value = _ref.value,
|
|
3212
3215
|
hasError = _ref.hasError,
|
|
3213
3216
|
onError = _ref.onError,
|
|
3214
|
-
placeholder = _ref.placeholder
|
|
3217
|
+
placeholder = _ref.placeholder,
|
|
3218
|
+
role = _ref.role;
|
|
3215
3219
|
var formatLocalizedFieldToString = useFormatLocalizedFieldToString();
|
|
3216
3220
|
var _useIntl = reactIntl.useIntl(),
|
|
3217
3221
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -3219,10 +3223,12 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3219
3223
|
return applicationContext.dataLocale;
|
|
3220
3224
|
});
|
|
3221
3225
|
var variables = React.useMemo(function () {
|
|
3222
|
-
return {
|
|
3226
|
+
return _objectSpread$1b({
|
|
3223
3227
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3224
|
-
}
|
|
3225
|
-
|
|
3228
|
+
}, role && {
|
|
3229
|
+
where: "roles contains any (\"".concat(role, "\")")
|
|
3230
|
+
});
|
|
3231
|
+
}, [dataLocale, role]);
|
|
3226
3232
|
var _useState = React.useState(),
|
|
3227
3233
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3228
3234
|
loadingError = _useState2[0],
|
|
@@ -3250,10 +3256,13 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3250
3256
|
var currentOption = useCurrentOption({
|
|
3251
3257
|
query: GetChannelQuery,
|
|
3252
3258
|
id: value,
|
|
3253
|
-
|
|
3259
|
+
queryDataToItem: function queryDataToItem(_ref2) {
|
|
3254
3260
|
var channel = _ref2.channel;
|
|
3255
|
-
return
|
|
3256
|
-
}
|
|
3261
|
+
return channel;
|
|
3262
|
+
},
|
|
3263
|
+
itemToOption: convertChannelToOption,
|
|
3264
|
+
typename: 'Channel',
|
|
3265
|
+
fragment: PickerInputChannel
|
|
3257
3266
|
});
|
|
3258
3267
|
var handleLoadOptions = React.useCallback(function (inputValue) {
|
|
3259
3268
|
return loadOptions(inputValue).then(function (_ref3) {
|
|
@@ -3286,7 +3295,7 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3286
3295
|
var tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
3287
3296
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
3288
3297
|
max: "scale",
|
|
3289
|
-
children:
|
|
3298
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
3290
3299
|
scale: "xs",
|
|
3291
3300
|
children: [jsxRuntime.jsx(CustomFieldTooltip, {
|
|
3292
3301
|
title: tooltipTitle,
|
|
@@ -3298,7 +3307,7 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3298
3307
|
defaultOptions: true,
|
|
3299
3308
|
showOptionGroupDivider: true,
|
|
3300
3309
|
isClearable: isClearable,
|
|
3301
|
-
isReadOnly: isReadOnly,
|
|
3310
|
+
isReadOnly: isReadOnly || currentOption.loading,
|
|
3302
3311
|
isDisabled: isDisabled,
|
|
3303
3312
|
components: {
|
|
3304
3313
|
Option: Option$2
|
|
@@ -3700,7 +3709,7 @@ var SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3700
3709
|
onMouseOver: this.props.handleMouseOver,
|
|
3701
3710
|
onMouseOut: this.props.handleMouseOut,
|
|
3702
3711
|
children: jsxRuntime.jsx(uiKit.SearchIcon, {
|
|
3703
|
-
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' : this.props.enableDisabledStyle ? 'neutral60' : 'solid',
|
|
3712
|
+
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' : this.props.themedValue(this.props.enableDisabledStyle ? 'neutral60' : 'solid', 'neutral60'),
|
|
3704
3713
|
size: "big"
|
|
3705
3714
|
})
|
|
3706
3715
|
})]
|
|
@@ -3732,7 +3741,7 @@ SearchInput.defaultProps = {
|
|
|
3732
3741
|
return null;
|
|
3733
3742
|
}
|
|
3734
3743
|
};
|
|
3735
|
-
var SearchInput$1 = flowRight__default["default"](keepDisplayName(SearchInput), withMouseOverState, reactIntl.injectIntl)(SearchInput);
|
|
3744
|
+
var SearchInput$1 = flowRight__default["default"](keepDisplayName(SearchInput), withMouseOverState, reactIntl.injectIntl, designSystem.withThemeContext)(SearchInput);
|
|
3736
3745
|
|
|
3737
3746
|
var FetchIndicesExist$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchIndicesExist" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "indicesExist" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "products" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchableIndexExists" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "newInProgress" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 191, source: { body: "query FetchIndicesExist {\n indicesExist {\n products {\n searchableIndexExists\n newInProgress\n }\n productTypes {\n searchableIndexExists\n newInProgress\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3738
3747
|
var useExecuteGraphQLRequest = function useExecuteGraphQLRequest() {
|
|
@@ -4028,22 +4037,44 @@ var useLoadOptions = function useLoadOptions(_ref) {
|
|
|
4028
4037
|
};
|
|
4029
4038
|
|
|
4030
4039
|
function useCurrentOption(_ref) {
|
|
4040
|
+
var _context;
|
|
4031
4041
|
var id = _ref.id,
|
|
4042
|
+
typename = _ref.typename,
|
|
4032
4043
|
query = _ref.query,
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4044
|
+
fragment = _ref.fragment,
|
|
4045
|
+
queryDataToItem = _ref.queryDataToItem,
|
|
4046
|
+
itemToOption = _ref.itemToOption;
|
|
4047
|
+
var apolloClient = client.useApolloClient();
|
|
4048
|
+
|
|
4049
|
+
// load from cache when possible to speed up initial render
|
|
4050
|
+
var canReadFromCache = id && typename && fragment;
|
|
4051
|
+
var cacheItem = canReadFromCache ? apolloClient.readFragment({
|
|
4052
|
+
id: _concatInstanceProperty__default["default"](_context = "".concat(typename, ":")).call(_context, id),
|
|
4053
|
+
fragment: fragment
|
|
4054
|
+
}) : undefined;
|
|
4055
|
+
|
|
4056
|
+
// load with the query as a fallback
|
|
4057
|
+
var _useQuery = client.useQuery(query, {
|
|
4058
|
+
context: {
|
|
4059
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
4060
|
+
},
|
|
4061
|
+
variables: {
|
|
4062
|
+
id: id
|
|
4063
|
+
},
|
|
4064
|
+
skip: !id || cacheItem
|
|
4065
|
+
}),
|
|
4066
|
+
queryLoading = _useQuery.loading,
|
|
4067
|
+
queryData = _useQuery.data,
|
|
4068
|
+
queryError = _useQuery.error;
|
|
4069
|
+
var queryItem = queryData && queryDataToItem(queryData);
|
|
4070
|
+
var item = queryItem !== null && queryItem !== void 0 ? queryItem : cacheItem;
|
|
4071
|
+
var loading = item ? false : queryLoading;
|
|
4072
|
+
var error = item ? undefined : queryError;
|
|
4073
|
+
var data = item && itemToOption(item);
|
|
4043
4074
|
return {
|
|
4044
|
-
loading:
|
|
4045
|
-
data:
|
|
4046
|
-
error:
|
|
4075
|
+
loading: loading,
|
|
4076
|
+
data: data,
|
|
4077
|
+
error: error
|
|
4047
4078
|
};
|
|
4048
4079
|
}
|
|
4049
4080
|
|
|
@@ -4122,10 +4153,11 @@ var ProductTypePickerInput = function ProductTypePickerInput(_ref) {
|
|
|
4122
4153
|
var currentOption = useCurrentOption({
|
|
4123
4154
|
query: GetProductTypeQuery,
|
|
4124
4155
|
id: value,
|
|
4125
|
-
|
|
4156
|
+
queryDataToItem: function queryDataToItem(_ref2) {
|
|
4126
4157
|
var productType = _ref2.productType;
|
|
4127
|
-
return
|
|
4128
|
-
}
|
|
4158
|
+
return productType;
|
|
4159
|
+
},
|
|
4160
|
+
itemToOption: convertProductTypeToOption
|
|
4129
4161
|
});
|
|
4130
4162
|
var handleLoadOptions = React.useCallback(function (inputValue) {
|
|
4131
4163
|
return loadProductTypes(inputValue).then(function (_ref3) {
|
|
@@ -4281,10 +4313,11 @@ var StatePickerInput = function StatePickerInput(_ref) {
|
|
|
4281
4313
|
var currentOption = useCurrentOption({
|
|
4282
4314
|
query: GetStateQuery,
|
|
4283
4315
|
id: value,
|
|
4284
|
-
|
|
4316
|
+
queryDataToItem: function queryDataToItem(_ref2) {
|
|
4285
4317
|
var state = _ref2.state;
|
|
4286
|
-
return
|
|
4287
|
-
}
|
|
4318
|
+
return state;
|
|
4319
|
+
},
|
|
4320
|
+
itemToOption: convertStateToOption
|
|
4288
4321
|
});
|
|
4289
4322
|
var handleLoadOptions = React.useCallback(function (inputValue) {
|
|
4290
4323
|
return loadOptions(inputValue).then(function (_ref3) {
|
|
@@ -6647,10 +6680,11 @@ var ProductPickerInput = function ProductPickerInput(_ref) {
|
|
|
6647
6680
|
var currentOption = useCurrentOption({
|
|
6648
6681
|
query: GetProductQuery,
|
|
6649
6682
|
id: value,
|
|
6650
|
-
|
|
6683
|
+
queryDataToItem: function queryDataToItem(_ref2) {
|
|
6651
6684
|
var product = _ref2.product;
|
|
6652
|
-
return
|
|
6653
|
-
}
|
|
6685
|
+
return product;
|
|
6686
|
+
},
|
|
6687
|
+
itemToOption: convertProductToOption
|
|
6654
6688
|
});
|
|
6655
6689
|
var handleLoadOptions = React.useCallback(function (inputValue) {
|
|
6656
6690
|
return loadOptions(inputValue).then(function (_ref3) {
|
|
@@ -7185,7 +7219,7 @@ function CustomInputSet(props) {
|
|
|
7185
7219
|
// type is selected.
|
|
7186
7220
|
var type = getType(props.fieldDefinition);
|
|
7187
7221
|
var typeName = type.name.toLowerCase();
|
|
7188
|
-
var areButtonsTopAligned = _includesInstanceProperty__default["default"](_context5 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context5, typeName);
|
|
7222
|
+
var areButtonsTopAligned = _includesInstanceProperty__default["default"](_context5 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context5, typeName);
|
|
7189
7223
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7190
7224
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
7191
7225
|
children: jsxRuntime.jsx("label", {
|
|
@@ -8713,8 +8747,9 @@ var trackingEvents = {
|
|
|
8713
8747
|
}
|
|
8714
8748
|
};
|
|
8715
8749
|
|
|
8716
|
-
var GetCustomerGroupsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupsQuery" }, 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: "customerGroups" }, 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: "
|
|
8717
|
-
var GetCustomerGroupQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupQuery" }, 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: "customerGroup" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }]
|
|
8750
|
+
var GetCustomerGroupsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupsQuery" }, 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: "customerGroups" }, 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: "PickerInputCustomerGroups" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, 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: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8751
|
+
var GetCustomerGroupQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupQuery" }, 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: "customerGroup" }, 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: "PickerInputCustomerGroups" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, 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: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8752
|
+
var PickerInputCustomerGroups = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, 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: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8718
8753
|
var getTrackingEvent = function getTrackingEvent(inputValue, selectedValue) {
|
|
8719
8754
|
var id = selectedValue.value,
|
|
8720
8755
|
key = selectedValue.key,
|
|
@@ -8774,10 +8809,13 @@ var CustomerGroupPickerInput = function CustomerGroupPickerInput(_ref) {
|
|
|
8774
8809
|
var currentOption = useCurrentOption({
|
|
8775
8810
|
query: GetCustomerGroupQuery,
|
|
8776
8811
|
id: value,
|
|
8777
|
-
|
|
8812
|
+
queryDataToItem: function queryDataToItem(_ref2) {
|
|
8778
8813
|
var customerGroup = _ref2.customerGroup;
|
|
8779
|
-
return
|
|
8780
|
-
}
|
|
8814
|
+
return customerGroup;
|
|
8815
|
+
},
|
|
8816
|
+
itemToOption: convertCustomerGroupToOption,
|
|
8817
|
+
typename: 'CustomerGroup',
|
|
8818
|
+
fragment: PickerInputCustomerGroups
|
|
8781
8819
|
});
|
|
8782
8820
|
var handleLoadOptions = React.useCallback(function (inputValue) {
|
|
8783
8821
|
return loadOptions(inputValue).then(function (_ref3) {
|
|
@@ -8810,7 +8848,7 @@ var CustomerGroupPickerInput = function CustomerGroupPickerInput(_ref) {
|
|
|
8810
8848
|
var tooltipTitle = (_currentOption$data$l = currentOption === null || currentOption === void 0 ? void 0 : (_currentOption$data = currentOption.data) === null || _currentOption$data === void 0 ? void 0 : _currentOption$data.label) !== null && _currentOption$data$l !== void 0 ? _currentOption$data$l : '';
|
|
8811
8849
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
8812
8850
|
max: "scale",
|
|
8813
|
-
children:
|
|
8851
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
8814
8852
|
scale: "xs",
|
|
8815
8853
|
children: [jsxRuntime.jsx(CustomFieldTooltip, {
|
|
8816
8854
|
title: tooltipTitle,
|
|
@@ -8822,7 +8860,7 @@ var CustomerGroupPickerInput = function CustomerGroupPickerInput(_ref) {
|
|
|
8822
8860
|
defaultOptions: true,
|
|
8823
8861
|
showOptionGroupDivider: true,
|
|
8824
8862
|
isClearable: isClearable,
|
|
8825
|
-
isReadOnly: isReadOnly,
|
|
8863
|
+
isReadOnly: isReadOnly || currentOption.loading,
|
|
8826
8864
|
isDisabled: isDisabled,
|
|
8827
8865
|
components: {
|
|
8828
8866
|
Option: Option$2
|
|
@@ -12793,7 +12831,7 @@ var StoreSelectField = function StoreSelectField(props) {
|
|
|
12793
12831
|
hintIcon: props.hintIcon,
|
|
12794
12832
|
htmlFor: props.id,
|
|
12795
12833
|
hasRequiredIndicator: props.isRequired,
|
|
12796
|
-
isBold:
|
|
12834
|
+
isBold: true
|
|
12797
12835
|
}), jsxRuntime.jsx(StoreSelectInput, _objectSpread$a(_objectSpread$a({
|
|
12798
12836
|
projectKey: props.projectKey,
|
|
12799
12837
|
id: props.id,
|
|
@@ -13266,7 +13304,6 @@ var MultiValueSelectorDropdown = function MultiValueSelectorDropdown(props) {
|
|
|
13266
13304
|
};
|
|
13267
13305
|
MultiValueSelectorDropdown.displayName = 'MultiValueSelectorDropdown';
|
|
13268
13306
|
var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
13269
|
-
var multiValueSearchInputRef = React.useRef(null);
|
|
13270
13307
|
var _useState = React.useState(''),
|
|
13271
13308
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13272
13309
|
value = _useState2[0],
|
|
@@ -13286,8 +13323,9 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13286
13323
|
var clearRunningTooltipTimer = function clearRunningTooltipTimer() {
|
|
13287
13324
|
if (tooltipTimeoutHandler) clearTimeout(tooltipTimeoutHandler);
|
|
13288
13325
|
};
|
|
13289
|
-
var handleInputChange = function handleInputChange(
|
|
13290
|
-
var
|
|
13326
|
+
var handleInputChange = function handleInputChange(event) {
|
|
13327
|
+
var _event$target$value = event.target.value,
|
|
13328
|
+
inputValue = _event$target$value === void 0 ? '' : _event$target$value;
|
|
13291
13329
|
setValue(inputValue);
|
|
13292
13330
|
var multiInput = _trimInstanceProperty__default["default"](inputValue).call(inputValue).split(' ');
|
|
13293
13331
|
setMultiValue(multiInput);
|
|
@@ -13308,7 +13346,8 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13308
13346
|
setValue('');
|
|
13309
13347
|
setMultiValue([]);
|
|
13310
13348
|
};
|
|
13311
|
-
var handleSubmit = function handleSubmit(
|
|
13349
|
+
var handleSubmit = function handleSubmit() {
|
|
13350
|
+
var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
13312
13351
|
clearInputValues();
|
|
13313
13352
|
clearRunningTooltipTimer();
|
|
13314
13353
|
setIsTooltipVisible(false);
|
|
@@ -13341,16 +13380,13 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13341
13380
|
className: styles$1.container,
|
|
13342
13381
|
children: [jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
13343
13382
|
size: "s",
|
|
13344
|
-
children: jsxRuntime.jsx(
|
|
13345
|
-
|
|
13346
|
-
disabled: props.isDisabled,
|
|
13347
|
-
initialValue: value,
|
|
13348
|
-
throttleMS: 0,
|
|
13383
|
+
children: jsxRuntime.jsx(uiKit.SearchTextInput, {
|
|
13384
|
+
isDisabled: props.isDisabled,
|
|
13349
13385
|
placeholder: props.placeholder,
|
|
13350
|
-
onSubmit: handleSubmit,
|
|
13351
13386
|
onChange: handleInputChange,
|
|
13352
|
-
|
|
13353
|
-
|
|
13387
|
+
onReset: handleClearSearchField,
|
|
13388
|
+
onSubmit: handleSubmit,
|
|
13389
|
+
value: value
|
|
13354
13390
|
})
|
|
13355
13391
|
}), jsxRuntime.jsx(MultiValueSelectorDropdown, {
|
|
13356
13392
|
isOpen: isTooltipVisible,
|