@mackin.com/styleguide 7.4.0 → 7.7.1
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 +544 -492
- package/index.js +2502 -2221
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -3,168 +3,60 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { ReactNode } from 'react';
|
|
4
4
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const mergeClassNames: (...classes: (string | boolean | undefined)[]) => string | undefined;
|
|
10
|
-
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
11
|
-
|
|
12
|
-
declare const Table: (props: {
|
|
13
|
-
caption?: string | JSX.Element;
|
|
14
|
-
children?: any;
|
|
15
|
-
noCellBorder?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
/** Colors alternate rows. */
|
|
18
|
-
altRows?: boolean;
|
|
19
|
-
}) => JSX.Element;
|
|
20
|
-
declare const Tr: (props: {
|
|
21
|
-
className?: string;
|
|
22
|
-
children?: any;
|
|
23
|
-
}) => JSX.Element;
|
|
24
|
-
declare const Th: (props: {
|
|
25
|
-
children?: any;
|
|
26
|
-
align?: Alignment;
|
|
27
|
-
width?: string;
|
|
28
|
-
style?: React.CSSProperties;
|
|
29
|
-
className?: string;
|
|
30
|
-
}) => JSX.Element;
|
|
31
|
-
declare const Td: (props: {
|
|
32
|
-
children?: any;
|
|
33
|
-
align?: Alignment;
|
|
34
|
-
style?: React.CSSProperties;
|
|
35
|
-
colSpan?: number;
|
|
36
|
-
}) => JSX.Element;
|
|
37
|
-
|
|
38
|
-
declare const TdCurrency: (props: {
|
|
39
|
-
value: number;
|
|
40
|
-
cents?: boolean;
|
|
41
|
-
}) => JSX.Element;
|
|
42
|
-
|
|
43
|
-
declare const TdNumber: (props: {
|
|
44
|
-
value: number;
|
|
45
|
-
}) => JSX.Element;
|
|
46
|
-
|
|
47
|
-
declare const ThSort: (props: {
|
|
48
|
-
text: string | JSX.Element;
|
|
49
|
-
onClick: () => void;
|
|
50
|
-
align?: Alignment;
|
|
51
|
-
direction?: 'asc' | 'desc';
|
|
52
|
-
style?: React.CSSProperties;
|
|
53
|
-
width?: string;
|
|
54
|
-
rightContent?: JSX.Element;
|
|
55
|
-
}) => JSX.Element;
|
|
56
|
-
|
|
57
|
-
declare type SortDirection = 'asc' | 'desc';
|
|
58
|
-
interface PagerSortOption<TItem> {
|
|
59
|
-
id: string;
|
|
60
|
-
name?: string;
|
|
61
|
-
sort: (items: TItem[]) => TItem[];
|
|
62
|
-
}
|
|
63
|
-
interface PagerOptions<TItem> {
|
|
64
|
-
/** Defaults to 10. */
|
|
65
|
-
limit?: number;
|
|
66
|
-
/** Defaults to [10] */
|
|
67
|
-
limitOptions?: number[];
|
|
68
|
-
sort?: string;
|
|
69
|
-
sortOptions?: PagerSortOption<TItem>[];
|
|
70
|
-
previous?: ItemPager<TItem>;
|
|
6
|
+
interface AutoCompleteItem {
|
|
7
|
+
id: string | number;
|
|
8
|
+
name: string;
|
|
71
9
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
get sort(): string | undefined;
|
|
78
|
-
set sort(sortId: string | undefined);
|
|
79
|
-
/** The direction of the current sort when using an option created from addToggleSortOption */
|
|
80
|
-
get sortDirection(): SortDirection | undefined;
|
|
81
|
-
get sortOptions(): PagerSortOption<TItem>[];
|
|
82
|
-
get limit(): number;
|
|
83
|
-
set limit(value: number);
|
|
84
|
-
get limitOptions(): number[];
|
|
85
|
-
get totalPages(): number;
|
|
86
|
-
/** The zero-based page index. */
|
|
87
|
-
get page(): number;
|
|
88
|
-
/** The zero-based page index. */
|
|
89
|
-
set page(value: number);
|
|
90
|
-
get pageItems(): TItem[];
|
|
91
|
-
get totalItems(): number;
|
|
92
|
-
get minItemIndex(): number;
|
|
93
|
-
get maxItemIndex(): number;
|
|
94
|
-
get hasNext(): boolean;
|
|
95
|
-
get hasPrevious(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Adds both asc and des sort options
|
|
98
|
-
*
|
|
99
|
-
* @param propPath Prop name or path ('resource.title').
|
|
100
|
-
* @param name Name to display or asc Name and desc Name.
|
|
101
|
-
*/
|
|
102
|
-
addToggleSortOption(propPath: string, name?: string | [string, string]): void;
|
|
103
|
-
/**
|
|
104
|
-
* Toggles between asc and desc.
|
|
105
|
-
* @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
|
|
106
|
-
*/
|
|
107
|
-
toggleSort(sortId: string): void;
|
|
108
|
-
applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
109
|
-
next(): void;
|
|
110
|
-
previous(): void;
|
|
111
|
-
pageByOffset(direction: 1 | -1): void;
|
|
112
|
-
/** Adds the item optionally keeping the current page. */
|
|
113
|
-
add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
|
|
114
|
-
/** Removes the matched item(s). */
|
|
115
|
-
remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
116
|
-
replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
|
|
117
|
-
private _allItems;
|
|
118
|
-
private _page;
|
|
119
|
-
private _limit;
|
|
120
|
-
private _limitOptions;
|
|
121
|
-
private _pageResult;
|
|
122
|
-
private _filteredItems;
|
|
123
|
-
private _sort;
|
|
124
|
-
private _sortOptions;
|
|
125
|
-
private _currentFilter;
|
|
126
|
-
private createPageResult;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
interface PagerStyleProps {
|
|
130
|
-
/** Used for localizations. Defaults to 'of' */
|
|
131
|
-
itemDividerText?: string;
|
|
132
|
-
/** Used for localizations. Defaults to 'No Results' */
|
|
133
|
-
noResultsText?: string;
|
|
134
|
-
/** Used for localizations. Defaults to 'Page' */
|
|
135
|
-
pageText?: string;
|
|
10
|
+
declare type AutocompleteValue = string | AutoCompleteItem;
|
|
11
|
+
interface AutocompleteProps {
|
|
12
|
+
value: AutocompleteValue | undefined;
|
|
13
|
+
round?: boolean;
|
|
14
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
136
15
|
rounded?: boolean;
|
|
16
|
+
rightControl?: JSX.Element;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
disabled?: boolean;
|
|
137
20
|
className?: string;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
totalPages?: number;
|
|
21
|
+
inputClassName?: string;
|
|
22
|
+
/** If not set, defaults to 100 */
|
|
23
|
+
maxLength?: number;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Limits what will be show in the autocomplete options. Default is 7. */
|
|
26
|
+
maxShownValues?: number;
|
|
27
|
+
/** The minimum characters before 'getOptions' is called. No default. */
|
|
28
|
+
minChars?: number;
|
|
29
|
+
inputAriaAttributes?: React.AriaAttributes;
|
|
30
|
+
onChange: (value: string) => void;
|
|
31
|
+
getOptions: (value: string) => Promise<AutocompleteValue[]>;
|
|
32
|
+
onPick: (value: AutocompleteValue) => void;
|
|
33
|
+
onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
152
34
|
}
|
|
153
|
-
declare const
|
|
35
|
+
declare const Autocomplete: (p: AutocompleteProps) => JSX.Element;
|
|
154
36
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
37
|
+
/** @deprecated Use Backdrop2 going forward. */
|
|
38
|
+
declare const Backdrop$1: (props: {
|
|
39
|
+
show: boolean;
|
|
40
|
+
onClick?: () => void;
|
|
41
|
+
transparent?: boolean;
|
|
42
|
+
/** If true, the backdrop will hide on larger screens. */
|
|
43
|
+
responsive?: boolean;
|
|
44
|
+
/** If true, the backdrop will hide on smaller screens. */
|
|
45
|
+
reverseResponsive?: boolean;
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
/** If true, will not prevent scroll when shown. */
|
|
49
|
+
allowScroll?: boolean;
|
|
50
|
+
/** Fade in time. Defaults to 250ms. */
|
|
51
|
+
showTimeMs?: number;
|
|
52
|
+
}) => JSX.Element;
|
|
53
|
+
|
|
54
|
+
declare const Backdrop: (p: {
|
|
55
|
+
children: React__default.ReactNode;
|
|
56
|
+
/** Fade in time. Defaults to 250ms. */
|
|
57
|
+
showTimeMs?: number;
|
|
58
|
+
debug?: boolean;
|
|
59
|
+
}) => JSX.Element;
|
|
168
60
|
|
|
169
61
|
declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
170
62
|
interface ButtonProps {
|
|
@@ -182,7 +74,7 @@ interface ButtonProps {
|
|
|
182
74
|
block?: boolean;
|
|
183
75
|
/** As round as can be. */
|
|
184
76
|
round?: boolean;
|
|
185
|
-
/**
|
|
77
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
186
78
|
rounded?: boolean;
|
|
187
79
|
className?: string;
|
|
188
80
|
rightIcon?: JSX.Element;
|
|
@@ -202,16 +94,42 @@ interface ButtonProps {
|
|
|
202
94
|
}
|
|
203
95
|
declare const Button: (props: ButtonProps) => JSX.Element;
|
|
204
96
|
|
|
205
|
-
interface
|
|
97
|
+
interface CalendarProps {
|
|
98
|
+
month: number;
|
|
99
|
+
year: number;
|
|
100
|
+
/** Defaults to 3rem. */
|
|
101
|
+
cellSize?: string;
|
|
102
|
+
smallHeader?: boolean;
|
|
103
|
+
id?: string;
|
|
104
|
+
/** Defaults to true. */
|
|
105
|
+
title?: boolean;
|
|
106
|
+
yearInTitle?: boolean;
|
|
107
|
+
/** Ignored if title is set to false. */
|
|
108
|
+
customTitle?: JSX.Element;
|
|
109
|
+
/** If true, will always show 6 rows / 42 cells. */
|
|
110
|
+
fixedRows?: boolean;
|
|
111
|
+
/** Bolds the current date. */
|
|
112
|
+
showCurrent?: boolean;
|
|
113
|
+
selectedValue?: number;
|
|
114
|
+
/** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
|
|
115
|
+
renderCell?: (date: Date) => JSX.Element;
|
|
116
|
+
/** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
|
|
117
|
+
isCellDisabled?: (date: Date) => boolean;
|
|
118
|
+
onClick?: (date: Date) => void;
|
|
119
|
+
/** This is the ms from Date.valueOf(). */
|
|
120
|
+
min?: number;
|
|
121
|
+
/** This is the ms from Date.valueOf(). */
|
|
122
|
+
max?: number;
|
|
123
|
+
}
|
|
124
|
+
declare const Calendar: (p: CalendarProps) => JSX.Element;
|
|
125
|
+
|
|
126
|
+
interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'checked' | 'onChange' | 'type'> {
|
|
206
127
|
checked: boolean;
|
|
207
|
-
onChange: (checked: boolean) => void;
|
|
128
|
+
onChange: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
129
|
+
readonly?: boolean;
|
|
208
130
|
label?: string;
|
|
209
|
-
children?: React.ReactNode;
|
|
210
|
-
className?: string;
|
|
211
131
|
checkedIcon?: string;
|
|
212
132
|
uncheckedIcon?: string;
|
|
213
|
-
disabled?: boolean;
|
|
214
|
-
readonly?: boolean;
|
|
215
133
|
/** Background color when checked based on the current theme. Mutually exclusive with 'checkedColor'. */
|
|
216
134
|
checkedThemeColor?: 'primary' | 'primary2' | 'secondary';
|
|
217
135
|
/** Background color when checked. Mutually exclusive with 'checkedThemeColor'. */
|
|
@@ -234,16 +152,72 @@ interface ConfirmModalProps {
|
|
|
234
152
|
}
|
|
235
153
|
declare const ConfirmModal: (props: ConfirmModalProps) => JSX.Element;
|
|
236
154
|
|
|
237
|
-
|
|
155
|
+
interface CopyButtonProps {
|
|
156
|
+
/** HTML selector of the target input to copy from. */
|
|
157
|
+
selector: string;
|
|
158
|
+
title?: string;
|
|
159
|
+
}
|
|
160
|
+
declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
|
|
238
161
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
162
|
+
interface DatePickerProps {
|
|
163
|
+
value: number | undefined;
|
|
164
|
+
/** Called with debounce when the input changes. */
|
|
165
|
+
onChange: (value: number | undefined) => void;
|
|
166
|
+
style?: React.CSSProperties;
|
|
167
|
+
/** Defaults to MM/DD/YYYY. */
|
|
168
|
+
placeholder?: string;
|
|
242
169
|
id?: string;
|
|
243
|
-
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
className?: string;
|
|
172
|
+
inputClassName?: string;
|
|
173
|
+
readOnly?: boolean;
|
|
174
|
+
required?: boolean;
|
|
175
|
+
/** Defaults to 250ms */
|
|
176
|
+
debounceMs?: number;
|
|
177
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
178
|
+
rounded?: boolean;
|
|
179
|
+
round?: boolean;
|
|
180
|
+
/** This is the ms from Date.valueOf(). */
|
|
181
|
+
min?: number;
|
|
182
|
+
/** This is the ms from Date.valueOf(). */
|
|
183
|
+
max?: number;
|
|
184
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
185
|
+
reposition?: boolean;
|
|
186
|
+
}
|
|
187
|
+
declare const DatePicker: (p: DatePickerProps) => JSX.Element;
|
|
188
|
+
|
|
189
|
+
declare const Divider: () => JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const ErrorModal: (props: {
|
|
192
|
+
message: string;
|
|
193
|
+
show: boolean;
|
|
194
|
+
id?: string;
|
|
195
|
+
debug?: boolean;
|
|
244
196
|
close: () => void;
|
|
245
197
|
}) => JSX.Element;
|
|
246
198
|
|
|
199
|
+
interface FileUploaderProps {
|
|
200
|
+
onUpload: (files: FileList) => Promise<void>;
|
|
201
|
+
/** Defaults to 'Upload'. */
|
|
202
|
+
buttonText?: string;
|
|
203
|
+
/** Defauts to 'Upload successful'. */
|
|
204
|
+
successMessage?: string | JSX.Element;
|
|
205
|
+
/** Defaults to 'Upload failed.' */
|
|
206
|
+
failureMessage?: string | JSX.Element;
|
|
207
|
+
/** Defaults to 10rem. */
|
|
208
|
+
buttonWidth?: string;
|
|
209
|
+
/** Defaults to 'primary'. */
|
|
210
|
+
buttonVariant?: ButtonVariant;
|
|
211
|
+
maxBytes?: number;
|
|
212
|
+
multiple?: boolean;
|
|
213
|
+
accept?: string;
|
|
214
|
+
/** Defaults to 'Click or drag and drop files.'*/
|
|
215
|
+
instructionMessage?: string;
|
|
216
|
+
/** For additional info below the instructionMessage. */
|
|
217
|
+
infoMessage?: string | JSX.Element;
|
|
218
|
+
}
|
|
219
|
+
declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
|
|
220
|
+
|
|
247
221
|
declare type FormProps = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
|
|
248
222
|
interface IProps extends FormProps {
|
|
249
223
|
inline?: boolean;
|
|
@@ -309,6 +283,8 @@ declare const InfoPanel: (props: {
|
|
|
309
283
|
variant?: 'info' | 'warning' | 'error' | 'negative' | 'positive';
|
|
310
284
|
className?: string;
|
|
311
285
|
style?: React.CSSProperties;
|
|
286
|
+
/** Defaults to 'p'. */
|
|
287
|
+
tag?: 'p' | 'div';
|
|
312
288
|
}) => JSX.Element;
|
|
313
289
|
|
|
314
290
|
interface InfoTipProps {
|
|
@@ -330,6 +306,24 @@ interface InfoTipProps {
|
|
|
330
306
|
}
|
|
331
307
|
declare const InfoTip: (props: InfoTipProps) => JSX.Element;
|
|
332
308
|
|
|
309
|
+
interface BaseInputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
310
|
+
rightControl?: JSX.Element;
|
|
311
|
+
round?: boolean;
|
|
312
|
+
/** The class applied to the wrapping element without this component. Use 'className' to style the input directly. */
|
|
313
|
+
wrapperClassName?: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
interface DateInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step' | 'pattern' | 'maxLength'> {
|
|
317
|
+
/** The epoch timestamp. Equivalent to Date.valueOf(). */
|
|
318
|
+
value: number | undefined;
|
|
319
|
+
/** The min epoch timestamp. */
|
|
320
|
+
min?: number;
|
|
321
|
+
/** The max epoch timestamp. */
|
|
322
|
+
max?: number;
|
|
323
|
+
onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
324
|
+
}
|
|
325
|
+
declare const DateInput: React.ForwardRefExoticComponent<Pick<DateInputProps, "value" | "onChange" | "min" | "max" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<any>>;
|
|
326
|
+
|
|
333
327
|
declare type InputValue = string | number | undefined;
|
|
334
328
|
declare type InputType = 'text' | 'number' | 'textarea' | 'date' | 'password' | 'url' | 'email';
|
|
335
329
|
interface InputProps {
|
|
@@ -350,8 +344,9 @@ interface InputProps {
|
|
|
350
344
|
/** Defaults to 'off'. */
|
|
351
345
|
autoComplete?: string;
|
|
352
346
|
autoFocus?: boolean;
|
|
347
|
+
inputAriaAttributes?: React.AriaAttributes;
|
|
353
348
|
/** Called with debounce when the input changes. */
|
|
354
|
-
onChange?: (value: InputValue, name?: string) => void;
|
|
349
|
+
onChange?: (value: InputValue, name?: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
355
350
|
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
356
351
|
onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
357
352
|
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
@@ -371,8 +366,32 @@ interface InputProps {
|
|
|
371
366
|
rows?: number;
|
|
372
367
|
pattern?: string;
|
|
373
368
|
}
|
|
369
|
+
/** @deprecated Use DateInput, NumberInput, or TextInput instead. */
|
|
374
370
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<any>>;
|
|
375
371
|
|
|
372
|
+
interface NumberInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
373
|
+
value: number | undefined;
|
|
374
|
+
min?: number;
|
|
375
|
+
max?: number;
|
|
376
|
+
step?: number;
|
|
377
|
+
onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
378
|
+
}
|
|
379
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Pick<NumberInputProps, "value" | "onChange" | "min" | "max" | "step" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "maxLength" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<any>>;
|
|
380
|
+
|
|
381
|
+
interface TextAreaProps extends Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value' | 'onChange'> {
|
|
382
|
+
value: string | undefined;
|
|
383
|
+
onChange: (value: string | undefined, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
384
|
+
}
|
|
385
|
+
declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "onChange" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<any>>;
|
|
386
|
+
|
|
387
|
+
interface TextInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
388
|
+
value: string | undefined;
|
|
389
|
+
/** Defaults to 'text'. */
|
|
390
|
+
type?: 'text' | 'email' | 'url' | 'password';
|
|
391
|
+
onChange: (value: string | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
392
|
+
}
|
|
393
|
+
declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputProps, "type" | "value" | "onChange" | "rightControl" | "round" | "wrapperClassName" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "maxLength" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<any>>;
|
|
394
|
+
|
|
376
395
|
interface LabelProps {
|
|
377
396
|
text: string | JSX.Element;
|
|
378
397
|
children: React.ReactNode;
|
|
@@ -442,6 +461,7 @@ interface OmniLinkProps {
|
|
|
442
461
|
children: React.ReactNode;
|
|
443
462
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
|
444
463
|
className?: string;
|
|
464
|
+
style?: React.CSSProperties;
|
|
445
465
|
noRouter?: boolean;
|
|
446
466
|
/** Ignored if 'noRouter' is false */
|
|
447
467
|
target?: string;
|
|
@@ -455,7 +475,7 @@ interface OmniLinkProps {
|
|
|
455
475
|
title?: string;
|
|
456
476
|
/** Only for button variants. */
|
|
457
477
|
round?: boolean;
|
|
458
|
-
/** Only for button variants. */
|
|
478
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. Only for button variants. */
|
|
459
479
|
rounded?: boolean;
|
|
460
480
|
/** Only for button variants. */
|
|
461
481
|
small?: boolean;
|
|
@@ -464,192 +484,250 @@ interface OmniLinkProps {
|
|
|
464
484
|
}
|
|
465
485
|
declare const OmniLink: (props: OmniLinkProps) => JSX.Element;
|
|
466
486
|
|
|
467
|
-
declare type
|
|
468
|
-
interface
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
id: T;
|
|
473
|
-
name?: string;
|
|
474
|
-
})[];
|
|
475
|
-
onChange: (value: T) => void;
|
|
476
|
-
id?: string;
|
|
477
|
-
rounded?: boolean;
|
|
478
|
-
disabled?: boolean;
|
|
479
|
-
className?: string;
|
|
480
|
-
readonly?: boolean;
|
|
487
|
+
declare type SortDirection = 'asc' | 'desc';
|
|
488
|
+
interface PagerSortOption<TItem> {
|
|
489
|
+
id: string;
|
|
490
|
+
name?: string;
|
|
491
|
+
sort: (items: TItem[]) => TItem[];
|
|
481
492
|
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
493
|
+
interface PagerOptions<TItem> {
|
|
494
|
+
/** Defaults to 10. */
|
|
495
|
+
limit?: number;
|
|
496
|
+
/** Defaults to [10] */
|
|
497
|
+
limitOptions?: number[];
|
|
498
|
+
sort?: string;
|
|
499
|
+
sortOptions?: PagerSortOption<TItem>[];
|
|
500
|
+
previous?: ItemPager<TItem>;
|
|
489
501
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
502
|
+
/** For in-memory paging. */
|
|
503
|
+
declare class ItemPager<TItem> {
|
|
504
|
+
constructor(allItems: TItem[], options?: PagerOptions<TItem>);
|
|
505
|
+
get allItems(): TItem[];
|
|
506
|
+
/** The ID of the current sort within the sortOptions. */
|
|
507
|
+
get sort(): string | undefined;
|
|
508
|
+
set sort(sortId: string | undefined);
|
|
509
|
+
/** The direction of the current sort when using an option created from addToggleSortOption */
|
|
510
|
+
get sortDirection(): SortDirection | undefined;
|
|
511
|
+
get sortOptions(): PagerSortOption<TItem>[];
|
|
512
|
+
get limit(): number;
|
|
513
|
+
set limit(value: number);
|
|
514
|
+
get limitOptions(): number[];
|
|
515
|
+
get totalPages(): number;
|
|
516
|
+
/** The zero-based page index. */
|
|
517
|
+
get page(): number;
|
|
518
|
+
/** The zero-based page index. */
|
|
519
|
+
set page(value: number);
|
|
520
|
+
get pageItems(): TItem[];
|
|
521
|
+
get totalItems(): number;
|
|
522
|
+
get minItemIndex(): number;
|
|
523
|
+
get maxItemIndex(): number;
|
|
524
|
+
get hasNext(): boolean;
|
|
525
|
+
get hasPrevious(): boolean;
|
|
526
|
+
/**
|
|
527
|
+
* Adds both asc and des sort options
|
|
528
|
+
*
|
|
529
|
+
* @param propPath Prop name or path ('resource.title').
|
|
530
|
+
* @param name Name to display or asc Name and desc Name.
|
|
531
|
+
*/
|
|
532
|
+
addToggleSortOption(propPath: string, name?: string | [string, string]): void;
|
|
533
|
+
/**
|
|
534
|
+
* Toggles between asc and desc.
|
|
535
|
+
* @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
|
|
536
|
+
*/
|
|
537
|
+
toggleSort(sortId: string): void;
|
|
538
|
+
applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
539
|
+
next(): void;
|
|
540
|
+
previous(): void;
|
|
541
|
+
pageByOffset(direction: 1 | -1): void;
|
|
542
|
+
/** Adds the item optionally keeping the current page. */
|
|
543
|
+
add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
|
|
544
|
+
/** Removes the matched item(s). */
|
|
545
|
+
remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
546
|
+
replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
|
|
547
|
+
private _allItems;
|
|
548
|
+
private _page;
|
|
549
|
+
private _limit;
|
|
550
|
+
private _limitOptions;
|
|
551
|
+
private _pageResult;
|
|
552
|
+
private _filteredItems;
|
|
553
|
+
private _sort;
|
|
554
|
+
private _sortOptions;
|
|
555
|
+
private _currentFilter;
|
|
556
|
+
private createPageResult;
|
|
557
|
+
}
|
|
496
558
|
|
|
497
|
-
interface
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
559
|
+
interface PagerStyleProps {
|
|
560
|
+
/** Used for localizations. Defaults to 'of' */
|
|
561
|
+
itemDividerText?: string;
|
|
562
|
+
/** Used for localizations. Defaults to 'No Results' */
|
|
563
|
+
noResultsText?: string;
|
|
564
|
+
/** Used for localizations. Defaults to 'Page' */
|
|
565
|
+
pageText?: string;
|
|
566
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
503
567
|
rounded?: boolean;
|
|
504
568
|
className?: string;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
debounceMs?: number;
|
|
569
|
+
leftControls?: JSX.Element;
|
|
570
|
+
rightControls?: JSX.Element;
|
|
508
571
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
ellipsis?: boolean;
|
|
521
|
-
style?: React.CSSProperties;
|
|
522
|
-
smaller?: boolean;
|
|
523
|
-
larger?: boolean;
|
|
524
|
-
spacedOut?: boolean;
|
|
525
|
-
lineClamp?: number;
|
|
526
|
-
/** Will remove all margin/padding from specified tag */
|
|
527
|
-
noPad?: boolean;
|
|
528
|
-
leftPad?: string;
|
|
572
|
+
interface PagerProps extends PagerStyleProps {
|
|
573
|
+
canGoNext: boolean;
|
|
574
|
+
canGoPrevious: boolean;
|
|
575
|
+
minItem: number;
|
|
576
|
+
maxItem: number;
|
|
577
|
+
totalItems: number;
|
|
578
|
+
page: (direction: 1 | -1) => void;
|
|
579
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
580
|
+
pageIndex?: number;
|
|
581
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
582
|
+
totalPages?: number;
|
|
529
583
|
}
|
|
530
|
-
declare const
|
|
531
|
-
style: React.CSSProperties;
|
|
532
|
-
className: string;
|
|
533
|
-
}, HTMLElement>;
|
|
584
|
+
declare const Pager: (props: PagerProps) => JSX.Element;
|
|
534
585
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
|
|
546
|
-
checkedIcon?: JSX.Element;
|
|
547
|
-
uncheckedIcon?: JSX.Element;
|
|
548
|
-
variant?: ToggleButtonVariant;
|
|
549
|
-
checkedVariant?: ToggleButtonVariant;
|
|
550
|
-
style?: React.CSSProperties;
|
|
551
|
-
checkedStyle?: React.CSSProperties;
|
|
586
|
+
interface Props$1<T> extends PagerStyleProps {
|
|
587
|
+
pager: ItemPager<T>;
|
|
588
|
+
onPage: (direction: 1 | -1) => void;
|
|
589
|
+
/** Defaults to 'Limit' */
|
|
590
|
+
limitText?: string;
|
|
591
|
+
/** Defaults to 'Sort' */
|
|
592
|
+
sortText?: string;
|
|
593
|
+
onLimit?: (limit: number) => void;
|
|
594
|
+
onSort?: (sort: string) => void;
|
|
595
|
+
/** Shows 'Page X of Y'. */
|
|
596
|
+
showPageText?: boolean;
|
|
552
597
|
}
|
|
553
|
-
declare const
|
|
598
|
+
declare const BoundMemoryPager: <T>(p: Props$1<T>) => JSX.Element;
|
|
554
599
|
|
|
555
|
-
interface
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
600
|
+
interface Props<T> extends PagerStyleProps {
|
|
601
|
+
result: PagedResult<T>;
|
|
602
|
+
onPage: (direction: 1 | -1) => void;
|
|
603
|
+
limitOptions?: number[];
|
|
604
|
+
sort?: string | number;
|
|
605
|
+
sortOptions?: {
|
|
606
|
+
id: string | number;
|
|
607
|
+
name?: string;
|
|
608
|
+
}[];
|
|
609
|
+
/** Defaults to 'Limit' */
|
|
610
|
+
limitText?: string;
|
|
611
|
+
/** Defaults to 'Sort' */
|
|
612
|
+
sortText?: string;
|
|
613
|
+
onLimit?: (limit: number) => void;
|
|
614
|
+
onSort?: (sort: string | number) => void;
|
|
615
|
+
/** Shows 'Page X of Y'. */
|
|
616
|
+
showPageText?: boolean;
|
|
571
617
|
}
|
|
572
|
-
declare const
|
|
618
|
+
declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
|
|
573
619
|
|
|
574
|
-
declare
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
620
|
+
declare class PagedResult<T> {
|
|
621
|
+
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
622
|
+
static fromDto<T>(dto: {
|
|
623
|
+
[key: string]: any;
|
|
624
|
+
}): PagedResult<T>;
|
|
625
|
+
total: number;
|
|
626
|
+
/** The zero-based page index. */
|
|
627
|
+
page: number;
|
|
628
|
+
limit: number;
|
|
629
|
+
items: T[];
|
|
630
|
+
/** Helper for items.length */
|
|
631
|
+
get length(): number;
|
|
632
|
+
get hasItems(): boolean;
|
|
633
|
+
get previousPage(): number;
|
|
634
|
+
get hasPrevious(): boolean;
|
|
635
|
+
get nextPage(): number;
|
|
636
|
+
get hasNext(): boolean;
|
|
637
|
+
get lastPage(): number;
|
|
638
|
+
get totalPages(): number;
|
|
639
|
+
get minPageItemIndex(): number;
|
|
640
|
+
get maxPageItemIndex(): number;
|
|
641
|
+
/** Returns the first item on the current page. */
|
|
642
|
+
get firstPageItem(): T;
|
|
643
|
+
/** Returns the last item on the current page */
|
|
644
|
+
get lastPageItem(): T;
|
|
645
|
+
getPageRelativeItemIndex(item: T): number;
|
|
646
|
+
getResultRelativeItemIndex(item: T): number | undefined;
|
|
647
|
+
getPreviousItem(fromItem: T): T | undefined;
|
|
648
|
+
getNextItem(fromItem: T): T | undefined;
|
|
649
|
+
getPagingRange(radius: number): number[];
|
|
650
|
+
toJSON(): {
|
|
651
|
+
[key: string]: any;
|
|
652
|
+
};
|
|
653
|
+
clone(newItems?: T[]): PagedResult<T>;
|
|
654
|
+
}
|
|
580
655
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
year: number;
|
|
584
|
-
/** Defaults to 3rem. */
|
|
585
|
-
cellSize?: string;
|
|
586
|
-
smallHeader?: boolean;
|
|
587
|
-
id?: string;
|
|
588
|
-
/** Defaults to true. */
|
|
589
|
-
title?: boolean;
|
|
590
|
-
yearInTitle?: boolean;
|
|
591
|
-
/** Ignored if title is set to false. */
|
|
592
|
-
customTitle?: JSX.Element;
|
|
593
|
-
/** If true, will always show 6 rows / 42 cells. */
|
|
594
|
-
fixedRows?: boolean;
|
|
595
|
-
/** Bolds the current date. */
|
|
596
|
-
showCurrent?: boolean;
|
|
597
|
-
selectedValue?: number;
|
|
598
|
-
/** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
|
|
599
|
-
renderCell?: (date: Date) => JSX.Element;
|
|
600
|
-
/** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
|
|
601
|
-
isCellDisabled?: (date: Date) => boolean;
|
|
602
|
-
onClick?: (date: Date) => void;
|
|
603
|
-
/** This is the ms from Date.valueOf(). */
|
|
604
|
-
min?: number;
|
|
605
|
-
/** This is the ms from Date.valueOf(). */
|
|
606
|
-
max?: number;
|
|
656
|
+
declare type PickerValue = string | number;
|
|
657
|
+
interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options' | 'onChange'> {
|
|
607
658
|
}
|
|
608
|
-
|
|
659
|
+
interface PickerProps<T extends PickerValue> extends SelectProps {
|
|
660
|
+
value: T;
|
|
661
|
+
options: (T | {
|
|
662
|
+
id: T;
|
|
663
|
+
name?: string;
|
|
664
|
+
})[];
|
|
665
|
+
onChange: (value: T, event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
666
|
+
readonly?: boolean;
|
|
667
|
+
/** @deprecated Unused. Picker will always render a 'select' element. */
|
|
668
|
+
type?: 'select';
|
|
669
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
670
|
+
rounded?: boolean;
|
|
671
|
+
}
|
|
672
|
+
declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element;
|
|
609
673
|
|
|
610
|
-
interface
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
placeholder?: string;
|
|
674
|
+
interface PopoverProps {
|
|
675
|
+
isOpen: boolean;
|
|
676
|
+
/** The content inside the popover. */
|
|
677
|
+
content: JSX.Element;
|
|
678
|
+
/** The element controlling the state of the popover. */
|
|
679
|
+
parent: JSX.Element;
|
|
617
680
|
id?: string;
|
|
618
|
-
disabled?: boolean;
|
|
619
|
-
className?: string;
|
|
620
|
-
inputClassName?: string;
|
|
621
|
-
readOnly?: boolean;
|
|
622
|
-
required?: boolean;
|
|
623
|
-
/** Defaults to 250ms */
|
|
624
|
-
debounceMs?: number;
|
|
625
|
-
rounded?: boolean;
|
|
626
|
-
round?: boolean;
|
|
627
|
-
/** This is the ms from Date.valueOf(). */
|
|
628
|
-
min?: number;
|
|
629
|
-
/** This is the ms from Date.valueOf(). */
|
|
630
|
-
max?: number;
|
|
631
681
|
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
632
682
|
reposition?: boolean;
|
|
683
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
684
|
+
/** Popover arrow color. Defaults to theme.colors.border. */
|
|
685
|
+
arrorColor?: string;
|
|
686
|
+
/** Popover border. Defaults to theme.controls.border. */
|
|
687
|
+
border?: string;
|
|
688
|
+
/** Popover background. Defaults to theme.colors.bg. */
|
|
689
|
+
backgroundColor?: string;
|
|
690
|
+
/** Order of positions as the Popover colides with the window edge. */
|
|
691
|
+
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
633
692
|
}
|
|
634
|
-
declare const
|
|
693
|
+
declare const Popover: (p: PopoverProps) => JSX.Element;
|
|
635
694
|
|
|
636
|
-
interface
|
|
637
|
-
|
|
695
|
+
interface ProgressBarProps {
|
|
696
|
+
pct: number;
|
|
697
|
+
round?: boolean;
|
|
698
|
+
showPct?: boolean;
|
|
699
|
+
className?: string;
|
|
638
700
|
}
|
|
639
|
-
|
|
640
|
-
|
|
701
|
+
declare const ProgressBar: (props: {
|
|
702
|
+
pct: number;
|
|
703
|
+
round?: boolean;
|
|
704
|
+
showPct?: boolean;
|
|
705
|
+
className?: string;
|
|
706
|
+
}) => JSX.Element;
|
|
707
|
+
|
|
708
|
+
interface SearchBoxProps {
|
|
709
|
+
value: string | undefined;
|
|
710
|
+
onChange: (value: string | undefined | number) => void;
|
|
641
711
|
id?: string;
|
|
712
|
+
placeholder?: string;
|
|
713
|
+
round?: boolean;
|
|
714
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
642
715
|
rounded?: boolean;
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
variant?: 'tab' | 'button';
|
|
716
|
+
className?: string;
|
|
717
|
+
onSubmit?: () => Promise<void>;
|
|
718
|
+
/** Defaults to 250ms */
|
|
719
|
+
debounceMs?: number;
|
|
648
720
|
}
|
|
649
|
-
declare const
|
|
721
|
+
declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
|
|
722
|
+
|
|
723
|
+
declare type Alignment = 'left' | 'right' | 'center';
|
|
650
724
|
|
|
651
725
|
declare const GlobalStyles: () => null;
|
|
652
726
|
|
|
727
|
+
/** @deprecated This will not work correctly with emotion/css. Use 'cx' for adding multiple class names together. */
|
|
728
|
+
declare const mergeClassNames: (...classes: (string | boolean | undefined)[]) => string | undefined;
|
|
729
|
+
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
730
|
+
|
|
653
731
|
interface MackinTheme {
|
|
654
732
|
colors: {
|
|
655
733
|
primary: string;
|
|
@@ -702,6 +780,7 @@ interface MackinTheme {
|
|
|
702
780
|
fontSize: string;
|
|
703
781
|
borderWidth: string;
|
|
704
782
|
border: string;
|
|
783
|
+
borderRadius: string;
|
|
705
784
|
height: string;
|
|
706
785
|
heightSmall: string;
|
|
707
786
|
boxShadow: string;
|
|
@@ -712,6 +791,7 @@ interface MackinTheme {
|
|
|
712
791
|
focusOutlineShadow: string;
|
|
713
792
|
focusOutlineRequiredShadow: string;
|
|
714
793
|
roundRadius: string;
|
|
794
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
715
795
|
roundedRadius: string;
|
|
716
796
|
disabledOpacity: string;
|
|
717
797
|
formButtonMinWidth: string;
|
|
@@ -742,129 +822,15 @@ interface MackinTheme {
|
|
|
742
822
|
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
|
743
823
|
declare const defaultTheme: MackinTheme;
|
|
744
824
|
|
|
745
|
-
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
746
|
-
declare const useThemeSafely: () => MackinTheme;
|
|
747
|
-
|
|
748
825
|
declare const ThemeProvider: <T extends MackinTheme>(p: {
|
|
749
826
|
children?: ReactNode;
|
|
750
827
|
theme: T;
|
|
751
828
|
}) => JSX.Element;
|
|
752
829
|
|
|
753
|
-
declare const
|
|
754
|
-
disabled?: boolean;
|
|
755
|
-
children?: React.ReactNode;
|
|
756
|
-
style?: React.CSSProperties;
|
|
757
|
-
}) => JSX.Element;
|
|
758
|
-
|
|
759
|
-
interface FileUploaderProps {
|
|
760
|
-
onUpload: (files: FileList) => Promise<void>;
|
|
761
|
-
/** Defaults to 'Upload'. */
|
|
762
|
-
buttonText?: string;
|
|
763
|
-
/** Defauts to 'Upload successful'. */
|
|
764
|
-
successMessage?: string | JSX.Element;
|
|
765
|
-
/** Defaults to 'Upload failed.' */
|
|
766
|
-
failureMessage?: string | JSX.Element;
|
|
767
|
-
/** Defaults to 10rem. */
|
|
768
|
-
buttonWidth?: string;
|
|
769
|
-
/** Defaults to 'primary'. */
|
|
770
|
-
buttonVariant?: ButtonVariant;
|
|
771
|
-
maxBytes?: number;
|
|
772
|
-
multiple?: boolean;
|
|
773
|
-
accept?: string;
|
|
774
|
-
/** Defaults to 'Click or drag and drop files.'*/
|
|
775
|
-
instructionMessage?: string;
|
|
776
|
-
/** For additional info below the instructionMessage. */
|
|
777
|
-
infoMessage?: string | JSX.Element;
|
|
778
|
-
}
|
|
779
|
-
declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
|
|
780
|
-
|
|
781
|
-
interface CopyButtonProps {
|
|
782
|
-
/** HTML selector of the target input to copy from. */
|
|
783
|
-
selector: string;
|
|
784
|
-
title?: string;
|
|
785
|
-
}
|
|
786
|
-
declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
|
|
787
|
-
|
|
788
|
-
interface PopoverProps {
|
|
789
|
-
isOpen: boolean;
|
|
790
|
-
/** The content inside the popover. */
|
|
791
|
-
content: JSX.Element;
|
|
792
|
-
/** The element controlling the state of the popover. */
|
|
793
|
-
parent: JSX.Element;
|
|
794
|
-
id?: string;
|
|
795
|
-
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
796
|
-
reposition?: boolean;
|
|
797
|
-
onClickOutside?: (e: MouseEvent) => void;
|
|
798
|
-
/** Popover arrow color. Defaults to theme.colors.border. */
|
|
799
|
-
arrorColor?: string;
|
|
800
|
-
/** Popover border. Defaults to theme.controls.border. */
|
|
801
|
-
border?: string;
|
|
802
|
-
/** Popover background. Defaults to theme.colors.bg. */
|
|
803
|
-
backgroundColor?: string;
|
|
804
|
-
/** Order of positions as the Popover colides with the window edge. */
|
|
805
|
-
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
806
|
-
}
|
|
807
|
-
declare const Popover: (p: PopoverProps) => JSX.Element;
|
|
808
|
-
|
|
809
|
-
interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
|
|
810
|
-
}
|
|
811
|
-
declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
|
|
812
|
-
|
|
813
|
-
declare class PagedResult<T> {
|
|
814
|
-
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
815
|
-
static fromDto<T>(dto: {
|
|
816
|
-
[key: string]: any;
|
|
817
|
-
}): PagedResult<T>;
|
|
818
|
-
total: number;
|
|
819
|
-
/** The zero-based page index. */
|
|
820
|
-
page: number;
|
|
821
|
-
limit: number;
|
|
822
|
-
items: T[];
|
|
823
|
-
/** Helper for items.length */
|
|
824
|
-
get length(): number;
|
|
825
|
-
get hasItems(): boolean;
|
|
826
|
-
get previousPage(): number;
|
|
827
|
-
get hasPrevious(): boolean;
|
|
828
|
-
get nextPage(): number;
|
|
829
|
-
get hasNext(): boolean;
|
|
830
|
-
get lastPage(): number;
|
|
831
|
-
get totalPages(): number;
|
|
832
|
-
get minPageItemIndex(): number;
|
|
833
|
-
get maxPageItemIndex(): number;
|
|
834
|
-
/** Returns the first item on the current page. */
|
|
835
|
-
get firstPageItem(): T;
|
|
836
|
-
/** Returns the last item on the current page */
|
|
837
|
-
get lastPageItem(): T;
|
|
838
|
-
getPageRelativeItemIndex(item: T): number;
|
|
839
|
-
getResultRelativeItemIndex(item: T): number | undefined;
|
|
840
|
-
getPreviousItem(fromItem: T): T | undefined;
|
|
841
|
-
getNextItem(fromItem: T): T | undefined;
|
|
842
|
-
getPagingRange(radius: number): number[];
|
|
843
|
-
toJSON(): {
|
|
844
|
-
[key: string]: any;
|
|
845
|
-
};
|
|
846
|
-
clone(newItems?: T[]): PagedResult<T>;
|
|
847
|
-
}
|
|
830
|
+
declare const useMediaQuery: (query: string) => boolean;
|
|
848
831
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
onPage: (direction: 1 | -1) => void;
|
|
852
|
-
limitOptions?: number[];
|
|
853
|
-
sort?: string | number;
|
|
854
|
-
sortOptions?: {
|
|
855
|
-
id: string | number;
|
|
856
|
-
name?: string;
|
|
857
|
-
}[];
|
|
858
|
-
/** Defaults to 'Limit' */
|
|
859
|
-
limitText?: string;
|
|
860
|
-
/** Defaults to 'Sort' */
|
|
861
|
-
sortText?: string;
|
|
862
|
-
onLimit?: (limit: number) => void;
|
|
863
|
-
onSort?: (sort: string | number) => void;
|
|
864
|
-
/** Shows 'Page X of Y'. */
|
|
865
|
-
showPageText?: boolean;
|
|
866
|
-
}
|
|
867
|
-
declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
|
|
832
|
+
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
833
|
+
declare const useThemeSafely: () => MackinTheme;
|
|
868
834
|
|
|
869
835
|
declare type SliderValue = number | [number, number];
|
|
870
836
|
interface SliderProps<T extends SliderValue> {
|
|
@@ -885,59 +851,145 @@ interface SliderProps<T extends SliderValue> {
|
|
|
885
851
|
}
|
|
886
852
|
declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => JSX.Element;
|
|
887
853
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
854
|
+
interface TabHeaderTabProps {
|
|
855
|
+
name: string;
|
|
856
|
+
}
|
|
857
|
+
interface TabHeaderProps {
|
|
858
|
+
tabs: TabHeaderTabProps[];
|
|
859
|
+
id?: string;
|
|
860
|
+
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
861
|
+
rounded?: boolean;
|
|
862
|
+
/** Defaults to 10rem. */
|
|
863
|
+
maxTabWidth?: string;
|
|
864
|
+
onTabChanged?: (tabIndex: number) => void;
|
|
865
|
+
/** Defaults to 'tab'. */
|
|
866
|
+
variant?: 'tab' | 'button';
|
|
867
|
+
}
|
|
868
|
+
declare const TabHeader: (p: TabHeaderProps) => JSX.Element;
|
|
869
|
+
|
|
870
|
+
declare const Table: (props: {
|
|
871
|
+
caption?: string | JSX.Element;
|
|
872
|
+
children?: any;
|
|
873
|
+
noCellBorder?: boolean;
|
|
898
874
|
className?: string;
|
|
899
|
-
/**
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
875
|
+
/** Colors alternate rows. */
|
|
876
|
+
altRows?: boolean;
|
|
877
|
+
}) => JSX.Element;
|
|
878
|
+
declare const Tr: (props: {
|
|
879
|
+
className?: string;
|
|
880
|
+
children?: any;
|
|
881
|
+
}) => JSX.Element;
|
|
882
|
+
declare const Th: (props: {
|
|
883
|
+
children?: any;
|
|
884
|
+
align?: Alignment;
|
|
885
|
+
width?: string;
|
|
886
|
+
style?: React.CSSProperties;
|
|
887
|
+
className?: string;
|
|
888
|
+
}) => JSX.Element;
|
|
889
|
+
declare const Td: (props: {
|
|
890
|
+
children?: any;
|
|
891
|
+
align?: Alignment;
|
|
892
|
+
style?: React.CSSProperties;
|
|
893
|
+
colSpan?: number;
|
|
903
894
|
}) => JSX.Element;
|
|
904
895
|
|
|
905
|
-
declare const
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
showTimeMs?: number;
|
|
909
|
-
debug?: boolean;
|
|
896
|
+
declare const TdCurrency: (props: {
|
|
897
|
+
value: number;
|
|
898
|
+
cents?: boolean;
|
|
910
899
|
}) => JSX.Element;
|
|
911
900
|
|
|
912
|
-
declare const
|
|
901
|
+
declare const TdNumber: (props: {
|
|
902
|
+
value: number;
|
|
903
|
+
}) => JSX.Element;
|
|
913
904
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
905
|
+
declare const ThSort: (props: {
|
|
906
|
+
text: string | JSX.Element;
|
|
907
|
+
onClick: () => void;
|
|
908
|
+
align?: Alignment;
|
|
909
|
+
direction?: 'asc' | 'desc';
|
|
910
|
+
style?: React.CSSProperties;
|
|
911
|
+
width?: string;
|
|
912
|
+
rightContent?: JSX.Element;
|
|
913
|
+
}) => JSX.Element;
|
|
914
|
+
|
|
915
|
+
declare const TabLocker: (props: {
|
|
916
|
+
disabled?: boolean;
|
|
917
|
+
children?: React.ReactNode;
|
|
918
|
+
style?: React.CSSProperties;
|
|
919
|
+
}) => JSX.Element;
|
|
920
|
+
|
|
921
|
+
interface TextProps {
|
|
922
|
+
children: any;
|
|
923
|
+
/** Defaults to 'p'. */
|
|
924
|
+
tag?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
|
|
925
|
+
align?: Alignment;
|
|
926
|
+
bold?: boolean;
|
|
927
|
+
italics?: boolean;
|
|
928
|
+
className?: string;
|
|
929
|
+
/** You will need to set a width or max-width on the element for this to work. */
|
|
930
|
+
ellipsis?: boolean;
|
|
931
|
+
style?: React.CSSProperties;
|
|
932
|
+
smaller?: boolean;
|
|
933
|
+
larger?: boolean;
|
|
934
|
+
spacedOut?: boolean;
|
|
935
|
+
lineClamp?: number;
|
|
936
|
+
/** Will remove all margin/padding from specified tag */
|
|
937
|
+
noPad?: boolean;
|
|
938
|
+
leftPad?: string;
|
|
917
939
|
}
|
|
918
|
-
declare
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
940
|
+
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
941
|
+
style: React.CSSProperties;
|
|
942
|
+
className: string;
|
|
943
|
+
}, HTMLElement>;
|
|
944
|
+
|
|
945
|
+
declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
946
|
+
interface ToggleButtonProps {
|
|
947
|
+
checked: boolean;
|
|
948
|
+
checkedText: string;
|
|
949
|
+
uncheckedText: string;
|
|
950
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
951
|
+
className?: string;
|
|
952
|
+
checkedClassName?: string;
|
|
926
953
|
disabled?: boolean;
|
|
954
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
955
|
+
enforceMinWidth?: boolean;
|
|
956
|
+
checkedIcon?: JSX.Element;
|
|
957
|
+
uncheckedIcon?: JSX.Element;
|
|
958
|
+
variant?: ToggleButtonVariant;
|
|
959
|
+
checkedVariant?: ToggleButtonVariant;
|
|
960
|
+
style?: React.CSSProperties;
|
|
961
|
+
checkedStyle?: React.CSSProperties;
|
|
962
|
+
}
|
|
963
|
+
declare const ToggleButton: (props: ToggleButtonProps) => JSX.Element;
|
|
964
|
+
|
|
965
|
+
interface ToggleButtonGroupProps {
|
|
966
|
+
value: string | number;
|
|
967
|
+
options: {
|
|
968
|
+
id: string | number;
|
|
969
|
+
name: string | JSX.Element;
|
|
970
|
+
rightIcon?: JSX.Element;
|
|
971
|
+
activeClass?: string;
|
|
972
|
+
}[];
|
|
973
|
+
onChange: (value: string | number) => void;
|
|
927
974
|
className?: string;
|
|
928
|
-
|
|
929
|
-
/**
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
/** The minimum characters before 'getOptions' is called. No default. */
|
|
935
|
-
minChars?: number;
|
|
936
|
-
onChange: (value: string) => void;
|
|
937
|
-
getOptions: (value: string) => Promise<AutocompleteValue[]>;
|
|
938
|
-
onPick: (value: AutocompleteValue) => void;
|
|
939
|
-
onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
975
|
+
disabled?: boolean;
|
|
976
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
977
|
+
enforceMinWidth?: boolean;
|
|
978
|
+
round?: boolean;
|
|
979
|
+
small?: boolean;
|
|
980
|
+
width?: string;
|
|
940
981
|
}
|
|
941
|
-
declare const
|
|
982
|
+
declare const ToggleButtonGroup: (props: ToggleButtonGroupProps) => JSX.Element;
|
|
983
|
+
|
|
984
|
+
interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
|
|
985
|
+
}
|
|
986
|
+
declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
|
|
987
|
+
|
|
988
|
+
declare const WaitingIndicator: (p: {
|
|
989
|
+
show: boolean;
|
|
990
|
+
minShowTimeMs?: number;
|
|
991
|
+
id?: string;
|
|
992
|
+
debug?: boolean;
|
|
993
|
+
}) => JSX.Element;
|
|
942
994
|
|
|
943
|
-
export { Alignment, Autocomplete, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
|
|
995
|
+
export { Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
|