diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-05 14:45:21 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-05 14:45:21 +0200 |
| commit | b7e39b59fd0fc7b5610ebff29035bf622079e0d8 (patch) | |
| tree | 64be84ebbdac9f7ceced983390c53b10d575af5c /old-apps/web-shared/src/components/chip.svelte | |
| parent | 2001c035fbb417ab0a3d42cfb04d17420bde4086 (diff) | |
| download | greatoffice-b7e39b59fd0fc7b5610ebff29035bf622079e0d8.tar.xz greatoffice-b7e39b59fd0fc7b5610ebff29035bf622079e0d8.zip | |
refactor: Change file structure
Diffstat (limited to 'old-apps/web-shared/src/components/chip.svelte')
| -rw-r--r-- | old-apps/web-shared/src/components/chip.svelte | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/old-apps/web-shared/src/components/chip.svelte b/old-apps/web-shared/src/components/chip.svelte deleted file mode 100644 index 7fbb445..0000000 --- a/old-apps/web-shared/src/components/chip.svelte +++ /dev/null @@ -1,50 +0,0 @@ -<script> - import {IconNames} from "$shared/lib/configuration"; - import {createEventDispatcher} from "svelte"; - import Button from "./button.svelte"; - - const dispatch = createEventDispatcher(); - export let removable = false; - export let clickable = false; - export let text = ""; - export let id = ""; - export let color = ""; - export let tabindex = ""; - - function handle_remove() { - if (removable) { - dispatch("remove", { - id - }); - } - } - - function handle_click() { - if (clickable) { - dispatch("clicked", { - id - }); - } - } -</script> - -<div class="chip break-word text-sm justify-between justify-start@md {clickable ? 'chip--interactive' : ''}" - on:click={handle_click} - id={id} - style={color !== "" ? `background-color: ${color}15; border: 1px solid ${color}; color: ${color}` : ""} - {tabindex} -> - <span class="chip__label">{text}</span> - - {#if removable} - <Button class="chip__btn" - variant="reset" - style="{color !== '' ? `background-color: ${color}45;` : ''}" - {tabindex} - icon="{IconNames.x}" - icon_width="initial" - icon_height="initial" - on:click={handle_remove} - /> - {/if} -</div> |
