@softwareone/spi-sv5-library 1.11.5 → 1.11.6

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.
@@ -199,7 +199,7 @@
199
199
 
200
200
  <style>
201
201
  .container {
202
- --color-red: #b30825;
202
+ --color-red: #dc2626;
203
203
  --color-gray-outer: #434952;
204
204
  --color-gray-auro: #6b7180;
205
205
  --color-gray: #e0e5e8;
@@ -238,9 +238,7 @@
238
238
 
239
239
  .text-error {
240
240
  color: var(--color-red);
241
- margin: 4px;
242
241
  font-size: 12px;
243
- line-height: 16px;
244
242
  }
245
243
 
246
244
  .drop-area {
@@ -7,7 +7,7 @@
7
7
  showModal?: boolean;
8
8
  ondelete: () => Promise<boolean> | boolean;
9
9
  onclose?: VoidFunction;
10
- ondeleteSuccess?: VoidFunction;
10
+ ondeleteSuccess?: () => Promise<void> | void;
11
11
  }
12
12
 
13
13
  let {
@@ -28,15 +28,17 @@
28
28
 
29
29
  const handleDelete = async () => {
30
30
  isLoading = true;
31
+
31
32
  const isSuccessful = await ondelete();
32
- isLoading = false;
33
33
 
34
34
  if (isSuccessful) {
35
+ await ondeleteSuccess?.();
35
36
  showModal = false;
36
- ondeleteSuccess?.();
37
37
  } else {
38
38
  addToast({ message: 'There was an unexpected error.', type: 'danger' });
39
39
  }
40
+
41
+ isLoading = false;
40
42
  };
41
43
  </script>
42
44
 
@@ -4,7 +4,7 @@ interface DeleteConfirmationProps {
4
4
  showModal?: boolean;
5
5
  ondelete: () => Promise<boolean> | boolean;
6
6
  onclose?: VoidFunction;
7
- ondeleteSuccess?: VoidFunction;
7
+ ondeleteSuccess?: () => Promise<void> | void;
8
8
  }
9
9
  declare const DeleteConfirmation: import("svelte").Component<DeleteConfirmationProps, {}, "showModal">;
10
10
  type DeleteConfirmation = ReturnType<typeof DeleteConfirmation>;
@@ -87,11 +87,23 @@
87
87
  const tableManualPagination = manualPagination ? setPaginationTableContext() : undefined;
88
88
  const hasData = $derived(data.length > 0);
89
89
 
90
+ const tableColumns = $derived.by(() => {
91
+ if (!enableChecked) return columns;
92
+
93
+ const checkedColumnExists = columns.some((column) => column.id === 'checked');
94
+ if (checkedColumnExists) return columns;
95
+
96
+ const checkedColumn = createCheckedColumn<T>();
97
+ return [checkedColumn, ...columns];
98
+ });
99
+
90
100
  const table = createSvelteTable({
91
101
  get data() {
92
102
  return tableData;
93
103
  },
94
- columns,
104
+ get columns() {
105
+ return tableColumns;
106
+ },
95
107
  state: {
96
108
  get sorting() {
97
109
  return sorting;
@@ -222,16 +234,6 @@
222
234
  $tableManualPagination = { ...pagination };
223
235
  }
224
236
  });
225
-
226
- $effect.pre(() => {
227
- if (enableChecked && columns.length) {
228
- const checkedColumnExists = columns.some((column) => column.id === 'checked');
229
- if (!checkedColumnExists) {
230
- const checkedColumn = createCheckedColumn<T>();
231
- columns.unshift(checkedColumn);
232
- }
233
- }
234
- });
235
237
  </script>
236
238
 
237
239
  <section class="table-container">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwareone/spi-sv5-library",
3
- "version": "1.11.5",
3
+ "version": "1.11.6",
4
4
  "description": "Svelte components",
5
5
  "keywords": [
6
6
  "svelte",