|
|
@ -168,7 +168,9 @@ const isExpanded = useVModel(props, 'modelValue', emits, { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const onClose = () => { |
|
|
|
const onClose = () => { |
|
|
|
if (changedColumns.value.size > 0) { |
|
|
|
if (!isUIAllowed('dataEdit')) { |
|
|
|
|
|
|
|
isExpanded.value = false |
|
|
|
|
|
|
|
} else if (changedColumns.value.size > 0) { |
|
|
|
isCloseModalOpen.value = true |
|
|
|
isCloseModalOpen.value = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (_row.value?.rowMeta?.new) emits('cancel') |
|
|
|
if (_row.value?.rowMeta?.new) emits('cancel') |
|
|
@ -457,7 +459,7 @@ const onIsExpandedUpdate = (v: boolean) => { |
|
|
|
|
|
|
|
|
|
|
|
if (changedColumns.value.size === 0 && !isUnsavedFormExist.value) { |
|
|
|
if (changedColumns.value.size === 0 && !isUnsavedFormExist.value) { |
|
|
|
isExpanded.value = v |
|
|
|
isExpanded.value = v |
|
|
|
} else if (!v) { |
|
|
|
} else if (!v && isUIAllowed('dataEdit')) { |
|
|
|
preventModalStatus.value = true |
|
|
|
preventModalStatus.value = true |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
isExpanded.value = v |
|
|
|
isExpanded.value = v |
|
|
@ -555,10 +557,11 @@ export default { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<div class="flex gap-2"> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
v-if="!isNew" |
|
|
|
v-if="!isNew && rowId" |
|
|
|
type="secondary" |
|
|
|
type="secondary" |
|
|
|
class="!xs:hidden text-gray-700" |
|
|
|
class="!xs:hidden text-gray-700" |
|
|
|
@click="!isNew ? copyRecordUrl() : () => {}" |
|
|
|
:disabled="isLoading" |
|
|
|
|
|
|
|
@click="copyRecordUrl()" |
|
|
|
> |
|
|
|
> |
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
<component :is="iconMap.check" v-if="isRecordLinkCopied" class="cursor-pointer nc-duplicate-row" /> |
|
|
|
<component :is="iconMap.check" v-if="isRecordLinkCopied" class="cursor-pointer nc-duplicate-row" /> |
|
|
@ -567,28 +570,18 @@ export default { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<NcDropdown v-if="!isNew" placement="bottomRight"> |
|
|
|
<NcDropdown v-if="!isNew" placement="bottomRight"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10" :disabled="isLoading"> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md text-gray-700" /> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md" :class="isLoading ? 'text-gray-300' : 'text-gray-700'" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu> |
|
|
|
<NcMenuItem v-if="!isNew" class="text-gray-700" @click="_loadRow()"> |
|
|
|
<NcMenuItem class="text-gray-700" @click="_loadRow()"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
{{ $t('general.reload') }} |
|
|
|
{{ $t('general.reload') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcMenuItem v-if="!isNew && isMobileMode" class="text-gray-700" @click="!isNew ? copyRecordUrl() : () => {}"> |
|
|
|
<NcMenuItem v-if="isUIAllowed('dataEdit')" class="text-gray-700" @click="!isNew ? onDuplicateRow() : () => {}"> |
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
|
|
|
|
<component :is="iconMap.link" class="cursor-pointer nc-duplicate-row" /> |
|
|
|
|
|
|
|
{{ $t('labels.copyRecordURL') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
|
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
|
|
|
|
class="text-gray-700" |
|
|
|
|
|
|
|
@click="!isNew ? onDuplicateRow() : () => {}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
v-e="['c:row-expand:duplicate']" |
|
|
|
v-e="['c:row-expand:duplicate']" |
|
|
|
data-testid="nc-expanded-form-duplicate" |
|
|
|
data-testid="nc-expanded-form-duplicate" |
|
|
@ -600,9 +593,9 @@ export default { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
<NcDivider v-if="isUIAllowed('dataEdit') && !isNew" /> |
|
|
|
<NcDivider v-if="isUIAllowed('dataEdit')" /> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
v-if="isUIAllowed('dataEdit')" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
@click="!isNew && onDeleteRowClick()" |
|
|
|
@click="!isNew && onDeleteRowClick()" |
|
|
|
> |
|
|
|
> |
|
|
@ -808,17 +801,23 @@ export default { |
|
|
|
class="w-full h-16 border-t-1 border-gray-200 bg-white flex items-center justify-end p-3 xs:(p-0 mt-4 border-t-0 gap-x-4 justify-between)" |
|
|
|
class="w-full h-16 border-t-1 border-gray-200 bg-white flex items-center justify-end p-3 xs:(p-0 mt-4 border-t-0 gap-x-4 justify-between)" |
|
|
|
> |
|
|
|
> |
|
|
|
<NcDropdown v-if="!isNew && isMobileMode" placement="bottomRight"> |
|
|
|
<NcDropdown v-if="!isNew && isMobileMode" placement="bottomRight"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10"> |
|
|
|
<NcButton type="secondary" class="nc-expand-form-more-actions w-10" :disabled="isLoading"> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md text-gray-700" /> |
|
|
|
<GeneralIcon icon="threeDotVertical" class="text-md" :class="isLoading ? 'text-gray-300' : 'text-gray-700'" /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu> |
|
|
|
<NcMenuItem v-if="!isNew" class="text-gray-700" @click="_loadRow()"> |
|
|
|
<NcMenuItem class="text-gray-700" @click="_loadRow()"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<div v-e="['c:row-expand:reload']" class="flex gap-2 items-center" data-testid="nc-expanded-form-reload"> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
<component :is="iconMap.reload" class="cursor-pointer" /> |
|
|
|
{{ $t('general.reload') }} |
|
|
|
{{ $t('general.reload') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
<NcMenuItem v-if="rowId" class="text-gray-700" @click="!isNew ? copyRecordUrl() : () => {}"> |
|
|
|
|
|
|
|
<div v-e="['c:row-expand:copy-url']" data-testid="nc-expanded-form-copy-url" class="flex gap-2 items-center"> |
|
|
|
|
|
|
|
<component :is="iconMap.link" class="cursor-pointer nc-duplicate-row" /> |
|
|
|
|
|
|
|
{{ $t('labels.copyRecordURL') }} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</NcMenuItem> |
|
|
|
<NcDivider /> |
|
|
|
<NcDivider /> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|
v-if="isUIAllowed('dataEdit') && !isNew" |
|
|
|