Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
volar committed Nov 20, 2023
1 parent 04869be commit d5d922f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
12 changes: 5 additions & 7 deletions src/components/file/AFileInput.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch, withModifiers } from 'vue'
import { onMounted, onUnmounted, ref, watch, withModifiers } from 'vue'
import { isBoolean, isUndefined } from '@/utils/common'
import AFileDropzone from '@/components/file/AFileDropzone.vue'
import type { InputFileChangeEvent } from '@/types/ChangeEvent'
Expand Down Expand Up @@ -56,15 +56,13 @@ const clickInput = () => {
const { checkFormatsAndSizes } = useFormatAndSizeCheck(props.accept, props.maxSizes)
const validateData = (files: File[]) => {
console.log('validateData')
if (!props.multiple && files.length > 0) {
console.log('emit1')
emit('filesInput', checkFormatsAndSizes([files[0]]))
const checked = checkFormatsAndSizes([files[0]])
emit('filesInput', checked)
return
}
console.log('emit2')
console.log(files)
emit('filesInput', checkFormatsAndSizes(files))
const checked = checkFormatsAndSizes(files)
emit('filesInput', checked)
}
const onDropzoneDrop = (files: File[]) => {
Expand Down
17 changes: 12 additions & 5 deletions src/components/image/AImageWidgetInner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const onDrop = (files: File[]) => {
}
const onFileInput = (files: File[]) => {
console.log('onFileInput', files)
// uploadQueuesStore.addByFiles(props.queueKey, props.licenceId, files)
uploadQueuesStore.addByFiles(props.queueKey, props.licenceId, files)
}
const { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(
Expand Down Expand Up @@ -179,7 +179,13 @@ const onAssetSelectConfirm = (data: AssetSelectReturnData) => {
:accept="uploadAccept"
:max-sizes="uploadSizes"
@files-input="onFileInput"
/>
>
<template #activator="{ props: fileInputProps }">
<VBtn v-bind="fileInputProps">
Upload
</VBtn>
</template>
</AFileInput>
</div>
<VBtn
variant="text"
Expand All @@ -197,6 +203,7 @@ const onAssetSelectConfirm = (data: AssetSelectReturnData) => {
v-model="clickMenuOpened"
activator="parent"
location="bottom right"
eager
>
<VCard>
<VList density="compact">
Expand All @@ -206,7 +213,7 @@ const onAssetSelectConfirm = (data: AssetSelectReturnData) => {
>
<VListItem-title>Update metadata</VListItem-title>
</VListItem>
<VListItem @click="actionLibrary">
<VListItem @click.stop="actionLibrary">
<VListItem-title>
<span v-if="imageLoaded">Replace from library</span>
<span v-else>Choose from library</span>
Expand All @@ -219,8 +226,8 @@ const onAssetSelectConfirm = (data: AssetSelectReturnData) => {
@files-input="onFileInput"
>
<template #activator="{ props: fileInputProps }">
<VListItem v-bind="fileInputProps">
Upload
<VListItem @click.stop="fileInputProps.onClick($event)">
Upload kravo
</VListItem>
</template>
</AFileInput>
Expand Down
1 change: 1 addition & 0 deletions src/playground/imageView/ImageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const imageId2 = ref<IntegerIdNullable>(null)
:ext-system="1"
queue-key="ahoj"
label="Lead image"
expand-options
/>
</VCol>
</VRow>
Expand Down

0 comments on commit d5d922f

Please sign in to comment.