@choc-ui/chakra-autocomplete 5.1.6 → 5.1.8
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-context.d.ts +3 -0
- package/dist/autocomplete-creatable.d.ts +14 -0
- package/dist/autocomplete-group.d.ts +9 -0
- package/dist/autocomplete-input.d.ts +11 -0
- package/dist/autocomplete-item.d.ts +12 -0
- package/dist/autocomplete-list.d.ts +3 -0
- package/dist/autocomplete-tag.d.ts +9 -0
- package/dist/autocomplete.d.ts +13 -0
- package/dist/components/empty-state.d.ts +3 -0
- package/dist/helpers/fuzzySearch.d.ts +1 -0
- package/dist/helpers/group.d.ts +4 -0
- package/dist/helpers/input.d.ts +1 -0
- package/dist/helpers/items.d.ts +9 -0
- package/dist/helpers/list.d.ts +2 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +3501 -0
- package/dist/index.js +27 -0
- package/dist/types.d.ts +124 -0
- package/dist/use-autocomplete.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlexProps } from "@chakra-ui/react";
|
|
3
|
+
import { MaybeRenderProp } from "@chakra-ui/react-utils";
|
|
4
|
+
interface AutoCompleteCreatableProps extends Omit<FlexProps, "children"> {
|
|
5
|
+
children?: MaybeRenderProp<{
|
|
6
|
+
value: any;
|
|
7
|
+
}>;
|
|
8
|
+
alwaysDisplay?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function AutoCompleteCreatable(props: AutoCompleteCreatableProps): JSX.Element | null;
|
|
11
|
+
export declare namespace AutoCompleteCreatable {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BoxProps, FlexProps } from "@chakra-ui/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface AutoCompleteGroupProps extends BoxProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
showDivider?: boolean;
|
|
6
|
+
dividerColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const AutoCompleteGroup: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", AutoCompleteGroupProps>;
|
|
9
|
+
export declare const AutoCompleteGroupTitle: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", FlexProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputProps, SystemStyleObject } from "@chakra-ui/react";
|
|
2
|
+
import { MaybeRenderProp } from "@chakra-ui/react-utils";
|
|
3
|
+
import { UseAutoCompleteReturn } from "./types";
|
|
4
|
+
export interface AutoCompleteInputProps extends Omit<InputProps, "children"> {
|
|
5
|
+
children?: MaybeRenderProp<{
|
|
6
|
+
tags: UseAutoCompleteReturn["tags"];
|
|
7
|
+
}>;
|
|
8
|
+
wrapStyles?: SystemStyleObject;
|
|
9
|
+
hidePlaceholder?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const AutoCompleteInput: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"input", AutoCompleteInputProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSObject, FlexProps } from "@chakra-ui/react";
|
|
2
|
+
export interface AutoCompleteItemProps extends FlexProps {
|
|
3
|
+
value: any;
|
|
4
|
+
label?: string;
|
|
5
|
+
fixed?: boolean;
|
|
6
|
+
_focus?: CSSObject | any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
_fixed?: CSSObject;
|
|
9
|
+
getValue?: (item: AutoCompleteItemProps["value"]) => any;
|
|
10
|
+
}
|
|
11
|
+
export declare const AutoCompleteItem: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", AutoCompleteItemProps>;
|
|
12
|
+
export declare const baseItemStyles: FlexProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TagProps } from "@chakra-ui/tag";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare type AutoCompleteTagProps = {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onRemove?: () => void;
|
|
7
|
+
} & TagProps;
|
|
8
|
+
export declare const AutoCompleteTag: React.MemoExoticComponent<(props: AutoCompleteTagProps) => JSX.Element>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MaybeRenderProp } from "@chakra-ui/react-utils";
|
|
3
|
+
import { AutoCompleteRefMethods, UseAutoCompleteProps } from "./types";
|
|
4
|
+
export declare type AutoCompleteChildProps = {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onOpen: () => void;
|
|
8
|
+
};
|
|
9
|
+
export interface AutoCompleteProps extends UseAutoCompleteProps {
|
|
10
|
+
children: MaybeRenderProp<AutoCompleteChildProps>;
|
|
11
|
+
ref?: React.RefObject<AutoCompleteRefMethods>;
|
|
12
|
+
}
|
|
13
|
+
export declare const AutoComplete: import("@chakra-ui/system/dist/system.types").ComponentWithAs<"div", AutoCompleteProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fuzzyScore(str1: string, str2: string, gramSize?: number): number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export declare const hasFirstItem: (children: ReactNode, firstItem: any) => any;
|
|
3
|
+
export declare const hasLastItem: (children: ReactNode, lastItem: any) => any;
|
|
4
|
+
export declare const hasChildren: (children: any, filteredList: any[]) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMultipleWrapStyles: (themeInput: any, multiple?: boolean) => any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { FlexProps } from "@chakra-ui/react";
|
|
3
|
+
import { Item } from "../types";
|
|
4
|
+
import { AutoCompleteItemProps } from "../autocomplete-item";
|
|
5
|
+
export declare const getDefItemValue: (item: AutoCompleteItemProps["value"]) => any;
|
|
6
|
+
export declare const setEmphasis: (children: any, query: string) => any;
|
|
7
|
+
export declare const getItemList: (children: ReactNode) => Item[];
|
|
8
|
+
export declare const getFocusedStyles: () => FlexProps;
|
|
9
|
+
export declare const defaultFilterMethod: (query: string, itemValue: Item["value"], itemLabel: Item["label"]) => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const siblingInfo: (children: React.ReactNode) => readonly [(string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[], (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[]];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./autocomplete";
|
|
2
|
+
export * from "./autocomplete-context";
|
|
3
|
+
export * from "./autocomplete-creatable";
|
|
4
|
+
export * from "./autocomplete-group";
|
|
5
|
+
export * from "./autocomplete-input";
|
|
6
|
+
export * from "./autocomplete-item";
|
|
7
|
+
export * from "./autocomplete-list";
|
|
8
|
+
export * from "./autocomplete-tag";
|
|
9
|
+
export * from "./use-autocomplete";
|
|
10
|
+
export * from "./types";
|