Skip to content

Commit 9803647

Browse files
Merge pull request #59 from bakerkretzmar/fix-loading-button
Add back Nova's removed `LoadingButton`
2 parents 0751ead + c1a21a0 commit 9803647

File tree

5 files changed

+55
-29
lines changed

5 files changed

+55
-29
lines changed

.github/workflows/main.yaml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
name: CI
22
on:
3-
pull_request:
4-
paths-ignore: ['dist/**', '*.md']
5-
push:
6-
branches: [1.x, 2.x]
7-
paths-ignore: ['dist/**', '*.md']
3+
pull_request:
4+
paths-ignore: ['dist/**', '*.md']
5+
push:
6+
branches: [1.x, 2.x]
7+
paths-ignore: ['dist/**', '*.md']
88
jobs:
9-
test:
10-
name: Tests
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v2
14-
- uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: 8.0
17-
- run: composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD
18-
env:
19-
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}
20-
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }}
21-
- uses: ramsey/composer-install@v2
22-
- run: vendor/bin/phpunit --testdox --colors=always
9+
test:
10+
name: Tests
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.0
17+
- run: composer config http-basic.nova.laravel.com $NOVA_USERNAME $NOVA_PASSWORD
18+
env:
19+
NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }}
20+
NOVA_PASSWORD: ${{ secrets.NOVA_PASSWORD }}
21+
- run: composer require laravel/nova:4.22.2 --no-update
22+
- uses: ramsey/composer-install@v2
23+
- run: vendor/bin/phpunit --testdox --colors=always

dist/js/tool.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
"prod": "mix --production"
77
},
88
"devDependencies": {
9-
"@vue/compiler-sfc": "^3.2.22",
10-
"autoprefixer": "^10.4.14",
11-
"codemirror": "^5.65.2",
12-
"laravel-mix": "^6.0.41",
9+
"@vue/compiler-sfc": "^3.4.19",
10+
"autoprefixer": "^10.4.17",
11+
"codemirror": "^5.65.16",
12+
"laravel-mix": "^6.0.49",
1313
"lodash": "^4.17.21",
14-
"postcss": "^8.4.27",
15-
"prettier": "^2.6.2",
16-
"tailwindcss": "^3.3.3",
17-
"vue": "^3.2.33",
18-
"vue-loader": "^17.0.0"
14+
"postcss": "^8.4.35",
15+
"prettier": "^3.2.5",
16+
"tailwindcss": "^3.4.1",
17+
"vue": "^3.4.19",
18+
"vue-loader": "^17.4.2"
1919
},
2020
"prettier": {
2121
"printWidth": 140,

resources/js/LoadingButton.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<Component size="lg" align="center" v-bind="$attrs" is="DefaultButton" ref="button">
3+
<span :class="{ invisible: processing }">
4+
<slot />
5+
</span>
6+
<span v-if="processing" class="absolute" style="top: 50%; left: 50%; transform: translate(-50%, -50%)">
7+
<Loader class="text-white" width="32" />
8+
</span>
9+
</Component>
10+
</template>
11+
12+
<script>
13+
export default {
14+
props: {
15+
processing: Boolean,
16+
},
17+
methods: {
18+
focus() {
19+
this.$refs.button.focus();
20+
},
21+
},
22+
};
23+
</script>

resources/js/Tool.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import SelectSetting from './SelectSetting.vue';
3030
import TextSetting from './TextSetting.vue';
3131
import TextareaSetting from './TextareaSetting.vue';
3232
import ToggleSetting from './ToggleSetting.vue';
33+
import LoadingButton from './LoadingButton.vue';
3334
3435
export default {
3536
components: {
@@ -39,6 +40,7 @@ export default {
3940
TextSetting,
4041
TextareaSetting,
4142
ToggleSetting,
43+
LoadingButton,
4244
},
4345
data: () => ({
4446
saving: false,

0 commit comments

Comments
 (0)