Skip to content

Commit d8d4c3c

Browse files
authored
docs: update fiori package API docs (#206)
1 parent adc0fd3 commit d8d4c3c

38 files changed

+926
-306
lines changed

apps/documentation/src/app/stories/fiori/barcodescannerdialog.stories.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
BarcodeScannerDialogComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { BarcodeScannerDialogComponent } from '@ui5/webcomponents-ngx/fiori/barcode-scanner-dialog';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75
import { CommonModule } from '@angular/common';
86

97
const description = `
10-
### Overview
118
12-
The <code>BarcodeScannerDialog</code> component provides barcode scanning functionality for all devices that support the <code>MediaDevices.getUserMedia()</code> native API. Opening the dialog launches the device camera and scans for known barcode formats. <br> <br> A <code>scanSuccess</code> event fires whenever a barcode is identified and a <code>scanError</code> event fires when the scan failed (for example, due to missing permisions). <br> <br> Internally, the component uses the zxing-js/library third party OSS.
9+
###Module Import
1310
14-
For a list of supported barcode formats, see the <ui5-link target="_blank" href="https://github.com/zxing-js/library">zxing-js/library</ui5-link> documentation.
15-
`;
11+
<code>import { BarcodeScannerDialogComponent } from '@ui5/webcomponents-ngx/fiori/barcode-scanner-dialog'</code>`;
1612

1713
const meta: Meta<BarcodeScannerDialogComponent> = {
1814
title: 'UI5 Web Components / Fiori / BarcodeScannerDialog',
@@ -26,7 +22,7 @@ const meta: Meta<BarcodeScannerDialogComponent> = {
2622
docs: {
2723
extractArgTypes,
2824
description: {
29-
component: description,
25+
component: extractDescription('BarcodeScannerDialog', BarcodeScannerDialogComponent, description),
3026
},
3127
},
3228
},
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { DynamicPageHeaderComponent } from '@ui5/webcomponents-ngx/fiori/dynamic-page-header';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
5+
6+
const description = `
7+
8+
###Module Import
9+
10+
<code>import { DynamicPageHeaderComponent } from "@ui5/webcomponents-ngx/fiori/dynamic-page-header";</code>`;
11+
export default {
12+
title: 'UI5 Web Components / Fiori / DynamicPage / DynamicPageHeader',
13+
component: DynamicPageHeaderComponent,
14+
decorators: [
15+
moduleMetadata({
16+
imports: [Ui5WebcomponentsModule],
17+
}),
18+
],
19+
parameters: {
20+
docs: {
21+
extractArgTypes,
22+
description: {
23+
component: extractDescription( 'DynamicPageHeaderComponent', DynamicPageHeaderComponent, description),
24+
},
25+
},
26+
},
27+
} as Meta;
28+
29+
30+
export const DynamicPageHeader: StoryObj<DynamicPageHeaderComponent> = {
31+
render: (args) => ({
32+
props: args,
33+
template: `
34+
`,
35+
}),
36+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { DynamicPageTitleComponent } from '@ui5/webcomponents-ngx/fiori/dynamic-page-title';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
5+
6+
const description = `
7+
8+
###Module Import
9+
10+
<code>import { DynamicPageTitleComponent } from "@ui5/webcomponents-ngx/fiori/dynamic-page-title";</code>`;
11+
export default {
12+
title: 'UI5 Web Components / Fiori / DynamicPage / DynamicPageTitle',
13+
component: DynamicPageTitleComponent,
14+
decorators: [
15+
moduleMetadata({
16+
imports: [Ui5WebcomponentsModule],
17+
}),
18+
],
19+
parameters: {
20+
docs: {
21+
extractArgTypes,
22+
description: {
23+
component: extractDescription( 'DynamicPageTitleComponent', DynamicPageTitleComponent, description),
24+
},
25+
},
26+
},
27+
} as Meta;
28+
29+
30+
export const DynamicPageTitle: StoryObj<DynamicPageTitleComponent> = {
31+
render: (args) => ({
32+
props: args,
33+
template: `
34+
`,
35+
}),
36+
};

apps/documentation/src/app/stories/fiori/dynamicpage.stories.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
DynamicPageComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { DynamicPageComponent } from '@ui5/webcomponents-ngx/fiori/dynamic-page';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75

8-
const description = `### Overview
6+
const description = `
97
10-
A layout component, representing a web page, consisting of a title, header with dynamic behavior, a content area, and an optional floating footer.
8+
<h3>Module Import</h3>
119
12-
The component consists of several components:
13-
14-
- DynamicPageTitle - a component, holding the title of the page, the navigation actions, and the content. The displayed content changes based on the current mode of the DynamicPageHeader.
15-
- DynamicPageHeader - a generic container, which can contain a single layout component and any other HTML elements. The header works in two modes - expanded and snapped, and its behavior can be adjusted with the help of different properties.
16-
- Content area - a generic container, which can have a single UI5 layout.
17-
- Footer - positioned at the bottom with a small offset and used for additional actions, the footer floats above the content.
18-
19-
<h3>ES6 Module Import</h3>
20-
21-
<code>import { DynamicPage } from "@ui5/webcomponents-ngx/fiori/dynamic-page";</code>;
22-
<code>import { DynamicPageTitle } from "@ui5/webcomponents-ngx/fiori/dynamic-page-title";</code>;
23-
<code>import { DynamicPageHeader } from "@ui5/webcomponents-ngx/fiori/dynamic-page-header";</code>;
10+
<code>import { DynamicPageComponent } from "@ui5/webcomponents-ngx/fiori/dynamic-page";</code>
2411
`;
2512

2613
export default {
@@ -35,7 +22,7 @@ export default {
3522
docs: {
3623
extractArgTypes,
3724
description: {
38-
component: description,
25+
component: extractDescription('DynamicPageComponent', DynamicPageComponent, description),
3926
},
4027
},
4128
},

apps/documentation/src/app/stories/fiori/dynamicsidecontent.stories.ts

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,11 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
DynamicSideContentComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { DynamicSideContentComponent } from '@ui5/webcomponents-ngx/fiori/dynamic-side-content';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75

8-
const description = `### Overview
6+
const description = `
97
10-
The DynamicSideContent (<code>ui5-dynamic-side-content</code>) is a layout component that allows additional content to be displayed in a way that flexibly adapts to different screen sizes. The side content appears in a container next to or directly below the main content (it doesn't overlay). When the side content is triggered, the main content becomes narrower (if appearing side-by-side). The side content contains a separate scrollbar when appearing next to the main content.
11-
12-
<h3>Usage</h3>
13-
14-
<i>When to use?</i>
15-
16-
Use this component if you want to display relevant information that is not critical for users to complete a task. Users should have access to all the key functions and critical information in the app even if they do not see the side content. This is important because on smaller screen sizes it may be difficult to display the side content in a way that is easily accessible for the user.
17-
18-
<i>When not to use?</i>
19-
20-
Don't use it if you want to display navigation or critical information that prevents users from completing a task when they have no access to the side content.
21-
22-
<h3>Responsive Behavior</h3>
23-
24-
Screen width > 1440px
25-
26-
<ul><li>Main vs. side content ratio is 75 vs. 25 percent (with a minimum of 320px each).</li> <li>If the application defines a trigger, the side content can be hidden.</li></ul>
27-
28-
Screen width <= 1440px and > 1024px
29-
30-
<ul><li>Main vs. side content ratio is 66.666 vs. 33.333 percent (with a minimum of 320px each). If the side content width falls below 320 px, it automatically slides under the main content, unless the app development team specifies that it should disappear.</li></ul>
31-
32-
Screen width <= 1024px and > 720px
33-
34-
<ul><li>The side content ratio is fixed to 340px, and the main content takes the rest of the width. Only if the <code>sideContentFallDown</code> is set to <code>OnMinimumWidth</code> and screen width is <= 960px and > 720px the side content falls below the main content.</li></ul>
35-
36-
Screen width <= 720px (for example on a mobile device)
37-
38-
<ul><li>In this case, the side content automatically disappears from the screen (unless specified to stay under the content by setting of <code>sideContentVisibility</code> property to <code>AlwaysShow</code>) and can be triggered from a pre-set trigger (specified within the app). When the side content is triggered, it replaces the main content. We recommend that you always place the trigger for the side content in the same location, such as in the app footer.</li></ul>
39-
40-
A special case allows switching the comparison mode between the main and side content. In this case, the screen is split into 50:50 percent for main vs. side content. The responsive behavior of the equal split is the same as in the standard view - the side content disappears on screen widths of less than 720 px and can only be viewed by triggering it.
41-
42-
<h3>ES6 Module Import</h3>
8+
<h3>Module Import</h3>
439
4410
<code>import { DynamicSideContentComponent } from "@ui5/webcomponents-ngx/fiori/dynamic-side-content";</code>`;
4511
const meta: Meta<DynamicSideContentComponent> = {
@@ -54,7 +20,7 @@ const meta: Meta<DynamicSideContentComponent> = {
5420
docs: {
5521
extractArgTypes,
5622
description: {
57-
component: description,
23+
component: extractDescription('DynamicSideContentComponent', DynamicSideContentComponent, description),
5824
},
5925
},
6026
},

apps/documentation/src/app/stories/fiori/flexiblecolumnlayout.stories.ts

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,26 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
FlexibleColumnLayoutComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { FlexibleColumnLayoutComponent } from '@ui5/webcomponents-ngx/fiori/flexible-column-layout';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75

8-
const description = `### Overview
6+
const description = `
97
10-
The <code>FlexibleColumnLayout</code> implements the list-detail-detail paradigm by displaying up to three pages in separate columns. There are several possible layouts that can be changed either with the component API, or by pressing the arrows, displayed between the columns.
11-
12-
<h3>Usage</h3>
13-
14-
Use this component for applications that need to display several logical levels of related information side by side (e.g. list of items, item, sub-item, etc.). The Component is flexible in a sense that the application can focus the user's attention on one particular column.
15-
16-
<h3>Responsive Behavior</h3>
17-
18-
The <code>FlexibleColumnLayout</code> automatically displays the maximum possible number of columns based on <code>layout</code> property and the window size. The component would display 1 column for window size smaller than 599px, up to two columns between 599px and 1023px, and 3 columns for sizes bigger than 1023px.
19-
20-
<br><br> <h3>Keyboard Handling</h3>
21-
22-
<h4>Basic Navigation</h4> <ul> <li>[SPACE, ENTER, RETURN] - If focus is on the layout toggle button (arrow button), once activated, it triggers the associated action (such as expand/collapse the column).</li> <li>This component provides a build in fast navigation group which can be used via <code>F6 / Shift + F6</code> or <code> Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up</code>. In order to use this functionality, you need to import the following module: <code>import "@ui5/webcomponents-base/dist/features/F6Navigation.js"</code></li> </ul>
23-
24-
<h4>Fast Navigation</h4> This component provides a build in fast navigation group which can be used via <code>F6 / Shift + F6</code> or <code> Ctrl + Alt(Option) + Down / Ctrl + Alt(Option) + Up</code>. In order to use this functionality, you need to import the following module: <code>import "@ui5/webcomponents-base/dist/features/F6Navigation.js"</code> <br><br>
25-
26-
<h3>ES6 Module Import</h3>
8+
<h3>Module Import</h3>
279
2810
<code>import { FlexibleColumnLayoutComponent } from "@ui5/webcomponents-ngx/fiori/flexible-column-layout";</code>`;
2911
export default {
3012
title: 'UI5 Web Components / Fiori / FlexibleColumnLayout',
3113
component: FlexibleColumnLayoutComponent,
3214
decorators: [
3315
moduleMetadata({
34-
imports: [Ui5WebcomponentsModule],
16+
imports: [Ui5WebcomponentsModule, FlexibleColumnLayoutComponent],
3517
}),
3618
],
3719
parameters: {
3820
docs: {
3921
extractArgTypes,
4022
description: {
41-
component: description,
23+
component: extractDescription('FlexibleColumnLayoutComponent', FlexibleColumnLayoutComponent, description),
4224
},
4325
},
4426
},

apps/documentation/src/app/stories/fiori/illustratedmessage.stories.ts

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,26 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
IllustratedMessageComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { IllustratedMessageComponent } from '@ui5/webcomponents-ngx/fiori/illustrated-message';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75

86
const description = `
9-
### Overview
107
11-
An IllustratedMessage is a recommended combination of a solution-oriented message, an engaging illustration, and conversational tone to better communicate an empty or a success state than just show a message alone.
12-
13-
Each illustration has default internationalised title and subtitle texts. Also they can be managed with <code>titleText</code> and <code>subtitleText</code> properties.
14-
15-
To display the desired illustration, use the <code>name</code> property, where you can find the list of all available illustrations. <br><br> <b>Note:</b> By default the “BeforeSearch” illustration is loaded. To use other illustrations, make sure you import them in addition, for example: <br> <code>import "@ui5/webcomponents-fiori/dist/illustrations/NoData.js"</code> <br> <b>Note:</b> Illustrations starting with the “Tnt” prefix are part of another illustration set. For example to use the “TntSuccess” illustration, add the following import:: <br> <code>import "@ui5/webcomponents-fiori/dist/illustrations/tnt/Success.js"</code>
16-
17-
### Structure
18-
19-
The IllustratedMessage consists of the following elements, which are displayed below each other in the following order: <br> <ul> <li>Illustration</li> <li>Title</li> <li>Subtitle</li> <li>Actions</li> </ul>
20-
21-
### Usage
22-
23-
<code>ui5-illustrated-message</code> is meant to be used inside container component, for example a <code>ui5-card</code>, a <code>ui5-dialog</code> or a <code>ui5-page</code>
24-
25-
### ES6 Module Import
8+
### Module Import
269
2710
<code>import { IllustratedMessageComponent } from "@ui5/webcomponents-ngx/fiori/illustrated-message";</code>`;
2811
export default {
2912
title: 'UI5 Web Components / Fiori / IllustratedMessage',
3013
component: IllustratedMessageComponent,
3114
decorators: [
3215
moduleMetadata({
33-
imports: [Ui5WebcomponentsModule],
16+
imports: [Ui5WebcomponentsModule, IllustratedMessageComponent],
3417
}),
3518
],
3619
parameters: {
3720
docs: {
3821
extractArgTypes,
3922
description: {
40-
component: description,
23+
component: extractDescription('IllustratedMessageComponent' ,IllustratedMessageComponent, description),
4124
},
4225
},
4326
},
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { MediaGalleryItemComponent } from '@ui5/webcomponents-ngx/fiori/media-gallery-item';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
5+
6+
const description = `
7+
8+
###Module Import
9+
10+
<code>import { MediaGalleryItemComponent } from "@ui5/webcomponents-ngx/fiori/media-gallery-item";</code>`;
11+
export default {
12+
title: 'UI5 Web Components / Fiori / MediaGallery / MediaGalleryItem',
13+
component: MediaGalleryItemComponent,
14+
decorators: [
15+
moduleMetadata({
16+
imports: [Ui5WebcomponentsModule],
17+
}),
18+
],
19+
parameters: {
20+
docs: {
21+
extractArgTypes,
22+
description: {
23+
component: extractDescription( 'MediaGalleryItemComponent', MediaGalleryItemComponent, description),
24+
},
25+
},
26+
},
27+
} as Meta;
28+
29+
30+
export const MediaGalleryItem: StoryObj<MediaGalleryItemComponent> = {
31+
render: (args) => ({
32+
props: args,
33+
template: `
34+
`,
35+
}),
36+
};

apps/documentation/src/app/stories/fiori/mediagallery.stories.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
import { Meta, StoryObj, moduleMetadata } from '@storybook/angular';
2-
import {
3-
Ui5WebcomponentsModule,
4-
MediaGalleryComponent,
5-
} from '@ui5/webcomponents-ngx';
6-
import { extractArgTypes } from '../../arg-type-tools';
2+
import { Ui5WebcomponentsModule } from '@ui5/webcomponents-ngx';
3+
import { MediaGalleryComponent } from '@ui5/webcomponents-ngx/fiori/media-gallery';
4+
import { extractArgTypes, extractDescription } from '../../arg-type-tools';
75

8-
const description = `### Overview
6+
const description = `
97
10-
The <code>ui5-media-gallery</code> component allows the user to browse through multimedia items. Currently, the supported items are images and videos. The items should be defined using the <code>ui5-media-gallery-item</code> component.
8+
<h3>Module Import</h3>
119
12-
The items are initially displayed as thumbnails. When the user selects a thumbnail, the corresponding item is displayed in larger size. <br> The component is responsive by default and adjusts the position of the menu with respect to viewport size, but the application is able to further customize the layout via the provided API.
13-
14-
<h3>Keyboard Handling</h3> The <code>ui5-media-gallery</code> provides advanced keyboard handling. <br> When the thumbnails menu is focused the following keyboard shortcuts allow the user to navigate through the thumbnail items: <br>
15-
16-
<ul> <li>[UP/DOWN] - Navigates up and down the items</li> <li>[HOME] - Navigates to first item</li> <li>[END] - Navigates to the last item</li> <li>[SPACE/ENTER] - Select an item</li> </ul> <br>
17-
18-
<h3>ES6 Module Import</h3> <code>import { MediaGalleryComponent } from "@ui5/webcomponents-ngx/fiori/media-gallery";</code>`;
10+
<code>import { MediaGalleryComponent } from "@ui5/webcomponents-ngx/fiori/media-gallery";</code>`;
1911
export default {
2012
title: 'UI5 Web Components / Fiori / MediaGallery',
2113
component: MediaGalleryComponent,
@@ -28,7 +20,7 @@ export default {
2820
docs: {
2921
extractArgTypes,
3022
description: {
31-
component: description,
23+
component: extractDescription('MediaGalleryComponent', MediaGalleryComponent, description),
3224
},
3325
},
3426
},

0 commit comments

Comments
 (0)