Skip to content

Commit 324d374

Browse files
authored
Merge branch 'dev' into fix-react-state-parent-render-2
2 parents 316b9ac + ec5cfa3 commit 324d374

18 files changed

Lines changed: 4272 additions & 3610 deletions

File tree

@plotly/dash-jupyterlab/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,9 +1312,9 @@ lib0@^0.2.85, lib0@^0.2.98:
13121312
isomorphic.js "^0.2.4"
13131313

13141314
lodash-es@^4.17.21:
1315-
version "4.17.21"
1316-
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
1317-
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
1315+
version "4.17.23"
1316+
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.23.tgz#58c4360fd1b5d33afc6c0bbd3d1149349b1138e0"
1317+
integrity sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==
13181318

13191319
lodash.escape@^4.0.1:
13201320
version "4.0.1"

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@ This project adheres to [Semantic Versioning](https://semver.org/).
55
## [UNRELEASED]
66

77
## Added
8+
9+
- [#3568]((https://github.com/plotly/dash/pull/3568) Added `children` and `copied_children` props to `dcc.Clipboard` to customize the button contents before and after copying.
810
- [#3534]((https://github.com/plotly/dash/pull/3534) Adds `playsInline` prop to `html.Video`. Based on [#2338]((https://github.com/plotly/dash/pull/2338)
911
- [#3541](https://github.com/plotly/dash/pull/3541) Add `attributes` dictionary to be be formatted on script/link (_js_dist/_css_dist) tags of the index, allows for `type="module"` or `type="importmap"`. [#3538](https://github.com/plotly/dash/issues/3538)
12+
- [#3542](https://github.com/plotly/dash/pull/3542) Add hidden=True to dash pages callback.
13+
- [#3564](https://github.com/plotly/dash/pull/3564) Add new parameter `hide_all_callbacks` to `run()`. Closes [#3493](https://github.com/plotly/dash/issues/3493)
14+
- [#3563](https://github.com/plotly/dash/pull/3563) Add hidden to clientside callbacks as configurable parameter
1015

1116
## Fixed
1217
- [#3541](https://github.com/plotly/dash/pull/3541) Remove last reference of deprecated `pkg_resources`.
13-
- [#3520](https://github.com/plotly/dash/pull/3520). Set `pointer-events` to `auto` on `Tooltip` to make it possible to interact with tooltip content when `targetable=True`
18+
- [#3548](https://github.com/plotly/dash/pull/3548) Fix devtools overflowing it's container on version update. Fix [#3535](https://github.com/plotly/dash/issues/3535).
19+
- [#3545](https://github.com/plotly/dash/pull/3545) Replace deprecated asyncio.iscoroutinefunction() call with inspect.iscoroutinefunction()
1420

21+
# Changed
22+
- [#3540](https://github.com/plotly/dash/pull/3540) Expose more types for better static typing options.
23+
- [#3520](https://github.com/plotly/dash/pull/3520). Set `pointer-events` to `auto` on `Tooltip` to make it possible to interact with tooltip content when `targetable=True`
1524

1625
## [3.3.0] - 2025-11-12
1726

components/dash-core-components/package-lock.json

Lines changed: 1246 additions & 1063 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-core-components/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "3.3.0",
3+
"version": "3.4.0",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",
@@ -63,11 +63,11 @@
6363
"uniqid": "^5.4.0"
6464
},
6565
"devDependencies": {
66-
"@babel/cli": "^7.28.3",
67-
"@babel/core": "^7.28.5",
68-
"@babel/eslint-parser": "^7.28.5",
66+
"@babel/cli": "^7.28.6",
67+
"@babel/core": "^7.28.6",
68+
"@babel/eslint-parser": "^7.28.6",
6969
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
70-
"@babel/preset-env": "^7.28.5",
70+
"@babel/preset-env": "^7.28.6",
7171
"@babel/preset-react": "^7.28.5",
7272
"@plotly/dash-component-plugins": "^1.2.3",
7373
"@plotly/webpack-dash-dynamic-import": "^1.3.0",
@@ -86,7 +86,7 @@
8686
"rimraf": "^5.0.5",
8787
"style-loader": "^3.3.3",
8888
"styled-jsx": "^5.1.7",
89-
"webpack": "^5.102.1",
89+
"webpack": "^5.104.1",
9090
"webpack-cli": "^5.1.4"
9191
},
9292
"optionalDependencies": {

components/dash-core-components/src/components/Clipboard.react.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ export default class Clipboard extends React.Component {
128128
}
129129

130130
render() {
131-
const {id, title, className, style} = this.props;
132-
const copyIcon = <FontAwesomeIcon icon={faCopy} />;
133-
const copiedIcon = <FontAwesomeIcon icon={faCheckCircle} />;
134-
const btnIcon = this.state.copied ? copiedIcon : copyIcon;
131+
const {id, title, className, style, children, copied_children} =
132+
this.props;
133+
134+
const isCopied = this.state.copied;
135+
136+
const button_children = isCopied
137+
? copied_children ?? <FontAwesomeIcon icon={faCheckCircle} />
138+
: children ?? <FontAwesomeIcon icon={faCopy} />;
135139

136140
return clipboardAPI ? (
137141
<LoadingElement
@@ -141,7 +145,7 @@ export default class Clipboard extends React.Component {
141145
className={className}
142146
onClick={this.onClickHandler}
143147
>
144-
<i> {btnIcon}</i>
148+
{button_children}
145149
</LoadingElement>
146150
) : null;
147151
}
@@ -160,6 +164,16 @@ Clipboard.propTypes = {
160164
*/
161165
id: PropTypes.string,
162166

167+
/**
168+
* Children rendered inside the Clipboard button before copying. By default, a copy icon.
169+
*/
170+
children: PropTypes.node,
171+
172+
/**
173+
* Children rendered inside the Clipboard button after the value has been copied. By default, a check icon.
174+
*/
175+
copied_children: PropTypes.node,
176+
163177
/**
164178
* The id of target component containing text to copy to the clipboard.
165179
* The inner text of the `children` prop will be copied to the clipboard. If none, then the text from the
@@ -173,7 +187,7 @@ Clipboard.propTypes = {
173187
content: PropTypes.string,
174188

175189
/**
176-
* The number of times copy button was clicked
190+
* The number of times Clipboard button was clicked
177191
*/
178192
n_clicks: PropTypes.number,
179193

components/dash-core-components/tests/integration/clipboard/test_clipboard.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,46 @@ def selected(icon_clicks, button_clicks):
9090
== copy_text,
9191
timeout=3,
9292
)
93+
94+
95+
def test_clp004_clipboard_children_and_copied_children(dash_dcc_headed):
96+
content = "https://dash.plotly.com/"
97+
children_text = "Copy URL"
98+
copied_children_text = "Copied!"
99+
100+
app = Dash(__name__, prevent_initial_callbacks=True)
101+
app.layout = html.Div(
102+
[
103+
dcc.Clipboard(
104+
id="clipboard",
105+
children=children_text,
106+
copied_children=copied_children_text,
107+
content=content,
108+
),
109+
dcc.Textarea(id="textarea"),
110+
]
111+
)
112+
113+
dash_dcc_headed.start_server(app)
114+
115+
clipboard = dash_dcc_headed.find_element("#clipboard")
116+
117+
assert clipboard.text == children_text
118+
119+
clipboard.click()
120+
wait.until(
121+
lambda: dash_dcc_headed.find_element("#clipboard").text == copied_children_text,
122+
timeout=3,
123+
)
124+
textarea = dash_dcc_headed.find_element("#textarea")
125+
textarea.click()
126+
127+
ActionChains(dash_dcc_headed.driver).key_down(Keys.CONTROL).send_keys("v").key_up(
128+
Keys.CONTROL
129+
).perform()
130+
131+
wait.until(
132+
lambda: dash_dcc_headed.find_element("#textarea").get_attribute("value")
133+
== content,
134+
timeout=3,
135+
)

0 commit comments

Comments
 (0)