[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 | | 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) | | [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](../core/form/components/widgets/core/form-field-validator.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](../core/services/search-configuration.service.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) [(Back to Contents)](#contents)
@ -152,6 +152,7 @@ for more information about installing and using the source code.
| Name | Description | Source link | | 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) | | _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) | | _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) | | _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) | | _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 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) | | _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) | | _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) | | _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) | | _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 | | 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) | | _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 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) | | _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) | | _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) | | _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) | | _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 component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people/people.component.ts) |
| _People search component_ | _Not currently documented_ | [Source](../lib/process-services/people/people-search.component.ts) | | _People list component_ | _Not currently documented_ | [Source](../lib/process-services/people/components/people-list/people-list.component.ts) |
| _People component_ | _Not currently documented_ | [Source](../lib/process-services/people/people.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 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 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 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 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) | | _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) | | _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) | | _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 | | 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) | | _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) | | _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. Allows a user to add ratings to an item.
@ -14,15 +14,15 @@ Allows a user to add ratings to an item.
### Properties ### Properties
| Attribute | Type | Default | Description | | Name | Type | Default value | Description |
| --------- | ---- | ------- | ----------- | | ---- | ---- | ------------- | ----------- |
| nodeId | string | | The identifier of a node | | nodeId | `string` | | Identifier of the node to apply the rating to. |
### Events ### Events
| Name | Description | | Name | Type | Description |
| ---- | ----------- | | ---- | ---- | ----------- |
| changeVote | Raised when vote gets changed | | changeVote | `EventEmitter<{}>` | Emitted when the "vote" gets changed. |
## See also ## See also

View File

@ -16,24 +16,23 @@ Displays a input text which shows find-as-you-type suggestions.
### Properties ### Properties
| Name | Type | Default | Description | | Name | Type | Default value | Description |
| ---- | ---- | ------- | ----------- | | ---- | ---- | ------------- | ----------- |
| searchTerm | string | | Search term to pre-populate the field with | | expandable | `boolean` | `true` | Toggles whether to use an expanding search control. If false then a regular input is used. |
| inputType | string | "text" | Type of the input field to render, e.g. "search" or "text" (default) | | highlight | `boolean` | `false` | Toggles highlighting of the search term in the results. |
| autocomplete | boolean | true | Whether the browser should offer field auto-completion for the input field to the user. | | inputType | `string` | `'text'` | Type of the input field to render, e.g. "search" or "text" (default). |
| highlight | boolean | false | Use the true value if you want to see the searched word highlighted. | | autocomplete | `boolean` | `false` | Toggles auto-completion of the search input field. |
| expandable | boolean | true | Whether to use an expanding search control, if false then a regular input is used. | | liveSearchEnabled | `boolean` | `true` | Toggles "find-as-you-type" suggestions for possible matches. |
| 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. |
| liveSearchMaxResults | number | 5 | Maximum number of results to show in the live search. | | customQueryBody | `QueryBody` | | |
| 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) |
### Events ### Events
| Name | Description | | Name | Type | 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 | `EventEmitter<any>` | Emitted when the search is submitted pressing ENTER button. The search term is provided as value of the event. |
| submit | 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 | Emitted when a file item from the list of find-as-you-type results is selected | | optionClicked | `EventEmitter<any>` | Emitted when a file item from the list of "find-as-you-type" results is selected. |
## Details ## Details

View File

@ -13,19 +13,21 @@ Searches items for supplied search terms.
### Properties ### Properties
| Name | Type | Default | Description | | Name | Type | Default value | Description |
| ---- | ---- | ------- | ----------- | | ---- | ---- | ------------- | ----------- |
| searchTerm | string | | Search term to use when executing the search. Updating this value will run a new search and update the results | | 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. | | maxResults | `number` | `20` | Maximum number of results to show in the search. |
| skipResults | number | 0 | Number of results to skip from the results pagination. | | 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` | | |
| 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) | | 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 ### Events
| Name | Description | | Name | Type | Description |
| ---- | ----------- | | ---- | ---- | ----------- |
| resultLoaded | Emitted when search results have fully loaded | | resultLoaded | `EventEmitter<NodePaging>` | Emitted when search results have fully loaded. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |
## Details ## Details

View File

@ -24,15 +24,15 @@ Displays a sidebar-action menu information panel.
### Properties ### Properties
| Name | Type | Default | Description | | Name | Type | Default value | Description |
| --- | --- | --- | --- | | ---- | ---- | ------------- | ----------- |
| title | string | null | The title of the Sidebar action | | title | `string` | | The title of the sidebar action. |
| expanded | boolean | false | Toggle the sidebar action menu on expand. | expanded | `boolean` | | Toggle the sidebar action menu on expand. |
## Details ## 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: 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:
- sidebar-menu-title-icon - sidebar-menu-title-icon
- sidebar-menu-options - sidebar-menu-options
- sidebar-menu-expand-icon - 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 ### Properties
| Attribute | Type | Default | Description | | Attribute | Type | Default | Description |
| --- | --- | --- | --- | | --------- | ---- | ------- | ----------- |
| hideMyFiles | boolean | false | Hide the "My Files" option added to the list by default | | 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. | | 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 ### Events
| Name | Returned Type | Description | | 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 | | 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 { export class SearchControlComponent implements OnInit, OnDestroy {
/** Toggles whether to use an expanding search control. If false
* then a regular input is used.
*/
@Input() @Input()
expandable: boolean = true; expandable: boolean = true;
/** Toggles highlighting of the search term in the results. */
@Input() @Input()
highlight: boolean = false; highlight: boolean = false;
/** Type of the input field to render, e.g. "search" or "text" (default). */
@Input() @Input()
inputType: string = 'text'; inputType: string = 'text';
/** Toggles auto-completion of the search input field. */
@Input() @Input()
autocomplete: boolean = false; autocomplete: boolean = false;
/** Toggles "find-as-you-type" suggestions for possible matches. */
@Input() @Input()
liveSearchEnabled: boolean = true; liveSearchEnabled: boolean = true;
/** Maximum number of results to show in the live search. */
@Input() @Input()
liveSearchMaxResults: number = 5; liveSearchMaxResults: number = 5;
@ -67,12 +75,21 @@ export class SearchControlComponent implements OnInit, OnDestroy {
@Input() @Input()
customQueryBody: QueryBody; customQueryBody: QueryBody;
/** Emitted when the search is submitted pressing ENTER button.
* The search term is provided as value of the event.
*/
@Output() @Output()
submit: EventEmitter<any> = new EventEmitter(); 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() @Output()
searchChange: EventEmitter<string> = new EventEmitter(); searchChange: EventEmitter<string> = new EventEmitter();
/** Emitted when a file item from the list of "find-as-you-type" results is selected. */
@Output() @Output()
optionClicked: EventEmitter<any> = new EventEmitter(); optionClicked: EventEmitter<any> = new EventEmitter();
@ -211,7 +228,7 @@ export class SearchControlComponent implements OnInit, OnDestroy {
let previousElement: any = this.getPreviousElementSibling(<Element> $event.target); let previousElement: any = this.getPreviousElementSibling(<Element> $event.target);
if (previousElement) { if (previousElement) {
previousElement.focus(); previousElement.focus();
}else { } else {
this.searchInput.nativeElement.focus(); this.searchInput.nativeElement.focus();
this.focusSubject.next(new FocusEvent('focus')); this.focusSubject.next(new FocusEvent('focus'));
} }

View File

@ -51,12 +51,15 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@ContentChild(TemplateRef) @ContentChild(TemplateRef)
template: TemplateRef<any>; template: TemplateRef<any>;
/** Function that maps an option's value to its display value in the trigger. */
@Input() @Input()
displayWith: ((value: any) => string) | null = null; displayWith: ((value: any) => string) | null = null;
/** Maximum number of results to show in the search. */
@Input() @Input()
maxResults: number = 20; maxResults: number = 20;
/** Number of results to skip from the results pagination. */
@Input() @Input()
skipResults: number = 0; skipResults: number = 0;
@ -64,9 +67,13 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@Input() @Input()
queryBody: QueryBody; queryBody: QueryBody;
/** Search term to use when executing the search. Updating this value will
* run a new search and update the results.
*/
@Input() @Input()
searchTerm: string = ''; searchTerm: string = '';
/** CSS class for display. */
@Input('class') @Input('class')
set classList(classList: string) { set classList(classList: string) {
if (classList && classList.length) { if (classList && classList.length) {
@ -75,9 +82,11 @@ export class SearchComponent implements AfterContentInit, OnChanges {
} }
} }
/** Emitted when search results have fully loaded. */
@Output() @Output()
resultLoaded: EventEmitter<NodePaging> = new EventEmitter(); resultLoaded: EventEmitter<NodePaging> = new EventEmitter();
/** Emitted when an error occurs. */
@Output() @Output()
error: EventEmitter<any> = new EventEmitter(); 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 { export class DropdownSitesComponent implements OnInit {
/** Hide the "My Files" option. */
@Input() @Input()
hideMyFiles: boolean = false; 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() @Input()
siteList: SitePaging = null; siteList: SitePaging = null;
/** Text or a translation key to act as a placeholder. */
@Input() @Input()
placeholder: string = 'DROPDOWN.PLACEHOLDER_LABEL'; placeholder: string = 'DROPDOWN.PLACEHOLDER_LABEL';
/** Emitted when the user selects a site. When the default option is selected,
* an empty model is emitted.
*/
@Output() @Output()
change: EventEmitter<SiteEntry> = new EventEmitter(); change: EventEmitter<SiteEntry> = new EventEmitter();
@ -54,7 +64,7 @@ export class DropdownSitesComponent implements OnInit {
let siteFound; let siteFound;
if (this.siteSelected === this.MY_FILES_VALUE) { if (this.siteSelected === this.MY_FILES_VALUE) {
siteFound = { entry: {}}; siteFound = { entry: {}};
}else { } else {
siteFound = this.siteList.list.entries.find( site => site.entry.guid === this.siteSelected); siteFound = this.siteList.list.entries.find( site => site.entry.guid === this.siteSelected);
} }
this.change.emit(siteFound); this.change.emit(siteFound);

View File

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

View File

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