diff --git a/app/components/ch/components/DownloadList.vue b/app/components/ch/components/DownloadList.vue index 62e9aeb6..64d23b05 100644 --- a/app/components/ch/components/DownloadList.vue +++ b/app/components/ch/components/DownloadList.vue @@ -3,15 +3,13 @@
-

+

{{ title }} -

+

{{ description }}

@@ -31,12 +29,6 @@ export default { MetaInfo, }, props: { - id: { - type: String, - required: false, - // generate default randomized id if not existing - default: () => Math.random().toString(36).substring(2, 15), - }, title: { type: String, required: true, diff --git a/app/components/stories/components/DownloadList.stories.mdx b/app/components/stories/components/DownloadList.stories.mdx index 5f724ada..40d59cdf 100644 --- a/app/components/stories/components/DownloadList.stories.mdx +++ b/app/components/stories/components/DownloadList.stories.mdx @@ -9,7 +9,7 @@ import DownloadList from '../../ch/components/DownloadList.vue' export const Template = (args, { argTypes }) => ({ props: Object.keys(argTypes), components: { DownloadList }, - template: '' + template: '' }) @@ -20,8 +20,22 @@ export const Template = (args, { argTypes }) => ({ name="Example" args={{ content: [ - { filename:"example.pdf" ,title:"Information on the usage of websites", description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean feugiat augue eu purus luctus rhoncus. Donec ultricies venenatis nibh, vel placerat est accumsan quis. Maecenas urna nibh, pretium pretium odio id, rhoncus rhoncus lorem. Nulla eu neque sagittis, cursus purus eget, sodales est. Duis at ultrices odio, ac egestas dolor.", url:"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", type:"PDF", date:"13.01.2022" }, - { filename:"example.pdf" ,title:"Information on the usage of websites", description:"", url:"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", type:"JPEG", date:"22.01.2022" }, + { + filename:"dummy.pdf" , + title:"Information on the usage of websites", + description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean feugiat augue eu purus luctus rhoncus. Donec ultricies venenatis nibh, vel placerat est accumsan quis. Maecenas urna nibh, pretium pretium odio id, rhoncus rhoncus lorem. Nulla eu neque sagittis, cursus purus eget, sodales est. Duis at ultrices odio, ac egestas dolor.", + url:"../../../static/documents/dummy.pdf", + type:"PDF", + date:"13.01.2022" + }, + { + filename:"image.png", + title:"Information on the usage of websites", + description:"", + url:"../../../static/images/html-structure.png", + type:"PNG", + date:"22.01.2022" + }, ] }} > @@ -29,74 +43,42 @@ export const Template = (args, { argTypes }) => ({ -# Interaction and accessibility -Each DownloadList item is it's own button, they can also be added within a list and their width is contained by the outer parent element. +## Interaction and accessibility + +Each DownloadList item is it's own link, they can also be added within a list and their width is contained by the outer parent element. During interactions, the DownloadList items are highlighted and the user can click on them to trigger the download. The DownloadList items are also accessible by tabbing through them. -```html -
+ +## Download vs navigation + +If the DownloadList item points to a document placed on the same server as the application, add the `download` attribute on your link. This will download the document instead of opening it in the browser. + +``` html + + +
+
Title
+

Optional description

+

+ meta-info 1 + meta-info 2 +

+
+
``` +If the DownloadList item points to an external document, a JavaScript or backend approach has to be applied. +And if the cross-origin problematic can't be solved, add a `target="_blank"` attribute on the link for a slightly better interaction. - + Go to the Canvas Tab --- - + Open page in full width in a new tab diff --git a/app/static/documents/dummy.pdf b/app/static/documents/dummy.pdf new file mode 100644 index 00000000..774c2ea7 Binary files /dev/null and b/app/static/documents/dummy.pdf differ