dash-core-components 3.0.3 → 3.0.5
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-graph.js.map +1 -1
- package/dash_core_components/async-highlight.js +1 -1
- package/dash_core_components/async-highlight.js.map +1 -1
- package/dash_core_components/async-markdown.js +1 -1
- package/dash_core_components/async-markdown.js.map +1 -1
- package/dash_core_components/async-slider.js +1 -1
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/async-upload.js +1 -1
- package/dash_core_components/async-upload.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/lib/components/Checklist.react.js +46 -63
- package/lib/components/Clipboard.react.js +172 -218
- package/lib/components/ConfirmDialog.react.js +34 -61
- package/lib/components/ConfirmDialogProvider.react.js +21 -44
- package/lib/components/DatePickerRange.react.js +7 -26
- package/lib/components/DatePickerSingle.react.js +7 -26
- package/lib/components/Download.react.js +22 -45
- package/lib/components/Dropdown.react.js +7 -26
- package/lib/components/Geolocation.react.js +64 -91
- package/lib/components/Graph.react.js +70 -97
- package/lib/components/Input.react.js +119 -162
- package/lib/components/Interval.react.js +55 -86
- package/lib/components/Link.react.js +4 -4
- package/lib/components/Loading.react.js +31 -35
- package/lib/components/Location.react.js +97 -126
- package/lib/components/Markdown.react.js +15 -35
- package/lib/components/RadioItems.react.js +45 -63
- package/lib/components/RangeSlider.react.js +7 -26
- package/lib/components/Slider.react.js +7 -26
- package/lib/components/Store.react.js +128 -176
- package/lib/components/Tab.react.js +1 -1
- package/lib/components/Tabs.react.js +99 -134
- package/lib/components/Textarea.react.js +4 -4
- package/lib/components/Tooltip.react.js +7 -6
- package/lib/components/Upload.react.js +7 -26
- package/lib/fragments/DatePickerRange.react.js +150 -181
- package/lib/fragments/DatePickerSingle.react.js +103 -134
- package/lib/fragments/Dropdown.react.js +11 -19
- package/lib/fragments/Graph.privateprops.js +3 -9
- package/lib/fragments/Graph.react.js +302 -370
- package/lib/fragments/Loading/spinners/CircleSpinner.js +2 -4
- package/lib/fragments/Loading/spinners/CubeSpinner.js +2 -4
- package/lib/fragments/Loading/spinners/DefaultSpinner.js +2 -4
- package/lib/fragments/Loading/spinners/DotSpinner.js +2 -4
- package/lib/fragments/Loading/spinners/GraphSpinner.js +2 -4
- package/lib/fragments/Markdown.react.js +119 -158
- package/lib/fragments/Math.react.js +23 -47
- package/lib/fragments/RangeSlider.react.js +110 -133
- package/lib/fragments/Slider.react.js +110 -133
- package/lib/fragments/Upload.react.js +82 -99
- package/lib/utils/DatePickerPersistence.js +2 -4
- package/lib/utils/LazyLoader/datePickerRange.js +2 -3
- package/lib/utils/LazyLoader/datePickerSingle.js +2 -3
- package/lib/utils/LazyLoader/dropdown.js +2 -3
- package/lib/utils/LazyLoader/graph.js +2 -3
- package/lib/utils/LazyLoader/hljs.js +2 -5
- package/lib/utils/LazyLoader/markdown.js +2 -3
- package/lib/utils/LazyLoader/mathjax.js +2 -5
- package/lib/utils/LazyLoader/plotly.js +7 -6
- package/lib/utils/LazyLoader/rangeSlider.js +2 -3
- package/lib/utils/LazyLoader/slider.js +2 -3
- package/lib/utils/LazyLoader/upload.js +2 -3
- package/lib/utils/MarkdownHighlighter.js +5 -6
- package/lib/utils/ResizeDetector.js +9 -13
- package/lib/utils/computeSliderMarkers.js +29 -49
- package/lib/utils/computeSliderStyle.js +4 -3
- package/lib/utils/convertToMoment.js +5 -6
- package/lib/utils/formatSliderTooltip.js +6 -8
- package/lib/utils/optionTypes.js +8 -9
- package/package.json +1 -1
|
@@ -12,22 +12,6 @@ var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"))
|
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
16
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
19
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
20
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
22
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
23
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
24
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
25
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
26
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
27
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
30
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
31
15
|
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; }
|
|
32
16
|
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; }
|
|
33
17
|
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; }
|
|
@@ -37,7 +21,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
37
21
|
// eslint-disable-line no-unused-vars
|
|
38
22
|
// EnhancedTab is defined here instead of in Tab.react.js because if exported there,
|
|
39
23
|
// it will mess up the Python imports and metadata.json
|
|
40
|
-
var EnhancedTab =
|
|
24
|
+
var EnhancedTab = _ref => {
|
|
41
25
|
var id = _ref.id,
|
|
42
26
|
label = _ref.label,
|
|
43
27
|
selected = _ref.selected,
|
|
@@ -96,7 +80,7 @@ var EnhancedTab = function EnhancedTab(_ref) {
|
|
|
96
80
|
className: tabClassName,
|
|
97
81
|
id: id,
|
|
98
82
|
style: tabStyle,
|
|
99
|
-
onClick:
|
|
83
|
+
onClick: () => {
|
|
100
84
|
if (!disabled) {
|
|
101
85
|
selectHandler(value);
|
|
102
86
|
}
|
|
@@ -105,136 +89,116 @@ var EnhancedTab = function EnhancedTab(_ref) {
|
|
|
105
89
|
jsx: true
|
|
106
90
|
}, "\n .tab {\n display: inline-block;\n background-color: ".concat(colors.background, ";\n border: 1px solid ").concat(colors.border, ";\n border-bottom: none;\n padding: 20px 25px;\n transition: background-color, color 200ms;\n width: 100%;\n text-align: center;\n box-sizing: border-box;\n }\n .tab:last-of-type {\n border-right: 1px solid ").concat(colors.border, ";\n border-bottom: 1px solid ").concat(colors.border, ";\n }\n .tab:hover {\n cursor: pointer;\n }\n .tab--selected {\n border-top: 2px solid ").concat(colors.primary, ";\n color: black;\n background-color: white;\n }\n .tab--selected:hover {\n background-color: white;\n }\n .tab--disabled {\n color: #d6d6d6;\n }\n\n @media screen and (min-width: ").concat(mobile_breakpoint, "px) {\n .tab {\n border: 1px solid ").concat(colors.border, ";\n border-right: none;\n ").concat(vertical ? '' : "width: calc(100% / ".concat(amountOfTabs, ");"), ";\n }\n .tab--selected,\n .tab:last-of-type.tab--selected {\n border-bottom: none;\n ").concat(vertical ? "border-left: 2px solid ".concat(colors.primary, ";") : "border-top: 2px solid ".concat(colors.primary, ";"), ";\n }\n }\n ")));
|
|
107
91
|
};
|
|
108
|
-
EnhancedTab.defaultProps = {
|
|
109
|
-
loading_state: {
|
|
110
|
-
is_loading: false,
|
|
111
|
-
component_name: '',
|
|
112
|
-
prop_name: ''
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
92
|
|
|
116
93
|
/**
|
|
117
94
|
* A Dash component that lets you render pages with tabs - the Tabs component's children
|
|
118
95
|
* can be dcc.Tab components, which can hold a label that will be displayed as a tab, and can in turn hold
|
|
119
96
|
* children components that will be that tab's content.
|
|
120
97
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
_this.props.setProps({
|
|
129
|
-
value: _this.valueOrDefault()
|
|
98
|
+
class Tabs extends _react.Component {
|
|
99
|
+
constructor(props) {
|
|
100
|
+
super(props);
|
|
101
|
+
this.selectHandler = this.selectHandler.bind(this);
|
|
102
|
+
if (!(0, _ramda.has)('value', this.props)) {
|
|
103
|
+
this.props.setProps({
|
|
104
|
+
value: this.valueOrDefault()
|
|
130
105
|
});
|
|
131
106
|
}
|
|
132
|
-
return _this;
|
|
133
107
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
value: function valueOrDefault() {
|
|
138
|
-
if ((0, _ramda.has)('value', this.props)) {
|
|
139
|
-
return this.props.value;
|
|
140
|
-
}
|
|
141
|
-
var children = this.parseChildrenToArray();
|
|
142
|
-
if (children && children.length) {
|
|
143
|
-
var firstChildren = window.dash_component_api.getLayout([].concat(_toConsumableArray(children[0].props.componentPath), ['props', 'value']));
|
|
144
|
-
return firstChildren || 'tab-1';
|
|
145
|
-
}
|
|
146
|
-
return 'tab-1';
|
|
108
|
+
valueOrDefault() {
|
|
109
|
+
if ((0, _ramda.has)('value', this.props)) {
|
|
110
|
+
return this.props.value;
|
|
147
111
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
// if dcc.Tabs.children contains just one single element, it gets passed as an object
|
|
153
|
-
// instead of an array - so we put it in an array ourselves!
|
|
154
|
-
return [this.props.children];
|
|
155
|
-
}
|
|
156
|
-
return this.props.children;
|
|
112
|
+
var children = this.parseChildrenToArray();
|
|
113
|
+
if (children && children.length) {
|
|
114
|
+
var firstChildren = window.dash_component_api.getLayout([...children[0].props.componentPath, 'props', 'value']);
|
|
115
|
+
return firstChildren || 'tab-1';
|
|
157
116
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
117
|
+
return 'tab-1';
|
|
118
|
+
}
|
|
119
|
+
parseChildrenToArray() {
|
|
120
|
+
if (this.props.children && !(0, _ramda.is)(Array, this.props.children)) {
|
|
121
|
+
// if dcc.Tabs.children contains just one single element, it gets passed as an object
|
|
122
|
+
// instead of an array - so we put it in an array ourselves!
|
|
123
|
+
return [this.props.children];
|
|
164
124
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (childProps.value === value) {
|
|
193
|
-
selectedTab = child;
|
|
194
|
-
}
|
|
195
|
-
return /*#__PURE__*/_react.default.createElement(EnhancedTab, {
|
|
196
|
-
key: index,
|
|
197
|
-
id: childProps.id,
|
|
198
|
-
label: childProps.label,
|
|
199
|
-
selected: value === childProps.value,
|
|
200
|
-
selectHandler: _this2.selectHandler,
|
|
201
|
-
className: childProps.className,
|
|
202
|
-
style: childProps.style,
|
|
203
|
-
selectedClassName: childProps.selected_className,
|
|
204
|
-
selected_style: childProps.selected_style,
|
|
205
|
-
value: childProps.value,
|
|
206
|
-
disabled: childProps.disabled,
|
|
207
|
-
disabled_style: childProps.disabled_style,
|
|
208
|
-
disabled_className: childProps.disabled_className,
|
|
209
|
-
mobile_breakpoint: _this2.props.mobile_breakpoint,
|
|
210
|
-
vertical: _this2.props.vertical,
|
|
211
|
-
amountOfTabs: amountOfTabs,
|
|
212
|
-
colors: _this2.props.colors,
|
|
213
|
-
componentPath: child.componentPath
|
|
125
|
+
return this.props.children;
|
|
126
|
+
}
|
|
127
|
+
selectHandler(value) {
|
|
128
|
+
this.props.setProps({
|
|
129
|
+
value: value
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
render() {
|
|
133
|
+
var EnhancedTabs;
|
|
134
|
+
var selectedTab;
|
|
135
|
+
var value = this.valueOrDefault();
|
|
136
|
+
if (this.props.children) {
|
|
137
|
+
var children = this.parseChildrenToArray();
|
|
138
|
+
var amountOfTabs = children.length;
|
|
139
|
+
EnhancedTabs = children.map((child, index) => {
|
|
140
|
+
// TODO: handle components that are not dcc.Tab components (throw error)
|
|
141
|
+
// enhance Tab components coming from Dash (as dcc.Tab) with methods needed for handling logic
|
|
142
|
+
var childProps;
|
|
143
|
+
if (/*#__PURE__*/_react.default.isValidElement(child)) {
|
|
144
|
+
childProps = window.dash_component_api.getLayout([...child.props.componentPath, 'props']);
|
|
145
|
+
} else {
|
|
146
|
+
// In case the selected tab is a string.
|
|
147
|
+
childProps = {};
|
|
148
|
+
}
|
|
149
|
+
if (!childProps.value) {
|
|
150
|
+
childProps = _objectSpread(_objectSpread({}, childProps), {}, {
|
|
151
|
+
value: "tab-".concat(index + 1)
|
|
214
152
|
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// check if this child/Tab is currently selected
|
|
156
|
+
if (childProps.value === value) {
|
|
157
|
+
selectedTab = child;
|
|
158
|
+
}
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(EnhancedTab, {
|
|
160
|
+
key: index,
|
|
161
|
+
id: childProps.id,
|
|
162
|
+
label: childProps.label,
|
|
163
|
+
selected: value === childProps.value,
|
|
164
|
+
selectHandler: this.selectHandler,
|
|
165
|
+
className: childProps.className,
|
|
166
|
+
style: childProps.style,
|
|
167
|
+
selectedClassName: childProps.selected_className,
|
|
168
|
+
selected_style: childProps.selected_style,
|
|
169
|
+
value: childProps.value,
|
|
170
|
+
disabled: childProps.disabled,
|
|
171
|
+
disabled_style: childProps.disabled_style,
|
|
172
|
+
disabled_className: childProps.disabled_className,
|
|
173
|
+
mobile_breakpoint: this.props.mobile_breakpoint,
|
|
174
|
+
vertical: this.props.vertical,
|
|
175
|
+
amountOfTabs: amountOfTabs,
|
|
176
|
+
colors: this.props.colors,
|
|
177
|
+
componentPath: child.componentPath
|
|
215
178
|
});
|
|
216
|
-
}
|
|
217
|
-
var selectedTabContent = !(0, _ramda.isNil)(selectedTab) ? selectedTab : '';
|
|
218
|
-
var tabContainerClass = this.props.vertical ? 'tab-container tab-container--vert' : 'tab-container';
|
|
219
|
-
var tabContentClass = this.props.vertical ? 'tab-content tab-content--vert' : 'tab-content';
|
|
220
|
-
var tabParentClass = this.props.vertical ? 'tab-parent tab-parent--vert' : 'tab-parent';
|
|
221
|
-
return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
|
|
222
|
-
className: "".concat(tabParentClass, " ").concat(this.props.parent_className || ''),
|
|
223
|
-
style: this.props.parent_style,
|
|
224
|
-
id: "".concat(this.props.id, "-parent")
|
|
225
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
-
className: "".concat(tabContainerClass, " ").concat(this.props.className || ''),
|
|
227
|
-
style: this.props.style,
|
|
228
|
-
id: this.props.id
|
|
229
|
-
}, EnhancedTabs), /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
-
className: "".concat(tabContentClass, " ").concat(this.props.content_className || ''),
|
|
231
|
-
style: this.props.content_style
|
|
232
|
-
}, selectedTabContent || ''), /*#__PURE__*/_react.default.createElement("style", {
|
|
233
|
-
jsx: true
|
|
234
|
-
}, "\n .tab-parent {\n display: flex;\n flex-direction: column;\n }\n .tab-container {\n display: flex;\n flex-direction: column;\n }\n .tab-container--vert {\n display: inline-flex;\n }\n .tab-content--vert {\n display: inline-flex;\n flex-direction: column;\n }\n @media screen and (min-width: ".concat(this.props.mobile_breakpoint, "px) {\n :global(.tab-container--vert .tab) {\n width: auto;\n border-right: none !important;\n border-bottom: none !important;\n }\n :global(.tab-container--vert .tab:last-of-type) {\n border-bottom: 1px solid ").concat(this.props.colors.border, " !important;\n }\n :global(.tab-container--vert .tab--selected) {\n border-top: 1px solid ").concat(this.props.colors.border, ";\n border-left: 2px solid ").concat(this.props.colors.primary, ";\n border-right: none;\n }\n .tab-container {\n flex-direction: row;\n }\n .tab-container--vert {\n flex-direction: column;\n }\n .tab-parent--vert {\n display: inline-flex;\n flex-direction: row;\n }\n }\n ")));
|
|
179
|
+
});
|
|
235
180
|
}
|
|
236
|
-
|
|
237
|
-
|
|
181
|
+
var selectedTabContent = !(0, _ramda.isNil)(selectedTab) ? selectedTab : '';
|
|
182
|
+
var tabContainerClass = this.props.vertical ? 'tab-container tab-container--vert' : 'tab-container';
|
|
183
|
+
var tabContentClass = this.props.vertical ? 'tab-content tab-content--vert' : 'tab-content';
|
|
184
|
+
var tabParentClass = this.props.vertical ? 'tab-parent tab-parent--vert' : 'tab-parent';
|
|
185
|
+
return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
|
|
186
|
+
className: "".concat(tabParentClass, " ").concat(this.props.parent_className || ''),
|
|
187
|
+
style: this.props.parent_style,
|
|
188
|
+
id: "".concat(this.props.id, "-parent")
|
|
189
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
className: "".concat(tabContainerClass, " ").concat(this.props.className || ''),
|
|
191
|
+
style: this.props.style,
|
|
192
|
+
id: this.props.id
|
|
193
|
+
}, EnhancedTabs), /*#__PURE__*/_react.default.createElement("div", {
|
|
194
|
+
className: "".concat(tabContentClass, " ").concat(this.props.content_className || ''),
|
|
195
|
+
style: this.props.content_style
|
|
196
|
+
}, selectedTabContent || ''), /*#__PURE__*/_react.default.createElement("style", {
|
|
197
|
+
jsx: true
|
|
198
|
+
}, "\n .tab-parent {\n display: flex;\n flex-direction: column;\n }\n .tab-container {\n display: flex;\n flex-direction: column;\n }\n .tab-container--vert {\n display: inline-flex;\n }\n .tab-content--vert {\n display: inline-flex;\n flex-direction: column;\n }\n @media screen and (min-width: ".concat(this.props.mobile_breakpoint, "px) {\n :global(.tab-container--vert .tab) {\n width: auto;\n border-right: none !important;\n border-bottom: none !important;\n }\n :global(.tab-container--vert .tab:last-of-type) {\n border-bottom: 1px solid ").concat(this.props.colors.border, " !important;\n }\n :global(.tab-container--vert .tab--selected) {\n border-top: 1px solid ").concat(this.props.colors.border, ";\n border-left: 2px solid ").concat(this.props.colors.primary, ";\n border-right: none;\n }\n .tab-container {\n flex-direction: row;\n }\n .tab-container--vert {\n flex-direction: column;\n }\n .tab-parent--vert {\n display: inline-flex;\n flex-direction: row;\n }\n }\n ")));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.default = Tabs;
|
|
238
202
|
Tabs.defaultProps = {
|
|
239
203
|
mobile_breakpoint: 800,
|
|
240
204
|
colors: {
|
|
@@ -328,4 +292,5 @@ Tabs.propTypes = {
|
|
|
328
292
|
* session: window.sessionStorage, data is cleared once the browser quit.
|
|
329
293
|
*/
|
|
330
294
|
persistence_type: _propTypes.default.oneOf(['local', 'session', 'memory'])
|
|
331
|
-
};
|
|
295
|
+
};
|
|
296
|
+
Tabs.dashChildrenUpdate = true;
|
|
@@ -19,7 +19,7 @@ var textAreaProps = ['id', 'autoFocus', 'cols', 'disabled', 'form', 'maxLength',
|
|
|
19
19
|
* A basic HTML textarea for entering multiline text.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
var Textarea =
|
|
22
|
+
var Textarea = _ref => {
|
|
23
23
|
var setProps = _ref.setProps,
|
|
24
24
|
value = _ref.value,
|
|
25
25
|
_ref$n_blur = _ref.n_blur,
|
|
@@ -37,18 +37,18 @@ var Textarea = function Textarea(_ref) {
|
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
38
38
|
"data-dash-is-loading": isLoading || undefined,
|
|
39
39
|
value: value,
|
|
40
|
-
onChange:
|
|
40
|
+
onChange: e => {
|
|
41
41
|
setProps({
|
|
42
42
|
value: e.target.value
|
|
43
43
|
});
|
|
44
44
|
},
|
|
45
|
-
onBlur:
|
|
45
|
+
onBlur: () => {
|
|
46
46
|
setProps({
|
|
47
47
|
n_blur: n_blur + 1,
|
|
48
48
|
n_blur_timestamp: Date.now()
|
|
49
49
|
});
|
|
50
50
|
},
|
|
51
|
-
onClick:
|
|
51
|
+
onClick: () => {
|
|
52
52
|
setProps({
|
|
53
53
|
n_clicks: n_clicks + 1,
|
|
54
54
|
n_clicks_timestamp: Date.now()
|
|
@@ -7,15 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _style = _interopRequireDefault(require("styled-jsx/style"));
|
|
10
|
-
var
|
|
11
|
-
var _excluded = ["show", "targetable", "direction", "border_color", "background_color", "className", "zindex", "loading_text"]; // eslint-disable-line no-unused-vars
|
|
10
|
+
var _excluded = ["show", "targetable", "direction", "border_color", "background_color", "className", "zindex", "loading_text"];
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
13
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
|
+
// eslint-disable-line no-unused-vars
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* A tooltip with an absolute position.
|
|
17
18
|
*/
|
|
18
|
-
var Tooltip =
|
|
19
|
+
var Tooltip = _ref => {
|
|
19
20
|
var _ref$show = _ref.show,
|
|
20
21
|
show = _ref$show === void 0 ? true : _ref$show,
|
|
21
22
|
_ref$targetable = _ref.targetable,
|
|
@@ -40,9 +41,9 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
40
41
|
var is_loading = ctx.useLoading();
|
|
41
42
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
42
43
|
className: "dcc-tooltip-bounding-box"
|
|
43
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
className: "hover hover-".concat(direction),
|
|
46
|
+
"data-dash-is-loading": is_loading
|
|
46
47
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
47
48
|
id: id,
|
|
48
49
|
className: "hover-content ".concat(className),
|
|
@@ -10,38 +10,19 @@ var _upload = _interopRequireDefault(require("../utils/LazyLoader/upload"));
|
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
|
-
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); }
|
|
18
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
13
|
var RealUpload = /*#__PURE__*/(0, _react.lazy)(_upload.default);
|
|
26
14
|
|
|
27
15
|
/**
|
|
28
16
|
* Upload components allow your app to accept user-uploaded files via drag'n'drop
|
|
29
17
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
class Upload extends _react.Component {
|
|
19
|
+
render() {
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
21
|
+
fallback: null
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
|
|
34
23
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
key: "render",
|
|
38
|
-
value: function render() {
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
40
|
-
fallback: null
|
|
41
|
-
}, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
|
|
42
|
-
}
|
|
43
|
-
}]);
|
|
44
|
-
}(_react.Component);
|
|
24
|
+
}
|
|
25
|
+
exports.default = Upload;
|
|
45
26
|
Upload.propTypes = {
|
|
46
27
|
/**
|
|
47
28
|
* The ID of this component, used to identify dash components
|