diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..5cf1f0e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ +# Test against the latest version of this Node.js version +environment: + nodejs_version: "6" + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm test + +# Don't actually build. +build: off diff --git a/compositor.json b/compositor.json deleted file mode 100644 index abdd18d..0000000 --- a/compositor.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "name": "ctxhou/react-tabtab", - "version": "0.1.4", - "libraries": { - "xv": "^1.1.25" - }, - "title": "", - "branch": "", - "style": { - "name": "Default", - "componentSet": { - "nav": "nav/BasicNav", - "header": "header/BannerHeader", - "article": "article/BasicArticle", - "footer": "footer/BasicFooter" - }, - "fontFamily": "-apple-system, BlinkMacSystemFont, sans-serif", - "fontWeight": 400, - "bold": 600, - "lineHeight": 1.5, - "typeScale": [ - 72, - 48, - 24, - 20, - 16, - 14, - 12 - ], - "monospace": "Menlo, monospace", - "heading": { - "fontFamily": null, - "fontStyle": null, - "fontWeight": 600, - "lineHeight": 1.25, - "textTransform": null, - "letterSpacing": null - }, - "h0": {}, - "h1": {}, - "h2": {}, - "h3": {}, - "h4": {}, - "h5": {}, - "h6": {}, - "alternativeText": {}, - "space": [ - 0, - 8, - 16, - 32, - 48, - 64, - 96 - ], - "layout": { - "maxWidth": 1024, - "centered": false - }, - "colors": { - "text": "#111", - "background": "#fff", - "primary": "#08e", - "secondary": "#059", - "highlight": "#e08", - "border": "#ddd", - "muted": "#eee" - }, - "border": { - "width": 1, - "radius": 2 - }, - "link": {}, - "button": { - "hover": { - "boxShadow": "inset 0 0 0 999px rgba(0, 0, 0, .125)" - } - }, - "input": {}, - "body": { - "margin": 0 - }, - "breakpoints": { - "xs": "@media screen and (max-width:40em)", - "sm": "@media screen and (min-width:40em)", - "md": "@media screen and (min-width:52em)", - "lg": "@media screen and (min-width:64em)" - } - }, - "content": [ - { - "component": "nav", - "links": [ - { - "href": "http://ctxhou.github.io/react-tabtab/", - "text": "Home" - }, - { - "href": "https://github.com/ctxhou/react-tabtab", - "text": "GitHub" - }, - { - "href": "https://npmjs.com/package/react-tabtab", - "text": "npm" - } - ] - }, - { - "component": "header", - "heading": "react-tabtab", - "subhead": "An api based react tab.", - "children": [ - { - "component": "ui/TweetButton", - "text": "react-tabtab: An api based react tab.", - "url": "http://ctxhou.github.io/react-tabtab/" - }, - { - "component": "ui/GithubButton", - "user": "ctxhou", - "repo": "react-tabtab" - } - ], - "text": "v0.8.0" - }, - { - "component": "article", - "metadata": { - "source": "github.readme" - }, - "html": "\n

\n\n

\n

react-tabtab is an api based react tab.

\n

Demo

\n

Features

\n

\n\n

Usage

\n

Now only available the commonjs module.

\n

Install it with npm.

\n
npm install react-tabtab --save

Simple example:

\n
var Tabs = require('react-tabtab').Tabs;\nvar Panel = require('react-tabtab').Panel;\n\nvar App = React.createClass({\n  render: function() {\n    return (\n      <Tabs>\n        <Panel title="hi">\n          Hi!\n        </Panel>\n        <Panel title="yo" lazy={true}>\n          yo yo\n        </Panel>\n      </Tabs>\n    )\n  }\n})\n\nReact.render(<App/>, document.getElementById('container'));

Advanced Usage

\n

Add tab

\n

\n

Trigger event on the add tab. Check the example code.

\n

props

\n\n

Delete tab

\n

\n

Trigger event on the delete button. Check the example code.

\n

props

\n\n

Drag and Drop:

\n

\n

The drag and drop feature is based on react-dnd. You can drag the tab to change the sequence.

\n

Because react-dnd can't have two HTML5 backends at the same time (this issue), react-tabtab doesn't wrap the HTML5 in the library.

\n

React-tabtab only wrap the DragSource and DropTarget on the tab, so if you want to use drag and drop, you need to wrap the DragDropContext on your top compoennt. (in case in your project you already have another html5 backend)

\n

In this way, the drag and drop feature in react-tabtab can fit with other dnd library.

\n

Check out the example code and the top component.

\n

props

\n\n

Advanced example

\n

Check the advanced.jsx.

\n

This example show how to add tab, delete tab, and drag and drop.

\n

All API

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
propertytypedefaultrequireddescription
activeKeyint0noset the active key of the tab
addBackTabbooleanfalsenowhether show a add tab at the end
handleAddBackClickfunctionn/anocallback function when user click the add tab
deleteButtonbooleanfalsenowhether show a delete button at each panel
handleDeleteButtonfunctionfalsenocallback function when user click the delete button
handleTabClickfunctionn/anoreturn the key which user clicks
tabDeleteButtonbooleanfalsenowhether each tab show delete button
handleTabDeleteButtonfunctionn/anocallback function when click tabDeleteButton
stylestringtabtabdefaultnothe class prefix
deleteAllClassnamestringn/ano
draggablebooleanfalsenowhether tab can drag and drop
beginDragfunctionn/anocallback function when start drag
setMoveDatafunctionn/anocallback function to get current index and hover index
\n

Style

\n

now only use css as style.

\n

if you want to use the same style as teh demo, just clone the stylesheets/folder.css and inlcude in you project.

\n

Development

\n

npm run build:watch\n node devServer.js

\n

License

\n

MIT @ctxhou

\n" - }, - { - "component": "footer", - "links": [ - { - "href": "https://github.com/ctxhou/react-tabtab", - "text": "GitHub" - }, - { - "href": "https://github.com/ctxhou", - "text": "ctxhou" - } - ] - } - ] -} \ No newline at end of file