add select all to indicator button
This commit is contained in:
parent
a67b234bf2
commit
2f881e1e66
@ -8,6 +8,7 @@
|
|||||||
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
import DownloadData from "$lib/components/DownloadData.svelte";
|
import DownloadData from "$lib/components/DownloadData.svelte";
|
||||||
import { page } from "$app/stores";
|
import { page } from "$app/stores";
|
||||||
|
import toast from "svelte-french-toast";
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
export let rawData;
|
export let rawData;
|
||||||
@ -218,6 +219,23 @@
|
|||||||
saveRules();
|
saveRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleSelectAll() {
|
||||||
|
if (data?.user?.tier === "Pro") {
|
||||||
|
searchQuery = "";
|
||||||
|
ruleOfList = allRows;
|
||||||
|
ruleOfList = [...ruleOfList];
|
||||||
|
checkedItems = new Set(ruleOfList?.map((item) => item.name));
|
||||||
|
allRows = sortIndicatorCheckMarks(allRows);
|
||||||
|
await updateStockScreenerData();
|
||||||
|
|
||||||
|
saveRules();
|
||||||
|
} else {
|
||||||
|
toast.error("Only for Pro Members", {
|
||||||
|
style: "border-radius: 200px; background: #333; color: #fff;",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleInput(event) {
|
function handleInput(event) {
|
||||||
searchQuery = event.target.value?.toLowerCase() || "";
|
searchQuery = event.target.value?.toLowerCase() || "";
|
||||||
|
|
||||||
@ -624,7 +642,7 @@
|
|||||||
</DropdownMenu.Group>
|
</DropdownMenu.Group>
|
||||||
<!-- Reset Selection button -->
|
<!-- Reset Selection button -->
|
||||||
<div
|
<div
|
||||||
class="sticky -bottom-1 bg-[#09090B] z-50 p-2 border-t border-gray-600 w-full"
|
class="sticky -bottom-1 bg-[#09090B] z-50 p-2 border-t border-gray-600 w-full flex justify-between items-center"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
on:click={handleResetAll}
|
on:click={handleResetAll}
|
||||||
@ -632,6 +650,12 @@
|
|||||||
>
|
>
|
||||||
Reset Selection
|
Reset Selection
|
||||||
</label>
|
</label>
|
||||||
|
<label
|
||||||
|
on:click={handleSelectAll}
|
||||||
|
class="w-full flex justify-end sm:hover:text-white text-gray-300 bg-[#09090B] text-start text-sm cursor-pointer"
|
||||||
|
>
|
||||||
|
Select All
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Root>
|
</DropdownMenu.Root>
|
||||||
|
|||||||
@ -404,6 +404,23 @@
|
|||||||
saveRules();
|
saveRules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleSelectAll() {
|
||||||
|
if (data?.user?.tier === "Pro") {
|
||||||
|
searchQuery = "";
|
||||||
|
ruleOfList = allRows;
|
||||||
|
ruleOfList = [...ruleOfList];
|
||||||
|
checkedItems = new Set(ruleOfList?.map((item) => item.name));
|
||||||
|
allRows = sortIndicatorCheckMarks(allRows);
|
||||||
|
await updateStockScreenerData();
|
||||||
|
|
||||||
|
saveRules();
|
||||||
|
} else {
|
||||||
|
toast.error("Only for Pro Members", {
|
||||||
|
style: "border-radius: 200px; background: #333; color: #fff;",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function changeWatchList(newWatchList) {
|
function changeWatchList(newWatchList) {
|
||||||
displayWatchList = newWatchList;
|
displayWatchList = newWatchList;
|
||||||
switchWatchlist = true;
|
switchWatchlist = true;
|
||||||
@ -979,7 +996,7 @@
|
|||||||
</DropdownMenu.Group>
|
</DropdownMenu.Group>
|
||||||
<!-- Reset Selection button -->
|
<!-- Reset Selection button -->
|
||||||
<div
|
<div
|
||||||
class="sticky -bottom-1 bg-[#09090B] z-50 p-2 border-t border-gray-600 w-full"
|
class="sticky -bottom-1 bg-[#09090B] z-50 p-2 border-t border-gray-600 w-full flex justify-between items-center"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
on:click={handleResetAll}
|
on:click={handleResetAll}
|
||||||
@ -987,6 +1004,12 @@
|
|||||||
>
|
>
|
||||||
Reset Selection
|
Reset Selection
|
||||||
</label>
|
</label>
|
||||||
|
<label
|
||||||
|
on:click={handleSelectAll}
|
||||||
|
class="w-full flex justify-end sm:hover:text-white text-gray-300 bg-[#09090B] text-start text-sm cursor-pointer"
|
||||||
|
>
|
||||||
|
Select All
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Root>
|
</DropdownMenu.Root>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user