Skip to content

Commit

Permalink
feat(core): controlled behavior (#1676)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
  • Loading branch information
nuke-ellington and danielleroux authored Feb 17, 2025
1 parent 8bec56d commit 4685dc2
Show file tree
Hide file tree
Showing 31 changed files with 792 additions and 46 deletions.
7 changes: 7 additions & 0 deletions .changeset/eighty-doors-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siemens/ix-angular': minor
'@siemens/ix': minor
'@siemens/ix-vue': minor
---

`ix-flip-tile`: Expsose `index` property to allow setting of displayed content and add `toggle` event.
7 changes: 7 additions & 0 deletions .changeset/shy-lions-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siemens/ix-angular': minor
'@siemens/ix': minor
'@siemens/ix-vue': minor
---

`ix-menu`: Add `openSettings` and `openAbout` events. Event `expandChange` can now be prevented via `event.preventDefault()`.
5 changes: 5 additions & 0 deletions .changeset/tender-planes-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siemens/ix': minor
---

`ìx-drawer`: Events `open` and `drawerClose` can now be prevented via`event.preventDefault()`.
7 changes: 7 additions & 0 deletions .changeset/thick-vans-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siemens/ix-angular': minor
'@siemens/ix': minor
'@siemens/ix-vue': minor
---

Add `tabChange` event to `ix-menu-settings` and `ix-menu-about`.
34 changes: 28 additions & 6 deletions packages/angular/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1058,25 +1058,31 @@ export declare interface IxFilterChip extends Components.IxFilterChip {


@ProxyCmp({
inputs: ['height', 'state', 'width']
inputs: ['height', 'index', 'state', 'width']
})
@Component({
selector: 'ix-flip-tile',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['height', 'state', 'width'],
inputs: ['height', 'index', 'state', 'width'],
})
export class IxFlipTile {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['toggle']);
}
}


export declare interface IxFlipTile extends Components.IxFlipTile {}
export declare interface IxFlipTile extends Components.IxFlipTile {
/**
* Event emitted when the index changes @since 3.0.0
*/
toggle: EventEmitter<CustomEvent<number>>;
}


@ProxyCmp({
Expand Down Expand Up @@ -1524,7 +1530,7 @@ export class IxMenu {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['expandChange', 'mapExpandChange', 'openAppSwitch']);
proxyOutputs(this, this.el, ['expandChange', 'mapExpandChange', 'openAppSwitch', 'openSettings', 'openAbout']);
}
}

Expand All @@ -1542,6 +1548,14 @@ export declare interface IxMenu extends Components.IxMenu {
* Event emitted when the app switch button is clicked @since 3.0.0
*/
openAppSwitch: EventEmitter<CustomEvent<void>>;
/**
* Event emitted when the settings button is clicked @since 3.0.0
*/
openSettings: EventEmitter<CustomEvent<void>>;
/**
* Event emitted when the about button is clicked @since 3.0.0
*/
openAbout: EventEmitter<CustomEvent<void>>;
}


Expand All @@ -1560,14 +1574,18 @@ export class IxMenuAbout {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['close']);
proxyOutputs(this, this.el, ['tabChange', 'close']);
}
}


import type { CustomCloseEvent as IIxMenuAboutCustomCloseEvent } from '@siemens/ix';

export declare interface IxMenuAbout extends Components.IxMenuAbout {
/**
* Active tab changed @since 3.0.0
*/
tabChange: EventEmitter<CustomEvent<string>>;
/**
* About and Legal closed
*/
Expand Down Expand Up @@ -1752,14 +1770,18 @@ export class IxMenuSettings {
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['close']);
proxyOutputs(this, this.el, ['tabChange', 'close']);
}
}


import type { CustomCloseEvent as IIxMenuSettingsCustomCloseEvent } from '@siemens/ix';

export declare interface IxMenuSettings extends Components.IxMenuSettings {
/**
* Active tab changed @since 3.0.0
*/
tabChange: EventEmitter<CustomEvent<string>>;
/**
* Popover closed
*/
Expand Down
125 changes: 124 additions & 1 deletion packages/core/component-doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8662,6 +8662,33 @@
"optional": false,
"required": false
},
{
"name": "index",
"type": "number",
"complexType": {
"original": "number",
"resolved": "number",
"references": {}
},
"mutable": false,
"attr": "index",
"reflectToAttr": false,
"docs": "Index of the currently visible content",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
],
"default": "0",
"values": [
{
"type": "number"
}
],
"optional": false,
"required": false
},
{
"name": "state",
"type": "FlipTileState.Alarm | FlipTileState.Info | FlipTileState.None | FlipTileState.Primary | FlipTileState.Warning | undefined",
Expand Down Expand Up @@ -8737,7 +8764,27 @@
}
],
"methods": [],
"events": [],
"events": [
{
"event": "toggle",
"detail": "number",
"bubbles": true,
"complexType": {
"original": "number",
"resolved": "number",
"references": {}
},
"cancelable": true,
"composed": true,
"docs": "Event emitted when the index changes",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
]
}
],
"styles": [],
"slots": [],
"parts": [],
Expand Down Expand Up @@ -12516,6 +12563,25 @@
"docs": "Map Sidebar expanded",
"docsTags": []
},
{
"event": "openAbout",
"detail": "void",
"bubbles": true,
"complexType": {
"original": "void",
"resolved": "void",
"references": {}
},
"cancelable": true,
"composed": true,
"docs": "Event emitted when the about button is clicked",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
]
},
{
"event": "openAppSwitch",
"detail": "void",
Expand All @@ -12534,6 +12600,25 @@
"text": "3.0.0"
}
]
},
{
"event": "openSettings",
"detail": "void",
"bubbles": true,
"complexType": {
"original": "void",
"resolved": "void",
"references": {}
},
"cancelable": true,
"composed": true,
"docs": "Event emitted when the settings button is clicked",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
]
}
],
"styles": [],
Expand Down Expand Up @@ -12672,6 +12757,25 @@
"composed": true,
"docs": "About and Legal closed",
"docsTags": []
},
{
"event": "tabChange",
"detail": "string",
"bubbles": true,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"cancelable": true,
"composed": true,
"docs": "Active tab changed",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
]
}
],
"styles": [],
Expand Down Expand Up @@ -13777,6 +13881,25 @@
"composed": true,
"docs": "Popover closed",
"docsTags": []
},
{
"event": "tabChange",
"detail": "string",
"bubbles": true,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"cancelable": true,
"composed": true,
"docs": "Active tab changed",
"docsTags": [
{
"name": "since",
"text": "3.0.0"
}
]
}
],
"styles": [],
Expand Down
Loading

0 comments on commit 4685dc2

Please sign in to comment.