dash-core-components 4.5.0 → 4.5.2
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/dash_core_components.js +1 -1
- package/dash_core_components/dash_core_components.js.map +1 -1
- package/dash_core_components/proptypes.js +1 -0
- package/lib/components/Link.tsx +8 -3
- package/lib/components/Location.react.js +6 -0
- package/lib/fragments/DatePickerRange.tsx +2 -0
- package/lib/fragments/DatePickerSingle.tsx +1 -0
- package/lib/types.ts +6 -0
- package/package.json +3 -3
|
@@ -177,6 +177,7 @@ pk.Link.propTypes = {children:pt.node,
|
|
|
177
177
|
href:pt.string,
|
|
178
178
|
target:pt.oneOfType([pt.string]),
|
|
179
179
|
refresh:pt.oneOfType([pt.bool]),
|
|
180
|
+
scrollToTop:pt.oneOfType([pt.bool]),
|
|
180
181
|
title:pt.oneOfType([pt.string]),
|
|
181
182
|
className:pt.oneOfType([pt.string]),
|
|
182
183
|
style:pt.any,
|
package/lib/components/Link.tsx
CHANGED
|
@@ -14,7 +14,11 @@ type LinkComponentProps = LinkProps & {
|
|
|
14
14
|
* For links with destinations outside the current app, `html.A` is a better
|
|
15
15
|
* component to use.
|
|
16
16
|
*/
|
|
17
|
-
const Link = ({
|
|
17
|
+
const Link = ({
|
|
18
|
+
refresh = false,
|
|
19
|
+
scrollToTop = true,
|
|
20
|
+
...props
|
|
21
|
+
}: LinkComponentProps) => {
|
|
18
22
|
const {className, style, id, href, children, title, target, setProps} =
|
|
19
23
|
props;
|
|
20
24
|
const cleanUrl = window.dash_clientside.clean_url;
|
|
@@ -39,8 +43,9 @@ const Link = ({refresh = false, ...props}: LinkComponentProps) => {
|
|
|
39
43
|
window.history.pushState({}, '', sanitizedUrl);
|
|
40
44
|
window.dispatchEvent(new CustomEvent('_dashprivate_pushstate'));
|
|
41
45
|
}
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
if (scrollToTop) {
|
|
47
|
+
window.scrollTo(0, 0);
|
|
48
|
+
}
|
|
44
49
|
};
|
|
45
50
|
|
|
46
51
|
useEffect(() => {
|
|
@@ -70,6 +70,12 @@ var Location = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
70
70
|
// Prop has changed?
|
|
71
71
|
if (refresh === true) {
|
|
72
72
|
// Refresh the page?
|
|
73
|
+
if (fieldName === 'href' && window.dash_clientside.clean_url(propVal) !== propVal) {
|
|
74
|
+
setProps({
|
|
75
|
+
_dash_error: new Error("Dangerous link detected: ".concat(propVal))
|
|
76
|
+
});
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
73
79
|
window.location[fieldName] = propVal;
|
|
74
80
|
} else if (_this2.props[fieldName] !== propVal) {
|
|
75
81
|
// If this prop has changed, need to setProps
|
|
@@ -405,6 +405,7 @@ const DatePickerRange = ({
|
|
|
405
405
|
disabled={disabled}
|
|
406
406
|
dir={direction}
|
|
407
407
|
aria-label={start_date_placeholder_text}
|
|
408
|
+
autoComplete="off"
|
|
408
409
|
/>
|
|
409
410
|
<ArrowIcon className="dash-datepicker-range-arrow" />
|
|
410
411
|
<AutosizeInput
|
|
@@ -427,6 +428,7 @@ const DatePickerRange = ({
|
|
|
427
428
|
disabled={disabled}
|
|
428
429
|
dir={direction}
|
|
429
430
|
aria-label={end_date_placeholder_text}
|
|
431
|
+
autoComplete="off"
|
|
430
432
|
/>
|
|
431
433
|
{clearable && !disabled && (
|
|
432
434
|
<a
|
package/lib/types.ts
CHANGED
|
@@ -1514,6 +1514,12 @@ export interface LinkProps {
|
|
|
1514
1514
|
*/
|
|
1515
1515
|
refresh?: boolean;
|
|
1516
1516
|
|
|
1517
|
+
/**
|
|
1518
|
+
* Controls whether or not the page will scroll to the top when the link is
|
|
1519
|
+
* clicked. Defaults to true.
|
|
1520
|
+
*/
|
|
1521
|
+
scrollToTop?: boolean;
|
|
1522
|
+
|
|
1517
1523
|
/**
|
|
1518
1524
|
* Adds the title attribute to your link, which can contain supplementary
|
|
1519
1525
|
* information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dash-core-components",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "Core component suite for Dash",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"@testing-library/react": "^16.3.2",
|
|
85
85
|
"@types/d3-format": "^3.0.4",
|
|
86
86
|
"@types/fast-isnumeric": "^1.1.2",
|
|
87
|
-
"@types/hast": "^
|
|
87
|
+
"@types/hast": "^3.0.5",
|
|
88
88
|
"@types/jest": "^29.5.14",
|
|
89
89
|
"@types/js-search": "^1.4.4",
|
|
90
|
-
"@types/ramda": "^0.
|
|
90
|
+
"@types/ramda": "^0.32.0",
|
|
91
91
|
"@types/react": "^18",
|
|
92
92
|
"@types/react-dom": "^18",
|
|
93
93
|
"@types/react-input-autosize": "^2.2.4",
|