dash-core-components 2.4.0 → 2.5.0
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-dropdown.js +1 -1
- package/dash_core_components/async-dropdown.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/dash_core_components.js +1 -1
- package/dash_core_components/dash_core_components.js.map +1 -1
- package/dash_core_components/mathjax.js +1 -1
- package/lib/components/Checklist.react.js +1 -1
- package/lib/components/Dropdown.react.js +1 -1
- package/lib/components/RadioItems.react.js +1 -1
- package/lib/fragments/Dropdown.react.js +1 -1
- package/lib/fragments/Markdown.react.js +16 -1
- package/package.json +1 -1
|
@@ -138,7 +138,7 @@ Checklist.propTypes = {
|
|
|
138
138
|
/**
|
|
139
139
|
* The option's label
|
|
140
140
|
*/
|
|
141
|
-
label: _propTypes.default.
|
|
141
|
+
label: _propTypes.default.node.isRequired,
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* The value of the option. This value
|
|
@@ -100,7 +100,7 @@ Dropdown.propTypes = {
|
|
|
100
100
|
/**
|
|
101
101
|
* The option's label
|
|
102
102
|
*/
|
|
103
|
-
label: _propTypes.default.
|
|
103
|
+
label: _propTypes.default.node.isRequired,
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* The value of the option. This value
|
|
@@ -141,7 +141,7 @@ RadioItems.propTypes = {
|
|
|
141
141
|
/**
|
|
142
142
|
* The option's label
|
|
143
143
|
*/
|
|
144
|
-
label: _propTypes.default.
|
|
144
|
+
label: _propTypes.default.node.isRequired,
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* The value of the option. This value
|
|
@@ -117,7 +117,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
117
117
|
});
|
|
118
118
|
}, []);
|
|
119
119
|
(0, _react.useEffect)(function () {
|
|
120
|
-
if (optionsCheck !== sanitizedOptions && !(0, _ramda.isNil)(value)) {
|
|
120
|
+
if (!(0, _ramda.isNil)(sanitizedOptions) && optionsCheck !== sanitizedOptions && !(0, _ramda.isNil)(value)) {
|
|
121
121
|
var values = sanitizedOptions.map(function (option) {
|
|
122
122
|
return option.value;
|
|
123
123
|
});
|
|
@@ -175,8 +175,23 @@ var DashMarkdown = /*#__PURE__*/function (_Component) {
|
|
|
175
175
|
},
|
|
176
176
|
dccMarkdown: function dccMarkdown(props) {
|
|
177
177
|
return /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, (0, _ramda.mergeDeepRight)((0, _ramda.pick)(['dangerously_allow_html', 'dedent'], _this2.props), (0, _ramda.pick)(['children'], props)));
|
|
178
|
+
},
|
|
179
|
+
dashMathjax: function dashMathjax(props) {
|
|
180
|
+
return /*#__PURE__*/_react.default.createElement(_Math.default, {
|
|
181
|
+
tex: props.value,
|
|
182
|
+
inline: props.inline
|
|
183
|
+
});
|
|
178
184
|
}
|
|
179
185
|
};
|
|
186
|
+
|
|
187
|
+
var regexMath = function regexMath(value) {
|
|
188
|
+
var newValue = value.replace(/(\${1,2})((?:\\.|[^$])+)\1/g, function (m, tag, src) {
|
|
189
|
+
var inline = tag.length === 1 || src.indexOf('\n') === -1;
|
|
190
|
+
return "<dashMathjax value='".concat(src, "' inline='").concat(inline, "'/>");
|
|
191
|
+
});
|
|
192
|
+
return newValue;
|
|
193
|
+
};
|
|
194
|
+
|
|
180
195
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
181
196
|
id: id,
|
|
182
197
|
ref: function ref(node) {
|
|
@@ -205,7 +220,7 @@ var DashMarkdown = /*#__PURE__*/function (_Component) {
|
|
|
205
220
|
},
|
|
206
221
|
html: function html(props) {
|
|
207
222
|
return props.escapeHtml ? props.value : /*#__PURE__*/_react.default.createElement(_reactJsxParser.default, {
|
|
208
|
-
jsx: props.value,
|
|
223
|
+
jsx: mathjax ? regexMath(props.value) : props.value,
|
|
209
224
|
components: componentTransforms,
|
|
210
225
|
renderInWrapper: false
|
|
211
226
|
});
|