@mackin.com/styleguide 9.12.0 → 10.0.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 +1109 -1125
- package/index.esm.js +3829 -3847
- package/index.js +3833 -3860
- package/package.json +10 -10
package/index.d.ts
CHANGED
|
@@ -1,1174 +1,1158 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import React__default, { ReactNode } from 'react';
|
|
4
3
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
interface AccordianProps {
|
|
8
|
-
header: JSX.Element | string;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
variant?: HeaderVariant;
|
|
11
|
-
/** Defaults to 'true'. */
|
|
12
|
-
block?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
/** If true, padding will not be added to the expanded content */
|
|
15
|
-
noPad?: boolean;
|
|
16
|
-
/** The initial state of the Accordian. Defaults to 'false'.
|
|
17
|
-
* Use with onChange to control the state from outside the Accordian.
|
|
18
|
-
*/
|
|
19
|
-
open?: boolean;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/** Defaults to 1020px. */
|
|
22
|
-
maxHeight?: string | undefined;
|
|
23
|
-
/** Defaults to 250ms. */
|
|
24
|
-
expandTimeMs?: number;
|
|
25
|
-
/** Defaults to 'ease-in-out'. */
|
|
26
|
-
transitionTimingFunction?: string;
|
|
27
|
-
onChange?: (open: boolean) => void;
|
|
28
|
-
}
|
|
29
|
-
declare const Accordian: (props: AccordianProps) => JSX.Element;
|
|
30
|
-
declare const useAccordianState: (count: number, openIndex?: number | undefined) => [boolean[], (index: number, open: boolean) => void];
|
|
31
|
-
|
|
32
|
-
interface InputOnFocusProps {
|
|
33
|
-
/** If true, the component will respond to outside changes even if the control has focus. Default is false. */
|
|
34
|
-
allowUpdateOnFocus?: boolean;
|
|
5
|
+
type HeaderVariant = 'label' | 'link' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
6
|
+
interface AccordianProps {
|
|
7
|
+
header: JSX.Element | string;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
variant?: HeaderVariant;
|
|
10
|
+
/** Defaults to 'true'. */
|
|
11
|
+
block?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
/** If true, padding will not be added to the expanded content */
|
|
14
|
+
noPad?: boolean;
|
|
15
|
+
/** The initial state of the Accordian. Defaults to 'false'.
|
|
16
|
+
* Use with onChange to control the state from outside the Accordian.
|
|
17
|
+
*/
|
|
18
|
+
open?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Defaults to 1020px. */
|
|
21
|
+
maxHeight?: string | undefined;
|
|
22
|
+
/** Defaults to 250ms. */
|
|
23
|
+
expandTimeMs?: number;
|
|
24
|
+
/** Defaults to 'ease-in-out'. */
|
|
25
|
+
transitionTimingFunction?: string;
|
|
26
|
+
onChange?: (open: boolean) => void;
|
|
35
27
|
}
|
|
28
|
+
declare const Accordian: (props: AccordianProps) => React.JSX.Element;
|
|
29
|
+
declare const useAccordianState: (count: number, openIndex?: number) => [boolean[], (index: number, open: boolean) => void];
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
/** Defaults to '
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
31
|
+
interface InputOnFocusProps {
|
|
32
|
+
/** If true, the component will respond to outside changes even if the control has focus. Default is false. */
|
|
33
|
+
allowUpdateOnFocus?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type BaseInputProps$1 = Omit<TextInputProps, 'value' | 'className' | 'wrapperClassName' | 'type' | 'showErrorDisplay'> & InputOnFocusProps;
|
|
37
|
+
interface AutocompleteProps extends BaseInputProps$1 {
|
|
38
|
+
value: string | undefined;
|
|
39
|
+
options: string[];
|
|
40
|
+
/** Applied to the Autocomplete wrapper. */
|
|
41
|
+
className?: string;
|
|
42
|
+
inputWrapperClassName?: string;
|
|
43
|
+
inputClassName?: string;
|
|
44
|
+
listClassName?: string;
|
|
45
|
+
listItemClassName?: string;
|
|
46
|
+
listItemButtonClassName?: string;
|
|
47
|
+
/** Limits what will be show in the autocomplete options. Default is 7. */
|
|
48
|
+
maxShownValues?: number;
|
|
49
|
+
/** Will enable scrolling in the results list. */
|
|
50
|
+
allowScroll?: boolean;
|
|
51
|
+
/** Delay before the input is re-focused after picking a value. Adjust if there are issues with the displayed input value after pick. Defaults to 100ms. */
|
|
52
|
+
onPickFocusWaitMs?: number;
|
|
53
|
+
/** The option `title` attribute will be filled with the option text. Defaults to `true`. */
|
|
54
|
+
showOptionTextAsTitle?: boolean;
|
|
55
|
+
onPick: (value: string | undefined, index?: number) => void;
|
|
56
|
+
}
|
|
57
|
+
declare const Autocomplete: (p: AutocompleteProps) => React.JSX.Element;
|
|
58
|
+
|
|
59
|
+
/** @deprecated Use Backdrop2 going forward. */
|
|
60
|
+
declare const Backdrop$1: (props: {
|
|
61
|
+
show: boolean;
|
|
62
|
+
onClick?: () => void;
|
|
63
|
+
transparent?: boolean;
|
|
64
|
+
/** If true, the backdrop will hide on larger screens. */
|
|
65
|
+
responsive?: boolean;
|
|
66
|
+
/** If true, the backdrop will hide on smaller screens. */
|
|
67
|
+
reverseResponsive?: boolean;
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
className?: string;
|
|
70
|
+
/** If true, will not prevent scroll when shown. */
|
|
71
|
+
allowScroll?: boolean;
|
|
72
|
+
/** Fade in time. Defaults to 250ms. */
|
|
73
|
+
showTimeMs?: number;
|
|
74
|
+
}) => React.JSX.Element;
|
|
75
|
+
|
|
76
|
+
declare const Backdrop: (p: {
|
|
77
|
+
children: React__default.ReactNode;
|
|
78
|
+
/** Fade in time. Defaults to 250ms. */
|
|
79
|
+
showTimeMs?: number;
|
|
80
|
+
__debug?: boolean;
|
|
81
|
+
}) => React__default.JSX.Element;
|
|
82
|
+
|
|
83
|
+
type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative' | 'text';
|
|
84
|
+
interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
85
|
+
variant?: ButtonVariant;
|
|
86
|
+
/** As round as can be. */
|
|
87
|
+
round?: boolean;
|
|
88
|
+
rightIcon?: JSX.Element;
|
|
89
|
+
leftIcon?: JSX.Element;
|
|
90
|
+
/** full width with max space between the text and the icon */
|
|
91
|
+
iconBlock?: boolean;
|
|
92
|
+
small?: boolean;
|
|
93
|
+
/** The button will not respond to click or mouse events, but it will appear normal. */
|
|
94
|
+
readOnly?: boolean;
|
|
95
|
+
waiting?: boolean;
|
|
96
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
97
|
+
enforceMinWidth?: boolean;
|
|
98
|
+
/** If true, bottom padding will be added to account for other inputs having space for error messages. */
|
|
99
|
+
controlAlign?: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
102
|
+
|
|
103
|
+
interface CalendarProps {
|
|
104
|
+
month: number;
|
|
105
|
+
year: number;
|
|
106
|
+
/** Defaults to 3rem. */
|
|
107
|
+
cellSize?: string;
|
|
108
|
+
smallHeader?: boolean;
|
|
109
|
+
id?: string;
|
|
110
|
+
/** Defaults to true. */
|
|
111
|
+
title?: boolean;
|
|
112
|
+
yearInTitle?: boolean;
|
|
113
|
+
/** Ignored if title is set to false. */
|
|
114
|
+
customTitle?: JSX.Element;
|
|
115
|
+
/** If true, will always show 6 rows / 42 cells. */
|
|
116
|
+
fixedRows?: boolean;
|
|
117
|
+
/** Bolds the current date. */
|
|
118
|
+
showCurrent?: boolean;
|
|
119
|
+
selectedValue?: number;
|
|
120
|
+
/** Renders custom content for each cell. The content will be wrapped in a button if onClick is provided. */
|
|
121
|
+
renderCell?: (date: Date) => JSX.Element;
|
|
122
|
+
/** Used with renderCell with onClick is provided. Will not wrap the cell contents in a button. */
|
|
123
|
+
isCellDisabled?: (date: Date) => boolean;
|
|
124
|
+
onClick?: (date: Date) => void;
|
|
125
|
+
/** This is the ms from Date.valueOf(). */
|
|
126
|
+
min?: number;
|
|
127
|
+
/** This is the ms from Date.valueOf(). */
|
|
128
|
+
max?: number;
|
|
129
|
+
}
|
|
130
|
+
declare const Calendar: (p: CalendarProps) => React.JSX.Element;
|
|
131
|
+
|
|
132
|
+
interface CheckboxProps extends Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'checked' | 'onChange' | 'type'> {
|
|
133
|
+
checked: boolean;
|
|
134
|
+
onChange: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
135
|
+
readOnly?: boolean;
|
|
136
|
+
label?: string;
|
|
137
|
+
checkedIcon?: string;
|
|
138
|
+
uncheckedIcon?: string;
|
|
139
|
+
/** Background color when checked based on the current theme. Mutually exclusive with 'checkedColor'. */
|
|
140
|
+
checkedThemeColor?: 'primary' | 'primary2' | 'secondary';
|
|
141
|
+
/** Background color when checked. Mutually exclusive with 'checkedThemeColor'. */
|
|
142
|
+
checkedColor?: string;
|
|
143
|
+
}
|
|
144
|
+
declare const Checkbox: (props: CheckboxProps) => React.JSX.Element;
|
|
145
|
+
|
|
146
|
+
interface ConfirmModalProps {
|
|
147
|
+
show: boolean;
|
|
148
|
+
text: string;
|
|
149
|
+
header: string;
|
|
150
|
+
onCancel: () => void;
|
|
151
|
+
onConfirm: () => void;
|
|
152
|
+
confirmText?: string;
|
|
153
|
+
cancelText?: string;
|
|
154
|
+
className?: string;
|
|
155
|
+
variant?: 'omg';
|
|
156
|
+
id?: string;
|
|
157
|
+
__debug?: boolean;
|
|
158
|
+
}
|
|
159
|
+
declare const ConfirmModal: (props: ConfirmModalProps) => React.JSX.Element;
|
|
160
|
+
|
|
161
|
+
interface CopyButtonProps extends Omit<ButtonProps, 'variant' | 'children'> {
|
|
162
|
+
/** HTML selector of the target input to copy from. */
|
|
163
|
+
selector: string;
|
|
164
|
+
}
|
|
165
|
+
declare const CopyButton: React.ForwardRefExoticComponent<Omit<CopyButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
166
|
+
|
|
167
|
+
declare const Divider: (p: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHRElement>, HTMLHRElement>) => React.JSX.Element;
|
|
168
|
+
|
|
169
|
+
declare const ErrorModal: (props: {
|
|
170
|
+
message: string;
|
|
171
|
+
show: boolean;
|
|
172
|
+
id?: string;
|
|
173
|
+
__debug?: boolean;
|
|
174
|
+
close: () => void;
|
|
175
|
+
}) => React.JSX.Element;
|
|
176
|
+
|
|
177
|
+
interface FileUploaderProps {
|
|
178
|
+
onUpload: (files: FileList) => Promise<void>;
|
|
179
|
+
/** Defaults to 'Upload'. */
|
|
180
|
+
buttonText?: string;
|
|
181
|
+
/** Defauts to 'Upload successful'. */
|
|
182
|
+
successMessage?: string | JSX.Element;
|
|
183
|
+
/** Defaults to 'Upload failed.' */
|
|
184
|
+
failureMessage?: string | JSX.Element;
|
|
185
|
+
/** Defaults to 10rem. */
|
|
186
|
+
buttonWidth?: string;
|
|
187
|
+
/** Defaults to 'primary'. */
|
|
188
|
+
buttonVariant?: ButtonVariant;
|
|
189
|
+
maxBytes?: number;
|
|
190
|
+
multiple?: boolean;
|
|
191
|
+
accept?: string;
|
|
192
|
+
/** Defaults to 'Click or drag and drop files.'*/
|
|
193
|
+
instructionMessage?: string;
|
|
194
|
+
/** For additional info below the instructionMessage. */
|
|
195
|
+
infoMessage?: string | JSX.Element;
|
|
196
|
+
/** If false, the 'infoMessage' will be hidden when a file is picked. Defaults to 'true' */
|
|
197
|
+
showInfoOnPick?: boolean;
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
}
|
|
200
|
+
declare const FileUploader: (p: FileUploaderProps) => React__default.JSX.Element;
|
|
202
201
|
declare const getFileSizeDisplay: (size: number) => string;
|
|
203
202
|
|
|
204
|
-
|
|
205
|
-
interface FormProps extends BaseProps$5 {
|
|
206
|
-
inline?: boolean;
|
|
207
|
-
/** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
|
|
208
|
-
ajax?: boolean;
|
|
209
|
-
/** Removes the opinionated flex styling. 'inline' will be ignored. */
|
|
210
|
-
unstyled?: boolean;
|
|
211
|
-
}
|
|
212
|
-
/** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
|
|
213
|
-
declare const Form: React.ForwardRefExoticComponent<
|
|
214
|
-
/** @deprecated Just style normally using flex, grid, etc. */
|
|
215
|
-
declare const FormFlexRow: (props: {
|
|
216
|
-
children: React.ReactNode;
|
|
217
|
-
className?: string;
|
|
218
|
-
style?: React.CSSProperties;
|
|
219
|
-
justifyContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "center" | "end" | "flex-end" | "flex-start" | "start";
|
|
220
|
-
}) => JSX.Element;
|
|
221
|
-
/** @deprecated Just style normally using flex, grid, etc. */
|
|
222
|
-
declare const FormColumnRow: (props: {
|
|
223
|
-
children: React.ReactNode;
|
|
224
|
-
cols: number;
|
|
225
|
-
className?: string;
|
|
226
|
-
style?: React.CSSProperties;
|
|
227
|
-
}) => JSX.Element;
|
|
228
|
-
|
|
229
|
-
declare const Header: (props: {
|
|
230
|
-
title?: string | JSX.Element;
|
|
231
|
-
toggleMenu?: () => void | undefined;
|
|
232
|
-
/** If true, will hide menu button on larger screens */
|
|
233
|
-
responsive?: boolean;
|
|
234
|
-
inline?: boolean;
|
|
235
|
-
className?: string;
|
|
236
|
-
leftElements?: JSX.Element;
|
|
237
|
-
rightElements?: JSX.Element;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
declare const InfoPanel: (props: {
|
|
269
|
-
children: React.ReactNode;
|
|
270
|
-
variant?:
|
|
271
|
-
className?: string;
|
|
272
|
-
style?: React.CSSProperties;
|
|
273
|
-
/** Defaults to 'p'. */
|
|
274
|
-
tag?:
|
|
275
|
-
}) => JSX.Element;
|
|
276
|
-
|
|
277
|
-
interface InfoTipProps {
|
|
278
|
-
content?: string | JSX.Element;
|
|
279
|
-
disabled?: boolean;
|
|
280
|
-
onClick?: () => void;
|
|
281
|
-
tabIndex?: number;
|
|
282
|
-
loadOnHover?: () => Promise<void>;
|
|
283
|
-
onClose?: () => void;
|
|
284
|
-
/** Defaults to 'info'. */
|
|
285
|
-
variant?: 'info' | 'modal';
|
|
286
|
-
/** Defaults to nav color. */
|
|
287
|
-
bgColor?: string;
|
|
288
|
-
/** Defaults to nav font color. */
|
|
289
|
-
fontColor?: string;
|
|
290
|
-
/** For variant=modal only. */
|
|
291
|
-
modalHeader?: string;
|
|
292
|
-
/** For variant=modal only. */
|
|
293
|
-
modalId?: string;
|
|
294
|
-
/** For variant=modal only. */
|
|
295
|
-
__modalDebug?: boolean;
|
|
296
|
-
/** Whether to move the popover on collision with the parent's bounds. Default is false. For variant=info only. */
|
|
297
|
-
reposition?: boolean;
|
|
298
|
-
/** Order of positions as the Popover colides with the window edge. The default order is ['right', 'top', 'left', 'bottom']. For variant=info only. */
|
|
299
|
-
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
300
|
-
}
|
|
301
|
-
declare const InfoTip: (props: InfoTipProps) => JSX.Element;
|
|
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
|
-
/** An error message to display below the input. */
|
|
309
|
-
error?: string;
|
|
310
|
-
/** Will show validation below the input. Defaults to 'true'. */
|
|
311
|
-
showErrorDisplay?: boolean;
|
|
203
|
+
type BaseProps$5 = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
|
|
204
|
+
interface FormProps extends BaseProps$5 {
|
|
205
|
+
inline?: boolean;
|
|
206
|
+
/** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
|
|
207
|
+
ajax?: boolean;
|
|
208
|
+
/** Removes the opinionated flex styling. 'inline' will be ignored. */
|
|
209
|
+
unstyled?: boolean;
|
|
210
|
+
}
|
|
211
|
+
/** Use this instead of <form> directly. If we need to fight Chrome's autofill, we can do so at a global level. */
|
|
212
|
+
declare const Form: React.ForwardRefExoticComponent<Omit<FormProps, "ref"> & React.RefAttributes<HTMLFormElement>>;
|
|
213
|
+
/** @deprecated Just style normally using flex, grid, etc. */
|
|
214
|
+
declare const FormFlexRow: (props: {
|
|
215
|
+
children: React.ReactNode;
|
|
216
|
+
className?: string;
|
|
217
|
+
style?: React.CSSProperties;
|
|
218
|
+
justifyContent?: "space-around" | "space-between" | "space-evenly" | "stretch" | "center" | "end" | "flex-end" | "flex-start" | "start";
|
|
219
|
+
}) => React.JSX.Element;
|
|
220
|
+
/** @deprecated Just style normally using flex, grid, etc. */
|
|
221
|
+
declare const FormColumnRow: (props: {
|
|
222
|
+
children: React.ReactNode;
|
|
223
|
+
cols: number;
|
|
224
|
+
className?: string;
|
|
225
|
+
style?: React.CSSProperties;
|
|
226
|
+
}) => React.JSX.Element;
|
|
227
|
+
|
|
228
|
+
declare const Header: (props: {
|
|
229
|
+
title?: string | JSX.Element;
|
|
230
|
+
toggleMenu?: () => void | undefined;
|
|
231
|
+
/** If true, will hide menu button on larger screens */
|
|
232
|
+
responsive?: boolean;
|
|
233
|
+
inline?: boolean;
|
|
234
|
+
className?: string;
|
|
235
|
+
leftElements?: JSX.Element;
|
|
236
|
+
rightElements?: JSX.Element;
|
|
237
|
+
noMenu?: boolean;
|
|
238
|
+
/** Will fill the title center aligned with wrapping. */
|
|
239
|
+
fillTitle?: boolean;
|
|
240
|
+
}) => React.JSX.Element;
|
|
241
|
+
|
|
242
|
+
declare const Highlight: (props: {
|
|
243
|
+
text: string;
|
|
244
|
+
highlightText: string;
|
|
245
|
+
}) => React.JSX.Element;
|
|
246
|
+
|
|
247
|
+
declare const ICONS: {
|
|
248
|
+
[key: string]: IconDefinition;
|
|
249
|
+
};
|
|
250
|
+
declare const Icon: (props: {
|
|
251
|
+
id: string;
|
|
252
|
+
title?: string;
|
|
253
|
+
className?: string;
|
|
254
|
+
spin?: boolean;
|
|
255
|
+
style?: React.CSSProperties;
|
|
256
|
+
onClick?: (e: React.MouseEvent<SVGSVGElement | HTMLElement, MouseEvent>) => void;
|
|
257
|
+
}) => React.JSX.Element;
|
|
258
|
+
|
|
259
|
+
interface ImageProps extends Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'src' | 'alt'> {
|
|
260
|
+
src: string;
|
|
261
|
+
alt: string;
|
|
262
|
+
}
|
|
263
|
+
declare const Image: React.ForwardRefExoticComponent<Omit<ImageProps, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
264
|
+
|
|
265
|
+
type InfoPanelVariant = 'info' | 'warning' | 'error' | 'negative' | 'positive';
|
|
266
|
+
type InfoPanelTag = 'p' | 'div';
|
|
267
|
+
declare const InfoPanel: (props: {
|
|
268
|
+
children: React.ReactNode;
|
|
269
|
+
variant?: InfoPanelVariant;
|
|
270
|
+
className?: string;
|
|
271
|
+
style?: React.CSSProperties;
|
|
272
|
+
/** Defaults to 'p'. */
|
|
273
|
+
tag?: InfoPanelTag;
|
|
274
|
+
}) => React.JSX.Element;
|
|
275
|
+
|
|
276
|
+
interface InfoTipProps {
|
|
277
|
+
content?: string | JSX.Element;
|
|
278
|
+
disabled?: boolean;
|
|
279
|
+
onClick?: () => void;
|
|
280
|
+
tabIndex?: number;
|
|
281
|
+
loadOnHover?: () => Promise<void>;
|
|
282
|
+
onClose?: () => void;
|
|
283
|
+
/** Defaults to 'info'. */
|
|
284
|
+
variant?: 'info' | 'modal';
|
|
285
|
+
/** Defaults to nav color. */
|
|
286
|
+
bgColor?: string;
|
|
287
|
+
/** Defaults to nav font color. */
|
|
288
|
+
fontColor?: string;
|
|
289
|
+
/** For variant=modal only. */
|
|
290
|
+
modalHeader?: string;
|
|
291
|
+
/** For variant=modal only. */
|
|
292
|
+
modalId?: string;
|
|
293
|
+
/** For variant=modal only. */
|
|
294
|
+
__modalDebug?: boolean;
|
|
295
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is false. For variant=info only. */
|
|
296
|
+
reposition?: boolean;
|
|
297
|
+
/** Order of positions as the Popover colides with the window edge. The default order is ['right', 'top', 'left', 'bottom']. For variant=info only. */
|
|
298
|
+
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
299
|
+
}
|
|
300
|
+
declare const InfoTip: (props: InfoTipProps) => React.JSX.Element;
|
|
301
|
+
|
|
302
|
+
interface BaseInputProps extends React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
303
|
+
rightControl?: JSX.Element;
|
|
304
|
+
round?: boolean;
|
|
305
|
+
/** The class applied to the wrapping element without this component. Use 'className' to style the input directly. */
|
|
306
|
+
wrapperClassName?: string;
|
|
307
|
+
/** An error message to display below the input. */
|
|
308
|
+
error?: string;
|
|
309
|
+
/** Will show validation below the input. Defaults to 'true'. */
|
|
310
|
+
showErrorDisplay?: boolean;
|
|
312
311
|
}
|
|
313
312
|
|
|
314
|
-
interface ValidationMessageProps {
|
|
315
|
-
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
316
|
-
customError?: string;
|
|
317
|
-
/** If 'pattern' is present, this message will be displayed as the validation failed message. */
|
|
318
|
-
patternErrorMessage?: string;
|
|
313
|
+
interface ValidationMessageProps {
|
|
314
|
+
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
315
|
+
customError?: string;
|
|
316
|
+
/** If 'pattern' is present, this message will be displayed as the validation failed message. */
|
|
317
|
+
patternErrorMessage?: string;
|
|
319
318
|
}
|
|
320
319
|
|
|
321
|
-
|
|
322
|
-
interface DateInputProps extends BaseProps$4 {
|
|
323
|
-
/** The epoch timestamp. Equivalent to Date.valueOf(). */
|
|
324
|
-
value?: number;
|
|
325
|
-
/** The min epoch timestamp. */
|
|
326
|
-
min?: number;
|
|
327
|
-
/** The max epoch timestamp. */
|
|
328
|
-
max?: number;
|
|
329
|
-
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
330
|
-
reposition?: boolean;
|
|
331
|
-
/** If `true`, the paging buttons for the years will be shown. Default is only the month pagers. */
|
|
332
|
-
pageYear?: boolean;
|
|
333
|
-
onValueChange: (value: number | undefined) => void;
|
|
334
|
-
}
|
|
320
|
+
type BaseProps$4 = Omit<BaseInputProps, 'type' | 'value' | 'min' | 'max' | 'step' | 'pattern' | 'maxLength' | 'rightControl' | 'ref'> & Omit<ValidationMessageProps, 'pattern'> & InputOnFocusProps;
|
|
321
|
+
interface DateInputProps extends BaseProps$4 {
|
|
322
|
+
/** The epoch timestamp. Equivalent to Date.valueOf(). */
|
|
323
|
+
value?: number;
|
|
324
|
+
/** The min epoch timestamp. */
|
|
325
|
+
min?: number;
|
|
326
|
+
/** The max epoch timestamp. */
|
|
327
|
+
max?: number;
|
|
328
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
329
|
+
reposition?: boolean;
|
|
330
|
+
/** If `true`, the paging buttons for the years will be shown. Default is only the month pagers. */
|
|
331
|
+
pageYear?: boolean;
|
|
332
|
+
onValueChange: (value: number | undefined) => void;
|
|
333
|
+
}
|
|
335
334
|
declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
336
335
|
|
|
337
|
-
|
|
338
|
-
interface NumberInputProps extends BaseProps$3 {
|
|
339
|
-
value?: number;
|
|
340
|
-
min?: number;
|
|
341
|
-
max?: number;
|
|
342
|
-
/** WARNING! At least in Chrome (2022-03-03), step is buggy. Stick to 1, 0, or fractional 10ths (0.1, 0.01, etc).
|
|
343
|
-
* Failure to do this will cause the input to be marked as invalid. We will not be attempting to fix this issue.
|
|
344
|
-
*/
|
|
345
|
-
step?: number;
|
|
346
|
-
onValueChange: (value: number | undefined) => void;
|
|
347
|
-
}
|
|
348
|
-
declare const NumberInput: React.ForwardRefExoticComponent<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
interface TextInputProps extends BaseProps$2 {
|
|
352
|
-
value?: string;
|
|
353
|
-
/** Defaults to 'text'. */
|
|
354
|
-
type?: 'text' | 'email' | 'url' | 'password';
|
|
355
|
-
/** Clears all leading and trailing whitespace on blur. Defaults to true. */
|
|
356
|
-
trim?: boolean;
|
|
357
|
-
/** If true, an empty input will return and empty string (''). Default value is undefined. */
|
|
358
|
-
emptyString?: boolean;
|
|
359
|
-
onValueChange: (value: string | undefined) => void;
|
|
360
|
-
}
|
|
361
|
-
declare const TextInput: React.ForwardRefExoticComponent<
|
|
362
|
-
|
|
363
|
-
/** useEffect but ignores the first call on component mount. */
|
|
336
|
+
type BaseProps$3 = Omit<BaseInputProps, 'type' | 'value' | 'min' | 'max' | 'step' | 'maxLength' | 'error' | 'pattern'> & Omit<ValidationMessageProps, 'pattern'> & InputOnFocusProps;
|
|
337
|
+
interface NumberInputProps extends BaseProps$3 {
|
|
338
|
+
value?: number;
|
|
339
|
+
min?: number;
|
|
340
|
+
max?: number;
|
|
341
|
+
/** WARNING! At least in Chrome (2022-03-03), step is buggy. Stick to 1, 0, or fractional 10ths (0.1, 0.01, etc).
|
|
342
|
+
* Failure to do this will cause the input to be marked as invalid. We will not be attempting to fix this issue.
|
|
343
|
+
*/
|
|
344
|
+
step?: number;
|
|
345
|
+
onValueChange: (value: number | undefined) => void;
|
|
346
|
+
}
|
|
347
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
348
|
+
|
|
349
|
+
type BaseProps$2 = Omit<BaseInputProps, 'type' | 'value' | 'max' | 'min' | 'step' | 'error'> & ValidationMessageProps & InputOnFocusProps;
|
|
350
|
+
interface TextInputProps extends BaseProps$2 {
|
|
351
|
+
value?: string;
|
|
352
|
+
/** Defaults to 'text'. */
|
|
353
|
+
type?: 'text' | 'email' | 'url' | 'password';
|
|
354
|
+
/** Clears all leading and trailing whitespace on blur. Defaults to true. */
|
|
355
|
+
trim?: boolean;
|
|
356
|
+
/** If true, an empty input will return and empty string (''). Default value is undefined. */
|
|
357
|
+
emptyString?: boolean;
|
|
358
|
+
onValueChange: (value: string | undefined) => void;
|
|
359
|
+
}
|
|
360
|
+
declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
361
|
+
|
|
362
|
+
/** useEffect but ignores the first call on component mount. */
|
|
364
363
|
declare const useIgnoreMount: (effect: React__default.EffectCallback, deps?: React__default.DependencyList | undefined) => void;
|
|
365
364
|
|
|
366
|
-
interface LabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
367
|
-
text: string | JSX.Element;
|
|
368
|
-
/** Displays the label NOT using a label element. */
|
|
369
|
-
static?: boolean;
|
|
370
|
-
/** Defaults to 'vertical'. */
|
|
371
|
-
orientation?: 'vertical' | 'horizontal' | 'horizontalReverse';
|
|
372
|
-
/** The alignment of the label text. Defaults to 'left'. Ignored for horizontal and horizontalReverse orientation. */
|
|
373
|
-
align?: 'left' | 'right' | 'center';
|
|
374
|
-
/** Don't wrap the children in the <label>. Fixes re-focus bugs with the date picker and possible future libraries. */
|
|
375
|
-
noWrap?: boolean;
|
|
376
|
-
/** Smaller text next to the main label. */
|
|
377
|
-
subText?: string | JSX.Element;
|
|
378
|
-
/** Indicates the control this label wraps is optional. Mutually exclusive with subText. */
|
|
379
|
-
optional?: boolean;
|
|
380
|
-
/** Used with static. Will put label text in the same position it would be if there was an input around it. For lining up forms. */
|
|
381
|
-
controlAlign?: boolean;
|
|
382
|
-
}
|
|
383
|
-
declare const Label: (props: LabelProps) => JSX.Element;
|
|
384
|
-
|
|
385
|
-
interface ListProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
|
|
386
|
-
altRowColor?: boolean;
|
|
387
|
-
noLines?: boolean;
|
|
388
|
-
items?: (string | JSX.Element)[];
|
|
389
|
-
}
|
|
390
|
-
declare const List: React.ForwardRefExoticComponent<
|
|
391
|
-
interface ListItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
392
|
-
/** For variant 'full', the content will take up the entire space of the parent (no padding applied by this component). */
|
|
393
|
-
variant?: 'full';
|
|
394
|
-
/** By default (and not a good idea in hindsight), ListItem applies styles to child Button or OmniLink elements when the variant is 'full'. Use this to remove these styles. */
|
|
395
|
-
noContentStyling?: boolean;
|
|
396
|
-
}
|
|
397
|
-
declare const ListItem: (props: ListItemProps) => JSX.Element;
|
|
398
|
-
|
|
399
|
-
interface ModalProps {
|
|
400
|
-
show: boolean;
|
|
401
|
-
children: React__default.ReactNode;
|
|
402
|
-
/** Defaults to theme.breakpoints.tablet. */
|
|
403
|
-
maxWidth?: string;
|
|
404
|
-
minWidth?: string;
|
|
405
|
-
/** Will not apply a background color to the modal body. */
|
|
406
|
-
noBackground?: boolean;
|
|
407
|
-
closeButton?: boolean;
|
|
408
|
-
heading?: string;
|
|
409
|
-
/** Use to override default heading styling. */
|
|
410
|
-
headerClassName?: string;
|
|
411
|
-
/** Selector of the element to focus on initial show. */
|
|
412
|
-
focusSelector?: string;
|
|
413
|
-
scrollable?: boolean;
|
|
414
|
-
id?: string;
|
|
415
|
-
/** Applied to the modal body. */
|
|
416
|
-
className?: string;
|
|
417
|
-
__debug?: boolean;
|
|
418
|
-
onClick?: () => void;
|
|
419
|
-
}
|
|
365
|
+
interface LabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
366
|
+
text: string | JSX.Element;
|
|
367
|
+
/** Displays the label NOT using a label element. */
|
|
368
|
+
static?: boolean;
|
|
369
|
+
/** Defaults to 'vertical'. */
|
|
370
|
+
orientation?: 'vertical' | 'horizontal' | 'horizontalReverse';
|
|
371
|
+
/** The alignment of the label text. Defaults to 'left'. Ignored for horizontal and horizontalReverse orientation. */
|
|
372
|
+
align?: 'left' | 'right' | 'center';
|
|
373
|
+
/** Don't wrap the children in the <label>. Fixes re-focus bugs with the date picker and possible future libraries. */
|
|
374
|
+
noWrap?: boolean;
|
|
375
|
+
/** Smaller text next to the main label. */
|
|
376
|
+
subText?: string | JSX.Element;
|
|
377
|
+
/** Indicates the control this label wraps is optional. Mutually exclusive with subText. */
|
|
378
|
+
optional?: boolean;
|
|
379
|
+
/** Used with static. Will put label text in the same position it would be if there was an input around it. For lining up forms. */
|
|
380
|
+
controlAlign?: boolean;
|
|
381
|
+
}
|
|
382
|
+
declare const Label: (props: LabelProps) => React.JSX.Element;
|
|
383
|
+
|
|
384
|
+
interface ListProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
|
|
385
|
+
altRowColor?: boolean;
|
|
386
|
+
noLines?: boolean;
|
|
387
|
+
items?: (string | JSX.Element)[];
|
|
388
|
+
}
|
|
389
|
+
declare const List: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
390
|
+
interface ListItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
391
|
+
/** For variant 'full', the content will take up the entire space of the parent (no padding applied by this component). */
|
|
392
|
+
variant?: 'full';
|
|
393
|
+
/** By default (and not a good idea in hindsight), ListItem applies styles to child Button or OmniLink elements when the variant is 'full'. Use this to remove these styles. */
|
|
394
|
+
noContentStyling?: boolean;
|
|
395
|
+
}
|
|
396
|
+
declare const ListItem: (props: ListItemProps) => React.JSX.Element;
|
|
397
|
+
|
|
398
|
+
interface ModalProps {
|
|
399
|
+
show: boolean;
|
|
400
|
+
children: React__default.ReactNode;
|
|
401
|
+
/** Defaults to theme.breakpoints.tablet. */
|
|
402
|
+
maxWidth?: string;
|
|
403
|
+
minWidth?: string;
|
|
404
|
+
/** Will not apply a background color to the modal body. */
|
|
405
|
+
noBackground?: boolean;
|
|
406
|
+
closeButton?: boolean;
|
|
407
|
+
heading?: string;
|
|
408
|
+
/** Use to override default heading styling. */
|
|
409
|
+
headerClassName?: string;
|
|
410
|
+
/** Selector of the element to focus on initial show. */
|
|
411
|
+
focusSelector?: string;
|
|
412
|
+
scrollable?: boolean;
|
|
413
|
+
id?: string;
|
|
414
|
+
/** Applied to the modal body. */
|
|
415
|
+
className?: string;
|
|
416
|
+
__debug?: boolean;
|
|
417
|
+
onClick?: () => void;
|
|
418
|
+
}
|
|
420
419
|
declare const Modal: (p: ModalProps) => React__default.ReactPortal | null;
|
|
421
420
|
|
|
422
|
-
declare const Nav: (props: {
|
|
423
|
-
show: boolean;
|
|
424
|
-
toggle: (show: boolean) => void;
|
|
425
|
-
id?: string
|
|
426
|
-
children?: React.ReactNode;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
page: number;
|
|
449
|
-
limit: number;
|
|
450
|
-
items: T[];
|
|
421
|
+
declare const Nav: (props: {
|
|
422
|
+
show: boolean;
|
|
423
|
+
toggle: (show: boolean) => void;
|
|
424
|
+
id?: string;
|
|
425
|
+
children?: React.ReactNode;
|
|
426
|
+
className?: string;
|
|
427
|
+
/** Duration of the slide animation in ms. Defaults to `theme.timings.nav.slideMs`. */
|
|
428
|
+
slideMs?: number;
|
|
429
|
+
/** Defaults to `theme.layout.navWidth`. */
|
|
430
|
+
navWidth?: string;
|
|
431
|
+
__debug?: boolean;
|
|
432
|
+
}) => React.JSX.Element;
|
|
433
|
+
|
|
434
|
+
interface OmniLinkProps extends LinkProps {
|
|
435
|
+
noRouter?: boolean;
|
|
436
|
+
/** Ignored if 'noRouter' is false */
|
|
437
|
+
target?: string;
|
|
438
|
+
}
|
|
439
|
+
declare const OmniLink: (props: OmniLinkProps) => React.JSX.Element;
|
|
440
|
+
|
|
441
|
+
interface PagedResultDto<T> {
|
|
442
|
+
total: number;
|
|
443
|
+
/** The zero-based page index. */
|
|
444
|
+
page: number;
|
|
445
|
+
limit: number;
|
|
446
|
+
items: T[];
|
|
451
447
|
}
|
|
452
448
|
|
|
453
|
-
/** A page of data with helpers props. */
|
|
454
|
-
declare class PagedResult<T> {
|
|
455
|
-
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
get
|
|
468
|
-
get
|
|
469
|
-
get
|
|
470
|
-
get
|
|
471
|
-
get
|
|
472
|
-
get
|
|
473
|
-
|
|
474
|
-
get
|
|
475
|
-
|
|
476
|
-
get
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
getNextItem(fromItem: T): T | undefined;
|
|
485
|
-
getPagingRange(radius: number): number[];
|
|
486
|
-
toJSON(): PagedResultDto<T>;
|
|
487
|
-
clone(newItems?: T[]): PagedResult<T>;
|
|
449
|
+
/** A page of data with helpers props. */
|
|
450
|
+
declare class PagedResult<T> {
|
|
451
|
+
constructor(items?: T[], total?: number, page?: number, limit?: number);
|
|
452
|
+
static fromPagedResultDto<TDto, TDomain>(dto: PagedResultDto<TDto>, convert?: (dto: TDto) => TDomain): PagedResult<TDomain>;
|
|
453
|
+
total: number;
|
|
454
|
+
/** The zero-based page index. */
|
|
455
|
+
page: number;
|
|
456
|
+
limit: number;
|
|
457
|
+
items: T[];
|
|
458
|
+
/** Helper for items.length */
|
|
459
|
+
get length(): number;
|
|
460
|
+
get hasItems(): boolean;
|
|
461
|
+
get previousPage(): number;
|
|
462
|
+
get hasPrevious(): boolean;
|
|
463
|
+
get nextPage(): number;
|
|
464
|
+
get hasNext(): boolean;
|
|
465
|
+
get lastPage(): number;
|
|
466
|
+
get totalPages(): number;
|
|
467
|
+
get minPageItemIndex(): number;
|
|
468
|
+
get maxPageItemIndex(): number;
|
|
469
|
+
/** Returns the first item on the current page. */
|
|
470
|
+
get firstPageItem(): T;
|
|
471
|
+
/** Returns the last item on the current page */
|
|
472
|
+
get lastPageItem(): T;
|
|
473
|
+
getPageRelativeItemIndex(item: T): number;
|
|
474
|
+
getResultRelativeItemIndex(item: T): number | undefined;
|
|
475
|
+
getPreviousItem(fromItem: T): T | undefined;
|
|
476
|
+
getNextItem(fromItem: T): T | undefined;
|
|
477
|
+
getPagingRange(radius: number): number[];
|
|
478
|
+
toJSON(): PagedResultDto<T>;
|
|
479
|
+
clone(newItems?: T[]): PagedResult<T>;
|
|
488
480
|
}
|
|
489
481
|
|
|
490
|
-
|
|
491
|
-
interface PagerSortOption<TItem> {
|
|
492
|
-
id: string;
|
|
493
|
-
name?: string;
|
|
494
|
-
sort: (items: TItem[]) => TItem[];
|
|
495
|
-
}
|
|
496
|
-
interface PagerOptions<TItem> {
|
|
497
|
-
/** Defaults to 10. */
|
|
498
|
-
limit?: number;
|
|
499
|
-
/** Defaults to [10] */
|
|
500
|
-
limitOptions?: number[];
|
|
501
|
-
sort?: string;
|
|
502
|
-
sortOptions?: PagerSortOption<TItem>[];
|
|
503
|
-
/** Will copy over this pagers options, filters, and state. */
|
|
504
|
-
previous?: ItemPager<TItem>;
|
|
505
|
-
}
|
|
506
|
-
/** In-memory pager. */
|
|
507
|
-
declare class ItemPager<TItem> {
|
|
508
|
-
constructor(allItems: TItem[], options?: PagerOptions<TItem>);
|
|
509
|
-
get allItems(): TItem[];
|
|
510
|
-
/** The ID of the current sort within the sortOptions. */
|
|
511
|
-
get sort(): string | undefined;
|
|
512
|
-
set sort(sortId: string | undefined);
|
|
513
|
-
/** The direction of the current sort when using an option created from addToggleSortOption */
|
|
514
|
-
get sortDirection(): SortDirection | undefined;
|
|
515
|
-
get sortOptions(): PagerSortOption<TItem>[];
|
|
516
|
-
get limit(): number;
|
|
517
|
-
set limit(value: number);
|
|
518
|
-
get limitOptions(): number[];
|
|
519
|
-
get totalPages(): number;
|
|
520
|
-
/** The zero-based page index. */
|
|
521
|
-
get page(): number;
|
|
522
|
-
/** The zero-based page index. */
|
|
523
|
-
set page(value: number);
|
|
524
|
-
get pageItems(): TItem[];
|
|
525
|
-
get totalItems(): number;
|
|
526
|
-
get minItemIndex(): number;
|
|
527
|
-
get maxItemIndex(): number;
|
|
528
|
-
get hasNext(): boolean;
|
|
529
|
-
get hasPrevious(): boolean;
|
|
530
|
-
/**
|
|
531
|
-
* Adds both asc and des sort options
|
|
532
|
-
*
|
|
533
|
-
* @param propPath Prop name or path ('resource.title').
|
|
534
|
-
* @param name Name to display or asc Name and desc Name.
|
|
535
|
-
*/
|
|
536
|
-
addToggleSortOption(propPath: string, name?: string | [string, string]): void;
|
|
537
|
-
/**
|
|
538
|
-
* Toggles between asc and desc.
|
|
539
|
-
* @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
|
|
540
|
-
*/
|
|
541
|
-
toggleSort(sortId: string): void;
|
|
542
|
-
/** Filters the current results by the filtering function ONCE.
|
|
543
|
-
* You will need to re-add the filter if the contents of the filtering function changes. */
|
|
544
|
-
applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
545
|
-
next(): void;
|
|
546
|
-
previous(): void;
|
|
547
|
-
pageByOffset(direction: 1 | -1): void;
|
|
548
|
-
/** Adds the item optionally keeping the current page. */
|
|
549
|
-
add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
|
|
550
|
-
/** Removes the matched item(s). */
|
|
551
|
-
remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
552
|
-
replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
|
|
553
|
-
/** Returns a clone of the underlying PagedResult. */
|
|
554
|
-
toPagedResult(): PagedResult<TItem>;
|
|
555
|
-
private _allItems;
|
|
556
|
-
private _page;
|
|
557
|
-
private _limit;
|
|
558
|
-
private _limitOptions;
|
|
559
|
-
private _pageResult;
|
|
560
|
-
private _filteredItems;
|
|
561
|
-
private _sort;
|
|
562
|
-
private _sortOptions;
|
|
563
|
-
private _currentFilter;
|
|
564
|
-
private createPageResult;
|
|
482
|
+
type SortDirection = 'asc' | 'desc';
|
|
483
|
+
interface PagerSortOption<TItem> {
|
|
484
|
+
id: string;
|
|
485
|
+
name?: string;
|
|
486
|
+
sort: (items: TItem[]) => TItem[];
|
|
487
|
+
}
|
|
488
|
+
interface PagerOptions<TItem> {
|
|
489
|
+
/** Defaults to 10. */
|
|
490
|
+
limit?: number;
|
|
491
|
+
/** Defaults to [10] */
|
|
492
|
+
limitOptions?: number[];
|
|
493
|
+
sort?: string;
|
|
494
|
+
sortOptions?: PagerSortOption<TItem>[];
|
|
495
|
+
/** Will copy over this pagers options, filters, and state. */
|
|
496
|
+
previous?: ItemPager<TItem>;
|
|
497
|
+
}
|
|
498
|
+
/** In-memory pager. */
|
|
499
|
+
declare class ItemPager<TItem> {
|
|
500
|
+
constructor(allItems: TItem[], options?: PagerOptions<TItem>);
|
|
501
|
+
get allItems(): TItem[];
|
|
502
|
+
/** The ID of the current sort within the sortOptions. */
|
|
503
|
+
get sort(): string | undefined;
|
|
504
|
+
set sort(sortId: string | undefined);
|
|
505
|
+
/** The direction of the current sort when using an option created from addToggleSortOption */
|
|
506
|
+
get sortDirection(): SortDirection | undefined;
|
|
507
|
+
get sortOptions(): PagerSortOption<TItem>[];
|
|
508
|
+
get limit(): number;
|
|
509
|
+
set limit(value: number);
|
|
510
|
+
get limitOptions(): number[];
|
|
511
|
+
get totalPages(): number;
|
|
512
|
+
/** The zero-based page index. */
|
|
513
|
+
get page(): number;
|
|
514
|
+
/** The zero-based page index. */
|
|
515
|
+
set page(value: number);
|
|
516
|
+
get pageItems(): TItem[];
|
|
517
|
+
get totalItems(): number;
|
|
518
|
+
get minItemIndex(): number;
|
|
519
|
+
get maxItemIndex(): number;
|
|
520
|
+
get hasNext(): boolean;
|
|
521
|
+
get hasPrevious(): boolean;
|
|
522
|
+
/**
|
|
523
|
+
* Adds both asc and des sort options
|
|
524
|
+
*
|
|
525
|
+
* @param propPath Prop name or path ('resource.title').
|
|
526
|
+
* @param name Name to display or asc Name and desc Name.
|
|
527
|
+
*/
|
|
528
|
+
addToggleSortOption(propPath: string, name?: string | [string, string]): void;
|
|
529
|
+
/**
|
|
530
|
+
* Toggles between asc and desc.
|
|
531
|
+
* @param sortId The ID or partial ID (no '-asc' or '-desc') of a sort option created through addToggleSortOption
|
|
532
|
+
*/
|
|
533
|
+
toggleSort(sortId: string): void;
|
|
534
|
+
/** Filters the current results by the filtering function ONCE.
|
|
535
|
+
* You will need to re-add the filter if the contents of the filtering function changes. */
|
|
536
|
+
applyFilter(filter?: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
537
|
+
next(): void;
|
|
538
|
+
previous(): void;
|
|
539
|
+
pageByOffset(direction: 1 | -1): void;
|
|
540
|
+
/** Adds the item optionally keeping the current page. */
|
|
541
|
+
add(item: TItem, position?: 'start' | 'end', keepPage?: boolean): void;
|
|
542
|
+
/** Removes the matched item(s). */
|
|
543
|
+
remove(comparer: (item: TItem) => boolean, keepPage?: boolean): void;
|
|
544
|
+
replace(newItem: TItem, comparer: (item: TItem) => boolean): void;
|
|
545
|
+
/** Returns a clone of the underlying PagedResult. */
|
|
546
|
+
toPagedResult(): PagedResult<TItem>;
|
|
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
|
+
}
|
|
558
|
+
|
|
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
|
+
className?: string;
|
|
567
|
+
leftControls?: JSX.Element;
|
|
568
|
+
rightControls?: JSX.Element;
|
|
569
|
+
}
|
|
570
|
+
interface PagerProps extends PagerStyleProps {
|
|
571
|
+
canGoNext: boolean;
|
|
572
|
+
canGoPrevious: boolean;
|
|
573
|
+
minItem: number;
|
|
574
|
+
maxItem: number;
|
|
575
|
+
totalItems: number;
|
|
576
|
+
page: (direction: 1 | -1) => void;
|
|
577
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
578
|
+
pageIndex?: number;
|
|
579
|
+
/** For display purposes. Will show under items text if this if present. */
|
|
580
|
+
totalPages?: number;
|
|
565
581
|
}
|
|
582
|
+
declare const Pager: (props: PagerProps) => React.JSX.Element;
|
|
583
|
+
|
|
584
|
+
interface Props$1<T> extends PagerStyleProps {
|
|
585
|
+
pager: ItemPager<T>;
|
|
586
|
+
onPage: (direction: 1 | -1) => void;
|
|
587
|
+
/** Defaults to 'Limit' */
|
|
588
|
+
limitText?: string;
|
|
589
|
+
/** Defaults to 'Sort' */
|
|
590
|
+
sortText?: string;
|
|
591
|
+
onLimit?: (limit: number) => void;
|
|
592
|
+
onSort?: (sort: string) => void;
|
|
593
|
+
/** Shows 'Page X of Y'. */
|
|
594
|
+
showPageText?: boolean;
|
|
595
|
+
}
|
|
596
|
+
declare const BoundMemoryPager: <T>(p: Props$1<T>) => React.JSX.Element;
|
|
597
|
+
|
|
598
|
+
interface Props<T> extends PagerStyleProps {
|
|
599
|
+
result: PagedResult<T>;
|
|
600
|
+
onPage: (direction: 1 | -1) => void;
|
|
601
|
+
limitOptions?: number[];
|
|
602
|
+
sort?: string | number;
|
|
603
|
+
sortOptions?: {
|
|
604
|
+
id: string | number;
|
|
605
|
+
name?: string;
|
|
606
|
+
}[];
|
|
607
|
+
/** Defaults to 'Limit' */
|
|
608
|
+
limitText?: string;
|
|
609
|
+
/** Defaults to 'Sort' */
|
|
610
|
+
sortText?: string;
|
|
611
|
+
onLimit?: (limit: number) => void;
|
|
612
|
+
onSort?: (sort: string | number) => void;
|
|
613
|
+
/** Shows 'Page X of Y'. */
|
|
614
|
+
showPageText?: boolean;
|
|
615
|
+
}
|
|
616
|
+
declare const BoundStaticPager: <T>(p: Props<T>) => React.JSX.Element;
|
|
617
|
+
|
|
618
|
+
type PickerValue = string | number;
|
|
619
|
+
type PickerOption<T> = T | {
|
|
620
|
+
id: T;
|
|
621
|
+
name?: string;
|
|
622
|
+
};
|
|
623
|
+
interface SelectProps extends Omit<React.DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, 'value' | 'options' | 'string'> {
|
|
624
|
+
}
|
|
625
|
+
interface PickerProps<T extends PickerValue> extends SelectProps {
|
|
626
|
+
value: T;
|
|
627
|
+
options: PickerOption<T>[];
|
|
628
|
+
onValueChange: (value: T) => void;
|
|
629
|
+
readOnly?: boolean;
|
|
630
|
+
round?: boolean;
|
|
631
|
+
/** If true, bottom spacing will be added to account for other inputs having space for error messages.
|
|
632
|
+
* If you plan on using 'error', make sure this is also set to true so the spacing is not added and removed when the error message is toggled.
|
|
633
|
+
*/
|
|
634
|
+
controlAlign?: boolean;
|
|
635
|
+
/** An error message to display below the input. If set, 'controlAlign' will be ignored and default to 'true'. */
|
|
636
|
+
error?: string;
|
|
637
|
+
/** This will be applied to the select element. */
|
|
638
|
+
className?: string;
|
|
639
|
+
/** Applies to the outer wrapper which contains the select and other elements. */
|
|
640
|
+
wrapperClassName?: string;
|
|
641
|
+
/** Applies to the custom down arrow. */
|
|
642
|
+
iconClassName?: string;
|
|
643
|
+
}
|
|
644
|
+
declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => React.JSX.Element;
|
|
645
|
+
|
|
646
|
+
interface PopoverProps {
|
|
647
|
+
isOpen: boolean;
|
|
648
|
+
/** The content inside the popover. */
|
|
649
|
+
content: JSX.Element;
|
|
650
|
+
/** The element controlling the state of the popover. */
|
|
651
|
+
parent: JSX.Element;
|
|
652
|
+
id?: string;
|
|
653
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is true. */
|
|
654
|
+
reposition?: boolean;
|
|
655
|
+
onClickOutside?: (e: MouseEvent) => void;
|
|
656
|
+
/** Popover arrow color. Defaults to theme.colors.border. */
|
|
657
|
+
arrorColor?: string;
|
|
658
|
+
/** Popover border. Defaults to theme.controls.border. */
|
|
659
|
+
border?: string;
|
|
660
|
+
/** Popover background. Defaults to theme.colors.bg. */
|
|
661
|
+
backgroundColor?: string;
|
|
662
|
+
/** Order of positions as the Popover colides with the window edge. The default order is ['right', 'top', 'left', 'bottom']. */
|
|
663
|
+
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
664
|
+
/** Targets the wrapper around `parent`. Use if you're having positioning issues when the tooltip is showing. */
|
|
665
|
+
parentWrapperClassName?: string;
|
|
666
|
+
}
|
|
667
|
+
declare const Popover: (p: PopoverProps) => React.JSX.Element;
|
|
566
668
|
|
|
567
|
-
interface
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
interface MackinTheme {
|
|
713
|
-
colors: {
|
|
714
|
-
primary: string;
|
|
715
|
-
primaryFont: string;
|
|
716
|
-
primary2: string;
|
|
717
|
-
primary2Font: string;
|
|
718
|
-
secondary: string;
|
|
719
|
-
/** @deprecated Bad name. Use 'secondaryFont'. */
|
|
720
|
-
secondary2Font: string;
|
|
721
|
-
secondaryFont: string;
|
|
722
|
-
info: string;
|
|
723
|
-
infoFont: string;
|
|
724
|
-
warning: string;
|
|
725
|
-
warningFont: string;
|
|
726
|
-
positive: string;
|
|
727
|
-
positiveFont: string;
|
|
728
|
-
negative: string;
|
|
729
|
-
negativeFont: string;
|
|
730
|
-
omg: string;
|
|
731
|
-
omgFont: string;
|
|
732
|
-
bg: string;
|
|
733
|
-
lightBg: string;
|
|
734
|
-
font: string;
|
|
735
|
-
header: string;
|
|
736
|
-
headerFont: string;
|
|
737
|
-
link: string;
|
|
738
|
-
border: string;
|
|
739
|
-
divider: string;
|
|
740
|
-
nav: string;
|
|
741
|
-
navFont: string;
|
|
742
|
-
focusOutline: string;
|
|
743
|
-
focusOutlineRequired: string;
|
|
744
|
-
progressBg: string;
|
|
745
|
-
progressFill: string;
|
|
746
|
-
modalBg: string;
|
|
747
|
-
disabled: string;
|
|
748
|
-
textHighlight: string;
|
|
749
|
-
required: string;
|
|
750
|
-
backdrop: string;
|
|
751
|
-
pagerBg: string;
|
|
752
|
-
[key: string]: string;
|
|
753
|
-
};
|
|
754
|
-
fonts: {
|
|
755
|
-
family: string;
|
|
756
|
-
size: string;
|
|
757
|
-
sizeSmall: string;
|
|
758
|
-
sizeLarge: string;
|
|
759
|
-
headerFamily: string;
|
|
760
|
-
sizeH1: string;
|
|
761
|
-
sizeH2: string;
|
|
762
|
-
sizeH3: string;
|
|
763
|
-
sizeH4: string;
|
|
764
|
-
};
|
|
765
|
-
controls: {
|
|
766
|
-
padding: string;
|
|
767
|
-
fontSize: string;
|
|
768
|
-
borderWidth: string;
|
|
769
|
-
border: string;
|
|
770
|
-
borderRadius: string;
|
|
771
|
-
height: string;
|
|
772
|
-
heightSmall: string;
|
|
773
|
-
boxShadow: string;
|
|
774
|
-
/** For controls with a background color. */
|
|
775
|
-
hoverBrightness: string;
|
|
776
|
-
/** For controls without a background color. */
|
|
777
|
-
hoverBackground: string;
|
|
778
|
-
transitionDuration: string;
|
|
779
|
-
transitionEasing: string;
|
|
780
|
-
transition: string;
|
|
781
|
-
focusOutlineShadow: string;
|
|
782
|
-
focusOutlineRequiredShadow: string;
|
|
783
|
-
roundRadius: string;
|
|
784
|
-
disabledOpacity: string;
|
|
785
|
-
formButtonMinWidth: string;
|
|
786
|
-
gap: string;
|
|
787
|
-
dividerMargin: string;
|
|
788
|
-
dividerBorder: string;
|
|
789
|
-
dividerThickness: string;
|
|
790
|
-
headerBoxShadow: string;
|
|
791
|
-
buttonBoxShadow: string;
|
|
792
|
-
inputErrorMinHeight: string;
|
|
793
|
-
paragraphPadding: string;
|
|
794
|
-
};
|
|
795
|
-
zIndexes: {
|
|
796
|
-
header: number;
|
|
797
|
-
backdrop: number;
|
|
798
|
-
nav: number;
|
|
799
|
-
flyout: number;
|
|
800
|
-
modal: number;
|
|
801
|
-
tooltip: number;
|
|
802
|
-
};
|
|
803
|
-
layout: {
|
|
804
|
-
headerHeight: string;
|
|
805
|
-
headerBodyOffset: string;
|
|
806
|
-
navWidth: string;
|
|
807
|
-
};
|
|
808
|
-
breakpoints: {
|
|
809
|
-
desktop: string;
|
|
810
|
-
tablet: string;
|
|
811
|
-
};
|
|
812
|
-
mediaQueries: {
|
|
813
|
-
desktop: string;
|
|
814
|
-
tablet: string;
|
|
815
|
-
};
|
|
816
|
-
timings: {
|
|
817
|
-
nav: {
|
|
818
|
-
slideMs: number;
|
|
819
|
-
};
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
/** Call this on your theme after messing with the props. It will re-build things that depend on sizes and colors. */
|
|
823
|
-
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
|
669
|
+
interface ProgressBarProps {
|
|
670
|
+
pct: number;
|
|
671
|
+
round?: boolean;
|
|
672
|
+
showPct?: boolean;
|
|
673
|
+
className?: string;
|
|
674
|
+
}
|
|
675
|
+
declare const ProgressBar: (props: {
|
|
676
|
+
pct: number;
|
|
677
|
+
round?: boolean;
|
|
678
|
+
showPct?: boolean;
|
|
679
|
+
className?: string;
|
|
680
|
+
}) => React.JSX.Element;
|
|
681
|
+
|
|
682
|
+
type BaseProps$1 = Omit<TextInputProps, 'rightControl' | 'wrapperClassName' | 'type' | 'className'> & InputOnFocusProps;
|
|
683
|
+
interface SearchBoxProps extends BaseProps$1 {
|
|
684
|
+
/** This will be applied to the containing element (Form or DIV when 'noForm'=true). */
|
|
685
|
+
wrapperClassName?: string;
|
|
686
|
+
buttonClassName?: string;
|
|
687
|
+
inputWrapperClassName?: string;
|
|
688
|
+
inputClassName?: string;
|
|
689
|
+
/** This will be ignored if 'noForm' is true. */
|
|
690
|
+
onSubmit?: () => Promise<void>;
|
|
691
|
+
/** If true, the controls will not be wrapped in a Form component. In addition, 'onSubmit' will be ignored. */
|
|
692
|
+
noForm?: boolean;
|
|
693
|
+
/** If true, the onSubmit handler will not be called when the input value is nullish or empty string. Defaults to 'true'. */
|
|
694
|
+
noSubmitWhenEmpty?: boolean;
|
|
695
|
+
/** The submit button will change to clear if present and there is a value. */
|
|
696
|
+
onClear?: () => void;
|
|
697
|
+
}
|
|
698
|
+
declare const SearchBox: React.ForwardRefExoticComponent<Omit<SearchBoxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
699
|
+
|
|
700
|
+
type Alignment = 'left' | 'right' | 'center';
|
|
701
|
+
|
|
702
|
+
declare const GlobalStyles: () => null;
|
|
703
|
+
|
|
704
|
+
interface MackinTheme {
|
|
705
|
+
colors: {
|
|
706
|
+
primary: string;
|
|
707
|
+
primaryFont: string;
|
|
708
|
+
primary2: string;
|
|
709
|
+
primary2Font: string;
|
|
710
|
+
secondary: string;
|
|
711
|
+
secondaryFont: string;
|
|
712
|
+
info: string;
|
|
713
|
+
infoFont: string;
|
|
714
|
+
warning: string;
|
|
715
|
+
warningFont: string;
|
|
716
|
+
positive: string;
|
|
717
|
+
positiveFont: string;
|
|
718
|
+
negative: string;
|
|
719
|
+
negativeFont: string;
|
|
720
|
+
omg: string;
|
|
721
|
+
omgFont: string;
|
|
722
|
+
bg: string;
|
|
723
|
+
lightBg: string;
|
|
724
|
+
font: string;
|
|
725
|
+
header: string;
|
|
726
|
+
headerFont: string;
|
|
727
|
+
link: string;
|
|
728
|
+
border: string;
|
|
729
|
+
divider: string;
|
|
730
|
+
nav: string;
|
|
731
|
+
navFont: string;
|
|
732
|
+
focusOutline: string;
|
|
733
|
+
focusOutlineRequired: string;
|
|
734
|
+
progressBg: string;
|
|
735
|
+
progressFill: string;
|
|
736
|
+
modalBg: string;
|
|
737
|
+
disabled: string;
|
|
738
|
+
textHighlight: string;
|
|
739
|
+
required: string;
|
|
740
|
+
backdrop: string;
|
|
741
|
+
pagerBg: string;
|
|
742
|
+
[key: string]: string;
|
|
743
|
+
};
|
|
744
|
+
fonts: {
|
|
745
|
+
family: string;
|
|
746
|
+
size: string;
|
|
747
|
+
sizeSmall: string;
|
|
748
|
+
sizeLarge: string;
|
|
749
|
+
headerFamily: string;
|
|
750
|
+
sizeH1: string;
|
|
751
|
+
sizeH2: string;
|
|
752
|
+
sizeH3: string;
|
|
753
|
+
sizeH4: string;
|
|
754
|
+
};
|
|
755
|
+
controls: {
|
|
756
|
+
padding: string;
|
|
757
|
+
fontSize: string;
|
|
758
|
+
borderWidth: string;
|
|
759
|
+
border: string;
|
|
760
|
+
borderRadius: string;
|
|
761
|
+
height: string;
|
|
762
|
+
heightSmall: string;
|
|
763
|
+
boxShadow: string;
|
|
764
|
+
/** For controls with a background color. */
|
|
765
|
+
hoverBrightness: string;
|
|
766
|
+
/** For controls without a background color. */
|
|
767
|
+
hoverBackground: string;
|
|
768
|
+
transitionDuration: string;
|
|
769
|
+
transitionEasing: string;
|
|
770
|
+
transition: string;
|
|
771
|
+
focusOutlineShadow: string;
|
|
772
|
+
focusOutlineRequiredShadow: string;
|
|
773
|
+
roundRadius: string;
|
|
774
|
+
disabledOpacity: string;
|
|
775
|
+
formButtonMinWidth: string;
|
|
776
|
+
gap: string;
|
|
777
|
+
dividerMargin: string;
|
|
778
|
+
dividerBorder: string;
|
|
779
|
+
dividerThickness: string;
|
|
780
|
+
headerBoxShadow: string;
|
|
781
|
+
buttonBoxShadow: string;
|
|
782
|
+
inputErrorMinHeight: string;
|
|
783
|
+
paragraphPadding: string;
|
|
784
|
+
};
|
|
785
|
+
zIndexes: {
|
|
786
|
+
header: number;
|
|
787
|
+
backdrop: number;
|
|
788
|
+
nav: number;
|
|
789
|
+
flyout: number;
|
|
790
|
+
modal: number;
|
|
791
|
+
tooltip: number;
|
|
792
|
+
};
|
|
793
|
+
layout: {
|
|
794
|
+
headerHeight: string;
|
|
795
|
+
headerBodyOffset: string;
|
|
796
|
+
navWidth: string;
|
|
797
|
+
};
|
|
798
|
+
breakpoints: {
|
|
799
|
+
desktop: string;
|
|
800
|
+
tablet: string;
|
|
801
|
+
};
|
|
802
|
+
mediaQueries: {
|
|
803
|
+
desktop: string;
|
|
804
|
+
tablet: string;
|
|
805
|
+
};
|
|
806
|
+
timings: {
|
|
807
|
+
nav: {
|
|
808
|
+
slideMs: number;
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
/** Call this on your theme after messing with the props. It will re-build things that depend on sizes and colors. */
|
|
813
|
+
declare const calcDynamicThemeProps: <T extends MackinTheme>(theme: T) => void;
|
|
824
814
|
declare const defaultTheme: MackinTheme;
|
|
825
815
|
|
|
826
|
-
declare const ThemeProvider: <T extends MackinTheme>(p: {
|
|
827
|
-
children?: ReactNode;
|
|
828
|
-
theme: T;
|
|
829
|
-
}) => JSX.Element;
|
|
816
|
+
declare const ThemeProvider: <T extends MackinTheme>(p: {
|
|
817
|
+
children?: ReactNode;
|
|
818
|
+
theme: T;
|
|
819
|
+
}) => React__default.JSX.Element;
|
|
830
820
|
|
|
831
|
-
/** React wrapper around window resizing and window.matchMedia.
|
|
832
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
|
|
833
|
-
*/
|
|
821
|
+
/** React wrapper around window resizing and window.matchMedia.
|
|
822
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
|
|
823
|
+
*/
|
|
834
824
|
declare const useMediaQuery: (query: string) => boolean;
|
|
835
825
|
|
|
836
|
-
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
826
|
+
/** Returns a user-provided theme if ThemeProvider was used correctly, or the default theme. */
|
|
837
827
|
declare const useThemeSafely: () => MackinTheme;
|
|
838
828
|
|
|
839
|
-
|
|
840
|
-
interface SliderProps<T extends SliderValue> {
|
|
841
|
-
min: number;
|
|
842
|
-
max: number;
|
|
843
|
-
value: T;
|
|
844
|
-
id?: string;
|
|
845
|
-
/** Default is 1. */
|
|
846
|
-
step?: number;
|
|
847
|
-
/** Shows the current value above each handle. */
|
|
848
|
-
showValue?: boolean;
|
|
849
|
-
onChange: (value: T) => void;
|
|
850
|
-
onUpdate?: (value: T) => void;
|
|
851
|
-
/** Used with showValue. Will be called to render the display string. */
|
|
852
|
-
renderValue?: (value: number) => string;
|
|
853
|
-
/** Used with renderValue for the custom element width. Defaults to theme.controls.height * 2. */
|
|
854
|
-
renderValueWidth?: string;
|
|
855
|
-
/** The with and height of the handles. Defaults to theme.controls.height. Do not use css to change the handle sizes. */
|
|
856
|
-
sliderHandleSize?: string;
|
|
857
|
-
/** Styles of the overall slider. */
|
|
858
|
-
className?: string;
|
|
859
|
-
/** Styles for the slider handles. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
860
|
-
handleClassName?: string;
|
|
861
|
-
/** Styles for the first handle. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
862
|
-
handle1ClassName?: string;
|
|
863
|
-
/** Styles for the second handle. Ignored if the value is not an array. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
864
|
-
handle2ClassName?: string;
|
|
865
|
-
/** Styles of the track. */
|
|
866
|
-
trackClassName?: string;
|
|
867
|
-
/** Styles applied to the track between two handlers. Ignored if the value is not an array. */
|
|
868
|
-
innerTrackClassName?: string;
|
|
869
|
-
/** Styles applied to the floating handle text with using 'showValue'. */
|
|
870
|
-
sliderTextClassName?: string;
|
|
871
|
-
}
|
|
872
|
-
declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => JSX.Element;
|
|
873
|
-
|
|
874
|
-
interface TabHeaderTabProps {
|
|
875
|
-
name: string | JSX.Element;
|
|
876
|
-
/** The HTML title of the tab button. Defaults to 'name' prop. */
|
|
877
|
-
title?: string;
|
|
878
|
-
}
|
|
879
|
-
interface TabHeaderProps {
|
|
880
|
-
tabs: TabHeaderTabProps[];
|
|
881
|
-
id?: string;
|
|
882
|
-
/** Defaults to 10rem. */
|
|
883
|
-
maxTabWidth?: string;
|
|
884
|
-
/** Defaults to 'tab'. */
|
|
885
|
-
variant?: 'tab' | 'button';
|
|
886
|
-
containerClassName?: string;
|
|
887
|
-
tabClassName?: string;
|
|
888
|
-
tabHeaderDividerClassName?: string;
|
|
889
|
-
/** Defaults to 0. */
|
|
890
|
-
startingIndex?: number;
|
|
891
|
-
onTabChanged?: (tabIndex: number) => void;
|
|
892
|
-
/** If present, tab change will be delayed until this method resolves. */
|
|
893
|
-
onBeforeTabChanged?: (tabIndex: number) => Promise<void>;
|
|
894
|
-
}
|
|
895
|
-
declare const TabHeader: (p: TabHeaderProps) => JSX.Element;
|
|
896
|
-
|
|
897
|
-
declare const Table: (props: {
|
|
898
|
-
caption?: string | JSX.Element;
|
|
899
|
-
children?:
|
|
900
|
-
noCellBorder?: boolean;
|
|
901
|
-
/** Styles applied to the table element. */
|
|
902
|
-
className?: string;
|
|
903
|
-
/** Colors alternate rows. */
|
|
904
|
-
altRows?: boolean;
|
|
905
|
-
/** Styles applied to the table wrapper scroll container. */
|
|
906
|
-
wrapperClassName?: string;
|
|
907
|
-
}) => JSX.Element;
|
|
908
|
-
declare const Tr: (props: {
|
|
909
|
-
className?: string;
|
|
910
|
-
children?:
|
|
911
|
-
}) => JSX.Element;
|
|
912
|
-
declare const Th: (props: {
|
|
913
|
-
children?:
|
|
914
|
-
align?: Alignment;
|
|
915
|
-
width?: string;
|
|
916
|
-
style?: React.CSSProperties;
|
|
917
|
-
className?: string;
|
|
918
|
-
}) => JSX.Element;
|
|
919
|
-
declare const Td: (props: {
|
|
920
|
-
children?:
|
|
921
|
-
align?: Alignment;
|
|
922
|
-
style?: React.CSSProperties;
|
|
923
|
-
colSpan?: number;
|
|
924
|
-
className?: string;
|
|
925
|
-
}) => JSX.Element;
|
|
926
|
-
|
|
927
|
-
declare const TdCurrency: (props: {
|
|
928
|
-
value: number;
|
|
929
|
-
cents?: boolean;
|
|
930
|
-
}) => JSX.Element;
|
|
931
|
-
|
|
932
|
-
declare const TdNumber: (props: {
|
|
933
|
-
value: number;
|
|
934
|
-
}) => JSX.Element;
|
|
935
|
-
|
|
936
|
-
declare const ThSort: (props: {
|
|
937
|
-
text: string | JSX.Element;
|
|
938
|
-
onClick: () => void;
|
|
939
|
-
align?: Alignment;
|
|
940
|
-
direction?: 'asc' | 'desc';
|
|
941
|
-
style?: React.CSSProperties;
|
|
942
|
-
width?: string;
|
|
943
|
-
rightContent?: JSX.Element;
|
|
944
|
-
}) => JSX.Element;
|
|
945
|
-
|
|
946
|
-
declare const TabLocker: (props: {
|
|
947
|
-
disabled?: boolean;
|
|
948
|
-
children?: React.ReactNode;
|
|
949
|
-
style?: React.CSSProperties;
|
|
950
|
-
}) => JSX.Element;
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
interface TextProps {
|
|
954
|
-
children:
|
|
955
|
-
/** Defaults to 'p'. */
|
|
956
|
-
tag?: SupportedTags;
|
|
957
|
-
align?: Alignment;
|
|
958
|
-
bold?: boolean;
|
|
959
|
-
italics?: boolean;
|
|
960
|
-
className?: string;
|
|
961
|
-
/** You will need to set a width or max-width on the element for this to work. */
|
|
962
|
-
ellipsis?: boolean;
|
|
963
|
-
style?: React.CSSProperties;
|
|
964
|
-
/** Applies `theme.fonts.sizeSmall` to the font-size. */
|
|
965
|
-
smaller?: boolean;
|
|
966
|
-
/** Applies `theme.fonts.sizeLarge` to the font-size. */
|
|
967
|
-
larger?: boolean;
|
|
968
|
-
/** Overrides the theme font-size. */
|
|
969
|
-
fontSize?: string | number;
|
|
970
|
-
spacedOut?: boolean;
|
|
971
|
-
lineClamp?: number;
|
|
972
|
-
/** Will remove all margin/padding from specified tag */
|
|
973
|
-
noPad?: boolean;
|
|
974
|
-
leftPad?: string;
|
|
975
|
-
}
|
|
976
|
-
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
977
|
-
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
978
|
-
style: React.CSSProperties;
|
|
979
|
-
className: string;
|
|
829
|
+
type SliderValue = number | [number, number];
|
|
830
|
+
interface SliderProps<T extends SliderValue> {
|
|
831
|
+
min: number;
|
|
832
|
+
max: number;
|
|
833
|
+
value: T;
|
|
834
|
+
id?: string;
|
|
835
|
+
/** Default is 1. */
|
|
836
|
+
step?: number;
|
|
837
|
+
/** Shows the current value above each handle. */
|
|
838
|
+
showValue?: boolean;
|
|
839
|
+
onChange: (value: T) => void;
|
|
840
|
+
onUpdate?: (value: T) => void;
|
|
841
|
+
/** Used with showValue. Will be called to render the display string. */
|
|
842
|
+
renderValue?: (value: number) => string;
|
|
843
|
+
/** Used with renderValue for the custom element width. Defaults to theme.controls.height * 2. */
|
|
844
|
+
renderValueWidth?: string;
|
|
845
|
+
/** The with and height of the handles. Defaults to theme.controls.height. Do not use css to change the handle sizes. */
|
|
846
|
+
sliderHandleSize?: string;
|
|
847
|
+
/** Styles of the overall slider. */
|
|
848
|
+
className?: string;
|
|
849
|
+
/** Styles for the slider handles. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
850
|
+
handleClassName?: string;
|
|
851
|
+
/** Styles for the first handle. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
852
|
+
handle1ClassName?: string;
|
|
853
|
+
/** Styles for the second handle. Ignored if the value is not an array. Do not use css to change the handle sizes. Use 'sliderHandleSize'. */
|
|
854
|
+
handle2ClassName?: string;
|
|
855
|
+
/** Styles of the track. */
|
|
856
|
+
trackClassName?: string;
|
|
857
|
+
/** Styles applied to the track between two handlers. Ignored if the value is not an array. */
|
|
858
|
+
innerTrackClassName?: string;
|
|
859
|
+
/** Styles applied to the floating handle text with using 'showValue'. */
|
|
860
|
+
sliderTextClassName?: string;
|
|
861
|
+
}
|
|
862
|
+
declare const Slider: <T extends SliderValue>(p: SliderProps<T>) => React__default.JSX.Element;
|
|
863
|
+
|
|
864
|
+
interface TabHeaderTabProps {
|
|
865
|
+
name: string | JSX.Element;
|
|
866
|
+
/** The HTML title of the tab button. Defaults to 'name' prop. */
|
|
867
|
+
title?: string;
|
|
868
|
+
}
|
|
869
|
+
interface TabHeaderProps {
|
|
870
|
+
tabs: TabHeaderTabProps[];
|
|
871
|
+
id?: string;
|
|
872
|
+
/** Defaults to 10rem. */
|
|
873
|
+
maxTabWidth?: string;
|
|
874
|
+
/** Defaults to 'tab'. */
|
|
875
|
+
variant?: 'tab' | 'button';
|
|
876
|
+
containerClassName?: string;
|
|
877
|
+
tabClassName?: string;
|
|
878
|
+
tabHeaderDividerClassName?: string;
|
|
879
|
+
/** Defaults to 0. */
|
|
880
|
+
startingIndex?: number;
|
|
881
|
+
onTabChanged?: (tabIndex: number) => void;
|
|
882
|
+
/** If present, tab change will be delayed until this method resolves. */
|
|
883
|
+
onBeforeTabChanged?: (tabIndex: number) => Promise<void>;
|
|
884
|
+
}
|
|
885
|
+
declare const TabHeader: (p: TabHeaderProps) => React.JSX.Element;
|
|
886
|
+
|
|
887
|
+
declare const Table: (props: {
|
|
888
|
+
caption?: string | JSX.Element;
|
|
889
|
+
children?: React.ReactNode;
|
|
890
|
+
noCellBorder?: boolean;
|
|
891
|
+
/** Styles applied to the table element. */
|
|
892
|
+
className?: string;
|
|
893
|
+
/** Colors alternate rows. */
|
|
894
|
+
altRows?: boolean;
|
|
895
|
+
/** Styles applied to the table wrapper scroll container. */
|
|
896
|
+
wrapperClassName?: string;
|
|
897
|
+
}) => React.JSX.Element;
|
|
898
|
+
declare const Tr: (props: {
|
|
899
|
+
className?: string;
|
|
900
|
+
children?: React.ReactNode;
|
|
901
|
+
}) => React.JSX.Element;
|
|
902
|
+
declare const Th: (props: {
|
|
903
|
+
children?: React.ReactNode;
|
|
904
|
+
align?: Alignment;
|
|
905
|
+
width?: string;
|
|
906
|
+
style?: React.CSSProperties;
|
|
907
|
+
className?: string;
|
|
908
|
+
}) => React.JSX.Element;
|
|
909
|
+
declare const Td: (props: {
|
|
910
|
+
children?: React.ReactNode;
|
|
911
|
+
align?: Alignment;
|
|
912
|
+
style?: React.CSSProperties;
|
|
913
|
+
colSpan?: number;
|
|
914
|
+
className?: string;
|
|
915
|
+
}) => React.JSX.Element;
|
|
916
|
+
|
|
917
|
+
declare const TdCurrency: (props: {
|
|
918
|
+
value: number;
|
|
919
|
+
cents?: boolean;
|
|
920
|
+
}) => React.JSX.Element;
|
|
921
|
+
|
|
922
|
+
declare const TdNumber: (props: {
|
|
923
|
+
value: number;
|
|
924
|
+
}) => React.JSX.Element;
|
|
925
|
+
|
|
926
|
+
declare const ThSort: (props: {
|
|
927
|
+
text: string | JSX.Element;
|
|
928
|
+
onClick: () => void;
|
|
929
|
+
align?: Alignment;
|
|
930
|
+
direction?: 'asc' | 'desc';
|
|
931
|
+
style?: React.CSSProperties;
|
|
932
|
+
width?: string;
|
|
933
|
+
rightContent?: JSX.Element;
|
|
934
|
+
}) => React.JSX.Element;
|
|
935
|
+
|
|
936
|
+
declare const TabLocker: (props: {
|
|
937
|
+
disabled?: boolean;
|
|
938
|
+
children?: React.ReactNode;
|
|
939
|
+
style?: React.CSSProperties;
|
|
940
|
+
}) => React.JSX.Element;
|
|
941
|
+
|
|
942
|
+
type SupportedTags = 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'span' | 'div';
|
|
943
|
+
interface TextProps {
|
|
944
|
+
children: React.ReactNode;
|
|
945
|
+
/** Defaults to 'p'. */
|
|
946
|
+
tag?: SupportedTags;
|
|
947
|
+
align?: Alignment;
|
|
948
|
+
bold?: boolean;
|
|
949
|
+
italics?: boolean;
|
|
950
|
+
className?: string;
|
|
951
|
+
/** You will need to set a width or max-width on the element for this to work. */
|
|
952
|
+
ellipsis?: boolean;
|
|
953
|
+
style?: React.CSSProperties;
|
|
954
|
+
/** Applies `theme.fonts.sizeSmall` to the font-size. */
|
|
955
|
+
smaller?: boolean;
|
|
956
|
+
/** Applies `theme.fonts.sizeLarge` to the font-size. */
|
|
957
|
+
larger?: boolean;
|
|
958
|
+
/** Overrides the theme font-size. */
|
|
959
|
+
fontSize?: string | number;
|
|
960
|
+
spacedOut?: boolean;
|
|
961
|
+
lineClamp?: number;
|
|
962
|
+
/** Will remove all margin/padding from specified tag */
|
|
963
|
+
noPad?: boolean;
|
|
964
|
+
leftPad?: string;
|
|
965
|
+
}
|
|
966
|
+
/** Wraps common needs for displaying text. Use for all text-containing elements to save on duplicated styling. */
|
|
967
|
+
declare const Text: (props: TextProps) => React.DetailedReactHTMLElement<{
|
|
968
|
+
style: React.CSSProperties;
|
|
969
|
+
className: string;
|
|
980
970
|
}, HTMLElement>;
|
|
981
971
|
|
|
982
|
-
|
|
983
|
-
interface TextAreaProps extends BaseProps {
|
|
984
|
-
value?: string;
|
|
985
|
-
/** By default all leading and trailing whitespace will be cleared on blur. */
|
|
986
|
-
noTrim?: boolean;
|
|
987
|
-
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
988
|
-
customError?: string;
|
|
989
|
-
/** onValueChange will report the local value even if the control is flagged as invalid. Defaults to false. */
|
|
990
|
-
reportValueOnError?: boolean;
|
|
991
|
-
/** Will show validation below the input. Defaults to 'true'. */
|
|
992
|
-
showErrorDisplay?: boolean;
|
|
993
|
-
onValueChange: (value: string | undefined) => void;
|
|
994
|
-
}
|
|
995
|
-
declare const TextArea: React.ForwardRefExoticComponent<
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
interface ToggleButtonProps extends PartialButtonProps {
|
|
1000
|
-
checked: boolean;
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
/** useEffect but it will only fire when the actual truthiness of the value changes.
|
|
1054
|
-
* Use for comparing previous states to next states without all the bullshit around useEffect and component mounting.
|
|
1055
|
-
*/
|
|
972
|
+
type BaseProps = Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'value'> & InputOnFocusProps;
|
|
973
|
+
interface TextAreaProps extends BaseProps {
|
|
974
|
+
value?: string;
|
|
975
|
+
/** By default all leading and trailing whitespace will be cleared on blur. */
|
|
976
|
+
noTrim?: boolean;
|
|
977
|
+
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
978
|
+
customError?: string;
|
|
979
|
+
/** onValueChange will report the local value even if the control is flagged as invalid. Defaults to false. */
|
|
980
|
+
reportValueOnError?: boolean;
|
|
981
|
+
/** Will show validation below the input. Defaults to 'true'. */
|
|
982
|
+
showErrorDisplay?: boolean;
|
|
983
|
+
onValueChange: (value: string | undefined) => void;
|
|
984
|
+
}
|
|
985
|
+
declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
986
|
+
|
|
987
|
+
type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
988
|
+
type PartialButtonProps = Omit<ButtonProps, 'variant' | 'rightIcon' | 'leftIcon' | 'children'>;
|
|
989
|
+
interface ToggleButtonProps extends PartialButtonProps {
|
|
990
|
+
checked: boolean;
|
|
991
|
+
checkedChildren?: React.ReactNode;
|
|
992
|
+
uncheckedChildren?: React.ReactNode;
|
|
993
|
+
variant?: ToggleButtonVariant;
|
|
994
|
+
checkedVariant?: ToggleButtonVariant;
|
|
995
|
+
checkedClassName?: string;
|
|
996
|
+
checkedStyle?: React.CSSProperties;
|
|
997
|
+
checkedIcon?: JSX.Element;
|
|
998
|
+
uncheckedIcon?: JSX.Element;
|
|
999
|
+
}
|
|
1000
|
+
declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ToggleButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
1001
|
+
|
|
1002
|
+
interface ToggleButtonGroupProps {
|
|
1003
|
+
value: string | number;
|
|
1004
|
+
options: {
|
|
1005
|
+
id: string | number;
|
|
1006
|
+
name: string | JSX.Element;
|
|
1007
|
+
rightIcon?: JSX.Element;
|
|
1008
|
+
activeClass?: string;
|
|
1009
|
+
}[];
|
|
1010
|
+
onChange: (value: string | number) => void;
|
|
1011
|
+
className?: string;
|
|
1012
|
+
disabled?: boolean;
|
|
1013
|
+
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
1014
|
+
enforceMinWidth?: boolean;
|
|
1015
|
+
round?: boolean;
|
|
1016
|
+
small?: boolean;
|
|
1017
|
+
width?: string;
|
|
1018
|
+
}
|
|
1019
|
+
declare const ToggleButtonGroup: (props: ToggleButtonGroupProps) => React.JSX.Element;
|
|
1020
|
+
|
|
1021
|
+
interface TogglePasswordInputProps extends Omit<TextInputProps, 'type' | 'rightControl'> {
|
|
1022
|
+
onVisibilityChanged?: (visible: boolean) => void;
|
|
1023
|
+
}
|
|
1024
|
+
declare const TogglePasswordInput: React.ForwardRefExoticComponent<Omit<TogglePasswordInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
1025
|
+
|
|
1026
|
+
declare const WaitingIndicator: (p: {
|
|
1027
|
+
show: boolean;
|
|
1028
|
+
minShowTimeMs?: number;
|
|
1029
|
+
id?: string;
|
|
1030
|
+
__debug?: boolean;
|
|
1031
|
+
}) => React__default.JSX.Element;
|
|
1032
|
+
|
|
1033
|
+
/** Tells you actual width of the scroll bar. This can vary by browser. */
|
|
1034
|
+
declare const useScrollbarSize: (recalc?: boolean) => number;
|
|
1035
|
+
|
|
1036
|
+
/** Provides stateful notifications around async calls. */
|
|
1037
|
+
declare const useWaiting: <TArgs extends unknown[], TReturn>(func: (...args: TArgs) => Promise<TReturn>) => [boolean, (...args: TArgs) => Promise<TReturn>];
|
|
1038
|
+
|
|
1039
|
+
/** useEffect but it will only fire when the actual truthiness of the value changes.
|
|
1040
|
+
* Use for comparing previous states to next states without all the bullshit around useEffect and component mounting.
|
|
1041
|
+
*/
|
|
1056
1042
|
declare const useBooleanChanged: (effect: (current: boolean, previous: boolean) => void, dep: boolean | undefined) => void;
|
|
1057
1043
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
/** Resets certain styles so there is more consistancy between browsers. */
|
|
1061
|
-
declare const NormalizeCss: (p: NormalizeCssProps) => null;
|
|
1044
|
+
/** Resets certain styles so there is more consistancy between browsers. */
|
|
1045
|
+
declare const NormalizeCss: () => null;
|
|
1062
1046
|
|
|
1063
|
-
/** Displays the value in American dollars. */
|
|
1064
|
-
declare const getCurrencyDisplay: (value: number, isCents?: boolean
|
|
1047
|
+
/** Displays the value in American dollars. */
|
|
1048
|
+
declare const getCurrencyDisplay: (value: number, isCents?: boolean, denomination?: string) => string;
|
|
1065
1049
|
|
|
1066
|
-
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
1067
|
-
declare const enumToEntities: <T extends {
|
|
1068
|
-
[key: string]: string | number;
|
|
1069
|
-
}>(enumObj: T) => {
|
|
1070
|
-
id: string | number;
|
|
1071
|
-
name: string;
|
|
1050
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
1051
|
+
declare const enumToEntities: <T extends {
|
|
1052
|
+
[key: string]: string | number;
|
|
1053
|
+
}>(enumObj: T) => {
|
|
1054
|
+
id: string | number;
|
|
1055
|
+
name: string;
|
|
1072
1056
|
}[];
|
|
1073
1057
|
|
|
1074
|
-
interface LinkContentProps {
|
|
1075
|
-
rightIcon?: JSX.Element;
|
|
1076
|
-
leftIcon?: JSX.Element;
|
|
1077
|
-
children?: ReactNode;
|
|
1078
|
-
waiting?: boolean;
|
|
1058
|
+
interface LinkContentProps {
|
|
1059
|
+
rightIcon?: JSX.Element;
|
|
1060
|
+
leftIcon?: JSX.Element;
|
|
1061
|
+
children?: ReactNode;
|
|
1062
|
+
waiting?: boolean;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
interface LinkProps extends LinkContentProps, React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
1066
|
+
href: string;
|
|
1067
|
+
block?: boolean;
|
|
1068
|
+
/** Full width with max space between the text and the icon */
|
|
1069
|
+
iconBlock?: boolean;
|
|
1070
|
+
/** Corresponds to the button variants of the same name. */
|
|
1071
|
+
variant?: 'button' | 'label' | 'icon' | 'circle' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative' | 'text';
|
|
1072
|
+
/** Only for button variants. */
|
|
1073
|
+
round?: boolean;
|
|
1074
|
+
/** Only for button variants. */
|
|
1075
|
+
small?: boolean;
|
|
1076
|
+
/** Only for button variants. */
|
|
1077
|
+
waiting?: boolean;
|
|
1078
|
+
disabled?: boolean;
|
|
1079
|
+
/** Overrides the `theme.colors.link` for non-button variants or `theme.colors.font` for the `button` variant. Does not apply to themed button variants like `primary`. */
|
|
1080
|
+
colorOverride?: string;
|
|
1079
1081
|
}
|
|
1082
|
+
declare const Link: (props: LinkProps) => React.JSX.Element;
|
|
1080
1083
|
|
|
1081
|
-
interface
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
/**
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
maxTabWidth?: string;
|
|
1116
|
-
/** Defaults to 'tab'. */
|
|
1117
|
-
variant?: 'tab' | 'button';
|
|
1118
|
-
contentClassName?: string;
|
|
1119
|
-
/** This is applied to the `containerClassName` prop of TabHeader. */
|
|
1120
|
-
tabHeaderClassName?: string;
|
|
1121
|
-
/** This is applied to the `tabClassName` prop of TabHeader. */
|
|
1122
|
-
tabClassName?: string;
|
|
1123
|
-
/** This is applied to the `tabHeaderDividerClassName` prop of TabHeader. */
|
|
1124
|
-
tabHeaderDividerClassName?: string;
|
|
1125
|
-
/** Defaults to 0. */
|
|
1126
|
-
startingIndex?: number;
|
|
1127
|
-
onTabChanged?: (tabIndex: number) => void;
|
|
1128
|
-
/** If present, tab change will be delayed until this method resolves. */
|
|
1129
|
-
onBeforeTabChanged?: (tabIndex: number) => Promise<void>;
|
|
1130
|
-
}
|
|
1131
|
-
declare const TabContainer: (p: TabContainerProps) => JSX.Element;
|
|
1132
|
-
|
|
1133
|
-
/** Add to fixed positioned elements so their contents do not jump around when scrolling is disabled. */
|
|
1084
|
+
interface ThemeRendererProps extends MackinTheme {
|
|
1085
|
+
backgroundColor?: string;
|
|
1086
|
+
color?: string;
|
|
1087
|
+
}
|
|
1088
|
+
declare const ThemeRenderer: (p: ThemeRendererProps) => React.JSX.Element;
|
|
1089
|
+
|
|
1090
|
+
interface TabContainerProps {
|
|
1091
|
+
tabs: {
|
|
1092
|
+
name: string | JSX.Element;
|
|
1093
|
+
/** The HTML title of the tab button. Defaults to 'name' prop. */
|
|
1094
|
+
title?: string;
|
|
1095
|
+
getContent: () => JSX.Element;
|
|
1096
|
+
}[];
|
|
1097
|
+
id?: string;
|
|
1098
|
+
/** Defaults to 10rem. */
|
|
1099
|
+
maxTabWidth?: string;
|
|
1100
|
+
/** Defaults to 'tab'. */
|
|
1101
|
+
variant?: 'tab' | 'button';
|
|
1102
|
+
contentClassName?: string;
|
|
1103
|
+
/** This is applied to the `containerClassName` prop of TabHeader. */
|
|
1104
|
+
tabHeaderClassName?: string;
|
|
1105
|
+
/** This is applied to the `tabClassName` prop of TabHeader. */
|
|
1106
|
+
tabClassName?: string;
|
|
1107
|
+
/** This is applied to the `tabHeaderDividerClassName` prop of TabHeader. */
|
|
1108
|
+
tabHeaderDividerClassName?: string;
|
|
1109
|
+
/** Defaults to 0. */
|
|
1110
|
+
startingIndex?: number;
|
|
1111
|
+
onTabChanged?: (tabIndex: number) => void;
|
|
1112
|
+
/** If present, tab change will be delayed until this method resolves. */
|
|
1113
|
+
onBeforeTabChanged?: (tabIndex: number) => Promise<void>;
|
|
1114
|
+
}
|
|
1115
|
+
declare const TabContainer: (p: TabContainerProps) => React.JSX.Element;
|
|
1116
|
+
|
|
1117
|
+
/** Add to fixed positioned elements so their contents do not jump around when scrolling is disabled. */
|
|
1134
1118
|
declare const modalScrollFixClassName = "modal-scroll-fix";
|
|
1135
1119
|
|
|
1136
|
-
interface AutoCompleteConfig {
|
|
1137
|
-
/** Number of characters entered before getOptions is called. Defaults to 3. */
|
|
1138
|
-
minChars?: number;
|
|
1139
|
-
/** Number of ms to debounce prior to calling getOptions on change. Defaults to no debounce. */
|
|
1140
|
-
debounceMs?: number;
|
|
1120
|
+
interface AutoCompleteConfig {
|
|
1121
|
+
/** Number of characters entered before getOptions is called. Defaults to 3. */
|
|
1122
|
+
minChars?: number;
|
|
1123
|
+
/** Number of ms to debounce prior to calling getOptions on change. Defaults to no debounce. */
|
|
1124
|
+
debounceMs?: number;
|
|
1141
1125
|
}
|
|
1142
1126
|
|
|
1143
|
-
declare class AutocompleteController {
|
|
1144
|
-
constructor(getOptions: (value: string | undefined) => Promise<string[]>, config?: AutoCompleteConfig);
|
|
1145
|
-
get value(): string | undefined;
|
|
1146
|
-
get options(): string[];
|
|
1147
|
-
onChange(newValue: string | undefined): Promise<void>;
|
|
1148
|
-
onPick(newValue: string | undefined): void;
|
|
1149
|
-
private readonly getOptions;
|
|
1150
|
-
private readonly _minChars;
|
|
1151
|
-
private _value;
|
|
1152
|
-
private _options;
|
|
1127
|
+
declare class AutocompleteController {
|
|
1128
|
+
constructor(getOptions: (value: string | undefined) => Promise<string[]>, config?: AutoCompleteConfig);
|
|
1129
|
+
get value(): string | undefined;
|
|
1130
|
+
get options(): string[];
|
|
1131
|
+
onChange(newValue: string | undefined): Promise<void>;
|
|
1132
|
+
onPick(newValue: string | undefined): void;
|
|
1133
|
+
private readonly getOptions;
|
|
1134
|
+
private readonly _minChars;
|
|
1135
|
+
private _value;
|
|
1136
|
+
private _options;
|
|
1153
1137
|
}
|
|
1154
1138
|
|
|
1155
|
-
/** Extracted logic around autocomplete functionality for Autocomplete.tsx that supports Entity (id/name) mapping. */
|
|
1156
|
-
declare class AutocompleteEntityController<T extends string | number> {
|
|
1157
|
-
constructor(getOptions: (value: string | undefined) => Promise<Entity<T>[]>, config?: AutoCompleteConfig);
|
|
1158
|
-
get entity(): Entity<T> | undefined;
|
|
1159
|
-
get entities(): Entity<T>[];
|
|
1160
|
-
get value(): string | undefined;
|
|
1161
|
-
get options(): string[];
|
|
1162
|
-
onChange(newValue: string | undefined): Promise<void>;
|
|
1163
|
-
onPick(newValue: string | undefined): void;
|
|
1164
|
-
private _ctrl;
|
|
1165
|
-
private _pickedEntity;
|
|
1166
|
-
private _options;
|
|
1167
|
-
private trySyncCtrlOptions;
|
|
1168
|
-
}
|
|
1169
|
-
interface Entity<T extends string | number> {
|
|
1170
|
-
id: T;
|
|
1171
|
-
name: string;
|
|
1139
|
+
/** Extracted logic around autocomplete functionality for Autocomplete.tsx that supports Entity (id/name) mapping. */
|
|
1140
|
+
declare class AutocompleteEntityController<T extends string | number> {
|
|
1141
|
+
constructor(getOptions: (value: string | undefined) => Promise<Entity<T>[]>, config?: AutoCompleteConfig);
|
|
1142
|
+
get entity(): Entity<T> | undefined;
|
|
1143
|
+
get entities(): Entity<T>[];
|
|
1144
|
+
get value(): string | undefined;
|
|
1145
|
+
get options(): string[];
|
|
1146
|
+
onChange(newValue: string | undefined): Promise<void>;
|
|
1147
|
+
onPick(newValue: string | undefined): void;
|
|
1148
|
+
private _ctrl;
|
|
1149
|
+
private _pickedEntity;
|
|
1150
|
+
private _options;
|
|
1151
|
+
private trySyncCtrlOptions;
|
|
1152
|
+
}
|
|
1153
|
+
interface Entity<T extends string | number> {
|
|
1154
|
+
id: T;
|
|
1155
|
+
name: string;
|
|
1172
1156
|
}
|
|
1173
1157
|
|
|
1174
|
-
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteController, AutocompleteEntityController, AutocompleteProps, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, ImageProps, InfoPanel, InfoTip, InfoTipProps, ItemPager, Label, LabelProps, Link, LinkProps, List, ListItem, ListItemProps, ListProps, MackinTheme, Modal, ModalProps, Nav, NormalizeCss, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, PagedResultDto, Pager, PagerProps, Picker, PickerOption, PickerProps, PickerValue, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, SliderProps, SliderValue, TabContainer, TabContainerProps, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
1158
|
+
export { Accordian, type AccordianProps, type Alignment, Autocomplete, AutocompleteController, AutocompleteEntityController, type AutocompleteProps, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, type ButtonProps, Calendar, type CalendarProps, Checkbox, type CheckboxProps, ConfirmModal, type ConfirmModalProps, CopyButton, DateInput, type DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, type FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, type ImageProps, InfoPanel, InfoTip, type InfoTipProps, ItemPager, Label, type LabelProps, Link, type LinkProps, List, ListItem, type ListItemProps, type ListProps, type MackinTheme, Modal, type ModalProps, Nav, NormalizeCss, NumberInput, type NumberInputProps, OmniLink, type OmniLinkProps, PagedResult, type PagedResultDto, Pager, type PagerProps, Picker, type PickerOption, type PickerProps, type PickerValue, Popover, ProgressBar, type ProgressBarProps, SearchBox, type SearchBoxProps, Slider, type SliderProps, type SliderValue, TabContainer, type TabContainerProps, TabHeader, type TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, modalScrollFixClassName, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|