@commercetools-frontend/experimental-components 8.1.0 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-experimental-components.cjs.dev.js +241 -710
- package/dist/commercetools-frontend-experimental-components.cjs.prod.js +234 -687
- package/dist/commercetools-frontend-experimental-components.esm.js +242 -704
- package/dist/declarations/src/hooks/index.d.ts +0 -1
- package/dist/declarations/src/index.d.ts +3 -9
- package/dist/declarations/src/utils/products/products.d.ts +4 -3
- package/package.json +28 -28
- package/dist/declarations/src/components/carousel/carousel.d.ts +0 -32
- package/dist/declarations/src/components/carousel/index.d.ts +0 -2
- package/dist/declarations/src/components/centered-loading-spinner/centered-loading-spinner.d.ts +0 -9
- package/dist/declarations/src/components/centered-loading-spinner/index.d.ts +0 -1
- package/dist/declarations/src/components/divider/divider.d.ts +0 -12
- package/dist/declarations/src/components/divider/index.d.ts +0 -1
- package/dist/declarations/src/components/required-indicator/required-indicator.d.ts +0 -10
- package/dist/declarations/src/components/scroll-to-field-error/scroll-to-field-error.d.ts +0 -2
- package/dist/declarations/src/components/selectable-field-search-input/selectable-field-search-input.d.ts +0 -14
- package/dist/declarations/src/hooks/use-db-maintenance-notification/index.d.ts +0 -1
- package/dist/declarations/src/hooks/use-db-maintenance-notification/use-db-maintenance-notification.d.ts +0 -7
|
@@ -61,6 +61,7 @@ var merge = require('lodash/merge');
|
|
|
61
61
|
var set = require('lodash/set');
|
|
62
62
|
var times = require('lodash/times');
|
|
63
63
|
var uuid = require('uuid');
|
|
64
|
+
var merchantCenterSharedUi = require('@commercetools/merchant-center-shared-ui');
|
|
64
65
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
65
66
|
var reselect = require('reselect');
|
|
66
67
|
var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/ends-with');
|
|
@@ -76,7 +77,6 @@ var _ = require('@commercetools-frontend/ui-kit/');
|
|
|
76
77
|
var PropTypes = require('prop-types');
|
|
77
78
|
var dnd = require('@hello-pangea/dnd');
|
|
78
79
|
var ReactDOM = require('react-dom');
|
|
79
|
-
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
80
80
|
var selectUtils = require('@commercetools-uikit/select-utils');
|
|
81
81
|
var utils = require('@commercetools-uikit/utils');
|
|
82
82
|
require('react-required-if');
|
|
@@ -107,9 +107,6 @@ var _Date$now = require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
|
107
107
|
var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
|
|
108
108
|
var memoize = require('memoize-one');
|
|
109
109
|
var omitEmpty = require('omit-empty-es');
|
|
110
|
-
var shuffle = require('lodash/shuffle');
|
|
111
|
-
var reactSnapCarousel = require('react-snap-carousel');
|
|
112
|
-
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
113
110
|
var hoc = require('@apollo/client/react/hoc');
|
|
114
111
|
var flatten = require('lodash/flatten');
|
|
115
112
|
var flowRight = require('lodash/flowRight');
|
|
@@ -118,7 +115,9 @@ var invariant = require('tiny-invariant');
|
|
|
118
115
|
var hoistNonReactStatics = require('hoist-non-react-statics');
|
|
119
116
|
var hooks = require('@apollo/client/react/hooks');
|
|
120
117
|
var reactRedux = require('react-redux');
|
|
118
|
+
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
121
119
|
var get = require('lodash/get');
|
|
120
|
+
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
122
121
|
|
|
123
122
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
124
123
|
|
|
@@ -185,7 +184,6 @@ var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
|
185
184
|
var keyBy__default = /*#__PURE__*/_interopDefault(keyBy);
|
|
186
185
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
187
186
|
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
188
|
-
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
189
187
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
190
188
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
191
189
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
@@ -210,25 +208,13 @@ var _Date$now__default = /*#__PURE__*/_interopDefault(_Date$now);
|
|
|
210
208
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
211
209
|
var memoize__default = /*#__PURE__*/_interopDefault(memoize);
|
|
212
210
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
213
|
-
var shuffle__default = /*#__PURE__*/_interopDefault(shuffle);
|
|
214
211
|
var flatten__default = /*#__PURE__*/_interopDefault(flatten);
|
|
215
212
|
var flowRight__default = /*#__PURE__*/_interopDefault(flowRight);
|
|
216
213
|
var uniqBy__default = /*#__PURE__*/_interopDefault(uniqBy);
|
|
217
214
|
var invariant__default = /*#__PURE__*/_interopDefault(invariant);
|
|
218
215
|
var hoistNonReactStatics__default = /*#__PURE__*/_interopDefault(hoistNonReactStatics);
|
|
219
216
|
var get__default = /*#__PURE__*/_interopDefault(get);
|
|
220
|
-
|
|
221
|
-
var _ref$f = {
|
|
222
|
-
name: "1tmmbhs",
|
|
223
|
-
styles: "height:100%;display:flex;flex-grow:1;align-items:center;justify-content:center"
|
|
224
|
-
} ;
|
|
225
|
-
const CenteredLoadingSpinner = () => jsxRuntime.jsx("div", {
|
|
226
|
-
css: _ref$f,
|
|
227
|
-
"data-testid": "centered-loading-spinner",
|
|
228
|
-
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {})
|
|
229
|
-
});
|
|
230
|
-
CenteredLoadingSpinner.displayName = 'CenteredLoadingSpinner';
|
|
231
|
-
var CenteredLoadingSpinner$1 = CenteredLoadingSpinner;
|
|
217
|
+
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
232
218
|
|
|
233
219
|
const LOWER_STORES_LIMIT = 60;
|
|
234
220
|
const UPPER_STORES_LIMIT = 500;
|
|
@@ -298,7 +284,7 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
298
284
|
}
|
|
299
285
|
});
|
|
300
286
|
|
|
301
|
-
var messages$
|
|
287
|
+
var messages$Q = reactIntl.defineMessages({
|
|
302
288
|
noChannelsFound: {
|
|
303
289
|
id: 'Products.ChannelPickerInput.noChannelsFound',
|
|
304
290
|
description: 'The message to display when no channels were found',
|
|
@@ -311,8 +297,8 @@ var messages$S = reactIntl.defineMessages({
|
|
|
311
297
|
}
|
|
312
298
|
});
|
|
313
299
|
|
|
314
|
-
function ownKeys$
|
|
315
|
-
function _objectSpread$
|
|
300
|
+
function ownKeys$1t(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
301
|
+
function _objectSpread$1t(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1t(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1t(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
316
302
|
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 } } } };
|
|
317
303
|
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 } } } };
|
|
318
304
|
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 } } } };
|
|
@@ -341,7 +327,7 @@ const ChannelPickerInput = _ref => {
|
|
|
341
327
|
const dataLocale = applicationShellConnectors.useApplicationContext(applicationContext => applicationContext.dataLocale);
|
|
342
328
|
const variables = React.useMemo(() => {
|
|
343
329
|
const rolesClause = getRolesClause(roles);
|
|
344
|
-
return _objectSpread$
|
|
330
|
+
return _objectSpread$1t({
|
|
345
331
|
sortByNamePath: `name.${dataLocale}`
|
|
346
332
|
}, rolesClause && {
|
|
347
333
|
extraWhere: rolesClause
|
|
@@ -417,7 +403,7 @@ const ChannelPickerInput = _ref => {
|
|
|
417
403
|
if (isCurrentOptionLoadingFailed && onError) onError(currentOptions.error);
|
|
418
404
|
}, [isCurrentOptionLoadingFailed, onError, currentOptions]);
|
|
419
405
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
420
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
406
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$Q.noChannelsFound), [loadingError, formatMessage]);
|
|
421
407
|
const tooltipTitle = !isMulti ? currentSingleOption?.data?.label ?? '' : '';
|
|
422
408
|
const selectedValue = currentOptions.data ?? (isMulti ? [] : null);
|
|
423
409
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
@@ -429,7 +415,7 @@ const ChannelPickerInput = _ref => {
|
|
|
429
415
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
430
416
|
id: name,
|
|
431
417
|
name: name,
|
|
432
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
418
|
+
placeholder: placeholder ?? formatMessage(messages$Q.placeholder),
|
|
433
419
|
loadOptions: loadOptionsDebounced,
|
|
434
420
|
defaultOptions: true,
|
|
435
421
|
showOptionGroupDivider: true,
|
|
@@ -485,7 +471,7 @@ let FormattedDateTime = /*#__PURE__*/function (_PureComponent) {
|
|
|
485
471
|
FormattedDateTime.displayName = 'FormattedDateTime';
|
|
486
472
|
var FormattedDateTime$1 = reactIntl.injectIntl(FormattedDateTime);
|
|
487
473
|
|
|
488
|
-
var messages$
|
|
474
|
+
var messages$P = reactIntl.defineMessages({
|
|
489
475
|
noProductTypesFound: {
|
|
490
476
|
id: 'Products.ProductTypePickerInput.noProductTypesFound',
|
|
491
477
|
description: 'The message to display when no product types were found',
|
|
@@ -567,14 +553,14 @@ const ProductTypePickerInput = _ref => {
|
|
|
567
553
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
568
554
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
569
555
|
max: "scale",
|
|
570
|
-
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner
|
|
556
|
+
children: currentOption.loading ? jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
571
557
|
scale: "xs",
|
|
572
558
|
children: [jsxRuntime.jsx(CustomFieldTooltip$1, {
|
|
573
559
|
title: tooltipTitle,
|
|
574
560
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
575
561
|
id: name,
|
|
576
562
|
name: name,
|
|
577
|
-
placeholder: formatMessage(messages$
|
|
563
|
+
placeholder: formatMessage(messages$P.placeholder),
|
|
578
564
|
loadOptions: loadOptionsDebounced,
|
|
579
565
|
defaultOptions: [],
|
|
580
566
|
isClearable: isClearable,
|
|
@@ -587,7 +573,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
587
573
|
onInputChange: handleInputChange,
|
|
588
574
|
onBlur: onBlur,
|
|
589
575
|
value: currentOption.data,
|
|
590
|
-
noOptionsMessage: () => loadingError ? null : formatMessage(messages$
|
|
576
|
+
noOptionsMessage: () => loadingError ? null : formatMessage(messages$P.noProductTypesFound),
|
|
591
577
|
hasError: hasError || isLoadingFailed,
|
|
592
578
|
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
593
579
|
menuPortalTarget: document.body,
|
|
@@ -603,7 +589,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
603
589
|
ProductTypePickerInput.displayName = 'ProductTypePickerInput';
|
|
604
590
|
var ProductTypePickerInput$1 = ProductTypePickerInput;
|
|
605
591
|
|
|
606
|
-
var messages$
|
|
592
|
+
var messages$O = reactIntl.defineMessages({
|
|
607
593
|
noStatesFound: {
|
|
608
594
|
id: 'Products.StatePickerInput.noStatesFound',
|
|
609
595
|
description: 'The message to display when no states were found',
|
|
@@ -687,11 +673,11 @@ const StatePickerInput = _ref => {
|
|
|
687
673
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
688
674
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
689
675
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
690
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
676
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$O.noStatesFound), [loadingError, formatMessage]);
|
|
691
677
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
692
678
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
693
679
|
max: "scale",
|
|
694
|
-
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner
|
|
680
|
+
children: currentOption.loading ? jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
695
681
|
scale: "xs",
|
|
696
682
|
children: [jsxRuntime.jsx(CustomFieldTooltip$1, {
|
|
697
683
|
title: tooltipTitle,
|
|
@@ -699,7 +685,7 @@ const StatePickerInput = _ref => {
|
|
|
699
685
|
id: name,
|
|
700
686
|
name: name,
|
|
701
687
|
horizontalConstraint: "scale",
|
|
702
|
-
placeholder: formatMessage(messages$
|
|
688
|
+
placeholder: formatMessage(messages$O.placeholder),
|
|
703
689
|
loadOptions: loadOptionsDebounced,
|
|
704
690
|
defaultOptions: true,
|
|
705
691
|
showOptionGroupDivider: true,
|
|
@@ -729,9 +715,9 @@ const StatePickerInput = _ref => {
|
|
|
729
715
|
StatePickerInput.displayName = 'StatePickerInput';
|
|
730
716
|
var StatePickerInput$1 = StatePickerInput;
|
|
731
717
|
|
|
732
|
-
function ownKeys$
|
|
733
|
-
function _objectSpread$
|
|
734
|
-
const TooltipWrapper = /*#__PURE__*/React__namespace["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$
|
|
718
|
+
function ownKeys$1s(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
719
|
+
function _objectSpread$1s(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1s(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1s(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
720
|
+
const TooltipWrapper = /*#__PURE__*/React__namespace["default"].forwardRef((props, ref) => jsxRuntime.jsx("div", _objectSpread$1s({
|
|
735
721
|
ref: ref,
|
|
736
722
|
style: {
|
|
737
723
|
display: 'block',
|
|
@@ -756,7 +742,7 @@ const CustomFieldTooltip = _ref => {
|
|
|
756
742
|
};
|
|
757
743
|
var CustomFieldTooltip$1 = CustomFieldTooltip;
|
|
758
744
|
|
|
759
|
-
var messages$
|
|
745
|
+
var messages$N = reactIntl.defineMessages({
|
|
760
746
|
bottomOption: {
|
|
761
747
|
id: 'Products.Pickers.bottomOption',
|
|
762
748
|
description: 'The message to display at the end of the options menu',
|
|
@@ -764,11 +750,11 @@ var messages$P = reactIntl.defineMessages({
|
|
|
764
750
|
}
|
|
765
751
|
});
|
|
766
752
|
|
|
767
|
-
function ownKeys$
|
|
768
|
-
function _objectSpread$
|
|
753
|
+
function ownKeys$1r(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
754
|
+
function _objectSpread$1r(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1r(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1r(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
769
755
|
const getBottomOption = formatMessage => ({
|
|
770
756
|
options: [{
|
|
771
|
-
label: formatMessage ? formatMessage(messages$
|
|
757
|
+
label: formatMessage ? formatMessage(messages$N.bottomOption) : messages$N.bottomOption,
|
|
772
758
|
isBottomOption: true,
|
|
773
759
|
isDisabled: true
|
|
774
760
|
}]
|
|
@@ -776,7 +762,7 @@ const getBottomOption = formatMessage => ({
|
|
|
776
762
|
const Option$2 = props => {
|
|
777
763
|
const _useIntl = reactIntl.useIntl(),
|
|
778
764
|
formatMessage = _useIntl.formatMessage;
|
|
779
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
765
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$1r(_objectSpread$1r({}, props), {}, {
|
|
780
766
|
children: props.data.isBottomOption ? jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
781
767
|
tone: "secondary",
|
|
782
768
|
children: formatMessage(props.data.label)
|
|
@@ -793,8 +779,8 @@ const Option$2 = props => {
|
|
|
793
779
|
};
|
|
794
780
|
Option$2.displayName = 'Option';
|
|
795
781
|
|
|
796
|
-
function ownKeys$
|
|
797
|
-
function _objectSpread$
|
|
782
|
+
function ownKeys$1q(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
783
|
+
function _objectSpread$1q(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1q(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1q(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
798
784
|
const useHandlers = onChange => {
|
|
799
785
|
const _useState = React.useState(),
|
|
800
786
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -805,8 +791,8 @@ const useHandlers = onChange => {
|
|
|
805
791
|
}, []);
|
|
806
792
|
const handleChange = useEventCallback$1(event => {
|
|
807
793
|
var _context;
|
|
808
|
-
const eventWithExtractedValue = _objectSpread$
|
|
809
|
-
target: _objectSpread$
|
|
794
|
+
const eventWithExtractedValue = _objectSpread$1q(_objectSpread$1q({}, event), {}, {
|
|
795
|
+
target: _objectSpread$1q(_objectSpread$1q({}, event.target), {}, {
|
|
810
796
|
value: _Array$isArray__default["default"](event.target.value) ? _mapInstanceProperty__default["default"](_context = event.target.value).call(_context, item => item?.value) : event.target.value?.value
|
|
811
797
|
})
|
|
812
798
|
});
|
|
@@ -816,9 +802,9 @@ const useHandlers = onChange => {
|
|
|
816
802
|
};
|
|
817
803
|
var useHandlers$1 = useHandlers;
|
|
818
804
|
|
|
819
|
-
const _excluded$
|
|
820
|
-
function ownKeys$
|
|
821
|
-
function _objectSpread$
|
|
805
|
+
const _excluded$d = ["extraWhere"];
|
|
806
|
+
function ownKeys$1p(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
807
|
+
function _objectSpread$1p(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$1p(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$1p(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
822
808
|
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
823
809
|
const constructPrefixSearchPredicate$1 = function () {
|
|
824
810
|
let prefixSearchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -860,13 +846,13 @@ const useLoadOptions = _ref => {
|
|
|
860
846
|
}
|
|
861
847
|
const _ref2 = variables ?? {},
|
|
862
848
|
extraWhere = _ref2.extraWhere,
|
|
863
|
-
restVariables = _objectWithoutProperties(_ref2, _excluded$
|
|
849
|
+
restVariables = _objectWithoutProperties(_ref2, _excluded$d);
|
|
864
850
|
if (typeof extraWhere === 'string') {
|
|
865
851
|
where = where ? `(${where}) and ${variables.extraWhere}` : variables.extraWhere;
|
|
866
852
|
}
|
|
867
853
|
return client$1.query({
|
|
868
854
|
query,
|
|
869
|
-
variables: _objectSpread$
|
|
855
|
+
variables: _objectSpread$1p({
|
|
870
856
|
where
|
|
871
857
|
}, restVariables),
|
|
872
858
|
context: {
|
|
@@ -1169,8 +1155,8 @@ var setDisplayName$1 = setDisplayName;
|
|
|
1169
1155
|
const wrapDisplayName = (BaseComponent, hocName) => `${hocName}(${getDisplayName$1(BaseComponent)})`;
|
|
1170
1156
|
var wrapDisplayName$1 = wrapDisplayName;
|
|
1171
1157
|
|
|
1172
|
-
function ownKeys$
|
|
1173
|
-
function _objectSpread$
|
|
1158
|
+
function ownKeys$1o(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1159
|
+
function _objectSpread$1o(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1o(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1o(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1174
1160
|
const injectDataTablePaginationState = initialValues => Component => {
|
|
1175
1161
|
const WithDataTablePaginationState = props => {
|
|
1176
1162
|
const _usePaginationState = uiKit.usePaginationState({
|
|
@@ -1183,7 +1169,7 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1183
1169
|
key: initialValues?.tableSorting?.key,
|
|
1184
1170
|
order: initialValues?.tableSorting?.order
|
|
1185
1171
|
});
|
|
1186
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1172
|
+
return jsxRuntime.jsx(Component, _objectSpread$1o(_objectSpread$1o({}, props), {}, {
|
|
1187
1173
|
dataTablePaginationState: {
|
|
1188
1174
|
page,
|
|
1189
1175
|
perPage,
|
|
@@ -1196,8 +1182,8 @@ const injectDataTablePaginationState = initialValues => Component => {
|
|
|
1196
1182
|
};
|
|
1197
1183
|
var injectDataTablePaginationState$1 = injectDataTablePaginationState;
|
|
1198
1184
|
|
|
1199
|
-
function ownKeys$
|
|
1200
|
-
function _objectSpread$
|
|
1185
|
+
function ownKeys$1n(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1186
|
+
function _objectSpread$1n(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1n(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1n(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1201
1187
|
const injectNotifications = function () {
|
|
1202
1188
|
let propName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'notifications';
|
|
1203
1189
|
return Component => {
|
|
@@ -1212,7 +1198,7 @@ const injectNotifications = function () {
|
|
|
1212
1198
|
onActionError,
|
|
1213
1199
|
hideAllPageNotifications
|
|
1214
1200
|
};
|
|
1215
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1201
|
+
return jsxRuntime.jsx(Component, _objectSpread$1n(_objectSpread$1n({}, props), {}, {
|
|
1216
1202
|
[propName]: notifications
|
|
1217
1203
|
}));
|
|
1218
1204
|
};
|
|
@@ -1222,23 +1208,23 @@ const injectNotifications = function () {
|
|
|
1222
1208
|
};
|
|
1223
1209
|
var injectNotifications$1 = injectNotifications;
|
|
1224
1210
|
|
|
1225
|
-
function ownKeys$
|
|
1226
|
-
function _objectSpread$
|
|
1211
|
+
function ownKeys$1m(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1212
|
+
function _objectSpread$1m(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1m(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1m(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1227
1213
|
function isPropsMapper(mapProps) {
|
|
1228
1214
|
return typeof mapProps === 'function';
|
|
1229
1215
|
}
|
|
1230
1216
|
const withProps = mapProps => Component => {
|
|
1231
1217
|
const EnhancedWithProps = ownProps => {
|
|
1232
|
-
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$
|
|
1233
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1218
|
+
const enhancedProps = isPropsMapper(mapProps) ? _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps(ownProps)) : _objectSpread$1m(_objectSpread$1m({}, ownProps), mapProps);
|
|
1219
|
+
return jsxRuntime.jsx(Component, _objectSpread$1m({}, enhancedProps));
|
|
1234
1220
|
};
|
|
1235
1221
|
EnhancedWithProps.displayName = wrapDisplayName$1(Component, 'withProps');
|
|
1236
1222
|
return EnhancedWithProps;
|
|
1237
1223
|
};
|
|
1238
1224
|
var withProps$1 = withProps;
|
|
1239
1225
|
|
|
1240
|
-
function ownKeys$
|
|
1241
|
-
function _objectSpread$
|
|
1226
|
+
function ownKeys$1l(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1227
|
+
function _objectSpread$1l(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1l(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1l(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1242
1228
|
const useRedirectEffect = _ref => {
|
|
1243
1229
|
let goTo = _ref.goTo;
|
|
1244
1230
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1258,31 +1244,31 @@ const defaultOptions$5 = {
|
|
|
1258
1244
|
skip: () => false
|
|
1259
1245
|
};
|
|
1260
1246
|
const withRedirectTo = options => Component => {
|
|
1261
|
-
const mergedOptions = _objectSpread$
|
|
1247
|
+
const mergedOptions = _objectSpread$1l(_objectSpread$1l({}, defaultOptions$5), options);
|
|
1262
1248
|
const WithRedirectTo = props => {
|
|
1263
1249
|
if (!mergedOptions.skip(props)) {
|
|
1264
1250
|
return jsxRuntime.jsx(RedirectTo, {
|
|
1265
1251
|
goTo: options.selectGoTo(props)
|
|
1266
1252
|
});
|
|
1267
1253
|
}
|
|
1268
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1254
|
+
return jsxRuntime.jsx(Component, _objectSpread$1l({}, props));
|
|
1269
1255
|
};
|
|
1270
1256
|
WithRedirectTo.displayName = 'WithFirstStepRedirect';
|
|
1271
1257
|
return WithRedirectTo;
|
|
1272
1258
|
};
|
|
1273
1259
|
var withRedirectTo$1 = withRedirectTo;
|
|
1274
1260
|
|
|
1275
|
-
function ownKeys$
|
|
1276
|
-
function _objectSpread$
|
|
1261
|
+
function ownKeys$1k(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1262
|
+
function _objectSpread$1k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1k(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1277
1263
|
const defaultOptions$4 = {
|
|
1278
1264
|
propName: 'modalState',
|
|
1279
1265
|
isInitiallyOpen: false
|
|
1280
1266
|
};
|
|
1281
1267
|
const injectModalState$2 = options => Component => {
|
|
1282
|
-
const mergedOptions = _objectSpread$
|
|
1268
|
+
const mergedOptions = _objectSpread$1k(_objectSpread$1k({}, defaultOptions$4), options);
|
|
1283
1269
|
const WithModalState = props => {
|
|
1284
1270
|
const modalState = applicationComponents.useModalState(mergedOptions.isInitiallyOpen);
|
|
1285
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1271
|
+
return jsxRuntime.jsx(Component, _objectSpread$1k(_objectSpread$1k({}, props), {}, {
|
|
1286
1272
|
[mergedOptions.propName]: modalState
|
|
1287
1273
|
}));
|
|
1288
1274
|
};
|
|
@@ -1291,17 +1277,17 @@ const injectModalState$2 = options => Component => {
|
|
|
1291
1277
|
};
|
|
1292
1278
|
var injectModalState$3 = injectModalState$2;
|
|
1293
1279
|
|
|
1294
|
-
function ownKeys$
|
|
1295
|
-
function _objectSpread$
|
|
1280
|
+
function ownKeys$1j(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1281
|
+
function _objectSpread$1j(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1j(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1j(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1296
1282
|
const defaultOptions$3 = {
|
|
1297
1283
|
propName: 'toggleState',
|
|
1298
1284
|
isInitiallyOpen: false
|
|
1299
1285
|
};
|
|
1300
1286
|
const injectModalState = options => Component => {
|
|
1301
|
-
const mergedOptions = _objectSpread$
|
|
1287
|
+
const mergedOptions = _objectSpread$1j(_objectSpread$1j({}, defaultOptions$3), options);
|
|
1302
1288
|
const WithToggleState = props => {
|
|
1303
1289
|
const toggleState = uiKit.useToggleState(mergedOptions.isInitiallyOpen);
|
|
1304
|
-
return jsxRuntime.jsx(Component, _objectSpread$
|
|
1290
|
+
return jsxRuntime.jsx(Component, _objectSpread$1j(_objectSpread$1j({}, props), {}, {
|
|
1305
1291
|
[mergedOptions.propName]: toggleState
|
|
1306
1292
|
}));
|
|
1307
1293
|
};
|
|
@@ -1310,8 +1296,8 @@ const injectModalState = options => Component => {
|
|
|
1310
1296
|
};
|
|
1311
1297
|
var injectModalState$1 = injectModalState;
|
|
1312
1298
|
|
|
1313
|
-
function ownKeys$
|
|
1314
|
-
function _objectSpread$
|
|
1299
|
+
function ownKeys$1i(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1300
|
+
function _objectSpread$1i(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1i(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1i(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1315
1301
|
const defaultOptions$2 = {
|
|
1316
1302
|
storageType: 'local',
|
|
1317
1303
|
segregateByUser: true
|
|
@@ -1329,7 +1315,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
1329
1315
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
1330
1316
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
1331
1317
|
var _context;
|
|
1332
|
-
const mergedOptions = _objectSpread$
|
|
1318
|
+
const mergedOptions = _objectSpread$1i(_objectSpread$1i({}, defaultOptions$2), options);
|
|
1333
1319
|
const userId = applicationShellConnectors.useApplicationContext(context => context.user?.id);
|
|
1334
1320
|
const scopedStorageKey = _filterInstanceProperty__default["default"](_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
1335
1321
|
const readFromStorage = React.useCallback(() => {
|
|
@@ -1374,8 +1360,8 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1374
1360
|
};
|
|
1375
1361
|
var useStorage$1 = useStorage;
|
|
1376
1362
|
|
|
1377
|
-
function ownKeys$
|
|
1378
|
-
function _objectSpread$
|
|
1363
|
+
function ownKeys$1h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1364
|
+
function _objectSpread$1h(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1h(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1h(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1379
1365
|
const defaultOptions$1 = {
|
|
1380
1366
|
propName: 'storage',
|
|
1381
1367
|
storageKey: '',
|
|
@@ -1388,7 +1374,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
1388
1374
|
* Options are being merged by spreading as destructuring and defaulting in
|
|
1389
1375
|
* argument position does not allow passing specification of option(s).
|
|
1390
1376
|
*/
|
|
1391
|
-
const mergedOptions = _objectSpread$
|
|
1377
|
+
const mergedOptions = _objectSpread$1h(_objectSpread$1h({}, defaultOptions$1), options);
|
|
1392
1378
|
const WithStorage = props => {
|
|
1393
1379
|
const _useStorage = useStorage$1(mergedOptions.storageKey(props), mergedOptions.initalStorageValue, mergedOptions.options),
|
|
1394
1380
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
@@ -1402,7 +1388,7 @@ const injectStorage = options => WrappedComponent => {
|
|
|
1402
1388
|
readFromStorage
|
|
1403
1389
|
}
|
|
1404
1390
|
};
|
|
1405
|
-
return jsxRuntime.jsx(WrappedComponent, _objectSpread$
|
|
1391
|
+
return jsxRuntime.jsx(WrappedComponent, _objectSpread$1h(_objectSpread$1h({}, props), storageProp));
|
|
1406
1392
|
};
|
|
1407
1393
|
WithStorage.displayName = wrapDisplayName$1(WrappedComponent, 'WithStorage');
|
|
1408
1394
|
return WithStorage;
|
|
@@ -1447,8 +1433,8 @@ function useFormatLocalizedFieldToString() {
|
|
|
1447
1433
|
return formatLocalizedFieldToString;
|
|
1448
1434
|
}
|
|
1449
1435
|
|
|
1450
|
-
function ownKeys$
|
|
1451
|
-
function _objectSpread$
|
|
1436
|
+
function ownKeys$1g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1437
|
+
function _objectSpread$1g(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1g(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1g(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1452
1438
|
var FetchResourceTypeDuplicatedField = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchResourceTypeDuplicatedField" }, 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: "skipAssociateRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipAttributeGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipBusinessUnits" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCarts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCartDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipChannels" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCustomers" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipCustomerGroups" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipDiscountCodes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipInventoryEntries" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipOrders" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipPayments" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProducts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductDiscounts" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipProductTypes" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipShippingMethods" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipShoppingLists" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipStores" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipTaxCategories" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "skipZones" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoles" }, 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: "skipAssociateRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "attributeGroups" }, 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: "skipAttributeGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "businessUnits" }, 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: "skipBusinessUnits" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "carts" }, 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: "skipCarts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "cartDiscounts" }, 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: "skipCartDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "categories" }, 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: "skipCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "channels" }, 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: "skipChannels" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "customers" }, 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: "skipCustomers" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "customerGroups" }, 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: "skipCustomerGroups" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "discountCodes" }, 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: "skipDiscountCodes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inventoryEntries" }, 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: "skipInventoryEntries" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "orders" }, 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: "skipOrders" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "payments" }, 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: "skipPayments" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "products" }, 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: "skipProducts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productDiscounts" }, 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: "skipProductDiscounts" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: "skipProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "productTypes" }, 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: "skipProductTypes" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "shippingMethods" }, 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: "skipShippingMethods" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "shoppingLists" }, 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: "skipShoppingLists" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", 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: "skipStores" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "taxCategories" }, 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: "skipTaxCategories" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "zones" }, 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: "skipZones" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 2328, source: { body: "query FetchResourceTypeDuplicatedField(\n $where: String\n $skipAssociateRoles: Boolean!\n $skipAttributeGroups: Boolean!\n $skipBusinessUnits: Boolean!\n $skipCarts: Boolean!\n $skipCartDiscounts: Boolean!\n $skipCategories: Boolean!\n $skipChannels: Boolean!\n $skipCustomers: Boolean!\n $skipCustomerGroups: Boolean!\n $skipDiscountCodes: Boolean!\n $skipInventoryEntries: Boolean!\n $skipOrders: Boolean!\n $skipPayments: Boolean!\n $skipProducts: Boolean!\n $skipProductDiscounts: Boolean!\n $skipProductSelections: Boolean!\n $skipProductTypes: Boolean!\n $skipShippingMethods: Boolean!\n $skipShoppingLists: Boolean!\n $skipStores: Boolean!\n $skipTaxCategories: Boolean!\n $skipZones: Boolean!\n) {\n associateRoles(where: $where) @skip(if: $skipAssociateRoles) {\n total\n }\n attributeGroups(where: $where) @skip(if: $skipAttributeGroups) {\n total\n }\n businessUnits(where: $where) @skip(if: $skipBusinessUnits) {\n total\n }\n carts(where: $where) @skip(if: $skipCarts) {\n total\n }\n cartDiscounts(where: $where) @skip(if: $skipCartDiscounts) {\n total\n }\n categories(where: $where) @skip(if: $skipCategories) {\n total\n }\n channels(where: $where) @skip(if: $skipChannels) {\n total\n }\n customers(where: $where) @skip(if: $skipCustomers) {\n total\n }\n customerGroups(where: $where) @skip(if: $skipCustomerGroups) {\n total\n }\n discountCodes(where: $where) @skip(if: $skipDiscountCodes) {\n total\n }\n inventoryEntries(where: $where) @skip(if: $skipInventoryEntries) {\n total\n }\n orders(where: $where) @skip(if: $skipOrders) {\n total\n }\n payments(where: $where) @skip(if: $skipPayments) {\n total\n }\n products(where: $where) @skip(if: $skipProducts) {\n total\n }\n productDiscounts(where: $where) @skip(if: $skipProductDiscounts) {\n total\n }\n productSelections(where: $where) @skip(if: $skipProductSelections) {\n total\n }\n productTypes(where: $where) @skip(if: $skipProductTypes) {\n total\n }\n shippingMethods(where: $where) @skip(if: $skipShippingMethods) {\n total\n }\n shoppingLists(where: $where) @skip(if: $skipShoppingLists) {\n total\n }\n stores(where: $where) @skip(if: $skipStores) {\n total\n }\n taxCategories(where: $where) @skip(if: $skipTaxCategories) {\n total\n }\n zones(where: $where) @skip(if: $skipZones) {\n total\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
1453
1439
|
const MC_RESOURCES_WITH_KEYS = {
|
|
1454
1440
|
ASSOCIATE_ROLE: 'ASSOCIATE_ROLE',
|
|
@@ -1523,7 +1509,7 @@ const DEFAULT_SKIP_RESOURCE_TYPES_VARIABLES = {
|
|
|
1523
1509
|
[BASE_SKIP_RESOURCE_TYPES_VARIABLES.ZONE]: true
|
|
1524
1510
|
};
|
|
1525
1511
|
const getSkipVariables = resourceType => {
|
|
1526
|
-
return _objectSpread$
|
|
1512
|
+
return _objectSpread$1g(_objectSpread$1g({}, DEFAULT_SKIP_RESOURCE_TYPES_VARIABLES), {}, {
|
|
1527
1513
|
[BASE_SKIP_RESOURCE_TYPES_VARIABLES[resourceType]]: false
|
|
1528
1514
|
});
|
|
1529
1515
|
};
|
|
@@ -1548,7 +1534,7 @@ const getQueryVariables = _ref2 => {
|
|
|
1548
1534
|
fieldValue,
|
|
1549
1535
|
id
|
|
1550
1536
|
});
|
|
1551
|
-
return _objectSpread$
|
|
1537
|
+
return _objectSpread$1g({
|
|
1552
1538
|
where
|
|
1553
1539
|
}, skipVariables);
|
|
1554
1540
|
};
|
|
@@ -1582,8 +1568,8 @@ const usePrevious = value => {
|
|
|
1582
1568
|
};
|
|
1583
1569
|
var usePrevious$1 = usePrevious;
|
|
1584
1570
|
|
|
1585
|
-
function ownKeys$
|
|
1586
|
-
function _objectSpread$
|
|
1571
|
+
function ownKeys$1f(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1572
|
+
function _objectSpread$1f(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$1f(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$1f(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1587
1573
|
var FetchStoresQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchStoresQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "limit" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "offset" } }, type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sort" } }, type: { kind: "ListType", type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "stores" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "Variable", name: { kind: "Name", value: "limit" } } }, { kind: "Argument", name: { kind: "Name", value: "offset" }, value: { kind: "Variable", name: { kind: "Name", value: "offset" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "Variable", name: { kind: "Name", value: "sort" } } }, { kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "count" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "offset" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "StoreBasicInfo" }, directives: [] }, { kind: "Field", name: { kind: "Name", value: "countries" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "languages" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "distributionChannelsRef" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "distributionChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "supplyChannels" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeExtendedStoresList" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "productSelections" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "excludeProductSelections" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "active" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "productSelection" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "mode" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "StoreBasicInfo" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Store" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 1089, source: { body: "#import '../../utils/graphql/fragments/store-basic-info.ctp.graphql'\n\nquery FetchStoresQuery(\n $limit: Int\n $offset: Int\n $sort: [String!]\n $where: String\n $excludeExtendedStoresList: Boolean!\n $excludeProductSelections: Boolean!\n) {\n stores(limit: $limit, offset: $offset, sort: $sort, where: $where) {\n total\n count\n offset\n results {\n ...StoreBasicInfo\n countries {\n code\n }\n languages @skip(if: $excludeExtendedStoresList)\n distributionChannelsRef {\n id\n }\n distributionChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n supplyChannels @skip(if: $excludeExtendedStoresList) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n productSelections @skip(if: $excludeProductSelections) {\n active\n productSelection {\n id\n mode\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
1588
1574
|
const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
1589
1575
|
var _context, _context2;
|
|
@@ -1594,7 +1580,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
1594
1580
|
offset: storesQueryResult.offset,
|
|
1595
1581
|
results: ((_context = storesQueryResult.results) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _mapInstanceProperty__default["default"](_context), _context))?.(store => {
|
|
1596
1582
|
var _context3, _context4;
|
|
1597
|
-
return _objectSpread$
|
|
1583
|
+
return _objectSpread$1f(_objectSpread$1f({}, store), {}, {
|
|
1598
1584
|
productSelections: ((_context3 = store.productSelections) == null ? void 0 : _bindInstanceProperty__default["default"](_context4 = Function.call).call(_context4, _filterInstanceProperty__default["default"](_context3), _context3))?.(productSelectionRef => Boolean(productSelectionRef.productSelection))
|
|
1599
1585
|
});
|
|
1600
1586
|
})
|
|
@@ -1602,7 +1588,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
1602
1588
|
};
|
|
1603
1589
|
const createQueryVariables$6 = ownProps => {
|
|
1604
1590
|
var _context5, _context6;
|
|
1605
|
-
return _objectSpread$
|
|
1591
|
+
return _objectSpread$1f(_objectSpread$1f(_objectSpread$1f({
|
|
1606
1592
|
limit: ownProps.limit,
|
|
1607
1593
|
offset: ownProps.offset,
|
|
1608
1594
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -1655,8 +1641,8 @@ const useStoresListFetcher = props => {
|
|
|
1655
1641
|
};
|
|
1656
1642
|
var useStoresListFetcher$1 = useStoresListFetcher;
|
|
1657
1643
|
|
|
1658
|
-
function ownKeys$
|
|
1659
|
-
function _objectSpread$
|
|
1644
|
+
function ownKeys$1e(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1645
|
+
function _objectSpread$1e(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1e(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1e(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1660
1646
|
const createSearchQuery = (searchBy, searchTerm, language) => {
|
|
1661
1647
|
if (searchBy === 'key/name') {
|
|
1662
1648
|
return {
|
|
@@ -1675,7 +1661,7 @@ const createSearchQuery = (searchBy, searchTerm, language) => {
|
|
|
1675
1661
|
};
|
|
1676
1662
|
} else {
|
|
1677
1663
|
return {
|
|
1678
|
-
fullTextPrefix: _objectSpread$
|
|
1664
|
+
fullTextPrefix: _objectSpread$1e(_objectSpread$1e({
|
|
1679
1665
|
field: searchBy
|
|
1680
1666
|
}, searchBy === 'name' ? {
|
|
1681
1667
|
language: language
|
|
@@ -1751,7 +1737,7 @@ const useStoresSearchFetcher = () => {
|
|
|
1751
1737
|
});
|
|
1752
1738
|
setIsLoading(false);
|
|
1753
1739
|
} catch (error) {
|
|
1754
|
-
setStoreSearchResults(prev => _objectSpread$
|
|
1740
|
+
setStoreSearchResults(prev => _objectSpread$1e(_objectSpread$1e({}, prev), {}, {
|
|
1755
1741
|
hits: [],
|
|
1756
1742
|
total: 0
|
|
1757
1743
|
}));
|
|
@@ -1762,7 +1748,7 @@ const useStoresSearchFetcher = () => {
|
|
|
1762
1748
|
fetchStoreSearchResults,
|
|
1763
1749
|
storeSearchResults,
|
|
1764
1750
|
isLoading,
|
|
1765
|
-
resetStoreSearchResults: () => setStoreSearchResults(prev => _objectSpread$
|
|
1751
|
+
resetStoreSearchResults: () => setStoreSearchResults(prev => _objectSpread$1e(_objectSpread$1e({}, prev), {}, {
|
|
1766
1752
|
hits: [],
|
|
1767
1753
|
total: 0
|
|
1768
1754
|
}))
|
|
@@ -1853,8 +1839,8 @@ const useStoreKeysInDataFences = _ref => {
|
|
|
1853
1839
|
};
|
|
1854
1840
|
var useStoreKeysInDataFences$1 = useStoreKeysInDataFences;
|
|
1855
1841
|
|
|
1856
|
-
function ownKeys$
|
|
1857
|
-
function _objectSpread$
|
|
1842
|
+
function ownKeys$1d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1843
|
+
function _objectSpread$1d(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1d(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1d(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1858
1844
|
const TEN_MINUTES_IN_MS = 600000;
|
|
1859
1845
|
const defaultOptions = {
|
|
1860
1846
|
reminderInterval: REMINDER_OPTION_1_DAY,
|
|
@@ -1882,7 +1868,7 @@ const useHasReminderExpired = readReminderInterval => {
|
|
|
1882
1868
|
};
|
|
1883
1869
|
const usePersistedReminder = function () {
|
|
1884
1870
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1885
|
-
const mergedOptions = _objectSpread$
|
|
1871
|
+
const mergedOptions = _objectSpread$1d(_objectSpread$1d({}, defaultOptions), options);
|
|
1886
1872
|
const _useStorage = useStorage$1(mergedOptions.storageKey, null),
|
|
1887
1873
|
_useStorage2 = _slicedToArray(_useStorage, 3),
|
|
1888
1874
|
initialChosenReminderInterval = _useStorage2[0],
|
|
@@ -1929,7 +1915,7 @@ const usePersistedReminder = function () {
|
|
|
1929
1915
|
};
|
|
1930
1916
|
var usePersistedReminder$1 = usePersistedReminder;
|
|
1931
1917
|
|
|
1932
|
-
var messages$
|
|
1918
|
+
var messages$M = reactIntl.defineMessages({
|
|
1933
1919
|
profileUpdated: {
|
|
1934
1920
|
id: 'NotificationText.profileUpdated',
|
|
1935
1921
|
description: 'Label for the notification header',
|
|
@@ -1947,8 +1933,8 @@ var messages$O = reactIntl.defineMessages({
|
|
|
1947
1933
|
}
|
|
1948
1934
|
});
|
|
1949
1935
|
|
|
1950
|
-
function ownKeys$
|
|
1951
|
-
function _objectSpread$
|
|
1936
|
+
function ownKeys$1c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1937
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1c(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1c(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1952
1938
|
const LinkToProfile = props => {
|
|
1953
1939
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
1954
1940
|
to: "/account/profile",
|
|
@@ -1966,9 +1952,9 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
1966
1952
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1967
1953
|
as: "p",
|
|
1968
1954
|
isBold: true,
|
|
1969
|
-
intlMessage: messages$
|
|
1955
|
+
intlMessage: messages$M.profileUpdated
|
|
1970
1956
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1971
|
-
intlMessage: _objectSpread$
|
|
1957
|
+
intlMessage: _objectSpread$1c(_objectSpread$1c({}, messages$M.addMoreInformation), {}, {
|
|
1972
1958
|
values: {
|
|
1973
1959
|
newline: getNewLine
|
|
1974
1960
|
}
|
|
@@ -1977,7 +1963,7 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
1977
1963
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1978
1964
|
scale: "xs",
|
|
1979
1965
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1980
|
-
intlMessage: _objectSpread$
|
|
1966
|
+
intlMessage: _objectSpread$1c(_objectSpread$1c({}, messages$M.informationAndProfileLink), {}, {
|
|
1981
1967
|
values: {
|
|
1982
1968
|
newline: getNewLine,
|
|
1983
1969
|
link: getLinkToProfile
|
|
@@ -2054,76 +2040,6 @@ const useRoleNotificationEffect = () => {
|
|
|
2054
2040
|
};
|
|
2055
2041
|
var useRoleNotificationEffect$1 = useRoleNotificationEffect;
|
|
2056
2042
|
|
|
2057
|
-
var messages$N = reactIntl.defineMessages({
|
|
2058
|
-
dbMaintenanceNotification: {
|
|
2059
|
-
id: 'Global.dbMaintenanceNotification',
|
|
2060
|
-
description: 'Database maintenance notification',
|
|
2061
|
-
defaultMessage: "A <linkDocs>database maintenance</linkDocs> is scheduled for January 22-23 2026. Some of the functionalities of the Merchant Center won't be available during that time, including customizations. Please plan your work accordingly."
|
|
2062
|
-
},
|
|
2063
|
-
dbMaintenanceOngoingNotification: {
|
|
2064
|
-
id: 'Global.dbMaintenanceOngoingNotification',
|
|
2065
|
-
description: 'Ongoing database maintenance notification',
|
|
2066
|
-
defaultMessage: 'Merchant Center database is currently under <linkDocs>planned maintenance</linkDocs>. Some of the functionalities of the Merchant Center are not available, including customizations. Thank you for your patience.'
|
|
2067
|
-
}
|
|
2068
|
-
});
|
|
2069
|
-
|
|
2070
|
-
// Hardcode feature flag name here instead of importing it from the private `constants` package.
|
|
2071
|
-
const ENABLE_DB_MAINTENANCE_NOTIFICATION = 'enableDbMaintenanceNotification';
|
|
2072
|
-
|
|
2073
|
-
// eslint-disable-next-line react/display-name
|
|
2074
|
-
const getLinkDocs = () => msg => jsxRuntime.jsx(uiKit.Link, {
|
|
2075
|
-
isExternal: true,
|
|
2076
|
-
to: "https://docs.commercetools.com/merchant-center/releases/2026-01-19-database-maintenance-on-22-23-january",
|
|
2077
|
-
children: msg
|
|
2078
|
-
}, 'db-maintenance-doc-link');
|
|
2079
|
-
const DISMISSED_DB_MAINTENANCE_UPCOMING = 'dismissed-db-maintenance-upcoming';
|
|
2080
|
-
const DISMISSED_DB_MAINTENANCE_ONGOING = 'dismissed-db-maintenance-ongoing';
|
|
2081
|
-
const PENDING_DB_MAINTENANCE_BANNER = 'pending-db-maintenance-banner';
|
|
2082
|
-
const useDbMaintenanceNotification = () => {
|
|
2083
|
-
const isDbMaintenanceNotificationEnabled = applicationShell.useFlagVariation(ENABLE_DB_MAINTENANCE_NOTIFICATION);
|
|
2084
|
-
const intl = reactIntl.useIntl();
|
|
2085
|
-
const showNotification = actionsGlobal.useShowNotification();
|
|
2086
|
-
const hasShownRef = React.useRef(false);
|
|
2087
|
-
React.useEffect(() => {
|
|
2088
|
-
// If running in Cypress, skip the notification
|
|
2089
|
-
if (typeof window !== 'undefined' && window.Cypress) {
|
|
2090
|
-
localStorage.setItem(DISMISSED_DB_MAINTENANCE_UPCOMING, 'true');
|
|
2091
|
-
return;
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
// Show notification if:
|
|
2095
|
-
// 1. value is true (upcoming maintenance), OR
|
|
2096
|
-
// 2. value is false with reason "ongoing" (maintenance is happening now)
|
|
2097
|
-
const isUpcoming = isDbMaintenanceNotificationEnabled?.value === true;
|
|
2098
|
-
const isOngoing = isDbMaintenanceNotificationEnabled?.value === false && isDbMaintenanceNotificationEnabled?.reason === 'ongoing';
|
|
2099
|
-
if (!isUpcoming && !isOngoing) return;
|
|
2100
|
-
const dismissedFlag = isOngoing ? DISMISSED_DB_MAINTENANCE_ONGOING : DISMISSED_DB_MAINTENANCE_UPCOMING;
|
|
2101
|
-
const hasDismissedBanner = !!localStorage.getItem(dismissedFlag);
|
|
2102
|
-
const isPending = !!localStorage.getItem(PENDING_DB_MAINTENANCE_BANNER);
|
|
2103
|
-
if (!hasDismissedBanner && !isPending && !hasShownRef.current || isPending && !hasShownRef.current) {
|
|
2104
|
-
hasShownRef.current = true;
|
|
2105
|
-
localStorage.setItem(PENDING_DB_MAINTENANCE_BANNER, 'true');
|
|
2106
|
-
const notificationKind = isOngoing ? constants.NOTIFICATION_KINDS_SIDE.warning : constants.NOTIFICATION_KINDS_SIDE.info;
|
|
2107
|
-
const messageKey = isOngoing ? 'dbMaintenanceOngoingNotification' : 'dbMaintenanceNotification';
|
|
2108
|
-
const messageObj = messages$N[messageKey];
|
|
2109
|
-
const formattedText = intl.formatMessage(messageObj, {
|
|
2110
|
-
linkDocs: getLinkDocs()
|
|
2111
|
-
});
|
|
2112
|
-
showNotification({
|
|
2113
|
-
kind: notificationKind,
|
|
2114
|
-
domain: constants.DOMAINS.GLOBAL,
|
|
2115
|
-
text: formattedText
|
|
2116
|
-
}, {
|
|
2117
|
-
onDismiss: () => {
|
|
2118
|
-
localStorage.setItem(dismissedFlag, 'true');
|
|
2119
|
-
localStorage.removeItem(PENDING_DB_MAINTENANCE_BANNER);
|
|
2120
|
-
hasShownRef.current = false;
|
|
2121
|
-
}
|
|
2122
|
-
});
|
|
2123
|
-
}
|
|
2124
|
-
}, [showNotification, intl, isDbMaintenanceNotificationEnabled]);
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
2043
|
function usePendingRequests() {
|
|
2128
2044
|
const _useState = React.useState(0),
|
|
2129
2045
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -2175,7 +2091,7 @@ const useEventCallback = (fn, dependencies) => {
|
|
|
2175
2091
|
};
|
|
2176
2092
|
var useEventCallback$1 = useEventCallback;
|
|
2177
2093
|
|
|
2178
|
-
var messages$
|
|
2094
|
+
var messages$L = reactIntl.defineMessages({
|
|
2179
2095
|
fallbackHint: {
|
|
2180
2096
|
id: 'KeyFallback.fallbackHint',
|
|
2181
2097
|
description: 'key fallback for a specified resource key (e.g name)',
|
|
@@ -2199,7 +2115,7 @@ const useLocalizedKeyFallback = () => {
|
|
|
2199
2115
|
return values => {
|
|
2200
2116
|
if (!values.resource) return null;
|
|
2201
2117
|
const localizedString = values.resource[values.localizedStringFieldName];
|
|
2202
|
-
const fallbackHintWithKey = intl.formatMessage(messages$
|
|
2118
|
+
const fallbackHintWithKey = intl.formatMessage(messages$L.fallbackHint, {
|
|
2203
2119
|
key: values.resource.key
|
|
2204
2120
|
});
|
|
2205
2121
|
if (!localizedString) return fallbackHintWithKey;
|
|
@@ -2213,8 +2129,8 @@ const useDebouncedPromiseCallback = (promiseCallback, wait) =>
|
|
|
2213
2129
|
React.useCallback(debounce__default["default"](promiseCallback, wait), [promiseCallback]);
|
|
2214
2130
|
var useDebouncedPromiseCallback$1 = useDebouncedPromiseCallback;
|
|
2215
2131
|
|
|
2216
|
-
function ownKeys$
|
|
2217
|
-
function _objectSpread$
|
|
2132
|
+
function ownKeys$1b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2133
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1b(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1b(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2218
2134
|
const prepareMutableColumnProps = (columnConfig, mutableColumnProps) => {
|
|
2219
2135
|
const updatedColumnProps = {};
|
|
2220
2136
|
_forEachInstanceProperty__default["default"](mutableColumnProps).call(mutableColumnProps, columnProp => {
|
|
@@ -2234,14 +2150,14 @@ const retrieveColumnsWithCachedConfiguration = _ref => {
|
|
|
2234
2150
|
mutableColumnProps = _ref.mutableColumnProps;
|
|
2235
2151
|
return _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](cachedVisibleTableConfiguration).call(cachedVisibleTableConfiguration, cachedColumn => _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedColumn.key))).call(_context, cachedConfig => {
|
|
2236
2152
|
const initialColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, initialConfig => initialConfig.key === cachedConfig.key);
|
|
2237
|
-
return _objectSpread$
|
|
2153
|
+
return _objectSpread$1b(_objectSpread$1b({}, initialColumnConfig), prepareMutableColumnProps(cachedConfig, mutableColumnProps));
|
|
2238
2154
|
});
|
|
2239
2155
|
};
|
|
2240
2156
|
const handleCacheUpdate = _ref2 => {
|
|
2241
2157
|
let update = _ref2.update,
|
|
2242
2158
|
cachedVisibleTableConfiguration = _ref2.cachedVisibleTableConfiguration,
|
|
2243
2159
|
updateCachedTableConfiguration = _ref2.updateCachedTableConfiguration;
|
|
2244
|
-
return updateCachedTableConfiguration(_objectSpread$
|
|
2160
|
+
return updateCachedTableConfiguration(_objectSpread$1b(_objectSpread$1b({}, pick__default["default"](cachedVisibleTableConfiguration, ['columnsConfig', 'displaySettings'])), update));
|
|
2245
2161
|
};
|
|
2246
2162
|
|
|
2247
2163
|
// Signature:
|
|
@@ -2270,7 +2186,7 @@ const usePersistedTableConfiguration = props => {
|
|
|
2270
2186
|
return {
|
|
2271
2187
|
columnsConfig: _mapInstanceProperty__default["default"](initialVisibleColumnKeys).call(initialVisibleColumnKeys, visibleColumnKey => {
|
|
2272
2188
|
const visibleColumnConfig = _findInstanceProperty__default["default"](allAvailableColumnsConfiguration).call(allAvailableColumnsConfiguration, columnConfig => columnConfig.key === visibleColumnKey);
|
|
2273
|
-
return _objectSpread$
|
|
2189
|
+
return _objectSpread$1b({
|
|
2274
2190
|
key: visibleColumnKey
|
|
2275
2191
|
}, prepareMutableColumnProps(visibleColumnConfig, mutableColumnProps));
|
|
2276
2192
|
}),
|
|
@@ -2333,14 +2249,14 @@ const useProductSelectionsTotalFetcher = props => {
|
|
|
2333
2249
|
};
|
|
2334
2250
|
var useProductSelectionsTotalFetcher$1 = useProductSelectionsTotalFetcher;
|
|
2335
2251
|
|
|
2336
|
-
function ownKeys$
|
|
2337
|
-
function _objectSpread$
|
|
2252
|
+
function ownKeys$1a(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2253
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1a(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1a(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2338
2254
|
|
|
2339
2255
|
// eslint-disable-next-line import/prefer-default-export
|
|
2340
2256
|
const convertProductSelectionsFromGraphQl = productSelections => {
|
|
2341
2257
|
var _context;
|
|
2342
|
-
return productSelections?.results && _objectSpread$
|
|
2343
|
-
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$
|
|
2258
|
+
return productSelections?.results && _objectSpread$1a(_objectSpread$1a({}, productSelections), {}, {
|
|
2259
|
+
results: _mapInstanceProperty__default["default"](_context = productSelections.results).call(_context, productSelection => _objectSpread$1a({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
2344
2260
|
from: 'nameAllLocales',
|
|
2345
2261
|
to: 'name'
|
|
2346
2262
|
}])))
|
|
@@ -3825,8 +3741,8 @@ const getData = (code, field) => {
|
|
|
3825
3741
|
};
|
|
3826
3742
|
const getFractionDigit = code => getData(code, 'fractionDigit');
|
|
3827
3743
|
|
|
3828
|
-
function ownKeys$
|
|
3829
|
-
function _objectSpread$
|
|
3744
|
+
function ownKeys$19(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3745
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$19(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$19(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3830
3746
|
function formatMoneyRangeValue(value, intl) {
|
|
3831
3747
|
if (value.from === value.to) return formatMoneyValue(value.from, value.currency, intl);
|
|
3832
3748
|
if (value.from && value.to) return `${formatMoneyValue(value.from, value.currency, intl)} -
|
|
@@ -3836,7 +3752,7 @@ function formatMoneyRangeValue(value, intl) {
|
|
|
3836
3752
|
return '';
|
|
3837
3753
|
}
|
|
3838
3754
|
function formatMoneyValue(amount, currency, intl) {
|
|
3839
|
-
return formatMoney$2(_objectSpread$
|
|
3755
|
+
return formatMoney$2(_objectSpread$19({
|
|
3840
3756
|
centAmount: amount,
|
|
3841
3757
|
fractionDigits: getFractionDigit(currency)
|
|
3842
3758
|
}, currency ? {
|
|
@@ -3852,14 +3768,14 @@ function getFractionedAmount(moneyValue) {
|
|
|
3852
3768
|
return amount / 10 ** fractionDigits;
|
|
3853
3769
|
}
|
|
3854
3770
|
function formatMoney$2(moneyValue, intl, options) {
|
|
3855
|
-
return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$
|
|
3771
|
+
return intl.formatNumber(moneyValue.fractionedAmount ?? getFractionedAmount(moneyValue), _objectSpread$19({
|
|
3856
3772
|
style: 'currency',
|
|
3857
3773
|
currency: moneyValue.currencyCode,
|
|
3858
3774
|
minimumFractionDigits: moneyValue.fractionDigits
|
|
3859
3775
|
}, options));
|
|
3860
3776
|
}
|
|
3861
3777
|
|
|
3862
|
-
var messages$
|
|
3778
|
+
var messages$K = reactIntl.defineMessages({
|
|
3863
3779
|
booleanYes: {
|
|
3864
3780
|
id: 'AttributeTypeFormats.boolean.yes',
|
|
3865
3781
|
description: 'The label for boolean attribute `true` value',
|
|
@@ -3941,7 +3857,7 @@ const formatDateTime = _ref7 => {
|
|
|
3941
3857
|
const formatBoolean = _ref8 => {
|
|
3942
3858
|
let value = _ref8.value,
|
|
3943
3859
|
intl = _ref8.intl;
|
|
3944
|
-
return value ? intl.formatMessage(messages$
|
|
3860
|
+
return value ? intl.formatMessage(messages$K.booleanYes) : intl.formatMessage(messages$K.booleanNo);
|
|
3945
3861
|
};
|
|
3946
3862
|
const formatNilType = _ref9 => {
|
|
3947
3863
|
let value = _ref9.value,
|
|
@@ -4125,9 +4041,9 @@ const getPrefixSearchBounds = input => {
|
|
|
4125
4041
|
};
|
|
4126
4042
|
var getPrefixSearchBounds$1 = getPrefixSearchBounds;
|
|
4127
4043
|
|
|
4128
|
-
const _excluded$
|
|
4129
|
-
function ownKeys$
|
|
4130
|
-
function _objectSpread$
|
|
4044
|
+
const _excluded$c = ["action"];
|
|
4045
|
+
function ownKeys$18(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4046
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var _context0, _context1; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context0 = ownKeys$18(Object(t), !0)).call(_context0, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context1 = ownKeys$18(Object(t))).call(_context1, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4131
4047
|
|
|
4132
4048
|
/**
|
|
4133
4049
|
* Checks if a value is a LocalizedString
|
|
@@ -4149,7 +4065,7 @@ const getIsLocalizedString = maybeLocalizedString => {
|
|
|
4149
4065
|
*/
|
|
4150
4066
|
const transformCustomFieldsRawToCustomFields = customFieldsRaw => {
|
|
4151
4067
|
if (!customFieldsRaw || customFieldsRaw.length === 0) return null;
|
|
4152
|
-
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$
|
|
4068
|
+
return _reduceInstanceProperty__default["default"](customFieldsRaw).call(customFieldsRaw, (customFields, customField) => _objectSpread$18(_objectSpread$18({}, customFields), {}, {
|
|
4153
4069
|
[customField.name]: customField.value
|
|
4154
4070
|
}), {});
|
|
4155
4071
|
};
|
|
@@ -4173,7 +4089,7 @@ function transformLocalizedFieldsForCategory(category) {
|
|
|
4173
4089
|
const transformedData = l10n.applyTransformedLocalizedFields(category, transformationOptions);
|
|
4174
4090
|
const parent = category.parent ? transformLocalizedFieldsForCategory(category.parent) : null;
|
|
4175
4091
|
const ancestors = category.ancestors ? _mapInstanceProperty__default["default"](_context = category.ancestors).call(_context, ancestor => transformLocalizedFieldsForCategory(ancestor)) : null;
|
|
4176
|
-
return _objectSpread$
|
|
4092
|
+
return _objectSpread$18(_objectSpread$18(_objectSpread$18({}, transformedData), parent ? {
|
|
4177
4093
|
parent
|
|
4178
4094
|
} : {}), ancestors ? {
|
|
4179
4095
|
ancestors
|
|
@@ -4266,7 +4182,7 @@ const formatMoney = valueType => money => {
|
|
|
4266
4182
|
case 'fixed':
|
|
4267
4183
|
case 'fixedCart':
|
|
4268
4184
|
return {
|
|
4269
|
-
[money.type]: _objectSpread$
|
|
4185
|
+
[money.type]: _objectSpread$18({
|
|
4270
4186
|
centAmount: money.centAmount,
|
|
4271
4187
|
currencyCode: money.currencyCode
|
|
4272
4188
|
}, money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4448,7 +4364,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4448
4364
|
case 'addAttributeDefinition':
|
|
4449
4365
|
return {
|
|
4450
4366
|
[actionName]: {
|
|
4451
|
-
attributeDefinition: _objectSpread$
|
|
4367
|
+
attributeDefinition: _objectSpread$18(_objectSpread$18({}, actionPayload.attribute), {}, {
|
|
4452
4368
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.label),
|
|
4453
4369
|
inputTip: l10n.transformLocalizedStringToLocalizedField(actionPayload.attribute.inputTip),
|
|
4454
4370
|
type: createAttributeTypeValue(actionPayload.attribute)
|
|
@@ -4544,7 +4460,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4544
4460
|
return {
|
|
4545
4461
|
[actionName]: {
|
|
4546
4462
|
attributeName: actionPayload.attributeName,
|
|
4547
|
-
value: _objectSpread$
|
|
4463
|
+
value: _objectSpread$18(_objectSpread$18({}, actionPayload.value), {}, {
|
|
4548
4464
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.value.label)
|
|
4549
4465
|
})
|
|
4550
4466
|
}
|
|
@@ -4553,7 +4469,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4553
4469
|
return {
|
|
4554
4470
|
[actionName]: {
|
|
4555
4471
|
attributeName: actionPayload.attributeName,
|
|
4556
|
-
newValue: _objectSpread$
|
|
4472
|
+
newValue: _objectSpread$18(_objectSpread$18({}, actionPayload.newValue), {}, {
|
|
4557
4473
|
label: l10n.transformLocalizedStringToLocalizedField(actionPayload.newValue.label)
|
|
4558
4474
|
})
|
|
4559
4475
|
}
|
|
@@ -4580,7 +4496,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4580
4496
|
name: l10n.transformLocalizedStringToLocalizedField(actionPayload.name),
|
|
4581
4497
|
taxCategory: actionPayload.taxCategory,
|
|
4582
4498
|
money: {
|
|
4583
|
-
[actionPayload.money.type]: _objectSpread$
|
|
4499
|
+
[actionPayload.money.type]: _objectSpread$18({
|
|
4584
4500
|
centAmount: actionPayload.money.centAmount,
|
|
4585
4501
|
currencyCode: actionPayload.money.currencyCode
|
|
4586
4502
|
}, actionPayload.money.type === PRECISION_TYPES.highPrecision && {
|
|
@@ -4608,7 +4524,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4608
4524
|
return {
|
|
4609
4525
|
[actionName]: {
|
|
4610
4526
|
target: {
|
|
4611
|
-
[actionPayload.target.type]: _objectSpread$
|
|
4527
|
+
[actionPayload.target.type]: _objectSpread$18(_objectSpread$18(_objectSpread$18({}, omit__default["default"](actionPayload.target, ['type', '__typename'])), actionPayload.target.triggerPattern && {
|
|
4612
4528
|
triggerPattern: _mapInstanceProperty__default["default"](_context6 = actionPayload.target.triggerPattern).call(_context6, pattern => ({
|
|
4613
4529
|
[pattern.type]: omit__default["default"](pattern, ['type', '__typename'])
|
|
4614
4530
|
}))
|
|
@@ -4643,8 +4559,8 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4643
4559
|
fields: customFields
|
|
4644
4560
|
} : null;
|
|
4645
4561
|
return {
|
|
4646
|
-
[actionName]: _objectSpread$
|
|
4647
|
-
address: _objectSpread$
|
|
4562
|
+
[actionName]: _objectSpread$18(_objectSpread$18({}, actionPayload), {}, {
|
|
4563
|
+
address: _objectSpread$18(_objectSpread$18({}, omit__default["default"](actionPayload.address, ['__typename'])), {}, {
|
|
4648
4564
|
custom
|
|
4649
4565
|
})
|
|
4650
4566
|
})
|
|
@@ -4686,7 +4602,7 @@ const convertAction = (actionName, actionPayload) => {
|
|
|
4686
4602
|
};
|
|
4687
4603
|
const createGraphQlUpdateActions = actions => _reduceInstanceProperty__default["default"](actions).call(actions, (previousActions, _ref9) => {
|
|
4688
4604
|
let actionName = _ref9.action,
|
|
4689
|
-
actionPayload = _objectWithoutProperties(_ref9, _excluded$
|
|
4605
|
+
actionPayload = _objectWithoutProperties(_ref9, _excluded$c);
|
|
4690
4606
|
return [...previousActions, convertAction(actionName, actionPayload)];
|
|
4691
4607
|
}, []);
|
|
4692
4608
|
const extractErrorFromGraphQlResponse = graphQlResponse => {
|
|
@@ -4752,8 +4668,8 @@ function omitDeep(obj, fieldsToOmit) {
|
|
|
4752
4668
|
return originalOmitDeep__default["default"](obj, fieldsToOmit);
|
|
4753
4669
|
}
|
|
4754
4670
|
|
|
4755
|
-
function ownKeys$
|
|
4756
|
-
function _objectSpread$
|
|
4671
|
+
function ownKeys$17(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4672
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$17(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$17(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4757
4673
|
function getPriceChannelName(price) {
|
|
4758
4674
|
return price.channel?.name ?? price.channel?.key ?? null;
|
|
4759
4675
|
}
|
|
@@ -4765,11 +4681,11 @@ function getDiscountValue(price) {
|
|
|
4765
4681
|
} else if (price.value?.type === PRECISION_TYPES.highPrecision && price.discounted?.value?.type === PRECISION_TYPES.centPrecision) {
|
|
4766
4682
|
fractionedAmount = getFractionedAmount(price.value) - getFractionedAmount(price.discounted.value);
|
|
4767
4683
|
}
|
|
4768
|
-
return price.discounted ? _objectSpread$
|
|
4684
|
+
return price.discounted ? _objectSpread$17(_objectSpread$17({}, price.value), {}, {
|
|
4769
4685
|
fractionedAmount,
|
|
4770
4686
|
centAmount: price.value.centAmount - price.discounted.value.centAmount,
|
|
4771
4687
|
preciseAmount
|
|
4772
|
-
}) : _objectSpread$
|
|
4688
|
+
}) : _objectSpread$17(_objectSpread$17({}, price.value), {}, {
|
|
4773
4689
|
centAmount: 0
|
|
4774
4690
|
});
|
|
4775
4691
|
}
|
|
@@ -4800,7 +4716,7 @@ function getNetUnitPrice(_ref) {
|
|
|
4800
4716
|
}
|
|
4801
4717
|
let preciseAmount;
|
|
4802
4718
|
if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + taxRate.amount);
|
|
4803
|
-
return _objectSpread$
|
|
4719
|
+
return _objectSpread$17(_objectSpread$17({}, price.value), {}, {
|
|
4804
4720
|
centAmount,
|
|
4805
4721
|
preciseAmount
|
|
4806
4722
|
});
|
|
@@ -4816,7 +4732,7 @@ function getNetUnitPrice(_ref) {
|
|
|
4816
4732
|
}
|
|
4817
4733
|
let preciseAmount;
|
|
4818
4734
|
if (price.value?.type === PRECISION_TYPES.highPrecision) preciseAmount = price.value.preciseAmount / (1 + lineItem.taxRate.amount);
|
|
4819
|
-
return _objectSpread$
|
|
4735
|
+
return _objectSpread$17(_objectSpread$17({}, price.value), {}, {
|
|
4820
4736
|
centAmount,
|
|
4821
4737
|
preciseAmount
|
|
4822
4738
|
});
|
|
@@ -4828,7 +4744,7 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4828
4744
|
const currencyCode = price.value.currencyCode;
|
|
4829
4745
|
const fractionedAmount = getFractionedAmount(price.value);
|
|
4830
4746
|
if (currencyCode && !isNil__default["default"](fractionedAmount)) {
|
|
4831
|
-
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$
|
|
4747
|
+
if (!minPrices[currencyCode] || fractionedAmount < getFractionedAmount(minPrices[currencyCode])) return _objectSpread$17(_objectSpread$17({}, minPrices), {}, {
|
|
4832
4748
|
[currencyCode]: price.value
|
|
4833
4749
|
});
|
|
4834
4750
|
}
|
|
@@ -4837,8 +4753,8 @@ function getMinimumPricesByCurrencyCode(prices) {
|
|
|
4837
4753
|
return _Object$values__default["default"](minPricesByCurrency);
|
|
4838
4754
|
}
|
|
4839
4755
|
|
|
4840
|
-
function ownKeys$
|
|
4841
|
-
function _objectSpread$
|
|
4756
|
+
function ownKeys$16(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4757
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$16(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$16(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4842
4758
|
const transformCustomFieldFromGraphQLResponse = resource => {
|
|
4843
4759
|
var _context, _context4;
|
|
4844
4760
|
return {
|
|
@@ -4853,14 +4769,14 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4853
4769
|
return {
|
|
4854
4770
|
name: fieldDefinition.name,
|
|
4855
4771
|
required: fieldDefinition.required,
|
|
4856
|
-
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$
|
|
4857
|
-
elementType: _objectSpread$
|
|
4772
|
+
type: fieldDefinition.type?.elementType?.name === 'LocalizedEnum' ? _objectSpread$16(_objectSpread$16({}, fieldDefinition.type), {}, {
|
|
4773
|
+
elementType: _objectSpread$16(_objectSpread$16({}, fieldDefinition.type.elementType), {}, {
|
|
4858
4774
|
values: _mapInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](fieldDefinition.type.elementType)).call(_context2, value => ({
|
|
4859
4775
|
key: value.key,
|
|
4860
4776
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
4861
4777
|
}))
|
|
4862
4778
|
})
|
|
4863
|
-
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$
|
|
4779
|
+
}) : fieldDefinition.type?.name === 'LocalizedEnum' ? _objectSpread$16(_objectSpread$16({}, fieldDefinition.type), {}, {
|
|
4864
4780
|
values: _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](fieldDefinition.type)).call(_context3, value => ({
|
|
4865
4781
|
key: value.key,
|
|
4866
4782
|
label: l10n.transformLocalizedFieldToLocalizedString(value.labelAllLocales)
|
|
@@ -4871,7 +4787,7 @@ const transformCustomFieldFromGraphQLResponse = resource => {
|
|
|
4871
4787
|
})
|
|
4872
4788
|
}
|
|
4873
4789
|
},
|
|
4874
|
-
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$
|
|
4790
|
+
fields: _reduceInstanceProperty__default["default"](_context4 = resource.custom.customFieldsRaw).call(_context4, (fields, customField) => _objectSpread$16(_objectSpread$16({}, fields), {}, {
|
|
4875
4791
|
[customField.name]: customField.value
|
|
4876
4792
|
}), {})
|
|
4877
4793
|
};
|
|
@@ -4883,7 +4799,7 @@ const convertProductSelectionFromGraphQl = productSelection => {
|
|
|
4883
4799
|
// Incase the product selection is not missing or if the current project dose not yet have access to the feature,
|
|
4884
4800
|
// in either case we return null
|
|
4885
4801
|
if (!productSelection) return null;
|
|
4886
|
-
return _objectSpread$
|
|
4802
|
+
return _objectSpread$16(_objectSpread$16({}, l10n.applyTransformedLocalizedFields(productSelection, [{
|
|
4887
4803
|
from: 'nameAllLocales',
|
|
4888
4804
|
to: 'name'
|
|
4889
4805
|
}])), {}, {
|
|
@@ -4906,8 +4822,8 @@ const transformAllToProperNounCase = text => {
|
|
|
4906
4822
|
return _mapInstanceProperty__default["default"](_context = text.split(' ')).call(_context, term => transformToProperNounCase(term)).join(' ');
|
|
4907
4823
|
};
|
|
4908
4824
|
|
|
4909
|
-
function ownKeys$
|
|
4910
|
-
function _objectSpread$
|
|
4825
|
+
function ownKeys$15(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4826
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$15(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$15(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
4911
4827
|
const REGEX_ISO8601 = /(\d{4}-\d{2}-\d{2}[T]\d{2}:\d{2}:\d{2}(\.\d{3}[Z]?))/;
|
|
4912
4828
|
const REGEX_TIME = /\d{2}:\d{2}/;
|
|
4913
4829
|
const REGEX_DATE = /\d{4}-\d{2}-\d{2}/;
|
|
@@ -4924,7 +4840,7 @@ function filterCustomTypeUpdateActionValues() {
|
|
|
4924
4840
|
if (updateAction.action === 'setCustomField' && _Array$isArray__default["default"](updateAction.value)) {
|
|
4925
4841
|
const definition = _findInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, field => field.name === updateAction.name);
|
|
4926
4842
|
const definitionName = definition.type.elementType.name;
|
|
4927
|
-
return _objectSpread$
|
|
4843
|
+
return _objectSpread$15(_objectSpread$15({}, updateAction), {}, {
|
|
4928
4844
|
value: filterNotDefinedValues(updateAction.value, definitionName)
|
|
4929
4845
|
});
|
|
4930
4846
|
}
|
|
@@ -5097,7 +5013,7 @@ function uniqueObjects(items) {
|
|
|
5097
5013
|
|
|
5098
5014
|
*/
|
|
5099
5015
|
|
|
5100
|
-
const messages$
|
|
5016
|
+
const messages$J = reactIntl.defineMessages({
|
|
5101
5017
|
unique: {
|
|
5102
5018
|
id: 'Validation.unique',
|
|
5103
5019
|
description: 'An error message to show if the field must be unique',
|
|
@@ -5139,7 +5055,7 @@ const messages$K = reactIntl.defineMessages({
|
|
|
5139
5055
|
defaultMessage: 'Invalid ID format. Please enter a valid ID.'
|
|
5140
5056
|
}
|
|
5141
5057
|
});
|
|
5142
|
-
var validationMessages = messages$
|
|
5058
|
+
var validationMessages = messages$J;
|
|
5143
5059
|
|
|
5144
5060
|
function getIndexesOfInvalidValues(values) {
|
|
5145
5061
|
let invalidValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -5329,7 +5245,7 @@ const useReferenceSearchItems = _ref2 => {
|
|
|
5329
5245
|
items
|
|
5330
5246
|
};
|
|
5331
5247
|
};
|
|
5332
|
-
var _ref$
|
|
5248
|
+
var _ref$d = {
|
|
5333
5249
|
name: "befiq5",
|
|
5334
5250
|
styles: "width:100%;>div{width:100%;}"
|
|
5335
5251
|
} ;
|
|
@@ -5361,7 +5277,7 @@ function ReferenceSearch(props) {
|
|
|
5361
5277
|
const option = props.isMulti ? _mapInstanceProperty__default["default"](_context3 = event.target.value).call(_context3, item => item.value) : event.target.value?.value || null;
|
|
5362
5278
|
props.onChange(option);
|
|
5363
5279
|
};
|
|
5364
|
-
const containerStyles = _ref$
|
|
5280
|
+
const containerStyles = _ref$d;
|
|
5365
5281
|
return jsxRuntime.jsxs("div", {
|
|
5366
5282
|
css: containerStyles,
|
|
5367
5283
|
children: [areSomeItemsMissing && jsxRuntime.jsx("div", {
|
|
@@ -5399,7 +5315,7 @@ function ReferenceSearch(props) {
|
|
|
5399
5315
|
});
|
|
5400
5316
|
}
|
|
5401
5317
|
|
|
5402
|
-
const messages$
|
|
5318
|
+
const messages$H = reactIntl.defineMessages({
|
|
5403
5319
|
placeholder: {
|
|
5404
5320
|
id: 'CartDiscountReferenceSearch.placeholder',
|
|
5405
5321
|
description: 'Placeholder for search for a cart discount',
|
|
@@ -5426,10 +5342,10 @@ const messages$I = reactIntl.defineMessages({
|
|
|
5426
5342
|
defaultMessage: 'Enter search term'
|
|
5427
5343
|
}
|
|
5428
5344
|
});
|
|
5429
|
-
var messages$
|
|
5345
|
+
var messages$I = messages$H;
|
|
5430
5346
|
|
|
5431
|
-
function ownKeys$
|
|
5432
|
-
function _objectSpread$
|
|
5347
|
+
function ownKeys$14(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5348
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$14(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$14(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5433
5349
|
function Option$1(props) {
|
|
5434
5350
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
5435
5351
|
language: applicationContext.dataLocale,
|
|
@@ -5440,7 +5356,7 @@ function Option$1(props) {
|
|
|
5440
5356
|
const _useIntl = reactIntl.useIntl(),
|
|
5441
5357
|
formatMessage = _useIntl.formatMessage;
|
|
5442
5358
|
const cartDiscount = props.data;
|
|
5443
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5359
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$14(_objectSpread$14({}, props), {}, {
|
|
5444
5360
|
children: jsxRuntime.jsxs("div", {
|
|
5445
5361
|
"data-testid": "cart-discount-option",
|
|
5446
5362
|
children: [jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -5451,14 +5367,14 @@ function Option$1(props) {
|
|
|
5451
5367
|
fallbackOrder: languages
|
|
5452
5368
|
})
|
|
5453
5369
|
}), jsxRuntime.jsxs(uiKit.Text.Detail, {
|
|
5454
|
-
children: [formatMessage(messages$
|
|
5370
|
+
children: [formatMessage(messages$I.key), ": ", cartDiscount.key || constants.NO_VALUE_FALLBACK]
|
|
5455
5371
|
})]
|
|
5456
5372
|
})
|
|
5457
5373
|
}));
|
|
5458
5374
|
}
|
|
5459
5375
|
|
|
5460
|
-
function ownKeys$
|
|
5461
|
-
function _objectSpread$
|
|
5376
|
+
function ownKeys$13(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5377
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$13(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$13(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5462
5378
|
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 } } } };
|
|
5463
5379
|
const returnNullIfEmpty = value => value && value.id === '' ? null : value;
|
|
5464
5380
|
const filterOption$1 = (option, text) => {
|
|
@@ -5484,7 +5400,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5484
5400
|
})),
|
|
5485
5401
|
language = _useApplicationContex.language,
|
|
5486
5402
|
languages = _useApplicationContex.languages;
|
|
5487
|
-
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$
|
|
5403
|
+
const mapItemToOption = React.useCallback(cartDiscount => _objectSpread$13(_objectSpread$13({}, cartDiscount), {}, {
|
|
5488
5404
|
value: cartDiscount.id,
|
|
5489
5405
|
key: cartDiscount.key,
|
|
5490
5406
|
label: l10n.formatLocalizedString(cartDiscount, {
|
|
@@ -5527,10 +5443,10 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5527
5443
|
onBlur: props.onBlur,
|
|
5528
5444
|
onChange: props.onChange,
|
|
5529
5445
|
value: returnNullIfEmpty(props.value),
|
|
5530
|
-
placeholderLabel: formatMessage(messages$
|
|
5531
|
-
searchPromptLabel: formatMessage(messages$
|
|
5532
|
-
noResultsLabel: formatMessage(messages$
|
|
5533
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5446
|
+
placeholderLabel: formatMessage(messages$I.placeholder),
|
|
5447
|
+
searchPromptLabel: formatMessage(messages$I.searchPrompt),
|
|
5448
|
+
noResultsLabel: formatMessage(messages$I.noResults),
|
|
5449
|
+
referenceIsMissingLabel: formatMessage(messages$I.isMissing),
|
|
5534
5450
|
mapItemToOption: mapItemToOption,
|
|
5535
5451
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5536
5452
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5540,7 +5456,7 @@ function CartDiscountReferenceSearch(props) {
|
|
|
5540
5456
|
});
|
|
5541
5457
|
}
|
|
5542
5458
|
|
|
5543
|
-
const messages$
|
|
5459
|
+
const messages$F = reactIntl.defineMessages({
|
|
5544
5460
|
placeholder: {
|
|
5545
5461
|
id: 'CategoryReferenceSearch.placeholder',
|
|
5546
5462
|
description: 'Placeholder for search for a category',
|
|
@@ -5572,10 +5488,10 @@ const messages$G = reactIntl.defineMessages({
|
|
|
5572
5488
|
defaultMessage: 'Parent Category'
|
|
5573
5489
|
}
|
|
5574
5490
|
});
|
|
5575
|
-
var messages$
|
|
5491
|
+
var messages$G = messages$F;
|
|
5576
5492
|
|
|
5577
|
-
function ownKeys$
|
|
5578
|
-
function _objectSpread$
|
|
5493
|
+
function ownKeys$12(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5494
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$12(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$12(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5579
5495
|
function Option(props) {
|
|
5580
5496
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
5581
5497
|
language: applicationContext.dataLocale,
|
|
@@ -5586,7 +5502,7 @@ function Option(props) {
|
|
|
5586
5502
|
const _useIntl = reactIntl.useIntl(),
|
|
5587
5503
|
formatMessage = _useIntl.formatMessage;
|
|
5588
5504
|
const category = props.data;
|
|
5589
|
-
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$
|
|
5505
|
+
return jsxRuntime.jsx(uiKit.AsyncSelectInput.Option, _objectSpread$12(_objectSpread$12({}, props), {}, {
|
|
5590
5506
|
children: jsxRuntime.jsxs("div", {
|
|
5591
5507
|
"data-testid": "category-option",
|
|
5592
5508
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -5597,7 +5513,7 @@ function Option(props) {
|
|
|
5597
5513
|
fallbackOrder: languages
|
|
5598
5514
|
})
|
|
5599
5515
|
}), category.parent && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5600
|
-
children: `${formatMessage(messages$
|
|
5516
|
+
children: `${formatMessage(messages$G.parentCategory)}: ${l10n.formatLocalizedString(category.parent, {
|
|
5601
5517
|
key: 'name',
|
|
5602
5518
|
locale: language,
|
|
5603
5519
|
fallbackOrder: languages
|
|
@@ -5609,14 +5525,14 @@ function Option(props) {
|
|
|
5609
5525
|
fallbackOrder: languages
|
|
5610
5526
|
})}`
|
|
5611
5527
|
}), category.externalId && jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
5612
|
-
children: `${formatMessage(messages$
|
|
5528
|
+
children: `${formatMessage(messages$G.externalId)}: ${category.externalId || constants.NO_VALUE_FALLBACK}`
|
|
5613
5529
|
})]
|
|
5614
5530
|
})
|
|
5615
5531
|
}));
|
|
5616
5532
|
}
|
|
5617
5533
|
|
|
5618
|
-
function ownKeys$
|
|
5619
|
-
function _objectSpread$
|
|
5534
|
+
function ownKeys$11(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5535
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$11(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$11(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5620
5536
|
const filterOption = () => true;
|
|
5621
5537
|
function CategoryReferenceSearch(props) {
|
|
5622
5538
|
const _useIntl = reactIntl.useIntl(),
|
|
@@ -5628,7 +5544,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5628
5544
|
})),
|
|
5629
5545
|
language = _useApplicationContex.language,
|
|
5630
5546
|
languages = _useApplicationContex.languages;
|
|
5631
|
-
const mapItemToOption = React.useCallback(category => _objectSpread$
|
|
5547
|
+
const mapItemToOption = React.useCallback(category => _objectSpread$11(_objectSpread$11({}, category), {}, {
|
|
5632
5548
|
value: category.id,
|
|
5633
5549
|
label: l10n.formatLocalizedString(category, {
|
|
5634
5550
|
key: 'name',
|
|
@@ -5646,7 +5562,7 @@ function CategoryReferenceSearch(props) {
|
|
|
5646
5562
|
}), [apolloClient]);
|
|
5647
5563
|
return jsxRuntime.jsx(ReferenceSearch, {
|
|
5648
5564
|
id: props.id,
|
|
5649
|
-
components: _objectSpread$
|
|
5565
|
+
components: _objectSpread$11({
|
|
5650
5566
|
Option
|
|
5651
5567
|
}, props.components),
|
|
5652
5568
|
isClearable: props.isClearable,
|
|
@@ -5657,10 +5573,10 @@ function CategoryReferenceSearch(props) {
|
|
|
5657
5573
|
onBlur: props.onBlur,
|
|
5658
5574
|
onChange: props.onChange,
|
|
5659
5575
|
value: props.value,
|
|
5660
|
-
placeholderLabel: formatMessage(messages$
|
|
5661
|
-
searchPromptLabel: formatMessage(messages$
|
|
5662
|
-
noResultsLabel: formatMessage(messages$
|
|
5663
|
-
referenceIsMissingLabel: formatMessage(messages$
|
|
5576
|
+
placeholderLabel: formatMessage(messages$G.placeholder),
|
|
5577
|
+
searchPromptLabel: formatMessage(messages$G.searchPrompt),
|
|
5578
|
+
noResultsLabel: formatMessage(messages$G.noResults),
|
|
5579
|
+
referenceIsMissingLabel: formatMessage(messages$G.isMissing),
|
|
5664
5580
|
mapItemToOption: mapItemToOption,
|
|
5665
5581
|
loadItemsBySearchTerm: loadItemsBySearchTerm,
|
|
5666
5582
|
loadItemsByIds: loadItemsByIds,
|
|
@@ -5687,7 +5603,7 @@ function useCachedCategoryOptions(ids) {
|
|
|
5687
5603
|
|
|
5688
5604
|
const getFileInputStyles = () => /*#__PURE__*/react$1.css("display:inline-flex;background-color:", designSystem.designTokens.colorSurface, ";border:1px solid ", designSystem.designTokens.colorNeutral, ";box-shadow:none;border-radius:", designSystem.designTokens.borderRadius4, ";color:", designSystem.designTokens.colorSolid, ";height:", designSystem.designTokens.heightForButtonAsBig, ";font-size:", designSystem.designTokens.fontSize20, ";font-weight:", designSystem.designTokens.fontWeight500, ";align-items:center;transition:background-color ", designSystem.designTokens.transitionLinear80Ms, ";padding:0 ", designSystem.designTokens.spacingM, ";&:hover,&:focus{cursor:pointer;background-color:", designSystem.designTokens.backgroundColorForButtonWhenHovered, ";box-shadow:none;}&:active{box-shadow:", designSystem.designTokens.shadow9, ";background-color:", designSystem.designTokens.colorSurface, ";}" + ("" ), "" );
|
|
5689
5605
|
|
|
5690
|
-
var messages$
|
|
5606
|
+
var messages$E = reactIntl.defineMessages({
|
|
5691
5607
|
chooseFile: {
|
|
5692
5608
|
id: 'ButtonFileInput.chooseFile',
|
|
5693
5609
|
description: 'The label text of the field for upload local file',
|
|
@@ -5695,26 +5611,26 @@ var messages$F = reactIntl.defineMessages({
|
|
|
5695
5611
|
}
|
|
5696
5612
|
});
|
|
5697
5613
|
|
|
5698
|
-
const _excluded$
|
|
5699
|
-
function ownKeys$
|
|
5700
|
-
function _objectSpread$
|
|
5701
|
-
var _ref$
|
|
5614
|
+
const _excluded$b = ["children", "allowMultiple", "acceptTypes"];
|
|
5615
|
+
function ownKeys$10(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5616
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$10(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$10(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5617
|
+
var _ref$c = {
|
|
5702
5618
|
name: "1wq0eh7",
|
|
5703
5619
|
styles: "visibility:hidden;width:1px;height:1px"
|
|
5704
5620
|
} ;
|
|
5705
5621
|
const FileInput = _ref2 => {
|
|
5706
5622
|
let _ref2$children = _ref2.children,
|
|
5707
|
-
children = _ref2$children === void 0 ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
5623
|
+
children = _ref2$children === void 0 ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$10({}, messages$E.chooseFile)) : _ref2$children,
|
|
5708
5624
|
_ref2$allowMultiple = _ref2.allowMultiple,
|
|
5709
5625
|
allowMultiple = _ref2$allowMultiple === void 0 ? false : _ref2$allowMultiple,
|
|
5710
5626
|
_ref2$acceptTypes = _ref2.acceptTypes,
|
|
5711
5627
|
acceptTypes = _ref2$acceptTypes === void 0 ? 'image/png,image/jpeg,image/gif' : _ref2$acceptTypes,
|
|
5712
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
5628
|
+
props = _objectWithoutProperties(_ref2, _excluded$b);
|
|
5713
5629
|
return jsxRuntime.jsx("label", {
|
|
5714
5630
|
children: jsxRuntime.jsxs("span", {
|
|
5715
5631
|
css: getFileInputStyles(),
|
|
5716
5632
|
children: [jsxRuntime.jsx("input", {
|
|
5717
|
-
css: _ref$
|
|
5633
|
+
css: _ref$c,
|
|
5718
5634
|
type: "file",
|
|
5719
5635
|
accept: acceptTypes,
|
|
5720
5636
|
name: props.name,
|
|
@@ -5727,245 +5643,7 @@ const FileInput = _ref2 => {
|
|
|
5727
5643
|
FileInput.displayName = 'FileInput';
|
|
5728
5644
|
var FileInput$1 = FileInput;
|
|
5729
5645
|
|
|
5730
|
-
|
|
5731
|
-
const baseButtonStyles = {
|
|
5732
|
-
name: "it1691",
|
|
5733
|
-
styles: "color:inherit;padding:0;font:inherit;cursor:pointer;outline:inherit;border:none;background:none"
|
|
5734
|
-
} ;
|
|
5735
|
-
|
|
5736
|
-
const _excluded$c = ["animationOrientation", "children", "onClick"];
|
|
5737
|
-
function ownKeys$11(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5738
|
-
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$11(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$11(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5739
|
-
const ICON_COLOR$1 = '#6359ff';
|
|
5740
|
-
const PaginationIconButton = _ref => {
|
|
5741
|
-
let animationOrientation = _ref.animationOrientation,
|
|
5742
|
-
children = _ref.children,
|
|
5743
|
-
onClick = _ref.onClick,
|
|
5744
|
-
rest = _objectWithoutProperties(_ref, _excluded$c);
|
|
5745
|
-
return jsxRuntime.jsx("button", _objectSpread$11(_objectSpread$11({
|
|
5746
|
-
css: [baseButtonStyles, /*#__PURE__*/react$1.css("svg{fill:", ICON_COLOR$1, ";}transition:transform ", uiKit.designTokens.transitionStandard, ";:hover{transform:translateX(\n ", animationOrientation === 'left' ? `calc(0px - var(--spacing-10))` : `var(--spacing-10)`, "\n );}padding-left:1px;padding-right:1px;:focus{border:1px solid ", ICON_COLOR$1, ";border-radius:", uiKit.designTokens.borderRadius1, ";padding-left:0px;padding-right:0px;}" + ("" ), "" ), "" , "" ],
|
|
5747
|
-
onClick: onClick
|
|
5748
|
-
}, rest), {}, {
|
|
5749
|
-
children: children
|
|
5750
|
-
}));
|
|
5751
|
-
};
|
|
5752
|
-
var PaginationIconButton$1 = PaginationIconButton;
|
|
5753
|
-
|
|
5754
|
-
const _excluded$b = ["isFilled", "onClick"];
|
|
5755
|
-
function ownKeys$10(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5756
|
-
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$10(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$10(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5757
|
-
const ICON_HEIGHT = '10px';
|
|
5758
|
-
const ICON_WIDTH = ICON_HEIGHT;
|
|
5759
|
-
// TODO: Integrate design tokens when redesign is complete
|
|
5760
|
-
const ICON_COLOR = '#6359FF';
|
|
5761
|
-
const ICON_HOVER_COLOR = '#B1ACFF';
|
|
5762
|
-
const PaginationSelectionButton = _ref => {
|
|
5763
|
-
let _ref$isFilled = _ref.isFilled,
|
|
5764
|
-
isFilled = _ref$isFilled === void 0 ? false : _ref$isFilled,
|
|
5765
|
-
onClick = _ref.onClick,
|
|
5766
|
-
rest = _objectWithoutProperties(_ref, _excluded$b);
|
|
5767
|
-
return jsxRuntime.jsx("button", _objectSpread$10({
|
|
5768
|
-
css: [baseButtonStyles, /*#__PURE__*/react$1.css("height:", ICON_HEIGHT, ";width:", ICON_WIDTH, ";border-radius:", uiKit.designTokens.borderRadius6, ";border:", isFilled ? 'none' : `${uiKit.designTokens.borderWidth1} solid ${uiKit.designTokens.colorNeutral}`, ";background:", isFilled ? ICON_COLOR : 'none', ";transition:", uiKit.designTokens.transitionStandard, ";:hover{background:", isFilled ? undefined : ICON_HOVER_COLOR, ";}:focus{border:", uiKit.designTokens.borderWidth1, " solid ", ICON_COLOR, ";}" + ("" ), "" ), "" , "" ],
|
|
5769
|
-
onClick: onClick
|
|
5770
|
-
}, rest));
|
|
5771
|
-
};
|
|
5772
|
-
var PaginationSelectionButton$1 = PaginationSelectionButton;
|
|
5773
|
-
|
|
5774
|
-
const CAROUSEL_WIDTH = 384;
|
|
5775
|
-
const PAGINATION_CONTROL_HEIGHT = 26;
|
|
5776
|
-
const IMAGE_AREA_HEIGHT = 200;
|
|
5777
|
-
const BaseCarousel = _ref2 => {
|
|
5778
|
-
let items = _ref2.items,
|
|
5779
|
-
renderItem = _ref2.renderItem,
|
|
5780
|
-
_ref2$fullWidth = _ref2.fullWidth,
|
|
5781
|
-
fullWidth = _ref2$fullWidth === void 0 ? false : _ref2$fullWidth,
|
|
5782
|
-
_ref2$borderless = _ref2.borderless,
|
|
5783
|
-
borderless = _ref2$borderless === void 0 ? false : _ref2$borderless;
|
|
5784
|
-
// Randomize input array and cache across rerenders
|
|
5785
|
-
const _useState = React.useState(shuffle__default["default"](items)),
|
|
5786
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
5787
|
-
shuffledItems = _useState2[0],
|
|
5788
|
-
setShuffledItems = _useState2[1];
|
|
5789
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
5790
|
-
projectKey: context.project?.key
|
|
5791
|
-
})),
|
|
5792
|
-
projectKey = _useApplicationContex.projectKey;
|
|
5793
|
-
const handleFilterItemsWhenFlagDisabled = idx => {
|
|
5794
|
-
const newItems = _filterInstanceProperty__default["default"](shuffledItems).call(shuffledItems, (_, idx1) => idx !== idx1);
|
|
5795
|
-
setShuffledItems(newItems);
|
|
5796
|
-
};
|
|
5797
|
-
const _useSnapCarousel = reactSnapCarousel.useSnapCarousel(),
|
|
5798
|
-
scrollRef = _useSnapCarousel.scrollRef,
|
|
5799
|
-
pages = _useSnapCarousel.pages,
|
|
5800
|
-
activePageIndex = _useSnapCarousel.activePageIndex,
|
|
5801
|
-
prev = _useSnapCarousel.prev,
|
|
5802
|
-
next = _useSnapCarousel.next,
|
|
5803
|
-
goTo = _useSnapCarousel.goTo;
|
|
5804
|
-
const handlePrev = () => {
|
|
5805
|
-
if (activePageIndex === 0) {
|
|
5806
|
-
goTo(pages.length - 1);
|
|
5807
|
-
} else {
|
|
5808
|
-
prev();
|
|
5809
|
-
}
|
|
5810
|
-
};
|
|
5811
|
-
const handleNext = () => {
|
|
5812
|
-
if (activePageIndex === pages.length - 1) {
|
|
5813
|
-
goTo(0);
|
|
5814
|
-
} else {
|
|
5815
|
-
next();
|
|
5816
|
-
}
|
|
5817
|
-
};
|
|
5818
|
-
const getLinkTo = activeItem => {
|
|
5819
|
-
if (!activeItem?.linkTo) return undefined;
|
|
5820
|
-
return activeItem.isExternal ? activeItem.linkTo() : activeItem.linkTo(projectKey);
|
|
5821
|
-
};
|
|
5822
|
-
|
|
5823
|
-
// Get the current item safely
|
|
5824
|
-
const currentItem = shuffledItems[activePageIndex];
|
|
5825
|
-
|
|
5826
|
-
// Don't render if there's no current item
|
|
5827
|
-
if (!currentItem) {
|
|
5828
|
-
return null;
|
|
5829
|
-
}
|
|
5830
|
-
return jsxRuntime.jsxs("div", {
|
|
5831
|
-
css: /*#__PURE__*/react$1.css("width:", fullWidth ? '100%' : `${CAROUSEL_WIDTH}px`, ";position:relative;" + ("" ), "" ),
|
|
5832
|
-
role: "region",
|
|
5833
|
-
"aria-roledescription": "carousel",
|
|
5834
|
-
"aria-label": "rotunda",
|
|
5835
|
-
children: [currentItem.linkTo ? jsxRuntime.jsx("a", {
|
|
5836
|
-
href: getLinkTo(currentItem),
|
|
5837
|
-
target: currentItem.isExternal ? '_blank' : '_self',
|
|
5838
|
-
rel: "noopener noreferrer",
|
|
5839
|
-
children: jsxRuntime.jsx(uiKit.Card, {
|
|
5840
|
-
insetScale: 'none',
|
|
5841
|
-
onClick: () => {},
|
|
5842
|
-
type: borderless ? 'flat' : undefined,
|
|
5843
|
-
children: jsxRuntime.jsx("div", {
|
|
5844
|
-
css: /*#__PURE__*/react$1.css("position:relative;display:flex;scroll-snap-type:x mandatory;overflow:hidden;margin:0;padding-bottom:", uiKit.designTokens.spacing60, ";" + ("" ), "" ),
|
|
5845
|
-
ref: scrollRef,
|
|
5846
|
-
children: _mapInstanceProperty__default["default"](shuffledItems).call(shuffledItems, (item, idx) => renderItem({
|
|
5847
|
-
item
|
|
5848
|
-
}, handleFilterItemsWhenFlagDisabled, idx))
|
|
5849
|
-
})
|
|
5850
|
-
})
|
|
5851
|
-
}) : jsxRuntime.jsx(uiKit.Card, {
|
|
5852
|
-
insetScale: 'none',
|
|
5853
|
-
onClick: () => {},
|
|
5854
|
-
type: borderless ? 'flat' : undefined,
|
|
5855
|
-
children: jsxRuntime.jsx("div", {
|
|
5856
|
-
css: /*#__PURE__*/react$1.css("position:relative;display:flex;scroll-snap-type:x mandatory;overflow:hidden;margin:0;padding-bottom:", uiKit.designTokens.spacing60, ";" + ("" ), "" ),
|
|
5857
|
-
ref: scrollRef,
|
|
5858
|
-
children: _mapInstanceProperty__default["default"](shuffledItems).call(shuffledItems, (item, idx) => renderItem({
|
|
5859
|
-
item
|
|
5860
|
-
}, handleFilterItemsWhenFlagDisabled, idx))
|
|
5861
|
-
})
|
|
5862
|
-
}), jsxRuntime.jsx("div", {
|
|
5863
|
-
css: /*#__PURE__*/react$1.css("position:absolute;bottom:", uiKit.designTokens.spacingM, ";left:50%;pointer-events:none;" + ("" ), "" ),
|
|
5864
|
-
children: jsxRuntime.jsx("div", {
|
|
5865
|
-
css: /*#__PURE__*/react$1.css("position:relative;left:-50%;background-color:", uiKit.designTokens.colorSurface, ";pointer-events:auto;height:", PAGINATION_CONTROL_HEIGHT, "px;border-radius:", uiKit.designTokens.borderRadius4, ";padding-left:", uiKit.designTokens.spacing25, ";padding-right:", uiKit.designTokens.spacing25, ";display:flex;align-items:center;" + ("" ), "" ),
|
|
5866
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
5867
|
-
scale: "m",
|
|
5868
|
-
justifyContent: "center",
|
|
5869
|
-
alignItems: "center",
|
|
5870
|
-
children: [jsxRuntime.jsx(PaginationIconButton$1, {
|
|
5871
|
-
animationOrientation: "left",
|
|
5872
|
-
onClick: handlePrev,
|
|
5873
|
-
"aria-label": "go to previous slide",
|
|
5874
|
-
"data-testid": "go-to-previous-slide-button",
|
|
5875
|
-
children: jsxRuntime.jsx(uiKit.AngleLeftIcon, {
|
|
5876
|
-
size: "small"
|
|
5877
|
-
})
|
|
5878
|
-
}), _mapInstanceProperty__default["default"](pages).call(pages, (_, i) => jsxRuntime.jsx(PaginationSelectionButton$1, {
|
|
5879
|
-
isFilled: activePageIndex === i,
|
|
5880
|
-
onClick: () => goTo(i),
|
|
5881
|
-
"aria-label": `go to slide ${i + 1}`,
|
|
5882
|
-
"data-testid": `go-to-slide-${i + 1}-button`
|
|
5883
|
-
}, i)), jsxRuntime.jsx(PaginationIconButton$1, {
|
|
5884
|
-
animationOrientation: "right",
|
|
5885
|
-
onClick: handleNext,
|
|
5886
|
-
"aria-label": "go to next slide",
|
|
5887
|
-
"data-testid": "go-to-next-slide-button",
|
|
5888
|
-
children: jsxRuntime.jsx(uiKit.AngleRightIcon, {
|
|
5889
|
-
size: "small"
|
|
5890
|
-
})
|
|
5891
|
-
})]
|
|
5892
|
-
})
|
|
5893
|
-
})
|
|
5894
|
-
})]
|
|
5895
|
-
});
|
|
5896
|
-
};
|
|
5897
|
-
var _ref$c = {
|
|
5898
|
-
name: "97rk2e",
|
|
5899
|
-
styles: "width:100%;height:100%;flex-shrink:0;scroll-snap-align:start"
|
|
5900
|
-
} ;
|
|
5901
|
-
const CarouselContent = _ref3 => {
|
|
5902
|
-
let item = _ref3.item,
|
|
5903
|
-
handleFilterItemsWhenFlagDisabled = _ref3.handleFilterItemsWhenFlagDisabled,
|
|
5904
|
-
idx = _ref3.idx,
|
|
5905
|
-
hasPadding = _ref3.hasPadding;
|
|
5906
|
-
const isEnabled = applicationShell.useFeatureToggle(item.flag || '');
|
|
5907
|
-
const intl = reactIntl.useIntl();
|
|
5908
|
-
React.useEffect(() => {
|
|
5909
|
-
if (item.flag && !isEnabled) {
|
|
5910
|
-
handleFilterItemsWhenFlagDisabled(idx);
|
|
5911
|
-
}
|
|
5912
|
-
}, [isEnabled, handleFilterItemsWhenFlagDisabled, idx, item]);
|
|
5913
|
-
if (item.flag && !isEnabled) {
|
|
5914
|
-
return null;
|
|
5915
|
-
}
|
|
5916
|
-
return jsxRuntime.jsx("div", {
|
|
5917
|
-
role: "group",
|
|
5918
|
-
"aria-roledescription": "slide",
|
|
5919
|
-
"aria-label": `slide-${idx + 1}`,
|
|
5920
|
-
css: _ref$c,
|
|
5921
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
5922
|
-
children: [item.imgSrc && item.imgAlt && jsxRuntime.jsx("img", {
|
|
5923
|
-
css: /*#__PURE__*/react$1.css("width:100%;height:", IMAGE_AREA_HEIGHT, "px;" + ("" ), "" ),
|
|
5924
|
-
src: item.imgSrc,
|
|
5925
|
-
alt: intl.formatMessage(item.imgAlt)
|
|
5926
|
-
}), jsxRuntime.jsx("div", {
|
|
5927
|
-
css: /*#__PURE__*/react$1.css("padding:0 ", hasPadding ? uiKit.designTokens.spacingL : 0, " 0 ", hasPadding ? uiKit.designTokens.spacingL : 0, ";" + ("" ), "" ),
|
|
5928
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
5929
|
-
scale: "xs",
|
|
5930
|
-
alignItems: "flex-start",
|
|
5931
|
-
children: [item.stampLabel && item.stampTone && jsxRuntime.jsx(uiKit.Stamp, {
|
|
5932
|
-
tone: item.stampTone,
|
|
5933
|
-
label: intl.formatMessage(item.stampLabel),
|
|
5934
|
-
isCondensed: !!item?.isStampCondensed
|
|
5935
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
5936
|
-
intlMessage: item.textContent
|
|
5937
|
-
})]
|
|
5938
|
-
})
|
|
5939
|
-
})]
|
|
5940
|
-
})
|
|
5941
|
-
});
|
|
5942
|
-
};
|
|
5943
|
-
const Carousel = _ref4 => {
|
|
5944
|
-
let items = _ref4.items,
|
|
5945
|
-
_ref4$fullWidth = _ref4.fullWidth,
|
|
5946
|
-
fullWidth = _ref4$fullWidth === void 0 ? false : _ref4$fullWidth,
|
|
5947
|
-
_ref4$borderless = _ref4.borderless,
|
|
5948
|
-
borderless = _ref4$borderless === void 0 ? true : _ref4$borderless,
|
|
5949
|
-
_ref4$hasPadding = _ref4.hasPadding,
|
|
5950
|
-
hasPadding = _ref4$hasPadding === void 0 ? true : _ref4$hasPadding;
|
|
5951
|
-
return jsxRuntime.jsx(BaseCarousel, {
|
|
5952
|
-
fullWidth: fullWidth,
|
|
5953
|
-
borderless: borderless,
|
|
5954
|
-
items: items,
|
|
5955
|
-
renderItem: (_ref5, handleFilterItemsWhenFlagDisabled, idx) => {
|
|
5956
|
-
let item = _ref5.item;
|
|
5957
|
-
return jsxRuntime.jsx(CarouselContent, {
|
|
5958
|
-
handleFilterItemsWhenFlagDisabled: handleFilterItemsWhenFlagDisabled,
|
|
5959
|
-
item: item,
|
|
5960
|
-
idx: idx,
|
|
5961
|
-
hasPadding: hasPadding
|
|
5962
|
-
}, item.id);
|
|
5963
|
-
}
|
|
5964
|
-
});
|
|
5965
|
-
};
|
|
5966
|
-
var Carousel$1 = Carousel;
|
|
5967
|
-
|
|
5968
|
-
var messages$E = reactIntl.defineMessages({
|
|
5646
|
+
var messages$D = reactIntl.defineMessages({
|
|
5969
5647
|
countriesBasicSelectPlaceholder: {
|
|
5970
5648
|
id: 'CountriesPicker.countriesBasicSelectPlaceholder',
|
|
5971
5649
|
description: 'Placeholder of the basic field for countries',
|
|
@@ -5986,7 +5664,7 @@ var messages$E = reactIntl.defineMessages({
|
|
|
5986
5664
|
function ownKeys$$(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5987
5665
|
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys$$(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context9 = ownKeys$$(Object(t))).call(_context9, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
5988
5666
|
const emptyCountryOption = intl => [{
|
|
5989
|
-
label: intl.formatMessage(messages$
|
|
5667
|
+
label: intl.formatMessage(messages$D.countriesAsyncSelectDropdownTypeAheadPrompt),
|
|
5990
5668
|
value: undefined,
|
|
5991
5669
|
isDisabled: true
|
|
5992
5670
|
}];
|
|
@@ -6029,7 +5707,7 @@ function CountriesAsyncSelectDropdown(props) {
|
|
|
6029
5707
|
var _context7;
|
|
6030
5708
|
return _findInstanceProperty__default["default"](_context7 = props.options).call(_context7, country => country.value === countryCode);
|
|
6031
5709
|
}),
|
|
6032
|
-
placeholder: intl.formatMessage(messages$
|
|
5710
|
+
placeholder: intl.formatMessage(messages$D.countriesAsyncSelectPlaceholder),
|
|
6033
5711
|
loadOptions: handleLoadOptions,
|
|
6034
5712
|
onChange: onOptionChange,
|
|
6035
5713
|
isDisabled: props.isDisabled,
|
|
@@ -6049,7 +5727,7 @@ function CountriesBasicSelectDropdown(props) {
|
|
|
6049
5727
|
value: props.value,
|
|
6050
5728
|
isRequired: props.isRequired,
|
|
6051
5729
|
description: props.description,
|
|
6052
|
-
placeholder: intl.formatMessage(messages$
|
|
5730
|
+
placeholder: intl.formatMessage(messages$D.countriesBasicSelectPlaceholder),
|
|
6053
5731
|
options: props.options,
|
|
6054
5732
|
onChange: props.onChange,
|
|
6055
5733
|
isDisabled: props.isDisabled,
|
|
@@ -6085,7 +5763,7 @@ function CountriesPicker(_ref) {
|
|
|
6085
5763
|
});
|
|
6086
5764
|
}
|
|
6087
5765
|
|
|
6088
|
-
var messages$
|
|
5766
|
+
var messages$C = reactIntl.defineMessages({
|
|
6089
5767
|
noCustomerGroupsFound: {
|
|
6090
5768
|
id: 'Prices.CustomerGroupPickerInput.noCustomerGroupsFound',
|
|
6091
5769
|
description: 'The message to display when no customer groups were found',
|
|
@@ -6175,7 +5853,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6175
5853
|
if (isCurrentOptionLoadingFailed) onError(currentOption.error);
|
|
6176
5854
|
}, [isCurrentOptionLoadingFailed, onError, currentOption]);
|
|
6177
5855
|
const isLoadingFailed = isCurrentOptionLoadingFailed || Boolean(loadingError);
|
|
6178
|
-
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$
|
|
5856
|
+
const handleNoOptions = React.useCallback(() => loadingError ? null : formatMessage(messages$C.noCustomerGroupsFound), [loadingError, formatMessage]);
|
|
6179
5857
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
6180
5858
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6181
5859
|
max: "scale",
|
|
@@ -6186,7 +5864,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6186
5864
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
6187
5865
|
id: name,
|
|
6188
5866
|
name: name,
|
|
6189
|
-
placeholder: placeholder ?? formatMessage(messages$
|
|
5867
|
+
placeholder: placeholder ?? formatMessage(messages$C.placeholder),
|
|
6190
5868
|
loadOptions: loadOptionsDebounced,
|
|
6191
5869
|
defaultOptions: true,
|
|
6192
5870
|
showOptionGroupDivider: true,
|
|
@@ -6213,25 +5891,6 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
6213
5891
|
CustomerGroupPickerInput.displayName = 'CustomerGroupPickerInput';
|
|
6214
5892
|
var CustomerGroupPickerInput$1 = CustomerGroupPickerInput;
|
|
6215
5893
|
|
|
6216
|
-
function Divider(_ref) {
|
|
6217
|
-
let _ref$isDashed = _ref.isDashed,
|
|
6218
|
-
isDashed = _ref$isDashed === void 0 ? false : _ref$isDashed,
|
|
6219
|
-
_ref$orientation = _ref.orientation,
|
|
6220
|
-
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation;
|
|
6221
|
-
const dividerStyles = /*#__PURE__*/react$1.css("box-sizing:border-box;margin:0;border:0;border-color:var(--color-neutral-90);border-style:", isDashed ? 'dashed' : 'solid', ";", orientation === 'horizontal' ? `
|
|
6222
|
-
width: 100%;
|
|
6223
|
-
border-top-width: 1px;
|
|
6224
|
-
` : `
|
|
6225
|
-
width: 1px;
|
|
6226
|
-
height: 2vmax;
|
|
6227
|
-
border-left-width: 1px;
|
|
6228
|
-
`, ";" + ("" ), "" );
|
|
6229
|
-
return jsxRuntime.jsx("hr", {
|
|
6230
|
-
css: dividerStyles
|
|
6231
|
-
});
|
|
6232
|
-
}
|
|
6233
|
-
Divider.displayName = 'Divider';
|
|
6234
|
-
|
|
6235
5894
|
const FormattedLocalizedString = /*#__PURE__*/React__namespace.memo(_ref => {
|
|
6236
5895
|
let value = _ref.value,
|
|
6237
5896
|
fallback = _ref.fallback;
|
|
@@ -6325,7 +5984,7 @@ const makeChangeHandler = setValue => event => {
|
|
|
6325
5984
|
// attributes.
|
|
6326
5985
|
const omitUnknownValues = (valuesAsMap, fieldDefinitionsAsMap) => omitBy__default["default"](valuesAsMap, (value, key) => isNil__default["default"](fieldDefinitionsAsMap[key]));
|
|
6327
5986
|
|
|
6328
|
-
var messages$
|
|
5987
|
+
var messages$B = reactIntl.defineMessages({
|
|
6329
5988
|
booleanSetInputYesLabel: {
|
|
6330
5989
|
id: 'CustomBooleanInputSet.booleanSetInputYesLabel',
|
|
6331
5990
|
description: 'Custom boolean input set Yes label',
|
|
@@ -6367,13 +6026,13 @@ function CustomBooleanInputSet(props) {
|
|
|
6367
6026
|
formatMessage = _useIntl.formatMessage;
|
|
6368
6027
|
const options = React.useMemo(() => [{
|
|
6369
6028
|
value: 'true',
|
|
6370
|
-
label: formatMessage(messages$
|
|
6029
|
+
label: formatMessage(messages$B.booleanSetInputYesLabel)
|
|
6371
6030
|
}, {
|
|
6372
6031
|
value: 'false',
|
|
6373
|
-
label: formatMessage(messages$
|
|
6032
|
+
label: formatMessage(messages$B.booleanSetInputNoLabel)
|
|
6374
6033
|
}, {
|
|
6375
6034
|
value: 'all',
|
|
6376
|
-
label: formatMessage(messages$
|
|
6035
|
+
label: formatMessage(messages$B.booleanSetInputAllLabel)
|
|
6377
6036
|
}], [formatMessage]);
|
|
6378
6037
|
const handleChange = makeChangeHandler(rawValue => {
|
|
6379
6038
|
const nullifiedIfNeeded = !rawValue ? undefined : valueToBooleanSet(rawValue);
|
|
@@ -6401,7 +6060,7 @@ const ExpandButton = props => props.totalValues > 1 ? jsxRuntime.jsxs(uiKit.Spac
|
|
|
6401
6060
|
scale: "s",
|
|
6402
6061
|
alignItems: "center",
|
|
6403
6062
|
children: [jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
6404
|
-
children: jsxRuntime.jsx(Divider, {})
|
|
6063
|
+
children: jsxRuntime.jsx(merchantCenterSharedUi.Divider, {})
|
|
6405
6064
|
}), jsxRuntime.jsx(uiKit.FlatButton, {
|
|
6406
6065
|
tone: "primary",
|
|
6407
6066
|
icon: props.isExpanded ? jsxRuntime.jsx(uiKit.AngleUpIcon, {}) : jsxRuntime.jsx(uiKit.AngleDownIcon, {}),
|
|
@@ -6672,7 +6331,7 @@ function CustomDateTimeInput(props) {
|
|
|
6672
6331
|
}
|
|
6673
6332
|
CustomDateTimeInput.displayName = 'CustomDateTimeInput';
|
|
6674
6333
|
|
|
6675
|
-
const convertTypeValuesToOptions$1 = reselect.
|
|
6334
|
+
const convertTypeValuesToOptions$1 = reselect.lruMemoize(typeValues => _mapInstanceProperty__default["default"](typeValues).call(typeValues, typeValue => ({
|
|
6676
6335
|
label: typeValue.label || `${typeValue.key} (key)`,
|
|
6677
6336
|
value: typeValue.key
|
|
6678
6337
|
})));
|
|
@@ -6704,7 +6363,7 @@ function CustomEnumInput(props) {
|
|
|
6704
6363
|
}
|
|
6705
6364
|
CustomEnumInput.displayName = 'CustomEnumInput';
|
|
6706
6365
|
|
|
6707
|
-
const convertTypeValuesToOptions = reselect.
|
|
6366
|
+
const convertTypeValuesToOptions = reselect.lruMemoize((type, dataLocale, languages) => {
|
|
6708
6367
|
var _context;
|
|
6709
6368
|
return _mapInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](type)).call(_context, value => ({
|
|
6710
6369
|
label: l10n.formatLocalizedString(value, {
|
|
@@ -6957,7 +6616,7 @@ const NestingLevelContext = /*#__PURE__*/React.createContext(0);
|
|
|
6957
6616
|
var NestingLevelContext$1 = NestingLevelContext;
|
|
6958
6617
|
|
|
6959
6618
|
// eslint-disable-next-line import/prefer-default-export
|
|
6960
|
-
const messages$
|
|
6619
|
+
const messages$A = reactIntl.defineMessages({
|
|
6961
6620
|
aboveFifthLevelWarning: {
|
|
6962
6621
|
id: 'attributeInputByType.nestedAttributes.aboveFifthLevelWarning',
|
|
6963
6622
|
description: 'Warning message shown when nested attribute are above the fifth level',
|
|
@@ -6969,9 +6628,9 @@ const messages$B = reactIntl.defineMessages({
|
|
|
6969
6628
|
defaultMessage: 'Empty'
|
|
6970
6629
|
}
|
|
6971
6630
|
});
|
|
6972
|
-
var customFieldsMessages = messages$
|
|
6631
|
+
var customFieldsMessages = messages$A;
|
|
6973
6632
|
|
|
6974
|
-
var messages$
|
|
6633
|
+
var messages$z = reactIntl.defineMessages({
|
|
6975
6634
|
updateButton: {
|
|
6976
6635
|
id: 'NestedAttributes.Details.updateButton',
|
|
6977
6636
|
description: 'Update button label',
|
|
@@ -7056,7 +6715,7 @@ const EditButton = props => {
|
|
|
7056
6715
|
formatMessage = _useIntl.formatMessage;
|
|
7057
6716
|
return jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7058
6717
|
placement: "top",
|
|
7059
|
-
title: formatMessage(messages$
|
|
6718
|
+
title: formatMessage(messages$z.editTooltip),
|
|
7060
6719
|
children: jsxRuntime.jsx(uiKit.IconButton, {
|
|
7061
6720
|
label: "Edit",
|
|
7062
6721
|
isDisabled: props.isDisabled,
|
|
@@ -7072,12 +6731,12 @@ const DropChangesConfirmation = props => {
|
|
|
7072
6731
|
formatMessage = _useIntl2.formatMessage;
|
|
7073
6732
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
7074
6733
|
isOpen: props.isOpen || false,
|
|
7075
|
-
title: formatMessage(messages$
|
|
7076
|
-
labelPrimary: formatMessage(messages$
|
|
6734
|
+
title: formatMessage(messages$z.confirmationDialogTitle),
|
|
6735
|
+
labelPrimary: formatMessage(messages$z.nestedAttributesConfirmLabel),
|
|
7077
6736
|
onConfirm: props.onConfirm,
|
|
7078
6737
|
onCancel: props.onCancel,
|
|
7079
6738
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7080
|
-
intlMessage: messages$
|
|
6739
|
+
intlMessage: messages$z.confirmationDialogBody
|
|
7081
6740
|
})
|
|
7082
6741
|
});
|
|
7083
6742
|
};
|
|
@@ -7102,11 +6761,11 @@ const NestedAttributeModalPage = props => {
|
|
|
7102
6761
|
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
7103
6762
|
isDisabled: !formik$1.dirty,
|
|
7104
6763
|
iconLeft: jsxRuntime.jsx(uiKit.RevertIcon, {}),
|
|
7105
|
-
label: formatMessage(messages$
|
|
6764
|
+
label: formatMessage(messages$z.cancelButton),
|
|
7106
6765
|
onClick: formik$1.resetForm
|
|
7107
6766
|
}), jsxRuntime.jsx(applicationComponents.CustomFormModalPage.FormPrimaryButton, {
|
|
7108
6767
|
isDisabled: !formik$1.dirty,
|
|
7109
|
-
label: formatMessage(messages$
|
|
6768
|
+
label: formatMessage(messages$z.updateButton),
|
|
7110
6769
|
onClick: formik$1.handleSubmit
|
|
7111
6770
|
})]
|
|
7112
6771
|
}),
|
|
@@ -7148,7 +6807,7 @@ const NestedInputControls = props => {
|
|
|
7148
6807
|
if (nextNestingLevel >= 6) return jsxRuntime.jsx(MaxNestingLevelReached, {});
|
|
7149
6808
|
const hasAttributes = props.productType.attributeDefinitions.length > 0;
|
|
7150
6809
|
if (!hasAttributes) return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
7151
|
-
intlMessage: messages$
|
|
6810
|
+
intlMessage: messages$z.emptyProductType,
|
|
7152
6811
|
tone: "secondary"
|
|
7153
6812
|
});
|
|
7154
6813
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -7224,7 +6883,7 @@ const CustomNestedInput = /*#__PURE__*/React.memo(props => {
|
|
|
7224
6883
|
if (nestingLevel !== 0) parentFormik.submitForm();else showNotification({
|
|
7225
6884
|
kind: 'success',
|
|
7226
6885
|
domain: constants.DOMAINS.SIDE,
|
|
7227
|
-
text: formatMessage(messages$
|
|
6886
|
+
text: formatMessage(messages$z.attributeUpdateSucceeded)
|
|
7228
6887
|
});
|
|
7229
6888
|
setSubmitting(false);
|
|
7230
6889
|
},
|
|
@@ -7343,7 +7002,7 @@ function CustomChannelReferenceInput(props) {
|
|
|
7343
7002
|
}
|
|
7344
7003
|
CustomChannelReferenceInput.displayName = 'CustomChannelReferenceInput';
|
|
7345
7004
|
|
|
7346
|
-
var messages$
|
|
7005
|
+
var messages$y = reactIntl.defineMessages({
|
|
7347
7006
|
noProductsFound: {
|
|
7348
7007
|
id: 'Shared.ProductPickerInput.noProductsFound',
|
|
7349
7008
|
description: 'The message to display when no products were found',
|
|
@@ -7434,14 +7093,14 @@ const ProductPickerInput = _ref => {
|
|
|
7434
7093
|
const tooltipTitle = currentOption?.data?.label ?? '';
|
|
7435
7094
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
7436
7095
|
max: "scale",
|
|
7437
|
-
children: currentOption.loading ? jsxRuntime.jsx(CenteredLoadingSpinner
|
|
7096
|
+
children: currentOption.loading ? jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {}) : jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
7438
7097
|
scale: "xs",
|
|
7439
7098
|
children: [jsxRuntime.jsx(CustomFieldTooltip$1, {
|
|
7440
7099
|
title: tooltipTitle,
|
|
7441
7100
|
children: jsxRuntime.jsx(uiKit.AsyncSelectInput, {
|
|
7442
7101
|
id: name,
|
|
7443
7102
|
name: name,
|
|
7444
|
-
placeholder: formatMessage(messages$
|
|
7103
|
+
placeholder: formatMessage(messages$y.placeholder),
|
|
7445
7104
|
loadOptions: loadOptionsDebounced,
|
|
7446
7105
|
defaultOptions: [],
|
|
7447
7106
|
isClearable: isClearable,
|
|
@@ -7455,7 +7114,7 @@ const ProductPickerInput = _ref => {
|
|
|
7455
7114
|
onInputChange: handleInputChange,
|
|
7456
7115
|
onBlur: onBlur,
|
|
7457
7116
|
value: currentOption.data,
|
|
7458
|
-
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$
|
|
7117
|
+
noOptionsMessage: () => isLoadingFailed ? null : formatMessage(messages$y.noProductsFound),
|
|
7459
7118
|
hasError: hasError || isLoadingFailed,
|
|
7460
7119
|
menuPortalZIndex: Z_INDEX_DROPDOWN,
|
|
7461
7120
|
menuPortalTarget: document.body,
|
|
@@ -7705,7 +7364,7 @@ function truncate (text) {
|
|
|
7705
7364
|
return `${text.substring(0, length)}${end}`;
|
|
7706
7365
|
}
|
|
7707
7366
|
|
|
7708
|
-
var messages$
|
|
7367
|
+
var messages$x = reactIntl.defineMessages({
|
|
7709
7368
|
productReferenceLabel: {
|
|
7710
7369
|
id: 'CustomFieldsLabel.productReferenceLabel',
|
|
7711
7370
|
description: 'Label shown above the product picker input.',
|
|
@@ -7773,7 +7432,7 @@ const CustomFieldsLabelHint = _ref2 => {
|
|
|
7773
7432
|
children: [jsxRuntime.jsx(uiKit.WarningIcon, {
|
|
7774
7433
|
size: "medium",
|
|
7775
7434
|
color: "warning"
|
|
7776
|
-
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$T({}, messages$
|
|
7435
|
+
}), jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$T({}, messages$x.cartDiscountMoreThan500))]
|
|
7777
7436
|
});
|
|
7778
7437
|
}
|
|
7779
7438
|
return l10n.formatLocalizedString(fieldDefinition, {
|
|
@@ -7787,8 +7446,8 @@ function CustomFieldsProductTypeReferenceSubtitle() {
|
|
|
7787
7446
|
formatMessage = _useIntl.formatMessage;
|
|
7788
7447
|
const _usePimStatus = usePimStatus(),
|
|
7789
7448
|
isProjectIndexed = _usePimStatus.isProjectIndexed;
|
|
7790
|
-
if (isProjectIndexed) return formatMessage(messages$
|
|
7791
|
-
return formatMessage(messages$
|
|
7449
|
+
if (isProjectIndexed) return formatMessage(messages$x.productTypeReferenceLabelI);
|
|
7450
|
+
return formatMessage(messages$x.productTypeReferenceLabel);
|
|
7792
7451
|
}
|
|
7793
7452
|
|
|
7794
7453
|
// TODO(pa3): this logic may be misplaced and probably
|
|
@@ -7805,13 +7464,13 @@ function CustomFieldsLabelSubtitle(_ref3) {
|
|
|
7805
7464
|
const referenceTypeName = capitalizeFirst(referenceTypeId);
|
|
7806
7465
|
if (_includesInstanceProperty__default["default"](_context = [SEARCHABLE_REFERENCES.category, SEARCHABLE_REFERENCES.cartDiscount]).call(_context, referenceTypeId)) return referenceTypeName;
|
|
7807
7466
|
if (referenceTypeId === SEARCHABLE_REFERENCES.product) {
|
|
7808
|
-
return formatMessage(messages$
|
|
7467
|
+
return formatMessage(messages$x.productReferenceLabel);
|
|
7809
7468
|
} else if (referenceTypeId === SEARCHABLE_REFERENCES.productType) {
|
|
7810
7469
|
return jsxRuntime.jsx(CustomFieldsProductTypeReferenceSubtitle, {});
|
|
7811
7470
|
} else if (referenceTypeId === SEARCHABLE_REFERENCES.channel) {
|
|
7812
|
-
return formatMessage(messages$
|
|
7471
|
+
return formatMessage(messages$x.channelReferenceLabel);
|
|
7813
7472
|
} else if (referenceTypeId === SEARCHABLE_REFERENCES.state) {
|
|
7814
|
-
return formatMessage(messages$
|
|
7473
|
+
return formatMessage(messages$x.stateReferenceLabel);
|
|
7815
7474
|
} else {
|
|
7816
7475
|
return `${referenceTypeName} ID`;
|
|
7817
7476
|
}
|
|
@@ -7827,7 +7486,7 @@ function CustomFieldsCountIndicator(_ref4) {
|
|
|
7827
7486
|
const _useIntl3 = reactIntl.useIntl(),
|
|
7828
7487
|
formatMessage = _useIntl3.formatMessage;
|
|
7829
7488
|
return assignedAttributeGroups?.length > 1 ? jsxRuntime.jsx(uiKit.Tooltip, {
|
|
7830
|
-
title: formatMessage(messages$
|
|
7489
|
+
title: formatMessage(messages$x.attributeGroupCountTooltip, {
|
|
7831
7490
|
attributeGroups: _mapInstanceProperty__default["default"](assignedAttributeGroups).call(assignedAttributeGroups, assignedAttributeGroup => formatLocalizedField(assignedAttributeGroup.nameAllLocales)).join(', '),
|
|
7832
7491
|
count: assignedAttributeGroups.length
|
|
7833
7492
|
}),
|
|
@@ -7886,7 +7545,7 @@ const CustomFieldsLabel = /*#__PURE__*/React.memo(_ref5 => {
|
|
|
7886
7545
|
CustomFieldsLabel.displayName = 'CustomFieldsTitle';
|
|
7887
7546
|
var CustomFieldsLabel$1 = CustomFieldsLabel;
|
|
7888
7547
|
|
|
7889
|
-
var messages$
|
|
7548
|
+
var messages$w = reactIntl.defineMessages({
|
|
7890
7549
|
referencedProductType: {
|
|
7891
7550
|
id: 'NestedAttributes.referencedProductType',
|
|
7892
7551
|
description: 'Product type referenced hint',
|
|
@@ -7897,7 +7556,7 @@ var messages$x = reactIntl.defineMessages({
|
|
|
7897
7556
|
function ownKeys$S(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7898
7557
|
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$S(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$S(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
7899
7558
|
function ProductTypeReference(props) {
|
|
7900
|
-
const productTypeMessage = _objectSpread$S(_objectSpread$S({}, messages$
|
|
7559
|
+
const productTypeMessage = _objectSpread$S(_objectSpread$S({}, messages$w.referencedProductType), {}, {
|
|
7901
7560
|
values: {
|
|
7902
7561
|
productTypeName: props.productType.name
|
|
7903
7562
|
}
|
|
@@ -8489,7 +8148,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8489
8148
|
options: emptyStoreOption$1(intl)
|
|
8490
8149
|
}];
|
|
8491
8150
|
};
|
|
8492
|
-
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8151
|
+
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
8493
8152
|
return jsxRuntime.jsx(uiKit.AsyncSelectField, {
|
|
8494
8153
|
id: props.id,
|
|
8495
8154
|
name: props.name,
|
|
@@ -8559,7 +8218,7 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
8559
8218
|
})),
|
|
8560
8219
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8561
8220
|
dataLocale = _useApplicationContex.dataLocale;
|
|
8562
|
-
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8221
|
+
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
8563
8222
|
const productSelections = productSelectionsFetcher.productSelections?.results ?? [];
|
|
8564
8223
|
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
8565
8224
|
var _context;
|
|
@@ -8723,7 +8382,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8723
8382
|
const currentProductSelection = _findInstanceProperty__default["default"](productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8724
8383
|
props.onChange(currentProductSelection);
|
|
8725
8384
|
};
|
|
8726
|
-
if (productSelectionsByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8385
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
8727
8386
|
return jsxRuntime.jsx(uiKit.SearchSelectField, {
|
|
8728
8387
|
id: props.id,
|
|
8729
8388
|
name: props.name,
|
|
@@ -8829,7 +8488,7 @@ function ProductSelectionsPicker(_ref) {
|
|
|
8829
8488
|
}
|
|
8830
8489
|
};
|
|
8831
8490
|
}, [optionType]);
|
|
8832
|
-
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8491
|
+
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
8833
8492
|
let CustomProductSelectionsPicker;
|
|
8834
8493
|
if (productSelectionsTotalFetcher.total <= lowerProductSelectionsLimit) CustomProductSelectionsPicker = ProductSelectionBasicSelectDropdown;else if (productSelectionsTotalFetcher.total <= upperProductSelectionsLimit) CustomProductSelectionsPicker = ProductSelectionsAsyncSelectDropdown;else CustomProductSelectionsPicker = ProductSelectionsSearchSelectDropdown;
|
|
8835
8494
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
@@ -8853,7 +8512,7 @@ function ProductSelectionsPicker(_ref) {
|
|
|
8853
8512
|
});
|
|
8854
8513
|
}
|
|
8855
8514
|
|
|
8856
|
-
var messages$
|
|
8515
|
+
var messages$v = reactIntl.defineMessages({
|
|
8857
8516
|
placeholder: {
|
|
8858
8517
|
id: 'RecurrentIntervalPicker.placeholder',
|
|
8859
8518
|
description: 'The placeholder of the input',
|
|
@@ -8966,7 +8625,7 @@ const RecurrentIntervalPicker = _ref => {
|
|
|
8966
8625
|
const valueArray = _Array$isArray__default["default"](value) ? value : [value];
|
|
8967
8626
|
const missingOptions = _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](valueArray).call(valueArray, val => !_someInstanceProperty__default["default"](recurrencePolicies).call(recurrencePolicies, policy => policy.id === val))).call(_context, val => ({
|
|
8968
8627
|
value: val,
|
|
8969
|
-
label: formatMessage(messages$
|
|
8628
|
+
label: formatMessage(messages$v.missingOptionLabel, {
|
|
8970
8629
|
value: val
|
|
8971
8630
|
})
|
|
8972
8631
|
}));
|
|
@@ -8986,7 +8645,7 @@ const RecurrentIntervalPicker = _ref => {
|
|
|
8986
8645
|
id: name,
|
|
8987
8646
|
name: name,
|
|
8988
8647
|
value: value,
|
|
8989
|
-
placeholder: messages$
|
|
8648
|
+
placeholder: formatMessage(messages$v.placeholder),
|
|
8990
8649
|
options: options,
|
|
8991
8650
|
isClearable: isClearable,
|
|
8992
8651
|
isReadOnly: isReadOnly,
|
|
@@ -9001,11 +8660,11 @@ const RecurrentIntervalPicker = _ref => {
|
|
|
9001
8660
|
intlMessage: commonPickerMessages.loadingErrorMessage
|
|
9002
8661
|
}) : selectedIsMissingInData ? jsxRuntime.jsx(uiKit.Text.Body, {
|
|
9003
8662
|
tone: "negative",
|
|
9004
|
-
intlMessage: messages$
|
|
8663
|
+
intlMessage: messages$v.missingSelectedWarning
|
|
9005
8664
|
}) : null, !error && noRecurrentIntervalsConfigured && jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
9006
8665
|
type: "info",
|
|
9007
8666
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
9008
|
-
intlMessage: _objectSpread$H(_objectSpread$H({}, messages$
|
|
8667
|
+
intlMessage: _objectSpread$H(_objectSpread$H({}, messages$v.noRecurrentIntervalsConfigured), {}, {
|
|
9009
8668
|
values: {
|
|
9010
8669
|
linkToSettings: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
9011
8670
|
to: `/${projectKey}/settings/project/intervals`,
|
|
@@ -9019,114 +8678,6 @@ const RecurrentIntervalPicker = _ref => {
|
|
|
9019
8678
|
};
|
|
9020
8679
|
var RecurrentIntervalPicker$1 = RecurrentIntervalPicker;
|
|
9021
8680
|
|
|
9022
|
-
// NOTE: this component is duplicated in `app-shell/from-core`.
|
|
9023
|
-
const RequiredIndicator = _ref => {
|
|
9024
|
-
let uncolored = _ref.uncolored;
|
|
9025
|
-
return jsxRuntime.jsx("em", {
|
|
9026
|
-
css: /*#__PURE__*/react$1.css("color:", uncolored ? uiKit.designTokens.colorNeutral90 : uiKit.designTokens.colorWarning, ";font-style:normal;margin-left:2px;" + ("" ), "" ),
|
|
9027
|
-
children: '*'
|
|
9028
|
-
});
|
|
9029
|
-
};
|
|
9030
|
-
RequiredIndicator.displayName = 'RequiredIndicator';
|
|
9031
|
-
var RequiredIndicator$1 = RequiredIndicator;
|
|
9032
|
-
|
|
9033
|
-
const ScrollToFieldError = () => {
|
|
9034
|
-
const formik$1 = formik.useFormikContext();
|
|
9035
|
-
const isValid = formik$1.isValid,
|
|
9036
|
-
submitCount = formik$1.submitCount;
|
|
9037
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
9038
|
-
dataLocale: applicationContext.dataLocale
|
|
9039
|
-
})),
|
|
9040
|
-
dataLocale = _useApplicationContex.dataLocale;
|
|
9041
|
-
React.useEffect(() => {
|
|
9042
|
-
// Do not run the effect if the form hasn't been submitted yet.
|
|
9043
|
-
if (submitCount === 0) return;
|
|
9044
|
-
// Do not run the effect if the form is valid.
|
|
9045
|
-
if (isValid) return;
|
|
9046
|
-
const firstErrorElement = document.querySelector('[aria-invalid="true"]');
|
|
9047
|
-
if (firstErrorElement) {
|
|
9048
|
-
// Get a reference to the label.
|
|
9049
|
-
const firstElementId = firstErrorElement.getAttribute('id');
|
|
9050
|
-
if (firstElementId) {
|
|
9051
|
-
const localizedInputIndex = _indexOfInstanceProperty__default["default"](firstElementId).call(firstElementId, `.${dataLocale}`);
|
|
9052
|
-
|
|
9053
|
-
// check if locale is appended then remove it from id
|
|
9054
|
-
const id = localizedInputIndex > -1 ? firstElementId.replace(`.${dataLocale}`, '') : firstElementId;
|
|
9055
|
-
|
|
9056
|
-
// Scroll to the label (if found), otherwise to the input element itself.
|
|
9057
|
-
|
|
9058
|
-
const elementToScrollTo =
|
|
9059
|
-
// div is used only for custom fields
|
|
9060
|
-
document.querySelector(`div[aria-errormessage="${firstElementId}"]`) ?? document.querySelector(`label[for="${id}"]`) ?? document.querySelector(`label#${id}`) ?? firstErrorElement;
|
|
9061
|
-
elementToScrollTo.scrollIntoView?.({
|
|
9062
|
-
behavior: 'smooth',
|
|
9063
|
-
block: 'center'
|
|
9064
|
-
});
|
|
9065
|
-
}
|
|
9066
|
-
}
|
|
9067
|
-
}, [dataLocale, isValid, submitCount]);
|
|
9068
|
-
return null;
|
|
9069
|
-
};
|
|
9070
|
-
var ScrollToFieldError$1 = ScrollToFieldError;
|
|
9071
|
-
|
|
9072
|
-
var messages$v = reactIntl.defineMessages({
|
|
9073
|
-
buttonLabel: {
|
|
9074
|
-
id: 'SearchInput.buttonLabel',
|
|
9075
|
-
description: 'Label for "Search" button.',
|
|
9076
|
-
defaultMessage: 'Search'
|
|
9077
|
-
},
|
|
9078
|
-
placeholder: {
|
|
9079
|
-
id: 'SearchInput.placeholder',
|
|
9080
|
-
description: 'Placeholder for "Search" input field',
|
|
9081
|
-
defaultMessage: 'Search'
|
|
9082
|
-
}
|
|
9083
|
-
});
|
|
9084
|
-
|
|
9085
|
-
const SelectableFieldSearchInput = props => {
|
|
9086
|
-
const _useState = React.useState(props.initialValue ?? ''),
|
|
9087
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
9088
|
-
searchText = _useState2[0],
|
|
9089
|
-
setSearchText = _useState2[1];
|
|
9090
|
-
const intl = reactIntl.useIntl();
|
|
9091
|
-
return jsxRuntime.jsx("div", {
|
|
9092
|
-
css: /*#__PURE__*/react$1.css("width:100%;position:relative;display:flex;z-index:3;max-width:", uiKit.designTokens.constraint15, ";" + ("" ), "" ),
|
|
9093
|
-
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
9094
|
-
menuHorizontalConstraint: 5,
|
|
9095
|
-
options: props.options,
|
|
9096
|
-
value: {
|
|
9097
|
-
text: searchText,
|
|
9098
|
-
option: props.searchMode
|
|
9099
|
-
},
|
|
9100
|
-
onChange: _ref => {
|
|
9101
|
-
let _ref$target = _ref.target,
|
|
9102
|
-
id = _ref$target.id,
|
|
9103
|
-
value = _ref$target.value;
|
|
9104
|
-
if (_endsWithInstanceProperty__default["default"](id).call(id, 'dropdown')) {
|
|
9105
|
-
props.onChange({
|
|
9106
|
-
option: value,
|
|
9107
|
-
value: searchText
|
|
9108
|
-
});
|
|
9109
|
-
} else {
|
|
9110
|
-
setSearchText(value);
|
|
9111
|
-
}
|
|
9112
|
-
},
|
|
9113
|
-
onSubmit: _ref2 => {
|
|
9114
|
-
let text = _ref2.text,
|
|
9115
|
-
option = _ref2.option;
|
|
9116
|
-
props.onChange({
|
|
9117
|
-
option: option,
|
|
9118
|
-
value: text
|
|
9119
|
-
});
|
|
9120
|
-
},
|
|
9121
|
-
onReset: props.onReset,
|
|
9122
|
-
placeholder: props.placeholder ?? intl.formatMessage(messages$v.placeholder),
|
|
9123
|
-
isDisabled: props.disabled
|
|
9124
|
-
})
|
|
9125
|
-
});
|
|
9126
|
-
};
|
|
9127
|
-
SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
|
|
9128
|
-
var SelectableFieldSearchInput$1 = SelectableFieldSearchInput;
|
|
9129
|
-
|
|
9130
8681
|
var messages$u = reactIntl.defineMessages({
|
|
9131
8682
|
basicSelectInputPlaceholder: {
|
|
9132
8683
|
id: 'Shared.StoreSelectInput.basicSelectInputPlaceholder',
|
|
@@ -9290,7 +8841,7 @@ const StoresAsyncSelectInput = _ref2 => {
|
|
|
9290
8841
|
options: emptyStoreOption(intl)
|
|
9291
8842
|
}];
|
|
9292
8843
|
};
|
|
9293
|
-
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8844
|
+
if (storesListFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
9294
8845
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9295
8846
|
children: [jsxRuntime.jsx(uiKit.AsyncSelectInput, _objectSpread$G(_objectSpread$G(_objectSpread$G({
|
|
9296
8847
|
id: props.id,
|
|
@@ -9395,7 +8946,7 @@ const StoresBasicSelectInput = _ref => {
|
|
|
9395
8946
|
});
|
|
9396
8947
|
}
|
|
9397
8948
|
};
|
|
9398
|
-
if (storesListFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
8949
|
+
if (storesListFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
9399
8950
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9400
8951
|
children: [jsxRuntime.jsx(uiKit.SelectInput, _objectSpread$F(_objectSpread$F(_objectSpread$F({
|
|
9401
8952
|
id: props.id,
|
|
@@ -9613,7 +9164,7 @@ const StoresSearchSelectInput = _ref4 => {
|
|
|
9613
9164
|
})]
|
|
9614
9165
|
});
|
|
9615
9166
|
};
|
|
9616
|
-
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
9167
|
+
if (storesByFieldFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
9617
9168
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9618
9169
|
children: [jsxRuntime.jsx(uiKit.SearchSelectInput, _objectSpread$E(_objectSpread$E({
|
|
9619
9170
|
id: props.id,
|
|
@@ -9699,7 +9250,7 @@ const StoreSelectInput = _ref2 => {
|
|
|
9699
9250
|
}
|
|
9700
9251
|
};
|
|
9701
9252
|
}, [optionType, totalNumberOfStoresFetcher.total, upperStoresLimit]);
|
|
9702
|
-
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner
|
|
9253
|
+
if (totalNumberOfStoresFetcher.isLoading) return jsxRuntime.jsx(merchantCenterSharedUi.CenteredLoadingSpinner, {});
|
|
9703
9254
|
let CustomStoreSelectInput;
|
|
9704
9255
|
// GIVEN total number of available stores <= lowerStoresLimit
|
|
9705
9256
|
// THEN render basic SelectField with all available stores as options
|
|
@@ -14428,13 +13979,15 @@ const getAttributeValueByType = _ref10 => {
|
|
|
14428
13979
|
};
|
|
14429
13980
|
|
|
14430
13981
|
// TODO: rename to isProductLevelAttribute since it returns a boolean
|
|
14431
|
-
const getProductLevelAttributes =
|
|
14432
|
-
return
|
|
13982
|
+
const getProductLevelAttributes = attributeDefinition => {
|
|
13983
|
+
return attributeDefinition?.level === ATTRIBUTE_LEVELS.PRODUCT;
|
|
13984
|
+
};
|
|
13985
|
+
const isVariantLevelAttribute = attributeDefinition => {
|
|
13986
|
+
return attributeDefinition?.level === ATTRIBUTE_LEVELS.VARIANT;
|
|
14433
13987
|
};
|
|
14434
|
-
|
|
14435
13988
|
// TODO: rename to isProductAttribute since it returns a boolean
|
|
14436
|
-
const getProductAttributes =
|
|
14437
|
-
return
|
|
13989
|
+
const getProductAttributes = attributeDefinition => {
|
|
13990
|
+
return attributeDefinition?.attributeConstraint === ATTRIBUTE_CONSTRAINTS.SAME_FOR_ALL || getProductLevelAttributes(attributeDefinition);
|
|
14438
13991
|
};
|
|
14439
13992
|
|
|
14440
13993
|
let RequestCache = /*#__PURE__*/function () {
|
|
@@ -14600,11 +14153,9 @@ var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kin
|
|
|
14600
14153
|
|
|
14601
14154
|
exports.BooleanField = booleanField;
|
|
14602
14155
|
exports.CUSTOM_FIELD_TYPES = CUSTOM_FIELD_TYPES;
|
|
14603
|
-
exports.Carousel = Carousel$1;
|
|
14604
14156
|
exports.CartDiscountReferenceSearch = CartDiscountReferenceSearch;
|
|
14605
14157
|
exports.CategoryReferenceSearch = CategoryReferenceSearch;
|
|
14606
14158
|
exports.CategorySearchPickerOptionFragment = CategorySearchPickerOptionFragment;
|
|
14607
|
-
exports.CenteredLoadingSpinner = CenteredLoadingSpinner$1;
|
|
14608
14159
|
exports.ChannelPickerInput = ChannelPickerInput$1;
|
|
14609
14160
|
exports.CountriesPicker = CountriesPicker;
|
|
14610
14161
|
exports.CustomFieldDefinitionsConnector = customFieldDefinitionsConnector;
|
|
@@ -14616,7 +14167,6 @@ exports.CustomFieldsErrorTextNotification = CustomFieldsErrorTextNotification$1;
|
|
|
14616
14167
|
exports.CustomFieldsFormField = CustomFieldsFormField$1;
|
|
14617
14168
|
exports.CustomerGroupPickerInput = CustomerGroupPickerInput$1;
|
|
14618
14169
|
exports.DefaultPageSizes = DefaultPageSizes;
|
|
14619
|
-
exports.Divider = Divider;
|
|
14620
14170
|
exports.EMAIL_REGEX = EMAIL_REGEX;
|
|
14621
14171
|
exports.FILTER_TYPES = FILTER_TYPES;
|
|
14622
14172
|
exports.FileInput = FileInput$1;
|
|
@@ -14641,9 +14191,6 @@ exports.QUERY_MAX_LIMIT = QUERY_MAX_LIMIT;
|
|
|
14641
14191
|
exports.RESOURCES_WITH_PLATFORM_LIMITS = RESOURCES_WITH_PLATFORM_LIMITS;
|
|
14642
14192
|
exports.RecurrentIntervalPicker = RecurrentIntervalPicker$1;
|
|
14643
14193
|
exports.RequestCache = RequestCache$1;
|
|
14644
|
-
exports.RequiredIndicator = RequiredIndicator$1;
|
|
14645
|
-
exports.ScrollToFieldError = ScrollToFieldError$1;
|
|
14646
|
-
exports.SelectableFieldSearchInput = SelectableFieldSearchInput$1;
|
|
14647
14194
|
exports.StoreSelectField = StoreSelectField$1;
|
|
14648
14195
|
exports.StoreSelectInput = StoreSelectInput$1;
|
|
14649
14196
|
exports.ThrottledField = ThrottledField$1;
|
|
@@ -14746,6 +14293,7 @@ exports.isUUID = isUUID$1;
|
|
|
14746
14293
|
exports.isValidISODate = isValidISODate;
|
|
14747
14294
|
exports.isValidISODateTime = isValidISODateTime;
|
|
14748
14295
|
exports.isValidISOTime = isValidISOTime;
|
|
14296
|
+
exports.isVariantLevelAttribute = isVariantLevelAttribute;
|
|
14749
14297
|
exports.keepDisplayName = keepDisplayName$1;
|
|
14750
14298
|
exports.mapShippingRateTierToGraphQL = mapShippingRateTierToGraphQL;
|
|
14751
14299
|
exports.mapStoresToOptions = mapStoresToOptions;
|
|
@@ -14789,7 +14337,6 @@ exports.useCurrentOption = useCurrentOption;
|
|
|
14789
14337
|
exports.useCustomFieldsDnDContext = useDnDContext;
|
|
14790
14338
|
exports.useCustomerGroupsPlatformLimits = useCustomerGroupsPlatformLimits$1;
|
|
14791
14339
|
exports.useCustomersPlatformLimits = useCustomersPlatformLimits$1;
|
|
14792
|
-
exports.useDbMaintenanceNotification = useDbMaintenanceNotification;
|
|
14793
14340
|
exports.useDebouncedPromiseCallback = useDebouncedPromiseCallback$1;
|
|
14794
14341
|
exports.useFormatCustomField = useFormatCustomField;
|
|
14795
14342
|
exports.useFormatLocalizedFieldToString = useFormatLocalizedFieldToString;
|