@bento-core/facet-filter 1.0.1-icdc.3 → 1.0.1-icdc.5

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.
@@ -41,21 +41,26 @@ var _default = () => ({
41
41
  marginBottom: '5px',
42
42
  borderTop: '1px solid #B1B1B1',
43
43
  textAlign: 'left',
44
- marginLeft: '-5px'
44
+ // marginLeft: '-5px',
45
+ display: 'flex',
46
+ alignItems: 'center',
47
+ justifyContent: 'center'
45
48
  },
46
49
  sortGroupIcon: {
47
50
  cursor: 'pointer',
48
51
  fontFamily: 'Nunito',
49
- fontSize: '10px',
50
- marginRight: '12px',
51
- marginLeft: '16px'
52
+ fontSize: '10px'
53
+ // marginRight: '12px',
54
+ // marginLeft: '16px',
52
55
  },
56
+
53
57
  sortGroupItem: {
54
58
  cursor: 'pointer',
55
59
  fontFamily: 'Nunito',
56
- fontSize: '10px',
57
- marginRight: '32px'
60
+ fontSize: '10px'
61
+ // marginRight: '32px',
58
62
  },
63
+
59
64
  NonSortGroup: {
60
65
  marginBottom: '5px',
61
66
  borderTop: '1px solid #B1B1B1',
@@ -70,11 +75,12 @@ var _default = () => ({
70
75
  sortGroupItemCounts: {
71
76
  cursor: 'pointer',
72
77
  fontFamily: 'Nunito',
73
- fontSize: '10px',
74
- float: 'right',
75
- marginRight: '10px',
76
- marginTop: '5px'
78
+ fontSize: '10px'
79
+ // float: 'right',
80
+ // marginRight: '10px',
81
+ // marginTop: '5px',
77
82
  },
83
+
78
84
  highlight: {
79
85
  color: '#b2c6d6'
80
86
  },
@@ -32,8 +32,7 @@ const FacetView = _ref => {
32
32
  onClearSliderSection,
33
33
  CustomView,
34
34
  autoComplete,
35
- upload,
36
- onToggle
35
+ upload
37
36
  } = _ref;
38
37
  const [expand, setExpand] = (0, _react.useState)(false);
39
38
  const onExpandFacet = () => setExpand(!expand);
@@ -63,24 +62,13 @@ const FacetView = _ref => {
63
62
  */
64
63
  const {
65
64
  type,
66
- facetValues,
67
- datafield
65
+ facetValues
68
66
  } = facet;
69
67
  const selectedItems = facetValues && facetValues.filter(item => item.isChecked);
70
68
  const displayFacet = _objectSpread({}, facet);
71
69
  displayFacet.facetValues = selectedItems;
72
70
  const isActiveFacet = [...selectedItems].length > 0;
73
71
  const limitCheckBoxCount = (facet === null || facet === void 0 ? void 0 : facet.showCheckboxCount) || 5;
74
- const clearFacetSectionValues = () => {
75
- facetValues.forEach(item => {
76
- const toggleCheckBoxItem = {
77
- name: item.group,
78
- datafield,
79
- isChecked: false
80
- };
81
- onToggle(toggleCheckBoxItem);
82
- });
83
- };
84
72
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Accordion, {
85
73
  square: true,
86
74
  expanded: expand,
@@ -90,7 +78,7 @@ const FacetView = _ref => {
90
78
  },
91
79
  id: facet.section
92
80
  }, CustomView ? /*#__PURE__*/_react.default.createElement(CustomView, {
93
- clearFacetSectionValues: clearFacetSectionValues,
81
+ clearFacetSectionValues: onClearSection,
94
82
  hasSelections: selectedItems.length,
95
83
  facet: facet,
96
84
  facetClasses: isActiveFacet ? "activeFacet".concat(facet.section) : "inactiveFacet".concat(facet.section)
@@ -107,7 +95,7 @@ const FacetView = _ref => {
107
95
  ["activeFacet".concat(facet.section)]: isActiveFacet
108
96
  })
109
97
  }, facet.label), selectedItems.length ? /*#__PURE__*/_react.default.createElement(_IconButton.default, {
110
- onClick: clearFacetSectionValues
98
+ onClick: onClearSection
111
99
  }, /*#__PURE__*/_react.default.createElement(_Refresh.default, null)) : null)), (facet.type === _Types.InputTypes.SLIDER || facetValues.length === 0) && /*#__PURE__*/_react.default.createElement("div", {
112
100
  className: classes.NonSortGroup
113
101
  }, /*#__PURE__*/_react.default.createElement("span", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/facet-filter",
3
- "version": "1.0.1-icdc.3",
3
+ "version": "1.0.1-icdc.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -35,20 +35,23 @@ export default () => ({
35
35
  marginBottom: '5px',
36
36
  borderTop: '1px solid #B1B1B1',
37
37
  textAlign: 'left',
38
- marginLeft: '-5px',
38
+ // marginLeft: '-5px',
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ justifyContent: 'center',
39
42
  },
40
43
  sortGroupIcon: {
41
44
  cursor: 'pointer',
42
45
  fontFamily: 'Nunito',
43
46
  fontSize: '10px',
44
- marginRight: '12px',
45
- marginLeft: '16px',
47
+ // marginRight: '12px',
48
+ // marginLeft: '16px',
46
49
  },
47
50
  sortGroupItem: {
48
51
  cursor: 'pointer',
49
52
  fontFamily: 'Nunito',
50
53
  fontSize: '10px',
51
- marginRight: '32px',
54
+ // marginRight: '32px',
52
55
  },
53
56
  NonSortGroup: {
54
57
  marginBottom: '5px',
@@ -65,9 +68,9 @@ export default () => ({
65
68
  cursor: 'pointer',
66
69
  fontFamily: 'Nunito',
67
70
  fontSize: '10px',
68
- float: 'right',
69
- marginRight: '10px',
70
- marginTop: '5px',
71
+ // float: 'right',
72
+ // marginRight: '10px',
73
+ // marginTop: '5px',
71
74
  },
72
75
  highlight: {
73
76
  color: '#b2c6d6',
@@ -21,7 +21,6 @@ const FacetView = ({
21
21
  CustomView,
22
22
  autoComplete,
23
23
  upload,
24
- onToggle,
25
24
  }) => {
26
25
  const [expand, setExpand] = useState(false);
27
26
  const onExpandFacet = () => setExpand(!expand);
@@ -54,24 +53,13 @@ const FacetView = ({
54
53
  /**
55
54
  * display checked items on facet collapse
56
55
  */
57
- const { type, facetValues, datafield } = facet;
56
+ const { type, facetValues } = facet;
58
57
  const selectedItems = facetValues && facetValues.filter((item) => item.isChecked);
59
58
  const displayFacet = { ...facet };
60
59
  displayFacet.facetValues = selectedItems;
61
60
  const isActiveFacet = [...selectedItems].length > 0;
62
61
  const limitCheckBoxCount = facet?.showCheckboxCount || 5;
63
62
 
64
- const clearFacetSectionValues = () => {
65
- facetValues.forEach((item) => {
66
- const toggleCheckBoxItem = {
67
- name: item.group,
68
- datafield,
69
- isChecked: false,
70
- };
71
-
72
- onToggle(toggleCheckBoxItem);
73
- });
74
- };
75
63
  return (
76
64
  <>
77
65
  <Accordion
@@ -85,7 +73,7 @@ const FacetView = ({
85
73
  >
86
74
  {CustomView ? (
87
75
  <CustomView
88
- clearFacetSectionValues={clearFacetSectionValues}
76
+ clearFacetSectionValues={onClearSection}
89
77
  hasSelections={selectedItems.length}
90
78
  facet={facet}
91
79
  facetClasses={
@@ -118,7 +106,7 @@ const FacetView = ({
118
106
  {facet.label}
119
107
  </div>
120
108
  {selectedItems.length ? (
121
- <IconButton onClick={clearFacetSectionValues}>
109
+ <IconButton onClick={onClearSection}>
122
110
  <RefreshIcon />
123
111
  </IconButton>
124
112
  ) : null}