@luscii-healthtech/web-ui 27.8.0 → 27.8.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.
- package/dist/components/FilterBar/ActiveFilters.d.ts +1 -1
- package/dist/components/FilterBar/FilterBarProps.type.d.ts +6 -0
- package/dist/index.development.js +4 -1
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { CategorizedFilters, FilterBarLocalization, OnFilterBarFilterChange } fr
|
|
|
3
3
|
type ActiveFiltersProps = {
|
|
4
4
|
filters: CategorizedFilters;
|
|
5
5
|
onRemoveActiveFilter: OnFilterBarFilterChange;
|
|
6
|
-
localization: Pick<FilterBarLocalization, "filtersLabel">;
|
|
6
|
+
localization: Pick<FilterBarLocalization, "filtersLabel" | "removeFilterOptionLabelGetter">;
|
|
7
7
|
};
|
|
8
8
|
export declare const ActiveFilters: React.FC<ActiveFiltersProps>;
|
|
9
9
|
export {};
|
|
@@ -57,6 +57,12 @@ export type FilterBarLocalization = {
|
|
|
57
57
|
* @default "Filters"
|
|
58
58
|
*/
|
|
59
59
|
filtersLabel: string;
|
|
60
|
+
/**
|
|
61
|
+
* Function for assigning a label to the remove button of an active filter.
|
|
62
|
+
* @param {TransformedFilterOption} activeFilter
|
|
63
|
+
* @default (activeFilter) => `Remove filter ${activeFilter.label}`
|
|
64
|
+
*/
|
|
65
|
+
removeFilterOptionLabelGetter?: (activeFilter: TransformedFilterOption) => string;
|
|
60
66
|
};
|
|
61
67
|
export type TransformedFilterOption = {
|
|
62
68
|
id: string;
|
|
@@ -5657,8 +5657,11 @@ const CloseIcon = () => React__namespace.default.createElement(
|
|
|
5657
5657
|
{ className: "ui-h-2 ui-w-2", stroke: "currentColor", fill: "none", viewBox: "0 0 8 8" },
|
|
5658
5658
|
React__namespace.default.createElement("path", { strokeLinecap: "round", strokeWidth: "1.5", d: "M1 1l6 6m0-6L1 7" })
|
|
5659
5659
|
);
|
|
5660
|
+
const defaultRemoveFilterOptionLabelGetter = (activeFilter) => `Remove filter ${activeFilter.label}`;
|
|
5660
5661
|
const ActiveFilters = (props) => {
|
|
5662
|
+
var _a;
|
|
5661
5663
|
const { onRemoveActiveFilter, filters, localization } = props;
|
|
5664
|
+
const removeFilterOptionLabelGetter = (_a = localization === null || localization === void 0 ? void 0 : localization.removeFilterOptionLabelGetter) !== null && _a !== void 0 ? _a : defaultRemoveFilterOptionLabelGetter;
|
|
5662
5665
|
const activeFilters = filters.flatMap((categorizedFilter) => {
|
|
5663
5666
|
return categorizedFilter.options.map((categorizedFilterOption) => {
|
|
5664
5667
|
return categorizedFilterOption;
|
|
@@ -5681,7 +5684,7 @@ const ActiveFilters = (props) => {
|
|
|
5681
5684
|
React__namespace.default.createElement("span", null, activeFilter.label),
|
|
5682
5685
|
React__namespace.default.createElement(
|
|
5683
5686
|
"button",
|
|
5684
|
-
{ type: "button", className: "ui-mx-1 ui-inline-flex ui-h-4 ui-w-4 ui-flex-shrink-0 ui-rounded-full ui-p-1 ui-text-gray-400 hover:ui-bg-gray-200 hover:ui-text-gray-500", onClick: () => onRemoveActiveFilter({
|
|
5687
|
+
{ type: "button", "aria-label": removeFilterOptionLabelGetter(activeFilter), className: "ui-mx-1 ui-inline-flex ui-h-4 ui-w-4 ui-flex-shrink-0 ui-rounded-full ui-p-1 ui-text-gray-400 hover:ui-bg-gray-200 hover:ui-text-gray-500", onClick: () => onRemoveActiveFilter({
|
|
5685
5688
|
changedFilterOption: {
|
|
5686
5689
|
isChecked: false,
|
|
5687
5690
|
id: activeFilter.id,
|