- added own provider for drive methods
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s
- renamed middleware Role and Can to role_middleware and can_middleware - added some typing for inertia vue3 components - npm updates
This commit is contained in:
parent
cb51a4136f
commit
296c8fd46e
67 changed files with 2515 additions and 1913 deletions
89
resources/js/app.ts
Normal file
89
resources/js/app.ts
Normal file
|
@ -0,0 +1,89 @@
|
|||
import '../css/app.css';
|
||||
import { createApp, h, App, Plugin } from 'vue';
|
||||
import { Inertia } from '@inertiajs/inertia';
|
||||
|
||||
import { createInertiaApp } from '@inertiajs/vue3';
|
||||
// import DefaultLayout from '@/Layouts/Default.vue';
|
||||
import { createPinia } from 'pinia';
|
||||
import { StyleService } from '@/Stores/style.service';
|
||||
import { LayoutService } from '@/Stores/layout';
|
||||
import { darkModeKey, styleKey } from '@/config';
|
||||
// import type { DefineComponent } from 'vue';
|
||||
// import { resolvePageComponent } from '@adonisjs/inertia/helpers';
|
||||
const pinia = createPinia();
|
||||
import { EmitterPlugin } from '@/EmitterDirective';
|
||||
|
||||
import { initRoutes } from '@eidellev/adonis-stardust/client/index.js';
|
||||
initRoutes();
|
||||
|
||||
interface SetupOptions {
|
||||
el: Element;
|
||||
App: App;
|
||||
props: Record<string, any>;
|
||||
plugin: Plugin;
|
||||
}
|
||||
|
||||
// import '@fontsource/archivo-black/index.css';
|
||||
// import '@fontsource/inter/index.css';
|
||||
|
||||
createInertiaApp({
|
||||
progress: {
|
||||
// color: '#4B5563',
|
||||
color: '#22C55E',
|
||||
},
|
||||
// Webpack
|
||||
// resolve: (name) => require(`./Pages/${name}`),
|
||||
// resolve: (name) => require(`./Pages/${name}.vue`),
|
||||
// add default layout
|
||||
// resolve: (name) => {
|
||||
// const page = require(`./Pages/${name}.vue`).default;
|
||||
// // if (!page.layout) {
|
||||
// // page.layout = DefaultLayout;
|
||||
// // }
|
||||
// return page;
|
||||
// },
|
||||
resolve: async (name: string) => {
|
||||
// Dynamically import the Vue component using import
|
||||
const { default: page } = await import(`./Pages/${name}.vue`);
|
||||
// const page = require(`./Pages/${name}.vue`).default;
|
||||
// if (!page.layout) {
|
||||
// page.layout = DefaultLayout;
|
||||
// }
|
||||
return page;
|
||||
},
|
||||
// resolve: (name) => {
|
||||
// return resolvePageComponent(
|
||||
// `./Pages/${name}.vue`,
|
||||
// import.meta.glob<DefineComponent>('./pages/**/*.vue'),
|
||||
// )
|
||||
// },
|
||||
|
||||
setup({ el, App, props, plugin} : SetupOptions) {
|
||||
createApp({ render: () => h(App, props) })
|
||||
.use(plugin)
|
||||
.use(pinia)
|
||||
.use(EmitterPlugin)
|
||||
// .component('inertia-link', Link)
|
||||
.mount(el);
|
||||
},
|
||||
});
|
||||
|
||||
const styleService = StyleService(pinia);
|
||||
const layoutService = LayoutService(pinia);
|
||||
// const mainService = MainService(pinia);
|
||||
// mainService.setUser(user);
|
||||
|
||||
/* App style */
|
||||
styleService.setStyle(localStorage[styleKey] ?? 'basic');
|
||||
|
||||
/* Dark mode */
|
||||
if ((!localStorage[darkModeKey] && window.matchMedia('(prefers-color-scheme: dark)').matches) || localStorage[darkModeKey] === '1') {
|
||||
styleService.setDarkMode(true);
|
||||
}
|
||||
|
||||
|
||||
/* Collapse mobile aside menu on route change */
|
||||
Inertia.on('navigate', () => {
|
||||
layoutService.isAsideMobileExpanded = false;
|
||||
layoutService.isAsideLgActive = false;
|
||||
});
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue