@bioturing/components 0.46.2 → 0.46.4
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/components/combobox/component.d.ts +2 -120
- package/dist/components/combobox/component.d.ts.map +1 -1
- package/dist/components/combobox/component.js +222 -251
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/combobox/index.d.ts.map +1 -1
- package/dist/components/combobox/types.d.ts +121 -0
- package/dist/components/combobox/types.d.ts.map +1 -0
- package/dist/components/combobox/use-combobox-token-input.d.ts +25 -0
- package/dist/components/combobox/use-combobox-token-input.d.ts.map +1 -0
- package/dist/components/combobox/use-combobox-token-input.js +52 -0
- package/dist/components/combobox/use-combobox-token-input.js.map +1 -0
- package/dist/components/combobox/utils.d.ts +7 -0
- package/dist/components/combobox/utils.d.ts.map +1 -1
- package/dist/components/combobox/utils.js +26 -5
- package/dist/components/combobox/utils.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1,124 +1,6 @@
|
|
|
1
|
-
import { ValidateStatus } from 'antd/es/form/FormItem';
|
|
2
|
-
import { PopoverProps } from 'antd/es/popover';
|
|
3
1
|
import { default as React, ForwardedRef } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
label: React.ReactNode;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
icon?: React.ReactNode;
|
|
9
|
-
} & O;
|
|
10
|
-
export interface ComboboxProps<T extends React.Key, M extends boolean, O extends Record<string, unknown> = {}> {
|
|
11
|
-
/** Array of options to be displayed in the combobox */
|
|
12
|
-
options?: ComboboxOption<T, O>[];
|
|
13
|
-
/** Current value of the combobox */
|
|
14
|
-
value?: M extends true ? T[] : T;
|
|
15
|
-
/** Default value when uncontrolled */
|
|
16
|
-
defaultValue?: M extends true ? T[] : T;
|
|
17
|
-
/** Callback when value changes */
|
|
18
|
-
onChange?: (value: M extends true ? T[] : T) => void;
|
|
19
|
-
/** Placeholder text for the input */
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
/** Whether the combobox is disabled */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
/** Validation status */
|
|
24
|
-
status?: ValidateStatus;
|
|
25
|
-
/** Whether to allow clearing the selection */
|
|
26
|
-
allowClear?: boolean;
|
|
27
|
-
/** Whether to allow multiple selections */
|
|
28
|
-
multiple?: M;
|
|
29
|
-
/** Maximum number of tags to show */
|
|
30
|
-
maxTagCount?: number;
|
|
31
|
-
/** Whether to show search functionality */
|
|
32
|
-
showSearch?: boolean;
|
|
33
|
-
/** Controlled open state */
|
|
34
|
-
open?: boolean;
|
|
35
|
-
/** Callback when open state changes */
|
|
36
|
-
onOpenChange?: (open: boolean) => void;
|
|
37
|
-
/** Placement of the dropdown */
|
|
38
|
-
placement?: PopoverProps["placement"];
|
|
39
|
-
/** Custom className for the component */
|
|
40
|
-
className?: string;
|
|
41
|
-
/** Custom class names for different parts */
|
|
42
|
-
classNames?: {
|
|
43
|
-
trigger?: string;
|
|
44
|
-
input?: string;
|
|
45
|
-
option?: string;
|
|
46
|
-
optionIcon?: string;
|
|
47
|
-
optionText?: string;
|
|
48
|
-
list?: string;
|
|
49
|
-
portal?: string;
|
|
50
|
-
};
|
|
51
|
-
/** Size of the combobox */
|
|
52
|
-
size?: "small" | "middle" | "large";
|
|
53
|
-
/** Loading state */
|
|
54
|
-
loading?: boolean;
|
|
55
|
-
/** Custom render for options */
|
|
56
|
-
optionRender?: (option: ComboboxOption<T, O>, props: React.HTMLAttributes<HTMLElement>) => React.ReactElement;
|
|
57
|
-
/** Filter function for search */
|
|
58
|
-
/**
|
|
59
|
-
* Filter function for search
|
|
60
|
-
* - `true` or `undefined`: default filtering (splits by tokenSeparators if provided)
|
|
61
|
-
* - `false`: disables filtering
|
|
62
|
-
* - custom function: `(input, option) => boolean`
|
|
63
|
-
* @default true
|
|
64
|
-
*/
|
|
65
|
-
filterOption?: boolean | ((input: string, option: ComboboxOption<T, O>) => boolean);
|
|
66
|
-
/** Callback when search input changes */
|
|
67
|
-
onSearch?: (value: string) => void;
|
|
68
|
-
/** Custom dropdown render */
|
|
69
|
-
dropdownRender?: (menu: React.ReactElement) => React.ReactElement;
|
|
70
|
-
/** Custom clear icon */
|
|
71
|
-
clearIcon?: React.ReactNode;
|
|
72
|
-
/** Custom suffix icon */
|
|
73
|
-
suffixIcon?: React.ReactNode;
|
|
74
|
-
/**
|
|
75
|
-
* Show select all option when in multiple mode
|
|
76
|
-
* @default false
|
|
77
|
-
*/
|
|
78
|
-
showSelectAll?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Render function for the select all option
|
|
81
|
-
*/
|
|
82
|
-
selectAllRender?: (props: {
|
|
83
|
-
onSelectAll: () => void;
|
|
84
|
-
onDeselectAll: () => void;
|
|
85
|
-
checked: boolean;
|
|
86
|
-
indeterminate: boolean;
|
|
87
|
-
}) => React.ReactNode;
|
|
88
|
-
/**
|
|
89
|
-
* Function to extract keywords from the item for search filtering
|
|
90
|
-
* @default (option) => [String(option.key), reactNodeToString(option.label)]
|
|
91
|
-
*/
|
|
92
|
-
getOptionKeywords?: (option: ComboboxOption<T, O>) => string[];
|
|
93
|
-
/**
|
|
94
|
-
* Render function for the option label
|
|
95
|
-
*/
|
|
96
|
-
optionLabelRender?: (option: ComboboxOption<T, O>, props?: React.HTMLAttributes<HTMLElement>) => React.ReactElement;
|
|
97
|
-
/**
|
|
98
|
-
* Whether the popup width should match the trigger width.
|
|
99
|
-
* When `false`, the popup can exceed the trigger width to fit long option labels.
|
|
100
|
-
* @default true
|
|
101
|
-
*/
|
|
102
|
-
popupMatchSelectWidth?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Allow adding items by typing the exact label or value and pressing Enter.
|
|
105
|
-
* @default false
|
|
106
|
-
*/
|
|
107
|
-
addOnEnter?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Characters to split input by when adding multiple items on Enter.
|
|
110
|
-
* Only applies when `addOnEnter` and `multiple` are true.
|
|
111
|
-
* @default undefined
|
|
112
|
-
*/
|
|
113
|
-
tokenSeparators?: string[];
|
|
114
|
-
/**
|
|
115
|
-
* Automatically highlight the first matching item while filtering.
|
|
116
|
-
* When enabled in single-select mode, Enter selects the highlighted
|
|
117
|
-
* item natively and `addOnEnter` is ignored to avoid conflicts.
|
|
118
|
-
* @default true
|
|
119
|
-
*/
|
|
120
|
-
autoHighlight?: boolean;
|
|
121
|
-
}
|
|
2
|
+
import { ComboboxProps } from './types';
|
|
3
|
+
export type { ComboboxOption, ComboboxProps } from './types';
|
|
122
4
|
declare const ComboboxInner: <T extends React.Key, M extends boolean, O extends Record<string, unknown> = {}>({ options, value: controlledValue, defaultValue, onChange, placeholder, disabled: disabledProp, status: statusProp, allowClear, multiple, showSearch: _showSearch, open: controlledOpen, onOpenChange, className, classNames, size, optionRender, onSearch, clearIcon, suffixIcon, placement, showSelectAll, optionLabelRender, getOptionKeywords: _getOptionKeywords, popupMatchSelectWidth, addOnEnter, tokenSeparators, autoHighlight, filterOption, ...rest }: ComboboxProps<T, M, O>, ref: React.ForwardedRef<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
123
5
|
export declare const Combobox: <T extends React.Key, M extends boolean, O extends Record<string, unknown> = {}>(props: ComboboxProps<T, M, O> & {
|
|
124
6
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/component.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/component.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,YAAY,EAOb,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,aAAa,CAAC;AAErB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7D,QAAA,MAAM,aAAa,GACjB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAEtC,mcAmCG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACzB,KAAK,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,4CAkbxC,CAAC;AAUF,eAAO,MAAM,QAAQ,GAPnB,CAAC,SAAS,KAAK,CAAC,GAAG,EACnB,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,cAE1B,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;CAAE,KACnE,UAAU,CAAC,OAAO,aAAa,CAIlC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|