@mackin.com/styleguide 7.6.0 → 8.0.0-beta.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 +528 -509
- package/index.js +2768 -2533
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -3,169 +3,58 @@ 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[];
|
|
6
|
+
interface AutoCompleteItem {
|
|
7
|
+
id: string | number;
|
|
8
|
+
name: string;
|
|
62
9
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
10
|
+
declare type AutocompleteValue = string | AutoCompleteItem;
|
|
11
|
+
interface AutocompleteProps {
|
|
12
|
+
value: AutocompleteValue | undefined;
|
|
13
|
+
round?: boolean;
|
|
14
|
+
rightControl?: JSX.Element;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
inputClassName?: string;
|
|
20
|
+
/** If not set, defaults to 100 */
|
|
21
|
+
maxLength?: number;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/** Limits what will be show in the autocomplete options. Default is 7. */
|
|
24
|
+
maxShownValues?: number;
|
|
25
|
+
/** The minimum characters before 'getOptions' is called. No default. */
|
|
26
|
+
minChars?: number;
|
|
27
|
+
inputAriaAttributes?: React.AriaAttributes;
|
|
28
|
+
onChange: (value: string) => void;
|
|
29
|
+
getOptions: (value: string) => Promise<AutocompleteValue[]>;
|
|
30
|
+
onPick: (value: AutocompleteValue) => void;
|
|
31
|
+
onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
71
32
|
}
|
|
72
|
-
|
|
73
|
-
declare class ItemPager<TItem> {
|
|
74
|
-
constructor(allItems: TItem[], options?: PagerOptions<TItem>);
|
|
75
|
-
get allItems(): TItem[];
|
|
76
|
-
/** The ID of the current sort within the sortOptions. */
|
|
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
|
-
}
|
|
33
|
+
declare const Autocomplete: (p: AutocompleteProps) => JSX.Element;
|
|
128
34
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
|
|
35
|
+
/** @deprecated Use Backdrop2 going forward. */
|
|
36
|
+
declare const Backdrop$1: (props: {
|
|
37
|
+
show: boolean;
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
transparent?: boolean;
|
|
40
|
+
/** If true, the backdrop will hide on larger screens. */
|
|
41
|
+
responsive?: boolean;
|
|
42
|
+
/** If true, the backdrop will hide on smaller screens. */
|
|
43
|
+
reverseResponsive?: boolean;
|
|
44
|
+
children?: React.ReactNode;
|
|
138
45
|
className?: string;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
canGoPrevious: boolean;
|
|
145
|
-
minItem: number;
|
|
146
|
-
maxItem: number;
|
|
147
|
-
totalItems: number;
|
|
148
|
-
page: (direction: 1 | -1) => void;
|
|
149
|
-
/** For display purposes. Will show under items text if this if present. */
|
|
150
|
-
pageIndex?: number;
|
|
151
|
-
/** For display purposes. Will show under items text if this if present. */
|
|
152
|
-
totalPages?: number;
|
|
153
|
-
}
|
|
154
|
-
declare const Pager: (props: PagerProps) => JSX.Element;
|
|
46
|
+
/** If true, will not prevent scroll when shown. */
|
|
47
|
+
allowScroll?: boolean;
|
|
48
|
+
/** Fade in time. Defaults to 250ms. */
|
|
49
|
+
showTimeMs?: number;
|
|
50
|
+
}) => JSX.Element;
|
|
155
51
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
sortText?: string;
|
|
163
|
-
onLimit?: (limit: number) => void;
|
|
164
|
-
onSort?: (sort: string) => void;
|
|
165
|
-
/** Shows 'Page X of Y'. */
|
|
166
|
-
showPageText?: boolean;
|
|
167
|
-
}
|
|
168
|
-
declare const BoundMemoryPager: <T>(p: Props$1<T>) => JSX.Element;
|
|
52
|
+
declare const Backdrop: (p: {
|
|
53
|
+
children: React__default.ReactNode;
|
|
54
|
+
/** Fade in time. Defaults to 250ms. */
|
|
55
|
+
showTimeMs?: number;
|
|
56
|
+
debug?: boolean;
|
|
57
|
+
}) => JSX.Element;
|
|
169
58
|
|
|
170
59
|
declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
171
60
|
interface ButtonProps {
|
|
@@ -183,8 +72,6 @@ interface ButtonProps {
|
|
|
183
72
|
block?: boolean;
|
|
184
73
|
/** As round as can be. */
|
|
185
74
|
round?: boolean;
|
|
186
|
-
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
187
|
-
rounded?: boolean;
|
|
188
75
|
className?: string;
|
|
189
76
|
rightIcon?: JSX.Element;
|
|
190
77
|
leftIcon?: JSX.Element;
|
|
@@ -203,16 +90,42 @@ interface ButtonProps {
|
|
|
203
90
|
}
|
|
204
91
|
declare const Button: (props: ButtonProps) => JSX.Element;
|
|
205
92
|
|
|
206
|
-
interface
|
|
93
|
+
interface CalendarProps {
|
|
94
|
+
month: number;
|
|
95
|
+
year: number;
|
|
96
|
+
/** Defaults to 3rem. */
|
|
97
|
+
cellSize?: string;
|
|
98
|
+
smallHeader?: boolean;
|
|
99
|
+
id?: string;
|
|
100
|
+
/** Defaults to true. */
|
|
101
|
+
title?: boolean;
|
|
102
|
+
yearInTitle?: boolean;
|
|
103
|
+
/** Ignored if title is set to false. */
|
|
104
|
+
customTitle?: JSX.Element;
|
|
105
|
+
/** If true, will always show 6 rows / 42 cells. */
|
|
106
|
+
fixedRows?: boolean;
|
|
107
|
+
/** Bolds the current date. */
|
|
108
|
+
showCurrent?: boolean;
|
|
109
|
+
selectedValue?: number;
|
|
110
|
+
/** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
|
|
111
|
+
renderCell?: (date: Date) => JSX.Element;
|
|
112
|
+
/** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
|
|
113
|
+
isCellDisabled?: (date: Date) => boolean;
|
|
114
|
+
onClick?: (date: Date) => void;
|
|
115
|
+
/** This is the ms from Date.valueOf(). */
|
|
116
|
+
min?: number;
|
|
117
|
+
/** This is the ms from Date.valueOf(). */
|
|
118
|
+
max?: number;
|
|
119
|
+
}
|
|
120
|
+
declare const Calendar: (p: CalendarProps) => JSX.Element;
|
|
121
|
+
|
|
122
|
+
interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'checked' | 'onChange' | 'type'> {
|
|
207
123
|
checked: boolean;
|
|
208
|
-
onChange: (checked: boolean) => void;
|
|
124
|
+
onChange: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
125
|
+
readonly?: boolean;
|
|
209
126
|
label?: string;
|
|
210
|
-
children?: React.ReactNode;
|
|
211
|
-
className?: string;
|
|
212
127
|
checkedIcon?: string;
|
|
213
128
|
uncheckedIcon?: string;
|
|
214
|
-
disabled?: boolean;
|
|
215
|
-
readonly?: boolean;
|
|
216
129
|
/** Background color when checked based on the current theme. Mutually exclusive with 'checkedColor'. */
|
|
217
130
|
checkedThemeColor?: 'primary' | 'primary2' | 'secondary';
|
|
218
131
|
/** Background color when checked. Mutually exclusive with 'checkedThemeColor'. */
|
|
@@ -235,17 +148,71 @@ interface ConfirmModalProps {
|
|
|
235
148
|
}
|
|
236
149
|
declare const ConfirmModal: (props: ConfirmModalProps) => JSX.Element;
|
|
237
150
|
|
|
238
|
-
|
|
151
|
+
interface CopyButtonProps {
|
|
152
|
+
/** HTML selector of the target input to copy from. */
|
|
153
|
+
selector: string;
|
|
154
|
+
title?: string;
|
|
155
|
+
}
|
|
156
|
+
declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
|
|
239
157
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
158
|
+
interface DatePickerProps {
|
|
159
|
+
value: number | undefined;
|
|
160
|
+
/** Called with debounce when the input changes. */
|
|
161
|
+
onChange: (value: number | undefined) => void;
|
|
162
|
+
style?: React.CSSProperties;
|
|
163
|
+
/** Defaults to MM/DD/YYYY. */
|
|
164
|
+
placeholder?: string;
|
|
243
165
|
id?: string;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
166
|
+
disabled?: boolean;
|
|
167
|
+
className?: string;
|
|
168
|
+
inputClassName?: string;
|
|
169
|
+
readOnly?: boolean;
|
|
170
|
+
required?: boolean;
|
|
171
|
+
/** Defaults to 250ms */
|
|
172
|
+
debounceMs?: number;
|
|
173
|
+
round?: boolean;
|
|
174
|
+
/** This is the ms from Date.valueOf(). */
|
|
175
|
+
min?: number;
|
|
176
|
+
/** This is the ms from Date.valueOf(). */
|
|
177
|
+
max?: number;
|
|
178
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
179
|
+
reposition?: boolean;
|
|
180
|
+
}
|
|
181
|
+
declare const DatePicker: (p: DatePickerProps) => JSX.Element;
|
|
182
|
+
|
|
183
|
+
declare const Divider: () => JSX.Element;
|
|
184
|
+
|
|
185
|
+
declare const ErrorModal: (props: {
|
|
186
|
+
message: string;
|
|
187
|
+
show: boolean;
|
|
188
|
+
id?: string;
|
|
189
|
+
debug?: boolean;
|
|
190
|
+
close: () => void;
|
|
191
|
+
}) => JSX.Element;
|
|
192
|
+
|
|
193
|
+
interface FileUploaderProps {
|
|
194
|
+
onUpload: (files: FileList) => Promise<void>;
|
|
195
|
+
/** Defaults to 'Upload'. */
|
|
196
|
+
buttonText?: string;
|
|
197
|
+
/** Defauts to 'Upload successful'. */
|
|
198
|
+
successMessage?: string | JSX.Element;
|
|
199
|
+
/** Defaults to 'Upload failed.' */
|
|
200
|
+
failureMessage?: string | JSX.Element;
|
|
201
|
+
/** Defaults to 10rem. */
|
|
202
|
+
buttonWidth?: string;
|
|
203
|
+
/** Defaults to 'primary'. */
|
|
204
|
+
buttonVariant?: ButtonVariant;
|
|
205
|
+
maxBytes?: number;
|
|
206
|
+
multiple?: boolean;
|
|
207
|
+
accept?: string;
|
|
208
|
+
/** Defaults to 'Click or drag and drop files.'*/
|
|
209
|
+
instructionMessage?: string;
|
|
210
|
+
/** For additional info below the instructionMessage. */
|
|
211
|
+
infoMessage?: string | JSX.Element;
|
|
212
|
+
}
|
|
213
|
+
declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
|
|
214
|
+
|
|
215
|
+
declare type FormProps = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
|
|
249
216
|
interface IProps extends FormProps {
|
|
250
217
|
inline?: boolean;
|
|
251
218
|
/** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
|
|
@@ -333,6 +300,24 @@ interface InfoTipProps {
|
|
|
333
300
|
}
|
|
334
301
|
declare const InfoTip: (props: InfoTipProps) => JSX.Element;
|
|
335
302
|
|
|
303
|
+
interface BaseInputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
304
|
+
rightControl?: JSX.Element;
|
|
305
|
+
round?: boolean;
|
|
306
|
+
/** The class applied to the wrapping element without this component. Use 'className' to style the input directly. */
|
|
307
|
+
wrapperClassName?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
interface DateInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step' | 'pattern' | 'maxLength'> {
|
|
311
|
+
/** The epoch timestamp. Equivalent to Date.valueOf(). */
|
|
312
|
+
value: number | undefined;
|
|
313
|
+
/** The min epoch timestamp. */
|
|
314
|
+
min?: number;
|
|
315
|
+
/** The max epoch timestamp. */
|
|
316
|
+
max?: number;
|
|
317
|
+
onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
318
|
+
}
|
|
319
|
+
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>>;
|
|
320
|
+
|
|
336
321
|
declare type InputValue = string | number | undefined;
|
|
337
322
|
declare type InputType = 'text' | 'number' | 'textarea' | 'date' | 'password' | 'url' | 'email';
|
|
338
323
|
interface InputProps {
|
|
@@ -340,7 +325,6 @@ interface InputProps {
|
|
|
340
325
|
name?: string;
|
|
341
326
|
style?: React.CSSProperties;
|
|
342
327
|
value?: InputValue;
|
|
343
|
-
rounded?: boolean;
|
|
344
328
|
placeholder?: string;
|
|
345
329
|
id?: string;
|
|
346
330
|
disabled?: boolean;
|
|
@@ -353,8 +337,9 @@ interface InputProps {
|
|
|
353
337
|
/** Defaults to 'off'. */
|
|
354
338
|
autoComplete?: string;
|
|
355
339
|
autoFocus?: boolean;
|
|
340
|
+
inputAriaAttributes?: React.AriaAttributes;
|
|
356
341
|
/** Called with debounce when the input changes. */
|
|
357
|
-
onChange?: (value: InputValue, name?: string) => void;
|
|
342
|
+
onChange?: (value: InputValue, name?: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
358
343
|
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
359
344
|
onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
360
345
|
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
@@ -374,8 +359,32 @@ interface InputProps {
|
|
|
374
359
|
rows?: number;
|
|
375
360
|
pattern?: string;
|
|
376
361
|
}
|
|
362
|
+
/** @deprecated Use DateInput, NumberInput, or TextInput instead. */
|
|
377
363
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<any>>;
|
|
378
364
|
|
|
365
|
+
interface NumberInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
366
|
+
value: number | undefined;
|
|
367
|
+
min?: number;
|
|
368
|
+
max?: number;
|
|
369
|
+
step?: number;
|
|
370
|
+
onChange: (value: number | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
371
|
+
}
|
|
372
|
+
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>>;
|
|
373
|
+
|
|
374
|
+
interface TextAreaProps extends Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value' | 'onChange'> {
|
|
375
|
+
value: string | undefined;
|
|
376
|
+
onChange: (value: string | undefined, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
377
|
+
}
|
|
378
|
+
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>>;
|
|
379
|
+
|
|
380
|
+
interface TextInputProps extends Omit<BaseInputProps, 'type' | 'value' | 'onChange' | 'min' | 'max' | 'step'> {
|
|
381
|
+
value: string | undefined;
|
|
382
|
+
/** Defaults to 'text'. */
|
|
383
|
+
type?: 'text' | 'email' | 'url' | 'password';
|
|
384
|
+
onChange: (value: string | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
385
|
+
}
|
|
386
|
+
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>>;
|
|
387
|
+
|
|
379
388
|
interface LabelProps {
|
|
380
389
|
text: string | JSX.Element;
|
|
381
390
|
children: React.ReactNode;
|
|
@@ -445,6 +454,7 @@ interface OmniLinkProps {
|
|
|
445
454
|
children: React.ReactNode;
|
|
446
455
|
onClick?: (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
|
|
447
456
|
className?: string;
|
|
457
|
+
style?: React.CSSProperties;
|
|
448
458
|
noRouter?: boolean;
|
|
449
459
|
/** Ignored if 'noRouter' is false */
|
|
450
460
|
target?: string;
|
|
@@ -458,8 +468,6 @@ interface OmniLinkProps {
|
|
|
458
468
|
title?: string;
|
|
459
469
|
/** Only for button variants. */
|
|
460
470
|
round?: boolean;
|
|
461
|
-
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. Only for button variants. */
|
|
462
|
-
rounded?: boolean;
|
|
463
471
|
/** Only for button variants. */
|
|
464
472
|
small?: boolean;
|
|
465
473
|
/** Overrides the default color (theme.colors.link) for non-button variants. To be used under exceptional circumstances. To change all link colors, override theme.colors.link directly. */
|
|
@@ -467,196 +475,240 @@ interface OmniLinkProps {
|
|
|
467
475
|
}
|
|
468
476
|
declare const OmniLink: (props: OmniLinkProps) => JSX.Element;
|
|
469
477
|
|
|
470
|
-
declare type
|
|
471
|
-
interface
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
id: T;
|
|
476
|
-
name?: string;
|
|
477
|
-
})[];
|
|
478
|
-
onChange: (value: T) => void;
|
|
479
|
-
id?: string;
|
|
480
|
-
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
481
|
-
rounded?: boolean;
|
|
482
|
-
disabled?: boolean;
|
|
483
|
-
className?: string;
|
|
484
|
-
readonly?: boolean;
|
|
478
|
+
declare type SortDirection = 'asc' | 'desc';
|
|
479
|
+
interface PagerSortOption<TItem> {
|
|
480
|
+
id: string;
|
|
481
|
+
name?: string;
|
|
482
|
+
sort: (items: TItem[]) => TItem[];
|
|
485
483
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
484
|
+
interface PagerOptions<TItem> {
|
|
485
|
+
/** Defaults to 10. */
|
|
486
|
+
limit?: number;
|
|
487
|
+
/** Defaults to [10] */
|
|
488
|
+
limitOptions?: number[];
|
|
489
|
+
sort?: string;
|
|
490
|
+
sortOptions?: PagerSortOption<TItem>[];
|
|
491
|
+
previous?: ItemPager<TItem>;
|
|
493
492
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
493
|
+
/** For in-memory paging. */
|
|
494
|
+
declare class ItemPager<TItem> {
|
|
495
|
+
constructor(allItems: TItem[], options?: PagerOptions<TItem>);
|
|
496
|
+
get allItems(): TItem[];
|
|
497
|
+
/** The ID of the current sort within the sortOptions. */
|
|
498
|
+
get sort(): string | undefined;
|
|
499
|
+
set sort(sortId: string | undefined);
|
|
500
|
+
/** The direction of the current sort when using an option created from addToggleSortOption */
|
|
501
|
+
get sortDirection(): SortDirection | undefined;
|
|
502
|
+
get sortOptions(): PagerSortOption<TItem>[];
|
|
503
|
+
get limit(): number;
|
|
504
|
+
set limit(value: number);
|
|
505
|
+
get limitOptions(): number[];
|
|
506
|
+
get totalPages(): number;
|
|
507
|
+
/** The zero-based page index. */
|
|
508
|
+
get page(): number;
|
|
509
|
+
/** The zero-based page index. */
|
|
510
|
+
set page(value: number);
|
|
511
|
+
get pageItems(): TItem[];
|
|
512
|
+
get totalItems(): number;
|
|
513
|
+
get minItemIndex(): number;
|
|
514
|
+
get maxItemIndex(): number;
|
|
515
|
+
get hasNext(): boolean;
|
|
516
|
+
get hasPrevious(): boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Adds both asc and des sort options
|
|
519
|
+
*
|
|
520
|
+
* @param propPath Prop name or path ('resource.title').
|
|
521
|
+
* @param name Name to display or asc Name and desc Name.
|
|
522
|
+
*/
|
|
523
|
+
addToggleSortOption(propPath: string, name?: string | [string, string]): void;
|
|
524
|
+
/**
|
|
525
|
+
* Toggles between asc and desc.
|
|
526
|
+
* @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
|
|
527
|
+
*/
|
|
528
|
+
toggleSort(sortId: string): void;
|
|
529
|
+
applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
530
|
+
next(): void;
|
|
531
|
+
previous(): void;
|
|
532
|
+
pageByOffset(direction: 1 | -1): void;
|
|
533
|
+
/** Adds the item optionally keeping the current page. */
|
|
534
|
+
add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
|
|
535
|
+
/** Removes the matched item(s). */
|
|
536
|
+
remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
537
|
+
replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
|
|
538
|
+
private _allItems;
|
|
539
|
+
private _page;
|
|
540
|
+
private _limit;
|
|
541
|
+
private _limitOptions;
|
|
542
|
+
private _pageResult;
|
|
543
|
+
private _filteredItems;
|
|
544
|
+
private _sort;
|
|
545
|
+
private _sortOptions;
|
|
546
|
+
private _currentFilter;
|
|
547
|
+
private createPageResult;
|
|
548
|
+
}
|
|
500
549
|
|
|
501
|
-
interface
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
rounded?: boolean;
|
|
550
|
+
interface PagerStyleProps {
|
|
551
|
+
/** Used for localizations. Defaults to 'of' */
|
|
552
|
+
itemDividerText?: string;
|
|
553
|
+
/** Used for localizations. Defaults to 'No Results' */
|
|
554
|
+
noResultsText?: string;
|
|
555
|
+
/** Used for localizations. Defaults to 'Page' */
|
|
556
|
+
pageText?: string;
|
|
509
557
|
className?: string;
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
debounceMs?: number;
|
|
558
|
+
leftControls?: JSX.Element;
|
|
559
|
+
rightControls?: JSX.Element;
|
|
513
560
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
ellipsis?: boolean;
|
|
526
|
-
style?: React.CSSProperties;
|
|
527
|
-
smaller?: boolean;
|
|
528
|
-
larger?: boolean;
|
|
529
|
-
spacedOut?: boolean;
|
|
530
|
-
lineClamp?: number;
|
|
531
|
-
/** Will remove all margin/padding from specified tag */
|
|
532
|
-
noPad?: boolean;
|
|
533
|
-
leftPad?: string;
|
|
561
|
+
interface PagerProps extends PagerStyleProps {
|
|
562
|
+
canGoNext: boolean;
|
|
563
|
+
canGoPrevious: boolean;
|
|
564
|
+
minItem: number;
|
|
565
|
+
maxItem: number;
|
|
566
|
+
totalItems: number;
|
|
567
|
+
page: (direction: 1 | -1) => void;
|
|
568
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
569
|
+
pageIndex?: number;
|
|
570
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
571
|
+
totalPages?: number;
|
|
534
572
|
}
|
|
535
|
-
declare const
|
|
536
|
-
style: React.CSSProperties;
|
|
537
|
-
className: string;
|
|
538
|
-
}, HTMLElement>;
|
|
573
|
+
declare const Pager: (props: PagerProps) => JSX.Element;
|
|
539
574
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
|
|
551
|
-
checkedIcon?: JSX.Element;
|
|
552
|
-
uncheckedIcon?: JSX.Element;
|
|
553
|
-
variant?: ToggleButtonVariant;
|
|
554
|
-
checkedVariant?: ToggleButtonVariant;
|
|
555
|
-
style?: React.CSSProperties;
|
|
556
|
-
checkedStyle?: React.CSSProperties;
|
|
575
|
+
interface Props$1<T> extends PagerStyleProps {
|
|
576
|
+
pager: ItemPager<T>;
|
|
577
|
+
onPage: (direction: 1 | -1) => void;
|
|
578
|
+
/** Defaults to 'Limit' */
|
|
579
|
+
limitText?: string;
|
|
580
|
+
/** Defaults to 'Sort' */
|
|
581
|
+
sortText?: string;
|
|
582
|
+
onLimit?: (limit: number) => void;
|
|
583
|
+
onSort?: (sort: string) => void;
|
|
584
|
+
/** Shows 'Page X of Y'. */
|
|
585
|
+
showPageText?: boolean;
|
|
557
586
|
}
|
|
558
|
-
declare const
|
|
587
|
+
declare const BoundMemoryPager: <T>(p: Props$1<T>) => JSX.Element;
|
|
559
588
|
|
|
560
|
-
interface
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
589
|
+
interface Props<T> extends PagerStyleProps {
|
|
590
|
+
result: PagedResult<T>;
|
|
591
|
+
onPage: (direction: 1 | -1) => void;
|
|
592
|
+
limitOptions?: number[];
|
|
593
|
+
sort?: string | number;
|
|
594
|
+
sortOptions?: {
|
|
595
|
+
id: string | number;
|
|
596
|
+
name?: string;
|
|
597
|
+
}[];
|
|
598
|
+
/** Defaults to 'Limit' */
|
|
599
|
+
limitText?: string;
|
|
600
|
+
/** Defaults to 'Sort' */
|
|
601
|
+
sortText?: string;
|
|
602
|
+
onLimit?: (limit: number) => void;
|
|
603
|
+
onSort?: (sort: string | number) => void;
|
|
604
|
+
/** Shows 'Page X of Y'. */
|
|
605
|
+
showPageText?: boolean;
|
|
576
606
|
}
|
|
577
|
-
declare const
|
|
607
|
+
declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
|
|
578
608
|
|
|
579
|
-
declare
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
609
|
+
declare class PagedResult<T> {
|
|
610
|
+
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
611
|
+
static fromDto<T>(dto: {
|
|
612
|
+
[key: string]: any;
|
|
613
|
+
}): PagedResult<T>;
|
|
614
|
+
total: number;
|
|
615
|
+
/** The zero-based page index. */
|
|
616
|
+
page: number;
|
|
617
|
+
limit: number;
|
|
618
|
+
items: T[];
|
|
619
|
+
/** Helper for items.length */
|
|
620
|
+
get length(): number;
|
|
621
|
+
get hasItems(): boolean;
|
|
622
|
+
get previousPage(): number;
|
|
623
|
+
get hasPrevious(): boolean;
|
|
624
|
+
get nextPage(): number;
|
|
625
|
+
get hasNext(): boolean;
|
|
626
|
+
get lastPage(): number;
|
|
627
|
+
get totalPages(): number;
|
|
628
|
+
get minPageItemIndex(): number;
|
|
629
|
+
get maxPageItemIndex(): number;
|
|
630
|
+
/** Returns the first item on the current page. */
|
|
631
|
+
get firstPageItem(): T;
|
|
632
|
+
/** Returns the last item on the current page */
|
|
633
|
+
get lastPageItem(): T;
|
|
634
|
+
getPageRelativeItemIndex(item: T): number;
|
|
635
|
+
getResultRelativeItemIndex(item: T): number | undefined;
|
|
636
|
+
getPreviousItem(fromItem: T): T | undefined;
|
|
637
|
+
getNextItem(fromItem: T): T | undefined;
|
|
638
|
+
getPagingRange(radius: number): number[];
|
|
639
|
+
toJSON(): {
|
|
640
|
+
[key: string]: any;
|
|
641
|
+
};
|
|
642
|
+
clone(newItems?: T[]): PagedResult<T>;
|
|
643
|
+
}
|
|
585
644
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
year: number;
|
|
589
|
-
/** Defaults to 3rem. */
|
|
590
|
-
cellSize?: string;
|
|
591
|
-
smallHeader?: boolean;
|
|
592
|
-
id?: string;
|
|
593
|
-
/** Defaults to true. */
|
|
594
|
-
title?: boolean;
|
|
595
|
-
yearInTitle?: boolean;
|
|
596
|
-
/** Ignored if title is set to false. */
|
|
597
|
-
customTitle?: JSX.Element;
|
|
598
|
-
/** If true, will always show 6 rows / 42 cells. */
|
|
599
|
-
fixedRows?: boolean;
|
|
600
|
-
/** Bolds the current date. */
|
|
601
|
-
showCurrent?: boolean;
|
|
602
|
-
selectedValue?: number;
|
|
603
|
-
/** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
|
|
604
|
-
renderCell?: (date: Date) => JSX.Element;
|
|
605
|
-
/** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
|
|
606
|
-
isCellDisabled?: (date: Date) => boolean;
|
|
607
|
-
onClick?: (date: Date) => void;
|
|
608
|
-
/** This is the ms from Date.valueOf(). */
|
|
609
|
-
min?: number;
|
|
610
|
-
/** This is the ms from Date.valueOf(). */
|
|
611
|
-
max?: number;
|
|
645
|
+
declare type PickerValue = string | number;
|
|
646
|
+
interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options' | 'onChange'> {
|
|
612
647
|
}
|
|
613
|
-
|
|
648
|
+
interface PickerProps<T extends PickerValue> extends SelectProps {
|
|
649
|
+
value: T;
|
|
650
|
+
options: (T | {
|
|
651
|
+
id: T;
|
|
652
|
+
name?: string;
|
|
653
|
+
})[];
|
|
654
|
+
onChange: (value: T, event: React.ChangeEvent<HTMLSelectElement>) => void;
|
|
655
|
+
readonly?: boolean;
|
|
656
|
+
}
|
|
657
|
+
declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element;
|
|
614
658
|
|
|
615
|
-
interface
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
placeholder?: string;
|
|
659
|
+
interface PopoverProps {
|
|
660
|
+
isOpen: boolean;
|
|
661
|
+
/** The content inside the popover. */
|
|
662
|
+
content: JSX.Element;
|
|
663
|
+
/** The element controlling the state of the popover. */
|
|
664
|
+
parent: JSX.Element;
|
|
622
665
|
id?: string;
|
|
623
|
-
disabled?: boolean;
|
|
624
|
-
className?: string;
|
|
625
|
-
inputClassName?: string;
|
|
626
|
-
readOnly?: boolean;
|
|
627
|
-
required?: boolean;
|
|
628
|
-
/** Defaults to 250ms */
|
|
629
|
-
debounceMs?: number;
|
|
630
|
-
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
631
|
-
rounded?: boolean;
|
|
632
|
-
round?: boolean;
|
|
633
|
-
/** This is the ms from Date.valueOf(). */
|
|
634
|
-
min?: number;
|
|
635
|
-
/** This is the ms from Date.valueOf(). */
|
|
636
|
-
max?: number;
|
|
637
666
|
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
638
667
|
reposition?: boolean;
|
|
668
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
669
|
+
/** Popover arrow color. Defaults to theme.colors.border. */
|
|
670
|
+
arrorColor?: string;
|
|
671
|
+
/** Popover border. Defaults to theme.controls.border. */
|
|
672
|
+
border?: string;
|
|
673
|
+
/** Popover background. Defaults to theme.colors.bg. */
|
|
674
|
+
backgroundColor?: string;
|
|
675
|
+
/** Order of positions as the Popover colides with the window edge. */
|
|
676
|
+
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
639
677
|
}
|
|
640
|
-
declare const
|
|
678
|
+
declare const Popover: (p: PopoverProps) => JSX.Element;
|
|
641
679
|
|
|
642
|
-
interface
|
|
643
|
-
|
|
680
|
+
interface ProgressBarProps {
|
|
681
|
+
pct: number;
|
|
682
|
+
round?: boolean;
|
|
683
|
+
showPct?: boolean;
|
|
684
|
+
className?: string;
|
|
644
685
|
}
|
|
645
|
-
|
|
646
|
-
|
|
686
|
+
declare const ProgressBar: (props: {
|
|
687
|
+
pct: number;
|
|
688
|
+
round?: boolean;
|
|
689
|
+
showPct?: boolean;
|
|
690
|
+
className?: string;
|
|
691
|
+
}) => JSX.Element;
|
|
692
|
+
|
|
693
|
+
interface SearchBoxProps {
|
|
694
|
+
value: string | undefined;
|
|
695
|
+
onChange: (value: string | undefined | number) => void;
|
|
647
696
|
id?: string;
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
variant?: 'tab' | 'button';
|
|
697
|
+
placeholder?: string;
|
|
698
|
+
round?: boolean;
|
|
699
|
+
className?: string;
|
|
700
|
+
onSubmit?: () => Promise<void>;
|
|
701
|
+
/** Defaults to 250ms */
|
|
702
|
+
debounceMs?: number;
|
|
655
703
|
}
|
|
656
|
-
declare const
|
|
704
|
+
declare const SearchBox: (props: SearchBoxProps) => JSX.Element;
|
|
705
|
+
|
|
706
|
+
declare type Alignment = 'left' | 'right' | 'center';
|
|
657
707
|
|
|
658
708
|
declare const GlobalStyles: () => null;
|
|
659
709
|
|
|
710
|
+
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
711
|
+
|
|
660
712
|
interface MackinTheme {
|
|
661
713
|
colors: {
|
|
662
714
|
primary: string;
|
|
@@ -720,8 +772,6 @@ interface MackinTheme {
|
|
|
720
772
|
focusOutlineShadow: string;
|
|
721
773
|
focusOutlineRequiredShadow: string;
|
|
722
774
|
roundRadius: string;
|
|
723
|
-
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
724
|
-
roundedRadius: string;
|
|
725
775
|
disabledOpacity: string;
|
|
726
776
|
formButtonMinWidth: string;
|
|
727
777
|
gap: string;
|
|
@@ -751,129 +801,15 @@ interface MackinTheme {
|
|
|
751
801
|
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
|
752
802
|
declare const defaultTheme: MackinTheme;
|
|
753
803
|
|
|
754
|
-
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
755
|
-
declare const useThemeSafely: () => MackinTheme;
|
|
756
|
-
|
|
757
804
|
declare const ThemeProvider: <T extends MackinTheme>(p: {
|
|
758
805
|
children?: ReactNode;
|
|
759
806
|
theme: T;
|
|
760
807
|
}) => JSX.Element;
|
|
761
808
|
|
|
762
|
-
declare const
|
|
763
|
-
disabled?: boolean;
|
|
764
|
-
children?: React.ReactNode;
|
|
765
|
-
style?: React.CSSProperties;
|
|
766
|
-
}) => JSX.Element;
|
|
767
|
-
|
|
768
|
-
interface FileUploaderProps {
|
|
769
|
-
onUpload: (files: FileList) => Promise<void>;
|
|
770
|
-
/** Defaults to 'Upload'. */
|
|
771
|
-
buttonText?: string;
|
|
772
|
-
/** Defauts to 'Upload successful'. */
|
|
773
|
-
successMessage?: string | JSX.Element;
|
|
774
|
-
/** Defaults to 'Upload failed.' */
|
|
775
|
-
failureMessage?: string | JSX.Element;
|
|
776
|
-
/** Defaults to 10rem. */
|
|
777
|
-
buttonWidth?: string;
|
|
778
|
-
/** Defaults to 'primary'. */
|
|
779
|
-
buttonVariant?: ButtonVariant;
|
|
780
|
-
maxBytes?: number;
|
|
781
|
-
multiple?: boolean;
|
|
782
|
-
accept?: string;
|
|
783
|
-
/** Defaults to 'Click or drag and drop files.'*/
|
|
784
|
-
instructionMessage?: string;
|
|
785
|
-
/** For additional info below the instructionMessage. */
|
|
786
|
-
infoMessage?: string | JSX.Element;
|
|
787
|
-
}
|
|
788
|
-
declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
|
|
789
|
-
|
|
790
|
-
interface CopyButtonProps {
|
|
791
|
-
/** HTML selector of the target input to copy from. */
|
|
792
|
-
selector: string;
|
|
793
|
-
title?: string;
|
|
794
|
-
}
|
|
795
|
-
declare const CopyButton: (props: CopyButtonProps) => JSX.Element;
|
|
796
|
-
|
|
797
|
-
interface PopoverProps {
|
|
798
|
-
isOpen: boolean;
|
|
799
|
-
/** The content inside the popover. */
|
|
800
|
-
content: JSX.Element;
|
|
801
|
-
/** The element controlling the state of the popover. */
|
|
802
|
-
parent: JSX.Element;
|
|
803
|
-
id?: string;
|
|
804
|
-
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
805
|
-
reposition?: boolean;
|
|
806
|
-
onClickOutside?: (e: MouseEvent) => void;
|
|
807
|
-
/** Popover arrow color. Defaults to theme.colors.border. */
|
|
808
|
-
arrorColor?: string;
|
|
809
|
-
/** Popover border. Defaults to theme.controls.border. */
|
|
810
|
-
border?: string;
|
|
811
|
-
/** Popover background. Defaults to theme.colors.bg. */
|
|
812
|
-
backgroundColor?: string;
|
|
813
|
-
/** Order of positions as the Popover colides with the window edge. */
|
|
814
|
-
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
815
|
-
}
|
|
816
|
-
declare const Popover: (p: PopoverProps) => JSX.Element;
|
|
817
|
-
|
|
818
|
-
interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
|
|
819
|
-
}
|
|
820
|
-
declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
|
|
821
|
-
|
|
822
|
-
declare class PagedResult<T> {
|
|
823
|
-
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
824
|
-
static fromDto<T>(dto: {
|
|
825
|
-
[key: string]: any;
|
|
826
|
-
}): PagedResult<T>;
|
|
827
|
-
total: number;
|
|
828
|
-
/** The zero-based page index. */
|
|
829
|
-
page: number;
|
|
830
|
-
limit: number;
|
|
831
|
-
items: T[];
|
|
832
|
-
/** Helper for items.length */
|
|
833
|
-
get length(): number;
|
|
834
|
-
get hasItems(): boolean;
|
|
835
|
-
get previousPage(): number;
|
|
836
|
-
get hasPrevious(): boolean;
|
|
837
|
-
get nextPage(): number;
|
|
838
|
-
get hasNext(): boolean;
|
|
839
|
-
get lastPage(): number;
|
|
840
|
-
get totalPages(): number;
|
|
841
|
-
get minPageItemIndex(): number;
|
|
842
|
-
get maxPageItemIndex(): number;
|
|
843
|
-
/** Returns the first item on the current page. */
|
|
844
|
-
get firstPageItem(): T;
|
|
845
|
-
/** Returns the last item on the current page */
|
|
846
|
-
get lastPageItem(): T;
|
|
847
|
-
getPageRelativeItemIndex(item: T): number;
|
|
848
|
-
getResultRelativeItemIndex(item: T): number | undefined;
|
|
849
|
-
getPreviousItem(fromItem: T): T | undefined;
|
|
850
|
-
getNextItem(fromItem: T): T | undefined;
|
|
851
|
-
getPagingRange(radius: number): number[];
|
|
852
|
-
toJSON(): {
|
|
853
|
-
[key: string]: any;
|
|
854
|
-
};
|
|
855
|
-
clone(newItems?: T[]): PagedResult<T>;
|
|
856
|
-
}
|
|
809
|
+
declare const useMediaQuery: (query: string) => boolean;
|
|
857
810
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
onPage: (direction: 1 | -1) => void;
|
|
861
|
-
limitOptions?: number[];
|
|
862
|
-
sort?: string | number;
|
|
863
|
-
sortOptions?: {
|
|
864
|
-
id: string | number;
|
|
865
|
-
name?: string;
|
|
866
|
-
}[];
|
|
867
|
-
/** Defaults to 'Limit' */
|
|
868
|
-
limitText?: string;
|
|
869
|
-
/** Defaults to 'Sort' */
|
|
870
|
-
sortText?: string;
|
|
871
|
-
onLimit?: (limit: number) => void;
|
|
872
|
-
onSort?: (sort: string | number) => void;
|
|
873
|
-
/** Shows 'Page X of Y'. */
|
|
874
|
-
showPageText?: boolean;
|
|
875
|
-
}
|
|
876
|
-
declare const BoundStaticPager: <T>(p: Props<T>) => JSX.Element;
|
|
811
|
+
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
812
|
+
declare const useThemeSafely: () => MackinTheme;
|
|
877
813
|
|
|
878
814
|
declare type SliderValue = number | [number, number];
|
|
879
815
|
interface SliderProps<T extends SliderValue> {
|
|
@@ -894,60 +830,143 @@ interface SliderProps<T extends SliderValue> {
|
|
|
894
830
|
}
|
|
895
831
|
declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => JSX.Element;
|
|
896
832
|
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
833
|
+
interface TabHeaderTabProps {
|
|
834
|
+
name: string;
|
|
835
|
+
}
|
|
836
|
+
interface TabHeaderProps {
|
|
837
|
+
tabs: TabHeaderTabProps[];
|
|
838
|
+
id?: string;
|
|
839
|
+
/** Defaults to 10rem. */
|
|
840
|
+
maxTabWidth?: string;
|
|
841
|
+
onTabChanged?: (tabIndex: number) => void;
|
|
842
|
+
/** Defaults to 'tab'. */
|
|
843
|
+
variant?: 'tab' | 'button';
|
|
844
|
+
}
|
|
845
|
+
declare const TabHeader: (p: TabHeaderProps) => JSX.Element;
|
|
846
|
+
|
|
847
|
+
declare const Table: (props: {
|
|
848
|
+
caption?: string | JSX.Element;
|
|
849
|
+
children?: any;
|
|
850
|
+
noCellBorder?: boolean;
|
|
907
851
|
className?: string;
|
|
908
|
-
/**
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
852
|
+
/** Colors alternate rows. */
|
|
853
|
+
altRows?: boolean;
|
|
854
|
+
}) => JSX.Element;
|
|
855
|
+
declare const Tr: (props: {
|
|
856
|
+
className?: string;
|
|
857
|
+
children?: any;
|
|
858
|
+
}) => JSX.Element;
|
|
859
|
+
declare const Th: (props: {
|
|
860
|
+
children?: any;
|
|
861
|
+
align?: Alignment;
|
|
862
|
+
width?: string;
|
|
863
|
+
style?: React.CSSProperties;
|
|
864
|
+
className?: string;
|
|
865
|
+
}) => JSX.Element;
|
|
866
|
+
declare const Td: (props: {
|
|
867
|
+
children?: any;
|
|
868
|
+
align?: Alignment;
|
|
869
|
+
style?: React.CSSProperties;
|
|
870
|
+
colSpan?: number;
|
|
912
871
|
}) => JSX.Element;
|
|
913
872
|
|
|
914
|
-
declare const
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
showTimeMs?: number;
|
|
918
|
-
debug?: boolean;
|
|
873
|
+
declare const TdCurrency: (props: {
|
|
874
|
+
value: number;
|
|
875
|
+
cents?: boolean;
|
|
919
876
|
}) => JSX.Element;
|
|
920
877
|
|
|
921
|
-
declare const
|
|
878
|
+
declare const TdNumber: (props: {
|
|
879
|
+
value: number;
|
|
880
|
+
}) => JSX.Element;
|
|
922
881
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
882
|
+
declare const ThSort: (props: {
|
|
883
|
+
text: string | JSX.Element;
|
|
884
|
+
onClick: () => void;
|
|
885
|
+
align?: Alignment;
|
|
886
|
+
direction?: 'asc' | 'desc';
|
|
887
|
+
style?: React.CSSProperties;
|
|
888
|
+
width?: string;
|
|
889
|
+
rightContent?: JSX.Element;
|
|
890
|
+
}) => JSX.Element;
|
|
891
|
+
|
|
892
|
+
declare const TabLocker: (props: {
|
|
893
|
+
disabled?: boolean;
|
|
894
|
+
children?: React.ReactNode;
|
|
895
|
+
style?: React.CSSProperties;
|
|
896
|
+
}) => JSX.Element;
|
|
897
|
+
|
|
898
|
+
interface TextProps {
|
|
899
|
+
children: any;
|
|
900
|
+
/** Defaults to 'p'. */
|
|
901
|
+
tag?: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
|
|
902
|
+
align?: Alignment;
|
|
903
|
+
bold?: boolean;
|
|
904
|
+
italics?: boolean;
|
|
905
|
+
className?: string;
|
|
906
|
+
/** You will need to set a width or max-width on the element for this to work. */
|
|
907
|
+
ellipsis?: boolean;
|
|
908
|
+
style?: React.CSSProperties;
|
|
909
|
+
smaller?: boolean;
|
|
910
|
+
larger?: boolean;
|
|
911
|
+
spacedOut?: boolean;
|
|
912
|
+
lineClamp?: number;
|
|
913
|
+
/** Will remove all margin/padding from specified tag */
|
|
914
|
+
noPad?: boolean;
|
|
915
|
+
leftPad?: string;
|
|
926
916
|
}
|
|
927
|
-
declare
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
917
|
+
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
918
|
+
style: React.CSSProperties;
|
|
919
|
+
className: string;
|
|
920
|
+
}, HTMLElement>;
|
|
921
|
+
|
|
922
|
+
declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
923
|
+
interface ToggleButtonProps {
|
|
924
|
+
checked: boolean;
|
|
925
|
+
checkedText: string;
|
|
926
|
+
uncheckedText: string;
|
|
927
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
928
|
+
className?: string;
|
|
929
|
+
checkedClassName?: string;
|
|
936
930
|
disabled?: boolean;
|
|
931
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
932
|
+
enforceMinWidth?: boolean;
|
|
933
|
+
checkedIcon?: JSX.Element;
|
|
934
|
+
uncheckedIcon?: JSX.Element;
|
|
935
|
+
variant?: ToggleButtonVariant;
|
|
936
|
+
checkedVariant?: ToggleButtonVariant;
|
|
937
|
+
style?: React.CSSProperties;
|
|
938
|
+
checkedStyle?: React.CSSProperties;
|
|
939
|
+
}
|
|
940
|
+
declare const ToggleButton: (props: ToggleButtonProps) => JSX.Element;
|
|
941
|
+
|
|
942
|
+
interface ToggleButtonGroupProps {
|
|
943
|
+
value: string | number;
|
|
944
|
+
options: {
|
|
945
|
+
id: string | number;
|
|
946
|
+
name: string | JSX.Element;
|
|
947
|
+
rightIcon?: JSX.Element;
|
|
948
|
+
activeClass?: string;
|
|
949
|
+
}[];
|
|
950
|
+
onChange: (value: string | number) => void;
|
|
937
951
|
className?: string;
|
|
938
|
-
|
|
939
|
-
/**
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
/** The minimum characters before 'getOptions' is called. No default. */
|
|
945
|
-
minChars?: number;
|
|
946
|
-
onChange: (value: string) => void;
|
|
947
|
-
getOptions: (value: string) => Promise<AutocompleteValue[]>;
|
|
948
|
-
onPick: (value: AutocompleteValue) => void;
|
|
949
|
-
onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
952
|
+
disabled?: boolean;
|
|
953
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
954
|
+
enforceMinWidth?: boolean;
|
|
955
|
+
round?: boolean;
|
|
956
|
+
small?: boolean;
|
|
957
|
+
width?: string;
|
|
950
958
|
}
|
|
951
|
-
declare const
|
|
959
|
+
declare const ToggleButtonGroup: (props: ToggleButtonGroupProps) => JSX.Element;
|
|
960
|
+
|
|
961
|
+
interface TogglePasswordInputProps extends Omit<InputProps, 'type' | 'rightControl'> {
|
|
962
|
+
}
|
|
963
|
+
declare const TogglePasswordInput: (p: TogglePasswordInputProps) => JSX.Element;
|
|
964
|
+
|
|
965
|
+
declare const WaitingIndicator: (p: {
|
|
966
|
+
show: boolean;
|
|
967
|
+
minShowTimeMs?: number;
|
|
968
|
+
id?: string;
|
|
969
|
+
debug?: boolean;
|
|
970
|
+
}) => JSX.Element;
|
|
952
971
|
|
|
953
|
-
export { Alignment, Autocomplete, AutocompleteValue, 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,
|
|
972
|
+
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, useMediaQuery, useThemeSafely };
|