@kingsimba/nc-ui 0.1.34 → 0.1.35
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/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +919 -867
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -379,7 +379,7 @@ declare interface CloseButtonProps {
|
|
|
379
379
|
|
|
380
380
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
381
381
|
|
|
382
|
-
export declare function ComboBox({ value, onChange, placeholder, options, disabled, label, clearable, allowTyping, placement, size, appearance, textAlign, style, className, }: ComboBoxProps): JSX_2.Element;
|
|
382
|
+
export declare function ComboBox({ value, onChange, placeholder, options, candidates, renderOption, renderSelected, selectedOption, disabled, label, clearable, allowTyping, placement, size, appearance, textAlign, style, className, }: ComboBoxProps): JSX_2.Element;
|
|
383
383
|
|
|
384
384
|
export declare type ComboBoxOption = {
|
|
385
385
|
label: string;
|
|
@@ -394,15 +394,23 @@ export declare interface ComboBoxProps {
|
|
|
394
394
|
onChange?: (value: string | undefined) => void;
|
|
395
395
|
/** Placeholder text when no value selected */
|
|
396
396
|
placeholder?: string;
|
|
397
|
-
/** Available options */
|
|
398
|
-
options
|
|
397
|
+
/** Available options for static lists */
|
|
398
|
+
options?: ComboBoxOption[];
|
|
399
|
+
/** Async function to fetch options based on typed query. Enables server-side search (implies allowTyping). */
|
|
400
|
+
candidates?: (query: string) => Promise<ComboBoxOption[]>;
|
|
401
|
+
/** Custom render for each option in the dropdown. Receives the option, index, and whether it is highlighted. */
|
|
402
|
+
renderOption?: (option: ComboBoxOption, index: number, highlighted: boolean) => default_2.ReactNode;
|
|
403
|
+
/** Custom render for the selected item in the input area. Receives the selected option. Useful when options have icons or rich data. */
|
|
404
|
+
renderSelected?: (option: ComboBoxOption) => default_2.ReactNode;
|
|
405
|
+
/** Provides the full option data for the current `value`. Useful in `candidates` mode when the initial option isn't in the loaded list yet. */
|
|
406
|
+
selectedOption?: ComboBoxOption;
|
|
399
407
|
/** Whether the combobox is disabled */
|
|
400
408
|
disabled?: boolean;
|
|
401
409
|
/** Label text */
|
|
402
410
|
label?: string;
|
|
403
411
|
/** Whether the selection can be cleared */
|
|
404
412
|
clearable?: boolean;
|
|
405
|
-
/** Whether typing to filter is allowed */
|
|
413
|
+
/** Whether typing to filter is allowed (ignored when candidates is provided) */
|
|
406
414
|
allowTyping?: boolean;
|
|
407
415
|
/** Dropdown placement preference */
|
|
408
416
|
placement?: 'top' | 'bottom';
|