@commercetools-frontend/experimental-components 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@ import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
|
16
16
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
17
17
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
18
18
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
19
|
-
import React, { useEffect, useCallback, useState,
|
|
19
|
+
import React, { useEffect, useCallback, useState, useRef, useMemo, PureComponent, Component, memo, createContext, useContext, isValidElement, forwardRef } from 'react';
|
|
20
20
|
import flowRight from 'lodash/flowRight';
|
|
21
21
|
import { graphql as graphql$1, withApollo } from '@apollo/client/react/hoc';
|
|
22
22
|
import flatten from 'lodash/flatten';
|
|
@@ -48,7 +48,6 @@ import PropTypes from 'prop-types';
|
|
|
48
48
|
import { useModalState, CustomFormModalPage, PageContentNarrow, ConfirmationDialog, PageContentFull, InfoDialog } from '@commercetools-frontend/application-components';
|
|
49
49
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
50
50
|
import { useApplicationContext, ApplicationContext, withApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
51
|
-
import { GtmContext, useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/application-shell';
|
|
52
51
|
import { useQuery, useApolloClient } from '@apollo/client/react';
|
|
53
52
|
import _lastIndexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/last-index-of';
|
|
54
53
|
import { graphql } from 'msw';
|
|
@@ -56,11 +55,11 @@ import get from 'lodash/get';
|
|
|
56
55
|
import { useFormikContext, Field, getIn, FastField, Formik } from 'formik';
|
|
57
56
|
import _Date$now from '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
58
57
|
import _setTimeout from '@babel/runtime-corejs3/core-js-stable/set-timeout';
|
|
58
|
+
import { useFeatureToggle, useAdapterStatus } from '@commercetools-frontend/application-shell';
|
|
59
59
|
import debounce from 'debounce-promise';
|
|
60
60
|
import pick from 'lodash/pick';
|
|
61
61
|
import { useQuery as useQuery$1 } from '@apollo/client/react/hooks';
|
|
62
62
|
import moment$1 from 'moment';
|
|
63
|
-
import _startsWithInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
64
63
|
import classnames from 'classnames';
|
|
65
64
|
import 'react-required-if';
|
|
66
65
|
import { withThemeContext, useTheme } from '@commercetools-uikit/design-system';
|
|
@@ -116,8 +115,6 @@ import compact from 'lodash/compact';
|
|
|
116
115
|
import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
117
116
|
import '@babel/runtime-corejs3/helpers/get';
|
|
118
117
|
import _spliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/splice';
|
|
119
|
-
import _URL from '@babel/runtime-corejs3/core-js-stable/url';
|
|
120
|
-
import { matchPath } from 'react-router-dom';
|
|
121
118
|
|
|
122
119
|
const QUERY_MAX_LIMIT = 500;
|
|
123
120
|
const SHOW_TOOLTIP_CHARS_COUNT = 40;
|
|
@@ -129,28 +126,6 @@ const SEARCHABLE_REFERENCES = {
|
|
|
129
126
|
productType: 'product-type',
|
|
130
127
|
state: 'state'
|
|
131
128
|
};
|
|
132
|
-
const trackingEvents$5 = {
|
|
133
|
-
showInfoNotification: {
|
|
134
|
-
category: 'Account-Profile',
|
|
135
|
-
action: 'showMyProfileUpdateNotification',
|
|
136
|
-
label: 'Show My Profile Update Notification'
|
|
137
|
-
},
|
|
138
|
-
clickOnInfoNotification: {
|
|
139
|
-
category: 'Account-Profile',
|
|
140
|
-
action: 'openAccountMyProfilePage',
|
|
141
|
-
label: 'Open My Profile Page'
|
|
142
|
-
},
|
|
143
|
-
clickCloseInfoNotification: {
|
|
144
|
-
category: 'Account-Profile',
|
|
145
|
-
action: 'closeInfoNotification',
|
|
146
|
-
label: 'Close Info Notification'
|
|
147
|
-
},
|
|
148
|
-
updateBusinessRoleOnProfilePage: {
|
|
149
|
-
category: 'Account-Profile',
|
|
150
|
-
action: 'updateMyProfilePage',
|
|
151
|
-
label: 'Update My Profile Page'
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
129
|
const BUSINESS_ROLE_NOTIFICATION = 'businessRoleNotification';
|
|
155
130
|
|
|
156
131
|
// The max API limit for one request
|
|
@@ -2133,8 +2108,6 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2133
2108
|
return WithStorage;
|
|
2134
2109
|
};
|
|
2135
2110
|
|
|
2136
|
-
var useTracking = (() => useContext(GtmContext));
|
|
2137
|
-
|
|
2138
2111
|
/**
|
|
2139
2112
|
* @returns function with the following parameters
|
|
2140
2113
|
* - {LocalizedStrings} localizedStrings - an array of graphql LocalizedString,
|
|
@@ -2444,10 +2417,7 @@ var messages$M = defineMessages({
|
|
|
2444
2417
|
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2445
2418
|
function _objectSpread$1f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2446
2419
|
const LinkToProfile = props => {
|
|
2447
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2448
|
-
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
2449
2420
|
return jsx(Link, {
|
|
2450
|
-
onClick: trackClickOnInfoNotification,
|
|
2451
2421
|
to: "/account/profile",
|
|
2452
2422
|
children: props.children
|
|
2453
2423
|
});
|
|
@@ -2485,45 +2455,8 @@ const NotificationText = () => jsxs(Spacings.Stack, {
|
|
|
2485
2455
|
});
|
|
2486
2456
|
NotificationText.displayName = 'NotificationText';
|
|
2487
2457
|
|
|
2488
|
-
const forwardHandler = (track, handler) => function () {
|
|
2489
|
-
track();
|
|
2490
|
-
handler(...arguments);
|
|
2491
|
-
};
|
|
2492
|
-
const defaultProcessTrackingEvent = trackingEvent => trackingEvent;
|
|
2493
|
-
const useTrackingHandler = function (trackingEvent) {
|
|
2494
|
-
let processTrackingEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultProcessTrackingEvent;
|
|
2495
|
-
const _useTrackingContext = useTracking(),
|
|
2496
|
-
track = _useTrackingContext.track;
|
|
2497
|
-
return useCallback(function () {
|
|
2498
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2499
|
-
args[_key] = arguments[_key];
|
|
2500
|
-
}
|
|
2501
|
-
const _processTrackingEvent = processTrackingEvent(trackingEvent, ...args),
|
|
2502
|
-
action = _processTrackingEvent.action,
|
|
2503
|
-
category = _processTrackingEvent.category,
|
|
2504
|
-
label = _processTrackingEvent.label;
|
|
2505
|
-
track(action, category, label);
|
|
2506
|
-
}, [track, trackingEvent, processTrackingEvent]);
|
|
2507
|
-
};
|
|
2508
|
-
const useTrackingShared = () => {
|
|
2509
|
-
const trackShowInfoNotification = useTrackingHandler(trackingEvents$5.showInfoNotification);
|
|
2510
|
-
const trackClickOnInfoNotification = useTrackingHandler(trackingEvents$5.clickOnInfoNotification);
|
|
2511
|
-
const trackClickCloseInfoNotification = useTrackingHandler(trackingEvents$5.clickCloseInfoNotification);
|
|
2512
|
-
const trackUpdateBusinessRoleOnProfilePage = useTrackingHandler(trackingEvents$5.updateBusinessRoleOnProfilePage);
|
|
2513
|
-
return {
|
|
2514
|
-
trackShowInfoNotification,
|
|
2515
|
-
trackClickOnInfoNotification,
|
|
2516
|
-
trackClickCloseInfoNotification,
|
|
2517
|
-
trackUpdateBusinessRoleOnProfilePage,
|
|
2518
|
-
forwardHandler
|
|
2519
|
-
};
|
|
2520
|
-
};
|
|
2521
|
-
|
|
2522
2458
|
const useRoleNotification = _ref => {
|
|
2523
2459
|
let dismissNotification = _ref.onDismiss;
|
|
2524
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2525
|
-
trackClickCloseInfoNotification = _useTrackingShared.trackClickCloseInfoNotification,
|
|
2526
|
-
forwardHandler = _useTrackingShared.forwardHandler;
|
|
2527
2460
|
const notification = useShowNotification({
|
|
2528
2461
|
domain: DOMAINS.SIDE,
|
|
2529
2462
|
kind: 'info'
|
|
@@ -2534,7 +2467,7 @@ const useRoleNotification = _ref => {
|
|
|
2534
2467
|
notification({
|
|
2535
2468
|
text: jsx(NotificationText, {})
|
|
2536
2469
|
}, {
|
|
2537
|
-
onDismiss: () =>
|
|
2470
|
+
onDismiss: () => dismissNotification()
|
|
2538
2471
|
});
|
|
2539
2472
|
}
|
|
2540
2473
|
};
|
|
@@ -2547,9 +2480,6 @@ const useRoleNotificationEffect = () => {
|
|
|
2547
2480
|
const storageKey = 'roleExpiry';
|
|
2548
2481
|
const userBusinessRole = user.businessRole;
|
|
2549
2482
|
const scopedStorageKey = [user.id, storageKey].join('/');
|
|
2550
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2551
|
-
trackShowInfoNotification = _useTrackingShared.trackShowInfoNotification,
|
|
2552
|
-
forwardHandler = _useTrackingShared.forwardHandler;
|
|
2553
2483
|
const _usePersistedReminder = usePersistedReminder({
|
|
2554
2484
|
storageKey,
|
|
2555
2485
|
reminderInterval: REMINDER_OPTION_3_DAY
|
|
@@ -2562,7 +2492,6 @@ const useRoleNotificationEffect = () => {
|
|
|
2562
2492
|
onDismiss: scheduleReminder
|
|
2563
2493
|
});
|
|
2564
2494
|
const isFirstTimeUser = !hasChosenReminderRef.current;
|
|
2565
|
-
const openBusinessRoleNotification = () => forwardHandler(trackShowInfoNotification(), roleNotification());
|
|
2566
2495
|
useEffect(() => {
|
|
2567
2496
|
/*
|
|
2568
2497
|
If the user does not have a business role,
|
|
@@ -2572,11 +2501,11 @@ const useRoleNotificationEffect = () => {
|
|
|
2572
2501
|
if (isFlopFlipReady) {
|
|
2573
2502
|
// 1. first time user
|
|
2574
2503
|
if (!userBusinessRole && isFirstTimeUser) {
|
|
2575
|
-
|
|
2504
|
+
roleNotification();
|
|
2576
2505
|
}
|
|
2577
2506
|
// 2. returning but not filled business role and has closed notification before
|
|
2578
2507
|
else if (!userBusinessRole && hasReminderExpired) {
|
|
2579
|
-
|
|
2508
|
+
roleNotification();
|
|
2580
2509
|
}
|
|
2581
2510
|
// 3. has filled business role
|
|
2582
2511
|
else if (userBusinessRole) {
|
|
@@ -2983,41 +2912,11 @@ var commonPickerMessages = defineMessages({
|
|
|
2983
2912
|
}
|
|
2984
2913
|
});
|
|
2985
2914
|
|
|
2986
|
-
const trackingEvents$4 = {
|
|
2987
|
-
selectChannelName: {
|
|
2988
|
-
action: 'select',
|
|
2989
|
-
category: 'ReferenceChannel',
|
|
2990
|
-
label: 'name'
|
|
2991
|
-
},
|
|
2992
|
-
selectChannelKey: {
|
|
2993
|
-
action: 'select',
|
|
2994
|
-
category: 'ReferenceChannel',
|
|
2995
|
-
label: 'key'
|
|
2996
|
-
},
|
|
2997
|
-
selectChannelId: {
|
|
2998
|
-
action: 'select',
|
|
2999
|
-
category: 'ReferenceChannel',
|
|
3000
|
-
label: 'id'
|
|
3001
|
-
},
|
|
3002
|
-
selectWithoutTyping: {
|
|
3003
|
-
action: 'select',
|
|
3004
|
-
category: 'ReferenceChannel',
|
|
3005
|
-
label: 'noEntry'
|
|
3006
|
-
}
|
|
3007
|
-
};
|
|
3008
|
-
|
|
3009
2915
|
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3010
2916
|
function _objectSpread$1c(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3011
2917
|
var GetChannelsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channels" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3012
2918
|
var GetChannelQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetChannelQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "channel" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputChannel" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3013
2919
|
var PickerInputChannel = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputChannel" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Channel" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 392, source: { body: "fragment PickerInputChannel on Channel {\n id\n key\n nameAllLocales {\n locale\n value\n }\n}\n\nquery GetChannelsQuery($where: String, $sortByNamePath: String!) {\n channels(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputChannel\n }\n }\n}\n\nquery GetChannelQuery($id: String) {\n channel(id: $id) {\n ...PickerInputChannel\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3014
|
-
const getTrackingEvent$4 = (inputValue, selectedValue) => {
|
|
3015
|
-
const id = selectedValue.value,
|
|
3016
|
-
key = selectedValue.key,
|
|
3017
|
-
name = selectedValue.name;
|
|
3018
|
-
const trackingEvent = !inputValue ? trackingEvents$4.selectWithoutTyping : _startsWithInstanceProperty(name).call(name, inputValue) ? trackingEvents$4.selectChannelName : _startsWithInstanceProperty(key).call(key, inputValue) ? trackingEvents$4.selectChannelKey : id === inputValue ? trackingEvents$4.selectChannelId : void 0;
|
|
3019
|
-
return trackingEvent;
|
|
3020
|
-
};
|
|
3021
2920
|
const ChannelPickerInput = _ref => {
|
|
3022
2921
|
var _currentOption$data$l, _currentOption$data;
|
|
3023
2922
|
let isClearable = _ref.isClearable,
|
|
@@ -3083,7 +2982,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3083
2982
|
onError(error);
|
|
3084
2983
|
}), [loadOptions, convertChannelToOption, onError]);
|
|
3085
2984
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
3086
|
-
const _useHandlers = useHandlers(onChange
|
|
2985
|
+
const _useHandlers = useHandlers(onChange),
|
|
3087
2986
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
3088
2987
|
handleInternalInputChange = _useHandlers2[0],
|
|
3089
2988
|
handleChange = _useHandlers2[1];
|
|
@@ -3466,7 +3365,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3466
3365
|
value: function render() {
|
|
3467
3366
|
return jsx("div", {
|
|
3468
3367
|
className: classnames(this.props.blockClassName, styles$h.block),
|
|
3469
|
-
"data-track-component": "Search",
|
|
3470
3368
|
children: jsxs("div", {
|
|
3471
3369
|
className: classnames(this.props.containerClassName, styles$h.container),
|
|
3472
3370
|
children: [jsx("div", {
|
|
@@ -3483,8 +3381,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3483
3381
|
label: this.props.label,
|
|
3484
3382
|
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$J.placeholder),
|
|
3485
3383
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3486
|
-
"data-track-component": "Text",
|
|
3487
|
-
"data-track-event": "change",
|
|
3488
3384
|
onChange: this.handleInputChange,
|
|
3489
3385
|
onEnter: this.handleEnter,
|
|
3490
3386
|
onBlurValue: this.props.onBlur,
|
|
@@ -3508,8 +3404,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3508
3404
|
}),
|
|
3509
3405
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
3510
3406
|
label: "search-button",
|
|
3511
|
-
"data-track-component": "Button",
|
|
3512
|
-
"data-track-event": "click",
|
|
3513
3407
|
onMouseOver: this.props.handleMouseOver,
|
|
3514
3408
|
onMouseOut: this.props.handleMouseOut,
|
|
3515
3409
|
children: jsx(SearchIcon, {
|
|
@@ -3739,9 +3633,7 @@ Option$2.displayName = 'Option';
|
|
|
3739
3633
|
|
|
3740
3634
|
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3741
3635
|
function _objectSpread$18(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3742
|
-
const useHandlers =
|
|
3743
|
-
const _useTracking = useTracking(),
|
|
3744
|
-
track = _useTracking.track;
|
|
3636
|
+
const useHandlers = onChange => {
|
|
3745
3637
|
const _useState = useState(),
|
|
3746
3638
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3747
3639
|
inputValue = _useState2[0],
|
|
@@ -3751,25 +3643,13 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3751
3643
|
}, []);
|
|
3752
3644
|
const handleChange = useEventCallback(event => {
|
|
3753
3645
|
var _event$target$value;
|
|
3754
|
-
const doTrack = () => {
|
|
3755
|
-
const trackingEvent = getTrackingEvent(inputValue, event.target.value);
|
|
3756
|
-
if (trackingEvent) {
|
|
3757
|
-
const action = trackingEvent.action,
|
|
3758
|
-
category = trackingEvent.category,
|
|
3759
|
-
label = trackingEvent.label;
|
|
3760
|
-
track(action, category, label);
|
|
3761
|
-
}
|
|
3762
|
-
};
|
|
3763
|
-
if (event.target.value) {
|
|
3764
|
-
doTrack();
|
|
3765
|
-
}
|
|
3766
3646
|
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3767
3647
|
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3768
3648
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3769
3649
|
})
|
|
3770
3650
|
});
|
|
3771
3651
|
onChange(eventWithExtractedValue);
|
|
3772
|
-
}, [onChange,
|
|
3652
|
+
}, [onChange, inputValue]);
|
|
3773
3653
|
return [handleInputChange, handleChange];
|
|
3774
3654
|
};
|
|
3775
3655
|
|
|
@@ -3884,30 +3764,11 @@ var messages$H = defineMessages({
|
|
|
3884
3764
|
}
|
|
3885
3765
|
});
|
|
3886
3766
|
|
|
3887
|
-
const trackingEvents$3 = {
|
|
3888
|
-
selectProductTypeName: {
|
|
3889
|
-
action: 'select',
|
|
3890
|
-
category: 'ReferenceProductType',
|
|
3891
|
-
label: 'name'
|
|
3892
|
-
},
|
|
3893
|
-
selectProductTypeId: {
|
|
3894
|
-
action: 'select',
|
|
3895
|
-
category: 'ReferenceProductType',
|
|
3896
|
-
label: 'id'
|
|
3897
|
-
}
|
|
3898
|
-
};
|
|
3899
|
-
|
|
3900
3767
|
var GetProductTypeQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductTypeQuery" }, 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: "productType" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }] } }], loc: { start: 0, end: 212, source: { body: "query GetProductTypesQuery($where: String) {\n productTypes(where: $where) {\n results {\n id\n name\n }\n }\n}\n\nquery GetProductTypeQuery($id: String) {\n productType(id: $id) {\n id\n name\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
3901
3768
|
const DropdownIndicator$1 = () => jsx(SearchIcon, {
|
|
3902
3769
|
color: "primary"
|
|
3903
3770
|
});
|
|
3904
3771
|
DropdownIndicator$1.displayName = 'DropdownIndicator';
|
|
3905
|
-
const getTrackingEvent$3 = (inputValue, selectedValue) => {
|
|
3906
|
-
const id = selectedValue.value,
|
|
3907
|
-
name = selectedValue.label;
|
|
3908
|
-
const trackingEvent = _startsWithInstanceProperty(name).call(name, inputValue) ? trackingEvents$3.selectProductTypeName : id === inputValue ? trackingEvents$3.selectProductTypeId : void 0;
|
|
3909
|
-
return trackingEvent;
|
|
3910
|
-
};
|
|
3911
3772
|
const convertProductTypeToOption = productType => {
|
|
3912
3773
|
if (!productType) return null;
|
|
3913
3774
|
const id = productType.id,
|
|
@@ -3957,7 +3818,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
3957
3818
|
onError(error);
|
|
3958
3819
|
}), [loadProductTypes, onError]);
|
|
3959
3820
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
3960
|
-
const _useHandlers = useHandlers(onChange
|
|
3821
|
+
const _useHandlers = useHandlers(onChange),
|
|
3961
3822
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
3962
3823
|
handleInternalInputChange = _useHandlers2[0],
|
|
3963
3824
|
handleChange = _useHandlers2[1];
|
|
@@ -4018,38 +3879,8 @@ var messages$G = defineMessages({
|
|
|
4018
3879
|
}
|
|
4019
3880
|
});
|
|
4020
3881
|
|
|
4021
|
-
const trackingEvents$2 = {
|
|
4022
|
-
selectStateName: {
|
|
4023
|
-
action: 'select',
|
|
4024
|
-
category: 'ReferenceState',
|
|
4025
|
-
label: 'name'
|
|
4026
|
-
},
|
|
4027
|
-
selectStateKey: {
|
|
4028
|
-
action: 'select',
|
|
4029
|
-
category: 'ReferenceState',
|
|
4030
|
-
label: 'key'
|
|
4031
|
-
},
|
|
4032
|
-
selectStateId: {
|
|
4033
|
-
action: 'select',
|
|
4034
|
-
category: 'ReferenceState',
|
|
4035
|
-
label: 'id'
|
|
4036
|
-
},
|
|
4037
|
-
selectWithoutTyping: {
|
|
4038
|
-
action: 'select',
|
|
4039
|
-
category: 'ReferenceState',
|
|
4040
|
-
label: 'noEntry'
|
|
4041
|
-
}
|
|
4042
|
-
};
|
|
4043
|
-
|
|
4044
3882
|
var GetStatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetStatesQuery" }, 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: "states" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 377, source: { body: "query GetStatesQuery($where: String, $sortByNamePath: String!) {\n states(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetStateQuery($id: String) {\n state(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
4045
3883
|
var GetStateQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetStateQuery" }, 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: "state" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 377, source: { body: "query GetStatesQuery($where: String, $sortByNamePath: String!) {\n states(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nquery GetStateQuery($id: String) {\n state(id: $id) {\n id\n key\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
4046
|
-
const getTrackingEvent$2 = (inputValue, selectedValue) => {
|
|
4047
|
-
const id = selectedValue.value,
|
|
4048
|
-
key = selectedValue.key,
|
|
4049
|
-
name = selectedValue.name;
|
|
4050
|
-
const trackingEvent = !inputValue ? trackingEvents$2.selectWithoutTyping : _startsWithInstanceProperty(name).call(name, inputValue) ? trackingEvents$2.selectStateName : _startsWithInstanceProperty(key).call(key, inputValue) ? trackingEvents$2.selectStateKey : id === inputValue ? trackingEvents$2.selectStateId : void 0;
|
|
4051
|
-
return trackingEvent;
|
|
4052
|
-
};
|
|
4053
3884
|
const StatePickerInput = _ref => {
|
|
4054
3885
|
var _currentOption$data$l, _currentOption$data;
|
|
4055
3886
|
let isClearable = _ref.isClearable,
|
|
@@ -4106,7 +3937,7 @@ const StatePickerInput = _ref => {
|
|
|
4106
3937
|
onError(error);
|
|
4107
3938
|
}), [loadOptions, convertStateToOption, onError]);
|
|
4108
3939
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
4109
|
-
const _useHandlers = useHandlers(onChange
|
|
3940
|
+
const _useHandlers = useHandlers(onChange),
|
|
4110
3941
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
4111
3942
|
handleInternalInputChange = _useHandlers2[0],
|
|
4112
3943
|
handleChange = _useHandlers2[1];
|
|
@@ -6244,37 +6075,12 @@ var messages$D = defineMessages({
|
|
|
6244
6075
|
}
|
|
6245
6076
|
});
|
|
6246
6077
|
|
|
6247
|
-
const trackingEvents$1 = {
|
|
6248
|
-
selectProductName: {
|
|
6249
|
-
action: 'select',
|
|
6250
|
-
category: 'ReferenceProduct',
|
|
6251
|
-
label: 'name'
|
|
6252
|
-
},
|
|
6253
|
-
selectProductKey: {
|
|
6254
|
-
action: 'select',
|
|
6255
|
-
category: 'ReferenceProduct',
|
|
6256
|
-
label: 'key'
|
|
6257
|
-
},
|
|
6258
|
-
selectProductId: {
|
|
6259
|
-
action: 'select',
|
|
6260
|
-
category: 'ReferenceProduct',
|
|
6261
|
-
label: 'id'
|
|
6262
|
-
}
|
|
6263
|
-
};
|
|
6264
|
-
|
|
6265
6078
|
var GetProductQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductQuery" }, 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: "product" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "masterData" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }], loc: { start: 0, end: 440, source: { body: "query GetProductsQuery($where: String) {\n products(where: $where) {\n results {\n id\n key\n masterData {\n current {\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n\nquery GetProductQuery($id: String) {\n product(id: $id) {\n id\n key\n masterData {\n current {\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6266
6079
|
var GetProductsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetProductsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "products" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "masterData" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "current" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 440, source: { body: "query GetProductsQuery($where: String) {\n products(where: $where) {\n results {\n id\n key\n masterData {\n current {\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n }\n}\n\nquery GetProductQuery($id: String) {\n product(id: $id) {\n id\n key\n masterData {\n current {\n nameAllLocales {\n locale\n value\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
6267
6080
|
const DropdownIndicator = () => jsx(SearchIcon, {
|
|
6268
6081
|
color: "primary"
|
|
6269
6082
|
});
|
|
6270
6083
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
6271
|
-
const getTrackingEvent$1 = (inputValue, selectedValue) => {
|
|
6272
|
-
const id = selectedValue.value,
|
|
6273
|
-
key = selectedValue.key,
|
|
6274
|
-
name = selectedValue.name;
|
|
6275
|
-
const trackingEvent = _startsWithInstanceProperty(name).call(name, inputValue) ? trackingEvents$1.selectProductName : _startsWithInstanceProperty(key).call(key, inputValue) ? trackingEvents$1.selectProductKey : id === inputValue ? trackingEvents$1.selectProductId : void 0;
|
|
6276
|
-
return trackingEvent;
|
|
6277
|
-
};
|
|
6278
6084
|
const ProductPickerInput = _ref => {
|
|
6279
6085
|
var _currentOption$data$l, _currentOption$data;
|
|
6280
6086
|
let isClearable = _ref.isClearable,
|
|
@@ -6332,7 +6138,7 @@ const ProductPickerInput = _ref => {
|
|
|
6332
6138
|
onError(error);
|
|
6333
6139
|
}), [loadOptions, onError, convertProductToOption]);
|
|
6334
6140
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
6335
|
-
const _useHandlers = useHandlers(onChange
|
|
6141
|
+
const _useHandlers = useHandlers(onChange),
|
|
6336
6142
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
6337
6143
|
handleInternalInputChange = _useHandlers2[0],
|
|
6338
6144
|
handleChange = _useHandlers2[1];
|
|
@@ -6745,7 +6551,7 @@ function CustomInputSet(props) {
|
|
|
6745
6551
|
touched = _useFormikContext.touched,
|
|
6746
6552
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
6747
6553
|
dirty = _useFormikContext.dirty;
|
|
6748
|
-
const
|
|
6554
|
+
const itemFieldDefinition = _objectSpread$U(_objectSpread$U({}, props.fieldDefinition), {}, {
|
|
6749
6555
|
type: props.fieldDefinition.type.elementType
|
|
6750
6556
|
});
|
|
6751
6557
|
const value = useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -6804,7 +6610,7 @@ function CustomInputSet(props) {
|
|
|
6804
6610
|
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
6805
6611
|
// type is selected.
|
|
6806
6612
|
const type = getType(props.fieldDefinition);
|
|
6807
|
-
const typeName = type.name.toLowerCase();
|
|
6613
|
+
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
6808
6614
|
const areButtonsTopAligned = _includesInstanceProperty(_context2 = [CUSTOM_FIELD_TYPES.lenum, CUSTOM_FIELD_TYPES.localizedenum, CUSTOM_FIELD_TYPES.localizedstring, CUSTOM_FIELD_TYPES.string, CUSTOM_FIELD_TYPES.text, CUSTOM_FIELD_TYPES.ltext, CUSTOM_FIELD_TYPES.reference]).call(_context2, typeName);
|
|
6809
6615
|
return jsxs(Fragment, {
|
|
6810
6616
|
children: [jsx(AccessibleHidden, {
|
|
@@ -6829,7 +6635,7 @@ function CustomInputSet(props) {
|
|
|
6829
6635
|
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
6830
6636
|
children: [jsx(CustomFieldInput, {
|
|
6831
6637
|
name: fieldName,
|
|
6832
|
-
fieldDefinition:
|
|
6638
|
+
fieldDefinition: itemFieldDefinition,
|
|
6833
6639
|
isDisabled: props.isDisabled,
|
|
6834
6640
|
isReadOnly: props.isReadOnly,
|
|
6835
6641
|
onBlur: props.onBlur,
|
|
@@ -6856,7 +6662,6 @@ function CustomInputSet(props) {
|
|
|
6856
6662
|
})]
|
|
6857
6663
|
});
|
|
6858
6664
|
}
|
|
6859
|
-
CustomInputSet.displayName = 'CustomInputSet';
|
|
6860
6665
|
|
|
6861
6666
|
var messages$C = defineMessages({
|
|
6862
6667
|
referencedProductType: {
|
|
@@ -7315,7 +7120,6 @@ function ProductAttributes(props) {
|
|
|
7315
7120
|
inputValuesConverter: convertInputValue
|
|
7316
7121
|
});
|
|
7317
7122
|
}
|
|
7318
|
-
ProductAttributes.displayName = 'ProductAttributes';
|
|
7319
7123
|
|
|
7320
7124
|
const useFieldDefintion = attributeDefinition => useMemo(() => attributeDefinitionToFieldDefinition(attributeDefinition), [attributeDefinition]);
|
|
7321
7125
|
function ProductAttributeInput(props) {
|
|
@@ -7664,30 +7468,23 @@ const nonSetComponents = {
|
|
|
7664
7468
|
[CUSTOM_FIELD_TYPES.date]: CustomDateTimeInput,
|
|
7665
7469
|
[CUSTOM_FIELD_TYPES.nested]: CustomNestedInput
|
|
7666
7470
|
};
|
|
7667
|
-
const getSetComponent = fieldDefinition => {
|
|
7668
|
-
const type = getType(fieldDefinition);
|
|
7669
|
-
const typeName = type.name.toLowerCase();
|
|
7670
|
-
// Boolean is the only set element with picularities (i.e. way more
|
|
7671
|
-
// convenient for user to work with it as with select input with three values:
|
|
7672
|
-
// [true], [false] and [true, false]).
|
|
7673
|
-
if (typeName === CUSTOM_FIELD_TYPES.boolean) return CustomBooleanInputSet;
|
|
7674
|
-
// All the rest sets are just a fancy wrapper around single-item components
|
|
7675
|
-
return CustomInputSet;
|
|
7676
|
-
};
|
|
7677
|
-
const getNonSetComponent = fieldDefinition => {
|
|
7678
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
7679
|
-
return nonSetComponents[typeName];
|
|
7680
|
-
};
|
|
7681
|
-
const isSet = fieldDefinition => {
|
|
7682
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
7683
|
-
return typeName === 'set';
|
|
7684
|
-
};
|
|
7685
|
-
const getInputComponent = fieldDefinition => {
|
|
7686
|
-
if (isSet(fieldDefinition)) return getSetComponent(fieldDefinition);
|
|
7687
|
-
return getNonSetComponent(fieldDefinition);
|
|
7688
|
-
};
|
|
7689
7471
|
const CustomFieldInput = /*#__PURE__*/memo(props => {
|
|
7690
|
-
const InputComponent =
|
|
7472
|
+
const InputComponent = useMemo(() => {
|
|
7473
|
+
var _props$fieldDefinitio;
|
|
7474
|
+
const typeName = (_props$fieldDefinitio = props.fieldDefinition.type) === null || _props$fieldDefinitio === void 0 ? void 0 : _props$fieldDefinitio.name.toLowerCase();
|
|
7475
|
+
if (typeName === 'set') {
|
|
7476
|
+
var _getSetElementType;
|
|
7477
|
+
// Boolean is the only set element with peculiarities (i.e. way more
|
|
7478
|
+
// convenient for user to work with it as with select input with three values:
|
|
7479
|
+
// [true], [false] and [true, false]).
|
|
7480
|
+
if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
|
|
7481
|
+
return CustomBooleanInputSet;
|
|
7482
|
+
}
|
|
7483
|
+
// All the rest sets are just a fancy wrapper around single-item components
|
|
7484
|
+
return CustomInputSet;
|
|
7485
|
+
}
|
|
7486
|
+
return nonSetComponents[typeName];
|
|
7487
|
+
}, [props.fieldDefinition]);
|
|
7691
7488
|
if (!InputComponent) return null;
|
|
7692
7489
|
return jsx(InputComponent, {
|
|
7693
7490
|
name: props.name,
|
|
@@ -8350,43 +8147,9 @@ var messages$y = defineMessages({
|
|
|
8350
8147
|
}
|
|
8351
8148
|
});
|
|
8352
8149
|
|
|
8353
|
-
const trackingEvents = {
|
|
8354
|
-
selectCustomerGroupName: {
|
|
8355
|
-
action: 'select',
|
|
8356
|
-
category: 'ReferenceCustomerGroup',
|
|
8357
|
-
label: 'name'
|
|
8358
|
-
},
|
|
8359
|
-
selectCustomerGroupKey: {
|
|
8360
|
-
action: 'select',
|
|
8361
|
-
category: 'ReferenceCustomerGroup',
|
|
8362
|
-
label: 'key'
|
|
8363
|
-
},
|
|
8364
|
-
selectCustomerGroupId: {
|
|
8365
|
-
action: 'select',
|
|
8366
|
-
category: 'ReferenceCustomerGroup',
|
|
8367
|
-
label: 'id'
|
|
8368
|
-
},
|
|
8369
|
-
selectWithoutTyping: {
|
|
8370
|
-
action: 'select',
|
|
8371
|
-
category: 'ReferenceCustomerGroup',
|
|
8372
|
-
label: 'noEntry'
|
|
8373
|
-
}
|
|
8374
|
-
};
|
|
8375
|
-
|
|
8376
8150
|
var GetCustomerGroupsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupsQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "customerGroups" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "where" }, value: { kind: "Variable", name: { kind: "Name", value: "where" } } }, { kind: "Argument", name: { kind: "Name", value: "sort" }, value: { kind: "ListValue", values: [{ kind: "Variable", name: { kind: "Name", value: "sortByNamePath" } }, { kind: "StringValue", value: "key", block: false }] } }, { kind: "Argument", name: { kind: "Name", value: "limit" }, value: { kind: "IntValue", value: "60" } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "total" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "results" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputCustomerGroups" }, directives: [] }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8377
8151
|
var GetCustomerGroupQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetCustomerGroupQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "customerGroup" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "id" }, value: { kind: "Variable", name: { kind: "Name", value: "id" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PickerInputCustomerGroups" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8378
8152
|
var PickerInputCustomerGroups = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "PickerInputCustomerGroups" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomerGroup" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 406, source: { body: "fragment PickerInputCustomerGroups on CustomerGroup {\n id\n key\n name\n}\n\nquery GetCustomerGroupsQuery($where: String, $sortByNamePath: String!) {\n customerGroups(where: $where, sort: [$sortByNamePath, \"key\"], limit: 60) {\n total\n results {\n ...PickerInputCustomerGroups\n }\n }\n}\n\nquery GetCustomerGroupQuery($id: String) {\n customerGroup(id: $id) {\n ...PickerInputCustomerGroups\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
8379
|
-
const getTrackingEvent = (inputValue, selectedValue) => {
|
|
8380
|
-
const id = selectedValue.value,
|
|
8381
|
-
key = selectedValue.key,
|
|
8382
|
-
name = selectedValue.name;
|
|
8383
|
-
const selectWithoutTyping = trackingEvents.selectWithoutTyping,
|
|
8384
|
-
selectCustomerGroupId = trackingEvents.selectCustomerGroupId,
|
|
8385
|
-
selectCustomerGroupKey = trackingEvents.selectCustomerGroupKey,
|
|
8386
|
-
selectCustomerGroupName = trackingEvents.selectCustomerGroupName;
|
|
8387
|
-
const trackingEvent = !inputValue ? selectWithoutTyping : _startsWithInstanceProperty(name).call(name, inputValue) ? selectCustomerGroupName : _startsWithInstanceProperty(key).call(key, inputValue) ? selectCustomerGroupKey : id === inputValue ? selectCustomerGroupId : void 0;
|
|
8388
|
-
return trackingEvent;
|
|
8389
|
-
};
|
|
8390
8153
|
const CustomerGroupPickerInput = _ref => {
|
|
8391
8154
|
var _currentOption$data$l, _currentOption$data;
|
|
8392
8155
|
let isClearable = _ref.isClearable,
|
|
@@ -8449,7 +8212,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8449
8212
|
onError(error);
|
|
8450
8213
|
}), [loadOptions, convertCustomerGroupToOption, onError]);
|
|
8451
8214
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
8452
|
-
const _useHandlers = useHandlers(onChange
|
|
8215
|
+
const _useHandlers = useHandlers(onChange),
|
|
8453
8216
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
8454
8217
|
handleInternalInputChange = _useHandlers2[0],
|
|
8455
8218
|
handleChange = _useHandlers2[1];
|
|
@@ -10092,7 +9855,7 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
10092
9855
|
};
|
|
10093
9856
|
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
10094
9857
|
|
|
10095
|
-
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, 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: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "inheritedAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end:
|
|
9858
|
+
var BusinessUnitAssociatesQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "BusinessUnitAssociatesQuery" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "Boolean" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "businessUnit" }, 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: "BusinessUnitAssociatesFragment" }, directives: [] }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "BusinessUnitAssociatesFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BusinessUnit" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "associates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "roles" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeRoles" } } }] }] }, { kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "inheritance" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "inheritedAssociates" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRoleAssignments" }, arguments: [], directives: [{ kind: "Directive", name: { kind: "Name", value: "skip" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "if" }, value: { kind: "Variable", name: { kind: "Name", value: "shouldExcludeAssociateRoleAssignmentsRoles" } } }] }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "associateRole" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "customer" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "email" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "firstName" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastName" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "__typename" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 849, source: { body: "fragment BusinessUnitAssociatesFragment on BusinessUnit {\n id\n associates {\n roles @skip(if: $shouldExcludeRoles)\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n inheritance\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n inheritedAssociates {\n associateRoleAssignments\n @skip(if: $shouldExcludeAssociateRoleAssignmentsRoles) {\n associateRole {\n name\n key\n }\n }\n customer {\n id\n email\n firstName\n lastName\n }\n }\n __typename\n}\n\nquery BusinessUnitAssociatesQuery(\n $id: String!\n $shouldExcludeRoles: Boolean!\n $shouldExcludeAssociateRoleAssignmentsRoles: Boolean!\n) {\n businessUnit(id: $id) {\n ...BusinessUnitAssociatesFragment\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
10096
9859
|
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
10097
9860
|
let id = _ref.id,
|
|
10098
9861
|
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
@@ -12370,9 +12133,6 @@ var messages$7 = defineMessages({
|
|
|
12370
12133
|
function ownKeys$f(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12371
12134
|
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12372
12135
|
const MissingValueField = props => jsx(CheckboxInput, {
|
|
12373
|
-
"data-track-component": "MissingValue",
|
|
12374
|
-
"data-track-event": "change",
|
|
12375
|
-
"data-track-label": props.isChecked,
|
|
12376
12136
|
name: "missing-value",
|
|
12377
12137
|
isChecked: props.isChecked,
|
|
12378
12138
|
onChange: props.onChange,
|
|
@@ -14247,30 +14007,6 @@ const getTimeZoneLabel = memoize((selectedTimeZone, timeZones) => {
|
|
|
14247
14007
|
return _concatInstanceProperty(_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
14248
14008
|
});
|
|
14249
14009
|
|
|
14250
|
-
function findButtonLinkPathname(element) {
|
|
14251
|
-
if (element.tagName === 'A') {
|
|
14252
|
-
var _context;
|
|
14253
|
-
const linkUrl = new _URL(element.href);
|
|
14254
|
-
return _concatInstanceProperty(_context = "".concat(linkUrl.pathname)).call(_context, linkUrl.search);
|
|
14255
|
-
}
|
|
14256
|
-
return findButtonLinkPathname(element.parentElement);
|
|
14257
|
-
}
|
|
14258
|
-
function trackMenuClick(_ref) {
|
|
14259
|
-
let event = _ref.event,
|
|
14260
|
-
track = _ref.track,
|
|
14261
|
-
pathToMatch = _ref.pathToMatch,
|
|
14262
|
-
trackingEvent = _ref.trackingEvent;
|
|
14263
|
-
const buttonLinkPathname = findButtonLinkPathname(event.target);
|
|
14264
|
-
const shouldTrackEvent = !!matchPath(buttonLinkPathname, {
|
|
14265
|
-
path: pathToMatch,
|
|
14266
|
-
exact: true,
|
|
14267
|
-
strict: true
|
|
14268
|
-
});
|
|
14269
|
-
if (shouldTrackEvent) {
|
|
14270
|
-
track(trackingEvent.action, trackingEvent.category, trackingEvent.label);
|
|
14271
|
-
}
|
|
14272
|
-
}
|
|
14273
|
-
|
|
14274
14010
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14275
14011
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14276
14012
|
function withPendingRequests() {
|
|
@@ -14290,4 +14026,4 @@ function withPendingRequests() {
|
|
|
14290
14026
|
|
|
14291
14027
|
var CategorySearchPickerOptionFragment = { kind: "Document", definitions: [{ kind: "FragmentDefinition", name: { kind: "Name", value: "CategorySearchPickerOptionFragment" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CategorySearch" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "externalId" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "slugAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "parent" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }, { kind: "Field", name: { kind: "Name", value: "ancestors" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "nameAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 685, source: { body: "query SearchCategoryReference($locale: Locale!, $text: String!) {\n categories: categoryAutocomplete(locale: $locale, text: $text) {\n results {\n ...CategorySearchPickerOptionFragment\n }\n }\n}\n\nquery FetchCategoriesByIds($where: String!) {\n categories(where: $where) {\n results {\n id\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n\nfragment CategorySearchPickerOptionFragment on CategorySearch {\n id\n externalId\n nameAllLocales {\n locale\n value\n }\n slugAllLocales {\n locale\n value\n }\n parent {\n nameAllLocales {\n locale\n value\n }\n }\n ancestors {\n nameAllLocales {\n locale\n value\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
14292
14028
|
|
|
14293
|
-
export { booleanField as BooleanField, BusinessUnitAssociatesList, BusinessUnitAssociatesListView, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$v as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$4 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$5 as productSelectionsFetcherMockHandler, handlers$6 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$J as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$7 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems,
|
|
14029
|
+
export { booleanField as BooleanField, BusinessUnitAssociatesList, BusinessUnitAssociatesListView, BusinessUnitSelectField, BusinessUnitSelectInput, Button, ButtonCancel, ButtonConfirm, ButtonSave, CartDiscountReferenceSearch, CategoryReferenceSearch, CategorySearchPickerOptionFragment, CenteredLoadingSpinner, ChannelPickerInput, CountriesPicker, customFieldDefinitionsConnector as CustomFieldDefinitionsConnector, customFieldTypeDefinitionsConnector as CustomFieldTypeDefinitionsConnector, CustomFields, CustomFieldsErrorTextNotification, CustomerGroupPickerInput, DefaultPageSizes, Divider, EMAIL_REGEX, FileInput, FormattedDateTime$1 as FormattedDateTime, LabelRange, MissingValueField, MultiValueSearchInput, numericFormatInput as NumericFormatInput, PRECISION_TYPES, pimIndexerProvider as PimIndexerProvider, ProductAttributeInput, ProductAttributes, ProductPickerInput, ProductSelectionsPicker as ProductSelectionPicker, RequestCache, RequiredIndicator, ScrollToFieldError, searchInput as SearchInput, SelectableFieldSearchInput, StoreSelectField, StoreSelectInput, ThrottledField, VALIDATOR_INTEGER, VALIDATOR_NUMERIC, VALIDATOR_REQUIRED, WithPimIndexer, allowedProperties, and, attributesMapToNameValuePairs, base64ToString, messages$8 as booleanMessages, buildSearchQuery, messages$v as businessRoleMessages, businessRoleKeys as businessRoles, capitalizeFirst, clone, coerceToInteger, computedProperties, convertApolloNetworkStatusToLoadingState, convertApolloQueryDataToConnectorData, convertProductSelectionFromGraphQl, convertRatioToPercentage, createGraphQlUpdateActions, createNextSortDefinition, createReducer, createResourceReducer, handlers$4 as customFieldDefinitionsMockHanders, customFields as customFieldsTransformer, dateTransformer$1 as dateTransformer, exact, exists, extractErrorFromGraphQlResponse, filterCustomTypeUpdateActionValues, filterDataAttributes, filterEmptyValues, formatCustomField, formatCustomerAddress, formatCustomerName, formatDateRangeValue, formatDateTime$1 as formatDateTime, formatDiscount, formatMoney$1 as formatMoney, formatMoneyRangeValue, formatMoneyValue, formatPercentage, formatAttribute as formatProductAttribute, getAncestors, getAttributeValueByType, getAttributeValueType, getBulkNotification, getCategoryLevel, getCountsFromBulkSummary, getDiscountValue, getDisplayName, getFractionedAmount, getIndexesOfInvalidValues, getMinimumPricesByCurrencyCode, getNetUnitPrice, getPathName, getPrefixSearchBounds, getPriceChannelName, getReferenceTypeId, getSelectedPrice, getTimeZoneId, getTimeZoneLabel, getTypeNameOfType, graphqlCategoryLevelTransformer, dateTransformer as graphqlDateTransformer, missingLocaleTransformer as graphqlMissingLocaleTransformer, missingTransformer as graphqlMissingTransformer, numberTransformer as graphqlNumberTransformer, graphqlQueryBuilder, referenceTransformer as graphqlReferenceTransformer, textTransformer as graphqlTextTransformer, hasInvalidInputError, hasSemanticError, injectCustomerGroupsPlatformLimits, injectCustomersPlatformLimits, injectDataTablePaginationState, injectModalState$1 as injectModalState, injectNotifications, injectPimIndexer, injectShippingMethodsPlatformLimits, injectStorage, injectTaxCategoriesPlatformLimits, injectModalState as injectToggleState, injectZonesPlatformLimits, isEmptyFilter as isEmpty, isEmptyValue, isUUID, isValidISODate, isValidISODateTime, isValidISOTime, keepDisplayName, mapTimeZonesToOptions, minusify, messages$7 as missingValueMessages, nameValuePairsToMap, normalizeProductSettings, not, omitDeep, omitSetsOfSets, or, commonPickerMessages as pickerMessages, handlers as platformLimitsMockHandlers, handlers$5 as productSelectionsFetcherMockHandler, handlers$6 as productSelectionsTotalFetcherMockHandler, range, reorderArrayItems, resolveStatusType, safelyAddFallback, sanitize, searchCategories, messages$J as searchInputMessages, setDisplayName, setToArray, shallowEqual, shouldUpdateAttributeInput, slugify, sortDataByIdsArray, sortRequiresLanguage, splitVariantAttributesByConstraint, handlers$7 as storesListConnectorMockHandlers, stringToBase64, swapArrayItems, transformAllToProperNounCase, transformCustomFieldsRawToCustomFields, transformLocalizedFieldsForCategory, truncate, unique, uniqueObjects, handlers$2 as useBusinessUnitsListFetcherMockHandler, useCachedCategoryOptions, useCustomerGroupsPlatformLimits, useCustomersPlatformLimits, useDebouncedPromiseCallback, useFormatLocalizedFieldToString, useLocalizedKeyFallback, usePendingRequests, usePersistedTableConfiguration, usePimIndexer, usePrevious, useProductSelectionsFetcher, useProductSelectionsTotalFetcher, useRoleNotificationEffect, useShippingMethodsLimits as useShippingMethodsPlatformLimits, useStorage, useStoreKeysInDataFences, useStoresListFetcher, useTaxCategoriesLimits as useTaxCategoriesPlatformLimits, handlers$1 as useTotalNumberOfBusinessUnitsFetcherHandlers, useTotalNumberOfStoresFetcher, handlers$3 as useTotalNumberOfStoresFetcherHandlers, validateFilter$2 as validateCustomField, validations as validateCustomFields, validateFilter$1 as validateDate, validateMultiOptionEnum, validateFilter as validateNumber, validateSingleOptionEnum, validateText, validatedInput, messages$O as validationMessages, withPendingRequests, withProps, withRedirectTo, withoutEmptyErrorsByField, wrapDisplayName };
|