@likable-hair/svelte 3.1.1 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,22 +5,24 @@ import Button from "../buttons/Button.svelte";
|
|
|
5
5
|
import { createEventDispatcher } from "svelte";
|
|
6
6
|
export let close = false, closeIcon = "mdi-close-circle", disabled = false, filter = false, filterIcon = "mdi-check", label = false, outlined = false, buttonTabIndex = null, truncateText = false;
|
|
7
7
|
const dispatch = createEventDispatcher();
|
|
8
|
-
function handleChipClick() {
|
|
9
|
-
dispatch("click");
|
|
8
|
+
function handleChipClick(e) {
|
|
9
|
+
dispatch("click", { native: e });
|
|
10
10
|
}
|
|
11
11
|
function handleCloseClick(e) {
|
|
12
12
|
e.detail.nativeEvent.stopPropagation();
|
|
13
|
-
dispatch("close"
|
|
13
|
+
dispatch("close", {
|
|
14
|
+
native: e.detail.nativeEvent
|
|
15
|
+
});
|
|
14
16
|
}
|
|
15
17
|
</script>
|
|
16
18
|
|
|
17
|
-
<
|
|
19
|
+
<button
|
|
18
20
|
class="chip"
|
|
19
21
|
class:label
|
|
20
22
|
class:outlined
|
|
21
23
|
class:disabled
|
|
24
|
+
disabled={disabled}
|
|
22
25
|
on:click={handleChipClick}
|
|
23
|
-
on:keypress={handleChipClick}
|
|
24
26
|
>
|
|
25
27
|
{#if filter}
|
|
26
28
|
<div class="icon-before">
|
|
@@ -42,12 +44,14 @@ function handleCloseClick(e) {
|
|
|
42
44
|
--button-background-color="transparent"
|
|
43
45
|
--button-padding="0px"
|
|
44
46
|
--button-color="var(--chip-color, var(--chip-default-color))"
|
|
47
|
+
--button-default-icon-active-color="var(--chip-color, var(--chip-default-color))"
|
|
48
|
+
--button-default-focus-active-color="var(--chip-color, var(--chip-default-color))"
|
|
45
49
|
on:click
|
|
46
50
|
={handleCloseClick}
|
|
47
51
|
/>
|
|
48
52
|
</div>
|
|
49
53
|
{/if}
|
|
50
|
-
</
|
|
54
|
+
</button>
|
|
51
55
|
|
|
52
56
|
<style>
|
|
53
57
|
.chip {
|
|
@@ -70,6 +74,13 @@ function handleCloseClick(e) {
|
|
|
70
74
|
--chip-cursor,
|
|
71
75
|
var(--chip-default-cursor)
|
|
72
76
|
);
|
|
77
|
+
|
|
78
|
+
outline: inherit;
|
|
79
|
+
background-image: none;
|
|
80
|
+
text-transform: none;
|
|
81
|
+
line-height: inherit;
|
|
82
|
+
border: none;
|
|
83
|
+
font: inherit;
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
.truncate {
|
|
@@ -14,8 +14,12 @@ declare const __propDef: {
|
|
|
14
14
|
truncateText?: boolean | undefined;
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
17
|
-
click: CustomEvent<
|
|
18
|
-
|
|
17
|
+
click: CustomEvent<{
|
|
18
|
+
native: MouseEvent;
|
|
19
|
+
}>;
|
|
20
|
+
close: CustomEvent<{
|
|
21
|
+
native: MouseEvent;
|
|
22
|
+
}>;
|
|
19
23
|
} & {
|
|
20
24
|
[evt: string]: CustomEvent<any>;
|
|
21
25
|
};
|