Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodekker committed Dec 8, 2021
1 parent e36216d commit 4636218
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 44 deletions.
18 changes: 9 additions & 9 deletions resources/js/Pages/Contacts/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ export default {
data() {
return {
form: this.$inertia.form({
first_name: null,
last_name: null,
first_name: '',
last_name: '',
organization_id: null,
email: null,
phone: null,
address: null,
city: null,
region: null,
country: null,
postal_code: null,
email: '',
phone: '',
address: '',
city: '',
region: '',
country: '',
postal_code: '',
}),
}
},
Expand Down
9 changes: 3 additions & 6 deletions resources/js/Pages/Contacts/Edit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div>
<Head :title="`${form.first_name} ${form.last_name}`" />
<h1 class="mb-8 font-bold text-3xl">
<Link class="text-indigo-400 hover:text-indigo-600" href="/contacts">Contacts</Link>
<span class="text-indigo-400 font-medium">/</span>
Expand Down Expand Up @@ -39,20 +40,16 @@
</template>

<script>
import { Link } from '@inertiajs/inertia-vue3'
import { Head, Link } from '@inertiajs/inertia-vue3'
import Layout from '@/Shared/Layout'
import TextInput from '@/Shared/TextInput'
import SelectInput from '@/Shared/SelectInput'
import LoadingButton from '@/Shared/LoadingButton'
import TrashedMessage from '@/Shared/TrashedMessage'
export default {
metaInfo() {
return {
title: `${this.form.first_name} ${this.form.last_name}`,
}
},
components: {
Head,
Link,
LoadingButton,
SelectInput,
Expand Down
8 changes: 4 additions & 4 deletions resources/js/Pages/Users/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export default {
data() {
return {
form: this.$inertia.form({
first_name: null,
last_name: null,
email: null,
password: null,
first_name: '',
last_name: '',
email: '',
password: '',
owner: false,
photo: null,
}),
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Users/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
first_name: this.user.first_name,
last_name: this.user.last_name,
email: this.user.email,
password: null,
password: '',
owner: this.user.owner,
photo: null,
}),
Expand Down
9 changes: 2 additions & 7 deletions resources/js/Shared/SelectInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<select :id="id" ref="input" v-model="selected" v-bind="$attrs" class="form-select" :class="{ error: error }">
<select :id="id" ref="input" v-model="selected" v-bind="{ ...$attrs, class: null }" class="form-select" :class="{ error: error }">
<slot />
</select>
<div v-if="error" class="form-error">{{ error }}</div>
Expand Down Expand Up @@ -30,11 +30,6 @@ export default {
selected: this.modelValue,
}
},
computed: {
$class() {
return this.class
},
},
watch: {
selected(selected) {
this.$emit('update:modelValue', selected)
Expand Down
9 changes: 2 additions & 7 deletions resources/js/Shared/TextInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<input :id="id" ref="input" v-bind="$attrs" class="form-input" :class="{ error: error }" :type="type" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<input :id="id" ref="input" v-bind="{ ...$attrs, class: null }" class="form-input" :class="{ error: error }" :type="type" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
Expand All @@ -27,11 +27,6 @@ export default {
label: String,
modelValue: String,
},
computed: {
$class() {
return this.class
},
},
methods: {
focus() {
this.$refs.input.focus()
Expand Down
9 changes: 2 additions & 7 deletions resources/js/Shared/TextareaInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="$class">
<div :class="$attrs.class">
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
<textarea :id="id" ref="input" v-bind="$attrs" class="form-textarea" :class="{ error: error }" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<textarea :id="id" ref="input" v-bind="{ ...$attrs, class: null }" class="form-textarea" :class="{ error: error }" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" />
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
Expand All @@ -23,11 +23,6 @@ export default {
label: String,
modelValue: String,
},
computed: {
$class() {
return this.class
},
},
methods: {
focus() {
this.$refs.input.focus()
Expand Down
4 changes: 1 addition & 3 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ createInertiaApp({
resolve: name => require(`./Pages/${name}`),
title: title => `${title} - Ping CRM`,
setup({ el, App, props, plugin }) {
createApp({
render: () => h(App, props),
})
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el)
},
Expand Down

0 comments on commit 4636218

Please sign in to comment.