2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 02:49:03 +00:00

fix: format using prettier

This commit is contained in:
pu-raihan 2024-08-20 13:11:33 +05:30
parent 3f9b90241a
commit f15b1cfe13
16 changed files with 293 additions and 287 deletions

View File

@ -14,7 +14,8 @@
h-full h-full
items-center items-center
justify-center justify-center
text-white dark:text-gray-900 text-white
dark:text-gray-900
w-full w-full
text-base text-base
uppercase uppercase

View File

@ -1,69 +1,33 @@
<template> <template>
<div> <div>
<svg <svg ref="chartSvg" :viewBox="`0 0 ${viewBoxWidth} ${viewBoxHeight}`" xmlns="http://www.w3.org/2000/svg">
ref="chartSvg"
:viewBox="`0 0 ${viewBoxWidth} ${viewBoxHeight}`"
xmlns="http://www.w3.org/2000/svg"
>
<!-- x Grid Lines --> <!-- x Grid Lines -->
<path <path v-if="drawXGrid" :d="xGrid" :stroke="gridColor" :stroke-width="gridThickness" stroke-linecap="round"
v-if="drawXGrid" fill="transparent" />
:d="xGrid"
:stroke="gridColor"
:stroke-width="gridThickness"
stroke-linecap="round"
fill="transparent"
/>
<!-- zero line --> <!-- zero line -->
<path <path v-if="drawZeroLine" :d="zLine" :stroke="zeroLineColor" :stroke-width="gridThickness" stroke-linecap="round"
v-if="drawZeroLine" fill="transparent" />
:d="zLine"
:stroke="zeroLineColor"
:stroke-width="gridThickness"
stroke-linecap="round"
fill="transparent"
/>
<!-- Axis --> <!-- Axis -->
<path <path v-if="drawAxis" :d="axis" :stroke-width="axisThickness" :stroke="axisColor" fill="transparent" />
v-if="drawAxis"
:d="axis"
:stroke-width="axisThickness"
:stroke="axisColor"
fill="transparent"
/>
<!-- x Labels --> <!-- x Labels -->
<template v-if="xLabels.length > 0"> <template v-if="xLabels.length > 0">
<text <text v-for="(i, j) in count" :key="j + '-xlabels'" :style="fontStyle" :y="viewBoxHeight -
v-for="(i, j) in count" axisPadding +
:key="j + '-xlabels'" yLabelOffset +
:style="fontStyle" fontStyle.fontSize / 2 -
:y=" bottom
viewBoxHeight - " :x="xs[i - 1]" text-anchor="middle">
axisPadding +
yLabelOffset +
fontStyle.fontSize / 2 -
bottom
"
:x="xs[i - 1]"
text-anchor="middle"
>
{{ j % skipXLabel === 0 ? formatX(xLabels[i - 1] || '') : '' }} {{ j % skipXLabel === 0 ? formatX(xLabels[i - 1] || '') : '' }}
</text> </text>
</template> </template>
<!-- y Labels --> <!-- y Labels -->
<template v-if="yLabelDivisions > 0"> <template v-if="yLabelDivisions > 0">
<text <text v-for="(i, j) in yLabelDivisions + 1" :key="j + '-ylabels'" :style="fontStyle" :y="yScalerLocation(i - 1)"
v-for="(i, j) in yLabelDivisions + 1" :x="axisPadding - xLabelOffset + left" text-anchor="end">
:key="j + '-ylabels'"
:style="fontStyle"
:y="yScalerLocation(i - 1)"
:x="axisPadding - xLabelOffset + left"
text-anchor="end"
>
{{ yScalerValue(i - 1) }} {{ yScalerValue(i - 1) }}
</text> </text>
</template> </template>
@ -73,54 +37,21 @@
<rect x="0" y="0" :width="viewBoxWidth" :height="z" /> <rect x="0" y="0" :width="viewBoxWidth" :height="z" />
</clipPath> </clipPath>
<clipPath id="negative-rect-clip"> <clipPath id="negative-rect-clip">
<rect <rect x="0" :y="z" :width="viewBoxWidth" :height="viewBoxHeight - z" />
x="0"
:y="z"
:width="viewBoxWidth"
:height="viewBoxHeight - z"
/>
</clipPath> </clipPath>
</defs> </defs>
<rect <rect v-for="(rec, i) in positiveRects" :key="i + 'prec'" :rx="radius" :ry="radius" :x="rec.x" :y="rec.y"
v-for="(rec, i) in positiveRects" :width="width" :height="rec.height" :fill="rec.color" clip-path="url(#positive-rect-clip)"
:key="i + 'prec'" @mouseenter="() => create(rec.xi, rec.yi)" @mousemove="update" @mouseleave="destroy" />
:rx="radius"
:ry="radius"
:x="rec.x"
:y="rec.y"
:width="width"
:height="rec.height"
:fill="rec.color"
clip-path="url(#positive-rect-clip)"
@mouseenter="() => create(rec.xi, rec.yi)"
@mousemove="update"
@mouseleave="destroy"
/>
<rect <rect v-for="(rec, i) in negativeRects" :key="i + 'nrec'" :rx="radius" :ry="radius" :x="rec.x" :y="rec.y"
v-for="(rec, i) in negativeRects" :width="width" :height="rec.height" :fill="rec.color" clip-path="url(#negative-rect-clip)"
:key="i + 'nrec'" @mouseenter="() => create(rec.xi, rec.yi)" @mousemove="update" @mouseleave="destroy" />
:rx="radius"
:ry="radius"
:x="rec.x"
:y="rec.y"
:width="width"
:height="rec.height"
:fill="rec.color"
clip-path="url(#negative-rect-clip)"
@mouseenter="() => create(rec.xi, rec.yi)"
@mousemove="update"
@mouseleave="destroy"
/>
</svg> </svg>
<Tooltip <Tooltip ref="tooltip" :offset="15" placement="top"
ref="tooltip"
:offset="15"
placement="top"
class="text-sm shadow-md px-2 py-1 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-200 border-s-4" class="text-sm shadow-md px-2 py-1 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-200 border-s-4"
:style="{ borderColor: activeColor }" :style="{ borderColor: activeColor }">
>
<div class="flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center">
<p> <p>
{{ xi > -1 ? formatX(xLabels[xi]) : '' }} {{ xi > -1 ? formatX(xLabels[xi]) : '' }}
@ -196,7 +127,7 @@ export default {
this.padding + this.padding +
this.left + this.left +
(i * (this.viewBoxWidth - this.left - 2 * this.padding)) / (i * (this.viewBoxWidth - this.left - 2 * this.padding)) /
(this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0 (this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0
); );
}, },
z() { z() {
@ -215,9 +146,8 @@ export default {
return Math.max(...this.points.flat()); return Math.max(...this.points.flat());
}, },
axis() { axis() {
return `M ${this.axisPadding + this.left} ${this.axisPadding} V ${ return `M ${this.axisPadding + this.left} ${this.axisPadding} V ${this.viewBoxHeight - this.axisPadding - this.bottom
this.viewBoxHeight - this.axisPadding - this.bottom } H ${this.viewBoxWidth - this.axisPadding}`;
} H ${this.viewBoxWidth - this.axisPadding}`;
}, },
padding() { padding() {
return this.axisPadding + this.pointsPadding; return this.axisPadding + this.pointsPadding;
@ -305,7 +235,7 @@ export default {
return ( return (
((this.yLabelDivisions - i) * ((this.yLabelDivisions - i) *
(this.viewBoxHeight - this.padding * 2 - this.bottom)) / (this.viewBoxHeight - this.padding * 2 - this.bottom)) /
this.yLabelDivisions + this.yLabelDivisions +
this.padding this.padding
); );
}, },

View File

@ -1,60 +1,30 @@
<template> <template>
<div> <div>
<svg <svg ref="chartSvg" :viewBox="`0 0 ${viewBoxWidth} ${viewBoxHeight}`" xmlns="http://www.w3.org/2000/svg"
ref="chartSvg" @mousemove="update">
:viewBox="`0 0 ${viewBoxWidth} ${viewBoxHeight}`"
xmlns="http://www.w3.org/2000/svg"
@mousemove="update"
>
<!-- x Grid Lines --> <!-- x Grid Lines -->
<path <path v-if="drawXGrid" :d="xGrid" :stroke="gridColor" :stroke-width="gridThickness" stroke-linecap="round"
v-if="drawXGrid" fill="transparent" />
:d="xGrid"
:stroke="gridColor"
:stroke-width="gridThickness"
stroke-linecap="round"
fill="transparent"
/>
<!-- Axis --> <!-- Axis -->
<path <path v-if="drawAxis" :d="axis" :stroke-width="axisThickness" :stroke="axisColor" fill="transparent" />
v-if="drawAxis"
:d="axis"
:stroke-width="axisThickness"
:stroke="axisColor"
fill="transparent"
/>
<!-- x Labels --> <!-- x Labels -->
<template v-if="drawLabels && xLabels.length > 0"> <template v-if="drawLabels && xLabels.length > 0">
<text <text v-for="(i, j) in count" :key="j + '-xlabels'" :style="fontStyle" :y="viewBoxHeight -
v-for="(i, j) in count" axisPadding +
:key="j + '-xlabels'" yLabelOffset +
:style="fontStyle" fontStyle.fontSize / 2 -
:y=" bottom
viewBoxHeight - " :x="xs[i - 1]" text-anchor="middle">
axisPadding +
yLabelOffset +
fontStyle.fontSize / 2 -
bottom
"
:x="xs[i - 1]"
text-anchor="middle"
>
{{ formatX(xLabels[i - 1] || '') }} {{ formatX(xLabels[i - 1] || '') }}
</text> </text>
</template> </template>
<!-- y Labels --> <!-- y Labels -->
<template v-if="drawLabels && yLabelDivisions > 0"> <template v-if="drawLabels && yLabelDivisions > 0">
<text <text v-for="(i, j) in yLabelDivisions + 1" :key="j + '-ylabels'" :style="fontStyle" :y="yScalerLocation(i - 1)"
v-for="(i, j) in yLabelDivisions + 1" :x="axisPadding - xLabelOffset + left" text-anchor="end">
:key="j + '-ylabels'"
:style="fontStyle"
:y="yScalerLocation(i - 1)"
:x="axisPadding - xLabelOffset + left"
text-anchor="end"
>
{{ yScalerValue(i - 1) }} {{ yScalerValue(i - 1) }}
</text> </text>
</template> </template>
@ -68,58 +38,28 @@
</linearGradient> </linearGradient>
<mask v-for="(i, j) in num" :id="'rect-mask-' + i" :key="j + '-mask'"> <mask v-for="(i, j) in num" :id="'rect-mask-' + i" :key="j + '-mask'">
<rect <rect x="0" :y="gradY(j)" :height="viewBoxHeight - gradY(j)" width="100%" fill="url('#grad')" />
x="0"
:y="gradY(j)"
:height="viewBoxHeight - gradY(j)"
width="100%"
fill="url('#grad')"
/>
</mask> </mask>
</defs> </defs>
<g v-for="(i, j) in num" :key="j + '-gpath'"> <g v-for="(i, j) in num" :key="j + '-gpath'">
<!-- Gradient Paths --> <!-- Gradient Paths -->
<path <path stroke-linejoin="round" :d="getGradLine(i - 1)" :stroke-width="thickness" stroke-linecap="round"
stroke-linejoin="round" :fill="colors[i - 1] || getRandomColor()" :mask="`url('#rect-mask-${i}')`" />
:d="getGradLine(i - 1)"
:stroke-width="thickness"
stroke-linecap="round"
:fill="colors[i - 1] || getRandomColor()"
:mask="`url('#rect-mask-${i}')`"
/>
<!-- Lines --> <!-- Lines -->
<path <path stroke-linejoin="round" :d="getLine(i - 1)" :stroke="colors[i - 1] || getRandomColor()"
stroke-linejoin="round" :stroke-width="thickness" stroke-linecap="round" fill="transparent" />
:d="getLine(i - 1)"
:stroke="colors[i - 1] || getRandomColor()"
:stroke-width="thickness"
stroke-linecap="round"
fill="transparent"
/>
</g> </g>
<!-- Tooltip Reference --> <!-- Tooltip Reference -->
<circle <circle v-if="xi > -1 && yi > -1" r="12" :cx="cx" :cy="cy" :fill="colors[yi]" style="
v-if="xi > -1 && yi > -1"
r="12"
:cx="cx"
:cy="cy"
:fill="colors[yi]"
style="
filter: brightness(115%) drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.25)); filter: brightness(115%) drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.25));
" " />
/>
</svg> </svg>
<Tooltip <Tooltip v-if="showTooltip" ref="tooltip" :offset="15" placement="top"
v-if="showTooltip"
ref="tooltip"
:offset="15"
placement="top"
class="text-sm shadow-md px-2 py-1 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-200 border-s-4" class="text-sm shadow-md px-2 py-1 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-200 border-s-4"
:style="{ borderColor: colors[yi] }" :style="{ borderColor: colors[yi] }">
>
<div class="flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center">
<p> <p>
{{ xi > -1 ? formatX(xLabels[xi]) : '' }} {{ xi > -1 ? formatX(xLabels[xi]) : '' }}
@ -193,7 +133,7 @@ export default {
this.padding + this.padding +
this.left + this.left +
(i * (this.viewBoxWidth - this.left - 2 * this.padding)) / (i * (this.viewBoxWidth - this.left - 2 * this.padding)) /
(this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0 (this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0
); );
}, },
ys() { ys() {
@ -204,7 +144,7 @@ export default {
(p) => (p) =>
this.padding + this.padding +
(1 - (p - min) / (max - min)) * (1 - (p - min) / (max - min)) *
(this.viewBoxHeight - 2 * this.padding - this.bottom) (this.viewBoxHeight - 2 * this.padding - this.bottom)
) )
); );
}, },
@ -218,9 +158,8 @@ export default {
return Math.max(...this.points.flat()); return Math.max(...this.points.flat());
}, },
axis() { axis() {
return `M ${this.axisPadding + this.left} ${this.axisPadding} V ${ return `M ${this.axisPadding + this.left} ${this.axisPadding} V ${this.viewBoxHeight - this.axisPadding - this.bottom
this.viewBoxHeight - this.axisPadding - this.bottom } H ${this.viewBoxWidth - this.axisPadding}`;
} H ${this.viewBoxWidth - this.axisPadding}`;
}, },
padding() { padding() {
return this.axisPadding + this.pointsPadding; return this.axisPadding + this.pointsPadding;
@ -261,7 +200,7 @@ export default {
return ( return (
((this.yLabelDivisions - i) * ((this.yLabelDivisions - i) *
(this.viewBoxHeight - this.padding * 2 - this.bottom)) / (this.viewBoxHeight - this.padding * 2 - this.bottom)) /
this.yLabelDivisions + this.yLabelDivisions +
this.padding this.padding
); );
}, },

View File

@ -1,48 +1,26 @@
<template> <template>
<div <div class="relative bg-white dark:bg-gray-900 border dark:border-gray-800 flex-center overflow-hidden group" :class="{
class="relative bg-white dark:bg-gray-900 border dark:border-gray-800 flex-center overflow-hidden group" rounded: size === 'form',
:class="{ 'w-20 h-20 rounded-full': size !== 'small' && size !== 'form',
rounded: size === 'form', 'w-12 h-12 rounded-full': size === 'small',
'w-20 h-20 rounded-full': size !== 'small' && size !== 'form', }" :title="df?.label" :style="imageSizeStyle">
'w-12 h-12 rounded-full': size === 'small',
}"
:title="df?.label"
:style="imageSizeStyle"
>
<img v-if="value" :src="value" /> <img v-if="value" :src="value" />
<div v-else :class="[!isReadOnly ? 'group-hover:opacity-90' : '']"> <div v-else :class="[!isReadOnly ? 'group-hover:opacity-90' : '']">
<div <div v-if="letterPlaceholder"
v-if="letterPlaceholder" class="flex h-full items-center justify-center text-gray-400 dark:text-gray-600 font-semibold w-full text-4xl select-none">
class="flex h-full items-center justify-center text-gray-400 dark:text-gray-600 font-semibold w-full text-4xl select-none"
>
{{ letterPlaceholder }} {{ letterPlaceholder }}
</div> </div>
<svg <svg v-else class="w-6 h-6 text-gray-300 dark:text-gray-600" viewBox="0 0 24 21"
v-else xmlns="http://www.w3.org/2000/svg">
class="w-6 h-6 text-gray-300 dark:text-gray-600"
viewBox="0 0 24 21"
xmlns="http://www.w3.org/2000/svg"
>
<path <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" 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="currentColor" fill="currentColor" fill-rule="nonzero" />
fill-rule="nonzero"
/>
</svg> </svg>
</div> </div>
<div <div class="hidden w-full h-full absolute justify-center items-end" :class="[!isReadOnly ? 'group-hover:flex' : '']"
class="hidden w-full h-full absolute justify-center items-end" style="background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(2px)">
:class="[!isReadOnly ? 'group-hover:flex' : '']" <button class="bg-gray-100 dark:bg-gray-800 p-0.5 rounded mb-1" @click="handleClick">
style="background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(2px)" <FeatherIcon :name="shouldClear ? 'x' : 'upload'" class="w-4 h-4 text-gray-600 dark:text-gray-400" />
>
<button
class="bg-gray-100 dark:bg-gray-800 p-0.5 rounded mb-1"
@click="handleClick"
>
<FeatherIcon
:name="shouldClear ? 'x' : 'upload'"
class="w-4 h-4 text-gray-600 dark:text-gray-400"
/>
</button> </button>
</div> </div>
</div> </div>

View File

@ -34,7 +34,20 @@
class="flex items-center justify-between text-base gap-2" class="flex items-center justify-between text-base gap-2"
> >
<div <div
class="cursor-pointer w-4 h-4 flex items-center justify-center text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-300 rounded-md group" class="
cursor-pointer
w-4
h-4
flex
items-center
justify-center
text-gray-600
dark:text-gray-400
hover:text-gray-800
dark:hover:text-gray-300
rounded-md
group
"
> >
<span class="hidden group-hover:inline-block"> <span class="hidden group-hover:inline-block">
<feather-icon <feather-icon
@ -99,7 +112,19 @@
</template> </template>
</div> </div>
<div <div
class="text-base border-t dark:border-gray-800 p-2 flex items-center text-gray-600 dark:text-gray-500 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-875" class="
text-base
border-t
dark:border-gray-800
p-2
flex
items-center
text-gray-600
dark:text-gray-500
cursor-pointer
hover:bg-gray-100
dark:hover:bg-gray-875
"
@click="addNewFilter" @click="addNewFilter"
> >
<feather-icon name="plus" class="w-4 h-4" /> <feather-icon name="plus" class="w-4 h-4" />
@ -133,7 +158,7 @@ const conditions = [
{ label: t`Is Not Empty`, value: 'is not null' }, { label: t`Is Not Empty`, value: 'is not null' },
] as const; ] as const;
type Condition = (typeof conditions)[number]['value']; type Condition = typeof conditions[number]['value'];
type Filter = { type Filter = {
fieldname: string; fieldname: string;

View File

@ -6,7 +6,16 @@
@click="$emit('closemodal')" @click="$emit('closemodal')"
> >
<div <div
class="bg-white dark:bg-gray-850 rounded-lg shadow-2xl border dark:border-gray-800 overflow-hidden inner" class="
bg-white
dark:bg-gray-850
rounded-lg
shadow-2xl
border
dark:border-gray-800
overflow-hidden
inner
"
v-bind="$attrs" v-bind="$attrs"
@click.stop @click.stop
> >

View File

@ -1,29 +1,18 @@
<template> <template>
<div <div class="px-4 flex justify-between items-center h-row-largest flex-shrink-0 dark:bg-gray-875" :class="[
class="px-4 flex justify-between items-center h-row-largest flex-shrink-0 dark:bg-gray-875" border ? 'border-b dark:border-gray-800' : '',
:class="[ platform !== 'Windows' ? 'window-drag' : '',
border ? 'border-b dark:border-gray-800' : '', ]">
platform !== 'Windows' ? 'window-drag' : '',
]"
>
<Transition name="spacer"> <Transition name="spacer">
<div <div v-if="!showSidebar && platform === 'Mac' && languageDirection !== 'rtl'" class="h-full"
v-if="!showSidebar && platform === 'Mac' && languageDirection !== 'rtl'" :class="spacerClass" />
class="h-full"
:class="spacerClass"
/>
</Transition> </Transition>
<div <div class="flex items-center window-no-drag gap-4 me-auto"
class="flex items-center window-no-drag gap-4 me-auto" :class="platform === 'Mac' && languageDirection === 'rtl' ? 'me-18' : ''">
:class="platform === 'Mac' && languageDirection === 'rtl' ? 'me-18' : ''"
>
<!-- Nav Group --> <!-- Nav Group -->
<PageHeaderNavGroup /> <PageHeaderNavGroup />
<h1 <h1 v-if="title" class="text-xl font-semibold select-none whitespace-nowrap dark:text-white">
v-if="title"
class="text-xl font-semibold select-none whitespace-nowrap dark:text-white"
>
{{ title }} {{ title }}
</h1> </h1>
@ -34,10 +23,8 @@
</div> </div>
<!-- Right (regular) Slot --> <!-- Right (regular) Slot -->
<div <div class="flex items-stretch window-no-drag gap-2 ms-auto"
class="flex items-stretch window-no-drag gap-2 ms-auto" :class="platform === 'Mac' && languageDirection === 'rtl' ? 'me-18' : ''">
:class="platform === 'Mac' && languageDirection === 'rtl' ? 'me-18' : ''"
>
<slot /> <slot />
</div> </div>
</div> </div>

View File

@ -4,7 +4,11 @@
<!-- Back Button --> <!-- Back Button -->
<a <a
ref="backlink" ref="backlink"
class="nav-link border-l border-r border-white dark:border-gray-850 dark:bg-gray-900" class="
nav-link
border-l border-r border-white
dark:border-gray-850 dark:bg-gray-900
"
:class=" :class="
historyState.back historyState.back
? 'text-gray-700 dark:text-gray-300 cursor-pointer' ? 'text-gray-700 dark:text-gray-300 cursor-pointer'

View File

@ -1,6 +1,13 @@
<template> <template>
<div <div
class="grid grid-cols-3 text-gray-800 dark:text-gray-100 text-sm select-none items-center" class="
grid grid-cols-3
text-gray-800
dark:text-gray-100
text-sm
select-none
items-center
"
style="height: 50px" style="height: 50px"
> >
<!-- Length Display --> <!-- Length Display -->
@ -25,7 +32,14 @@
<div class="flex gap-1 bg-gray-100 dark:bg-gray-890 rounded"> <div class="flex gap-1 bg-gray-100 dark:bg-gray-890 rounded">
<input <input
type="number" type="number"
class="w-7 text-end outline-none bg-transparent focus:text-gray-900 dark:focus:text-gray-25" class="
w-7
text-end
outline-none
bg-transparent
focus:text-gray-900
dark:focus:text-gray-25
"
:value="pageNo" :value="pageNo"
min="1" min="1"
:max="maxPages" :max="maxPages"
@ -52,7 +66,13 @@
<!-- Count Selector --> <!-- Count Selector -->
<div <div
v-if="filteredCounts.length" v-if="filteredCounts.length"
class="border border-gray-100 dark:border-gray-800 rounded flex justify-self-end" class="
border border-gray-100
dark:border-gray-800
rounded
flex
justify-self-end
"
> >
<template v-for="c in filteredCounts" :key="c + '-count'"> <template v-for="c in filteredCounts" :key="c + '-count'">
<button <button

View File

@ -12,7 +12,17 @@
v-show="isOpen" v-show="isOpen"
ref="popover" ref="popover"
:class="popoverClass" :class="popoverClass"
class="bg-white dark:bg-gray-850 rounded-md border dark:border-gray-875 shadow-lg popover-container relative z-10" class="
bg-white
dark:bg-gray-850
rounded-md
border
dark:border-gray-875
shadow-lg
popover-container
relative
z-10
"
:style="{ 'transition-delay': `${isOpen ? entryDelay : exitDelay}ms` }" :style="{ 'transition-delay': `${isOpen ? entryDelay : exitDelay}ms` }"
> >
<slot name="content" :toggle-popover="togglePopover"></slot> <slot name="content" :toggle-popover="togglePopover"></slot>

View File

@ -9,7 +9,20 @@
}" }"
> >
<div <div
class="text-sm flex focus:outline-none hover:text-gray-800 dark:hover:text-gray-100 focus:text-gray-800 dark:focus:text-gray-100 items-center py-1 rounded-md leading-relaxed cursor-pointer" class="
text-sm
flex
focus:outline-none
hover:text-gray-800
dark:hover:text-gray-100
focus:text-gray-800
dark:focus:text-gray-100
items-center
py-1
rounded-md
leading-relaxed
cursor-pointer
"
:class=" :class="
!value !value
? 'text-gray-600 dark:text-gray-500' ? 'text-gray-600 dark:text-gray-500'

View File

@ -7,7 +7,16 @@
}" }"
> >
<div <div
class="w-full w-form shadow-lg rounded-lg border dark:border-gray-800 relative bg-white dark:bg-gray-875" class="
w-full w-form
shadow-lg
rounded-lg
border
dark:border-gray-800
relative
bg-white
dark:bg-gray-875
"
style="height: 700px" style="height: 700px"
> >
<!-- Welcome to Frappe Books --> <!-- Welcome to Frappe Books -->
@ -22,17 +31,24 @@
</p> </p>
</div> </div>
<hr class="dark:border-gray-800"/> <hr class="dark:border-gray-800" />
<!-- New File (Blue Icon) --> <!-- New File (Blue Icon) -->
<div <div
data-testid="create-new-file" data-testid="create-new-file"
class="px-4 h-row-largest flex flex-row items-center gap-4 p-2" class="px-4 h-row-largest flex flex-row items-center gap-4 p-2"
:class="creatingDemo ? '' : 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'" :class="
creatingDemo
? ''
: 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'
"
@click="newDatabase" @click="newDatabase"
> >
<div class="w-8 h-8 rounded-full bg-blue-500 relative flex-center"> <div class="w-8 h-8 rounded-full bg-blue-500 relative flex-center">
<feather-icon name="plus" class="text-white dark:text-gray-900 w-5 h-5" /> <feather-icon
name="plus"
class="text-white dark:text-gray-900 w-5 h-5"
/>
</div> </div>
<div> <div>
@ -48,11 +64,28 @@
<!-- Existing File (Green Icon) --> <!-- Existing File (Green Icon) -->
<div <div
class="px-4 h-row-largest flex flex-row items-center gap-4 p-2" class="px-4 h-row-largest flex flex-row items-center gap-4 p-2"
:class="creatingDemo ? '' : 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'" :class="
creatingDemo
? ''
: 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'
"
@click="existingDatabase" @click="existingDatabase"
> >
<div class="w-8 h-8 rounded-full bg-green-500 dark:bg-green-600 relative flex-center"> <div
<feather-icon name="upload" class="w-4 h-4 text-white dark:text-gray-900" /> class="
w-8
h-8
rounded-full
bg-green-500
dark:bg-green-600
relative
flex-center
"
>
<feather-icon
name="upload"
class="w-4 h-4 text-white dark:text-gray-900"
/>
</div> </div>
<div> <div>
<p class="font-medium dark:text-gray-200"> <p class="font-medium dark:text-gray-200">
@ -68,10 +101,24 @@
<div <div
v-if="!files?.length" v-if="!files?.length"
class="px-4 h-row-largest flex flex-row items-center gap-4 p-2" class="px-4 h-row-largest flex flex-row items-center gap-4 p-2"
:class="creatingDemo ? '' : 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'" :class="
creatingDemo
? ''
: 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'
"
@click="createDemo" @click="createDemo"
> >
<div class="w-8 h-8 rounded-full bg-pink-500 dark:bg-pink-600 relative flex-center"> <div
class="
w-8
h-8
rounded-full
bg-pink-500
dark:bg-pink-600
relative
flex-center
"
>
<feather-icon name="monitor" class="w-4 h-4 text-white" /> <feather-icon name="monitor" class="w-4 h-4 text-white" />
</div> </div>
<div> <div>
@ -83,7 +130,7 @@
</p> </p>
</div> </div>
</div> </div>
<hr class="dark:border-gray-800"/> <hr class="dark:border-gray-800" />
<!-- File List --> <!-- File List -->
<div class="overflow-y-auto" style="max-height: 340px"> <div class="overflow-y-auto" style="max-height: 340px">
@ -91,7 +138,11 @@
v-for="(file, i) in files" v-for="(file, i) in files"
:key="file.dbPath" :key="file.dbPath"
class="h-row-largest px-4 flex gap-4 items-center" class="h-row-largest px-4 flex gap-4 items-center"
:class="creatingDemo ? '' : 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'" :class="
creatingDemo
? ''
: 'hover:bg-gray-50 dark:hover:bg-gray-890 cursor-pointer'
"
:title="t`${file.companyName} stored at ${file.dbPath}`" :title="t`${file.companyName} stored at ${file.dbPath}`"
@click="selectFile(file)" @click="selectFile(file)"
> >
@ -103,7 +154,8 @@
flex flex
justify-center justify-center
items-center items-center
bg-gray-200 dark:bg-gray-800 bg-gray-200
dark:bg-gray-800
text-gray-500 text-gray-500
font-semibold font-semibold
flex-shrink-0 flex-shrink-0
@ -117,13 +169,20 @@
<h2 class="font-medium dark:text-gray-200"> <h2 class="font-medium dark:text-gray-200">
{{ file.companyName }} {{ file.companyName }}
</h2> </h2>
<p class="whitespace-nowrap text-sm text-gray-600 dark:text-gray-400"> <p
class="
whitespace-nowrap
text-sm text-gray-600
dark:text-gray-400
"
>
{{ formatDate(file.modified) }} {{ formatDate(file.modified) }}
</p> </p>
</div> </div>
<p <p
class=" class="
text-sm text-gray-600 dark:text-gray-400 text-sm text-gray-600
dark:text-gray-400
overflow-x-auto overflow-x-auto
no-scrollbar no-scrollbar
whitespace-nowrap whitespace-nowrap
@ -136,12 +195,15 @@
class=" class="
ms-auto ms-auto
p-2 p-2
hover:bg-red-200 dark:hover:bg-red-900 dark:hover:bg-opacity-40 hover:bg-red-200
dark:hover:bg-red-900 dark:hover:bg-opacity-40
rounded-full rounded-full
w-8 w-8
h-8 h-8
text-gray-600 dark:text-gray-400 text-gray-600
hover:text-red-400 dark:hover:text-red-200 dark:text-gray-400
hover:text-red-400
dark:hover:text-red-200
" "
@click.stop="() => deleteDb(i)" @click.stop="() => deleteDb(i)"
> >
@ -149,7 +211,7 @@
</button> </button>
</div> </div>
</div> </div>
<hr v-if="files?.length" class="dark:border-gray-800"/> <hr v-if="files?.length" class="dark:border-gray-800" />
<!-- Language Selector --> <!-- Language Selector -->
<div <div
@ -160,7 +222,8 @@
items-center items-center
absolute absolute
p-4 p-4
text-gray-900 dark:text-gray-100 text-gray-900
dark:text-gray-100
" "
style="top: 100%; transform: translateY(-100%)" style="top: 100%; transform: translateY(-100%)"
> >
@ -169,8 +232,10 @@
v-if="files?.length" v-if="files?.length"
class=" class="
text-sm text-sm
bg-gray-100 dark:bg-gray-890 bg-gray-100
hover:bg-gray-200 dark:hover:bg-gray-900 dark:bg-gray-890
hover:bg-gray-200
dark:hover:bg-gray-900
rounded rounded
px-4 px-4
py-1.5 py-1.5
@ -205,14 +270,18 @@
creating the dummy instance. creating the dummy instance.
</p> </p>
<div class="flex my-12 justify-center items-baseline gap-4 text-base"> <div class="flex my-12 justify-center items-baseline gap-4 text-base">
<label for="basecount" class="text-gray-600 dark:text-gray-400">Base Count</label> <label for="basecount" class="text-gray-600 dark:text-gray-400"
>Base Count</label
>
<input <input
v-model="baseCount" v-model="baseCount"
type="number" type="number"
name="basecount" name="basecount"
class=" class="
bg-gray-100 dark:bg-gray-875 bg-gray-100
focus:bg-gray-200 dark:focus:bg-gray-890 dark:bg-gray-875
focus:bg-gray-200
dark:focus:bg-gray-890
rounded-md rounded-md
px-2 px-2
py-1 py-1

View File

@ -16,7 +16,14 @@
<div <div
v-for="(column, i) in columns" v-for="(column, i) in columns"
:key="column.label" :key="column.label"
class="overflow-x-auto no-scrollbar whitespace-nowrap h-row items-center flex" class="
overflow-x-auto
no-scrollbar
whitespace-nowrap
h-row
items-center
flex
"
:class="{ :class="{
'ms-auto': isNumeric(column.fieldtype), 'ms-auto': isNumeric(column.fieldtype),
'pe-4': i === columns.length - 1, 'pe-4': i === columns.length - 1,
@ -31,7 +38,11 @@
<!-- Data Rows --> <!-- Data Rows -->
<div <div
v-if="dataSlice.length !== 0" v-if="dataSlice.length !== 0"
class="overflow-y-auto dark:dark-scroll custom-scroll custom-scroll-thumb1" class="
overflow-y-auto
dark:dark-scroll
custom-scroll custom-scroll-thumb1
"
> >
<div v-for="(row, i) in dataSlice" :key="(row.name as string)"> <div v-for="(row, i) in dataSlice" :key="(row.name as string)">
<!-- Row Content --> <!-- Row Content -->
@ -41,7 +52,13 @@
</p> </p>
<Row <Row
gap="1rem" gap="1rem"
class="cursor-pointer text-gray-900 dark:text-gray-300 flex-1 h-row-mid" class="
cursor-pointer
text-gray-900
dark:text-gray-300
flex-1
h-row-mid
"
:column-count="columns.length" :column-count="columns.length"
@click="$emit('openDoc', row.name)" @click="$emit('openDoc', row.name)"
> >

View File

@ -40,11 +40,15 @@ export function getColorClass(
value = 300, value = 300,
darkvalue = 600 darkvalue = 600
) { ) {
return `${type}-${getValidColor(color)}-${value} dark:${type}-${getValidColor(color)}-${darkvalue}`; return `${type}-${getValidColor(color)}-${value} dark:${type}-${getValidColor(
color
)}-${darkvalue}`;
} }
export function getTextColorClass(color: string) { export function getTextColorClass(color: string) {
return `text-${getValidColor(color)}-700 dark:text-${getValidColor(color)}-200`; return `text-${getValidColor(color)}-700 dark:text-${getValidColor(
color
)}-200`;
} }
export function getBgTextColorClass(color: string) { export function getBgTextColorClass(color: string) {

View File

@ -15,7 +15,7 @@ export function setDarkMode(): void {
let darkMode = fyo.config.get('darkMode'); let darkMode = fyo.config.get('darkMode');
/* Fetching system theme */ /* Fetching system theme */
if (darkMode === undefined){ if (darkMode === undefined) {
darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
fyo.config.set('darkMode', darkMode); fyo.config.set('darkMode', darkMode);
} }

View File

@ -76,7 +76,7 @@ module.exports = {
'dark', 'dark',
], ],
display: ['group-hover'], display: ['group-hover'],
borderWidth:['last'], borderWidth: ['last'],
fontWeight: ['dark'], fontWeight: ['dark'],
}, },
plugins: [require('tailwindcss-rtl')], plugins: [require('tailwindcss-rtl')],