@bonlineza/luxity-lib 2.28.0 → 2.29.1
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/AddInterest.js +1718 -9604
- package/BrandSelector.js +371 -10649
- package/CHANGELOG.md +275 -0
- package/GraphQLDropdownSelector.js +39 -184
- package/Interests.js +1074 -1771
- package/LuxityGraphQLDropdownSelector.js +37 -83
- package/LuxityGraphQLMultiselector.js +4 -40
- package/MaterialSelector.js +37 -83
- package/ModelSelector.js +37 -83
- package/RareStepHeader.js +3 -0
- package/StyleSelector.js +5 -47
- package/build/bundle.js +81 -371
- package/package.json +1 -1
package/build/bundle.js
CHANGED
|
@@ -9709,298 +9709,15 @@
|
|
|
9709
9709
|
|
|
9710
9710
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
9711
9711
|
|
|
9712
|
-
var _templateObject$E;
|
|
9712
|
+
var _templateObject$E, _templateObject2$6;
|
|
9713
9713
|
var ALL_ITEM = {
|
|
9714
|
-
label: 'ALL',
|
|
9715
|
-
value: 'ALL'
|
|
9716
|
-
};
|
|
9717
|
-
var StyledMultiselector = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .multiselector__selected-items,\n .multiselector__selectable-items {\n display: flex;\n flex-flow: no-wrap;\n margin-bottom: 40px;\n .dropdown-select-container {\n width: 100%;\n .dropdown-select {\n &__control {\n border-color: ", ";\n border-radius: 0px;\n background-color: ", ";\n color: ", ";\n }\n &__multi-value {\n background-color: ", ";\n }\n &__multi-value__label {\n color: ", ";\n font-size: 100%;\n }\n &__multi-value__remove {\n svg {\n fill: ", ";\n }\n }\n }\n }\n }\n"])), function (props) {
|
|
9718
|
-
return props.theme.colors.primary;
|
|
9719
|
-
}, function (props) {
|
|
9720
|
-
return props.theme.colors.ntrlMin;
|
|
9721
|
-
}, function (props) {
|
|
9722
|
-
return props.theme.colors.primary;
|
|
9723
|
-
}, function (props) {
|
|
9724
|
-
return props.theme.colors.primary;
|
|
9725
|
-
}, function (props) {
|
|
9726
|
-
return props.theme.colors.ntrlMin;
|
|
9727
|
-
}, function (props) {
|
|
9728
|
-
return props.theme.colors.ntrlMin;
|
|
9729
|
-
});
|
|
9730
|
-
/**
|
|
9731
|
-
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
9732
|
-
*/
|
|
9733
|
-
|
|
9734
|
-
var GraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
9735
|
-
_inherits(GraphQLDropdownSelector, _React$Component);
|
|
9736
|
-
|
|
9737
|
-
var _super = _createSuper(GraphQLDropdownSelector);
|
|
9738
|
-
|
|
9739
|
-
function GraphQLDropdownSelector(props) {
|
|
9740
|
-
var _this;
|
|
9741
|
-
|
|
9742
|
-
_classCallCheck(this, GraphQLDropdownSelector);
|
|
9743
|
-
|
|
9744
|
-
_this = _super.call(this, props);
|
|
9745
|
-
|
|
9746
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
9747
|
-
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
9748
|
-
_this.makeRequest();
|
|
9749
|
-
}
|
|
9750
|
-
});
|
|
9751
|
-
|
|
9752
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
9753
|
-
_this.pageReady.refreshPage();
|
|
9754
|
-
});
|
|
9755
|
-
|
|
9756
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
9757
|
-
return _this.setState({
|
|
9758
|
-
selected: [ALL_ITEM]
|
|
9759
|
-
});
|
|
9760
|
-
});
|
|
9761
|
-
|
|
9762
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
9763
|
-
var selectedIds = _this.state.selected.map(function (sel) {
|
|
9764
|
-
return sel.value;
|
|
9765
|
-
});
|
|
9766
|
-
|
|
9767
|
-
var pagination = _this.props.resultProcessor(res);
|
|
9768
|
-
|
|
9769
|
-
var allSelected = _this.state.selected.some(function (item) {
|
|
9770
|
-
return item.value === ALL_ITEM.value;
|
|
9771
|
-
});
|
|
9772
|
-
|
|
9773
|
-
var newList = pagination.filter(function (newItem) {
|
|
9774
|
-
return !selectedIds.includes(newItem.value);
|
|
9775
|
-
});
|
|
9776
|
-
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList)); // eslint-disable-next-line react/no-unused-state
|
|
9777
|
-
|
|
9778
|
-
_this.setState({
|
|
9779
|
-
list: newList,
|
|
9780
|
-
pagination: pagination
|
|
9781
|
-
});
|
|
9782
|
-
});
|
|
9783
|
-
|
|
9784
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
9785
|
-
var newSelectedList;
|
|
9786
|
-
|
|
9787
|
-
if (addSelectedItem.includes(ALL_ITEM)) {
|
|
9788
|
-
newSelectedList = [ALL_ITEM];
|
|
9789
|
-
} else {
|
|
9790
|
-
newSelectedList = addSelectedItem.filter(function (item) {
|
|
9791
|
-
return item.value !== ALL_ITEM.value;
|
|
9792
|
-
});
|
|
9793
|
-
}
|
|
9794
|
-
|
|
9795
|
-
_this.setState(function (prevState) {
|
|
9796
|
-
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
9797
|
-
selected: newSelectedList
|
|
9798
|
-
});
|
|
9799
|
-
}, function () {
|
|
9800
|
-
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
9801
|
-
return item.value !== ALL_ITEM.value;
|
|
9802
|
-
}));
|
|
9803
|
-
});
|
|
9804
|
-
});
|
|
9805
|
-
|
|
9806
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
9807
|
-
_this.setState({
|
|
9808
|
-
isLoading: flag
|
|
9809
|
-
});
|
|
9810
|
-
});
|
|
9811
|
-
|
|
9812
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9813
|
-
var _this$props = _this.props,
|
|
9814
|
-
baseClass = _this$props.baseClass,
|
|
9815
|
-
identifier = _this$props.identifier,
|
|
9816
|
-
triggerRequest = _this$props.triggerRequest,
|
|
9817
|
-
className = _this$props.className;
|
|
9818
|
-
var list = _this.state.list;
|
|
9819
|
-
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9820
|
-
"data-qe-id": identifier,
|
|
9821
|
-
className: "".concat(className, " ").concat(baseClass)
|
|
9822
|
-
}, /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9823
|
-
ref: function ref(inst) {
|
|
9824
|
-
_this.pageReady = inst;
|
|
9825
|
-
},
|
|
9826
|
-
onData: _this.setNewResults,
|
|
9827
|
-
onIsLoading: _this.onIsLoading,
|
|
9828
|
-
getRequestPromise: function getRequestPromise() {
|
|
9829
|
-
return triggerRequest();
|
|
9830
|
-
}
|
|
9831
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9832
|
-
className: "".concat(baseClass, "__selectable-items")
|
|
9833
|
-
}, /*#__PURE__*/React__default.createElement(ReactSelectWrapper, {
|
|
9834
|
-
options: list,
|
|
9835
|
-
onChange: function onChange(value) {
|
|
9836
|
-
_this.onAddItem(value);
|
|
9837
|
-
},
|
|
9838
|
-
isMulti: true,
|
|
9839
|
-
isSearchable: true
|
|
9840
|
-
}))));
|
|
9841
|
-
});
|
|
9842
|
-
|
|
9843
|
-
_this.state = {
|
|
9844
|
-
selected: [ALL_ITEM],
|
|
9845
|
-
list: [],
|
|
9846
|
-
pagination: {},
|
|
9847
|
-
isLoading: false
|
|
9848
|
-
};
|
|
9849
|
-
return _this;
|
|
9850
|
-
}
|
|
9851
|
-
|
|
9852
|
-
return _createClass(GraphQLDropdownSelector);
|
|
9853
|
-
}(React__default.Component);
|
|
9854
|
-
|
|
9855
|
-
GraphQLDropdownSelector.defaultProps = {
|
|
9856
|
-
baseClass: 'multiselector'
|
|
9857
|
-
};
|
|
9858
|
-
var GraphQLDropdownSelector$1 = themed(GraphQLDropdownSelector);
|
|
9859
|
-
|
|
9860
|
-
/**
|
|
9861
|
-
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
9862
|
-
*/
|
|
9863
|
-
var LuxityGraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
9864
|
-
_inherits(LuxityGraphQLDropdownSelector, _React$Component);
|
|
9865
|
-
|
|
9866
|
-
var _super = _createSuper(LuxityGraphQLDropdownSelector);
|
|
9867
|
-
|
|
9868
|
-
function LuxityGraphQLDropdownSelector(props) {
|
|
9869
|
-
var _this;
|
|
9870
|
-
|
|
9871
|
-
_classCallCheck(this, LuxityGraphQLDropdownSelector);
|
|
9872
|
-
|
|
9873
|
-
_this = _super.call(this, props);
|
|
9874
|
-
|
|
9875
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
9876
|
-
|
|
9877
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
9878
|
-
_this.setState(function (prevState) {
|
|
9879
|
-
return {
|
|
9880
|
-
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
9881
|
-
};
|
|
9882
|
-
});
|
|
9883
|
-
});
|
|
9884
|
-
|
|
9885
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
9886
|
-
_this.props.onChange(selection);
|
|
9887
|
-
});
|
|
9888
|
-
|
|
9889
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9890
|
-
var _this$state = _this.state,
|
|
9891
|
-
limit = _this$state.limit,
|
|
9892
|
-
query_arguments = _this$state.query_arguments;
|
|
9893
|
-
var _this$props = _this.props,
|
|
9894
|
-
title = _this$props.title,
|
|
9895
|
-
baseClass = _this$props.baseClass,
|
|
9896
|
-
getGraphQuery = _this$props.getGraphQuery,
|
|
9897
|
-
resultProcessor = _this$props.resultProcessor,
|
|
9898
|
-
graphApi = _this$props.graphApi,
|
|
9899
|
-
identifier = _this$props.identifier,
|
|
9900
|
-
requestInstance = _this$props.requestInstance;
|
|
9901
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
9902
|
-
className: baseClass
|
|
9903
|
-
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9904
|
-
className: "".concat(baseClass, "__title"),
|
|
9905
|
-
title: title
|
|
9906
|
-
}), /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(GraphQLDropdownSelector$1, {
|
|
9907
|
-
triggerRequest: function triggerRequest() {
|
|
9908
|
-
return requestInstance.post(graphApi, {
|
|
9909
|
-
query: getGraphQuery(limit, 1, 'id|desc', query_arguments)
|
|
9910
|
-
});
|
|
9911
|
-
},
|
|
9912
|
-
graphQuery: getGraphQuery(limit, 1, 'id|desc', query_arguments),
|
|
9913
|
-
identifier: identifier,
|
|
9914
|
-
ref: _this.multiSelectorRef,
|
|
9915
|
-
onChange: _this.onChange,
|
|
9916
|
-
resultProcessor: resultProcessor
|
|
9917
|
-
})));
|
|
9918
|
-
});
|
|
9919
|
-
|
|
9920
|
-
_this.state = {
|
|
9921
|
-
limit: props.baseQueryLimit,
|
|
9922
|
-
query_arguments: props.query_arguments
|
|
9923
|
-
};
|
|
9924
|
-
return _this;
|
|
9925
|
-
}
|
|
9926
|
-
|
|
9927
|
-
_createClass(LuxityGraphQLDropdownSelector, [{
|
|
9928
|
-
key: "componentDidUpdate",
|
|
9929
|
-
value: function componentDidUpdate(prevProps) {
|
|
9930
|
-
var _this$multiSelectorRe;
|
|
9931
|
-
|
|
9932
|
-
if (prevProps.query_arguments !== this.props.query_arguments && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
9933
|
-
this.multiSelectorRef.current.emptySelected();
|
|
9934
|
-
}
|
|
9935
|
-
}
|
|
9936
|
-
}], [{
|
|
9937
|
-
key: "getDerivedStateFromProps",
|
|
9938
|
-
value: function getDerivedStateFromProps(props, prevState) {
|
|
9939
|
-
if (prevState.query_arguments !== props.query_arguments) {
|
|
9940
|
-
return {
|
|
9941
|
-
query_arguments: props.query_arguments
|
|
9942
|
-
};
|
|
9943
|
-
}
|
|
9944
|
-
|
|
9945
|
-
return null;
|
|
9946
|
-
}
|
|
9947
|
-
}]);
|
|
9948
|
-
|
|
9949
|
-
return LuxityGraphQLDropdownSelector;
|
|
9950
|
-
}(React__default.Component);
|
|
9951
|
-
|
|
9952
|
-
LuxityGraphQLDropdownSelector.defaultProps = {
|
|
9953
|
-
baseClass: '',
|
|
9954
|
-
searchPlaceHolder: '',
|
|
9955
|
-
queryLimitIncrement: 12,
|
|
9956
|
-
baseQueryLimit: 12
|
|
9957
|
-
};
|
|
9958
|
-
|
|
9959
|
-
var BrandSelector = function BrandSelector(_ref) {
|
|
9960
|
-
var onChange = _ref.onChange,
|
|
9961
|
-
category = _ref.category,
|
|
9962
|
-
graphApi = _ref.graphApi,
|
|
9963
|
-
getGraphQuery = _ref.getGraphQuery,
|
|
9964
|
-
resultProcessor = _ref.resultProcessor,
|
|
9965
|
-
requestInstance = _ref.requestInstance;
|
|
9966
|
-
return /*#__PURE__*/React__default.createElement(LuxityGraphQLDropdownSelector, {
|
|
9967
|
-
baseQueryLimit: 9999,
|
|
9968
|
-
title: "Brands",
|
|
9969
|
-
queryId: "getBrands",
|
|
9970
|
-
baseClass: "brand-selector",
|
|
9971
|
-
identifier: "brand-selector",
|
|
9972
|
-
searchPlaceHolder: "Search brands",
|
|
9973
|
-
query_arguments: category,
|
|
9974
|
-
onChange: onChange,
|
|
9975
|
-
graphApi: graphApi,
|
|
9976
|
-
getGraphQuery: getGraphQuery,
|
|
9977
|
-
resultProcessor: resultProcessor,
|
|
9978
|
-
requestInstance: requestInstance
|
|
9979
|
-
});
|
|
9980
|
-
};
|
|
9981
|
-
|
|
9982
|
-
BrandSelector.defaultProps = {
|
|
9983
|
-
resultProcessor: function resultProcessor(result) {
|
|
9984
|
-
return result.data.data.luxity_brands.data.map(function (_ref2) {
|
|
9985
|
-
var id = _ref2.id,
|
|
9986
|
-
name = _ref2.name;
|
|
9987
|
-
return {
|
|
9988
|
-
label: name,
|
|
9989
|
-
value: id
|
|
9990
|
-
};
|
|
9991
|
-
});
|
|
9992
|
-
}
|
|
9993
|
-
};
|
|
9994
|
-
|
|
9995
|
-
var _templateObject$F, _templateObject2$6;
|
|
9996
|
-
var ALL_ITEM$1 = {
|
|
9997
9714
|
id: 'ALL',
|
|
9998
9715
|
name: 'ALL'
|
|
9999
9716
|
};
|
|
10000
9717
|
var multiSelectorItemMaxHeight = '3rem';
|
|
10001
9718
|
var multiSelectorItemAnimationDuration = '300ms';
|
|
10002
|
-
var multiselectorItemFadeIn = styled.keyframes(_templateObject$
|
|
10003
|
-
var StyledMultiselector
|
|
9719
|
+
var multiselectorItemFadeIn = styled.keyframes(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n from {\n margin: 0;\n max-height: 0px;\n opacity: 0;\n }\n to {\n max-height: ", ";\n opacity: 1;\n }\n"])), multiSelectorItemMaxHeight);
|
|
9720
|
+
var StyledMultiselector = styled__default.div(_templateObject2$6 || (_templateObject2$6 = _taggedTemplateLiteral(["\n .multiselector__selected-items,\n .multiselector__selectable-items {\n display: flex;\n flex-flow: wrap;\n margin-left: calc(-1 * ", ");\n button {\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n border-color: ", ";\n background-color: ", ";\n color: ", ";\n padding: ", ";\n text-transform: none;\n box-sizing: border-box;\n animation: ", " ease-in-out\n ", " forwards;\n flex-basis: calc(25% - ", ");\n margin-bottom: ", ";\n margin-left: ", ";\n text-overflow: ellipsis;\n overflow-x: hidden;\n min-height: 40px;\n\n @media (max-width: ", ") {\n flex-basis: calc(50% - ", ");\n }\n }\n }\n\n .multiselector__footer {\n display: flex;\n justify-content: center;\n button {\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n background-color: ", ";\n color: ", ";\n }\n }\n"])), function (props) {
|
|
10004
9721
|
return props.theme.marginPaddings[2];
|
|
10005
9722
|
}, function (props) {
|
|
10006
9723
|
return props.theme.colors.ntrlMin;
|
|
@@ -10059,7 +9776,7 @@
|
|
|
10059
9776
|
|
|
10060
9777
|
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
10061
9778
|
return _this.setState({
|
|
10062
|
-
selected: [ALL_ITEM
|
|
9779
|
+
selected: [ALL_ITEM]
|
|
10063
9780
|
});
|
|
10064
9781
|
});
|
|
10065
9782
|
|
|
@@ -10071,13 +9788,13 @@
|
|
|
10071
9788
|
var pagination = _this.props.resultProcessor(res);
|
|
10072
9789
|
|
|
10073
9790
|
var allSelected = _this.state.selected.some(function (item) {
|
|
10074
|
-
return item.id === ALL_ITEM
|
|
9791
|
+
return item.id === ALL_ITEM.id;
|
|
10075
9792
|
});
|
|
10076
9793
|
|
|
10077
9794
|
var newList = pagination.data.filter(function (newItem) {
|
|
10078
9795
|
return !selectedIds.includes(newItem.id);
|
|
10079
9796
|
});
|
|
10080
|
-
newList = allSelected ? newList : [ALL_ITEM
|
|
9797
|
+
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
10081
9798
|
|
|
10082
9799
|
_this.setState({
|
|
10083
9800
|
list: newList,
|
|
@@ -10090,21 +9807,21 @@
|
|
|
10090
9807
|
var newSelectedList;
|
|
10091
9808
|
var newList;
|
|
10092
9809
|
|
|
10093
|
-
if (addSelectedItem.id === ALL_ITEM
|
|
9810
|
+
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
10094
9811
|
// Clear Selected List
|
|
10095
9812
|
// and move previous Selected items to list
|
|
10096
|
-
newSelectedList = [ALL_ITEM
|
|
9813
|
+
newSelectedList = [ALL_ITEM];
|
|
10097
9814
|
newList = prevState.list.filter(function (item) {
|
|
10098
|
-
return item.id !== ALL_ITEM
|
|
9815
|
+
return item.id !== ALL_ITEM.id;
|
|
10099
9816
|
}).concat(prevState.selected).sort(function (a, b) {
|
|
10100
9817
|
return a.id - b.id;
|
|
10101
9818
|
});
|
|
10102
9819
|
} else {
|
|
10103
9820
|
newSelectedList = _toConsumableArray(prevState.selected.filter(function (item) {
|
|
10104
|
-
return item.id !== ALL_ITEM
|
|
9821
|
+
return item.id !== ALL_ITEM.id;
|
|
10105
9822
|
})).concat(addSelectedItem);
|
|
10106
|
-
newList = [ALL_ITEM
|
|
10107
|
-
return item.id !== ALL_ITEM
|
|
9823
|
+
newList = [ALL_ITEM].concat(_toConsumableArray(prevState.list.filter(function (item) {
|
|
9824
|
+
return item.id !== ALL_ITEM.id;
|
|
10108
9825
|
}).filter(function (item) {
|
|
10109
9826
|
return item.id !== addSelectedItem.id;
|
|
10110
9827
|
})));
|
|
@@ -10116,7 +9833,7 @@
|
|
|
10116
9833
|
};
|
|
10117
9834
|
}, function () {
|
|
10118
9835
|
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
10119
|
-
return item.id !== ALL_ITEM
|
|
9836
|
+
return item.id !== ALL_ITEM.id;
|
|
10120
9837
|
}));
|
|
10121
9838
|
});
|
|
10122
9839
|
});
|
|
@@ -10124,7 +9841,7 @@
|
|
|
10124
9841
|
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
10125
9842
|
_this.setState(function (prevState) {
|
|
10126
9843
|
// Cannot remove ALL from selection by unselecting it
|
|
10127
|
-
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM
|
|
9844
|
+
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
10128
9845
|
return {};
|
|
10129
9846
|
}
|
|
10130
9847
|
|
|
@@ -10133,18 +9850,18 @@
|
|
|
10133
9850
|
});
|
|
10134
9851
|
|
|
10135
9852
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
10136
|
-
return item.id !== ALL_ITEM
|
|
9853
|
+
return item.id !== ALL_ITEM.id;
|
|
10137
9854
|
}).sort(function (a, b) {
|
|
10138
9855
|
return a.id - b.id;
|
|
10139
9856
|
});
|
|
10140
9857
|
|
|
10141
9858
|
return {
|
|
10142
9859
|
list: newList,
|
|
10143
|
-
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM
|
|
9860
|
+
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
10144
9861
|
};
|
|
10145
9862
|
}, function () {
|
|
10146
9863
|
_this.props.onChange(_this.state.selected.filter(function (item) {
|
|
10147
|
-
return item.id !== ALL_ITEM
|
|
9864
|
+
return item.id !== ALL_ITEM.id;
|
|
10148
9865
|
}));
|
|
10149
9866
|
});
|
|
10150
9867
|
});
|
|
@@ -10167,7 +9884,7 @@
|
|
|
10167
9884
|
selected = _this$state.selected,
|
|
10168
9885
|
pagination = _this$state.pagination,
|
|
10169
9886
|
isLoading = _this$state.isLoading;
|
|
10170
|
-
return /*#__PURE__*/React__default.createElement(StyledMultiselector
|
|
9887
|
+
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10171
9888
|
"data-qe-id": identifier,
|
|
10172
9889
|
className: "".concat(className, " ").concat(baseClass)
|
|
10173
9890
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -10207,7 +9924,7 @@
|
|
|
10207
9924
|
});
|
|
10208
9925
|
|
|
10209
9926
|
_this.state = {
|
|
10210
|
-
selected: [ALL_ITEM
|
|
9927
|
+
selected: [ALL_ITEM],
|
|
10211
9928
|
list: [],
|
|
10212
9929
|
pagination: {},
|
|
10213
9930
|
isLoading: false
|
|
@@ -10237,7 +9954,7 @@
|
|
|
10237
9954
|
}));
|
|
10238
9955
|
});
|
|
10239
9956
|
|
|
10240
|
-
var _templateObject$
|
|
9957
|
+
var _templateObject$F;
|
|
10241
9958
|
|
|
10242
9959
|
var Title$3 = function Title(_ref) {
|
|
10243
9960
|
var baseClass = _ref.baseClass,
|
|
@@ -10258,7 +9975,7 @@
|
|
|
10258
9975
|
})));
|
|
10259
9976
|
};
|
|
10260
9977
|
|
|
10261
|
-
var StyledTitle = styled__default(Title$3)(_templateObject$
|
|
9978
|
+
var StyledTitle = styled__default(Title$3)(_templateObject$F || (_templateObject$F = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-weight: bold;\n display: flex;\n align-items: center;\n font-size: ", ";\n\n .title__search,\n .title__search {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 30px;\n margin-bottom: ", ";\n\n svg {\n margin-left: ", ";\n fill: ", ";\n stroke: ", ";\n }\n\n input {\n width: 140px;\n border: none;\n font-size: ", ";\n transition: 0.2s border-color ease-in-out;\n margin-left: ", ";\n padding: 0;\n\n :focus {\n border-color: ", ";\n border-bottom: none;\n }\n }\n }\n"])), function (props) {
|
|
10262
9979
|
return props.theme.marginPaddings[2];
|
|
10263
9980
|
}, function (props) {
|
|
10264
9981
|
return props.theme.fontSizes[2];
|
|
@@ -10324,10 +10041,7 @@
|
|
|
10324
10041
|
var _this$state = _this.state,
|
|
10325
10042
|
limit = _this$state.limit,
|
|
10326
10043
|
category = _this$state.category,
|
|
10327
|
-
nameFilter = _this$state.nameFilter
|
|
10328
|
-
brands = _this$state.brands,
|
|
10329
|
-
models = _this$state.models,
|
|
10330
|
-
materials = _this$state.materials;
|
|
10044
|
+
nameFilter = _this$state.nameFilter;
|
|
10331
10045
|
var _this$props = _this.props,
|
|
10332
10046
|
title = _this$props.title,
|
|
10333
10047
|
baseClass = _this$props.baseClass,
|
|
@@ -10348,10 +10062,10 @@
|
|
|
10348
10062
|
}), /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(GraphQLMultiSelector$1, {
|
|
10349
10063
|
triggerRequest: function triggerRequest() {
|
|
10350
10064
|
return requestInstance.post(graphApi, {
|
|
10351
|
-
query: getGraphQuery(limit, 1, 'id|desc', category, nameFilter
|
|
10065
|
+
query: getGraphQuery(limit, 1, 'id|desc', category, nameFilter)
|
|
10352
10066
|
});
|
|
10353
10067
|
},
|
|
10354
|
-
graphQuery: getGraphQuery(limit, 1, 'id|desc', category, nameFilter
|
|
10068
|
+
graphQuery: getGraphQuery(limit, 1, 'id|desc', category, nameFilter),
|
|
10355
10069
|
identifier: identifier,
|
|
10356
10070
|
ref: _this.multiSelectorRef,
|
|
10357
10071
|
onChange: _this.onChange,
|
|
@@ -10364,9 +10078,6 @@
|
|
|
10364
10078
|
_this.state = {
|
|
10365
10079
|
limit: props.baseQueryLimit,
|
|
10366
10080
|
category: props.category,
|
|
10367
|
-
brands: props.brands,
|
|
10368
|
-
models: props.models,
|
|
10369
|
-
materials: props.materials,
|
|
10370
10081
|
nameFilter: ''
|
|
10371
10082
|
};
|
|
10372
10083
|
return _this;
|
|
@@ -10375,23 +10086,11 @@
|
|
|
10375
10086
|
_createClass(LuxityGraphQLMultiselector, [{
|
|
10376
10087
|
key: "componentDidUpdate",
|
|
10377
10088
|
value: function componentDidUpdate(prevProps) {
|
|
10378
|
-
var _this$multiSelectorRe
|
|
10089
|
+
var _this$multiSelectorRe;
|
|
10379
10090
|
|
|
10380
10091
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
10381
10092
|
this.multiSelectorRef.current.emptySelected();
|
|
10382
10093
|
}
|
|
10383
|
-
|
|
10384
|
-
if (prevProps.brands !== this.props.brands && (_this$multiSelectorRe2 = this.multiSelectorRef) !== null && _this$multiSelectorRe2 !== void 0 && _this$multiSelectorRe2.current) {
|
|
10385
|
-
this.multiSelectorRef.current.emptySelected();
|
|
10386
|
-
}
|
|
10387
|
-
|
|
10388
|
-
if (prevProps.models !== this.props.models && (_this$multiSelectorRe3 = this.multiSelectorRef) !== null && _this$multiSelectorRe3 !== void 0 && _this$multiSelectorRe3.current) {
|
|
10389
|
-
this.multiSelectorRef.current.emptySelected();
|
|
10390
|
-
}
|
|
10391
|
-
|
|
10392
|
-
if (prevProps.materials !== this.props.materials && (_this$multiSelectorRe4 = this.multiSelectorRef) !== null && _this$multiSelectorRe4 !== void 0 && _this$multiSelectorRe4.current) {
|
|
10393
|
-
this.multiSelectorRef.current.emptySelected();
|
|
10394
|
-
}
|
|
10395
10094
|
}
|
|
10396
10095
|
}], [{
|
|
10397
10096
|
key: "getDerivedStateFromProps",
|
|
@@ -10402,24 +10101,6 @@
|
|
|
10402
10101
|
};
|
|
10403
10102
|
}
|
|
10404
10103
|
|
|
10405
|
-
if (prevState.brands !== props.brands) {
|
|
10406
|
-
return {
|
|
10407
|
-
brands: props.brands
|
|
10408
|
-
};
|
|
10409
|
-
}
|
|
10410
|
-
|
|
10411
|
-
if (prevState.models !== props.models) {
|
|
10412
|
-
return {
|
|
10413
|
-
models: props.models
|
|
10414
|
-
};
|
|
10415
|
-
}
|
|
10416
|
-
|
|
10417
|
-
if (prevState.materials !== props.materials) {
|
|
10418
|
-
return {
|
|
10419
|
-
materials: props.materials
|
|
10420
|
-
};
|
|
10421
|
-
}
|
|
10422
|
-
|
|
10423
10104
|
return null;
|
|
10424
10105
|
}
|
|
10425
10106
|
}]);
|
|
@@ -10434,8 +10115,8 @@
|
|
|
10434
10115
|
baseQueryLimit: 12
|
|
10435
10116
|
};
|
|
10436
10117
|
|
|
10437
|
-
var _templateObject$
|
|
10438
|
-
var BaseButton = styled__default.button(_templateObject$
|
|
10118
|
+
var _templateObject$G;
|
|
10119
|
+
var BaseButton = styled__default.button(_templateObject$G || (_templateObject$G = _taggedTemplateLiteral(["\n color: ", ";\n border: 1px solid ", ";\n background-color: ", ";\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n"])), function (props) {
|
|
10439
10120
|
return props.theme.colors.base;
|
|
10440
10121
|
}, function (props) {
|
|
10441
10122
|
return props.theme.colors.borderColor;
|
|
@@ -10461,6 +10142,38 @@
|
|
|
10461
10142
|
return selected ? /*#__PURE__*/React__default.createElement(PrimaryButton$1, props, item.name) : /*#__PURE__*/React__default.createElement(UnselectedButton, props, item.name);
|
|
10462
10143
|
};
|
|
10463
10144
|
|
|
10145
|
+
var BrandSelector = function BrandSelector(_ref) {
|
|
10146
|
+
var onChange = _ref.onChange,
|
|
10147
|
+
category = _ref.category,
|
|
10148
|
+
graphApi = _ref.graphApi,
|
|
10149
|
+
itemRenderer = _ref.itemRenderer,
|
|
10150
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10151
|
+
resultProcessor = _ref.resultProcessor,
|
|
10152
|
+
requestInstance = _ref.requestInstance;
|
|
10153
|
+
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10154
|
+
baseQueryLimit: 16,
|
|
10155
|
+
title: "Brands",
|
|
10156
|
+
queryId: "getBrands",
|
|
10157
|
+
baseClass: "brand-selector",
|
|
10158
|
+
identifier: "brand-selector",
|
|
10159
|
+
searchPlaceHolder: "Search brands",
|
|
10160
|
+
category: category,
|
|
10161
|
+
onChange: onChange,
|
|
10162
|
+
graphApi: graphApi,
|
|
10163
|
+
itemRenderer: itemRenderer,
|
|
10164
|
+
getGraphQuery: getGraphQuery,
|
|
10165
|
+
resultProcessor: resultProcessor,
|
|
10166
|
+
requestInstance: requestInstance
|
|
10167
|
+
});
|
|
10168
|
+
};
|
|
10169
|
+
|
|
10170
|
+
BrandSelector.defaultProps = {
|
|
10171
|
+
itemRenderer: ItemRenderer,
|
|
10172
|
+
resultProcessor: function resultProcessor(result) {
|
|
10173
|
+
return result.data.data.luxity_brands;
|
|
10174
|
+
}
|
|
10175
|
+
};
|
|
10176
|
+
|
|
10464
10177
|
var StyleSelector = function StyleSelector(_ref) {
|
|
10465
10178
|
var onChange = _ref.onChange,
|
|
10466
10179
|
category = _ref.category,
|
|
@@ -10468,10 +10181,7 @@
|
|
|
10468
10181
|
itemRenderer = _ref.itemRenderer,
|
|
10469
10182
|
getGraphQuery = _ref.getGraphQuery,
|
|
10470
10183
|
resultProcessor = _ref.resultProcessor,
|
|
10471
|
-
requestInstance = _ref.requestInstance
|
|
10472
|
-
brands = _ref.brands,
|
|
10473
|
-
models = _ref.models,
|
|
10474
|
-
materials = _ref.materials;
|
|
10184
|
+
requestInstance = _ref.requestInstance;
|
|
10475
10185
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10476
10186
|
title: "Styles",
|
|
10477
10187
|
queryId: "getStyles",
|
|
@@ -10480,9 +10190,6 @@
|
|
|
10480
10190
|
identifier: "style-selector",
|
|
10481
10191
|
searchPlaceHolder: "Search Styles",
|
|
10482
10192
|
category: category,
|
|
10483
|
-
brands: brands,
|
|
10484
|
-
models: models,
|
|
10485
|
-
materials: materials,
|
|
10486
10193
|
onChange: onChange,
|
|
10487
10194
|
graphApi: graphApi,
|
|
10488
10195
|
itemRenderer: itemRenderer,
|
|
@@ -10510,8 +10217,8 @@
|
|
|
10510
10217
|
}
|
|
10511
10218
|
};
|
|
10512
10219
|
|
|
10513
|
-
var _templateObject$
|
|
10514
|
-
var TitleWrapper = styled__default.div(_templateObject$
|
|
10220
|
+
var _templateObject$H, _templateObject2$7;
|
|
10221
|
+
var TitleWrapper = styled__default.div(_templateObject$H || (_templateObject$H = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: nowrap row;\n justify-content: space-between;\n margin-bottom: ", ";\n label {\n margin-bottom: 0;\n }\n"])), function (props) {
|
|
10515
10222
|
return props.theme.marginPaddings[4];
|
|
10516
10223
|
});
|
|
10517
10224
|
var onShoeSizeTypeChangeTimeout = 300;
|
|
@@ -10649,8 +10356,8 @@
|
|
|
10649
10356
|
}
|
|
10650
10357
|
};
|
|
10651
10358
|
|
|
10652
|
-
var _templateObject$
|
|
10653
|
-
var SelectionWrapper = styled__default.div(_templateObject$
|
|
10359
|
+
var _templateObject$I;
|
|
10360
|
+
var SelectionWrapper = styled__default.div(_templateObject$I || (_templateObject$I = _taggedTemplateLiteral(["\n display: flex;\n margin-left: calc(-1 * ", ");\n label {\n margin-bottom: ", ";\n flex-basis: calc(33.33% - ", ");\n margin-bottom: ", ";\n margin-left: ", ";\n }\n @media (max-width: ", ") {\n label {\n flex-basis: calc(50% - ", ");\n }\n }\n"])), function (props) {
|
|
10654
10361
|
return props.theme.marginPaddings[2];
|
|
10655
10362
|
}, function (props) {
|
|
10656
10363
|
return props.theme.marginPaddings[2];
|
|
@@ -10666,8 +10373,8 @@
|
|
|
10666
10373
|
|
|
10667
10374
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10668
10375
|
|
|
10669
|
-
var _templateObject$
|
|
10670
|
-
var Content = styled__default.div(_templateObject$
|
|
10376
|
+
var _templateObject$J, _templateObject2$8, _templateObject3$3;
|
|
10377
|
+
var Content = styled__default.div(_templateObject$J || (_templateObject$J = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n transition: 200ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
10671
10378
|
return props.theme.colors.primary;
|
|
10672
10379
|
}, function (props) {
|
|
10673
10380
|
return props.theme.marginPaddings[0];
|
|
@@ -10832,9 +10539,9 @@
|
|
|
10832
10539
|
}));
|
|
10833
10540
|
});
|
|
10834
10541
|
|
|
10835
|
-
var _templateObject$
|
|
10542
|
+
var _templateObject$K, _templateObject2$9, _templateObject3$4, _templateObject4$3, _templateObject5$1;
|
|
10836
10543
|
var UNISEX$1 = genders.UNISEX;
|
|
10837
|
-
var AddInterestContainer = styled__default.div(_templateObject$
|
|
10544
|
+
var AddInterestContainer = styled__default.div(_templateObject$K || (_templateObject$K = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n border: 1px solid ", ";\n padding: ", ";\n"])), function (props) {
|
|
10838
10545
|
return props.theme.marginPaddings[6];
|
|
10839
10546
|
}, function (props) {
|
|
10840
10547
|
return props.theme.colors.borderColor;
|
|
@@ -11122,8 +10829,8 @@
|
|
|
11122
10829
|
|
|
11123
10830
|
var AddInterest$1 = themed(AddInterest);
|
|
11124
10831
|
|
|
11125
|
-
var _templateObject$
|
|
11126
|
-
var MyInterestTitleHeadingContainer = styled__default.div(_templateObject$
|
|
10832
|
+
var _templateObject$L;
|
|
10833
|
+
var MyInterestTitleHeadingContainer = styled__default.div(_templateObject$L || (_templateObject$L = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n\n .heading-title-section {\n display: flex;\n justify-content: space-between;\n width: 95%;\n padding: ", ";\n }\n\n .heading-title {\n color: ", ";\n font-weight: bold;\n flex-basis: calc(100% / 6);\n margin-left: ", ";\n padding-bottom: 0;\n }\n\n .heading-title-empty {\n flex-basis: 5%;\n margin-left: 1rem;\n }\n\n @media (max-width: ", ") {\n display: none;\n }\n"])), function (props) {
|
|
11127
10834
|
return props.theme.marginPaddings[0];
|
|
11128
10835
|
}, function (props) {
|
|
11129
10836
|
return props.theme.colors.primary;
|
|
@@ -11153,8 +10860,8 @@
|
|
|
11153
10860
|
|
|
11154
10861
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
11155
10862
|
|
|
11156
|
-
var _templateObject$
|
|
11157
|
-
var SvgWrapper$2 = styled__default.span(_templateObject$
|
|
10863
|
+
var _templateObject$M;
|
|
10864
|
+
var SvgWrapper$2 = styled__default.span(_templateObject$M || (_templateObject$M = _taggedTemplateLiteral(["\n svg {\n path {\n fill: ", ";\n }\n }\n"])), function (props) {
|
|
11158
10865
|
return props.theme.colors.primary;
|
|
11159
10866
|
});
|
|
11160
10867
|
var AccountIcon = themed(function () {
|
|
@@ -11300,8 +11007,8 @@
|
|
|
11300
11007
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|
|
11301
11008
|
};
|
|
11302
11009
|
|
|
11303
|
-
var _templateObject$
|
|
11304
|
-
var HeaderWrapper = styled__default.div(_templateObject$
|
|
11010
|
+
var _templateObject$N, _templateObject2$a, _templateObject3$5, _templateObject4$4, _templateObject5$2, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30;
|
|
11011
|
+
var HeaderWrapper = styled__default.div(_templateObject$N || (_templateObject$N = _taggedTemplateLiteral(["\n {\n display: inline-block;\n background-color: ", ";\n position: relative;\n width: 100%;\n\n .header__search-container,\n .header__search-input {\n background-color: ", ";\n }\n\n .header__search-container {\n max-width: ", ";\n margin: 0 auto;\n padding: ", " 5%;\n }\n }\n"])), function (props) {
|
|
11305
11012
|
return props.theme.rareStepColors.ntrlMin;
|
|
11306
11013
|
}, function (props) {
|
|
11307
11014
|
return props.theme.rareStepColors.primary;
|
|
@@ -11445,6 +11152,9 @@
|
|
|
11445
11152
|
}
|
|
11446
11153
|
};
|
|
11447
11154
|
|
|
11155
|
+
React.useEffect(function () {
|
|
11156
|
+
searchInputRef.current.focus();
|
|
11157
|
+
}, []);
|
|
11448
11158
|
return /*#__PURE__*/React__default.createElement(SearchContainer, {
|
|
11449
11159
|
className: "header__search-container"
|
|
11450
11160
|
}, /*#__PURE__*/React__default.createElement(SearchIcon, {
|
|
@@ -11635,8 +11345,8 @@
|
|
|
11635
11345
|
|
|
11636
11346
|
var RareStepDesktopHeader$1 = themed(RareStepDesktopHeader);
|
|
11637
11347
|
|
|
11638
|
-
var _templateObject$
|
|
11639
|
-
var HeaderWrapper$1 = styled__default.div(_templateObject$
|
|
11348
|
+
var _templateObject$O, _templateObject2$b, _templateObject3$6, _templateObject4$5, _templateObject5$3, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17$1, _templateObject18$1, _templateObject19$1, _templateObject20$1, _templateObject21$1, _templateObject22$1, _templateObject23$1;
|
|
11349
|
+
var HeaderWrapper$1 = styled__default.div(_templateObject$O || (_templateObject$O = _taggedTemplateLiteral(["\n {\n display: flex;\n background-color: ", ";\n position: relative;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n padding: ", " 5%;\n }\n"])), function (props) {
|
|
11640
11350
|
return props.theme.rareStepColors.ntrlMin;
|
|
11641
11351
|
}, function (props) {
|
|
11642
11352
|
return props.theme.marginPaddings[3];
|
|
@@ -11987,8 +11697,8 @@
|
|
|
11987
11697
|
};
|
|
11988
11698
|
var index$3 = themed(RareStepHeader);
|
|
11989
11699
|
|
|
11990
|
-
var _templateObject$
|
|
11991
|
-
var FooterWrapper = styled__default.div(_templateObject$
|
|
11700
|
+
var _templateObject$P, _templateObject2$c, _templateObject3$7, _templateObject4$6, _templateObject5$4, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$2, _templateObject10$2, _templateObject11$2, _templateObject12$2, _templateObject13$2, _templateObject14$2, _templateObject15$2, _templateObject16$2;
|
|
11701
|
+
var FooterWrapper = styled__default.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteral(["\n {\n background-color: ", ";\n font-weight: ", ";\n padding-top: ", ";\n font-size: ", ";\n }\n"])), function (props) {
|
|
11992
11702
|
return props.theme.rareStepColors.ntrlMax;
|
|
11993
11703
|
}, function (props) {
|
|
11994
11704
|
return props.theme.rareStepFontWeights.bold;
|