-
-
Notifications
You must be signed in to change notification settings - Fork 72
3.0 clean offsets #110
3.0 clean offsets #110
Changes from all commits
7394393
81e0802
646068b
3b13dbb
4e0ecad
fadbe4b
8c60f0b
7013574
b606834
ec68944
ba80945
f9ce473
78a1844
452de9b
8ec667e
b334918
1ad6d66
651682f
3a8e448
1c39abb
b559a47
77c21b4
80a2c02
2b674ee
b2fc917
6ba5403
e546390
a520da6
d9e294d
770effa
6577df5
e86b8fd
c816691
f02ee15
cd06e6c
0aba66b
5af4a70
dd70844
7414d0b
71a09a8
9e89e8d
4d71b40
e1be8a7
3e53af1
0304c69
16730e5
6ffd3c2
d38c599
8be5143
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ class App extends Component { | |
| } | ||
| ], | ||
| table_style: [ | ||
| { selector: '.dash-spreadsheet.freeze-left', rule: 'width: 1000px; max-width: 1000px;' } | ||
| { selector: '.dash-spreadsheet.dash-freeze-left', rule: 'width: 1000px; max-width: 1000px;' } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style -- add prefix for external/contract classes |
||
| ] | ||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,32 @@ import PropTypes from 'prop-types'; | |
| import RealTable from 'dash-table/components/Table'; | ||
|
|
||
| import 'dash-table/style/component.less'; | ||
| import Logger from 'core/Logger'; | ||
|
|
||
| export default class Table extends Component { | ||
| render() { | ||
| const { | ||
| filtering, | ||
| sorting, | ||
| pagination_mode | ||
| } = this.props; | ||
|
|
||
| function isFrontEnd(value: any) { | ||
| return ['fe', true, false].indexOf(value) !== -1; | ||
| } | ||
|
|
||
| function isBackEnd(value: any) { | ||
| return ['be', false].indexOf(value) !== -1; | ||
| } | ||
|
|
||
| const isValid = isFrontEnd(pagination_mode) || | ||
| (isBackEnd(filtering) && isBackEnd(sorting)); | ||
|
|
||
| if (!isValid) { | ||
| Logger.error(`Invalid combination of filtering / sorting / pagination`, filtering, sorting, pagination_mode); | ||
| return (<div>Invalid props combination</div>); | ||
| } | ||
|
|
||
| return (<RealTable {...this.props} />); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Table.js is the Dash component wrapper, its role is to
Here we add the first sanity check: are the sorting/paging/filtering props compatible with each other? If paging is done BE -> sort/filter must be off or in BE |
||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,7 @@ export default class Cell extends Component<ICellProps, ICellState> { | |
| } = this.propsWithDefaults; | ||
|
|
||
| return [ | ||
| 'dash-cell', | ||
| ...(active ? ['focused'] : []), | ||
| ...(!editable ? ['cell--uneditable'] : []), | ||
| ...(selected ? ['cell--selected'] : []), | ||
|
|
@@ -113,7 +114,7 @@ export default class Cell extends Component<ICellProps, ICellState> { | |
| const classes = [ | ||
| ...(active ? ['input-active'] : []), | ||
| ...(focused ? ['focused'] : ['unfocused']), | ||
| ...['cell-value'] | ||
| ...['dash-cell-value'] | ||
| ]; | ||
|
|
||
| const attributes = { | ||
|
|
@@ -219,11 +220,14 @@ export default class Cell extends Component<ICellProps, ICellState> { | |
| } | ||
|
|
||
| render() { | ||
| const { property } = this.props; | ||
|
|
||
| return (<td | ||
| ref='td' | ||
| tabIndex={-1} | ||
| className={this.classes.join(' ')} | ||
| style={this.style} | ||
| data-dash-column={property} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of exposing the columns as column-{index} classes, expose as an attribute with value equal to column id -- this is more consistent with what the user gives us and less about implementation details |
||
| > | ||
| {this.renderInner()} | ||
| </td>); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump version