@omnitend/dashboard-for-laravel 0.47.5 → 0.48.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.
@@ -1,9 +1,36 @@
1
1
  import type { SelectOption } from "bootstrap-vue-next";
2
2
  type AutocompleteOptions = readonly (object | string | number | boolean)[];
3
3
  type FilterFunction = (options: SelectOption[], search: string) => SelectOption[];
4
+ /**
5
+ * Resolves with the options matching `term`. The signal is aborted when a
6
+ * newer term supersedes this call, so a fetch can be cancelled.
7
+ */
8
+ export type AutocompleteProvider = (term: string, signal: AbortSignal) => Promise<AutocompleteOptions>;
4
9
  interface Props {
5
- /** Options passed straight through to BAutocomplete (see its `options` prop). */
10
+ /**
11
+ * Options passed straight through to BAutocomplete (see its `options` prop).
12
+ * With a `provider`, these are a seed: they stay in the list alongside the
13
+ * provider's results, so a value bound before any search has run can be
14
+ * labelled by passing its option here.
15
+ */
6
16
  options?: AutocompleteOptions;
17
+ /**
18
+ * Ask a server for the options as the user types (0.48.0), for a list too
19
+ * big to download and filter in the browser. Called with the trimmed text
20
+ * once typing has paused for `provider-debounce` ms; its result replaces
21
+ * the list. Only the latest call's result is applied: an earlier call that
22
+ * resolves late is dropped, and its signal was aborted when the newer term
23
+ * was typed. bvn's own substring filter is bypassed, since the server has
24
+ * already filtered. An empty term makes no call and clears the results.
25
+ * A rejected promise reads as "Search failed" in the list (an abort does
26
+ * not) and is logged; it never throws out of the component.
27
+ *
28
+ * Named for DXTable's `provider`, a function that supplies rows; `search`
29
+ * is bvn's name for the input's text and stays as it was.
30
+ */
31
+ provider?: AutocompleteProvider;
32
+ /** Milliseconds of quiet typing before `provider` is called. */
33
+ providerDebounce?: number;
7
34
  /**
8
35
  * A custom filter. Composed with `null-option` rather than replaced: when a
9
36
  * null option is present it stays pinned and this runs on the rest.
@@ -18,11 +45,17 @@ interface Props {
18
45
  */
19
46
  nullOption?: boolean | string;
20
47
  }
21
- declare var __VLS_10: string | number, __VLS_11: any;
48
+ declare var __VLS_11: string | number, __VLS_12: any;
22
49
  type __VLS_Slots = {} & {
23
- [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
50
+ [K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
24
51
  };
25
- declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
53
+ options: AutocompleteOptions;
54
+ provider: AutocompleteProvider;
55
+ providerDebounce: number;
56
+ filterFunction: FilterFunction;
57
+ nullOption: boolean | string;
58
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
59
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
27
60
  export default _default;
28
61
  type __VLS_WithSlots<T, S> = T & {