WIP
This commit is contained in:
parent
e36216da50
commit
4636218aaa
8 changed files with 24 additions and 44 deletions
|
@ -57,16 +57,16 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: this.$inertia.form({
|
form: this.$inertia.form({
|
||||||
first_name: null,
|
first_name: '',
|
||||||
last_name: null,
|
last_name: '',
|
||||||
organization_id: null,
|
organization_id: null,
|
||||||
email: null,
|
email: '',
|
||||||
phone: null,
|
phone: '',
|
||||||
address: null,
|
address: '',
|
||||||
city: null,
|
city: '',
|
||||||
region: null,
|
region: '',
|
||||||
country: null,
|
country: '',
|
||||||
postal_code: null,
|
postal_code: '',
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<Head :title="`${form.first_name} ${form.last_name}`" />
|
||||||
<h1 class="mb-8 font-bold text-3xl">
|
<h1 class="mb-8 font-bold text-3xl">
|
||||||
<Link class="text-indigo-400 hover:text-indigo-600" href="/contacts">Contacts</Link>
|
<Link class="text-indigo-400 hover:text-indigo-600" href="/contacts">Contacts</Link>
|
||||||
<span class="text-indigo-400 font-medium">/</span>
|
<span class="text-indigo-400 font-medium">/</span>
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Link } from '@inertiajs/inertia-vue3'
|
import { Head, Link } from '@inertiajs/inertia-vue3'
|
||||||
import Layout from '@/Shared/Layout'
|
import Layout from '@/Shared/Layout'
|
||||||
import TextInput from '@/Shared/TextInput'
|
import TextInput from '@/Shared/TextInput'
|
||||||
import SelectInput from '@/Shared/SelectInput'
|
import SelectInput from '@/Shared/SelectInput'
|
||||||
|
@ -47,12 +48,8 @@ import LoadingButton from '@/Shared/LoadingButton'
|
||||||
import TrashedMessage from '@/Shared/TrashedMessage'
|
import TrashedMessage from '@/Shared/TrashedMessage'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metaInfo() {
|
|
||||||
return {
|
|
||||||
title: `${this.form.first_name} ${this.form.last_name}`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
components: {
|
||||||
|
Head,
|
||||||
Link,
|
Link,
|
||||||
LoadingButton,
|
LoadingButton,
|
||||||
SelectInput,
|
SelectInput,
|
||||||
|
|
|
@ -48,10 +48,10 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: this.$inertia.form({
|
form: this.$inertia.form({
|
||||||
first_name: null,
|
first_name: '',
|
||||||
last_name: null,
|
last_name: '',
|
||||||
email: null,
|
email: '',
|
||||||
password: null,
|
password: '',
|
||||||
owner: false,
|
owner: false,
|
||||||
photo: null,
|
photo: null,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -65,7 +65,7 @@ export default {
|
||||||
first_name: this.user.first_name,
|
first_name: this.user.first_name,
|
||||||
last_name: this.user.last_name,
|
last_name: this.user.last_name,
|
||||||
email: this.user.email,
|
email: this.user.email,
|
||||||
password: null,
|
password: '',
|
||||||
owner: this.user.owner,
|
owner: this.user.owner,
|
||||||
photo: null,
|
photo: null,
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="$class">
|
<div :class="$attrs.class">
|
||||||
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
|
<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 />
|
<slot />
|
||||||
</select>
|
</select>
|
||||||
<div v-if="error" class="form-error">{{ error }}</div>
|
<div v-if="error" class="form-error">{{ error }}</div>
|
||||||
|
@ -30,11 +30,6 @@ export default {
|
||||||
selected: this.modelValue,
|
selected: this.modelValue,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
$class() {
|
|
||||||
return this.class
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
selected(selected) {
|
selected(selected) {
|
||||||
this.$emit('update:modelValue', selected)
|
this.$emit('update:modelValue', selected)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="$class">
|
<div :class="$attrs.class">
|
||||||
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
|
<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 v-if="error" class="form-error">{{ error }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -27,11 +27,6 @@ export default {
|
||||||
label: String,
|
label: String,
|
||||||
modelValue: String,
|
modelValue: String,
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
$class() {
|
|
||||||
return this.class
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
this.$refs.input.focus()
|
this.$refs.input.focus()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="$class">
|
<div :class="$attrs.class">
|
||||||
<label v-if="label" class="form-label" :for="id">{{ label }}:</label>
|
<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 v-if="error" class="form-error">{{ error }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -23,11 +23,6 @@ export default {
|
||||||
label: String,
|
label: String,
|
||||||
modelValue: String,
|
modelValue: String,
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
$class() {
|
|
||||||
return this.class
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
this.$refs.input.focus()
|
this.$refs.input.focus()
|
||||||
|
|
4
resources/js/app.js
vendored
4
resources/js/app.js
vendored
|
@ -8,9 +8,7 @@ createInertiaApp({
|
||||||
resolve: name => require(`./Pages/${name}`),
|
resolve: name => require(`./Pages/${name}`),
|
||||||
title: title => `${title} - Ping CRM`,
|
title: title => `${title} - Ping CRM`,
|
||||||
setup({ el, App, props, plugin }) {
|
setup({ el, App, props, plugin }) {
|
||||||
createApp({
|
createApp({ render: () => h(App, props) })
|
||||||
render: () => h(App, props),
|
|
||||||
})
|
|
||||||
.use(plugin)
|
.use(plugin)
|
||||||
.mount(el)
|
.mount(el)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue