mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(header-action): type missing "open" event (#1293)
* fix(header-action): type missing "open" event * Run "yarn build:docs" * test(header-utilities): assert "open" and "close" events
This commit is contained in:
parent
1454eeae19
commit
5576c7ce84
5 changed files with 20 additions and 7 deletions
|
@ -1609,9 +1609,10 @@ None.
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :--------- | :--------- | :----- |
|
| :--------- | :--------- | :---------------- |
|
||||||
|
| open | dispatched | <code>null</code> |
|
||||||
|
| close | dispatched | <code>null</code> |
|
||||||
| click | forwarded | -- |
|
| click | forwarded | -- |
|
||||||
| close | dispatched | -- |
|
|
||||||
|
|
||||||
## `HeaderActionLink`
|
## `HeaderActionLink`
|
||||||
|
|
||||||
|
|
|
@ -4573,8 +4573,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"events": [
|
"events": [
|
||||||
{ "type": "forwarded", "name": "click", "element": "button" },
|
{ "type": "dispatched", "name": "open", "detail": "null" },
|
||||||
{ "type": "dispatched", "name": "close" }
|
{ "type": "dispatched", "name": "close", "detail": "null" },
|
||||||
|
{ "type": "forwarded", "name": "click", "element": "button" }
|
||||||
],
|
],
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "Element", "name": "button" }
|
"rest_props": { "type": "Element", "name": "button" }
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* @event {null} open
|
||||||
|
* @event {null} close
|
||||||
|
*/
|
||||||
|
|
||||||
/** Set to `true` to open the panel */
|
/** Set to `true` to open the panel */
|
||||||
export let isOpen = false;
|
export let isOpen = false;
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
<HeaderGlobalAction aria-label="Settings" icon="{SettingsAdjust}" />
|
<HeaderGlobalAction aria-label="Settings" icon="{SettingsAdjust}" />
|
||||||
<HeaderAction
|
<HeaderAction
|
||||||
bind:isOpen
|
bind:isOpen
|
||||||
|
on:open
|
||||||
|
on:close
|
||||||
transition="{{ duration: 400, easing: quintOut }}"
|
transition="{{ duration: 400, easing: quintOut }}"
|
||||||
>
|
>
|
||||||
<HeaderPanelLinks>
|
<HeaderPanelLinks>
|
||||||
|
|
6
types/UIShell/HeaderAction.svelte.d.ts
vendored
6
types/UIShell/HeaderAction.svelte.d.ts
vendored
|
@ -46,6 +46,10 @@ export interface HeaderActionProps
|
||||||
|
|
||||||
export default class HeaderAction extends SvelteComponentTyped<
|
export default class HeaderAction extends SvelteComponentTyped<
|
||||||
HeaderActionProps,
|
HeaderActionProps,
|
||||||
{ click: WindowEventMap["click"]; close: CustomEvent<any> },
|
{
|
||||||
|
open: CustomEvent<null>;
|
||||||
|
close: CustomEvent<null>;
|
||||||
|
click: WindowEventMap["click"];
|
||||||
|
},
|
||||||
{ default: {}; closeIcon: {}; icon: {}; text: {} }
|
{ default: {}; closeIcon: {}; icon: {}; text: {} }
|
||||||
> {}
|
> {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue