-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathmenu-picklist.d.ts
84 lines (84 loc) · 3.01 KB
/
menu-picklist.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
declare module '@salesforce/design-system-react/components/menu-picklist' {
import React from 'react';
type Props = {
/**
* Callback that passes in the DOM reference of the `<button>` DOM node within this component. Primary use is to allow `focus` to be called. You should still test if the node exists, since rendering is asynchronous. `buttonRef={(component) => { if(component) console.log(component); }}`
*/
buttonRef?: (v: any) => any;
className?: string;
/**
* If true, renders checkmark icon on the selected Menu Item.
*/
checkmark?: boolean;
disabled?: boolean;
/**
* Message to display when the input is in an error state. When this is present, also visually highlights the component as in error.
*/
errorText?: string;
/**
* A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.
*/
id?: string;
/**
* Renders menu within the wrapping trigger as a sibling of the button. By default, you will have an absolutely positioned container at an elevated z-index.
*/
isInline?: boolean;
/**
* Form element label
*/
label?: string;
/**
* **Text labels for internationalization**
* This object is merged with the default props object on every render.
* * `multipleOptionsSelected`: Text to be used when multiple items are selected. "2 Options Selected" is a good pattern to use.
*/
labels?: Partial<{
multipleOptionsSelected: string;
}>;
/**
* Custom element that overrides the default Menu Item component.
*/
listItemRenderer?: (v: any) => any;
/**
* Triggered when the trigger button is clicked to open.
*/
onClick?: (v: any) => any;
/**
* Triggered when an item is selected. Passes in the option object that has been selected and a data object in the format: `{ option, optionIndex }`. The first parameter may be deprecated in the future and changed to an event for consistency. Please use the data object.
*/
onSelect?: (v: { option: any; optionIndex: number }) => any;
/**
* Triggered when a pill is removed. Passes in the option object that has been removed and a data object in the format: `{ option, optionIndex }`. The first parameter may be deprecated in the future and changed to an event for consistency. Please use the data object.
*/
onPillRemove?: (v: { option: any; optionIndex: number }) => any;
/**
* Menu item data.
*/
options: any[] /*.isRequired*/;
/**
* Text present in trigger button if no items are selected.
*/
placeholder?: string;
/**
* Add styling of a required form element.
*/
required?: boolean;
/**
* Current selected item.
*/
value?: React.ReactNode;
/**
* Initial selected item index.
*/
initValueIndex?: number;
};
/**
* ** MenuPicklist is deprecated. Please use a read-only Combobox instead.**
*
* The MenuPicklist component is a variant of the Lightning Design System Menu component.
*
* @deprecated
*/
function Component(props: Props): JSX.Element;
export default Component;
}