@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.
|
@@ -52,7 +52,6 @@ var PropTypes = require('prop-types');
|
|
|
52
52
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
53
53
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
54
54
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
55
|
-
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
56
55
|
var react = require('@apollo/client/react');
|
|
57
56
|
var _lastIndexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/last-index-of');
|
|
58
57
|
var msw = require('msw');
|
|
@@ -60,11 +59,11 @@ var get = require('lodash/get');
|
|
|
60
59
|
var formik = require('formik');
|
|
61
60
|
var _Date$now = require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
62
61
|
var _setTimeout = require('@babel/runtime-corejs3/core-js-stable/set-timeout');
|
|
62
|
+
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
63
63
|
var debounce = require('debounce-promise');
|
|
64
64
|
var pick = require('lodash/pick');
|
|
65
65
|
var hooks = require('@apollo/client/react/hooks');
|
|
66
66
|
var moment$1 = require('moment');
|
|
67
|
-
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
68
67
|
var classnames = require('classnames');
|
|
69
68
|
require('react-required-if');
|
|
70
69
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
@@ -120,8 +119,6 @@ var compact = require('lodash/compact');
|
|
|
120
119
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
121
120
|
require('@babel/runtime-corejs3/helpers/get');
|
|
122
121
|
var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
|
|
123
|
-
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
124
|
-
var reactRouterDom = require('react-router-dom');
|
|
125
122
|
|
|
126
123
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
127
124
|
|
|
@@ -163,7 +160,6 @@ var _setTimeout__default = /*#__PURE__*/_interopDefault(_setTimeout);
|
|
|
163
160
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
164
161
|
var pick__default = /*#__PURE__*/_interopDefault(pick);
|
|
165
162
|
var moment__default$1 = /*#__PURE__*/_interopDefault(moment$1);
|
|
166
|
-
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
167
163
|
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
168
164
|
var Textarea__default = /*#__PURE__*/_interopDefault(Textarea);
|
|
169
165
|
var has__default = /*#__PURE__*/_interopDefault(has);
|
|
@@ -202,7 +198,6 @@ var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInde
|
|
|
202
198
|
var compact__default = /*#__PURE__*/_interopDefault(compact);
|
|
203
199
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
204
200
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
205
|
-
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
206
201
|
|
|
207
202
|
const QUERY_MAX_LIMIT = 500;
|
|
208
203
|
const SHOW_TOOLTIP_CHARS_COUNT = 40;
|
|
@@ -214,28 +209,6 @@ const SEARCHABLE_REFERENCES = {
|
|
|
214
209
|
productType: 'product-type',
|
|
215
210
|
state: 'state'
|
|
216
211
|
};
|
|
217
|
-
const trackingEvents$5 = {
|
|
218
|
-
showInfoNotification: {
|
|
219
|
-
category: 'Account-Profile',
|
|
220
|
-
action: 'showMyProfileUpdateNotification',
|
|
221
|
-
label: 'Show My Profile Update Notification'
|
|
222
|
-
},
|
|
223
|
-
clickOnInfoNotification: {
|
|
224
|
-
category: 'Account-Profile',
|
|
225
|
-
action: 'openAccountMyProfilePage',
|
|
226
|
-
label: 'Open My Profile Page'
|
|
227
|
-
},
|
|
228
|
-
clickCloseInfoNotification: {
|
|
229
|
-
category: 'Account-Profile',
|
|
230
|
-
action: 'closeInfoNotification',
|
|
231
|
-
label: 'Close Info Notification'
|
|
232
|
-
},
|
|
233
|
-
updateBusinessRoleOnProfilePage: {
|
|
234
|
-
category: 'Account-Profile',
|
|
235
|
-
action: 'updateMyProfilePage',
|
|
236
|
-
label: 'Update My Profile Page'
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
212
|
const BUSINESS_ROLE_NOTIFICATION = 'businessRoleNotification';
|
|
240
213
|
|
|
241
214
|
// The max API limit for one request
|
|
@@ -2218,8 +2191,6 @@ const injectStorage = options => WrappedComponent => {
|
|
|
2218
2191
|
return WithStorage;
|
|
2219
2192
|
};
|
|
2220
2193
|
|
|
2221
|
-
var useTracking = (() => React.useContext(applicationShell.GtmContext));
|
|
2222
|
-
|
|
2223
2194
|
/**
|
|
2224
2195
|
* @returns function with the following parameters
|
|
2225
2196
|
* - {LocalizedStrings} localizedStrings - an array of graphql LocalizedString,
|
|
@@ -2276,7 +2247,7 @@ const filterStoresOutdatedDanglingProductSelections = storesQueryResult => {
|
|
|
2276
2247
|
})
|
|
2277
2248
|
};
|
|
2278
2249
|
};
|
|
2279
|
-
const createQueryVariables$
|
|
2250
|
+
const createQueryVariables$9 = ownProps => {
|
|
2280
2251
|
var _context;
|
|
2281
2252
|
return _objectSpread$1h(_objectSpread$1h({
|
|
2282
2253
|
limit: ownProps.limit,
|
|
@@ -2292,7 +2263,7 @@ const createQueryVariables$8 = ownProps => {
|
|
|
2292
2263
|
const useStoresListFetcher = props => {
|
|
2293
2264
|
const excludeExtendedStoresList = props.excludeExtendedStoresList || false;
|
|
2294
2265
|
const excludeProductSelections = props.excludeProductSelections || false;
|
|
2295
|
-
const queryVariables = createQueryVariables$
|
|
2266
|
+
const queryVariables = createQueryVariables$9({
|
|
2296
2267
|
limit: props.limit,
|
|
2297
2268
|
offset: props.offset,
|
|
2298
2269
|
sort: _sortInstanceProperty__default["default"](props),
|
|
@@ -2529,10 +2500,7 @@ var messages$M = reactIntl.defineMessages({
|
|
|
2529
2500
|
function ownKeys$1f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2530
2501
|
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__default["default"](_context = ownKeys$1f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
2531
2502
|
const LinkToProfile = props => {
|
|
2532
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2533
|
-
trackClickOnInfoNotification = _useTrackingShared.trackClickOnInfoNotification;
|
|
2534
2503
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
2535
|
-
onClick: trackClickOnInfoNotification,
|
|
2536
2504
|
to: "/account/profile",
|
|
2537
2505
|
children: props.children
|
|
2538
2506
|
});
|
|
@@ -2570,45 +2538,8 @@ const NotificationText = () => jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
|
2570
2538
|
});
|
|
2571
2539
|
NotificationText.displayName = 'NotificationText';
|
|
2572
2540
|
|
|
2573
|
-
const forwardHandler = (track, handler) => function () {
|
|
2574
|
-
track();
|
|
2575
|
-
handler(...arguments);
|
|
2576
|
-
};
|
|
2577
|
-
const defaultProcessTrackingEvent = trackingEvent => trackingEvent;
|
|
2578
|
-
const useTrackingHandler = function (trackingEvent) {
|
|
2579
|
-
let processTrackingEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultProcessTrackingEvent;
|
|
2580
|
-
const _useTrackingContext = useTracking(),
|
|
2581
|
-
track = _useTrackingContext.track;
|
|
2582
|
-
return React.useCallback(function () {
|
|
2583
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2584
|
-
args[_key] = arguments[_key];
|
|
2585
|
-
}
|
|
2586
|
-
const _processTrackingEvent = processTrackingEvent(trackingEvent, ...args),
|
|
2587
|
-
action = _processTrackingEvent.action,
|
|
2588
|
-
category = _processTrackingEvent.category,
|
|
2589
|
-
label = _processTrackingEvent.label;
|
|
2590
|
-
track(action, category, label);
|
|
2591
|
-
}, [track, trackingEvent, processTrackingEvent]);
|
|
2592
|
-
};
|
|
2593
|
-
const useTrackingShared = () => {
|
|
2594
|
-
const trackShowInfoNotification = useTrackingHandler(trackingEvents$5.showInfoNotification);
|
|
2595
|
-
const trackClickOnInfoNotification = useTrackingHandler(trackingEvents$5.clickOnInfoNotification);
|
|
2596
|
-
const trackClickCloseInfoNotification = useTrackingHandler(trackingEvents$5.clickCloseInfoNotification);
|
|
2597
|
-
const trackUpdateBusinessRoleOnProfilePage = useTrackingHandler(trackingEvents$5.updateBusinessRoleOnProfilePage);
|
|
2598
|
-
return {
|
|
2599
|
-
trackShowInfoNotification,
|
|
2600
|
-
trackClickOnInfoNotification,
|
|
2601
|
-
trackClickCloseInfoNotification,
|
|
2602
|
-
trackUpdateBusinessRoleOnProfilePage,
|
|
2603
|
-
forwardHandler
|
|
2604
|
-
};
|
|
2605
|
-
};
|
|
2606
|
-
|
|
2607
2541
|
const useRoleNotification = _ref => {
|
|
2608
2542
|
let dismissNotification = _ref.onDismiss;
|
|
2609
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2610
|
-
trackClickCloseInfoNotification = _useTrackingShared.trackClickCloseInfoNotification,
|
|
2611
|
-
forwardHandler = _useTrackingShared.forwardHandler;
|
|
2612
2543
|
const notification = actionsGlobal.useShowNotification({
|
|
2613
2544
|
domain: constants.DOMAINS.SIDE,
|
|
2614
2545
|
kind: 'info'
|
|
@@ -2619,7 +2550,7 @@ const useRoleNotification = _ref => {
|
|
|
2619
2550
|
notification({
|
|
2620
2551
|
text: jsxRuntime.jsx(NotificationText, {})
|
|
2621
2552
|
}, {
|
|
2622
|
-
onDismiss: () =>
|
|
2553
|
+
onDismiss: () => dismissNotification()
|
|
2623
2554
|
});
|
|
2624
2555
|
}
|
|
2625
2556
|
};
|
|
@@ -2632,9 +2563,6 @@ const useRoleNotificationEffect = () => {
|
|
|
2632
2563
|
const storageKey = 'roleExpiry';
|
|
2633
2564
|
const userBusinessRole = user.businessRole;
|
|
2634
2565
|
const scopedStorageKey = [user.id, storageKey].join('/');
|
|
2635
|
-
const _useTrackingShared = useTrackingShared(),
|
|
2636
|
-
trackShowInfoNotification = _useTrackingShared.trackShowInfoNotification,
|
|
2637
|
-
forwardHandler = _useTrackingShared.forwardHandler;
|
|
2638
2566
|
const _usePersistedReminder = usePersistedReminder({
|
|
2639
2567
|
storageKey,
|
|
2640
2568
|
reminderInterval: REMINDER_OPTION_3_DAY
|
|
@@ -2647,7 +2575,6 @@ const useRoleNotificationEffect = () => {
|
|
|
2647
2575
|
onDismiss: scheduleReminder
|
|
2648
2576
|
});
|
|
2649
2577
|
const isFirstTimeUser = !hasChosenReminderRef.current;
|
|
2650
|
-
const openBusinessRoleNotification = () => forwardHandler(trackShowInfoNotification(), roleNotification());
|
|
2651
2578
|
React.useEffect(() => {
|
|
2652
2579
|
/*
|
|
2653
2580
|
If the user does not have a business role,
|
|
@@ -2657,11 +2584,11 @@ const useRoleNotificationEffect = () => {
|
|
|
2657
2584
|
if (isFlopFlipReady) {
|
|
2658
2585
|
// 1. first time user
|
|
2659
2586
|
if (!userBusinessRole && isFirstTimeUser) {
|
|
2660
|
-
|
|
2587
|
+
roleNotification();
|
|
2661
2588
|
}
|
|
2662
2589
|
// 2. returning but not filled business role and has closed notification before
|
|
2663
2590
|
else if (!userBusinessRole && hasReminderExpired) {
|
|
2664
|
-
|
|
2591
|
+
roleNotification();
|
|
2665
2592
|
}
|
|
2666
2593
|
// 3. has filled business role
|
|
2667
2594
|
else if (userBusinessRole) {
|
|
@@ -2899,8 +2826,8 @@ const convertProductSelectionsFromGraphQl = productSelections => {
|
|
|
2899
2826
|
});
|
|
2900
2827
|
};
|
|
2901
2828
|
|
|
2902
|
-
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:
|
|
2903
|
-
const createQueryVariables$
|
|
2829
|
+
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 } } } };
|
|
2830
|
+
const createQueryVariables$8 = ownProps => ({
|
|
2904
2831
|
limit: ownProps.limit,
|
|
2905
2832
|
offset: ownProps.offset,
|
|
2906
2833
|
sort: _sortInstanceProperty__default["default"](ownProps)
|
|
@@ -2912,7 +2839,7 @@ const emptyProductSelections = {
|
|
|
2912
2839
|
results: []
|
|
2913
2840
|
};
|
|
2914
2841
|
const useProductSelectionsFetcher = props => {
|
|
2915
|
-
const queryVariables = createQueryVariables$
|
|
2842
|
+
const queryVariables = createQueryVariables$8(props);
|
|
2916
2843
|
const _useQuery = hooks.useQuery(FetchProductSelections, {
|
|
2917
2844
|
context: {
|
|
2918
2845
|
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
@@ -3068,41 +2995,11 @@ var commonPickerMessages = reactIntl.defineMessages({
|
|
|
3068
2995
|
}
|
|
3069
2996
|
});
|
|
3070
2997
|
|
|
3071
|
-
const trackingEvents$4 = {
|
|
3072
|
-
selectChannelName: {
|
|
3073
|
-
action: 'select',
|
|
3074
|
-
category: 'ReferenceChannel',
|
|
3075
|
-
label: 'name'
|
|
3076
|
-
},
|
|
3077
|
-
selectChannelKey: {
|
|
3078
|
-
action: 'select',
|
|
3079
|
-
category: 'ReferenceChannel',
|
|
3080
|
-
label: 'key'
|
|
3081
|
-
},
|
|
3082
|
-
selectChannelId: {
|
|
3083
|
-
action: 'select',
|
|
3084
|
-
category: 'ReferenceChannel',
|
|
3085
|
-
label: 'id'
|
|
3086
|
-
},
|
|
3087
|
-
selectWithoutTyping: {
|
|
3088
|
-
action: 'select',
|
|
3089
|
-
category: 'ReferenceChannel',
|
|
3090
|
-
label: 'noEntry'
|
|
3091
|
-
}
|
|
3092
|
-
};
|
|
3093
|
-
|
|
3094
2998
|
function ownKeys$1c(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3095
2999
|
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__default["default"](_context2 = ownKeys$1c(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1c(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3096
3000
|
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 } } } };
|
|
3097
3001
|
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 } } } };
|
|
3098
3002
|
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 } } } };
|
|
3099
|
-
const getTrackingEvent$4 = (inputValue, selectedValue) => {
|
|
3100
|
-
const id = selectedValue.value,
|
|
3101
|
-
key = selectedValue.key,
|
|
3102
|
-
name = selectedValue.name;
|
|
3103
|
-
const trackingEvent = !inputValue ? trackingEvents$4.selectWithoutTyping : _startsWithInstanceProperty__default["default"](name).call(name, inputValue) ? trackingEvents$4.selectChannelName : _startsWithInstanceProperty__default["default"](key).call(key, inputValue) ? trackingEvents$4.selectChannelKey : id === inputValue ? trackingEvents$4.selectChannelId : void 0;
|
|
3104
|
-
return trackingEvent;
|
|
3105
|
-
};
|
|
3106
3003
|
const ChannelPickerInput = _ref => {
|
|
3107
3004
|
var _currentOption$data$l, _currentOption$data;
|
|
3108
3005
|
let isClearable = _ref.isClearable,
|
|
@@ -3168,7 +3065,7 @@ const ChannelPickerInput = _ref => {
|
|
|
3168
3065
|
onError(error);
|
|
3169
3066
|
}), [loadOptions, convertChannelToOption, onError]);
|
|
3170
3067
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
3171
|
-
const _useHandlers = useHandlers(onChange
|
|
3068
|
+
const _useHandlers = useHandlers(onChange),
|
|
3172
3069
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
3173
3070
|
handleInternalInputChange = _useHandlers2[0],
|
|
3174
3071
|
handleChange = _useHandlers2[1];
|
|
@@ -3551,7 +3448,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3551
3448
|
value: function render() {
|
|
3552
3449
|
return jsxRuntime.jsx("div", {
|
|
3553
3450
|
className: classnames__default["default"](this.props.blockClassName, styles$h.block),
|
|
3554
|
-
"data-track-component": "Search",
|
|
3555
3451
|
children: jsxRuntime.jsxs("div", {
|
|
3556
3452
|
className: classnames__default["default"](this.props.containerClassName, styles$h.container),
|
|
3557
3453
|
children: [jsxRuntime.jsx("div", {
|
|
@@ -3568,8 +3464,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3568
3464
|
label: this.props.label,
|
|
3569
3465
|
placeholder: this.props.placeholder || this.props.intl.formatMessage(messages$J.placeholder),
|
|
3570
3466
|
inputRef: this.props.inputRef || this.setInputRef,
|
|
3571
|
-
"data-track-component": "Text",
|
|
3572
|
-
"data-track-event": "change",
|
|
3573
3467
|
onChange: this.handleInputChange,
|
|
3574
3468
|
onEnter: this.handleEnter,
|
|
3575
3469
|
onBlurValue: this.props.onBlur,
|
|
@@ -3593,8 +3487,6 @@ let SearchInput = /*#__PURE__*/function (_Component) {
|
|
|
3593
3487
|
}),
|
|
3594
3488
|
onClick: this.props.disabled ? null : this.handleSubmit,
|
|
3595
3489
|
label: "search-button",
|
|
3596
|
-
"data-track-component": "Button",
|
|
3597
|
-
"data-track-event": "click",
|
|
3598
3490
|
onMouseOver: this.props.handleMouseOver,
|
|
3599
3491
|
onMouseOut: this.props.handleMouseOut,
|
|
3600
3492
|
children: jsxRuntime.jsx(uiKit.SearchIcon, {
|
|
@@ -3824,9 +3716,7 @@ Option$2.displayName = 'Option';
|
|
|
3824
3716
|
|
|
3825
3717
|
function ownKeys$18(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3826
3718
|
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__default["default"](_context = ownKeys$18(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$18(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
3827
|
-
const useHandlers =
|
|
3828
|
-
const _useTracking = useTracking(),
|
|
3829
|
-
track = _useTracking.track;
|
|
3719
|
+
const useHandlers = onChange => {
|
|
3830
3720
|
const _useState = React.useState(),
|
|
3831
3721
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3832
3722
|
inputValue = _useState2[0],
|
|
@@ -3836,25 +3726,13 @@ const useHandlers = (onChange, getTrackingEvent) => {
|
|
|
3836
3726
|
}, []);
|
|
3837
3727
|
const handleChange = useEventCallback(event => {
|
|
3838
3728
|
var _event$target$value;
|
|
3839
|
-
const doTrack = () => {
|
|
3840
|
-
const trackingEvent = getTrackingEvent(inputValue, event.target.value);
|
|
3841
|
-
if (trackingEvent) {
|
|
3842
|
-
const action = trackingEvent.action,
|
|
3843
|
-
category = trackingEvent.category,
|
|
3844
|
-
label = trackingEvent.label;
|
|
3845
|
-
track(action, category, label);
|
|
3846
|
-
}
|
|
3847
|
-
};
|
|
3848
|
-
if (event.target.value) {
|
|
3849
|
-
doTrack();
|
|
3850
|
-
}
|
|
3851
3729
|
const eventWithExtractedValue = _objectSpread$18(_objectSpread$18({}, event), {}, {
|
|
3852
3730
|
target: _objectSpread$18(_objectSpread$18({}, event.target), {}, {
|
|
3853
3731
|
value: (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value
|
|
3854
3732
|
})
|
|
3855
3733
|
});
|
|
3856
3734
|
onChange(eventWithExtractedValue);
|
|
3857
|
-
}, [onChange,
|
|
3735
|
+
}, [onChange, inputValue]);
|
|
3858
3736
|
return [handleInputChange, handleChange];
|
|
3859
3737
|
};
|
|
3860
3738
|
|
|
@@ -3969,30 +3847,11 @@ var messages$H = reactIntl.defineMessages({
|
|
|
3969
3847
|
}
|
|
3970
3848
|
});
|
|
3971
3849
|
|
|
3972
|
-
const trackingEvents$3 = {
|
|
3973
|
-
selectProductTypeName: {
|
|
3974
|
-
action: 'select',
|
|
3975
|
-
category: 'ReferenceProductType',
|
|
3976
|
-
label: 'name'
|
|
3977
|
-
},
|
|
3978
|
-
selectProductTypeId: {
|
|
3979
|
-
action: 'select',
|
|
3980
|
-
category: 'ReferenceProductType',
|
|
3981
|
-
label: 'id'
|
|
3982
|
-
}
|
|
3983
|
-
};
|
|
3984
|
-
|
|
3985
3850
|
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 } } } };
|
|
3986
3851
|
const DropdownIndicator$1 = () => jsxRuntime.jsx(uiKit.SearchIcon, {
|
|
3987
3852
|
color: "primary"
|
|
3988
3853
|
});
|
|
3989
3854
|
DropdownIndicator$1.displayName = 'DropdownIndicator';
|
|
3990
|
-
const getTrackingEvent$3 = (inputValue, selectedValue) => {
|
|
3991
|
-
const id = selectedValue.value,
|
|
3992
|
-
name = selectedValue.label;
|
|
3993
|
-
const trackingEvent = _startsWithInstanceProperty__default["default"](name).call(name, inputValue) ? trackingEvents$3.selectProductTypeName : id === inputValue ? trackingEvents$3.selectProductTypeId : void 0;
|
|
3994
|
-
return trackingEvent;
|
|
3995
|
-
};
|
|
3996
3855
|
const convertProductTypeToOption = productType => {
|
|
3997
3856
|
if (!productType) return null;
|
|
3998
3857
|
const id = productType.id,
|
|
@@ -4042,7 +3901,7 @@ const ProductTypePickerInput = _ref => {
|
|
|
4042
3901
|
onError(error);
|
|
4043
3902
|
}), [loadProductTypes, onError]);
|
|
4044
3903
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
4045
|
-
const _useHandlers = useHandlers(onChange
|
|
3904
|
+
const _useHandlers = useHandlers(onChange),
|
|
4046
3905
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
4047
3906
|
handleInternalInputChange = _useHandlers2[0],
|
|
4048
3907
|
handleChange = _useHandlers2[1];
|
|
@@ -4103,38 +3962,8 @@ var messages$G = reactIntl.defineMessages({
|
|
|
4103
3962
|
}
|
|
4104
3963
|
});
|
|
4105
3964
|
|
|
4106
|
-
const trackingEvents$2 = {
|
|
4107
|
-
selectStateName: {
|
|
4108
|
-
action: 'select',
|
|
4109
|
-
category: 'ReferenceState',
|
|
4110
|
-
label: 'name'
|
|
4111
|
-
},
|
|
4112
|
-
selectStateKey: {
|
|
4113
|
-
action: 'select',
|
|
4114
|
-
category: 'ReferenceState',
|
|
4115
|
-
label: 'key'
|
|
4116
|
-
},
|
|
4117
|
-
selectStateId: {
|
|
4118
|
-
action: 'select',
|
|
4119
|
-
category: 'ReferenceState',
|
|
4120
|
-
label: 'id'
|
|
4121
|
-
},
|
|
4122
|
-
selectWithoutTyping: {
|
|
4123
|
-
action: 'select',
|
|
4124
|
-
category: 'ReferenceState',
|
|
4125
|
-
label: 'noEntry'
|
|
4126
|
-
}
|
|
4127
|
-
};
|
|
4128
|
-
|
|
4129
3965
|
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 } } } };
|
|
4130
3966
|
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 } } } };
|
|
4131
|
-
const getTrackingEvent$2 = (inputValue, selectedValue) => {
|
|
4132
|
-
const id = selectedValue.value,
|
|
4133
|
-
key = selectedValue.key,
|
|
4134
|
-
name = selectedValue.name;
|
|
4135
|
-
const trackingEvent = !inputValue ? trackingEvents$2.selectWithoutTyping : _startsWithInstanceProperty__default["default"](name).call(name, inputValue) ? trackingEvents$2.selectStateName : _startsWithInstanceProperty__default["default"](key).call(key, inputValue) ? trackingEvents$2.selectStateKey : id === inputValue ? trackingEvents$2.selectStateId : void 0;
|
|
4136
|
-
return trackingEvent;
|
|
4137
|
-
};
|
|
4138
3967
|
const StatePickerInput = _ref => {
|
|
4139
3968
|
var _currentOption$data$l, _currentOption$data;
|
|
4140
3969
|
let isClearable = _ref.isClearable,
|
|
@@ -4191,7 +4020,7 @@ const StatePickerInput = _ref => {
|
|
|
4191
4020
|
onError(error);
|
|
4192
4021
|
}), [loadOptions, convertStateToOption, onError]);
|
|
4193
4022
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
4194
|
-
const _useHandlers = useHandlers(onChange
|
|
4023
|
+
const _useHandlers = useHandlers(onChange),
|
|
4195
4024
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
4196
4025
|
handleInternalInputChange = _useHandlers2[0],
|
|
4197
4026
|
handleChange = _useHandlers2[1];
|
|
@@ -6329,37 +6158,12 @@ var messages$D = reactIntl.defineMessages({
|
|
|
6329
6158
|
}
|
|
6330
6159
|
});
|
|
6331
6160
|
|
|
6332
|
-
const trackingEvents$1 = {
|
|
6333
|
-
selectProductName: {
|
|
6334
|
-
action: 'select',
|
|
6335
|
-
category: 'ReferenceProduct',
|
|
6336
|
-
label: 'name'
|
|
6337
|
-
},
|
|
6338
|
-
selectProductKey: {
|
|
6339
|
-
action: 'select',
|
|
6340
|
-
category: 'ReferenceProduct',
|
|
6341
|
-
label: 'key'
|
|
6342
|
-
},
|
|
6343
|
-
selectProductId: {
|
|
6344
|
-
action: 'select',
|
|
6345
|
-
category: 'ReferenceProduct',
|
|
6346
|
-
label: 'id'
|
|
6347
|
-
}
|
|
6348
|
-
};
|
|
6349
|
-
|
|
6350
6161
|
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 } } } };
|
|
6351
6162
|
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 } } } };
|
|
6352
6163
|
const DropdownIndicator = () => jsxRuntime.jsx(uiKit.SearchIcon, {
|
|
6353
6164
|
color: "primary"
|
|
6354
6165
|
});
|
|
6355
6166
|
DropdownIndicator.displayName = 'DropdownIndicator';
|
|
6356
|
-
const getTrackingEvent$1 = (inputValue, selectedValue) => {
|
|
6357
|
-
const id = selectedValue.value,
|
|
6358
|
-
key = selectedValue.key,
|
|
6359
|
-
name = selectedValue.name;
|
|
6360
|
-
const trackingEvent = _startsWithInstanceProperty__default["default"](name).call(name, inputValue) ? trackingEvents$1.selectProductName : _startsWithInstanceProperty__default["default"](key).call(key, inputValue) ? trackingEvents$1.selectProductKey : id === inputValue ? trackingEvents$1.selectProductId : void 0;
|
|
6361
|
-
return trackingEvent;
|
|
6362
|
-
};
|
|
6363
6167
|
const ProductPickerInput = _ref => {
|
|
6364
6168
|
var _currentOption$data$l, _currentOption$data;
|
|
6365
6169
|
let isClearable = _ref.isClearable,
|
|
@@ -6417,7 +6221,7 @@ const ProductPickerInput = _ref => {
|
|
|
6417
6221
|
onError(error);
|
|
6418
6222
|
}), [loadOptions, onError, convertProductToOption]);
|
|
6419
6223
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
6420
|
-
const _useHandlers = useHandlers(onChange
|
|
6224
|
+
const _useHandlers = useHandlers(onChange),
|
|
6421
6225
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
6422
6226
|
handleInternalInputChange = _useHandlers2[0],
|
|
6423
6227
|
handleChange = _useHandlers2[1];
|
|
@@ -6830,7 +6634,7 @@ function CustomInputSet(props) {
|
|
|
6830
6634
|
touched = _useFormikContext.touched,
|
|
6831
6635
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
6832
6636
|
dirty = _useFormikContext.dirty;
|
|
6833
|
-
const
|
|
6637
|
+
const itemFieldDefinition = _objectSpread$U(_objectSpread$U({}, props.fieldDefinition), {}, {
|
|
6834
6638
|
type: props.fieldDefinition.type.elementType
|
|
6835
6639
|
});
|
|
6836
6640
|
const value = React.useMemo(() => props.value || [undefined], [props.value]);
|
|
@@ -6889,7 +6693,7 @@ function CustomInputSet(props) {
|
|
|
6889
6693
|
// in <CustomFieldComponent /> where proper component for given field/attribute
|
|
6890
6694
|
// type is selected.
|
|
6891
6695
|
const type = getType(props.fieldDefinition);
|
|
6892
|
-
const typeName = type.name.toLowerCase();
|
|
6696
|
+
const typeName = type === null || type === void 0 ? void 0 : type.name.toLowerCase();
|
|
6893
6697
|
const areButtonsTopAligned = _includesInstanceProperty__default["default"](_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);
|
|
6894
6698
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
6895
6699
|
children: [jsxRuntime.jsx(uiKit.AccessibleHidden, {
|
|
@@ -6914,7 +6718,7 @@ function CustomInputSet(props) {
|
|
|
6914
6718
|
alignItems: areButtonsTopAligned ? 'flex-start' : 'center',
|
|
6915
6719
|
children: [jsxRuntime.jsx(CustomFieldInput, {
|
|
6916
6720
|
name: fieldName,
|
|
6917
|
-
fieldDefinition:
|
|
6721
|
+
fieldDefinition: itemFieldDefinition,
|
|
6918
6722
|
isDisabled: props.isDisabled,
|
|
6919
6723
|
isReadOnly: props.isReadOnly,
|
|
6920
6724
|
onBlur: props.onBlur,
|
|
@@ -6941,7 +6745,6 @@ function CustomInputSet(props) {
|
|
|
6941
6745
|
})]
|
|
6942
6746
|
});
|
|
6943
6747
|
}
|
|
6944
|
-
CustomInputSet.displayName = 'CustomInputSet';
|
|
6945
6748
|
|
|
6946
6749
|
var messages$C = reactIntl.defineMessages({
|
|
6947
6750
|
referencedProductType: {
|
|
@@ -7400,7 +7203,6 @@ function ProductAttributes(props) {
|
|
|
7400
7203
|
inputValuesConverter: convertInputValue
|
|
7401
7204
|
});
|
|
7402
7205
|
}
|
|
7403
|
-
ProductAttributes.displayName = 'ProductAttributes';
|
|
7404
7206
|
|
|
7405
7207
|
const useFieldDefintion = attributeDefinition => React.useMemo(() => attributeDefinitionToFieldDefinition(attributeDefinition), [attributeDefinition]);
|
|
7406
7208
|
function ProductAttributeInput(props) {
|
|
@@ -7749,30 +7551,23 @@ const nonSetComponents = {
|
|
|
7749
7551
|
[CUSTOM_FIELD_TYPES.date]: CustomDateTimeInput,
|
|
7750
7552
|
[CUSTOM_FIELD_TYPES.nested]: CustomNestedInput
|
|
7751
7553
|
};
|
|
7752
|
-
const getSetComponent = fieldDefinition => {
|
|
7753
|
-
const type = getType(fieldDefinition);
|
|
7754
|
-
const typeName = type.name.toLowerCase();
|
|
7755
|
-
// Boolean is the only set element with picularities (i.e. way more
|
|
7756
|
-
// convenient for user to work with it as with select input with three values:
|
|
7757
|
-
// [true], [false] and [true, false]).
|
|
7758
|
-
if (typeName === CUSTOM_FIELD_TYPES.boolean) return CustomBooleanInputSet;
|
|
7759
|
-
// All the rest sets are just a fancy wrapper around single-item components
|
|
7760
|
-
return CustomInputSet;
|
|
7761
|
-
};
|
|
7762
|
-
const getNonSetComponent = fieldDefinition => {
|
|
7763
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
7764
|
-
return nonSetComponents[typeName];
|
|
7765
|
-
};
|
|
7766
|
-
const isSet = fieldDefinition => {
|
|
7767
|
-
const typeName = fieldDefinition.type.name.toLowerCase();
|
|
7768
|
-
return typeName === 'set';
|
|
7769
|
-
};
|
|
7770
|
-
const getInputComponent = fieldDefinition => {
|
|
7771
|
-
if (isSet(fieldDefinition)) return getSetComponent(fieldDefinition);
|
|
7772
|
-
return getNonSetComponent(fieldDefinition);
|
|
7773
|
-
};
|
|
7774
7554
|
const CustomFieldInput = /*#__PURE__*/React.memo(props => {
|
|
7775
|
-
const InputComponent =
|
|
7555
|
+
const InputComponent = React.useMemo(() => {
|
|
7556
|
+
var _props$fieldDefinitio;
|
|
7557
|
+
const typeName = (_props$fieldDefinitio = props.fieldDefinition.type) === null || _props$fieldDefinitio === void 0 ? void 0 : _props$fieldDefinitio.name.toLowerCase();
|
|
7558
|
+
if (typeName === 'set') {
|
|
7559
|
+
var _getSetElementType;
|
|
7560
|
+
// Boolean is the only set element with peculiarities (i.e. way more
|
|
7561
|
+
// convenient for user to work with it as with select input with three values:
|
|
7562
|
+
// [true], [false] and [true, false]).
|
|
7563
|
+
if (((_getSetElementType = getType(props.fieldDefinition)) === null || _getSetElementType === void 0 ? void 0 : _getSetElementType.name.toLowerCase()) === CUSTOM_FIELD_TYPES.boolean) {
|
|
7564
|
+
return CustomBooleanInputSet;
|
|
7565
|
+
}
|
|
7566
|
+
// All the rest sets are just a fancy wrapper around single-item components
|
|
7567
|
+
return CustomInputSet;
|
|
7568
|
+
}
|
|
7569
|
+
return nonSetComponents[typeName];
|
|
7570
|
+
}, [props.fieldDefinition]);
|
|
7776
7571
|
if (!InputComponent) return null;
|
|
7777
7572
|
return jsxRuntime.jsx(InputComponent, {
|
|
7778
7573
|
name: props.name,
|
|
@@ -7931,6 +7726,11 @@ var pickerMessages = reactIntl.defineMessages({
|
|
|
7931
7726
|
id: 'ProductSelectionPicker.productSelectionsSearchSelectPlaceholder',
|
|
7932
7727
|
description: 'Placeholder of the search select field for product selections',
|
|
7933
7728
|
defaultMessage: 'Search for product selections by entering exact key'
|
|
7729
|
+
},
|
|
7730
|
+
asyncSelectDropdownTypeAheadPrompt: {
|
|
7731
|
+
id: 'ProductSelectionPicker.asyncSelectDropdownTypeAheadPrompt',
|
|
7732
|
+
description: 'Message shown telling the user to start typing to load more product selections',
|
|
7733
|
+
defaultMessage: 'Start typing above to load more'
|
|
7934
7734
|
}
|
|
7935
7735
|
});
|
|
7936
7736
|
|
|
@@ -7963,6 +7763,10 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7963
7763
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7964
7764
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
7965
7765
|
const productSelections = (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
7766
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
7767
|
+
var _context;
|
|
7768
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7769
|
+
});
|
|
7966
7770
|
const onOptionClick = event => {
|
|
7967
7771
|
const productSelectionId = event.target.value;
|
|
7968
7772
|
const currentProductSelection = _findInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => productSelection.id === productSelectionId);
|
|
@@ -7977,12 +7781,18 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7977
7781
|
isRequired: props.isRequired,
|
|
7978
7782
|
description: props.description,
|
|
7979
7783
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsBasicSelectPlaceholder),
|
|
7980
|
-
options: mapProductSelectionsToOptions$1(
|
|
7784
|
+
options: mapProductSelectionsToOptions$1(filteredProductSelections, dataLocale, projectLanguages),
|
|
7981
7785
|
components: props.components,
|
|
7982
7786
|
onChange: onOptionClick,
|
|
7787
|
+
onBlur: props.onBlur,
|
|
7983
7788
|
isDisabled: props.isDisabled,
|
|
7984
7789
|
isReadOnly: props.isReadOnly,
|
|
7985
7790
|
hasWarning: props.hasWarning,
|
|
7791
|
+
hasError: props.hasError,
|
|
7792
|
+
isClearable: props.isClearable,
|
|
7793
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7794
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7795
|
+
maxMenuHeight: props.maxMenuHeight,
|
|
7986
7796
|
isSearchable: true
|
|
7987
7797
|
});
|
|
7988
7798
|
}
|
|
@@ -7990,6 +7800,28 @@ function ProductSelectionBasicSelectDropdown(props) {
|
|
|
7990
7800
|
const LOWER_PRODUCT_SELECTIONS_LIMIT = 60;
|
|
7991
7801
|
const UPPER_PRODUCT_SELECTIONS_LIMIT = 500;
|
|
7992
7802
|
|
|
7803
|
+
const getValueFromOptions$3 = _ref => {
|
|
7804
|
+
let currentlySelectedProductSelections = _ref.currentlySelectedProductSelections,
|
|
7805
|
+
allProductSelectionOptions = _ref.allProductSelectionOptions,
|
|
7806
|
+
isMulti = _ref.isMulti;
|
|
7807
|
+
// return value as undefined if no options is yet selected. It is needed for cases where users sets initial values as empty string
|
|
7808
|
+
if (!currentlySelectedProductSelections) {
|
|
7809
|
+
return undefined;
|
|
7810
|
+
}
|
|
7811
|
+
|
|
7812
|
+
// handle async-select-field value transformation
|
|
7813
|
+
if (isMulti) {
|
|
7814
|
+
return _filterInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === null || currentlySelectedProductSelections === void 0 ? void 0 : _includesInstanceProperty__default["default"](currentlySelectedProductSelections).call(currentlySelectedProductSelections, ps.value));
|
|
7815
|
+
}
|
|
7816
|
+
|
|
7817
|
+
// in case it is not multiselect, then a single valued async-select-input is being requested and the value should have proper format
|
|
7818
|
+
return _findInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, ps => currentlySelectedProductSelections === ps.value);
|
|
7819
|
+
};
|
|
7820
|
+
const emptyStoreOption$1 = intl => [{
|
|
7821
|
+
label: intl.formatMessage(pickerMessages.asyncSelectDropdownTypeAheadPrompt),
|
|
7822
|
+
value: undefined,
|
|
7823
|
+
isDisabled: true
|
|
7824
|
+
}];
|
|
7993
7825
|
function ProductSelectionsAsyncSelectDropdown(props) {
|
|
7994
7826
|
var _productSelectionsFet3;
|
|
7995
7827
|
const intl = reactIntl.useIntl();
|
|
@@ -8007,6 +7839,10 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8007
7839
|
var _productSelectionsFet, _productSelectionsFet2;
|
|
8008
7840
|
return (_productSelectionsFet = (_productSelectionsFet2 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet2 === void 0 ? void 0 : _productSelectionsFet2.results) !== null && _productSelectionsFet !== void 0 ? _productSelectionsFet : [];
|
|
8009
7841
|
}, [(_productSelectionsFet3 = productSelectionsFetcher.productSelections) === null || _productSelectionsFet3 === void 0 ? void 0 : _productSelectionsFet3.results]);
|
|
7842
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](productSelections).call(productSelections, ps => {
|
|
7843
|
+
var _context;
|
|
7844
|
+
return !_includesInstanceProperty__default["default"](_context = props.excludedProductSelectionIds).call(_context, ps.id);
|
|
7845
|
+
});
|
|
8010
7846
|
const onOptionClick = event => {
|
|
8011
7847
|
var _event$target$value;
|
|
8012
7848
|
const productSelectionId = (_event$target$value = event.target.value) === null || _event$target$value === void 0 ? void 0 : _event$target$value.value;
|
|
@@ -8014,7 +7850,7 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8014
7850
|
props.onChange(currentProductSelection);
|
|
8015
7851
|
};
|
|
8016
7852
|
const allProductSelectionOptions = React.useMemo(() => {
|
|
8017
|
-
return _mapInstanceProperty__default["default"](
|
|
7853
|
+
return _mapInstanceProperty__default["default"](filteredProductSelections).call(filteredProductSelections, productSelection => {
|
|
8018
7854
|
const localizedName = l10n.formatLocalizedString(productSelection, {
|
|
8019
7855
|
key: 'name',
|
|
8020
7856
|
locale: dataLocale,
|
|
@@ -8027,17 +7863,26 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8027
7863
|
key: productSelection.key
|
|
8028
7864
|
};
|
|
8029
7865
|
});
|
|
8030
|
-
}, [dataLocale, projectLanguages,
|
|
7866
|
+
}, [dataLocale, projectLanguages, filteredProductSelections]);
|
|
8031
7867
|
const getDefaultOptions = () => {
|
|
8032
|
-
return
|
|
7868
|
+
return [{
|
|
7869
|
+
options: _sliceInstanceProperty__default["default"](allProductSelectionOptions).call(allProductSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT)
|
|
7870
|
+
}, {
|
|
7871
|
+
options: emptyStoreOption$1(intl)
|
|
7872
|
+
}];
|
|
8033
7873
|
};
|
|
8034
7874
|
const handleLoadOptions = async searchTerm => {
|
|
8035
7875
|
const productSelectionOptions = allProductSelectionOptions;
|
|
8036
7876
|
const filteredOptions = _filterInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, productSelection => {
|
|
8037
|
-
var
|
|
8038
|
-
return _includesInstanceProperty__default["default"](
|
|
7877
|
+
var _context2, _context3;
|
|
7878
|
+
return _includesInstanceProperty__default["default"](_context2 = productSelection.label.toLowerCase()).call(_context2, searchTerm.toLowerCase()) || productSelection.key && _includesInstanceProperty__default["default"](_context3 = productSelection.key.toLowerCase()).call(_context3, searchTerm.toLowerCase());
|
|
8039
7879
|
});
|
|
8040
|
-
|
|
7880
|
+
const finalOptions = searchTerm ? _sliceInstanceProperty__default["default"](filteredOptions).call(filteredOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT) : _sliceInstanceProperty__default["default"](productSelectionOptions).call(productSelectionOptions, 0, LOWER_PRODUCT_SELECTIONS_LIMIT);
|
|
7881
|
+
return [{
|
|
7882
|
+
options: finalOptions
|
|
7883
|
+
}, {
|
|
7884
|
+
options: emptyStoreOption$1(intl)
|
|
7885
|
+
}];
|
|
8041
7886
|
};
|
|
8042
7887
|
if (productSelectionsFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8043
7888
|
return jsxRuntime.jsx(uiKit.AsyncSelectField, {
|
|
@@ -8048,22 +7893,60 @@ function ProductSelectionsAsyncSelectDropdown(props) {
|
|
|
8048
7893
|
isRequired: props.isRequired,
|
|
8049
7894
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsAsyncSelectPlaceholder),
|
|
8050
7895
|
loadOptions: handleLoadOptions,
|
|
7896
|
+
value: getValueFromOptions$3({
|
|
7897
|
+
currentlySelectedProductSelections: props.value,
|
|
7898
|
+
allProductSelectionOptions,
|
|
7899
|
+
isMulti: props.isMulti
|
|
7900
|
+
}),
|
|
8051
7901
|
onChange: onOptionClick,
|
|
7902
|
+
onBlur: props.onBlur,
|
|
8052
7903
|
isDisabled: props.isDisabled,
|
|
7904
|
+
showOptionGroupDivider: true,
|
|
8053
7905
|
isReadOnly: props.isReadOnly,
|
|
8054
7906
|
components: props.components,
|
|
8055
7907
|
defaultOptions: getDefaultOptions(),
|
|
8056
|
-
hasWarning: props.hasWarning
|
|
7908
|
+
hasWarning: props.hasWarning,
|
|
7909
|
+
hasError: props.hasError,
|
|
7910
|
+
isClearable: props.isClearable,
|
|
7911
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
7912
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
7913
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8057
7914
|
});
|
|
8058
7915
|
}
|
|
8059
7916
|
|
|
7917
|
+
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 } } } };
|
|
7918
|
+
const createQueryVariables$7 = (productSelections, predicateField) => {
|
|
7919
|
+
var _context;
|
|
7920
|
+
return {
|
|
7921
|
+
where: _concatInstanceProperty__default["default"](_context = "".concat(predicateField, " in (")).call(_context, _mapInstanceProperty__default["default"](productSelections).call(productSelections, ps => "\"".concat(ps, "\"")).join(', '), ")"),
|
|
7922
|
+
limit: 500
|
|
7923
|
+
};
|
|
7924
|
+
};
|
|
7925
|
+
const useProductSelectionsByFieldFetcher = (productSelections, predicateField) => {
|
|
7926
|
+
var _productSelectionsQue, _productSelectionsQue2;
|
|
7927
|
+
const productSelectionList = _Array$isArray__default["default"](productSelections) ? productSelections : [productSelections];
|
|
7928
|
+
const productSelectionsQuery = react.useQuery(ProductSelectionsPickerFetcher$1, {
|
|
7929
|
+
context: {
|
|
7930
|
+
target: constants.GRAPHQL_TARGETS.COMMERCETOOLS_PLATFORM
|
|
7931
|
+
},
|
|
7932
|
+
variables: createQueryVariables$7(productSelectionList, predicateField),
|
|
7933
|
+
skip: productSelectionList.length === 0
|
|
7934
|
+
});
|
|
7935
|
+
return {
|
|
7936
|
+
productSelections: (_productSelectionsQue = (_productSelectionsQue2 = productSelectionsQuery.data) === null || _productSelectionsQue2 === void 0 ? void 0 : _productSelectionsQue2.productSelections.results) !== null && _productSelectionsQue !== void 0 ? _productSelectionsQue : [],
|
|
7937
|
+
isLoading: productSelectionsQuery.loading
|
|
7938
|
+
};
|
|
7939
|
+
};
|
|
7940
|
+
|
|
8060
7941
|
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 } } } };
|
|
8061
|
-
const mapProductSelectionsToOptions = memoize__default["default"](
|
|
8062
|
-
let
|
|
8063
|
-
|
|
8064
|
-
|
|
7942
|
+
const mapProductSelectionsToOptions = memoize__default["default"](_ref => {
|
|
7943
|
+
let _ref$productSelection = _ref.productSelections,
|
|
7944
|
+
productSelections = _ref$productSelection === void 0 ? [] : _ref$productSelection,
|
|
7945
|
+
dataLocale = _ref.dataLocale,
|
|
7946
|
+
projectLanguages = _ref.projectLanguages,
|
|
7947
|
+
renderSelectInputOptionValuesByField = _ref.renderSelectInputOptionValuesByField;
|
|
8065
7948
|
return _mapInstanceProperty__default["default"](productSelections).call(productSelections, productSelection => ({
|
|
8066
|
-
value: productSelection.id,
|
|
7949
|
+
value: renderSelectInputOptionValuesByField === 'key' ? productSelection.key : productSelection.id,
|
|
8067
7950
|
label: l10n.formatLocalizedString(productSelection, {
|
|
8068
7951
|
key: 'name',
|
|
8069
7952
|
locale: dataLocale,
|
|
@@ -8072,9 +7955,22 @@ const mapProductSelectionsToOptions = memoize__default["default"](function () {
|
|
|
8072
7955
|
key: productSelection.key
|
|
8073
7956
|
}));
|
|
8074
7957
|
});
|
|
8075
|
-
const
|
|
7958
|
+
const getValueFromOptions$2 = _ref2 => {
|
|
7959
|
+
let isMulti = _ref2.isMulti,
|
|
7960
|
+
currentlySelectedProductSelections = _ref2.currentlySelectedProductSelections,
|
|
7961
|
+
productSelectionFieldOptions = _ref2.productSelectionFieldOptions;
|
|
7962
|
+
if (!currentlySelectedProductSelections) {
|
|
7963
|
+
return undefined;
|
|
7964
|
+
}
|
|
7965
|
+
if (isMulti) {
|
|
7966
|
+
return productSelectionFieldOptions;
|
|
7967
|
+
}
|
|
7968
|
+
// if the input is not multiselect, the AsyncSearchSelect is expecting an object rather than array
|
|
7969
|
+
return productSelectionFieldOptions[0];
|
|
7970
|
+
};
|
|
7971
|
+
const createQueryVariables$6 = _ref3 => {
|
|
8076
7972
|
var _context;
|
|
8077
|
-
let searchText =
|
|
7973
|
+
let searchText = _ref3.searchText;
|
|
8078
7974
|
const sanitizedSearchText = sanitize(_trimInstanceProperty__default["default"](searchText).call(searchText, searchText));
|
|
8079
7975
|
const idQuery = isUUID(sanitizedSearchText) && "id = \"".concat(sanitizedSearchText, "\"");
|
|
8080
7976
|
const keyQuery = "key = \"".concat(sanitizedSearchText, "\"");
|
|
@@ -8084,6 +7980,7 @@ const createQueryVariables$6 = _ref => {
|
|
|
8084
7980
|
};
|
|
8085
7981
|
};
|
|
8086
7982
|
function ProductSelectionsSearchSelectDropdown(props) {
|
|
7983
|
+
var _context3;
|
|
8087
7984
|
const intl = reactIntl.useIntl();
|
|
8088
7985
|
const _useState = React.useState([]),
|
|
8089
7986
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -8096,6 +7993,7 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8096
7993
|
})),
|
|
8097
7994
|
projectLanguages = _useApplicationContex.projectLanguages,
|
|
8098
7995
|
dataLocale = _useApplicationContex.dataLocale;
|
|
7996
|
+
const productSelectionsByFieldFetcher = useProductSelectionsByFieldFetcher(props.value, props.renderSelectInputOptionValuesByField);
|
|
8099
7997
|
const handleLoadOptions = async searchText => {
|
|
8100
7998
|
var _data$productSelectio, _data$productSelectio2;
|
|
8101
7999
|
const _await$client$query = await client$1.query({
|
|
@@ -8111,8 +8009,17 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8111
8009
|
data = _await$client$query.data;
|
|
8112
8010
|
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 : [];
|
|
8113
8011
|
const updatedProductSelections = _mapInstanceProperty__default["default"](matchedProductSelections).call(matchedProductSelections, convertProductSelectionFromGraphQl);
|
|
8114
|
-
|
|
8115
|
-
|
|
8012
|
+
const filteredProductSelections = _filterInstanceProperty__default["default"](updatedProductSelections).call(updatedProductSelections, ps => {
|
|
8013
|
+
var _context2;
|
|
8014
|
+
return !_includesInstanceProperty__default["default"](_context2 = props.excludedProductSelectionIds).call(_context2, ps.id);
|
|
8015
|
+
});
|
|
8016
|
+
setProductSelectionResults(filteredProductSelections);
|
|
8017
|
+
return mapProductSelectionsToOptions({
|
|
8018
|
+
productSelections: filteredProductSelections,
|
|
8019
|
+
dataLocale,
|
|
8020
|
+
projectLanguages,
|
|
8021
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8022
|
+
});
|
|
8116
8023
|
};
|
|
8117
8024
|
const loadOptionsDebounced = debounce__default["default"](handleLoadOptions, 500);
|
|
8118
8025
|
const onOptionClick = event => {
|
|
@@ -8121,33 +8028,56 @@ function ProductSelectionsSearchSelectDropdown(props) {
|
|
|
8121
8028
|
const currentProductSelection = _findInstanceProperty__default["default"](productionSelectionResults).call(productionSelectionResults, productSelection => productSelection.id === productSelectionId);
|
|
8122
8029
|
props.onChange(currentProductSelection);
|
|
8123
8030
|
};
|
|
8031
|
+
if (productSelectionsByFieldFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8124
8032
|
return jsxRuntime.jsx(uiKit.SearchSelectField, {
|
|
8125
8033
|
id: props.id,
|
|
8126
8034
|
name: props.name,
|
|
8127
8035
|
title: props.title,
|
|
8036
|
+
value: getValueFromOptions$2({
|
|
8037
|
+
currentlySelectedProductSelections: props.value,
|
|
8038
|
+
productSelectionFieldOptions: mapProductSelectionsToOptions({
|
|
8039
|
+
productSelections: _mapInstanceProperty__default["default"](_context3 = productSelectionsByFieldFetcher.productSelections).call(_context3, convertProductSelectionFromGraphQl),
|
|
8040
|
+
dataLocale,
|
|
8041
|
+
projectLanguages,
|
|
8042
|
+
renderSelectInputOptionValuesByField: props.renderSelectInputOptionValuesByField
|
|
8043
|
+
}),
|
|
8044
|
+
isMulti: props.isMulti
|
|
8045
|
+
}),
|
|
8128
8046
|
description: props.description,
|
|
8129
8047
|
isRequired: props.isRequired,
|
|
8130
8048
|
placeholder: intl.formatMessage(pickerMessages.productSelectionsSearchSelectPlaceholder),
|
|
8131
8049
|
loadOptions: loadOptionsDebounced,
|
|
8132
8050
|
onChange: onOptionClick,
|
|
8051
|
+
onBlur: props.onBlur,
|
|
8133
8052
|
components: props.components,
|
|
8134
|
-
isDisabled: props.isDisabled,
|
|
8053
|
+
isDisabled: props.isDisabled || productSelectionsByFieldFetcher.isLoading,
|
|
8135
8054
|
isReadOnly: props.isReadOnly,
|
|
8136
|
-
hasWarning: props.hasWarning
|
|
8055
|
+
hasWarning: props.hasWarning,
|
|
8056
|
+
isClearable: props.isClearable,
|
|
8057
|
+
hasError: props.hasError,
|
|
8058
|
+
menuPortalTarget: props.menuPortalTarget,
|
|
8059
|
+
menuPortalZIndex: props.menuPortalZIndex,
|
|
8060
|
+
maxMenuHeight: props.maxMenuHeight
|
|
8137
8061
|
});
|
|
8138
8062
|
}
|
|
8139
8063
|
|
|
8140
8064
|
function ownKeys$N(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8141
8065
|
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__default["default"](_context = ownKeys$N(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$N(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
8142
|
-
const components = {
|
|
8143
|
-
// eslint-disable-next-line react/display-name
|
|
8144
|
-
Option: optionInnerProps => jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8145
|
-
optionType: "double-property",
|
|
8146
|
-
optionInnerProps: optionInnerProps
|
|
8147
|
-
})
|
|
8148
|
-
};
|
|
8149
8066
|
function ProductSelectionsPicker(props) {
|
|
8150
8067
|
const productSelectionsTotalFetcher = useProductSelectionsTotalFetcher();
|
|
8068
|
+
const components = React.useMemo(() => {
|
|
8069
|
+
return {
|
|
8070
|
+
Option: optionInnerProps => {
|
|
8071
|
+
if (optionInnerProps.isDisabled) {
|
|
8072
|
+
return jsxRuntime.jsx(uiKit.SelectInput.Option, _objectSpread$N({}, optionInnerProps));
|
|
8073
|
+
}
|
|
8074
|
+
return jsxRuntime.jsx(selectUtils.CustomSelectInputOption, {
|
|
8075
|
+
optionType: props.optionType,
|
|
8076
|
+
optionInnerProps: optionInnerProps
|
|
8077
|
+
});
|
|
8078
|
+
}
|
|
8079
|
+
};
|
|
8080
|
+
}, [props.optionType]);
|
|
8151
8081
|
if (productSelectionsTotalFetcher.isLoading) return jsxRuntime.jsx(CenteredLoadingSpinner, {});
|
|
8152
8082
|
const CustomProductSelectionsPicker = productSelectionsTotalFetcher.total <= props.lowerProductSelectionsLimit ? ProductSelectionBasicSelectDropdown : productSelectionsTotalFetcher.total <= props.upperProductSelectionsLimit ? ProductSelectionsAsyncSelectDropdown : ProductSelectionsSearchSelectDropdown;
|
|
8153
8083
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
@@ -8163,7 +8093,13 @@ ProductSelectionsPicker.defaultProps = {
|
|
|
8163
8093
|
optionType: 'double-property',
|
|
8164
8094
|
isMulti: false,
|
|
8165
8095
|
isRequired: false,
|
|
8166
|
-
hasWarning: false
|
|
8096
|
+
hasWarning: false,
|
|
8097
|
+
hasError: false,
|
|
8098
|
+
isClearable: false,
|
|
8099
|
+
isReadOnly: false,
|
|
8100
|
+
isDisabled: false,
|
|
8101
|
+
excludedProductSelectionIds: [],
|
|
8102
|
+
title: '' // FieldLabel requires title to have some value
|
|
8167
8103
|
};
|
|
8168
8104
|
|
|
8169
8105
|
const COUNTRIES_ASYNC_LOADING_LIMIT = 60;
|
|
@@ -8294,43 +8230,9 @@ var messages$y = reactIntl.defineMessages({
|
|
|
8294
8230
|
}
|
|
8295
8231
|
});
|
|
8296
8232
|
|
|
8297
|
-
const trackingEvents = {
|
|
8298
|
-
selectCustomerGroupName: {
|
|
8299
|
-
action: 'select',
|
|
8300
|
-
category: 'ReferenceCustomerGroup',
|
|
8301
|
-
label: 'name'
|
|
8302
|
-
},
|
|
8303
|
-
selectCustomerGroupKey: {
|
|
8304
|
-
action: 'select',
|
|
8305
|
-
category: 'ReferenceCustomerGroup',
|
|
8306
|
-
label: 'key'
|
|
8307
|
-
},
|
|
8308
|
-
selectCustomerGroupId: {
|
|
8309
|
-
action: 'select',
|
|
8310
|
-
category: 'ReferenceCustomerGroup',
|
|
8311
|
-
label: 'id'
|
|
8312
|
-
},
|
|
8313
|
-
selectWithoutTyping: {
|
|
8314
|
-
action: 'select',
|
|
8315
|
-
category: 'ReferenceCustomerGroup',
|
|
8316
|
-
label: 'noEntry'
|
|
8317
|
-
}
|
|
8318
|
-
};
|
|
8319
|
-
|
|
8320
8233
|
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 } } } };
|
|
8321
8234
|
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 } } } };
|
|
8322
8235
|
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 } } } };
|
|
8323
|
-
const getTrackingEvent = (inputValue, selectedValue) => {
|
|
8324
|
-
const id = selectedValue.value,
|
|
8325
|
-
key = selectedValue.key,
|
|
8326
|
-
name = selectedValue.name;
|
|
8327
|
-
const selectWithoutTyping = trackingEvents.selectWithoutTyping,
|
|
8328
|
-
selectCustomerGroupId = trackingEvents.selectCustomerGroupId,
|
|
8329
|
-
selectCustomerGroupKey = trackingEvents.selectCustomerGroupKey,
|
|
8330
|
-
selectCustomerGroupName = trackingEvents.selectCustomerGroupName;
|
|
8331
|
-
const trackingEvent = !inputValue ? selectWithoutTyping : _startsWithInstanceProperty__default["default"](name).call(name, inputValue) ? selectCustomerGroupName : _startsWithInstanceProperty__default["default"](key).call(key, inputValue) ? selectCustomerGroupKey : id === inputValue ? selectCustomerGroupId : void 0;
|
|
8332
|
-
return trackingEvent;
|
|
8333
|
-
};
|
|
8334
8236
|
const CustomerGroupPickerInput = _ref => {
|
|
8335
8237
|
var _currentOption$data$l, _currentOption$data;
|
|
8336
8238
|
let isClearable = _ref.isClearable,
|
|
@@ -8393,7 +8295,7 @@ const CustomerGroupPickerInput = _ref => {
|
|
|
8393
8295
|
onError(error);
|
|
8394
8296
|
}), [loadOptions, convertCustomerGroupToOption, onError]);
|
|
8395
8297
|
const loadOptionsDebounced = useDebouncedPromiseCallback(handleLoadOptions, 300);
|
|
8396
|
-
const _useHandlers = useHandlers(onChange
|
|
8298
|
+
const _useHandlers = useHandlers(onChange),
|
|
8397
8299
|
_useHandlers2 = _slicedToArray(_useHandlers, 2),
|
|
8398
8300
|
handleInternalInputChange = _useHandlers2[0],
|
|
8399
8301
|
handleChange = _useHandlers2[1];
|
|
@@ -9790,11 +9692,9 @@ const mergeOverwritten = (inherited, explicit) => {
|
|
|
9790
9692
|
};
|
|
9791
9693
|
};
|
|
9792
9694
|
const mergeAssociates = businessUnit => {
|
|
9793
|
-
var _context2;
|
|
9794
|
-
const _businessUnit$associa = businessUnit.associates,
|
|
9795
|
-
|
|
9796
|
-
_businessUnit$inherit = businessUnit.inheritedAssociates,
|
|
9797
|
-
inheritedAssociates = _businessUnit$inherit === void 0 ? [] : _businessUnit$inherit;
|
|
9695
|
+
var _businessUnit$associa, _businessUnit$inherit, _context2;
|
|
9696
|
+
const associates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$associa = businessUnit.associates) === null || _businessUnit$associa === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$associa).call(_businessUnit$associa, associate => associate === null || associate === void 0 ? void 0 : associate.customer);
|
|
9697
|
+
const inheritedAssociates = businessUnit === null || businessUnit === void 0 ? void 0 : (_businessUnit$inherit = businessUnit.inheritedAssociates) === null || _businessUnit$inherit === void 0 ? void 0 : _filterInstanceProperty__default["default"](_businessUnit$inherit).call(_businessUnit$inherit, inheritedAssociate => inheritedAssociate === null || inheritedAssociate === void 0 ? void 0 : inheritedAssociate.customer);
|
|
9798
9698
|
const overwrittenOnExplicit = intersectionBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
9799
9699
|
const overwrittenOnInherited = intersectionBy__default["default"](inheritedAssociates, associates, 'customer.id') || [];
|
|
9800
9700
|
const onlyExplicit = differenceBy__default["default"](associates, inheritedAssociates, 'customer.id') || [];
|
|
@@ -9895,10 +9795,10 @@ var messages$r = reactIntl.defineMessages({
|
|
|
9895
9795
|
function ownKeys$A(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9896
9796
|
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__default["default"](_context3 = ownKeys$A(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$A(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
9897
9797
|
const BusinessUnitAssociatesListView = props => {
|
|
9898
|
-
var _props$values, _props$values$associa;
|
|
9798
|
+
var _props$values, _props$values$associa, _props$values2, _props$values2$inheri;
|
|
9899
9799
|
const intl = reactIntl.useIntl();
|
|
9900
9800
|
const businessUnitsAssociateRolesFeatureEnabled = applicationShell.useFeatureToggle(ENABLE_BUSINESS_UNITS_ASSOCIATE_ROLES);
|
|
9901
|
-
const totalAssociates = (_props$values = _valuesInstanceProperty__default["default"](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;
|
|
9801
|
+
const totalAssociates = ((_props$values = _valuesInstanceProperty__default["default"](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__default["default"](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);
|
|
9902
9802
|
const isBusinessUnitCreation = !isUUID(props.businessUnitId);
|
|
9903
9803
|
const _usePaginationState = uiKit.usePaginationState({
|
|
9904
9804
|
perPage: 20
|
|
@@ -9913,8 +9813,8 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
9913
9813
|
searchValue = _useState2[0],
|
|
9914
9814
|
setSearchValue = _useState2[1];
|
|
9915
9815
|
const associates = React.useMemo(() => {
|
|
9916
|
-
var _props$
|
|
9917
|
-
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty__default["default"](props)) : (_props$
|
|
9816
|
+
var _props$values3, _context, _context2;
|
|
9817
|
+
return businessUnitsAssociateRolesFeatureEnabled ? mergeAssociates(_valuesInstanceProperty__default["default"](props)) : (_props$values3 = _valuesInstanceProperty__default["default"](props)) === null || _props$values3 === void 0 ? void 0 : _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](_context2 = _props$values3.associates).call(_context2, associate => associate === null || associate === void 0 ? void 0 : associate.customer)).call(_context, associate => _objectSpread$A(_objectSpread$A({}, associate), {}, {
|
|
9918
9818
|
id: associate.customer.id
|
|
9919
9819
|
}));
|
|
9920
9820
|
}, [_valuesInstanceProperty__default["default"](props), businessUnitsAssociateRolesFeatureEnabled]);
|
|
@@ -10038,7 +9938,7 @@ const BusinessUnitAssociatesListView = props => {
|
|
|
10038
9938
|
};
|
|
10039
9939
|
BusinessUnitAssociatesListView.displayName = 'BusinessUnitAssociatesListView';
|
|
10040
9940
|
|
|
10041
|
-
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:
|
|
9941
|
+
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 } } } };
|
|
10042
9942
|
const useBusinessUnitAssociatesFetcher = _ref => {
|
|
10043
9943
|
let id = _ref.id,
|
|
10044
9944
|
shouldExcludeRoles = _ref.shouldExcludeRoles,
|
|
@@ -12316,9 +12216,6 @@ var messages$7 = reactIntl.defineMessages({
|
|
|
12316
12216
|
function ownKeys$f(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12317
12217
|
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__default["default"](_context = ownKeys$f(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$f(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
12318
12218
|
const MissingValueField = props => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
12319
|
-
"data-track-component": "MissingValue",
|
|
12320
|
-
"data-track-event": "change",
|
|
12321
|
-
"data-track-label": props.isChecked,
|
|
12322
12219
|
name: "missing-value",
|
|
12323
12220
|
isChecked: props.isChecked,
|
|
12324
12221
|
onChange: props.onChange,
|
|
@@ -12614,6 +12511,7 @@ const SelectableFieldSearchInput = props => {
|
|
|
12614
12511
|
return jsxRuntime.jsx("div", {
|
|
12615
12512
|
className: styles$4.container,
|
|
12616
12513
|
children: jsxRuntime.jsx(uiKit.SelectableSearchInput, {
|
|
12514
|
+
menuHorizontalConstraint: 5,
|
|
12617
12515
|
options: props.options,
|
|
12618
12516
|
value: {
|
|
12619
12517
|
text: searchText,
|
|
@@ -14184,30 +14082,6 @@ const getTimeZoneLabel = memoize__default["default"]((selectedTimeZone, timeZone
|
|
|
14184
14082
|
return _concatInstanceProperty__default["default"](_context4 = "(GMT ".concat(timeZoneData.offset, ") ")).call(_context4, timeZoneData.name);
|
|
14185
14083
|
});
|
|
14186
14084
|
|
|
14187
|
-
function findButtonLinkPathname(element) {
|
|
14188
|
-
if (element.tagName === 'A') {
|
|
14189
|
-
var _context;
|
|
14190
|
-
const linkUrl = new _URL__default["default"](element.href);
|
|
14191
|
-
return _concatInstanceProperty__default["default"](_context = "".concat(linkUrl.pathname)).call(_context, linkUrl.search);
|
|
14192
|
-
}
|
|
14193
|
-
return findButtonLinkPathname(element.parentElement);
|
|
14194
|
-
}
|
|
14195
|
-
function trackMenuClick(_ref) {
|
|
14196
|
-
let event = _ref.event,
|
|
14197
|
-
track = _ref.track,
|
|
14198
|
-
pathToMatch = _ref.pathToMatch,
|
|
14199
|
-
trackingEvent = _ref.trackingEvent;
|
|
14200
|
-
const buttonLinkPathname = findButtonLinkPathname(event.target);
|
|
14201
|
-
const shouldTrackEvent = !!reactRouterDom.matchPath(buttonLinkPathname, {
|
|
14202
|
-
path: pathToMatch,
|
|
14203
|
-
exact: true,
|
|
14204
|
-
strict: true
|
|
14205
|
-
});
|
|
14206
|
-
if (shouldTrackEvent) {
|
|
14207
|
-
track(trackingEvent.action, trackingEvent.category, trackingEvent.label);
|
|
14208
|
-
}
|
|
14209
|
-
}
|
|
14210
|
-
|
|
14211
14085
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14212
14086
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
14213
14087
|
function withPendingRequests() {
|
|
@@ -14393,7 +14267,6 @@ exports.splitVariantAttributesByConstraint = splitVariantAttributesByConstraint;
|
|
|
14393
14267
|
exports.storesListConnectorMockHandlers = handlers$7;
|
|
14394
14268
|
exports.stringToBase64 = stringToBase64;
|
|
14395
14269
|
exports.swapArrayItems = swapArrayItems;
|
|
14396
|
-
exports.trackMenuClick = trackMenuClick;
|
|
14397
14270
|
exports.transformAllToProperNounCase = transformAllToProperNounCase;
|
|
14398
14271
|
exports.transformCustomFieldsRawToCustomFields = transformCustomFieldsRawToCustomFields;
|
|
14399
14272
|
exports.transformLocalizedFieldsForCategory = transformLocalizedFieldsForCategory;
|
|
@@ -14422,9 +14295,6 @@ exports.useTaxCategoriesPlatformLimits = useTaxCategoriesLimits;
|
|
|
14422
14295
|
exports.useTotalNumberOfBusinessUnitsFetcherHandlers = handlers$1;
|
|
14423
14296
|
exports.useTotalNumberOfStoresFetcher = useTotalNumberOfStoresFetcher;
|
|
14424
14297
|
exports.useTotalNumberOfStoresFetcherHandlers = handlers$3;
|
|
14425
|
-
exports.useTracking = useTracking;
|
|
14426
|
-
exports.useTrackingContext = useTracking;
|
|
14427
|
-
exports.useTrackingShared = useTrackingShared;
|
|
14428
14298
|
exports.validateCustomField = validateFilter$2;
|
|
14429
14299
|
exports.validateCustomFields = validations;
|
|
14430
14300
|
exports.validateDate = validateFilter$1;
|