@axium/client 0.9.11 → 0.9.13
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,15 +6,16 @@
|
|
|
6
6
|
import FormDialog from './FormDialog.svelte';
|
|
7
7
|
import UserCard from './UserCard.svelte';
|
|
8
8
|
import Icon from './Icon.svelte';
|
|
9
|
+
import type { HTMLDialogAttributes } from 'svelte/elements';
|
|
9
10
|
|
|
10
|
-
interface Props {
|
|
11
|
+
interface Props extends HTMLDialogAttributes {
|
|
11
12
|
editable: boolean;
|
|
12
13
|
dialog?: HTMLDialogElement;
|
|
13
14
|
itemType: string;
|
|
14
15
|
item?: ({ name?: string; user?: User; id: string } & AccessControllable) | null;
|
|
15
16
|
acl?: AccessControl[];
|
|
16
17
|
}
|
|
17
|
-
let { item = $bindable(), itemType, editable, dialog = $bindable(), acl = $bindable(item?.acl) }: Props = $props();
|
|
18
|
+
let { item = $bindable(), itemType, editable, dialog = $bindable(), acl = $bindable(item?.acl), ...rest }: Props = $props();
|
|
18
19
|
|
|
19
20
|
if (!acl && item) getACL(itemType, item.id).then(fetched => (acl = item.acl = fetched));
|
|
20
21
|
</script>
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
submit={async data => {
|
|
26
27
|
if (item) await setACL(itemType, item.id, data as any as AccessMap);
|
|
27
28
|
}}
|
|
29
|
+
{...rest}
|
|
28
30
|
>
|
|
29
31
|
{#snippet header()}
|
|
30
32
|
{#if item?.name}
|
package/lib/Popover.svelte
CHANGED
package/lib/Preference.svelte
CHANGED
|
@@ -51,13 +51,7 @@
|
|
|
51
51
|
function onchange(e: Event) {
|
|
52
52
|
const value = schema.parse(input instanceof HTMLInputElement && input.type === 'checkbox' ? input.checked : input.value);
|
|
53
53
|
if (value == getByString(preferences, path)) return;
|
|
54
|
-
|
|
55
|
-
if (getByString(preferenceDefaults, path) == value) {
|
|
56
|
-
const parts = path.split('.');
|
|
57
|
-
const prop = parts.pop()!;
|
|
58
|
-
delete getByString<Record<string, any>>(preferences, parts.join('.'))[prop];
|
|
59
|
-
} else setByString(preferences, path, value);
|
|
60
|
-
|
|
54
|
+
setByString(preferences, path, value);
|
|
61
55
|
fetchAPI('PATCH', 'users/:id', { preferences }, userId);
|
|
62
56
|
}
|
|
63
57
|
</script>
|