diff --git a/docs/file-draggable.directive.md b/docs/file-draggable.directive.md index 6242293718..f38fcbf996 100644 --- a/docs/file-draggable.directive.md +++ b/docs/file-draggable.directive.md @@ -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` | Emitted when one or more files are dragged and dropped onto the draggable element. | +| filesEntityDropped | `EventEmitter` | Emitted when one or more files are dragged and dropped onto the draggable element. | +| folderEntityDropped | `EventEmitter` | Emitted when a directory is dragged and dropped onto the draggable element. | ## Details diff --git a/docs/folder-create.directive.md b/docs/folder-create.directive.md index a5c7ba7e7e..6643ff666a 100644 --- a/docs/folder-create.directive.md +++ b/docs/folder-create.directive.md @@ -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 diff --git a/docs/folder-edit.directive.md b/docs/folder-edit.directive.md index e748aa9194..fc7b270054 100644 --- a/docs/folder-edit.directive.md +++ b/docs/folder-edit.directive.md @@ -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. \ No newline at end of file +If data is valid, on dialog close, it emits folderEdit event. diff --git a/docs/highlight.directive.md b/docs/highlight.directive.md index 210bfcb187..79a5eccebf 100644 --- a/docs/highlight.directive.md +++ b/docs/highlight.directive.md @@ -14,6 +14,14 @@ Adds highlighting to selected sections of an HTML element's content. ``` +### 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 diff --git a/docs/node-delete.directive.md b/docs/node-delete.directive.md index 573e6a8937..e84e367e21 100644 --- a/docs/node-delete.directive.md +++ b/docs/node-delete.directive.md @@ -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` | Emitted when the nodes have been deleted. | ## Details diff --git a/docs/node-download.directive.md b/docs/node-download.directive.md index 429709f3d8..f9c1173f3d 100644 --- a/docs/node-download.directive.md +++ b/docs/node-download.directive.md @@ -15,4 +15,10 @@ Allows folders and/or files to be downloaded. Multiple nodes are packed as a '.Z ... -``` \ No newline at end of file +``` + +### Properties + +| Name | Type | Default value | Description | +| ---- | ---- | ------------- | ----------- | +| nodes | `MinimalNodeEntity[]` | | Nodes to download. | diff --git a/docs/node-favorite.directive.md b/docs/node-favorite.directive.md index 0f6d468d18..9558192f7f 100644 --- a/docs/node-favorite.directive.md +++ b/docs/node-favorite.directive.md @@ -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` | 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** diff --git a/docs/node-permission.directive.md b/docs/node-permission.directive.md index c65698b8e5..465d588753 100644 --- a/docs/node-permission.directive.md +++ b/docs/node-permission.directive.md @@ -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 diff --git a/docs/node-restore.directive.md b/docs/node-restore.directive.md index ba17424c3c..4fece6edf7 100644 --- a/docs/node-restore.directive.md +++ b/docs/node-restore.directive.md @@ -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` | Emitted when restoration is complete. | ## Details diff --git a/docs/process-audit.directive.md b/docs/process-audit.directive.md index 4d9592cac5..948f352e06 100644 --- a/docs/process-audit.directive.md +++ b/docs/process-audit.directive.md @@ -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` | Emitted when the decorated element is clicked. | +| error | `EventEmitter` | Emitted when an error occurs. | diff --git a/docs/task-audit.directive.md b/docs/task-audit.directive.md index 21007ab56a..ddc7f09de5 100644 --- a/docs/task-audit.directive.md +++ b/docs/task-audit.directive.md @@ -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` | Emitted when the decorated element is clicked. | +| error | `EventEmitter` | Emitted when an error occurs. | diff --git a/docs/upload.directive.md b/docs/upload.directive.md index 930853ade1..acbd7f5e83 100644 --- a/docs/upload.directive.md +++ b/docs/upload.directive.md @@ -31,6 +31,17 @@ You can decorate any element including buttons, for example: ``` +### 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. diff --git a/lib/config/DocProcessor/tools/tscProps.js b/lib/config/DocProcessor/tools/tscProps.js index beab7f0702..eb6a3bd3f2 100644 --- a/lib/config/DocProcessor/tools/tscProps.js +++ b/lib/config/DocProcessor/tools/tscProps.js @@ -185,14 +185,14 @@ var ServiceDocAutoContent = /** @class */ (function () { }()); function updatePhase(tree, pathname, aggData) { var fileNameNoSuffix = path.basename(pathname, ".md"); - var itemType = fileNameNoSuffix.match(/component|service/); + var itemType = fileNameNoSuffix.match(/component|directive|service/); if (itemType) { var srcData = aggData.srcData[fileNameNoSuffix]; if (srcData) { var srcPath = srcData.path; var className = fixAngularFilename(fileNameNoSuffix); var classData = void 0; - if (itemType[0] === "component") { + if ((itemType[0] === "component") || (itemType[0] === "directive")) { classData = new ComponentDocAutoContent(); } else if (itemType[0] === "service") { diff --git a/lib/config/DocProcessor/tools/tscProps.ts b/lib/config/DocProcessor/tools/tscProps.ts index 260407bf31..99b685a58b 100644 --- a/lib/config/DocProcessor/tools/tscProps.ts +++ b/lib/config/DocProcessor/tools/tscProps.ts @@ -264,7 +264,7 @@ class ServiceDocAutoContent implements NgDocAutoContent { export function updatePhase(tree, pathname, aggData) { let fileNameNoSuffix = path.basename(pathname, ".md"); - let itemType = fileNameNoSuffix.match(/component|service/); + let itemType = fileNameNoSuffix.match(/component|directive|service/); if (itemType) { let srcData = aggData.srcData[fileNameNoSuffix]; @@ -275,7 +275,7 @@ export function updatePhase(tree, pathname, aggData) { let classData: NgDocAutoContent; - if (itemType[0] === "component") { + if ((itemType[0] === "component") || (itemType[0] === "directive")) { classData = new ComponentDocAutoContent(); } else if (itemType[0] === "service") { classData = new ServiceDocAutoContent(); diff --git a/lib/content-services/directives/node-download.directive.ts b/lib/content-services/directives/node-download.directive.ts index 406ae5be79..e4ac2dea7f 100644 --- a/lib/content-services/directives/node-download.directive.ts +++ b/lib/content-services/directives/node-download.directive.ts @@ -27,6 +27,7 @@ import { DownloadZipDialogComponent } from '../dialogs/download-zip.dialog'; }) export class NodeDownloadDirective { + /** Nodes to download. */ // tslint:disable-next-line:no-input-rename @Input('adfNodeDownload') nodes: MinimalNodeEntity[]; diff --git a/lib/content-services/folder-directive/folder-create.directive.ts b/lib/content-services/folder-directive/folder-create.directive.ts index b7bcc6b241..3d962b657d 100644 --- a/lib/content-services/folder-directive/folder-create.directive.ts +++ b/lib/content-services/folder-directive/folder-create.directive.ts @@ -31,6 +31,7 @@ const DEFAULT_FOLDER_PARENT_ID = '-my-'; export class FolderCreateDirective { static DIALOG_WIDTH: number = 400; + /** Parent folder where the new folder will be located after creation. */ @Input('adf-create-folder') parentNodeId: string = DEFAULT_FOLDER_PARENT_ID; diff --git a/lib/content-services/folder-directive/folder-edit.directive.ts b/lib/content-services/folder-directive/folder-edit.directive.ts index 17e3f8b760..002fd21ab0 100644 --- a/lib/content-services/folder-directive/folder-edit.directive.ts +++ b/lib/content-services/folder-directive/folder-edit.directive.ts @@ -31,6 +31,7 @@ import { ContentService } from '@alfresco/adf-core'; export class FolderEditDirective { static DIALOG_WIDTH: number = 400; + /** Folder node to edit. */ @Input('adf-edit-folder') folder: MinimalNodeEntryEntity; diff --git a/lib/content-services/upload/directives/file-draggable.directive.ts b/lib/content-services/upload/directives/file-draggable.directive.ts index bc3f283665..8ffdce64d4 100644 --- a/lib/content-services/upload/directives/file-draggable.directive.ts +++ b/lib/content-services/upload/directives/file-draggable.directive.ts @@ -27,15 +27,19 @@ export class FileDraggableDirective implements OnInit, OnDestroy { files: File []; + /** Enables/disables drag-and-drop functionality. */ @Input('file-draggable') enabled: boolean = true; + /** Emitted when one or more files are dragged and dropped onto the draggable element. */ @Output() filesDropped: EventEmitter = new EventEmitter(); + /** Emitted when one or more files are dragged and dropped onto the draggable element. */ @Output() filesEntityDropped: EventEmitter = new EventEmitter(); + /** Emitted when a directory is dragged and dropped onto the draggable element. */ @Output() folderEntityDropped: EventEmitter = new EventEmitter(); diff --git a/lib/core/directives/highlight.directive.ts b/lib/core/directives/highlight.directive.ts index 875a87ae9e..89c5dea233 100644 --- a/lib/core/directives/highlight.directive.ts +++ b/lib/core/directives/highlight.directive.ts @@ -25,12 +25,15 @@ import { HighlightTransformService, HightlightTransformResult } from '../service }) export class HighlightDirective { + /** Class selector for highlightable elements. */ @Input('adf-highlight-selector') selector: string = ''; + /** Text to highlight. */ @Input('adf-highlight') search: string = ''; + /** CSS class used to apply highlighting. */ @Input('adf-highlight-class') classToApply: string = 'adf-highlight'; diff --git a/lib/core/directives/node-delete.directive.ts b/lib/core/directives/node-delete.directive.ts index 92522be416..266936e8cb 100644 --- a/lib/core/directives/node-delete.directive.ts +++ b/lib/core/directives/node-delete.directive.ts @@ -53,12 +53,17 @@ interface ProcessStatus { selector: '[adf-delete]' }) export class NodeDeleteDirective implements OnChanges { + /** Array of nodes to delete. */ @Input('adf-delete') selection: MinimalNodeEntity[]; + /** If true then the nodes are deleted immediately rather than being + * put in the trash. + */ @Input() permanent: boolean = false; + /** Emitted when the nodes have been deleted. */ @Output() delete: EventEmitter = new EventEmitter(); diff --git a/lib/core/directives/node-favorite.directive.ts b/lib/core/directives/node-favorite.directive.ts index bbebf938c7..8b1eaa9784 100644 --- a/lib/core/directives/node-favorite.directive.ts +++ b/lib/core/directives/node-favorite.directive.ts @@ -31,9 +31,11 @@ import 'rxjs/observable/forkJoin'; export class NodeFavoriteDirective implements OnChanges { private favorites: any[] = []; + /** Array of nodes to toggle as favorites. */ @Input('adf-node-favorite') selection: MinimalNodeEntity[] = []; + /** Emitted when the favorite setting is complete. */ @Output() toggle: EventEmitter = new EventEmitter(); @HostListener('click') diff --git a/lib/core/directives/node-permission.directive.ts b/lib/core/directives/node-permission.directive.ts index 3b1fa58392..2b35b1f05d 100644 --- a/lib/core/directives/node-permission.directive.ts +++ b/lib/core/directives/node-permission.directive.ts @@ -31,9 +31,13 @@ export interface NodePermissionSubject { }) export class NodePermissionDirective implements OnChanges { + /** Node permission to check (create, delete, update, updatePermissions, + * !create, !delete, !update, !updatePermissions). + */ @Input('adf-node-permission') permission: string = null; + /** Nodes to check permission for. */ @Input('adf-nodes') nodes: MinimalNodeEntity[] = []; diff --git a/lib/core/directives/node-restore.directive.ts b/lib/core/directives/node-restore.directive.ts index 68839b7deb..55a9eabc0d 100644 --- a/lib/core/directives/node-restore.directive.ts +++ b/lib/core/directives/node-restore.directive.ts @@ -34,12 +34,15 @@ import 'rxjs/add/operator/mergeMap'; export class NodeRestoreDirective { private restoreProcessStatus; + /** Array of deleted nodes to restore. */ @Input('adf-restore') selection: DeletedNodeEntry[]; + /** Path to restored node. */ @Input() location: string = ''; + /** Emitted when restoration is complete. */ @Output() restore: EventEmitter = new EventEmitter(); diff --git a/lib/core/directives/upload.directive.ts b/lib/core/directives/upload.directive.ts index a0800e34cb..7988b5dc7f 100644 --- a/lib/core/directives/upload.directive.ts +++ b/lib/core/directives/upload.directive.ts @@ -25,21 +25,29 @@ import { FileInfo, FileUtils } from '../utils/file-utils'; }) export class UploadDirective implements OnInit, OnDestroy { + /** Enables/disables uploading. */ @Input('adf-upload') enabled: boolean = true; + /** Data to upload. */ @Input('adf-upload-data') data: any; + /** Upload mode. Can be "drop" (receives dropped files) or "click" + * (clicking opens a file dialog). Both modes can be active at once. + */ @Input() mode: string[] = ['drop']; // click|drop + /** Toggles multiple file uploads. */ @Input() multiple: boolean; + /** (Click mode only) MIME type filter for files to accept. */ @Input() accept: string; + /** (Click mode only) Toggles uploading of directories. */ @Input() directory: boolean; diff --git a/lib/process-services/process-list/components/process-audit.directive.ts b/lib/process-services/process-list/components/process-audit.directive.ts index 44883d76ed..663aa8a2d5 100644 --- a/lib/process-services/process-list/components/process-audit.directive.ts +++ b/lib/process-services/process-list/components/process-audit.directive.ts @@ -33,21 +33,27 @@ const PDF_FORMAT: string = 'pdf'; }) export class ProcessAuditDirective implements OnChanges { + /** ID of the process. */ @Input('process-id') processId: string; + /** Name of the file to download (for PDF downloads). */ @Input() fileName: string = 'Audit'; + /** Format for the audit information (can be "pdf" or "json"). */ @Input() format: string = 'pdf'; + /** Enables downloading of the audit file on clicking. */ @Input() download: boolean = true; + /** Emitted when the decorated element is clicked. */ @Output() clicked: EventEmitter = new EventEmitter(); + /** Emitted when an error occurs. */ @Output() error: EventEmitter = new EventEmitter(); diff --git a/lib/process-services/task-list/components/task-audit.directive.ts b/lib/process-services/task-list/components/task-audit.directive.ts index 70a55f9681..a75678d71e 100644 --- a/lib/process-services/task-list/components/task-audit.directive.ts +++ b/lib/process-services/task-list/components/task-audit.directive.ts @@ -33,21 +33,27 @@ const PDF_FORMAT: string = 'pdf'; }) export class TaskAuditDirective implements OnChanges { + /** (**required**) The id of the task. */ @Input('task-id') taskId: string; + /** Name of the downloaded file (for PDF downloads). */ @Input() fileName: string = 'Audit'; + /** Format of the audit information. Can be "pdf" or "json". */ @Input() format: string = 'pdf'; + /** Enables downloading of the audit when the decorated element is clicked. */ @Input() download: boolean = true; + /** Emitted when the decorated element is clicked. */ @Output() clicked: EventEmitter = new EventEmitter(); + /** Emitted when an error occurs. */ @Output() error: EventEmitter = new EventEmitter();