From f2d4ad56749256a7c574f3408dd4ddcf3d37de9e Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 4 Dec 2022 23:40:35 +0100 Subject: [PATCH] Add global save button --- package-lock.json | 15 ++++++ package.json | 1 + resources/img/svg/save.svg | 1 + resources/js/app.js | 15 +++--- resources/js/components/SaveButton.vue | 22 +++++++++ resources/js/components/SidebarHeader.vue | 27 ++++++++--- resources/js/layouts/AppLayout.vue | 48 +++++++++---------- resources/js/views/member/VForm.vue | 6 +-- resources/js/views/setting/Bill.vue | 11 +++-- resources/js/views/setting/Mailman.vue | 10 ++-- .../views/subscription/SubscriptionForm.vue | 5 +- 11 files changed, 107 insertions(+), 54 deletions(-) create mode 100644 resources/img/svg/save.svg create mode 100644 resources/js/components/SaveButton.vue diff --git a/package-lock.json b/package-lock.json index 6f889d76..9187c4d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "@inertiajs/inertia-vue": "^0.8.0", "lodash": "^4.17.21", "merge": "^2.1.1", + "portal-vue": "^2.1.7", "postcss-import": "^14.0.1", "query-string": "^7.0.0", "svg-sprite": "^2.0.2", @@ -7791,6 +7792,14 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/portal-vue": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz", + "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==", + "peerDependencies": { + "vue": "^2.5.18" + } + }, "node_modules/portfinder": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", @@ -16790,6 +16799,12 @@ "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==" }, + "portal-vue": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/portal-vue/-/portal-vue-2.1.7.tgz", + "integrity": "sha512-+yCno2oB3xA7irTt0EU5Ezw22L2J51uKAacE/6hMPMoO/mx3h4rXFkkBkT4GFsMDv/vEe8TNKC3ujJJ0PTwb6g==", + "requires": {} + }, "portfinder": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", diff --git a/package.json b/package.json index fc74aaaf..47f30215 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@inertiajs/inertia-vue": "^0.8.0", "lodash": "^4.17.21", "merge": "^2.1.1", + "portal-vue": "^2.1.7", "postcss-import": "^14.0.1", "query-string": "^7.0.0", "svg-sprite": "^2.0.2", diff --git a/resources/img/svg/save.svg b/resources/img/svg/save.svg new file mode 100644 index 00000000..7986d893 --- /dev/null +++ b/resources/img/svg/save.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/js/app.js b/resources/js/app.js index 3ddc3808..921dbcd3 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -2,10 +2,6 @@ import Vue from 'vue'; import {App as InertiaApp, plugin, Link as ILink} from '@inertiajs/inertia-vue'; import SvgSprite from './components/SvgSprite.js'; -import FText from './components/FText.vue'; -import FSwitch from './components/FSwitch.vue'; -import FSelect from './components/FSelect.vue'; -import FTextarea from './components/FTextarea.vue'; import VPages from './components/VPages.vue'; import VLabel from './components/VLabel.vue'; import VBool from './components/VBool.vue'; @@ -14,19 +10,22 @@ import Heading from './components/Heading.vue'; import AppLayout from './layouts/AppLayout.vue'; import VTooltip from 'v-tooltip'; import hasModule from './mixins/hasModule.js'; +import PortalVue from 'portal-vue'; Vue.use(plugin); +Vue.use(PortalVue); Vue.use(VTooltip); -Vue.component('f-text', FText); -Vue.component('f-switch', FSwitch); -Vue.component('f-select', FSelect); -Vue.component('f-textarea', FTextarea); +Vue.component('f-text', () => import(/* webpackChunkName: "form" */ './components/FText')); +Vue.component('f-switch', () => import(/* webpackChunkName: "form" */ './components/FSwitch')); +Vue.component('f-select', () => import(/* webpackChunkName: "form" */ './components/FSelect')); +Vue.component('f-textarea', () => import(/* webpackChunkName: "form" */ './components/FTextarea')); Vue.component('SvgSprite', SvgSprite); Vue.component('VPages', VPages); Vue.component('v-bool', VBool); Vue.component('v-label', VLabel); Vue.component('box', Box); Vue.component('heading', Heading); +Vue.component('save-button', () => import(/* webpackChunkName: "form" */ './components/SaveButton')); const el = document.getElementById('app'); diff --git a/resources/js/components/SaveButton.vue b/resources/js/components/SaveButton.vue new file mode 100644 index 00000000..3cd17e87 --- /dev/null +++ b/resources/js/components/SaveButton.vue @@ -0,0 +1,22 @@ + + + diff --git a/resources/js/components/SidebarHeader.vue b/resources/js/components/SidebarHeader.vue index da32fb45..410bf389 100644 --- a/resources/js/components/SidebarHeader.vue +++ b/resources/js/components/SidebarHeader.vue @@ -2,11 +2,22 @@
- + - + @@ -23,11 +34,15 @@ export default { props: { links: { - default: function() { return []; } + default: function () { + return []; + }, }, title: { - default: function() { return ''; } - } - } + default: function () { + return ''; + }, + }, + }, }; diff --git a/resources/js/layouts/AppLayout.vue b/resources/js/layouts/AppLayout.vue index 3a00635d..52acf524 100644 --- a/resources/js/layouts/AppLayout.vue +++ b/resources/js/layouts/AppLayout.vue @@ -36,36 +36,36 @@ class="grow bg-gray-900 flex flex-col transition-all" :class="{'ml-56': menuVisible, 'ml-0': !menuVisible}" > -
-
- - - - -
- - - - -
+
+ + + + + + + + +
+ +
diff --git a/resources/js/views/setting/Bill.vue b/resources/js/views/setting/Bill.vue index 4e590079..2eede038 100644 --- a/resources/js/views/setting/Bill.vue +++ b/resources/js/views/setting/Bill.vue @@ -1,5 +1,10 @@ diff --git a/resources/js/views/setting/Mailman.vue b/resources/js/views/setting/Mailman.vue index fde12259..5d7329e4 100644 --- a/resources/js/views/setting/Mailman.vue +++ b/resources/js/views/setting/Mailman.vue @@ -1,5 +1,10 @@ diff --git a/resources/js/views/subscription/SubscriptionForm.vue b/resources/js/views/subscription/SubscriptionForm.vue index 42d8b023..9cfa4f15 100644 --- a/resources/js/views/subscription/SubscriptionForm.vue +++ b/resources/js/views/subscription/SubscriptionForm.vue @@ -1,5 +1,6 @@