Skip to content

Commit

Permalink
upgrade demo default to bootstrap 5
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Jan 9, 2022
1 parent aea8130 commit 236f4d2
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 416 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ npm install vue-datatables-net
```

## Usage
Default configuration and provide example for `bootstrap4` styling. Though, it allow for complete flexibility of customization with any other jQuery DataTables supported theme.
Default configuration and provide example for `bootstrap5` styling. Though, it allow for complete flexibility of customization with any other jQuery DataTables supported theme.

> Example of imports for Bootstrap 4:
> Example of imports for Bootstrap 5:
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href='https://cdn.datatables.net/1.10.24/css/dataTables.bootstrap4.min.css'>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap5.min.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>

<script>
import VdtnetTable from 'vue-datatables-net'
import 'datatables.net-bs4'
import 'datatables.net-bs5'
// below you should only import what you need
// Example: import buttons and plugins
Expand All @@ -61,11 +61,11 @@ import 'datatables.net-buttons/js/buttons.html5.js'
import 'datatables.net-buttons/js/buttons.print.js'
// import the rest for your specific theme
import 'datatables.net-buttons-bs4'
import 'datatables.net-select-bs4'
import 'datatables.net-buttons-bs5'
import 'datatables.net-select-bs5'
import 'datatables.net-select-bs4/css/select.bootstrap4.min.css'
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'
import 'datatables.net-select-bs5/css/select.bootstrap5.min.css'
import 'datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css'
</script>
```

Expand Down Expand Up @@ -143,7 +143,7 @@ Our component parameters:
type: String,
},
/**
* Set the table classes you wish to use, default with bootstrap4
* Set the table classes you wish to use, default with bootstrap5
* but you can override with: themeforest, foundation, etc..
*
* @type String
Expand Down Expand Up @@ -397,7 +397,7 @@ Let say you have a column `description`, you can provide table footer template f
## dom (Searching and Toolbar)
`dom` configuration defines how jQuery DataTables components are rendered - https://datatables.net/reference/option/dom
Our default configuration compatible with Bootstrap4 is:
Our default configuration compatible with Bootstrap5 is:
```html
"tr<'row vdtnet-footer'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'pl>>"
```
Expand All @@ -421,7 +421,7 @@ window.open(url)
```
## Responsive
1. In Bootstrap4, there's a class called [table-responsive](https://getbootstrap.com/docs/4.1/content/tables/#responsive-tables) that wrap the table at each screen breakpoint. We apply this class on our wrapper div to make the table scroll horizontally. We also include `d-print-inline` for print.
1. In Bootstrap5, there's a class called [table-responsive](https://getbootstrap.com/docs/5.0/content/tables/#responsive-tables) that wrap the table at each screen breakpoint. We apply this class on our wrapper div to make the table scroll horizontally. We also include `d-print-inline` for print.
2. Alternatively, you can set `options.responsive = true` to use jQuery DataTable responsive plugin. **WARNING**: This plugin does not play well with `select-checkbox`, `master-details`, and many other features. It is recommended to use option 1 above.
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* vue-datatables-net
* Vue jQuery DataTables.net wrapper component
*
* @version v1.6.0
* @version v1.6.1
* @author [email protected]
* @repository https://github.com/niiknow/vue-datatables-net.git
*/
2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/index.js": "/index.js?id=c3aea7f36e626df83718"
"/index.js": "/index.js?id=12db3d98387d1b9aa7fd"
}
10 changes: 5 additions & 5 deletions example/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@
// this demonstrate with buttons and responsive master/details row
import VdtnetTable from '../src'
import 'datatables.net-bs4'
import 'datatables.net-bs5'
// import buttons and plugins
import 'datatables.net-buttons/js/dataTables.buttons.js'
import 'datatables.net-buttons/js/buttons.html5.js'
import 'datatables.net-buttons/js/buttons.print.js'
// import the rest
import 'datatables.net-buttons-bs4'
import 'datatables.net-select-bs4'
import 'datatables.net-buttons-bs5'
import 'datatables.net-select-bs5'
import 'datatables.net-select-bs4/css/select.bootstrap4.min.css'
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'
import 'datatables.net-select-bs5/css/select.bootstrap5.min.css'
import 'datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css'
export default {
name: 'App',
Expand Down
78 changes: 39 additions & 39 deletions example/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions example/late-schema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@
// this demonstrate with buttons and responsive master/details row
import VdtnetTable from '../src'
import 'datatables.net-bs4'
import 'datatables.net-bs5'
// import buttons and plugins
import 'datatables.net-buttons/js/dataTables.buttons.js'
import 'datatables.net-buttons/js/buttons.html5.js'
import 'datatables.net-buttons/js/buttons.print.js'
// import the rest
import 'datatables.net-buttons-bs4'
import 'datatables.net-select-bs4'
import 'datatables.net-buttons-bs5'
import 'datatables.net-select-bs5'
import 'datatables.net-select-bs4/css/select.bootstrap4.min.css'
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'
import 'datatables.net-select-bs5/css/select.bootstrap5.min.css'
import 'datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css'
export default {
name: 'App',
Expand Down
2 changes: 1 addition & 1 deletion example/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/index.js": "/index.js?id=df009d921acc7805114f"
"/index.js": "/index.js?id=04fadb273badf98689e9"
}
14 changes: 7 additions & 7 deletions example/responsive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@
// this demonstrate with buttons and responsive master/details row
import VdtnetTable from '../src'
import 'datatables.net-bs4'
import 'datatables.net-bs5'
// import buttons and plugins
import 'datatables.net-buttons/js/dataTables.buttons.js'
import 'datatables.net-buttons/js/buttons.html5.js'
import 'datatables.net-buttons/js/buttons.print.js'
import 'datatables.net-responsive/js/dataTables.responsive.js'
import 'datatables.net-responsive-bs4/js/responsive.bootstrap4.js'
import 'datatables.net-responsive-bs5/js/responsive.bootstrap4.js'
// import the rest
import 'datatables.net-buttons-bs4'
import 'datatables.net-select-bs4'
import 'datatables.net-buttons-bs5'
import 'datatables.net-select-bs5'
import 'datatables.net-select-bs4/css/select.bootstrap4.min.css'
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'
import 'datatables.net-responsive-bs4/css/responsive.bootstrap4.css'
import 'datatables.net-select-bs5/css/select.bootstrap5.min.css'
import 'datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css'
import 'datatables.net-responsive-bs5/css/responsive.bootstrap5.css'
export default {
name: 'App',
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta charset="utf-8">
<title>vue-datatables-net demo</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.3/css/dataTables.bootstrap5.min.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
</head>
<body>
Expand Down
Loading

0 comments on commit 236f4d2

Please sign in to comment.