@softwareone/spi-sv5-library 1.11.4 → 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.
- package/dist/Accordion/Accordion.svelte +1 -0
- package/dist/Controls/AttachFile/AttachFile.svelte +1 -3
- package/dist/DeleteConfirmation/DeleteConfirmation.svelte +13 -5
- package/dist/DeleteConfirmation/DeleteConfirmation.svelte.d.ts +1 -1
- package/dist/ErrorPage/ErrorPage.svelte +2 -2
- package/dist/Form/Form.svelte +3 -2
- package/dist/Form/Form.svelte.d.ts +1 -0
- package/dist/Form/context.d.ts +2 -2
- package/dist/Form/context.js +13 -5
- package/dist/Menu/Sidebar.svelte +1 -1
- package/dist/Modal/ModalFooter.svelte +1 -1
- package/dist/ProgressPage/ProgressPage.svelte +1 -1
- package/dist/ProgressWizard/ProgressWizard.svelte +3 -2
- package/dist/Table/AdvancedFilter.svelte +1 -0
- package/dist/Table/Table.svelte +17 -13
- package/dist/Waffle/WaffleItems.svelte +3 -2
- package/package.json +1 -1
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
|
|
200
200
|
<style>
|
|
201
201
|
.container {
|
|
202
|
-
--color-red: #
|
|
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?:
|
|
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
|
|
|
@@ -59,7 +61,13 @@
|
|
|
59
61
|
</div>
|
|
60
62
|
|
|
61
63
|
{#snippet footer()}
|
|
62
|
-
<Button
|
|
64
|
+
<Button
|
|
65
|
+
type="button"
|
|
66
|
+
variant="primary"
|
|
67
|
+
variantColor="danger"
|
|
68
|
+
disabled={!enableButton}
|
|
69
|
+
onclick={handleDelete}
|
|
70
|
+
>
|
|
63
71
|
Delete
|
|
64
72
|
</Button>
|
|
65
73
|
{/snippet}
|
|
@@ -72,7 +80,7 @@
|
|
|
72
80
|
gap: 16px;
|
|
73
81
|
width: 100%;
|
|
74
82
|
}
|
|
75
|
-
|
|
83
|
+
|
|
76
84
|
p {
|
|
77
85
|
margin: 0;
|
|
78
86
|
user-select: none;
|
|
@@ -4,7 +4,7 @@ interface DeleteConfirmationProps {
|
|
|
4
4
|
showModal?: boolean;
|
|
5
5
|
ondelete: () => Promise<boolean> | boolean;
|
|
6
6
|
onclose?: VoidFunction;
|
|
7
|
-
ondeleteSuccess?:
|
|
7
|
+
ondeleteSuccess?: () => Promise<void> | void;
|
|
8
8
|
}
|
|
9
9
|
declare const DeleteConfirmation: import("svelte").Component<DeleteConfirmationProps, {}, "showModal">;
|
|
10
10
|
type DeleteConfirmation = ReturnType<typeof DeleteConfirmation>;
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
</p>
|
|
40
40
|
|
|
41
41
|
<div class="feedback-footer">
|
|
42
|
-
<Button variant="outline" onclick={() => window.history.back()}>Back</Button>
|
|
43
|
-
<Button variant="primary" onclick={() => goto(page.url.origin)}>Go home</Button>
|
|
42
|
+
<Button type="button" variant="outline" onclick={() => window.history.back()}>Back</Button>
|
|
43
|
+
<Button type="button" variant="primary" onclick={() => goto(page.url.origin)}>Go home</Button>
|
|
44
44
|
</div>
|
|
45
45
|
</section>
|
|
46
46
|
|
package/dist/Form/Form.svelte
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
enctype?: FormEncodingType;
|
|
28
28
|
invalidateAll?: boolean;
|
|
29
29
|
spinnerFixed?: boolean;
|
|
30
|
+
contextName?: string;
|
|
30
31
|
onsuccess: (data?: Record<string, unknown>) => void;
|
|
31
32
|
onfailure?: (status: number | undefined, error: unknown) => void;
|
|
32
33
|
children?: Snippet;
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
enctype = 'application/x-www-form-urlencoded',
|
|
42
43
|
invalidateAll = true,
|
|
43
44
|
spinnerFixed = false,
|
|
45
|
+
contextName,
|
|
44
46
|
onsuccess,
|
|
45
47
|
onfailure = undefined,
|
|
46
48
|
children
|
|
@@ -49,8 +51,7 @@
|
|
|
49
51
|
let actionResult: ActionResult;
|
|
50
52
|
let isLoading = $state(false);
|
|
51
53
|
|
|
52
|
-
const { form, errors, isFormValid } = getFormContext<Schema>();
|
|
53
|
-
|
|
54
|
+
const { form, errors, isFormValid } = getFormContext<Schema>(contextName);
|
|
54
55
|
$form = structuredClone($state.snapshot(initialData));
|
|
55
56
|
|
|
56
57
|
const onUpdated = () => {
|
|
@@ -9,6 +9,7 @@ declare const Form: import("svelte").Component<{
|
|
|
9
9
|
enctype?: "application/x-www-form-urlencoded" | "multipart/form-data";
|
|
10
10
|
invalidateAll?: boolean;
|
|
11
11
|
spinnerFixed?: boolean;
|
|
12
|
+
contextName?: string;
|
|
12
13
|
onsuccess: (data?: Record<string, unknown>) => void;
|
|
13
14
|
onfailure?: (status: number | undefined, error: unknown) => void;
|
|
14
15
|
children?: Snippet;
|
package/dist/Form/context.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FormContext } from './types.js';
|
|
2
|
-
export declare const setFormContext: <T>() => FormContext<T>;
|
|
3
|
-
export declare const getFormContext: <T>() => FormContext<T>;
|
|
2
|
+
export declare const setFormContext: <T>(name?: string) => FormContext<T>;
|
|
3
|
+
export declare const getFormContext: <T>(name?: string) => FormContext<T>;
|
package/dist/Form/context.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { getContext, setContext } from 'svelte';
|
|
2
2
|
import { writable } from 'svelte/store';
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const symbolCache = new Map();
|
|
4
|
+
const getFormContextKey = (name) => {
|
|
5
|
+
const DEFAULT_KEY = 'formContext';
|
|
6
|
+
const key = name ? `${DEFAULT_KEY}-${name}` : DEFAULT_KEY;
|
|
7
|
+
if (!symbolCache.has(key)) {
|
|
8
|
+
symbolCache.set(key, Symbol(key));
|
|
9
|
+
}
|
|
10
|
+
return symbolCache.get(key);
|
|
11
|
+
};
|
|
12
|
+
export const setFormContext = (name) => {
|
|
5
13
|
const formContext = {
|
|
6
14
|
form: writable({}),
|
|
7
15
|
errors: writable({}),
|
|
8
16
|
isFormValid: writable(false)
|
|
9
17
|
};
|
|
10
|
-
setContext(
|
|
18
|
+
setContext(getFormContextKey(name), formContext);
|
|
11
19
|
return formContext;
|
|
12
20
|
};
|
|
13
|
-
export const getFormContext = () => {
|
|
14
|
-
return getContext(
|
|
21
|
+
export const getFormContext = (name) => {
|
|
22
|
+
return getContext(getFormContextKey(name));
|
|
15
23
|
};
|
package/dist/Menu/Sidebar.svelte
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<div class="category-items">
|
|
44
|
-
<button class="button" onclick={toggleSidebar}>
|
|
44
|
+
<button type="button" class="button" onclick={toggleSidebar}>
|
|
45
45
|
<span class="material-icons-outlined icon-span">
|
|
46
46
|
{isCollapsed ? 'menu' : 'menu_open'}
|
|
47
47
|
</span>
|
|
@@ -114,19 +114,20 @@
|
|
|
114
114
|
</article>
|
|
115
115
|
</section>
|
|
116
116
|
<section class="progress-wizard-footer">
|
|
117
|
-
<Button variant="outline-none" onclick={oncancel}>Cancel</Button>
|
|
117
|
+
<Button type="button" variant="outline-none" onclick={oncancel}>Cancel</Button>
|
|
118
118
|
|
|
119
119
|
<div class="actions">
|
|
120
120
|
{#if !allStepsDisabled}
|
|
121
121
|
{#if !readonly}
|
|
122
122
|
<Button
|
|
123
|
+
type="button"
|
|
123
124
|
variant="secondary"
|
|
124
125
|
disabled={currentStep === firstActiveStep}
|
|
125
126
|
onclick={onclickBack}>Back</Button
|
|
126
127
|
>
|
|
127
128
|
|
|
128
129
|
{#if currentStep < lastActiveStep}
|
|
129
|
-
<Button variant="primary" onclick={onclickNext}>Next</Button>
|
|
130
|
+
<Button type="button" variant="primary" onclick={onclickNext}>Next</Button>
|
|
130
131
|
{/if}
|
|
131
132
|
{/if}
|
|
132
133
|
|
package/dist/Table/Table.svelte
CHANGED
|
@@ -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">
|
|
@@ -266,8 +268,10 @@
|
|
|
266
268
|
/>
|
|
267
269
|
{/if}
|
|
268
270
|
{#if enableExportExcel}
|
|
269
|
-
<Button
|
|
270
|
-
|
|
271
|
+
<Button
|
|
272
|
+
type="button"
|
|
273
|
+
variant="secondary"
|
|
274
|
+
onclick={() => exportExcel(table, excelSetting)}>Export</Button
|
|
271
275
|
>
|
|
272
276
|
{/if}
|
|
273
277
|
{@render header?.()}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
let { title, icon, onclickwaffleitems }: Props = $props();
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<button onclick={onclickwaffleitems} class="waffle-item-button">
|
|
11
|
+
<button type="button" onclick={onclickwaffleitems} class="waffle-item-button">
|
|
12
12
|
<figure class="waffle-icon-container" aria-hidden="true">
|
|
13
13
|
{@html icon}
|
|
14
14
|
</figure>
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
background: #f4f6f8;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.waffle-item-button:focus,
|
|
42
|
+
.waffle-item-button:focus,
|
|
43
|
+
.waffle-item-button:focus-visible {
|
|
43
44
|
background: #eaecff;
|
|
44
45
|
}
|
|
45
46
|
|