iconograph-ui 1.6.8 → 1.6.9

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.
@@ -6,12 +6,11 @@
6
6
  export let button = {};
7
7
  export let uri;
8
8
  export let callbackFunction = () => {};
9
+ export let waiting = false;
9
10
 
10
11
  const defaultButton = { label: "Enregistrer", clickEvent: handleSubmit };
11
12
  $: button = { ...defaultButton, ...button };
12
13
 
13
- let waiting = false;
14
-
15
14
  function setDeep(obj, path, value) {
16
15
  let keys = path
17
16
  .replace(/\]/g, '')
@@ -68,7 +67,7 @@
68
67
  <form>
69
68
  <slot></slot>
70
69
 
71
- <FormButton button={button} clickEvent={button.clickEvent} ></FormButton>
70
+ <FormButton button={button} clickEvent={button.clickEvent} waiting={waiting}></FormButton>
72
71
 
73
72
  </form>
74
73
 
@@ -1,13 +1,22 @@
1
1
  <script>
2
+ import loaderIcon from '../assets/icons/loader-ring-grey.svg?url';
3
+
2
4
  export let button;
3
5
  export let clickEvent;
6
+ export let waiting = false;
4
7
  </script>
5
8
 
6
9
  <!-- svelte-ignore a11y_click_events_have_key_events -->
7
10
  <!-- svelte-ignore a11y_no_static_element_interactions -->
8
- <div class="button" on:click|preventDefault|stopPropagation={clickEvent}> <!-- Prevent button default submit event when pressing enter-->
9
- {button.label}
10
- </div>
11
+ {#if waiting}
12
+ <button class="waiting" style:background-image={`url("${loaderIcon}")`}>
13
+ {button.label}
14
+ </button>
15
+ {:else}
16
+ <div class="button" on:click|preventDefault|stopPropagation={clickEvent}> <!-- Prevent button default submit event when pressing enter-->
17
+ {button.label}
18
+ </div>
19
+ {/if}
11
20
 
12
21
  <style>
13
22
  .button {
@@ -41,4 +50,16 @@
41
50
  .button:disabled {
42
51
  background-color: var(--disabled-background-color) !important;
43
52
  }
53
+ .waiting {
54
+ background-repeat: no-repeat;
55
+ background-position: 12px center;
56
+ background-size: 20px;
57
+ padding-left: 40px;
58
+ background-color: #eee;
59
+ color: #888 !important;
60
+ cursor: not-allowed;
61
+ }
62
+ .waiting:hover {
63
+ background-color: #ddd
64
+ }
44
65
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iconograph-ui",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "description": "A Svelte Kit components library",
5
5
  "main": "./index.js",
6
6
  "svelte": "./index.js",