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
@@ -1,193 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- var _ramda = require("ramda");
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _optionTypes = require("../utils/optionTypes");
11
- var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
- /**
20
- * Checklist is a component that encapsulates several checkboxes.
21
- * The values and labels of the checklist are specified in the `options`
22
- * property and the checked items are specified with the `value` property.
23
- * Each checkbox is rendered as an input with a surrounding label.
24
- */
25
- class Checklist extends _react.Component {
26
- render() {
27
- var _this$props = this.props,
28
- className = _this$props.className,
29
- id = _this$props.id,
30
- inputClassName = _this$props.inputClassName,
31
- inputStyle = _this$props.inputStyle,
32
- labelClassName = _this$props.labelClassName,
33
- labelStyle = _this$props.labelStyle,
34
- options = _this$props.options,
35
- setProps = _this$props.setProps,
36
- style = _this$props.style,
37
- value = _this$props.value,
38
- inline = _this$props.inline;
39
- return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
40
- id: id,
41
- style: style,
42
- className: className
43
- }, (0, _optionTypes.sanitizeOptions)(options).map(option => {
44
- return /*#__PURE__*/_react.default.createElement("label", {
45
- key: option.value,
46
- style: _objectSpread({
47
- display: inline ? 'inline-block' : 'block'
48
- }, labelStyle),
49
- className: labelClassName,
50
- title: option.title
51
- }, /*#__PURE__*/_react.default.createElement("input", {
52
- checked: (0, _ramda.includes)(option.value, value),
53
- className: inputClassName,
54
- disabled: Boolean(option.disabled),
55
- style: inputStyle,
56
- type: "checkbox",
57
- onChange: () => {
58
- var newValue;
59
- if ((0, _ramda.includes)(option.value, value)) {
60
- newValue = (0, _ramda.without)([option.value], value);
61
- } else {
62
- newValue = (0, _ramda.append)(option.value, value);
63
- }
64
- setProps({
65
- value: newValue
66
- });
67
- }
68
- }), option.label);
69
- }));
70
- }
71
- }
72
- exports.default = Checklist;
73
- Checklist.propTypes = {
74
- /**
75
- * An array of options
76
- */
77
- options: _propTypes.default.oneOfType([
78
- /**
79
- * Array of options where the label and the value are the same thing - [string|number|bool]
80
- */
81
- _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool])),
82
- /**
83
- * Simpler `options` representation in dictionary format. The order is not guaranteed.
84
- * {`value1`: `label1`, `value2`: `label2`, ... }
85
- * which is equal to
86
- * [{label: `label1`, value: `value1`}, {label: `label2`, value: `value2`}, ...]
87
- */
88
- _propTypes.default.object,
89
- /**
90
- * An array of options {label: [string|number], value: [string|number]},
91
- * an optional disabled field can be used for each option
92
- */
93
- _propTypes.default.arrayOf(_propTypes.default.exact({
94
- /**
95
- * The option's label
96
- */
97
- label: _propTypes.default.node.isRequired,
98
- /**
99
- * The value of the option. This value
100
- * corresponds to the items specified in the
101
- * `value` property.
102
- */
103
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]).isRequired,
104
- /**
105
- * If true, this option is disabled and cannot be selected.
106
- */
107
- disabled: _propTypes.default.bool,
108
- /**
109
- * The HTML 'title' attribute for the option. Allows for
110
- * information on hover. For more information on this attribute,
111
- * see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
112
- */
113
- title: _propTypes.default.string
114
- }))]),
115
- /**
116
- * The currently selected value
117
- */
118
- value: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool])),
119
- /**
120
- * Indicates whether the options labels should be displayed inline (true=horizontal)
121
- * or in a block (false=vertical).
122
- */
123
- inline: _propTypes.default.bool,
124
- /**
125
- * The class of the container (div)
126
- */
127
- className: _propTypes.default.string,
128
- /**
129
- * The style of the container (div)
130
- */
131
- style: _propTypes.default.object,
132
- /**
133
- * The style of the <input> checkbox element
134
- */
135
- inputStyle: _propTypes.default.object,
136
- /**
137
- * The class of the <input> checkbox element
138
- */
139
- inputClassName: _propTypes.default.string,
140
- /**
141
- * The style of the <label> that wraps the checkbox input
142
- * and the option's label
143
- */
144
- labelStyle: _propTypes.default.object,
145
- /**
146
- * The class of the <label> that wraps the checkbox input
147
- * and the option's label
148
- */
149
- labelClassName: _propTypes.default.string,
150
- /**
151
- * The ID of this component, used to identify dash components
152
- * in callbacks. The ID needs to be unique across all of the
153
- * components in an app.
154
- */
155
- id: _propTypes.default.string,
156
- /**
157
- * Dash-assigned callback that gets fired when the value changes.
158
- */
159
- setProps: _propTypes.default.func,
160
- /**
161
- * Used to allow user interactions in this component to be persisted when
162
- * the component - or the page - is refreshed. If `persisted` is truthy and
163
- * hasn't changed from its previous value, a `value` that the user has
164
- * changed while using the app will keep that change, as long as
165
- * the new `value` also matches what was given originally.
166
- * Used in conjunction with `persistence_type`.
167
- */
168
- persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
169
- /**
170
- * Properties whose user interactions will persist after refreshing the
171
- * component or the page. Since only `value` is allowed this prop can
172
- * normally be ignored.
173
- */
174
- persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['value'])),
175
- /**
176
- * Where persisted user changes will be stored:
177
- * memory: only kept in memory, reset on page refresh.
178
- * local: window.localStorage, data is kept after the browser quit.
179
- * session: window.sessionStorage, data is cleared once the browser quit.
180
- */
181
- persistence_type: _propTypes.default.oneOf(['local', 'session', 'memory'])
182
- };
183
- Checklist.defaultProps = {
184
- inputStyle: {},
185
- inputClassName: '',
186
- labelStyle: {},
187
- labelClassName: '',
188
- options: [],
189
- value: [],
190
- persisted_props: ['value'],
191
- persistence_type: 'local',
192
- inline: false
193
- };
@@ -1,244 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.propTypes = exports.defaultProps = exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _datePickerRange = _interopRequireDefault(require("../utils/LazyLoader/datePickerRange"));
10
- var _DatePickerPersistence = _interopRequireDefault(require("../utils/DatePickerPersistence"));
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- var RealDatePickerRange = /*#__PURE__*/(0, _react.lazy)(_datePickerRange.default);
14
-
15
- /**
16
- * DatePickerRange is a tailor made component designed for selecting
17
- * timespan across multiple days off of a calendar.
18
- *
19
- * The DatePicker integrates well with the Python datetime module with the
20
- * startDate and endDate being returned in a string format suitable for
21
- * creating datetime objects.
22
- *
23
- * This component is based off of Airbnb's react-dates react component
24
- * which can be found here: https://github.com/airbnb/react-dates
25
- */
26
- class DatePickerRange extends _react.Component {
27
- render() {
28
- return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
29
- fallback: null
30
- }, /*#__PURE__*/_react.default.createElement(RealDatePickerRange, this.props));
31
- }
32
- }
33
- exports.default = DatePickerRange;
34
- DatePickerRange.propTypes = {
35
- /**
36
- * Specifies the starting date for the component.
37
- * Accepts datetime.datetime objects or strings
38
- * in the format 'YYYY-MM-DD'
39
- */
40
- start_date: _propTypes.default.string,
41
- /**
42
- * Specifies the ending date for the component.
43
- * Accepts datetime.datetime objects or strings
44
- * in the format 'YYYY-MM-DD'
45
- */
46
- end_date: _propTypes.default.string,
47
- /**
48
- * Specifies the lowest selectable date for the component.
49
- * Accepts datetime.datetime objects or strings
50
- * in the format 'YYYY-MM-DD'
51
- */
52
- min_date_allowed: _propTypes.default.string,
53
- /**
54
- * Specifies the highest selectable date for the component.
55
- * Accepts datetime.datetime objects or strings
56
- * in the format 'YYYY-MM-DD'
57
- */
58
- max_date_allowed: _propTypes.default.string,
59
- /**
60
- * Specifies additional days between min_date_allowed and max_date_allowed
61
- * that should be disabled. Accepted datetime.datetime objects or strings
62
- * in the format 'YYYY-MM-DD'
63
- */
64
- disabled_days: _propTypes.default.arrayOf(_propTypes.default.string),
65
- /**
66
- * Specifies a minimum number of nights that must be selected between
67
- * the startDate and the endDate
68
- */
69
- minimum_nights: _propTypes.default.number,
70
- /**
71
- * Determines when the component should update
72
- * its value. If `bothdates`, then the DatePicker
73
- * will only trigger its value when the user has
74
- * finished picking both dates. If `singledate`, then
75
- * the DatePicker will update its value
76
- * as one date is picked.
77
- */
78
- updatemode: _propTypes.default.oneOf(['singledate', 'bothdates']),
79
- /**
80
- * Text that will be displayed in the first input
81
- * box of the date picker when no date is selected. Default value is 'Start Date'
82
- */
83
- start_date_placeholder_text: _propTypes.default.string,
84
- /**
85
- * Text that will be displayed in the second input
86
- * box of the date picker when no date is selected. Default value is 'End Date'
87
- */
88
- end_date_placeholder_text: _propTypes.default.string,
89
- /**
90
- * Specifies the month that is initially presented when the user
91
- * opens the calendar. Accepts datetime.datetime objects or strings
92
- * in the format 'YYYY-MM-DD'
93
- *
94
- */
95
- initial_visible_month: _propTypes.default.string,
96
- /**
97
- * Whether or not the dropdown is "clearable", that is, whether or
98
- * not a small "x" appears on the right of the dropdown that removes
99
- * the selected value.
100
- */
101
- clearable: _propTypes.default.bool,
102
- /**
103
- * If True, the calendar will automatically open when cleared
104
- */
105
- reopen_calendar_on_clear: _propTypes.default.bool,
106
- /**
107
- * Specifies the format that the selected dates will be displayed
108
- * valid formats are variations of "MM YY DD". For example:
109
- * "MM YY DD" renders as '05 10 97' for May 10th 1997
110
- * "MMMM, YY" renders as 'May, 1997' for May 10th 1997
111
- * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
112
- * "MMMM" renders as 'May' for May 10 1997
113
- */
114
- display_format: _propTypes.default.string,
115
- /**
116
- * Specifies the format that the month will be displayed in the calendar,
117
- * valid formats are variations of "MM YY". For example:
118
- * "MM YY" renders as '05 97' for May 1997
119
- * "MMMM, YYYY" renders as 'May, 1997' for May 1997
120
- * "MMM, YY" renders as 'Sep, 97' for September 1997
121
- */
122
- month_format: _propTypes.default.string,
123
- /**
124
- * Specifies what day is the first day of the week, values must be
125
- * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
126
- */
127
- first_day_of_week: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6]),
128
- /**
129
- * If True the calendar will display days that rollover into
130
- * the next month
131
- */
132
- show_outside_days: _propTypes.default.bool,
133
- /**
134
- * If True the calendar will not close when the user has selected a value
135
- * and will wait until the user clicks off the calendar
136
- */
137
- stay_open_on_select: _propTypes.default.bool,
138
- /**
139
- * Orientation of calendar, either vertical or horizontal.
140
- * Valid options are 'vertical' or 'horizontal'.
141
- */
142
- calendar_orientation: _propTypes.default.oneOf(['vertical', 'horizontal']),
143
- /**
144
- * Number of calendar months that are shown when calendar is opened
145
- */
146
- number_of_months_shown: _propTypes.default.number,
147
- /**
148
- * If True, calendar will open in a screen overlay portal,
149
- * not supported on vertical calendar
150
- */
151
- with_portal: _propTypes.default.bool,
152
- /**
153
- * If True, calendar will open in a full screen overlay portal, will
154
- * take precedent over 'withPortal' if both are set to true,
155
- * not supported on vertical calendar
156
- */
157
- with_full_screen_portal: _propTypes.default.bool,
158
- /**
159
- * Size of rendered calendar days, higher number
160
- * means bigger day size and larger calendar overall
161
- */
162
- day_size: _propTypes.default.number,
163
- /**
164
- * Determines whether the calendar and days operate
165
- * from left to right or from right to left
166
- */
167
- is_RTL: _propTypes.default.bool,
168
- /**
169
- * If True, no dates can be selected.
170
- */
171
- disabled: _propTypes.default.bool,
172
- /**
173
- * The HTML element ID of the start date input field.
174
- * Not used by Dash, only by CSS.
175
- */
176
- start_date_id: _propTypes.default.string,
177
- /**
178
- * The HTML element ID of the end date input field.
179
- * Not used by Dash, only by CSS.
180
- */
181
- end_date_id: _propTypes.default.string,
182
- /**
183
- * CSS styles appended to wrapper div
184
- */
185
- style: _propTypes.default.object,
186
- /**
187
- * Appends a CSS class to the wrapper div component.
188
- */
189
- className: _propTypes.default.string,
190
- /**
191
- * The ID of this component, used to identify dash components
192
- * in callbacks. The ID needs to be unique across all of the
193
- * components in an app.
194
- */
195
- id: _propTypes.default.string,
196
- /**
197
- * Dash-assigned callback that gets fired when the value changes.
198
- */
199
- setProps: _propTypes.default.func,
200
- /**
201
- * Used to allow user interactions in this component to be persisted when
202
- * the component - or the page - is refreshed. If `persisted` is truthy and
203
- * hasn't changed from its previous value, any `persisted_props` that the
204
- * user has changed while using the app will keep those changes, as long as
205
- * the new prop value also matches what was given originally.
206
- * Used in conjunction with `persistence_type` and `persisted_props`.
207
- */
208
- persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
209
- /**
210
- * Properties whose user interactions will persist after refreshing the
211
- * component or the page.
212
- */
213
- persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['start_date', 'end_date'])),
214
- /**
215
- * Where persisted user changes will be stored:
216
- * memory: only kept in memory, reset on page refresh.
217
- * local: window.localStorage, data is kept after the browser quit.
218
- * session: window.sessionStorage, data is cleared once the browser quit.
219
- */
220
- persistence_type: _propTypes.default.oneOf(['local', 'session', 'memory'])
221
- };
222
- DatePickerRange.persistenceTransforms = {
223
- end_date: _DatePickerPersistence.default,
224
- start_date: _DatePickerPersistence.default
225
- };
226
- DatePickerRange.defaultProps = {
227
- calendar_orientation: 'horizontal',
228
- is_RTL: false,
229
- day_size: 39,
230
- with_portal: false,
231
- with_full_screen_portal: false,
232
- first_day_of_week: 0,
233
- number_of_months_shown: 1,
234
- stay_open_on_select: false,
235
- reopen_calendar_on_clear: false,
236
- clearable: false,
237
- disabled: false,
238
- updatemode: 'singledate',
239
- persisted_props: ['start_date', 'end_date'],
240
- persistence_type: 'local',
241
- disabled_days: []
242
- };
243
- var propTypes = exports.propTypes = DatePickerRange.propTypes;
244
- var defaultProps = exports.defaultProps = DatePickerRange.defaultProps;
@@ -1,209 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.propTypes = exports.defaultProps = exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _datePickerSingle = _interopRequireDefault(require("../utils/LazyLoader/datePickerSingle"));
10
- var _DatePickerPersistence = _interopRequireDefault(require("../utils/DatePickerPersistence"));
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- var RealDateSingleRange = /*#__PURE__*/(0, _react.lazy)(_datePickerSingle.default);
14
-
15
- /**
16
- * DatePickerSingle is a tailor made component designed for selecting
17
- * a single day off of a calendar.
18
- *
19
- * The DatePicker integrates well with the Python datetime module with the
20
- * startDate and endDate being returned in a string format suitable for
21
- * creating datetime objects.
22
- *
23
- * This component is based off of Airbnb's react-dates react component
24
- * which can be found here: https://github.com/airbnb/react-dates
25
- */
26
- class DatePickerSingle extends _react.Component {
27
- render() {
28
- return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
29
- fallback: null
30
- }, /*#__PURE__*/_react.default.createElement(RealDateSingleRange, this.props));
31
- }
32
- }
33
- exports.default = DatePickerSingle;
34
- DatePickerSingle.propTypes = {
35
- /**
36
- * Specifies the starting date for the component, best practice is to pass
37
- * value via datetime object
38
- */
39
- date: _propTypes.default.string,
40
- /**
41
- * Specifies the lowest selectable date for the component.
42
- * Accepts datetime.datetime objects or strings
43
- * in the format 'YYYY-MM-DD'
44
- */
45
- min_date_allowed: _propTypes.default.string,
46
- /**
47
- * Specifies the highest selectable date for the component.
48
- * Accepts datetime.datetime objects or strings
49
- * in the format 'YYYY-MM-DD'
50
- */
51
- max_date_allowed: _propTypes.default.string,
52
- /**
53
- * Specifies additional days between min_date_allowed and max_date_allowed
54
- * that should be disabled. Accepted datetime.datetime objects or strings
55
- * in the format 'YYYY-MM-DD'
56
- */
57
- disabled_days: _propTypes.default.arrayOf(_propTypes.default.string),
58
- /**
59
- * Text that will be displayed in the input
60
- * box of the date picker when no date is selected.
61
- * Default value is 'Start Date'
62
- */
63
- placeholder: _propTypes.default.string,
64
- /**
65
- * Specifies the month that is initially presented when the user
66
- * opens the calendar. Accepts datetime.datetime objects or strings
67
- * in the format 'YYYY-MM-DD'
68
- *
69
- */
70
- initial_visible_month: _propTypes.default.string,
71
- /**
72
- * Whether or not the dropdown is "clearable", that is, whether or
73
- * not a small "x" appears on the right of the dropdown that removes
74
- * the selected value.
75
- */
76
- clearable: _propTypes.default.bool,
77
- /**
78
- * If True, the calendar will automatically open when cleared
79
- */
80
- reopen_calendar_on_clear: _propTypes.default.bool,
81
- /**
82
- * Specifies the format that the selected dates will be displayed
83
- * valid formats are variations of "MM YY DD". For example:
84
- * "MM YY DD" renders as '05 10 97' for May 10th 1997
85
- * "MMMM, YY" renders as 'May, 1997' for May 10th 1997
86
- * "M, D, YYYY" renders as '07, 10, 1997' for September 10th 1997
87
- * "MMMM" renders as 'May' for May 10 1997
88
- */
89
- display_format: _propTypes.default.string,
90
- /**
91
- * Specifies the format that the month will be displayed in the calendar,
92
- * valid formats are variations of "MM YY". For example:
93
- * "MM YY" renders as '05 97' for May 1997
94
- * "MMMM, YYYY" renders as 'May, 1997' for May 1997
95
- * "MMM, YY" renders as 'Sep, 97' for September 1997
96
- */
97
- month_format: _propTypes.default.string,
98
- /**
99
- * Specifies what day is the first day of the week, values must be
100
- * from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
101
- */
102
- first_day_of_week: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6]),
103
- /**
104
- * If True the calendar will display days that rollover into
105
- * the next month
106
- */
107
- show_outside_days: _propTypes.default.bool,
108
- /**
109
- * If True the calendar will not close when the user has selected a value
110
- * and will wait until the user clicks off the calendar
111
- */
112
- stay_open_on_select: _propTypes.default.bool,
113
- /**
114
- * Orientation of calendar, either vertical or horizontal.
115
- * Valid options are 'vertical' or 'horizontal'.
116
- */
117
- calendar_orientation: _propTypes.default.oneOf(['vertical', 'horizontal']),
118
- /**
119
- * Number of calendar months that are shown when calendar is opened
120
- */
121
- number_of_months_shown: _propTypes.default.number,
122
- /**
123
- * If True, calendar will open in a screen overlay portal,
124
- * not supported on vertical calendar
125
- */
126
- with_portal: _propTypes.default.bool,
127
- /**
128
- * If True, calendar will open in a full screen overlay portal, will
129
- * take precedent over 'withPortal' if both are set to True,
130
- * not supported on vertical calendar
131
- */
132
- with_full_screen_portal: _propTypes.default.bool,
133
- /**
134
- * Size of rendered calendar days, higher number
135
- * means bigger day size and larger calendar overall
136
- */
137
- day_size: _propTypes.default.number,
138
- /**
139
- * Determines whether the calendar and days operate
140
- * from left to right or from right to left
141
- */
142
- is_RTL: _propTypes.default.bool,
143
- /**
144
- * If True, no dates can be selected.
145
- */
146
- disabled: _propTypes.default.bool,
147
- /**
148
- * CSS styles appended to wrapper div
149
- */
150
- style: _propTypes.default.object,
151
- /**
152
- * Appends a CSS class to the wrapper div component.
153
- */
154
- className: _propTypes.default.string,
155
- /**
156
- * The ID of this component, used to identify dash components
157
- * in callbacks. The ID needs to be unique across all of the
158
- * components in an app.
159
- */
160
- id: _propTypes.default.string,
161
- /**
162
- * Dash-assigned callback that gets fired when the value changes.
163
- */
164
- setProps: _propTypes.default.func,
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 `date` that the user has
169
- * changed while using the app will keep that change, as long as
170
- * the new `date` also matches what was given originally.
171
- * Used in conjunction with `persistence_type`.
172
- */
173
- persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
174
- /**
175
- * Properties whose user interactions will persist after refreshing the
176
- * component or the page. Since only `date` is allowed this prop can
177
- * normally be ignored.
178
- */
179
- persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['date'])),
180
- /**
181
- * Where persisted user changes will be stored:
182
- * memory: only kept in memory, reset on page refresh.
183
- * local: window.localStorage, data is kept after the browser quit.
184
- * session: window.sessionStorage, data is cleared once the browser quit.
185
- */
186
- persistence_type: _propTypes.default.oneOf(['local', 'session', 'memory'])
187
- };
188
- DatePickerSingle.persistenceTransforms = {
189
- date: _DatePickerPersistence.default
190
- };
191
- DatePickerSingle.defaultProps = {
192
- calendar_orientation: 'horizontal',
193
- is_RTL: false,
194
- day_size: 39,
195
- with_portal: false,
196
- with_full_screen_portal: false,
197
- show_outside_days: true,
198
- first_day_of_week: 0,
199
- number_of_months_shown: 1,
200
- stay_open_on_select: false,
201
- reopen_calendar_on_clear: false,
202
- clearable: false,
203
- disabled: false,
204
- persisted_props: ['date'],
205
- persistence_type: 'local',
206
- disabled_days: []
207
- };
208
- var propTypes = exports.propTypes = DatePickerSingle.propTypes;
209
- var defaultProps = exports.defaultProps = DatePickerSingle.defaultProps;