iconograph-ui 1.6.6 → 1.6.7
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.
- package/lib/navigation/Button.svelte +28 -7
- package/package.json +1 -1
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import loaderIcon from '../assets/icons/loader-ring-grey.svg?url';
|
|
3
|
+
|
|
2
4
|
export let label;
|
|
3
5
|
export let url;
|
|
4
6
|
export let clickEvent;
|
|
7
|
+
export let waiting = false;
|
|
5
8
|
</script>
|
|
6
9
|
|
|
7
|
-
{#if
|
|
8
|
-
<button
|
|
9
|
-
|
|
10
|
-
</button>
|
|
10
|
+
{#if waiting}
|
|
11
|
+
<button class="waiting" style:background-image={`url("${loaderIcon}")`}>
|
|
12
|
+
{label}
|
|
13
|
+
</button>
|
|
11
14
|
{:else}
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
+
{#if clickEvent}
|
|
16
|
+
<button on:click|stopPropagation={clickEvent}>
|
|
17
|
+
{label}
|
|
18
|
+
</button>
|
|
19
|
+
{:else}
|
|
20
|
+
<a href={url} >
|
|
21
|
+
{label}
|
|
22
|
+
</a>
|
|
23
|
+
{/if}
|
|
15
24
|
{/if}
|
|
16
25
|
|
|
17
26
|
<style>
|
|
@@ -34,9 +43,21 @@ a, button {
|
|
|
34
43
|
cursor: pointer;
|
|
35
44
|
padding: 0px 20px;
|
|
36
45
|
}
|
|
46
|
+
.waiting {
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
background-position: 12px center;
|
|
49
|
+
background-size: 20px;
|
|
50
|
+
padding-left: 40px;
|
|
51
|
+
background-color: #eee;
|
|
52
|
+
color: #888 !important;
|
|
53
|
+
cursor: not-allowed;
|
|
54
|
+
}
|
|
37
55
|
a:hover, button:hover {
|
|
38
56
|
background-color: var(--theme-main-color-hover);
|
|
39
57
|
}
|
|
58
|
+
.waiting:hover {
|
|
59
|
+
background-color: #ddd
|
|
60
|
+
}
|
|
40
61
|
a:active {
|
|
41
62
|
background-color: var(--theme-main-color-hover);
|
|
42
63
|
position: relative;
|