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 54 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.24.0] - UNRELEASED
### Added
- New Tabs and Tab components!

## [0.23.0]
### Added
- Upgraded Plotly.js, the underlying library behind the
Expand Down
4 changes: 2 additions & 2 deletions dash_core_components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'external_url': (
'https://unpkg.com/dash-core-components@{}'
'/dash_core_components/bundle.js'
).format(__version__),
).format('0.24.0-rc6'),
'namespace': 'dash_core_components'
}
]
Expand All @@ -51,7 +51,7 @@
'https://unpkg.com/[email protected]/styles.css',
'https://unpkg.com/[email protected]/styles.css',
'https://unpkg.com/[email protected]/assets/index.css',
'https://unpkg.com/dash-core-components@{}/dash_core_components/[email protected]'.format(__version__)
'https://unpkg.com/dash-core-components@{}/dash_core_components/[email protected]'.format('0.24.0-rc6')
],
'namespace': 'dash_core_components'
}
Expand Down
71 changes: 36 additions & 35 deletions dash_core_components/bundle.js

Large diffs are not rendered by default.

285 changes: 218 additions & 67 deletions dash_core_components/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,73 +139,6 @@
}
}
},
"src/components/Confirm.react.js": {
"description": "Confirm wraps window.confirm",
"displayName": "Confirm",
"methods": [],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"message": {
"type": {
"name": "string"
},
"required": false,
"description": ""
},
"init": {
"type": {
"name": "shape",
"value": {
"value": {
"name": "any",
"required": false
},
"ask": {
"name": "bool",
"required": false
}
}
},
"required": false,
"description": ""
},
"result": {
"type": {
"name": "shape",
"value": {
"timestamp": {
"name": "custom",
"raw": "PropTypes.integer",
"required": false
},
"value": {
"name": "any",
"required": false
}
}
},
"required": false,
"description": "",
"defaultValue": {
"value": "{\n timestamp: -1\n}",
"computed": false
}
},
"setProps": {
"type": {
"name": "func"
},
"required": false,
"description": "Dash-assigned callback that gets fired when the value changes."
}
}
},
"src/components/DatePickerRange.react.js": {
"description": "DatePickerRange is a tailor made component designed for selecting\ntimespan across multiple days off of a calendar.\n\nThe DatePicker integrates well with the Python datetime module with the\nstartDate and endDate being returned in a string format suitable for\ncreating datetime objects.\n\nThis component is based off of Airbnb's react-dates react component\nwhich can be found here: https://github.com/airbnb/react-dates",
"displayName": "DatePickerRange",
Expand Down Expand Up @@ -2489,6 +2422,224 @@
}
}
},
"src/components/Tab.react.js": {
"description": "",
"methods": [],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "The ID of this component, used to identify dash components\nin callbacks. The ID needs to be unique across all of the\ncomponents in an app."
},
"label": {
"type": {
"name": "custom",
"raw": "PropTypes.children"
},
"required": false,
"description": "The tab's label"
},
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "The content of the tab - will only be displayed if this tab is selected"
},
"value": {
"type": {
"name": "string"
},
"required": false,
"description": "Value for determining which Tab is currently selected"
},
"disabled": {
"type": {
"name": "bool"
},
"required": false,
"description": "Determines if tab is disabled or not - defaults to false",
"defaultValue": {
"value": "false",
"computed": false
}
},
"disabled_style": {
"type": {
"name": "object"
},
"required": false,
"description": "Overrides the default (inline) styles when disabled",
"defaultValue": {
"value": "{\n color: '#d6d6d6'\n}",
"computed": false
}
},
"disabled_className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the Tab component when it is disabled."
},
"className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the Tab component."
},
"selected_className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the Tab component when it is selected."
},
"style": {
"type": {
"name": "object"
},
"required": false,
"description": "Overrides the default (inline) styles for the Tab component."
},
"selected_style": {
"type": {
"name": "object"
},
"required": false,
"description": "Overrides the default (inline) styles for the Tab component when it is selected."
}
}
},
"src/components/Tabs.react.js": {
"description": "A Dash component that lets you render pages with tabs - the Tabs component's children\ncan be dcc.Tab components, which can hold a label that will be displayed as a tab, and can in turn hold\nchildren components that will be that tab's content.",
"displayName": "Tabs",
"methods": [
{
"name": "selectHandler",
"docblock": null,
"modifiers": [],
"params": [
{
"name": "value",
"type": null
}
],
"returns": null
}
],
"props": {
"id": {
"type": {
"name": "string"
},
"required": false,
"description": "The ID of this component, used to identify dash components\nin callbacks. The ID needs to be unique across all of the\ncomponents in an app."
},
"value": {
"type": {
"name": "string"
},
"required": false,
"description": "The value of the currently selected Tab"
},
"className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the Tabs container holding the individual Tab components."
},
"content_className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the Tab content container holding the children of the Tab that is selected."
},
"parent_className": {
"type": {
"name": "string"
},
"required": false,
"description": "Appends a class to the top-level parent container holding both the Tabs container and the content container."
},
"style": {
"type": {
"name": "object"
},
"required": false,
"description": "Appends (inline) styles to the Tabs container holding the individual Tab components."
},
"parent_style": {
"type": {
"name": "object"
},
"required": false,
"description": "Appends (inline) styles to the top-level parent container holding both the Tabs container and the content container."
},
"content_style": {
"type": {
"name": "object"
},
"required": false,
"description": "Appends (inline) styles to the tab content container holding the children of the Tab that is selected."
},
"vertical": {
"type": {
"name": "bool"
},
"required": false,
"description": "Renders the tabs vertically (on the side)"
},
"mobile_breakpoint": {
"type": {
"name": "number"
},
"required": false,
"description": "Breakpoint at which tabs are rendered full width (can be 0 if you don't want full width tabs on mobile)",
"defaultValue": {
"value": "800",
"computed": false
}
},
"children": {
"type": {
"name": "node"
},
"required": false,
"description": "Array that holds Tab components"
},
"colors": {
"type": {
"name": "shape",
"value": {
"border": {
"name": "string",
"required": false
},
"primary": {
"name": "string",
"required": false
},
"background": {
"name": "string",
"required": false
}
}
},
"required": false,
"description": "Holds the colors used by the Tabs and Tab components. If you set these, you should specify colors for all properties, so: \ncolors: {\n border: '#d6d6d6',\n primary: '#1975FA',\n background: '#f9f9f9'\n }",
"defaultValue": {
"value": "{\n border: '#d6d6d6',\n primary: '#1975FA',\n background: '#f9f9f9'\n}",
"computed": false
}
}
}
},
"src/components/Textarea.react.js": {
"description": "A basic HTML textarea for entering multiline text.",
"displayName": "Textarea",
Expand Down
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.23.0'
__version__ = '0.24.0rc6'
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>
Loading