fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

48
node_modules/reakit/ts/Combobox/Combobox.d.ts generated vendored Normal file
View File

@@ -0,0 +1,48 @@
import * as React from "react";
import { CompositeOptions, CompositeHTMLProps } from "../Composite/Composite";
import { unstable_ComboboxStateReturn } from "./ComboboxState";
export declare const unstable_useCombobox: {
(options?: unstable_ComboboxOptions | undefined, htmlProps?: unstable_ComboboxHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_ComboboxHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "wrap" | "orientation" | "baseId" | "currentId" | "unstable_virtual" | "groups" | "unstable_moves"> & Pick<import("..").CompositeStateReturn, "move" | "first" | "last" | "items" | "setCurrentId"> & Pick<Partial<unstable_ComboboxStateReturn>, "hide" | "show" | "visible" | "inline" | "list" | "menuRole" | "minValueLength" | "currentValue" | "autoSelect" | "unstable_referenceRef"> & Pick<unstable_ComboboxStateReturn, "baseId" | "inputValue" | "setInputValue"> & {
/**
* When enabled, user can hide the combobox popover by pressing
* <kbd>Esc</kbd> while focusing on the combobox input.
* @default true
*/
hideOnEsc?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.InputHTMLAttributes<any>, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "wrap" | "orientation" | "baseId" | "currentId" | "unstable_virtual" | "groups" | "unstable_moves"> & Pick<import("..").CompositeStateReturn, "move" | "first" | "last" | "items" | "setCurrentId"> & Pick<Partial<unstable_ComboboxStateReturn>, "hide" | "show" | "visible" | "inline" | "list" | "menuRole" | "minValueLength" | "currentValue" | "autoSelect" | "unstable_referenceRef"> & Pick<unstable_ComboboxStateReturn, "baseId" | "inputValue" | "setInputValue"> & {
/**
* When enabled, user can hide the combobox popover by pressing
* <kbd>Esc</kbd> while focusing on the combobox input.
* @default true
*/
hideOnEsc?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.InputHTMLAttributes<any>) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_ComboboxOptions, htmlProps: unstable_ComboboxHTMLProps) => unstable_ComboboxOptions;
};
export declare const unstable_Combobox: import("reakit-system/ts/createComponent").Component<"input", unstable_ComboboxOptions>;
export declare type unstable_ComboboxOptions = CompositeOptions & Pick<Partial<unstable_ComboboxStateReturn>, "currentValue" | "menuRole" | "list" | "inline" | "autoSelect" | "visible" | "show" | "hide" | "unstable_referenceRef" | "minValueLength"> & Pick<unstable_ComboboxStateReturn, "baseId" | "inputValue" | "setInputValue"> & {
/**
* When enabled, user can hide the combobox popover by pressing
* <kbd>Esc</kbd> while focusing on the combobox input.
* @default true
*/
hideOnEsc?: boolean;
};
export declare type unstable_ComboboxHTMLProps = CompositeHTMLProps & React.InputHTMLAttributes<any>;
export declare type unstable_ComboboxProps = unstable_ComboboxOptions & unstable_ComboboxHTMLProps;

45
node_modules/reakit/ts/Combobox/ComboboxGridCell.d.ts generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/// <reference types="react" />
import { unstable_GridCellOptions as GridCellOptions, unstable_GridCellHTMLProps as GridCellHTMLProps } from "../Grid/GridCell";
import { unstable_ComboboxItemOptions as ComboboxItemOptions, unstable_ComboboxItemHTMLProps as ComboboxItemHTMLProps } from "./ComboboxItem";
export declare const unstable_useComboboxGridCell: {
(options?: unstable_ComboboxGridCellOptions | undefined, htmlProps?: unstable_ComboboxGridCellHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_ComboboxGridCellHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
value?: string | undefined;
} & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & import("react").TdHTMLAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
value?: string | undefined;
} & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & import("react").TdHTMLAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_ComboboxGridCellOptions, htmlProps: unstable_ComboboxGridCellHTMLProps) => unstable_ComboboxGridCellOptions;
};
export declare const unstable_ComboboxGridCell: import("reakit-system/ts/createComponent").Component<"span", unstable_ComboboxGridCellOptions>;
export declare type unstable_ComboboxGridCellOptions = GridCellOptions & ComboboxItemOptions;
export declare type unstable_ComboboxGridCellHTMLProps = GridCellHTMLProps & ComboboxItemHTMLProps;
export declare type unstable_ComboboxGridCellProps = unstable_ComboboxGridCellOptions & unstable_ComboboxGridCellHTMLProps;

20
node_modules/reakit/ts/Combobox/ComboboxGridRow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
/// <reference types="react" />
import { unstable_GridRowOptions as GridRowOptions, unstable_GridRowHTMLProps as GridRowHTMLProps } from "../Grid/GridRow";
export declare const unstable_useComboboxGridRow: {
(options?: import("..").CompositeGroupOptions | undefined, htmlProps?: import("..").RoleHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): import("..").RoleHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<import("..").CompositeStateReturn, "registerGroup" | "unregisterGroup"> & Pick<Partial<import("..").CompositeStateReturn>, "currentId" | "items" | "unstable_moves"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}, next: import("..").RoleOptions & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<import("..").CompositeStateReturn, "registerGroup" | "unregisterGroup"> & Pick<Partial<import("..").CompositeStateReturn>, "currentId" | "items" | "unstable_moves"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: import("..").CompositeGroupOptions, htmlProps: import("..").RoleHTMLProps) => import("..").CompositeGroupOptions;
};
export declare const unstable_ComboboxGridRow: import("reakit-system/ts/createComponent").Component<"div", import("..").CompositeGroupOptions>;
export declare type unstable_ComboboxGridRowOptions = GridRowOptions;
export declare type unstable_ComboboxGridRowHTMLProps = GridRowHTMLProps;
export declare type unstable_ComboboxGridRowProps = unstable_ComboboxGridRowOptions & unstable_ComboboxGridRowHTMLProps;

View File

@@ -0,0 +1,8 @@
import { SealedInitialState } from "reakit-utils/useSealedState";
import { unstable_ComboboxListGridState as ComboboxListGridState, unstable_ComboboxListGridActions as ComboboxListGridActions, unstable_ComboboxListGridInitialState as ComboboxListGridInitialState } from "./ComboboxListGridState";
import { ComboboxPopoverState, ComboboxPopoverActions, ComboboxPopoverInitialState } from "./__utils/ComboboxPopoverState";
export declare function unstable_useComboboxGridState(initialState?: SealedInitialState<unstable_ComboboxGridInitialState>): unstable_ComboboxGridStateReturn;
export declare type unstable_ComboboxGridState = ComboboxPopoverState & ComboboxListGridState;
export declare type unstable_ComboboxGridActions = ComboboxPopoverActions & ComboboxListGridActions;
export declare type unstable_ComboboxGridInitialState = ComboboxPopoverInitialState & ComboboxListGridInitialState;
export declare type unstable_ComboboxGridStateReturn = unstable_ComboboxGridState & unstable_ComboboxGridActions;

63
node_modules/reakit/ts/Combobox/ComboboxItem.d.ts generated vendored Normal file
View File

@@ -0,0 +1,63 @@
import * as React from "react";
import { BoxOptions, BoxHTMLProps } from "../Box/Box";
import { CompositeItemOptions, CompositeItemHTMLProps } from "../Composite/CompositeItem";
import { unstable_ComboboxStateReturn } from "./ComboboxState";
export declare const unstable_useComboboxItem: {
(options?: unstable_ComboboxItemOptions | undefined, htmlProps?: unstable_ComboboxItemHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_ComboboxItemHTMLProps;
unstable_propsAreEqual: (prev: BoxOptions & import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & Pick<Partial<unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
/**
* Item's value that will be used to fill input value and filter `matches`
* based on the input value. You can omit this for items that perform
* actions other than filling a form. For example, items may open a dialog.
*/
value?: string | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}, next: BoxOptions & import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & Pick<Partial<unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
/**
* Item's value that will be used to fill input value and filter `matches`
* based on the input value. You can omit this for items that perform
* actions other than filling a form. For example, items may open a dialog.
*/
value?: string | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_ComboboxItemOptions, htmlProps: unstable_ComboboxItemHTMLProps) => unstable_ComboboxItemOptions;
};
export declare const unstable_ComboboxItem: import("reakit-system/ts/createComponent").Component<"span", unstable_ComboboxItemOptions>;
export declare type unstable_ComboboxItemOptions = BoxOptions & CompositeItemOptions & Pick<Partial<unstable_ComboboxStateReturn>, "currentValue" | "inputValue" | "hide" | "visible"> & Pick<unstable_ComboboxStateReturn, "setInputValue" | "registerItem"> & {
/**
* Item's value that will be used to fill input value and filter `matches`
* based on the input value. You can omit this for items that perform
* actions other than filling a form. For example, items may open a dialog.
*/
value?: string;
};
export declare type unstable_ComboboxItemHTMLProps = BoxHTMLProps & CompositeItemHTMLProps;
export declare type unstable_ComboboxItemProps = unstable_ComboboxItemOptions & unstable_ComboboxItemHTMLProps;

17
node_modules/reakit/ts/Combobox/ComboboxList.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
/// <reference types="react" />
import { BoxOptions, BoxHTMLProps } from "../Box/Box";
import { unstable_ComboboxStateReturn } from "./ComboboxState";
export declare const unstable_useComboboxList: {
(options?: unstable_ComboboxListOptions | undefined, htmlProps?: BoxHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): BoxHTMLProps;
unstable_propsAreEqual: (prev: BoxOptions & Pick<Partial<unstable_ComboboxStateReturn>, "menuRole"> & Pick<unstable_ComboboxStateReturn, "baseId"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}, next: BoxOptions & Pick<Partial<unstable_ComboboxStateReturn>, "menuRole"> & Pick<unstable_ComboboxStateReturn, "baseId"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_ComboboxListOptions, htmlProps: BoxHTMLProps) => unstable_ComboboxListOptions;
};
export declare const unstable_ComboboxList: import("reakit-system/ts/createComponent").Component<"div", unstable_ComboboxListOptions>;
export declare type unstable_ComboboxListOptions = BoxOptions & Pick<Partial<unstable_ComboboxStateReturn>, "menuRole"> & Pick<unstable_ComboboxStateReturn, "baseId">;
export declare type unstable_ComboboxListHTMLProps = BoxHTMLProps;
export declare type unstable_ComboboxListProps = unstable_ComboboxListOptions & unstable_ComboboxListHTMLProps;

View File

@@ -0,0 +1,34 @@
import { SealedInitialState } from "reakit-utils/useSealedState";
import { SetState } from "reakit-utils/types";
import { unstable_GridState as GridState, unstable_GridActions as GridActions, unstable_GridInitialState as GridInitialState } from "../Grid/GridState";
import { ComboboxBaseState, ComboboxBaseActions, ComboboxBaseInitialState } from "./__utils/ComboboxBaseState";
export declare function unstable_useComboboxListGridState(initialState?: SealedInitialState<unstable_ComboboxListGridInitialState>): unstable_ComboboxListGridStateReturn;
export declare type unstable_ComboboxListGridState = Omit<ComboboxBaseState<GridState>, "matches"> & {
/**
* Number of columns by which `values` will be splitted to generate the
* `matches` 2D array.
*/
columns: number;
/**
* Result of filtering `values` based on `inputValue`.
* @default []
* @example
* const combobox = useComboboxState({
* values: ["Red", "Green", "Blue"],
* columns: 2,
* });
* combobox.matches; // [["Red", "Green"], ["Blue"]]
* combobox.setInputValue("g");
* // On next render
* combobox.matches; // [["Green"]]
*/
matches: string[][];
};
export declare type unstable_ComboboxListGridActions = ComboboxBaseActions<GridActions> & {
/**
* Sets `columns`.
*/
setColumns: SetState<unstable_ComboboxListGridState["columns"]>;
};
export declare type unstable_ComboboxListGridInitialState = Omit<GridInitialState, "unstable_virtual" | "unstable_includesBaseElement"> & ComboboxBaseInitialState & Pick<Partial<unstable_ComboboxListGridState>, "columns">;
export declare type unstable_ComboboxListGridStateReturn = unstable_ComboboxListGridState & unstable_ComboboxListGridActions;

View File

@@ -0,0 +1,8 @@
import { SealedInitialState } from "reakit-utils/useSealedState";
import { CompositeState, CompositeActions, CompositeInitialState } from "../Composite/CompositeState";
import { ComboboxBaseState, ComboboxBaseActions, ComboboxBaseInitialState } from "./__utils/ComboboxBaseState";
export declare function unstable_useComboboxListState(initialState?: SealedInitialState<unstable_ComboboxListInitialState>): unstable_ComboboxListStateReturn;
export declare type unstable_ComboboxListState = ComboboxBaseState<CompositeState>;
export declare type unstable_ComboboxListActions = ComboboxBaseActions<CompositeActions>;
export declare type unstable_ComboboxListInitialState = Omit<CompositeInitialState, "unstable_virtual" | "unstable_includesBaseElement"> & ComboboxBaseInitialState;
export declare type unstable_ComboboxListStateReturn = unstable_ComboboxListState & unstable_ComboboxListActions;

45
node_modules/reakit/ts/Combobox/ComboboxOption.d.ts generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/// <reference types="react" />
import { CompositeItemOptions, CompositeItemHTMLProps } from "../Composite/CompositeItem";
import { unstable_ComboboxItemOptions as ComboboxItemOptions, unstable_ComboboxItemHTMLProps as ComboboxItemHTMLProps } from "./ComboboxItem";
export declare const unstable_useComboboxOption: {
(options?: import("./ComboboxGridCell").unstable_ComboboxGridCellOptions | undefined, htmlProps?: unstable_ComboboxOptionHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_ComboboxOptionHTMLProps;
unstable_propsAreEqual: (prev: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
value?: string | undefined;
} & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}, next: import("..").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("..").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("..").CompositeStateReturn>, "orientation" | "baseId" | "unstable_virtual" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("..").CompositeStateReturn, "down" | "up" | "next" | "first" | "last" | "currentId" | "items" | "registerItem" | "unregisterItem" | "previous" | "setCurrentId"> & import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "hide" | "visible" | "inputValue" | "currentValue"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "registerItem" | "setInputValue"> & {
value?: string | undefined;
} & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: import("./ComboboxGridCell").unstable_ComboboxGridCellOptions, htmlProps: unstable_ComboboxOptionHTMLProps) => import("./ComboboxGridCell").unstable_ComboboxGridCellOptions;
};
export declare const unstable_ComboboxOption: import("reakit-system/ts/createComponent").Component<"div", import("./ComboboxGridCell").unstable_ComboboxGridCellOptions>;
export declare type unstable_ComboboxOptionOptions = CompositeItemOptions & ComboboxItemOptions;
export declare type unstable_ComboboxOptionHTMLProps = CompositeItemHTMLProps & ComboboxItemHTMLProps;
export declare type unstable_ComboboxOptionProps = unstable_ComboboxOptionOptions & unstable_ComboboxOptionHTMLProps;

22
node_modules/reakit/ts/Combobox/ComboboxPopover.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/// <reference types="react" />
import { PopoverOptions, PopoverHTMLProps } from "../Popover/Popover";
import { unstable_ComboboxListOptions as ComboboxListOptions, unstable_ComboboxListHTMLProps as ComboboxListHTMLProps } from "./ComboboxList";
import { ComboboxPopoverStateReturn } from "./__utils/ComboboxPopoverState";
export declare const unstable_useComboboxPopover: {
(options?: unstable_ComboboxPopoverOptions | undefined, htmlProps?: unstable_ComboboxPopoverHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): unstable_ComboboxPopoverHTMLProps;
unstable_propsAreEqual: (prev: import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "menuRole"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "baseId"> & Pick<PopoverOptions, "hide" | "visible" | "unstable_system" | "baseId" | "animated" | "animating" | "modal" | "unstable_popoverRef" | "unstable_popoverStyles" | "stopAnimation" | "hideOnEsc" | "hideOnClickOutside" | "preventBodyScroll" | "unstable_initialFocusRef" | "unstable_finalFocusRef" | "unstable_orphan"> & Pick<Partial<ComboboxPopoverStateReturn>, "unstable_referenceRef"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}, next: import("..").BoxOptions & Pick<Partial<import("./ComboboxState").unstable_ComboboxStateReturn>, "menuRole"> & Pick<import("./ComboboxState").unstable_ComboboxStateReturn, "baseId"> & Pick<PopoverOptions, "hide" | "visible" | "unstable_system" | "baseId" | "animated" | "animating" | "modal" | "unstable_popoverRef" | "unstable_popoverStyles" | "stopAnimation" | "hideOnEsc" | "hideOnClickOutside" | "preventBodyScroll" | "unstable_initialFocusRef" | "unstable_finalFocusRef" | "unstable_orphan"> & Pick<Partial<ComboboxPopoverStateReturn>, "unstable_referenceRef"> & import("react").HTMLAttributes<any> & import("react").RefAttributes<any> & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
} & {
wrapElement?: ((element: import("react").ReactNode) => import("react").ReactNode) | undefined;
}) => boolean;
__keys: readonly any[];
__useOptions: (options: unstable_ComboboxPopoverOptions, htmlProps: unstable_ComboboxPopoverHTMLProps) => unstable_ComboboxPopoverOptions;
};
export declare const unstable_ComboboxPopover: import("reakit-system/ts/createComponent").Component<"div", unstable_ComboboxPopoverOptions>;
export declare type unstable_ComboboxPopoverOptions = ComboboxListOptions & Omit<PopoverOptions, "unstable_disclosureRef" | "unstable_autoFocusOnHide" | "unstable_autoFocusOnShow"> & Pick<Partial<ComboboxPopoverStateReturn>, "unstable_referenceRef">;
export declare type unstable_ComboboxPopoverHTMLProps = PopoverHTMLProps & ComboboxListHTMLProps;
export declare type unstable_ComboboxPopoverProps = unstable_ComboboxPopoverOptions & unstable_ComboboxPopoverHTMLProps;

8
node_modules/reakit/ts/Combobox/ComboboxState.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import { SealedInitialState } from "reakit-utils/useSealedState";
import { unstable_ComboboxListState as ComboboxListState, unstable_ComboboxListActions as ComboboxListActions, unstable_ComboboxListInitialState as ComboboxListInitialState } from "./ComboboxListState";
import { ComboboxPopoverState, ComboboxPopoverActions, ComboboxPopoverInitialState } from "./__utils/ComboboxPopoverState";
export declare function unstable_useComboboxState(initialState?: SealedInitialState<unstable_ComboboxInitialState>): unstable_ComboboxStateReturn;
export declare type unstable_ComboboxState = ComboboxPopoverState & ComboboxListState;
export declare type unstable_ComboboxActions = ComboboxPopoverActions & ComboboxListActions;
export declare type unstable_ComboboxInitialState = ComboboxPopoverInitialState & ComboboxListInitialState;
export declare type unstable_ComboboxStateReturn = unstable_ComboboxState & unstable_ComboboxActions;

7
node_modules/reakit/ts/Combobox/__keys.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export declare const COMBOBOX_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place", "hideOnEsc"];
export declare const COMBOBOX_GRID_CELL_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place"];
export declare const COMBOBOX_GRID_ROW_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place"];
export declare const COMBOBOX_ITEM_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place", "value"];
export declare const COMBOBOX_LIST_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place"];
export declare const COMBOBOX_OPTION_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place"];
export declare const COMBOBOX_POPOVER_KEYS: readonly ["baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "columns", "setColumns", "baseId", "unstable_idCountRef", "unstable_virtual", "rtl", "orientation", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "items", "menuRole", "inputValue", "minValueLength", "currentValue", "values", "limit", "matches", "list", "inline", "autoSelect", "visible", "setBaseId", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget", "registerItem", "setInputValue", "setMinValueLength", "setValues", "setLimit", "setList", "setInline", "setAutoSelect", "animated", "animating", "modal", "unstable_disclosureRef", "unstable_referenceRef", "unstable_popoverRef", "unstable_arrowRef", "unstable_popoverStyles", "unstable_arrowStyles", "unstable_originalPlacement", "unstable_update", "placement", "show", "hide", "toggle", "setVisible", "setAnimated", "stopAnimation", "setModal", "place"];

View File

@@ -0,0 +1,169 @@
import { SetState } from "reakit-utils/types";
import { CompositeStateReturn, CompositeState, CompositeActions } from "../../Composite/CompositeState";
import { Item } from "./types";
export declare function useComboboxBaseState<T extends CompositeStateReturn>(composite: T, { inputValue: initialInputValue, minValueLength: initialMinValueLength, values: initialValues, limit: initialLimit, list: initialList, inline: initialInline, autoSelect: initialAutoSelect, }?: ComboboxBaseInitialState): ComboboxBaseStateReturn<T>;
export declare type ComboboxBaseState<T extends CompositeState = CompositeState> = Omit<T, "items"> & {
/**
* Lists all the combobox items with their `id`, DOM `ref`, `disabled` state,
* `value` and `groupId` if any. This state is automatically updated when
* `registerItem` and `unregisterItem` are called.
* @example
* const combobox = useComboboxState();
* combobox.items.forEach((item) => {
* console.log(item.value);
* });
*/
items: Item[];
/**
* Indicates the type of the suggestions popup.
*/
menuRole: "listbox" | "tree" | "grid" | "dialog";
/**
* Combobox input value that will be used to filter `values` and populate
* the `matches` property.
*/
inputValue: string;
/**
* How many characters are needed for opening the combobox popover and
* populating `matches` with filtered values.
* @default 0
* @example
* const combobox = useComboboxState({
* values: ["Red", "Green"],
* minValueLength: 2,
* });
* combobox.matches; // []
* combobox.setInputValue("g");
* // On next render
* combobox.matches; // []
* combobox.setInputValue("gr");
* // On next render
* combobox.matches; // ["Green"]
*/
minValueLength: number;
/**
* Value of the item that is currently selected.
*/
currentValue?: string;
/**
* Values that will be used to produce `matches`.
* @default []
* @example
* const combobox = useComboboxState({ values: ["Red", "Green"] });
* combobox.matches; // ["Red", "Green"]
* combobox.setInputValue("g");
* // On next render
* combobox.matches; // ["Green"]
*/
values: string[];
/**
* Maximum number of `matches`. If it's set to `false`, there will be no
* limit.
* @default 10
*/
limit: number | false;
/**
* Result of filtering `values` based on `inputValue`.
* @default []
* @example
* const combobox = useComboboxState({ values: ["Red", "Green"] });
* combobox.matches; // ["Red", "Green"]
* combobox.setInputValue("g");
* // On next render
* combobox.matches; // ["Green"]
*/
matches: string[];
/**
* Determines how the combobox options behave: dynamically or statically.
* By default, it's `true` if `values` are provided. Otherwise, it's `false`:
* - If it's `true` and `values` are provided, then they will be
* automatically filtered based on `inputValue` and will populate `matches`.
* - If it's `true` and `values` aren't provided, this means that you'll
* provide and filter values by yourself. `matches` will be empty.
* - If it's `false` and `values` are provided, then they won't be
* automatically filtered and `matches` will be the same as `values`.
* @example
* const withoutValues = useComboboxState();
* withValues.list; // false;
* const withValues = useComboboxState({ values: ["Red", "Green"] });
* withValues.list; // true;
* const withList = useComboboxState({ list: true });
* withValues.list; // true;
* <Combobox list={true} /> // <input aria-autocomplete="list">
*/
list: boolean;
/**
* Determines whether focusing on an option will temporarily change the value
* of the combobox. If it's `true`, focusing on an option will temporarily
* change the combobox value to the option's value.
* @default false
*/
inline: boolean;
/**
* Determines whether the first option will be automatically selected. When
* it's set to `true`, the exact behavior will depend on the value of
* `inline`:
* - If `inline` is `true`, the first option is automatically focused when
* the combobox popover opens and the input value changes to reflect this.
* The inline completion string will be highlighted and will have a selected
* state.
* - If `inline` is `false`, the first option is automatically focused when
* the combobox popover opens, but the input value remains the same.
* @default false
*/
autoSelect: boolean;
/**
* Whether the suggestions popup is visible or not.
*/
visible: boolean;
};
export declare type ComboboxBaseActions<T extends CompositeActions = CompositeActions> = Omit<T, "registerItem"> & {
/**
* Registers a combobox item.
* @example
* const ref = React.useRef();
* const combobox = useComboboxState();
* React.useEffect(() => {
* combobox.registerItem({ ref, id: "id" });
* return () => combobox.unregisterItem("id");
* });
*/
registerItem: (item: Item) => void;
/**
* Sets `inputValue`.
* @example
* const combobox = useComboboxState();
* combobox.setInputValue("new value");
*/
setInputValue: SetState<ComboboxBaseState["inputValue"]>;
/**
* Sets `minValueLength`.
*/
setMinValueLength: SetState<ComboboxBaseState["minValueLength"]>;
/**
* Sets `values`.
* @example
* const combobox = useComboboxState();
* combobox.setValues(["Red", "Green"]);
* combobox.setValues((prevValues) => [...prevValues, "Blue"]);
*/
setValues: SetState<ComboboxBaseState["values"]>;
/**
* Sets `limit`.
*/
setLimit: SetState<ComboboxBaseState["limit"]>;
/**
* Sets `list`.
*/
setList: SetState<ComboboxBaseState["list"]>;
/**
* Sets `inline`.
*/
setInline: SetState<ComboboxBaseState["inline"]>;
/**
* Sets `autoSelect`.
*/
setAutoSelect: SetState<ComboboxBaseState["autoSelect"]>;
};
export declare type ComboboxBaseInitialState = Pick<Partial<ComboboxBaseState>, "inputValue" | "minValueLength" | "values" | "limit" | "list" | "inline" | "autoSelect">;
export declare type ComboboxBaseStateReturn<T extends CompositeStateReturn> = ComboboxBaseState<T> & ComboboxBaseActions<T>;

View File

@@ -0,0 +1,37 @@
import * as React from "react";
import { PopoverState, PopoverActions, PopoverInitialState } from "../../Popover/PopoverState";
import { unstable_ComboboxListStateReturn as ComboboxListStateReturn } from "../ComboboxListState";
import { unstable_ComboboxListGridStateReturn as ComboboxListGridStateReturn } from "../ComboboxListGridState";
export declare function useComboboxPopoverState<T extends ComboboxListStateReturn | ComboboxListGridStateReturn>(combobox: T, { gutter, placement, ...initialState }?: ComboboxPopoverInitialState): T & import("../..").unstable_IdState & {
visible: boolean;
animated: number | boolean;
animating: boolean;
} & import("../..").unstable_IdActions & {
show: () => void;
hide: () => void;
toggle: () => void;
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
setAnimated: React.Dispatch<React.SetStateAction<number | boolean>>;
stopAnimation: () => void;
} & {
modal: boolean;
unstable_disclosureRef: React.MutableRefObject<HTMLElement | null>;
} & {
setModal: React.Dispatch<React.SetStateAction<boolean>>;
} & {
unstable_referenceRef: React.RefObject<HTMLElement | null>;
unstable_popoverRef: React.RefObject<HTMLElement | null>;
unstable_arrowRef: React.RefObject<HTMLElement | null>;
unstable_popoverStyles: React.CSSProperties;
unstable_arrowStyles: React.CSSProperties;
unstable_originalPlacement: import("@popperjs/core").Placement;
unstable_update: () => boolean;
placement: import("@popperjs/core").Placement;
} & {
visible: boolean;
place: React.Dispatch<React.SetStateAction<import("@popperjs/core").Placement>>;
};
export declare type ComboboxPopoverState = PopoverState;
export declare type ComboboxPopoverActions = PopoverActions;
export declare type ComboboxPopoverInitialState = PopoverInitialState;
export declare type ComboboxPopoverStateReturn = ComboboxPopoverState & ComboboxPopoverActions;

View File

@@ -0,0 +1 @@
export declare function getItemId(baseId: string, value: string, id?: string): string;

View File

@@ -0,0 +1 @@
export declare function getMenuId(baseId: string): string;

12
node_modules/reakit/ts/Combobox/__utils/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/// <reference types="react" />
export declare type Group = {
id: string;
ref: React.RefObject<HTMLElement>;
};
export declare type Item = {
id: string | null;
ref: React.RefObject<HTMLElement>;
groupId?: Group["id"];
disabled?: boolean;
value?: string;
};

11
node_modules/reakit/ts/Combobox/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export * from "./Combobox";
export * from "./ComboboxGridCell";
export * from "./ComboboxGridRow";
export * from "./ComboboxGridState";
export * from "./ComboboxItem";
export * from "./ComboboxList";
export * from "./ComboboxListGridState";
export * from "./ComboboxListState";
export * from "./ComboboxOption";
export * from "./ComboboxPopover";
export * from "./ComboboxState";