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

Default Styles#196

Merged
Marc-Andre-Rivet merged 15 commits into
masterfrom
3.1-issue150-default-styles
Nov 1, 2018
Merged

Default Styles#196
Marc-Andre-Rivet merged 15 commits into
masterfrom
3.1-issue150-default-styles

Conversation

@Marc-Andre-Rivet

@Marc-Andre-Rivet Marc-Andre-Rivet commented Nov 1, 2018

Copy link
Copy Markdown
Contributor
  • readonly cells cursor
  • filter fields placeholder & styling

image

image

@chriddyp
chriddyp temporarily deployed to dash-table-review-pr-196 November 1, 2018 17:52 Inactive
@chriddyp
chriddyp temporarily deployed to dash-table-review-pr-196 November 1, 2018 17:53 Inactive
@chriddyp
chriddyp temporarily deployed to dash-table-review-pr-196 November 1, 2018 17:53 Inactive
type='text'
value={this.state.value || ''}
onChange={this.handleChange}
placeholder={placeholder}

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 placeholder prop... wondering if we couldn't just compose off the dash-core-components input to get all the base prop types since the component works standalone. Might be an overkill, just thinking out loud here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah that's not a bad idea. How would that work though? Maybe if we were to redo core-components so that it's built more as a JS library, that both dash-renderer and other repo's like dash-table could use?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can't really do that because components can't be properties right now in Dash. In the future, they could be. Otherwise, we'll need to copy over the properties one-by-one

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.

Since this is purely internal, I was thinking that just importing the component would work

columnId: ColumnId;
isValid: boolean;
property: ColumnId;
setFilter: SetFilter;

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.

property was redundant with columnId and unused

input::placeholder {
color: transparent;
}
}

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.

Only display the placeholder if (1) the filter is the first (not selected by & + .dash-filter), otherwise only show if hovered or focused

.cell--uneditable input {
cursor: not-allowed;
}

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.

Remove the cursor style on readonly cells

columnStaticStyle: any,
data: Data
data: Data,
selectedCells: SelectedCells

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 error here that went unnoticed because of the 'any'

'dash-cell' +
` column-${columnIndex}` +
(active ? ' focused' : '') +
(!isEditable(editable, column.editable) ? ' cell--uneditable' : '') +

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.

cell-uneditable is now useless -- removing it.. the cell can be customized through the style_cell prop, there's no need for this css selector

.add('with multiple columns', () => (<DataTable
{...props}
columns={['a', 'b', 'c'].map(id => ({ id: id, name: id.toUpperCase() }))}
/>)); No newline at end of file

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.

Two basic visual tests that make sure the first filter displays the placeholder and that the others do not.

@valentijnnieman valentijnnieman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

type='text'
value={this.state.value || ''}
onChange={this.handleChange}
placeholder={placeholder}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah that's not a bad idea. How would that work though? Maybe if we were to redo core-components so that it's built more as a JS library, that both dash-renderer and other repo's like dash-table could use?

@chriddyp

chriddyp commented Nov 1, 2018

Copy link
Copy Markdown
Member

Sorry to be annoying, but can we go back to just monospace too? Seeing the other fonts in the docs makes our Monaco, ... it feel too opinionated right now.

@chriddyp chriddyp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💃

@Marc-Andre-Rivet

Copy link
Copy Markdown
Contributor Author

@chriddyp Ok. Reverting the monospace changes and the corresponding changelog entry.

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.

3 participants