|
|
|
@ -24,14 +24,14 @@
|
|
|
|
|
@keyup.esc.exact="resetSelection">
|
|
|
|
|
<NcLoadingIcon v-if="isLoading" />
|
|
|
|
|
<NcCheckboxRadioSwitch v-else
|
|
|
|
|
:aria-label="t('files', 'Select the row for {displayName}', { displayName })"
|
|
|
|
|
:aria-label="ariaLabel"
|
|
|
|
|
:checked="isSelected"
|
|
|
|
|
@update:checked="onSelectionChange" />
|
|
|
|
|
</td>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Node } from '@nextcloud/files'
|
|
|
|
|
import { Node, FileType } from '@nextcloud/files'
|
|
|
|
|
import { translate as t } from '@nextcloud/l10n'
|
|
|
|
|
import Vue, { PropType } from 'vue'
|
|
|
|
|
|
|
|
|
@ -51,10 +51,6 @@ export default Vue.extend({
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
|
displayName: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
fileid: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
@ -67,6 +63,10 @@ export default Vue.extend({
|
|
|
|
|
type: Array as PropType<Node[]>,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
source: {
|
|
|
|
|
type: Object as PropType<Node>,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
@ -88,6 +88,14 @@ export default Vue.extend({
|
|
|
|
|
index() {
|
|
|
|
|
return this.nodes.findIndex((node: Node) => node.fileid === parseInt(this.fileid))
|
|
|
|
|
},
|
|
|
|
|
isFile() {
|
|
|
|
|
return this.source.type === FileType.File
|
|
|
|
|
},
|
|
|
|
|
ariaLabel() {
|
|
|
|
|
return this.isFile
|
|
|
|
|
? t('files', 'Toggle selection for file "{displayName}"', { displayName: this.source.basename })
|
|
|
|
|
: t('files', 'Toggle selection for folder "{displayName}"', { displayName: this.source.basename })
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|