2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 11:29:03 +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

@ -1,33 +1,49 @@
<template>
<div>
<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">
<select
class="appearance-none bg-transparent focus:outline-none w-full"
:class="isReadOnly && 'pointer-events-none'"
:value="value"
@change="e => triggerChange(e.target.value)"
@focus="e => $emit('focus', e)"
>
<option v-for="option in options" :value="option.value">{{ option.label }}</option>
</select>
<div class="absolute left-0 pl-2 text-gray-600 pointer-events-none" v-if="!value">
{{ inputPlaceholder }}
<div>
<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"
>
<select
class="appearance-none bg-transparent focus:outline-none w-full"
:class="isReadOnly && 'pointer-events-none'"
:value="value"
@change="e => triggerChange(e.target.value)"
@focus="e => $emit('focus', e)"
>
<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"
>
{{ inputPlaceholder }}
</div>
<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"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
<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"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</div>
</div>
</template>
<script>

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

@ -1,6 +1,6 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 12">
<g fill="none" fill-rule="evenodd" transform="translate(.5 -1.5)">
<g fill="none" fill-rule="evenodd" transform="translate(.5 -1.5)">
<path
d="M.5 5.5L.5 10.4361148C.5 11.1734491.553979991 11.4529804.708039303 11.7410463.835746496 11.979838 1.02016204 12.1642535 1.25895373 12.2919607 1.54701959 12.44602 1.82655093 12.5 2.5638852 12.5L10.4361148 12.5C11.1734491 12.5 11.4529804 12.44602 11.7410463 12.2919607 11.979838 12.1642535 12.1642535 11.979838 12.2919607 11.7410463 12.44602 11.4529804 12.5 11.1734491 12.5 10.4361148L12.5 5.5.5 5.5zM.5 5.5L12.5 5.5 12.5 4.5638852C12.5 3.82655093 12.44602 3.54701959 12.2919607 3.25895373 12.1642535 3.02016204 11.979838 2.8357465 11.7410463 2.7080393 11.4529804 2.55397999 11.1734491 2.5 10.4361148 2.5L2.5638852 2.5C1.82655093 2.5 1.54701959 2.55397999 1.25895373 2.7080393 1.02016204 2.8357465.835746496 3.02016204.708039303 3.25895373.553979991 3.54701959.5 3.82655093.5 4.5638852L.5 5.5z"
/>

View File

@ -1,5 +1,5 @@
<template>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">
<circle cx="8" cy="8" r="3.5" fill="none" transform="translate(-4 -4)" />
<circle cx="8" cy="8" r="3.5" fill="none" transform="translate(-4 -4)" />
</svg>
</template>

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>