mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(multi-select): forward "on:clear" event
This commit is contained in:
parent
956b316009
commit
a016bf897c
3 changed files with 23 additions and 11 deletions
|
@ -2749,6 +2749,7 @@ No slots.
|
||||||
|
|
||||||
### Forwarded events
|
### Forwarded events
|
||||||
|
|
||||||
|
- `on:clear`
|
||||||
- `on:keydown`
|
- `on:keydown`
|
||||||
- `on:focus`
|
- `on:focus`
|
||||||
- `on:blur`
|
- `on:blur`
|
||||||
|
|
|
@ -8051,11 +8051,22 @@
|
||||||
],
|
],
|
||||||
"slots": [],
|
"slots": [],
|
||||||
"forwarded_events": [
|
"forwarded_events": [
|
||||||
|
[
|
||||||
|
"clear",
|
||||||
|
{
|
||||||
|
"start": 8393,
|
||||||
|
"end": 8401,
|
||||||
|
"type": "EventHandler",
|
||||||
|
"name": "clear",
|
||||||
|
"modifiers": [],
|
||||||
|
"expression": null
|
||||||
|
}
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"keydown",
|
"keydown",
|
||||||
{
|
{
|
||||||
"start": 9267,
|
"start": 9289,
|
||||||
"end": 9277,
|
"end": 9299,
|
||||||
"type": "EventHandler",
|
"type": "EventHandler",
|
||||||
"name": "keydown",
|
"name": "keydown",
|
||||||
"modifiers": [],
|
"modifiers": [],
|
||||||
|
@ -8065,8 +8076,8 @@
|
||||||
[
|
[
|
||||||
"focus",
|
"focus",
|
||||||
{
|
{
|
||||||
"start": 9769,
|
"start": 9791,
|
||||||
"end": 9777,
|
"end": 9799,
|
||||||
"type": "EventHandler",
|
"type": "EventHandler",
|
||||||
"name": "focus",
|
"name": "focus",
|
||||||
"modifiers": [],
|
"modifiers": [],
|
||||||
|
@ -8076,8 +8087,8 @@
|
||||||
[
|
[
|
||||||
"blur",
|
"blur",
|
||||||
{
|
{
|
||||||
"start": 9788,
|
"start": 9810,
|
||||||
"end": 9795,
|
"end": 9817,
|
||||||
"type": "EventHandler",
|
"type": "EventHandler",
|
||||||
"name": "blur",
|
"name": "blur",
|
||||||
"modifiers": [],
|
"modifiers": [],
|
||||||
|
|
|
@ -169,11 +169,10 @@
|
||||||
let fieldRef = null;
|
let fieldRef = null;
|
||||||
let selectionRef = null;
|
let selectionRef = null;
|
||||||
let inputRef = null;
|
let inputRef = null;
|
||||||
|
let inputValue = "";
|
||||||
$: inputValue = "";
|
let initialSorted = false;
|
||||||
$: initialSorted = false;
|
let highlightedIndex = -1;
|
||||||
$: highlightedIndex = -1;
|
let prevChecked = [];
|
||||||
$: prevChecked = [];
|
|
||||||
|
|
||||||
setContext("MultiSelect", {
|
setContext("MultiSelect", {
|
||||||
declareRef: ({ key, ref }) => {
|
declareRef: ({ key, ref }) => {
|
||||||
|
@ -335,6 +334,7 @@
|
||||||
{#if checked.length > 0}
|
{#if checked.length > 0}
|
||||||
<ListBoxSelection
|
<ListBoxSelection
|
||||||
selectionCount="{checked.length}"
|
selectionCount="{checked.length}"
|
||||||
|
on:clear
|
||||||
on:clear="{() => {
|
on:clear="{() => {
|
||||||
sortedItems = sortedItems.map((item) => ({
|
sortedItems = sortedItems.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue