-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
50e2aae
commit 6b38368
Showing
26 changed files
with
280 additions
and
86 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
resources/js/components/Button/CreateRelationCustomButton.vue
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,27 @@ | ||
<template> | ||
<button | ||
@click="$emit('click')" | ||
type="button" | ||
class="rounded dim font-bold text-sm text-primary inline-flex items-center focus:outline-none active:outline-none focus:shadow-outline active:shadow-outline pl-1 pr-2" | ||
> | ||
<icon type="add" width="24" height="24" view-box="0 0 24 24" /> | ||
<span>{{ setLabel(__('Create')) }}</span> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
label: {}, | ||
field: {} | ||
}, | ||
methods: { | ||
setLabel(defaultLabel) { | ||
return ( | ||
this.field.createRelationButtonLabel || defaultLabel | ||
) | ||
}, | ||
} | ||
} | ||
</script> |
27 changes: 27 additions & 0 deletions
27
resources/js/components/Detail/BroadcasterBelongsToField.vue
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,27 @@ | ||
<template> | ||
<panel-item :field="field"> | ||
<template slot="value"> | ||
<router-link | ||
v-if="field.viewable && field.value" | ||
:to="{ | ||
name: 'detail', | ||
params: { | ||
resourceName: field.resourceName, | ||
resourceId: field.belongsToId, | ||
}, | ||
}" | ||
class="no-underline font-bold dim text-primary" | ||
> | ||
{{ field.value }} | ||
</router-link> | ||
<p v-else-if="field.value">{{ field.value }}</p> | ||
<p v-else>—</p> | ||
</template> | ||
</panel-item> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resource', 'resourceName', 'resourceId', 'field'], | ||
} | ||
</script> |
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
<template> | ||
<panel-item :field="field" /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resource', 'resourceName', 'resourceId', 'field'], | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<panel-item :field="field" /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resource', 'resourceName', 'resourceId', 'field'], | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<template> | ||
<panel-item :field="field" /> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resource', 'resourceName', 'resourceId', 'field'], | ||
} | ||
</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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,48 @@ | ||
<template> | ||
<input :id="field.name" type="hidden" v-model="value" /> | ||
</template> | ||
|
||
<script> | ||
import { FormField } from 'laravel-nova' | ||
export default { | ||
mixins: [FormField], | ||
props: ['resourceName', 'resourceId', 'field'], | ||
created() { | ||
Nova.$on(this.field.listensTo, this.messageReceived) | ||
}, | ||
data: () => ({ | ||
calculating: false, | ||
field_values: {} | ||
}), | ||
methods: { | ||
/* | ||
* Set the initial, internal value for the field. | ||
*/ | ||
setInitialValue() { | ||
this.value = this.field.value || '' | ||
}, | ||
messageReceived(message) { | ||
this.field_values[message.field_name] = message.value; | ||
this.calculateValue() | ||
}, | ||
calculateValue: _.debounce(function () { | ||
this.calculating = true; | ||
Nova.request().post( | ||
`/gldrenthe89/nova-calculated-field/calculate/${this.resourceName}/${this.field.attribute}`, | ||
this.field_values | ||
).then((response) => { | ||
this.value = response.data.value; | ||
this.calculating = false; | ||
}).catch(() => { | ||
this.calculating = false; | ||
}); | ||
}, 500), | ||
}, | ||
} | ||
</script> |
10 changes: 0 additions & 10 deletions
10
...roadcaster-belongsto-field/IndexField.vue → ...nents/Index/BroadcasterBelongsToField.vue
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
<template> | ||
<span>{{ field.value }}</span> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['resourceName', 'field'], | ||
} | ||
</script> |
36 changes: 0 additions & 36 deletions
36
resources/js/components/broadcaster-belongsto-field/DetailField.vue
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
resources/js/components/broadcaster-select-field/DetailField.vue
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
Nova.booting((Vue, router, store) => { | ||
Vue.component('index-broadcaster-field', require('./components/broadcaster-field/IndexField')); | ||
Vue.component('detail-broadcaster-field', require('./components/broadcaster-field/DetailField')); | ||
Vue.component('form-broadcaster-field', require('./components/broadcaster-field/FormField')); | ||
// Detail | ||
Vue.component('detail-broadcaster-field', require('./components/Detail/BroadcasterField')); | ||
Vue.component('detail-broadcaster-belongsto-field', require('./components/Detail/BroadcasterBelongsToField')); | ||
Vue.component('detail-broadcaster-select-field', require('./components/Detail/BroadcasterSelectField')); | ||
Vue.component('detail-listener-currency-field', require('./components/Detail/ListenerCurrencyField')); | ||
Vue.component('detail-listener-field', require('./components/Detail/ListenerField')); | ||
Vue.component('detail-listener-hidden-field', require('./components/Detail/ListenerHiddenField')); | ||
|
||
Vue.component('index-broadcaster-select-field', require('./components/broadcaster-select-field/IndexField')); | ||
Vue.component('detail-broadcaster-select-field', require('./components/broadcaster-select-field/DetailField')); | ||
Vue.component('form-broadcaster-select-field', require('./components/broadcaster-select-field/FormField')); | ||
// Form | ||
Vue.component('form-broadcaster-field', require('./components/Form/BroadcasterField')); | ||
Vue.component('form-broadcaster-belongsto-field', require('./components/Form/BroadcasterBelongsToField')); | ||
Vue.component('form-broadcaster-select-field', require('./components/Form/BroadcasterSelectField')); | ||
Vue.component('form-listener-currency-field', require('./components/Form/ListenerCurrencyField')); | ||
Vue.component('form-listener-field', require('./components/Form/ListenerField')); | ||
Vue.component('form-listener-hidden-field', require('./components/Form/ListenerHiddenField')); | ||
|
||
Vue.component('index-broadcaster-belongsto-field', require('./components/broadcaster-belongsto-field/IndexField')); | ||
Vue.component('detail-broadcaster-belongsto-field', require('./components/broadcaster-belongsto-field/DetailField')); | ||
Vue.component('form-broadcaster-belongsto-field', require('./components/broadcaster-belongsto-field/FormField')); | ||
// Index | ||
Vue.component('index-broadcaster-field', require('./components/Index/BroadcasterField')); | ||
Vue.component('index-broadcaster-belongsto-field', require('./components/Index/BroadcasterBelongsToField')); | ||
Vue.component('index-broadcaster-select-field', require('./components/Index/BroadcasterSelectField')); | ||
Vue.component('index-listener-currency-field', require('./components/Index/ListenerCurrencyField')); | ||
Vue.component('index-listener-field', require('./components/Index/ListenerField')); | ||
Vue.component('index-listener-hidden-field', require('./components/Index/ListenerHiddenField')); | ||
|
||
Vue.component('index-listener-field', require('./components/listener-field/IndexField')); | ||
Vue.component('detail-listener-field', require('./components/listener-field/DetailField')); | ||
Vue.component('form-listener-field', require('./components/listener-field/FormField')); | ||
|
||
Vue.component('index-listener-currency-field', require('./components/listener-currency-field/IndexField')); | ||
Vue.component('detail-listener-currency-field', require('./components/listener-currency-field/DetailField')); | ||
Vue.component('form-listener-currency-field', require('./components/listener-currency-field/FormField')); | ||
// Button | ||
Vue.component('create-relation-custom-button', require('./components/Button/CreateRelationCustomButton')); | ||
}) |
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
Oops, something went wrong.