Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

This is a major release, and it might be not compatible with your current usage of our library. Please read about the necessary changes in the section about how to migrate.

### Added

- `<ActivityControlWidget />`
- Add parameter `active` to activity control action to set the `active` state of its button.

### Changed

- `<MultiSelect />`:
- Change default filter predicate to match multi-word queries.

### Migration from v24 to v25

- remove deprecated components, properties and imports from your project, if the info cannot be found here then it was already mentioned in **Deprecated** sections of the past changelogs
Expand Down
3 changes: 3 additions & 0 deletions src/cmem/ActivityControl/ActivityControlWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export interface ActivityControlWidgetAction extends TestableComponent {
disabled?: boolean;
// Warning state
hasStateWarning?: boolean;
// Active state
active?: boolean
}

interface IActivityMenuAction extends ActivityControlWidgetAction {
Expand Down Expand Up @@ -228,6 +230,7 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
hoverOpenDelay: 200,
placement: "bottom",
}}
active={action.active}
/>
);
})}
Expand Down
15 changes: 12 additions & 3 deletions src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ import { removeExtraSpaces } from "../../common/utils/stringUtils";
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
import { TestableComponent } from "../interfaces";

import { ContextOverlayProps, Highlighter, IconButton, MenuItem, OverflowText, Spinner } from "./../../index";
import {
ContextOverlayProps,
Highlighter,
highlighterUtils,
IconButton,
MenuItem,
OverflowText,
Spinner
} from "./../../index";

export interface MultiSuggestFieldSelectionProps<T> {
newlySelected?: T;
Expand Down Expand Up @@ -53,7 +61,7 @@ interface MultiSuggestFieldCommonProps<T>
/**
* prop to listen for query changes, when text is entered in the multi-select input
*/
runOnQueryChange?: (query: string) => Promise<T[] | undefined>;
runOnQueryChange?: (query: string) => Promise<T[] | undefined> | (T[] | undefined);
/**
* Whether the component should take up the full width of its container.
* This overrides `tagInputProps.fill`.
Expand Down Expand Up @@ -265,7 +273,8 @@ export function MultiSuggestField<T>({
};

const defaultFilterPredicate = (item: T, query: string) => {
return itemLabel(item).toLowerCase().includes(query);
const searchWords = highlighterUtils.extractSearchWords(query, true)
return highlighterUtils.matchesAllWords(itemLabel(item).toLowerCase(), searchWords)
};

/**
Expand Down