@bento-core/facet-filter 1.0.1-ctdc.0 → 1.0.1-ctdc.2
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.
|
@@ -37,14 +37,15 @@ const CheckBoxView = _ref => {
|
|
|
37
37
|
const {
|
|
38
38
|
field = 'group',
|
|
39
39
|
count = 'subjects',
|
|
40
|
-
customCount = text => "(".concat(text, ")")
|
|
40
|
+
customCount = text => "(".concat(text, ")"),
|
|
41
|
+
defaultValue = ''
|
|
41
42
|
} = facet;
|
|
42
43
|
const indexType = index % 2 === 0 ? 'Even' : 'Odd';
|
|
43
44
|
const checkedSection = "".concat(section).toLowerCase().replace(/\ /g, '_');
|
|
44
|
-
const name = checkboxItem[field] || 'N/A';
|
|
45
|
+
const name = checkboxItem[field] || defaultValue || 'N/A';
|
|
45
46
|
const handleToggle = () => {
|
|
46
47
|
const toggleCheckBoxItem = {
|
|
47
|
-
name:
|
|
48
|
+
name: checkboxItem[field],
|
|
48
49
|
datafield: datafield,
|
|
49
50
|
isChecked: !isChecked
|
|
50
51
|
};
|
package/package.json
CHANGED
|
@@ -41,16 +41,17 @@ const CheckBoxView = ({
|
|
|
41
41
|
field = 'group',
|
|
42
42
|
count = 'subjects',
|
|
43
43
|
customCount = (text) => `(${text})`,
|
|
44
|
+
defaultValue = '',
|
|
44
45
|
} = facet;
|
|
45
46
|
|
|
46
47
|
const indexType = index % 2 === 0 ? 'Even' : 'Odd';
|
|
47
48
|
const checkedSection = `${section}`.toLowerCase().replace(/\ /g, '_');
|
|
48
49
|
|
|
49
|
-
const name = checkboxItem[field] || 'N/A';
|
|
50
|
+
const name = checkboxItem[field] || defaultValue || 'N/A';
|
|
50
51
|
|
|
51
52
|
const handleToggle = () => {
|
|
52
53
|
const toggleCheckBoxItem = {
|
|
53
|
-
name:
|
|
54
|
+
name: checkboxItem[field],
|
|
54
55
|
datafield: datafield,
|
|
55
56
|
isChecked: !isChecked,
|
|
56
57
|
};
|