[ADF-1769] Added JSDocs and prop tables (#2898)

This commit is contained in:
Andy Stark 2018-01-31 17:40:28 +00:00 committed by Eugenio Romano
parent 0d93c65fd7
commit dd7afc65db
11 changed files with 99 additions and 54 deletions

View File

@ -133,9 +133,9 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Data Table Adapter interface](DataTableAdapter.md) | Defines how table data is supplied to [DataTable](datatable.component.md) and [Tasklist](task-list.component.md) components. | [Source](../core/datatable/data/datatable-adapter.ts) |
| [Form Field Validator interface](FormFieldValidator.md) | Defines how the input fields of [ADF Form](form.component.md) and [ADF Task Details](task-details.component.md) components are validated. | [Source](../core/form/components/widgets/core/form-field-validator.ts) |
| [Search Configuration interface](search-configuration.interface.md) | Provides fine control of parameters to a search. | [Source](../core/services/search-configuration.service.ts) |
| [Data Table Adapter interface](DataTableAdapter.md) | Defines how table data is supplied to [DataTable](datatable.component.md) and [Tasklist](task-list.component.md) components. | [Source](../lib/core/datatable/data/datatable-adapter.ts) |
| [Form Field Validator interface](FormFieldValidator.md) | Defines how the input fields of [ADF Form](form.component.md) and [ADF Task Details](task-details.component.md) components are validated. | [Source](../lib/core/form/components/widgets/core/form-field-validator.ts) |
| [Search Configuration interface](search-configuration.interface.md) | Provides fine control of parameters to a search. | [Source](../lib/core/services/search-configuration.service.ts) |
[(Back to Contents)](#contents)
@ -152,6 +152,7 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Sites dropdown component](sites-dropdown.component.md) | Displays a dropdown menu to show and interact with the sites of the current user. | [Source](../lib/content-services/site-dropdown/sites-dropdown.component.ts) |
| _Breadcrumb component_ | _Not currently documented_ | [Source](../lib/content-services/breadcrumb/breadcrumb.component.ts) |
| _Dropdown breadcrumb component_ | _Not currently documented_ | [Source](../lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts) |
| _Content node selector panel component_ | _Not currently documented_ | [Source](../lib/content-services/content-node-selector/content-node-selector-panel.component.ts) |
@ -160,7 +161,6 @@ for more information about installing and using the source code.
| _Document list component_ | _Not currently documented_ | [Source](../lib/content-services/document-list/components/document-list.component.ts) |
| _Search control component_ | _Not currently documented_ | [Source](../lib/content-services/search/components/search-control.component.ts) |
| _Search component_ | _Not currently documented_ | [Source](../lib/content-services/search/components/search.component.ts) |
| _Sites dropdown component_ | _Not currently documented_ | [Source](../lib/content-services/site-dropdown/sites-dropdown.component.ts) |
| _Like component_ | _Not currently documented_ | [Source](../lib/content-services/social/like.component.ts) |
| _Rating component_ | _Not currently documented_ | [Source](../lib/content-services/social/rating.component.ts) |
| _Tag actions component_ | _Not currently documented_ | [Source](../lib/content-services/tag/tag-actions.component.ts) |
@ -208,7 +208,6 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Process list component](process-list.component.md) | Renders a list containing all the process instances matched by the parameters specified. | [Source](../lib/process-services/process-list/components/process-list.component.ts) |
| _Apps list component_ | _Not currently documented_ | [Source](../lib/process-services/app-list/apps-list.component.ts) |
| _Create process attachment component_ | _Not currently documented_ | [Source](../lib/process-services/attachment/create-process-attachment.component.ts) |
| _Create task attachment component_ | _Not currently documented_ | [Source](../lib/process-services/attachment/create-task-attachment.component.ts) |
@ -217,13 +216,16 @@ for more information about installing and using the source code.
| _Comment list component_ | _Not currently documented_ | [Source](../lib/process-services/comments/comment-list.component.ts) |
| _Comments component_ | _Not currently documented_ | [Source](../lib/process-services/comments/comments.component.ts) |
| _Process comments component_ | _Not currently documented_ | [Source](../lib/process-services/comments/process-comments.component.ts) |
| _People list component_ | _Not currently documented_ | [Source](../lib/process-services/people/people-list.component.ts) |
| _People search component_ | _Not currently documented_ | [Source](../lib/process-services/people/people-search.component.ts) |
| _People component_ | _Not currently documented_ | [Source](../lib/process-services/people/people.component.ts) |
| _People component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people/people.component.ts) |
| _People list component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people-list/people-list.component.ts) |
| _People search component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people-search/people-search.component.ts) |
| _People search field component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people-search-field/people-search-field.component.ts) |
| _People selector component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people-selector/people-selector.component.ts) |
| _Process filters component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-filters.component.ts) |
| _Process instance details component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-instance-details.component.ts) |
| _Process instance header component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-instance-header.component.ts) |
| _Process instance tasks component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-instance-tasks.component.ts) |
| _Process list component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-list.component.ts) |
| _Start process component_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/start-process.component.ts) |
| _Checklist component_ | _Not currently documented_ | [Source](../lib/process-services/task-list/components/checklist.component.ts) |
| _Start task component_ | _Not currently documented_ | [Source](../lib/process-services/task-list/components/start-task.component.ts) |
@ -236,6 +238,8 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| _People search action label directive_ | _Not currently documented_ | [Source](../lib/process-services/people/directives/people-search-action-label.directive.ts) |
| _People search title directive_ | _Not currently documented_ | [Source](../lib/process-services/people/directives/people-search-title.directive.ts) |
| _Process audit directive_ | _Not currently documented_ | [Source](../lib/process-services/process-list/components/process-audit.directive.ts) |
| _Task audit directive_ | _Not currently documented_ | [Source](../lib/process-services/task-list/components/task-audit.directive.ts) |

View File

@ -1,4 +1,4 @@
# ADF Rating component
# Rating component
Allows a user to add ratings to an item.
@ -14,15 +14,15 @@ Allows a user to add ratings to an item.
### Properties
| Attribute | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| nodeId | string | | The identifier of a node |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| nodeId | `string` | | Identifier of the node to apply the rating to. |
### Events
| Name | Description |
| ---- | ----------- |
| changeVote | Raised when vote gets changed |
| Name | Type | Description |
| ---- | ---- | ----------- |
| changeVote | `EventEmitter<{}>` | Emitted when the "vote" gets changed. |
## See also

View File

@ -16,24 +16,23 @@ Displays a input text which shows find-as-you-type suggestions.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| searchTerm | string | | Search term to pre-populate the field with |
| inputType | string | "text" | Type of the input field to render, e.g. "search" or "text" (default) |
| autocomplete | boolean | true | Whether the browser should offer field auto-completion for the input field to the user. |
| highlight | boolean | false | Use the true value if you want to see the searched word highlighted. |
| expandable | boolean | true | Whether to use an expanding search control, if false then a regular input is used. |
| liveSearchEnabled | boolean | true | Whether find-as-you-type suggestions should be offered for matching content items. Set to false to disable. |
| liveSearchMaxResults | number | 5 | Maximum number of results to show in the live search. |
| customQueryBody | [QueryBody](https://github.com/Alfresco/alfresco-js-api/blob/1.6.0/src/alfresco-search-rest-api/docs/QueryBody.md) | | object which allow you to perform more elaborated query from the search api. This input is deprecated, to use the extended query body function please refer to the suggested solution [here](search-configuration.interface.md) |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| expandable | `boolean` | `true` | Toggles whether to use an expanding search control. If false then a regular input is used. |
| highlight | `boolean` | `false` | Toggles highlighting of the search term in the results. |
| inputType | `string` | `'text'` | Type of the input field to render, e.g. "search" or "text" (default). |
| autocomplete | `boolean` | `false` | Toggles auto-completion of the search input field. |
| liveSearchEnabled | `boolean` | `true` | Toggles "find-as-you-type" suggestions for possible matches. |
| liveSearchMaxResults | `number` | `5` | Maximum number of results to show in the live search. |
| customQueryBody | `QueryBody` | | |
### Events
| Name | Description |
| ---- | ----------- |
| searchChange | Emitted when the search term is changed. The search term is provided in the 'value' property of the returned object. If the term is less than three characters in length then the term is truncated to an empty string. |
| submit | Emitted when the search is submitted pressing ENTER button. The search term is provided as value of the event. |
| optionClicked | Emitted when a file item from the list of find-as-you-type results is selected |
| Name | Type | Description |
| ---- | ---- | ----------- |
| submit | `EventEmitter<any>` | Emitted when the search is submitted pressing ENTER button. The search term is provided as value of the event. |
| searchChange | `EventEmitter<string>` | Emitted when the search term is changed. The search term is provided in the 'value' property of the returned object. If the term is less than three characters in length then the term is truncated to an empty string. |
| optionClicked | `EventEmitter<any>` | Emitted when a file item from the list of "find-as-you-type" results is selected. |
## Details

View File

@ -13,19 +13,21 @@ Searches items for supplied search terms.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| searchTerm | string | | Search term to use when executing the search. Updating this value will run a new search and update the results |
| maxResults | number | 20 | Maximum number of results to show in the search. |
| skipResults | number | 0 | Number of results to skip from the results pagination. |
| displayWith | function | | Function that maps an option's value to its display value in the trigger |
| queryBody | [QueryBody](https://github.com/Alfresco/alfresco-js-api/blob/1.6.0/src/alfresco-search-rest-api/docs/QueryBody.md) | | object which allow you to perform more elaborated query from the search api. This input is deprecated, to use the extended query body function please refer to the suggested solution [here](search-configuration.interface.md) |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| displayWith | `(value: any) => string` | `null` | Function that maps an option's value to its display value in the trigger. |
| maxResults | `number` | `20` | Maximum number of results to show in the search. |
| skipResults | `number` | `0` | Number of results to skip from the results pagination. |
| queryBody | `QueryBody` | | |
| searchTerm | `string` | `''` | Search term to use when executing the search. Updating this value will run a new search and update the results. |
| classList | `string` | | CSS class for display. |
### Events
| Name | Description |
| ---- | ----------- |
| resultLoaded | Emitted when search results have fully loaded |
| Name | Type | Description |
| ---- | ---- | ----------- |
| resultLoaded | `EventEmitter<NodePaging>` | Emitted when search results have fully loaded. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |
## Details

View File

@ -24,10 +24,11 @@ Displays a sidebar-action menu information panel.
### Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| title | string | null | The title of the Sidebar action |
| expanded | boolean | false | Toggle the sidebar action menu on expand.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| title | `string` | | The title of the sidebar action. |
| expanded | `boolean` | | Toggle the sidebar action menu on expand. |
## Details
As the name suggests, this is basically just a layout with CSS styling. There are three regions where you can add your own content, as shown in the example:
@ -35,4 +36,3 @@ As the name suggests, this is basically just a layout with CSS styling. There ar
- sidebar-menu-title-icon
- sidebar-menu-options
- sidebar-menu-expand-icon

View File

@ -15,13 +15,13 @@ Displays a dropdown menu to show and interact with the sites of the current user
### Properties
| Attribute | Type | Default | Description |
| --- | --- | --- | --- |
| --------- | ---- | ------- | ----------- |
| hideMyFiles | boolean | false | Hide the "My Files" option added to the list by default |
| siteList | [SitePaging](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | A custom list of sites to be displayed by the dropdown. If no value is given, the sites of the current user are displayed by default. A list of objects only with properties 'title' and 'guid' is enough to be able to display the dropdown. |
| placeholder | string | 'DROPDOWN.PLACEHOLDER_LABEL' | The placeholder text/the key from translation files for the placeholder text to be shown by default|
| placeholder | string | 'DROPDOWN.PLACEHOLDER_LABEL' | The placeholder text/the key from translation files for the placeholder text to be shown by default |
### Events
| Name | Returned Type | Description |
| --- | --- | --- |
| ---- | ------------- | ----------- |
| change | [SiteModel](site.model.md) | emitted when user selects a site. When default option is selected an empty model is emitted |

View File

@ -45,21 +45,29 @@ import { MatListItem } from '@angular/material';
})
export class SearchControlComponent implements OnInit, OnDestroy {
/** Toggles whether to use an expanding search control. If false
* then a regular input is used.
*/
@Input()
expandable: boolean = true;
/** Toggles highlighting of the search term in the results. */
@Input()
highlight: boolean = false;
/** Type of the input field to render, e.g. "search" or "text" (default). */
@Input()
inputType: string = 'text';
/** Toggles auto-completion of the search input field. */
@Input()
autocomplete: boolean = false;
/** Toggles "find-as-you-type" suggestions for possible matches. */
@Input()
liveSearchEnabled: boolean = true;
/** Maximum number of results to show in the live search. */
@Input()
liveSearchMaxResults: number = 5;
@ -67,12 +75,21 @@ export class SearchControlComponent implements OnInit, OnDestroy {
@Input()
customQueryBody: QueryBody;
/** Emitted when the search is submitted pressing ENTER button.
* The search term is provided as value of the event.
*/
@Output()
submit: EventEmitter<any> = new EventEmitter();
/** Emitted when the search term is changed. The search term is provided
* in the 'value' property of the returned object. If the term is less
* than three characters in length then the term is truncated to an empty
* string.
*/
@Output()
searchChange: EventEmitter<string> = new EventEmitter();
/** Emitted when a file item from the list of "find-as-you-type" results is selected. */
@Output()
optionClicked: EventEmitter<any> = new EventEmitter();
@ -211,7 +228,7 @@ export class SearchControlComponent implements OnInit, OnDestroy {
let previousElement: any = this.getPreviousElementSibling(<Element> $event.target);
if (previousElement) {
previousElement.focus();
}else {
} else {
this.searchInput.nativeElement.focus();
this.focusSubject.next(new FocusEvent('focus'));
}

View File

@ -51,12 +51,15 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@ContentChild(TemplateRef)
template: TemplateRef<any>;
/** Function that maps an option's value to its display value in the trigger. */
@Input()
displayWith: ((value: any) => string) | null = null;
/** Maximum number of results to show in the search. */
@Input()
maxResults: number = 20;
/** Number of results to skip from the results pagination. */
@Input()
skipResults: number = 0;
@ -64,9 +67,13 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@Input()
queryBody: QueryBody;
/** Search term to use when executing the search. Updating this value will
* run a new search and update the results.
*/
@Input()
searchTerm: string = '';
/** CSS class for display. */
@Input('class')
set classList(classList: string) {
if (classList && classList.length) {
@ -75,9 +82,11 @@ export class SearchComponent implements AfterContentInit, OnChanges {
}
}
/** Emitted when search results have fully loaded. */
@Output()
resultLoaded: EventEmitter<NodePaging> = new EventEmitter();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter();

View File

@ -26,15 +26,25 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
})
export class DropdownSitesComponent implements OnInit {
/** Hide the "My Files" option. */
@Input()
hideMyFiles: boolean = false;
/** A custom list of sites to be displayed by the dropdown. If no value
* is given, the sites of the current user are displayed by default. A
* list of objects only with properties 'title' and 'guid' is enough to
* be able to display the dropdown.
*/
@Input()
siteList: SitePaging = null;
/** Text or a translation key to act as a placeholder. */
@Input()
placeholder: string = 'DROPDOWN.PLACEHOLDER_LABEL';
/** Emitted when the user selects a site. When the default option is selected,
* an empty model is emitted.
*/
@Output()
change: EventEmitter<SiteEntry> = new EventEmitter();
@ -54,7 +64,7 @@ export class DropdownSitesComponent implements OnInit {
let siteFound;
if (this.siteSelected === this.MY_FILES_VALUE) {
siteFound = { entry: {}};
}else {
} else {
siteFound = this.siteList.list.entries.find( site => site.entry.guid === this.siteSelected);
}
this.change.emit(siteFound);

View File

@ -27,6 +27,7 @@ import { RatingService } from './services/rating.service';
})
export class RatingComponent implements OnChanges {
/** Identifier of the node to apply the rating to. */
@Input()
nodeId: string;
@ -34,6 +35,7 @@ export class RatingComponent implements OnChanges {
ratingType: string = 'fiveStar';
/** Emitted when the "vote" gets changed. */
@Output()
changeVote = new EventEmitter();

View File

@ -28,9 +28,11 @@ import { ChangeDetectionStrategy, Component, Directive, Input, ViewEncapsulation
export class SidebarActionMenuComponent {
/** The title of the sidebar action. */
@Input()
title: string;
/** Toggle the sidebar action menu on expand. */
@Input()
expanded: boolean;