@simpli-route/apollo-ds 0.2.2 → 0.2.3
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/SearchField/utils.d.ts +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +1414 -1405
- package/dist/stories/Autocomplete.stories.d.ts +8 -0
- package/dist/stories/InvisibleSelect.stories.d.ts +8 -0
- package/dist/stories/SearchField.stories.d.ts +11 -0
- package/dist/stories/SelectInput.stories.d.ts +8 -0
- package/dist/utils/accentInsensitive.d.ts +28 -0
- package/dist/utils/accentInsensitive.test.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -19,3 +19,11 @@ export declare const Required: Story;
|
|
|
19
19
|
export declare const AsyncMovieSearch: Story;
|
|
20
20
|
/** Debounced async search - avoids 1 request per keystroke. Debounce is only in this example, not in the component. */
|
|
21
21
|
export declare const AsyncMovieSearchDebounced: Story;
|
|
22
|
+
/**
|
|
23
|
+
* DEMO — Accent-insensitive search.
|
|
24
|
+
*
|
|
25
|
+
* Autocomplete passes the shared `accentInsensitiveContains` util as the RAC ComboBox
|
|
26
|
+
* `defaultFilter`, so `accion` matches "Acción 1", `bogota` matches "Bogotá" and `nunez`
|
|
27
|
+
* matches "Núñez" (ñ→n) regardless of locale. Matches are also highlighted accent-insensitively.
|
|
28
|
+
*/
|
|
29
|
+
export declare const AccentSearchBehavior: Story;
|
|
@@ -56,3 +56,11 @@ export declare const WithError: Story;
|
|
|
56
56
|
export declare const WithErrorHorizontal: Story;
|
|
57
57
|
export declare const SearchWithNoResults: Story;
|
|
58
58
|
export declare const WithDisabledItems: Story;
|
|
59
|
+
/**
|
|
60
|
+
* DEMO — Accent-insensitive search.
|
|
61
|
+
*
|
|
62
|
+
* InvisibleSelect folds accents via the shared `accentInsensitiveContains` util (used as
|
|
63
|
+
* the RAC Autocomplete `filter`), so `accion` matches "Acción 1", `bogota` matches
|
|
64
|
+
* "Bogotá" and `nunez` matches "Núñez" (ñ→n) regardless of locale.
|
|
65
|
+
*/
|
|
66
|
+
export declare const AccentSearchBehavior: Story;
|
|
@@ -50,3 +50,14 @@ export declare const MultipleValuesControlledBasic: Story;
|
|
|
50
50
|
export declare const MultipleValuesControlledExample: Story;
|
|
51
51
|
export declare const WithContainerClassName: Story;
|
|
52
52
|
export declare const MultipleValuesWithCustomValue: Story;
|
|
53
|
+
/**
|
|
54
|
+
* DEMO — Accent-insensitive search.
|
|
55
|
+
*
|
|
56
|
+
* SearchField folds accents via the shared `accentInsensitiveContains` util, so search
|
|
57
|
+
* works in both directions and regardless of locale:
|
|
58
|
+
*
|
|
59
|
+
* - Type `accion` (no accent) → matches "Acción 1".
|
|
60
|
+
* - Type `acción` (with accent) → matches "Accion sin tilde".
|
|
61
|
+
* - Type `bogota` → matches "Bogotá". Type `nunez` → matches "Núñez". Type `pena` → matches "Peña".
|
|
62
|
+
*/
|
|
63
|
+
export declare const AccentSearchBehavior: Story;
|
|
@@ -65,3 +65,11 @@ export declare const MassiveList: Story;
|
|
|
65
65
|
export declare const ValidState: Story;
|
|
66
66
|
export declare const SearchWithNoResults: Story;
|
|
67
67
|
export declare const InvalidState: Story;
|
|
68
|
+
/**
|
|
69
|
+
* DEMO — Accent-insensitive search.
|
|
70
|
+
*
|
|
71
|
+
* SelectInput folds accents via the shared `accentInsensitiveContains` util (used as the
|
|
72
|
+
* RAC Autocomplete `filter`), so `accion` matches "Acción 1", `bogota` matches "Bogotá"
|
|
73
|
+
* and `nunez` matches "Núñez" (ñ→n) regardless of locale.
|
|
74
|
+
*/
|
|
75
|
+
export declare const AccentSearchBehavior: Story;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes text for accent- and case-insensitive search.
|
|
3
|
+
*
|
|
4
|
+
* Decomposes accented characters (NFD) and strips combining diacritical marks
|
|
5
|
+
* (U+0300–U+036F), so `á→a`, `ñ→n`, `ü→u`, etc., then lowercases the result. This makes
|
|
6
|
+
* search work in both directions and independent of locale (unlike the collator, which
|
|
7
|
+
* treats `ñ` as a distinct letter in Spanish).
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeForSearch(value: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns `true` if `text` contains `query`, ignoring accents and case.
|
|
12
|
+
* An empty `query` always matches (useful as a default filter).
|
|
13
|
+
*/
|
|
14
|
+
export declare function accentInsensitiveContains(text: string, query: string): boolean;
|
|
15
|
+
export interface HighlightedPart {
|
|
16
|
+
text: string;
|
|
17
|
+
highlight: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Splits `text` into parts flagging which ones match `highlight`, ignoring accents and
|
|
21
|
+
* case. Each part keeps the original text (with its accents).
|
|
22
|
+
*
|
|
23
|
+
* Matching is computed on the normalized strings; since each precomposed (NFC) accented
|
|
24
|
+
* character maps to a single character after normalization, indices align with the
|
|
25
|
+
* original text. If the lengths differ for some reason (already-decomposed text), the
|
|
26
|
+
* text is returned unhighlighted to avoid slicing at the wrong offsets.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getHighlightedParts(text: string, highlight: string): HighlightedPart[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/index.d.ts
CHANGED