Skip to content

Commit 7138a62

Browse files
committed
Merge branch 'v3'
2 parents d7bff0b + 467ec6f commit 7138a62

37 files changed

+3502
-11144
lines changed

.browserslistrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.js

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
11
module.exports = {
2-
root: true,
3-
env: {
4-
node: true
5-
},
6-
'extends': [
7-
'plugin:vue/essential',
8-
'@vue/standard'
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:vue/vue3-strongly-recommended',
5+
'prettier',
96
],
7+
plugins: ['prettier'],
108
rules: {
11-
'indent': ['error', 4],
12-
'semi': 'off',
13-
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
9+
indent: [
10+
'error',
11+
4,
12+
{
13+
SwitchCase: 1,
14+
},
15+
],
16+
'linebreak-style': ['error', 'unix'],
17+
quotes: [
18+
'error',
19+
'single',
20+
{
21+
avoidEscape: true,
22+
},
23+
],
24+
'no-empty': [
25+
'error',
26+
{
27+
allowEmptyCatch: true,
28+
},
29+
],
30+
semi: 0,
31+
'no-undef': 0,
32+
'no-console': 0,
33+
'vue/html-indent': ['error', 4],
34+
'vue/max-attributes-per-line': 0,
1535
},
16-
parserOptions: {
17-
parser: 'babel-eslint'
18-
}
19-
}
36+
};

.github/workflows/close-issues.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Close inactive issues
2+
3+
on:
4+
schedule:
5+
- cron: "20 1 * * *"
6+
7+
jobs:
8+
close-issues:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
steps:
14+
- uses: actions/stale@v3
15+
with:
16+
days-before-issue-stale: 90
17+
days-before-issue-close: 30
18+
stale-issue-label: "stale"
19+
stale-issue-message: "This issue is stale because it has been open for 90 days with no activity."
20+
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
21+
days-before-pr-stale: -1
22+
days-before-pr-close: -1
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/npm-publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
- run: yarn && yarn test
16+
17+
publish:
18+
needs: test
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: 16
25+
registry-url: https://registry.npmjs.org/
26+
- run: yarn && yarn build
27+
- run: npm publish
28+
env:
29+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/tests.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
name: Tests
1+
name: Run tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
8-
9-
# Allows you to run this workflow manually from the Actions tab
10-
workflow_dispatch:
7+
branches: [master]
118

129
jobs:
13-
build:
10+
test:
1411
runs-on: ubuntu-latest
15-
1612
steps:
1713
- uses: actions/checkout@v2
1814
- uses: actions/setup-node@v2
1915
with:
20-
node-version: '14'
21-
- name: Install dependencies
22-
run: yarn
23-
- name: Run tests
24-
run: yarn test
16+
node-version: 16
17+
- run: yarn && yarn test

.gitignore

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
.DS_Store
2-
node_modules
3-
/dist/*.html
4-
5-
# local env files
6-
.env.local
7-
.env.*.local
8-
9-
# Log files
1+
# Logs
2+
logs
3+
*.log
104
npm-debug.log*
115
yarn-debug.log*
126
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist-ssr
12+
*.local
1313

1414
# Editor directories and files
15+
.vscode/*
16+
!.vscode/extensions.json
17+
!.vscode/settings.json
1518
.idea
16-
.vscode
19+
.DS_Store
1720
*.suo
1821
*.ntvs*
1922
*.njsproj
2023
*.sln
21-
*.sw*
24+
*.sw?

.nowignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 4,
3+
"singleQuote": true
4+
}

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"dbaeumer.vscode-eslint",
4+
"johnsoncodehk.volar"
5+
]
6+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"eslint.validate": [
3+
"javascript",
4+
"javascriptreact",
5+
"vue"
6+
],
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": true
9+
},
10+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
[![Build Status](https://travis-ci.org/gilbitron/laravel-vue-pagination.svg?branch=master)](https://travis-ci.org/gilbitron/laravel-vue-pagination) [![npm](https://img.shields.io/npm/v/laravel-vue-pagination.svg)](https://www.npmjs.com/package/laravel-vue-pagination) [![Downloads](https://img.shields.io/npm/dt/laravel-vue-pagination.svg)](https://www.npmjs.com/package/laravel-vue-pagination)
1+
[![npm](https://img.shields.io/npm/v/laravel-vue-pagination.svg)](https://www.npmjs.com/package/laravel-vue-pagination) [![Downloads](https://img.shields.io/npm/dt/laravel-vue-pagination.svg)](https://www.npmjs.com/package/laravel-vue-pagination)
22

33
> Want your logo here? [Sponsor me on GitHub](https://github.com/users/gilbitron/sponsorship)
44
55
# Laravel Vue Pagination
6-
A Vue.js pagination component for Laravel paginators that works with Bootstrap.
6+
A Vue.js pagination component for Laravel paginators.
77

88
## Requirements
99

10-
* [Vue.js](https://vuejs.org/) 2.x ([Looking for Vue 3 support?](https://github.com/gilbitron/laravel-vue-pagination/issues/124))
11-
* [Laravel](http://laravel.com/docs/) 5.x
10+
* [Vue.js](https://vuejs.org/) 3
11+
* [Laravel](http://laravel.com/docs/) 5+
1212
* [Bootstrap](http://getbootstrap.com/) 4
1313

1414
## Install
@@ -28,7 +28,13 @@ See [https://laravel-vue-pagination.now.sh](https://laravel-vue-pagination.now.s
2828
Register the component:
2929

3030
```javascript
31-
Vue.component('pagination', require('laravel-vue-pagination'));
31+
import LaravelVuePagination from 'laravel-vue-pagination';
32+
33+
export default {
34+
components: {
35+
'Pagination': LaravelVuePagination
36+
}
37+
}
3238
```
3339

3440
Use the component:
@@ -38,33 +44,32 @@ Use the component:
3844
<li v-for="post in laravelData.data" :key="post.id">{{ post.title }}</li>
3945
</ul>
4046

41-
<pagination :data="laravelData" @pagination-change-page="getResults"></pagination>
47+
<Pagination :data="laravelData" @pagination-change-page="getResults" />
4248
```
4349

4450
```javascript
4551
export default {
46-
47-
data() {
48-
return {
49-
// Our data object that holds the Laravel paginator data
50-
laravelData: {},
51-
}
52-
},
53-
54-
mounted() {
55-
// Fetch initial results
56-
this.getResults();
57-
},
58-
59-
methods: {
60-
// Our method to GET results from a Laravel endpoint
61-
getResults(page = 1) {
62-
axios.get('example/results?page=' + page)
63-
.then(response => {
64-
this.laravelData = response.data;
65-
});
66-
}
67-
}
52+
data() {
53+
return {
54+
// Our data object that holds the Laravel paginator data
55+
laravelData: {},
56+
}
57+
},
58+
59+
mounted() {
60+
// Fetch initial results
61+
this.getResults();
62+
},
63+
64+
methods: {
65+
// Our method to GET results from a Laravel endpoint
66+
getResults(page = 1) {
67+
axios.get('example/results?page=' + page)
68+
.then(response => {
69+
this.laravelData = response.data;
70+
});
71+
}
72+
}
6873

6974
}
7075
```
@@ -75,8 +80,12 @@ Prev/Next buttons can be customized using the `prev-nav` and `next-nav` slots:
7580

7681
```html
7782
<pagination :data="laravelData">
78-
<span slot="prev-nav">&lt; Previous</span>
79-
<span slot="next-nav">Next &gt;</span>
83+
<template #prev-nav>
84+
<span>&lt; Previous</span>
85+
</template>
86+
<template #next-nav>
87+
<span>Next &gt;</span>
88+
</template>
8089
</pagination>
8190
```
8291

@@ -86,7 +95,7 @@ Prev/Next buttons can be customized using the `prev-nav` and `next-nav` slots:
8695

8796
| Name | Type | Description |
8897
| --- | --- | --- |
89-
| `data` | Object | An object containing the structure of a [Laravel paginator](https://laravel.com/docs/5.7/pagination) response or a [Laravel API Resource](https://laravel.com/docs/5.7/eloquent-resources) response. |
98+
| `data` | Object | An object containing the structure of a [Laravel paginator](https://laravel.com/docs/8.x/pagination) response or a [Laravel API Resource](https://laravel.com/docs/8.x/eloquent-resources) response. |
9099
| `limit` | Number | (optional) Limit of pages to be rendered. `0` shows all pages (default). `-1` will hide numeric pages and leave only arrow navigation. Any positive integer (e.g. `2`) will define how many pages should be shown on either side of the current page when only a range of pages are shown. |
91100
| `show-disabled` | Boolean | (optional) Show disabled prev/next buttons instead of hiding them. `false` hides disabled buttons (default). `true` shows disables buttons. |
92101
| `size` | String | (optional) One of `small`, `default` or `large` |

babel.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)