-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vagrant
committed
Jun 23, 2022
1 parent
5549f24
commit de74331
Showing
11 changed files
with
124 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*! | ||
* vuex v4.0.2 | ||
* (c) 2021 Evan You | ||
* @license MIT | ||
*/ | ||
|
||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | ||
|
||
/** | ||
* @license | ||
* Lodash <https://lodash.com/> | ||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> | ||
* Released under MIT license <https://lodash.com/license> | ||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | ||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"/js/field.js": "/js/field.js", | ||
"/css/field.css": "/css/field.css" | ||
} | ||
"/js/field.js": "/js/field.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const mix = require('laravel-mix'); | ||
const webpack = require('webpack'); | ||
const path = require('path'); | ||
|
||
class NovaExtension { | ||
name() { | ||
return 'nova-extension'; | ||
} | ||
|
||
register(name) { | ||
this.name = name; | ||
} | ||
|
||
webpackPlugins() { | ||
return new webpack.ProvidePlugin({ | ||
_: 'lodash', | ||
Errors: 'form-backend-validation', | ||
}); | ||
} | ||
|
||
webpackConfig(webpackConfig) { | ||
webpackConfig.externals = { | ||
vue: 'Vue', | ||
}; | ||
|
||
webpackConfig.resolve.alias = { | ||
...(webpackConfig.resolve.alias || {}), | ||
'laravel-nova': path.join(__dirname, 'vendor/laravel/nova/resources/js/mixins/packages.js'), | ||
'laravel-nova-mixins': path.join(__dirname, 'vendor/laravel/nova/resources/js/mixins/index.js'), | ||
'@': path.join(__dirname, 'vendor/laravel/nova/resources/js/'), | ||
}; | ||
webpackConfig.output = { | ||
uniqueName: this.name, | ||
}; | ||
} | ||
} | ||
|
||
mix.extend('nova', new NovaExtension()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<template> | ||
<panel-item :field="field"> | ||
<template slot="value"> | ||
<PanelItem :index="index" :field="field" :field-name="field.name"> | ||
<template #value> | ||
<span class="rounded-full uppercase px-2 py-1 text-xs font-bold whitespace-no-wrap" | ||
:style="{ backgroundColor: backgroundColor(), color: textColor() }" | ||
>{{ __(displayValue()) }}</span> | ||
</template> | ||
</panel-item> | ||
|
||
</PanelItem> | ||
</template> | ||
|
||
<script> | ||
import colors from '../mixins/colors'; | ||
import display from '../mixins/display'; | ||
export default { | ||
props: ['resource', 'resourceName', 'resourceId', 'field'], | ||
props: ['index', 'resource', 'resourceName', 'resourceId', 'field'], | ||
mixins: [colors, display] | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
Nova.booting((Vue, router) => { | ||
Vue.component('index-badge', require('./components/IndexField')); | ||
Vue.component('detail-badge', require('./components/DetailField')); | ||
Vue.component('form-badge', require('./components/FormField')); | ||
import IndexField from './components/IndexField' | ||
import DetailField from './components/DetailField' | ||
import SelectField from '../../vendor/laravel/nova/resources/js/fields/Form/SelectField' | ||
|
||
Nova.booting((app, router, store) => { | ||
app.component('index-badge', IndexField); | ||
app.component('detail-badge', DetailField); | ||
app.component('form-badge', SelectField); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,5 @@ public function displayUsingLabels() | |
|
||
return $this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
let mix = require('laravel-mix') | ||
let path = require('path') | ||
|
||
mix.setPublicPath('dist') | ||
require('./nova.mix') | ||
|
||
mix | ||
.setPublicPath('dist') | ||
.js('resources/js/field.js', 'js') | ||
.sass('resources/sass/field.scss', 'css') | ||
.vue({ version: 3 }) | ||
.alias({ | ||
'laravel-nova': path.join(__dirname, 'vendor/laravel/nova/resources/js/mixins/packages.js'), | ||
'@': path.join(__dirname, 'resources/js/') | ||
}) | ||
.nova('timothyasp/nova-badge-field') |