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

Styling as listview#179

Merged
Marc-Andre-Rivet merged 4 commits intomasterfrom
3.1-styling-as-listview
Oct 25, 2018
Merged

Styling as listview#179
Marc-Andre-Rivet merged 4 commits intomasterfrom
3.1-styling-as-listview

Conversation

@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor

PR for:

Some clean up for:

  • column name nested prop update (support array of strings)
  • fix errors in demo app

- column name nested prop update (support array of strings)
- fix errors in demo app
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-179 October 25, 2018 15:51 Inactive
@chriddyp chriddyp temporarily deployed to dash-table-review-pr-179 October 25, 2018 15:53 Inactive
id: 'table',
data,
columns: clone(mockData.columns).map(col => R.merge(col, {
name: col.name || col.id,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing react warnings that appeared after tightening the column props

package.json Outdated
{
"name": "dash-table",
"version": "3.1.0rc9",
"version": "3.1.0rc10",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump version

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-179 October 25, 2018 15:55 Inactive
name: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.string),
PropTypes.string
]).isRequired,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing for column name was incorrect. It accepts a string or an array of strings (for multiline headers)

}
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the block of code related to styling the cells and making it a mixin that accepts one parameter (isListView) -- follow up styling and mixin calls is based on that variable


& when (@isListView = False) {
.inset-shadow(red, 1px, 1px, -1px, -1px);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

td.focused and .dash-filter.invalid styling moved here to make isListView variable available

// .shadow(red, 1px, 1px, 0, 0);
.outline-shadow(var(--accent), 1px, 1px, 0, 0);
border: 1px solid var(--accent);
margin: -1px;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style fragments unaffected by table style are left as is.

editable_name?: boolean | number;
id: ColumnId;
name: string;
name: string | string[];
Copy link
Copy Markdown
Contributor Author

@Marc-Andre-Rivet Marc-Andre-Rivet Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array of strings support

sorting_settings?: SortSettings;
sorting_type?: SortingType;
sorting_treat_empty_string_as_none?: boolean;
style_as_list_view?: boolean;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this back

.add('with frozen rows and frozen columns', () => (<DashTable
{...props4}
n_fixed_columns={1}
n_fixed_rows={1}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same tests as for the standard style but for the list view style.

@chriddyp
Copy link
Copy Markdown
Member

Looks very nice!
image

Copy link
Copy Markdown
Member

@chriddyp chriddyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I wasn't sure if we'd keep style_as_list_view or if we'd just document how to override the styles via style_cell, but this looks like it turned out pretty good.

…view

# Conflicts:
#	CHANGELOG.md
#	dash_table/bundle.js
#	dash_table/demo.js
#	dash_table/metadata.json
#	src/dash-table/Table.js
@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor Author

@chriddyp Overriding with style_cell gets into a lot of special cases when taking into consideration the fixed rows and columns. We may even want to provide a special way to override the shadow style in the future as doing so manually forces you to deal with all (too many) edge cases.

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit db4257a into master Oct 25, 2018
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 3.1-styling-as-listview branch July 18, 2019 12:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants