@leonardaustin/ui 0.14.0 → 0.15.0
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/app-shell/MobileDrawer.d.ts.map +1 -1
- package/dist/components/app-shell/Sidebar.d.ts.map +1 -1
- package/dist/components/app-shell/ThemeMenu.d.ts.map +1 -1
- package/dist/components/ui/Combobox.d.ts.map +1 -1
- package/dist/components/ui/Dialog.d.ts.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +3 -1
- package/dist/components/ui/DropdownMenu.d.ts.map +1 -1
- package/dist/components/ui/SelectDropdown.d.ts +6 -1
- package/dist/components/ui/SelectDropdown.d.ts.map +1 -1
- package/dist/components/ui/SideSheet.d.ts.map +1 -1
- package/dist/components/ui/Tooltip.d.ts +11 -4
- package/dist/components/ui/Tooltip.d.ts.map +1 -1
- package/dist/components/ui/calendar/MonthView.d.ts.map +1 -1
- package/dist/hooks/useAnchoredPopup.d.ts +17 -0
- package/dist/hooks/useAnchoredPopup.d.ts.map +1 -1
- package/dist/hooks/useDismiss.d.ts.map +1 -1
- package/dist/hooks/usePortalContainer.d.ts +30 -0
- package/dist/hooks/usePortalContainer.d.ts.map +1 -0
- package/dist/hooks/useTypeahead.d.ts +11 -0
- package/dist/hooks/useTypeahead.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1763 -1554
- package/dist/lib/typeahead.d.ts +35 -0
- package/dist/lib/typeahead.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** How long (ms) a pause ends a typeahead search and starts a new one. */
|
|
2
|
+
export declare const TYPEAHEAD_RESET_MS = 500;
|
|
3
|
+
/** The text typed so far and when the last character arrived. */
|
|
4
|
+
export interface TypeaheadState {
|
|
5
|
+
text: string;
|
|
6
|
+
at: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const EMPTY_TYPEAHEAD: TypeaheadState;
|
|
9
|
+
/** Current time for typeahead; kept out of components so render stays pure. */
|
|
10
|
+
export declare function typeaheadNow(): number;
|
|
11
|
+
/** True for a key that adds to a search: one printable character, no shortcut modifier. */
|
|
12
|
+
export declare function isTypeaheadKey(event: {
|
|
13
|
+
key: string;
|
|
14
|
+
ctrlKey: boolean;
|
|
15
|
+
metaKey: boolean;
|
|
16
|
+
altKey: boolean;
|
|
17
|
+
getModifierState?: (key: "AltGraph") => boolean;
|
|
18
|
+
}): boolean;
|
|
19
|
+
/** Whether a search is in progress at `at` (non-empty and not timed out). */
|
|
20
|
+
export declare function isTypeaheadActive(state: TypeaheadState, at: number): boolean;
|
|
21
|
+
/** The state after typing `char` at `at`; a stale search starts over. */
|
|
22
|
+
export declare function appendTypeahead(state: TypeaheadState, char: string, at: number): TypeaheadState;
|
|
23
|
+
/**
|
|
24
|
+
* The index of the item a search lands on, or -1 for none. Matching is a
|
|
25
|
+
* case-insensitive prefix test on the trimmed label, and disabled items are
|
|
26
|
+
* skipped.
|
|
27
|
+
*
|
|
28
|
+
* A single character, or the same character typed repeatedly, searches
|
|
29
|
+
* forward from the item after `current` and wraps, so repeating a letter
|
|
30
|
+
* cycles through the items that start with it. A longer search starts at
|
|
31
|
+
* `current` itself, so refining it keeps the current item when it still
|
|
32
|
+
* matches.
|
|
33
|
+
*/
|
|
34
|
+
export declare function findTypeaheadMatch(labels: readonly string[], isDisabled: (index: number) => boolean, current: number, query: string): number;
|
|
35
|
+
//# sourceMappingURL=typeahead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeahead.d.ts","sourceRoot":"","sources":["../../src/lib/typeahead.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,eAAe,EAAE,cAAoC,CAAC;AAEnE,+EAA+E;AAC/E,wBAAgB,YAAY,WAE3B;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC;CACjD,WAOA;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,WAElE;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,cAAc,CAGhB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,MAAM,CAiBR"}
|