@trackunit/filters-filter-bar 0.0.210 → 0.0.212
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/index.cjs.js +19 -6
- package/index.esm.js +19 -6
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -710,11 +710,24 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
710
710
|
value: (_a = customSearch === null || customSearch === void 0 ? void 0 : customSearch.value) !== null && _a !== void 0 ? _a : searchText,
|
|
711
711
|
onChange: (_b = customSearch === null || customSearch === void 0 ? void 0 : customSearch.onChange) !== null && _b !== void 0 ? _b : setSearchText,
|
|
712
712
|
count: undefinedCount ? filteredOptions.length - 1 : filteredOptions.length,
|
|
713
|
-
} })), jsxRuntime.jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsxRuntime.jsx(DynamicFilterList, { checked: index =>
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
713
|
+
} })), jsxRuntime.jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsxRuntime.jsx(DynamicFilterList, { checked: index => {
|
|
714
|
+
var _a, _b;
|
|
715
|
+
return filterDefinition.type === "valueName"
|
|
716
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || "")
|
|
717
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, ((_b = res[index]) === null || _b === void 0 ? void 0 : _b.key) || "");
|
|
718
|
+
}, count: index => { var _a; return (_a = res[index]) === null || _a === void 0 ? void 0 : _a.count; }, keyMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""; }, labelMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.label) || ""; }, onChange: index => {
|
|
719
|
+
const result = res[index];
|
|
720
|
+
if (result) {
|
|
721
|
+
handleClick(result);
|
|
722
|
+
}
|
|
723
|
+
}, prefixMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.prefix) || ""; }, rowCount: undefinedCount ? res.length - 1 : res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "CheckBox" })) }), showUndefinedOptionWithCountAtBottom && undefinedCount ? (jsxRuntime.jsx(reactFilterComponents.CheckBoxFilterItem, { checked: filterDefinition.type === "valueName"
|
|
724
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_c = results[undefinedCount.index]) === null || _c === void 0 ? void 0 : _c.key) || "")
|
|
725
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, ((_d = results[undefinedCount.index]) === null || _d === void 0 ? void 0 : _d.key) || ""), className: "border-t-2", dataTestId: "dynamic-filter-check-box-undefined", itemCount: undefinedCount.count, label: (_e = results[undefinedCount.index]) === null || _e === void 0 ? void 0 : _e.label, name: "dynamic-filter-check-box-undefined", onChange: () => {
|
|
726
|
+
const result = results[undefinedCount.index];
|
|
727
|
+
if (result) {
|
|
728
|
+
handleClick(result);
|
|
729
|
+
}
|
|
730
|
+
} }, "dynamic-filter-check-box-undefined")) : null] }));
|
|
718
731
|
};
|
|
719
732
|
|
|
720
733
|
const formatToJustDate = (date) => {
|
|
@@ -834,7 +847,7 @@ const DefaultRadioFilter = ({ filterDefinition, filterBarActions, options, loadi
|
|
|
834
847
|
count: filteredOptions.length,
|
|
835
848
|
} })), jsxRuntime.jsx(FilterResults, { loading: loading, results: customSearch ? options : filteredOptions, children: res => (jsxRuntime.jsx(reactFormComponents.RadioGroup, { id: "DefaultRadioFilter", onChange: e => {
|
|
836
849
|
handleClick(e.currentTarget.value);
|
|
837
|
-
}, value: selectedRadioId, children: jsxRuntime.jsx(DynamicFilterList, { checked: index => filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, res[index].key), count: index => res[index].count, keyMapper: index => res[index].key, labelMapper: index => res[index].label, prefixMapper: index => res[index].prefix, rowCount: res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "Radio" }) })) })] }));
|
|
850
|
+
}, value: selectedRadioId, children: jsxRuntime.jsx(DynamicFilterList, { checked: index => { var _a; return filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""); }, count: index => { var _a; return (_a = res[index]) === null || _a === void 0 ? void 0 : _a.count; }, keyMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""; }, labelMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.label) || ""; }, prefixMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.prefix) || ""; }, rowCount: res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "Radio" }) })) })] }));
|
|
838
851
|
};
|
|
839
852
|
|
|
840
853
|
/**
|
package/index.esm.js
CHANGED
|
@@ -702,11 +702,24 @@ const DefaultCheckboxFilter = ({ filterDefinition, filterBarActions, options, lo
|
|
|
702
702
|
value: (_a = customSearch === null || customSearch === void 0 ? void 0 : customSearch.value) !== null && _a !== void 0 ? _a : searchText,
|
|
703
703
|
onChange: (_b = customSearch === null || customSearch === void 0 ? void 0 : customSearch.onChange) !== null && _b !== void 0 ? _b : setSearchText,
|
|
704
704
|
count: undefinedCount ? filteredOptions.length - 1 : filteredOptions.length,
|
|
705
|
-
} })), jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsx(DynamicFilterList, { checked: index =>
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
705
|
+
} })), jsx(FilterResults, { ignoreUndefined: undefinedCount !== null, loading: loading, results: results, children: res => (jsx(DynamicFilterList, { checked: index => {
|
|
706
|
+
var _a, _b;
|
|
707
|
+
return filterDefinition.type === "valueName"
|
|
708
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || "")
|
|
709
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, ((_b = res[index]) === null || _b === void 0 ? void 0 : _b.key) || "");
|
|
710
|
+
}, count: index => { var _a; return (_a = res[index]) === null || _a === void 0 ? void 0 : _a.count; }, keyMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""; }, labelMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.label) || ""; }, onChange: index => {
|
|
711
|
+
const result = res[index];
|
|
712
|
+
if (result) {
|
|
713
|
+
handleClick(result);
|
|
714
|
+
}
|
|
715
|
+
}, prefixMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.prefix) || ""; }, rowCount: undefinedCount ? res.length - 1 : res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "CheckBox" })) }), showUndefinedOptionWithCountAtBottom && undefinedCount ? (jsx(CheckBoxFilterItem, { checked: filterDefinition.type === "valueName"
|
|
716
|
+
? filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_c = results[undefinedCount.index]) === null || _c === void 0 ? void 0 : _c.key) || "")
|
|
717
|
+
: filterBarActions.arrayIncludesValue(filterDefinition.filterKey, ((_d = results[undefinedCount.index]) === null || _d === void 0 ? void 0 : _d.key) || ""), className: "border-t-2", dataTestId: "dynamic-filter-check-box-undefined", itemCount: undefinedCount.count, label: (_e = results[undefinedCount.index]) === null || _e === void 0 ? void 0 : _e.label, name: "dynamic-filter-check-box-undefined", onChange: () => {
|
|
718
|
+
const result = results[undefinedCount.index];
|
|
719
|
+
if (result) {
|
|
720
|
+
handleClick(result);
|
|
721
|
+
}
|
|
722
|
+
} }, "dynamic-filter-check-box-undefined")) : null] }));
|
|
710
723
|
};
|
|
711
724
|
|
|
712
725
|
const formatToJustDate = (date) => {
|
|
@@ -826,7 +839,7 @@ const DefaultRadioFilter = ({ filterDefinition, filterBarActions, options, loadi
|
|
|
826
839
|
count: filteredOptions.length,
|
|
827
840
|
} })), jsx(FilterResults, { loading: loading, results: customSearch ? options : filteredOptions, children: res => (jsx(RadioGroup, { id: "DefaultRadioFilter", onChange: e => {
|
|
828
841
|
handleClick(e.currentTarget.value);
|
|
829
|
-
}, value: selectedRadioId, children: jsx(DynamicFilterList, { checked: index => filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, res[index].key), count: index => res[index].count, keyMapper: index => res[index].key, labelMapper: index => res[index].label, prefixMapper: index => res[index].prefix, rowCount: res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "Radio" }) })) })] }));
|
|
842
|
+
}, value: selectedRadioId, children: jsx(DynamicFilterList, { checked: index => { var _a; return filterBarActions.objectArrayIncludesValue(filterDefinition.filterKey, ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""); }, count: index => { var _a; return (_a = res[index]) === null || _a === void 0 ? void 0 : _a.count; }, keyMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.key) || ""; }, labelMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.label) || ""; }, prefixMapper: index => { var _a; return ((_a = res[index]) === null || _a === void 0 ? void 0 : _a.prefix) || ""; }, rowCount: res.length, showRequestMoreUseSearch: showRequestMoreUseSearch, showTooltip: showTooltip, type: "Radio" }) })) })] }));
|
|
830
843
|
};
|
|
831
844
|
|
|
832
845
|
/**
|