Skip to content

Commit aab4acd

Browse files
committed
fix(cli): improve description for events & outline experimental components
1 parent 36aa447 commit aab4acd

File tree

7 files changed

+25
-7
lines changed

7 files changed

+25
-7
lines changed

packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export class ComponentRenderer extends AbstractRenderer {
1414
private note: string = '';
1515
private isAbstract: boolean = false;
1616
private since: string | undefined;
17+
private isExperimental: boolean | string | undefined = false;
1718

1819
setAttributes(attrs: CEM.ClassField[]) {
1920
this.attributes.push(...attrs);
@@ -50,6 +51,11 @@ export class ComponentRenderer extends AbstractRenderer {
5051
return this;
5152
}
5253

54+
setIsExperimental(value?: boolean | string) {
55+
this.isExperimental = value;
56+
return this;
57+
}
58+
5359
prepare(context: WebComponentWrapper) {
5460
context.exportSet.add(context.componentName);
5561
}
@@ -64,10 +70,13 @@ export class ComponentRenderer extends AbstractRenderer {
6470
comment += ` *\n`;
6571
comment += ` * @since [${this.since}](https://github.com/SAP/ui5-webcomponents/releases/tag/v${this.since}) of __${context.packageName}__.\n`;
6672
}
67-
6873
if (this.isAbstract) {
6974
comment += ' * @abstract\n';
7075
}
76+
if (this.isExperimental) {
77+
comment += ` * @experimental${typeof this.isExperimental === 'string' ? ` ${this.isExperimental}` : ''}\n`;
78+
}
79+
7180
comment += '*/';
7281

7382
const component = dedent`

packages/cli/src/scripts/create-wrappers/PropTypesRenderer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ export class PropTypesRenderer extends AbstractRenderer {
114114
descriptionParts.push(` * @deprecated`);
115115
}
116116
}
117+
if (event._ui5Bubbles || event._ui5Cancelable) {
118+
descriptionParts.push(` *`);
119+
descriptionParts.push(`* | cancelable | bubbles |`);
120+
descriptionParts.push(`* | :--------: | :-----: |`);
121+
descriptionParts.push(`* | ${event._ui5Cancelable ? '✅' : '❌'}|${event._ui5Bubbles ? '✅' : '❌'}|`);
122+
}
117123

118124
const domRef = `${context.componentName}DomRef`;
119125
let eventType = '(event: unknown) => void;';

packages/cli/src/scripts/create-wrappers/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default async function createWrappers(packageName: string, outDir: string
6666
.setNote(options.additionalComponentNote ?? '')
6767
.setIsAbstract(declaration._ui5abstract ?? false)
6868
.setSince(declaration._ui5since)
69+
.setIsExperimental(declaration._ui5experimental)
6970
);
7071
wrapper.addRenderer(new ExportsRenderer());
7172

packages/main/src/webComponents/Form/Form.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import * as ComponentStories from './Form.stories';
77

88
<Meta of={ComponentStories} />
99

10-
<DocsHeader since="0.7.0" subComponents={['FormGroup', 'FormItem']} />
11-
12-
**Note:** For more detailed examples of how the form can be used or integrated with other external libraries such as "React Hook Form", you can visit our [knowledge base](?path=/docs/knowledge-base-form-handling--docs).
10+
<DocsHeader subComponents={['FormGroup', 'FormItem']} />
1311

1412
<br />
1513

@@ -33,6 +31,10 @@ import * as ComponentStories from './Form.stories';
3331

3432
<summary>Show Code</summary>
3533

34+
| cancelable | bubbles |
35+
|:----------:|:-------:|
36+
|  ✅   |   ❌   |
37+
3638
```jsx
3739
const StandardField = ({ editMode, value, inputType = InputType.Text, onInput, ...rest }) => {
3840
if (editMode) {

packages/main/src/webComponents/Form/Form.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FormItem } from '../FormItem/index.js';
77
import { Form } from './index.js';
88

99
const meta = {
10-
title: 'Layouts & Floorplans / Form',
10+
title: 'Layouts & Floorplans / Form (experimental)',
1111
component: Form,
1212
argTypes: {
1313
children: { control: { disable: true } }

packages/main/src/webComponents/Table/Table.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { TableSelection } from '../TableSelection/index.js';
1212
import { Table } from './index.js';
1313

1414
const meta = {
15-
title: 'Data Display / Table',
15+
title: 'Data Display / Table (experimental)',
1616
component: Table,
1717
argTypes: {
1818
headerRow: { control: { disable: true } },

packages/main/src/webComponents/Tokenizer/Tokenizer.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { TokenizerPropTypes } from './index.js';
77
import { Tokenizer } from './index.js';
88

99
const meta = {
10-
title: 'Inputs / Tokenizer',
10+
title: 'Inputs / Tokenizer (experimental)',
1111
component: Tokenizer,
1212
args: { style: { width: '250px' } },
1313
tags: ['package:@ui5/webcomponents']

0 commit comments

Comments
 (0)