Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaela Robosova committed Dec 28, 2017
0 parents commit 382554b
Show file tree
Hide file tree
Showing 44 changed files with 21,017 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
root: true,
parser: 'babel-eslint',
env: {
browser: true,
node: true,
jest: true,
},
extends: 'eslint-config-genius',
plugins: [
'html'
],
rules: {},
globals: {}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
demo/dist/
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"processors": ["stylelint-processor-html"],
"extends": [
"stylelint-config-standard",
"stylelint-config-recess-order"
],
"plugins": [
"stylelint-scss"
],
"rules": {
"declaration-colon-space-after": null
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Michaela Robošová

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# vue-tree-navigation

A Vue.js tree navigation

[Demo](https://vue-tree-navigation.misrob.cz)

## Features:

* infinite number of levels
* you can define default open level
* focused on core functionality, only necessary styles included - just apply your own styles like I did for demo page :wink:

## Installation

```console
$ npm install vue-tree-navigation
```

**main.js**

```javascript
import VueTreeNavigation from 'vue-tree-navigation';

Vue.use(VueTreeNavigation);
```

## Usage

**file.vue**

```html
<vue-tree-navigation :items="items" :defaultOpenLevel="defaultOpenLevel" />
```

```javascript
export default {
data() {
return {
items: [
{ name: 'First category', children: [
{ name: 'Category item', href: '#take-me-somewhere' },
{ name: 'Category item', href: '#take-me-somewhere' }
]},
{ name: 'Second category', href: '#take-me-somewhere' }
],
defaultOpenLevel: 2
}
}
};
```

**items**

You don't need to specify `href` field. Menu item will be rendered as a simple value instead of hyperlink in this case.

**defaultOpenLevel**

Optional. Default value is 0.

## Developers

Run tests:

```console
$ npm run test
```

Run tests in verbose mode:

```console
$ npm run test:verbose
```

Run development server:

```console
$ npm run dev
```

Build:

```console
$ npm run build
```

Run demo development server:

```console
$ cd demo
$ npm run dev
```

11 changes: 11 additions & 0 deletions demo/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"env",
{
"modules": false
}
],
"stage-3"
]
}
23 changes: 23 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# demo-vue-tree-navigation

A [demo page](https://vue-tree-navigation.misrob.cz) for vue-tree-navigation

## Developers

Install dependencies:

```console
$ npm install
```

Run development server:

```console
$ npm run dev
```

Build:

```console
$ npm run build
```
23 changes: 23 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>vue-tree-navigation</title>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<script src="https://use.fontawesome.com/4540149b59.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111626882-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-111626882-1');
</script>
</head>
<body>
<div id="app"></div>
<script src="/dist/build.js"></script>
</body>
</html>
Loading

0 comments on commit 382554b

Please sign in to comment.