This repository has been archived by the owner on Oct 17, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from tanerkay/nova-4
- Loading branch information
Showing
10 changed files
with
19,067 additions
and
69 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,40 @@ | ||
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' | ||
), | ||
} | ||
|
||
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
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
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,42 @@ | ||
<template> | ||
<div> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
// Credit: fega https://www.npmjs.com/package/vue2-leaflet-geosearch | ||
import { GeoSearchControl } from 'leaflet-geosearch'; | ||
export default { | ||
props: { | ||
options: { | ||
required: true, | ||
}, | ||
}, | ||
name: 'v-geosearch', | ||
mounted() { | ||
this.add(); | ||
}, | ||
beforeDestroy() { | ||
this.remove(); | ||
}, | ||
methods: { | ||
deferredMountedTo(parent) { | ||
const searchControl = new GeoSearchControl(this.options); | ||
parent.addControl(searchControl); | ||
searchControl.getContainer().onclick = e => { e.stopPropagation(); }; | ||
}, | ||
remove() { | ||
if (this.markerCluster) { | ||
this.$parent.removeLayer(this.markerCluster); | ||
} | ||
}, | ||
add() { | ||
if (this.$parent._isMounted) { | ||
this.deferredMountedTo(this.$parent.mapObject); | ||
} | ||
}, | ||
}, | ||
}; | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
Nova.booting((Vue, router, store) => { | ||
Vue.component('index-nova-map-marker-field', require('./components/IndexField').default); | ||
Vue.component('detail-nova-map-marker-field', require('./components/DetailField').default); | ||
Vue.component('form-nova-map-marker-field', require('./components/FormField').default); | ||
import IndexField from './components/IndexField' | ||
import DetailField from './components/DetailField' | ||
import FormField from './components/FormField' | ||
|
||
Nova.booting((Vue) => { | ||
Vue.component('index-nova-map-marker-field', IndexField); | ||
Vue.component('detail-nova-map-marker-field', DetailField); | ||
Vue.component('form-nova-map-marker-field', FormField); | ||
}); |
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,7 +1,9 @@ | ||
let mix = require('laravel-mix') | ||
|
||
require('./nova.mix') | ||
|
||
mix | ||
.setPublicPath('dist') | ||
.js('resources/js/field.js', 'js') | ||
.copy("./node_modules/leaflet/dist/images", "dist/vendor/leaflet/dist/images") | ||
; | ||
.setPublicPath('dist') | ||
.js('resources/js/field.js', 'js') | ||
.vue({ version: 3 }) | ||
.nova('genealabs/nova-map-marker-field') |