@axium/client 0.13.2 → 0.13.4

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.
@@ -65,13 +65,12 @@
65
65
  <Icon i="at" />
66
66
  <span>{control.role}</span>
67
67
  </span>
68
- <!-- {:else if control.tag} -->
69
68
  {:else}
70
69
  <i>Unknown</i>
71
70
  {/if}
72
71
  <div class="permissions">
73
72
  {#each Object.entries(pickPermissions(control) as Record<string, boolean>) as [key, value]}
74
- {@const id = `${getTarget(control)}.${key}`}
73
+ {@const id = `${item.id}.${getTarget(control)}.${key}`}
75
74
  <span class="icon-text">
76
75
  {#if editable}
77
76
  <input {id} type="checkbox" onchange={update(key)} />
package/lib/Upload.svelte CHANGED
@@ -7,7 +7,7 @@
7
7
  name = 'files',
8
8
  input = $bindable(),
9
9
  files = $bindable(),
10
- progress = $bindable(),
10
+ progress = $bindable([]),
11
11
  ...rest
12
12
  }: HTMLInputAttributes & { input?: HTMLInputElement; progress?: [current: number, max: number][] } = $props();
13
13
 
@@ -18,23 +18,33 @@
18
18
  <label for={id} class={[files?.length && 'file']}>
19
19
  {#each files! as file, i}
20
20
  <Icon i={forMime(file.type)} />
21
- <div class="name">
22
- <span>{file.name}</span>
23
- {#if progress?.[i]}
21
+ {#if !progress[i]}
22
+ <div class="name">
23
+ <span>{file.name}</span>
24
+ </div>
25
+ <button
26
+ onclick={e => {
27
+ e.preventDefault();
28
+ const dt = new DataTransfer();
29
+ for (let f of files!) if (file !== f) dt.items.add(f);
30
+ input!.files = files = dt.files;
31
+ }}
32
+ style:display="contents"
33
+ >
34
+ <Icon i="trash" />
35
+ </button>
36
+ {:else if progress[i][0] == progress[i][1]}
37
+ <div class="name">
38
+ <span>{file.name}</span>
39
+ </div>
40
+ <Icon i="cloud-check" />
41
+ {:else}
42
+ <div class="name">
43
+ <span>{file.name}</span>
24
44
  <progress value={progress[i][0]} max={progress[i][1]}></progress>
25
- {/if}
26
- </div>
27
- <button
28
- onclick={e => {
29
- e.preventDefault();
30
- const dt = new DataTransfer();
31
- for (let f of files!) if (file !== f) dt.items.add(f);
32
- input!.files = files = dt.files;
33
- }}
34
- style:display="contents"
35
- >
36
- <Icon i="trash" />
37
- </button>
45
+ </div>
46
+ <Icon i="cloud-arrow-up" />
47
+ {/if}
38
48
  {:else}
39
49
  <Icon i="upload" /> Upload
40
50
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.13.2",
3
+ "version": "0.13.4",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",