Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 302caeb

Browse files
committed
Merge branch 'master' into 576-hidden-edits
2 parents 9f3b71e + a4ea856 commit 302caeb

File tree

29 files changed

+1280
-736
lines changed

29 files changed

+1280
-736
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1414
[#18](https://github.com/plotly/dash-table/issues/18)
1515
- Fix row selection vertical and horizontal alignment
1616

17+
[#103](https://github.com/plotly/dash-table/issues/103)
18+
- Simplify usage for multi-line cells and ellipsis. The cell's content now inherits the value of
19+
`white-space`, `overflow` and `text-overflow` from its parent, making it possible to style
20+
multi-line & ellipsis with `style_data` and other style props.
21+
22+
[#583](https://github.com/plotly/dash-table/issues/583)
23+
- Fix regression when editing the content of a cell in a scrolled virtualized table
24+
25+
### Added
26+
[#319](https://github.com/plotly/dash-table/issues/319)
27+
- New 'loading_state' prop that contains information about which prop, if any, is being computed.
28+
- Table no longer allows for editing while the `data` prop is loading.
29+
1730
## [4.2.0] - 2019-08-27
1831
### Added
1932
[#317](https://github.com/plotly/dash-table/issues/317)

package-lock.json

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

package.json

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@
2525
"private::host_dash8081": "python tests/cypress/dash/v_be_page.py",
2626
"private::host_dash8082": "python tests/cypress/dash/v_copy_paste.py",
2727
"private::host_dash8083": "python tests/cypress/dash/v_fe_page.py",
28+
"private::host_dash8084": "python tests/cypress/dash/v_data_loading.py",
29+
"private::host_dash8085": "python tests/cypress/dash/v_default.py",
2830
"private::host_js": "http-server ./dash_table -c-1 --silent",
2931
"private::lint:ts": "tslint --project tsconfig.json --config tslint.json",
3032
"private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table",
3133
"private::wait_dash8081": "wait-on http://localhost:8081",
3234
"private::wait_dash8082": "wait-on http://localhost:8082",
3335
"private::wait_dash8083": "wait-on http://localhost:8083",
36+
"private::wait_dash8084": "wait-on http://localhost:8084",
37+
"private::wait_dash8085": "wait-on http://localhost:8085",
3438
"private::wait_js": "wait-on http://localhost:8080",
3539
"private::opentests": "cypress open",
3640
"private::test.python": "python -m unittest tests/unit/format_test.py",
@@ -52,10 +56,10 @@
5256
"license": "MIT",
5357
"dependencies": {},
5458
"devDependencies": {
55-
"@babel/cli": "^7.5.5",
56-
"@babel/core": "^7.5.5",
57-
"@babel/polyfill": "^7.4.4",
58-
"@babel/preset-env": "^7.5.5",
59+
"@babel/cli": "^7.6.0",
60+
"@babel/core": "^7.6.0",
61+
"@babel/polyfill": "^7.6.0",
62+
"@babel/preset-env": "^7.6.0",
5963
"@babel/preset-react": "^7.0.0",
6064
"@cypress/webpack-preprocessor": "^4.1.0",
6165
"@fortawesome/fontawesome-svg-core": "^1.2.22",
@@ -75,13 +79,13 @@
7579
"core-js": "^3.2.1",
7680
"css-loader": "^3.2.0",
7781
"cypress": "^3.4.1",
78-
"d3-format": "^1.3.2",
82+
"d3-format": "^1.4.1",
7983
"fast-isnumeric": "^1.1.3",
8084
"file-loader": "^4.2.0",
8185
"http-server": "^0.11.1",
8286
"less": "^3.10.3",
8387
"less-loader": "^5.0.0",
84-
"npm": "^6.11.2",
88+
"npm": "^6.11.3",
8589
"npm-run-all": "^4.1.5",
8690
"papaparse": "^5.0.2",
8791
"ramda": "^0.26.1",
@@ -93,12 +97,12 @@
9397
"remarkable": "^2.0.0",
9498
"sheetclip": "^0.3.0",
9599
"style-loader": "^1.0.0",
96-
"ts-loader": "^6.0.4",
97-
"tslint": "^5.19.0",
98-
"typescript": "^3.6.2",
100+
"ts-loader": "^6.1.0",
101+
"tslint": "^5.20.0",
102+
"typescript": "^3.6.3",
99103
"wait-on": "^3.3.0",
100-
"webpack": "^4.39.3",
101-
"webpack-cli": "^3.3.7",
104+
"webpack": "^4.40.0",
105+
"webpack-cli": "^3.3.8",
102106
"webpack-dev-server": "^3.8.0",
103107
"webpack-preprocessor": "^0.1.12",
104108
"xlsx": "^0.15.1"

src/core/Stylesheet.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ class StylesheetFacade {
5555
export default class Stylesheet {
5656
private stylesheet: StylesheetFacade;
5757

58-
static unit(dimension: any, defaultUnit: 'em' | 'rem' | 'px' | '%' = 'px') {
59-
if (Stylesheet.hasUnit(dimension)) {
60-
return dimension;
61-
} else {
62-
return `${dimension}${defaultUnit}`;
63-
}
64-
}
65-
66-
static hasUnit(dimension: any) {
67-
return typeof dimension === 'string' &&
68-
/^\d+(\.\d+)?(px|em|rem|%)$/.test(dimension);
69-
}
70-
7158
constructor(private readonly prefix: string) {
7259
this.stylesheet = new StylesheetFacade(`${prefix}-dynamic-inline.css`);
7360
}

src/dash-table/components/Cell/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export default class Cell extends Component<ICellProps> {
2323
const {
2424
attributes,
2525
classes,
26+
onClick,
27+
onDoubleClick,
2628
onMouseEnter,
2729
onMouseLeave,
2830
onMouseMove,
@@ -34,6 +36,8 @@ export default class Cell extends Component<ICellProps> {
3436
children={(this as any).props.children}
3537
tabIndex={-1}
3638
className={classes}
39+
onClick={onClick}
40+
onDoubleClick={onDoubleClick}
3741
onMouseEnter={onMouseEnter}
3842
onMouseLeave={onMouseLeave}
3943
onMouseMove={onMouseMove}

src/dash-table/components/Cell/props.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export interface ICellProps {
88
active: boolean;
99
attributes: IAttributes;
1010
classes: string;
11+
onClick: (e: MouseEvent) => void;
12+
onDoubleClick: (e: MouseEvent) => void;
1113
onMouseEnter: (e: MouseEvent) => void;
1214
onMouseLeave: (e: MouseEvent) => void;
1315
onMouseMove: (e: MouseEvent) => void;

src/dash-table/components/CellDropdown/index.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface IProps {
1616
dropdown?: IDropdownValue[];
1717
onChange: (e: ChangeEvent) => void;
1818
value: any;
19+
disabled?: boolean;
1920
}
2021

2122
export default class CellDropdown extends PureComponent<IProps> {
@@ -24,10 +25,14 @@ export default class CellDropdown extends PureComponent<IProps> {
2425
clearable,
2526
dropdown,
2627
onChange,
27-
value
28+
value,
29+
disabled
2830
} = this.props;
2931

30-
return (<div className='dash-dropdown-cell-value-container dash-cell-value-container'>
32+
return (<div
33+
className='dash-dropdown-cell-value-container dash-cell-value-container'
34+
onClick={this.handleClick}
35+
>
3136
<div className='dropdown-cell-value-shadow cell-value-shadow'>
3237
{(dropdown && dropdown.find(entry => entry.value === value) || { label: undefined }).label}
3338
</div>
@@ -41,6 +46,7 @@ export default class CellDropdown extends PureComponent<IProps> {
4146
options={dropdown}
4247
placeholder={''}
4348
value={value}
49+
disabled={disabled}
4450
/>
4551
</div>);
4652
}
@@ -53,6 +59,10 @@ export default class CellDropdown extends PureComponent<IProps> {
5359
this.setFocus();
5460
}
5561

62+
private handleClick(e: React.MouseEvent) {
63+
e.stopPropagation();
64+
}
65+
5666
private setFocus() {
5767
const { active } = this.props;
5868
if (!active) {

src/dash-table/components/CellFactory.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { IEdgesMatrices } from 'dash-table/derived/edges/type';
1515
import { memoizeOne } from 'core/memoizer';
1616
import memoizerCache from 'core/cache/memoizer';
1717

18+
import dataLoading from 'dash-table/derived/table/data_loading';
19+
1820
export default class CellFactory {
1921

2022
private get props() {
@@ -51,7 +53,8 @@ export default class CellFactory {
5153
style_data,
5254
style_data_conditional,
5355
virtualized,
54-
visibleColumns
56+
visibleColumns,
57+
loading_state
5558
} = this.props;
5659

5760
const relevantStyles = this.relevantStyles(
@@ -113,12 +116,15 @@ export default class CellFactory {
113116
selected_cells
114117
);
115118

119+
const data_loading = dataLoading(loading_state);
120+
116121
const partialCellContents = this.cellContents.partialGet(
117122
visibleColumns,
118123
virtualized.data,
119124
virtualized.offset,
120125
!!is_focused,
121-
dropdowns
126+
dropdowns,
127+
data_loading
122128
);
123129

124130
const cellContents = this.cellContents.get(
@@ -128,7 +134,8 @@ export default class CellFactory {
128134
virtualized.data,
129135
virtualized.offset,
130136
!!is_focused,
131-
dropdowns
137+
dropdowns,
138+
data_loading
132139
);
133140

134141
const ops = this.getDataOpCells(

src/dash-table/components/CellInput/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ interface ICellProps {
1515
className: string;
1616
focused: boolean;
1717
onChange: (e: ChangeEvent) => void;
18-
onClick: (e: MouseEvent) => void;
19-
onDoubleClick: (e: MouseEvent) => void;
2018
onMouseUp: (e: MouseEvent) => void;
2119
onPaste: (e: ClipboardEvent<Element>) => void;
2220
type?: string;
@@ -40,8 +38,6 @@ export default class CellInput extends PureComponent<ICellProps, ICellState> {
4038
render() {
4139
const {
4240
className,
43-
onClick,
44-
onDoubleClick,
4541
onMouseUp,
4642
onPaste,
4743
value
@@ -62,8 +58,6 @@ export default class CellInput extends PureComponent<ICellProps, ICellState> {
6258
className={className}
6359
onBlur={this.propagateChange}
6460
onChange={this.handleChange}
65-
onClick={onClick}
66-
onDoubleClick={onDoubleClick}
6761
onKeyDown={this.handleKeyDown}
6862
onMouseUp={onMouseUp}
6963
onPaste={onPaste}

src/dash-table/components/CellLabel/index.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
import React, {
2-
MouseEvent,
32
PureComponent
43
} from 'react';
54

65
interface IProps {
76
className: string;
8-
onClick: (e: MouseEvent) => void;
9-
onDoubleClick: (e: MouseEvent) => void;
107
value: any;
118
}
129

1310
export default class CellLabel extends PureComponent<IProps> {
1411
render() {
1512
const {
1613
className,
17-
onClick,
18-
onDoubleClick,
1914
value
2015
} = this.props;
2116

2217
return (<div
2318
className={className}
24-
onClick={onClick}
25-
onDoubleClick={onDoubleClick}
2619
>
2720
{value}
2821
</div>);

0 commit comments

Comments
 (0)