{
if (file.is_trashed) {
return;
}
if (isModifiedClick(e)) {
if (!e.defaultPrevented && this.dispatchAction({ action: ActionType.Open, file })) {
e.stopPropagation();
e.preventDefault();
openUrl(file.download_url ?? file.external_url, "_blank");
}
} else {
!e.defaultPrevented && this.dispatchAction({ action: ActionType.Select, file });
}
}}
${highlight ? ref(autoScrollRef({ block: "center", behavior: "instant" })) : nothing}
>
|
${isRenaming
? html`
{
inputConsume(e);
handleRenameKey(e);
}}
@click=${(e: Event) => e.preventDefault()}
@focus=${handleSelectFilename}
${ref(autoFocusRef())}
/>
`
: html`${file.name}`}
|
${this.componentFeatures?.allowsFeature(Feature.Comments) && file.comments?.count
? html` {
if (!e.defaultPrevented && !file.is_trashed) {
(e.target as HTMLElement).blur();
this.dispatchAction({ action: ActionType.Comment, file });
e.stopPropagation();
}
}}
title=${msg(str`${file.comments.count} comments`)}
>
${file.comments.count}
`
: nothing} |
|
${file.kind} |
${fileSize} |
this.dispatchAction({ action: ActionType.Edit, file: e.detail.file })}
@edit-name=${(e: FileEditNameEventType) =>
this.dispatchAction({
action: ActionType.EditName,
file: e.detail.editName ? e.detail.file : null,
})}
@trash=${(e: FileTrashEventType) => this.dispatchAction({ action: ActionType.Trash, file: e.detail.file })}
@restore=${(e: FileRestoreEventType) =>
this.dispatchAction({ action: ActionType.Restore, file: e.detail.file })}
@delete-forever=${(e: FileDeleteForeverEventType) =>
this.dispatchAction({ action: ActionType.DeleteForever, file: e.detail.file })}
@subscribe=${(e: FileSubscribeEventType) =>
this.dispatchAction({
action: e.detail.subscribe ? ActionType.Subscribe : ActionType.Unsubscribe,
file: e.detail.file,
})}
>
|
`;
}
override render() {
const { data } = this.infiniteQueryResult || {};
const files = getFlatInfiniteResultData(data);
if (files && files.length) {
return this.renderFileTable.call(this, files, this.order, this.isRenamingId, this.highlightId);
}
return nothing;
}
}