Skip to content

Commit bebb6bb

Browse files
feat: update @ui5/webcomponents to ~1.15.1 (#4811)
Co-authored-by: Lukas Harbarth <[email protected]>
1 parent 87be1b3 commit bebb6bb

File tree

120 files changed

+527
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+527
-385
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"@storybook/react": "7.0.24",
3636
"@storybook/react-vite": "7.0.24",
3737
"@storybook/theming": "7.0.24",
38-
"@ui5/webcomponents": "1.14.5",
39-
"@ui5/webcomponents-fiori": "1.14.5",
40-
"@ui5/webcomponents-icons": "1.14.5",
38+
"@ui5/webcomponents": "1.15.1",
39+
"@ui5/webcomponents-fiori": "1.15.1",
40+
"@ui5/webcomponents-icons": "1.15.1",
4141
"react": "18.2.0",
4242
"react-dom": "18.2.0",
4343
"remark-gfm": "^3.0.1",
@@ -57,7 +57,7 @@
5757
"@types/react-dom": "^18.0.0",
5858
"@typescript-eslint/eslint-plugin": "^5.54.1",
5959
"@typescript-eslint/parser": "^5.54.1",
60-
"@ui5/webcomponents-tools": "1.14.5",
60+
"@ui5/webcomponents-tools": "1.15.1",
6161
"@vitejs/plugin-react": "^4.0.0",
6262
"chromatic": "^6.5.3",
6363
"cypress": "^12.1.0",

packages/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"peerDependencies": {
3232
"@types/react": "*",
33-
"@ui5/webcomponents-base": "~1.14.0",
33+
"@ui5/webcomponents-base": "~1.15.1",
3434
"react": "^16.14.0 || ^17.0.0 || ^18.0.0"
3535
},
3636
"peerDependenciesMeta": {

packages/charts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"recharts": "2.7.1"
3535
},
3636
"peerDependencies": {
37-
"@ui5/webcomponents-react": "~1.16.0",
38-
"@ui5/webcomponents-react-base": "~1.16.0",
37+
"@ui5/webcomponents-react": "~1.17.0",
38+
"@ui5/webcomponents-react-base": "~1.17.0",
3939
"react": "^16.14.0 || ^17.0.0 || ^18.0.0",
4040
"react-jss": "^10.10.0"
4141
},

packages/cra-template-seed/template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"package": {
33
"dependencies": {
4-
"@ui5/webcomponents": "~1.14.0",
5-
"@ui5/webcomponents-fiori": "~1.14.0",
6-
"@ui5/webcomponents-icons": "~1.14.0",
4+
"@ui5/webcomponents": "~1.15.1",
5+
"@ui5/webcomponents-fiori": "~1.15.1",
6+
"@ui5/webcomponents-icons": "~1.15.1",
77
"@ui5/webcomponents-react": "latest",
88
"axios": "^0.27.2",
99
"formik": "^2.2.9",

packages/cra-template/template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"package": {
33
"dependencies": {
4-
"@ui5/webcomponents": "~1.14.0",
5-
"@ui5/webcomponents-fiori": "~1.14.0",
6-
"@ui5/webcomponents-icons": "~1.14.0",
4+
"@ui5/webcomponents": "~1.15.1",
5+
"@ui5/webcomponents-fiori": "~1.15.1",
6+
"@ui5/webcomponents-icons": "~1.15.1",
77
"@ui5/webcomponents-react": "latest",
88
"web-vitals": "^2.1.0"
99
},

packages/main/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"./dist/json-imports/*"
4444
],
4545
"scripts": {
46-
"clean": "rimraf dist tmp wrappers",
46+
"clean": "rimraf dist tmp wrappers ssr",
4747
"build:i18n": "node scripts/generateI18n.mjs",
4848
"build:client": "babel src --out-dir dist --extensions .ts,.tsx --env-name client && tsc --declarationDir dist",
4949
"build:ssr": "babel src --out-dir ssr --extensions .ts,.tsx --env-name ssr && tsc --declarationDir ssr",
@@ -59,10 +59,10 @@
5959
"peerDependencies": {
6060
"@types/react": "*",
6161
"@types/react-dom": "*",
62-
"@ui5/webcomponents": "~1.14.0",
63-
"@ui5/webcomponents-base": "~1.14.0",
64-
"@ui5/webcomponents-fiori": "~1.14.0",
65-
"@ui5/webcomponents-icons": "~1.14.0",
62+
"@ui5/webcomponents": "~1.15.1",
63+
"@ui5/webcomponents-base": "~1.15.1",
64+
"@ui5/webcomponents-fiori": "~1.15.1",
65+
"@ui5/webcomponents-icons": "~1.15.1",
6666
"react": "^16.14.0 || ^17.0.0 || ^18.0.0",
6767
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
6868
},

packages/main/scripts/create-web-components-wrapper.mjs

Lines changed: 7 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ const EXCLUDE_LIST = [];
3434
const WEB_COMPONENTS_ROOT_DIR = path.join(PATHS.packages, 'main', 'src', 'webComponents');
3535
const ENUMS_DIR = path.join(PATHS.packages, 'main', 'src', 'enums');
3636

37-
const EXTENDED_PROP_DESCRIPTION = {
38-
primaryCalendarType: `<br/>__Note:__ Calendar types other than Gregorian must be imported manually:<br />\`import "@ui5/webcomponents-localization/dist/features/calendar/{primaryCalendarType}.js";\``
39-
};
40-
4137
// use JSDoc syntax here
4238
const CUSTOM_MAIN_DESCRIPTION = {
4339
IllustratedMessage: (desc) => {
@@ -49,130 +45,6 @@ ${desc}
4945
}
5046
};
5147

52-
const CUSTOM_DESCRIPTION_REPLACE = {
53-
Avatar: {
54-
icon: (desc) => desc.replace(`<ui5-avatar icon="employee">`, `\`<Avatar icon="employee">\``)
55-
},
56-
ComboBox: {
57-
children: (desc) => {
58-
return desc.replace(
59-
` * Example:
60-
* <ui5-combobox>
61-
*     <ui5-li>Item #1</ui5-li>
62-
*     <ui5-li>Item #2</ui5-li>
63-
* </ui5-combobox>`,
64-
` * Example:
65-
*
66-
* <pre>
67-
* <code>
68-
* &lt;ComboBox><br />
69-
* &nbsp;&nbsp;&lt;StandardListItem>Item #1&lt;/StandardListItem><br />
70-
* &nbsp;&nbsp;&lt;StandardListItem>Item #2&lt;/StandardListItem><br />
71-
* &lt;/ComboBox>
72-
* </code>
73-
* </pre>`
74-
);
75-
}
76-
},
77-
Input: {
78-
children: (description) => {
79-
const formatExample = description.replace(
80-
` * Example:
81-
*
82-
* <ui5-input show-suggestions>
83-
*     <ui5-suggestion-item text="Item #1"></ui5-suggestion-item>
84-
*     <ui5-suggestion-item text="Item #2"></ui5-suggestion-item>
85-
* </ui5-input> `,
86-
` * Example:
87-
*
88-
* <pre>
89-
* <code>
90-
* &lt;Input showSuggestions><br />
91-
* &nbsp;&nbsp;&lt;SuggestionItem text="Item #1" /><br />
92-
* &nbsp;&nbsp;&lt;SuggestionItem text="Item #2" /><br />
93-
* &lt;/Input>
94-
* </code>
95-
* </pre>`
96-
);
97-
return formatExample.replace(/<ui5-suggestion-item>/g, '<SuggestionItem>');
98-
}
99-
},
100-
MultiComboBox: {
101-
children: (desc) => {
102-
return desc.replace(
103-
` * Example:
104-
* <ui5-multi-combobox>
105-
*     <ui5-li>Item #1</ui5-li>
106-
*     <ui5-li>Item #2</ui5-li>
107-
* </ui5-multi-combobox>`,
108-
` * Example:
109-
*
110-
* <pre>
111-
* <code>
112-
* &lt;MultiComboBox><br />
113-
* &nbsp;&nbsp;&lt;StandardListItem>Item #1&lt;/StandardListItem><br />
114-
* &nbsp;&nbsp;&lt;StandardListItem>Item #2&lt;/StandardListItem><br />
115-
* &lt;/MultiComboBox>
116-
* </code>
117-
* </pre>`
118-
);
119-
}
120-
},
121-
MultiInput: {
122-
children: (description) => {
123-
const formatExample = description.replace(
124-
` * Example:
125-
*
126-
* <ui5-input show-suggestions>
127-
*     <ui5-suggestion-item text="Item #1"></ui5-suggestion-item>
128-
*     <ui5-suggestion-item text="Item #2"></ui5-suggestion-item>
129-
* </ui5-input> `,
130-
` * Example:
131-
*
132-
* <pre>
133-
* <code>
134-
* &lt;MultiInput showSuggestions><br />
135-
* &nbsp;&nbsp;&lt;SuggestionItem text="Item #1" /><br />
136-
* &nbsp;&nbsp;&lt;SuggestionItem text="Item #2" /><br />
137-
* &lt;/MultiInput>
138-
* </code>
139-
* </pre>`
140-
);
141-
return formatExample.replace(/<ui5-suggestion-item>/g, '<SuggestionItem>');
142-
},
143-
tokens: (description) => {
144-
return description.replace(
145-
` * Example:
146-
* <ui5-multi-input>
147-
*     <ui5-token slot="tokens" text="Token 1"></ui5-token>
148-
*     <ui5-token slot="tokens" text="Token 2"></ui5-token>
149-
* </ui5-multi-input>`,
150-
` * Example:
151-
*
152-
* <pre>
153-
* <code>
154-
* &lt;MultiInput<br />
155-
* &nbsp;tokens={<br />
156-
* &nbsp;&nbsp;&lt;><br />
157-
* &nbsp;&nbsp;&nbsp;&lt;Token text="Token 1" /><br />
158-
* &nbsp;&nbsp;&nbsp;&lt;Token text="Token 1" /><br />
159-
* &nbsp;&nbsp;&lt;/><br />
160-
* &nbsp;}<br />
161-
* />
162-
* </code>
163-
* </pre>`
164-
);
165-
}
166-
},
167-
ShellBar: {
168-
children: (desc) => {
169-
return desc.replace('<ui5-shellbar-item></ui5-shellbar-item>', '`ShellBarItem`');
170-
},
171-
menuItems: (desc) => {
172-
return desc.replace('<ui5-li></ui5-li>', '`StandardListItem`');
173-
}
174-
}
175-
};
17648
// todo: add StepInput when `onInput` is available (https://github.com/SAP/ui5-webcomponents/issues/5177)
17749
const INPUT_COMPONENTS = new Set([
17850
'ComboBox',
@@ -213,7 +85,7 @@ for (const spec of allWebComponents) {
21385
const filterNonPublicAttributes = (prop) =>
21486
prop.visibility === 'public' && prop.readonly !== 'true' && prop.static !== true;
21587

216-
const replaceTagNameWithModuleName = (description) => {
88+
export const replaceTagNameWithModuleName = (description) => {
21789
let parsedDescription = description.replace(/(ui5-[\w-]+)/g, (fullMatch, tag, ...args) => {
21890
if (tag === 'ui5-link') return tag;
21991
if (tag === 'ui5-webcomponents-react') return tag;
@@ -340,6 +212,7 @@ const createWebComponentWrapper = async (
340212
attributes,
341213
slotsAndEvents,
342214
description: componentDescription,
215+
ui5wcPackage: componentSpec.name.includes('fiori') ? 'fiori' : 'main',
343216
tagName: componentSpec.tagname,
344217
regularProps,
345218
booleanProps,
@@ -443,6 +316,9 @@ const resolveInheritedAttributes = (componentSpec) => {
443316
...mainWebComponentsSpec.symbols.filter((spec) => spec.module.startsWith('types/') && spec.visibility === 'public'),
444317
...fioriWebComponentsSpec.symbols.filter((spec) => spec.module.startsWith('types/') && spec.visibility === 'public')
445318
].forEach((spec) => {
319+
if (spec.module === 'HasPopup') {
320+
return;
321+
}
446322
const template = dedent`
447323
// Generated file - do not change manually!
448324
@@ -457,32 +333,6 @@ const resolveInheritedAttributes = (componentSpec) => {
457333
writeFileSync(path.join(ENUMS_DIR, `${spec.basename}.ts`), prettier.format(template, Utils.prettierConfig));
458334
});
459335

460-
const propDescription = (componentSpec, property) => {
461-
if (!componentSpec.tagname) {
462-
return property.description || '';
463-
}
464-
let formattedDescription = Utils.formatDescription(property.description, componentSpec);
465-
466-
const customDescriptionReplace = CUSTOM_DESCRIPTION_REPLACE[componentSpec.module];
467-
if (customDescriptionReplace && customDescriptionReplace[property.name]) {
468-
formattedDescription = customDescriptionReplace[property.name](formattedDescription);
469-
}
470-
471-
const extendedDescription = EXTENDED_PROP_DESCRIPTION[property.name] ?? '';
472-
473-
if (property.name !== 'children' && componentSpec?.slots?.some((item) => item.name === property.name)) {
474-
formattedDescription += `
475-
*
476-
* __Note:__ This prop will be rendered as [slot](https://www.w3schools.com/tags/tag_slot.asp) (\`slot="${property.name}"\`).
477-
* 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.
478-
*
479-
* __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.
480-
* Learn more about it [here](https://sap.github.io/ui5-webcomponents-react/?path=/docs/knowledge-base-handling-slots--docs).`;
481-
}
482-
483-
return replaceTagNameWithModuleName(`${formattedDescription}${extendedDescription}`);
484-
};
485-
486336
allWebComponents
487337
.filter((spec) => spec.visibility === 'public')
488338
.filter((spec) => !PRIVATE_COMPONENTS[spec.module])
@@ -505,7 +355,7 @@ allWebComponents
505355

506356
attributes.push(dedent`
507357
/**
508-
* ${propDescription(componentSpec, property)}
358+
* ${Utils.propDescription(componentSpec, property)}
509359
*/
510360
${property.name}?: ${tsType.tsType};
511361
`);
@@ -546,7 +396,7 @@ allWebComponents
546396

547397
slotsAndEvents.push(dedent`
548398
/**
549-
* ${propDescription(componentSpec, property)}
399+
* ${Utils.propDescription(componentSpec, property)}
550400
*/
551401
${property.name}?: ${tsType.tsType};
552402
`);

packages/main/src/components/MessageViewButton/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const useStyles = createUseStyles(
5959
{ name: 'MessageViewButtonStyles' }
6060
);
6161

62-
export interface MessageViewButtonProptypes extends Omit<ButtonPropTypes, 'design' | 'icon' | 'iconEnd' | 'children'> {
62+
export interface MessageViewButtonProptypes
63+
extends Omit<ButtonPropTypes, 'design' | 'icon' | 'iconEnd' | 'children' | 'type'> {
6364
/**
6465
* Specifies the type of the button.
6566
*/

packages/main/src/enums/ButtonType.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Generated file - do not change manually!
2+
3+
import ButtonType from '@ui5/webcomponents/dist/types/ButtonType.js';
4+
5+
export { ButtonType };

packages/main/src/enums/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export * from './BreadcrumbsDesign.js';
1717
export * from './BreadcrumbsSeparatorStyle.js';
1818
export * from './BusyIndicatorSize.js';
1919
export * from './ButtonDesign.js';
20+
export * from './ButtonType.js';
2021
export * from './CalendarSelection.js';
2122
export * from './CalendarSelectionMode.js';
2223
export * from './CalendarType.js';

packages/main/src/webComponents/Avatar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export interface AvatarPropTypes extends AvatarAttributes, CommonProps {
109109
*
110110
* __Note:__ This component is a web component developed by the UI5 Web Components’ team.
111111
*
112-
* <ui5-link href="https://sap.github.io/ui5-webcomponents/playground/components/Avatar" target="_blank">UI5 Web Components Playground</ui5-link>
112+
* <ui5-link href="https://sap.github.io/ui5-webcomponents/playground/?path=/docs/main-Avatar" target="_blank">UI5 Web Components Storybook</ui5-link>
113113
*/
114114
const Avatar = withWebComponent<AvatarPropTypes, AvatarDomRef>(
115115
'ui5-avatar',

packages/main/src/webComponents/AvatarGroup/AvatarGroupDescription.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Do not use the `AvatarGroup` if:
1818
## Keyboard Handling
1919

2020
The component provides advanced keyboard handling. When focused, the user can use the following keyboard shortcuts in order to perform a navigation:
21-
\- `type` Individual:
21+
`type` Individual:
2222

2323
- \[TAB\] - Move focus to the overflow button
2424
- \[LEFT\] - Navigate one avatar to the left
@@ -27,7 +27,7 @@ The component provides advanced keyboard handling. When focused, the user can us
2727
- \[END\] - Navigate to the last avatar
2828
- \[SPACE\],\[ENTER\],\[RETURN\] - Trigger `undefined` event
2929

30-
\- `type` Group:
30+
`type` Group:
3131

3232
- \[TAB\] - Move focus to the next interactive element after the component
3333
- \[SPACE\],\[ENTER\],\[RETURN\] - Trigger `undefined` event
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22

33
export const Avatar1 = (
4-
<img src="https://sap.github.io/ui5-webcomponents/main/assets/images/avatars/woman_avatar_5.png" />
4+
<img src="https://sap.github.io/ui5-webcomponents/assets/images/avatars/woman_avatar_5.png" alt="Avatar1" />
55
);
66
export const Avatar2 = (
7-
<img src="https://sap.github.io/ui5-webcomponents/main/assets/images/avatars/man_avatar_3.png" />
7+
<img src="https://sap.github.io/ui5-webcomponents/assets/images/avatars/man_avatar_3.png" alt="Avatar2" />
88
);

0 commit comments

Comments
 (0)