Skip to content

Commit

Permalink
Merge pull request #55 from webard/main
Browse files Browse the repository at this point in the history
Introduce nova-kit/nova-packages-tool
  • Loading branch information
Muetze42 authored Sep 25, 2024
2 parents e4b08eb + df8d5d7 commit 41c1e59
Show file tree
Hide file tree
Showing 8 changed files with 3,702 additions and 9,909 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ phpunit.xml
.phpunit.result.cache
.DS_Store
Thumbs.db
auth.json
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
"require": {
"php": "^8.0",
"laravel/nova": "^4.27.14",
"norman-huth/nova-basic-package": "^1.2.6"
"norman-huth/nova-basic-package": "^1.2.6",
"nova-kit/nova-packages-tool": "^1.17"
},
"repositories": {
"nova": {
"type": "composer",
"url": "https://nova.laravel.com"
}
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/js/tool.js": "/js/tool.js?id=f784f5ef8bff673d4c91433f754f9c9b"
"/js/tool.js": "/js/tool.js?id=6d2963b95b1029c41300eba98761f83a"
}
12 changes: 3 additions & 9 deletions nova.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ class NovaExtension {

webpackConfig(webpackConfig) {
webpackConfig.externals = {
vue: 'Vue'
}

webpackConfig.resolve.alias = {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(
__dirname,
'../../nova/resources/js/mixins/packages.js'
)
vue: 'Vue',
'laravel-nova': 'LaravelNova',
'laravel-nova-ui': 'LaravelNovaUi'
}

webpackConfig.output = {
Expand Down
13,511 changes: 3,666 additions & 9,845 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 14 additions & 29 deletions resources/js/components/MenuGroup.vue
Original file line number Diff line number Diff line change
@@ -1,43 +1,28 @@
<template>
<div v-if="item.items.length > 0" :class="item.classes.filterClass">
<h4
@click.prevent="handleClick"
class="flex items-center px-1 py-1 rounded text-left text-gray-500"
:class="[{
'cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800':
displayAsButton,
'font-bold text-primary-500 dark:text-primary-500': item.active,
}, item.icons.classes.elem, { 'cursor-pointer menu-iframe-group': item.iframe.target }]"
v-tooltip.click="item.tooltip"
@click="item.iframe.target ? open = true : null"
>
<h4 @click.prevent="handleClick" class="flex items-center px-1 py-1 rounded text-left text-gray-500" :class="[{
'cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800':
displayAsButton,
'font-bold text-primary-500 dark:text-primary-500': item.active,
}, item.icons.classes.elem, { 'cursor-pointer menu-iframe-group': item.iframe.target }]"
v-tooltip.click="item.tooltip" @click="item.iframe.target ? open = true : null">
<span class="inline-block shrink-0 w-6 h-6">
<NHMenuIcon :icons="item.icons" v-if="!item.icons.asLabel"/>
<NHMenuIcon :icons="item.icons" v-if="!item.icons.asLabel" />
</span>

<span
class="flex-1 flex items-center w-full tracking-wide uppercase font-bold text-left text-xs px-3 py-1"
:class="'gap-x-'+item.icons.labelGap"
>
<NHMenuIcon :icons="item.icons" v-if="item.icons.asLabel" class="inline-block"/>
<span class="flex-1 flex items-center w-full tracking-wide uppercase font-bold text-left text-xs px-3 py-1"
:class="'gap-x-' + item.icons.labelGap">
<NHMenuIcon :icons="item.icons" v-if="item.icons.asLabel" class="inline-block" />
{{ item.name }}
</span>

<span
v-if="item.collapsable"
class="inline-flex items-center justify-center shrink-0 w-6 h-6"
>
<CollapseButton :collapsed="collapsed" :to="item.path"/>
<span v-if="item.collapsable" class="inline-flex items-center justify-center shrink-0 w-6 h-6">
<CollapseButton :collapsed="collapsed" :to="item.path" />
</span>
</h4>

<div v-if="!collapsed && !item.iframe.target">
<component
:key="item.name"
v-for="item in item.items"
:is="item.component"
:item="item"
/>
<component :key="item.name" v-for="item in item.items" :is="item.component" :item="item" />
</div>
</div>
<div :class="item.iframe.wrapper.classes" :style="item.iframe.wrapper.styles" @click="open = false" v-if="open">
Expand All @@ -46,7 +31,7 @@
</template>

<script>
import Collapsable from './../../../../../laravel/nova/resources/js/mixins/Collapsable.js'
import Collapsable from './../../../vendor/laravel/nova/resources/js/mixins/Collapsable.js'
export default {
mixins: [Collapsable],
Expand Down
31 changes: 8 additions & 23 deletions resources/js/components/MenuSection.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
<template>
<div class="relative" v-if="item.path || item.items.length > 0" :class="item.classes.filterClass">
<component
:is="component"
:href="item.path ?? null"
@click.prevent="handleClick"
<component :is="component" :href="item.path ?? null" @click.prevent="handleClick"
:tabindex="displayAsButton ? 0 : null"
class="w-full flex items-start px-1 py-1 rounded text-left text-gray-500 dark:text-gray-500 focus:outline-none focus:ring focus:ring-primary-200 dark:focus:ring-gray-600"
:class="[{
'cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-800':
displayAsButton,
'font-bold text-primary-500 dark:text-primary-500': item.active,
},item.icons.classes.elem,{ 'cursor-pointer menu-iframe-section': item.iframe.target }]"
v-tooltip.click="item.tooltip"
@click="item.iframe.target ? open = true : null"
>
}, item.icons.classes.elem, { 'cursor-pointer menu-iframe-section': item.iframe.target }]"
v-tooltip.click="item.tooltip" @click="item.iframe.target ? open = true : null">
<span class="inline-block shrink-0 w-6 h-6">
<NHMenuIcon :icons="item.icons" />
</span>

<span
class="flex-1 flex items-center w-full px-3 text-base"
:class="[{'font-bold inertia-link-active': item.active}, item.icons.classes.label]"
>
<span class="flex-1 flex items-center w-full px-3 text-base"
:class="[{ 'font-bold inertia-link-active': item.active }, item.icons.classes.label]">
{{ item.name }}
</span>

Expand All @@ -31,21 +24,13 @@
</Badge>
</span>

<span
v-if="item.collapsable"
class="inline-flex items-center justify-center shrink-0 w-6 h-6"
>
<span v-if="item.collapsable" class="inline-flex items-center justify-center shrink-0 w-6 h-6">
<CollapseButton :collapsed="collapsed" :to="item.path" />
</span>
</component>

<div v-if="!item.iframe.target && item.items.length > 0 && !collapsed" class="mt-1 space-y-1">
<component
:is="item.component"
v-for="item in item.items"
:key="item.name"
:item="item"
/>
<component :is="item.component" v-for="item in item.items" :key="item.name" :item="item" />
</div>
</div>
<div :class="item.iframe.wrapper.classes" :style="item.iframe.wrapper.styles" @click="open = false" v-if="open">
Expand All @@ -54,7 +39,7 @@
</template>

<script>
import Collapsable from './../../../../../laravel/nova/resources/js/mixins/Collapsable.js'
import Collapsable from './../../../vendor/laravel/nova/resources/js/mixins/Collapsable.js'
import { mapGetters, mapMutations } from 'vuex'
export default {
Expand Down

0 comments on commit 41c1e59

Please sign in to comment.