mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: mobile logic.
fix: overlay on mobile's side sheet.
This commit is contained in:
1 parent
c54797daf3
commit
cc193c4d3c
2 files changed
+35
-8
No files matched your search
+26
-7
@@ -56,6 +56,7 @@
|
||||
let headerElement: HTMLElement | null = null;
|
||||
let rangeOverlayEl: HTMLDivElement | null = null;
|
||||
let fadeBottomOverlayEl: HTMLDivElement | null = null;
|
||||
let snowFadeBottomOverlayEl: HTMLDivElement | null = null;
|
||||
|
||||
let customColumns = $state<
|
||||
(SuggestedColumnSchema & { elements?: []; isPlaceholder?: boolean })[]
|
||||
@@ -70,6 +71,8 @@
|
||||
let previousColumnId = $state<string | null>(null);
|
||||
let selectedColumnName = $state<string | null>(null);
|
||||
|
||||
let triggerColumnId = $state<string | null>(null);
|
||||
|
||||
// for deleting a column + undo
|
||||
let undoTimer: ReturnType<typeof setTimeout> | null = $state(null);
|
||||
let columnBeingDeleted: (SuggestedColumnSchema & { deletedIndex?: number }) | null =
|
||||
@@ -535,7 +538,7 @@
|
||||
async function updateOverlaysForMobile(value: boolean) {
|
||||
if ($isSmallViewport) {
|
||||
setTimeout(() => {
|
||||
[rangeOverlayEl, fadeBottomOverlayEl].forEach((el) => {
|
||||
[rangeOverlayEl, fadeBottomOverlayEl, snowFadeBottomOverlayEl].forEach((el) => {
|
||||
if (el) {
|
||||
el.style.opacity = value ? '0' : '1';
|
||||
}
|
||||
@@ -1097,7 +1100,15 @@
|
||||
|
||||
<Options
|
||||
enabled={isColumnInteractable}
|
||||
onShowStateChanged={onPopoverShowStateChanged}>
|
||||
onShowStateChanged={onPopoverShowStateChanged}
|
||||
triggerOpen={() => {
|
||||
if (triggerColumnId === column.id) {
|
||||
triggerColumnId = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}}>
|
||||
{#snippet children(toggle)}
|
||||
<Spreadsheet.Header.Cell
|
||||
{root}
|
||||
@@ -1247,8 +1258,12 @@
|
||||
class="column-selector-button"
|
||||
aria-label="Select column"
|
||||
onclick={() => {
|
||||
if (isColumnInteractable && !$isTabletViewport) {
|
||||
selectColumnWithId(column);
|
||||
if (isColumnInteractable) {
|
||||
if (!$isTabletViewport) {
|
||||
selectColumnWithId(column);
|
||||
} else if ($isSmallViewport) {
|
||||
triggerColumnId = column.id;
|
||||
}
|
||||
}
|
||||
}}></button>
|
||||
</Spreadsheet.Cell>
|
||||
@@ -1264,7 +1279,11 @@
|
||||
data-collapsed-tabs={!$expandTabs}>
|
||||
</div>
|
||||
|
||||
<div class="snow-fade-bottom" data-collapsed-tabs={!$expandTabs}></div>
|
||||
<div
|
||||
bind:this={snowFadeBottomOverlayEl}
|
||||
class="snow-fade-bottom"
|
||||
data-collapsed-tabs={!$expandTabs}>
|
||||
</div>
|
||||
|
||||
{#if $tableColumnSuggestions.thinking}
|
||||
<div class="floating-action-wrapper">
|
||||
@@ -1381,8 +1400,8 @@
|
||||
{creatingColumns
|
||||
? 'Creating columns'
|
||||
: $isSmallViewport
|
||||
? 'Review and edit suggested columns'
|
||||
: 'Review and edit suggested columns before applying'}
|
||||
? 'Click headers or cells to edit columns'
|
||||
: 'Click headers or cells to edit columns before applying'}
|
||||
</Typography.Caption>
|
||||
</Layout.Stack>
|
||||
</svelte:fragment>
|
||||
|
||||
+9
-1
@@ -11,7 +11,8 @@
|
||||
toggleOnTapClick = true,
|
||||
onShowStateChanged = null,
|
||||
enabled = true,
|
||||
onChildrenClick
|
||||
onChildrenClick,
|
||||
triggerOpen
|
||||
}: {
|
||||
children: Snippet<[toggle: (event: Event) => void]>;
|
||||
tooltipChildren: Snippet<[toggle: (event: Event) => void]>;
|
||||
@@ -20,6 +21,7 @@
|
||||
onShowStateChanged?: (showing: boolean) => void;
|
||||
enabled?: boolean;
|
||||
onChildrenClick?: () => void;
|
||||
triggerOpen?: () => boolean;
|
||||
} = $props();
|
||||
|
||||
let showSheet = $state(false);
|
||||
@@ -29,6 +31,12 @@
|
||||
showSheet = false;
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if ($isSmallViewport && triggerOpen && triggerOpen()) {
|
||||
showSheet = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Popover let:toggle let:showing portal padding="none" placement="bottom-start">
|
||||
|
||||
Reference in new issue
Block a user