dash-core-components 4.0.0-rc0 → 4.0.0-rc2
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/dash_core_components/async-datepicker.js +1 -1
- package/dash_core_components/async-datepicker.js.map +1 -1
- package/dash_core_components/async-dropdown.js +1 -1
- package/dash_core_components/async-dropdown.js.map +1 -1
- package/dash_core_components/async-graph.js +1 -1
- package/dash_core_components/async-slider.js +1 -2
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/dash_core_components-shared.js +1 -1
- package/dash_core_components/dash_core_components-shared.js.map +1 -1
- package/dash_core_components/dash_core_components.js +1 -1
- package/dash_core_components/dash_core_components.js.map +1 -1
- package/dash_core_components/proptypes.js +118 -1
- package/lib/components/Checklist.tsx +67 -0
- package/lib/components/Dropdown.tsx +68 -0
- package/lib/components/Loading.tsx +185 -0
- package/lib/components/RadioItems.tsx +69 -0
- package/lib/components/RangeSlider.tsx +12 -1
- package/lib/components/Slider.tsx +12 -1
- package/lib/components/Tab.react.js.old +79 -0
- package/lib/components/Textarea.react.js.old +287 -0
- package/lib/components/Textarea.tsx +79 -0
- package/lib/components/Tooltip.tsx +66 -0
- package/lib/components/css/checklist.css +4 -0
- package/lib/components/css/dcc.css +3 -0
- package/lib/components/css/dropdown.css +211 -0
- package/lib/components/css/input.css +22 -6
- package/lib/components/css/optionslist.css +34 -0
- package/lib/components/css/radioitems.css +4 -0
- package/lib/components/css/sliders.css +19 -7
- package/lib/components/css/textarea.css +21 -0
- package/lib/components/css/tooltip.css +127 -0
- package/lib/fragments/Dropdown.tsx +513 -0
- package/lib/fragments/Loading/spinners/CircleSpinner.tsx +185 -0
- package/lib/fragments/Loading/spinners/CubeSpinner.tsx +193 -0
- package/lib/fragments/Loading/spinners/DebugTitle.tsx +11 -0
- package/lib/fragments/Loading/spinners/DefaultSpinner.tsx +110 -0
- package/lib/fragments/Loading/spinners/DotSpinner.tsx +96 -0
- package/lib/fragments/Loading/spinners/GraphSpinner.tsx +332 -0
- package/lib/fragments/Loading/types.ts +13 -0
- package/lib/fragments/RangeSlider.tsx +235 -105
- package/lib/index.ts +6 -6
- package/lib/types.ts +571 -64
- package/lib/utils/LazyLoader/dropdown.ts +2 -0
- package/lib/utils/_LoadingElement.tsx +8 -18
- package/lib/utils/dropdownSearch.ts +92 -0
- package/lib/utils/optionRendering.tsx +168 -0
- package/lib/utils/optionTypes.ts +27 -0
- package/lib/utils/sliderRendering.tsx +23 -4
- package/package.json +7 -4
- package/lib/components/Checklist.react.js +0 -193
- package/lib/components/Dropdown.react.js +0 -182
- package/lib/components/Input.react.js.old +0 -507
- package/lib/components/Loading.react.js +0 -254
- package/lib/components/RadioItems.react.js +0 -192
- package/lib/components/Slider.react.js.old +0 -214
- package/lib/components/Textarea.react.js +0 -223
- package/lib/components/Tooltip.react.js +0 -120
- package/lib/components/css/Dropdown.css +0 -8
- package/lib/fragments/Dropdown.react.js +0 -158
- package/lib/fragments/Loading/spinners/CircleSpinner.js +0 -68
- package/lib/fragments/Loading/spinners/CubeSpinner.js +0 -57
- package/lib/fragments/Loading/spinners/DebugTitle.js +0 -15
- package/lib/fragments/Loading/spinners/DefaultSpinner.js +0 -54
- package/lib/fragments/Loading/spinners/DotSpinner.js +0 -50
- package/lib/fragments/Loading/spinners/GraphSpinner.js +0 -68
- package/lib/fragments/Slider.tsx.old +0 -364
- package/lib/utils/LazyLoader/dropdown.js +0 -8
package/lib/types.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {DashComponent} from '@dash-renderer/types/component';
|
|
3
|
+
import ExternalWrapper from '@dash-renderer/wrapper/ExternalWrapper';
|
|
4
|
+
import {useDashContext} from '@dash-renderer/wrapper/DashContext';
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
dash_component_api: {
|
|
9
|
+
useDashContext: typeof useDashContext;
|
|
10
|
+
ExternalWrapper: typeof ExternalWrapper;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
1
15
|
export enum PersistenceTypes {
|
|
2
16
|
'local' = 'local',
|
|
3
17
|
'session' = 'session',
|
|
@@ -8,6 +22,50 @@ export enum PersistedProps {
|
|
|
8
22
|
'value' = 'value',
|
|
9
23
|
}
|
|
10
24
|
|
|
25
|
+
export interface BaseComponentProps<T> {
|
|
26
|
+
/**
|
|
27
|
+
* The ID of this component, used to identify dash components
|
|
28
|
+
* in callbacks. The ID needs to be unique across all of the
|
|
29
|
+
* components in an app.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Additional CSS class for the root DOM node
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Dash-assigned callback that gets fired when component properties change
|
|
40
|
+
*/
|
|
41
|
+
setProps: (props: Partial<T>) => void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Used to allow user interactions in this component to be persisted when
|
|
45
|
+
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
46
|
+
* hasn't changed from its previous value, a `value` that the user has
|
|
47
|
+
* changed while using the app will keep that change, as long as
|
|
48
|
+
* the new `value` also matches what was given originally.
|
|
49
|
+
* Used in conjunction with `persistence_type`.
|
|
50
|
+
*/
|
|
51
|
+
persistence?: boolean | string | number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Properties whose user interactions will persist after refreshing the
|
|
55
|
+
* component or the page. Since only `value` is allowed this prop can
|
|
56
|
+
* normally be ignored.
|
|
57
|
+
*/
|
|
58
|
+
persisted_props?: PersistedProps[];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Where persisted user changes will be stored:
|
|
62
|
+
* memory: only kept in memory, reset on page refresh.
|
|
63
|
+
* local: window.localStorage, data is kept after the browser quit.
|
|
64
|
+
* session: window.sessionStorage, data is cleared once the browser quit.
|
|
65
|
+
*/
|
|
66
|
+
persistence_type?: PersistenceTypes;
|
|
67
|
+
}
|
|
68
|
+
|
|
11
69
|
export type SliderMarks = {
|
|
12
70
|
[key: number]: string | {label: string; style?: React.CSSProperties};
|
|
13
71
|
};
|
|
@@ -64,7 +122,7 @@ export type SliderTooltip = {
|
|
|
64
122
|
transform?: string;
|
|
65
123
|
};
|
|
66
124
|
|
|
67
|
-
export interface SliderProps {
|
|
125
|
+
export interface SliderProps extends BaseComponentProps<SliderProps> {
|
|
68
126
|
/**
|
|
69
127
|
* Minimum allowed value of the slider
|
|
70
128
|
*/
|
|
@@ -118,6 +176,11 @@ export interface SliderProps {
|
|
|
118
176
|
*/
|
|
119
177
|
included?: boolean;
|
|
120
178
|
|
|
179
|
+
/**
|
|
180
|
+
* If the value is true, the slider is rendered in reverse.
|
|
181
|
+
*/
|
|
182
|
+
reverse?: boolean;
|
|
183
|
+
|
|
121
184
|
/**
|
|
122
185
|
* Configuration for tooltips describing the current slider value
|
|
123
186
|
*/
|
|
@@ -144,51 +207,9 @@ export interface SliderProps {
|
|
|
144
207
|
* The height, in px, of the slider if it is vertical.
|
|
145
208
|
*/
|
|
146
209
|
verticalHeight?: number;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Additional CSS class for the root DOM node
|
|
150
|
-
*/
|
|
151
|
-
className?: string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* The ID of this component, used to identify dash components
|
|
155
|
-
* in callbacks. The ID needs to be unique across all of the
|
|
156
|
-
* components in an app.
|
|
157
|
-
*/
|
|
158
|
-
id?: string;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Dash-assigned callback that gets fired when the value or drag_value changes.
|
|
162
|
-
*/
|
|
163
|
-
setProps: (props: Partial<SliderProps>) => void;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Used to allow user interactions in this component to be persisted when
|
|
167
|
-
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
168
|
-
* hasn't changed from its previous value, a `value` that the user has
|
|
169
|
-
* changed while using the app will keep that change, as long as
|
|
170
|
-
* the new `value` also matches what was given originally.
|
|
171
|
-
* Used in conjunction with `persistence_type`.
|
|
172
|
-
*/
|
|
173
|
-
persistence?: boolean | string | number;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Properties whose user interactions will persist after refreshing the
|
|
177
|
-
* component or the page. Since only `value` is allowed this prop can
|
|
178
|
-
* normally be ignored.
|
|
179
|
-
*/
|
|
180
|
-
persisted_props?: PersistedProps[];
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Where persisted user changes will be stored:
|
|
184
|
-
* memory: only kept in memory, reset on page refresh.
|
|
185
|
-
* local: window.localStorage, data is kept after the browser quit.
|
|
186
|
-
* session: window.sessionStorage, data is cleared once the browser quit.
|
|
187
|
-
*/
|
|
188
|
-
persistence_type?: PersistenceTypes;
|
|
189
210
|
}
|
|
190
211
|
|
|
191
|
-
export interface RangeSliderProps {
|
|
212
|
+
export interface RangeSliderProps extends BaseComponentProps<RangeSliderProps> {
|
|
192
213
|
/**
|
|
193
214
|
* Minimum allowed value of the slider
|
|
194
215
|
*/
|
|
@@ -261,6 +282,11 @@ export interface RangeSliderProps {
|
|
|
261
282
|
*/
|
|
262
283
|
included?: boolean;
|
|
263
284
|
|
|
285
|
+
/**
|
|
286
|
+
* If the value is true, the slider is rendered in reverse.
|
|
287
|
+
*/
|
|
288
|
+
reverse?: boolean;
|
|
289
|
+
|
|
264
290
|
/**
|
|
265
291
|
* Configuration for tooltips describing the current slider values
|
|
266
292
|
*/
|
|
@@ -286,11 +312,374 @@ export interface RangeSliderProps {
|
|
|
286
312
|
* The height, in px, of the slider if it is vertical.
|
|
287
313
|
*/
|
|
288
314
|
verticalHeight?: number;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export type OptionValue = string | number | boolean;
|
|
289
318
|
|
|
319
|
+
export type DetailedOption = {
|
|
320
|
+
label: string | DashComponent | DashComponent[];
|
|
290
321
|
/**
|
|
291
|
-
*
|
|
322
|
+
* The value of the option. This value
|
|
323
|
+
* corresponds to the items specified in the
|
|
324
|
+
* `value` property.
|
|
292
325
|
*/
|
|
293
|
-
|
|
326
|
+
value: OptionValue;
|
|
327
|
+
/**
|
|
328
|
+
* If true, this option is disabled and cannot be selected.
|
|
329
|
+
*/
|
|
330
|
+
disabled?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* The HTML 'title' attribute for the option. Allows for
|
|
333
|
+
* information on hover. For more information on this attribute,
|
|
334
|
+
* see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
|
|
335
|
+
*/
|
|
336
|
+
title?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Optional search value for the option, to use if the label
|
|
339
|
+
* is a component or provide a custom search value different
|
|
340
|
+
* from the label. If no search value and the label is a
|
|
341
|
+
* component, the `value` will be used for search.
|
|
342
|
+
*/
|
|
343
|
+
search?: string;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Array of options where the label and the value are the same thing, or an option dict
|
|
348
|
+
*/
|
|
349
|
+
export type OptionsArray = (OptionValue | DetailedOption)[];
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Simpler `options` representation in dictionary format. The order is not guaranteed.
|
|
353
|
+
* {`value1`: `label1`, `value2`: `label2`, ... }
|
|
354
|
+
* which is equal to
|
|
355
|
+
* [{label: `label1`, value: `value1`}, {label: `label2`, value: `value2`}, ...]
|
|
356
|
+
*/
|
|
357
|
+
export type OptionsDict = Record<string, string>;
|
|
358
|
+
|
|
359
|
+
export interface DropdownProps extends BaseComponentProps<DropdownProps> {
|
|
360
|
+
/**
|
|
361
|
+
* An array of options {label: [string|number], value: [string|number]},
|
|
362
|
+
* an optional disabled field can be used for each option
|
|
363
|
+
*/
|
|
364
|
+
options?: OptionsArray | OptionsDict;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* The value of the input. If `multi` is false (the default)
|
|
368
|
+
* then value is just a string that corresponds to the values
|
|
369
|
+
* provided in the `options` property. If `multi` is true, then
|
|
370
|
+
* multiple values can be selected at once, and `value` is an
|
|
371
|
+
* array of items with values corresponding to those in the
|
|
372
|
+
* `options` prop.
|
|
373
|
+
*/
|
|
374
|
+
value?: OptionValue | OptionValue[] | null;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* If true, the user can select multiple values
|
|
378
|
+
*/
|
|
379
|
+
multi?: boolean;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Whether or not the dropdown is "clearable", that is, whether or
|
|
383
|
+
* not a small "x" appears on the right of the dropdown that removes
|
|
384
|
+
* the selected value.
|
|
385
|
+
*/
|
|
386
|
+
clearable?: boolean;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Whether to enable the searching feature or not
|
|
390
|
+
*/
|
|
391
|
+
searchable?: boolean;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* The value typed in the DropDown for searching.
|
|
395
|
+
*/
|
|
396
|
+
search_value?: string;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* The grey, default text shown when no option is selected
|
|
400
|
+
*/
|
|
401
|
+
placeholder?: string;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* If true, this dropdown is disabled and the selection cannot be changed.
|
|
405
|
+
*/
|
|
406
|
+
disabled?: boolean;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* If false, the menu of the dropdown will not close once a value is selected.
|
|
410
|
+
*/
|
|
411
|
+
closeOnSelect?: boolean;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* height of each option. Can be increased when label lengths would wrap around
|
|
415
|
+
*/
|
|
416
|
+
optionHeight?: 'auto' | number;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* height of the options dropdown.
|
|
420
|
+
*/
|
|
421
|
+
maxHeight?: number;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Defines CSS styles which will override styles previously set.
|
|
425
|
+
*/
|
|
426
|
+
style?: React.CSSProperties;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Text for customizing the labels rendered by this component.
|
|
430
|
+
*/
|
|
431
|
+
labels?: {
|
|
432
|
+
select_all?: string;
|
|
433
|
+
deselect_all?: string;
|
|
434
|
+
selected_count?: string;
|
|
435
|
+
search?: string;
|
|
436
|
+
clear_search?: string;
|
|
437
|
+
clear_selection?: string;
|
|
438
|
+
no_options_found?: string;
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface ChecklistProps extends BaseComponentProps<ChecklistProps> {
|
|
443
|
+
/**
|
|
444
|
+
* An array of options
|
|
445
|
+
*/
|
|
446
|
+
options?: OptionsArray | OptionsDict;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* The currently selected value
|
|
450
|
+
*/
|
|
451
|
+
value?: OptionValue[] | null;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Indicates whether the options labels should be displayed inline (true=horizontal)
|
|
455
|
+
* or in a block (false=vertical).
|
|
456
|
+
*/
|
|
457
|
+
inline?: boolean;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The style of the container (div)
|
|
461
|
+
*/
|
|
462
|
+
style?: React.CSSProperties;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The style of the <input> checkbox element
|
|
466
|
+
*/
|
|
467
|
+
inputStyle?: React.CSSProperties;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The class of the <input> checkbox element
|
|
471
|
+
*/
|
|
472
|
+
inputClassName?: string;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The style of the <label> that wraps the checkbox input
|
|
476
|
+
* and the option's label
|
|
477
|
+
*/
|
|
478
|
+
labelStyle?: React.CSSProperties;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* The class of the <label> that wraps the checkbox input
|
|
482
|
+
* and the option's label
|
|
483
|
+
*/
|
|
484
|
+
labelClassName?: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export interface RadioItemsProps extends BaseComponentProps<RadioItemsProps> {
|
|
488
|
+
/**
|
|
489
|
+
* An array of options
|
|
490
|
+
*/
|
|
491
|
+
options?: OptionsArray | OptionsDict;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* The currently selected value
|
|
495
|
+
*/
|
|
496
|
+
value?: OptionValue | null;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Indicates whether the options labels should be displayed inline (true=horizontal)
|
|
500
|
+
* or in a block (false=vertical).
|
|
501
|
+
*/
|
|
502
|
+
inline?: boolean;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* The style of the container (div)
|
|
506
|
+
*/
|
|
507
|
+
style?: React.CSSProperties;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* The style of the <input> checkbox element
|
|
511
|
+
*/
|
|
512
|
+
inputStyle?: React.CSSProperties;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* The class of the <input> checkbox element
|
|
516
|
+
*/
|
|
517
|
+
inputClassName?: string;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* The style of the <label> that wraps the checkbox input
|
|
521
|
+
* and the option's label
|
|
522
|
+
*/
|
|
523
|
+
labelStyle?: React.CSSProperties;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* The class of the <label> that wraps the checkbox input
|
|
527
|
+
* and the option's label
|
|
528
|
+
*/
|
|
529
|
+
labelClassName?: string;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
export interface TextAreaProps extends BaseComponentProps<TextAreaProps> {
|
|
533
|
+
/**
|
|
534
|
+
* The value of the textarea
|
|
535
|
+
*/
|
|
536
|
+
value?: string;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* The element should be automatically focused after the page loaded.
|
|
540
|
+
*/
|
|
541
|
+
autoFocus?: string;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Defines the number of columns in a textarea.
|
|
545
|
+
*/
|
|
546
|
+
cols?: number;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Indicates whether the user can interact with the element.
|
|
550
|
+
*/
|
|
551
|
+
disabled?: boolean | 'disabled' | 'DISABLED';
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Indicates the form that is the owner of the element.
|
|
555
|
+
*/
|
|
556
|
+
form?: string;
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Defines the maximum number of characters allowed in the element.
|
|
560
|
+
*/
|
|
561
|
+
maxLength?: number;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Defines the minimum number of characters allowed in the element.
|
|
565
|
+
*/
|
|
566
|
+
minLength?: number;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Name of the element. For example used by the server to identify the fields in form submits.
|
|
570
|
+
*/
|
|
571
|
+
name?: string;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Provides a hint to the user of what can be entered in the field.
|
|
575
|
+
*/
|
|
576
|
+
placeholder?: string;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Indicates whether the element can be edited.
|
|
580
|
+
* readOnly is an HTML boolean attribute - it is enabled by a boolean or
|
|
581
|
+
* 'readOnly'. Alternative capitalizations `readonly` & `READONLY`
|
|
582
|
+
* are also acccepted.
|
|
583
|
+
*/
|
|
584
|
+
readOnly?: boolean | 'readOnly' | 'readonly' | 'READONLY';
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Indicates whether this element is required to fill out or not.
|
|
588
|
+
* required is an HTML boolean attribute - it is enabled by a boolean or
|
|
589
|
+
* 'required'. Alternative capitalizations `REQUIRED`
|
|
590
|
+
* are also acccepted.
|
|
591
|
+
*/
|
|
592
|
+
required?: boolean | 'required' | 'REQUIRED';
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Defines the number of rows in a text area.
|
|
596
|
+
*/
|
|
597
|
+
rows?: number;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Indicates whether the text should be wrapped.
|
|
601
|
+
*/
|
|
602
|
+
wrap?: string;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Defines a keyboard shortcut to activate or add focus to the element.
|
|
606
|
+
*/
|
|
607
|
+
accessKey?: string;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Indicates whether the element's content is editable.
|
|
611
|
+
*/
|
|
612
|
+
contentEditable?: boolean;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
616
|
+
*/
|
|
617
|
+
contextMenu?: string;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
621
|
+
*/
|
|
622
|
+
dir?: string;
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Defines whether the element can be dragged.
|
|
626
|
+
*/
|
|
627
|
+
draggable?: boolean;
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
|
|
631
|
+
*/
|
|
632
|
+
hidden?: string;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Defines the language used in the element.
|
|
636
|
+
*/
|
|
637
|
+
lang?: string;
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Indicates whether spell checking is allowed for the element.
|
|
641
|
+
*/
|
|
642
|
+
spellCheck?: boolean;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Defines CSS styles which will override styles previously set.
|
|
646
|
+
*/
|
|
647
|
+
style?: React.CSSProperties;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Overrides the browser's default tab order and follows the one specified instead.
|
|
651
|
+
*/
|
|
652
|
+
tabIndex?: number;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Text to be displayed in a tooltip when hovering over the element.
|
|
656
|
+
*/
|
|
657
|
+
title?: string;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Number of times the textarea lost focus.
|
|
661
|
+
*/
|
|
662
|
+
n_blur?: number;
|
|
663
|
+
/**
|
|
664
|
+
* Last time the textarea lost focus.
|
|
665
|
+
*/
|
|
666
|
+
n_blur_timestamp?: number;
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Number of times the textarea has been clicked.
|
|
670
|
+
*/
|
|
671
|
+
n_clicks?: number;
|
|
672
|
+
/**
|
|
673
|
+
* Last time the textarea was clicked.
|
|
674
|
+
*/
|
|
675
|
+
n_clicks_timestamp?: number;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface TooltipProps {
|
|
679
|
+
/**
|
|
680
|
+
* The contents of the tooltip
|
|
681
|
+
*/
|
|
682
|
+
children?: React.ReactNode;
|
|
294
683
|
|
|
295
684
|
/**
|
|
296
685
|
* The ID of this component, used to identify dash components
|
|
@@ -300,32 +689,150 @@ export interface RangeSliderProps {
|
|
|
300
689
|
id?: string;
|
|
301
690
|
|
|
302
691
|
/**
|
|
303
|
-
*
|
|
692
|
+
* The class of the tooltip
|
|
304
693
|
*/
|
|
305
|
-
|
|
694
|
+
className?: string;
|
|
306
695
|
|
|
307
696
|
/**
|
|
308
|
-
*
|
|
309
|
-
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
310
|
-
* hasn't changed from its previous value, a `value` that the user has
|
|
311
|
-
* changed while using the app will keep that change, as long as
|
|
312
|
-
* the new `value` also matches what was given originally.
|
|
313
|
-
* Used in conjunction with `persistence_type`.
|
|
697
|
+
* The style of the tooltip
|
|
314
698
|
*/
|
|
315
|
-
|
|
699
|
+
style?: React.CSSProperties;
|
|
316
700
|
|
|
317
701
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* normally be ignored.
|
|
702
|
+
* The bounding box coordinates of the item to label, in px relative to
|
|
703
|
+
* the positioning parent of the Tooltip component.
|
|
321
704
|
*/
|
|
322
|
-
|
|
705
|
+
bbox?: {
|
|
706
|
+
x0: number;
|
|
707
|
+
y0: number;
|
|
708
|
+
x1: number;
|
|
709
|
+
y1: number;
|
|
710
|
+
};
|
|
323
711
|
|
|
324
712
|
/**
|
|
325
|
-
*
|
|
326
|
-
* memory: only kept in memory, reset on page refresh.
|
|
327
|
-
* local: window.localStorage, data is kept after the browser quit.
|
|
328
|
-
* session: window.sessionStorage, data is cleared once the browser quit.
|
|
713
|
+
* Whether to show the tooltip
|
|
329
714
|
*/
|
|
330
|
-
|
|
715
|
+
show?: boolean;
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* The side of the `bbox` on which the tooltip should open.
|
|
719
|
+
*/
|
|
720
|
+
direction?: 'top' | 'right' | 'bottom' | 'left';
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Color of the tooltip border, as a CSS color string.
|
|
724
|
+
*/
|
|
725
|
+
border_color?: string;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Color of the tooltip background, as a CSS color string.
|
|
729
|
+
*/
|
|
730
|
+
background_color?: string;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* The text displayed in the tooltip while loading
|
|
734
|
+
*/
|
|
735
|
+
loading_text?: string;
|
|
736
|
+
|
|
737
|
+
/**
|
|
738
|
+
* The `z-index` CSS property to assign to the tooltip. Components with
|
|
739
|
+
* higher values will be displayed on top of components with lower values.
|
|
740
|
+
*/
|
|
741
|
+
zindex?: number;
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Whether the tooltip itself can be targeted by pointer events.
|
|
745
|
+
* For tooltips triggered by hover events, typically this should be left
|
|
746
|
+
* `false` to avoid the tooltip interfering with those same events.
|
|
747
|
+
*/
|
|
748
|
+
targetable?: boolean;
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Dash-assigned callback that gets fired when the value changes.
|
|
752
|
+
*/
|
|
753
|
+
setProps: (props: Partial<TooltipProps>) => void;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export interface LoadingProps extends BaseComponentProps<LoadingProps> {
|
|
757
|
+
/**
|
|
758
|
+
* Array that holds components to render
|
|
759
|
+
*/
|
|
760
|
+
children?: React.ReactNode;
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Property that determines which built-in spinner to show
|
|
764
|
+
* one of 'graph', 'cube', 'circle', 'dot', or 'default'.
|
|
765
|
+
*/
|
|
766
|
+
type?: 'graph' | 'cube' | 'circle' | 'dot' | 'default';
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Boolean that makes the built-in spinner display full-screen
|
|
770
|
+
*/
|
|
771
|
+
fullscreen?: boolean;
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* If true, the built-in spinner will display the component_name and prop_name
|
|
775
|
+
* while loading
|
|
776
|
+
*/
|
|
777
|
+
debug?: boolean;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Additional CSS styling for the built-in spinner root DOM node
|
|
781
|
+
*/
|
|
782
|
+
style?: React.CSSProperties;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Additional CSS class for the outermost dcc.Loading parent div DOM node
|
|
786
|
+
*/
|
|
787
|
+
parent_className?: string;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Additional CSS styling for the outermost dcc.Loading parent div DOM node
|
|
791
|
+
*/
|
|
792
|
+
parent_style?: React.CSSProperties;
|
|
793
|
+
/**
|
|
794
|
+
* Additional CSS styling for the spinner overlay. This is applied to the
|
|
795
|
+
* dcc.Loading children while the spinner is active. The default is `{'visibility': 'hidden'}`
|
|
796
|
+
*/
|
|
797
|
+
overlay_style?: React.CSSProperties;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Primary color used for the built-in loading spinners
|
|
801
|
+
*/
|
|
802
|
+
color?: string;
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Setting display to "show" or "hide" will override the loading state coming from dash-renderer
|
|
806
|
+
*/
|
|
807
|
+
display?: 'auto' | 'show' | 'hide';
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* Add a time delay (in ms) to the spinner being removed to prevent flickering.
|
|
811
|
+
*/
|
|
812
|
+
delay_hide?: number;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Add a time delay (in ms) to the spinner being shown after the loading_state
|
|
816
|
+
* is set to True.
|
|
817
|
+
*/
|
|
818
|
+
delay_show?: number;
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Whether the Spinner should show on app start-up before the loading state
|
|
822
|
+
* has been determined. Default True. Use when also setting `delay_show`.
|
|
823
|
+
*/
|
|
824
|
+
show_initially?: boolean;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Specify component and prop to trigger showing the loading spinner
|
|
828
|
+
* example: `{"output-container": "children", "grid": ["rowData", "columnDefs]}`
|
|
829
|
+
*
|
|
830
|
+
*/
|
|
831
|
+
target_components?: Record<string, string | string[]>;
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Component to use rather than the built-in spinner specified in the `type` prop.
|
|
835
|
+
*
|
|
836
|
+
*/
|
|
837
|
+
custom_spinner?: React.ReactNode;
|
|
331
838
|
}
|