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