@commercetools-frontend/experimental-components 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +1008 -1257
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +1007 -1256
- package/dist/commercetools-frontend-experimental-components.esm.js +1005 -1252
- package/dist/styles.css +16 -97
- package/package.json +12 -11
|
@@ -16,7 +16,7 @@ import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
|
16
16
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
17
17
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
18
18
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
19
|
-
import React, { useEffect, useCallback, useState, useRef, useMemo, PureComponent, Component,
|
|
19
|
+
import React, { useEffect, useCallback, useState, useRef, useMemo, PureComponent, Component, createContext, memo, useContext, forwardRef } from 'react';
|
|
20
20
|
import flowRight from 'lodash/flowRight';
|
|
21
21
|
import { graphql as graphql$1, withApollo } from '@apollo/client/react/hoc';
|
|
22
22
|
import flatten from 'lodash/flatten';
|
|
@@ -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,
|
|
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, SecondaryButton, RevertIcon, Grid, customProperties, SubdirectoryArrowIcon, Tag, IconButton, EditIcon, FieldLabel, WarningIcon, FlatButton, AngleUpIcon, AngleDownIcon, BinLinearIcon, PlusBoldIcon, ErrorIcon, SelectField, AsyncSelectField, SearchSelectField, FieldErrors, ContentNotification, ListIcon, CheckboxInput, SelectableSearchInput, 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';
|
|
@@ -52,7 +52,7 @@ import { useQuery, useApolloClient } from '@apollo/client/react';
|
|
|
52
52
|
import _lastIndexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/last-index-of';
|
|
53
53
|
import { graphql } from 'msw';
|
|
54
54
|
import get from 'lodash/get';
|
|
55
|
-
import { useFormikContext, Field, getIn, FastField
|
|
55
|
+
import { useFormikContext, Formik, Field, getIn, FastField } from 'formik';
|
|
56
56
|
import _Date$now from '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
57
57
|
import _setTimeout from '@babel/runtime-corejs3/core-js-stable/set-timeout';
|
|
58
58
|
import { useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/application-shell';
|
|
@@ -62,7 +62,6 @@ import { useQuery as useQuery$1 } from '@apollo/client/react/hooks';
|
|
|
62
62
|
import moment$1 from 'moment';
|
|
63
63
|
import classnames from 'classnames';
|
|
64
64
|
import 'react-required-if';
|
|
65
|
-
import { withThemeContext, useTheme } from '@commercetools-uikit/design-system';
|
|
66
65
|
import _assertThisInitialized from '@babel/runtime-corejs3/helpers/esm/assertThisInitialized';
|
|
67
66
|
import Textarea from 'react-textarea-autosize';
|
|
68
67
|
import has from 'lodash/has';
|
|
@@ -76,6 +75,7 @@ import omit from 'lodash/omit';
|
|
|
76
75
|
import isEmpty$3 from 'lodash/isEmpty';
|
|
77
76
|
import _Object$freeze from '@babel/runtime-corejs3/core-js-stable/object/freeze';
|
|
78
77
|
import originalOmitDeep from 'omit-deep';
|
|
78
|
+
import _findIndexInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find-index';
|
|
79
79
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
80
80
|
import _parseInt from '@babel/runtime-corejs3/core-js-stable/parse-int';
|
|
81
81
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
@@ -108,7 +108,6 @@ import isUndefined from 'lodash/isUndefined';
|
|
|
108
108
|
import isFinite from 'lodash/isFinite';
|
|
109
109
|
import Cleave from 'cleave.js/react';
|
|
110
110
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
111
|
-
import _findIndexInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find-index';
|
|
112
111
|
import compact from 'lodash/compact';
|
|
113
112
|
import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
114
113
|
import '@babel/runtime-corejs3/helpers/get';
|
|
@@ -295,7 +294,7 @@ function uniqueObjects(items) {
|
|
|
295
294
|
|
|
296
295
|
*/
|
|
297
296
|
|
|
298
|
-
const messages$
|
|
297
|
+
const messages$J = defineMessages({
|
|
299
298
|
unique: {
|
|
300
299
|
id: 'Validation.unique',
|
|
301
300
|
description: 'An error message to show if the field must be unique',
|
|
@@ -1590,8 +1589,8 @@ const getData = (code, field) => {
|
|
|
1590
1589
|
};
|
|
1591
1590
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
1592
1591
|
|
|
1593
|
-
function ownKeys$
|
|
1594
|
-
function _objectSpread$
|
|
1592
|
+
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; }
|
|
1593
|
+
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; }
|
|
1595
1594
|
function formatMoneyRangeValue(value, intl) {
|
|
1596
1595
|
var _context;
|
|
1597
1596
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
@@ -1601,7 +1600,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
1601
1600
|
return '';
|
|
1602
1601
|
}
|
|
1603
1602
|
function formatMoneyValue(amount, currency, intl) {
|
|
1604
|
-
return formatMoney$1(_objectSpread$
|
|
1603
|
+
return formatMoney$1(_objectSpread$1i({
|
|
1605
1604
|
centAmount: amount,
|
|
1606
1605
|
fractionDigits: getFractionDigit(currency)
|
|
1607
1606
|
}, currency ? {
|
|
@@ -1618,14 +1617,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
1618
1617
|
}
|
|
1619
1618
|
function formatMoney$1(moneyValue, intl, options) {
|
|
1620
1619
|
var _moneyValue$fractione;
|
|
1621
|
-
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$
|
|
1620
|
+
return intl.formatNumber((_moneyValue$fractione = moneyValue.fractionedAmount) !== null && _moneyValue$fractione !== void 0 ? _moneyValue$fractione : getFractionedAmount(moneyValue), _objectSpread$1i({
|
|
1622
1621
|
style: 'currency',
|
|
1623
1622
|
currency: moneyValue.currencyCode,
|
|
1624
1623
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
1625
1624
|
}, options));
|
|
1626
1625
|
}
|
|
1627
1626
|
|
|
1628
|
-
var messages$
|
|
1627
|
+
var messages$I = defineMessages({
|
|
1629
1628
|
booleanYes: {
|
|
1630
1629
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
1631
1630
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -1710,7 +1709,7 @@ const formatDateTime = _ref7 => {
|
|
|
1710
1709
|
const formatBoolean = _ref8 => {
|
|
1711
1710
|
let value = _ref8.value,
|
|
1712
1711
|
intl = _ref8.intl;
|
|
1713
|
-
return value ? intl.formatMessage(messages$
|
|
1712
|
+
return value ? intl.formatMessage(messages$I.booleanYes) : intl.formatMessage(messages$I.booleanNo);
|
|
1714
1713
|
};
|
|
1715
1714
|
const formatNilType = _ref9 => {
|
|
1716
1715
|
let value = _ref9.value,
|
|
@@ -1872,8 +1871,8 @@ const wrapDisplayName = (BaseComponent, hocName) => {
|
|
|
1872
1871
|
return _concatInstanceProperty(_context = "".concat(hocName, "(")).call(_context, getDisplayName(BaseComponent), ")");
|
|
1873
1872
|
};
|
|
1874
1873
|
|
|
1875
|
-
function ownKeys$
|
|
1876
|
-
function _objectSpread$
|
|
1874
|
+
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; }
|
|
1875
|
+
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; }
|
|
1877
1876
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1878
1877
|
const WithDataTablePaginationState = props => {
|
|
1879
1878
|
var _initialValues$tableS, _initialValues$tableS2;
|
|
@@ -1887,7 +1886,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1887
1886
|
key: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS = initialValues.tableSorting) === null || _initialValues$tableS === void 0 ? void 0 : _initialValues$tableS.key,
|
|
1888
1887
|
order: initialValues === null || initialValues === void 0 ? void 0 : (_initialValues$tableS2 = initialValues.tableSorting) === null || _initialValues$tableS2 === void 0 ? void 0 : _initialValues$tableS2.order
|
|
1889
1888
|
});
|
|
1890
|
-
return jsx(Component, _objectSpread$
|
|
1889
|
+
return jsx(Component, _objectSpread$1h(_objectSpread$1h({}, props), {}, {
|
|
1891
1890
|
dataTablePaginationState: {
|
|
1892
1891
|
page,
|
|
1893
1892
|
perPage,
|
|
@@ -1899,8 +1898,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1899
1898
|
return WithDataTablePaginationState;
|
|
1900
1899
|
};
|
|
1901
1900
|
|
|
1902
|
-
function ownKeys$
|
|
1903
|
-
function _objectSpread$
|
|
1901
|
+
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; }
|
|
1902
|
+
function _objectSpread$1g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1g(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1904
1903
|
const injectNotifications = function () {
|
|
1905
1904
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1906
1905
|
return Component => {
|
|
@@ -1915,7 +1914,7 @@ const injectNotifications = function () {
|
|
|
1915
1914
|
onActionError,
|
|
1916
1915
|
hideAllPageNotifications
|
|
1917
1916
|
};
|
|
1918
|
-
return jsx(Component, _objectSpread$
|
|
1917
|
+
return jsx(Component, _objectSpread$1g(_objectSpread$1g({}, props), {}, {
|
|
1919
1918
|
[propName]: notifications
|
|
1920
1919
|
}));
|
|
1921
1920
|
};
|
|
@@ -1924,22 +1923,22 @@ const injectNotifications = function () {
|
|
|
1924
1923
|
};
|
|
1925
1924
|
};
|
|
1926
1925
|
|
|
1927
|
-
function ownKeys$
|
|
1928
|
-
function _objectSpread$
|
|
1926
|
+
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; }
|
|
1927
|
+
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; }
|
|
1929
1928
|
function isPropsMapper(mapProps) {
|
|
1930
1929
|
return typeof mapProps === 'function';
|
|
1931
1930
|
}
|
|
1932
1931
|
const withProps = mapProps => Component => {
|
|
1933
1932
|
const EnhancedWithProps = ownProps => {
|
|
1934
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1935
|
-
return jsx(Component, _objectSpread$
|
|
1933
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1f(_objectSpread$1f({}, ownProps), mapProps(ownProps)) : _objectSpread$1f(_objectSpread$1f({}, ownProps), mapProps);
|
|
1934
|
+
return jsx(Component, _objectSpread$1f({}, enhancedProps));
|
|
1936
1935
|
};
|
|
1937
1936
|
EnhancedWithProps.displayName = wrapDisplayName(Component, 'withProps');
|
|
1938
1937
|
return EnhancedWithProps;
|
|
1939
1938
|
};
|
|
1940
1939
|
|
|
1941
|
-
function ownKeys$
|
|
1942
|
-
function _objectSpread$
|
|
1940
|
+
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; }
|
|
1941
|
+
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; }
|
|
1943
1942
|
const useRedirectEffect = _ref => {
|
|
1944
1943
|
let goTo = _ref.goTo;
|
|
1945
1944
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1959,30 +1958,30 @@ const defaultOptions$5 = {
|
|
|
1959
1958
|
skip: () => false
|
|
1960
1959
|
};
|
|
1961
1960
|
const withRedirectTo = options => Component => {
|
|
1962
|
-
const mergedOptions = _objectSpread$
|
|
1961
|
+
const mergedOptions = _objectSpread$1e(_objectSpread$1e({}, defaultOptions$5), options);
|
|
1963
1962
|
const WithRedirectTo = props => {
|
|
1964
1963
|
if (!mergedOptions.skip(props)) {
|
|
1965
1964
|
return jsx(RedirectTo, {
|
|
1966
1965
|
goTo: options.selectGoTo(props)
|
|
1967
1966
|
});
|
|
1968
1967
|
}
|
|
1969
|
-
return jsx(Component, _objectSpread$
|
|
1968
|
+
return jsx(Component, _objectSpread$1e({}, props));
|
|
1970
1969
|
};
|
|
1971
1970
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1972
1971
|
return WithRedirectTo;
|
|
1973
1972
|
};
|
|
1974
1973
|
|
|
1975
|
-
function ownKeys$
|
|
1976
|
-
function _objectSpread$
|
|
1974
|
+
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; }
|
|
1975
|
+
function _objectSpread$1d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1d(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1977
1976
|
const defaultOptions$4 = {
|
|
1978
1977
|
propName: 'modalState',
|
|
1979
1978
|
isInitiallyOpen: false
|
|
1980
1979
|
};
|
|
1981
1980
|
const injectModalState$1 = options => Component => {
|
|
1982
|
-
const mergedOptions = _objectSpread$
|
|
1981
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions$4), options);
|
|
1983
1982
|
const WithModalState = props => {
|
|
1984
1983
|
const modalState = useModalState(mergedOptions.isInitiallyOpen);
|
|
1985
|
-
return jsx(Component, _objectSpread$
|
|
1984
|
+
return jsx(Component, _objectSpread$1d(_objectSpread$1d({}, props), {}, {
|
|
1986
1985
|
[mergedOptions.propName]: modalState
|
|
1987
1986
|
}));
|
|
1988
1987
|
};
|
|
@@ -1990,17 +1989,17 @@ const injectModalState$1 = options => Component => {
|
|
|
1990
1989
|
return WithModalState;
|
|
1991
1990
|
};
|
|
1992
1991
|
|
|
1993
|
-
function ownKeys$
|
|
1994
|
-
function _objectSpread$
|
|
1992
|
+
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; }
|
|
1993
|
+
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1995
1994
|
const defaultOptions$3 = {
|
|
1996
1995
|
propName: 'toggleState',
|
|
1997
1996
|
isInitiallyOpen: false
|
|
1998
1997
|
};
|
|
1999
1998
|
const injectModalState = options => Component => {
|
|
2000
|
-
const mergedOptions = _objectSpread$
|
|
1999
|
+
const mergedOptions = _objectSpread$1c(_objectSpread$1c({}, defaultOptions$3), options);
|
|
2001
2000
|
const WithToggleState = props => {
|
|
2002
2001
|
const toggleState = useToggleState(mergedOptions.isInitiallyOpen);
|
|
2003
|
-
return jsx(Component, _objectSpread$
|
|
2002
|
+
return jsx(Component, _objectSpread$1c(_objectSpread$1c({}, props), {}, {
|
|
2004
2003
|
[mergedOptions.propName]: toggleState
|
|
2005
2004
|
}));
|
|
2006
2005
|
};
|
|
@@ -2008,8 +2007,8 @@ const injectModalState = options => Component => {
|
|
|
2008
2007
|
return WithToggleState;
|
|
2009
2008
|
};
|
|
2010
2009
|
|
|
2011
|
-
function ownKeys$
|
|
2012
|
-
function _objectSpread$
|
|
2010
|
+
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; }
|
|
2011
|
+
function _objectSpread$1b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1b(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2013
2012
|
const defaultOptions$2 = {
|
|
2014
2013
|
storageType: 'local',
|
|
2015
2014
|
segregateByUser: true
|
|
@@ -2027,7 +2026,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
2027
2026
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
2028
2027
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
2029
2028
|
var _context;
|
|
2030
|
-
const mergedOptions = _objectSpread$
|
|
2029
|
+
const mergedOptions = _objectSpread$1b(_objectSpread$1b({}, defaultOptions$2), options);
|
|
2031
2030
|
const userId = useApplicationContext(context => {
|
|
2032
2031
|
var _context$user;
|
|
2033
2032
|
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
@@ -2075,8 +2074,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
2075
2074
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
2076
2075
|
};
|
|
2077
2076
|
|
|
2078
|
-
function ownKeys$
|
|
2079
|
-
function _objectSpread$
|
|
2077
|
+
function ownKeys$1a(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; }
|
|
2078
|
+
function _objectSpread$1a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2080
2079
|
const defaultOptions$1 = {
|
|
2081
2080
|
propName: 'storage',
|
|
2082
2081
|
storageKey: '',
|
|
@@ -2089,7 +2088,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2089
2088
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
2090
2089
|
* argument position does not allow passing specification of option(s).
|
|
2091
2090
|
*/
|
|
2092
|
-
const mergedOptions = _objectSpread$
|
|
2091
|
+
const mergedOptions = _objectSpread$1a(_objectSpread$1a({}, defaultOptions$1), options);
|
|
2093
2092
|
const WithStorage = props => {
|
|
2094
2093
|
const _useStorage = useStorage(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
2095
2094
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -2103,7 +2102,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2103
2102
|
readFromStorage
|
|
2104
2103
|
}
|
|
2105
2104
|
};
|
|
2106
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
2105
|
+
return jsx(WrappedComponent, _objectSpread$1a(_objectSpread$1a({}, props), storageProp));
|
|
2107
2106
|
};
|
|
2108
2107
|
WithStorage.displayName = wrapDisplayName(WrappedComponent, 'WithStorage');
|
|
2109
2108
|
return WithStorage;
|
|
@@ -2147,8 +2146,8 @@ const usePrevious = value => {
|
|
|
2147
2146
|
return ref.current;
|
|
2148
2147
|
};
|
|
2149
2148
|
|
|
2150
|
-
function ownKeys$
|
|
2151
|
-
function _objectSpread$
|
|
2149
|
+
function ownKeys$19(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; }
|
|
2150
|
+
function _objectSpread$19(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$19(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$19(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2152
2151
|
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: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n type\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2153
2152
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
2154
2153
|
var _storesQueryResult$re;
|
|
@@ -2159,7 +2158,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2159
2158
|
offset: storesQueryResult.offset,
|
|
2160
2159
|
results: (_storesQueryResult$re = storesQueryResult.results) === null || _storesQueryResult$re === void 0 ? void 0 : _mapInstanceProperty(_storesQueryResult$re).call(_storesQueryResult$re, store => {
|
|
2161
2160
|
var _store$productSelecti;
|
|
2162
|
-
return _objectSpread$
|
|
2161
|
+
return _objectSpread$19(_objectSpread$19({}, store), {}, {
|
|
2163
2162
|
productSelections: (_store$productSelecti = store.productSelections) === null || _store$productSelecti === void 0 ? void 0 : _filterInstanceProperty(_store$productSelecti).call(_store$productSelecti, productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
2164
2163
|
});
|
|
2165
2164
|
})
|
|
@@ -2167,7 +2166,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2167
2166
|
};
|
|
2168
2167
|
const createQueryVariables$6 = ownProps => {
|
|
2169
2168
|
var _context;
|
|
2170
|
-
return _objectSpread$
|
|
2169
|
+
return _objectSpread$19(_objectSpread$19({
|
|
2171
2170
|
limit: ownProps.limit,
|
|
2172
2171
|
offset: ownProps.offset,
|
|
2173
2172
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2322,8 +2321,8 @@ function useDidFormValidationFail() {
|
|
|
2322
2321
|
return Boolean(didFormValidationFail);
|
|
2323
2322
|
}
|
|
2324
2323
|
|
|
2325
|
-
function ownKeys$
|
|
2326
|
-
function _objectSpread$
|
|
2324
|
+
function ownKeys$18(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; }
|
|
2325
|
+
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2327
2326
|
const TEN_MINUTES_IN_MS = 600000;
|
|
2328
2327
|
const defaultOptions = {
|
|
2329
2328
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -2351,7 +2350,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
2351
2350
|
};
|
|
2352
2351
|
const usePersistedReminder = function () {
|
|
2353
2352
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2354
|
-
const mergedOptions = _objectSpread$
|
|
2353
|
+
const mergedOptions = _objectSpread$18(_objectSpread$18({}, defaultOptions), options);
|
|
2355
2354
|
const _useStorage = useStorage(mergedOptions.storageKey, null),
|
|
2356
2355
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
2357
2356
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -2397,7 +2396,7 @@ const usePersistedReminder = function () {
|
|
|
2397
2396
|
return [hasReminderExpired, hasChosenReminderRef, scheduleReminder];
|
|
2398
2397
|
};
|
|
2399
2398
|
|
|
2400
|
-
var messages$
|
|
2399
|
+
var messages$H = defineMessages({
|
|
2401
2400
|
profileUpdated: {
|
|
2402
2401
|
id: 'NotificationText.profileUpdated',
|
|
2403
2402
|
description: 'Label for the notification header',
|
|
@@ -2415,8 +2414,8 @@ var messages$I = defineMessages({
|
|
|
2415
2414
|
}
|
|
2416
2415
|
});
|
|
2417
2416
|
|
|
2418
|
-
function ownKeys$
|
|
2419
|
-
function _objectSpread$
|
|
2417
|
+
function ownKeys$17(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; }
|
|
2418
|
+
function _objectSpread$17(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$17(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$17(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2420
2419
|
const LinkToProfile = props => {
|
|
2421
2420
|
return jsx(Link, {
|
|
2422
2421
|
to: "/account/profile",
|
|
@@ -2434,9 +2433,9 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2434
2433
|
children: [jsx(Text.Body, {
|
|
2435
2434
|
as: "p",
|
|
2436
2435
|
isBold: true,
|
|
2437
|
-
intlMessage: messages$
|
|
2436
|
+
intlMessage: messages$H.profileUpdated
|
|
2438
2437
|
}), jsx(Text.Body, {
|
|
2439
|
-
intlMessage: _objectSpread$
|
|
2438
|
+
intlMessage: _objectSpread$17(_objectSpread$17({}, messages$H.addMoreInformation), {}, {
|
|
2440
2439
|
values: {
|
|
2441
2440
|
newline: getNewLine
|
|
2442
2441
|
}
|
|
@@ -2445,7 +2444,7 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2445
2444
|
}), jsx(Spacings.Stack, {
|
|
2446
2445
|
scale: "xs",
|
|
2447
2446
|
children: jsx(Text.Body, {
|
|
2448
|
-
intlMessage: _objectSpread$
|
|
2447
|
+
intlMessage: _objectSpread$17(_objectSpread$17({}, messages$H.informationAndProfileLink), {}, {
|
|
2449
2448
|
values: {
|
|
2450
2449
|
newline: getNewLine,
|
|
2451
2450
|
link: getLinkToProfile
|
|
@@ -2566,7 +2565,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2566
2565
|
}, [ref]);
|
|
2567
2566
|
};
|
|
2568
2567
|
|
|
2569
|
-
var messages$
|
|
2568
|
+
var messages$G = defineMessages({
|
|
2570
2569
|
fallbackHint: {
|
|
2571
2570
|
id: 'KeyFallback.fallbackHint',
|
|
2572
2571
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2590,7 +2589,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2590
2589
|
return values => {
|
|
2591
2590
|
if (!values.resource) return null;
|
|
2592
2591
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2593
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2592
|
+
const fallbackHintWithKey = intl.formatMessage(messages$G.fallbackHint, {
|
|
2594
2593
|
key: values.resource.key
|
|
2595
2594
|
});
|
|
2596
2595
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2602,8 +2601,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2602
2601
|
// eslint-disable-next-line testing-library/await-async-utils
|
|
2603
2602
|
useCallback(debounce(promiseCallback, wait), [promiseCallback]);
|
|
2604
2603
|
|
|
2605
|
-
function ownKeys$
|
|
2606
|
-
function _objectSpread$
|
|
2604
|
+
function ownKeys$16(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; }
|
|
2605
|
+
function _objectSpread$16(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$16(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$16(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2607
2606
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2608
2607
|
const updatedColumnProps = {};
|
|
2609
2608
|
_forEachInstanceProperty(mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2623,14 +2622,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2623
2622
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2624
2623
|
return _mapInstanceProperty(_context = _filterInstanceProperty(cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2625
2624
|
const initialColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2626
|
-
return _objectSpread$
|
|
2625
|
+
return _objectSpread$16(_objectSpread$16({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2627
2626
|
});
|
|
2628
2627
|
};
|
|
2629
2628
|
const handleCacheUpdate = _ref2 => {
|
|
2630
2629
|
let update = _ref2.update,
|
|
2631
2630
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2632
2631
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2633
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2632
|
+
return updateCachedTableConfiguration(_objectSpread$16(_objectSpread$16({}, pick(cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2634
2633
|
};
|
|
2635
2634
|
|
|
2636
2635
|
// Signature:
|
|
@@ -2659,7 +2658,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2659
2658
|
return {
|
|
2660
2659
|
columnsConfig: _mapInstanceProperty(initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2661
2660
|
const visibleColumnConfig = _findInstanceProperty(allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2662
|
-
return _objectSpread$
|
|
2661
|
+
return _objectSpread$16({
|
|
2663
2662
|
key: visibleColumnKey
|
|
2664
2663
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2665
2664
|
}),
|
|
@@ -2730,14 +2729,14 @@ const handlers$4 = {
|
|
|
2730
2729
|
}
|
|
2731
2730
|
};
|
|
2732
2731
|
|
|
2733
|
-
function ownKeys$
|
|
2734
|
-
function _objectSpread$
|
|
2732
|
+
function ownKeys$15(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; }
|
|
2733
|
+
function _objectSpread$15(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$15(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$15(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2735
2734
|
|
|
2736
2735
|
// eslint-disable-next-line import/prefer-default-export
|
|
2737
2736
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2738
2737
|
var _context;
|
|
2739
|
-
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$
|
|
2740
|
-
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2738
|
+
return (productSelections === null || productSelections === void 0 ? void 0 : productSelections.results) && _objectSpread$15(_objectSpread$15({}, productSelections), {}, {
|
|
2739
|
+
results: _mapInstanceProperty(_context = productSelections.results).call(_context, productSelection => _objectSpread$15({}, applyTransformedLocalizedFields(productSelection, [{
|
|
2741
2740
|
from: 'nameAllLocales',
|
|
2742
2741
|
to: 'name'
|
|
2743
2742
|
}])))
|
|
@@ -2873,7 +2872,7 @@ var localizedTextTransformer = (localizedString => {
|
|
|
2873
2872
|
}).join(' and ');
|
|
2874
2873
|
});
|
|
2875
2874
|
|
|
2876
|
-
var styles$
|
|
2875
|
+
var styles$i = {
|
|
2877
2876
|
"loading-container": "centered-loading-spinner-module__loading-container___3_9-h"
|
|
2878
2877
|
};
|
|
2879
2878
|
/**
|
|
@@ -2881,13 +2880,13 @@ var styles$j = {
|
|
|
2881
2880
|
* - the ui-kit Spacings.Stack does not allow for custom styles, nor does it stretch to fill its container's height
|
|
2882
2881
|
*/
|
|
2883
2882
|
const CenteredLoadingSpinner = () => jsx("div", {
|
|
2884
|
-
className: styles$
|
|
2883
|
+
className: styles$i['loading-container'],
|
|
2885
2884
|
"data-testid": "centered-loading-spinner",
|
|
2886
2885
|
children: jsx(LoadingSpinner, {})
|
|
2887
2886
|
});
|
|
2888
2887
|
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
2889
2888
|
|
|
2890
|
-
var messages$
|
|
2889
|
+
var messages$F = defineMessages({
|
|
2891
2890
|
noChannelsFound: {
|
|
2892
2891
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
2893
2892
|
description: 'The message to display when no channels were found',
|
|
@@ -2913,8 +2912,8 @@ var commonPickerMessages = defineMessages({
|
|
|
2913
2912
|
}
|
|
2914
2913
|
});
|
|
2915
2914
|
|
|
2916
|
-
function ownKeys$
|
|
2917
|
-
function _objectSpread$
|
|
2915
|
+
function ownKeys$14(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; }
|
|
2916
|
+
function _objectSpread$14(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$14(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$14(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2918
2917
|
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 } } } };
|
|
2919
2918
|
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 } } } };
|
|
2920
2919
|
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 } } } };
|
|
@@ -2935,7 +2934,7 @@ const ChannelPickerInput = _ref => {
|
|
|
2935
2934
|
const _useIntl = useIntl(),
|
|
2936
2935
|
formatMessage = _useIntl.formatMessage;
|
|
2937
2936
|
const dataLocale = useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
2938
|
-
const variables = useMemo(() => _objectSpread$
|
|
2937
|
+
const variables = useMemo(() => _objectSpread$14({
|
|
2939
2938
|
sortByNamePath: "name.".concat(dataLocale)
|
|
2940
2939
|
}, role && {
|
|
2941
2940
|
where: "roles contains any (\"".concat(role, "\")")
|
|
@@ -2996,7 +2995,7 @@ const ChannelPickerInput = _ref => {
|
|
|
2996
2995
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
2997
2996
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
2998
2997
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
2999
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
2998
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$F.noChannelsFound), [loadingError, formatMessage]);
|
|
3000
2999
|
const 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 : '';
|
|
3001
3000
|
return jsx(Constraints.Horizontal, {
|
|
3002
3001
|
max: "scale",
|
|
@@ -3007,7 +3006,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3007
3006
|
children: jsx(AsyncSelectInput, {
|
|
3008
3007
|
id: name,
|
|
3009
3008
|
name: name,
|
|
3010
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
3009
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$F.placeholder),
|
|
3011
3010
|
loadOptions: loadOptionsDebounced,
|
|
3012
3011
|
defaultOptions: true,
|
|
3013
3012
|
showOptionGroupDivider: true,
|
|
@@ -3064,8 +3063,8 @@ var FormattedDateTime$1 = injectIntl(FormattedDateTime);
|
|
|
3064
3063
|
|
|
3065
3064
|
const keepDisplayName = component => setDisplayName(getDisplayName(component));
|
|
3066
3065
|
|
|
3067
|
-
function ownKeys$
|
|
3068
|
-
function _objectSpread$
|
|
3066
|
+
function ownKeys$13(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; }
|
|
3067
|
+
function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$13(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$13(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3069
3068
|
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3070
3069
|
function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3071
3070
|
const withMouseOverState = BaseComponent => {
|
|
@@ -3097,7 +3096,7 @@ const withMouseOverState = BaseComponent => {
|
|
|
3097
3096
|
handleMouseOver: this.handleMouseOver,
|
|
3098
3097
|
handleMouseOut: this.handleMouseOut
|
|
3099
3098
|
};
|
|
3100
|
-
return jsx(BaseComponent, _objectSpread$
|
|
3099
|
+
return jsx(BaseComponent, _objectSpread$13({}, _objectSpread$13(_objectSpread$13({}, this.props), injectedProps)));
|
|
3101
3100
|
}
|
|
3102
3101
|
}]);
|
|
3103
3102
|
return WithMouseOverState;
|
|
@@ -3106,11 +3105,11 @@ const withMouseOverState = BaseComponent => {
|
|
|
3106
3105
|
return WithMouseOverState;
|
|
3107
3106
|
};
|
|
3108
3107
|
|
|
3109
|
-
function ownKeys$
|
|
3110
|
-
function _objectSpread$
|
|
3108
|
+
function ownKeys$12(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; }
|
|
3109
|
+
function _objectSpread$12(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$12(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$12(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3111
3110
|
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3112
3111
|
function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3113
|
-
var styles$
|
|
3112
|
+
var styles$h = {
|
|
3114
3113
|
"size": "throttled-field-module__size___324jx",
|
|
3115
3114
|
"input-text": "throttled-field-module__input-text___3zFFp",
|
|
3116
3115
|
"input-secondary": "throttled-field-module__input-secondary___cFo9e throttled-field-module__input-text___3zFFp throttled-field-module__size___324jx",
|
|
@@ -3218,7 +3217,7 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3218
3217
|
}, {
|
|
3219
3218
|
key: "render",
|
|
3220
3219
|
value: function render() {
|
|
3221
|
-
const commonProps = _objectSpread$
|
|
3220
|
+
const commonProps = _objectSpread$12(_objectSpread$12({
|
|
3222
3221
|
value: this.state.draftValue,
|
|
3223
3222
|
autoComplete: this.props.autoComplete,
|
|
3224
3223
|
onChange: this.handleChange,
|
|
@@ -3237,23 +3236,23 @@ let ThrottledField = /*#__PURE__*/function (_PureComponent) {
|
|
|
3237
3236
|
htmlFor: inputId,
|
|
3238
3237
|
children: this.props.label
|
|
3239
3238
|
})
|
|
3240
|
-
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$
|
|
3239
|
+
}), this.props.as === 'textarea' ? jsx(Textarea, _objectSpread$12(_objectSpread$12({}, commonProps), {}, {
|
|
3241
3240
|
id: inputId,
|
|
3242
|
-
className: classnames(styles$
|
|
3243
|
-
[styles$
|
|
3244
|
-
[styles$
|
|
3241
|
+
className: classnames(styles$h.textarea, styles$h["textarea-".concat(this.props.style)], {
|
|
3242
|
+
[styles$h.invalid]: !this.props.isValid,
|
|
3243
|
+
[styles$h.disabled]: this.props.disabled
|
|
3245
3244
|
}),
|
|
3246
3245
|
rows: 1,
|
|
3247
3246
|
maxRows: this.props.autoSize ? undefined : 1,
|
|
3248
3247
|
cacheMeasurements: true
|
|
3249
|
-
})) : jsx("input", _objectSpread$
|
|
3248
|
+
})) : jsx("input", _objectSpread$12(_objectSpread$12({}, commonProps), {}, {
|
|
3250
3249
|
id: inputId,
|
|
3251
3250
|
ref: this.props.inputRef,
|
|
3252
3251
|
type: this.props.as,
|
|
3253
|
-
className: classnames(styles$
|
|
3254
|
-
[styles$
|
|
3255
|
-
[styles$
|
|
3256
|
-
[styles$
|
|
3252
|
+
className: classnames(styles$h["input-".concat(this.props.style)], {
|
|
3253
|
+
[styles$h.invalid]: !this.props.isValid,
|
|
3254
|
+
[styles$h.disabled]: this.props.disabled,
|
|
3255
|
+
[styles$h.granular]: this.props.isGranular
|
|
3257
3256
|
})
|
|
3258
3257
|
}))]
|
|
3259
3258
|
});
|
|
@@ -3273,7 +3272,7 @@ ThrottledField.defaultProps = {
|
|
|
3273
3272
|
label: 'Throttled field'
|
|
3274
3273
|
};
|
|
3275
3274
|
|
|
3276
|
-
var messages$
|
|
3275
|
+
var messages$E = defineMessages({
|
|
3277
3276
|
buttonLabel: {
|
|
3278
3277
|
id: 'SearchInput.buttonLabel',
|
|
3279
3278
|
description: 'Label for "Search" button.',
|
|
@@ -3288,7 +3287,7 @@ var messages$F = defineMessages({
|
|
|
3288
3287
|
|
|
3289
3288
|
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
3290
3289
|
function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
3291
|
-
var styles$
|
|
3290
|
+
var styles$g = {
|
|
3292
3291
|
"block": "search-input-module__block___1uM-y",
|
|
3293
3292
|
"container": "search-input-module__container___9u6if",
|
|
3294
3293
|
"input-container": "search-input-module__input-container___mJnyZ",
|
|
@@ -3365,14 +3364,14 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3365
3364
|
key: "render",
|
|
3366
3365
|
value: function render() {
|
|
3367
3366
|
return jsx("div", {
|
|
3368
|
-
className: classnames(this.props.blockClassName, styles$
|
|
3367
|
+
className: classnames(this.props.blockClassName, styles$g.block),
|
|
3369
3368
|
children: jsxs("div", {
|
|
3370
|
-
className: classnames(this.props.containerClassName, styles$
|
|
3369
|
+
className: classnames(this.props.containerClassName, styles$g.container),
|
|
3371
3370
|
children: [jsx("div", {
|
|
3372
|
-
className: classnames(styles$
|
|
3373
|
-
[styles$
|
|
3374
|
-
[styles$
|
|
3375
|
-
[styles$
|
|
3371
|
+
className: classnames(styles$g['input-container'], {
|
|
3372
|
+
[styles$g['input-container-hoverable']]: !this.props.disabled,
|
|
3373
|
+
[styles$g['input-container-disabled']]: this.props.disabled && this.props.enableDisabledStyle,
|
|
3374
|
+
[styles$g['input-container-granular']]: this.props.isGranular
|
|
3376
3375
|
}),
|
|
3377
3376
|
children: jsx(ThrottledField, {
|
|
3378
3377
|
style: "primary",
|
|
@@ -3380,7 +3379,7 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3380
3379
|
"data-testid": this.props.testId || 'search-input',
|
|
3381
3380
|
value: this.state.text,
|
|
3382
3381
|
label: this.props.label,
|
|
3383
|
-
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$
|
|
3382
|
+
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$E.placeholder),
|
|
3384
3383
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3385
3384
|
onChange: this.handleInputChange,
|
|
3386
3385
|
onEnter: this.handleEnter,
|
|
@@ -3390,8 +3389,8 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3390
3389
|
isGranular: this.props.isGranular
|
|
3391
3390
|
})
|
|
3392
3391
|
}), this.state.text && jsx(SecondaryIconButton, {
|
|
3393
|
-
className: classnames(styles$
|
|
3394
|
-
[styles$
|
|
3392
|
+
className: classnames(styles$g['clear-icon-container'], {
|
|
3393
|
+
[styles$g['clear-icon-container-granular']]: this.props.isGranular
|
|
3395
3394
|
}),
|
|
3396
3395
|
icon: jsx(CloseIcon, {}),
|
|
3397
3396
|
size: "medium",
|
|
@@ -3399,16 +3398,16 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3399
3398
|
onClick: this.handleClear
|
|
3400
3399
|
}), jsx("div", {
|
|
3401
3400
|
"data-testid": "search-button",
|
|
3402
|
-
className: classnames(styles$
|
|
3403
|
-
[styles$
|
|
3404
|
-
[styles$
|
|
3401
|
+
className: classnames(styles$g['search-icon-container'], {
|
|
3402
|
+
[styles$g['search-icon-container-hoverable']]: !this.props.disabled,
|
|
3403
|
+
[styles$g['search-icon-container-granular']]: this.props.isGranular
|
|
3405
3404
|
}),
|
|
3406
3405
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
3407
3406
|
label: "search-button",
|
|
3408
3407
|
onMouseOver: this.props.handleMouseOver,
|
|
3409
3408
|
onMouseOut: this.props.handleMouseOut,
|
|
3410
3409
|
children: jsx(SearchIcon, {
|
|
3411
|
-
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' :
|
|
3410
|
+
color: this.props.iconColor || this.props.isMouseOver && !this.props.disabled ? 'primary' : 'neutral60',
|
|
3412
3411
|
size: "big"
|
|
3413
3412
|
})
|
|
3414
3413
|
})]
|
|
@@ -3436,7 +3435,7 @@ SearchInput.defaultProps = {
|
|
|
3436
3435
|
label: 'Search input',
|
|
3437
3436
|
onChange: () => null
|
|
3438
3437
|
};
|
|
3439
|
-
var searchInput = flowRight(keepDisplayName(SearchInput), withMouseOverState, injectIntl
|
|
3438
|
+
var searchInput = flowRight(keepDisplayName(SearchInput), withMouseOverState, injectIntl)(SearchInput);
|
|
3440
3439
|
|
|
3441
3440
|
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 } } } };
|
|
3442
3441
|
const useExecuteGraphQLRequest = () => {
|
|
@@ -3595,7 +3594,7 @@ const useProductTypeOptions = _ref3 => {
|
|
|
3595
3594
|
};
|
|
3596
3595
|
};
|
|
3597
3596
|
|
|
3598
|
-
var messages$
|
|
3597
|
+
var messages$D = defineMessages({
|
|
3599
3598
|
bottomOption: {
|
|
3600
3599
|
id: 'Products.Pickers.bottomOption',
|
|
3601
3600
|
description: 'The message to display at the end of the options menu',
|
|
@@ -3603,11 +3602,11 @@ var messages$E = defineMessages({
|
|
|
3603
3602
|
}
|
|
3604
3603
|
});
|
|
3605
3604
|
|
|
3606
|
-
function ownKeys$
|
|
3607
|
-
function _objectSpread$
|
|
3605
|
+
function ownKeys$11(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; }
|
|
3606
|
+
function _objectSpread$11(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$11(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$11(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3608
3607
|
const getBottomOption = () => ({
|
|
3609
3608
|
options: [{
|
|
3610
|
-
label: messages$
|
|
3609
|
+
label: messages$D.bottomOption,
|
|
3611
3610
|
isBottomOption: true,
|
|
3612
3611
|
isDisabled: true
|
|
3613
3612
|
}]
|
|
@@ -3615,7 +3614,7 @@ const getBottomOption = () => ({
|
|
|
3615
3614
|
const Option$2 = props => {
|
|
3616
3615
|
const _useIntl = useIntl(),
|
|
3617
3616
|
formatMessage = _useIntl.formatMessage;
|
|
3618
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
3617
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$11(_objectSpread$11({}, props), {}, {
|
|
3619
3618
|
children: props.data.isBottomOption ? jsx(Text.Detail, {
|
|
3620
3619
|
tone: "secondary",
|
|
3621
3620
|
children: formatMessage(props.data.label)
|
|
@@ -3632,8 +3631,8 @@ const Option$2 = props => {
|
|
|
3632
3631
|
};
|
|
3633
3632
|
Option$2.displayName = 'Option';
|
|
3634
3633
|
|
|
3635
|
-
function ownKeys$
|
|
3636
|
-
function _objectSpread$
|
|
3634
|
+
function ownKeys$10(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; }
|
|
3635
|
+
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$10(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$10(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3637
3636
|
const useHandlers = onChange => {
|
|
3638
3637
|
const _useState = useState(),
|
|
3639
3638
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3644,8 +3643,8 @@ const useHandlers = onChange => {
|
|
|
3644
3643
|
}, []);
|
|
3645
3644
|
const handleChange = useEventCallback(event => {
|
|
3646
3645
|
var _event$target$value;
|
|
3647
|
-
const eventWithExtractedValue = _objectSpread$
|
|
3648
|
-
target: _objectSpread$
|
|
3646
|
+
const eventWithExtractedValue = _objectSpread$10(_objectSpread$10({}, event), {}, {
|
|
3647
|
+
target: _objectSpread$10(_objectSpread$10({}, event.target), {}, {
|
|
3649
3648
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3650
3649
|
})
|
|
3651
3650
|
});
|
|
@@ -3654,8 +3653,8 @@ const useHandlers = onChange => {
|
|
|
3654
3653
|
return [handleInputChange, handleChange];
|
|
3655
3654
|
};
|
|
3656
3655
|
|
|
3657
|
-
function ownKeys
|
|
3658
|
-
function _objectSpread
|
|
3656
|
+
function ownKeys$$(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; }
|
|
3657
|
+
function _objectSpread$$(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$$(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$$(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3659
3658
|
const constructPrefixSearchPredicate = function () {
|
|
3660
3659
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3661
3660
|
let lowerBound = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -3698,7 +3697,7 @@ const useLoadOptions = _ref => {
|
|
|
3698
3697
|
}();
|
|
3699
3698
|
return client.query({
|
|
3700
3699
|
query,
|
|
3701
|
-
variables: _objectSpread
|
|
3700
|
+
variables: _objectSpread$$({
|
|
3702
3701
|
where
|
|
3703
3702
|
}, variables),
|
|
3704
3703
|
context: {
|
|
@@ -3752,7 +3751,7 @@ function useCurrentOption(_ref) {
|
|
|
3752
3751
|
};
|
|
3753
3752
|
}
|
|
3754
3753
|
|
|
3755
|
-
var messages$
|
|
3754
|
+
var messages$C = defineMessages({
|
|
3756
3755
|
noProductTypesFound: {
|
|
3757
3756
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
3758
3757
|
description: 'The message to display when no product types were found',
|
|
@@ -3842,7 +3841,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3842
3841
|
children: jsx(AsyncSelectInput, {
|
|
3843
3842
|
id: name,
|
|
3844
3843
|
name: name,
|
|
3845
|
-
placeholder: formatMessage(messages$
|
|
3844
|
+
placeholder: formatMessage(messages$C.placeholder),
|
|
3846
3845
|
loadOptions: loadOptionsDebounced,
|
|
3847
3846
|
defaultOptions: [],
|
|
3848
3847
|
isClearable: isClearable,
|
|
@@ -3855,7 +3854,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3855
3854
|
onInputChange: handleInputChange,
|
|
3856
3855
|
onBlur: onBlur,
|
|
3857
3856
|
value: currentOption.data,
|
|
3858
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
3857
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$C.noProductTypesFound),
|
|
3859
3858
|
hasError: hasError || isLoadingFailed
|
|
3860
3859
|
})
|
|
3861
3860
|
}), isLoadingFailed && jsx(Text.Body, {
|
|
@@ -3867,7 +3866,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3867
3866
|
};
|
|
3868
3867
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
3869
3868
|
|
|
3870
|
-
var messages$
|
|
3869
|
+
var messages$B = defineMessages({
|
|
3871
3870
|
noStatesFound: {
|
|
3872
3871
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
3873
3872
|
description: 'The message to display when no states were found',
|
|
@@ -3951,7 +3950,7 @@ const StatePickerInput = _ref => {
|
|
|
3951
3950
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
3952
3951
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
3953
3952
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
3954
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
3953
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$B.noStatesFound), [loadingError, formatMessage]);
|
|
3955
3954
|
const 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 : '';
|
|
3956
3955
|
return jsx(Constraints.Horizontal, {
|
|
3957
3956
|
max: "scale",
|
|
@@ -3963,7 +3962,7 @@ const StatePickerInput = _ref => {
|
|
|
3963
3962
|
id: name,
|
|
3964
3963
|
name: name,
|
|
3965
3964
|
horizontalConstraint: "scale",
|
|
3966
|
-
placeholder: formatMessage(messages$
|
|
3965
|
+
placeholder: formatMessage(messages$B.placeholder),
|
|
3967
3966
|
loadOptions: loadOptionsDebounced,
|
|
3968
3967
|
defaultOptions: true,
|
|
3969
3968
|
showOptionGroupDivider: true,
|
|
@@ -3989,9 +3988,9 @@ const StatePickerInput = _ref => {
|
|
|
3989
3988
|
};
|
|
3990
3989
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
3991
3990
|
|
|
3992
|
-
function ownKeys$
|
|
3993
|
-
function _objectSpread$
|
|
3994
|
-
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$
|
|
3991
|
+
function ownKeys$_(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; }
|
|
3992
|
+
function _objectSpread$_(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$_(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$_(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3993
|
+
const TooltipWrapper = /*#__PURE__*/React.forwardRef((props, ref) => jsx("div", _objectSpread$_({
|
|
3995
3994
|
ref: ref,
|
|
3996
3995
|
style: {
|
|
3997
3996
|
display: 'block',
|
|
@@ -4129,8 +4128,8 @@ const getPrefixSearchBounds = input => {
|
|
|
4129
4128
|
};
|
|
4130
4129
|
|
|
4131
4130
|
const _excluded = ["action"];
|
|
4132
|
-
function ownKeys
|
|
4133
|
-
function _objectSpread
|
|
4131
|
+
function ownKeys$Z(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; }
|
|
4132
|
+
function _objectSpread$Z(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys$Z(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys$Z(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4134
4133
|
|
|
4135
4134
|
/**
|
|
4136
4135
|
* Checks if a value is a LocalizedString
|
|
@@ -4152,7 +4151,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4152
4151
|
*/
|
|
4153
4152
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4154
4153
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4155
|
-
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread
|
|
4154
|
+
return _reduceInstanceProperty(customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$Z(_objectSpread$Z({}, customFields), {}, {
|
|
4156
4155
|
[customField.name]: customField.value
|
|
4157
4156
|
}), {});
|
|
4158
4157
|
};
|
|
@@ -4176,7 +4175,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4176
4175
|
const transformedData = applyTransformedLocalizedFields(category, transformationOptions);
|
|
4177
4176
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4178
4177
|
const ancestors = category.ancestors ? _mapInstanceProperty(_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4179
|
-
return _objectSpread
|
|
4178
|
+
return _objectSpread$Z(_objectSpread$Z(_objectSpread$Z({}, transformedData), parent ? {
|
|
4180
4179
|
parent
|
|
4181
4180
|
} : {}), ancestors ? {
|
|
4182
4181
|
ancestors
|
|
@@ -4390,7 +4389,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4390
4389
|
case 'addAttributeDefinition':
|
|
4391
4390
|
return {
|
|
4392
4391
|
[actionName]: {
|
|
4393
|
-
attributeDefinition: _objectSpread
|
|
4392
|
+
attributeDefinition: _objectSpread$Z(_objectSpread$Z({}, actionPayload.attribute), {}, {
|
|
4394
4393
|
label: transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4395
4394
|
inputTip: transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4396
4395
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4486,7 +4485,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4486
4485
|
return {
|
|
4487
4486
|
[actionName]: {
|
|
4488
4487
|
attributeName: actionPayload.attributeName,
|
|
4489
|
-
value: _objectSpread
|
|
4488
|
+
value: _objectSpread$Z(_objectSpread$Z({}, actionPayload.value), {}, {
|
|
4490
4489
|
label: transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4491
4490
|
})
|
|
4492
4491
|
}
|
|
@@ -4495,7 +4494,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4495
4494
|
return {
|
|
4496
4495
|
[actionName]: {
|
|
4497
4496
|
attributeName: actionPayload.attributeName,
|
|
4498
|
-
newValue: _objectSpread
|
|
4497
|
+
newValue: _objectSpread$Z(_objectSpread$Z({}, actionPayload.newValue), {}, {
|
|
4499
4498
|
label: transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4500
4499
|
})
|
|
4501
4500
|
}
|
|
@@ -4522,7 +4521,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4522
4521
|
name: transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4523
4522
|
taxCategory: actionPayload.taxCategory,
|
|
4524
4523
|
money: {
|
|
4525
|
-
[actionPayload.money.type]: _objectSpread
|
|
4524
|
+
[actionPayload.money.type]: _objectSpread$Z({
|
|
4526
4525
|
centAmount: actionPayload.money.centAmount,
|
|
4527
4526
|
currencyCode: actionPayload.money.currencyCode
|
|
4528
4527
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4577,8 +4576,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4577
4576
|
fields: customFields
|
|
4578
4577
|
} : null;
|
|
4579
4578
|
return {
|
|
4580
|
-
[actionName]: _objectSpread
|
|
4581
|
-
address: _objectSpread
|
|
4579
|
+
[actionName]: _objectSpread$Z(_objectSpread$Z({}, actionPayload), {}, {
|
|
4580
|
+
address: _objectSpread$Z(_objectSpread$Z({}, omit(actionPayload.address, ['__typename'])), {}, {
|
|
4582
4581
|
custom
|
|
4583
4582
|
})
|
|
4584
4583
|
})
|
|
@@ -4654,8 +4653,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4654
4653
|
return originalOmitDeep(obj, fieldsToOmit);
|
|
4655
4654
|
}
|
|
4656
4655
|
|
|
4657
|
-
function ownKeys$
|
|
4658
|
-
function _objectSpread$
|
|
4656
|
+
function ownKeys$Y(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; }
|
|
4657
|
+
function _objectSpread$Y(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$Y(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$Y(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4659
4658
|
function getPriceChannelName(price) {
|
|
4660
4659
|
var _ref, _price$channel$name, _price$channel, _price$channel2;
|
|
4661
4660
|
return (_ref = (_price$channel$name = (_price$channel = price.channel) === null || _price$channel === void 0 ? void 0 : _price$channel.name) !== null && _price$channel$name !== void 0 ? _price$channel$name : (_price$channel2 = price.channel) === null || _price$channel2 === void 0 ? void 0 : _price$channel2.key) !== null && _ref !== void 0 ? _ref : null;
|
|
@@ -4669,11 +4668,11 @@ function getDiscountValue(price) {
|
|
|
4669
4668
|
} else if (((_price$value2 = price.value) === null || _price$value2 === void 0 ? void 0 : _price$value2.type) === PRECISION_TYPES.highPrecision && ((_price$discounted = price.discounted) === null || _price$discounted === void 0 ? void 0 : (_price$discounted$val = _price$discounted.value) === null || _price$discounted$val === void 0 ? void 0 : _price$discounted$val.type) === PRECISION_TYPES.centPrecision) {
|
|
4670
4669
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4671
4670
|
}
|
|
4672
|
-
return price.discounted ? _objectSpread$
|
|
4671
|
+
return price.discounted ? _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4673
4672
|
fractionedAmount,
|
|
4674
4673
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4675
4674
|
preciseAmount
|
|
4676
|
-
}) : _objectSpread$
|
|
4675
|
+
}) : _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4677
4676
|
centAmount: 0
|
|
4678
4677
|
});
|
|
4679
4678
|
}
|
|
@@ -4681,20 +4680,45 @@ function getSelectedPrice(price) {
|
|
|
4681
4680
|
return price.discounted ? price.discounted : price;
|
|
4682
4681
|
}
|
|
4683
4682
|
function getNetUnitPrice(_ref2) {
|
|
4683
|
+
var _lineItem$perMethodTa, _filteredPerMethodTax, _filteredPerMethodTax2;
|
|
4684
4684
|
let lineItem = _ref2.lineItem,
|
|
4685
4685
|
shouldRoundAmount = _ref2.shouldRoundAmount;
|
|
4686
4686
|
const price = getSelectedPrice(lineItem.price);
|
|
4687
|
-
|
|
4687
|
+
const filteredPerMethodTaxRate = lineItem === null || lineItem === void 0 ? void 0 : (_lineItem$perMethodTa = lineItem.perMethodTaxRate) === null || _lineItem$perMethodTa === void 0 ? void 0 : _filterInstanceProperty(_lineItem$perMethodTa).call(_lineItem$perMethodTa, perMethodTax => {
|
|
4688
|
+
var _lineItem$shippingDet, _lineItem$shippingDet2;
|
|
4689
|
+
return (lineItem === null || lineItem === void 0 ? void 0 : (_lineItem$shippingDet = lineItem.shippingDetails) === null || _lineItem$shippingDet === void 0 ? void 0 : (_lineItem$shippingDet2 = _lineItem$shippingDet.targets) === null || _lineItem$shippingDet2 === void 0 ? void 0 : _findIndexInstanceProperty(_lineItem$shippingDet2).call(_lineItem$shippingDet2, target => (target === null || target === void 0 ? void 0 : target.shippingMethodKey) === (perMethodTax === null || perMethodTax === void 0 ? void 0 : perMethodTax.shippingMethodKey))) >= 0;
|
|
4690
|
+
});
|
|
4691
|
+
|
|
4692
|
+
// when shipping mode is multi with the same tax rate
|
|
4693
|
+
if ((filteredPerMethodTaxRate === null || filteredPerMethodTaxRate === void 0 ? void 0 : filteredPerMethodTaxRate.length) > 0 && (_filteredPerMethodTax = filteredPerMethodTaxRate[0]) !== null && _filteredPerMethodTax !== void 0 && (_filteredPerMethodTax2 = _filteredPerMethodTax.taxRate) !== null && _filteredPerMethodTax2 !== void 0 && _filteredPerMethodTax2.includedInPrice) {
|
|
4688
4694
|
var _price$value3, _price$value4;
|
|
4695
|
+
const taxRate = filteredPerMethodTaxRate[0].taxRate;
|
|
4689
4696
|
let centAmount;
|
|
4690
4697
|
// should accept 0 value
|
|
4691
4698
|
if (typeof ((_price$value3 = price.value) === null || _price$value3 === void 0 ? void 0 : _price$value3.centAmount) === 'number') {
|
|
4699
|
+
const amount = price.value.centAmount / (1 + taxRate.amount);
|
|
4700
|
+
centAmount = shouldRoundAmount ? Math.round(amount) : amount;
|
|
4701
|
+
}
|
|
4702
|
+
let preciseAmount;
|
|
4703
|
+
if (((_price$value4 = price.value) === null || _price$value4 === void 0 ? void 0 : _price$value4.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4704
|
+
return _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4705
|
+
centAmount,
|
|
4706
|
+
preciseAmount
|
|
4707
|
+
});
|
|
4708
|
+
}
|
|
4709
|
+
|
|
4710
|
+
// when shipping mode is single
|
|
4711
|
+
if (lineItem.taxRate && lineItem.taxRate.includedInPrice) {
|
|
4712
|
+
var _price$value5, _price$value6;
|
|
4713
|
+
let centAmount;
|
|
4714
|
+
// should accept 0 value
|
|
4715
|
+
if (typeof ((_price$value5 = price.value) === null || _price$value5 === void 0 ? void 0 : _price$value5.centAmount) === 'number') {
|
|
4692
4716
|
const amount = price.value.centAmount / (1 + lineItem.taxRate.amount);
|
|
4693
4717
|
centAmount = shouldRoundAmount ? Math.round(amount) : amount;
|
|
4694
4718
|
}
|
|
4695
4719
|
let preciseAmount;
|
|
4696
|
-
if (((_price$
|
|
4697
|
-
return _objectSpread$
|
|
4720
|
+
if (((_price$value6 = price.value) === null || _price$value6 === void 0 ? void 0 : _price$value6.type) === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4721
|
+
return _objectSpread$Y(_objectSpread$Y({}, price.value), {}, {
|
|
4698
4722
|
centAmount,
|
|
4699
4723
|
preciseAmount
|
|
4700
4724
|
});
|
|
@@ -4706,7 +4730,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4706
4730
|
const currencyCode = price.value.currencyCode;
|
|
4707
4731
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4708
4732
|
if (currencyCode && !isNil$1(fractionedAmount)) {
|
|
4709
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4733
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$Y(_objectSpread$Y({}, minPrices), {}, {
|
|
4710
4734
|
[currencyCode]: price.value
|
|
4711
4735
|
});
|
|
4712
4736
|
}
|
|
@@ -4715,8 +4739,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4715
4739
|
return _Object$values(minPricesByCurrency);
|
|
4716
4740
|
}
|
|
4717
4741
|
|
|
4718
|
-
function ownKeys$
|
|
4719
|
-
function _objectSpread$
|
|
4742
|
+
function ownKeys$X(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; }
|
|
4743
|
+
function _objectSpread$X(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$X(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$X(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4720
4744
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4721
4745
|
var _context, _context4;
|
|
4722
4746
|
return {
|
|
@@ -4731,14 +4755,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4731
4755
|
return {
|
|
4732
4756
|
name: fieldDefinition.name,
|
|
4733
4757
|
required: fieldDefinition.required,
|
|
4734
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4735
|
-
elementType: _objectSpread$
|
|
4758
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
4759
|
+
elementType: _objectSpread$X(_objectSpread$X({}, fieldDefinition.type.elementType), {}, {
|
|
4736
4760
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4737
4761
|
key: value.key,
|
|
4738
4762
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4739
4763
|
}))
|
|
4740
4764
|
})
|
|
4741
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4765
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$X(_objectSpread$X({}, fieldDefinition.type), {}, {
|
|
4742
4766
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
4743
4767
|
key: value.key,
|
|
4744
4768
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4749,7 +4773,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4749
4773
|
})
|
|
4750
4774
|
}
|
|
4751
4775
|
},
|
|
4752
|
-
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4776
|
+
fields: _reduceInstanceProperty(_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$X(_objectSpread$X({}, fields), {}, {
|
|
4753
4777
|
[customField.name]: customField.value
|
|
4754
4778
|
}), {})
|
|
4755
4779
|
};
|
|
@@ -4761,7 +4785,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4761
4785
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4762
4786
|
// in either case we return null
|
|
4763
4787
|
if (!productSelection) return null;
|
|
4764
|
-
return _objectSpread$
|
|
4788
|
+
return _objectSpread$X(_objectSpread$X({}, applyTransformedLocalizedFields(productSelection, [{
|
|
4765
4789
|
from: 'nameAllLocales',
|
|
4766
4790
|
to: 'name'
|
|
4767
4791
|
}])), {}, {
|
|
@@ -4784,8 +4808,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4784
4808
|
return _mapInstanceProperty(_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4785
4809
|
};
|
|
4786
4810
|
|
|
4787
|
-
function ownKeys$
|
|
4788
|
-
function _objectSpread$
|
|
4811
|
+
function ownKeys$W(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; }
|
|
4812
|
+
function _objectSpread$W(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$W(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$W(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4789
4813
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4790
4814
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4791
4815
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4802,7 +4826,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4802
4826
|
if (updateAction.action === 'setCustomField' && _Array$isArray(updateAction.value)) {
|
|
4803
4827
|
const definition = _findInstanceProperty(fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4804
4828
|
const definitionName = definition.type.elementType.name;
|
|
4805
|
-
return _objectSpread$
|
|
4829
|
+
return _objectSpread$W(_objectSpread$W({}, updateAction), {}, {
|
|
4806
4830
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4807
4831
|
});
|
|
4808
4832
|
}
|
|
@@ -4876,8 +4900,8 @@ function omitSetsOfSets() {
|
|
|
4876
4900
|
|
|
4877
4901
|
var GetProductTypesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductTypesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productTypes" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query GetProductTypesQuery($where: String) {\n productTypes(where: $where) {\n results {\n id\n name\n }\n }\n}\n\nquery GetProductTypeQuery($id: String) {\n productType(id: $id) {\n id\n name\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
4878
4902
|
|
|
4879
|
-
function ownKeys$
|
|
4880
|
-
function _objectSpread$
|
|
4903
|
+
function ownKeys$V(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; }
|
|
4904
|
+
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$V(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$V(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4881
4905
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
4882
4906
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4883
4907
|
var FetchTypeDefinitionsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchTypeDefinitionsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "fieldDefinitions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizedEnumType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1172, source: { body: "query FetchTypeDefinitionsQuery($where: String, $limit: Int, $offset: Int) {\n typeDefinitions(where: $where, limit: $limit, offset: $offset) {\n results {\n fieldDefinitions {\n type {\n name\n ... on SetType {\n elementType {\n name\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n }\n ... on EnumType {\n values {\n key\n label\n }\n }\n ... on LocalizedEnumType {\n values {\n key\n labelAllLocales {\n value\n locale\n }\n }\n }\n ... on ReferenceType {\n referenceTypeId\n }\n }\n name\n labelAllLocales {\n value\n locale\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -4937,7 +4961,7 @@ const mapDataToProps = _ref => {
|
|
|
4937
4961
|
return {
|
|
4938
4962
|
fetchTypeDefinitionsQuery: {
|
|
4939
4963
|
loading: fetchTypeDefinitionsQuery.loading,
|
|
4940
|
-
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$
|
|
4964
|
+
customFieldDefinitions: uniqBy(_mapInstanceProperty(fieldDefinitionsToOptionsMap).call(fieldDefinitionsToOptionsMap, fieldDefinition => _objectSpread$V({}, applyTransformedLocalizedFields(omitDeep(fieldDefinition, ['__typename'], {
|
|
4941
4965
|
isImmutable: true
|
|
4942
4966
|
}), [{
|
|
4943
4967
|
from: 'labelAllLocales',
|
|
@@ -4965,12 +4989,12 @@ const handlers$2 = {
|
|
|
4965
4989
|
}
|
|
4966
4990
|
};
|
|
4967
4991
|
|
|
4968
|
-
function ownKeys$
|
|
4969
|
-
function _objectSpread$
|
|
4992
|
+
function ownKeys$U(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; }
|
|
4993
|
+
function _objectSpread$U(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$U(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$U(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4970
4994
|
const restDocToForm = customFieldsFromRestResponse => {
|
|
4971
4995
|
return {
|
|
4972
4996
|
fields: customFieldsFromRestResponse.fields,
|
|
4973
|
-
type: _objectSpread$
|
|
4997
|
+
type: _objectSpread$U({
|
|
4974
4998
|
id: customFieldsFromRestResponse.type.id
|
|
4975
4999
|
}, customFieldsFromRestResponse.type.obj)
|
|
4976
5000
|
};
|
|
@@ -4989,14 +5013,14 @@ const graphQlDocToForm = typeDefinition => {
|
|
|
4989
5013
|
name: fieldDefinition.name,
|
|
4990
5014
|
required: fieldDefinition.required,
|
|
4991
5015
|
inputHint: fieldDefinition.inputHint,
|
|
4992
|
-
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$
|
|
4993
|
-
elementType: _objectSpread$
|
|
5016
|
+
type: ((_fieldDefinition$type = fieldDefinition.type) === null || _fieldDefinition$type === void 0 ? void 0 : (_fieldDefinition$type2 = _fieldDefinition$type.elementType) === null || _fieldDefinition$type2 === void 0 ? void 0 : _fieldDefinition$type2.name) === 'LocalizedEnum' ? _objectSpread$U(_objectSpread$U({}, fieldDefinition.type), {}, {
|
|
5017
|
+
elementType: _objectSpread$U(_objectSpread$U({}, fieldDefinition.type.elementType), {}, {
|
|
4994
5018
|
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4995
5019
|
key: value.key,
|
|
4996
5020
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4997
5021
|
}))
|
|
4998
5022
|
})
|
|
4999
|
-
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$
|
|
5023
|
+
}) : ((_fieldDefinition$type3 = fieldDefinition.type) === null || _fieldDefinition$type3 === void 0 ? void 0 : _fieldDefinition$type3.name) === 'LocalizedEnum' ? _objectSpread$U(_objectSpread$U({}, fieldDefinition.type), {}, {
|
|
5000
5024
|
values: _mapInstanceProperty(_context3 = _valuesInstanceProperty(fieldDefinition.type)).call(_context3, value => ({
|
|
5001
5025
|
key: value.key,
|
|
5002
5026
|
label: transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -5012,7 +5036,7 @@ const formToRestDoc = formCustomFields => ({
|
|
|
5012
5036
|
type: {
|
|
5013
5037
|
id: formCustomFields.type.id,
|
|
5014
5038
|
typeId: 'type',
|
|
5015
|
-
obj: _objectSpread$
|
|
5039
|
+
obj: _objectSpread$U({}, formCustomFields.type)
|
|
5016
5040
|
},
|
|
5017
5041
|
fields: formCustomFields.fields
|
|
5018
5042
|
});
|
|
@@ -5020,7 +5044,7 @@ const formToGraphQlDoc = formCustomFields => ({
|
|
|
5020
5044
|
type: {
|
|
5021
5045
|
id: formCustomFields.type.id,
|
|
5022
5046
|
typeId: 'type',
|
|
5023
|
-
obj: _objectSpread$
|
|
5047
|
+
obj: _objectSpread$U({}, omit(formCustomFields.type, ['id']))
|
|
5024
5048
|
},
|
|
5025
5049
|
fields: omitBy(formCustomFields.fields || {}, isNil$1)
|
|
5026
5050
|
});
|
|
@@ -5151,8 +5175,8 @@ const REFERENCED_TYPES = {
|
|
|
5151
5175
|
zone: 'zone'
|
|
5152
5176
|
};
|
|
5153
5177
|
|
|
5154
|
-
function ownKeys$
|
|
5155
|
-
function _objectSpread$
|
|
5178
|
+
function ownKeys$T(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; }
|
|
5179
|
+
function _objectSpread$T(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$T(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$T(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5156
5180
|
const extractDuplicatedValues = (values, type, language, languages) => {
|
|
5157
5181
|
let validatedValues = [];
|
|
5158
5182
|
if (type.name.toLowerCase() === 'money') {
|
|
@@ -5219,8 +5243,8 @@ function validations (formValues, language, languages) {
|
|
|
5219
5243
|
var _context2;
|
|
5220
5244
|
// Collect all required and set type fields
|
|
5221
5245
|
const fieldDefinitionsToValidate = _filterInstanceProperty(_context2 = formValues.custom.type.fieldDefinitions).call(_context2, fieldDefinition => fieldDefinition.required || fieldDefinition.type.name.toLowerCase() === 'set');
|
|
5222
|
-
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$
|
|
5223
|
-
[fieldDefinition.name]: _objectSpread$
|
|
5246
|
+
const errors = _reduceInstanceProperty(fieldDefinitionsToValidate).call(fieldDefinitionsToValidate, (acc, fieldDefinition) => _objectSpread$T(_objectSpread$T({}, acc), {}, {
|
|
5247
|
+
[fieldDefinition.name]: _objectSpread$T(_objectSpread$T({}, setMissingIfRequired(formValues, fieldDefinition)), setDuplicatedIfSet(formValues, fieldDefinition, language, languages))
|
|
5224
5248
|
}), {});
|
|
5225
5249
|
return withoutEmptyErrorsByField(errors);
|
|
5226
5250
|
}
|
|
@@ -5247,8 +5271,8 @@ function CustomTextInput(props) {
|
|
|
5247
5271
|
}
|
|
5248
5272
|
CustomTextInput.displayName = 'CustomTextInput';
|
|
5249
5273
|
|
|
5250
|
-
function ownKeys$
|
|
5251
|
-
function _objectSpread$
|
|
5274
|
+
function ownKeys$S(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; }
|
|
5275
|
+
function _objectSpread$S(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$S(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$S(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5252
5276
|
const getSubfieldLanguage = subfieldName => {
|
|
5253
5277
|
const lastDotIndex = _lastIndexOfInstanceProperty(subfieldName).call(subfieldName, '.');
|
|
5254
5278
|
return subfieldName.substring(lastDotIndex + 1);
|
|
@@ -5272,7 +5296,7 @@ function CustomLocalizedTextInput(props) {
|
|
|
5272
5296
|
// as a whole.
|
|
5273
5297
|
|
|
5274
5298
|
const fieldLanguage = getSubfieldLanguage(subfieldName);
|
|
5275
|
-
const newValue = _objectSpread$
|
|
5299
|
+
const newValue = _objectSpread$S(_objectSpread$S({}, props.value), {}, {
|
|
5276
5300
|
[fieldLanguage]: rawValue
|
|
5277
5301
|
});
|
|
5278
5302
|
const nullifiedIfNeeded = LocalizedTextInput.isEmpty(newValue) ? undefined : newValue;
|
|
@@ -5339,21 +5363,21 @@ function CustomNumberInput(props) {
|
|
|
5339
5363
|
}
|
|
5340
5364
|
CustomNumberInput.displayName = 'CustomNumberInput';
|
|
5341
5365
|
|
|
5342
|
-
function ownKeys$
|
|
5343
|
-
function _objectSpread$
|
|
5344
|
-
var styles$
|
|
5366
|
+
function ownKeys$R(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; }
|
|
5367
|
+
function _objectSpread$R(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$R(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$R(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5368
|
+
var styles$f = {
|
|
5345
5369
|
"container": "custom-money-input-module__container___1fdO2"
|
|
5346
5370
|
};
|
|
5347
5371
|
const fixCurrencyCode = (value, currencies) => {
|
|
5348
5372
|
if (value.currencyCode) return value;
|
|
5349
5373
|
const firstCurrency = currencies[0];
|
|
5350
|
-
return _objectSpread$
|
|
5374
|
+
return _objectSpread$R(_objectSpread$R({}, value), {}, {
|
|
5351
5375
|
currencyCode: firstCurrency
|
|
5352
5376
|
});
|
|
5353
5377
|
};
|
|
5354
5378
|
const fixAmount = value => {
|
|
5355
5379
|
if (!value.amount) {
|
|
5356
|
-
return _objectSpread$
|
|
5380
|
+
return _objectSpread$R(_objectSpread$R({}, value), {}, {
|
|
5357
5381
|
amount: '0'
|
|
5358
5382
|
});
|
|
5359
5383
|
}
|
|
@@ -5395,7 +5419,7 @@ function CustomMoneyInput(props) {
|
|
|
5395
5419
|
}
|
|
5396
5420
|
const handleChange = makeChangeHandler((rawValue, subfieldName) => {
|
|
5397
5421
|
const isAmount = _endsWithInstanceProperty(subfieldName).call(subfieldName, 'amount');
|
|
5398
|
-
const newValue = _objectSpread$
|
|
5422
|
+
const newValue = _objectSpread$R({}, internalValue.current);
|
|
5399
5423
|
if (isAmount) newValue.amount = rawValue;else newValue.currencyCode = rawValue;
|
|
5400
5424
|
const fixedValue = fixEnteredValue(newValue, internalValue.current, currencies);
|
|
5401
5425
|
internalValue.current = fixedValue;
|
|
@@ -5405,7 +5429,7 @@ function CustomMoneyInput(props) {
|
|
|
5405
5429
|
|
|
5406
5430
|
// TODO(pa3): fix setting proper id in UIKit
|
|
5407
5431
|
return jsxs("div", {
|
|
5408
|
-
className: styles$
|
|
5432
|
+
className: styles$f.container,
|
|
5409
5433
|
"aria-labelledby": props.name,
|
|
5410
5434
|
children: [jsx(AccessibleHidden, {
|
|
5411
5435
|
children: jsx("label", {
|
|
@@ -5533,7 +5557,7 @@ function getCategoriesByIds(apolloClient, options) {
|
|
|
5533
5557
|
});
|
|
5534
5558
|
}
|
|
5535
5559
|
|
|
5536
|
-
var styles$
|
|
5560
|
+
var styles$e = {
|
|
5537
5561
|
"container": "reference-search-module__container___3-iK3",
|
|
5538
5562
|
"missing-label": "reference-search-module__missing-label___az9AO"
|
|
5539
5563
|
};
|
|
@@ -5643,9 +5667,9 @@ function ReferenceSearch(props) {
|
|
|
5643
5667
|
props.onChange(option);
|
|
5644
5668
|
};
|
|
5645
5669
|
return jsxs("div", {
|
|
5646
|
-
className: styles$
|
|
5670
|
+
className: styles$e.container,
|
|
5647
5671
|
children: [areSomeItemsMissing && jsx("div", {
|
|
5648
|
-
className: styles$
|
|
5672
|
+
className: styles$e['missing-label'],
|
|
5649
5673
|
children: props.referenceIsMissingLabel
|
|
5650
5674
|
}), jsx(CustomFieldTooltip, {
|
|
5651
5675
|
title: tooltipTitle,
|
|
@@ -5676,7 +5700,7 @@ function ReferenceSearch(props) {
|
|
|
5676
5700
|
});
|
|
5677
5701
|
}
|
|
5678
5702
|
|
|
5679
|
-
const messages$
|
|
5703
|
+
const messages$A = defineMessages({
|
|
5680
5704
|
placeholder: {
|
|
5681
5705
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5682
5706
|
description: 'Placeholder for search for a category',
|
|
@@ -5709,8 +5733,8 @@ const messages$B = defineMessages({
|
|
|
5709
5733
|
}
|
|
5710
5734
|
});
|
|
5711
5735
|
|
|
5712
|
-
function ownKeys$
|
|
5713
|
-
function _objectSpread$
|
|
5736
|
+
function ownKeys$Q(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; }
|
|
5737
|
+
function _objectSpread$Q(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$Q(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$Q(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5714
5738
|
function Option$1(props) {
|
|
5715
5739
|
var _context, _context2;
|
|
5716
5740
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
@@ -5722,7 +5746,7 @@ function Option$1(props) {
|
|
|
5722
5746
|
const _useIntl = useIntl(),
|
|
5723
5747
|
formatMessage = _useIntl.formatMessage;
|
|
5724
5748
|
const category = props.data;
|
|
5725
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5749
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$Q(_objectSpread$Q({}, props), {}, {
|
|
5726
5750
|
children: jsxs("div", {
|
|
5727
5751
|
"data-testid": "category-option",
|
|
5728
5752
|
children: [jsx(Text.Body, {
|
|
@@ -5733,7 +5757,7 @@ function Option$1(props) {
|
|
|
5733
5757
|
fallbackOrder: languages
|
|
5734
5758
|
})
|
|
5735
5759
|
}), category.parent && jsx(Text.Detail, {
|
|
5736
|
-
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$
|
|
5760
|
+
children: _concatInstanceProperty(_context = "".concat(formatMessage(messages$A.parentCategory), ": ")).call(_context, formatLocalizedString(category.parent, {
|
|
5737
5761
|
key: 'name',
|
|
5738
5762
|
locale: language,
|
|
5739
5763
|
fallbackOrder: languages
|
|
@@ -5745,14 +5769,14 @@ function Option$1(props) {
|
|
|
5745
5769
|
fallbackOrder: languages
|
|
5746
5770
|
}))
|
|
5747
5771
|
}), category.externalId && jsx(Text.Detail, {
|
|
5748
|
-
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$
|
|
5772
|
+
children: _concatInstanceProperty(_context2 = "".concat(formatMessage(messages$A.externalId), ": ")).call(_context2, category.externalId || NO_VALUE_FALLBACK)
|
|
5749
5773
|
})]
|
|
5750
5774
|
})
|
|
5751
5775
|
}));
|
|
5752
5776
|
}
|
|
5753
5777
|
|
|
5754
|
-
function ownKeys$
|
|
5755
|
-
function _objectSpread$
|
|
5778
|
+
function ownKeys$P(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; }
|
|
5779
|
+
function _objectSpread$P(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$P(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$P(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5756
5780
|
const filterOption$1 = () => true;
|
|
5757
5781
|
function CategoryReferenceSearch(props) {
|
|
5758
5782
|
const _useIntl = useIntl(),
|
|
@@ -5764,7 +5788,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5764
5788
|
})),
|
|
5765
5789
|
language = _useApplicationContex.language,
|
|
5766
5790
|
languages = _useApplicationContex.languages;
|
|
5767
|
-
const mapItemToOption = useCallback(category => _objectSpread$
|
|
5791
|
+
const mapItemToOption = useCallback(category => _objectSpread$P(_objectSpread$P({}, category), {}, {
|
|
5768
5792
|
value: category.id,
|
|
5769
5793
|
label: formatLocalizedString(category, {
|
|
5770
5794
|
key: 'name',
|
|
@@ -5782,7 +5806,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5782
5806
|
}), [apolloClient]);
|
|
5783
5807
|
return jsx(ReferenceSearch, {
|
|
5784
5808
|
id: props.id,
|
|
5785
|
-
components: _objectSpread$
|
|
5809
|
+
components: _objectSpread$P({
|
|
5786
5810
|
Option: Option$1
|
|
5787
5811
|
}, props.components),
|
|
5788
5812
|
isClearable: props.isClearable,
|
|
@@ -5793,10 +5817,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5793
5817
|
onBlur: props.onBlur,
|
|
5794
5818
|
onChange: props.onChange,
|
|
5795
5819
|
value: props.value,
|
|
5796
|
-
placeholderLabel: formatMessage(messages$
|
|
5797
|
-
searchPromptLabel: formatMessage(messages$
|
|
5798
|
-
noResultsLabel: formatMessage(messages$
|
|
5799
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5820
|
+
placeholderLabel: formatMessage(messages$A.placeholder),
|
|
5821
|
+
searchPromptLabel: formatMessage(messages$A.searchPrompt),
|
|
5822
|
+
noResultsLabel: formatMessage(messages$A.noResults),
|
|
5823
|
+
referenceIsMissingLabel: formatMessage(messages$A.isMissing),
|
|
5800
5824
|
mapItemToOption: mapItemToOption,
|
|
5801
5825
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5802
5826
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5872,7 +5896,7 @@ function getCartDiscountById(apolloClient, options) {
|
|
|
5872
5896
|
});
|
|
5873
5897
|
}
|
|
5874
5898
|
|
|
5875
|
-
const messages$
|
|
5899
|
+
const messages$z = defineMessages({
|
|
5876
5900
|
placeholder: {
|
|
5877
5901
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5878
5902
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5900,8 +5924,8 @@ const messages$A = defineMessages({
|
|
|
5900
5924
|
}
|
|
5901
5925
|
});
|
|
5902
5926
|
|
|
5903
|
-
function ownKeys$
|
|
5904
|
-
function _objectSpread$
|
|
5927
|
+
function ownKeys$O(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; }
|
|
5928
|
+
function _objectSpread$O(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$O(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$O(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5905
5929
|
function Option(props) {
|
|
5906
5930
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
5907
5931
|
language: applicationContext.dataLocale,
|
|
@@ -5912,7 +5936,7 @@ function Option(props) {
|
|
|
5912
5936
|
const _useIntl = useIntl(),
|
|
5913
5937
|
formatMessage = _useIntl.formatMessage;
|
|
5914
5938
|
const cartDiscount = props.data;
|
|
5915
|
-
return jsx(AsyncSelectInput.Option, _objectSpread$
|
|
5939
|
+
return jsx(AsyncSelectInput.Option, _objectSpread$O(_objectSpread$O({}, props), {}, {
|
|
5916
5940
|
children: jsxs("div", {
|
|
5917
5941
|
"data-testid": "cart-discount-option",
|
|
5918
5942
|
children: [jsx(Text.Detail, {
|
|
@@ -5923,14 +5947,14 @@ function Option(props) {
|
|
|
5923
5947
|
fallbackOrder: languages
|
|
5924
5948
|
})
|
|
5925
5949
|
}), jsxs(Text.Detail, {
|
|
5926
|
-
children: [formatMessage(messages$
|
|
5950
|
+
children: [formatMessage(messages$z.key), ": ", cartDiscount.key || NO_VALUE_FALLBACK]
|
|
5927
5951
|
})]
|
|
5928
5952
|
})
|
|
5929
5953
|
}));
|
|
5930
5954
|
}
|
|
5931
5955
|
|
|
5932
|
-
function ownKeys$
|
|
5933
|
-
function _objectSpread$
|
|
5956
|
+
function ownKeys$N(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; }
|
|
5957
|
+
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$N(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$N(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5934
5958
|
var CartDiscountsCount$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 425, source: { body: "query SearchCartDiscount($where: String) {\n cartDiscounts(limit: 500, where: $where) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n\nquery FetchCartDiscountById($cartDiscountId: String!) {\n cartDiscount(id: $cartDiscountId) {\n id\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
5935
5959
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
5936
5960
|
const filterOption = (option, text) => {
|
|
@@ -5956,7 +5980,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5956
5980
|
})),
|
|
5957
5981
|
language = _useApplicationContex.language,
|
|
5958
5982
|
languages = _useApplicationContex.languages;
|
|
5959
|
-
const mapItemToOption = useCallback(cartDiscount => _objectSpread$
|
|
5983
|
+
const mapItemToOption = useCallback(cartDiscount => _objectSpread$N(_objectSpread$N({}, cartDiscount), {}, {
|
|
5960
5984
|
value: cartDiscount.id,
|
|
5961
5985
|
key: cartDiscount.key,
|
|
5962
5986
|
label: formatLocalizedString(cartDiscount, {
|
|
@@ -5999,10 +6023,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5999
6023
|
onBlur: props.onBlur,
|
|
6000
6024
|
onChange: props.onChange,
|
|
6001
6025
|
value: returnNullIfEmpty(props.value),
|
|
6002
|
-
placeholderLabel: formatMessage(messages$
|
|
6003
|
-
searchPromptLabel: formatMessage(messages$
|
|
6004
|
-
noResultsLabel: formatMessage(messages$
|
|
6005
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
6026
|
+
placeholderLabel: formatMessage(messages$z.placeholder),
|
|
6027
|
+
searchPromptLabel: formatMessage(messages$z.searchPrompt),
|
|
6028
|
+
noResultsLabel: formatMessage(messages$z.noResults),
|
|
6029
|
+
referenceIsMissingLabel: formatMessage(messages$z.isMissing),
|
|
6006
6030
|
mapItemToOption: mapItemToOption,
|
|
6007
6031
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
6008
6032
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -6063,7 +6087,7 @@ function CustomCartDiscountReferenceInput(props) {
|
|
|
6063
6087
|
});
|
|
6064
6088
|
}
|
|
6065
6089
|
|
|
6066
|
-
var messages$
|
|
6090
|
+
var messages$y = defineMessages({
|
|
6067
6091
|
noProductsFound: {
|
|
6068
6092
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
6069
6093
|
description: 'The message to display when no products were found',
|
|
@@ -6162,7 +6186,7 @@ const ProductPickerInput = _ref => {
|
|
|
6162
6186
|
children: jsx(AsyncSelectInput, {
|
|
6163
6187
|
id: name,
|
|
6164
6188
|
name: name,
|
|
6165
|
-
placeholder: formatMessage(messages$
|
|
6189
|
+
placeholder: formatMessage(messages$y.placeholder),
|
|
6166
6190
|
loadOptions: loadOptionsDebounced,
|
|
6167
6191
|
defaultOptions: [],
|
|
6168
6192
|
isClearable: isClearable,
|
|
@@ -6176,7 +6200,7 @@ const ProductPickerInput = _ref => {
|
|
|
6176
6200
|
onInputChange: handleInputChange,
|
|
6177
6201
|
onBlur: onBlur,
|
|
6178
6202
|
value: currentOption.data,
|
|
6179
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
6203
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$y.noProductsFound),
|
|
6180
6204
|
hasError: hasError || isLoadingFailed
|
|
6181
6205
|
})
|
|
6182
6206
|
}), isLoadingFailed && showLoadingErrorMessage && jsx(Text.Body, {
|
|
@@ -6426,630 +6450,44 @@ function CustomBooleanInputSet(props) {
|
|
|
6426
6450
|
}
|
|
6427
6451
|
CustomBooleanInputSet.displayName = 'CustomBooleanInputSet';
|
|
6428
6452
|
|
|
6429
|
-
var
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6453
|
+
function ownKeys$M(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; }
|
|
6454
|
+
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$M(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$M(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6455
|
+
const getTypeName = type => type.name.toLowerCase();
|
|
6456
|
+
const findLabel = (enumType, key) => {
|
|
6457
|
+
var _enumType$values$find, _enumType$values$find2, _context;
|
|
6458
|
+
const emptyValue = getTypeName(enumType) === 'enum' ? '' : {};
|
|
6459
|
+
return (_enumType$values$find = (_enumType$values$find2 = _findInstanceProperty(_context = _valuesInstanceProperty(enumType)).call(_context, value => value.key === key)) === null || _enumType$values$find2 === void 0 ? void 0 : _enumType$values$find2.label) !== null && _enumType$values$find !== void 0 ? _enumType$values$find : emptyValue;
|
|
6435
6460
|
};
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
[styles$e.size_s]: size === 's',
|
|
6445
|
-
[styles$e.size_m]: size === 'm'
|
|
6446
|
-
})
|
|
6447
|
-
});
|
|
6448
|
-
}
|
|
6449
|
-
Divider.displayName = 'Divider';
|
|
6450
|
-
|
|
6451
|
-
const ExpandButton = props => props.totalValues > 1 ? jsxs(Spacings.Stack, {
|
|
6452
|
-
scale: "s",
|
|
6453
|
-
alignItems: "center",
|
|
6454
|
-
children: [jsx(Constraints.Horizontal, {
|
|
6455
|
-
children: jsx(Divider, {})
|
|
6456
|
-
}), jsx(FlatButton, {
|
|
6457
|
-
tone: "primary",
|
|
6458
|
-
icon: props.isExpanded ? jsx(AngleUpIcon, {}) : jsx(AngleDownIcon, {}),
|
|
6459
|
-
label: props.isExpanded ? "Hide set items (".concat(props.totalValues, ")") : "Show all set items (".concat(props.totalValues, ")"),
|
|
6460
|
-
onClick: props.onExpand
|
|
6461
|
-
})]
|
|
6462
|
-
}) : null;
|
|
6463
|
-
ExpandButton.displayName = 'ExpandButton';
|
|
6464
|
-
|
|
6465
|
-
// @redesign cleanup
|
|
6466
|
-
var styles$d = {
|
|
6467
|
-
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6468
|
-
"gap": "set-buttons-module__gap___38Qr0"
|
|
6469
|
-
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
6470
|
-
// have to find a better way to do it.
|
|
6471
|
-
const SetButtons = props => {
|
|
6472
|
-
const _useTheme = useTheme(),
|
|
6473
|
-
themedValue = _useTheme.themedValue;
|
|
6474
|
-
return jsx("div", {
|
|
6475
|
-
className: themedValue(props.isTopAligned ? styles$d.topAlign : undefined, undefined),
|
|
6476
|
-
children: jsxs(Spacings.Inline, {
|
|
6477
|
-
children: [jsx(IconButton, {
|
|
6478
|
-
label: "Remove value",
|
|
6479
|
-
onClick: props.onRemoveItem,
|
|
6480
|
-
isDisabled: props.isRemoveDisabled,
|
|
6481
|
-
size: themedValue('medium', 'big'),
|
|
6482
|
-
icon: themedValue(jsx(BinFilledIcon, {}), jsx(BinLinearIcon, {}))
|
|
6483
|
-
}), props.isFirstItem ? jsx(IconButton, {
|
|
6484
|
-
label: "Add value",
|
|
6485
|
-
onClick: props.onAddItem,
|
|
6486
|
-
isDisabled: props.isAddDisabled,
|
|
6487
|
-
size: themedValue('medium', 'big'),
|
|
6488
|
-
icon: jsx(PlusBoldIcon, {})
|
|
6489
|
-
}) : jsx("div", {
|
|
6490
|
-
className: styles$d.gap
|
|
6491
|
-
})]
|
|
6492
|
-
})
|
|
6461
|
+
const convertEnumValues = (value, attributeDefinition) => {
|
|
6462
|
+
var _context2, _context3;
|
|
6463
|
+
if (isNil$1(value)) return value;
|
|
6464
|
+
const typeName = getTypeName(attributeDefinition.type);
|
|
6465
|
+
if (_includesInstanceProperty(_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
6466
|
+
if (typeName === 'set' && _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty(value).call(value, _ref => {
|
|
6467
|
+
let key = _ref.key;
|
|
6468
|
+
return key;
|
|
6493
6469
|
});
|
|
6470
|
+
return value;
|
|
6494
6471
|
};
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
const
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
duplicated: true
|
|
6511
|
-
};
|
|
6512
|
-
}
|
|
6513
|
-
}
|
|
6514
|
-
}
|
|
6515
|
-
return result;
|
|
6516
|
-
/* eslint-enable no-plusplus */
|
|
6517
|
-
};
|
|
6518
|
-
|
|
6519
|
-
const isEmpty$1 = value => value.length === 0;
|
|
6520
|
-
const nullifyIfEmpty = value => isEmpty$1(value) ? undefined : value;
|
|
6521
|
-
const dropEmptyEntries = value => _Array$isArray(value) ? _filterInstanceProperty(value).call(value, item => !isNil$1(item)) : value;
|
|
6522
|
-
const removeArrayItem = (array, index) => {
|
|
6523
|
-
const head = _sliceInstanceProperty(array).call(array, 0, index);
|
|
6524
|
-
const tail = _sliceInstanceProperty(array).call(array, index + 1);
|
|
6525
|
-
return [...head, ...tail];
|
|
6472
|
+
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
6473
|
+
var _context4, _context5;
|
|
6474
|
+
if (isNil$1(value)) return value;
|
|
6475
|
+
if (!attributeDefinition) return value;
|
|
6476
|
+
const type = attributeDefinition.type;
|
|
6477
|
+
const typeName = getTypeName(type);
|
|
6478
|
+
if (_includesInstanceProperty(_context4 = ['enum', 'lenum']).call(_context4, typeName)) return {
|
|
6479
|
+
key: value,
|
|
6480
|
+
label: findLabel(type, value)
|
|
6481
|
+
};
|
|
6482
|
+
if (typeName === 'set' && _includesInstanceProperty(_context5 = ['enum', 'lenum']).call(_context5, getTypeName(type.elementType))) return _mapInstanceProperty(value).call(value, val => ({
|
|
6483
|
+
key: val,
|
|
6484
|
+
label: findLabel(type.elementType, val)
|
|
6485
|
+
}));
|
|
6486
|
+
return value;
|
|
6526
6487
|
};
|
|
6527
|
-
const
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
return [...head, newItem, ...tail];
|
|
6531
|
-
};
|
|
6532
|
-
const getItemIndex = name => {
|
|
6533
|
-
const indexPartStart = _lastIndexOfInstanceProperty(name).call(name, '[');
|
|
6534
|
-
const indexPartEnd = _lastIndexOfInstanceProperty(name).call(name, ']');
|
|
6535
|
-
const rawIndex = name.substring(indexPartStart + 1, indexPartEnd);
|
|
6536
|
-
return _parseInt(rawIndex, 10);
|
|
6537
|
-
};
|
|
6538
|
-
const makeKeys = amount => times(amount, () => v4());
|
|
6539
|
-
const makeItemFieldName = (fieldName, index) => {
|
|
6540
|
-
var _context;
|
|
6541
|
-
return _concatInstanceProperty(_context = "".concat(fieldName, ".[")).call(_context, index, "]");
|
|
6542
|
-
};
|
|
6543
|
-
const makeMapForAllItems = (fieldName, items, value) => _reduceInstanceProperty(items).call(items, (result, item, index) => set(result, makeItemFieldName(fieldName, index), value), {});
|
|
6544
|
-
function CustomInputSet(props) {
|
|
6545
|
-
var _context2;
|
|
6546
|
-
const _useToggleState = useToggleState(false),
|
|
6547
|
-
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
6548
|
-
isExpanded = _useToggleState2[0],
|
|
6549
|
-
toggleExpansion = _useToggleState2[1];
|
|
6550
|
-
const _useFormikContext = useFormikContext(),
|
|
6551
|
-
setTouched = _useFormikContext.setTouched,
|
|
6552
|
-
touched = _useFormikContext.touched,
|
|
6553
|
-
isSubmitting = _useFormikContext.isSubmitting,
|
|
6554
|
-
dirty = _useFormikContext.dirty;
|
|
6555
|
-
const itemFieldDefinition = _objectSpread$O(_objectSpread$O({}, props.fieldDefinition), {}, {
|
|
6556
|
-
type: props.fieldDefinition.type.elementType
|
|
6557
|
-
});
|
|
6558
|
-
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
6559
|
-
const _useState = useState(value),
|
|
6560
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
6561
|
-
internalValue = _useState2[0],
|
|
6562
|
-
setInternalValue = _useState2[1];
|
|
6563
|
-
const _useState3 = useState(makeKeys(internalValue.length)),
|
|
6564
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
6565
|
-
keys = _useState4[0],
|
|
6566
|
-
setKeys = _useState4[1];
|
|
6567
|
-
const totalAmount = internalValue === null || internalValue === void 0 ? void 0 : internalValue.length;
|
|
6568
|
-
const amountToRender = isExpanded ? totalAmount : 1;
|
|
6569
|
-
const updateInternalValue = newValue => {
|
|
6570
|
-
const valueToSet = isEmpty$1(newValue) ? [undefined] : newValue;
|
|
6571
|
-
setInternalValue(valueToSet);
|
|
6572
|
-
if (valueToSet.length !== keys.length) {
|
|
6573
|
-
setKeys(makeKeys(valueToSet.length));
|
|
6574
|
-
}
|
|
6575
|
-
};
|
|
6576
|
-
|
|
6577
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6578
|
-
useEffect(() => updateInternalValue(value), [value]);
|
|
6579
|
-
|
|
6580
|
-
// Filter out all empty values on form submit
|
|
6581
|
-
useEffect(() => {
|
|
6582
|
-
if (isSubmitting || !dirty) {
|
|
6583
|
-
const withoutEmpty = dropEmptyEntries(value);
|
|
6584
|
-
if (!deepEqual(withoutEmpty, dropEmptyEntries(internalValue))) {
|
|
6585
|
-
setKeys(makeKeys(withoutEmpty.length || 1));
|
|
6586
|
-
}
|
|
6587
|
-
updateInternalValue(withoutEmpty);
|
|
6588
|
-
}
|
|
6589
|
-
// I do really want to run it only when isSubmitting or dirty values change.
|
|
6590
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6591
|
-
}, [isSubmitting, dirty]);
|
|
6592
|
-
const markAllItemsAsTouched = items => setTouched(merge({}, touched, makeMapForAllItems(props.name, items, true)));
|
|
6593
|
-
const setNewValue = newValue => {
|
|
6594
|
-
const withoutEmpty = dropEmptyEntries(newValue);
|
|
6595
|
-
const nullified = nullifyIfEmpty(withoutEmpty);
|
|
6596
|
-
updateInternalValue(withoutEmpty);
|
|
6597
|
-
markAllItemsAsTouched(withoutEmpty);
|
|
6598
|
-
props.setFieldValue(props.name, nullified);
|
|
6599
|
-
};
|
|
6600
|
-
const addNewItem = () => updateInternalValue([undefined, ...internalValue]);
|
|
6601
|
-
const removeItem = index => {
|
|
6602
|
-
setNewValue(removeArrayItem(internalValue, index));
|
|
6603
|
-
};
|
|
6604
|
-
const setItemValue = (itemName, itemValue) => {
|
|
6605
|
-
const index = getItemIndex(itemName);
|
|
6606
|
-
const newValue = replaceArrayItem(internalValue, index, itemValue);
|
|
6607
|
-
setNewValue(newValue);
|
|
6608
|
-
};
|
|
6609
|
-
|
|
6610
|
-
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
6611
|
-
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
6612
|
-
// type is selected.
|
|
6613
|
-
const type = getType$1(props.fieldDefinition);
|
|
6614
|
-
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
6615
|
-
const areButtonsTopAligned = _includesInstanceProperty(_context2 = [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(_context2, typeName);
|
|
6616
|
-
return jsxs(Fragment, {
|
|
6617
|
-
children: [jsx(AccessibleHidden, {
|
|
6618
|
-
children: jsx("label", {
|
|
6619
|
-
id: props.name,
|
|
6620
|
-
children: props.name
|
|
6621
|
-
})
|
|
6622
|
-
}), jsx("div", {
|
|
6623
|
-
children: jsx(Field, {
|
|
6624
|
-
name: props.name,
|
|
6625
|
-
validate: values => {
|
|
6626
|
-
const errors = getDuplicateErrors(values);
|
|
6627
|
-
return errors.length > 0 ? errors : undefined;
|
|
6628
|
-
},
|
|
6629
|
-
children: () => jsxs(Spacings.Stack, {
|
|
6630
|
-
scale: "s",
|
|
6631
|
-
"data-testid": props.name,
|
|
6632
|
-
children: [times(amountToRender, index => {
|
|
6633
|
-
const fieldName = makeItemFieldName(props.name, index);
|
|
6634
|
-
const fieldValue = internalValue[index];
|
|
6635
|
-
return jsxs(Spacings.Inline, {
|
|
6636
|
-
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
6637
|
-
children: [jsx(CustomFieldInput, {
|
|
6638
|
-
name: fieldName,
|
|
6639
|
-
fieldDefinition: itemFieldDefinition,
|
|
6640
|
-
isDisabled: props.isDisabled,
|
|
6641
|
-
isReadOnly: props.isReadOnly,
|
|
6642
|
-
onBlur: props.onBlur,
|
|
6643
|
-
setFieldValue: setItemValue,
|
|
6644
|
-
value: fieldValue,
|
|
6645
|
-
hasError: props.hasError
|
|
6646
|
-
}), jsx(SetButtons, {
|
|
6647
|
-
index: index,
|
|
6648
|
-
isFirstItem: !isExpanded || index === 0,
|
|
6649
|
-
onAddItem: addNewItem,
|
|
6650
|
-
onRemoveItem: () => removeItem(index),
|
|
6651
|
-
isRemoveDisabled: props.isDisabled || props.isReadOnly || internalValue.length === 1,
|
|
6652
|
-
isAddDisabled: props.isDisabled || props.isReadOnly || !internalValue[0],
|
|
6653
|
-
isTopAligned: areButtonsTopAligned
|
|
6654
|
-
})]
|
|
6655
|
-
}, keys[index]);
|
|
6656
|
-
}), jsx(ExpandButton, {
|
|
6657
|
-
totalValues: totalAmount,
|
|
6658
|
-
isExpanded: isExpanded,
|
|
6659
|
-
onExpand: toggleExpansion
|
|
6660
|
-
})]
|
|
6661
|
-
})
|
|
6662
|
-
})
|
|
6663
|
-
})]
|
|
6664
|
-
});
|
|
6665
|
-
}
|
|
6666
|
-
|
|
6667
|
-
var messages$y = defineMessages({
|
|
6668
|
-
referencedProductType: {
|
|
6669
|
-
id: 'NestedAttributes.referencedProductType',
|
|
6670
|
-
description: 'Product type referenced hint',
|
|
6671
|
-
defaultMessage: 'Product type referenced: {productTypeName}'
|
|
6672
|
-
}
|
|
6673
|
-
});
|
|
6674
|
-
|
|
6675
|
-
function ownKeys$N(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; }
|
|
6676
|
-
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6677
|
-
function ProductTypeReference(props) {
|
|
6678
|
-
const productTypeMessage = _objectSpread$N(_objectSpread$N({}, messages$y.referencedProductType), {}, {
|
|
6679
|
-
values: {
|
|
6680
|
-
productTypeName: props.productType.name
|
|
6681
|
-
}
|
|
6682
|
-
});
|
|
6683
|
-
return jsx(Text.Detail, {
|
|
6684
|
-
intlMessage: productTypeMessage
|
|
6685
|
-
});
|
|
6686
|
-
}
|
|
6687
|
-
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
6688
|
-
|
|
6689
|
-
function ownKeys$M(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; }
|
|
6690
|
-
function _objectSpread$M(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$M(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$M(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6691
|
-
var FetchProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductTypeQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productType" }, 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: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "attributeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "100" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isRequired" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputTipAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1905, source: { body: "query FetchProductTypeQuery($id: String!) {\n productType(id: $id) {\n name\n attributeDefinitions(limit: 100) {\n results {\n name\n isRequired\n inputHint\n inputTipAllLocales {\n value\n locale\n }\n labelAllLocales {\n value\n locale\n }\n type {\n name\n ... on SetAttributeDefinitionType {\n elementType {\n name\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6692
|
-
const mapAttributeDefinition = definition => {
|
|
6693
|
-
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6694
|
-
return _objectSpread$M(_objectSpread$M({}, definition), {}, {
|
|
6695
|
-
required: definition.isRequired,
|
|
6696
|
-
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6697
|
-
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6698
|
-
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$M(_objectSpread$M({}, definition.type), {}, {
|
|
6699
|
-
elementType: _objectSpread$M(_objectSpread$M({}, definition.type.elementType), {}, {
|
|
6700
|
-
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6701
|
-
key: value.key,
|
|
6702
|
-
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6703
|
-
}))
|
|
6704
|
-
})
|
|
6705
|
-
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$M(_objectSpread$M({}, definition.type), {}, {
|
|
6706
|
-
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6707
|
-
key: value.key,
|
|
6708
|
-
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6709
|
-
}))
|
|
6710
|
-
}) : definition.type
|
|
6711
|
-
});
|
|
6712
|
-
};
|
|
6713
|
-
function useNestedProductType(fieldDefinition) {
|
|
6714
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
6715
|
-
const isSet = typeName === 'set';
|
|
6716
|
-
const productTypeId = isSet ? fieldDefinition.type.elementType.typeRef.id : fieldDefinition.type.typeRef.id;
|
|
6717
|
-
const _useQuery = useQuery(FetchProductTypeQuery, {
|
|
6718
|
-
variables: {
|
|
6719
|
-
id: productTypeId
|
|
6720
|
-
},
|
|
6721
|
-
context: {
|
|
6722
|
-
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6723
|
-
}
|
|
6724
|
-
}),
|
|
6725
|
-
data = _useQuery.data,
|
|
6726
|
-
loading = _useQuery.loading,
|
|
6727
|
-
error = _useQuery.error;
|
|
6728
|
-
if (!loading && !error) {
|
|
6729
|
-
var _context5;
|
|
6730
|
-
const attributeDefinitions = _mapInstanceProperty(_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6731
|
-
return {
|
|
6732
|
-
loading: false,
|
|
6733
|
-
error: false,
|
|
6734
|
-
productType: {
|
|
6735
|
-
name: data.productType.name,
|
|
6736
|
-
attributeDefinitions
|
|
6737
|
-
}
|
|
6738
|
-
};
|
|
6739
|
-
}
|
|
6740
|
-
return {
|
|
6741
|
-
loading,
|
|
6742
|
-
error
|
|
6743
|
-
};
|
|
6744
|
-
}
|
|
6745
|
-
|
|
6746
|
-
function CustomNestedFieldInput(props) {
|
|
6747
|
-
const typeName = props.fieldDefinition.type.name.toLowerCase();
|
|
6748
|
-
const isSet = typeName === 'set';
|
|
6749
|
-
const _useNestedProductType = useNestedProductType(props.fieldDefinition),
|
|
6750
|
-
productType = _useNestedProductType.productType,
|
|
6751
|
-
error = _useNestedProductType.error;
|
|
6752
|
-
if (error) return jsxs(Spacings.Inline, {
|
|
6753
|
-
scale: "s",
|
|
6754
|
-
alignItems: "center",
|
|
6755
|
-
children: [jsx(ErrorIcon, {
|
|
6756
|
-
color: "error"
|
|
6757
|
-
}), jsx(Text.Body, {
|
|
6758
|
-
tone: "negative",
|
|
6759
|
-
intlMessage: commonPickerMessages.loadingErrorMessage
|
|
6760
|
-
})]
|
|
6761
|
-
});
|
|
6762
|
-
if (!productType) return null;
|
|
6763
|
-
const InputComponent = isSet ? CustomInputSet : CustomNestedInput;
|
|
6764
|
-
return jsxs(Fragment, {
|
|
6765
|
-
children: [jsx(ProductTypeReference, {
|
|
6766
|
-
productType: productType
|
|
6767
|
-
}), jsx(InputComponent, {
|
|
6768
|
-
name: props.name,
|
|
6769
|
-
productType: productType,
|
|
6770
|
-
fieldDefinition: props.fieldDefinition,
|
|
6771
|
-
value: props.value,
|
|
6772
|
-
isDisabled: props.isDisabled,
|
|
6773
|
-
isReadOnly: props.isReadOnly,
|
|
6774
|
-
setFieldValue: props.setFieldValue,
|
|
6775
|
-
onBlur: props.onBlur
|
|
6776
|
-
})]
|
|
6777
|
-
});
|
|
6778
|
-
}
|
|
6779
|
-
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
6780
|
-
|
|
6781
|
-
function ownKeys$L(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; }
|
|
6782
|
-
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$L(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$L(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6783
|
-
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$L(_objectSpread$L({}, result), itemErrors), {});
|
|
6784
|
-
|
|
6785
|
-
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
6786
|
-
// all the other types of fields. So that there will be no isArray check.
|
|
6787
|
-
const CustomFieldErrors = props => {
|
|
6788
|
-
// We want to highlight fields with errors not only after a form submission,
|
|
6789
|
-
// but also after manually triggered form validation.
|
|
6790
|
-
const didFormValidationFail = useDidFormValidationFail();
|
|
6791
|
-
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
6792
|
-
return jsxs(Fragment, {
|
|
6793
|
-
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
6794
|
-
intlMessage: messages$K.required
|
|
6795
|
-
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
6796
|
-
intlMessage: messages$K.unique
|
|
6797
|
-
})]
|
|
6798
|
-
});
|
|
6799
|
-
};
|
|
6800
|
-
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
6801
|
-
|
|
6802
|
-
var messages$x = defineMessages({
|
|
6803
|
-
productReferenceLabel: {
|
|
6804
|
-
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
6805
|
-
description: 'Label shown above the product picker input.',
|
|
6806
|
-
defaultMessage: 'Product (case sensitive field)'
|
|
6807
|
-
},
|
|
6808
|
-
productTypeReferenceLabel: {
|
|
6809
|
-
id: 'CustomFieldsLabel.productTypeReferenceLabel',
|
|
6810
|
-
description: 'Label shown above the product type picker input.',
|
|
6811
|
-
defaultMessage: 'Product type (case sensitive field)'
|
|
6812
|
-
},
|
|
6813
|
-
productTypeReferenceLabelI: {
|
|
6814
|
-
id: 'CustomFieldsLabel.productTypeReferenceLabelI',
|
|
6815
|
-
description: 'Label shown above the product type picker input for indexed project.',
|
|
6816
|
-
defaultMessage: 'Product type'
|
|
6817
|
-
},
|
|
6818
|
-
stateReferenceLabel: {
|
|
6819
|
-
id: 'CustomFieldsLabel.stateReferenceLabel',
|
|
6820
|
-
description: 'Label shown above the state picker input.',
|
|
6821
|
-
defaultMessage: 'State (case sensitive field)'
|
|
6822
|
-
},
|
|
6823
|
-
channelReferenceLabel: {
|
|
6824
|
-
id: 'CustomFieldsLabel.channelReferenceLabel',
|
|
6825
|
-
description: 'Label shown above the channel picker input.',
|
|
6826
|
-
defaultMessage: 'Channel (case sensitive field)'
|
|
6827
|
-
},
|
|
6828
|
-
cartDiscountMoreThan500: {
|
|
6829
|
-
id: 'cartDiscountMoreThan500',
|
|
6830
|
-
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
6831
|
-
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
6832
|
-
}
|
|
6833
|
-
});
|
|
6834
|
-
|
|
6835
|
-
function ownKeys$K(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; }
|
|
6836
|
-
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$K(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$K(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6837
|
-
var CartDiscountsCount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 61, source: { body: "query CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6838
|
-
const CustomFieldsLabelHint = _ref => {
|
|
6839
|
-
var _type$name;
|
|
6840
|
-
let fieldDefinition = _ref.fieldDefinition;
|
|
6841
|
-
const type = getType$1(fieldDefinition);
|
|
6842
|
-
const _useTheme = useTheme(),
|
|
6843
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
6844
|
-
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
6845
|
-
const referenceTypeId = type.referenceTypeId;
|
|
6846
|
-
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
6847
|
-
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
6848
|
-
languages: applicationContext.project.languages,
|
|
6849
|
-
dataLocale: applicationContext.dataLocale
|
|
6850
|
-
})),
|
|
6851
|
-
languages = _useApplicationContex.languages,
|
|
6852
|
-
dataLocale = _useApplicationContex.dataLocale;
|
|
6853
|
-
const _useQuery = useQuery(CartDiscountsCount, {
|
|
6854
|
-
skip: !isCartDiscountsReference,
|
|
6855
|
-
context: {
|
|
6856
|
-
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6857
|
-
}
|
|
6858
|
-
}),
|
|
6859
|
-
data = _useQuery.data,
|
|
6860
|
-
loading = _useQuery.loading;
|
|
6861
|
-
if (loading) return null;
|
|
6862
|
-
if ((data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT) {
|
|
6863
|
-
return isNewTheme ? jsxs(Spacings.Inline, {
|
|
6864
|
-
alignItems: "center",
|
|
6865
|
-
children: [jsx(WarningIcon, {
|
|
6866
|
-
size: "medium",
|
|
6867
|
-
color: "warning"
|
|
6868
|
-
}), jsx(FormattedMessage, _objectSpread$K({}, messages$x.cartDiscountMoreThan500))]
|
|
6869
|
-
}) : jsx(Spacings.Inset, {
|
|
6870
|
-
scale: "xs",
|
|
6871
|
-
children: jsxs(Spacings.Inline, {
|
|
6872
|
-
alignItems: "flex-start",
|
|
6873
|
-
children: [jsx(InformationIcon, {
|
|
6874
|
-
size: "medium"
|
|
6875
|
-
}), jsx(FormattedMessage, _objectSpread$K({}, messages$x.cartDiscountMoreThan500))]
|
|
6876
|
-
})
|
|
6877
|
-
});
|
|
6878
|
-
}
|
|
6879
|
-
return formatLocalizedString(fieldDefinition, {
|
|
6880
|
-
key: 'inputTip',
|
|
6881
|
-
locale: dataLocale,
|
|
6882
|
-
fallbackOrder: languages
|
|
6883
|
-
});
|
|
6884
|
-
};
|
|
6885
|
-
function CustomFieldsProductTypeReferenceSubtitle() {
|
|
6886
|
-
const _useIntl = useIntl(),
|
|
6887
|
-
formatMessage = _useIntl.formatMessage;
|
|
6888
|
-
const _usePimStatus = usePimStatus(),
|
|
6889
|
-
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
6890
|
-
if (isProjectIndexed) return formatMessage(messages$x.productTypeReferenceLabelI);
|
|
6891
|
-
return formatMessage(messages$x.productTypeReferenceLabel);
|
|
6892
|
-
}
|
|
6893
|
-
|
|
6894
|
-
// TODO(pa3): this logic may be misplaced and probably
|
|
6895
|
-
// should belong to <CustomReferenceInput /> component instead.
|
|
6896
|
-
function CustomFieldsLabelSubtitle(_ref2) {
|
|
6897
|
-
var _type$name2, _context;
|
|
6898
|
-
let fieldDefinition = _ref2.fieldDefinition;
|
|
6899
|
-
const _useIntl2 = useIntl(),
|
|
6900
|
-
formatMessage = _useIntl2.formatMessage;
|
|
6901
|
-
const type = getType$1(fieldDefinition);
|
|
6902
|
-
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
6903
|
-
if (!isReference) return null;
|
|
6904
|
-
const referenceTypeId = type.referenceTypeId;
|
|
6905
|
-
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
6906
|
-
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
6907
|
-
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$x.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$x.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$x.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
6908
|
-
}
|
|
6909
|
-
const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
6910
|
-
let name = _ref3.name,
|
|
6911
|
-
fieldDefinition = _ref3.fieldDefinition;
|
|
6912
|
-
const _useApplicationContex2 = useApplicationContext(applicationContext => ({
|
|
6913
|
-
languages: applicationContext.project.languages,
|
|
6914
|
-
language: applicationContext.dataLocale
|
|
6915
|
-
})),
|
|
6916
|
-
languages = _useApplicationContex2.languages,
|
|
6917
|
-
language = _useApplicationContex2.language;
|
|
6918
|
-
return jsx(FieldLabel, {
|
|
6919
|
-
htmlFor: name,
|
|
6920
|
-
title: formatLocalizedString(fieldDefinition, {
|
|
6921
|
-
key: 'label',
|
|
6922
|
-
locale: language,
|
|
6923
|
-
fallbackOrder: languages,
|
|
6924
|
-
fallback: fieldDefinition.name
|
|
6925
|
-
}),
|
|
6926
|
-
description: jsx(CustomFieldsLabelSubtitle, {
|
|
6927
|
-
fieldDefinition: fieldDefinition
|
|
6928
|
-
}),
|
|
6929
|
-
hint: jsx(CustomFieldsLabelHint, {
|
|
6930
|
-
fieldDefinition: fieldDefinition
|
|
6931
|
-
}),
|
|
6932
|
-
hasRequiredIndicator: fieldDefinition.required
|
|
6933
|
-
});
|
|
6934
|
-
});
|
|
6935
|
-
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
6936
|
-
|
|
6937
|
-
const getFieldName$1 = (parentName, fieldName) => {
|
|
6938
|
-
var _context;
|
|
6939
|
-
if (!parentName) return fieldName;
|
|
6940
|
-
return _concatInstanceProperty(_context = "".concat(parentName, ".")).call(_context, fieldName);
|
|
6941
|
-
};
|
|
6942
|
-
const isNested$1 = fieldDefinition => {
|
|
6943
|
-
const type = fieldDefinition.type;
|
|
6944
|
-
const typeName = type.name.toLowerCase();
|
|
6945
|
-
if (typeName === 'set') {
|
|
6946
|
-
const elementTypeName = type.elementType.name.toLowerCase();
|
|
6947
|
-
return elementTypeName === CUSTOM_FIELD_TYPES.nested;
|
|
6948
|
-
}
|
|
6949
|
-
return typeName === CUSTOM_FIELD_TYPES.nested;
|
|
6950
|
-
};
|
|
6951
|
-
const ThemedCustomFieldsInternal = props => {
|
|
6952
|
-
const _useFormikContext = useFormikContext(),
|
|
6953
|
-
errors = _useFormikContext.errors,
|
|
6954
|
-
touched = _useFormikContext.touched,
|
|
6955
|
-
values = _valuesInstanceProperty(_useFormikContext),
|
|
6956
|
-
handleBlur = _useFormikContext.handleBlur;
|
|
6957
|
-
const didFormValidationFail = useDidFormValidationFail();
|
|
6958
|
-
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
6959
|
-
return jsx(Fragment, {
|
|
6960
|
-
children: _mapInstanceProperty(fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
6961
|
-
var _context2;
|
|
6962
|
-
const fieldName = getFieldName$1(props.name, fieldDefinition.name);
|
|
6963
|
-
const isTouched = Boolean(getIn(touched, fieldName));
|
|
6964
|
-
const fieldErrors = getIn(errors, fieldName);
|
|
6965
|
-
const value = props.inputValuesConverter(fieldName, getIn(values, fieldName));
|
|
6966
|
-
// We want to highlight fields with errors not only after a form submission,
|
|
6967
|
-
// but also after manually triggered form validation.
|
|
6968
|
-
const hasError = Boolean(fieldErrors) && (isTouched || didFormValidationFail);
|
|
6969
|
-
const validate = value => {
|
|
6970
|
-
if (fieldDefinition.required && isNil$1(value)) return {
|
|
6971
|
-
missing: true
|
|
6972
|
-
};
|
|
6973
|
-
return undefined;
|
|
6974
|
-
};
|
|
6975
|
-
return jsx(FastField, {
|
|
6976
|
-
name: fieldName,
|
|
6977
|
-
validate: validate,
|
|
6978
|
-
children: () => jsxs(Spacings.Stack, {
|
|
6979
|
-
scale: "xs",
|
|
6980
|
-
children: [jsx(CustomFieldsLabel, {
|
|
6981
|
-
name: fieldName,
|
|
6982
|
-
fieldDefinition: fieldDefinition
|
|
6983
|
-
}), jsxs(Spacings.Stack, {
|
|
6984
|
-
scale: "xs",
|
|
6985
|
-
alignItems: "stretch",
|
|
6986
|
-
children: [isNested$1(fieldDefinition) ? jsx(CustomNestedFieldInput, {
|
|
6987
|
-
name: fieldName,
|
|
6988
|
-
value: value,
|
|
6989
|
-
fieldDefinition: fieldDefinition,
|
|
6990
|
-
isDisabled: props.isDisabled,
|
|
6991
|
-
isReadOnly: props.isReadOnly,
|
|
6992
|
-
onBlur: handleBlur,
|
|
6993
|
-
setFieldValue: props.setFieldValue
|
|
6994
|
-
}) : jsx(CustomFieldInput, {
|
|
6995
|
-
name: fieldName,
|
|
6996
|
-
value: value,
|
|
6997
|
-
fieldDefinition: fieldDefinition,
|
|
6998
|
-
isDisabled: props.isDisabled,
|
|
6999
|
-
isReadOnly: props.isReadOnly,
|
|
7000
|
-
onBlur: handleBlur,
|
|
7001
|
-
setFieldValue: props.setFieldValue,
|
|
7002
|
-
hasError: hasError
|
|
7003
|
-
}), jsx(CustomFieldErrors, {
|
|
7004
|
-
isTouched: isTouched,
|
|
7005
|
-
errors: fieldErrors
|
|
7006
|
-
})]
|
|
7007
|
-
})]
|
|
7008
|
-
})
|
|
7009
|
-
}, _concatInstanceProperty(_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7010
|
-
})
|
|
7011
|
-
});
|
|
7012
|
-
};
|
|
7013
|
-
ThemedCustomFieldsInternal.displayName = 'ThemedCustomFieldsInternal';
|
|
7014
|
-
|
|
7015
|
-
function ownKeys$J(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; }
|
|
7016
|
-
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context7, _context8; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context7 = ownKeys$J(Object(source), !0)).call(_context7, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context8 = ownKeys$J(Object(source))).call(_context8, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7017
|
-
const getTypeName = type => type.name.toLowerCase();
|
|
7018
|
-
const findLabel = (enumType, key) => {
|
|
7019
|
-
var _enumType$values$find, _enumType$values$find2, _context;
|
|
7020
|
-
const emptyValue = getTypeName(enumType) === 'enum' ? '' : {};
|
|
7021
|
-
return (_enumType$values$find = (_enumType$values$find2 = _findInstanceProperty(_context = _valuesInstanceProperty(enumType)).call(_context, value => value.key === key)) === null || _enumType$values$find2 === void 0 ? void 0 : _enumType$values$find2.label) !== null && _enumType$values$find !== void 0 ? _enumType$values$find : emptyValue;
|
|
7022
|
-
};
|
|
7023
|
-
const convertEnumValues = (value, attributeDefinition) => {
|
|
7024
|
-
var _context2, _context3;
|
|
7025
|
-
if (isNil$1(value)) return value;
|
|
7026
|
-
const typeName = getTypeName(attributeDefinition.type);
|
|
7027
|
-
if (_includesInstanceProperty(_context2 = ['enum', 'lenum']).call(_context2, typeName)) return value.key;
|
|
7028
|
-
if (typeName === 'set' && _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, getTypeName(attributeDefinition.type.elementType))) return _mapInstanceProperty(value).call(value, _ref => {
|
|
7029
|
-
let key = _ref.key;
|
|
7030
|
-
return key;
|
|
7031
|
-
});
|
|
7032
|
-
return value;
|
|
7033
|
-
};
|
|
7034
|
-
const customFieldToAttribute = (value, attributeDefinition) => {
|
|
7035
|
-
var _context4, _context5;
|
|
7036
|
-
if (isNil$1(value)) return value;
|
|
7037
|
-
if (!attributeDefinition) return value;
|
|
7038
|
-
const type = attributeDefinition.type;
|
|
7039
|
-
const typeName = getTypeName(type);
|
|
7040
|
-
if (_includesInstanceProperty(_context4 = ['enum', 'lenum']).call(_context4, typeName)) return {
|
|
7041
|
-
key: value,
|
|
7042
|
-
label: findLabel(type, value)
|
|
7043
|
-
};
|
|
7044
|
-
if (typeName === 'set' && _includesInstanceProperty(_context5 = ['enum', 'lenum']).call(_context5, getTypeName(type.elementType))) return _mapInstanceProperty(value).call(value, val => ({
|
|
7045
|
-
key: val,
|
|
7046
|
-
label: findLabel(type.elementType, val)
|
|
7047
|
-
}));
|
|
7048
|
-
return value;
|
|
7049
|
-
};
|
|
7050
|
-
const attributeToCustomField = (attributeValue, attributeDefinition) => {
|
|
7051
|
-
if (!attributeDefinition) return attributeValue;
|
|
7052
|
-
return convertEnumValues(attributeValue, attributeDefinition);
|
|
6488
|
+
const attributeToCustomField = (attributeValue, attributeDefinition) => {
|
|
6489
|
+
if (!attributeDefinition) return attributeValue;
|
|
6490
|
+
return convertEnumValues(attributeValue, attributeDefinition);
|
|
7053
6491
|
};
|
|
7054
6492
|
const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
7055
6493
|
name: attributeDefinition.name,
|
|
@@ -7062,7 +6500,7 @@ const attributeDefinitionToFieldDefinition = attributeDefinition => ({
|
|
|
7062
6500
|
const nameValuePairsToMap = pairs => _reduceInstanceProperty(pairs).call(pairs, (result, _ref2) => {
|
|
7063
6501
|
let name = _ref2.name,
|
|
7064
6502
|
value = _ref2.value;
|
|
7065
|
-
return _objectSpread$
|
|
6503
|
+
return _objectSpread$M(_objectSpread$M({}, result), {}, {
|
|
7066
6504
|
[name]: value
|
|
7067
6505
|
});
|
|
7068
6506
|
}, {});
|
|
@@ -7085,8 +6523,6 @@ const getAttributeShortName = (fullName, attributesPrefix) => {
|
|
|
7085
6523
|
};
|
|
7086
6524
|
function ProductAttributes(props) {
|
|
7087
6525
|
const formik = useFormikContext();
|
|
7088
|
-
const _useTheme = useTheme(),
|
|
7089
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7090
6526
|
const fieldDefinitions = useMemo(() => {
|
|
7091
6527
|
var _context;
|
|
7092
6528
|
return _mapInstanceProperty(_context = props.attributeDefinitions).call(_context, attributeDefinitionToFieldDefinition);
|
|
@@ -7099,11 +6535,11 @@ function ProductAttributes(props) {
|
|
|
7099
6535
|
formikSetFieldValue(name, converted);
|
|
7100
6536
|
}, [props.name, attributeDefinitionsAsMap, formikSetFieldValue]);
|
|
7101
6537
|
const convertInputValue = (attributeName, attributeValue) => attributeToCustomField(attributeValue, attributeDefinitionsAsMap[getAttributeShortName(attributeName, props.name)]);
|
|
7102
|
-
return
|
|
6538
|
+
return jsx(Constraints.Horizontal, {
|
|
7103
6539
|
max: "scale",
|
|
7104
6540
|
children: jsx(Spacings.Stack, {
|
|
7105
6541
|
scale: "xl",
|
|
7106
|
-
children: jsx(
|
|
6542
|
+
children: jsx(CustomFieldsInternal, {
|
|
7107
6543
|
name: props.name,
|
|
7108
6544
|
isReadOnly: props.isReadOnly,
|
|
7109
6545
|
isDisabled: props.isDisabled,
|
|
@@ -7112,13 +6548,6 @@ function ProductAttributes(props) {
|
|
|
7112
6548
|
inputValuesConverter: convertInputValue
|
|
7113
6549
|
})
|
|
7114
6550
|
})
|
|
7115
|
-
}) : jsx(CustomFieldsInternal, {
|
|
7116
|
-
name: props.name,
|
|
7117
|
-
isDisabled: props.isDisabled,
|
|
7118
|
-
isReadOnly: props.isReadOnly,
|
|
7119
|
-
fieldDefinitions: fieldDefinitions,
|
|
7120
|
-
setFieldValue: setFieldValue,
|
|
7121
|
-
inputValuesConverter: convertInputValue
|
|
7122
6551
|
});
|
|
7123
6552
|
}
|
|
7124
6553
|
|
|
@@ -7155,7 +6584,7 @@ function ProductAttributeInput(props) {
|
|
|
7155
6584
|
ProductAttributeInput.displayName = 'ProductAttributeInput';
|
|
7156
6585
|
|
|
7157
6586
|
// eslint-disable-next-line import/prefer-default-export
|
|
7158
|
-
const messages$
|
|
6587
|
+
const messages$x = defineMessages({
|
|
7159
6588
|
aboveFifthLevelWarning: {
|
|
7160
6589
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
7161
6590
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -7168,7 +6597,64 @@ const messages$w = defineMessages({
|
|
|
7168
6597
|
}
|
|
7169
6598
|
});
|
|
7170
6599
|
|
|
7171
|
-
var
|
|
6600
|
+
function ownKeys$L(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; }
|
|
6601
|
+
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$L(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$L(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6602
|
+
var FetchProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductTypeQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productType" }, 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: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "attributeDefinitions" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "100" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "isRequired" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputHint" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "inputTipAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SetAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "elementType" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ReferenceAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "referenceTypeId" }, arguments: [], directives: [] }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "NestedAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "typeRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "EnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "label" }, arguments: [], directives: [] }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LocalizableEnumAttributeDefinitionType" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "values" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 1905, source: { body: "query FetchProductTypeQuery($id: String!) {\n productType(id: $id) {\n name\n attributeDefinitions(limit: 100) {\n results {\n name\n isRequired\n inputHint\n inputTipAllLocales {\n value\n locale\n }\n labelAllLocales {\n value\n locale\n }\n type {\n name\n ... on SetAttributeDefinitionType {\n elementType {\n name\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n }\n }\n ... on ReferenceAttributeDefinitionType {\n referenceTypeId\n }\n ... on NestedAttributeDefinitionType {\n typeRef {\n id\n }\n }\n ... on EnumAttributeDefinitionType {\n values {\n results {\n key\n label\n }\n }\n }\n ... on LocalizableEnumAttributeDefinitionType {\n values {\n results {\n key\n labelAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6603
|
+
const mapAttributeDefinition = definition => {
|
|
6604
|
+
var _context, _definition$type, _definition$type$elem, _context2, _context3, _definition$type2, _context4;
|
|
6605
|
+
return _objectSpread$L(_objectSpread$L({}, definition), {}, {
|
|
6606
|
+
required: definition.isRequired,
|
|
6607
|
+
inputTip: transformLocalizedFieldToLocalizedString(definition.inputTipAllLocales),
|
|
6608
|
+
label: transformLocalizedFieldToLocalizedString(definition.labelAllLocales),
|
|
6609
|
+
type: _includesInstanceProperty(_context = ['enum', 'lenum']).call(_context, (_definition$type = definition.type) === null || _definition$type === void 0 ? void 0 : (_definition$type$elem = _definition$type.elementType) === null || _definition$type$elem === void 0 ? void 0 : _definition$type$elem.name) ? _objectSpread$L(_objectSpread$L({}, definition.type), {}, {
|
|
6610
|
+
elementType: _objectSpread$L(_objectSpread$L({}, definition.type.elementType), {}, {
|
|
6611
|
+
values: _mapInstanceProperty(_context2 = _valuesInstanceProperty(definition.type.elementType).results).call(_context2, value => ({
|
|
6612
|
+
key: value.key,
|
|
6613
|
+
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6614
|
+
}))
|
|
6615
|
+
})
|
|
6616
|
+
}) : _includesInstanceProperty(_context3 = ['enum', 'lenum']).call(_context3, (_definition$type2 = definition.type) === null || _definition$type2 === void 0 ? void 0 : _definition$type2.name) ? _objectSpread$L(_objectSpread$L({}, definition.type), {}, {
|
|
6617
|
+
values: _mapInstanceProperty(_context4 = _valuesInstanceProperty(definition.type).results).call(_context4, value => ({
|
|
6618
|
+
key: value.key,
|
|
6619
|
+
label: value.label || transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
6620
|
+
}))
|
|
6621
|
+
}) : definition.type
|
|
6622
|
+
});
|
|
6623
|
+
};
|
|
6624
|
+
function useNestedProductType(fieldDefinition) {
|
|
6625
|
+
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
6626
|
+
const isSet = typeName === 'set';
|
|
6627
|
+
const productTypeId = isSet ? fieldDefinition.type.elementType.typeRef.id : fieldDefinition.type.typeRef.id;
|
|
6628
|
+
const _useQuery = useQuery(FetchProductTypeQuery, {
|
|
6629
|
+
variables: {
|
|
6630
|
+
id: productTypeId
|
|
6631
|
+
},
|
|
6632
|
+
context: {
|
|
6633
|
+
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
6634
|
+
}
|
|
6635
|
+
}),
|
|
6636
|
+
data = _useQuery.data,
|
|
6637
|
+
loading = _useQuery.loading,
|
|
6638
|
+
error = _useQuery.error;
|
|
6639
|
+
if (!loading && !error) {
|
|
6640
|
+
var _context5;
|
|
6641
|
+
const attributeDefinitions = _mapInstanceProperty(_context5 = data.productType.attributeDefinitions.results).call(_context5, mapAttributeDefinition);
|
|
6642
|
+
return {
|
|
6643
|
+
loading: false,
|
|
6644
|
+
error: false,
|
|
6645
|
+
productType: {
|
|
6646
|
+
name: data.productType.name,
|
|
6647
|
+
attributeDefinitions
|
|
6648
|
+
}
|
|
6649
|
+
};
|
|
6650
|
+
}
|
|
6651
|
+
return {
|
|
6652
|
+
loading,
|
|
6653
|
+
error
|
|
6654
|
+
};
|
|
6655
|
+
}
|
|
6656
|
+
|
|
6657
|
+
var messages$w = defineMessages({
|
|
7172
6658
|
updateButton: {
|
|
7173
6659
|
id: 'NestedAttributes.Details.updateButton',
|
|
7174
6660
|
description: 'Update button label',
|
|
@@ -7248,14 +6734,14 @@ var messages$v = defineMessages({
|
|
|
7248
6734
|
|
|
7249
6735
|
const NestingLevelContext = /*#__PURE__*/createContext(0);
|
|
7250
6736
|
|
|
7251
|
-
function ownKeys$
|
|
7252
|
-
function _objectSpread$
|
|
6737
|
+
function ownKeys$K(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; }
|
|
6738
|
+
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$K(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$K(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7253
6739
|
const EditButton = props => {
|
|
7254
6740
|
const _useIntl = useIntl(),
|
|
7255
6741
|
formatMessage = _useIntl.formatMessage;
|
|
7256
6742
|
return jsx(Tooltip, {
|
|
7257
6743
|
placement: "top",
|
|
7258
|
-
title: formatMessage(messages$
|
|
6744
|
+
title: formatMessage(messages$w.editTooltip),
|
|
7259
6745
|
children: jsx(IconButton, {
|
|
7260
6746
|
label: "Edit",
|
|
7261
6747
|
isDisabled: props.isDisabled,
|
|
@@ -7271,12 +6757,12 @@ const DropChangesConfirmation = props => {
|
|
|
7271
6757
|
formatMessage = _useIntl2.formatMessage;
|
|
7272
6758
|
return jsx(ConfirmationDialog, {
|
|
7273
6759
|
isOpen: props.isOpen || false,
|
|
7274
|
-
title: formatMessage(messages$
|
|
7275
|
-
labelPrimary: formatMessage(messages$
|
|
6760
|
+
title: formatMessage(messages$w.confirmationDialogTitle),
|
|
6761
|
+
labelPrimary: formatMessage(messages$w.nestedAttributesConfirmLabel),
|
|
7276
6762
|
onConfirm: props.onConfirm,
|
|
7277
6763
|
onCancel: props.onCancel,
|
|
7278
6764
|
children: jsx(Text.Body, {
|
|
7279
|
-
intlMessage: messages$
|
|
6765
|
+
intlMessage: messages$w.confirmationDialogBody
|
|
7280
6766
|
})
|
|
7281
6767
|
});
|
|
7282
6768
|
};
|
|
@@ -7285,10 +6771,7 @@ const NestedAttributeModalPage = props => {
|
|
|
7285
6771
|
const _useIntl3 = useIntl(),
|
|
7286
6772
|
formatMessage = _useIntl3.formatMessage;
|
|
7287
6773
|
const formik = useFormikContext();
|
|
7288
|
-
const _useTheme = useTheme(),
|
|
7289
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7290
6774
|
const confirmationModal = useModalState();
|
|
7291
|
-
const nestingLevel = useContext(NestingLevelContext);
|
|
7292
6775
|
const handleClose = () => {
|
|
7293
6776
|
if (!formik.dirty) props.onClose();else confirmationModal.openModal();
|
|
7294
6777
|
};
|
|
@@ -7297,7 +6780,6 @@ const NestedAttributeModalPage = props => {
|
|
|
7297
6780
|
confirmationModal.closeModal();
|
|
7298
6781
|
props.onClose();
|
|
7299
6782
|
};
|
|
7300
|
-
const columnsTemplate = isNewTheme ? "".concat(customProperties.constraint15) : nestingLevel === 1 ? "repeat(2, ".concat(customProperties.constraint11, ")") : nestingLevel === 5 ? "".concat(customProperties.constraint10) : "repeat(2, ".concat(customProperties.constraint10, ")");
|
|
7301
6783
|
return jsxs(Fragment, {
|
|
7302
6784
|
children: [jsx(CustomFormModalPage, {
|
|
7303
6785
|
isOpen: props.isOpen,
|
|
@@ -7305,11 +6787,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7305
6787
|
children: [jsx(SecondaryButton, {
|
|
7306
6788
|
isDisabled: !formik.dirty,
|
|
7307
6789
|
iconLeft: jsx(RevertIcon, {}),
|
|
7308
|
-
label: formatMessage(messages$
|
|
6790
|
+
label: formatMessage(messages$w.cancelButton),
|
|
7309
6791
|
onClick: formik.resetForm
|
|
7310
6792
|
}), jsx(CustomFormModalPage.FormPrimaryButton, {
|
|
7311
6793
|
isDisabled: !formik.dirty,
|
|
7312
|
-
label: formatMessage(messages$
|
|
6794
|
+
label: formatMessage(messages$w.updateButton),
|
|
7313
6795
|
onClick: formik.handleSubmit
|
|
7314
6796
|
})]
|
|
7315
6797
|
}),
|
|
@@ -7318,7 +6800,7 @@ const NestedAttributeModalPage = props => {
|
|
|
7318
6800
|
title: props.title,
|
|
7319
6801
|
children: jsx(PageContentNarrow, {
|
|
7320
6802
|
children: props.isOpen && jsx(Grid, {
|
|
7321
|
-
gridTemplateColumns:
|
|
6803
|
+
gridTemplateColumns: customProperties.constraint15,
|
|
7322
6804
|
gridGap: customProperties.spacingM,
|
|
7323
6805
|
children: jsx(ProductAttributes, {
|
|
7324
6806
|
isDisabled: props.isDisabled,
|
|
@@ -7338,7 +6820,7 @@ NestedAttributeModalPage.displayName = 'NestedAttributeModalPage';
|
|
|
7338
6820
|
const MaxNestingLevelReached = () => jsx(FieldLabel, {
|
|
7339
6821
|
title: "",
|
|
7340
6822
|
hint: jsx(Text.Body, {
|
|
7341
|
-
intlMessage: messages$
|
|
6823
|
+
intlMessage: messages$x.aboveFifthLevelWarning
|
|
7342
6824
|
}),
|
|
7343
6825
|
hintIcon: jsx(WarningIcon, {})
|
|
7344
6826
|
});
|
|
@@ -7350,7 +6832,7 @@ const NestedInputControls = props => {
|
|
|
7350
6832
|
if (nextNestingLevel >= 6) return jsx(MaxNestingLevelReached, {});
|
|
7351
6833
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7352
6834
|
if (!hasAttributes) return jsx(Text.Body, {
|
|
7353
|
-
intlMessage: messages$
|
|
6835
|
+
intlMessage: messages$w.emptyProductType,
|
|
7354
6836
|
tone: "secondary"
|
|
7355
6837
|
});
|
|
7356
6838
|
return jsxs(Spacings.Inline, {
|
|
@@ -7364,7 +6846,7 @@ const NestedInputControls = props => {
|
|
|
7364
6846
|
children: props.productType.name
|
|
7365
6847
|
}), props.isEmpty && jsx("span", {
|
|
7366
6848
|
children: jsx(Tag, {
|
|
7367
|
-
children: formatMessage(messages$
|
|
6849
|
+
children: formatMessage(messages$x.emptySetItem)
|
|
7368
6850
|
})
|
|
7369
6851
|
})]
|
|
7370
6852
|
}), jsx(EditButton, {
|
|
@@ -7400,13 +6882,13 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7400
6882
|
const valuesAsMap = nameValuePairsToMap(value);
|
|
7401
6883
|
const initialValues = omitUnknownValues(valuesAsMap, attributeDefinitionsAsMap);
|
|
7402
6884
|
const openNestedAttributesForm = () => {
|
|
7403
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6885
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$K(_objectSpread$K({}, parentFormik.status), {}, {
|
|
7404
6886
|
hideSaveToolbar: true
|
|
7405
6887
|
}));
|
|
7406
6888
|
attributesForm.openModal();
|
|
7407
6889
|
};
|
|
7408
6890
|
const closeNestedAttributesForm = () => {
|
|
7409
|
-
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$
|
|
6891
|
+
if (nestingLevel === 0) parentFormik.setStatus(_objectSpread$K(_objectSpread$K({}, parentFormik.status), {}, {
|
|
7410
6892
|
hideSaveToolbar: false
|
|
7411
6893
|
}));
|
|
7412
6894
|
attributesForm.closeModal();
|
|
@@ -7426,7 +6908,7 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7426
6908
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7427
6909
|
kind: 'success',
|
|
7428
6910
|
domain: DOMAINS.SIDE,
|
|
7429
|
-
text: formatMessage(messages$
|
|
6911
|
+
text: formatMessage(messages$w.attributeUpdateSucceeded)
|
|
7430
6912
|
});
|
|
7431
6913
|
setSubmitting(false);
|
|
7432
6914
|
},
|
|
@@ -7447,10 +6929,238 @@ const CustomNestedInput = /*#__PURE__*/memo(props => {
|
|
|
7447
6929
|
})
|
|
7448
6930
|
})
|
|
7449
6931
|
})
|
|
7450
|
-
})
|
|
6932
|
+
})
|
|
6933
|
+
});
|
|
6934
|
+
});
|
|
6935
|
+
CustomNestedInput.displayName = 'CustomNestedInput';
|
|
6936
|
+
|
|
6937
|
+
var styles$d = {
|
|
6938
|
+
"divider": "divider-module__divider___4-vdy",
|
|
6939
|
+
"divider-solid": "divider-module__divider-solid___3Fs4q divider-module__divider___4-vdy",
|
|
6940
|
+
"divider-dashed": "divider-module__divider-dashed___2Em8A divider-module__divider___4-vdy"
|
|
6941
|
+
};
|
|
6942
|
+
function Divider(_ref) {
|
|
6943
|
+
let isDashed = _ref.isDashed;
|
|
6944
|
+
return jsx("hr", {
|
|
6945
|
+
className: classnames({
|
|
6946
|
+
[styles$d['divider-solid']]: !isDashed,
|
|
6947
|
+
[styles$d['divider-dashed']]: isDashed
|
|
6948
|
+
})
|
|
6949
|
+
});
|
|
6950
|
+
}
|
|
6951
|
+
Divider.displayName = 'Divider';
|
|
6952
|
+
|
|
6953
|
+
const ExpandButton = props => props.totalValues > 1 ? jsxs(Spacings.Stack, {
|
|
6954
|
+
scale: "s",
|
|
6955
|
+
alignItems: "center",
|
|
6956
|
+
children: [jsx(Constraints.Horizontal, {
|
|
6957
|
+
children: jsx(Divider, {})
|
|
6958
|
+
}), jsx(FlatButton, {
|
|
6959
|
+
tone: "primary",
|
|
6960
|
+
icon: props.isExpanded ? jsx(AngleUpIcon, {}) : jsx(AngleDownIcon, {}),
|
|
6961
|
+
label: props.isExpanded ? "Hide set items (".concat(props.totalValues, ")") : "Show all set items (".concat(props.totalValues, ")"),
|
|
6962
|
+
onClick: props.onExpand
|
|
6963
|
+
})]
|
|
6964
|
+
}) : null;
|
|
6965
|
+
ExpandButton.displayName = 'ExpandButton';
|
|
6966
|
+
|
|
6967
|
+
var styles$c = {
|
|
6968
|
+
"topAlign": "set-buttons-module__topAlign___3AZwc",
|
|
6969
|
+
"gap": "set-buttons-module__gap___38Qr0"
|
|
6970
|
+
}; // TODO(pa3): alignment of buttons made in a kinda ugly way (i.e. gap class).
|
|
6971
|
+
// have to find a better way to do it.
|
|
6972
|
+
const SetButtons = props => {
|
|
6973
|
+
return jsx("div", {
|
|
6974
|
+
children: jsxs(Spacings.Inline, {
|
|
6975
|
+
children: [jsx(IconButton, {
|
|
6976
|
+
label: "Remove value",
|
|
6977
|
+
onClick: props.onRemoveItem,
|
|
6978
|
+
isDisabled: props.isRemoveDisabled,
|
|
6979
|
+
size: "big",
|
|
6980
|
+
icon: jsx(BinLinearIcon, {})
|
|
6981
|
+
}), props.isFirstItem ? jsx(IconButton, {
|
|
6982
|
+
label: "Add value",
|
|
6983
|
+
onClick: props.onAddItem,
|
|
6984
|
+
isDisabled: props.isAddDisabled,
|
|
6985
|
+
size: "big",
|
|
6986
|
+
icon: jsx(PlusBoldIcon, {})
|
|
6987
|
+
}) : jsx("div", {
|
|
6988
|
+
className: styles$c.gap
|
|
6989
|
+
})]
|
|
6990
|
+
})
|
|
6991
|
+
});
|
|
6992
|
+
};
|
|
6993
|
+
SetButtons.displayName = 'SetButtons';
|
|
6994
|
+
|
|
6995
|
+
function ownKeys$J(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; }
|
|
6996
|
+
function _objectSpread$J(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$J(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$J(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6997
|
+
const getDuplicateErrors = setValues => {
|
|
6998
|
+
/* eslint-disable no-plusplus */
|
|
6999
|
+
const result = [];
|
|
7000
|
+
if (!setValues) return result;
|
|
7001
|
+
for (let i = 0; i < setValues.length; i++) {
|
|
7002
|
+
for (let j = i + 1; j < setValues.length; j++) {
|
|
7003
|
+
if (deepEqual(setValues[i], setValues[j])) {
|
|
7004
|
+
result[i] = {
|
|
7005
|
+
duplicated: true
|
|
7006
|
+
};
|
|
7007
|
+
result[j] = {
|
|
7008
|
+
duplicated: true
|
|
7009
|
+
};
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
}
|
|
7013
|
+
return result;
|
|
7014
|
+
/* eslint-enable no-plusplus */
|
|
7015
|
+
};
|
|
7016
|
+
|
|
7017
|
+
const isEmpty$1 = value => value.length === 0;
|
|
7018
|
+
const nullifyIfEmpty = value => isEmpty$1(value) ? undefined : value;
|
|
7019
|
+
const dropEmptyEntries = value => _Array$isArray(value) ? _filterInstanceProperty(value).call(value, item => !isNil$1(item)) : value;
|
|
7020
|
+
const removeArrayItem = (array, index) => {
|
|
7021
|
+
const head = _sliceInstanceProperty(array).call(array, 0, index);
|
|
7022
|
+
const tail = _sliceInstanceProperty(array).call(array, index + 1);
|
|
7023
|
+
return [...head, ...tail];
|
|
7024
|
+
};
|
|
7025
|
+
const replaceArrayItem = (array, index, newItem) => {
|
|
7026
|
+
const head = _sliceInstanceProperty(array).call(array, 0, index);
|
|
7027
|
+
const tail = _sliceInstanceProperty(array).call(array, index + 1);
|
|
7028
|
+
return [...head, newItem, ...tail];
|
|
7029
|
+
};
|
|
7030
|
+
const getItemIndex = name => {
|
|
7031
|
+
const indexPartStart = _lastIndexOfInstanceProperty(name).call(name, '[');
|
|
7032
|
+
const indexPartEnd = _lastIndexOfInstanceProperty(name).call(name, ']');
|
|
7033
|
+
const rawIndex = name.substring(indexPartStart + 1, indexPartEnd);
|
|
7034
|
+
return _parseInt(rawIndex, 10);
|
|
7035
|
+
};
|
|
7036
|
+
const makeKeys = amount => times(amount, () => v4());
|
|
7037
|
+
const makeItemFieldName = (fieldName, index) => {
|
|
7038
|
+
var _context;
|
|
7039
|
+
return _concatInstanceProperty(_context = "".concat(fieldName, ".[")).call(_context, index, "]");
|
|
7040
|
+
};
|
|
7041
|
+
const makeMapForAllItems = (fieldName, items, value) => _reduceInstanceProperty(items).call(items, (result, item, index) => set(result, makeItemFieldName(fieldName, index), value), {});
|
|
7042
|
+
function CustomInputSet(props) {
|
|
7043
|
+
var _context2;
|
|
7044
|
+
const _useToggleState = useToggleState(false),
|
|
7045
|
+
_useToggleState2 = _slicedToArray(_useToggleState, 2),
|
|
7046
|
+
isExpanded = _useToggleState2[0],
|
|
7047
|
+
toggleExpansion = _useToggleState2[1];
|
|
7048
|
+
const _useFormikContext = useFormikContext(),
|
|
7049
|
+
setTouched = _useFormikContext.setTouched,
|
|
7050
|
+
touched = _useFormikContext.touched,
|
|
7051
|
+
isSubmitting = _useFormikContext.isSubmitting,
|
|
7052
|
+
dirty = _useFormikContext.dirty;
|
|
7053
|
+
const itemFieldDefinition = _objectSpread$J(_objectSpread$J({}, props.fieldDefinition), {}, {
|
|
7054
|
+
type: props.fieldDefinition.type.elementType
|
|
7055
|
+
});
|
|
7056
|
+
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
7057
|
+
const _useState = useState(value),
|
|
7058
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7059
|
+
internalValue = _useState2[0],
|
|
7060
|
+
setInternalValue = _useState2[1];
|
|
7061
|
+
const _useState3 = useState(makeKeys(internalValue.length)),
|
|
7062
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
7063
|
+
keys = _useState4[0],
|
|
7064
|
+
setKeys = _useState4[1];
|
|
7065
|
+
const totalAmount = internalValue === null || internalValue === void 0 ? void 0 : internalValue.length;
|
|
7066
|
+
const amountToRender = isExpanded ? totalAmount : 1;
|
|
7067
|
+
const updateInternalValue = newValue => {
|
|
7068
|
+
const valueToSet = isEmpty$1(newValue) ? [undefined] : newValue;
|
|
7069
|
+
setInternalValue(valueToSet);
|
|
7070
|
+
if (valueToSet.length !== keys.length) {
|
|
7071
|
+
setKeys(makeKeys(valueToSet.length));
|
|
7072
|
+
}
|
|
7073
|
+
};
|
|
7074
|
+
|
|
7075
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7076
|
+
useEffect(() => updateInternalValue(value), [value]);
|
|
7077
|
+
|
|
7078
|
+
// Filter out all empty values on form submit
|
|
7079
|
+
useEffect(() => {
|
|
7080
|
+
if (isSubmitting || !dirty) {
|
|
7081
|
+
const withoutEmpty = dropEmptyEntries(value);
|
|
7082
|
+
if (!deepEqual(withoutEmpty, dropEmptyEntries(internalValue))) {
|
|
7083
|
+
setKeys(makeKeys(withoutEmpty.length || 1));
|
|
7084
|
+
}
|
|
7085
|
+
updateInternalValue(withoutEmpty);
|
|
7086
|
+
}
|
|
7087
|
+
// I do really want to run it only when isSubmitting or dirty values change.
|
|
7088
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7089
|
+
}, [isSubmitting, dirty]);
|
|
7090
|
+
const markAllItemsAsTouched = items => setTouched(merge({}, touched, makeMapForAllItems(props.name, items, true)));
|
|
7091
|
+
const setNewValue = newValue => {
|
|
7092
|
+
const withoutEmpty = dropEmptyEntries(newValue);
|
|
7093
|
+
const nullified = nullifyIfEmpty(withoutEmpty);
|
|
7094
|
+
updateInternalValue(withoutEmpty);
|
|
7095
|
+
markAllItemsAsTouched(withoutEmpty);
|
|
7096
|
+
props.setFieldValue(props.name, nullified);
|
|
7097
|
+
};
|
|
7098
|
+
const addNewItem = () => updateInternalValue([undefined, ...internalValue]);
|
|
7099
|
+
const removeItem = index => {
|
|
7100
|
+
setNewValue(removeArrayItem(internalValue, index));
|
|
7101
|
+
};
|
|
7102
|
+
const setItemValue = (itemName, itemValue) => {
|
|
7103
|
+
const index = getItemIndex(itemName);
|
|
7104
|
+
const newValue = replaceArrayItem(internalValue, index, itemValue);
|
|
7105
|
+
setNewValue(newValue);
|
|
7106
|
+
};
|
|
7107
|
+
|
|
7108
|
+
// TODO(pa3): I don't like this bool. Feels like decision should happen
|
|
7109
|
+
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
7110
|
+
// type is selected.
|
|
7111
|
+
const type = getType$1(props.fieldDefinition);
|
|
7112
|
+
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
7113
|
+
const areButtonsTopAligned = _includesInstanceProperty(_context2 = [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(_context2, typeName);
|
|
7114
|
+
return jsxs(Fragment, {
|
|
7115
|
+
children: [jsx(AccessibleHidden, {
|
|
7116
|
+
children: jsx("label", {
|
|
7117
|
+
id: props.name,
|
|
7118
|
+
children: props.name
|
|
7119
|
+
})
|
|
7120
|
+
}), jsx("div", {
|
|
7121
|
+
children: jsx(Field, {
|
|
7122
|
+
name: props.name,
|
|
7123
|
+
validate: values => {
|
|
7124
|
+
const errors = getDuplicateErrors(values);
|
|
7125
|
+
return errors.length > 0 ? errors : undefined;
|
|
7126
|
+
},
|
|
7127
|
+
children: () => jsxs(Spacings.Stack, {
|
|
7128
|
+
scale: "s",
|
|
7129
|
+
"data-testid": props.name,
|
|
7130
|
+
children: [times(amountToRender, index => {
|
|
7131
|
+
const fieldName = makeItemFieldName(props.name, index);
|
|
7132
|
+
const fieldValue = internalValue[index];
|
|
7133
|
+
return jsxs(Spacings.Inline, {
|
|
7134
|
+
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
7135
|
+
children: [jsx(CustomFieldInput, {
|
|
7136
|
+
name: fieldName,
|
|
7137
|
+
fieldDefinition: itemFieldDefinition,
|
|
7138
|
+
isDisabled: props.isDisabled,
|
|
7139
|
+
isReadOnly: props.isReadOnly,
|
|
7140
|
+
onBlur: props.onBlur,
|
|
7141
|
+
setFieldValue: setItemValue,
|
|
7142
|
+
value: fieldValue,
|
|
7143
|
+
hasError: props.hasError
|
|
7144
|
+
}), jsx(SetButtons, {
|
|
7145
|
+
index: index,
|
|
7146
|
+
isFirstItem: !isExpanded || index === 0,
|
|
7147
|
+
onAddItem: addNewItem,
|
|
7148
|
+
onRemoveItem: () => removeItem(index),
|
|
7149
|
+
isRemoveDisabled: props.isDisabled || props.isReadOnly || internalValue.length === 1,
|
|
7150
|
+
isAddDisabled: props.isDisabled || props.isReadOnly || !internalValue[0],
|
|
7151
|
+
isTopAligned: areButtonsTopAligned
|
|
7152
|
+
})]
|
|
7153
|
+
}, keys[index]);
|
|
7154
|
+
}), jsx(ExpandButton, {
|
|
7155
|
+
totalValues: totalAmount,
|
|
7156
|
+
isExpanded: isExpanded,
|
|
7157
|
+
onExpand: toggleExpansion
|
|
7158
|
+
})]
|
|
7159
|
+
})
|
|
7160
|
+
})
|
|
7161
|
+
})]
|
|
7451
7162
|
});
|
|
7452
|
-
}
|
|
7453
|
-
CustomNestedInput.displayName = 'CustomNestedInput';
|
|
7163
|
+
}
|
|
7454
7164
|
|
|
7455
7165
|
const nonSetComponents = {
|
|
7456
7166
|
[CUSTOM_FIELD_TYPES.text]: CustomTextInput,
|
|
@@ -7500,6 +7210,209 @@ const CustomFieldInput = /*#__PURE__*/memo(props => {
|
|
|
7500
7210
|
});
|
|
7501
7211
|
CustomFieldInput.displayName = 'CustomFieldInput';
|
|
7502
7212
|
|
|
7213
|
+
var messages$v = defineMessages({
|
|
7214
|
+
referencedProductType: {
|
|
7215
|
+
id: 'NestedAttributes.referencedProductType',
|
|
7216
|
+
description: 'Product type referenced hint',
|
|
7217
|
+
defaultMessage: 'Product type referenced: {productTypeName}'
|
|
7218
|
+
}
|
|
7219
|
+
});
|
|
7220
|
+
|
|
7221
|
+
function ownKeys$I(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; }
|
|
7222
|
+
function _objectSpread$I(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$I(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$I(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7223
|
+
function ProductTypeReference(props) {
|
|
7224
|
+
const productTypeMessage = _objectSpread$I(_objectSpread$I({}, messages$v.referencedProductType), {}, {
|
|
7225
|
+
values: {
|
|
7226
|
+
productTypeName: props.productType.name
|
|
7227
|
+
}
|
|
7228
|
+
});
|
|
7229
|
+
return jsx(Text.Detail, {
|
|
7230
|
+
intlMessage: productTypeMessage
|
|
7231
|
+
});
|
|
7232
|
+
}
|
|
7233
|
+
ProductTypeReference.displayName = 'ProductTypeReference';
|
|
7234
|
+
|
|
7235
|
+
function CustomNestedFieldInput(props) {
|
|
7236
|
+
const typeName = props.fieldDefinition.type.name.toLowerCase();
|
|
7237
|
+
const isSet = typeName === 'set';
|
|
7238
|
+
const _useNestedProductType = useNestedProductType(props.fieldDefinition),
|
|
7239
|
+
productType = _useNestedProductType.productType,
|
|
7240
|
+
error = _useNestedProductType.error;
|
|
7241
|
+
if (error) return jsxs(Spacings.Inline, {
|
|
7242
|
+
scale: "s",
|
|
7243
|
+
alignItems: "center",
|
|
7244
|
+
children: [jsx(ErrorIcon, {
|
|
7245
|
+
color: "error"
|
|
7246
|
+
}), jsx(Text.Body, {
|
|
7247
|
+
tone: "negative",
|
|
7248
|
+
intlMessage: commonPickerMessages.loadingErrorMessage
|
|
7249
|
+
})]
|
|
7250
|
+
});
|
|
7251
|
+
if (!productType) return null;
|
|
7252
|
+
const InputComponent = isSet ? CustomInputSet : CustomNestedInput;
|
|
7253
|
+
return jsxs(Fragment, {
|
|
7254
|
+
children: [jsx(ProductTypeReference, {
|
|
7255
|
+
productType: productType
|
|
7256
|
+
}), jsx(InputComponent, {
|
|
7257
|
+
name: props.name,
|
|
7258
|
+
productType: productType,
|
|
7259
|
+
fieldDefinition: props.fieldDefinition,
|
|
7260
|
+
value: props.value,
|
|
7261
|
+
isDisabled: props.isDisabled,
|
|
7262
|
+
isReadOnly: props.isReadOnly,
|
|
7263
|
+
setFieldValue: props.setFieldValue,
|
|
7264
|
+
onBlur: props.onBlur
|
|
7265
|
+
})]
|
|
7266
|
+
});
|
|
7267
|
+
}
|
|
7268
|
+
CustomNestedFieldInput.displayName = 'CustomNestedFieldInput';
|
|
7269
|
+
|
|
7270
|
+
function ownKeys$H(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; }
|
|
7271
|
+
function _objectSpread$H(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$H(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$H(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7272
|
+
const mergeSetItemsErrors = errors => _reduceInstanceProperty(errors).call(errors, (result, itemErrors) => _objectSpread$H(_objectSpread$H({}, result), itemErrors), {});
|
|
7273
|
+
|
|
7274
|
+
// TODO(pa3): worth splitting in two components: one of set errors and one for
|
|
7275
|
+
// all the other types of fields. So that there will be no isArray check.
|
|
7276
|
+
const CustomFieldErrors = props => {
|
|
7277
|
+
// We want to highlight fields with errors not only after a form submission,
|
|
7278
|
+
// but also after manually triggered form validation.
|
|
7279
|
+
const didFormValidationFail = useDidFormValidationFail();
|
|
7280
|
+
const errors = _Array$isArray(props.errors) ? mergeSetItemsErrors(props.errors) : props.errors;
|
|
7281
|
+
return jsxs(Fragment, {
|
|
7282
|
+
children: [props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.missing) && jsx(ErrorMessage, {
|
|
7283
|
+
intlMessage: messages$J.required
|
|
7284
|
+
}), props.isTouched || didFormValidationFail && (errors === null || errors === void 0 ? void 0 : errors.duplicated) && jsx(ErrorMessage, {
|
|
7285
|
+
intlMessage: messages$J.unique
|
|
7286
|
+
})]
|
|
7287
|
+
});
|
|
7288
|
+
};
|
|
7289
|
+
CustomFieldErrors.displayName = 'CustomFieldErrors';
|
|
7290
|
+
|
|
7291
|
+
var messages$u = defineMessages({
|
|
7292
|
+
productReferenceLabel: {
|
|
7293
|
+
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7294
|
+
description: 'Label shown above the product picker input.',
|
|
7295
|
+
defaultMessage: 'Product (case sensitive field)'
|
|
7296
|
+
},
|
|
7297
|
+
productTypeReferenceLabel: {
|
|
7298
|
+
id: 'CustomFieldsLabel.productTypeReferenceLabel',
|
|
7299
|
+
description: 'Label shown above the product type picker input.',
|
|
7300
|
+
defaultMessage: 'Product type (case sensitive field)'
|
|
7301
|
+
},
|
|
7302
|
+
productTypeReferenceLabelI: {
|
|
7303
|
+
id: 'CustomFieldsLabel.productTypeReferenceLabelI',
|
|
7304
|
+
description: 'Label shown above the product type picker input for indexed project.',
|
|
7305
|
+
defaultMessage: 'Product type'
|
|
7306
|
+
},
|
|
7307
|
+
stateReferenceLabel: {
|
|
7308
|
+
id: 'CustomFieldsLabel.stateReferenceLabel',
|
|
7309
|
+
description: 'Label shown above the state picker input.',
|
|
7310
|
+
defaultMessage: 'State (case sensitive field)'
|
|
7311
|
+
},
|
|
7312
|
+
channelReferenceLabel: {
|
|
7313
|
+
id: 'CustomFieldsLabel.channelReferenceLabel',
|
|
7314
|
+
description: 'Label shown above the channel picker input.',
|
|
7315
|
+
defaultMessage: 'Channel (case sensitive field)'
|
|
7316
|
+
},
|
|
7317
|
+
cartDiscountMoreThan500: {
|
|
7318
|
+
id: 'cartDiscountMoreThan500',
|
|
7319
|
+
description: 'Cart discounts must be selected by exact match of name, ID or key.',
|
|
7320
|
+
defaultMessage: 'Cart discounts must be selected by exact match of name, ID or key.'
|
|
7321
|
+
}
|
|
7322
|
+
});
|
|
7323
|
+
|
|
7324
|
+
function ownKeys$G(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; }
|
|
7325
|
+
function _objectSpread$G(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$G(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$G(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7326
|
+
var CartDiscountsCount = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "CartDiscountsCount" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 61, source: { body: "query CartDiscountsCount {\n cartDiscounts {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7327
|
+
const CustomFieldsLabelHint = _ref => {
|
|
7328
|
+
var _type$name;
|
|
7329
|
+
let fieldDefinition = _ref.fieldDefinition;
|
|
7330
|
+
const type = getType$1(fieldDefinition);
|
|
7331
|
+
const isReference = ((_type$name = type.name) === null || _type$name === void 0 ? void 0 : _type$name.toLowerCase()) === 'reference';
|
|
7332
|
+
const referenceTypeId = type.referenceTypeId;
|
|
7333
|
+
const isCartDiscountsReference = isReference && referenceTypeId === SEARCHABLE_REFERENCES.cartDiscount;
|
|
7334
|
+
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
7335
|
+
languages: applicationContext.project.languages,
|
|
7336
|
+
dataLocale: applicationContext.dataLocale
|
|
7337
|
+
})),
|
|
7338
|
+
languages = _useApplicationContex.languages,
|
|
7339
|
+
dataLocale = _useApplicationContex.dataLocale;
|
|
7340
|
+
const _useQuery = useQuery(CartDiscountsCount, {
|
|
7341
|
+
skip: !isCartDiscountsReference,
|
|
7342
|
+
context: {
|
|
7343
|
+
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
7344
|
+
}
|
|
7345
|
+
}),
|
|
7346
|
+
data = _useQuery.data,
|
|
7347
|
+
loading = _useQuery.loading;
|
|
7348
|
+
if (loading) return null;
|
|
7349
|
+
if ((data === null || data === void 0 ? void 0 : data.cartDiscounts.total) > QUERY_MAX_LIMIT) {
|
|
7350
|
+
return jsxs(Spacings.Inline, {
|
|
7351
|
+
alignItems: "center",
|
|
7352
|
+
children: [jsx(WarningIcon, {
|
|
7353
|
+
size: "medium",
|
|
7354
|
+
color: "warning"
|
|
7355
|
+
}), jsx(FormattedMessage, _objectSpread$G({}, messages$u.cartDiscountMoreThan500))]
|
|
7356
|
+
});
|
|
7357
|
+
}
|
|
7358
|
+
return formatLocalizedString(fieldDefinition, {
|
|
7359
|
+
key: 'inputTip',
|
|
7360
|
+
locale: dataLocale,
|
|
7361
|
+
fallbackOrder: languages
|
|
7362
|
+
});
|
|
7363
|
+
};
|
|
7364
|
+
function CustomFieldsProductTypeReferenceSubtitle() {
|
|
7365
|
+
const _useIntl = useIntl(),
|
|
7366
|
+
formatMessage = _useIntl.formatMessage;
|
|
7367
|
+
const _usePimStatus = usePimStatus(),
|
|
7368
|
+
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7369
|
+
if (isProjectIndexed) return formatMessage(messages$u.productTypeReferenceLabelI);
|
|
7370
|
+
return formatMessage(messages$u.productTypeReferenceLabel);
|
|
7371
|
+
}
|
|
7372
|
+
|
|
7373
|
+
// TODO(pa3): this logic may be misplaced and probably
|
|
7374
|
+
// should belong to <CustomReferenceInput /> component instead.
|
|
7375
|
+
function CustomFieldsLabelSubtitle(_ref2) {
|
|
7376
|
+
var _type$name2, _context;
|
|
7377
|
+
let fieldDefinition = _ref2.fieldDefinition;
|
|
7378
|
+
const _useIntl2 = useIntl(),
|
|
7379
|
+
formatMessage = _useIntl2.formatMessage;
|
|
7380
|
+
const type = getType$1(fieldDefinition);
|
|
7381
|
+
const isReference = ((_type$name2 = type.name) === null || _type$name2 === void 0 ? void 0 : _type$name2.toLowerCase()) === 'reference';
|
|
7382
|
+
if (!isReference) return null;
|
|
7383
|
+
const referenceTypeId = type.referenceTypeId;
|
|
7384
|
+
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7385
|
+
if (_includesInstanceProperty(_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7386
|
+
return referenceTypeId === SEARCHABLE_REFERENCES.product ? formatMessage(messages$u.productReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.productType ? jsx(CustomFieldsProductTypeReferenceSubtitle, {}) : referenceTypeId === SEARCHABLE_REFERENCES.channel ? formatMessage(messages$u.channelReferenceLabel) : referenceTypeId === SEARCHABLE_REFERENCES.state ? formatMessage(messages$u.stateReferenceLabel) : "".concat(referenceTypeName, " ID");
|
|
7387
|
+
}
|
|
7388
|
+
const CustomFieldsLabel = /*#__PURE__*/memo(_ref3 => {
|
|
7389
|
+
let name = _ref3.name,
|
|
7390
|
+
fieldDefinition = _ref3.fieldDefinition;
|
|
7391
|
+
const _useApplicationContex2 = useApplicationContext(applicationContext => ({
|
|
7392
|
+
languages: applicationContext.project.languages,
|
|
7393
|
+
language: applicationContext.dataLocale
|
|
7394
|
+
})),
|
|
7395
|
+
languages = _useApplicationContex2.languages,
|
|
7396
|
+
language = _useApplicationContex2.language;
|
|
7397
|
+
return jsx(FieldLabel, {
|
|
7398
|
+
htmlFor: name,
|
|
7399
|
+
title: formatLocalizedString(fieldDefinition, {
|
|
7400
|
+
key: 'label',
|
|
7401
|
+
locale: language,
|
|
7402
|
+
fallbackOrder: languages,
|
|
7403
|
+
fallback: fieldDefinition.name
|
|
7404
|
+
}),
|
|
7405
|
+
description: jsx(CustomFieldsLabelSubtitle, {
|
|
7406
|
+
fieldDefinition: fieldDefinition
|
|
7407
|
+
}),
|
|
7408
|
+
hint: jsx(CustomFieldsLabelHint, {
|
|
7409
|
+
fieldDefinition: fieldDefinition
|
|
7410
|
+
}),
|
|
7411
|
+
hasRequiredIndicator: fieldDefinition.required
|
|
7412
|
+
});
|
|
7413
|
+
});
|
|
7414
|
+
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
7415
|
+
|
|
7503
7416
|
const getFieldName = (parentName, fieldName) => {
|
|
7504
7417
|
var _context;
|
|
7505
7418
|
if (!parentName) return fieldName;
|
|
@@ -7522,8 +7435,6 @@ const CustomFieldsInternal = props => {
|
|
|
7522
7435
|
handleBlur = _useFormikContext.handleBlur;
|
|
7523
7436
|
const didFormValidationFail = useDidFormValidationFail();
|
|
7524
7437
|
const fieldDefinitions = omitSetsOfSets(props.fieldDefinitions);
|
|
7525
|
-
const nestingLevel = useContext(NestingLevelContext);
|
|
7526
|
-
const isCurrentFieldNested = nestingLevel > 0;
|
|
7527
7438
|
return jsx(Fragment, {
|
|
7528
7439
|
children: _mapInstanceProperty(fieldDefinitions).call(fieldDefinitions, (fieldDefinition, index) => {
|
|
7529
7440
|
var _context2;
|
|
@@ -7543,43 +7454,36 @@ const CustomFieldsInternal = props => {
|
|
|
7543
7454
|
return jsx(FastField, {
|
|
7544
7455
|
name: fieldName,
|
|
7545
7456
|
validate: validate,
|
|
7546
|
-
children: () =>
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
}), jsx(CustomFieldErrors, {
|
|
7577
|
-
isTouched: isTouched,
|
|
7578
|
-
errors: fieldErrors
|
|
7579
|
-
})]
|
|
7580
|
-
})]
|
|
7581
|
-
})
|
|
7582
|
-
})
|
|
7457
|
+
children: () => jsxs(Spacings.Stack, {
|
|
7458
|
+
scale: "xs",
|
|
7459
|
+
children: [jsx(CustomFieldsLabel, {
|
|
7460
|
+
name: fieldName,
|
|
7461
|
+
fieldDefinition: fieldDefinition
|
|
7462
|
+
}), jsxs(Spacings.Stack, {
|
|
7463
|
+
scale: "xs",
|
|
7464
|
+
alignItems: "stretch",
|
|
7465
|
+
children: [isNested(fieldDefinition) ? jsx(CustomNestedFieldInput, {
|
|
7466
|
+
name: fieldName,
|
|
7467
|
+
value: value,
|
|
7468
|
+
fieldDefinition: fieldDefinition,
|
|
7469
|
+
isDisabled: props.isDisabled,
|
|
7470
|
+
isReadOnly: props.isReadOnly,
|
|
7471
|
+
onBlur: handleBlur,
|
|
7472
|
+
setFieldValue: props.setFieldValue
|
|
7473
|
+
}) : jsx(CustomFieldInput, {
|
|
7474
|
+
name: fieldName,
|
|
7475
|
+
value: value,
|
|
7476
|
+
fieldDefinition: fieldDefinition,
|
|
7477
|
+
isDisabled: props.isDisabled,
|
|
7478
|
+
isReadOnly: props.isReadOnly,
|
|
7479
|
+
onBlur: handleBlur,
|
|
7480
|
+
setFieldValue: props.setFieldValue,
|
|
7481
|
+
hasError: hasError
|
|
7482
|
+
}), jsx(CustomFieldErrors, {
|
|
7483
|
+
isTouched: isTouched,
|
|
7484
|
+
errors: fieldErrors
|
|
7485
|
+
})]
|
|
7486
|
+
})]
|
|
7583
7487
|
})
|
|
7584
7488
|
}, _concatInstanceProperty(_context2 = "".concat(fieldName, "-")).call(_context2, index));
|
|
7585
7489
|
})
|
|
@@ -7587,21 +7491,18 @@ const CustomFieldsInternal = props => {
|
|
|
7587
7491
|
};
|
|
7588
7492
|
CustomFieldsInternal.displayName = 'CustomFieldsInternal';
|
|
7589
7493
|
|
|
7590
|
-
// TODO: @redesign cleanup
|
|
7591
7494
|
const nopConverter = (fieldName, fieldValue) => fieldValue;
|
|
7592
7495
|
const CustomFields = props => {
|
|
7593
7496
|
const _useFormikContext = useFormikContext(),
|
|
7594
7497
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
7595
|
-
const _useTheme = useTheme(),
|
|
7596
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
7597
7498
|
|
|
7598
7499
|
// Ensure you pass isWidthExpanded=true when adding the new layout component so the custom fields
|
|
7599
7500
|
// can expand to fill the width of the layout.
|
|
7600
|
-
return
|
|
7601
|
-
css: /*#__PURE__*/css("min-width:", props.isWidthExpanded ? '100%' : customProperties.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomFields;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
7501
|
+
return jsx("div", {
|
|
7502
|
+
css: /*#__PURE__*/css("min-width:", props.isWidthExpanded ? '100%' : customProperties.constraint11, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:CustomFields;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS1maWVsZHMuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVjIiwiZmlsZSI6ImN1c3RvbS1maWVsZHMuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCB7IHVzZUZvcm1pa0NvbnRleHQgfSBmcm9tICdmb3JtaWsnO1xuaW1wb3J0IEN1c3RvbUZpZWxkc0ludGVybmFsIGZyb20gJy4vY3VzdG9tLWZpZWxkcy1pbnRlcm5hbCc7XG5pbXBvcnQgeyBjdXN0b21Qcm9wZXJ0aWVzLCBTcGFjaW5ncyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCc7XG5cbmNvbnN0IG5vcENvbnZlcnRlciA9IChmaWVsZE5hbWUsIGZpZWxkVmFsdWUpID0+IGZpZWxkVmFsdWU7XG5cbmNvbnN0IEN1c3RvbUZpZWxkcyA9IChwcm9wcykgPT4ge1xuICBjb25zdCB7IHNldEZpZWxkVmFsdWUgfSA9IHVzZUZvcm1pa0NvbnRleHQoKTtcblxuICAvLyBFbnN1cmUgeW91IHBhc3MgaXNXaWR0aEV4cGFuZGVkPXRydWUgd2hlbiBhZGRpbmcgdGhlIG5ldyBsYXlvdXQgY29tcG9uZW50IHNvIHRoZSBjdXN0b20gZmllbGRzXG4gIC8vIGNhbiBleHBhbmQgdG8gZmlsbCB0aGUgd2lkdGggb2YgdGhlIGxheW91dC5cbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgbWluLXdpZHRoOiAke3Byb3BzLmlzV2lkdGhFeHBhbmRlZFxuICAgICAgICAgID8gJzEwMCUnXG4gICAgICAgICAgOiBjdXN0b21Qcm9wZXJ0aWVzLmNvbnN0cmFpbnQxMX07XG4gICAgICBgfVxuICAgID5cbiAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cInhsXCI+XG4gICAgICAgIDxDdXN0b21GaWVsZHNJbnRlcm5hbFxuICAgICAgICAgIG5hbWU9e3Byb3BzLm5hbWV9XG4gICAgICAgICAgaXNSZWFkT25seT17cHJvcHMuaXNSZWFkT25seX1cbiAgICAgICAgICBpc0Rpc2FibGVkPXtwcm9wcy5pc0Rpc2FibGVkfVxuICAgICAgICAgIGZpZWxkRGVmaW5pdGlvbnM9e3Byb3BzLmZpZWxkRGVmaW5pdGlvbnN9XG4gICAgICAgICAgc2V0RmllbGRWYWx1ZT17c2V0RmllbGRWYWx1ZX1cbiAgICAgICAgICBpbnB1dFZhbHVlc0NvbnZlcnRlcj17bm9wQ29udmVydGVyfVxuICAgICAgICAvPlxuICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG5DdXN0b21GaWVsZHMuZGlzcGxheU5hbWUgPSAnQ3VzdG9tRmllbGRzJztcbkN1c3RvbUZpZWxkcy5wcm9wVHlwZXMgPSB7XG4gIGlzV2lkdGhFeHBhbmRlZDogUHJvcFR5cGVzLmJvb2wsXG4gIGlzUmVhZE9ubHk6IFByb3BUeXBlcy5ib29sLFxuICBpc0Rpc2FibGVkOiBQcm9wVHlwZXMuYm9vbCxcbiAgbmFtZTogUHJvcFR5cGVzLnN0cmluZyxcbiAgZmllbGREZWZpbml0aW9uczogUHJvcFR5cGVzLmFycmF5T2YoXG4gICAgUHJvcFR5cGVzLnNoYXBlKHtcbiAgICAgIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gICAgICByZXF1aXJlZDogUHJvcFR5cGVzLmJvb2wsXG5cbiAgICAgIGlucHV0SGludDogUHJvcFR5cGVzLnN0cmluZyxcbiAgICAgIGlucHV0VGlwOiBQcm9wVHlwZXMub2JqZWN0LFxuICAgICAgbGFiZWw6IFByb3BUeXBlcy5vYmplY3RPZihQcm9wVHlwZXMuc3RyaW5nKSxcblxuICAgICAgdHlwZTogUHJvcFR5cGVzLm9uZU9mVHlwZShbXG4gICAgICAgIFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICAgICAgdHlwZTogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICAgICAgICAgIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gICAgICAgICAgfSksXG4gICAgICAgIH0pLFxuICAgICAgICAvLyBTZXRcbiAgICAgICAgUHJvcFR5cGVzLnNoYXBlKHtcbiAgICAgICAgICBlbGVtZW50VHlwZTogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICAgICAgICAgIHR5cGU6IFByb3BUeXBlcy5zaGFwZSh7XG4gICAgICAgICAgICAgIG5hbWU6IFByb3BUeXBlcy5zdHJpbmcsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICB9KSxcbiAgICAgICAgfSksXG4gICAgICBdKSxcbiAgICB9KVxuICApLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgQ3VzdG9tRmllbGRzO1xuIl19 */"),
|
|
7602
7503
|
children: jsx(Spacings.Stack, {
|
|
7603
7504
|
scale: "xl",
|
|
7604
|
-
children: jsx(
|
|
7505
|
+
children: jsx(CustomFieldsInternal, {
|
|
7605
7506
|
name: props.name,
|
|
7606
7507
|
isReadOnly: props.isReadOnly,
|
|
7607
7508
|
isDisabled: props.isDisabled,
|
|
@@ -7610,21 +7511,6 @@ const CustomFields = props => {
|
|
|
7610
7511
|
inputValuesConverter: nopConverter
|
|
7611
7512
|
})
|
|
7612
7513
|
})
|
|
7613
|
-
}) : jsx(Grid, {
|
|
7614
|
-
"data-testid": "custom-fields",
|
|
7615
|
-
gridTemplateColumns:
|
|
7616
|
-
// TODO: @redesign cleanup
|
|
7617
|
-
isNewTheme ? 'repeat(1, 1fr)' : "repeat(2, minmax(0, ".concat(customProperties.constraint11, "))"),
|
|
7618
|
-
gridGap: customProperties.spacingM,
|
|
7619
|
-
isWidthExpanded: isNewTheme,
|
|
7620
|
-
children: jsx(CustomFieldsInternal, {
|
|
7621
|
-
name: props.name,
|
|
7622
|
-
isReadOnly: props.isReadOnly,
|
|
7623
|
-
isDisabled: props.isDisabled,
|
|
7624
|
-
fieldDefinitions: props.fieldDefinitions,
|
|
7625
|
-
setFieldValue: setFieldValue,
|
|
7626
|
-
inputValuesConverter: nopConverter
|
|
7627
|
-
})
|
|
7628
7514
|
});
|
|
7629
7515
|
};
|
|
7630
7516
|
CustomFields.displayName = 'CustomFields';
|
|
@@ -7652,8 +7538,8 @@ var pickerMessages = defineMessages({
|
|
|
7652
7538
|
}
|
|
7653
7539
|
});
|
|
7654
7540
|
|
|
7655
|
-
function ownKeys$
|
|
7656
|
-
function _objectSpread$
|
|
7541
|
+
function ownKeys$F(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; }
|
|
7542
|
+
function _objectSpread$F(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$F(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$F(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7657
7543
|
const PRODUCT_SELECTION_TYPES = {
|
|
7658
7544
|
INCLUSION: 'individual',
|
|
7659
7545
|
EXCLUSION: 'individual exclusion'
|
|
@@ -7667,7 +7553,7 @@ const addTypeToLabel = function (ps) {
|
|
|
7667
7553
|
var _context;
|
|
7668
7554
|
let enableExcludingProducts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7669
7555
|
if (!ps) return undefined;
|
|
7670
|
-
return _objectSpread$
|
|
7556
|
+
return _objectSpread$F(_objectSpread$F({}, ps), {}, {
|
|
7671
7557
|
label: _concatInstanceProperty(_context = "".concat(ps === null || ps === void 0 ? void 0 : ps.label)).call(_context, enableExcludingProducts ? " (type: ".concat(getType(ps === null || ps === void 0 ? void 0 : ps.type), ")") : '')
|
|
7672
7558
|
});
|
|
7673
7559
|
};
|
|
@@ -8018,12 +7904,12 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8018
7904
|
});
|
|
8019
7905
|
}
|
|
8020
7906
|
|
|
8021
|
-
function ownKeys$
|
|
8022
|
-
function _objectSpread$
|
|
7907
|
+
function ownKeys$E(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; }
|
|
7908
|
+
function _objectSpread$E(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$E(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$E(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8023
7909
|
function TypeSelectInputOption(props) {
|
|
8024
7910
|
const data = props.data;
|
|
8025
7911
|
const noValueFallback = props.noValueFallback || NO_VALUE_FALLBACK;
|
|
8026
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7912
|
+
return jsx(SelectInput.Option, _objectSpread$E(_objectSpread$E({}, props), {}, {
|
|
8027
7913
|
children: jsxs(Spacings.Stack, {
|
|
8028
7914
|
scale: "xs",
|
|
8029
7915
|
children: [jsx(Text.Detail, {
|
|
@@ -8038,18 +7924,18 @@ function TypeSelectInputOption(props) {
|
|
|
8038
7924
|
}));
|
|
8039
7925
|
}
|
|
8040
7926
|
|
|
8041
|
-
function ownKeys$
|
|
8042
|
-
function _objectSpread$
|
|
7927
|
+
function ownKeys$D(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; }
|
|
7928
|
+
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$D(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$D(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8043
7929
|
function ProductSelectionsPicker(props) {
|
|
8044
7930
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8045
7931
|
const components = useMemo(() => {
|
|
8046
7932
|
return {
|
|
8047
7933
|
Option: optionInnerProps => {
|
|
8048
7934
|
if (optionInnerProps.isDisabled) {
|
|
8049
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
7935
|
+
return jsx(SelectInput.Option, _objectSpread$D({}, optionInnerProps));
|
|
8050
7936
|
}
|
|
8051
7937
|
if (props.optionType === TYPE_PROPERTY) {
|
|
8052
|
-
return jsx(TypeSelectInputOption, _objectSpread$
|
|
7938
|
+
return jsx(TypeSelectInputOption, _objectSpread$D({}, optionInnerProps));
|
|
8053
7939
|
}
|
|
8054
7940
|
return jsx(CustomSelectInputOption, {
|
|
8055
7941
|
optionType: props.optionType,
|
|
@@ -8061,7 +7947,7 @@ function ProductSelectionsPicker(props) {
|
|
|
8061
7947
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8062
7948
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8063
7949
|
return jsx(Spacings.Stack, {
|
|
8064
|
-
children: jsx(CustomProductSelectionsPicker, _objectSpread$
|
|
7950
|
+
children: jsx(CustomProductSelectionsPicker, _objectSpread$D(_objectSpread$D({}, props), {}, {
|
|
8065
7951
|
components: components
|
|
8066
7952
|
}))
|
|
8067
7953
|
});
|
|
@@ -8084,7 +7970,7 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8084
7970
|
|
|
8085
7971
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
8086
7972
|
|
|
8087
|
-
var messages$
|
|
7973
|
+
var messages$t = defineMessages({
|
|
8088
7974
|
countriesBasicSelectPlaceholder: {
|
|
8089
7975
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
8090
7976
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -8112,7 +7998,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8112
7998
|
value: props.value,
|
|
8113
7999
|
isRequired: props.isRequired,
|
|
8114
8000
|
description: props.description,
|
|
8115
|
-
placeholder: intl.formatMessage(messages$
|
|
8001
|
+
placeholder: intl.formatMessage(messages$t.countriesBasicSelectPlaceholder),
|
|
8116
8002
|
options: props.options,
|
|
8117
8003
|
onChange: props.onChange,
|
|
8118
8004
|
isDisabled: props.isDisabled,
|
|
@@ -8122,10 +8008,10 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
8122
8008
|
});
|
|
8123
8009
|
}
|
|
8124
8010
|
|
|
8125
|
-
function ownKeys$
|
|
8126
|
-
function _objectSpread$
|
|
8011
|
+
function ownKeys$C(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; }
|
|
8012
|
+
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var _context4, _context5; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context4 = ownKeys$C(Object(source), !0)).call(_context4, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context5 = ownKeys$C(Object(source))).call(_context5, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8127
8013
|
const emptyCountryOption = intl => [{
|
|
8128
|
-
label: intl.formatMessage(messages$
|
|
8014
|
+
label: intl.formatMessage(messages$t.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
8129
8015
|
value: undefined,
|
|
8130
8016
|
isDisabled: true
|
|
8131
8017
|
}];
|
|
@@ -8150,7 +8036,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8150
8036
|
const onOptionChange = event => {
|
|
8151
8037
|
const countries = event.target.value;
|
|
8152
8038
|
props.onChange({
|
|
8153
|
-
target: _objectSpread$
|
|
8039
|
+
target: _objectSpread$C(_objectSpread$C({}, event.target), {}, {
|
|
8154
8040
|
value: _mapInstanceProperty(countries).call(countries, country => {
|
|
8155
8041
|
var _country$value;
|
|
8156
8042
|
return (_country$value = country === null || country === void 0 ? void 0 : country.value) !== null && _country$value !== void 0 ? _country$value : country;
|
|
@@ -8171,7 +8057,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8171
8057
|
var _context3;
|
|
8172
8058
|
return _findInstanceProperty(_context3 = props.options).call(_context3, country => country.value === countryCode);
|
|
8173
8059
|
}),
|
|
8174
|
-
placeholder: intl.formatMessage(messages$
|
|
8060
|
+
placeholder: intl.formatMessage(messages$t.countriesAsyncSelectPlaceholder),
|
|
8175
8061
|
loadOptions: handleLoadOptions,
|
|
8176
8062
|
onChange: onOptionChange,
|
|
8177
8063
|
isDisabled: props.isDisabled,
|
|
@@ -8181,13 +8067,13 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
8181
8067
|
});
|
|
8182
8068
|
}
|
|
8183
8069
|
|
|
8184
|
-
function ownKeys$
|
|
8185
|
-
function _objectSpread$
|
|
8070
|
+
function ownKeys$B(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; }
|
|
8071
|
+
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$B(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$B(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8186
8072
|
function CountriesPicker(props) {
|
|
8187
8073
|
var _props$options;
|
|
8188
8074
|
const CustomCountriesPicker = ((_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.length) <= props.countriesAsyncLoadingLimit ? CountriesBasicSelectDropdown : CountriesAsyncSelectDropdown;
|
|
8189
8075
|
return jsx(Spacings.Stack, {
|
|
8190
|
-
children: jsx(CustomCountriesPicker, _objectSpread$
|
|
8076
|
+
children: jsx(CustomCountriesPicker, _objectSpread$B({}, props))
|
|
8191
8077
|
});
|
|
8192
8078
|
}
|
|
8193
8079
|
CountriesPicker.defaultProps = {
|
|
@@ -8197,7 +8083,7 @@ CountriesPicker.defaultProps = {
|
|
|
8197
8083
|
hasWarning: false
|
|
8198
8084
|
};
|
|
8199
8085
|
|
|
8200
|
-
var messages$
|
|
8086
|
+
var messages$s = defineMessages({
|
|
8201
8087
|
noCustomerGroupsFound: {
|
|
8202
8088
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
8203
8089
|
description: 'The message to display when no customer groups were found',
|
|
@@ -8288,7 +8174,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8288
8174
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
8289
8175
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
8290
8176
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
8291
|
-
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$
|
|
8177
|
+
const handleNoOptions = useCallback(() => loadingError ? null : formatMessage(messages$s.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
8292
8178
|
const 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 : '';
|
|
8293
8179
|
return jsx(Constraints.Horizontal, {
|
|
8294
8180
|
max: "scale",
|
|
@@ -8299,7 +8185,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8299
8185
|
children: jsx(AsyncSelectInput, {
|
|
8300
8186
|
id: name,
|
|
8301
8187
|
name: name,
|
|
8302
|
-
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$
|
|
8188
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : formatMessage(messages$s.placeholder),
|
|
8303
8189
|
loadOptions: loadOptionsDebounced,
|
|
8304
8190
|
defaultOptions: true,
|
|
8305
8191
|
showOptionGroupDivider: true,
|
|
@@ -8369,7 +8255,7 @@ const getFirst60Options = (storesOptions, currentValues) => {
|
|
|
8369
8255
|
return _sliceInstanceProperty(storesOptions).call(storesOptions, 0, LOWER_STORES_LIMIT + currentValuesLength);
|
|
8370
8256
|
};
|
|
8371
8257
|
|
|
8372
|
-
var messages$
|
|
8258
|
+
var messages$r = defineMessages({
|
|
8373
8259
|
basicSelectInputPlaceholder: {
|
|
8374
8260
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
8375
8261
|
description: 'The placeholder shown for basic select input',
|
|
@@ -8402,8 +8288,8 @@ var messages$s = defineMessages({
|
|
|
8402
8288
|
}
|
|
8403
8289
|
});
|
|
8404
8290
|
|
|
8405
|
-
function ownKeys$
|
|
8406
|
-
function _objectSpread$
|
|
8291
|
+
function ownKeys$A(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; }
|
|
8292
|
+
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context5, _context6; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context5 = ownKeys$A(Object(source), !0)).call(_context5, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$A(Object(source))).call(_context6, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8407
8293
|
const hasErrors$2 = errors => {
|
|
8408
8294
|
var _context;
|
|
8409
8295
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8428,7 +8314,7 @@ const getValueFromOptions$1 = _ref => {
|
|
|
8428
8314
|
return _findInstanceProperty(mappedStoresListOptions).call(mappedStoresListOptions, store => currentlySelectedStores === store.value);
|
|
8429
8315
|
};
|
|
8430
8316
|
const emptyStoreOption = intl => [{
|
|
8431
|
-
label: intl.formatMessage(messages$
|
|
8317
|
+
label: intl.formatMessage(messages$r.asyncSelectDropdownTypeAheadPrompt),
|
|
8432
8318
|
value: undefined,
|
|
8433
8319
|
isDisabled: true
|
|
8434
8320
|
}];
|
|
@@ -8448,7 +8334,7 @@ const StoresAsyncSelectInput = props => {
|
|
|
8448
8334
|
stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
|
|
8449
8335
|
projectKey: props.projectKey
|
|
8450
8336
|
});
|
|
8451
|
-
const hasError = AsyncSelectInput.isTouched(props.touched) && hasErrors$2(props.errors);
|
|
8337
|
+
const hasError = AsyncSelectInput.isTouched(props.touched) && hasErrors$2(props.errors) || props.hasError;
|
|
8452
8338
|
const mappedStoresListOptions = useMemo(() => {
|
|
8453
8339
|
var _context2, _storesListFetcher$st;
|
|
8454
8340
|
return _mapInstanceProperty(_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
|
|
@@ -8475,10 +8361,10 @@ const StoresAsyncSelectInput = props => {
|
|
|
8475
8361
|
};
|
|
8476
8362
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8477
8363
|
return jsxs(Fragment, {
|
|
8478
|
-
children: [jsx(AsyncSelectInput, _objectSpread$
|
|
8364
|
+
children: [jsx(AsyncSelectInput, _objectSpread$A(_objectSpread$A({
|
|
8479
8365
|
id: props.id,
|
|
8480
8366
|
name: props.name,
|
|
8481
|
-
placeholder: intl.formatMessage(messages$
|
|
8367
|
+
placeholder: intl.formatMessage(messages$r.basicSelectInputPlaceholder),
|
|
8482
8368
|
horizontalConstraint: props.horizontalConstraint,
|
|
8483
8369
|
loadOptions: handleLoadOptions,
|
|
8484
8370
|
defaultOptions: true,
|
|
@@ -8518,8 +8404,8 @@ StoresAsyncSelectInput.defaultProps = {
|
|
|
8518
8404
|
shouldFetchProductSelections: false
|
|
8519
8405
|
};
|
|
8520
8406
|
|
|
8521
|
-
function ownKeys$
|
|
8522
|
-
function _objectSpread$
|
|
8407
|
+
function ownKeys$z(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; }
|
|
8408
|
+
function _objectSpread$z(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$z(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$z(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8523
8409
|
const hasErrors$1 = errors => {
|
|
8524
8410
|
var _context;
|
|
8525
8411
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
@@ -8540,7 +8426,7 @@ const StoresBasicSelectInput = props => {
|
|
|
8540
8426
|
stores: (keysOfStores === null || keysOfStores === void 0 ? void 0 : keysOfStores.length) && keysOfStores,
|
|
8541
8427
|
projectKey: props.projectKey
|
|
8542
8428
|
});
|
|
8543
|
-
const hasError = SelectInput.isTouched(props.touched) &&
|
|
8429
|
+
const hasError = SelectInput.isTouched(props.touched) && hasErrors$1(props.errors) || props.hasError;
|
|
8544
8430
|
const mappedStoresListOptions = useMemo(() => {
|
|
8545
8431
|
var _context2, _storesListFetcher$st;
|
|
8546
8432
|
return _mapInstanceProperty(_context2 = ((_storesListFetcher$st = storesListFetcher.stores) === null || _storesListFetcher$st === void 0 ? void 0 : _storesListFetcher$st.results) || []).call(_context2, store => mapStoresToOptions({
|
|
@@ -8567,10 +8453,10 @@ const StoresBasicSelectInput = props => {
|
|
|
8567
8453
|
};
|
|
8568
8454
|
if (storesListFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8569
8455
|
return jsxs(Fragment, {
|
|
8570
|
-
children: [jsx(SelectInput, _objectSpread$
|
|
8456
|
+
children: [jsx(SelectInput, _objectSpread$z(_objectSpread$z({
|
|
8571
8457
|
id: props.id,
|
|
8572
8458
|
name: props.name,
|
|
8573
|
-
placeholder: intl.formatMessage(messages$
|
|
8459
|
+
placeholder: intl.formatMessage(messages$r.basicSelectInputPlaceholder),
|
|
8574
8460
|
horizontalConstraint: props.horizontalConstraint,
|
|
8575
8461
|
options: mappedStoresListOptions,
|
|
8576
8462
|
isMulti: props.isMulti,
|
|
@@ -8663,8 +8549,8 @@ const useStoresByFieldFetcher = function (stores, predicateField, projectKey) {
|
|
|
8663
8549
|
};
|
|
8664
8550
|
};
|
|
8665
8551
|
|
|
8666
|
-
function ownKeys$
|
|
8667
|
-
function _objectSpread$
|
|
8552
|
+
function ownKeys$y(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; }
|
|
8553
|
+
function _objectSpread$y(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys$y(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys$y(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8668
8554
|
var FetchStoresByWherePredicate = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresByWherePredicate" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } }, 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", alias: { kind: "Name", value: "storesByWherePredicate" }, name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "skipFetchingStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "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: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 525, source: { body: "query FetchStoresByWherePredicate(\n $where: String!\n $skipFetchingStores: Boolean!\n $excludeProductSelections: Boolean!\n) {\n storesByWherePredicate: stores(where: $where) @skip(if: $skipFetchingStores) {\n results {\n id\n key\n nameAllLocales {\n locale\n value\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 } } } };
|
|
8669
8555
|
const hasErrors = errors => {
|
|
8670
8556
|
var _context;
|
|
@@ -8737,7 +8623,7 @@ const StoresSearchSelectInput = props => {
|
|
|
8737
8623
|
const intl = useIntl();
|
|
8738
8624
|
const client = useApolloClient$1();
|
|
8739
8625
|
const storesByFieldFetcher = useStoresByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField, props.projectKey, props.shouldFetchProductSelections);
|
|
8740
|
-
const hasError = AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors);
|
|
8626
|
+
const hasError = AsyncSelectInput.isTouched(props.touched) && hasErrors(props.errors) || props.hasError;
|
|
8741
8627
|
const handleLoadOptions = searchText => {
|
|
8742
8628
|
const extractMatchedStores = client.query({
|
|
8743
8629
|
query: FetchStoresByWherePredicate,
|
|
@@ -8766,10 +8652,10 @@ const StoresSearchSelectInput = props => {
|
|
|
8766
8652
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8767
8653
|
if (storesByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8768
8654
|
return jsxs(Fragment, {
|
|
8769
|
-
children: [jsx(SearchSelectInput, _objectSpread$
|
|
8655
|
+
children: [jsx(SearchSelectInput, _objectSpread$y(_objectSpread$y({
|
|
8770
8656
|
id: props.id,
|
|
8771
8657
|
name: props.name,
|
|
8772
|
-
placeholder: intl.formatMessage(messages$
|
|
8658
|
+
placeholder: intl.formatMessage(messages$r.searchSelectInputPlaceholder),
|
|
8773
8659
|
horizontalConstraint: props.horizontalConstraint,
|
|
8774
8660
|
loadOptions: loadOptionsDebounced,
|
|
8775
8661
|
defaultOptions: false,
|
|
@@ -8783,8 +8669,8 @@ const StoresSearchSelectInput = props => {
|
|
|
8783
8669
|
}),
|
|
8784
8670
|
onChange: props.onChange,
|
|
8785
8671
|
onBlur: props.onBlur,
|
|
8786
|
-
loadingMessage: intl.formatMessage(messages$
|
|
8787
|
-
noOptionsMessage: () => intl.formatMessage(messages$
|
|
8672
|
+
loadingMessage: intl.formatMessage(messages$r.searchSelectInputLoadingMessage),
|
|
8673
|
+
noOptionsMessage: () => intl.formatMessage(messages$r.searchSelectInputNoOptionsFoundMessage),
|
|
8788
8674
|
isDisabled: props.isDisabled || storesByFieldFetcher.isLoading,
|
|
8789
8675
|
isReadOnly: props.isReadOnly,
|
|
8790
8676
|
isClearable: props.isClearable,
|
|
@@ -8812,8 +8698,8 @@ StoresSearchSelectInput.defaultProps = {
|
|
|
8812
8698
|
shouldFetchProductSelections: false
|
|
8813
8699
|
};
|
|
8814
8700
|
|
|
8815
|
-
function ownKeys$
|
|
8816
|
-
function _objectSpread$
|
|
8701
|
+
function ownKeys$x(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; }
|
|
8702
|
+
function _objectSpread$x(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$x(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$x(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8817
8703
|
const StoreSelectInput = props => {
|
|
8818
8704
|
const totalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher(props.projectKey);
|
|
8819
8705
|
const components = useMemo(() => {
|
|
@@ -8821,7 +8707,7 @@ const StoreSelectInput = props => {
|
|
|
8821
8707
|
// eslint-disable-next-line react/display-name
|
|
8822
8708
|
Option: optionInnerProps => {
|
|
8823
8709
|
if (optionInnerProps.isDisabled) {
|
|
8824
|
-
return jsx(SelectInput.Option, _objectSpread$
|
|
8710
|
+
return jsx(SelectInput.Option, _objectSpread$x({}, optionInnerProps));
|
|
8825
8711
|
}
|
|
8826
8712
|
return jsx(CustomSelectInputOption, {
|
|
8827
8713
|
optionType: props.optionType,
|
|
@@ -8832,7 +8718,7 @@ const StoreSelectInput = props => {
|
|
|
8832
8718
|
}, [props.optionType]);
|
|
8833
8719
|
if (totalNumberOfStoresFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8834
8720
|
const CustomStoreSelectInput = totalNumberOfStoresFetcher.total <= props.lowerStoresLimit ? StoresBasicSelectInput : totalNumberOfStoresFetcher.total <= props.upperStoresLimit ? StoresAsyncSelectInput : StoresSearchSelectInput;
|
|
8835
|
-
return jsx(CustomStoreSelectInput, _objectSpread$
|
|
8721
|
+
return jsx(CustomStoreSelectInput, _objectSpread$x(_objectSpread$x({
|
|
8836
8722
|
projectKey: props.projectKey,
|
|
8837
8723
|
id: props.id,
|
|
8838
8724
|
name: props.name,
|
|
@@ -8876,7 +8762,7 @@ StoreSelectInput.defaultProps = {
|
|
|
8876
8762
|
// https://github.com/sphereio/sphere-backend/blob/master/ws/core/users.md#-businessrole
|
|
8877
8763
|
const businessRoleKeys = ['ExecutiveManagement', 'Architect', 'Engineer', 'ProductProjectManagerOrOwner', 'Marketing', 'CustomerService', 'SalesAndECommerceManager', 'Other'];
|
|
8878
8764
|
|
|
8879
|
-
var messages$
|
|
8765
|
+
var messages$q = defineMessages({
|
|
8880
8766
|
ExecutiveManagement: {
|
|
8881
8767
|
id: 'Shared.businessRoles.executiveManagement',
|
|
8882
8768
|
description: 'The label for one of the selectable business roles',
|
|
@@ -8934,7 +8820,7 @@ function convertRatioToPercentage(ratio) {
|
|
|
8934
8820
|
return _parseFloat((ratio * 100).toFixed(2));
|
|
8935
8821
|
}
|
|
8936
8822
|
|
|
8937
|
-
const messages$
|
|
8823
|
+
const messages$p = defineMessages({
|
|
8938
8824
|
inputFieldError: {
|
|
8939
8825
|
id: 'Search.Filters.validation.customField.inputFieldError',
|
|
8940
8826
|
description: 'Error message for empty input field ',
|
|
@@ -8955,14 +8841,14 @@ const validateValue = (value, type, intl) => {
|
|
|
8955
8841
|
if (validateSingleFilter({
|
|
8956
8842
|
value
|
|
8957
8843
|
})) {
|
|
8958
|
-
return intl.formatMessage(messages$
|
|
8844
|
+
return intl.formatMessage(messages$p.inputFieldError);
|
|
8959
8845
|
}
|
|
8960
8846
|
if (type === FIELD_TYPES.Money && (validateSingleFilter({
|
|
8961
8847
|
value: value.currencyCode
|
|
8962
8848
|
}) || validateSingleFilter({
|
|
8963
8849
|
value: value.amount
|
|
8964
8850
|
}))) {
|
|
8965
|
-
return intl.formatMessage(messages$
|
|
8851
|
+
return intl.formatMessage(messages$p.inputFieldError);
|
|
8966
8852
|
}
|
|
8967
8853
|
return null;
|
|
8968
8854
|
};
|
|
@@ -8970,7 +8856,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8970
8856
|
let value = _ref.value;
|
|
8971
8857
|
if (!value || !value.type) {
|
|
8972
8858
|
return {
|
|
8973
|
-
type: intl.formatMessage(messages$
|
|
8859
|
+
type: intl.formatMessage(messages$p.optionFieldError)
|
|
8974
8860
|
};
|
|
8975
8861
|
}
|
|
8976
8862
|
const typeName = value.type.name;
|
|
@@ -8978,7 +8864,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8978
8864
|
const filterValue = value.value;
|
|
8979
8865
|
if (hasOption && !value.option) {
|
|
8980
8866
|
return {
|
|
8981
|
-
option: intl.formatMessage(messages$
|
|
8867
|
+
option: intl.formatMessage(messages$p.optionFieldError)
|
|
8982
8868
|
};
|
|
8983
8869
|
}
|
|
8984
8870
|
if (value.option === FILTER_TYPES.range) {
|
|
@@ -8997,7 +8883,7 @@ function validateFilter$2(_ref, intl) {
|
|
|
8997
8883
|
} : null;
|
|
8998
8884
|
}
|
|
8999
8885
|
|
|
9000
|
-
const messages$
|
|
8886
|
+
const messages$o = defineMessages({
|
|
9001
8887
|
rangeMissingValue: {
|
|
9002
8888
|
id: 'Search.Filters.validation.date.rangeMissingValue',
|
|
9003
8889
|
description: 'error message if missing a value in a range',
|
|
@@ -9022,25 +8908,25 @@ function validateFilter$1(_ref, intl) {
|
|
|
9022
8908
|
if (validateSingleFilter({
|
|
9023
8909
|
value: value === null || value === void 0 ? void 0 : value.from
|
|
9024
8910
|
})) return {
|
|
9025
|
-
from: intl.formatMessage(messages$
|
|
8911
|
+
from: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9026
8912
|
};
|
|
9027
8913
|
if (validateSingleFilter({
|
|
9028
8914
|
value: value === null || value === void 0 ? void 0 : value.to
|
|
9029
8915
|
})) return {
|
|
9030
|
-
to: intl.formatMessage(messages$
|
|
8916
|
+
to: intl.formatMessage(messages$o.rangeMissingValue)
|
|
9031
8917
|
};
|
|
9032
8918
|
if (moment$1(value === null || value === void 0 ? void 0 : value.to).isBefore(value === null || value === void 0 ? void 0 : value.from)) return {
|
|
9033
|
-
from: intl.formatMessage(messages$
|
|
8919
|
+
from: intl.formatMessage(messages$o.rangeToSmallerThanFrom)
|
|
9034
8920
|
};
|
|
9035
8921
|
} else if (type === 'equalTo' || type === 'lessThan' || type === 'moreThan') {
|
|
9036
8922
|
if (validateSingleFilter({
|
|
9037
8923
|
value
|
|
9038
|
-
})) return intl.formatMessage(messages$
|
|
8924
|
+
})) return intl.formatMessage(messages$o.missingValue);
|
|
9039
8925
|
}
|
|
9040
8926
|
return null;
|
|
9041
8927
|
}
|
|
9042
8928
|
|
|
9043
|
-
const messages$
|
|
8929
|
+
const messages$n = defineMessages({
|
|
9044
8930
|
rangeMissingValue: {
|
|
9045
8931
|
id: 'Search.Filters.validation.number.rangeMissingValue',
|
|
9046
8932
|
description: 'error message if missing a value in a range',
|
|
@@ -9059,30 +8945,30 @@ function validateFilter(_ref, intl) {
|
|
|
9059
8945
|
_ref$allowFloat = _ref.allowFloat,
|
|
9060
8946
|
allowFloat = _ref$allowFloat === void 0 ? true : _ref$allowFloat;
|
|
9061
8947
|
if (type !== 'range') {
|
|
9062
|
-
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$
|
|
8948
|
+
if (!allowFloat && !isInteger(value)) return intl.formatMessage(messages$J.integer);
|
|
9063
8949
|
return null;
|
|
9064
8950
|
}
|
|
9065
8951
|
|
|
9066
8952
|
// only range types from here
|
|
9067
8953
|
|
|
9068
8954
|
if (!allowFloat && !isInteger(value.from)) return {
|
|
9069
|
-
from: intl.formatMessage(messages$
|
|
8955
|
+
from: intl.formatMessage(messages$J.integer)
|
|
9070
8956
|
};
|
|
9071
8957
|
if (!allowFloat && !isInteger(value.to)) return {
|
|
9072
|
-
to: intl.formatMessage(messages$
|
|
8958
|
+
to: intl.formatMessage(messages$J.integer)
|
|
9073
8959
|
};
|
|
9074
8960
|
if (validateSingleFilter({
|
|
9075
8961
|
value: value.from
|
|
9076
8962
|
})) return {
|
|
9077
|
-
from: intl.formatMessage(messages$
|
|
8963
|
+
from: intl.formatMessage(messages$n.rangeMissingValue)
|
|
9078
8964
|
};
|
|
9079
8965
|
if (validateSingleFilter({
|
|
9080
8966
|
value: value.to
|
|
9081
8967
|
})) return {
|
|
9082
|
-
to: intl.formatMessage(messages$
|
|
8968
|
+
to: intl.formatMessage(messages$n.rangeMissingValue)
|
|
9083
8969
|
};
|
|
9084
8970
|
if (_parseFloat(value.to) < _parseFloat(value.from)) return {
|
|
9085
|
-
from: intl.formatMessage(messages$
|
|
8971
|
+
from: intl.formatMessage(messages$n.rangeToSmallerThanFrom)
|
|
9086
8972
|
};
|
|
9087
8973
|
return null;
|
|
9088
8974
|
}
|
|
@@ -9376,10 +9262,10 @@ const RESOURCES_WITH_PLATFORM_LIMITS = {
|
|
|
9376
9262
|
carts: 'carts'
|
|
9377
9263
|
};
|
|
9378
9264
|
|
|
9379
|
-
function ownKeys$
|
|
9380
|
-
function _objectSpread$
|
|
9265
|
+
function ownKeys$w(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; }
|
|
9266
|
+
function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$w(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$w(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9381
9267
|
const resourcesWithPlatformLimits = _Object$keys(RESOURCES_WITH_PLATFORM_LIMITS);
|
|
9382
|
-
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$
|
|
9268
|
+
const createQueryVariables = platformLimit => _reduceInstanceProperty(resourcesWithPlatformLimits).call(resourcesWithPlatformLimits, (previousIncludedLimits, nextNameOfLimit) => _objectSpread$w({
|
|
9383
9269
|
[camelCase("should include ".concat(nextNameOfLimit))]: platformLimit ? nextNameOfLimit === platformLimit : true
|
|
9384
9270
|
}, previousIncludedLimits), {});
|
|
9385
9271
|
|
|
@@ -9441,7 +9327,7 @@ const useInterceptNavigation = hasReachedErrorLimit => {
|
|
|
9441
9327
|
};
|
|
9442
9328
|
};
|
|
9443
9329
|
|
|
9444
|
-
var messages$
|
|
9330
|
+
var messages$m = defineMessages({
|
|
9445
9331
|
shippingMethods: {
|
|
9446
9332
|
id: 'PlatformLimits.Notifications.shippingMethodsWarning',
|
|
9447
9333
|
description: 'warning message about platform limit exceeded',
|
|
@@ -9469,8 +9355,8 @@ var messages$n = defineMessages({
|
|
|
9469
9355
|
}
|
|
9470
9356
|
});
|
|
9471
9357
|
|
|
9472
|
-
function ownKeys$
|
|
9473
|
-
function _objectSpread$
|
|
9358
|
+
function ownKeys$v(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; }
|
|
9359
|
+
function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$v(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$v(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9474
9360
|
const getCustomerSupportLink$1 = msg => jsx(Link, {
|
|
9475
9361
|
isExternal: true,
|
|
9476
9362
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9481,7 +9367,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9481
9367
|
limit = _ref.limit;
|
|
9482
9368
|
return jsx(ContentNotification, {
|
|
9483
9369
|
type: "warning",
|
|
9484
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9370
|
+
children: jsx(FormattedMessage, _objectSpread$v(_objectSpread$v({}, messages$m[resource]), {}, {
|
|
9485
9371
|
values: {
|
|
9486
9372
|
limit,
|
|
9487
9373
|
customersupport: getCustomerSupportLink$1
|
|
@@ -9494,7 +9380,7 @@ const PlatformLimitWarningNotification = _ref => {
|
|
|
9494
9380
|
};
|
|
9495
9381
|
PlatformLimitWarningNotification.displayName = 'PlatformLimitWarningNotification';
|
|
9496
9382
|
|
|
9497
|
-
var messages$
|
|
9383
|
+
var messages$l = defineMessages({
|
|
9498
9384
|
shippingMethods: {
|
|
9499
9385
|
id: 'PlatformLimits.Notifications.shippingMethodsError',
|
|
9500
9386
|
description: 'error message about platform limit exceeded',
|
|
@@ -9522,8 +9408,8 @@ var messages$m = defineMessages({
|
|
|
9522
9408
|
}
|
|
9523
9409
|
});
|
|
9524
9410
|
|
|
9525
|
-
function ownKeys$
|
|
9526
|
-
function _objectSpread$
|
|
9411
|
+
function ownKeys$u(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; }
|
|
9412
|
+
function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$u(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$u(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9527
9413
|
const getCustomerSupportLink = msg => jsx(Link, {
|
|
9528
9414
|
isExternal: true,
|
|
9529
9415
|
to: SUPPORT_PORTAL_URL,
|
|
@@ -9534,7 +9420,7 @@ const PlatformLimitErrorNotification = _ref => {
|
|
|
9534
9420
|
limit = _ref.limit;
|
|
9535
9421
|
return jsx(ContentNotification, {
|
|
9536
9422
|
type: "error",
|
|
9537
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
9423
|
+
children: jsx(FormattedMessage, _objectSpread$u(_objectSpread$u({}, messages$l[resource]), {}, {
|
|
9538
9424
|
values: {
|
|
9539
9425
|
limit,
|
|
9540
9426
|
customersupport: getCustomerSupportLink
|
|
@@ -9552,8 +9438,8 @@ const Notifications = {
|
|
|
9552
9438
|
Error: PlatformLimitErrorNotification
|
|
9553
9439
|
};
|
|
9554
9440
|
|
|
9555
|
-
function ownKeys$
|
|
9556
|
-
function _objectSpread$
|
|
9441
|
+
function ownKeys$t(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; }
|
|
9442
|
+
function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$t(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$t(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9557
9443
|
const PlatformLimitsStatusText = _ref => {
|
|
9558
9444
|
let intlMessage = _ref.intlMessage,
|
|
9559
9445
|
children = _ref.children;
|
|
@@ -9562,7 +9448,7 @@ const PlatformLimitsStatusText = _ref => {
|
|
|
9562
9448
|
children: jsxs(Spacings.Inline, {
|
|
9563
9449
|
size: "xs",
|
|
9564
9450
|
children: [jsx("span", {
|
|
9565
|
-
children: intlMessage && jsx(FormattedMessage, _objectSpread$
|
|
9451
|
+
children: intlMessage && jsx(FormattedMessage, _objectSpread$t({}, intlMessage))
|
|
9566
9452
|
}), jsx("span", {
|
|
9567
9453
|
children: children
|
|
9568
9454
|
})]
|
|
@@ -9663,7 +9549,7 @@ const PlatformLimitsShippingMethodsNotifications = () => {
|
|
|
9663
9549
|
};
|
|
9664
9550
|
PlatformLimitsShippingMethodsNotifications.displayName = 'PlatformLimitsShippingMethodsNotifications';
|
|
9665
9551
|
|
|
9666
|
-
var messages$
|
|
9552
|
+
var messages$k = defineMessages({
|
|
9667
9553
|
shippingMethodsPlatformLimitReached: {
|
|
9668
9554
|
id: 'PlatformLimits.Tooltip.shippingMethodsLimitReached',
|
|
9669
9555
|
description: 'The message for shipping methods platform limit being reached',
|
|
@@ -9671,17 +9557,17 @@ var messages$l = defineMessages({
|
|
|
9671
9557
|
}
|
|
9672
9558
|
});
|
|
9673
9559
|
|
|
9674
|
-
function ownKeys$
|
|
9675
|
-
function _objectSpread$
|
|
9560
|
+
function ownKeys$s(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; }
|
|
9561
|
+
function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$s(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$s(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9676
9562
|
const PlatformLimitsShippingMethodsTooltip = props => {
|
|
9677
9563
|
const intl = useIntl();
|
|
9678
|
-
return jsx(Tooltip, _objectSpread$
|
|
9679
|
-
title: intl.formatMessage(messages$
|
|
9564
|
+
return jsx(Tooltip, _objectSpread$s(_objectSpread$s({}, props), {}, {
|
|
9565
|
+
title: intl.formatMessage(messages$k.shippingMethodsPlatformLimitReached)
|
|
9680
9566
|
}));
|
|
9681
9567
|
};
|
|
9682
9568
|
PlatformLimitsShippingMethodsTooltip.displayName = 'PlatformLimitsShippingMethodsTooltip';
|
|
9683
9569
|
|
|
9684
|
-
var messages$
|
|
9570
|
+
var messages$j = defineMessages({
|
|
9685
9571
|
shippingMethodsStatus: {
|
|
9686
9572
|
id: 'PlatformLimits.Status.shippingMethods',
|
|
9687
9573
|
description: 'The message for shipping methods platform limit values',
|
|
@@ -9698,7 +9584,7 @@ const PlatformLimitsShippingMethodsStatus = _ref => {
|
|
|
9698
9584
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp = platformLimits.shippingMethods) === null || _platformLimits$shipp === void 0 ? void 0 : (_platformLimits$shipp2 = _platformLimits$shipp.total) === null || _platformLimits$shipp2 === void 0 ? void 0 : _platformLimits$shipp2.current;
|
|
9699
9585
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$shipp3 = platformLimits.shippingMethods) === null || _platformLimits$shipp3 === void 0 ? void 0 : (_platformLimits$shipp4 = _platformLimits$shipp3.total) === null || _platformLimits$shipp4 === void 0 ? void 0 : _platformLimits$shipp4.limit;
|
|
9700
9586
|
return jsx(PlatformLimitsStatusText, {
|
|
9701
|
-
intlMessage: messages$
|
|
9587
|
+
intlMessage: messages$j.shippingMethodsStatus,
|
|
9702
9588
|
children: getPlatformLimitsStatus({
|
|
9703
9589
|
limit,
|
|
9704
9590
|
current,
|
|
@@ -9729,15 +9615,15 @@ const useShippingMethodsLimits = () => {
|
|
|
9729
9615
|
};
|
|
9730
9616
|
};
|
|
9731
9617
|
|
|
9732
|
-
function ownKeys$
|
|
9733
|
-
function _objectSpread$
|
|
9618
|
+
function ownKeys$r(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; }
|
|
9619
|
+
function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$r(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$r(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9734
9620
|
const injectShippingMethodsPlatformLimits = () => WrappedComponent => {
|
|
9735
9621
|
const WithShippingMethodsPlatformLimits = props => {
|
|
9736
9622
|
const shippingMethodsPlatformLimits = useShippingMethodsLimits();
|
|
9737
9623
|
const shippingMethodsProps = {
|
|
9738
9624
|
platformLimits: shippingMethodsPlatformLimits
|
|
9739
9625
|
};
|
|
9740
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9626
|
+
return jsx(WrappedComponent, _objectSpread$r(_objectSpread$r({}, props), shippingMethodsProps));
|
|
9741
9627
|
};
|
|
9742
9628
|
WithShippingMethodsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithShippingMethodsPlatformLimits');
|
|
9743
9629
|
return WithShippingMethodsPlatformLimits;
|
|
@@ -9810,7 +9696,7 @@ const PlatformLimitsTaxCategoriesNotifications = () => {
|
|
|
9810
9696
|
};
|
|
9811
9697
|
PlatformLimitsTaxCategoriesNotifications.displayName = 'PlatformLimitsTaxCategoriesNotifications';
|
|
9812
9698
|
|
|
9813
|
-
var messages$
|
|
9699
|
+
var messages$i = defineMessages({
|
|
9814
9700
|
taxCategoriesPlatformLimitReached: {
|
|
9815
9701
|
id: 'PlatformLimits.Tooltip.taxCategoriesLimitReached',
|
|
9816
9702
|
description: 'The message for tax categories platform limit being reached',
|
|
@@ -9818,17 +9704,17 @@ var messages$j = defineMessages({
|
|
|
9818
9704
|
}
|
|
9819
9705
|
});
|
|
9820
9706
|
|
|
9821
|
-
function ownKeys$
|
|
9822
|
-
function _objectSpread$
|
|
9707
|
+
function ownKeys$q(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; }
|
|
9708
|
+
function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$q(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$q(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9823
9709
|
const PlatformLimitsTaxCategoriesTooltip = props => {
|
|
9824
9710
|
const intl = useIntl();
|
|
9825
|
-
return jsx(Tooltip, _objectSpread$
|
|
9826
|
-
title: intl.formatMessage(messages$
|
|
9711
|
+
return jsx(Tooltip, _objectSpread$q(_objectSpread$q({}, props), {}, {
|
|
9712
|
+
title: intl.formatMessage(messages$i.taxCategoriesPlatformLimitReached)
|
|
9827
9713
|
}));
|
|
9828
9714
|
};
|
|
9829
9715
|
PlatformLimitsTaxCategoriesTooltip.displayName = 'PlatformLimitsTaxCategoriesTooltip';
|
|
9830
9716
|
|
|
9831
|
-
var messages$
|
|
9717
|
+
var messages$h = defineMessages({
|
|
9832
9718
|
taxCategoriesStatus: {
|
|
9833
9719
|
id: 'PlatformLimits.Status.taxCategories',
|
|
9834
9720
|
description: 'The message for tax categories platform limit values',
|
|
@@ -9845,7 +9731,7 @@ const PlatformLimitsTaxCategoriesStatus = _ref => {
|
|
|
9845
9731
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa = platformLimits.taxCategories) === null || _platformLimits$taxCa === void 0 ? void 0 : (_platformLimits$taxCa2 = _platformLimits$taxCa.total) === null || _platformLimits$taxCa2 === void 0 ? void 0 : _platformLimits$taxCa2.current;
|
|
9846
9732
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$taxCa3 = platformLimits.taxCategories) === null || _platformLimits$taxCa3 === void 0 ? void 0 : (_platformLimits$taxCa4 = _platformLimits$taxCa3.total) === null || _platformLimits$taxCa4 === void 0 ? void 0 : _platformLimits$taxCa4.limit;
|
|
9847
9733
|
return jsx(PlatformLimitsStatusText, {
|
|
9848
|
-
intlMessage: messages$
|
|
9734
|
+
intlMessage: messages$h.taxCategoriesStatus,
|
|
9849
9735
|
children: getPlatformLimitsStatus({
|
|
9850
9736
|
limit,
|
|
9851
9737
|
current,
|
|
@@ -9876,15 +9762,15 @@ const useTaxCategoriesLimits = () => {
|
|
|
9876
9762
|
};
|
|
9877
9763
|
};
|
|
9878
9764
|
|
|
9879
|
-
function ownKeys$
|
|
9880
|
-
function _objectSpread$
|
|
9765
|
+
function ownKeys$p(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; }
|
|
9766
|
+
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$p(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$p(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9881
9767
|
const injectTaxCategoriesPlatformLimits = WrappedComponent => {
|
|
9882
9768
|
const WithTaxCategoriesPlatformLimits = props => {
|
|
9883
9769
|
const taxCategoriesPlatformLimits = useTaxCategoriesLimits();
|
|
9884
9770
|
const taxCategoriesProps = {
|
|
9885
9771
|
platformLimits: taxCategoriesPlatformLimits
|
|
9886
9772
|
};
|
|
9887
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9773
|
+
return jsx(WrappedComponent, _objectSpread$p(_objectSpread$p({}, props), taxCategoriesProps));
|
|
9888
9774
|
};
|
|
9889
9775
|
WithTaxCategoriesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithTaxCategoriesPlatformLimits');
|
|
9890
9776
|
return WithTaxCategoriesPlatformLimits;
|
|
@@ -9957,7 +9843,7 @@ const PlatformLimitsZonesNotifications = () => {
|
|
|
9957
9843
|
};
|
|
9958
9844
|
PlatformLimitsZonesNotifications.displayName = 'PlatformLimitsZonesNotifications';
|
|
9959
9845
|
|
|
9960
|
-
var messages$
|
|
9846
|
+
var messages$g = defineMessages({
|
|
9961
9847
|
zonesPlatformLimitReached: {
|
|
9962
9848
|
id: 'PlatformLimits.Tooltip.zonesLimitReached',
|
|
9963
9849
|
description: 'The message for zones platform limit being reached',
|
|
@@ -9965,17 +9851,17 @@ var messages$h = defineMessages({
|
|
|
9965
9851
|
}
|
|
9966
9852
|
});
|
|
9967
9853
|
|
|
9968
|
-
function ownKeys$
|
|
9969
|
-
function _objectSpread$
|
|
9854
|
+
function ownKeys$o(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; }
|
|
9855
|
+
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$o(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$o(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9970
9856
|
const PlatformLimitsZonesTooltip = props => {
|
|
9971
9857
|
const intl = useIntl();
|
|
9972
|
-
return jsx(Tooltip, _objectSpread$
|
|
9973
|
-
title: intl.formatMessage(messages$
|
|
9858
|
+
return jsx(Tooltip, _objectSpread$o(_objectSpread$o({}, props), {}, {
|
|
9859
|
+
title: intl.formatMessage(messages$g.zonesPlatformLimitReached)
|
|
9974
9860
|
}));
|
|
9975
9861
|
};
|
|
9976
9862
|
PlatformLimitsZonesTooltip.displayName = 'PlatformLimitsZonesTooltip';
|
|
9977
9863
|
|
|
9978
|
-
var messages$
|
|
9864
|
+
var messages$f = defineMessages({
|
|
9979
9865
|
zonesStatus: {
|
|
9980
9866
|
id: 'PlatformLimits.Status.zones',
|
|
9981
9867
|
description: 'The message for zones platform limit values',
|
|
@@ -9992,7 +9878,7 @@ const PlatformLimitsZonesStatus = _ref => {
|
|
|
9992
9878
|
const current = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones = platformLimits.zones) === null || _platformLimits$zones === void 0 ? void 0 : (_platformLimits$zones2 = _platformLimits$zones.total) === null || _platformLimits$zones2 === void 0 ? void 0 : _platformLimits$zones2.current;
|
|
9993
9879
|
const limit = platformLimits === null || platformLimits === void 0 ? void 0 : (_platformLimits$zones3 = platformLimits.zones) === null || _platformLimits$zones3 === void 0 ? void 0 : (_platformLimits$zones4 = _platformLimits$zones3.total) === null || _platformLimits$zones4 === void 0 ? void 0 : _platformLimits$zones4.limit;
|
|
9994
9880
|
return jsx(PlatformLimitsStatusText, {
|
|
9995
|
-
intlMessage: messages$
|
|
9881
|
+
intlMessage: messages$f.zonesStatus,
|
|
9996
9882
|
children: getPlatformLimitsStatus({
|
|
9997
9883
|
limit,
|
|
9998
9884
|
current,
|
|
@@ -10023,15 +9909,15 @@ const useZonesLimits = () => {
|
|
|
10023
9909
|
};
|
|
10024
9910
|
};
|
|
10025
9911
|
|
|
10026
|
-
function ownKeys$
|
|
10027
|
-
function _objectSpread$
|
|
9912
|
+
function ownKeys$n(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; }
|
|
9913
|
+
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$n(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$n(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10028
9914
|
const injectZonesPlatformLimits = () => WrappedComponent => {
|
|
10029
9915
|
const WithZonesPlatformLimits = props => {
|
|
10030
9916
|
const zonesPlatformLimits = useZonesLimits();
|
|
10031
9917
|
const zonesProps = {
|
|
10032
9918
|
platformLimits: zonesPlatformLimits
|
|
10033
9919
|
};
|
|
10034
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
9920
|
+
return jsx(WrappedComponent, _objectSpread$n(_objectSpread$n({}, props), zonesProps));
|
|
10035
9921
|
};
|
|
10036
9922
|
WithZonesPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithZonesPlatformLimits');
|
|
10037
9923
|
return WithZonesPlatformLimits;
|
|
@@ -10117,7 +10003,7 @@ const PlatformLimitsCustomersNotifications = () => {
|
|
|
10117
10003
|
};
|
|
10118
10004
|
PlatformLimitsCustomersNotifications.displayName = 'PlatformLimitsCustomersNotifications';
|
|
10119
10005
|
|
|
10120
|
-
var messages$
|
|
10006
|
+
var messages$e = defineMessages({
|
|
10121
10007
|
customersPlatformLimitReached: {
|
|
10122
10008
|
id: 'PlatformLimits.Tooltip.customersLimitReached',
|
|
10123
10009
|
description: 'The message for customers platform limit being reached',
|
|
@@ -10125,17 +10011,17 @@ var messages$f = defineMessages({
|
|
|
10125
10011
|
}
|
|
10126
10012
|
});
|
|
10127
10013
|
|
|
10128
|
-
function ownKeys$
|
|
10129
|
-
function _objectSpread$
|
|
10014
|
+
function ownKeys$m(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; }
|
|
10015
|
+
function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$m(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$m(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10130
10016
|
const PlatformLimitsCustomersTooltip = props => {
|
|
10131
10017
|
const intl = useIntl();
|
|
10132
|
-
return jsx(Tooltip, _objectSpread$
|
|
10133
|
-
title: intl.formatMessage(messages$
|
|
10018
|
+
return jsx(Tooltip, _objectSpread$m(_objectSpread$m({}, props), {}, {
|
|
10019
|
+
title: intl.formatMessage(messages$e.customersPlatformLimitReached)
|
|
10134
10020
|
}));
|
|
10135
10021
|
};
|
|
10136
10022
|
PlatformLimitsCustomersTooltip.displayName = 'PlatformLimitsCustomersTooltip';
|
|
10137
10023
|
|
|
10138
|
-
var messages$
|
|
10024
|
+
var messages$d = defineMessages({
|
|
10139
10025
|
customersStatus: {
|
|
10140
10026
|
id: 'PlatformLimits.Status.customers',
|
|
10141
10027
|
description: 'The message for customers platform limit values',
|
|
@@ -10143,9 +10029,9 @@ var messages$e = defineMessages({
|
|
|
10143
10029
|
}
|
|
10144
10030
|
});
|
|
10145
10031
|
|
|
10146
|
-
function ownKeys$
|
|
10147
|
-
function _objectSpread$
|
|
10148
|
-
var styles$
|
|
10032
|
+
function ownKeys$l(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; }
|
|
10033
|
+
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$l(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$l(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10034
|
+
var styles$b = {
|
|
10149
10035
|
"status": "platform-limits-customers-status-module__status___3rXYM"
|
|
10150
10036
|
};
|
|
10151
10037
|
const PlatformLimitsCustomersStatus = () => {
|
|
@@ -10160,11 +10046,11 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10160
10046
|
current = _platformLimits$custo2.current,
|
|
10161
10047
|
limit = _platformLimits$custo2.limit;
|
|
10162
10048
|
return jsx("div", {
|
|
10163
|
-
className: styles$
|
|
10049
|
+
className: styles$b.status,
|
|
10164
10050
|
children: jsx(Text.Detail, {
|
|
10165
10051
|
tone: "secondary",
|
|
10166
10052
|
isInline: true,
|
|
10167
|
-
intlMessage: _objectSpread$
|
|
10053
|
+
intlMessage: _objectSpread$l(_objectSpread$l({}, messages$d.customersStatus), {}, {
|
|
10168
10054
|
values: {
|
|
10169
10055
|
current: intl.formatNumber(current),
|
|
10170
10056
|
limit: intl.formatNumber(limit)
|
|
@@ -10175,7 +10061,7 @@ const PlatformLimitsCustomersStatus = () => {
|
|
|
10175
10061
|
};
|
|
10176
10062
|
PlatformLimitsCustomersStatus.displayName = 'PlatformLimitsCustomersStatus';
|
|
10177
10063
|
|
|
10178
|
-
var messages$
|
|
10064
|
+
var messages$c = defineMessages({
|
|
10179
10065
|
title: {
|
|
10180
10066
|
id: 'PlatformLimits.Customers.modalTitle',
|
|
10181
10067
|
description: 'The modal title for the customer platform limits error',
|
|
@@ -10188,10 +10074,10 @@ var messages$d = defineMessages({
|
|
|
10188
10074
|
}
|
|
10189
10075
|
});
|
|
10190
10076
|
|
|
10191
|
-
function ownKeys$
|
|
10192
|
-
function _objectSpread$
|
|
10077
|
+
function ownKeys$k(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; }
|
|
10078
|
+
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$k(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$k(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10193
10079
|
var LimitsReachedErrorGraphic$1 = function LimitsReachedErrorGraphic(props) {
|
|
10194
|
-
return jsxs("svg", _objectSpread$
|
|
10080
|
+
return jsxs("svg", _objectSpread$k(_objectSpread$k({}, props), {}, {
|
|
10195
10081
|
children: [jsx("defs", {
|
|
10196
10082
|
children: jsx("path", {
|
|
10197
10083
|
id: "a",
|
|
@@ -10299,7 +10185,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10299
10185
|
return jsx(InfoDialog, {
|
|
10300
10186
|
isOpen: customersPlatformLimitsModalState.isModalOpen,
|
|
10301
10187
|
onClose: onClose,
|
|
10302
|
-
title: intl.formatMessage(messages$
|
|
10188
|
+
title: intl.formatMessage(messages$c.title),
|
|
10303
10189
|
children: jsxs(Spacings.Stack, {
|
|
10304
10190
|
scale: "m",
|
|
10305
10191
|
alignItems: "center",
|
|
@@ -10308,7 +10194,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10308
10194
|
alignItems: "center",
|
|
10309
10195
|
children: [jsx(PlatformLimitsCustomersNotifications, {}), jsx(FlatButton, {
|
|
10310
10196
|
onClick: onClose,
|
|
10311
|
-
label: intl.formatMessage(messages$
|
|
10197
|
+
label: intl.formatMessage(messages$c.backToList),
|
|
10312
10198
|
icon: jsx(ListIcon, {
|
|
10313
10199
|
size: "medium",
|
|
10314
10200
|
color: "primary"
|
|
@@ -10320,7 +10206,7 @@ const PlatformLimitsCustomersErrorModal = _ref => {
|
|
|
10320
10206
|
};
|
|
10321
10207
|
PlatformLimitsCustomersErrorModal.displayName = 'PlatformLimitsCustomersErrorModal';
|
|
10322
10208
|
|
|
10323
|
-
var styles$
|
|
10209
|
+
var styles$a = {
|
|
10324
10210
|
"combined": "platform-limits-customers-combined-module__combined___OszDd"
|
|
10325
10211
|
};
|
|
10326
10212
|
const PlatformLimitsCustomersCombined = () => {
|
|
@@ -10328,14 +10214,12 @@ const PlatformLimitsCustomersCombined = () => {
|
|
|
10328
10214
|
const _useCustomersPlatform = useCustomersPlatformLimits$1(),
|
|
10329
10215
|
hasReachedCustomersErrorLimit = _useCustomersPlatform.hasReachedCustomersErrorLimit,
|
|
10330
10216
|
hasReachedCustomersWarningLimit = _useCustomersPlatform.hasReachedCustomersWarningLimit;
|
|
10331
|
-
const _useTheme = useTheme(),
|
|
10332
|
-
themedValue = _useTheme.themedValue;
|
|
10333
10217
|
return jsx("div", {
|
|
10334
|
-
className: styles$
|
|
10218
|
+
className: styles$a.combined,
|
|
10335
10219
|
children: jsxs(Spacings.Inline, {
|
|
10336
10220
|
scale: "xl",
|
|
10337
10221
|
justifyContent: "space-between",
|
|
10338
|
-
children: [hasReachedCustomersWarningLimit && !hasReachedCustomersErrorLimit ? jsx(PlatformLimitsCustomersNotifications, {}) :
|
|
10222
|
+
children: [hasReachedCustomersWarningLimit && !hasReachedCustomersErrorLimit ? jsx(PlatformLimitsCustomersNotifications, {}) : null, jsx(PlatformLimitsCustomersStatus, {})]
|
|
10339
10223
|
})
|
|
10340
10224
|
});
|
|
10341
10225
|
};
|
|
@@ -10365,15 +10249,15 @@ const useCustomersPlatformLimits = () => {
|
|
|
10365
10249
|
};
|
|
10366
10250
|
};
|
|
10367
10251
|
|
|
10368
|
-
function ownKeys$
|
|
10369
|
-
function _objectSpread$
|
|
10252
|
+
function ownKeys$j(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; }
|
|
10253
|
+
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$j(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$j(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10370
10254
|
const injectCustomersPlatformLimits = () => WrappedComponent => {
|
|
10371
10255
|
const WithCustomersPlatformLimits = props => {
|
|
10372
10256
|
const CustomersPlatformLimits = useCustomersPlatformLimits();
|
|
10373
10257
|
const customersProps = {
|
|
10374
10258
|
platformLimits: CustomersPlatformLimits
|
|
10375
10259
|
};
|
|
10376
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10260
|
+
return jsx(WrappedComponent, _objectSpread$j(_objectSpread$j({}, props), customersProps));
|
|
10377
10261
|
};
|
|
10378
10262
|
WithCustomersPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomersPlatformLimits');
|
|
10379
10263
|
return WithCustomersPlatformLimits;
|
|
@@ -10459,7 +10343,7 @@ const PlatformLimitsCustomerGroupsNotifications = () => {
|
|
|
10459
10343
|
};
|
|
10460
10344
|
PlatformLimitsCustomerGroupsNotifications.displayName = 'PlatformLimitsCustomerGroupsNotifications';
|
|
10461
10345
|
|
|
10462
|
-
var messages$
|
|
10346
|
+
var messages$b = defineMessages({
|
|
10463
10347
|
customerGroupsPlatformLimitReached: {
|
|
10464
10348
|
id: 'PlatformLimits.Tooltip.customerGroupsLimitReached',
|
|
10465
10349
|
description: 'The message for custome groups platform limit being reached',
|
|
@@ -10467,17 +10351,17 @@ var messages$c = defineMessages({
|
|
|
10467
10351
|
}
|
|
10468
10352
|
});
|
|
10469
10353
|
|
|
10470
|
-
function ownKeys$
|
|
10471
|
-
function _objectSpread$
|
|
10354
|
+
function ownKeys$i(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; }
|
|
10355
|
+
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$i(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$i(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10472
10356
|
const PlatformLimitsCustomerGroupsTooltip = props => {
|
|
10473
10357
|
const intl = useIntl();
|
|
10474
|
-
return jsx(Tooltip, _objectSpread$
|
|
10475
|
-
title: intl.formatMessage(messages$
|
|
10358
|
+
return jsx(Tooltip, _objectSpread$i(_objectSpread$i({}, props), {}, {
|
|
10359
|
+
title: intl.formatMessage(messages$b.customerGroupsPlatformLimitReached)
|
|
10476
10360
|
}));
|
|
10477
10361
|
};
|
|
10478
10362
|
PlatformLimitsCustomerGroupsTooltip.displayName = 'PlatformLimitsCustomerGroupsTooltip';
|
|
10479
10363
|
|
|
10480
|
-
var messages$
|
|
10364
|
+
var messages$a = defineMessages({
|
|
10481
10365
|
customerGroupsStatus: {
|
|
10482
10366
|
id: 'PlatformLimits.Status.customerGroups',
|
|
10483
10367
|
description: 'The message for customer groups platform limit values',
|
|
@@ -10485,9 +10369,9 @@ var messages$b = defineMessages({
|
|
|
10485
10369
|
}
|
|
10486
10370
|
});
|
|
10487
10371
|
|
|
10488
|
-
function ownKeys$
|
|
10489
|
-
function _objectSpread$
|
|
10490
|
-
var styles$
|
|
10372
|
+
function ownKeys$h(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; }
|
|
10373
|
+
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$h(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$h(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10374
|
+
var styles$9 = {
|
|
10491
10375
|
"status": "platform-limits-customer-groups-status-module__status___6099G"
|
|
10492
10376
|
};
|
|
10493
10377
|
const PlatformLimitsCustomerGroupsStatus = () => {
|
|
@@ -10502,11 +10386,11 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10502
10386
|
current = _platformLimits$custo2.current,
|
|
10503
10387
|
limit = _platformLimits$custo2.limit;
|
|
10504
10388
|
return jsx("div", {
|
|
10505
|
-
className: styles$
|
|
10389
|
+
className: styles$9.status,
|
|
10506
10390
|
children: jsx(Text.Detail, {
|
|
10507
10391
|
tone: "secondary",
|
|
10508
10392
|
isInline: true,
|
|
10509
|
-
intlMessage: _objectSpread$
|
|
10393
|
+
intlMessage: _objectSpread$h(_objectSpread$h({}, messages$a.customerGroupsStatus), {}, {
|
|
10510
10394
|
values: {
|
|
10511
10395
|
current: intl.formatNumber(current),
|
|
10512
10396
|
limit: intl.formatNumber(limit)
|
|
@@ -10517,7 +10401,7 @@ const PlatformLimitsCustomerGroupsStatus = () => {
|
|
|
10517
10401
|
};
|
|
10518
10402
|
PlatformLimitsCustomerGroupsStatus.displayName = 'PlatformLimitsCustomerGroupsStatus';
|
|
10519
10403
|
|
|
10520
|
-
var messages$
|
|
10404
|
+
var messages$9 = defineMessages({
|
|
10521
10405
|
title: {
|
|
10522
10406
|
id: 'PlatformLimits.CustomerGroups.modalTitle',
|
|
10523
10407
|
description: 'The modal title for the customer groups platform limits error',
|
|
@@ -10530,10 +10414,10 @@ var messages$a = defineMessages({
|
|
|
10530
10414
|
}
|
|
10531
10415
|
});
|
|
10532
10416
|
|
|
10533
|
-
function ownKeys$
|
|
10534
|
-
function _objectSpread$
|
|
10417
|
+
function ownKeys$g(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; }
|
|
10418
|
+
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$g(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$g(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10535
10419
|
var LimitsReachedErrorGraphic = function LimitsReachedErrorGraphic(props) {
|
|
10536
|
-
return jsxs("svg", _objectSpread$
|
|
10420
|
+
return jsxs("svg", _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
10537
10421
|
children: [jsx("defs", {
|
|
10538
10422
|
children: jsx("path", {
|
|
10539
10423
|
id: "a",
|
|
@@ -10641,7 +10525,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10641
10525
|
return jsx(InfoDialog, {
|
|
10642
10526
|
isOpen: customerGroupsPlatformLimitsModalState.isModalOpen,
|
|
10643
10527
|
onClose: onClose,
|
|
10644
|
-
title: intl.formatMessage(messages$
|
|
10528
|
+
title: intl.formatMessage(messages$9.title),
|
|
10645
10529
|
children: jsxs(Spacings.Stack, {
|
|
10646
10530
|
scale: "m",
|
|
10647
10531
|
alignItems: "center",
|
|
@@ -10650,7 +10534,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10650
10534
|
alignItems: "center",
|
|
10651
10535
|
children: [jsx(PlatformLimitsCustomerGroupsNotifications, {}), jsx(FlatButton, {
|
|
10652
10536
|
onClick: onClose,
|
|
10653
|
-
label: intl.formatMessage(messages$
|
|
10537
|
+
label: intl.formatMessage(messages$9.backToList),
|
|
10654
10538
|
icon: jsx(ListIcon, {
|
|
10655
10539
|
size: "medium",
|
|
10656
10540
|
color: "primary"
|
|
@@ -10662,7 +10546,7 @@ const PlatformLimitsCustomerGroupsErrorModal = _ref => {
|
|
|
10662
10546
|
};
|
|
10663
10547
|
PlatformLimitsCustomerGroupsErrorModal.displayName = 'PlatformLimitsCustomerGroupsErrorModal';
|
|
10664
10548
|
|
|
10665
|
-
var styles$
|
|
10549
|
+
var styles$8 = {
|
|
10666
10550
|
"combined": "platform-limits-customer-groups-combined-module__combined___WjRoI"
|
|
10667
10551
|
};
|
|
10668
10552
|
const PlatformLimitsCustomerGroupsCombined = () => {
|
|
@@ -10670,14 +10554,12 @@ const PlatformLimitsCustomerGroupsCombined = () => {
|
|
|
10670
10554
|
const _useCustomerGroupsPla = useCustomerGroupsPlatformLimitsStatus(),
|
|
10671
10555
|
hasReachedCustomerGroupsErrorLimit = _useCustomerGroupsPla.hasReachedCustomerGroupsErrorLimit,
|
|
10672
10556
|
hasReachedCustomerGroupsWarningLimit = _useCustomerGroupsPla.hasReachedCustomerGroupsWarningLimit;
|
|
10673
|
-
const _useTheme = useTheme(),
|
|
10674
|
-
themedValue = _useTheme.themedValue;
|
|
10675
10557
|
return jsx("div", {
|
|
10676
|
-
className: styles$
|
|
10558
|
+
className: styles$8.combined,
|
|
10677
10559
|
children: jsxs(Spacings.Inline, {
|
|
10678
10560
|
scale: "xl",
|
|
10679
10561
|
justifyContent: "space-between",
|
|
10680
|
-
children: [hasReachedCustomerGroupsWarningLimit && !hasReachedCustomerGroupsErrorLimit ? jsx(PlatformLimitsCustomerGroupsNotifications, {}) :
|
|
10562
|
+
children: [hasReachedCustomerGroupsWarningLimit && !hasReachedCustomerGroupsErrorLimit ? jsx(PlatformLimitsCustomerGroupsNotifications, {}) : null, jsx(PlatformLimitsCustomerGroupsStatus, {})]
|
|
10681
10563
|
})
|
|
10682
10564
|
});
|
|
10683
10565
|
};
|
|
@@ -10707,15 +10589,15 @@ const useCustomerGroupsPlatformLimits = () => {
|
|
|
10707
10589
|
};
|
|
10708
10590
|
};
|
|
10709
10591
|
|
|
10710
|
-
function ownKeys$
|
|
10711
|
-
function _objectSpread$
|
|
10592
|
+
function ownKeys$f(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; }
|
|
10593
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10712
10594
|
const injectCustomerGroupsPlatformLimits = () => WrappedComponent => {
|
|
10713
10595
|
const WithCustomerGroupsPlatformLimits = props => {
|
|
10714
10596
|
const CustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits();
|
|
10715
10597
|
const customersProps = {
|
|
10716
10598
|
platformLimits: CustomerGroupsPlatformLimits
|
|
10717
10599
|
};
|
|
10718
|
-
return jsx(WrappedComponent, _objectSpread$
|
|
10600
|
+
return jsx(WrappedComponent, _objectSpread$f(_objectSpread$f({}, props), customersProps));
|
|
10719
10601
|
};
|
|
10720
10602
|
WithCustomerGroupsPlatformLimits.displayName = wrapDisplayName(WrappedComponent, 'WithCustomerGroupsPlatformLimits');
|
|
10721
10603
|
return WithCustomerGroupsPlatformLimits;
|
|
@@ -10770,7 +10652,7 @@ var fetchPimIndexStatus = ((apolloClient, projectKey) => async dispatch => {
|
|
|
10770
10652
|
}
|
|
10771
10653
|
});
|
|
10772
10654
|
|
|
10773
|
-
var messages$
|
|
10655
|
+
var messages$8 = defineMessages({
|
|
10774
10656
|
indexingSucceed: {
|
|
10775
10657
|
id: 'Products.PimIndexer.Notifications.indexingSucceed',
|
|
10776
10658
|
description: 'Message to be shown to user when PIM successfully finishes initial project indexing.',
|
|
@@ -10808,8 +10690,8 @@ const defaultValue = {
|
|
|
10808
10690
|
*/
|
|
10809
10691
|
const PimIndexerContext = /*#__PURE__*/createContext(defaultValue);
|
|
10810
10692
|
|
|
10811
|
-
function ownKeys$
|
|
10812
|
-
function _objectSpread$
|
|
10693
|
+
function ownKeys$e(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; }
|
|
10694
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$e(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$e(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10813
10695
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10814
10696
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10815
10697
|
var RefreshProductIndices = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "RefreshProductIndices" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "ids" } }, type: { kind: "NonNullType", type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "refreshProducts" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "ids" }, value: { kind: "Variable", name: { kind: "Name", value: "ids" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updatedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "deletedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "notFoundDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "unchangedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "failedRefreshedDocuments" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "reason" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 1119, source: { body: "mutation RefreshProductIndices($ids: [String!]!) {\n refreshProducts(ids: $ids) {\n updatedDocuments {\n id\n version\n }\n deletedDocuments {\n id\n }\n notFoundDocuments {\n id\n }\n unchangedDocuments {\n id\n version\n }\n failedRefreshedDocuments {\n id\n reason\n }\n }\n}\n\nmutation IndexProject(\n $shouldIndexProducts: Boolean!\n $shouldIndexProductTypes: Boolean!\n) {\n products: reIndexAllProducts @include(if: $shouldIndexProducts) {\n indexingJobId\n existingIndexingJobId\n }\n productTypes: reIndexAllProductTypes @include(if: $shouldIndexProductTypes) {\n indexingJobId\n existingIndexingJobId\n }\n}\n\nquery GetIndexingProgress(\n $productsJobId: String!\n $productTypesJobId: String!\n $shouldIncludeProducts: Boolean!\n $shouldIncludeProductTypes: Boolean!\n) {\n products: getReindexingStatus(id: $productsJobId)\n @include(if: $shouldIncludeProducts) {\n percentCompleted\n completed\n }\n\n productTypes: getReindexingStatus(id: $productTypesJobId)\n @include(if: $shouldIncludeProductTypes) {\n percentCompleted\n completed\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
@@ -10895,7 +10777,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10895
10777
|
_this.props.notifications.showNotification({
|
|
10896
10778
|
kind: 'error',
|
|
10897
10779
|
domain: DOMAINS.SIDE,
|
|
10898
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10780
|
+
text: _this.props.intl.formatMessage(messages$8.indexingFailed)
|
|
10899
10781
|
});
|
|
10900
10782
|
};
|
|
10901
10783
|
_this.getIndexingProgress = async () => {
|
|
@@ -10936,7 +10818,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10936
10818
|
_this.props.notifications.showNotification({
|
|
10937
10819
|
kind: 'success',
|
|
10938
10820
|
domain: DOMAINS.SIDE,
|
|
10939
|
-
text: _this.props.intl.formatMessage(messages$
|
|
10821
|
+
text: _this.props.intl.formatMessage(messages$8.indexingSucceed)
|
|
10940
10822
|
},
|
|
10941
10823
|
// because the indexing may take so long, the success notification
|
|
10942
10824
|
// may be dismissed without being seen by the user. Set `dismissAfter`
|
|
@@ -10985,7 +10867,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
10985
10867
|
shouldIndexProductTypes: isIndexingProductTypes
|
|
10986
10868
|
}
|
|
10987
10869
|
});
|
|
10988
|
-
_this.setState(_objectSpread$
|
|
10870
|
+
_this.setState(_objectSpread$e(_objectSpread$e({
|
|
10989
10871
|
isLoading: false,
|
|
10990
10872
|
isProjectBeingIndexedByPim: true
|
|
10991
10873
|
}, getIndexingJobIds(indexMutationResult)), {}, {
|
|
@@ -11010,7 +10892,7 @@ let PimIndexerProvider = /*#__PURE__*/function (_PureComponent) {
|
|
|
11010
10892
|
key: "render",
|
|
11011
10893
|
value: function render() {
|
|
11012
10894
|
return jsx(PimIndexerContext.Provider, {
|
|
11013
|
-
value: _objectSpread$
|
|
10895
|
+
value: _objectSpread$e(_objectSpread$e({}, this.state), {}, {
|
|
11014
10896
|
attemptToRefreshProducts: this.attemptToRefreshProducts,
|
|
11015
10897
|
indexProject: this.indexProject
|
|
11016
10898
|
}),
|
|
@@ -11052,13 +10934,13 @@ let WithPimIndexer = /*#__PURE__*/function (_PureComponent) {
|
|
|
11052
10934
|
}(PureComponent);
|
|
11053
10935
|
WithPimIndexer.displayName = 'WithPimIndexer';
|
|
11054
10936
|
|
|
11055
|
-
function ownKeys$
|
|
11056
|
-
function _objectSpread$
|
|
10937
|
+
function ownKeys$d(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; }
|
|
10938
|
+
function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$d(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$d(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11057
10939
|
var injectPimIndexer = (function () {
|
|
11058
10940
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'pimIndexer';
|
|
11059
10941
|
return Component => {
|
|
11060
10942
|
const WrappedComponent = props => jsx(WithPimIndexer, {
|
|
11061
|
-
children: pimIndexerProps => jsx(Component, _objectSpread$
|
|
10943
|
+
children: pimIndexerProps => jsx(Component, _objectSpread$d(_objectSpread$d({}, props), {}, {
|
|
11062
10944
|
[propName]: pimIndexerProps
|
|
11063
10945
|
}))
|
|
11064
10946
|
});
|
|
@@ -11071,7 +10953,7 @@ function usePimIndexer() {
|
|
|
11071
10953
|
return useContext(PimIndexerContext);
|
|
11072
10954
|
}
|
|
11073
10955
|
|
|
11074
|
-
var messages$
|
|
10956
|
+
var messages$7 = defineMessages({
|
|
11075
10957
|
yes: {
|
|
11076
10958
|
id: 'BooleanField.yes',
|
|
11077
10959
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -11093,8 +10975,8 @@ const BooleanField = props => {
|
|
|
11093
10975
|
var _context;
|
|
11094
10976
|
let selectedValue;
|
|
11095
10977
|
if (typeof props.value === 'boolean') selectedValue = getBooleanValue(props.value);else if (props.isMulti && _Array$isArray(props.value) && props.value.length) selectedValue = props.value.length === 2 ? 'all' : getBooleanValue(props.value[0]);
|
|
11096
|
-
const yesLabel = props.intl.formatMessage(messages$
|
|
11097
|
-
const noLabel = props.intl.formatMessage(messages$
|
|
10978
|
+
const yesLabel = props.intl.formatMessage(messages$7.yes);
|
|
10979
|
+
const noLabel = props.intl.formatMessage(messages$7.no);
|
|
11098
10980
|
const options = [{
|
|
11099
10981
|
value: 'yes',
|
|
11100
10982
|
label: yesLabel
|
|
@@ -11132,7 +11014,7 @@ function getBooleanValue(value) {
|
|
|
11132
11014
|
return value === false ? 'no' : 'yes';
|
|
11133
11015
|
}
|
|
11134
11016
|
|
|
11135
|
-
var messages$
|
|
11017
|
+
var messages$6 = defineMessages({
|
|
11136
11018
|
label: {
|
|
11137
11019
|
id: 'MissingValueField.label',
|
|
11138
11020
|
description: 'The label text for the missing values option',
|
|
@@ -11140,21 +11022,21 @@ var messages$7 = defineMessages({
|
|
|
11140
11022
|
}
|
|
11141
11023
|
});
|
|
11142
11024
|
|
|
11143
|
-
function ownKeys$
|
|
11144
|
-
function _objectSpread$
|
|
11025
|
+
function ownKeys$c(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; }
|
|
11026
|
+
function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$c(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$c(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11145
11027
|
const MissingValueField = props => jsx(CheckboxInput, {
|
|
11146
11028
|
name: "missing-value",
|
|
11147
11029
|
isChecked: props.isChecked,
|
|
11148
11030
|
onChange: props.onChange,
|
|
11149
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11031
|
+
children: jsx(FormattedMessage, _objectSpread$c({}, messages$6.label))
|
|
11150
11032
|
});
|
|
11151
11033
|
MissingValueField.defaultProps = {
|
|
11152
11034
|
isChecked: false
|
|
11153
11035
|
};
|
|
11154
11036
|
|
|
11155
|
-
function ownKeys$
|
|
11156
|
-
function _objectSpread$
|
|
11157
|
-
var styles$
|
|
11037
|
+
function ownKeys$b(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; }
|
|
11038
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11039
|
+
var styles$7 = {
|
|
11158
11040
|
"button": "button-module__button___1OzVf",
|
|
11159
11041
|
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
11160
11042
|
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
@@ -11187,10 +11069,10 @@ const Button = props => {
|
|
|
11187
11069
|
|
|
11188
11070
|
// Pass only `data-*` props
|
|
11189
11071
|
const dataProps = filterDataAttributes(props);
|
|
11190
|
-
return jsx("button", _objectSpread$
|
|
11072
|
+
return jsx("button", _objectSpread$b(_objectSpread$b({
|
|
11191
11073
|
onClick: isDisabled ? null : onClick,
|
|
11192
11074
|
type: props.type,
|
|
11193
|
-
className: classnames(styles$
|
|
11075
|
+
className: classnames(styles$7.button, isDisabled ? styles$7.disabled : null, className),
|
|
11194
11076
|
disabled: isDisabled,
|
|
11195
11077
|
"aria-label": props['aria-label']
|
|
11196
11078
|
}, dataProps), {}, {
|
|
@@ -11202,7 +11084,7 @@ Button.defaultProps = {
|
|
|
11202
11084
|
type: 'button'
|
|
11203
11085
|
};
|
|
11204
11086
|
|
|
11205
|
-
var messages$
|
|
11087
|
+
var messages$5 = defineMessages({
|
|
11206
11088
|
chooseFile: {
|
|
11207
11089
|
id: 'ButtonFileInput.chooseFile',
|
|
11208
11090
|
description: 'The label text of the field for upload local file',
|
|
@@ -11210,17 +11092,17 @@ var messages$6 = defineMessages({
|
|
|
11210
11092
|
}
|
|
11211
11093
|
});
|
|
11212
11094
|
|
|
11213
|
-
function ownKeys$
|
|
11214
|
-
function _objectSpread$
|
|
11215
|
-
var styles$
|
|
11095
|
+
function ownKeys$a(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; }
|
|
11096
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11097
|
+
var styles$6 = {
|
|
11216
11098
|
"button": "file-input-module__button___2KypN",
|
|
11217
11099
|
"input": "file-input-module__input___3MP4D"
|
|
11218
11100
|
};
|
|
11219
11101
|
const FileInput = props => jsx("label", {
|
|
11220
11102
|
children: jsxs("span", {
|
|
11221
|
-
className: styles$
|
|
11103
|
+
className: styles$6.button,
|
|
11222
11104
|
children: [jsx("input", {
|
|
11223
|
-
className: styles$
|
|
11105
|
+
className: styles$6.input,
|
|
11224
11106
|
type: "file",
|
|
11225
11107
|
accept: props.acceptTypes,
|
|
11226
11108
|
name: props.name,
|
|
@@ -11231,140 +11113,11 @@ const FileInput = props => jsx("label", {
|
|
|
11231
11113
|
});
|
|
11232
11114
|
FileInput.displayName = 'FileInput';
|
|
11233
11115
|
FileInput.defaultProps = {
|
|
11234
|
-
children: jsx(FormattedMessage, _objectSpread$
|
|
11116
|
+
children: jsx(FormattedMessage, _objectSpread$a({}, messages$5.chooseFile)),
|
|
11235
11117
|
allowMultiple: false,
|
|
11236
11118
|
acceptTypes: 'image/png,image/jpeg,image/gif'
|
|
11237
11119
|
};
|
|
11238
11120
|
|
|
11239
|
-
function ownKeys$b(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; }
|
|
11240
|
-
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11241
|
-
var styles$6 = {
|
|
11242
|
-
"button": "button-module__button___1OzVf",
|
|
11243
|
-
"cancel": "button-module__cancel___1-jYL button-module__button___1OzVf",
|
|
11244
|
-
"confirm": "button-module__confirm___-W92x button-module__button___1OzVf",
|
|
11245
|
-
"save": "button-module__save___1-KXp button-module__confirm___-W92x button-module__button___1OzVf",
|
|
11246
|
-
"add": "button-module__add___1fbPS button-module__button___1OzVf",
|
|
11247
|
-
"add-url": "button-module__add-url___1e6xE button-module__add___1fbPS button-module__button___1OzVf",
|
|
11248
|
-
"icon-add": "button-module__icon-add___2X7fc",
|
|
11249
|
-
"icon-chain": "button-module__icon-chain___1pvWT",
|
|
11250
|
-
"switch": "button-module__switch___2bt5z",
|
|
11251
|
-
"icon": "button-module__icon___wuw4Z",
|
|
11252
|
-
"switch--active": "button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11253
|
-
"switch-squared": "button-module__switch-squared___QnrOG button-module__button___1OzVf button-module__switch___2bt5z",
|
|
11254
|
-
"switch-squared--active": "button-module__switch-squared--active___2ZbEC button-module__switch-squared___QnrOG button-module__button___1OzVf button-module__switch___2bt5z button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11255
|
-
"switch-rounded": "button-module__switch-rounded___1CBs_ button-module__switch___2bt5z",
|
|
11256
|
-
"switch-rounded--active": "button-module__switch-rounded--active___2Ckga button-module__switch-rounded___1CBs_ button-module__switch___2bt5z button-module__switch--active___1s4ZM button-module__switch___2bt5z",
|
|
11257
|
-
"switch-label": "button-module__switch-label___2FAdy",
|
|
11258
|
-
"disabled": "button-module__disabled___2Azpu",
|
|
11259
|
-
"full": "button-module__full___264Zw",
|
|
11260
|
-
"alt": "button-module__alt___Z6PWx",
|
|
11261
|
-
"confirm-alt": "button-module__confirm-alt___2Zcqz button-module__confirm___-W92x button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11262
|
-
"cancel-alt": "button-module__cancel-alt___u5EAw button-module__cancel___1-jYL button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11263
|
-
"save-alt": "button-module__save-alt___6iHMF button-module__save___1-KXp button-module__confirm___-W92x button-module__button___1OzVf button-module__alt___Z6PWx",
|
|
11264
|
-
"add-button": "button-module__add-button___1f093"
|
|
11265
|
-
};
|
|
11266
|
-
/**
|
|
11267
|
-
* Button-Typed
|
|
11268
|
-
*
|
|
11269
|
-
* This module generates button components based on a name, type and several
|
|
11270
|
-
* default options.
|
|
11271
|
-
*
|
|
11272
|
-
* Each button has a TYPE (save, confirm, cancel, add) and may have a STYLE
|
|
11273
|
-
* (default, alternative)
|
|
11274
|
-
*
|
|
11275
|
-
* Each button may or may not have a default label and icon. If no default label
|
|
11276
|
-
* is provided, then label becomes a required prop. If no default icon is
|
|
11277
|
-
* provided then icon is still an optional prop.
|
|
11278
|
-
*
|
|
11279
|
-
* If the option hasAlternativeStyle is true, then the `style` prop may be either
|
|
11280
|
-
* "default" or "alternative", otherwise the style prop will default to "default"
|
|
11281
|
-
* and can not be set to anything else.
|
|
11282
|
-
*/
|
|
11283
|
-
function ButtonTyped (name, options) {
|
|
11284
|
-
const defaultLabel = options.defaultLabel,
|
|
11285
|
-
defaultIcon = options.defaultIcon,
|
|
11286
|
-
type = options.type,
|
|
11287
|
-
hasAlternativeStyle = options.hasAlternativeStyle,
|
|
11288
|
-
buttonWrapperClassName = options.buttonWrapperClassName;
|
|
11289
|
-
const validTypes = ['save', 'cancel', 'confirm', 'add'];
|
|
11290
|
-
if (!_includesInstanceProperty(validTypes).call(validTypes, type)) throw new Error('Invalid button type provided to ButtonTyped');
|
|
11291
|
-
const ButtonTyped = props => {
|
|
11292
|
-
const label = props.label,
|
|
11293
|
-
onClick = props.onClick,
|
|
11294
|
-
isDisabled = props.isDisabled,
|
|
11295
|
-
fullWidth = props.fullWidth,
|
|
11296
|
-
style = props.style,
|
|
11297
|
-
icon = props.icon,
|
|
11298
|
-
url = props.url,
|
|
11299
|
-
className = props.className;
|
|
11300
|
-
const isAlternativeStyle = hasAlternativeStyle && style === 'alternative';
|
|
11301
|
-
const hasIcon = defaultIcon || icon;
|
|
11302
|
-
const classNames = classnames({
|
|
11303
|
-
[styles$6.full]: fullWidth
|
|
11304
|
-
}, isAlternativeStyle ? styles$6["".concat(type, "-alt")] : styles$6[type], className);
|
|
11305
|
-
const computedLabel = label || defaultLabel;
|
|
11306
|
-
const dataAttrs = filterDataAttributes(props);
|
|
11307
|
-
return jsx(Button, _objectSpread$b(_objectSpread$b({
|
|
11308
|
-
onClick: isDisabled ? null : onClick,
|
|
11309
|
-
url: url,
|
|
11310
|
-
isDisabled: isDisabled,
|
|
11311
|
-
className: classNames
|
|
11312
|
-
}, dataAttrs), {}, {
|
|
11313
|
-
children: jsxs("div", {
|
|
11314
|
-
className: buttonWrapperClassName,
|
|
11315
|
-
children: [/*#__PURE__*/isValidElement(computedLabel) ? computedLabel : jsx("span", {
|
|
11316
|
-
children: computedLabel
|
|
11317
|
-
}), hasIcon ? icon || defaultIcon : null]
|
|
11318
|
-
})
|
|
11319
|
-
}));
|
|
11320
|
-
};
|
|
11321
|
-
ButtonTyped.displayName = name;
|
|
11322
|
-
ButtonTyped.defaultProps = {
|
|
11323
|
-
isDisabled: false,
|
|
11324
|
-
fullWidth: false,
|
|
11325
|
-
style: 'default',
|
|
11326
|
-
icon: null,
|
|
11327
|
-
className: null
|
|
11328
|
-
};
|
|
11329
|
-
return ButtonTyped;
|
|
11330
|
-
}
|
|
11331
|
-
|
|
11332
|
-
const messages$5 = defineMessages({
|
|
11333
|
-
cancel: {
|
|
11334
|
-
id: 'Button.cancel',
|
|
11335
|
-
description: 'Label for the cancel button',
|
|
11336
|
-
defaultMessage: 'Cancel'
|
|
11337
|
-
},
|
|
11338
|
-
confirm: {
|
|
11339
|
-
id: 'Button.confirm',
|
|
11340
|
-
description: 'Label for the confirm button',
|
|
11341
|
-
defaultMessage: 'Confirm'
|
|
11342
|
-
},
|
|
11343
|
-
save: {
|
|
11344
|
-
id: 'Button.save',
|
|
11345
|
-
description: 'Label for the save button',
|
|
11346
|
-
defaultMessage: 'Save'
|
|
11347
|
-
}
|
|
11348
|
-
});
|
|
11349
|
-
|
|
11350
|
-
function ownKeys$a(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; }
|
|
11351
|
-
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11352
|
-
const ButtonCancel = ButtonTyped('ButtonCancel', {
|
|
11353
|
-
type: 'cancel',
|
|
11354
|
-
defaultLabel: jsx(FormattedMessage, _objectSpread$a({}, messages$5.cancel)),
|
|
11355
|
-
hasAlternativeStyle: true
|
|
11356
|
-
});
|
|
11357
|
-
const ButtonConfirm = ButtonTyped('ButtonConfirm', {
|
|
11358
|
-
type: 'confirm',
|
|
11359
|
-
defaultLabel: jsx(FormattedMessage, _objectSpread$a({}, messages$5.confirm)),
|
|
11360
|
-
hasAlternativeStyle: true
|
|
11361
|
-
});
|
|
11362
|
-
const ButtonSave = ButtonTyped('ButtonSave', {
|
|
11363
|
-
type: 'save',
|
|
11364
|
-
defaultLabel: jsx(FormattedMessage, _objectSpread$a({}, messages$5.save)),
|
|
11365
|
-
hasAlternativeStyle: true
|
|
11366
|
-
});
|
|
11367
|
-
|
|
11368
11121
|
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
11369
11122
|
var styles$5 = {
|
|
11370
11123
|
"colored": "required-indicator-module__colored____YUFm",
|
|
@@ -11542,7 +11295,7 @@ const validateRequired = value => {
|
|
|
11542
11295
|
};
|
|
11543
11296
|
const VALIDATOR_REQUIRED = {
|
|
11544
11297
|
name: 'required',
|
|
11545
|
-
message: messages$
|
|
11298
|
+
message: messages$J.required,
|
|
11546
11299
|
permanent: true,
|
|
11547
11300
|
validators: {
|
|
11548
11301
|
change(value) {
|
|
@@ -11556,7 +11309,7 @@ const VALIDATOR_REQUIRED = {
|
|
|
11556
11309
|
};
|
|
11557
11310
|
const VALIDATOR_NUMERIC = {
|
|
11558
11311
|
name: 'numeric',
|
|
11559
|
-
message: messages$
|
|
11312
|
+
message: messages$J.numeric,
|
|
11560
11313
|
permanent: false,
|
|
11561
11314
|
validators: {
|
|
11562
11315
|
change: v => {
|
|
@@ -11571,7 +11324,7 @@ const VALIDATOR_NUMERIC = {
|
|
|
11571
11324
|
};
|
|
11572
11325
|
const VALIDATOR_INTEGER = {
|
|
11573
11326
|
name: 'integer',
|
|
11574
|
-
message: messages$
|
|
11327
|
+
message: messages$J.integer,
|
|
11575
11328
|
permanent: false,
|
|
11576
11329
|
validators: {
|
|
11577
11330
|
change: v => {
|
|
@@ -11586,7 +11339,7 @@ const VALIDATOR_INTEGER = {
|
|
|
11586
11339
|
};
|
|
11587
11340
|
({
|
|
11588
11341
|
name: 'email',
|
|
11589
|
-
message: messages$
|
|
11342
|
+
message: messages$J.email,
|
|
11590
11343
|
permanent: false,
|
|
11591
11344
|
validators: {
|
|
11592
11345
|
// Note: it's a bit weird to validate it on every change,
|
|
@@ -12523,17 +12276,17 @@ function isValidISODateTime(_ref3) {
|
|
|
12523
12276
|
}
|
|
12524
12277
|
|
|
12525
12278
|
const validateSingleOptionEnum = (selectedOption, intl) => {
|
|
12526
|
-
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$
|
|
12279
|
+
if (validateSingleFilter(selectedOption)) return intl.formatMessage(messages$J.required);
|
|
12527
12280
|
return null;
|
|
12528
12281
|
};
|
|
12529
12282
|
const validateMultiOptionEnum = (selectedOption, intl) => {
|
|
12530
|
-
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$
|
|
12283
|
+
if (validateSingleFilter(selectedOption) || selectedOption.value.length === 0) return intl.formatMessage(messages$J.required);
|
|
12531
12284
|
return null;
|
|
12532
12285
|
};
|
|
12533
12286
|
|
|
12534
12287
|
// eslint-disable-next-line import/prefer-default-export
|
|
12535
12288
|
const validateText = (text, intl) => {
|
|
12536
|
-
if (validateSingleFilter(text)) return intl.formatMessage(messages$
|
|
12289
|
+
if (validateSingleFilter(text)) return intl.formatMessage(messages$J.required);
|
|
12537
12290
|
return null;
|
|
12538
12291
|
};
|
|
12539
12292
|
|
|
@@ -12985,4 +12738,4 @@ function withPendingRequests() {
|
|
|
12985
12738
|
|
|
12986
12739
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, 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: "slugAllLocales" }, 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: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ 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: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
12987
12740
|
|
|
12988
|
-
export { booleanField as BooleanField, Button,
|
|
12741
|
+
export { booleanField as BooleanField, Button, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$7 as booleanMessages, buildSearchQuery, messages$q as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$2 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapStoresToOptions, mapTimeZonesToOptions, minusify, messages$6 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$3 as productSelectionsFetcherMockHandler, handlers$4 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$E as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$5 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, useTotalNumberOfStoresFetcher, handlers$1 as useTotalNumberOfStoresFetcherHandlers, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$J as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|