dash-core-components 4.0.0-rc1 → 4.0.0-rc3

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.
Files changed (103) hide show
  1. package/dash_core_components/async-datepicker.js +1 -1
  2. package/dash_core_components/async-datepicker.js.map +1 -1
  3. package/dash_core_components/async-dropdown.js +1 -2
  4. package/dash_core_components/async-dropdown.js.map +1 -1
  5. package/dash_core_components/async-graph.js +1 -1
  6. package/dash_core_components/async-graph.js.map +1 -1
  7. package/dash_core_components/async-highlight.js +1 -1
  8. package/dash_core_components/async-highlight.js.map +1 -1
  9. package/dash_core_components/async-markdown.js +1 -1
  10. package/dash_core_components/async-markdown.js.map +1 -1
  11. package/dash_core_components/async-mathjax.js +1 -1
  12. package/dash_core_components/async-slider.js +1 -1
  13. package/dash_core_components/async-slider.js.map +1 -1
  14. package/dash_core_components/async-upload.js +1 -1
  15. package/dash_core_components/async-upload.js.map +1 -1
  16. package/dash_core_components/dash_core_components-shared.js +1 -1
  17. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  18. package/dash_core_components/dash_core_components.js +1 -1
  19. package/dash_core_components/dash_core_components.js.map +1 -1
  20. package/dash_core_components/proptypes.js +209 -6
  21. package/lib/components/Checklist.tsx +67 -0
  22. package/lib/components/Clipboard.react.js +1 -1
  23. package/lib/components/DatePickerRange.tsx +70 -0
  24. package/lib/components/DatePickerSingle.tsx +72 -0
  25. package/lib/components/Dropdown.tsx +19 -3
  26. package/lib/components/Input.tsx +1 -1
  27. package/lib/components/Loading.tsx +185 -0
  28. package/lib/components/RadioItems.tsx +69 -0
  29. package/lib/components/RangeSlider.tsx +5 -1
  30. package/lib/components/Slider.tsx +12 -1
  31. package/lib/components/Tab.tsx +19 -0
  32. package/lib/components/Tabs.tsx +311 -0
  33. package/lib/components/Textarea.tsx +79 -0
  34. package/lib/components/Tooltip.tsx +66 -0
  35. package/lib/components/css/calendar.css +66 -0
  36. package/lib/components/css/checklist.css +4 -0
  37. package/lib/components/css/datepickers.css +233 -0
  38. package/lib/components/css/dcc.css +3 -0
  39. package/lib/components/css/dropdown.css +34 -50
  40. package/lib/components/css/input.css +29 -7
  41. package/lib/components/css/optionslist.css +34 -0
  42. package/lib/components/css/radioitems.css +4 -0
  43. package/lib/components/css/sliders.css +33 -7
  44. package/lib/components/css/tabs.css +113 -0
  45. package/lib/components/css/textarea.css +21 -0
  46. package/lib/components/css/tooltip.css +127 -0
  47. package/lib/fragments/DatePickerRange.tsx +444 -0
  48. package/lib/fragments/DatePickerSingle.tsx +249 -0
  49. package/lib/fragments/Dropdown.tsx +212 -272
  50. package/lib/fragments/Graph.react.js +18 -45
  51. package/lib/fragments/Loading/spinners/CircleSpinner.tsx +185 -0
  52. package/lib/fragments/Loading/spinners/CubeSpinner.tsx +193 -0
  53. package/lib/fragments/Loading/spinners/DebugTitle.tsx +11 -0
  54. package/lib/fragments/Loading/spinners/DefaultSpinner.tsx +110 -0
  55. package/lib/fragments/Loading/spinners/DotSpinner.tsx +96 -0
  56. package/lib/fragments/Loading/spinners/GraphSpinner.tsx +332 -0
  57. package/lib/fragments/Loading/types.ts +13 -0
  58. package/lib/fragments/RangeSlider.tsx +195 -63
  59. package/lib/index.ts +9 -11
  60. package/lib/types.ts +797 -132
  61. package/lib/utils/DatePickerPersistence.ts +14 -0
  62. package/lib/utils/LazyLoader/datePickerRange.ts +4 -0
  63. package/lib/utils/LazyLoader/datePickerSingle.ts +4 -0
  64. package/lib/utils/calendar/Calendar.tsx +382 -0
  65. package/lib/utils/calendar/CalendarDay.tsx +75 -0
  66. package/lib/utils/calendar/CalendarDayPadding.tsx +15 -0
  67. package/lib/utils/calendar/CalendarMonth.tsx +247 -0
  68. package/lib/utils/calendar/CalendarMonthHeader.tsx +23 -0
  69. package/lib/utils/calendar/createMonthGrid.ts +28 -0
  70. package/lib/utils/calendar/helpers.ts +272 -0
  71. package/lib/utils/computeSliderMarkers.ts +71 -116
  72. package/lib/utils/dropdownSearch.ts +4 -4
  73. package/lib/utils/optionRendering.tsx +175 -0
  74. package/lib/utils/optionTypes.ts +5 -5
  75. package/lib/utils/sliderRendering.tsx +63 -6
  76. package/package.json +16 -14
  77. package/lib/components/Checklist.react.js +0 -193
  78. package/lib/components/DatePickerRange.react.js +0 -244
  79. package/lib/components/DatePickerSingle.react.js +0 -209
  80. package/lib/components/Dropdown.react.js.old +0 -228
  81. package/lib/components/Input.react.js.old +0 -507
  82. package/lib/components/Loading.react.js +0 -254
  83. package/lib/components/RadioItems.react.js +0 -192
  84. package/lib/components/Slider.react.js.old +0 -214
  85. package/lib/components/Tab.react.js +0 -80
  86. package/lib/components/Tabs.react.js +0 -295
  87. package/lib/components/Textarea.react.js +0 -223
  88. package/lib/components/Textarea.react.js.old +0 -287
  89. package/lib/components/Tooltip.react.js +0 -120
  90. package/lib/components/css/Dropdown.css +0 -8
  91. package/lib/fragments/DatePickerRange.react.js +0 -188
  92. package/lib/fragments/DatePickerSingle.react.js +0 -132
  93. package/lib/fragments/Loading/spinners/CircleSpinner.js +0 -68
  94. package/lib/fragments/Loading/spinners/CubeSpinner.js +0 -57
  95. package/lib/fragments/Loading/spinners/DebugTitle.js +0 -15
  96. package/lib/fragments/Loading/spinners/DefaultSpinner.js +0 -54
  97. package/lib/fragments/Loading/spinners/DotSpinner.js +0 -50
  98. package/lib/fragments/Loading/spinners/GraphSpinner.js +0 -68
  99. package/lib/utils/DatePickerPersistence.js +0 -18
  100. package/lib/utils/LazyLoader/datePickerRange.js +0 -8
  101. package/lib/utils/LazyLoader/datePickerSingle.js +0 -8
  102. package/lib/utils/convertToMoment.js +0 -30
  103. package/lib/utils/optionTypes.js +0 -39
package/lib/types.ts CHANGED
@@ -1,16 +1,5 @@
1
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
- }
2
+ import {BaseDashProps, DashComponent} from '@dash-renderer/types';
14
3
 
15
4
  export enum PersistenceTypes {
16
5
  'local' = 'local',
@@ -20,6 +9,47 @@ export enum PersistenceTypes {
20
9
 
21
10
  export enum PersistedProps {
22
11
  'value' = 'value',
12
+ 'date' = 'date',
13
+ 'start_date' = 'start_date',
14
+ 'end_date' = 'end_date',
15
+ }
16
+
17
+ export interface BaseDccProps<T>
18
+ extends Pick<BaseDashProps, 'id' | 'componentPath'> {
19
+ /**
20
+ * Additional CSS class for the root DOM node
21
+ */
22
+ className?: string;
23
+
24
+ /**
25
+ * Dash-assigned callback that gets fired when component properties change
26
+ */
27
+ setProps: (props: Partial<T>) => void;
28
+
29
+ /**
30
+ * Used to allow user interactions in this component to be persisted when
31
+ * the component - or the page - is refreshed. If `persisted` is truthy and
32
+ * hasn't changed from its previous value, a `value` that the user has
33
+ * changed while using the app will keep that change, as long as
34
+ * the new `value` also matches what was given originally.
35
+ * Used in conjunction with `persistence_type`.
36
+ */
37
+ persistence?: boolean | string | number;
38
+
39
+ /**
40
+ * Properties whose user interactions will persist after refreshing the
41
+ * component or the page. Since only `value` is allowed this prop can
42
+ * normally be ignored.
43
+ */
44
+ persisted_props?: PersistedProps[];
45
+
46
+ /**
47
+ * Where persisted user changes will be stored:
48
+ * memory: only kept in memory, reset on page refresh.
49
+ * local: window.localStorage, data is kept after the browser quit.
50
+ * session: window.sessionStorage, data is cleared once the browser quit.
51
+ */
52
+ persistence_type?: PersistenceTypes;
23
53
  }
24
54
 
25
55
  export type SliderMarks = {
@@ -78,7 +108,7 @@ export type SliderTooltip = {
78
108
  transform?: string;
79
109
  };
80
110
 
81
- export interface SliderProps {
111
+ export interface SliderProps extends BaseDccProps<SliderProps> {
82
112
  /**
83
113
  * Minimum allowed value of the slider
84
114
  */
@@ -132,6 +162,11 @@ export interface SliderProps {
132
162
  */
133
163
  included?: boolean;
134
164
 
165
+ /**
166
+ * If the value is true, the slider is rendered in reverse.
167
+ */
168
+ reverse?: boolean;
169
+
135
170
  /**
136
171
  * Configuration for tooltips describing the current slider value
137
172
  */
@@ -158,51 +193,9 @@ export interface SliderProps {
158
193
  * The height, in px, of the slider if it is vertical.
159
194
  */
160
195
  verticalHeight?: number;
161
-
162
- /**
163
- * Additional CSS class for the root DOM node
164
- */
165
- className?: string;
166
-
167
- /**
168
- * The ID of this component, used to identify dash components
169
- * in callbacks. The ID needs to be unique across all of the
170
- * components in an app.
171
- */
172
- id?: string;
173
-
174
- /**
175
- * Dash-assigned callback that gets fired when the value or drag_value changes.
176
- */
177
- setProps: (props: Partial<SliderProps>) => void;
178
-
179
- /**
180
- * Used to allow user interactions in this component to be persisted when
181
- * the component - or the page - is refreshed. If `persisted` is truthy and
182
- * hasn't changed from its previous value, a `value` that the user has
183
- * changed while using the app will keep that change, as long as
184
- * the new `value` also matches what was given originally.
185
- * Used in conjunction with `persistence_type`.
186
- */
187
- persistence?: boolean | string | number;
188
-
189
- /**
190
- * Properties whose user interactions will persist after refreshing the
191
- * component or the page. Since only `value` is allowed this prop can
192
- * normally be ignored.
193
- */
194
- persisted_props?: PersistedProps[];
195
-
196
- /**
197
- * Where persisted user changes will be stored:
198
- * memory: only kept in memory, reset on page refresh.
199
- * local: window.localStorage, data is kept after the browser quit.
200
- * session: window.sessionStorage, data is cleared once the browser quit.
201
- */
202
- persistence_type?: PersistenceTypes;
203
196
  }
204
197
 
205
- export interface RangeSliderProps {
198
+ export interface RangeSliderProps extends BaseDccProps<RangeSliderProps> {
206
199
  /**
207
200
  * Minimum allowed value of the slider
208
201
  */
@@ -275,6 +268,11 @@ export interface RangeSliderProps {
275
268
  */
276
269
  included?: boolean;
277
270
 
271
+ /**
272
+ * If the value is true, the slider is rendered in reverse.
273
+ */
274
+ reverse?: boolean;
275
+
278
276
  /**
279
277
  * Configuration for tooltips describing the current slider values
280
278
  */
@@ -300,60 +298,18 @@ export interface RangeSliderProps {
300
298
  * The height, in px, of the slider if it is vertical.
301
299
  */
302
300
  verticalHeight?: number;
303
-
304
- /**
305
- * Additional CSS class for the root DOM node
306
- */
307
- className?: string;
308
-
309
- /**
310
- * The ID of this component, used to identify dash components
311
- * in callbacks. The ID needs to be unique across all of the
312
- * components in an app.
313
- */
314
- id?: string;
315
-
316
- /**
317
- * Dash-assigned callback that gets fired when the value or drag_value changes.
318
- */
319
- setProps: (props: Partial<RangeSliderProps>) => void;
320
-
321
- /**
322
- * Used to allow user interactions in this component to be persisted when
323
- * the component - or the page - is refreshed. If `persisted` is truthy and
324
- * hasn't changed from its previous value, a `value` that the user has
325
- * changed while using the app will keep that change, as long as
326
- * the new `value` also matches what was given originally.
327
- * Used in conjunction with `persistence_type`.
328
- */
329
- persistence?: boolean | string | number;
330
-
331
- /**
332
- * Properties whose user interactions will persist after refreshing the
333
- * component or the page. Since only `value` is allowed this prop can
334
- * normally be ignored.
335
- */
336
- persisted_props?: PersistedProps[];
337
-
338
- /**
339
- * Where persisted user changes will be stored:
340
- * memory: only kept in memory, reset on page refresh.
341
- * local: window.localStorage, data is kept after the browser quit.
342
- * session: window.sessionStorage, data is cleared once the browser quit.
343
- */
344
- persistence_type?: PersistenceTypes;
345
301
  }
346
302
 
347
- export type DropdownValue = string | number | boolean;
303
+ export type OptionValue = string | number | boolean;
348
304
 
349
- export type DetailedDropdownOption = {
350
- label: string | DashComponent;
305
+ export type DetailedOption = {
306
+ label: string | DashComponent | DashComponent[];
351
307
  /**
352
308
  * The value of the option. This value
353
309
  * corresponds to the items specified in the
354
310
  * `value` property.
355
311
  */
356
- value: DropdownValue;
312
+ value: OptionValue;
357
313
  /**
358
314
  * If true, this option is disabled and cannot be selected.
359
315
  */
@@ -376,7 +332,7 @@ export type DetailedDropdownOption = {
376
332
  /**
377
333
  * Array of options where the label and the value are the same thing, or an option dict
378
334
  */
379
- export type DropdownOptionsArray = (DropdownValue | DetailedDropdownOption)[];
335
+ export type OptionsArray = (OptionValue | DetailedOption)[];
380
336
 
381
337
  /**
382
338
  * Simpler `options` representation in dictionary format. The order is not guaranteed.
@@ -384,14 +340,14 @@ export type DropdownOptionsArray = (DropdownValue | DetailedDropdownOption)[];
384
340
  * which is equal to
385
341
  * [{label: `label1`, value: `value1`}, {label: `label2`, value: `value2`}, ...]
386
342
  */
387
- export type DropdownOptionsDict = Record<string, string>;
343
+ export type OptionsDict = Record<string, string>;
388
344
 
389
- export interface DropdownProps {
345
+ export interface DropdownProps extends BaseDccProps<DropdownProps> {
390
346
  /**
391
347
  * An array of options {label: [string|number], value: [string|number]},
392
348
  * an optional disabled field can be used for each option
393
349
  */
394
- options?: DropdownOptionsArray | DropdownOptionsDict;
350
+ options?: OptionsArray | OptionsDict;
395
351
 
396
352
  /**
397
353
  * The value of the input. If `multi` is false (the default)
@@ -401,7 +357,7 @@ export interface DropdownProps {
401
357
  * array of items with values corresponding to those in the
402
358
  * `options` prop.
403
359
  */
404
- value?: DropdownValue | DropdownValue[] | null;
360
+ value?: OptionValue | OptionValue[] | null;
405
361
 
406
362
  /**
407
363
  * If true, the user can select multiple values
@@ -443,7 +399,7 @@ export interface DropdownProps {
443
399
  /**
444
400
  * height of each option. Can be increased when label lengths would wrap around
445
401
  */
446
- optionHeight?: number;
402
+ optionHeight?: 'auto' | number;
447
403
 
448
404
  /**
449
405
  * height of the options dropdown.
@@ -456,44 +412,753 @@ export interface DropdownProps {
456
412
  style?: React.CSSProperties;
457
413
 
458
414
  /**
459
- * className of the dropdown element
415
+ * Text for customizing the labels rendered by this component.
460
416
  */
461
- className?: string;
417
+ labels?: {
418
+ select_all?: string;
419
+ deselect_all?: string;
420
+ selected_count?: string;
421
+ search?: string;
422
+ clear_search?: string;
423
+ clear_selection?: string;
424
+ no_options_found?: string;
425
+ };
426
+ }
462
427
 
428
+ export interface ChecklistProps extends BaseDccProps<ChecklistProps> {
463
429
  /**
464
- * The ID of this component, used to identify dash components
465
- * in callbacks. The ID needs to be unique across all of the
466
- * components in an app.
430
+ * An array of options
467
431
  */
468
- id?: string;
432
+ options?: OptionsArray | OptionsDict;
469
433
 
470
434
  /**
471
- * Dash-assigned callback that gets fired when the input changes
435
+ * The currently selected value
472
436
  */
473
- setProps: (props: Partial<DropdownProps>) => void;
437
+ value?: OptionValue[] | null;
474
438
 
475
439
  /**
476
- * Used to allow user interactions in this component to be persisted when
477
- * the component - or the page - is refreshed. If `persisted` is truthy and
478
- * hasn't changed from its previous value, a `value` that the user has
479
- * changed while using the app will keep that change, as long as
480
- * the new `value` also matches what was given originally.
481
- * Used in conjunction with `persistence_type`.
440
+ * Indicates whether the options labels should be displayed inline (true=horizontal)
441
+ * or in a block (false=vertical).
482
442
  */
483
- persistence?: boolean | string | number;
443
+ inline?: boolean;
484
444
 
485
445
  /**
486
- * Properties whose user interactions will persist after refreshing the
487
- * component or the page. Since only `value` is allowed this prop can
488
- * normally be ignored.
446
+ * The style of the container (div)
489
447
  */
490
- persisted_props?: PersistedProps[];
448
+ style?: React.CSSProperties;
491
449
 
492
450
  /**
493
- * Where persisted user changes will be stored:
494
- * memory: only kept in memory, reset on page refresh.
495
- * local: window.localStorage, data is kept after the browser quit.
496
- * session: window.sessionStorage, data is cleared once the browser quit.
451
+ * The style of the <input> checkbox element
497
452
  */
498
- persistence_type?: PersistenceTypes;
453
+ inputStyle?: React.CSSProperties;
454
+
455
+ /**
456
+ * The class of the <input> checkbox element
457
+ */
458
+ inputClassName?: string;
459
+
460
+ /**
461
+ * The style of the <label> that wraps the checkbox input
462
+ * and the option's label
463
+ */
464
+ labelStyle?: React.CSSProperties;
465
+
466
+ /**
467
+ * The class of the <label> that wraps the checkbox input
468
+ * and the option's label
469
+ */
470
+ labelClassName?: string;
471
+ }
472
+
473
+ export interface RadioItemsProps extends BaseDccProps<RadioItemsProps> {
474
+ /**
475
+ * An array of options
476
+ */
477
+ options?: OptionsArray | OptionsDict;
478
+
479
+ /**
480
+ * The currently selected value
481
+ */
482
+ value?: OptionValue | null;
483
+
484
+ /**
485
+ * Indicates whether the options labels should be displayed inline (true=horizontal)
486
+ * or in a block (false=vertical).
487
+ */
488
+ inline?: boolean;
489
+
490
+ /**
491
+ * The style of the container (div)
492
+ */
493
+ style?: React.CSSProperties;
494
+
495
+ /**
496
+ * The style of the <input> checkbox element
497
+ */
498
+ inputStyle?: React.CSSProperties;
499
+
500
+ /**
501
+ * The class of the <input> checkbox element
502
+ */
503
+ inputClassName?: string;
504
+
505
+ /**
506
+ * The style of the <label> that wraps the checkbox input
507
+ * and the option's label
508
+ */
509
+ labelStyle?: React.CSSProperties;
510
+
511
+ /**
512
+ * The class of the <label> that wraps the checkbox input
513
+ * and the option's label
514
+ */
515
+ labelClassName?: string;
516
+ }
517
+
518
+ export interface TextAreaProps extends BaseDccProps<TextAreaProps> {
519
+ /**
520
+ * The value of the textarea
521
+ */
522
+ value?: string;
523
+
524
+ /**
525
+ * The element should be automatically focused after the page loaded.
526
+ */
527
+ autoFocus?: string;
528
+
529
+ /**
530
+ * Defines the number of columns in a textarea.
531
+ */
532
+ cols?: number;
533
+
534
+ /**
535
+ * Indicates whether the user can interact with the element.
536
+ */
537
+ disabled?: boolean | 'disabled' | 'DISABLED';
538
+
539
+ /**
540
+ * Indicates the form that is the owner of the element.
541
+ */
542
+ form?: string;
543
+
544
+ /**
545
+ * Defines the maximum number of characters allowed in the element.
546
+ */
547
+ maxLength?: number;
548
+
549
+ /**
550
+ * Defines the minimum number of characters allowed in the element.
551
+ */
552
+ minLength?: number;
553
+
554
+ /**
555
+ * Name of the element. For example used by the server to identify the fields in form submits.
556
+ */
557
+ name?: string;
558
+
559
+ /**
560
+ * Provides a hint to the user of what can be entered in the field.
561
+ */
562
+ placeholder?: string;
563
+
564
+ /**
565
+ * Indicates whether the element can be edited.
566
+ * readOnly is an HTML boolean attribute - it is enabled by a boolean or
567
+ * 'readOnly'. Alternative capitalizations `readonly` & `READONLY`
568
+ * are also acccepted.
569
+ */
570
+ readOnly?: boolean | 'readOnly' | 'readonly' | 'READONLY';
571
+
572
+ /**
573
+ * Indicates whether this element is required to fill out or not.
574
+ * required is an HTML boolean attribute - it is enabled by a boolean or
575
+ * 'required'. Alternative capitalizations `REQUIRED`
576
+ * are also acccepted.
577
+ */
578
+ required?: boolean | 'required' | 'REQUIRED';
579
+
580
+ /**
581
+ * Defines the number of rows in a text area.
582
+ */
583
+ rows?: number;
584
+
585
+ /**
586
+ * Indicates whether the text should be wrapped.
587
+ */
588
+ wrap?: string;
589
+
590
+ /**
591
+ * Defines a keyboard shortcut to activate or add focus to the element.
592
+ */
593
+ accessKey?: string;
594
+
595
+ /**
596
+ * Indicates whether the element's content is editable.
597
+ */
598
+ contentEditable?: boolean;
599
+
600
+ /**
601
+ * Defines the ID of a <menu> element which will serve as the element's context menu.
602
+ */
603
+ contextMenu?: string;
604
+
605
+ /**
606
+ * Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
607
+ */
608
+ dir?: string;
609
+
610
+ /**
611
+ * Defines whether the element can be dragged.
612
+ */
613
+ draggable?: boolean;
614
+
615
+ /**
616
+ * Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
617
+ */
618
+ hidden?: string;
619
+
620
+ /**
621
+ * Defines the language used in the element.
622
+ */
623
+ lang?: string;
624
+
625
+ /**
626
+ * Indicates whether spell checking is allowed for the element.
627
+ */
628
+ spellCheck?: boolean;
629
+
630
+ /**
631
+ * Defines CSS styles which will override styles previously set.
632
+ */
633
+ style?: React.CSSProperties;
634
+
635
+ /**
636
+ * Overrides the browser's default tab order and follows the one specified instead.
637
+ */
638
+ tabIndex?: number;
639
+
640
+ /**
641
+ * Text to be displayed in a tooltip when hovering over the element.
642
+ */
643
+ title?: string;
644
+
645
+ /**
646
+ * Number of times the textarea lost focus.
647
+ */
648
+ n_blur?: number;
649
+ /**
650
+ * Last time the textarea lost focus.
651
+ */
652
+ n_blur_timestamp?: number;
653
+
654
+ /**
655
+ * Number of times the textarea has been clicked.
656
+ */
657
+ n_clicks?: number;
658
+ /**
659
+ * Last time the textarea was clicked.
660
+ */
661
+ n_clicks_timestamp?: number;
662
+ }
663
+
664
+ export interface TooltipProps {
665
+ /**
666
+ * The contents of the tooltip
667
+ */
668
+ children?: React.ReactNode;
669
+
670
+ /**
671
+ * The ID of this component, used to identify dash components
672
+ * in callbacks. The ID needs to be unique across all of the
673
+ * components in an app.
674
+ */
675
+ id?: string;
676
+
677
+ /**
678
+ * The class of the tooltip
679
+ */
680
+ className?: string;
681
+
682
+ /**
683
+ * The style of the tooltip
684
+ */
685
+ style?: React.CSSProperties;
686
+
687
+ /**
688
+ * The bounding box coordinates of the item to label, in px relative to
689
+ * the positioning parent of the Tooltip component.
690
+ */
691
+ bbox?: {
692
+ x0: number;
693
+ y0: number;
694
+ x1: number;
695
+ y1: number;
696
+ };
697
+
698
+ /**
699
+ * Whether to show the tooltip
700
+ */
701
+ show?: boolean;
702
+
703
+ /**
704
+ * The side of the `bbox` on which the tooltip should open.
705
+ */
706
+ direction?: 'top' | 'right' | 'bottom' | 'left';
707
+
708
+ /**
709
+ * Color of the tooltip border, as a CSS color string.
710
+ */
711
+ border_color?: string;
712
+
713
+ /**
714
+ * Color of the tooltip background, as a CSS color string.
715
+ */
716
+ background_color?: string;
717
+
718
+ /**
719
+ * The text displayed in the tooltip while loading
720
+ */
721
+ loading_text?: string;
722
+
723
+ /**
724
+ * The `z-index` CSS property to assign to the tooltip. Components with
725
+ * higher values will be displayed on top of components with lower values.
726
+ */
727
+ zindex?: number;
728
+
729
+ /**
730
+ * Whether the tooltip itself can be targeted by pointer events.
731
+ * For tooltips triggered by hover events, typically this should be left
732
+ * `false` to avoid the tooltip interfering with those same events.
733
+ */
734
+ targetable?: boolean;
735
+
736
+ /**
737
+ * Dash-assigned callback that gets fired when the value changes.
738
+ */
739
+ setProps: (props: Partial<TooltipProps>) => void;
740
+ }
741
+
742
+ export interface LoadingProps extends BaseDccProps<LoadingProps> {
743
+ /**
744
+ * Array that holds components to render
745
+ */
746
+ children?: React.ReactNode;
747
+
748
+ /**
749
+ * Property that determines which built-in spinner to show
750
+ * one of 'graph', 'cube', 'circle', 'dot', or 'default'.
751
+ */
752
+ type?: 'graph' | 'cube' | 'circle' | 'dot' | 'default';
753
+
754
+ /**
755
+ * Boolean that makes the built-in spinner display full-screen
756
+ */
757
+ fullscreen?: boolean;
758
+
759
+ /**
760
+ * If true, the built-in spinner will display the component_name and prop_name
761
+ * while loading
762
+ */
763
+ debug?: boolean;
764
+
765
+ /**
766
+ * Additional CSS styling for the built-in spinner root DOM node
767
+ */
768
+ style?: React.CSSProperties;
769
+
770
+ /**
771
+ * Additional CSS class for the outermost dcc.Loading parent div DOM node
772
+ */
773
+ parent_className?: string;
774
+
775
+ /**
776
+ * Additional CSS styling for the outermost dcc.Loading parent div DOM node
777
+ */
778
+ parent_style?: React.CSSProperties;
779
+ /**
780
+ * Additional CSS styling for the spinner overlay. This is applied to the
781
+ * dcc.Loading children while the spinner is active. The default is `{'visibility': 'hidden'}`
782
+ */
783
+ overlay_style?: React.CSSProperties;
784
+
785
+ /**
786
+ * Primary color used for the built-in loading spinners
787
+ */
788
+ color?: string;
789
+
790
+ /**
791
+ * Setting display to "show" or "hide" will override the loading state coming from dash-renderer
792
+ */
793
+ display?: 'auto' | 'show' | 'hide';
794
+
795
+ /**
796
+ * Add a time delay (in ms) to the spinner being removed to prevent flickering.
797
+ */
798
+ delay_hide?: number;
799
+
800
+ /**
801
+ * Add a time delay (in ms) to the spinner being shown after the loading_state
802
+ * is set to True.
803
+ */
804
+ delay_show?: number;
805
+
806
+ /**
807
+ * Whether the Spinner should show on app start-up before the loading state
808
+ * has been determined. Default True. Use when also setting `delay_show`.
809
+ */
810
+ show_initially?: boolean;
811
+
812
+ /**
813
+ * Specify component and prop to trigger showing the loading spinner
814
+ * example: `{"output-container": "children", "grid": ["rowData", "columnDefs]}`
815
+ *
816
+ */
817
+ target_components?: Record<string, string | string[]>;
818
+
819
+ /**
820
+ * Component to use rather than the built-in spinner specified in the `type` prop.
821
+ *
822
+ */
823
+ custom_spinner?: React.ReactNode;
824
+ }
825
+
826
+ export interface TabsProps extends BaseDccProps<TabsProps> {
827
+ /**
828
+ * The value of the currently selected Tab
829
+ */
830
+ value?: string;
831
+
832
+ /**
833
+ * Appends a class to the Tab content container holding the children of the Tab that is selected.
834
+ */
835
+ content_className?: string;
836
+
837
+ /**
838
+ * Appends a class to the top-level parent container holding both the Tabs container and the content container.
839
+ */
840
+ parent_className?: string;
841
+
842
+ /**
843
+ * Appends (inline) styles to the Tabs container holding the individual Tab components.
844
+ */
845
+ style?: React.CSSProperties;
846
+
847
+ /**
848
+ * Appends (inline) styles to the top-level parent container holding both the Tabs container and the content container.
849
+ */
850
+ parent_style?: React.CSSProperties;
851
+
852
+ /**
853
+ * Appends (inline) styles to the tab content container holding the children of the Tab that is selected.
854
+ */
855
+ content_style?: React.CSSProperties;
856
+
857
+ /**
858
+ * Renders the tabs vertically (on the side)
859
+ */
860
+ vertical?: boolean;
861
+
862
+ /**
863
+ * Breakpoint at which tabs are rendered full width (can be 0 if you don't want full width tabs on mobile)
864
+ */
865
+ mobile_breakpoint?: number;
866
+
867
+ /**
868
+ * Array that holds Tab components
869
+ */
870
+ children?: DashComponent;
871
+
872
+ /**
873
+ * Holds the colors used by the Tabs and Tab components. If you set these, you should specify colors for all properties, so:
874
+ * colors: {
875
+ * border: '#d6d6d6',
876
+ * primary: '#1975FA',
877
+ * background: '#f9f9f9'
878
+ * }
879
+ */
880
+ colors?: {
881
+ border: string;
882
+ primary: string;
883
+ background: string;
884
+ };
885
+ }
886
+
887
+ // Note a quirk in how this extends the BaseDccProps: `setProps` is shared
888
+ // with `TabsProps` (plural!) due to how tabs are implemented. This is
889
+ // intentional.
890
+ export interface TabProps extends BaseDccProps<TabsProps> {
891
+ /**
892
+ * The tab's label
893
+ */
894
+ label?: string | DashComponent;
895
+
896
+ /**
897
+ * The content of the tab - will only be displayed if this tab is selected
898
+ */
899
+ children?: DashComponent;
900
+
901
+ /**
902
+ * Value for determining which Tab is currently selected
903
+ */
904
+ value?: string;
905
+
906
+ /**
907
+ * Determines if tab is disabled or not - defaults to false
908
+ */
909
+ disabled?: boolean;
910
+
911
+ /**
912
+ * Overrides the default (inline) styles when disabled
913
+ */
914
+ disabled_style?: React.CSSProperties;
915
+
916
+ /**
917
+ * Appends a class to the Tab component when it is disabled.
918
+ */
919
+ disabled_className?: string;
920
+
921
+ /**
922
+ * Appends a class to the Tab component.
923
+ */
924
+ className?: string;
925
+
926
+ /**
927
+ * Appends a class to the Tab component when it is selected.
928
+ */
929
+ selected_className?: string;
930
+
931
+ /**
932
+ * Overrides the default (inline) styles for the Tab component.
933
+ */
934
+ style?: React.CSSProperties;
935
+
936
+ /**
937
+ * Overrides the default (inline) styles for the Tab component when it is selected.
938
+ */
939
+ selected_style?: React.CSSProperties;
940
+
941
+ /**
942
+ * A custom width for this tab, in the format of `50px` or `50%`; numbers
943
+ * are treated as pixel values. By default, there is no width and this Tab
944
+ * is evenly spaced along with all the other tabs to occupy the available
945
+ * space. Setting this value will "fix" this tab width to the given size.
946
+ * while the other "non-fixed" tabs will continue to automatically
947
+ * occupying the remaining available space.
948
+ * This property has no effect when tabs are displayed vertically.
949
+ */
950
+ width?: string | number;
951
+ }
952
+
953
+ export enum DayOfWeek {
954
+ Sunday = 0,
955
+ Monday = 1,
956
+ Tuesday = 2,
957
+ Wednesday = 3,
958
+ Thursday = 4,
959
+ Friday = 5,
960
+ Saturday = 6,
961
+ }
962
+
963
+ export enum CalendarDirection {
964
+ LeftToRight = 'ltr',
965
+ RightToLeft = 'rtl',
966
+ }
967
+
968
+ export interface DatePickerSingleProps
969
+ extends BaseDccProps<DatePickerSingleProps> {
970
+ /**
971
+ * Specifies the starting date for the component, best practice is to pass
972
+ * value via datetime object
973
+ */
974
+ date?: `${string}-${string}-${string}`;
975
+
976
+ /**
977
+ * Specifies the lowest selectable date for the component.
978
+ * Accepts datetime.datetime objects or strings
979
+ * in the format 'YYYY-MM-DD'
980
+ */
981
+ min_date_allowed?: string;
982
+
983
+ /**
984
+ * Specifies the highest selectable date for the component.
985
+ * Accepts datetime.datetime objects or strings
986
+ * in the format 'YYYY-MM-DD'
987
+ */
988
+ max_date_allowed?: string;
989
+
990
+ /**
991
+ * Specifies additional days between min_date_allowed and max_date_allowed
992
+ * that should be disabled. Accepted datetime.datetime objects or strings
993
+ * in the format 'YYYY-MM-DD'
994
+ */
995
+ disabled_days?: string[];
996
+
997
+ /**
998
+ * Text that will be displayed in the input
999
+ * box of the date picker when no date is selected.
1000
+ */
1001
+ placeholder?: string;
1002
+
1003
+ /**
1004
+ * Specifies the month that is initially presented when the user
1005
+ * opens the calendar. Accepts datetime.datetime objects or strings
1006
+ * in the format 'YYYY-MM-DD'
1007
+ *
1008
+ */
1009
+ initial_visible_month?: string;
1010
+
1011
+ /**
1012
+ * Whether or not the dropdown is "clearable", that is, whether or
1013
+ * not a small "x" appears on the right of the dropdown that removes
1014
+ * the selected value.
1015
+ */
1016
+ clearable?: boolean;
1017
+
1018
+ /**
1019
+ * If True, the calendar will automatically open when cleared
1020
+ */
1021
+ reopen_calendar_on_clear?: boolean;
1022
+
1023
+ /**
1024
+ * Specifies the format that the selected dates will be displayed
1025
+ * valid formats are variations of "MM YY DD". For example:
1026
+ * "MM YY DD" renders as '05 10 97' for May 10th 1997
1027
+ * "MMMM, YY" renders as 'May, 1997' for May 10th 1997
1028
+ * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
1029
+ * "MMMM" renders as 'May' for May 10 1997
1030
+ */
1031
+ display_format?: string;
1032
+
1033
+ /**
1034
+ * Specifies the format that the month will be displayed in the calendar,
1035
+ * valid formats are variations of "MM YY". For example:
1036
+ * "MM YY" renders as '05 97' for May 1997
1037
+ * "MMMM, YYYY" renders as 'May, 1997' for May 1997
1038
+ * "MMM, YY" renders as 'Sep, 97' for September 1997
1039
+ */
1040
+ month_format?: string;
1041
+
1042
+ /**
1043
+ * Specifies what day is the first day of the week, values must be
1044
+ * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
1045
+ */
1046
+ first_day_of_week?: DayOfWeek;
1047
+
1048
+ /**
1049
+ * If True the calendar will display days that rollover into
1050
+ * the next month
1051
+ */
1052
+ show_outside_days?: boolean;
1053
+
1054
+ /**
1055
+ * If True the calendar will not close when the user has selected a value
1056
+ * and will wait until the user clicks off the calendar
1057
+ */
1058
+ stay_open_on_select?: boolean;
1059
+
1060
+ /**
1061
+ * Orientation of calendar, either vertical or horizontal.
1062
+ * Valid options are 'vertical' or 'horizontal'.
1063
+ */
1064
+ calendar_orientation?: 'vertical' | 'horizontal';
1065
+
1066
+ /**
1067
+ * Number of calendar months that are shown when calendar is opened
1068
+ */
1069
+ number_of_months_shown?: number;
1070
+
1071
+ /**
1072
+ * If True, calendar will open in a screen overlay portal,
1073
+ * not supported on vertical calendar
1074
+ */
1075
+ with_portal?: boolean;
1076
+
1077
+ /**
1078
+ * If True, calendar will open in a full screen overlay portal, will
1079
+ * take precedent over 'withPortal' if both are set to True,
1080
+ * not supported on vertical calendar
1081
+ */
1082
+ with_full_screen_portal?: boolean;
1083
+
1084
+ /**
1085
+ * Size of rendered calendar days, higher number
1086
+ * means bigger day size and larger calendar overall
1087
+ */
1088
+ day_size?: number;
1089
+
1090
+ /**
1091
+ * Determines whether the calendar and days operate
1092
+ * from left to right or from right to left
1093
+ */
1094
+ is_RTL?: boolean;
1095
+
1096
+ /**
1097
+ * If True, no dates can be selected.
1098
+ */
1099
+ disabled?: boolean;
1100
+
1101
+ /**
1102
+ * CSS styles appended to wrapper div
1103
+ */
1104
+ style?: React.CSSProperties;
1105
+ }
1106
+
1107
+ export interface DatePickerRangeProps
1108
+ extends Omit<DatePickerSingleProps, 'date'> {
1109
+ /**
1110
+ * Specifies the starting date for the component.
1111
+ * Accepts datetime.datetime objects or strings
1112
+ * in the format 'YYYY-MM-DD'
1113
+ */
1114
+ start_date?: `${string}-${string}-${string}`;
1115
+
1116
+ /**
1117
+ * Specifies the ending date for the component.
1118
+ * Accepts datetime.datetime objects or strings
1119
+ * in the format 'YYYY-MM-DD'
1120
+ */
1121
+ end_date?: `${string}-${string}-${string}`;
1122
+
1123
+ /**
1124
+ * Specifies a minimum number of nights that must be selected between
1125
+ * the startDate and the endDate
1126
+ */
1127
+ minimum_nights?: number;
1128
+
1129
+ /**
1130
+ * Determines when the component should update
1131
+ * its value. If `bothdates`, then the DatePicker
1132
+ * will only trigger its value when the user has
1133
+ * finished picking both dates. If `singledate`, then
1134
+ * the DatePicker will update its value
1135
+ * as one date is picked.
1136
+ */
1137
+ updatemode?: 'singledate' | 'bothdates';
1138
+
1139
+ /**
1140
+ * Text that will be displayed in the first input
1141
+ * box of the date picker when no date is selected. Default value is 'Start Date'
1142
+ */
1143
+ start_date_placeholder_text?: string;
1144
+
1145
+ /**
1146
+ * Text that will be displayed in the second input
1147
+ * box of the date picker when no date is selected. Default value is 'End Date'
1148
+ */
1149
+ end_date_placeholder_text?: string;
1150
+
1151
+ /**
1152
+ * The HTML element ID of the start date input field.
1153
+ * Not used by Dash, only by CSS.
1154
+ */
1155
+ start_date_id?: string;
1156
+
1157
+ /**
1158
+ * The HTML element ID of the end date input field.
1159
+ * Not used by Dash, only by CSS.
1160
+ */
1161
+ end_date_id?: string;
1162
+
1163
+ setProps: (props: Partial<DatePickerRangeProps>) => void;
499
1164
  }