@bonlineza/luxity-lib 2.39.9 → 2.40.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.
package/build/bundle.js CHANGED
@@ -10568,11 +10568,13 @@
10568
10568
  className = _ref.className,
10569
10569
  title = _ref.title,
10570
10570
  searchPlaceHolder = _ref.searchPlaceHolder,
10571
- onSearchChanged = _ref.onSearchChanged;
10571
+ onSearchChanged = _ref.onSearchChanged,
10572
+ _ref$searchable = _ref.searchable,
10573
+ searchable = _ref$searchable === void 0 ? true : _ref$searchable;
10572
10574
  return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
10573
10575
  className: "".concat(className, " ").concat(baseClass, "__title"),
10574
10576
  title: title
10575
- }, /*#__PURE__*/React__default.createElement("div", {
10577
+ }, searchable && /*#__PURE__*/React__default.createElement("div", {
10576
10578
  className: "title__search"
10577
10579
  }, /*#__PURE__*/React__default.createElement(Search, null), /*#__PURE__*/React__default.createElement("input", {
10578
10580
  placeholder: searchPlaceHolder,
@@ -10656,6 +10658,7 @@
10656
10658
  resultProcessor = _this$props.resultProcessor,
10657
10659
  itemRenderer = _this$props.itemRenderer,
10658
10660
  searchPlaceHolder = _this$props.searchPlaceHolder,
10661
+ searchable = _this$props.searchable,
10659
10662
  graphApi = _this$props.graphApi,
10660
10663
  identifier = _this$props.identifier,
10661
10664
  requestInstance = _this$props.requestInstance;
@@ -10665,6 +10668,7 @@
10665
10668
  title: title,
10666
10669
  baseClass: baseClass,
10667
10670
  searchPlaceHolder: searchPlaceHolder,
10671
+ searchable: searchable,
10668
10672
  onSearchChanged: _this.onSearchChanged
10669
10673
  }), /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(GraphQLMultiSelector$1, {
10670
10674
  triggerRequest: function triggerRequest() {
@@ -10718,6 +10722,7 @@
10718
10722
  LuxityGraphQLMultiselector.defaultProps = {
10719
10723
  baseClass: '',
10720
10724
  searchPlaceHolder: '',
10725
+ searchable: true,
10721
10726
  queryLimitIncrement: 12,
10722
10727
  baseQueryLimit: 12
10723
10728
  };
@@ -10813,6 +10818,48 @@
10813
10818
  }
10814
10819
  };
10815
10820
 
10821
+ var ApparelSizeSelector = function ApparelSizeSelector(_ref) {
10822
+ var onChange = _ref.onChange,
10823
+ category = _ref.category,
10824
+ graphApi = _ref.graphApi,
10825
+ itemRenderer = _ref.itemRenderer,
10826
+ getGraphQuery = _ref.getGraphQuery,
10827
+ resultProcessor = _ref.resultProcessor,
10828
+ requestInstance = _ref.requestInstance;
10829
+ return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
10830
+ title: "Sizes",
10831
+ queryId: "getApparelSizes",
10832
+ baseQueryLimit: 16,
10833
+ baseClass: "apparel-size-selector",
10834
+ identifier: "apparel-size-selector",
10835
+ searchable: false,
10836
+ category: category,
10837
+ onChange: onChange,
10838
+ graphApi: graphApi,
10839
+ itemRenderer: itemRenderer,
10840
+ getGraphQuery: getGraphQuery,
10841
+ resultProcessor: resultProcessor,
10842
+ requestInstance: requestInstance
10843
+ });
10844
+ };
10845
+
10846
+ ApparelSizeSelector.defaultProps = {
10847
+ itemRenderer: ItemRenderer,
10848
+ resultProcessor: function resultProcessor(result) {
10849
+ return {
10850
+ data: (result.data.data.luxity_universal_apparel_size_list || []).map(function (_ref2) {
10851
+ var id = _ref2.id,
10852
+ size = _ref2.size;
10853
+ return {
10854
+ id: id,
10855
+ name: size
10856
+ };
10857
+ }),
10858
+ has_more_pages: false
10859
+ };
10860
+ }
10861
+ };
10862
+
10816
10863
  var shoeSizeTypes = {
10817
10864
  uk: {
10818
10865
  label: 'UK',
@@ -11189,6 +11236,7 @@
11189
11236
  min_price: null,
11190
11237
  max_price: null,
11191
11238
  styles: [],
11239
+ apparel_sizes: [],
11192
11240
  gender: [],
11193
11241
  condition: [],
11194
11242
  request: _objectSpread2({}, request),
@@ -11218,7 +11266,8 @@
11218
11266
  _this.setState({
11219
11267
  category_type: categoryType,
11220
11268
  brands: [],
11221
- styles: []
11269
+ styles: [],
11270
+ apparel_sizes: []
11222
11271
  });
11223
11272
  });
11224
11273
 
@@ -11267,6 +11316,14 @@
11267
11316
  });
11268
11317
  });
11269
11318
 
11319
+ _defineProperty(_assertThisInitialized(_this), "onApparelSizesChanged", function (apparelSizesArray) {
11320
+ _this.setState({
11321
+ apparel_sizes: apparelSizesArray.map(function (apparelSize) {
11322
+ return apparelSize.id;
11323
+ })
11324
+ });
11325
+ });
11326
+
11270
11327
  _defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
11271
11328
  _this.setState({
11272
11329
  condition: conditions.map(function (condition) {
@@ -11296,6 +11353,7 @@
11296
11353
  min_price = _this$state.min_price,
11297
11354
  max_price = _this$state.max_price,
11298
11355
  styles = _this$state.styles,
11356
+ apparel_sizes = _this$state.apparel_sizes,
11299
11357
  category_type = _this$state.category_type,
11300
11358
  requestState = _this$state.request,
11301
11359
  gender = _this$state.gender,
@@ -11321,8 +11379,11 @@
11321
11379
  max_shoe_size_id: max_shoe_size_id,
11322
11380
  shoe_size_type: shoe_size_type
11323
11381
  } : {};
11382
+ var apparelSizesPayload = category_type === interestCategories.APPAREL ? {
11383
+ apparel_sizes: apparel_sizes
11384
+ } : {};
11324
11385
 
11325
- var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
11386
+ var payload = _objectSpread2(_objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload), apparelSizesPayload);
11326
11387
 
11327
11388
  simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
11328
11389
  _this.setState({
@@ -11379,6 +11440,7 @@
11379
11440
  baseGraphApi = _this$props.baseGraphApi,
11380
11441
  getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
11381
11442
  getStylesGraphQuery = _this$props.getStylesGraphQuery,
11443
+ getApparelSizesGraphQuery = _this$props.getApparelSizesGraphQuery,
11382
11444
  getShoesGraphQuery = _this$props.getShoesGraphQuery,
11383
11445
  defaultShoeSizeType = _this$props.defaultShoeSizeType,
11384
11446
  getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
@@ -11410,6 +11472,12 @@
11410
11472
  requestInstance: requestInstance,
11411
11473
  graphApi: "".concat(baseGraphApi, "?id=getStyles"),
11412
11474
  getGraphQuery: getStylesGraphQuery
11475
+ }), category_type === interestCategories.APPAREL && /*#__PURE__*/React__default.createElement(ApparelSizeSelector, {
11476
+ category: category_type,
11477
+ onChange: _this.onApparelSizesChanged,
11478
+ requestInstance: requestInstance,
11479
+ graphApi: "".concat(baseGraphApi, "?id=getApparelSizes"),
11480
+ getGraphQuery: getApparelSizesGraphQuery
11413
11481
  }), /*#__PURE__*/React__default.createElement(ConditionSelector, {
11414
11482
  onChange: _this.onConditionChanged,
11415
11483
  requestInstance: requestInstance,
@@ -12228,6 +12296,7 @@
12228
12296
  baseGraphApi = _this$props2.baseGraphApi,
12229
12297
  getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
12230
12298
  getStylesGraphQuery = _this$props2.getStylesGraphQuery,
12299
+ getApparelSizesGraphQuery = _this$props2.getApparelSizesGraphQuery,
12231
12300
  getShoesGraphQuery = _this$props2.getShoesGraphQuery,
12232
12301
  deleteInterestApi = _this$props2.deleteInterestApi,
12233
12302
  setSchedule = _this$props2.setSchedule,
@@ -12282,6 +12351,7 @@
12282
12351
  baseGraphApi: baseGraphApi,
12283
12352
  getBrandsGraphQuery: getBrandsGraphQuery,
12284
12353
  getStylesGraphQuery: getStylesGraphQuery,
12354
+ getApparelSizesGraphQuery: getApparelSizesGraphQuery,
12285
12355
  getShoesGraphQuery: getShoesGraphQuery,
12286
12356
  defaultShoeSizeType: defaultShoeSizeType,
12287
12357
  addInterestTitle: "Category Interest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonlineza/luxity-lib",
3
- "version": "2.39.9",
3
+ "version": "2.40.0",
4
4
  "packageManager": "yarn@1.22.22",
5
5
  "scripts": {
6
6
  "start": "start-storybook -p 9001 -c .storybook -s ./public",