iconograph-ui 1.4.0 → 1.4.2

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/index.js CHANGED
@@ -19,6 +19,9 @@ import Modal from "./lib/layout/Modal.svelte"
19
19
  import FlexForm from "./lib/form/FlexForm.svelte";
20
20
  import Editor from "./lib/inputs/Editor.svelte";
21
21
  import SegmentedSwitchInput from "./lib/form/SegmentedSwitchInput.svelte"
22
+ import DateStr from "./lib/display/DateStr.svelte";
23
+ import Field from "./lib/display/Field.svelte";
24
+ import Link from "./lib/display/Link.svelte";
22
25
 
23
26
  export {
24
27
  Button,
@@ -41,5 +44,8 @@ export {
41
44
  SelectUserInput,
42
45
  Modal,
43
46
  Editor,
47
+ DateStr,
48
+ Field,
49
+ Link,
44
50
  addNotification,
45
51
  };
@@ -0,0 +1,46 @@
1
+ <script>
2
+ // @ts-nocheck
3
+ export let fields;
4
+ export let field;
5
+
6
+ export const __filter_options = fields;
7
+
8
+ function transform(arr) {
9
+ return arr.reduce((acc, obj) => {
10
+ const [key, value] = Object.entries(obj)[0]; // take the single key/value
11
+ acc[key] = value;
12
+ return acc;
13
+ }, {});
14
+ }
15
+
16
+ let f_arr = transform(fields);
17
+ </script>
18
+
19
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
20
+ <!-- svelte-ignore a11y-no-static-element-interactions -->
21
+ <div class="indicator-wrapper">
22
+ <span>{f_arr[field]} </span>
23
+ </div>
24
+
25
+ <style>
26
+
27
+ .indicator-wrapper {
28
+ max-width: calc(100% - 16px);
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ cursor: pointer;
33
+ height: 16px;
34
+ z-index: 12;
35
+ }
36
+ .indicator-wrapper > span{
37
+ font-weight: 600;
38
+ text-wrap: nowrap;
39
+ white-space: nowrap;
40
+ overflow: hidden;
41
+ text-overflow: ellipsis;
42
+ color: #555;
43
+ font-weight: 600;
44
+ font-size: 11px;
45
+ }
46
+ </style>
@@ -52,10 +52,9 @@
52
52
 
53
53
  async function getData() {
54
54
  waiting = true;
55
+ data = [];
55
56
 
56
57
  const filterStr = Object.keys(filters).map(k => k + '=' + encodeURIComponent(filters[k])).join('&');
57
- console.log(filterStr);
58
-
59
58
  const response = await fetch(`${uri}limit=${limit}&offset=${(page - 1) * limit}&${filterStr}`, {
60
59
  method: 'GET',
61
60
  headers: { 'Content-Type': 'application/json' }
@@ -132,17 +131,16 @@
132
131
  <TableRow actions={actions} columns={columns} row={d}></TableRow>
133
132
  {/each}
134
133
 
135
- {#if pagination && data.length > 0}
136
- <TablePagination bind:page={page} bind:limit={limit} bind:waiting={waiting} bind:total={total} on:pageChange={getData} on:limitChange={resetAndGetData} ></TablePagination>
137
- {/if}
138
-
139
- {#if data.length == 0}
134
+ {#if waiting}
135
+ <span style:background-image={`url("${loaderIcon}")`}>Chargement en cours</span>
136
+ {:else if data.length == 0}
140
137
  <span>Aucune donnée disponible</span>
141
138
  {/if}
142
139
 
143
- {#if waiting}
144
- <span style:background-image={`url("${loaderIcon}")`}>Chargement en cours</span>
140
+ {#if pagination && data.length > 0}
141
+ <TablePagination bind:page={page} bind:limit={limit} bind:waiting={waiting} bind:total={total} on:pageChange={getData} on:limitChange={resetAndGetData} ></TablePagination>
145
142
  {/if}
143
+
146
144
  </div>
147
145
  </div>
148
146
  </div>
@@ -14,7 +14,7 @@
14
14
  {#if c.component}
15
15
  <svelte:component this={c.component} {...c.props} {...{ [c.field]: row[c.field], ...row }}/>
16
16
  {:else}
17
- <span>{ (row[c.field] && row[c.field] != "undefined ") ? row[c.field] : ''}</span>
17
+ <span>{ (row[c.field] && row[c.field] != "undefined") ? row[c.field] : ''}</span>
18
18
  {/if}
19
19
  </div>
20
20
  {/each}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iconograph-ui",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "A Svelte Kit components library",
5
5
  "main": "./index.js",
6
6
  "svelte": "./index.js",
File without changes