Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 22978b9

Browse files
committed
0.5.9 - Added debounce delay prop when searching the table data
1 parent 8b30133 commit 22978b9

14 files changed

+35
-16936
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Alternatively, if you have custom filters applied and you would prefered they ar
9999
| `order-dir` | String | "asc" | (optional) The default order by direction |
100100
| `per-page` | Array | ['10','25','50'] | (optional) Amount to be displayed |
101101
| `theme` | String | "light" | (optional) Must be dark or light |
102+
| `debounce-delay` | Number | 0 | (optional) Adds a debounce delay to the get request when searching |
102103
| `classes` | Object | See Below | (optional) Table classes |
103104
| `pagination` | Object | {} | (optional) props for [gilbitron/laravel-vue-pagination](https://github.com/gilbitron/laravel-vue-pagination#props) |
104105
| `add-filters-to-url` | Boolean | false | (optional) Will adjust the current url to keep track of used filters and will also store them in local storage. |
File renamed without changes.

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
);
1414
}
1515
}
16-
}(window.location))</script><link href=/laravel-vue-datatable/css/app.a12833b9.css rel=preload as=style><link href=/laravel-vue-datatable/css/chunk-vendors.f5109e5a.css rel=preload as=style><link href=/laravel-vue-datatable/js/app.13e15f85.js rel=preload as=script><link href=/laravel-vue-datatable/js/chunk-vendors.ba41ea86.js rel=preload as=script><link href=/laravel-vue-datatable/css/chunk-vendors.f5109e5a.css rel=stylesheet><link href=/laravel-vue-datatable/css/app.a12833b9.css rel=stylesheet></head><body class=min-h-100><noscript><strong>We're sorry but laravel-vue-datatable doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/laravel-vue-datatable/js/chunk-vendors.ba41ea86.js></script><script src=/laravel-vue-datatable/js/app.13e15f85.js></script></body></html>
16+
}(window.location))</script><link href=/laravel-vue-datatable/css/app.a12833b9.css rel=preload as=style><link href=/laravel-vue-datatable/css/chunk-vendors.1e6085d0.css rel=preload as=style><link href=/laravel-vue-datatable/js/app.e5a4068f.js rel=preload as=script><link href=/laravel-vue-datatable/js/chunk-vendors.17a48e06.js rel=preload as=script><link href=/laravel-vue-datatable/css/chunk-vendors.1e6085d0.css rel=stylesheet><link href=/laravel-vue-datatable/css/app.a12833b9.css rel=stylesheet></head><body class=min-h-100><noscript><strong>We're sorry but laravel-vue-datatable doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/laravel-vue-datatable/js/chunk-vendors.17a48e06.js></script><script src=/laravel-vue-datatable/js/app.e5a4068f.js></script></body></html>

docs/js/app.13e15f85.js

-2
This file was deleted.

docs/js/app.13e15f85.js.map

-1
This file was deleted.

docs/js/app.e5a4068f.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/app.e5a4068f.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/chunk-vendors.ba41ea86.js docs/js/chunk-vendors.17a48e06.js

+19-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/chunk-vendors.17a48e06.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/chunk-vendors.ba41ea86.js.map

-1
This file was deleted.

package-lock.json

-16,915
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "laravel-vue-datatable",
3-
"version": "0.5.8",
3+
"version": "0.5.9",
44
"description": "Vue.js datatable made with Laravel and Bootstrap in mind",
55
"author": "James Dordoy <[email protected]>",
66
"homepage": "https://jamesdordoy.github.io/laravel-vue-datatable/",

src/components/DataTable.vue

+8-4
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@
8484

8585
<script>
8686
87+
import _ from 'lodash';
8788
import axios from 'axios';
8889
import VueTable from './Table.vue';
8990
import UrlFilters from '../mixins/UrlFilters';
9091
import DataTableCell from './DataTableCell.vue';
9192
import DataTableFilters from './DataTableFilters.vue';
92-
import _ from 'lodash'
9393
9494
export default {
9595
created() {
@@ -104,7 +104,7 @@ export default {
104104
this.classes['table']['table-dark'] = true;
105105
}
106106
107-
this.debouncedGetData = _.debounce(this.getData, this.$attrs.delay_ms ? this.$attrs.delay_ms : 0);
107+
this.debounceGetData = _.debounce(this.getData, this.debounceDelay ? this.debounceDelay : 0);
108108
},
109109
mounted() {
110110
this.columns.forEach((column) => {
@@ -116,15 +116,15 @@ export default {
116116
url: {
117117
handler: function(newUrl) {
118118
this.loading = false;
119-
this.debouncedGetData(newUrl, this.getRequestPayload);
119+
this.debounceGetData(newUrl, this.getRequestPayload);
120120
},
121121
},
122122
tableProps: {
123123
handler: function() {
124124
this.loading = false;
125125
126126
if (this.url) {
127-
this.debouncedGetData(this.url, this.getRequestPayload);
127+
this.debounceGetData(this.url, this.getRequestPayload);
128128
let props = this.tableProps;
129129
props.page = this.page;
130130
this.$emit("onTablePropsChanged", props);
@@ -286,6 +286,10 @@ export default {
286286
type: Boolean,
287287
default: false,
288288
},
289+
debounceDelay: {
290+
type: Number,
291+
default: 0,
292+
},
289293
pagination: {
290294
type: Object,
291295
default: () => ({

src/markdown/props/table.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| order-dir | String | "asc" | (optional) The default order by direction |
88
| per-page | Array | ['10','25','50'] | (optional) Amount to be displayed |
99
| theme | String | "light" | (optional) Must be dark or light |
10+
| debounce-delay | Number | 0 | (optional) Adds a debounce delay to the get request when searching |
1011
| add-filters-to-url | Boolean | false | <p class="wrap-text"> (optional) Will adjust the current url to keep track of used filters and will also store them in local storage. </p> |
1112
| classes | Object | See Below | (optional) Table classes |
1213
| pagination | Object | {} | (optional) props for [gilbitron/laravel-vue-pagination](https://github.com/gilbitron/laravel-vue-pagination#props) |

0 commit comments

Comments
 (0)