@onsvisual/svelte-components 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,12 +49,27 @@
|
|
|
49
49
|
"This handbook explains what the census is, why it matters to everyone and how we can work together to spread the word within your community."
|
|
50
50
|
}
|
|
51
51
|
];
|
|
52
|
+
|
|
53
|
+
const items3 = [
|
|
54
|
+
{
|
|
55
|
+
title: "Including everyone in Census",
|
|
56
|
+
href: "#0",
|
|
57
|
+
meta: "Poster, PDF, 499KB, 1 page"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: "Community handbook for Census 2021",
|
|
61
|
+
href: "#0",
|
|
62
|
+
meta: "Booklet,PDF, 3.3MB, 16 pages"
|
|
63
|
+
}
|
|
64
|
+
];
|
|
52
65
|
</script>
|
|
53
66
|
|
|
54
67
|
<Story name="Document list with images" args={{ items: items1 }} />
|
|
55
68
|
|
|
56
69
|
<Story name="Article list with featured item" args={{ items: items2 }} />
|
|
57
70
|
|
|
71
|
+
<Story name="Compact list, no description" args={{ items: items3, compact: true }} />
|
|
72
|
+
|
|
58
73
|
<Story name="Individually defined documents" asChild parameters={withStoryDocs(exampleDocs)}>
|
|
59
74
|
<DocumentList>
|
|
60
75
|
<Document
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
* @type {object[]|null}
|
|
6
6
|
*/
|
|
7
7
|
export let items = null;
|
|
8
|
+
/** Compact mode. Removes horizonatal lines between documents
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export let compact = false;
|
|
8
12
|
/**
|
|
9
13
|
* Optional: Set an additional CSS class for the component
|
|
10
14
|
* @type {string|null}
|
|
@@ -12,7 +16,7 @@
|
|
|
12
16
|
export let cls = null;
|
|
13
17
|
</script>
|
|
14
18
|
|
|
15
|
-
<ul class="ons-document-list {cls}">
|
|
19
|
+
<ul class="ons-document-list {cls}" class:ons-document-list--compact={compact}>
|
|
16
20
|
<slot />
|
|
17
21
|
{#if Array.isArray(items)}
|
|
18
22
|
{#each items as item}
|
|
@@ -20,3 +24,10 @@
|
|
|
20
24
|
{/each}
|
|
21
25
|
{/if}
|
|
22
26
|
</ul>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.ons-document-list--compact > :global(.ons-document-list__item) {
|
|
30
|
+
padding-bottom: 0;
|
|
31
|
+
border: none;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} DocumentListSlots */
|
|
4
4
|
export default class DocumentList extends SvelteComponentTyped<{
|
|
5
5
|
cls?: string | null | undefined;
|
|
6
|
+
compact?: boolean | undefined;
|
|
6
7
|
items?: object[] | null | undefined;
|
|
7
8
|
}, {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|
|
@@ -17,6 +18,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
17
18
|
declare const __propDef: {
|
|
18
19
|
props: {
|
|
19
20
|
cls?: string | null | undefined;
|
|
21
|
+
compact?: boolean | undefined;
|
|
20
22
|
items?: object[] | null | undefined;
|
|
21
23
|
};
|
|
22
24
|
events: {
|