-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refractored pagination & add basic style
- Loading branch information
MordiSacks
committed
Jan 14, 2018
1 parent
c0825f0
commit bd21d70
Showing
14 changed files
with
275 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" | ||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>VueifiedDataTables example</title> | ||
<link rel="stylesheet" href="app.css"> | ||
</head> | ||
<body> | ||
|
||
<div id="app"> | ||
<div class="container"> | ||
<vueified-datatable :url="url" :columns="columns" :options="config"></vueified-datatable> | ||
</div> | ||
</div> | ||
|
||
<script src="app.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"/example/app.js": "/example/app.js", | ||
"/vueifiedDataTables/vueifiedDataTables.js": "/vueifiedDataTables/vueifiedDataTables.js", | ||
"/vueifiedDataTables/vueifiedDataTables.css": "/vueifiedDataTables/vueifiedDataTables.css" | ||
"/vueifiedDataTables/vueifiedDataTables.css": "/vueifiedDataTables/vueifiedDataTables.css", | ||
"/example/app.css": "/example/app.css" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,56 @@ | ||
# Vueified DataTables | ||
|
||
## Installation | ||
- TODO | ||
Run | ||
`yarn add vueified-datatables` or `npm install vueified-datatables` | ||
In your code | ||
```js | ||
import VueifiedDataTables from 'vueifiedDataTables'; | ||
|
||
Vue.use(VueifiedDataTables); | ||
``` | ||
|
||
Then in your template | ||
```html | ||
<vueified-datatable :url="URL_TO_JSON_DATA" :columns="YOUR_COLUMNS_ARRAY" :options="YOUR_OPTIONS_OBJECT(Optional)"></vueified-datatable> | ||
``` | ||
|
||
### Example of a columns object | ||
```js | ||
let columns = [ | ||
{ | ||
// the key to read from json | ||
key: 'id', | ||
|
||
// the table header (optional, will use key by default) | ||
title: 'User ID', | ||
|
||
// is column sortable {true|false} (optional, true by default) | ||
sortable: true, | ||
|
||
// is column searchable {true|false} (optional, true by default) | ||
searchable: true, | ||
|
||
// Callback, receives cell value and row, should return a vue component, if is set, cell will render the component | ||
template: function(value, row){ | ||
return { | ||
template: `<i @click="delete" class="fa fa-trash">`, | ||
}; | ||
}, | ||
}, | ||
{ | ||
key: 'f_name', | ||
title: 'First Name', | ||
}, | ||
]; | ||
``` | ||
|
||
### options | ||
- TODO | ||
|
||
## Change log | ||
### 1.0.1 | ||
1. Refactored pagination | ||
2. Added basic stylesheet | ||
3. Updated readme | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Vue from 'vue'; | ||
import VueifiedDataTables from '../vueifiedDataTables/js/vueifiedDataTables'; | ||
|
||
Vue.use(VueifiedDataTables); | ||
|
||
const app = new Vue({ | ||
el: '#app', | ||
data: { | ||
url: 'http://192.168.1.2/Projects/TLF/public/dtSample', | ||
columns: [ | ||
{ | ||
key: 'id', | ||
title: 'ID', | ||
}, | ||
{ | ||
key: 'project_id', | ||
title: 'Project ID', | ||
}, | ||
{ | ||
key: 'name', | ||
title: 'Name', | ||
}, | ||
{ | ||
key: 'created_at', | ||
title: 'Created', | ||
}, | ||
], | ||
config: { | ||
footer: !true, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
body { | ||
font-family: 'Segoe UI', Arial, sans-serif; | ||
|
||
} | ||
|
||
.container { | ||
width: 1170px; | ||
max-width: 100%; | ||
margin: 0 auto; | ||
} | ||
|
||
@import "../vueifiedDataTables/scss/vueifiedDataTables"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
.vueified-datatable { | ||
color: #555555; | ||
|
||
.vueified-datatable-header-controls { | ||
width: 100%; | ||
float: left; | ||
background: #f2f2f2; | ||
padding: 8px; | ||
|
||
.dataTables_length { | ||
float: left; | ||
label { | ||
select { | ||
|
||
} | ||
} | ||
} | ||
|
||
.dataTables_filter { | ||
float: right; | ||
label { | ||
input { | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
table { | ||
width: 100%; | ||
text-align: left; | ||
border-spacing: 0; | ||
|
||
td, th { | ||
padding: 8px; | ||
line-height: 1.6; | ||
vertical-align: top; | ||
} | ||
|
||
thead { | ||
tr { | ||
th { | ||
border-bottom: 1px solid #555555; | ||
|
||
&.sorting, | ||
&.sorting_asc, | ||
&.sorting_desc { | ||
cursor: pointer; | ||
&:after { | ||
float: right; | ||
} | ||
} | ||
|
||
&.sorting:after { | ||
content: '\21C5'; | ||
} | ||
|
||
&.sorting_asc:after { | ||
content: '\21CA'; | ||
} | ||
&.sorting_desc:after { | ||
content: '\21C8'; | ||
} | ||
} | ||
} | ||
} | ||
|
||
tbody { | ||
tr { | ||
background-color: #f9f9f9; | ||
|
||
&:nth-child(even) { | ||
background-color: #fff; | ||
} | ||
|
||
&:last-child { | ||
td { | ||
border-bottom: 1px solid #555555; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
.vueified-datatable-footer-controls { | ||
width: 100%; | ||
float: left; | ||
padding: 8px; | ||
|
||
.dataTables_info { | ||
float: left; | ||
color: #333333; | ||
} | ||
|
||
.dataTables_paginate { | ||
float: right; | ||
|
||
a { | ||
padding: 5px; | ||
cursor: pointer; | ||
|
||
&.disabled { | ||
cursor: not-allowed; | ||
} | ||
|
||
&.current { | ||
font-weight: bold; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.