Skip to content

feat: update to UI5 Web Components 2.5.0 #6696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,054 changes: 907 additions & 147 deletions .storybook/custom-element-manifests/fiori.json

Large diffs are not rendered by default.

923 changes: 810 additions & 113 deletions .storybook/custom-element-manifests/main.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { StorybookConfig } from '@storybook/react-vite';
import { dirname, join } from 'path';
import type { StorybookConfig } from '@storybook/react-vite';
import remarkGfm from 'remark-gfm';
import { isChromatic } from './utils';

Expand Down
3 changes: 2 additions & 1 deletion config/version-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@
"2.1.2": "2.0.0",
"2.2.0": "2.1.0",
"2.3.0": "2.2.0",
"2.4.0": "2.4.0"
"2.4.0": "2.4.0",
"2.5.0": "2.5.0"
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@storybook/react": "8.4.5",
"@storybook/react-vite": "8.4.5",
"@storybook/theming": "8.4.5",
"@ui5/webcomponents": "2.4.0",
"@ui5/webcomponents-compat": "2.4.0",
"@ui5/webcomponents-fiori": "2.4.0",
"@ui5/webcomponents-icons": "2.4.0",
"@ui5/webcomponents": "2.5.0",
"@ui5/webcomponents-compat": "2.5.0",
"@ui5/webcomponents-fiori": "2.5.0",
"@ui5/webcomponents-icons": "2.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"remark-gfm": "^4.0.0",
Expand All @@ -65,7 +65,7 @@
"@types/node": "^22.0.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@ui5/webcomponents-tools": "2.4.0",
"@ui5/webcomponents-tools": "2.5.0",
"@vitejs/plugin-react": "^4.2.0",
"chromatic": "^11.0.0",
"cssnano": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"peerDependencies": {
"@types/react": "*",
"@ui5/webcomponents-base": "~2.4.0",
"@ui5/webcomponents-base": "~2.5.0",
"react": "^18 || ^19"
},
"peerDependenciesMeta": {
Expand Down
4 changes: 2 additions & 2 deletions packages/charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"recharts": "2.14.1"
},
"peerDependencies": {
"@ui5/webcomponents-react": "~2.4.0",
"@ui5/webcomponents-react-base": "~2.4.0",
"@ui5/webcomponents-react": "~2.5.0",
"@ui5/webcomponents-react-base": "~2.5.0",
"react": "^18"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"@ui5/webcomponents-compat": "~2.4.0",
"@ui5/webcomponents-react": "~2.4.0",
"@ui5/webcomponents-compat": "~2.5.0",
"@ui5/webcomponents-react": "~2.5.0",
"react": "^18 || ^19",
"react-dom": "^18 || ^19"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"@ui5/webcomponents": "~2.4.0",
"@ui5/webcomponents-base": "~2.4.0",
"@ui5/webcomponents-fiori": "~2.4.0",
"@ui5/webcomponents-icons": "~2.4.0",
"@ui5/webcomponents": "~2.5.0",
"@ui5/webcomponents-base": "~2.5.0",
"@ui5/webcomponents-fiori": "~2.5.0",
"@ui5/webcomponents-icons": "~2.5.0",
"react": "^18 || ^19",
"react-dom": "^18 || ^19"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/webComponents/AvatarGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface AvatarGroupPropTypes
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onClick?: (event: Ui5CustomEvent<AvatarGroupDomRef, AvatarGroupClickEventDetail>) => void;

Expand All @@ -87,7 +87,7 @@ interface AvatarGroupPropTypes
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onOverflow?: (event: Ui5CustomEvent<AvatarGroupDomRef>) => void;
}
Expand Down
9 changes: 9 additions & 0 deletions packages/main/src/webComponents/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ interface ButtonAttributes {
*/
accessibilityAttributes?: ButtonAccessibilityAttributes;

/**
* Defines the accessible description of the component.
*
* **Note:** Available since [v2.5.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.5.0) of **@ui5/webcomponents**.
* @default undefined
*/
accessibleDescription?: string | undefined;

/**
* Defines the accessible ARIA name of the component.
* @default undefined
Expand Down Expand Up @@ -170,6 +178,7 @@ const Button = withWebComponent<ButtonPropTypes, ButtonDomRef>(
'ui5-button',
[
'accessibilityAttributes',
'accessibleDescription',
'accessibleName',
'accessibleNameRef',
'accessibleRole',
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/webComponents/CardHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface CardHeaderAttributes {

/**
* Defines if the component would be interactive,
* e.g gets hover effect, gets focus outline and `click` event is fired, when pressed.
* e.g gets hover effect and `click` event is fired, when pressed.
* @default false
*/
interactive?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/webComponents/ColorPalette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface ColorPalettePropTypes extends ColorPaletteAttributes, Omit<CommonProps
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onItemClick?: (event: Ui5CustomEvent<ColorPaletteDomRef, ColorPaletteItemClickEventDetail>) => void;
}
Expand Down
10 changes: 9 additions & 1 deletion packages/main/src/webComponents/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ interface ColorPickerAttributes {
*/
name?: string | undefined;

/**
* When set to `true`, the alpha slider and inputs for RGB values will not be displayed.
*
* **Note:** Available since [v2.5.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.5.0) of **@ui5/webcomponents**.
* @default false
*/
simplified?: boolean;

/**
* Defines the currently selected color of the component.
*
Expand Down Expand Up @@ -60,7 +68,7 @@ interface ColorPickerPropTypes
const ColorPicker = withWebComponent<ColorPickerPropTypes, ColorPickerDomRef>(
'ui5-color-picker',
['name', 'value'],
[],
['simplified'],
[],
['change']
);
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/webComponents/ComboBoxItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface ComboBoxItemPropTypes extends ComboBoxItemAttributes, Omit<CommonProps
* The `ComboBoxItem` represents the item for a `ComboBox`.
*
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
* @abstract
*/
const ComboBoxItem = withWebComponent<ComboBoxItemPropTypes, ComboBoxItemDomRef>(
'ui5-cb-item',
Expand Down
59 changes: 53 additions & 6 deletions packages/main/src/webComponents/ComboBoxItemGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
'use client';

import '@ui5/webcomponents/dist/ComboBoxItemGroup.js';
import type { ListItemGroupMoveEventDetail } from '@ui5/webcomponents/dist/ListItemGroup.js';
import type { ReactNode } from 'react';
import { withWebComponent } from '../../internal/withWebComponent.js';
import type { CommonProps, Ui5DomRef } from '../../types/index.js';
import type { CommonProps, Ui5CustomEvent, Ui5DomRef, UI5WCSlotsNode } from '../../types/index.js';

interface ComboBoxItemGroupAttributes {
/**
* Defines the text of the component.
* Defines the accessible name of the header.
* @default undefined
*/
headerAccessibleName?: string | undefined;

/**
* Defines the header text of the <code>ui5-li-group</code>.
* @default undefined
*/
headerText?: string | undefined;
Expand All @@ -17,11 +24,51 @@ interface ComboBoxItemGroupDomRef extends Required<ComboBoxItemGroupAttributes>,

interface ComboBoxItemGroupPropTypes
extends ComboBoxItemGroupAttributes,
Omit<CommonProps, keyof ComboBoxItemGroupAttributes | 'children'> {
Omit<CommonProps, keyof ComboBoxItemGroupAttributes | 'children' | 'header' | 'onMove' | 'onMoveOver'> {
/**
* Defines the items of the <code>ui5-cb-item-group</code>.
*/
children?: ReactNode | ReactNode[];

/**
* Defines the header of the component.
*
* **Note:** Using this slot, the default header text of group and the value of `headerText` property will be overwritten.
*
* __Note:__ The content of the prop will be rendered into a [&lt;slot&gt;](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) by assigning the respective [slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot) attribute (`slot="header"`).
* Since you can't change the DOM order of slots when declaring them within a prop, it might prove beneficial to manually mount them as part of the component's children, especially when facing problems with the reading order of screen readers.
*
* __Note:__ When passing a custom React component to this prop, you have to make sure your component reads the `slot` prop and appends it to the most outer element of your component.
* Learn more about it [here](https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/knowledge-base-handling-slots--docs).
*/
header?: UI5WCSlotsNode;
/**
* Fired when a movable list item is dropped onto a drop target.
*
* **Note:** `move` event is fired only if there was a preceding `move-over` with prevented default action.
*
* **Note:** Available since [v2.1.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌|✅|
*/
onMove?: (event: Ui5CustomEvent<ComboBoxItemGroupDomRef, ListItemGroupMoveEventDetail>) => void;

/**
* Fired when a movable list item is moved over a potential drop target during a dragging operation.
*
* If the new position is valid, prevent the default action of the event using `preventDefault()`.
*
* **Note:** Call `event.preventDefault()` inside the handler of this event to prevent its default action/s.
*
* **Note:** Available since [v2.1.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.1.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ✅|✅|
*/
onMoveOver?: (event: Ui5CustomEvent<ComboBoxItemGroupDomRef, ListItemGroupMoveEventDetail>) => void;
}

/**
Expand All @@ -33,10 +80,10 @@ interface ComboBoxItemGroupPropTypes
*/
const ComboBoxItemGroup = withWebComponent<ComboBoxItemGroupPropTypes, ComboBoxItemGroupDomRef>(
'ui5-cb-item-group',
['headerText'],
[],
['headerAccessibleName', 'headerText'],
[],
[]
['header'],
['move-over', 'move']
);

ComboBoxItemGroup.displayName = 'ComboBoxItemGroup';
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/webComponents/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ interface DatePickerPropTypes
onChange?: (event: Ui5CustomEvent<DatePickerDomRef, DatePickerChangeEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is closed.
* Fired after the component's picker is closed.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onClose?: (event: Ui5CustomEvent<DatePickerDomRef>) => void;

Expand All @@ -223,13 +223,13 @@ interface DatePickerPropTypes
onInput?: (event: Ui5CustomEvent<DatePickerDomRef, DatePickerInputEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is opened.
* Fired after the component's picker is opened.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onOpen?: (event: Ui5CustomEvent<DatePickerDomRef>) => void;

Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/webComponents/DateRangePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ interface DateRangePickerPropTypes
onChange?: (event: Ui5CustomEvent<DateRangePickerDomRef, DatePickerChangeEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is closed.
* Fired after the component's picker is closed.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onClose?: (event: Ui5CustomEvent<DateRangePickerDomRef>) => void;

Expand All @@ -245,13 +245,13 @@ interface DateRangePickerPropTypes
onInput?: (event: Ui5CustomEvent<DateRangePickerDomRef, DatePickerInputEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is opened.
* Fired after the component's picker is opened.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onOpen?: (event: Ui5CustomEvent<DateRangePickerDomRef>) => void;

Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/webComponents/DateTimePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ interface DateTimePickerPropTypes
onChange?: (event: Ui5CustomEvent<DateTimePickerDomRef, DatePickerChangeEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is closed.
* Fired after the component's picker is closed.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onClose?: (event: Ui5CustomEvent<DateTimePickerDomRef>) => void;

Expand All @@ -223,13 +223,13 @@ interface DateTimePickerPropTypes
onInput?: (event: Ui5CustomEvent<DateTimePickerDomRef, DatePickerInputEventDetail>) => void;

/**
* Fired after the value-help dialog of the component is opened.
* Fired after the component's picker is opened.
*
* **Note:** Available since [v2.4.0](https://github.com/SAP/ui5-webcomponents/releases/tag/v2.4.0) of **@ui5/webcomponents**.
*
* | cancelable | bubbles |
* | :--------: | :-----: |
* | ❌||
* | ❌||
*/
onOpen?: (event: Ui5CustomEvent<DateTimePickerDomRef>) => void;

Expand Down
Loading
Loading