@onsvisual/svelte-components 0.0.26 → 0.0.28
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.
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CardSlots */
|
|
4
4
|
export default class Card extends SvelteComponentTyped<{
|
|
5
5
|
id?: any;
|
|
6
|
-
title?:
|
|
7
|
-
href?:
|
|
6
|
+
title?: any;
|
|
7
|
+
href?: any;
|
|
8
8
|
hideTitle?: boolean;
|
|
9
9
|
noBackground?: any;
|
|
10
|
-
image?:
|
|
11
|
-
imageAlt?:
|
|
10
|
+
image?: any;
|
|
11
|
+
imageAlt?: any;
|
|
12
12
|
colspan?: number;
|
|
13
13
|
grow?: boolean;
|
|
14
14
|
}, {
|
|
@@ -24,12 +24,12 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
24
24
|
declare const __propDef: {
|
|
25
25
|
props: {
|
|
26
26
|
id?: any;
|
|
27
|
-
title?:
|
|
28
|
-
href?:
|
|
27
|
+
title?: any;
|
|
28
|
+
href?: any;
|
|
29
29
|
hideTitle?: boolean;
|
|
30
30
|
noBackground?: any;
|
|
31
|
-
image?:
|
|
32
|
-
imageAlt?:
|
|
31
|
+
image?: any;
|
|
32
|
+
imageAlt?: any;
|
|
33
33
|
colspan?: number;
|
|
34
34
|
grow?: boolean;
|
|
35
35
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
import { slugify } from "../../js/utils";
|
|
4
4
|
|
|
5
|
-
export let title =
|
|
5
|
+
export let title = null;
|
|
6
6
|
export let id = slugify(title);
|
|
7
7
|
export let hideTitle = false;
|
|
8
|
-
export let image =
|
|
9
|
-
export let imageAlt =
|
|
10
|
-
export let href =
|
|
8
|
+
export let image = null;
|
|
9
|
+
export let imageAlt = null;
|
|
10
|
+
export let href = null;
|
|
11
11
|
|
|
12
12
|
export let colspan = 1; // 1, 2 or 3
|
|
13
13
|
export let noBackground = getContext("noBackground") || false;
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
style:grid-column-end="{grow ? $cols + 1 : null}"
|
|
29
29
|
>
|
|
30
30
|
<div id="{id}" class="ons-card" aria-describedBy="{id}_text">
|
|
31
|
-
{#if href && title
|
|
32
|
-
<a href="{href}" class="ons-card__link ons-u-db">
|
|
31
|
+
{#if href && title}
|
|
32
|
+
<a href="{href}" class="ons-card__link ons-u-db" class:ons-u-vh="{hideTitle}">
|
|
33
33
|
{#if image}
|
|
34
34
|
<img
|
|
35
35
|
class="ons-card__image ons-u-mb-s"
|
|
@@ -46,9 +46,10 @@
|
|
|
46
46
|
{title}
|
|
47
47
|
</h3>
|
|
48
48
|
</a>
|
|
49
|
-
{:else if title
|
|
49
|
+
{:else if title}
|
|
50
50
|
<h3
|
|
51
51
|
class="ons-card__title ons-u-fs-m"
|
|
52
|
+
class:ons-u-vh="{hideTitle}"
|
|
52
53
|
style:padding="{!noBackground ? "8px 16px 0" : ""}"
|
|
53
54
|
style:margin-bottom="5px"
|
|
54
55
|
>
|