@commercetools-frontend/experimental-components 3.0.0 → 3.1.0
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.
|
@@ -41,7 +41,7 @@ import { NO_VALUE_FALLBACK, GRAPHQL_TARGETS, DOMAINS, MC_API_PROXY_TARGETS, SUPP
|
|
|
41
41
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
42
42
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
43
43
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
44
|
-
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput } from '@commercetools-frontend/ui-kit';
|
|
44
|
+
import { usePaginationState, useDataTableSortingState, useToggleState, Spacings, Text, Link, LoadingSpinner, Constraints, AsyncSelectInput, AccessibleHidden, SecondaryIconButton, CloseIcon, SearchIcon, Tooltip, MoneyInput, TextInput, MultilineTextInput, LocalizedTextInput, LocalizedMultilineTextInput, SelectInput, NumberInput, SearchSelectInput, DateInput, DateTimeInput, TimeInput, FlatButton, AngleUpIcon, AngleDownIcon, IconButton, BinFilledIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, FieldLabel, WarningIcon, InformationIcon, customProperties, SecondaryButton, RevertIcon, Grid, SubdirectoryArrowIcon, Tag, EditIcon, Card, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput, SearchTextInput } from '@commercetools-frontend/ui-kit';
|
|
45
45
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
46
46
|
import { useShowNotification, useShowApiErrorNotification, useOnActionError, useHideAllPageNotifications } from '@commercetools-frontend/actions-global';
|
|
47
47
|
import PropTypes from 'prop-types';
|
|
@@ -1623,8 +1623,8 @@ var getFractionDigit = function getFractionDigit(code) {
|
|
|
1623
1623
|
return getData(code, 'fractionDigit');
|
|
1624
1624
|
};
|
|
1625
1625
|
|
|
1626
|
-
function ownKeys$
|
|
1627
|
-
function _objectSpread$
|
|
1626
|
+
function ownKeys$1p(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1627
|
+
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(_context2 = ownKeys$1p(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1p(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1628
1628
|
function formatMoneyRangeValue(value, intl) {
|
|
1629
1629
|
var _context;
|
|
1630
1630
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1634,7 +1634,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1634
1634
|
return '';
|
|
1635
1635
|
}
|
|
1636
1636
|
function formatMoneyValue(amount, currency, intl) {
|
|
1637
|
-
return formatMoney$1(_objectSpread$
|
|
1637
|
+
return formatMoney$1(_objectSpread$1p({
|
|
1638
1638
|
centAmount: amount,
|
|
1639
1639
|
fractionDigits: getFractionDigit(currency)
|
|
1640
1640
|
}, currency ? {
|
|
@@ -1651,7 +1651,7 @@ function getFractionedAmount(moneyValue) {
|
|
|
1651
1651
|
}
|
|
1652
1652
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1653
1653
|
var _moneyValue$fractione;
|
|
1654
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1654
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1p({
|
|
1655
1655
|
style: 'currency',
|
|
1656
1656
|
currency: moneyValue.currencyCode,
|
|
1657
1657
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
@@ -1906,8 +1906,8 @@ var wrapDisplayName = function wrapDisplayName(BaseComponent, hocName) {
|
|
|
1906
1906
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1907
1907
|
};
|
|
1908
1908
|
|
|
1909
|
-
function ownKeys$
|
|
1910
|
-
function _objectSpread$
|
|
1909
|
+
function ownKeys$1o(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1910
|
+
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(_context = ownKeys$1o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1o(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1911
1911
|
var injectDataTablePaginationState = function injectDataTablePaginationState(initialValues) {
|
|
1912
1912
|
return function (Component) {
|
|
1913
1913
|
var WithDataTablePaginationState = function WithDataTablePaginationState(props) {
|
|
@@ -1922,7 +1922,7 @@ var injectDataTablePaginationState = function injectDataTablePaginationState(ini
|
|
|
1922
1922
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1923
1923
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1924
1924
|
});
|
|
1925
|
-
return jsx(Component, _objectSpread$
|
|
1925
|
+
return jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1926
1926
|
dataTablePaginationState: {
|
|
1927
1927
|
page: page,
|
|
1928
1928
|
perPage: perPage,
|
|
@@ -1935,8 +1935,8 @@ var injectDataTablePaginationState = function injectDataTablePaginationState(ini
|
|
|
1935
1935
|
};
|
|
1936
1936
|
};
|
|
1937
1937
|
|
|
1938
|
-
function ownKeys$
|
|
1939
|
-
function _objectSpread$
|
|
1938
|
+
function ownKeys$1n(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1939
|
+
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(_context = ownKeys$1n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1n(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1940
1940
|
var injectNotifications = function injectNotifications() {
|
|
1941
1941
|
var propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1942
1942
|
return function (Component) {
|
|
@@ -1951,31 +1951,31 @@ var injectNotifications = function injectNotifications() {
|
|
|
1951
1951
|
onActionError: onActionError,
|
|
1952
1952
|
hideAllPageNotifications: hideAllPageNotifications
|
|
1953
1953
|
};
|
|
1954
|
-
return jsx(Component, _objectSpread$
|
|
1954
|
+
return jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), _defineProperty({}, propName, notifications)));
|
|
1955
1955
|
};
|
|
1956
1956
|
WrappedComponent.displayName = "withNotifications(".concat(getDisplayName(Component));
|
|
1957
1957
|
return WrappedComponent;
|
|
1958
1958
|
};
|
|
1959
1959
|
};
|
|
1960
1960
|
|
|
1961
|
-
function ownKeys$
|
|
1962
|
-
function _objectSpread$
|
|
1961
|
+
function ownKeys$1m(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1962
|
+
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(_context = ownKeys$1m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1m(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1963
1963
|
function isPropsMapper(mapProps) {
|
|
1964
1964
|
return typeof mapProps === 'function';
|
|
1965
1965
|
}
|
|
1966
1966
|
var withProps = function withProps(mapProps) {
|
|
1967
1967
|
return function (Component) {
|
|
1968
1968
|
var EnhancedWithProps = function EnhancedWithProps(ownProps) {
|
|
1969
|
-
var enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1970
|
-
return jsx(Component, _objectSpread$
|
|
1969
|
+
var enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
1970
|
+
return jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
1971
1971
|
};
|
|
1972
1972
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1973
1973
|
return EnhancedWithProps;
|
|
1974
1974
|
};
|
|
1975
1975
|
};
|
|
1976
1976
|
|
|
1977
|
-
function ownKeys$
|
|
1978
|
-
function _objectSpread$
|
|
1977
|
+
function ownKeys$1l(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1978
|
+
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(_context = ownKeys$1l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1l(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1979
1979
|
var useRedirectEffect = function useRedirectEffect(_ref) {
|
|
1980
1980
|
var goTo = _ref.goTo;
|
|
1981
1981
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1998,58 +1998,58 @@ var defaultOptions$5 = {
|
|
|
1998
1998
|
};
|
|
1999
1999
|
var withRedirectTo = function withRedirectTo(options) {
|
|
2000
2000
|
return function (Component) {
|
|
2001
|
-
var mergedOptions = _objectSpread$
|
|
2001
|
+
var mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
2002
2002
|
var WithRedirectTo = function WithRedirectTo(props) {
|
|
2003
2003
|
if (!mergedOptions.skip(props)) {
|
|
2004
2004
|
return jsx(RedirectTo, {
|
|
2005
2005
|
goTo: options.selectGoTo(props)
|
|
2006
2006
|
});
|
|
2007
2007
|
}
|
|
2008
|
-
return jsx(Component, _objectSpread$
|
|
2008
|
+
return jsx(Component, _objectSpread$1l({}, props));
|
|
2009
2009
|
};
|
|
2010
2010
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
2011
2011
|
return WithRedirectTo;
|
|
2012
2012
|
};
|
|
2013
2013
|
};
|
|
2014
2014
|
|
|
2015
|
-
function ownKeys$
|
|
2016
|
-
function _objectSpread$
|
|
2015
|
+
function ownKeys$1k(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2016
|
+
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(_context = ownKeys$1k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2017
2017
|
var defaultOptions$4 = {
|
|
2018
2018
|
propName: 'modalState',
|
|
2019
2019
|
isInitiallyOpen: false
|
|
2020
2020
|
};
|
|
2021
2021
|
var injectModalState$1 = function injectModalState(options) {
|
|
2022
2022
|
return function (Component) {
|
|
2023
|
-
var mergedOptions = _objectSpread$
|
|
2023
|
+
var mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
2024
2024
|
var WithModalState = function WithModalState(props) {
|
|
2025
2025
|
var modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
2026
|
-
return jsx(Component, _objectSpread$
|
|
2026
|
+
return jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), _defineProperty({}, mergedOptions.propName, modalState)));
|
|
2027
2027
|
};
|
|
2028
2028
|
WithModalState.displayName = wrapDisplayName(WithModalState, 'WithModalState');
|
|
2029
2029
|
return WithModalState;
|
|
2030
2030
|
};
|
|
2031
2031
|
};
|
|
2032
2032
|
|
|
2033
|
-
function ownKeys$
|
|
2034
|
-
function _objectSpread$
|
|
2033
|
+
function ownKeys$1j(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2034
|
+
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(_context = ownKeys$1j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1j(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2035
2035
|
var defaultOptions$3 = {
|
|
2036
2036
|
propName: 'toggleState',
|
|
2037
2037
|
isInitiallyOpen: false
|
|
2038
2038
|
};
|
|
2039
2039
|
var injectModalState = function injectModalState(options) {
|
|
2040
2040
|
return function (Component) {
|
|
2041
|
-
var mergedOptions = _objectSpread$
|
|
2041
|
+
var mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
2042
2042
|
var WithToggleState = function WithToggleState(props) {
|
|
2043
2043
|
var toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2044
|
-
return jsx(Component, _objectSpread$
|
|
2044
|
+
return jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), _defineProperty({}, mergedOptions.propName, toggleState)));
|
|
2045
2045
|
};
|
|
2046
2046
|
WithToggleState.displayName = wrapDisplayName(WithToggleState, 'WithToggleState');
|
|
2047
2047
|
return WithToggleState;
|
|
2048
2048
|
};
|
|
2049
2049
|
};
|
|
2050
2050
|
|
|
2051
|
-
function ownKeys$
|
|
2052
|
-
function _objectSpread$
|
|
2051
|
+
function ownKeys$1i(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2052
|
+
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(_context2 = ownKeys$1i(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1i(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2053
2053
|
var defaultOptions$2 = {
|
|
2054
2054
|
storageType: 'local',
|
|
2055
2055
|
segregateByUser: true
|
|
@@ -2073,7 +2073,7 @@ var isNil = function isNil(value) {
|
|
|
2073
2073
|
};
|
|
2074
2074
|
var useStorage = function useStorage(storageKey, initialStorageValue, options) {
|
|
2075
2075
|
var _context;
|
|
2076
|
-
var mergedOptions = _objectSpread$
|
|
2076
|
+
var mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
2077
2077
|
var userId = useApplicationContext(function (context) {
|
|
2078
2078
|
var _context$user;
|
|
2079
2079
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2121,8 +2121,8 @@ var useStorage = function useStorage(storageKey, initialStorageValue, options) {
|
|
|
2121
2121
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2122
2122
|
};
|
|
2123
2123
|
|
|
2124
|
-
function ownKeys$
|
|
2125
|
-
function _objectSpread$
|
|
2124
|
+
function ownKeys$1h(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2125
|
+
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(_context = ownKeys$1h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1h(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2126
2126
|
var defaultOptions$1 = {
|
|
2127
2127
|
propName: 'storage',
|
|
2128
2128
|
storageKey: '',
|
|
@@ -2136,7 +2136,7 @@ var injectStorage = function injectStorage(options) {
|
|
|
2136
2136
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2137
2137
|
* argument position does not allow passing specification of option(s).
|
|
2138
2138
|
*/
|
|
2139
|
-
var mergedOptions = _objectSpread$
|
|
2139
|
+
var mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
2140
2140
|
var WithStorage = function WithStorage(props) {
|
|
2141
2141
|
var _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2142
2142
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2148,7 +2148,7 @@ var injectStorage = function injectStorage(options) {
|
|
|
2148
2148
|
writeToStorage: writeToStorage,
|
|
2149
2149
|
readFromStorage: readFromStorage
|
|
2150
2150
|
});
|
|
2151
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2151
|
+
return jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
2152
2152
|
};
|
|
2153
2153
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2154
2154
|
return WithStorage;
|
|
@@ -2199,8 +2199,8 @@ var usePrevious = function usePrevious(value) {
|
|
|
2199
2199
|
return ref.current;
|
|
2200
2200
|
};
|
|
2201
2201
|
|
|
2202
|
-
function ownKeys$
|
|
2203
|
-
function _objectSpread$
|
|
2202
|
+
function ownKeys$1g(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2203
|
+
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(_context2 = ownKeys$1g(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1g(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2204
2204
|
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 } } } };
|
|
2205
2205
|
var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdatedDanglingProductSelections(storesQueryResult) {
|
|
2206
2206
|
var _storesQueryResult$re;
|
|
@@ -2211,7 +2211,7 @@ var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdate
|
|
|
2211
2211
|
offset: storesQueryResult.offset,
|
|
2212
2212
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, function (store) {
|
|
2213
2213
|
var _store$productSelecti;
|
|
2214
|
-
return _objectSpread$
|
|
2214
|
+
return _objectSpread$1g(_objectSpread$1g({}, store), {}, {
|
|
2215
2215
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, function (productSelectionRef) {
|
|
2216
2216
|
return Boolean(productSelectionRef.productSelection);
|
|
2217
2217
|
})
|
|
@@ -2221,7 +2221,7 @@ var filterStoresOutdatedDanglingProductSelections = function filterStoresOutdate
|
|
|
2221
2221
|
};
|
|
2222
2222
|
var createQueryVariables$8 = function createQueryVariables(ownProps) {
|
|
2223
2223
|
var _context;
|
|
2224
|
-
return _objectSpread$
|
|
2224
|
+
return _objectSpread$1g(_objectSpread$1g({
|
|
2225
2225
|
limit: ownProps.limit,
|
|
2226
2226
|
offset: ownProps.offset,
|
|
2227
2227
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2389,8 +2389,8 @@ function useDidFormValidationFail() {
|
|
|
2389
2389
|
return Boolean(didFormValidationFail);
|
|
2390
2390
|
}
|
|
2391
2391
|
|
|
2392
|
-
function ownKeys$
|
|
2393
|
-
function _objectSpread$
|
|
2392
|
+
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2393
|
+
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(_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2394
2394
|
var TEN_MINUTES_IN_MS = 600000;
|
|
2395
2395
|
var defaultOptions = {
|
|
2396
2396
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2418,7 +2418,7 @@ var useHasReminderExpired = function useHasReminderExpired(readReminderInterval)
|
|
|
2418
2418
|
};
|
|
2419
2419
|
var usePersistedReminder = function usePersistedReminder() {
|
|
2420
2420
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2421
|
-
var mergedOptions = _objectSpread$
|
|
2421
|
+
var mergedOptions = _objectSpread$1f(_objectSpread$1f({}, defaultOptions), options);
|
|
2422
2422
|
var _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2423
2423
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2424
2424
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2486,8 +2486,8 @@ var messages$H = defineMessages({
|
|
|
2486
2486
|
}
|
|
2487
2487
|
});
|
|
2488
2488
|
|
|
2489
|
-
function ownKeys$
|
|
2490
|
-
function _objectSpread$
|
|
2489
|
+
function ownKeys$1e(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2490
|
+
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(_context = ownKeys$1e(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1e(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2491
2491
|
var LinkToProfile = function LinkToProfile(props) {
|
|
2492
2492
|
var _useTrackingShared = useTrackingShared(),
|
|
2493
2493
|
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
@@ -2515,7 +2515,7 @@ var NotificationText = function NotificationText() {
|
|
|
2515
2515
|
isBold: true,
|
|
2516
2516
|
intlMessage: messages$H.profileUpdated
|
|
2517
2517
|
}), jsx(Text.Body, {
|
|
2518
|
-
intlMessage: _objectSpread$
|
|
2518
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$H.addMoreInformation), {}, {
|
|
2519
2519
|
values: {
|
|
2520
2520
|
newline: getNewLine
|
|
2521
2521
|
}
|
|
@@ -2524,7 +2524,7 @@ var NotificationText = function NotificationText() {
|
|
|
2524
2524
|
}), jsx(Spacings.Stack, {
|
|
2525
2525
|
scale: "xs",
|
|
2526
2526
|
children: jsx(Text.Body, {
|
|
2527
|
-
intlMessage: _objectSpread$
|
|
2527
|
+
intlMessage: _objectSpread$1e(_objectSpread$1e({}, messages$H.informationAndProfileLink), {}, {
|
|
2528
2528
|
values: {
|
|
2529
2529
|
newline: getNewLine,
|
|
2530
2530
|
link: getLinkToProfile
|
|
@@ -2744,8 +2744,8 @@ var useDebouncedPromiseCallback = function useDebouncedPromiseCallback(promiseCa
|
|
|
2744
2744
|
);
|
|
2745
2745
|
};
|
|
2746
2746
|
|
|
2747
|
-
function ownKeys$
|
|
2748
|
-
function _objectSpread$
|
|
2747
|
+
function ownKeys$1d(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2748
|
+
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(_context2 = ownKeys$1d(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1d(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2749
2749
|
var prepareMutableColumnProps = function prepareMutableColumnProps(columnConfig, mutableColumnProps) {
|
|
2750
2750
|
var updatedColumnProps = {};
|
|
2751
2751
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, function (columnProp) {
|
|
@@ -2771,14 +2771,14 @@ var retrieveColumnsWithCachedConfiguration = function retrieveColumnsWithCachedC
|
|
|
2771
2771
|
var initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, function (initialConfig) {
|
|
2772
2772
|
return initialConfig.key === cachedConfig.key;
|
|
2773
2773
|
});
|
|
2774
|
-
return _objectSpread$
|
|
2774
|
+
return _objectSpread$1d(_objectSpread$1d({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2775
2775
|
});
|
|
2776
2776
|
};
|
|
2777
2777
|
var handleCacheUpdate = function handleCacheUpdate(_ref2) {
|
|
2778
2778
|
var update = _ref2.update,
|
|
2779
2779
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2780
2780
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2781
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2781
|
+
return updateCachedTableConfiguration(_objectSpread$1d(_objectSpread$1d({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2782
2782
|
};
|
|
2783
2783
|
|
|
2784
2784
|
// Signature:
|
|
@@ -2809,7 +2809,7 @@ var usePersistedTableConfiguration = function usePersistedTableConfiguration(pro
|
|
|
2809
2809
|
var visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, function (columnConfig) {
|
|
2810
2810
|
return columnConfig.key === visibleColumnKey;
|
|
2811
2811
|
});
|
|
2812
|
-
return _objectSpread$
|
|
2812
|
+
return _objectSpread$1d({
|
|
2813
2813
|
key: visibleColumnKey
|
|
2814
2814
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2815
2815
|
}),
|
|
@@ -2888,15 +2888,15 @@ var handlers$6 = {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
};
|
|
2890
2890
|
|
|
2891
|
-
function ownKeys$
|
|
2892
|
-
function _objectSpread$
|
|
2891
|
+
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2892
|
+
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(_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2893
2893
|
|
|
2894
2894
|
// eslint-disable-next-line import/prefer-default-export
|
|
2895
2895
|
var convertProductSelectionsFromGraphQl = function convertProductSelectionsFromGraphQl(productSelections) {
|
|
2896
2896
|
var _context;
|
|
2897
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2897
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$1c(_objectSpread$1c({}, productSelections), {}, {
|
|
2898
2898
|
results: _mapInstanceProperty(_context = productSelections.results).call(_context, function (productSelection) {
|
|
2899
|
-
return _objectSpread$
|
|
2899
|
+
return _objectSpread$1c({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2900
2900
|
from: 'nameAllLocales',
|
|
2901
2901
|
to: 'name'
|
|
2902
2902
|
}]));
|
|
@@ -3106,6 +3106,8 @@ var trackingEvents$4 = {
|
|
|
3106
3106
|
}
|
|
3107
3107
|
};
|
|
3108
3108
|
|
|
3109
|
+
function ownKeys$1b(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3110
|
+
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(_context3 = ownKeys$1b(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$1b(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3109
3111
|
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: "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: 385, source: { body: "query GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3110
3112
|
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: "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: 385, source: { body: "query GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3111
3113
|
var getTrackingEvent$4 = function getTrackingEvent(inputValue, selectedValue) {
|
|
@@ -3126,7 +3128,8 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3126
3128
|
value = _ref.value,
|
|
3127
3129
|
hasError = _ref.hasError,
|
|
3128
3130
|
onError = _ref.onError,
|
|
3129
|
-
placeholder = _ref.placeholder
|
|
3131
|
+
placeholder = _ref.placeholder,
|
|
3132
|
+
role = _ref.role;
|
|
3130
3133
|
var formatLocalizedFieldToString = useFormatLocalizedFieldToString();
|
|
3131
3134
|
var _useIntl = useIntl(),
|
|
3132
3135
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -3134,10 +3137,12 @@ var ChannelPickerInput = function ChannelPickerInput(_ref) {
|
|
|
3134
3137
|
return applicationContext.dataLocale;
|
|
3135
3138
|
});
|
|
3136
3139
|
var variables = useMemo(function () {
|
|
3137
|
-
return {
|
|
3140
|
+
return _objectSpread$1b({
|
|
3138
3141
|
sortByNamePath: "name.".concat(dataLocale)
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3142
|
+
}, role && {
|
|
3143
|
+
where: "roles contains any (\"".concat(role, "\")")
|
|
3144
|
+
});
|
|
3145
|
+
}, [dataLocale, role]);
|
|
3141
3146
|
var _useState = useState(),
|
|
3142
3147
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3143
3148
|
loadingError = _useState2[0],
|
|
@@ -13181,7 +13186,6 @@ var MultiValueSelectorDropdown = function MultiValueSelectorDropdown(props) {
|
|
|
13181
13186
|
};
|
|
13182
13187
|
MultiValueSelectorDropdown.displayName = 'MultiValueSelectorDropdown';
|
|
13183
13188
|
var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
13184
|
-
var multiValueSearchInputRef = useRef(null);
|
|
13185
13189
|
var _useState = useState(''),
|
|
13186
13190
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13187
13191
|
value = _useState2[0],
|
|
@@ -13201,8 +13205,9 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13201
13205
|
var clearRunningTooltipTimer = function clearRunningTooltipTimer() {
|
|
13202
13206
|
if (tooltipTimeoutHandler) clearTimeout(tooltipTimeoutHandler);
|
|
13203
13207
|
};
|
|
13204
|
-
var handleInputChange = function handleInputChange(
|
|
13205
|
-
var
|
|
13208
|
+
var handleInputChange = function handleInputChange(event) {
|
|
13209
|
+
var _event$target$value = event.target.value,
|
|
13210
|
+
inputValue = _event$target$value === void 0 ? '' : _event$target$value;
|
|
13206
13211
|
setValue(inputValue);
|
|
13207
13212
|
var multiInput = _trimInstanceProperty(inputValue).call(inputValue).split(' ');
|
|
13208
13213
|
setMultiValue(multiInput);
|
|
@@ -13223,7 +13228,8 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13223
13228
|
setValue('');
|
|
13224
13229
|
setMultiValue([]);
|
|
13225
13230
|
};
|
|
13226
|
-
var handleSubmit = function handleSubmit(
|
|
13231
|
+
var handleSubmit = function handleSubmit() {
|
|
13232
|
+
var inputValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
13227
13233
|
clearInputValues();
|
|
13228
13234
|
clearRunningTooltipTimer();
|
|
13229
13235
|
setIsTooltipVisible(false);
|
|
@@ -13256,16 +13262,13 @@ var MultiValueSearchInput = function MultiValueSearchInput(props) {
|
|
|
13256
13262
|
className: styles$1.container,
|
|
13257
13263
|
children: [jsx(Spacings.Stack, {
|
|
13258
13264
|
size: "s",
|
|
13259
|
-
children: jsx(
|
|
13260
|
-
|
|
13261
|
-
disabled: props.isDisabled,
|
|
13262
|
-
initialValue: value,
|
|
13263
|
-
throttleMS: 0,
|
|
13265
|
+
children: jsx(SearchTextInput, {
|
|
13266
|
+
isDisabled: props.isDisabled,
|
|
13264
13267
|
placeholder: props.placeholder,
|
|
13265
|
-
onSubmit: handleSubmit,
|
|
13266
13268
|
onChange: handleInputChange,
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
+
onReset: handleClearSearchField,
|
|
13270
|
+
onSubmit: handleSubmit,
|
|
13271
|
+
value: value
|
|
13269
13272
|
})
|
|
13270
13273
|
}), jsx(MultiValueSelectorDropdown, {
|
|
13271
13274
|
isOpen: isTooltipVisible,
|
package/dist/styles.css
CHANGED
|
@@ -227,9 +227,16 @@
|
|
|
227
227
|
|
|
228
228
|
.throttled-field-module__size___324jx {
|
|
229
229
|
width: 100%;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
:where(html[data-theme='default']) .throttled-field-module__size___324jx {
|
|
230
233
|
height: inherit;
|
|
231
234
|
}
|
|
232
235
|
|
|
236
|
+
:where(html[data-theme='test']) .throttled-field-module__size___324jx {
|
|
237
|
+
min-height: var(--height-for-input)
|
|
238
|
+
}
|
|
239
|
+
|
|
233
240
|
.throttled-field-module__input-text___3zFFp {
|
|
234
241
|
transition: 0.2s ease;
|
|
235
242
|
border-radius: 6px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/experimental-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/commercetools-frontend-experimental-components.cjs.js",
|
|
6
6
|
"module": "dist/commercetools-frontend-experimental-components.esm.js",
|