mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
remove: excessive changes
This commit is contained in:
+1
-2
@@ -475,8 +475,7 @@
|
||||
<EditRow
|
||||
bind:this={editRow}
|
||||
bind:row={$databaseRowSheetOptions.row}
|
||||
bind:rowId={$databaseRowSheetOptions.rowId}
|
||||
autoFocus={$databaseRowSheetOptions.autoFocus} />
|
||||
bind:rowId={$databaseRowSheetOptions.rowId} />
|
||||
{/key}
|
||||
</SideSheet>
|
||||
|
||||
|
||||
+2
-6
@@ -19,12 +19,10 @@
|
||||
|
||||
let {
|
||||
row = $bindable(),
|
||||
rowId = $bindable(null),
|
||||
autoFocus = true
|
||||
rowId = $bindable(null)
|
||||
}: {
|
||||
row?: Models.Row | null;
|
||||
rowId?: string | null;
|
||||
autoFocus?: boolean;
|
||||
} = $props();
|
||||
|
||||
let loading = $state(false);
|
||||
@@ -78,9 +76,7 @@
|
||||
$effect(() => {
|
||||
if (row) {
|
||||
work = initWork();
|
||||
if (autoFocus) {
|
||||
focusFirstInput();
|
||||
}
|
||||
requestAnimationFrame(() => focusFirstInput());
|
||||
} else {
|
||||
work = null;
|
||||
}
|
||||
|
||||
+6
-12
@@ -543,13 +543,11 @@
|
||||
} else if (type === 'row') {
|
||||
if (action === 'update') {
|
||||
databaseRowSheetOptions.update((opts) => {
|
||||
const wasOpen = opts.show;
|
||||
return {
|
||||
...opts,
|
||||
row,
|
||||
show: true,
|
||||
title: 'Update row',
|
||||
autoFocus: !wasOpen,
|
||||
title: 'Update row'
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -760,15 +758,11 @@
|
||||
|
||||
$: rowSelection = !$spreadsheetLoading && !$paginatedRowsLoading ? true : ('disabled' as const);
|
||||
|
||||
$: if (!$databaseRowSheetOptions.show) {
|
||||
$databaseRowSheetOptions.autoFocus = true;
|
||||
|
||||
if (previouslyFocusedElement) {
|
||||
requestAnimationFrame(() => {
|
||||
(previouslyFocusedElement as HTMLElement)?.focus();
|
||||
previouslyFocusedElement = null;
|
||||
});
|
||||
}
|
||||
$: if (!$databaseRowSheetOptions.show && previouslyFocusedElement) {
|
||||
requestAnimationFrame(() => {
|
||||
(previouslyFocusedElement as HTMLElement)?.focus();
|
||||
previouslyFocusedElement = null;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
+1
-3
@@ -64,14 +64,12 @@ export const databaseRowSheetOptions = writable<
|
||||
DatabaseSheetOptions & {
|
||||
row: Models.Row;
|
||||
rowId?: string;
|
||||
autoFocus?: boolean;
|
||||
}
|
||||
>({
|
||||
title: null,
|
||||
show: false,
|
||||
row: null,
|
||||
rowId: null, // for loading from a given id
|
||||
autoFocus: true
|
||||
rowId: null // for loading from a given id
|
||||
});
|
||||
|
||||
export const databaseRelatedRowSheetOptions = writable<
|
||||
|
||||
Reference in New Issue
Block a user