mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Compare commits
3 Commits
dark-base-
...
dark-base-
| Author | SHA1 | Date | |
|---|---|---|---|
| b1e42cfe6a | |||
| 604aafe520 | |||
| ddd4ed77dc |
@ -16,15 +16,13 @@
|
|||||||
text-left
|
text-left
|
||||||
bg-white
|
bg-white
|
||||||
border border-gray-200
|
border border-gray-200
|
||||||
dark:border-gray-600
|
|
||||||
rounded-md
|
rounded-md
|
||||||
min-h-[200px]
|
min-h-[200px]
|
||||||
overflow-hidden
|
overflow-hidden
|
||||||
dark:bg-gray-700 dark:text-white
|
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div v-if="editor" class="editor-content">
|
<div v-if="editor" class="editor-content">
|
||||||
<div class="flex justify-end p-2 border-b border-gray-200 dark:border-gray-600 md:hidden">
|
<div class="flex justify-end p-2 border-b border-gray-200 md:hidden">
|
||||||
<BaseDropdown width-class="w-48">
|
<BaseDropdown width-class="w-48">
|
||||||
<template #activator>
|
<template #activator>
|
||||||
<div
|
<div
|
||||||
@ -44,7 +42,7 @@
|
|||||||
<dots-vertical-icon class="w-6 h-6 text-gray-600" />
|
<dots-vertical-icon class="w-6 h-6 text-gray-600" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="flex flex-wrap space-x-1 dark:text-white">
|
<div class="flex flex-wrap space-x-1">
|
||||||
<span
|
<span
|
||||||
class="
|
class="
|
||||||
flex
|
flex
|
||||||
@ -55,9 +53,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('bold') }"
|
:class="{ 'bg-gray-200': editor.isActive('bold') }"
|
||||||
@click="editor.chain().focus().toggleBold().run()"
|
@click="editor.chain().focus().toggleBold().run()"
|
||||||
>
|
>
|
||||||
<bold-icon class="h-3 cursor-pointer fill-current" />
|
<bold-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -72,9 +69,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('italic') }"
|
:class="{ 'bg-gray-200': editor.isActive('italic') }"
|
||||||
@click="editor.chain().focus().toggleItalic().run()"
|
@click="editor.chain().focus().toggleItalic().run()"
|
||||||
>
|
>
|
||||||
<italic-icon class="h-3 cursor-pointer fill-current" />
|
<italic-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -89,9 +85,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('strike') }"
|
:class="{ 'bg-gray-200': editor.isActive('strike') }"
|
||||||
@click="editor.chain().focus().toggleStrike().run()"
|
@click="editor.chain().focus().toggleStrike().run()"
|
||||||
>
|
>
|
||||||
<strikethrough-icon class="h-3 cursor-pointer fill-current" />
|
<strikethrough-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -106,9 +101,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('code') }"
|
:class="{ 'bg-gray-200': editor.isActive('code') }"
|
||||||
@click="editor.chain().focus().toggleCode().run()"
|
@click="editor.chain().focus().toggleCode().run()"
|
||||||
>
|
>
|
||||||
<coding-icon class="h-3 cursor-pointer fill-current" />
|
<coding-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -123,9 +117,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('paragraph') }"
|
:class="{ 'bg-gray-200': editor.isActive('paragraph') }"
|
||||||
@click="editor.chain().focus().setParagraph().run()"
|
@click="editor.chain().focus().setParagraph().run()"
|
||||||
>
|
>
|
||||||
<paragraph-icon class="h-3 cursor-pointer fill-current" />
|
<paragraph-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -140,10 +133,9 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 1 }),
|
'bg-gray-200': editor.isActive('heading', { level: 1 }),
|
||||||
}"
|
}"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 1 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 1 }).run()"
|
||||||
>
|
>
|
||||||
@ -159,10 +151,9 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 2 }),
|
'bg-gray-200': editor.isActive('heading', { level: 2 }),
|
||||||
}"
|
}"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 2 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 2 }).run()"
|
||||||
>
|
>
|
||||||
@ -178,10 +169,9 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 3 }),
|
'bg-gray-200': editor.isActive('heading', { level: 3 }),
|
||||||
}"
|
}"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 3 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 3 }).run()"
|
||||||
>
|
>
|
||||||
@ -198,9 +188,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('bulletList') }"
|
:class="{ 'bg-gray-200': editor.isActive('bulletList') }"
|
||||||
@click="editor.chain().focus().toggleBulletList().run()"
|
@click="editor.chain().focus().toggleBulletList().run()"
|
||||||
>
|
>
|
||||||
<list-ul-icon class="h-3 cursor-pointer fill-current" />
|
<list-ul-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -215,9 +204,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('orderedList') }"
|
:class="{ 'bg-gray-200': editor.isActive('orderedList') }"
|
||||||
@click="editor.chain().focus().toggleOrderedList().run()"
|
@click="editor.chain().focus().toggleOrderedList().run()"
|
||||||
>
|
>
|
||||||
<list-icon class="h-3 cursor-pointer fill-current" />
|
<list-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -232,9 +220,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('blockquote') }"
|
:class="{ 'bg-gray-200': editor.isActive('blockquote') }"
|
||||||
@click="editor.chain().focus().toggleBlockquote().run()"
|
@click="editor.chain().focus().toggleBlockquote().run()"
|
||||||
>
|
>
|
||||||
<quote-icon class="h-3 cursor-pointer fill-current" />
|
<quote-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -249,9 +236,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('codeBlock') }"
|
:class="{ 'bg-gray-200': editor.isActive('codeBlock') }"
|
||||||
@click="editor.chain().focus().toggleCodeBlock().run()"
|
@click="editor.chain().focus().toggleCodeBlock().run()"
|
||||||
>
|
>
|
||||||
<code-block-icon class="h-3 cursor-pointer fill-current" />
|
<code-block-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -266,9 +252,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('undo') }"
|
:class="{ 'bg-gray-200': editor.isActive('undo') }"
|
||||||
@click="editor.chain().focus().undo().run()"
|
@click="editor.chain().focus().undo().run()"
|
||||||
>
|
>
|
||||||
<undo-icon class="h-3 cursor-pointer fill-current" />
|
<undo-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -283,9 +268,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('redo') }"
|
:class="{ 'bg-gray-200': editor.isActive('redo') }"
|
||||||
@click="editor.chain().focus().redo().run()"
|
@click="editor.chain().focus().redo().run()"
|
||||||
>
|
>
|
||||||
<redo-icon class="h-3 cursor-pointer fill-current" />
|
<redo-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -293,7 +277,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</BaseDropdown>
|
</BaseDropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden p-2 border-b border-gray-200 dark:border-gray-600 md:flex">
|
<div class="hidden p-2 border-b border-gray-200 md:flex">
|
||||||
<div class="flex flex-wrap space-x-1">
|
<div class="flex flex-wrap space-x-1">
|
||||||
<span
|
<span
|
||||||
class="
|
class="
|
||||||
@ -305,9 +289,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('bold') }"
|
:class="{ 'bg-gray-200': editor.isActive('bold') }"
|
||||||
@click="editor.chain().focus().toggleBold().run()"
|
@click="editor.chain().focus().toggleBold().run()"
|
||||||
>
|
>
|
||||||
<bold-icon class="h-3 cursor-pointer fill-current" />
|
<bold-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -322,9 +305,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('italic') }"
|
:class="{ 'bg-gray-200': editor.isActive('italic') }"
|
||||||
@click="editor.chain().focus().toggleItalic().run()"
|
@click="editor.chain().focus().toggleItalic().run()"
|
||||||
>
|
>
|
||||||
<italic-icon class="h-3 cursor-pointer fill-current" />
|
<italic-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -339,9 +321,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('strike') }"
|
:class="{ 'bg-gray-200': editor.isActive('strike') }"
|
||||||
@click="editor.chain().focus().toggleStrike().run()"
|
@click="editor.chain().focus().toggleStrike().run()"
|
||||||
>
|
>
|
||||||
<strikethrough-icon class="h-3 cursor-pointer fill-current" />
|
<strikethrough-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -356,9 +337,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('code') }"
|
:class="{ 'bg-gray-200': editor.isActive('code') }"
|
||||||
@click="editor.chain().focus().toggleCode().run()"
|
@click="editor.chain().focus().toggleCode().run()"
|
||||||
>
|
>
|
||||||
<coding-icon class="h-3 cursor-pointer fill-current" />
|
<coding-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -373,9 +353,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('paragraph') }"
|
:class="{ 'bg-gray-200': editor.isActive('paragraph') }"
|
||||||
@click="editor.chain().focus().setParagraph().run()"
|
@click="editor.chain().focus().setParagraph().run()"
|
||||||
>
|
>
|
||||||
<paragraph-icon class="h-3 cursor-pointer fill-current" />
|
<paragraph-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -390,9 +369,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 1 }) }"
|
:class="{ 'bg-gray-200': editor.isActive('heading', { level: 1 }) }"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 1 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 1 }).run()"
|
||||||
>
|
>
|
||||||
H1
|
H1
|
||||||
@ -407,9 +385,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 2 }) }"
|
:class="{ 'bg-gray-200': editor.isActive('heading', { level: 2 }) }"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 2 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 2 }).run()"
|
||||||
>
|
>
|
||||||
H2
|
H2
|
||||||
@ -424,9 +401,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('heading', { level: 3 }) }"
|
:class="{ 'bg-gray-200': editor.isActive('heading', { level: 3 }) }"
|
||||||
@click="editor.chain().focus().toggleHeading({ level: 3 }).run()"
|
@click="editor.chain().focus().toggleHeading({ level: 3 }).run()"
|
||||||
>
|
>
|
||||||
H3
|
H3
|
||||||
@ -442,9 +418,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('bulletList') }"
|
:class="{ 'bg-gray-200': editor.isActive('bulletList') }"
|
||||||
@click="editor.chain().focus().toggleBulletList().run()"
|
@click="editor.chain().focus().toggleBulletList().run()"
|
||||||
>
|
>
|
||||||
<list-ul-icon class="h-3 cursor-pointer fill-current" />
|
<list-ul-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -459,9 +434,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('orderedList') }"
|
:class="{ 'bg-gray-200': editor.isActive('orderedList') }"
|
||||||
@click="editor.chain().focus().toggleOrderedList().run()"
|
@click="editor.chain().focus().toggleOrderedList().run()"
|
||||||
>
|
>
|
||||||
<list-icon class="h-3 cursor-pointer fill-current" />
|
<list-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -476,9 +450,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('blockquote') }"
|
:class="{ 'bg-gray-200': editor.isActive('blockquote') }"
|
||||||
@click="editor.chain().focus().toggleBlockquote().run()"
|
@click="editor.chain().focus().toggleBlockquote().run()"
|
||||||
>
|
>
|
||||||
<quote-icon class="h-3 cursor-pointer fill-current" />
|
<quote-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -493,9 +466,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('codeBlock') }"
|
:class="{ 'bg-gray-200': editor.isActive('codeBlock') }"
|
||||||
@click="editor.chain().focus().toggleCodeBlock().run()"
|
@click="editor.chain().focus().toggleCodeBlock().run()"
|
||||||
>
|
>
|
||||||
<code-block-icon class="h-3 cursor-pointer fill-current" />
|
<code-block-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -510,9 +482,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('undo') }"
|
:class="{ 'bg-gray-200': editor.isActive('undo') }"
|
||||||
@click="editor.chain().focus().undo().run()"
|
@click="editor.chain().focus().undo().run()"
|
||||||
>
|
>
|
||||||
<undo-icon class="h-3 cursor-pointer fill-current" />
|
<undo-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -527,9 +498,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive('redo') }"
|
:class="{ 'bg-gray-200': editor.isActive('redo') }"
|
||||||
@click="editor.chain().focus().redo().run()"
|
@click="editor.chain().focus().redo().run()"
|
||||||
>
|
>
|
||||||
<redo-icon class="h-3 cursor-pointer fill-current" />
|
<redo-icon class="h-3 cursor-pointer fill-current" />
|
||||||
@ -544,9 +514,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive({ textAlign: 'left' }) }"
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'left' }) }"
|
||||||
@click="editor.chain().focus().setTextAlign('left').run()"
|
@click="editor.chain().focus().setTextAlign('left').run()"
|
||||||
>
|
>
|
||||||
<menu-alt2-icon class="h-5 cursor-pointer fill-current" />
|
<menu-alt2-icon class="h-5 cursor-pointer fill-current" />
|
||||||
@ -561,9 +530,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive({ textAlign: 'right' }) }"
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'right' }) }"
|
||||||
@click="editor.chain().focus().setTextAlign('right').run()"
|
@click="editor.chain().focus().setTextAlign('right').run()"
|
||||||
>
|
>
|
||||||
<menu-alt3-icon class="h-5 cursor-pointer fill-current" />
|
<menu-alt3-icon class="h-5 cursor-pointer fill-current" />
|
||||||
@ -578,10 +546,9 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-gray-200 dark:bg-gray-900': editor.isActive({ textAlign: 'justify' }),
|
'bg-gray-200': editor.isActive({ textAlign: 'justify' }),
|
||||||
}"
|
}"
|
||||||
@click="editor.chain().focus().setTextAlign('justify').run()"
|
@click="editor.chain().focus().setTextAlign('justify').run()"
|
||||||
>
|
>
|
||||||
@ -597,9 +564,8 @@
|
|||||||
rounded-sm
|
rounded-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
hover:bg-gray-100
|
hover:bg-gray-100
|
||||||
dark:hover:bg-gray-800
|
|
||||||
"
|
"
|
||||||
:class="{ 'bg-gray-200 dark:bg-gray-900': editor.isActive({ textAlign: 'center' }) }"
|
:class="{ 'bg-gray-200': editor.isActive({ textAlign: 'center' }) }"
|
||||||
@click="editor.chain().focus().setTextAlign('center').run()"
|
@click="editor.chain().focus().setTextAlign('center').run()"
|
||||||
>
|
>
|
||||||
<menu-center-icon class="h-5 cursor-pointer fill-current" />
|
<menu-center-icon class="h-5 cursor-pointer fill-current" />
|
||||||
|
|||||||
@ -7,11 +7,18 @@
|
|||||||
relative
|
relative
|
||||||
overflow-hidden
|
overflow-hidden
|
||||||
bg-white
|
bg-white
|
||||||
border-b border-gray-200
|
border-b
|
||||||
|
border-gray-200
|
||||||
shadow
|
shadow
|
||||||
sm:rounded-lg
|
sm:rounded-lg
|
||||||
"
|
dark:shadow-glass
|
||||||
|
dark:border
|
||||||
|
dark:border-white/10
|
||||||
|
dark:bg-gray-800/70
|
||||||
|
"
|
||||||
>
|
>
|
||||||
|
<BaseDarkHighlight v-if="darkHighlight" class="z-[-1]" />
|
||||||
|
|
||||||
<slot name="header" />
|
<slot name="header" />
|
||||||
<table :class="tableClass">
|
<table :class="tableClass">
|
||||||
<thead :class="theadClass">
|
<thead :class="theadClass">
|
||||||
@ -51,7 +58,11 @@
|
|||||||
<tr
|
<tr
|
||||||
v-for="placeRow in placeholderCount"
|
v-for="placeRow in placeholderCount"
|
||||||
:key="placeRow"
|
:key="placeRow"
|
||||||
:class="placeRow % 2 === 0 ? 'bg-white' : 'bg-gray-50'"
|
:class="
|
||||||
|
placeRow % 2 === 0
|
||||||
|
? 'bg-white dark:bg-gray-800'
|
||||||
|
: 'bg-gray-50 dark:bg-gray-800'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
v-for="column in columns"
|
v-for="column in columns"
|
||||||
@ -75,7 +86,11 @@
|
|||||||
<tr
|
<tr
|
||||||
v-for="(row, index) in sortedRows"
|
v-for="(row, index) in sortedRows"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="index % 2 === 0 ? 'bg-white' : 'bg-gray-50'"
|
:class="
|
||||||
|
index % 2 === 0
|
||||||
|
? 'bg-white dark:bg-transparent'
|
||||||
|
: 'bg-gray-50 dark:bg-gray-700/20 dark:border-y dark:border-gray-600'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
v-for="column in columns"
|
v-for="column in columns"
|
||||||
@ -103,7 +118,10 @@
|
|||||||
justify-center
|
justify-center
|
||||||
w-full
|
w-full
|
||||||
h-full
|
h-full
|
||||||
bg-white bg-opacity-60
|
bg-white
|
||||||
|
bg-opacity-60
|
||||||
|
dark:bg-gray-700
|
||||||
|
dark:bg-opacity-60
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<SpinnerIcon class="w-10 h-10 text-primary-500" />
|
<SpinnerIcon class="w-10 h-10 text-primary-500" />
|
||||||
@ -163,9 +181,12 @@ const props = defineProps({
|
|||||||
sortOrder: { type: String, default: '' },
|
sortOrder: { type: String, default: '' },
|
||||||
tableClass: {
|
tableClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'min-w-full divide-y divide-gray-200',
|
default: 'min-w-full divide-y divide-gray-200 dark:divide-gray-600',
|
||||||
|
},
|
||||||
|
theadClass: {
|
||||||
|
type: String,
|
||||||
|
default: 'bg-gray-50 dark:bg-gray-800 dark:text-white',
|
||||||
},
|
},
|
||||||
theadClass: { type: String, default: 'bg-gray-50' },
|
|
||||||
tbodyClass: { type: String, default: '' },
|
tbodyClass: { type: String, default: '' },
|
||||||
noResultsMessage: {
|
noResultsMessage: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -186,6 +207,10 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 3,
|
default: 3,
|
||||||
},
|
},
|
||||||
|
darkHighlight: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
let rows = reactive([])
|
let rows = reactive([])
|
||||||
@ -236,7 +261,7 @@ function getColumn(columnName) {
|
|||||||
|
|
||||||
function getThClass(column) {
|
function getThClass(column) {
|
||||||
let classes =
|
let classes =
|
||||||
'whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider'
|
'whitespace-nowrap px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-white'
|
||||||
|
|
||||||
if (column.defaultThClass) {
|
if (column.defaultThClass) {
|
||||||
classes = column.defaultThClass
|
classes = column.defaultThClass
|
||||||
@ -256,7 +281,8 @@ function getThClass(column) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTdClass(column) {
|
function getTdClass(column) {
|
||||||
let classes = 'px-6 py-4 text-sm text-gray-500 whitespace-nowrap'
|
let classes =
|
||||||
|
'px-6 py-4 text-sm text-gray-500 whitespace-nowrap dark:text-gray-300'
|
||||||
|
|
||||||
if (column.defaultTdClass) {
|
if (column.defaultTdClass) {
|
||||||
classes = column.defaultTdClass
|
classes = column.defaultTdClass
|
||||||
@ -309,6 +335,7 @@ function changeSorting(column) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!usesLocalData.value) {
|
if (!usesLocalData.value) {
|
||||||
|
if (pagination.value) pagination.value.currentPage = 1
|
||||||
mapDataToRows()
|
mapDataToRows()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,7 +353,9 @@ async function pageChange(page) {
|
|||||||
await mapDataToRows()
|
await mapDataToRows()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function refresh() {
|
async function refresh(isPreservePage = false) {
|
||||||
|
if (pagination.value && !isPreservePage) pagination.value.currentPage = 1
|
||||||
|
|
||||||
await mapDataToRows()
|
await mapDataToRows()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user