add document remove button

pull/150/merge^2
iozeey 2 years ago
parent 33a322d674
commit b65bf49da0

@ -30,7 +30,7 @@
:class="{ 'cursor-default ': !submittable, 'z-0 ': isActive && submittable, 'bg-opacity-100 ': (isActive || isValueSet) && submittable }" :class="{ 'cursor-default ': !submittable, 'z-0 ': isActive && submittable, 'bg-opacity-100 ': (isActive || isValueSet) && submittable }"
> >
<span <span
style="border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem" style="--tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem"
class="!text-2xl w-full h-full" class="!text-2xl w-full h-full"
v-text="showLocalText" v-text="showLocalText"
/> />
@ -44,7 +44,7 @@
:class="{ 'cursor-default ': !submittable, 'z-0 ': isActive && submittable, 'bg-opacity-100 ': (isActive || isValueSet) && submittable }" :class="{ 'cursor-default ': !submittable, 'z-0 ': isActive && submittable, 'bg-opacity-100 ': (isActive || isValueSet) && submittable }"
> >
<span <span
style="border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem" style="--tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem"
class="flex items-center px-0.5 w-full h-full" class="flex items-center px-0.5 w-full h-full"
> >
{{ getFormattedDate }} {{ getFormattedDate }}
@ -82,7 +82,7 @@
:class="{'cursor-default ': !submittable}" :class="{'cursor-default ': !submittable}"
> >
<span <span
style="border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem" style="--tw-bg-opacity: 1; --tw-border-opacity: 0.2; font-size: 1.4rem"
class="w-full h-full" class="w-full h-full"
> >
<component <component

@ -122,7 +122,7 @@
/> />
</div> </div>
<span class="flex items-center transition-all duration-75 group-hover:border border-base-content/20 border-dashed w-6 h-6 flex justify-center items-center rounded"> <span class="flex items-center transition-all duration-75 group-hover:border border-base-content/20 border-dashed w-6 h-6 flex justify-center items-center rounded">
<IconPlus <IconChevronDown
width="18" width="18"
height="18" height="18"
/> />
@ -185,7 +185,7 @@
</template> </template>
<script> <script>
import { IconUserPlus, IconTrashX, IconPlus, IconChevronUp } from '@tabler/icons-vue' import { IconUserPlus, IconTrashX, IconChevronDown, IconChevronUp } from '@tabler/icons-vue'
import Contenteditable from './contenteditable' import Contenteditable from './contenteditable'
import { v4 } from 'uuid' import { v4 } from 'uuid'
@ -194,9 +194,9 @@ export default {
components: { components: {
IconUserPlus, IconUserPlus,
Contenteditable, Contenteditable,
IconPlus,
IconTrashX, IconTrashX,
IconChevronUp IconChevronUp,
IconChevronDown
}, },
props: { props: {
showNewFields: { showNewFields: {

@ -8,9 +8,6 @@
class="rounded border" class="rounded border"
loading="lazy" loading="lazy"
> >
<div class="absolute bottom-0 left-0 bg-white text-gray-700 p-1">
{{ index + 1 }}
</div>
<div <div
class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1" class="group flex justify-end cursor-pointer top-0 bottom-0 left-0 right-0 absolute p-1"
@click="$emit('scroll-to', item, previewImage)" @click="$emit('scroll-to', item, previewImage)"
@ -45,15 +42,6 @@
<div <div
class="flex flex-col justify-between opacity-0 group-hover:opacity-100" class="flex flex-col justify-between opacity-0 group-hover:opacity-100"
> >
<div>
<button
class="btn border-base-200 bg-white text-base-content btn-xs rounded hover:text-base-100 hover:bg-red-500 hover:border-base-content w-full transition-colors"
style="width: 24px; height: 24px"
@click.stop="$emit('remove', item)"
>
&times;
</button>
</div>
<div <div
v-if="withArrows" v-if="withArrows"
class="flex flex-col space-y-1" class="flex flex-col space-y-1"
@ -111,10 +99,22 @@
width="22" width="22"
class="animate-spin" class="animate-spin"
/> />
<span v-if="isLoading"> Add blank page </span> <span v-if="isLoading"> Adding blank page </span>
<span v-else>Add blank page</span> <span v-else>Add blank page</span>
</button> </button>
<label
class="btn btn-outline w-full mt-2"
@click.stop="$emit('remove', item)"
>
<span class="flex items-center">
<IconFileOff
width="22"
/>
&nbsp;
del document </span>
</label>
<div class="flex pb-2 pt-1.5"> <div class="flex pb-2 pt-1.5">
<Contenteditable <Contenteditable
:model-value="item.name" :model-value="item.name"
@ -131,14 +131,15 @@
import Contenteditable from './contenteditable' import Contenteditable from './contenteditable'
import Upload from './upload' import Upload from './upload'
import ReplaceButton from './replace' import ReplaceButton from './replace'
import { IconInnerShadowTop } from '@tabler/icons-vue' import { IconInnerShadowTop, IconFileOff } from '@tabler/icons-vue'
export default { export default {
name: 'DocumentPreview', name: 'DocumentPreview',
components: { components: {
Contenteditable, Contenteditable,
ReplaceButton, ReplaceButton,
IconInnerShadowTop IconInnerShadowTop,
IconFileOff
}, },
props: { props: {
item: { item: {

Loading…
Cancel
Save