fix(pickers): rework B02 against the public review
Restore native clearing, unify the form/field protocol with the other choice families (per-key entries, disabled and removed keys omitted, shared form owner), synchronise ComboBox text by key identity, keep filtering out of open composition sessions, and stop stealing focus when a controlled close is rejected. Also merge caller refs/ARIA/disabled, implement asChild, autoFocus and ComboBox variant, use a locale-aware base matcher, and put the indicator class and slot on the icon element the ported CSS selects.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Case- and accent-insensitive substring match, the equivalent of ICU
|
||||
* "base" sensitivity for search: `Café` matches `cafe`, `STRASSE` matches
|
||||
* `strasse` after compatibility normalisation.
|
||||
*/
|
||||
const fold = (value: string) => value.normalize("NFKD").replace(/\p{Mn}/gu, "");
|
||||
|
||||
export function createBaseContains(locale?: string) {
|
||||
return (text: string, query: string) => {
|
||||
if (!query) return true;
|
||||
return fold(text)
|
||||
.toLocaleLowerCase(locale)
|
||||
.includes(fold(query).toLocaleLowerCase(locale));
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user