@yamada-ui/autocomplete 1.1.12 → 1.1.13-dev-20240507050136
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/autocomplete-option-group.d.mts +2 -1
- package/dist/autocomplete-option-group.d.ts +2 -1
- package/dist/autocomplete-option.d.mts +2 -1
- package/dist/autocomplete-option.d.ts +2 -1
- package/dist/autocomplete.d.mts +2 -1
- package/dist/autocomplete.d.ts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/multi-autocomplete.d.mts +2 -1
- package/dist/multi-autocomplete.d.ts +2 -1
- package/dist/use-autocomplete-BP1-0-tj.d.mts +407 -0
- package/dist/use-autocomplete-BP1-0-tj.d.ts +407 -0
- package/dist/use-autocomplete.d.mts +2 -1
- package/dist/use-autocomplete.d.ts +2 -1
- package/package.json +2 -2
- package/dist/use-autocomplete-D0Nn5A2q.d.mts +0 -4141
- package/dist/use-autocomplete-D0Nn5A2q.d.ts +0 -4141
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
-
import { U as UseAutocompleteOptionGroupProps } from './use-autocomplete-
|
|
3
|
+
import { U as UseAutocompleteOptionGroupProps } from './use-autocomplete-BP1-0-tj.mjs';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '@yamada-ui/use-descendant';
|
|
6
7
|
import '@yamada-ui/form-control';
|
|
7
8
|
import '@yamada-ui/motion';
|
|
8
9
|
import '@yamada-ui/popover';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
-
import { U as UseAutocompleteOptionGroupProps } from './use-autocomplete-
|
|
3
|
+
import { U as UseAutocompleteOptionGroupProps } from './use-autocomplete-BP1-0-tj.js';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'react';
|
|
6
|
+
import '@yamada-ui/use-descendant';
|
|
6
7
|
import '@yamada-ui/form-control';
|
|
7
8
|
import '@yamada-ui/motion';
|
|
8
9
|
import '@yamada-ui/popover';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@yamada-ui/core';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-
|
|
3
|
+
export { A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-BP1-0-tj.mjs';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
|
+
import '@yamada-ui/use-descendant';
|
|
5
6
|
import '@yamada-ui/form-control';
|
|
6
7
|
import '@yamada-ui/motion';
|
|
7
8
|
import '@yamada-ui/popover';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '@yamada-ui/core';
|
|
2
2
|
import 'react';
|
|
3
|
-
export { A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-
|
|
3
|
+
export { A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-BP1-0-tj.js';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
|
+
import '@yamada-ui/use-descendant';
|
|
5
6
|
import '@yamada-ui/form-control';
|
|
6
7
|
import '@yamada-ui/motion';
|
|
7
8
|
import '@yamada-ui/popover';
|
package/dist/autocomplete.d.mts
CHANGED
|
@@ -3,10 +3,11 @@ import { ThemeProps, HTMLUIProps } from '@yamada-ui/core';
|
|
|
3
3
|
import { PortalProps } from '@yamada-ui/portal';
|
|
4
4
|
import { AutocompleteIconProps } from './autocomplete-icon.mjs';
|
|
5
5
|
import { AutocompleteListProps } from './autocomplete-list.mjs';
|
|
6
|
-
import { c as UseAutocompleteProps } from './use-autocomplete-
|
|
6
|
+
import { c as UseAutocompleteProps } from './use-autocomplete-BP1-0-tj.mjs';
|
|
7
7
|
import 'react';
|
|
8
8
|
import '@yamada-ui/motion';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import '@yamada-ui/use-descendant';
|
|
10
11
|
import '@yamada-ui/form-control';
|
|
11
12
|
import '@yamada-ui/popover';
|
|
12
13
|
import '@yamada-ui/utils';
|
package/dist/autocomplete.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import { ThemeProps, HTMLUIProps } from '@yamada-ui/core';
|
|
|
3
3
|
import { PortalProps } from '@yamada-ui/portal';
|
|
4
4
|
import { AutocompleteIconProps } from './autocomplete-icon.js';
|
|
5
5
|
import { AutocompleteListProps } from './autocomplete-list.js';
|
|
6
|
-
import { c as UseAutocompleteProps } from './use-autocomplete-
|
|
6
|
+
import { c as UseAutocompleteProps } from './use-autocomplete-BP1-0-tj.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import '@yamada-ui/motion';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import '@yamada-ui/use-descendant';
|
|
10
11
|
import '@yamada-ui/form-control';
|
|
11
12
|
import '@yamada-ui/popover';
|
|
12
13
|
import '@yamada-ui/utils';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Autocomplete, AutocompleteProps } from './autocomplete.mjs';
|
|
2
2
|
export { AutocompleteOptionGroup, AutocompleteOptionGroupProps } from './autocomplete-option-group.mjs';
|
|
3
|
-
export { b as AutocompleteItem, A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-
|
|
3
|
+
export { b as AutocompleteItem, A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-BP1-0-tj.mjs';
|
|
4
4
|
export { AutocompleteCreate, AutocompleteCreateProps } from './autocomplete-create.mjs';
|
|
5
5
|
export { AutocompleteEmpty, AutocompleteEmptyProps } from './autocomplete-empty.mjs';
|
|
6
6
|
export { MultiAutocomplete, MultiAutocompleteProps } from './multi-autocomplete.mjs';
|
|
@@ -11,6 +11,7 @@ import 'react';
|
|
|
11
11
|
import './autocomplete-list.mjs';
|
|
12
12
|
import '@yamada-ui/motion';
|
|
13
13
|
import 'react/jsx-runtime';
|
|
14
|
+
import '@yamada-ui/use-descendant';
|
|
14
15
|
import '@yamada-ui/form-control';
|
|
15
16
|
import '@yamada-ui/popover';
|
|
16
17
|
import '@yamada-ui/utils';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Autocomplete, AutocompleteProps } from './autocomplete.js';
|
|
2
2
|
export { AutocompleteOptionGroup, AutocompleteOptionGroupProps } from './autocomplete-option-group.js';
|
|
3
|
-
export { b as AutocompleteItem, A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-
|
|
3
|
+
export { b as AutocompleteItem, A as AutocompleteOption, a as AutocompleteOptionProps } from './use-autocomplete-BP1-0-tj.js';
|
|
4
4
|
export { AutocompleteCreate, AutocompleteCreateProps } from './autocomplete-create.js';
|
|
5
5
|
export { AutocompleteEmpty, AutocompleteEmptyProps } from './autocomplete-empty.js';
|
|
6
6
|
export { MultiAutocomplete, MultiAutocompleteProps } from './multi-autocomplete.js';
|
|
@@ -11,6 +11,7 @@ import 'react';
|
|
|
11
11
|
import './autocomplete-list.js';
|
|
12
12
|
import '@yamada-ui/motion';
|
|
13
13
|
import 'react/jsx-runtime';
|
|
14
|
+
import '@yamada-ui/use-descendant';
|
|
14
15
|
import '@yamada-ui/form-control';
|
|
15
16
|
import '@yamada-ui/popover';
|
|
16
17
|
import '@yamada-ui/utils';
|
|
@@ -4,9 +4,10 @@ import { PortalProps } from '@yamada-ui/portal';
|
|
|
4
4
|
import { FC, MouseEventHandler } from 'react';
|
|
5
5
|
import { AutocompleteIconProps } from './autocomplete-icon.mjs';
|
|
6
6
|
import { AutocompleteListProps } from './autocomplete-list.mjs';
|
|
7
|
-
import { c as UseAutocompleteProps } from './use-autocomplete-
|
|
7
|
+
import { c as UseAutocompleteProps } from './use-autocomplete-BP1-0-tj.mjs';
|
|
8
8
|
import '@yamada-ui/motion';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import '@yamada-ui/use-descendant';
|
|
10
11
|
import '@yamada-ui/form-control';
|
|
11
12
|
import '@yamada-ui/popover';
|
|
12
13
|
import '@yamada-ui/utils';
|
|
@@ -4,9 +4,10 @@ import { PortalProps } from '@yamada-ui/portal';
|
|
|
4
4
|
import { FC, MouseEventHandler } from 'react';
|
|
5
5
|
import { AutocompleteIconProps } from './autocomplete-icon.js';
|
|
6
6
|
import { AutocompleteListProps } from './autocomplete-list.js';
|
|
7
|
-
import { c as UseAutocompleteProps } from './use-autocomplete-
|
|
7
|
+
import { c as UseAutocompleteProps } from './use-autocomplete-BP1-0-tj.js';
|
|
8
8
|
import '@yamada-ui/motion';
|
|
9
9
|
import 'react/jsx-runtime';
|
|
10
|
+
import '@yamada-ui/use-descendant';
|
|
10
11
|
import '@yamada-ui/form-control';
|
|
11
12
|
import '@yamada-ui/popover';
|
|
12
13
|
import '@yamada-ui/utils';
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactElement, RefObject, Dispatch, SetStateAction, ChangeEvent, MouseEvent } from 'react';
|
|
4
|
+
import * as _yamada_ui_use_descendant from '@yamada-ui/use-descendant';
|
|
5
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
6
|
+
import { HTMLUIProps, UIPropGetter, CSSUIObject } from '@yamada-ui/core';
|
|
7
|
+
import { FormControlOptions } from '@yamada-ui/form-control';
|
|
8
|
+
import { MotionUIPropGetter } from '@yamada-ui/motion';
|
|
9
|
+
import { PopoverProps } from '@yamada-ui/popover';
|
|
10
|
+
import { Dict, DOMAttributes, Union } from '@yamada-ui/utils';
|
|
11
|
+
|
|
12
|
+
type AutocompleteOptionOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* The autocomplete option icon to use.
|
|
15
|
+
*/
|
|
16
|
+
icon?: ReactElement;
|
|
17
|
+
};
|
|
18
|
+
type AutocompleteOptionProps = UseAutocompleteOptionProps & AutocompleteOptionOptions;
|
|
19
|
+
declare const AutocompleteOption: _yamada_ui_core.Component<"li", AutocompleteOptionProps>;
|
|
20
|
+
|
|
21
|
+
type AutocompleteBaseItem = Omit<AutocompleteOptionProps, "value" | "children"> & {
|
|
22
|
+
label?: string;
|
|
23
|
+
};
|
|
24
|
+
type AutocompleteItemWithValue = AutocompleteBaseItem & {
|
|
25
|
+
value?: string;
|
|
26
|
+
};
|
|
27
|
+
type AutocompleteItemWithItems = AutocompleteBaseItem & {
|
|
28
|
+
items?: AutocompleteItemWithValue[];
|
|
29
|
+
};
|
|
30
|
+
type AutocompleteItem = AutocompleteItemWithValue | AutocompleteItemWithItems;
|
|
31
|
+
declare const AutocompleteDescendantsContextProvider: react.Provider<{
|
|
32
|
+
register: (nodeOrOptions: HTMLElement | {
|
|
33
|
+
disabled?: boolean | undefined;
|
|
34
|
+
id?: string | undefined;
|
|
35
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
|
36
|
+
} | null) => void | ((node: HTMLElement | null) => void);
|
|
37
|
+
unregister: (node: HTMLElement) => void;
|
|
38
|
+
destroy: () => void;
|
|
39
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
40
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
41
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
42
|
+
indexOf: (node: HTMLElement | null) => number;
|
|
43
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
44
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
45
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The value of the autocomplete.
|
|
48
|
+
*/
|
|
49
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
50
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
51
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
52
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
53
|
+
* The initial value of the autocomplete.
|
|
54
|
+
*/
|
|
55
|
+
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
56
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
57
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
58
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
59
|
+
* The callback invoked when value state changes.
|
|
60
|
+
*/
|
|
61
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
declare const useAutocompleteDescendantsContext: () => {
|
|
64
|
+
register: (nodeOrOptions: HTMLElement | {
|
|
65
|
+
disabled?: boolean | undefined;
|
|
66
|
+
id?: string | undefined;
|
|
67
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
|
68
|
+
} | null) => void | ((node: HTMLElement | null) => void);
|
|
69
|
+
unregister: (node: HTMLElement) => void;
|
|
70
|
+
destroy: () => void;
|
|
71
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
72
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
73
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
74
|
+
indexOf: (node: HTMLElement | null) => number;
|
|
75
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
76
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
77
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* The value of the autocomplete.
|
|
80
|
+
*/
|
|
81
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
82
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
83
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
84
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
85
|
+
* The initial value of the autocomplete.
|
|
86
|
+
*/
|
|
87
|
+
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
88
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
89
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
90
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
91
|
+
* The callback invoked when value state changes.
|
|
92
|
+
*/
|
|
93
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
94
|
+
};
|
|
95
|
+
declare const useAutocompleteDescendants: () => {
|
|
96
|
+
register: (nodeOrOptions: HTMLElement | {
|
|
97
|
+
disabled?: boolean | undefined;
|
|
98
|
+
id?: string | undefined;
|
|
99
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
|
100
|
+
} | null) => void | ((node: HTMLElement | null) => void);
|
|
101
|
+
unregister: (node: HTMLElement) => void;
|
|
102
|
+
destroy: () => void;
|
|
103
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
104
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
105
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
106
|
+
indexOf: (node: HTMLElement | null) => number;
|
|
107
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
108
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
109
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* The value of the autocomplete.
|
|
112
|
+
*/
|
|
113
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
114
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
115
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
116
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
117
|
+
* The initial value of the autocomplete.
|
|
118
|
+
*/
|
|
119
|
+
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
120
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
121
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
122
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
123
|
+
* The callback invoked when value state changes.
|
|
124
|
+
*/
|
|
125
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
126
|
+
};
|
|
127
|
+
declare const useAutocompleteDescendant: (options?: {
|
|
128
|
+
disabled?: boolean | undefined;
|
|
129
|
+
id?: string | undefined;
|
|
130
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
|
131
|
+
} | undefined) => {
|
|
132
|
+
descendants: {
|
|
133
|
+
register: (nodeOrOptions: HTMLElement | _yamada_ui_use_descendant.DescendantOptions<HTMLElement, Record<string, any>> | null) => void | ((node: HTMLElement | null) => void);
|
|
134
|
+
unregister: (node: HTMLElement) => void;
|
|
135
|
+
destroy: () => void;
|
|
136
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => number;
|
|
137
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>>[];
|
|
138
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
139
|
+
indexOf: (node: HTMLElement | null) => number;
|
|
140
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
141
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
142
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* The value of the autocomplete.
|
|
145
|
+
*/
|
|
146
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
147
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => number;
|
|
148
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>>[];
|
|
149
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined; /**
|
|
150
|
+
* The initial value of the autocomplete.
|
|
151
|
+
*/
|
|
152
|
+
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => number;
|
|
153
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
154
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
155
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined; /**
|
|
156
|
+
* The callback invoked when value state changes.
|
|
157
|
+
*/
|
|
158
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, Record<string, any>> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, Record<string, any>> | undefined;
|
|
159
|
+
};
|
|
160
|
+
index: number;
|
|
161
|
+
enabledIndex: number;
|
|
162
|
+
register: (node: HTMLElement | null) => void;
|
|
163
|
+
};
|
|
164
|
+
type AutocompleteContext = Omit<UseAutocompleteProps, "value" | "defaultValue" | "onChange" | "onCreate"> & {
|
|
165
|
+
value: string | string[];
|
|
166
|
+
label: string | string[] | undefined;
|
|
167
|
+
inputValue: string;
|
|
168
|
+
isHit: boolean;
|
|
169
|
+
isEmpty: boolean;
|
|
170
|
+
isAllSelected: boolean;
|
|
171
|
+
onChange: (newValue: string) => void;
|
|
172
|
+
onChangeLabel: (newValue: string, runOmit?: boolean) => void;
|
|
173
|
+
pickOptions: (value: string) => void;
|
|
174
|
+
rebirthOptions: (runFocus?: boolean) => void;
|
|
175
|
+
inputProps: DOMAttributes;
|
|
176
|
+
isOpen: boolean;
|
|
177
|
+
onOpen: () => void;
|
|
178
|
+
onClose: () => void;
|
|
179
|
+
onCreate: () => void;
|
|
180
|
+
onFocusFirst: () => void;
|
|
181
|
+
onFocusLast: () => void;
|
|
182
|
+
onFocusNext: (index?: number) => void;
|
|
183
|
+
onFocusPrev: (index?: number) => void;
|
|
184
|
+
focusedIndex: number;
|
|
185
|
+
setFocusedIndex: Dispatch<SetStateAction<number>>;
|
|
186
|
+
listRef: RefObject<HTMLUListElement>;
|
|
187
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
188
|
+
formControlProps: Record<string, any>;
|
|
189
|
+
styles: Record<string, CSSUIObject>;
|
|
190
|
+
};
|
|
191
|
+
declare const AutocompleteProvider: react.Provider<AutocompleteContext>;
|
|
192
|
+
declare const useAutocompleteContext: () => AutocompleteContext;
|
|
193
|
+
type UseAutocompleteBaseProps<T extends string | string[] = string> = Omit<PopoverProps, "initialFocusRef" | "closeOnButton" | "trigger" | "autoFocus" | "restoreFocus" | "openDelay" | "closeDelay"> & FormControlOptions & {
|
|
194
|
+
/**
|
|
195
|
+
* The value of the autocomplete.
|
|
196
|
+
*/
|
|
197
|
+
value?: T;
|
|
198
|
+
/**
|
|
199
|
+
* The initial value of the autocomplete.
|
|
200
|
+
*/
|
|
201
|
+
defaultValue?: T;
|
|
202
|
+
/**
|
|
203
|
+
* The callback invoked when value state changes.
|
|
204
|
+
*/
|
|
205
|
+
onChange?: (value: T) => void;
|
|
206
|
+
/**
|
|
207
|
+
* The callback invoked when search input.
|
|
208
|
+
*/
|
|
209
|
+
onSearch?: (ev: ChangeEvent<HTMLInputElement>) => void;
|
|
210
|
+
/**
|
|
211
|
+
* The callback invoked when autocomplete option created.
|
|
212
|
+
*/
|
|
213
|
+
onCreate?: (newItem: AutocompleteItem, newItems: AutocompleteItem[]) => void;
|
|
214
|
+
/**
|
|
215
|
+
* Function to format text when search input.
|
|
216
|
+
*/
|
|
217
|
+
format?: (value: string) => string;
|
|
218
|
+
/**
|
|
219
|
+
* The position to be inserted when the autocomplete option is created.
|
|
220
|
+
*
|
|
221
|
+
* @default 'first'
|
|
222
|
+
*/
|
|
223
|
+
insertPositionItem?: Union<"first" | "last"> | [string, "first" | "last"];
|
|
224
|
+
/**
|
|
225
|
+
* If `true`, the list element will be closed when value is selected.
|
|
226
|
+
*
|
|
227
|
+
* @default true
|
|
228
|
+
*/
|
|
229
|
+
closeOnSelect?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* The message displayed when the search yields no hits.
|
|
232
|
+
*
|
|
233
|
+
* @default 'No results found'
|
|
234
|
+
*/
|
|
235
|
+
emptyMessage?: string;
|
|
236
|
+
/**
|
|
237
|
+
* If `true`, enables the creation of autocomplete option.
|
|
238
|
+
*
|
|
239
|
+
* @default false
|
|
240
|
+
*/
|
|
241
|
+
allowCreate?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* If `true`, enables the free input.
|
|
244
|
+
*/
|
|
245
|
+
allowFree?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* If `true`, the selected item(s) will be excluded from the list.
|
|
248
|
+
*
|
|
249
|
+
* @default false
|
|
250
|
+
*/
|
|
251
|
+
omitSelectedValues?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* The maximum selectable value.
|
|
254
|
+
*/
|
|
255
|
+
maxSelectValues?: number;
|
|
256
|
+
/**
|
|
257
|
+
* Props for select option element.
|
|
258
|
+
*/
|
|
259
|
+
optionProps?: Omit<AutocompleteOptionProps, "value" | "children">;
|
|
260
|
+
/**
|
|
261
|
+
* If provided, generate options based on items.
|
|
262
|
+
*/
|
|
263
|
+
items?: AutocompleteItem[];
|
|
264
|
+
};
|
|
265
|
+
type UseAutocompleteProps<T extends string | string[] = string> = Omit<HTMLUIProps<"input">, keyof UseAutocompleteBaseProps | "list" | "disabled" | "required" | "readOnly" | "size"> & UseAutocompleteBaseProps<T>;
|
|
266
|
+
declare const useAutocomplete: <T extends string | string[] = string>({ value: valueProp, defaultValue, onChange: onChangeProp, onCreate: onCreateProp, onSearch: onSearchProp, closeOnSelect, omitSelectedValues, maxSelectValues, closeOnBlur, closeOnEsc, allowCreate, allowFree, insertPositionItem, emptyMessage, format, placement, duration, optionProps, placeholder, items, children, isOpen: isOpenProp, defaultIsOpen, onOpen: onOpenProp, onClose: onCloseProp, ...rest }: UseAutocompleteProps<T>) => {
|
|
267
|
+
id: string | undefined;
|
|
268
|
+
descendants: {
|
|
269
|
+
register: (nodeOrOptions: HTMLElement | {
|
|
270
|
+
disabled?: boolean | undefined;
|
|
271
|
+
id?: string | undefined;
|
|
272
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
|
273
|
+
} | null) => void | ((node: HTMLElement | null) => void);
|
|
274
|
+
unregister: (node: HTMLElement) => void;
|
|
275
|
+
destroy: () => void;
|
|
276
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
277
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
278
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
279
|
+
indexOf: (node: HTMLElement | null) => number;
|
|
280
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
281
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
282
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* The value of the autocomplete.
|
|
285
|
+
*/
|
|
286
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
287
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
288
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
|
289
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
290
|
+
* The initial value of the autocomplete.
|
|
291
|
+
*/
|
|
292
|
+
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
|
293
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
294
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
295
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined; /**
|
|
296
|
+
* The callback invoked when value state changes.
|
|
297
|
+
*/
|
|
298
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
|
299
|
+
};
|
|
300
|
+
value: T;
|
|
301
|
+
label: T | undefined;
|
|
302
|
+
inputValue: string;
|
|
303
|
+
isHit: boolean;
|
|
304
|
+
isEmpty: boolean;
|
|
305
|
+
computedChildren: (react_jsx_runtime.JSX.Element | undefined)[] | undefined;
|
|
306
|
+
focusedIndex: number;
|
|
307
|
+
omitSelectedValues: boolean;
|
|
308
|
+
closeOnSelect: boolean;
|
|
309
|
+
allowCreate: boolean;
|
|
310
|
+
allowFree: boolean;
|
|
311
|
+
emptyMessage: string;
|
|
312
|
+
isOpen: boolean;
|
|
313
|
+
isAllSelected: boolean;
|
|
314
|
+
listRef: RefObject<HTMLUListElement>;
|
|
315
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
316
|
+
optionProps: Omit<AutocompleteOptionProps, "value" | "children"> | undefined;
|
|
317
|
+
formControlProps: {
|
|
318
|
+
[x: string]: any;
|
|
319
|
+
};
|
|
320
|
+
setFocusedIndex: Dispatch<SetStateAction<number>>;
|
|
321
|
+
onChangeLabel: (newValue: string, runOmit?: boolean) => void;
|
|
322
|
+
onChange: (newValue: string, runRebirth?: boolean) => void;
|
|
323
|
+
onSearch: (ev: ChangeEvent<HTMLInputElement>) => void;
|
|
324
|
+
onCreate: () => void;
|
|
325
|
+
onClear: (ev: MouseEvent<HTMLDivElement>) => void;
|
|
326
|
+
onCompositionStart: () => void;
|
|
327
|
+
onCompositionEnd: () => void;
|
|
328
|
+
pickOptions: (value: string) => void;
|
|
329
|
+
rebirthOptions: (runFocus?: boolean) => void;
|
|
330
|
+
onOpen: () => void;
|
|
331
|
+
onClose: () => void;
|
|
332
|
+
onFocusFirst: () => void;
|
|
333
|
+
onFocusLast: () => void;
|
|
334
|
+
onFocusSelected: () => void;
|
|
335
|
+
onFocusNext: (index?: number) => void;
|
|
336
|
+
onFocusPrev: (index?: number) => void;
|
|
337
|
+
getPopoverProps: (props?: PopoverProps) => PopoverProps;
|
|
338
|
+
getContainerProps: UIPropGetter;
|
|
339
|
+
getFieldProps: UIPropGetter;
|
|
340
|
+
inputProps: Omit<Dict, string>;
|
|
341
|
+
};
|
|
342
|
+
type UseAutocompleteReturn = ReturnType<typeof useAutocomplete>;
|
|
343
|
+
declare const useAutocompleteInput: () => {
|
|
344
|
+
getInputProps: UIPropGetter<"input">;
|
|
345
|
+
};
|
|
346
|
+
type UseAutocompleteInputReturn = ReturnType<typeof useAutocompleteInput>;
|
|
347
|
+
declare const useAutocompleteList: () => {
|
|
348
|
+
getListProps: MotionUIPropGetter<"ul">;
|
|
349
|
+
};
|
|
350
|
+
type UseAutocompleteOptionGroupProps = HTMLUIProps<"ul"> & {
|
|
351
|
+
/**
|
|
352
|
+
* The label of the autocomplete option group.
|
|
353
|
+
*/
|
|
354
|
+
label: string;
|
|
355
|
+
};
|
|
356
|
+
declare const useAutocompleteOptionGroup: ({ label, ...rest }: UseAutocompleteOptionGroupProps) => {
|
|
357
|
+
label: string;
|
|
358
|
+
getContainerProps: UIPropGetter;
|
|
359
|
+
getGroupProps: UIPropGetter;
|
|
360
|
+
};
|
|
361
|
+
type UseAutocompleteOptionGroupReturn = ReturnType<typeof useAutocompleteOptionGroup>;
|
|
362
|
+
type UseAutocompleteOptionProps = Omit<HTMLUIProps<"li">, "value" | "children"> & {
|
|
363
|
+
/**
|
|
364
|
+
* The value of the select option.
|
|
365
|
+
*/
|
|
366
|
+
value?: string;
|
|
367
|
+
/**
|
|
368
|
+
* The label of the select option.
|
|
369
|
+
*/
|
|
370
|
+
children?: string;
|
|
371
|
+
/**
|
|
372
|
+
* If `true`, the select option will be disabled.
|
|
373
|
+
*
|
|
374
|
+
* @default false
|
|
375
|
+
*/
|
|
376
|
+
isDisabled?: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* If `true`, the select option will be focusable.
|
|
379
|
+
*
|
|
380
|
+
* @default false
|
|
381
|
+
*/
|
|
382
|
+
isFocusable?: boolean;
|
|
383
|
+
/**
|
|
384
|
+
* If `true`, the list element will be closed when selected.
|
|
385
|
+
*
|
|
386
|
+
* @default false
|
|
387
|
+
*/
|
|
388
|
+
closeOnSelect?: boolean;
|
|
389
|
+
};
|
|
390
|
+
declare const useAutocompleteOption: (props: UseAutocompleteOptionProps) => {
|
|
391
|
+
isSelected: boolean;
|
|
392
|
+
isFocused: boolean;
|
|
393
|
+
customIcon: react.ReactElement<any, string | react.JSXElementConstructor<any>> | undefined;
|
|
394
|
+
children: string | undefined;
|
|
395
|
+
getOptionProps: UIPropGetter<"li">;
|
|
396
|
+
};
|
|
397
|
+
type UseAutocompleteOptionReturn = ReturnType<typeof useAutocompleteOption>;
|
|
398
|
+
declare const useAutocompleteCreate: () => {
|
|
399
|
+
getCreateProps: UIPropGetter<"li">;
|
|
400
|
+
};
|
|
401
|
+
type UseAutocompleteCreateReturn = ReturnType<typeof useAutocompleteCreate>;
|
|
402
|
+
declare const useAutocompleteEmpty: () => {
|
|
403
|
+
getEmptyProps: UIPropGetter<"li">;
|
|
404
|
+
};
|
|
405
|
+
type UseAutocompleteEmptyReturn = ReturnType<typeof useAutocompleteEmpty>;
|
|
406
|
+
|
|
407
|
+
export { AutocompleteOption as A, type UseAutocompleteOptionGroupProps as U, type AutocompleteOptionProps as a, type AutocompleteItem as b, type UseAutocompleteProps as c, AutocompleteDescendantsContextProvider as d, useAutocompleteDescendants as e, useAutocompleteDescendant as f, AutocompleteProvider as g, useAutocompleteContext as h, useAutocomplete as i, type UseAutocompleteReturn as j, useAutocompleteInput as k, type UseAutocompleteInputReturn as l, useAutocompleteList as m, useAutocompleteOptionGroup as n, type UseAutocompleteOptionGroupReturn as o, type UseAutocompleteOptionProps as p, useAutocompleteOption as q, type UseAutocompleteOptionReturn as r, useAutocompleteCreate as s, type UseAutocompleteCreateReturn as t, useAutocompleteDescendantsContext as u, useAutocompleteEmpty as v, type UseAutocompleteEmptyReturn as w };
|