2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00

style: Format with prettier

This commit is contained in:
Faris Ansari 2019-12-21 21:19:01 +05:30
parent a779c91679
commit 2d2f5eb57e
13 changed files with 62 additions and 64 deletions

View File

@ -1,6 +1,11 @@
<template>
<div class="rounded-full overflow-hidden" :class="sizeClasses">
<img v-if="imageURL" :src="imageURL" class="object-cover" :class="sizeClasses" />
<img
v-if="imageURL"
:src="imageURL"
class="object-cover"
:class="sizeClasses"
/>
<div
v-else
class="bg-gray-500 flex h-full items-center justify-center text-white w-full text-base uppercase"

View File

@ -1,5 +1,8 @@
<template>
<div class="inline-block rounded-md px-2 py-1 truncate" :class="getColorClass">
<div
class="inline-block rounded-md px-2 py-1 truncate"
:class="getColorClass"
>
<slot></slot>
</div>
</template>
@ -20,7 +23,7 @@ export default {
yellow: 'bg-yellow-100 text-yellow-600',
orange: 'bg-orange-100 text-orange-600',
blue: 'bg-blue-100 text-blue-600',
green: 'bg-green-100 text-green-600',
green: 'bg-green-100 text-green-600'
}[this.color];
}
}

View File

@ -5,7 +5,8 @@ export default {
props: ['target'],
extends: Link,
created() {
this.targetWatcher = this.$watch(`doc.${this.df.references}`, function(newTarget, oldTarget) {
let watchKey = `doc.${this.df.references}`;
this.targetWatcher = this.$watch(watchKey, function(newTarget, oldTarget) {
if (oldTarget && newTarget !== oldTarget) {
this.triggerChange('');
}

View File

@ -3,7 +3,10 @@
<div class="text-gray-600 text-sm mb-1" v-if="showLabel">
{{ df.label }}
</div>
<div class="relative flex items-center justify-end bg-white focus-within:bg-gray-200" :class="inputClasses">
<div
class="relative flex items-center justify-end bg-white focus-within:bg-gray-200"
:class="inputClasses"
>
<select
class="appearance-none bg-transparent focus:outline-none w-full"
:class="isReadOnly && 'pointer-events-none'"
@ -11,12 +14,25 @@
@change="e => triggerChange(e.target.value)"
@focus="e => $emit('focus', e)"
>
<option v-for="option in options" :value="option.value">{{ option.label }}</option>
<option
v-for="option in options"
:key="option.value"
:value="option.value"
>
{{ option.label }}
</option>
</select>
<div class="absolute left-0 pl-2 text-gray-600 pointer-events-none" v-if="!value">
<div
class="absolute left-0 pl-2 text-gray-600 pointer-events-none"
v-if="!value"
>
{{ inputPlaceholder }}
</div>
<svg class="w-3 h-3 absolute" viewBox="0 0 5 10" xmlns="http://www.w3.org/2000/svg">
<svg
class="w-3 h-3 absolute"
viewBox="0 0 5 10"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1 2.636L2.636 1l1.637 1.636M1 7.364L2.636 9l1.637-1.636"
stroke="#404040"

View File

@ -1,8 +1,5 @@
<template>
<Row
:ratio="ratio"
class="border-b px-2 w-full"
>
<Row :ratio="ratio" class="border-b px-2 w-full">
<div class="flex items-center pl-2 text-gray-600">{{ row.idx + 1 }}</div>
<FormControl
:size="size"
@ -35,7 +32,7 @@ export default {
doctype: this.row.doctype,
name: this.row.name,
doc: this.row
};
}
}
}
};
</script>

View File

@ -3,7 +3,6 @@
<g
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
transform="translate(0 1)"

View File

@ -2,7 +2,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 4">
<polyline
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
points="4 6 8 10 12 6"

View File

@ -2,7 +2,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 9">
<polyline
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"

View File

@ -2,7 +2,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 15">
<path
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
d="M7,13 C10.3137085,13 13,10.3137085 13,7 C13,3.6862915 10.3137085,1 7,1 C3.6862915,1 1,3.6862915 1,7 C1,10.3137085 3.6862915,13 7,13 Z M15,15 L11.242,11.242"

View File

@ -29,6 +29,7 @@ export default {
style() {
let obj = {};
if (this.columnCount) {
// prettier-ignore
obj['grid-template-columns'] = `repeat(${this.columnCount}, ${this.columnWidth})`;
}
if (this.ratio.length) {

View File

@ -1,36 +1,16 @@
<template>
<div>
<!-- <div class="bg-blue-500 px-6 py-5 rounded-lg flex justify-between items-center">
<div class="flex items-center">
<div class="bg-white rounded-full w-16 h-16 flex-center">
<svg class="w-6 h-6" viewBox="0 0 24 21" xmlns="http://www.w3.org/2000/svg">
<path
d="M21 3h-4l-2-3H9L7 3H3a3 3 0 00-3 3v12a3 3 0 003 3h18a3 3 0 003-3V6a3 3 0 00-3-3zm-9 14a5 5 0 110-10 5 5 0 010 10z"
fill="#B7BFC6"
fill-rule="nonzero"
/>
</svg>
</div>
<div class="flex flex-col text-white ml-4">
<span class="text-lg font-semibold">Company Name</span>
<span class="text-sm">Email</span>
</div>
</div>
<Button class="text-xs">Edit</Button>
</div> -->
<TwoColumnForm v-if="doc" :doc="doc" :fields="fields" :autosave="true" />
</div>
</template>
<script>
import frappe from 'frappejs';
import Button from '@/components/Button';
import TwoColumnForm from '@/components/TwoColumnForm';
export default {
name: 'TabGeneral',
components: {
Button,
TwoColumnForm
},
data() {
@ -58,4 +38,3 @@ export default {
}
};
</script>