@commercetools-frontend/experimental-components 3.2.1 → 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,
|
|
@@ -2191,7 +2164,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2191
2164
|
})
|
|
2192
2165
|
};
|
|
2193
2166
|
};
|
|
2194
|
-
const createQueryVariables$
|
|
2167
|
+
const createQueryVariables$9 = ownProps => {
|
|
2195
2168
|
var _context;
|
|
2196
2169
|
return _objectSpread$1h(_objectSpread$1h({
|
|
2197
2170
|
limit: ownProps.limit,
|
|
@@ -2207,7 +2180,7 @@ const createQueryVariables$8 = ownProps => {
|
|
|
2207
2180
|
const useStoresListFetcher = props => {
|
|
2208
2181
|
const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
|
|
2209
2182
|
const excludeProductSelections = props.excludeProductSelections || false;
|
|
2210
|
-
const queryVariables = createQueryVariables$
|
|
2183
|
+
const queryVariables = createQueryVariables$9({
|
|
2211
2184
|
limit: props.limit,
|
|
2212
2185
|
offset: props.offset,
|
|
2213
2186
|
sort: _sortInstanceProperty(props),
|
|
@@ -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) {
|
|
@@ -2814,8 +2743,8 @@ const convertProductSelectionsFromGraphQl = productSelections => {
|
|
|
2814
2743
|
});
|
|
2815
2744
|
};
|
|
2816
2745
|
|
|
2817
|
-
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, 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: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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" } } }], 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: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end:
|
|
2818
|
-
const createQueryVariables$
|
|
2746
|
+
var FetchProductSelections = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProductSelections" }, 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: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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" } } }], 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: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "version" }, 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: "createdAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "lastModifiedAt" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }], loc: { start: 0, end: 341, source: { body: "query FetchProductSelections($limit: Int, $offset: Int, $sort: [String!]) {\n productSelections(limit: $limit, offset: $offset, sort: $sort) {\n total\n count\n offset\n results {\n id\n version\n key\n nameAllLocales {\n locale\n value\n }\n createdAt\n lastModifiedAt\n type\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
2747
|
+
const createQueryVariables$8 = ownProps => ({
|
|
2819
2748
|
limit: ownProps.limit,
|
|
2820
2749
|
offset: ownProps.offset,
|
|
2821
2750
|
sort: _sortInstanceProperty(ownProps)
|
|
@@ -2827,7 +2756,7 @@ const emptyProductSelections = {
|
|
|
2827
2756
|
results: []
|
|
2828
2757
|
};
|
|
2829
2758
|
const useProductSelectionsFetcher = props => {
|
|
2830
|
-
const queryVariables = createQueryVariables$
|
|
2759
|
+
const queryVariables = createQueryVariables$8(props);
|
|
2831
2760
|
const _useQuery = useQuery$1(FetchProductSelections, {
|
|
2832
2761
|
context: {
|
|
2833
2762
|
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
@@ -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,
|
|
@@ -7846,6 +7643,11 @@ var pickerMessages = defineMessages({
|
|
|
7846
7643
|
id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
|
|
7847
7644
|
description: 'Placeholder of the search select field for product selections',
|
|
7848
7645
|
defaultMessage: 'Search for product selections by entering exact key'
|
|
7646
|
+
},
|
|
7647
|
+
asyncSelectDropdownTypeAheadPrompt: {
|
|
7648
|
+
id: 'ProductSelectionPicker.asyncSelectDropdownTypeAheadPrompt',
|
|
7649
|
+
description: 'Message shown telling the user to start typing to load more product selections',
|
|
7650
|
+
defaultMessage: 'Start typing above to load more'
|
|
7849
7651
|
}
|
|
7850
7652
|
});
|
|
7851
7653
|
|
|
@@ -7878,6 +7680,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7878
7680
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7879
7681
|
if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7880
7682
|
const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7683
|
+
const filteredProductSelections = _filterInstanceProperty(productSelections).call(productSelections, ps => {
|
|
7684
|
+
var _context;
|
|
7685
|
+
return !_includesInstanceProperty(_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7686
|
+
});
|
|
7881
7687
|
const onOptionClick = event => {
|
|
7882
7688
|
const productSelectionId = event.target.value;
|
|
7883
7689
|
const currentProductSelection = _findInstanceProperty(productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
|
|
@@ -7892,12 +7698,18 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7892
7698
|
isRequired: props.isRequired,
|
|
7893
7699
|
description: props.description,
|
|
7894
7700
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
|
|
7895
|
-
options: mapProductSelectionsToOptions$1(
|
|
7701
|
+
options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
|
|
7896
7702
|
components: props.components,
|
|
7897
7703
|
onChange: onOptionClick,
|
|
7704
|
+
onBlur: props.onBlur,
|
|
7898
7705
|
isDisabled: props.isDisabled,
|
|
7899
7706
|
isReadOnly: props.isReadOnly,
|
|
7900
7707
|
hasWarning: props.hasWarning,
|
|
7708
|
+
hasError: props.hasError,
|
|
7709
|
+
isClearable: props.isClearable,
|
|
7710
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7711
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7712
|
+
maxMenuHeight: props.maxMenuHeight,
|
|
7901
7713
|
isSearchable: true
|
|
7902
7714
|
});
|
|
7903
7715
|
}
|
|
@@ -7905,6 +7717,28 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7905
7717
|
const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
|
|
7906
7718
|
const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
|
|
7907
7719
|
|
|
7720
|
+
const getValueFromOptions$3 = _ref => {
|
|
7721
|
+
let currentlySelectedProductSelections = _ref.currentlySelectedProductSelections,
|
|
7722
|
+
allProductSelectionOptions = _ref.allProductSelectionOptions,
|
|
7723
|
+
isMulti = _ref.isMulti;
|
|
7724
|
+
// return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
|
|
7725
|
+
if (!currentlySelectedProductSelections) {
|
|
7726
|
+
return undefined;
|
|
7727
|
+
}
|
|
7728
|
+
|
|
7729
|
+
// handle async-select-field value transformation
|
|
7730
|
+
if (isMulti) {
|
|
7731
|
+
return _filterInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty(currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value));
|
|
7732
|
+
}
|
|
7733
|
+
|
|
7734
|
+
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
7735
|
+
return _findInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value);
|
|
7736
|
+
};
|
|
7737
|
+
const emptyStoreOption$1 = intl => [{
|
|
7738
|
+
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
7739
|
+
value: undefined,
|
|
7740
|
+
isDisabled: true
|
|
7741
|
+
}];
|
|
7908
7742
|
function ProductSelectionsAsyncSelectDropdown(props) {
|
|
7909
7743
|
var _productSelectionsFet3;
|
|
7910
7744
|
const intl = useIntl();
|
|
@@ -7922,6 +7756,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7922
7756
|
var _productSelectionsFet, _productSelectionsFet2;
|
|
7923
7757
|
return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7924
7758
|
}, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
|
|
7759
|
+
const filteredProductSelections = _filterInstanceProperty(productSelections).call(productSelections, ps => {
|
|
7760
|
+
var _context;
|
|
7761
|
+
return !_includesInstanceProperty(_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7762
|
+
});
|
|
7925
7763
|
const onOptionClick = event => {
|
|
7926
7764
|
var _event$target$value;
|
|
7927
7765
|
const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
|
|
@@ -7929,7 +7767,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7929
7767
|
props.onChange(currentProductSelection);
|
|
7930
7768
|
};
|
|
7931
7769
|
const allProductSelectionOptions = useMemo(() => {
|
|
7932
|
-
return _mapInstanceProperty(
|
|
7770
|
+
return _mapInstanceProperty(filteredProductSelections).call(filteredProductSelections, productSelection => {
|
|
7933
7771
|
const localizedName = formatLocalizedString(productSelection, {
|
|
7934
7772
|
key: 'name',
|
|
7935
7773
|
locale: dataLocale,
|
|
@@ -7942,17 +7780,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7942
7780
|
key: productSelection.key
|
|
7943
7781
|
};
|
|
7944
7782
|
});
|
|
7945
|
-
}, [dataLocale, projectLanguages,
|
|
7783
|
+
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
7946
7784
|
const getDefaultOptions = () => {
|
|
7947
|
-
return
|
|
7785
|
+
return [{
|
|
7786
|
+
options: _sliceInstanceProperty(allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
|
|
7787
|
+
}, {
|
|
7788
|
+
options: emptyStoreOption$1(intl)
|
|
7789
|
+
}];
|
|
7948
7790
|
};
|
|
7949
7791
|
const handleLoadOptions = async searchTerm => {
|
|
7950
7792
|
const productSelectionOptions = allProductSelectionOptions;
|
|
7951
7793
|
const filteredOptions = _filterInstanceProperty(productSelectionOptions).call(productSelectionOptions, productSelection => {
|
|
7952
|
-
var
|
|
7953
|
-
return _includesInstanceProperty(
|
|
7794
|
+
var _context2, _context3;
|
|
7795
|
+
return _includesInstanceProperty(_context2 = productSelection.label.toLowerCase()).call(_context2, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty(_context3 = productSelection.key.toLowerCase()).call(_context3, searchTerm.toLowerCase());
|
|
7954
7796
|
});
|
|
7955
|
-
|
|
7797
|
+
const finalOptions = searchTerm ? _sliceInstanceProperty(filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty(productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
|
|
7798
|
+
return [{
|
|
7799
|
+
options: finalOptions
|
|
7800
|
+
}, {
|
|
7801
|
+
options: emptyStoreOption$1(intl)
|
|
7802
|
+
}];
|
|
7956
7803
|
};
|
|
7957
7804
|
if (productSelectionsFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
7958
7805
|
return jsx(AsyncSelectField, {
|
|
@@ -7963,22 +7810,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
7963
7810
|
isRequired: props.isRequired,
|
|
7964
7811
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
|
|
7965
7812
|
loadOptions: handleLoadOptions,
|
|
7813
|
+
value: getValueFromOptions$3({
|
|
7814
|
+
currentlySelectedProductSelections: props.value,
|
|
7815
|
+
allProductSelectionOptions,
|
|
7816
|
+
isMulti: props.isMulti
|
|
7817
|
+
}),
|
|
7966
7818
|
onChange: onOptionClick,
|
|
7819
|
+
onBlur: props.onBlur,
|
|
7967
7820
|
isDisabled: props.isDisabled,
|
|
7821
|
+
showOptionGroupDivider: true,
|
|
7968
7822
|
isReadOnly: props.isReadOnly,
|
|
7969
7823
|
components: props.components,
|
|
7970
7824
|
defaultOptions: getDefaultOptions(),
|
|
7971
|
-
hasWarning: props.hasWarning
|
|
7825
|
+
hasWarning: props.hasWarning,
|
|
7826
|
+
hasError: props.hasError,
|
|
7827
|
+
isClearable: props.isClearable,
|
|
7828
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7829
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7830
|
+
maxMenuHeight: props.maxMenuHeight
|
|
7972
7831
|
});
|
|
7973
7832
|
}
|
|
7974
7833
|
|
|
7834
|
+
var ProductSelectionsPickerFetcher$1 = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: "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: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7835
|
+
const createQueryVariables$7 = (productSelections, predicateField) => {
|
|
7836
|
+
var _context;
|
|
7837
|
+
return {
|
|
7838
|
+
where: _concatInstanceProperty(_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty(productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
|
|
7839
|
+
limit: 500
|
|
7840
|
+
};
|
|
7841
|
+
};
|
|
7842
|
+
const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
|
|
7843
|
+
var _productSelectionsQue, _productSelectionsQue2;
|
|
7844
|
+
const productSelectionList = _Array$isArray(productSelections) ? productSelections : [productSelections];
|
|
7845
|
+
const productSelectionsQuery = useQuery(ProductSelectionsPickerFetcher$1, {
|
|
7846
|
+
context: {
|
|
7847
|
+
target: GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
7848
|
+
},
|
|
7849
|
+
variables: createQueryVariables$7(productSelectionList, predicateField),
|
|
7850
|
+
skip: productSelectionList.length === 0
|
|
7851
|
+
});
|
|
7852
|
+
return {
|
|
7853
|
+
productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
|
|
7854
|
+
isLoading: productSelectionsQuery.loading
|
|
7855
|
+
};
|
|
7856
|
+
};
|
|
7857
|
+
|
|
7975
7858
|
var ProductSelectionsPickerFetcher = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "ProductSelectionsPickerFetcher" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "where" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "productSelections" }, 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: "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: [] }] } }] } }] } }] } }], loc: { start: 0, end: 212, source: { body: "query ProductSelectionsPickerFetcher($where: String!) {\n productSelections(where: $where) {\n results {\n id\n key\n version\n nameAllLocales {\n locale\n value\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
7976
|
-
const mapProductSelectionsToOptions = memoize(
|
|
7977
|
-
let
|
|
7978
|
-
|
|
7979
|
-
|
|
7859
|
+
const mapProductSelectionsToOptions = memoize(_ref => {
|
|
7860
|
+
let _ref$productSelection = _ref.productSelections,
|
|
7861
|
+
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
7862
|
+
dataLocale = _ref.dataLocale,
|
|
7863
|
+
projectLanguages = _ref.projectLanguages,
|
|
7864
|
+
renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField;
|
|
7980
7865
|
return _mapInstanceProperty(productSelections).call(productSelections, productSelection => ({
|
|
7981
|
-
value: productSelection.id,
|
|
7866
|
+
value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
|
|
7982
7867
|
label: formatLocalizedString(productSelection, {
|
|
7983
7868
|
key: 'name',
|
|
7984
7869
|
locale: dataLocale,
|
|
@@ -7987,9 +7872,22 @@ const mapProductSelectionsToOptions = memoize(function () {
|
|
|
7987
7872
|
key: productSelection.key
|
|
7988
7873
|
}));
|
|
7989
7874
|
});
|
|
7990
|
-
const
|
|
7875
|
+
const getValueFromOptions$2 = _ref2 => {
|
|
7876
|
+
let isMulti = _ref2.isMulti,
|
|
7877
|
+
currentlySelectedProductSelections = _ref2.currentlySelectedProductSelections,
|
|
7878
|
+
productSelectionFieldOptions = _ref2.productSelectionFieldOptions;
|
|
7879
|
+
if (!currentlySelectedProductSelections) {
|
|
7880
|
+
return undefined;
|
|
7881
|
+
}
|
|
7882
|
+
if (isMulti) {
|
|
7883
|
+
return productSelectionFieldOptions;
|
|
7884
|
+
}
|
|
7885
|
+
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
7886
|
+
return productSelectionFieldOptions[0];
|
|
7887
|
+
};
|
|
7888
|
+
const createQueryVariables$6 = _ref3 => {
|
|
7991
7889
|
var _context;
|
|
7992
|
-
let searchText =
|
|
7890
|
+
let searchText = _ref3.searchText;
|
|
7993
7891
|
const sanitizedSearchText = sanitize(_trimInstanceProperty(searchText).call(searchText, searchText));
|
|
7994
7892
|
const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
|
|
7995
7893
|
const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
|
|
@@ -7999,6 +7897,7 @@ const createQueryVariables$6 = _ref => {
|
|
|
7999
7897
|
};
|
|
8000
7898
|
};
|
|
8001
7899
|
function ProductSelectionsSearchSelectDropdown(props) {
|
|
7900
|
+
var _context3;
|
|
8002
7901
|
const intl = useIntl();
|
|
8003
7902
|
const _useState = useState([]),
|
|
8004
7903
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -8011,6 +7910,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8011
7910
|
})),
|
|
8012
7911
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8013
7912
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7913
|
+
const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
|
|
8014
7914
|
const handleLoadOptions = async searchText => {
|
|
8015
7915
|
var _data$productSelectio, _data$productSelectio2;
|
|
8016
7916
|
const _await$client$query = await client.query({
|
|
@@ -8026,8 +7926,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8026
7926
|
data = _await$client$query.data;
|
|
8027
7927
|
const matchedProductSelections = (_data$productSelectio = data === null || data === void 0 ? void 0 : (_data$productSelectio2 = data.productSelections) === null || _data$productSelectio2 === void 0 ? void 0 : _data$productSelectio2.results) !== null && _data$productSelectio !== void 0 ? _data$productSelectio : [];
|
|
8028
7928
|
const updatedProductSelections = _mapInstanceProperty(matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
8029
|
-
|
|
8030
|
-
|
|
7929
|
+
const filteredProductSelections = _filterInstanceProperty(updatedProductSelections).call(updatedProductSelections, ps => {
|
|
7930
|
+
var _context2;
|
|
7931
|
+
return !_includesInstanceProperty(_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
|
|
7932
|
+
});
|
|
7933
|
+
setProductSelectionResults(filteredProductSelections);
|
|
7934
|
+
return mapProductSelectionsToOptions({
|
|
7935
|
+
productSelections: filteredProductSelections,
|
|
7936
|
+
dataLocale,
|
|
7937
|
+
projectLanguages,
|
|
7938
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
7939
|
+
});
|
|
8031
7940
|
};
|
|
8032
7941
|
const loadOptionsDebounced = debounce(handleLoadOptions, 500);
|
|
8033
7942
|
const onOptionClick = event => {
|
|
@@ -8036,33 +7945,56 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8036
7945
|
const currentProductSelection = _findInstanceProperty(productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8037
7946
|
props.onChange(currentProductSelection);
|
|
8038
7947
|
};
|
|
7948
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8039
7949
|
return jsx(SearchSelectField, {
|
|
8040
7950
|
id: props.id,
|
|
8041
7951
|
name: props.name,
|
|
8042
7952
|
title: props.title,
|
|
7953
|
+
value: getValueFromOptions$2({
|
|
7954
|
+
currentlySelectedProductSelections: props.value,
|
|
7955
|
+
productSelectionFieldOptions: mapProductSelectionsToOptions({
|
|
7956
|
+
productSelections: _mapInstanceProperty(_context3 = productSelectionsByFieldFetcher.productSelections).call(_context3, convertProductSelectionFromGraphQl),
|
|
7957
|
+
dataLocale,
|
|
7958
|
+
projectLanguages,
|
|
7959
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
7960
|
+
}),
|
|
7961
|
+
isMulti: props.isMulti
|
|
7962
|
+
}),
|
|
8043
7963
|
description: props.description,
|
|
8044
7964
|
isRequired: props.isRequired,
|
|
8045
7965
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
|
|
8046
7966
|
loadOptions: loadOptionsDebounced,
|
|
8047
7967
|
onChange: onOptionClick,
|
|
7968
|
+
onBlur: props.onBlur,
|
|
8048
7969
|
components: props.components,
|
|
8049
|
-
isDisabled: props.isDisabled,
|
|
7970
|
+
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8050
7971
|
isReadOnly: props.isReadOnly,
|
|
8051
|
-
hasWarning: props.hasWarning
|
|
7972
|
+
hasWarning: props.hasWarning,
|
|
7973
|
+
isClearable: props.isClearable,
|
|
7974
|
+
hasError: props.hasError,
|
|
7975
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7976
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7977
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8052
7978
|
});
|
|
8053
7979
|
}
|
|
8054
7980
|
|
|
8055
7981
|
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8056
7982
|
function _objectSpread$N(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8057
|
-
const components = {
|
|
8058
|
-
// eslint-disable-next-line react/display-name
|
|
8059
|
-
Option: optionInnerProps => jsx(CustomSelectInputOption, {
|
|
8060
|
-
optionType: "double-property",
|
|
8061
|
-
optionInnerProps: optionInnerProps
|
|
8062
|
-
})
|
|
8063
|
-
};
|
|
8064
7983
|
function ProductSelectionsPicker(props) {
|
|
8065
7984
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
7985
|
+
const components = useMemo(() => {
|
|
7986
|
+
return {
|
|
7987
|
+
Option: optionInnerProps => {
|
|
7988
|
+
if (optionInnerProps.isDisabled) {
|
|
7989
|
+
return jsx(SelectInput.Option, _objectSpread$N({}, optionInnerProps));
|
|
7990
|
+
}
|
|
7991
|
+
return jsx(CustomSelectInputOption, {
|
|
7992
|
+
optionType: props.optionType,
|
|
7993
|
+
optionInnerProps: optionInnerProps
|
|
7994
|
+
});
|
|
7995
|
+
}
|
|
7996
|
+
};
|
|
7997
|
+
}, [props.optionType]);
|
|
8066
7998
|
if (productSelectionsTotalFetcher.isLoading) return jsx(CenteredLoadingSpinner, {});
|
|
8067
7999
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8068
8000
|
return jsx(Spacings.Stack, {
|
|
@@ -8078,7 +8010,13 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8078
8010
|
optionType: 'double-property',
|
|
8079
8011
|
isMulti: false,
|
|
8080
8012
|
isRequired: false,
|
|
8081
|
-
hasWarning: false
|
|
8013
|
+
hasWarning: false,
|
|
8014
|
+
hasError: false,
|
|
8015
|
+
isClearable: false,
|
|
8016
|
+
isReadOnly: false,
|
|
8017
|
+
isDisabled: false,
|
|
8018
|
+
excludedProductSelectionIds: [],
|
|
8019
|
+
title: '' // FieldLabel requires title to have some value
|
|
8082
8020
|
};
|
|
8083
8021
|
|
|
8084
8022
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
@@ -8209,43 +8147,9 @@ var messages$y = defineMessages({
|
|
|
8209
8147
|
}
|
|
8210
8148
|
});
|
|
8211
8149
|
|
|
8212
|
-
const trackingEvents = {
|
|
8213
|
-
selectCustomerGroupName: {
|
|
8214
|
-
action: 'select',
|
|
8215
|
-
category: 'ReferenceCustomerGroup',
|
|
8216
|
-
label: 'name'
|
|
8217
|
-
},
|
|
8218
|
-
selectCustomerGroupKey: {
|
|
8219
|
-
action: 'select',
|
|
8220
|
-
category: 'ReferenceCustomerGroup',
|
|
8221
|
-
label: 'key'
|
|
8222
|
-
},
|
|
8223
|
-
selectCustomerGroupId: {
|
|
8224
|
-
action: 'select',
|
|
8225
|
-
category: 'ReferenceCustomerGroup',
|
|
8226
|
-
label: 'id'
|
|
8227
|
-
},
|
|
8228
|
-
selectWithoutTyping: {
|
|
8229
|
-
action: 'select',
|
|
8230
|
-
category: 'ReferenceCustomerGroup',
|
|
8231
|
-
label: 'noEntry'
|
|
8232
|
-
}
|
|
8233
|
-
};
|
|
8234
|
-
|
|
8235
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 } } } };
|
|
8236
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 } } } };
|
|
8237
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 } } } };
|
|
8238
|
-
const getTrackingEvent = (inputValue, selectedValue) => {
|
|
8239
|
-
const id = selectedValue.value,
|
|
8240
|
-
key = selectedValue.key,
|
|
8241
|
-
name = selectedValue.name;
|
|
8242
|
-
const selectWithoutTyping = trackingEvents.selectWithoutTyping,
|
|
8243
|
-
selectCustomerGroupId = trackingEvents.selectCustomerGroupId,
|
|
8244
|
-
selectCustomerGroupKey = trackingEvents.selectCustomerGroupKey,
|
|
8245
|
-
selectCustomerGroupName = trackingEvents.selectCustomerGroupName;
|
|
8246
|
-
const trackingEvent = !inputValue ? selectWithoutTyping : _startsWithInstanceProperty(name).call(name, inputValue) ? selectCustomerGroupName : _startsWithInstanceProperty(key).call(key, inputValue) ? selectCustomerGroupKey : id === inputValue ? selectCustomerGroupId : void 0;
|
|
8247
|
-
return trackingEvent;
|
|
8248
|
-
};
|
|
8249
8153
|
const CustomerGroupPickerInput = _ref => {
|
|
8250
8154
|
var _currentOption$data$l, _currentOption$data;
|
|
8251
8155
|
let isClearable = _ref.isClearable,
|
|
@@ -8308,7 +8212,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8308
8212
|
onError(error);
|
|
8309
8213
|
}), [loadOptions, convertCustomerGroupToOption, onError]);
|
|
8310
8214
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
8311
|
-
const _useHandlers = useHandlers(onChange
|
|
8215
|
+
const _useHandlers = useHandlers(onChange),
|
|
8312
8216
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
8313
8217
|
handleInternalInputChange = _useHandlers2[0],
|
|
8314
8218
|
handleChange = _useHandlers2[1];
|
|
@@ -9705,11 +9609,9 @@ const mergeOverwritten = (inherited, explicit) => {
|
|
|
9705
9609
|
};
|
|
9706
9610
|
};
|
|
9707
9611
|
const mergeAssociates = businessUnit => {
|
|
9708
|
-
var _context2;
|
|
9709
|
-
const _businessUnit$associa = businessUnit.associates,
|
|
9710
|
-
|
|
9711
|
-
_businessUnit$inherit = businessUnit.inheritedAssociates,
|
|
9712
|
-
inheritedAssociates = _businessUnit$inherit === void 0 ? [] : _businessUnit$inherit;
|
|
9612
|
+
var _businessUnit$associa, _businessUnit$inherit, _context2;
|
|
9613
|
+
const associates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$associa = businessUnit.associates) === null || _businessUnit$associa === void 0 ? void 0 : _filterInstanceProperty(_businessUnit$associa).call(_businessUnit$associa, associate => associate === null || associate === void 0 ? void 0 : associate.customer);
|
|
9614
|
+
const inheritedAssociates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$inherit = businessUnit.inheritedAssociates) === null || _businessUnit$inherit === void 0 ? void 0 : _filterInstanceProperty(_businessUnit$inherit).call(_businessUnit$inherit, inheritedAssociate => inheritedAssociate === null || inheritedAssociate === void 0 ? void 0 : inheritedAssociate.customer);
|
|
9713
9615
|
const overwrittenOnExplicit = intersectionBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
9714
9616
|
const overwrittenOnInherited = intersectionBy(inheritedAssociates, associates, 'customer.id') || [];
|
|
9715
9617
|
const onlyExplicit = differenceBy(associates, inheritedAssociates, 'customer.id') || [];
|
|
@@ -9810,10 +9712,10 @@ var messages$r = defineMessages({
|
|
|
9810
9712
|
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9811
9713
|
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9812
9714
|
const BusinessUnitAssociatesListView = props => {
|
|
9813
|
-
var _props$values, _props$values$associa;
|
|
9715
|
+
var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
|
|
9814
9716
|
const intl = useIntl();
|
|
9815
9717
|
const businessUnitsAssociateRolesFeatureEnabled = useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
9816
|
-
const totalAssociates = (_props$values = _valuesInstanceProperty(props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length;
|
|
9718
|
+
const totalAssociates = ((_props$values = _valuesInstanceProperty(props)) === null || _props$values === void 0 ? void 0 : (_props$values$associa = _props$values.associates) === null || _props$values$associa === void 0 ? void 0 : _props$values$associa.length) + (((_props$values2 = _valuesInstanceProperty(props)) === null || _props$values2 === void 0 ? void 0 : (_props$values2$inheri = _props$values2.inheritedAssociates) === null || _props$values2$inheri === void 0 ? void 0 : _props$values2$inheri.length) || 0);
|
|
9817
9719
|
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
9818
9720
|
const _usePaginationState = usePaginationState({
|
|
9819
9721
|
perPage: 20
|
|
@@ -9828,8 +9730,8 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
9828
9730
|
searchValue = _useState2[0],
|
|
9829
9731
|
setSearchValue = _useState2[1];
|
|
9830
9732
|
const associates = useMemo(() => {
|
|
9831
|
-
var _props$
|
|
9832
|
-
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty(props)) : (_props$
|
|
9733
|
+
var _props$values3, _context, _context2;
|
|
9734
|
+
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty(props)) : (_props$values3 = _valuesInstanceProperty(props)) === null || _props$values3 === void 0 ? void 0 : _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = _props$values3.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
|
|
9833
9735
|
id: associate.customer.id
|
|
9834
9736
|
}));
|
|
9835
9737
|
}, [_valuesInstanceProperty(props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
@@ -9953,7 +9855,7 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
9953
9855
|
};
|
|
9954
9856
|
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
9955
9857
|
|
|
9956
|
-
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: "__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 } } } };
|
|
9957
9859
|
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
9958
9860
|
let id = _ref.id,
|
|
9959
9861
|
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
@@ -12231,9 +12133,6 @@ var messages$7 = defineMessages({
|
|
|
12231
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; }
|
|
12232
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; }
|
|
12233
12135
|
const MissingValueField = props => jsx(CheckboxInput, {
|
|
12234
|
-
"data-track-component": "MissingValue",
|
|
12235
|
-
"data-track-event": "change",
|
|
12236
|
-
"data-track-label": props.isChecked,
|
|
12237
12136
|
name: "missing-value",
|
|
12238
12137
|
isChecked: props.isChecked,
|
|
12239
12138
|
onChange: props.onChange,
|
|
@@ -12529,6 +12428,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
12529
12428
|
return jsx("div", {
|
|
12530
12429
|
className: styles$4.container,
|
|
12531
12430
|
children: jsx(SelectableSearchInput, {
|
|
12431
|
+
menuHorizontalConstraint: 5,
|
|
12532
12432
|
options: props.options,
|
|
12533
12433
|
value: {
|
|
12534
12434
|
text: searchText,
|
|
@@ -14107,30 +14007,6 @@ const getTimeZoneLabel = memoize((selectedTimeZone, timeZones) => {
|
|
|
14107
14007
|
return _concatInstanceProperty(_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
14108
14008
|
});
|
|
14109
14009
|
|
|
14110
|
-
function findButtonLinkPathname(element) {
|
|
14111
|
-
if (element.tagName === 'A') {
|
|
14112
|
-
var _context;
|
|
14113
|
-
const linkUrl = new _URL(element.href);
|
|
14114
|
-
return _concatInstanceProperty(_context = "".concat(linkUrl.pathname)).call(_context, linkUrl.search);
|
|
14115
|
-
}
|
|
14116
|
-
return findButtonLinkPathname(element.parentElement);
|
|
14117
|
-
}
|
|
14118
|
-
function trackMenuClick(_ref) {
|
|
14119
|
-
let event = _ref.event,
|
|
14120
|
-
track = _ref.track,
|
|
14121
|
-
pathToMatch = _ref.pathToMatch,
|
|
14122
|
-
trackingEvent = _ref.trackingEvent;
|
|
14123
|
-
const buttonLinkPathname = findButtonLinkPathname(event.target);
|
|
14124
|
-
const shouldTrackEvent = !!matchPath(buttonLinkPathname, {
|
|
14125
|
-
path: pathToMatch,
|
|
14126
|
-
exact: true,
|
|
14127
|
-
strict: true
|
|
14128
|
-
});
|
|
14129
|
-
if (shouldTrackEvent) {
|
|
14130
|
-
track(trackingEvent.action, trackingEvent.category, trackingEvent.label);
|
|
14131
|
-
}
|
|
14132
|
-
}
|
|
14133
|
-
|
|
14134
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; }
|
|
14135
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; }
|
|
14136
14012
|
function withPendingRequests() {
|
|
@@ -14150,4 +14026,4 @@ function withPendingRequests() {
|
|
|
14150
14026
|
|
|
14151
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 } } } };
|
|
14152
14028
|
|
|
14153
|
-
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 };
|