[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

@@ -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") {

View File

@@ -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();

View File

@@ -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[];

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<File[]> = new EventEmitter<File[]>();
/** Emitted when one or more files are dragged and dropped onto the draggable element. */
@Output()
filesEntityDropped: EventEmitter<any> = new EventEmitter();
/** Emitted when a directory is dragged and dropped onto the draggable element. */
@Output()
folderEntityDropped: EventEmitter<any> = new EventEmitter();

View File

@@ -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';

View File

@@ -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<any> = new EventEmitter();

View File

@@ -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<any> = new EventEmitter();
@HostListener('click')

View File

@@ -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[] = [];

View File

@@ -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<any> = new EventEmitter();

View File

@@ -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;

View File

@@ -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<any> = new EventEmitter<any>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();

View File

@@ -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<any> = new EventEmitter<any>();
/** Emitted when an error occurs. */
@Output()
error: EventEmitter<any> = new EventEmitter<any>();