Skip to content

Commit

Permalink
fix(core/split-button-item): deprecate component (#760)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Maurer <lukas.maurer@siemens.com>
  • Loading branch information
danielleroux and nuke-ellington authored Sep 19, 2023
1 parent a396383 commit 950c66a
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 43 deletions.
4 changes: 4 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v2.0.0

### Deprecated `ix-split-button-item`

Use `ix-dropdown-item` instead of `ix-split-button-item`. `ix-split-button-item` will be removed in the next major release.

### `ix-dropdown-item` remove 'itemClick' event

Remove `itemClick` event use native `click` event instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: ` <ix-split-button icon="document" splitIcon="chevron-down-small">
<ix-split-button-item icon="cut"></ix-split-button-item>
<ix-split-button-item icon="bulb"></ix-split-button-item>
<ix-dropdown-item icon="cut"></ix-dropdown-item>
<ix-dropdown-item icon="bulb"></ix-dropdown-item>
</ix-split-button>`,
})
export default class SplitButtonIcons {}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Component } from '@angular/core';
selector: 'app-example',
template: `
<ix-split-button label="Action text" splitIcon="chevron-down-small">
<ix-split-button-item label="Item 1"></ix-split-button-item>
<ix-split-button-item label="Item 2"></ix-split-button-item>
<ix-dropdown-item label="Item 1"></ix-dropdown-item>
<ix-dropdown-item label="Item 2"></ix-dropdown-item>
</ix-split-button>
`,
})
Expand Down
8 changes: 7 additions & 1 deletion packages/core/component-doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9824,7 +9824,12 @@
"overview": "",
"usage": {},
"docs": "",
"docsTags": [],
"docsTags": [
{
"name": "deprecated",
"text": "since 2.0.0. Use the `ix-dropdown-item` component instead."
}
],
"encapsulation": "shadow",
"dependents": [],
"dependencies": [
Expand All @@ -9838,6 +9843,7 @@
"ix-icon"
]
},
"deprecation": "since 2.0.0. Use the `ix-dropdown-item` component instead.",
"props": [
{
"name": "icon",
Expand Down
12 changes: 12 additions & 0 deletions packages/core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,9 @@ export namespace Components {
*/
"variant": SplitButtonVariant;
}
/**
* @deprecated since 2.0.0. Use the `ix-dropdown-item` component instead.
*/
interface IxSplitButtonItem {
/**
* Dropdown icon
Expand Down Expand Up @@ -2879,6 +2882,9 @@ declare global {
prototype: HTMLIxSplitButtonElement;
new (): HTMLIxSplitButtonElement;
};
/**
* @deprecated since 2.0.0. Use the `ix-dropdown-item` component instead.
*/
interface HTMLIxSplitButtonItemElement extends Components.IxSplitButtonItem, HTMLStencilElement {
}
var HTMLIxSplitButtonItemElement: {
Expand Down Expand Up @@ -4901,6 +4907,9 @@ declare namespace LocalJSX {
*/
"variant"?: SplitButtonVariant;
}
/**
* @deprecated since 2.0.0. Use the `ix-dropdown-item` component instead.
*/
interface IxSplitButtonItem {
/**
* Dropdown icon
Expand Down Expand Up @@ -5635,6 +5644,9 @@ declare module "@stencil/core" {
"ix-slider": LocalJSX.IxSlider & JSXBase.HTMLAttributes<HTMLIxSliderElement>;
"ix-spinner": LocalJSX.IxSpinner & JSXBase.HTMLAttributes<HTMLIxSpinnerElement>;
"ix-split-button": LocalJSX.IxSplitButton & JSXBase.HTMLAttributes<HTMLIxSplitButtonElement>;
/**
* @deprecated since 2.0.0. Use the `ix-dropdown-item` component instead.
*/
"ix-split-button-item": LocalJSX.IxSplitButtonItem & JSXBase.HTMLAttributes<HTMLIxSplitButtonItemElement>;
"ix-tab-item": LocalJSX.IxTabItem & JSXBase.HTMLAttributes<HTMLIxTabItemElement>;
"ix-tabs": LocalJSX.IxTabs & JSXBase.HTMLAttributes<HTMLIxTabsElement>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import {
Prop,
} from '@stencil/core';

/**
* @deprecated since 2.0.0. Use the `ix-dropdown-item` component instead.
*/
@Component({
tag: 'ix-split-button-item',
styleUrl: 'split-button-item.css',
Expand Down
6 changes: 0 additions & 6 deletions packages/core/src/components/split-button/split-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ export class SplitButton {
private triggerElement: HTMLElement;
private dropdownElement: HTMLIxDropdownElement;

get splitItems() {
return Array.from(
this.hostElement.querySelectorAll('ix-split-button-item')
);
}

private linkTriggerRef() {
if (this.triggerElement && this.dropdownElement) {
this.dropdownElement.trigger = this.triggerElement;
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/tests/split-button/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
</head>
<body>
<ix-split-button label="Test">
<ix-split-button-item label="Item 1" icon="print" />
<ix-split-button-item label="Item 2" icon="print" />
<ix-split-button-item label="Item 3" icon="print" />
<ix-dropdown-item label="Item 1" icon="print"></ix-dropdown-item>
<ix-dropdown-item label="Item 2" icon="print"></ix-dropdown-item>
<ix-dropdown-item label="Item 3" icon="print"></ix-dropdown-item>
</ix-split-button>
<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
Expand Down
12 changes: 1 addition & 11 deletions packages/documentation/docs/controls/split-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ frameworks={{
vue: SourceVueSplitButtonIcons
}}></Playground>

## Properties (ix-split-button)
## Properties

### Props

Expand All @@ -52,13 +52,3 @@ frameworks={{
### Events

<Events />

## Properties (ix-split-button-item)

### Props

<ItemProps />

### Events

<ItemEvents />
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<body class="theme-brand-dark">
<!-- Preview code -->
<ix-split-button icon="document" split-icon="chevron-down-small">
<ix-split-button-item icon="cut"></ix-split-button-item>
<ix-split-button-item icon="bulb"></ix-split-button-item>
<ix-dropdown-item icon="cut"></ix-dropdown-item>
<ix-dropdown-item icon="bulb"></ix-dropdown-item>
</ix-split-button>
<!-- Preview code -->
<script type="module" src="./init.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions packages/html-test-app/src/preview-examples/split-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<body class="theme-brand-dark">
<!-- Preview code -->
<ix-split-button label="Action text" split-icon="chevron-down-small">
<ix-split-button-item label="Item 1"></ix-split-button-item>
<ix-split-button-item label="Item 2"></ix-split-button-item>
<ix-dropdown-item label="Item 1"></ix-dropdown-item>
<ix-dropdown-item label="Item 2"></ix-dropdown-item>
</ix-split-button>
<!-- Preview code -->
<script type="module" src="./init.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* LICENSE file in the root directory of this source tree.
*/

import { IxSplitButton, IxSplitButtonItem } from '@siemens/ix-react';
import { IxDropdownItem, IxSplitButton } from '@siemens/ix-react';
import React from 'react';

export default () => {
return (
<IxSplitButton label="Action text" splitIcon='chevron-down-small'>
<IxSplitButtonItem label="Item 1" icon="cut"></IxSplitButtonItem>
<IxSplitButtonItem label="Item 2" icon="bulb"></IxSplitButtonItem>
<IxSplitButton label="Action text" splitIcon="chevron-down-small">
<IxDropdownItem label="Item 1" icon="cut"></IxDropdownItem>
<IxDropdownItem label="Item 2" icon="bulb"></IxDropdownItem>
</IxSplitButton>
);
};
8 changes: 4 additions & 4 deletions packages/react-test-app/src/preview-examples/split-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* LICENSE file in the root directory of this source tree.
*/

import { IxSplitButton, IxSplitButtonItem } from '@siemens/ix-react';
import { IxDropdownItem, IxSplitButton } from '@siemens/ix-react';
import React from 'react';

export default () => {
return (
<IxSplitButton label="Action text" splitIcon='chevron-down-small'>
<IxSplitButtonItem label="Item 1"></IxSplitButtonItem>
<IxSplitButtonItem label="Item 2"></IxSplitButtonItem>
<IxSplitButton label="Action text" splitIcon="chevron-down-small">
<IxDropdownItem label="Item 1"></IxDropdownItem>
<IxDropdownItem label="Item 2"></IxDropdownItem>
</IxSplitButton>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
-->

<script setup lang="ts">
import { IxSplitButton, IxSplitButtonItem } from '@siemens/ix-vue';
import { IxSplitButton, IxDropdownItem } from '@siemens/ix-vue';
</script>

<template>
<IxSplitButton label="Action text">
<IxSplitButtonItem label="Item 1" icon="cut"></IxSplitButtonItem>
<IxSplitButtonItem label="Item 2" icon="bulb"></IxSplitButtonItem>
<IxDropdownItem label="Item 1" icon="cut"></IxDropdownItem>
<IxDropdownItem label="Item 2" icon="bulb"></IxDropdownItem>
</IxSplitButton>
</template>
6 changes: 3 additions & 3 deletions packages/vue-test-app/src/preview-examples/split-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
-->

<script setup lang="ts">
import { IxSplitButton, IxSplitButtonItem } from '@siemens/ix-vue';
import { IxSplitButton, IxDropdownItem } from '@siemens/ix-vue';
</script>

<template>
<IxSplitButton label="Action text">
<IxSplitButtonItem label="Item 1"></IxSplitButtonItem>
<IxSplitButtonItem label="Item 2"></IxSplitButtonItem>
<IxDropdownItem label="Item 1"></IxDropdownItem>
<IxDropdownItem label="Item 2"></IxDropdownItem>
</IxSplitButton>
</template>

0 comments on commit 950c66a

Please sign in to comment.