Skip to content

Commit 8ec0539

Browse files
committed
feat: enhance wrapper script to support component description and ui5-tag replacement
1 parent 64d6d6a commit 8ec0539

File tree

70 files changed

+1058
-586
lines changed

Some content is hidden

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

70 files changed

+1058
-586
lines changed

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

Lines changed: 190 additions & 48 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import { NotificationOverflowAction } from '../webComponents/NotificationOverflowAction';
2+
import type { NotificationOverflowActionPropTypes } from '../webComponents/NotificationOverflowAction';
23

34
export { NotificationOverflowAction };
5+
export type { NotificationOverflowActionPropTypes };

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1+
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
2+
import '@ui5/webcomponents/dist/Avatar';
3+
import { FC } from 'react';
14
import { AvatarBackgroundColor } from '@ui5/webcomponents-react/lib/AvatarBackgroundColor';
25
import { AvatarFitType } from '@ui5/webcomponents-react/lib/AvatarFitType';
36
import { AvatarShape } from '@ui5/webcomponents-react/lib/AvatarShape';
47
import { AvatarSize } from '@ui5/webcomponents-react/lib/AvatarSize';
5-
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
6-
import '@ui5/webcomponents/dist/Avatar';
7-
import { FC } from 'react';
88

99
export interface AvatarPropTypes extends WithWebComponentPropTypes {
1010
/**
11-
* Defines the text alternative of the <code>ui5-avatar</code>. If not provided a default text alternative will be set, if present.
11+
* Defines the text alternative of the <code>Avatar</code>. If not provided a default text alternative will be set, if present.
1212
*/
1313
accessibleName?: string;
1414
/**
1515
* Defines the background color of the desired image. <br><br> Available options are: <ul> <li><code>Accent1</code></li> <li><code>Accent2</code></li> <li><code>Accent3</code></li> <li><code>Accent4</code></li> <li><code>Accent5</code></li> <li><code>Accent6</code></li> <li><code>Accent7</code></li> <li><code>Accent8</code></li> <li><code>Accent9</code></li> <li><code>Accent10</code></li> <li><code>Placeholder</code></li> <ul>
1616
*/
1717
backgroundColor?: AvatarBackgroundColor;
1818
/**
19-
* Defines the name of the UI5 Icon, that would be displayed. <br> <b>Note:</b> If <code>image</code> is set, the property would be ignored. <br> <b>Note:</b> You should import the desired icon first, then use its name as "icon". <br><br> import "@ui5/webcomponents-icons/dist/icons/{icon_name}.js" <br> <pre>&lt;ui5-avatar icon-src="employee"></pre><br/><br/>
19+
* Defines the name of the UI5 Icon, that would be displayed. <br> <b>Note:</b> If <code>image</code> is set, the property would be ignored. <br> <b>Note:</b> You should import the desired icon first, then use its name as "icon". <br><br> import "@ui5/webcomponents-icons/dist/icons/{icon_name}.js" <br> <pre>&lt;Avatar icon-src="employee"></pre><br/><br/>
2020
*
2121
* See all the available icons in the <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
2222
*/
@@ -30,22 +30,26 @@ export interface AvatarPropTypes extends WithWebComponentPropTypes {
3030
*/
3131
imageFitType?: AvatarFitType;
3232
/**
33-
* Defines the displayed initials. <br> Up to two Latin letters can be displayed as initials in a <code>ui5-avatar</code>.
33+
* Defines the displayed initials. <br> Up to two Latin letters can be displayed as initials in a <code>Avatar</code>.
3434
*/
3535
initials?: string;
3636
/**
37-
* Defines the shape of the <code>ui5-avatar</code>. <br><br> Available options are: <ul> <li><code>Circle</code></li> <li><code>Square</code></li> <ul>
37+
* Defines the shape of the <code>Avatar</code>. <br><br> Available options are: <ul> <li><code>Circle</code></li> <li><code>Square</code></li> <ul>
3838
*/
3939
shape?: AvatarShape;
4040
/**
41-
* Defines predefined size of the <code>ui5-avatar</code>. <br><br> Available options are: <ul> <li><code>XS</code></li> <li><code>S</code></li> <li><code>M</code></li> <li><code>L</code></li> <li><code>XL</code></li> <ul>
41+
* Defines predefined size of the <code>Avatar</code>. <br><br> Available options are: <ul> <li><code>XS</code></li> <li><code>S</code></li> <li><code>M</code></li> <li><code>L</code></li> <li><code>XL</code></li> <ul>
4242
*/
4343
size?: AvatarSize;
4444
}
4545

4646
/**
47-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Avatar" target="_blank">UI5 Web Components Playground</a>
48-
*/
47+
* An image-like control that has different display options for representing images and icons in different shapes and
48+
sizes, depending on the use case. The shape can be circular or square. There are several predefined sizes, as well as an
49+
option to set a custom size.
50+
51+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Avatar" target="_blank">UI5 Web Components Playground</a>
52+
*/
4953
const Avatar: FC<AvatarPropTypes> = withWebComponent<AvatarPropTypes>(
5054
'ui5-avatar',
5155
['accessibleName', 'backgroundColor', 'icon', 'image', 'imageFitType', 'initials', 'shape', 'size'],

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
22
import '@ui5/webcomponents/dist/Badge';
3-
import { FC, ReactNode } from 'react';
3+
import { FC } from 'react';
4+
import { ReactNode } from 'react';
45

56
export interface BadgePropTypes extends WithWebComponentPropTypes {
67
/**
7-
* Defines the color scheme of the <code>ui5-badge</code>. There are 10 predefined schemes. Each scheme applies different values for the <code>background-color</code> and <code>border-color</code>. To use one you can set a number from <code>"1"</code> to <code>"10"</code>. The <code>colorScheme</code> <code>"1"</code> will be set by default. <br><br> <b>Note:</b> Color schemes have no visual representation in High Contrast Black (sap_belize_hcb) theme.
8+
* Defines the color scheme of the <code>Badge</code>. There are 10 predefined schemes. Each scheme applies different values for the <code>background-color</code> and <code>border-color</code>. To use one you can set a number from <code>"1"</code> to <code>"10"</code>. The <code>colorScheme</code> <code>"1"</code> will be set by default. <br><br> <b>Note:</b> Color schemes have no visual representation in High Contrast Black (sap_belize_hcb) theme.
89
*/
910
colorScheme?: string;
1011
/**
11-
* Defines the text of the <code>ui5-badge</code>. <br><b>Note:</b> Аlthough this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
12+
* Defines the text of the <code>Badge</code>. <br><b>Note:</b> Аlthough this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
1213
*/
1314
children?: ReactNode | ReactNode[];
1415
/**
15-
* Defines the <code>ui5-icon</code> to be displayed in the <code>ui5-badge</code>.
16+
* Defines the <code>Icon</code> to be displayed in the <code>Badge</code>.
1617
*/
1718
icon?: ReactNode | ReactNode[];
1819
}
1920

2021
/**
21-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Badge" target="_blank">UI5 Web Components Playground</a>
22-
*/
22+
* The <code>Badge</code> is a small non-interactive component which contains text information and color chosen from a list
23+
of predefined color schemes. It serves the purpose to attract the user attention to some piece of information (state,
24+
quantity, condition, etc.).
25+
26+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Badge" target="_blank">UI5 Web Components Playground</a>
27+
*/
2328
const Badge: FC<BadgePropTypes> = withWebComponent<BadgePropTypes>('ui5-badge', ['colorScheme'], [], ['icon'], []);
2429

2530
Badge.displayName = 'Badge';

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
1-
import { BusyIndicatorSize } from '@ui5/webcomponents-react/lib/BusyIndicatorSize';
21
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
32
import '@ui5/webcomponents/dist/BusyIndicator';
4-
import { FC, ReactNode } from 'react';
3+
import { FC } from 'react';
4+
import { BusyIndicatorSize } from '@ui5/webcomponents-react/lib/BusyIndicatorSize';
5+
import { ReactNode } from 'react';
56

67
export interface BusyIndicatorPropTypes extends WithWebComponentPropTypes {
78
/**
89
* Defines if the busy indicator is visible on the screen. By default it is not.
910
*/
1011
active?: boolean;
1112
/**
12-
* Defines the size of the <code>ui5-busyindicator</code>. <br><br> <b>Note:</b> Available options are "Small", "Medium", and "Large".
13+
* Defines the size of the <code>BusyIndicator</code>. <br><br> <b>Note:</b> Available options are "Small", "Medium", and "Large".
1314
*/
1415
size?: BusyIndicatorSize;
1516
/**
1617
* Defines text to be displayed below the busy indicator. It can be used to inform the user of the current operation.
1718
*/
1819
text?: string;
1920
/**
20-
* Determines the content over which the <code>ui5-busyindicator</code> will appear.
21+
* Determines the content over which the <code>BusyIndicator</code> will appear.
2122
*/
2223
children?: ReactNode | ReactNode[];
2324
}
2425

2526
/**
26-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/BusyIndicator" target="_blank">UI5 Web Components Playground</a>
27-
*/
27+
* The <code>BusyIndicator</code> signals that some operation is going on and that the user must wait. It does not block
28+
the current UI screen so other operations could be triggered in parallel.
29+
30+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/BusyIndicator" target="_blank">UI5 Web Components Playground</a>
31+
*/
2832
const BusyIndicator: FC<BusyIndicatorPropTypes> = withWebComponent<BusyIndicatorPropTypes>(
2933
'ui5-busyindicator',
3034
['size', 'text'],

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
1-
import { ButtonDesign } from '@ui5/webcomponents-react/lib/ButtonDesign';
21
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
32
import '@ui5/webcomponents/dist/Button';
4-
import { FC, ReactNode } from 'react';
3+
import { FC } from 'react';
4+
import { ButtonDesign } from '@ui5/webcomponents-react/lib/ButtonDesign';
5+
import { ReactNode } from 'react';
56

67
export interface ButtonPropTypes extends Omit<WithWebComponentPropTypes, 'onClick'> {
78
/**
8-
* Defines the <code>ui5-button</code> design. <br><br> <b>Note:</b> Available options are "Default", "Emphasized", "Positive", "Negative", and "Transparent".
9+
* Defines the <code>Button</code> design. <br><br> <b>Note:</b> Available options are "Default", "Emphasized", "Positive", "Negative", and "Transparent".
910
*/
1011
design?: ButtonDesign;
1112
/**
12-
* Defines whether the <code>ui5-button</code> is disabled (default is set to <code>false</code>). A disabled <code>ui5-button</code> can't be pressed or focused, and it is not in the tab chain.
13+
* Defines whether the <code>Button</code> is disabled (default is set to <code>false</code>). A disabled <code>Button</code> can't be pressed or focused, and it is not in the tab chain.
1314
*/
1415
disabled?: boolean;
1516
/**
16-
* Defines the icon to be displayed as graphical element within the <code>ui5-button</code>. The SAP-icons font provides numerous options. <br><br> Example: <br> <pre>ui5-button icon="palette"</pre><br/><br/>
17+
* Defines the icon to be displayed as graphical element within the <code>Button</code>. The SAP-icons font provides numerous options. <br><br> Example: <br> <pre>Button icon="palette"</pre><br/><br/>
1718
*
1819
* See all the available icons in the <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
1920
*/
2021
icon?: string;
2122
/**
22-
* Defines whether the icon should be displayed after the <code>ui5-button</code> text.
23+
* Defines whether the icon should be displayed after the <code>Button</code> text.
2324
*/
2425
iconEnd?: boolean;
2526
/**
26-
* When set to <code>true</code>, the <code>ui5-button</code> will automatically submit the nearest form element upon <code>press</code>. <br><br> <b>Important:</b> For the <code>submits</code> property to have effect, you must add the following import to your project: <code>import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";</code>
27+
* When set to <code>true</code>, the <code>Button</code> will automatically submit the nearest form element upon <code>press</code>. <br><br> <b>Important:</b> For the <code>submits</code> property to have effect, you must add the following import to your project: <code>import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";</code>
2728
*/
2829
submits?: boolean;
2930
/**
30-
* Defines the text of the <code>ui5-button</code>. <br><br> <b>Note:</b> Аlthough this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
31+
* Defines the text of the <code>Button</code>. <br><br> <b>Note:</b> Аlthough this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
3132
*/
3233
children?: ReactNode | ReactNode[];
3334
/**
34-
* Fired when the <code>ui5-button</code> is activated either with a mouse/tap or by using the Enter or Space key. <br><br> <b>Note:</b> The event will not be fired if the <code>disabled</code> property is set to <code>true</code>.
35+
* Fired when the <code>Button</code> is activated either with a mouse/tap or by using the Enter or Space key. <br><br> <b>Note:</b> The event will not be fired if the <code>disabled</code> property is set to <code>true</code>.
3536
*/
3637
onClick?: (event: CustomEvent<{}>) => void;
3738
}
3839

3940
/**
40-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Button" target="_blank">UI5 Web Components Playground</a>
41-
*/
41+
* The <code>Button</code> component represents a simple push button. It enables users to trigger actions by clicking or
42+
tapping the <code>Button</code>, or by pressing certain keyboard keys, such as Enter.
43+
44+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Button" target="_blank">UI5 Web Components Playground</a>
45+
*/
4246
const Button: FC<ButtonPropTypes> = withWebComponent<ButtonPropTypes>(
4347
'ui5-button',
4448
['design', 'icon'],

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { CalendarType } from '@ui5/webcomponents-react/lib/CalendarType';
21
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
32
import '@ui5/webcomponents/dist/Calendar';
43
import { FC } from 'react';
4+
import { CalendarType } from '@ui5/webcomponents-react/lib/CalendarType';
55

66
export interface CalendarPropTypes extends WithWebComponentPropTypes {
77
/**
@@ -19,7 +19,7 @@ export interface CalendarPropTypes extends WithWebComponentPropTypes {
1919
*/
2020
minDate?: string;
2121
/**
22-
* Defines the calendar type used for display. If not defined, the calendar type of the global configuration is used. Available options are: "Gregorian", "Islamic", "Japanese", "Buddhist" and "Persian".
22+
* Defines the calendar type used for display. If not defined, the calendar type of the global configuration is used. Available options are: "Gregorian", "Islamic", "Japanese", "Buddhist" and "Persian".<br/><b>Note:</b> Calendar types other than Gregorian must be imported manually:<br /><code>import "@ui5/webcomponents-localization/dist/features/calendar/{primaryCalendarType}.js";</code>
2323
*/
2424
primaryCalendarType?: CalendarType;
2525
/**
@@ -37,8 +37,11 @@ export interface CalendarPropTypes extends WithWebComponentPropTypes {
3737
}
3838

3939
/**
40-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Calendar" target="_blank">UI5 Web Components Playground</a>
41-
*/
40+
* The <code>Calendar</code> can be used standale to display the years, months, weeks and days, but the main purpose of the
41+
<code>Calendar</code> is to be used within a <code>DatePicker</code>
42+
43+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Calendar" target="_blank">UI5 Web Components Playground</a>
44+
*/
4245
const Calendar: FC<CalendarPropTypes> = withWebComponent<CalendarPropTypes>(
4346
'ui5-calendar',
4447
['maxDate', 'minDate', 'primaryCalendarType', 'selectedDates', 'timestamp'],

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { withWebComponent, WithWebComponentPropTypes } from '@ui5/webcomponents-react/lib/withWebComponent';
22
import '@ui5/webcomponents/dist/Card';
3-
import { FC, ReactNode } from 'react';
3+
import { FC } from 'react';
4+
import { ReactNode } from 'react';
45

56
export interface CardPropTypes extends WithWebComponentPropTypes {
67
/**
7-
* Defines if the <code>ui5-card</code> header would be interactive, e.g gets hover effect, gets focused and <code>headerPress</code> event is fired, when it is pressed.
8+
* Defines if the <code>Card</code> header would be interactive, e.g gets hover effect, gets focused and <code>headerPress</code> event is fired, when it is pressed.
89
*/
910
headerInteractive?: boolean;
1011
/**
11-
* Defines the title displayed in the <code>ui5-card</code> header.
12+
* Defines the title displayed in the <code>Card</code> header.
1213
*/
1314
heading?: string;
1415
/**
15-
* Defines the status displayed in the <code>ui5-card</code> header. <br><br> <b>Note:</b> If the <code>action</code> slot is set, the <code>status</code> will not be displayed, you can either have <code>action</code>, or <code>status</code>.
16+
* Defines the status displayed in the <code>Card</code> header. <br><br> <b>Note:</b> If the <code>action</code> slot is set, the <code>status</code> will not be displayed, you can either have <code>action</code>, or <code>status</code>.
1617
*/
1718
status?: string;
1819
/**
19-
* Defines the subheading displayed in the <code>ui5-card</code> header.
20+
* Defines the subheading displayed in the <code>Card</code> header.
2021
*/
2122
subheading?: string;
2223
/**
@@ -28,18 +29,23 @@ export interface CardPropTypes extends WithWebComponentPropTypes {
2829
*/
2930
avatar?: ReactNode | ReactNode[];
3031
/**
31-
* Defines the content of the <code>ui5-card</code>.
32+
* Defines the content of the <code>Card</code>.
3233
*/
3334
children?: ReactNode | ReactNode[];
3435
/**
35-
* Fired when the <code>ui5-card</code> header is activated by mouse/tap or by using the Enter or Space key. <br><br> <b>Note:</b> The event would be fired only if the <code>headerInteractive</code> property is set to true.
36+
* Fired when the <code>Card</code> header is activated by mouse/tap or by using the Enter or Space key. <br><br> <b>Note:</b> The event would be fired only if the <code>headerInteractive</code> property is set to true.
3637
*/
3738
onHeaderClick?: (event: CustomEvent<{}>) => void;
3839
}
3940

4041
/**
41-
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Card" target="_blank">UI5 Web Components Playground</a>
42-
*/
42+
* The <code>Card</code> is a component that represents information in the form of a tile with separate header and content
43+
areas. The content area of a <code>Card</code> can be arbitrary HTML content. The header can be used through several
44+
properties, such as: <code>heading</code>, <code>subheading</code>, <code>status</code> and two slots:
45+
<code>avatar</code> and <code>action</code>.
46+
47+
* <a href="https://sap.github.io/ui5-webcomponents/playground/components/Card" target="_blank">UI5 Web Components Playground</a>
48+
*/
4349
const Card: FC<CardPropTypes> = withWebComponent<CardPropTypes>(
4450
'ui5-card',
4551
['heading', 'status', 'subheading'],

0 commit comments

Comments
 (0)