[ADF-1769] Added JSDocs for directives (#2964)

This commit is contained in:
Andy Stark
2018-02-20 14:00:18 +00:00
committed by Eugenio Romano
parent d731cc651c
commit b45048b5ed
26 changed files with 137 additions and 69 deletions

View File

@@ -30,17 +30,17 @@ Some sample CSS to show the drag and drop area:
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| file-draggable | boolean | true | Toggles between enable/disable of the drag-and-drop functionality. |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| enabled | `boolean` | `true` | Enables/disables drag-and-drop functionality. |
### Events
| Name | Description |
| ---- | ----------- |
| filesEntityDropped | Emitted when one or more files are dragged and dropped onto the draggable element, such as a `div` |
| folderEntityDropped | Emitted when a directory is dragged and dropped onto the draggable element, such as a `div` |
| filesDropped | Emitted when one or more files are dragged and dropped onto the draggable element, such as a `div` |
| Name | Type | Description |
| ---- | ---- | ----------- |
| filesDropped | `EventEmitter<File[]>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
| filesEntityDropped | `EventEmitter<any>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
| folderEntityDropped | `EventEmitter<any>` | Emitted when a directory is dragged and dropped onto the draggable element. |
## Details

View File

@@ -19,9 +19,9 @@ Allows folders to be created.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| adf-create-folder | string | '-my-' | Parent folder where the new folder will be located after creation |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| parentNodeId | `string` | `DEFAULT_FOLDER_PARENT_ID` | Parent folder where the new folder will be located after creation. |
## Details

View File

@@ -19,11 +19,11 @@ Allows folders to be edited.
### Properties
| Name | Type | Default | Description |
| ----------------- | ---------------------- | ------- | ----------------------------------- |
| adf-edit-folder | MinimalNodeEntryEntity | | The folder node entity for editing |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| folder | `MinimalNodeEntryEntity` | | Folder node to edit. |
## Details
'FolderEditDirective' directive needs a selection folder entry of #documentList to open the folder dialog component to edit the name and description properties of that selected folder.
If data is valid, on dialog close, it emits folderEdit event.
If data is valid, on dialog close, it emits folderEdit event.

View File

@@ -14,6 +14,14 @@ Adds highlighting to selected sections of an HTML element's content.
</div>
```
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| selector | `string` | `''` | Class selector for highlightable elements. |
| search | `string` | `''` | Text to highlight. |
| classToApply | `string` | `'adf-highlight'` | CSS class used to apply highlighting. |
## Details
Add `adf-highlight` with a search term to an element to highlight occurrences

View File

@@ -19,16 +19,16 @@ Deletes multiple files and folders.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| adf-delete | MinimalNodeEntity\[] | \[] | Nodes to delete |
| permanent | boolean | false | Permanent delete |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| selection | `MinimalNodeEntity[]` | | Array of nodes to delete. |
| permanent | `boolean` | `false` | If true then the nodes are deleted immediately rather than being put in the trash. |
### Events
| Name | Description |
| ---- | ----------- |
| delete | emitted when delete process is done |
| Name | Type | Description |
| ---- | ---- | ----------- |
| delete | `EventEmitter<any>` | Emitted when the nodes have been deleted. |
## Details

View File

@@ -15,4 +15,10 @@ Allows folders and/or files to be downloaded. Multiple nodes are packed as a '.Z
<adf-document-list #documentList ...>
...
</adf-document-list>
```
```
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| nodes | `MinimalNodeEntity[]` | | Nodes to download. |

View File

@@ -32,15 +32,15 @@ export class MyComponent {
### Properties
| Name | Type | Default | Description |
| ----------------- | ------------------- | ------- | --------------------------- |
| adf-node-favorite | MinimalNodeEntity[] | [] | Nodes to toggle as favorite |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| selection | `MinimalNodeEntity[]` | `[]` | Array of nodes to toggle as favorites. |
### Events
| Name | Description |
| ------------------------- | -------------------------------------------- |
| toggle | emitted when toggle favorite process is done |
| Name | Type | Description |
| ---- | ---- | ----------- |
| toggle | `EventEmitter<any>` | Emitted when the favorite setting is complete. |
## Details
@@ -61,10 +61,9 @@ which provides a method to help further style the element.
The directive performs as follows:
- if there are no favorite nodes in the selection, then all are marked as favorites
- if there is at least one favorite node in the selection, then only those who are not
are being marked
- if all nodes in the selection are favorites, then they are removed from favorites
- if there are no favorite nodes in the selection, then all are marked as favorites
- if there is at least one favorite node in the selection, then only those who are not
are being marked
- if all nodes in the selection are favorites, then they are removed from favorites
See **Demo Shell**

View File

@@ -6,10 +6,10 @@ Selectively disables an HTML element or Angular component
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| adf-node-permission | [Permissions](https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/models/permissions.enum.ts) | null | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions) |
| adf-nodes | MinimalNodeEntity\[] | \[] | Nodes to check permission for |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| permission | `string` | `null` | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions). |
| nodes | `MinimalNodeEntity[]` | `[]` | Nodes to check permission for. |
## Details

View File

@@ -22,16 +22,16 @@ Restores deleted nodes to their original location.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| adf-restore | DeletedNodeEntry\[] | \[] | Deleted nodes to restore |
| location | string | '' | Route path to view restored node |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| selection | `DeletedNodeEntry[]` | | Array of deleted nodes to restore. |
| location | `string` | `''` | Path to restored node. |
### Events
| Name | Description |
| ---- | ----------- |
| restore | Raised when the restore is done |
| Name | Type | Description |
| ---- | ---- | ----------- |
| restore | `EventEmitter<any>` | Emitted when restoration is complete. |
## Details

View File

@@ -19,16 +19,16 @@ Fetches the Process Audit information in the pdf or json format.
### Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| taskId | string | | (**required**) The id of the task. |
| format | string | pdf | In whitch format you want the task audit information (pdf or json). |
| download | boolean | false | True If you want download the file on the click event. |
| fileName | string | Audit | Represent the name of the file to download in case the format is pdf. |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| processId | `string` | | ID of the process. |
| fileName | `string` | `'Audit'` | Name of the file to download (for PDF downloads). |
| format | `string` | `'pdf'` | Format for the audit information (can be "pdf" or "json"). |
| download | `boolean` | `true` | Enables downloading of the audit file on clicking. |
### Events
| Name | Description |
| --- | --- |
| clicked | Raised when the task audit info is ready |
| error | Raised if there is an error during fetching task information |
| Name | Type | Description |
| ---- | ---- | ----------- |
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |

View File

@@ -18,16 +18,16 @@ Fetches the Task Audit information in the pdf or json format.
### Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| taskId | string | | (**required**) The id of the task. |
| format | string | pdf | In whitch format you want the task audit information (pdf or json). |
| download | boolean | false | True If you want download the file on the click event. |
| fileName | string | Audit | Represent the name of the file to download in case the format is pdf. |
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| taskId | `string` | | (**required**) The id of the task. |
| fileName | `string` | `'Audit'` | Name of the downloaded file (for PDF downloads). |
| format | `string` | `'pdf'` | Format of the audit information. Can be "pdf" or "json". |
| download | `boolean` | `true` | Enables downloading of the audit when the decorated element is clicked. |
### Events
| Name | Description |
| --- | --- |
| clicked | Raised when the task audit info is ready |
| error | Raised if there is an error during fetching task information |
| Name | Type | Description |
| ---- | ---- | ----------- |
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
| error | `EventEmitter<any>` | Emitted when an error occurs. |

View File

@@ -31,6 +31,17 @@ You can decorate any element including buttons, for example:
</button>
```
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| enabled | `boolean` | `true` | Enables/disables uploading. |
| data | `any` | | Data to upload. |
| mode | `string[]` | `['drop']` | Upload mode. Can be "drop" (receives dropped files) or "click" (clicking opens a file dialog). Both modes can be active at once. |
| multiple | `boolean` | | Toggles multiple file uploads. |
| accept | `string` | | (Click mode only) MIME type filter for files to accept. |
| directory | `boolean` | | (Click mode only) Toggles uploading of directories. |
## Details
Used by attaching to an element or component.