elastic-input 0.1.0 → 0.2.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/README.md +37 -15
- package/dist/autocomplete/AutocompleteEngine.d.ts +10 -0
- package/dist/elastic-input.es.js +680 -680
- package/dist/types.d.ts +4 -10
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -43,18 +43,12 @@ export interface FieldConfig {
|
|
|
43
43
|
label?: string;
|
|
44
44
|
/** Data type that determines validation and autocomplete behavior. */
|
|
45
45
|
type: FieldType;
|
|
46
|
-
/** Allowed values for `enum` fields, or value hints for other types. Shown in autocomplete. */
|
|
47
|
-
suggestions?: string[];
|
|
48
46
|
/** Allowed comparison operators. Defaults to `>`, `>=`, `<`, `<=` for number/date fields. */
|
|
49
47
|
operators?: string[];
|
|
50
48
|
/** Description shown alongside the field in autocomplete suggestions. */
|
|
51
49
|
description?: string;
|
|
52
50
|
/** Custom placeholder hint shown in the dropdown while typing a value for this field (e.g. "Search by company name..."). Overrides the default type-based hint. Set to `false` to suppress the hint entirely. */
|
|
53
51
|
placeholder?: string | false;
|
|
54
|
-
/** When `true`, the dropdown shows a "Searching..." spinner immediately when entering this field's value (instead of the sync hint). Use for fields whose values are provided by `fetchSuggestions`. @default false */
|
|
55
|
-
asyncSearch?: boolean;
|
|
56
|
-
/** Label shown next to the loading spinner for async fields. Accepts a static string or a callback receiving the current partial text. @default "Searching..." */
|
|
57
|
-
asyncSearchLabel?: string | ((partial: string) => string);
|
|
58
52
|
}
|
|
59
53
|
/** A saved/named search that users can reference with `#name` syntax. */
|
|
60
54
|
export interface SavedSearch {
|
|
@@ -320,10 +314,10 @@ export interface ElasticInputProps {
|
|
|
320
314
|
value?: string;
|
|
321
315
|
/** Initial value for uncontrolled usage. Ignored if `value` is provided. */
|
|
322
316
|
defaultValue?: string;
|
|
323
|
-
/** Saved searches available via `#name` syntax.
|
|
324
|
-
savedSearches?: SavedSearch[] | (() => Promise<SavedSearch[]>);
|
|
325
|
-
/** Search history available via `!` syntax.
|
|
326
|
-
searchHistory?: HistoryEntry[] | (() => Promise<HistoryEntry[]>);
|
|
317
|
+
/** Saved searches available via `#name` syntax. Array is passed through as-is; callback is called per-keystroke (debounced) with the partial. */
|
|
318
|
+
savedSearches?: SavedSearch[] | ((partial: string) => Promise<SavedSearch[]>);
|
|
319
|
+
/** Search history available via `!` syntax. Array is passed through as-is; callback is called per-keystroke (debounced) with the partial. */
|
|
320
|
+
searchHistory?: HistoryEntry[] | ((partial: string) => Promise<HistoryEntry[]>);
|
|
327
321
|
/** Async callback for fetching field value suggestions. Called with field name and partial text. */
|
|
328
322
|
fetchSuggestions?: (fieldName: string, partial: string) => Promise<SuggestionItem[]>;
|
|
329
323
|
/** Color overrides for syntax highlighting and UI elements. Merged with `DEFAULT_COLORS`. */
|