Fix some code quality issues

This commit is contained in:
Henrik Giesel 2021-04-01 18:55:34 +02:00
parent 96feba7a3e
commit 37ed3e8209
11 changed files with 11 additions and 32 deletions

View File

@ -1,19 +0,0 @@
load("//ts:vendor.bzl", "copy_bootstrap_icons", "copy_fontawesome_icons")
copy_bootstrap_icons(name = "bootstrap-icons")
copy_fontawesome_icons(name = "fontawesome-icons")
files = [
"bootstrap-icons",
"fontawesome-icons",
]
directories = []
filegroup(
name = "vendor",
srcs = ["//qt/aqt/data/web/imgs/vendor:{}".format(file) for file in files] +
["//qt/aqt/data/web/imgs/vendor/{}".format(dir) for dir in directories],
visibility = ["//qt:__subpackages__"],
)

View File

@ -4,7 +4,7 @@
export let props: Record<string, string> = {};
export let title: string;
export let onChange: (event: ChangeEvent) => void;
export let onChange: (event: Event) => void;
</script>
<style lang="scss">

View File

@ -50,13 +50,13 @@
if (activatable) {
initializeButton(command);
commandMap.subscribe((map: Record<string, boolean>): void => {
commandMap.subscribe((map: Map<string, boolean>): void => {
active = map.get(command);
return () => map.delete(command);
});
}
function onClick(event: ClickEvent): void {
function onClick(): void {
document.execCommand(command);
}
</script>

View File

@ -4,7 +4,7 @@
export let props: Record<string, string> = {};
export let title: string;
export let onClick: (event: ClickEvent) => void;
export let onClick: (event: MouseEvent) => void;
export let label: string;
export let endLabel: string;
</script>

View File

@ -1,4 +1,5 @@
<script lang="typescript">
import type { SvelteComponent } from "svelte";
import type { Readable } from "svelte/store";
import { setContext } from "svelte";
import { disabledKey, nightModeKey } from "./contextKeys";

View File

@ -7,7 +7,7 @@
export let title: string;
export let icon = "";
export let onClick: (event: ClickEvent) => void;
export let onClick: (event: MouseEvent) => void;
</script>
<SquareButton {id} {className} {props} {title} {onClick} on:mount>

View File

@ -8,7 +8,7 @@
export let label: string;
export let title: string;
export let onClick: (event: ClickEvent) => void;
export let onClick: (event: MouseEvent) => void;
export let disables = true;
let buttonRef: HTMLButtonElement;

View File

@ -1,6 +1,5 @@
<script lang="typescript">
import { onMount, createEventDispatcher, getContext } from "svelte";
import type { Readable } from "svelte/store";
import { disabledKey } from "./contextKeys";
import SelectOption from "./SelectOption.svelte";
@ -19,7 +18,7 @@
return `form-select ${classes}`;
}
export let disables;
export let disables = true;
export let options: Option[];
let buttonRef: HTMLSelectElement;

View File

@ -8,7 +8,7 @@
export let props: Record<string, string> = {};
export let title: string;
export let onClick: (event: ClickEvent) => void;
export let onClick: (event: MouseEvent) => void;
export let active = false;
let buttonRef: HTMLButtonElement;

View File

@ -1,6 +1,4 @@
<script lang="typescript">
import { onMount } from "svelte";
import type { ButtonDefinition } from "./types";
export let button: ButtonDefinition;

View File

@ -1,2 +1,2 @@
export let nightModeKey = Symbol("nightMode");
export let disabledKey = Symbol("disabled");
export const nightModeKey = Symbol("nightMode");
export const disabledKey = Symbol("disabled");