Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Improved Tabs component #213

Merged
merged 55 commits into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0b099e2
Setup new Tabs component
valentijnnieman Jun 20, 2018
b4a6588
Define Tabs component API for Dash
valentijnnieman Jun 20, 2018
b4362f3
Added styled-jsx to package
valentijnnieman Jun 20, 2018
15aa4d8
Added selection logic with EnhancedTab 's
valentijnnieman Jun 20, 2018
d03411d
Better selection logic & style set-up
valentijnnieman Jun 20, 2018
13be608
Added meta tag in Demo/index for mobile viewers
valentijnnieman Jun 20, 2018
ea684ec
Pass class and style props to component
valentijnnieman Jun 20, 2018
b8a8a20
Added usage.py for now, which describes how to use Tabs
valentijnnieman Jun 20, 2018
e3fdb79
Better styling and className passing
valentijnnieman Jun 21, 2018
ab8d0ce
Better vertical support and responsiveness
valentijnnieman Jun 21, 2018
3644be6
Remove usage.py again
valentijnnieman Jun 21, 2018
531efd9
Cleanup and better interface descriptions
valentijnnieman Jun 21, 2018
abbaa43
Added Tabs component to test_gallery integration test
valentijnnieman Jun 21, 2018
b4825e1
Added build and changed version to 0.24.0
valentijnnieman Jun 22, 2018
5ca1fb4
Merge branch 'master' into improved_tabs
valentijnnieman Jun 22, 2018
f31aa82
Changed version to 0.24.0
valentijnnieman Jun 22, 2018
c2779ef
Merged with origin
valentijnnieman Jun 22, 2018
7de3794
Support for value props
valentijnnieman Jun 25, 2018
e2b4f3d
Remove console.logs
valentijnnieman Jun 25, 2018
b7c77e4
Handle props for Dash and Demo.react.js
valentijnnieman Jun 25, 2018
9fc48cb
Integration test for Tabs without children
valentijnnieman Jun 25, 2018
69e0eef
Better styling for Tab components
valentijnnieman Jun 25, 2018
3354f65
mobile_breakpoint prop
valentijnnieman Jun 25, 2018
94f7ffa
Better mobile styles, mobile_breakpoint fix
valentijnnieman Jun 25, 2018
22a6ff5
Styling fixes
valentijnnieman Jun 26, 2018
1b03748
Fixed bug that occus when there's only one Tab
valentijnnieman Jun 26, 2018
d95af71
Favor snake_case prop names over camelCase
valentijnnieman Jun 26, 2018
091f264
Added id prop to Tab component
valentijnnieman Jun 26, 2018
7c6eb3f
Fixed failing test
valentijnnieman Jun 26, 2018
fdda9bc
Added comment/annotation to Tab components
valentijnnieman Jun 26, 2018
0b0311a
Update for prerelease version
valentijnnieman Jul 2, 2018
ead8139
Updated package.json for prerelease
valentijnnieman Jul 2, 2018
c97a380
Changed version to npm version
valentijnnieman Jul 4, 2018
0d55b21
Update to prerelease rc2
valentijnnieman Jul 4, 2018
bd2b142
Better default styles
valentijnnieman Jul 11, 2018
a07d99b
Changed defaultProps and fixed typo
valentijnnieman Jul 11, 2018
8743130
Props for settings colors used
valentijnnieman Jul 11, 2018
d132ce2
Updated test with snapshot
valentijnnieman Jul 11, 2018
9507f9f
'disabled' prop on Tab component, with styles and className support
valentijnnieman Jul 16, 2018
cda07d6
Add snapshot to tabs_without_children test loop
valentijnnieman Jul 16, 2018
3893b5b
Fixed bug where Tab classes weren't overwriting
valentijnnieman Jul 17, 2018
957cd87
Changed version to prerelease 0.24.0rc4
valentijnnieman Jul 17, 2018
85d38e4
Fixed small className error
valentijnnieman Jul 17, 2018
392336e
Fixed small selected_className bug
valentijnnieman Jul 17, 2018
2aa8ba5
Refactored Tabs selection logic
valentijnnieman Jul 24, 2018
a0676cc
Updated integration tests for Tabs
valentijnnieman Jul 24, 2018
6200d49
Updated CSS for seleced Tabs
valentijnnieman Jul 24, 2018
8583ec6
Changed label propType from string to children
valentijnnieman Jul 24, 2018
85d88bd
Render label correctly if it has children
valentijnnieman Jul 24, 2018
61003ee
Fix selection when not specifying value
valentijnnieman Jul 24, 2018
919da14
Fixed broken Tabs test
valentijnnieman Jul 24, 2018
9f39caa
Fixed styles copying over
valentijnnieman Jul 25, 2018
3645254
Added flexbox to default container style
valentijnnieman Jul 25, 2018
b71875b
Update prerelease versioning
valentijnnieman Jul 25, 2018
a50ba4d
Fixed merge conflicts & updated version
valentijnnieman Jul 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc"
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc",
"plugins": [
"styled-jsx/babel"
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.26.0]
### Added
- New Tabs and Tab components! [#213](https://github.com/plotly/dash-core-components/pull/213#pullrequestreview-135893345)

## [0.25.1]
### Fixed
- `__init__` version formatting for unpkg.
Expand Down
83 changes: 42 additions & 41 deletions dash_core_components/bundle.js

Large diffs are not rendered by default.

408 changes: 313 additions & 95 deletions dash_core_components/metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_core_components/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.25.1'
__version__ = '0.26.0'
40 changes: 22 additions & 18 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.css"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/xq-light.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/react-select.css"/>
<link rel="stylesheet" href="https://cdn.rawgit.com/chriddyp/abcbc02565dd495b676c3269240e09ca/raw/816de7d5c5d5626e3f3cac8e967070aa15da77e2/rc-slider.css"/>
</head>

<body>
<div id="react-demo-entry-point"></div>
</body>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/xq-light.min.css" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/react-select.css" />
<link rel="stylesheet" href="https://cdn.rawgit.com/chriddyp/abcbc02565dd495b676c3269240e09ca/raw/816de7d5c5d5626e3f3cac8e967070aa15da77e2/rc-slider.css"
/>
</head>

<footer>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/mode/javascript/javascript.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/react@15/dist/react.js"></script>
<script type="text/javascript" src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script type="text/javascript" src="/lib/bundle.js"></script>
</footer>
</html>
<body>
<div id="react-demo-entry-point"></div>
</body>

<footer>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/mode/javascript/javascript.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/react@15/dist/react.js"></script>
<script type="text/javascript" src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script type="text/javascript" src="/lib/bundle.js"></script>
</footer>

</html>
66 changes: 49 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "0.25.1",
"version": "0.26.0",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,7 +40,8 @@
"react-select": "^1.0.0-rc.10",
"react-select-fast-filter-options": "^0.2.2",
"react-syntax-highlighter": "^5.0.0",
"react-virtualized-select": "^3.1.0"
"react-virtualized-select": "^3.1.0",
"styled-jsx": "^2.2.6"
},
"devDependencies": {
"component-playground": "^2.0.0",
Expand Down
76 changes: 76 additions & 0 deletions src/components/Tab.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from 'react';
import PropTypes from 'prop-types';

const Tab = ({ children }) => <div>{children}</div>;

/**
* Part of dcc.Tabs - this is the child Tab component used to render a tabbed page.
* Its children will be set as the content of that tab, which if clicked will become visible.
*/
Tab.propTypes = {
/**
* The ID of this component, used to identify dash components
* in callbacks. The ID needs to be unique across all of the
* components in an app.
*/
id: PropTypes.string,

/**
* The tab's label
*/
label: PropTypes.children,

/**
* The content of the tab - will only be displayed if this tab is selected
*/
children: PropTypes.node,

/**
* Value for determining which Tab is currently selected
*/
value: PropTypes.string,

/**
* Determines if tab is disabled or not - defaults to false
*/
disabled: PropTypes.bool,

/**
* Overrides the default (inline) styles when disabled
*/
disabled_style: PropTypes.object,

/**
* Appends a class to the Tab component when it is disabled.
*/
disabled_className: PropTypes.string,

/**
* Appends a class to the Tab component.
*/
className: PropTypes.string,

/**
* Appends a class to the Tab component when it is selected.
*/
selected_className: PropTypes.string,

/**
* Overrides the default (inline) styles for the Tab component.
*/
style: PropTypes.object,

/**
* Overrides the default (inline) styles for the Tab component when it is selected.
*/
selected_style: PropTypes.object
};

Tab.defaultProps = {
disabled: false,
disabled_style: {
color: '#d6d6d6'
}
}

export default Tab;
Loading