@lumx/react 4.11.0-next.7 → 4.11.0-next.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/index.d.ts +275 -272
- package/index.js +712 -658
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HorizontalAlignment as HorizontalAlignment$1, Orientation as Orientation$1, Alignment as Alignment$1, Size as Size$1, AspectRatio as AspectRatio$1, Kind as Kind$1, Emphasis as Emphasis$1, Theme as Theme$1 } from '@lumx/core/js/constants';
|
|
2
2
|
export * from '@lumx/core/js/constants';
|
|
3
3
|
import * as _lumx_core_js_types from '@lumx/core/js/types';
|
|
4
|
-
import {
|
|
4
|
+
import { ValueOf as ValueOf$1, GenericProps as GenericProps$1, HasTheme as HasTheme$1, PropsToOverride, HasAriaDisabled as HasAriaDisabled$1, HasRequiredLinkHref as HasRequiredLinkHref$1, HasClassName as HasClassName$1, HasCloseMode as HasCloseMode$1, JSXElement as JSXElement$1, CommonRef as CommonRef$1, Falsy, HeadingElement as HeadingElement$1, HasAriaLabelOrLabelledBy as HasAriaLabelOrLabelledBy$1 } from '@lumx/core/js/types';
|
|
5
5
|
export * from '@lumx/core/js/types';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import React__default, { Ref, ReactElement, ReactNode, SyntheticEvent, MouseEventHandler, KeyboardEventHandler, RefObject, SetStateAction, Key, CSSProperties, ElementType as ElementType$1, HTMLInputTypeAttribute, ComponentProps, ImgHTMLAttributes, AriaAttributes as AriaAttributes$1 } from 'react';
|
|
@@ -39,260 +39,6 @@ type HasPolymorphicAs$1<E extends React.ElementType> = React.ComponentPropsWitho
|
|
|
39
39
|
as?: E;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'> {
|
|
43
|
-
/** Message variant. */
|
|
44
|
-
kind?: Kind$1;
|
|
45
|
-
/** Dialog title. */
|
|
46
|
-
title?: string;
|
|
47
|
-
/** Props forwarded to the confirm button */
|
|
48
|
-
confirmProps: ButtonProps & {
|
|
49
|
-
label: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Props forwarded to the cancel button.
|
|
53
|
-
* Will not render a cancel button if undefined.
|
|
54
|
-
*/
|
|
55
|
-
cancelProps?: ButtonProps & {
|
|
56
|
-
label: string;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Children
|
|
60
|
-
*/
|
|
61
|
-
children?: React__default.ReactNode;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* AlertDialog component.
|
|
65
|
-
*
|
|
66
|
-
* An alert dialog is a modal dialog that interrupts the user's workflow to
|
|
67
|
-
* communicate an important message and acquire a response.
|
|
68
|
-
*
|
|
69
|
-
* It should not have a complex content.
|
|
70
|
-
* Children of this component should only be strings, paragraphs or links.
|
|
71
|
-
*/
|
|
72
|
-
declare const AlertDialog: Comp<AlertDialogProps, HTMLDivElement>;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Defines the props of the component.
|
|
76
|
-
*/
|
|
77
|
-
interface AutocompleteProps extends GenericProps$1, HasTheme$1 {
|
|
78
|
-
/**
|
|
79
|
-
* Whether the suggestions list should display anchored to the input or to the wrapper.
|
|
80
|
-
* @see {@link DropdownProps#anchorToInput}
|
|
81
|
-
*/
|
|
82
|
-
anchorToInput?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Props to pass to the clear button (minus those already set by the TextField props).
|
|
85
|
-
* If not specified, the button won't be displayed.
|
|
86
|
-
* @see {@link TextFieldProps#clearButtonProps}
|
|
87
|
-
*/
|
|
88
|
-
clearButtonProps?: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis'>;
|
|
89
|
-
/**
|
|
90
|
-
* Reference to the <input> or <textarea> element.
|
|
91
|
-
* @see {@link TextFieldProps#inputRef}
|
|
92
|
-
*/
|
|
93
|
-
inputRef?: TextFieldProps['inputRef'];
|
|
94
|
-
/**
|
|
95
|
-
* The offset that will be applied to the Dropdown position.
|
|
96
|
-
* @see {@link DropdownProps#offset}
|
|
97
|
-
*/
|
|
98
|
-
offset?: Offset;
|
|
99
|
-
/**
|
|
100
|
-
* The preferred Dropdown location against the anchor element.
|
|
101
|
-
* @see {@link DropdownProps#placement}
|
|
102
|
-
*/
|
|
103
|
-
placement?: Placement;
|
|
104
|
-
/**
|
|
105
|
-
* Manage dropdown width:
|
|
106
|
-
* - `maxWidth`: dropdown not bigger than anchor
|
|
107
|
-
* - `minWidth` or `true`: dropdown not smaller than anchor
|
|
108
|
-
* - `width`: dropdown equal to the anchor.
|
|
109
|
-
* @see {@link DropdownProps#fitToAnchorWidth}
|
|
110
|
-
*/
|
|
111
|
-
fitToAnchorWidth?: DropdownProps['fitToAnchorWidth'];
|
|
112
|
-
/**
|
|
113
|
-
* The error related to the component.
|
|
114
|
-
* @see {@link TextFieldProps#error}
|
|
115
|
-
*/
|
|
116
|
-
error?: string | ReactNode;
|
|
117
|
-
/**
|
|
118
|
-
* Whether the text field is displayed with error style or not.
|
|
119
|
-
* @see {@link TextFieldProps#hasError}
|
|
120
|
-
*/
|
|
121
|
-
hasError?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Whether the text box should be focused upon closing the suggestions or not.
|
|
124
|
-
*/
|
|
125
|
-
shouldFocusOnClose?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* The helper message of the text field.
|
|
128
|
-
* @see {@link TextFieldProps#helper}
|
|
129
|
-
*/
|
|
130
|
-
helper?: string;
|
|
131
|
-
/**
|
|
132
|
-
* The icon of the text field (SVG path).
|
|
133
|
-
* @see {@link TextFieldProps#icon}
|
|
134
|
-
*/
|
|
135
|
-
icon?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Whether the component is disabled or not.
|
|
138
|
-
* @see {@link TextFieldProps#isDisabled}
|
|
139
|
-
*/
|
|
140
|
-
isDisabled?: boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Whether the component is required or not.
|
|
143
|
-
* @see {@link TextFieldProps#isRequired}
|
|
144
|
-
*/
|
|
145
|
-
isRequired?: boolean;
|
|
146
|
-
/**
|
|
147
|
-
* Whether the text field is displayed with valid style or not.
|
|
148
|
-
* @see {@link TextFieldProps#isValid}
|
|
149
|
-
*/
|
|
150
|
-
isValid?: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* The label of the text field displayed in a label tag.
|
|
153
|
-
* @see {@link TextFieldProps#label}
|
|
154
|
-
*/
|
|
155
|
-
label?: string;
|
|
156
|
-
/**
|
|
157
|
-
* The placeholder message of the text field.
|
|
158
|
-
* @see {@link TextFieldProps#placeholder}
|
|
159
|
-
*/
|
|
160
|
-
placeholder?: string;
|
|
161
|
-
/** List of suggestions to display during autocomplete. */
|
|
162
|
-
children: React.ReactNode;
|
|
163
|
-
/**
|
|
164
|
-
* The list of chips to be displayed before the text field input.
|
|
165
|
-
*/
|
|
166
|
-
chips?: React.ReactNode;
|
|
167
|
-
/**
|
|
168
|
-
* The value of the text field.
|
|
169
|
-
* @see {@link TextFieldProps#value}
|
|
170
|
-
*/
|
|
171
|
-
value: string;
|
|
172
|
-
/**
|
|
173
|
-
* Whether the suggestions from the autocomplete should be displayed or not.
|
|
174
|
-
* @see {@link DropdownProps#isOpen}
|
|
175
|
-
*/
|
|
176
|
-
isOpen: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* The native input name property.
|
|
179
|
-
* @see {@link TextFieldProps#name}
|
|
180
|
-
*/
|
|
181
|
-
name?: string;
|
|
182
|
-
/**
|
|
183
|
-
* Whether a click in the Autocomplete dropdown would close it or not.
|
|
184
|
-
* @see {@link DropdownProps#closeOnClick}
|
|
185
|
-
*/
|
|
186
|
-
closeOnClick?: boolean;
|
|
187
|
-
/**
|
|
188
|
-
* Whether a click anywhere out of the Autocomplete would close it or not.
|
|
189
|
-
* @see {@link DropdownProps#closeOnClickAway}
|
|
190
|
-
*/
|
|
191
|
-
closeOnClickAway?: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* Whether an escape key press would close the Autocomplete or not.
|
|
194
|
-
* @see {@link DropdownProps#closeOnEscape}
|
|
195
|
-
*/
|
|
196
|
-
closeOnEscape?: boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Whether the focus should go back on the anchor when dropdown closes and focus is within.
|
|
199
|
-
* @see {@link DropdownProps#focusAnchorOnClose}
|
|
200
|
-
*/
|
|
201
|
-
focusAnchorOnClose?: DropdownProps['focusAnchorOnClose'];
|
|
202
|
-
/**
|
|
203
|
-
* The function called on blur.
|
|
204
|
-
* @see {@link TextFieldProps#onBlur}
|
|
205
|
-
*/
|
|
206
|
-
onBlur?(event: React.FocusEvent): void;
|
|
207
|
-
/**
|
|
208
|
-
* On change callback.
|
|
209
|
-
* @see {@link TextFieldProps#onChange}
|
|
210
|
-
*/
|
|
211
|
-
onChange(value: string, name?: string, event?: SyntheticEvent): void;
|
|
212
|
-
/**
|
|
213
|
-
* The function called on close.
|
|
214
|
-
* @see {@link DropdownProps#onClose}
|
|
215
|
-
*/
|
|
216
|
-
onClose?(): void;
|
|
217
|
-
/**
|
|
218
|
-
* The function called on focus.
|
|
219
|
-
* @see {@link TextFieldProps#onFocus}
|
|
220
|
-
*/
|
|
221
|
-
onFocus?(event: React.FocusEvent): void;
|
|
222
|
-
/**
|
|
223
|
-
* The function called when the bottom of the dropdown is reached.
|
|
224
|
-
* @see {@link DropdownProps#onInfiniteScroll}
|
|
225
|
-
*/
|
|
226
|
-
onInfiniteScroll?(): void;
|
|
227
|
-
/**
|
|
228
|
-
* Props forwarded to the underlying TextField component.
|
|
229
|
-
* Only the props not managed by the Autocomplete can be set.
|
|
230
|
-
* @see {@link TextFieldProps}
|
|
231
|
-
*/
|
|
232
|
-
textFieldProps?: Partial<TextFieldProps>;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Autocomplete component.
|
|
236
|
-
*
|
|
237
|
-
* @param props Component props.
|
|
238
|
-
* @param ref Component ref.
|
|
239
|
-
* @return React element.
|
|
240
|
-
*/
|
|
241
|
-
declare const Autocomplete: Comp<AutocompleteProps, HTMLDivElement>;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Defines the props of the component.
|
|
245
|
-
*/
|
|
246
|
-
interface AutocompleteMultipleProps extends AutocompleteProps {
|
|
247
|
-
/** Selected values. */
|
|
248
|
-
values: any[];
|
|
249
|
-
/** Alignment of the chips in the autocomplete. */
|
|
250
|
-
chipsAlignment?: HorizontalAlignment$1;
|
|
251
|
-
/** Selected value render function. Default: Renders the value inside of a Chip. */
|
|
252
|
-
selectedChipRender(choice: any, index: number, onClear?: (event?: React.MouseEvent, val?: any) => void, isDisabled?: boolean): ReactNode | string;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* AutocompleteMultiple component.
|
|
256
|
-
*
|
|
257
|
-
* @param props Component props.
|
|
258
|
-
* @param ref Component ref.
|
|
259
|
-
* @return React element.
|
|
260
|
-
*/
|
|
261
|
-
declare const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElement>;
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Require either `aria-label` or `arial-labelledby` prop.
|
|
265
|
-
* If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
|
|
266
|
-
* needs a visible element.
|
|
267
|
-
*/
|
|
268
|
-
type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string ? {
|
|
269
|
-
/**
|
|
270
|
-
* The id of the element to use as title of the dialog. Can be within or out of the dialog.
|
|
271
|
-
* Although it is not recommended, aria-label can be used instead if no visible element is available.
|
|
272
|
-
*/
|
|
273
|
-
'aria-labelledby': T;
|
|
274
|
-
/** The label of the dialog. */
|
|
275
|
-
'aria-label'?: undefined;
|
|
276
|
-
} : {
|
|
277
|
-
'aria-label': string;
|
|
278
|
-
'aria-labelledby'?: undefined;
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
interface HasClassName {
|
|
282
|
-
/**
|
|
283
|
-
* Class name forwarded to the root element of the component.
|
|
284
|
-
*/
|
|
285
|
-
className?: string;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
interface HasCloseMode {
|
|
289
|
-
/**
|
|
290
|
-
* Choose how the children are hidden when closed
|
|
291
|
-
* ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
|
|
292
|
-
*/
|
|
293
|
-
closeMode?: 'hide' | 'unmount';
|
|
294
|
-
}
|
|
295
|
-
|
|
296
42
|
/**
|
|
297
43
|
* Alignments.
|
|
298
44
|
*/
|
|
@@ -480,6 +226,39 @@ type ColorVariant = ValueOf$1<typeof ColorVariant>;
|
|
|
480
226
|
/** ColorPalette with all possible color variant combination */
|
|
481
227
|
type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
|
|
482
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Require either `aria-label` or `arial-labelledby` prop.
|
|
231
|
+
* If none are set, the order will prioritize `aria-labelledby` over `aria-label` as it
|
|
232
|
+
* needs a visible element.
|
|
233
|
+
*/
|
|
234
|
+
type HasAriaLabelOrLabelledBy<T = string | undefined> = T extends string ? {
|
|
235
|
+
/**
|
|
236
|
+
* The id of the element to use as title of the dialog. Can be within or out of the dialog.
|
|
237
|
+
* Although it is not recommended, aria-label can be used instead if no visible element is available.
|
|
238
|
+
*/
|
|
239
|
+
'aria-labelledby': T;
|
|
240
|
+
/** The label of the dialog. */
|
|
241
|
+
'aria-label'?: undefined;
|
|
242
|
+
} : {
|
|
243
|
+
'aria-label': string;
|
|
244
|
+
'aria-labelledby'?: undefined;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
interface HasClassName {
|
|
248
|
+
/**
|
|
249
|
+
* Class name forwarded to the root element of the component.
|
|
250
|
+
*/
|
|
251
|
+
className?: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface HasCloseMode {
|
|
255
|
+
/**
|
|
256
|
+
* Choose how the children are hidden when closed
|
|
257
|
+
* ('hide' keeps the children in DOM but hide them, 'unmount' remove the children from the DOM).
|
|
258
|
+
*/
|
|
259
|
+
closeMode?: 'hide' | 'unmount';
|
|
260
|
+
}
|
|
261
|
+
|
|
483
262
|
interface HasTheme {
|
|
484
263
|
/**
|
|
485
264
|
* Theme adapting the component to light or dark background.
|
|
@@ -596,6 +375,246 @@ type FieldSelector<TObject, TValue> = keyof {
|
|
|
596
375
|
*/
|
|
597
376
|
type Selector<TObject, TValue = string> = FieldSelector<TObject, TValue> | FunctionSelector<TObject, TValue>;
|
|
598
377
|
|
|
378
|
+
interface BaseDialogProps {
|
|
379
|
+
/** Footer content. */
|
|
380
|
+
footer?: JSXElement;
|
|
381
|
+
/** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
|
|
382
|
+
forceFooterDivider?: boolean;
|
|
383
|
+
/** Header content. */
|
|
384
|
+
header?: JSXElement;
|
|
385
|
+
/** Whether the divider between the dialog content and the header is always displayed (instead of showing it on scroll). */
|
|
386
|
+
forceHeaderDivider?: boolean;
|
|
387
|
+
/** Whether the indefinite progress indicator over the dialog content is displayed or not. */
|
|
388
|
+
isLoading?: boolean;
|
|
389
|
+
/** Whether the component is open or not. */
|
|
390
|
+
isOpen?: boolean;
|
|
391
|
+
}
|
|
392
|
+
type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
393
|
+
|
|
394
|
+
interface BaseAlertDialogProps {
|
|
395
|
+
/** Message variant. */
|
|
396
|
+
kind?: Kind;
|
|
397
|
+
/** Dialog title. */
|
|
398
|
+
title?: string;
|
|
399
|
+
/**
|
|
400
|
+
* Children
|
|
401
|
+
*/
|
|
402
|
+
children?: JSXElement;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'>, BaseAlertDialogProps {
|
|
406
|
+
/** Props forwarded to the confirm button */
|
|
407
|
+
confirmProps: ButtonProps & {
|
|
408
|
+
label: string;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Props forwarded to the cancel button.
|
|
412
|
+
* Will not render a cancel button if undefined.
|
|
413
|
+
*/
|
|
414
|
+
cancelProps?: ButtonProps & {
|
|
415
|
+
label: string;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* AlertDialog component.
|
|
420
|
+
*
|
|
421
|
+
* An alert dialog is a modal dialog that interrupts the user's workflow to
|
|
422
|
+
* communicate an important message and acquire a response.
|
|
423
|
+
*
|
|
424
|
+
* It should not have a complex content.
|
|
425
|
+
* Children of this component should only be strings, paragraphs or links.
|
|
426
|
+
*/
|
|
427
|
+
declare const AlertDialog: Comp<AlertDialogProps, HTMLDivElement>;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Defines the props of the component.
|
|
431
|
+
*/
|
|
432
|
+
interface AutocompleteProps extends GenericProps$1, HasTheme$1 {
|
|
433
|
+
/**
|
|
434
|
+
* Whether the suggestions list should display anchored to the input or to the wrapper.
|
|
435
|
+
* @see {@link DropdownProps#anchorToInput}
|
|
436
|
+
*/
|
|
437
|
+
anchorToInput?: boolean;
|
|
438
|
+
/**
|
|
439
|
+
* Props to pass to the clear button (minus those already set by the TextField props).
|
|
440
|
+
* If not specified, the button won't be displayed.
|
|
441
|
+
* @see {@link TextFieldProps#clearButtonProps}
|
|
442
|
+
*/
|
|
443
|
+
clearButtonProps?: Pick<IconButtonProps, 'label'> & Omit<IconButtonProps, 'label' | 'onClick' | 'icon' | 'emphasis'>;
|
|
444
|
+
/**
|
|
445
|
+
* Reference to the <input> or <textarea> element.
|
|
446
|
+
* @see {@link TextFieldProps#inputRef}
|
|
447
|
+
*/
|
|
448
|
+
inputRef?: TextFieldProps['inputRef'];
|
|
449
|
+
/**
|
|
450
|
+
* The offset that will be applied to the Dropdown position.
|
|
451
|
+
* @see {@link DropdownProps#offset}
|
|
452
|
+
*/
|
|
453
|
+
offset?: Offset;
|
|
454
|
+
/**
|
|
455
|
+
* The preferred Dropdown location against the anchor element.
|
|
456
|
+
* @see {@link DropdownProps#placement}
|
|
457
|
+
*/
|
|
458
|
+
placement?: Placement;
|
|
459
|
+
/**
|
|
460
|
+
* Manage dropdown width:
|
|
461
|
+
* - `maxWidth`: dropdown not bigger than anchor
|
|
462
|
+
* - `minWidth` or `true`: dropdown not smaller than anchor
|
|
463
|
+
* - `width`: dropdown equal to the anchor.
|
|
464
|
+
* @see {@link DropdownProps#fitToAnchorWidth}
|
|
465
|
+
*/
|
|
466
|
+
fitToAnchorWidth?: DropdownProps['fitToAnchorWidth'];
|
|
467
|
+
/**
|
|
468
|
+
* The error related to the component.
|
|
469
|
+
* @see {@link TextFieldProps#error}
|
|
470
|
+
*/
|
|
471
|
+
error?: string | ReactNode;
|
|
472
|
+
/**
|
|
473
|
+
* Whether the text field is displayed with error style or not.
|
|
474
|
+
* @see {@link TextFieldProps#hasError}
|
|
475
|
+
*/
|
|
476
|
+
hasError?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* Whether the text box should be focused upon closing the suggestions or not.
|
|
479
|
+
*/
|
|
480
|
+
shouldFocusOnClose?: boolean;
|
|
481
|
+
/**
|
|
482
|
+
* The helper message of the text field.
|
|
483
|
+
* @see {@link TextFieldProps#helper}
|
|
484
|
+
*/
|
|
485
|
+
helper?: string;
|
|
486
|
+
/**
|
|
487
|
+
* The icon of the text field (SVG path).
|
|
488
|
+
* @see {@link TextFieldProps#icon}
|
|
489
|
+
*/
|
|
490
|
+
icon?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Whether the component is disabled or not.
|
|
493
|
+
* @see {@link TextFieldProps#isDisabled}
|
|
494
|
+
*/
|
|
495
|
+
isDisabled?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Whether the component is required or not.
|
|
498
|
+
* @see {@link TextFieldProps#isRequired}
|
|
499
|
+
*/
|
|
500
|
+
isRequired?: boolean;
|
|
501
|
+
/**
|
|
502
|
+
* Whether the text field is displayed with valid style or not.
|
|
503
|
+
* @see {@link TextFieldProps#isValid}
|
|
504
|
+
*/
|
|
505
|
+
isValid?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* The label of the text field displayed in a label tag.
|
|
508
|
+
* @see {@link TextFieldProps#label}
|
|
509
|
+
*/
|
|
510
|
+
label?: string;
|
|
511
|
+
/**
|
|
512
|
+
* The placeholder message of the text field.
|
|
513
|
+
* @see {@link TextFieldProps#placeholder}
|
|
514
|
+
*/
|
|
515
|
+
placeholder?: string;
|
|
516
|
+
/** List of suggestions to display during autocomplete. */
|
|
517
|
+
children: React.ReactNode;
|
|
518
|
+
/**
|
|
519
|
+
* The list of chips to be displayed before the text field input.
|
|
520
|
+
*/
|
|
521
|
+
chips?: React.ReactNode;
|
|
522
|
+
/**
|
|
523
|
+
* The value of the text field.
|
|
524
|
+
* @see {@link TextFieldProps#value}
|
|
525
|
+
*/
|
|
526
|
+
value: string;
|
|
527
|
+
/**
|
|
528
|
+
* Whether the suggestions from the autocomplete should be displayed or not.
|
|
529
|
+
* @see {@link DropdownProps#isOpen}
|
|
530
|
+
*/
|
|
531
|
+
isOpen: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* The native input name property.
|
|
534
|
+
* @see {@link TextFieldProps#name}
|
|
535
|
+
*/
|
|
536
|
+
name?: string;
|
|
537
|
+
/**
|
|
538
|
+
* Whether a click in the Autocomplete dropdown would close it or not.
|
|
539
|
+
* @see {@link DropdownProps#closeOnClick}
|
|
540
|
+
*/
|
|
541
|
+
closeOnClick?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Whether a click anywhere out of the Autocomplete would close it or not.
|
|
544
|
+
* @see {@link DropdownProps#closeOnClickAway}
|
|
545
|
+
*/
|
|
546
|
+
closeOnClickAway?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Whether an escape key press would close the Autocomplete or not.
|
|
549
|
+
* @see {@link DropdownProps#closeOnEscape}
|
|
550
|
+
*/
|
|
551
|
+
closeOnEscape?: boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Whether the focus should go back on the anchor when dropdown closes and focus is within.
|
|
554
|
+
* @see {@link DropdownProps#focusAnchorOnClose}
|
|
555
|
+
*/
|
|
556
|
+
focusAnchorOnClose?: DropdownProps['focusAnchorOnClose'];
|
|
557
|
+
/**
|
|
558
|
+
* The function called on blur.
|
|
559
|
+
* @see {@link TextFieldProps#onBlur}
|
|
560
|
+
*/
|
|
561
|
+
onBlur?(event: React.FocusEvent): void;
|
|
562
|
+
/**
|
|
563
|
+
* On change callback.
|
|
564
|
+
* @see {@link TextFieldProps#onChange}
|
|
565
|
+
*/
|
|
566
|
+
onChange(value: string, name?: string, event?: SyntheticEvent): void;
|
|
567
|
+
/**
|
|
568
|
+
* The function called on close.
|
|
569
|
+
* @see {@link DropdownProps#onClose}
|
|
570
|
+
*/
|
|
571
|
+
onClose?(): void;
|
|
572
|
+
/**
|
|
573
|
+
* The function called on focus.
|
|
574
|
+
* @see {@link TextFieldProps#onFocus}
|
|
575
|
+
*/
|
|
576
|
+
onFocus?(event: React.FocusEvent): void;
|
|
577
|
+
/**
|
|
578
|
+
* The function called when the bottom of the dropdown is reached.
|
|
579
|
+
* @see {@link DropdownProps#onInfiniteScroll}
|
|
580
|
+
*/
|
|
581
|
+
onInfiniteScroll?(): void;
|
|
582
|
+
/**
|
|
583
|
+
* Props forwarded to the underlying TextField component.
|
|
584
|
+
* Only the props not managed by the Autocomplete can be set.
|
|
585
|
+
* @see {@link TextFieldProps}
|
|
586
|
+
*/
|
|
587
|
+
textFieldProps?: Partial<TextFieldProps>;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Autocomplete component.
|
|
591
|
+
*
|
|
592
|
+
* @param props Component props.
|
|
593
|
+
* @param ref Component ref.
|
|
594
|
+
* @return React element.
|
|
595
|
+
*/
|
|
596
|
+
declare const Autocomplete: Comp<AutocompleteProps, HTMLDivElement>;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Defines the props of the component.
|
|
600
|
+
*/
|
|
601
|
+
interface AutocompleteMultipleProps extends AutocompleteProps {
|
|
602
|
+
/** Selected values. */
|
|
603
|
+
values: any[];
|
|
604
|
+
/** Alignment of the chips in the autocomplete. */
|
|
605
|
+
chipsAlignment?: HorizontalAlignment$1;
|
|
606
|
+
/** Selected value render function. Default: Renders the value inside of a Chip. */
|
|
607
|
+
selectedChipRender(choice: any, index: number, onClear?: (event?: React.MouseEvent, val?: any) => void, isDisabled?: boolean): ReactNode | string;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* AutocompleteMultiple component.
|
|
611
|
+
*
|
|
612
|
+
* @param props Component props.
|
|
613
|
+
* @param ref Component ref.
|
|
614
|
+
* @return React element.
|
|
615
|
+
*/
|
|
616
|
+
declare const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElement>;
|
|
617
|
+
|
|
599
618
|
/**
|
|
600
619
|
* Avatar sizes.
|
|
601
620
|
*/
|
|
@@ -2281,22 +2300,6 @@ interface DatePickerFieldProps extends Omit<TextFieldProps, 'value' | 'onChange'
|
|
|
2281
2300
|
*/
|
|
2282
2301
|
declare const DatePickerField: Comp<DatePickerFieldProps, HTMLDivElement>;
|
|
2283
2302
|
|
|
2284
|
-
interface BaseDialogProps {
|
|
2285
|
-
/** Footer content. */
|
|
2286
|
-
footer?: JSXElement;
|
|
2287
|
-
/** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
|
|
2288
|
-
forceFooterDivider?: boolean;
|
|
2289
|
-
/** Header content. */
|
|
2290
|
-
header?: JSXElement;
|
|
2291
|
-
/** Whether the divider between the dialog content and the header is always displayed (instead of showing it on scroll). */
|
|
2292
|
-
forceHeaderDivider?: boolean;
|
|
2293
|
-
/** Whether the indefinite progress indicator over the dialog content is displayed or not. */
|
|
2294
|
-
isLoading?: boolean;
|
|
2295
|
-
/** Whether the component is open or not. */
|
|
2296
|
-
isOpen?: boolean;
|
|
2297
|
-
}
|
|
2298
|
-
type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
2299
|
-
|
|
2300
2303
|
/**
|
|
2301
2304
|
* Defines the props of the component.
|
|
2302
2305
|
*/
|