+
+
+ {{ $t("common.back") }}
+
+
+
+
+ {{ $t("ui.fileCard.usage.basic") }}
+
+
+
+
+
+
+ <template>
+ <FileCard :file="file" />
+ </template>
+
+ <script setup lang="ts">
+ import { FileCard } from "@dzangolab/vue3-ui";
+
+ import type { IFile } from "@dzangolab/vue3-ui";
+
+ const file = {
+ description: "This is a file",
+ downloadCount: 0,
+ id: 1,
+ lastDownloadedAt: Date.now(),
+ originalFileName: "file.png",
+ size: 4,
+ uploadedBy: { givenName: "Test", lastName: "user" },
+ uploadedAt: Date.now(),
+ } as IFile;
+ </script>
+
+
+
+
+
+
+ {{ $t("ui.fileCard.usage.messages") }}
+
+
+
+
+
+
+ <template>
+ <FileCard :file="file" :messages="messages" />
+ </template>
+
+ <script setup lang="ts">
+ import { FileCard } from "@dzangolab/vue3-ui";
+
+ import type { FileMessages, IFile } from "@dzangolab/vue3-ui";
+
+ const file = {
+ ...
+ } as IFile;
+
+ const messages = {
+ archiveAction: "Archive file",
+ archiveConfirmationHeader: "Confirm archive?",
+ archiveConfirmationMessage: "Are you sure to archive this file?",
+ deleteAction: "Delete file",
+ deleteConfirmationHeader: "Confirm delete?",
+ deleteConfirmationMessage: "Are you sure to delete this file?",
+ downloadAction: "Download file",
+ downloadCountHeader: "Download count:",
+ lastDownloadedAtHeader: "Last downloaded date:",
+ shareAction: "Share file",
+ uploadedAtHeader: "Uploaded date:",
+ uploadedByHeader: "Uploaded by:",
+ viewAction: "View file",
+ } as FileMessages;
+ </script>
+
+
+
+
+
+
+ {{ $t("ui.fileCard.usage.buttonProps") }}
+
+
+
+
+
+
+ <template>
+ <FileCard
+ :archive-button-props="archiveButtonProps"
+ :delete-button-props="deleteButtonProps"
+ :download-button-props="downloadButtonProps"
+ :file="file"
+ :share-button-props="shareButtonProps"
+ :view-button-props="viewButtonProps"
+ />
+ </template>
+
+ <script setup lang="ts">
+ import { FileCard } from "@dzangolab/vue3-ui";
+
+ import type { FileMessages, IFile } from "@dzangolab/vue3-ui";
+
+ const archiveButtonProps = {
+ severity: "warning",
+ size: "medium",
+ variant: "outlined",
+ };
+
+ const deleteButtonProps = {
+ severity: "danger",
+ size: "medium",
+ variant: "outlined",
+ };
+
+ const downloadButtonProps = {
+ severity: "primary",
+ size: "medium",
+ variant: "outlined",
+ };
+
+ const file = {
+ ...
+ } as IFile;
+
+ const shareButtonProps = {
+ severity: "alternate",
+ size: "medium",
+ variant: "outlined",
+ };
+
+ const viewButtonProps = {
+ severity: "secondary",
+ size: "medium",
+ variant: "outlined",
+ };
+
+
+
+
+
+
+ {{ $t("ui.fileCard.usage.visibilityDetail") }}
+
+
+
+
+
+
+ <template>
+ <FileCard
+ :action-buttons-visibility="{
+ archive: false,
+ delete: true,
+ download: true,
+ share: false,
+ view: true,
+ }"
+ :file="file"
+ :visibility-detail="{
+ actions: true,
+ description: false,
+ downloadCount: true,
+ lastDownloadedAt: false,
+ originalFileName: true,
+ size: false,
+ uploadedAt: true,
+ uploadedBy: true,
+ }"
+ />
+ </template>
+
+ <script setup lang="ts">
+ import { FileCard } from "@dzangolab/vue3-ui";
+
+ import type { IFile } from "@dzangolab/vue3-ui";
+
+ const file = {
+ ...
+ } as IFile;
+
+
+
+
+
+