diff --git a/src/lib/components/form/LazyDropdown.svelte b/src/lib/components/form/LazyDropdown.svelte deleted file mode 100644 index e3f80b8..0000000 --- a/src/lib/components/form/LazyDropdown.svelte +++ /dev/null @@ -1,148 +0,0 @@ - - -
-
- {@render children()} -
- - {#if action} - event.preventDefault()} - value={get_label(input_variable) ?? placeholder} - {...restProps} - /> - {:else} - event.preventDefault()} - value={get_label(input_variable) ?? placeholder} - {...restProps} - /> - {/if} -
- -
- {#if load} - - {#each options as option} - -
- {#if option.icon_url} - - {/if} - {option.label} -
-
- {/each} -
- {/if} -
diff --git a/src/lib/components/form/LazyDropdown.ts b/src/lib/components/form/LazyDropdown.ts deleted file mode 100644 index 534402e..0000000 --- a/src/lib/components/form/LazyDropdown.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { type DropdownOption } from "$lib/components"; - -export interface LazyDropdownOption extends DropdownOption { - /** The label displayed in the list of options. */ - label: string; - - /** The value assigned to the dropdown value variable */ - value: string; - - /** An optional icon displayed left to the label */ - icon_url?: string; - - /** The aspect ratio width of the optional icon */ - icon_width?: number; - - /** The aspect ratio height of the optional icon */ - icon_height?: number; -} diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index cc9b1c8..96df6fa 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -5,7 +5,6 @@ import Table from "./Table.svelte"; import Button from "./form/Button.svelte"; import Dropdown from "./form/Dropdown.svelte"; import Input from "./form/Input.svelte"; -import LazyDropdown from "./form/LazyDropdown.svelte"; import Search from "./form/Search.svelte"; import Card from "./cards/Card.svelte"; @@ -16,7 +15,6 @@ import SubstitutionCard from "./cards/SubstitutionCard.svelte"; import TeamCard from "./cards/TeamCard.svelte"; import type { DropdownOption } from "./form/Dropdown"; -import type { LazyDropdownOption } from "./form/LazyDropdown"; import type { TableColumn } from "./Table"; import MenuDrawerIcon from "./svg/MenuDrawerIcon.svelte"; @@ -33,7 +31,6 @@ export { Button, Dropdown, Input, - LazyDropdown, Search, // Cards @@ -46,7 +43,6 @@ export { // Types type DropdownOption, - type LazyDropdownOption, type TableColumn, // SVG diff --git a/src/routes/data/season/+page.svelte b/src/routes/data/season/+page.svelte index 935cfc2..f1849ac 100644 --- a/src/routes/data/season/+page.svelte +++ b/src/routes/data/season/+page.svelte @@ -9,15 +9,13 @@ type ModalStore, } from "@skeletonlabs/skeleton"; - import { Button, Table, type LazyDropdownOption, type TableColumn } from "$lib/components"; + import { Button, Table, type DropdownOption, type TableColumn } from "$lib/components"; import { get_by_value } from "$lib/database"; import { DRIVER_HEADSHOT_HEIGHT, DRIVER_HEADSHOT_WIDTH, RACE_PICTOGRAM_HEIGHT, RACE_PICTOGRAM_WIDTH, - TEAM_BANNER_HEIGHT, - TEAM_BANNER_WIDTH, TEAM_LOGO_HEIGHT, TEAM_LOGO_WIDTH, } from "$lib/config"; @@ -57,7 +55,7 @@ update_substitution_race_select_values["create"] = ""; // All options to create a component for the teams - const team_dropdown_options: LazyDropdownOption[] = []; + const team_dropdown_options: DropdownOption[] = []; data.teams.forEach((team: Team) => { team_dropdown_options.push({ label: team.name, @@ -69,7 +67,7 @@ }); // All options to create a component for the drivers - const driver_dropdown_options: LazyDropdownOption[] = []; + const driver_dropdown_options: DropdownOption[] = []; data.drivers.then((drivers: Driver[]) => drivers.forEach((driver: Driver) => { driver_dropdown_options.push({ @@ -83,7 +81,7 @@ ); // All options to create a component for the races - const race_dropdown_options: LazyDropdownOption[] = []; + const race_dropdown_options: DropdownOption[] = []; data.races.then((races: Race[]) => races.forEach((race: Race) => { race_dropdown_options.push({