mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-3323] Updated doc tools to use DocFX intermediate files (#3601)
* [ADF-3323] Moved source file parsing to main doc tool * [ADF-3323] Moved source info classes * [ADF-3323] Added doc YAML generator tool * [ADF-3323] Added doc YAML/JSON source paths to gitignore * [ADF-3323] Completed templates and template context code * [ADF-3323] Added source paths and updated type linker * [ADF-3323] Final fixes to templates and type linking * [ADF-3323] Fixed filter for private and protected methods * [ADF-3323] Content services docs after check and rebuild * [ADF-3323] Updated docbuild script in package.json
This commit is contained in:
parent
54380fd693
commit
69d8ff147e
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,3 +26,5 @@ src/environments/
|
||||
/lib/config/exportCheck.js
|
||||
/lib/config/export-check/export-new.json
|
||||
/lib/config/export-check/exportCheck.js
|
||||
/docs/sourceinfo
|
||||
/docs/docs.json
|
@ -22,17 +22,17 @@ for more information about installing and using the source code.
|
||||
| [Add permission panel component](add-permission-panel.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.ts) |
|
||||
| [Add permission component](add-permission.component.md) | Searches for people or groups to add to the current node permissions. | [Source](../../lib/content-services/permission-manager/components/add-permission/add-permission.component.ts) |
|
||||
| [Permission list component](permission-list.component.md) | Shows node permissions as a table. | [Source](../../lib/content-services/permission-manager/components/permission-list/permission-list.component.ts) |
|
||||
| [Search check list component](search-check-list.component.md) | Implements a checklist widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-check-list/search-check-list.component.ts) |
|
||||
| [Search check list component](search-check-list.component.md) | Implements a checklist widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-check-list/search-check-list.component.ts) |
|
||||
| [Search chip list component](search-chip-list.component.md) | Displays search criteria as a set of "chips". | [Source](../../lib/content-services/search/components/search-chip-list/search-chip-list.component.ts) |
|
||||
| [Search control component](search-control.component.md) | Displays a input text which shows find-as-you-type suggestions. | [Source](../../lib/content-services/search/components/search-control.component.ts) |
|
||||
| [Search date range component](search-date-range.component.md) | Implements a date range widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-date-range/search-date-range.component.ts) |
|
||||
| [Search date range component](search-date-range.component.md) | Implements a date range widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-date-range/search-date-range.component.ts) |
|
||||
| [Search filter component](search-filter.component.md) | Represents a main container component for custom search and faceted search settings. | [Source](../../lib/content-services/search/components/search-filter/search-filter.component.ts) |
|
||||
| [Search number range component](search-number-range.component.md) | Implements a number range widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-number-range/search-number-range.component.ts) |
|
||||
| [Search radio component](search-radio.component.md) | Implements a radio button list widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-radio/search-radio.component.ts) |
|
||||
| [Search slider component](search-slider.component.md) | Implements a numeric slider widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-slider/search-slider.component.ts) |
|
||||
| [Search number range component](search-number-range.component.md) | Implements a number range widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-number-range/search-number-range.component.ts) |
|
||||
| [Search radio component](search-radio.component.md) | Implements a radio button list widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-radio/search-radio.component.ts) |
|
||||
| [Search slider component](search-slider.component.md) | Implements a numeric slider widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-slider/search-slider.component.ts) |
|
||||
| [Search sorting picker component](search-sorting-picker.component.md) | Provides an ability to select one of the predefined sorting definitions for search results: | [Source](../../lib/content-services/search/components/search-sorting-picker/search-sorting-picker.component.ts) |
|
||||
| [Search text component](search-text.component.md) | Implements a text input widget for the Search Filter component. | [Source](../../lib/content-services/search/components/search-text/search-text.component.ts) |
|
||||
| [Search component](search.component.md) | Searches items for supplied search terms. | [Source](../../lib/content-services/search/components/search.component.ts) |
|
||||
| [Search text component](search-text.component.md) | Implements a text input widget for the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-text/search-text.component.ts) |
|
||||
| [Search component](search.component.md) | Searches items for supplied search terms. | [Source](../../lib/content-services/search/components/search.component.ts) |
|
||||
| [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) |
|
||||
| [Like component](like.component.md) | Allows a user to add "likes" to an item. | [Source](../../lib/content-services/social/like.component.ts) |
|
||||
| [Rating component](rating.component.md) | Allows a user to add ratings to an item. | [Source](../../lib/content-services/social/rating.component.ts) |
|
||||
@ -43,7 +43,7 @@ for more information about installing and using the source code.
|
||||
| [Upload button component](upload-button.component.md) | Activates a file upload. | [Source](../../lib/content-services/upload/components/upload-button.component.ts) |
|
||||
| [Upload drag area component](upload-drag-area.component.md) | Adds a drag and drop area to upload files to ACS. | [Source](../../lib/content-services/upload/components/upload-drag-area.component.ts) |
|
||||
| [Upload version button component](upload-version-button.component.md)  | Activates a file version upload. | [Source](../../lib/content-services/upload/components/upload-version-button.component.ts) |
|
||||
| [Version list component](version-list.component.md)  | Displays the version history of a node in a Version Manager component. | [Source](../../lib/content-services/version-manager/version-list.component.ts) |
|
||||
| [Version list component](version-list.component.md)  | Displays the version history of a node in a [Version Manager component](../content-services/version-manager.component.md). | [Source](../../lib/content-services/version-manager/version-list.component.ts) |
|
||||
| [Version manager component](version-manager.component.md)  | Displays the version history of a node with the ability to upload a new version. | [Source](../../lib/content-services/version-manager/version-manager.component.ts) |
|
||||
| [Webscript component](webscript.component.md) | Provides access to Webscript features. | [Source](../../lib/content-services/webscript/webscript.component.ts) |
|
||||
|
||||
@ -72,12 +72,12 @@ for more information about installing and using the source code.
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Content node dialog service](content-node-dialog.service.md) | Displays and manages dialogs for selecting content to open, copy or upload. | [Source](../../lib/content-services/content-node-selector/content-node-dialog.service.ts) |
|
||||
| [Custom resources service](custom-resources.service.md) | Manages Document List information that is specific to a user. | [Source](../../lib/content-services/document-list/services/custom-resources.service.ts) |
|
||||
| [Document actions service](document-actions.service.md) | Implements the document menu actions for the Document List component. | [Source](../../lib/content-services/document-list/services/document-actions.service.ts) |
|
||||
| [Document list service](document-list.service.md) | Implements node operations used by the Document List component. | [Source](../../lib/content-services/document-list/services/document-list.service.ts) |
|
||||
| [Folder actions service](folder-actions.service.md) | Implements the folder menu actions for the Document List component. | [Source](../../lib/content-services/document-list/services/folder-actions.service.ts) |
|
||||
| [Document actions service](document-actions.service.md) | Implements the document menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/document-actions.service.ts) |
|
||||
| [Document list service](document-list.service.md) | Implements node operations used by the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/document-list.service.ts) |
|
||||
| [Folder actions service](folder-actions.service.md) | Implements the folder menu actions for the [Document List component](../content-services/document-list.component.md). | [Source](../../lib/content-services/document-list/services/folder-actions.service.ts) |
|
||||
| [Node permission dialog service](node-permission-dialog.service.md) | Displays dialogs to let the user set node permissions. | [Source](../../lib/content-services/permission-manager/services/node-permission-dialog.service.ts) |
|
||||
| [Node permission service](node-permission.service.md) | Manages role permissions for content nodes. | [Source](../../lib/content-services/permission-manager/services/node-permission.service.ts) |
|
||||
| [Search filter service](search-filter.service.md) | Registers widgets for use with the Search Filter component. | [Source](../../lib/content-services/search/components/search-filter/search-filter.service.ts) |
|
||||
| [Search filter service](search-filter.service.md) | Registers widgets for use with the [Search Filter component](../content-services/search-filter.component.md). | [Source](../../lib/content-services/search/components/search-filter/search-filter.service.ts) |
|
||||
| [Search query builder service](search-query-builder.service.md) | Stores information from all the custom search and faceted search widgets, compiles and runs the final search query. | [Source](../../lib/content-services/search/search-query-builder.service.ts) |
|
||||
| [Rating service](rating.service.md) | Manages ratings for items in Content Services. | [Source](../../lib/content-services/social/services/rating.service.ts) |
|
||||
| [Tag service](tag.service.md) | Manages tags in Content Services. | [Source](../../lib/content-services/tag/services/tag.service.ts) |
|
||||
@ -88,4 +88,4 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Search Widget interface](search-widget.interface.md) | Specifies required properties for Search filter component widgets. | [Source](../../lib/content-services/search/search-widget.interface.ts) |
|
||||
| [Search Widget interface](search-widget.interface.md) | Specifies required properties for [Search filter component](../content-services/search-filter.component.md) widgets. | [Source](../../lib/content-services/search/search-widget.interface.ts) |
|
||||
|
@ -25,7 +25,7 @@ Searches for people or groups to add to the current node permissions.
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| select | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a permission list item is selected. |
|
||||
|
||||
## Details
|
||||
|
@ -25,13 +25,13 @@ Searches for people or groups to add to the current node permissions.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | ID of the target node. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs during the update. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when the node is updated successfully. |
|
||||
|
||||
|
@ -24,19 +24,19 @@ Indicates the current position within a navigation hierarchy.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Active node, builds UI based on folderNode.path.elements collection. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Active node, builds UI based on folderNode.path.elements collection. |
|
||||
| maxItems | `number` | | Maximum number of nodes to display before wrapping them with a dropdown element. |
|
||||
| root | `string` | null | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. You can use an i18n resource key for the property value. |
|
||||
| rootId | `string` | null | (optional) The id of the root element. You can use this property to set a custom element the breadcrumb should start with. |
|
||||
| root | `string` | null | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. You can use an i18n resource key for the property value. |
|
||||
| rootId | `string` | null | (optional) The id of the root element. You can use this property to set a custom element the breadcrumb should start with. |
|
||||
| target | [`DocumentListComponent`](../content-services/document-list.component.md) | | (optional) [Document List component](../content-services/document-list.component.md) to operate with. The list will update when the breadcrumb is clicked. |
|
||||
| transform | `function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
| transform | `Function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| navigate | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PathElementEntity`](../../lib/content-services/document-list/models/document-library.model.ts)`>` | Emitted when the user clicks on a breadcrumb. |
|
||||
| ---- | ---- | ----------- |
|
||||
| navigate | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the user clicks on a breadcrumb. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -13,19 +13,15 @@ Adds options to a Document List actions menu for a particular content type.
|
||||
## Contents
|
||||
|
||||
- [Basic Usage](#basic-usage)
|
||||
|
||||
- [Class members](#class-members)
|
||||
|
||||
- [Properties](#properties)
|
||||
- [Events](#events)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Conditional visibility](#conditional-visibility)
|
||||
- [Conditional disabled state](#conditional-disabled-state)
|
||||
- [Customizing built-in actions](#customizing-built-in-actions)
|
||||
- [Error, Permission and Success callbacks](#error-permission-and-success-callbacks)
|
||||
|
||||
- [See also](#see-also)
|
||||
|
||||
## Basic Usage
|
||||
@ -86,24 +82,24 @@ export class MyView {
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| disableWithNoPermission | `boolean` | | Should this action be disabled in the menu if the user doesn't have permission for it? |
|
||||
| disabled | `boolean \|Function` | false | Is the menu item disabled? |
|
||||
| disabled | `boolean \| Function` | false | Is the menu item disabled? |
|
||||
| handler | `string` | | System actions. Can be "delete", "download", "copy" or "move". |
|
||||
| icon | `string` | | The name of the icon to display next to the menu command (can be left blank). |
|
||||
| permission | `string` | | The permission type. |
|
||||
| target | `string` | [`ContentActionTarget`](../../lib/content-services/document-list/models/content-action.model.ts).All | Type of item that the action applies to. Can be "document" or "folder" |
|
||||
| target | `string` | | Type of item that the action applies to. Can be "document" or "folder" |
|
||||
| title | `string` | "Action" | The title of the action as shown in the menu. |
|
||||
| visible | `boolean \| Function` | true | Visibility state (see examples). |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs during the action. Applies to copy and move actions. |
|
||||
| execute | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the user selects the action from the menu. |
|
||||
| permissionEvent | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a permission error occurs |
|
||||
| success | `EventEmitter<Object>` | Emitted when the action succeeds with the success string message. Applies to copy, move and delete actions. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the action succeeds with the success string message. Applies to copy, move and delete actions. |
|
||||
|
||||
## Details
|
||||
|
||||
@ -124,7 +120,7 @@ will trigger the same action.) You can also add your own handler by implementing
|
||||
`execute` event.
|
||||
|
||||
Note that you can use _both_ a built-in handler and your own `execute`
|
||||
function in the same action. The `execute` function is passed a [`NodeMinimalEntry`](../../lib/content-services/document-list/models/document-library.model.ts) as its
|
||||
function in the same action. The `execute` function is passed a [`NodeMinimalEntry`](lib/content-services/document-list/models/document-library.model.ts) as its
|
||||
parameter (see the [Document Library model](document-library.model.md) page for more
|
||||
information) which contains full details of the item that the action is operating on. For
|
||||
example, with `handler="delete"` you could use `execute` to show a message with the name,
|
||||
@ -383,8 +379,8 @@ funcName = (parameters): boolean => {
|
||||
|
||||
Similar to `visible` property, it is possible to control the `disabled` state with the following scenarios:
|
||||
|
||||
- direct value of `boolean` type
|
||||
- binding to a property of the `Function` type that evaluates condition and returns `boolean` value
|
||||
- direct value of `boolean` type
|
||||
- binding to a property of the `Function` type that evaluates condition and returns `boolean` value
|
||||
|
||||
#### Using direct value of boolean type
|
||||
|
||||
|
@ -25,7 +25,7 @@ Displays and edits metadata related to a node.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| displayEmpty | `boolean` | false | Toggles whether to display empty values in the card view |
|
||||
| editable | `boolean` | false | Toggles whether the edit button should be shown |
|
||||
| expanded | `boolean` | false | Toggles between expanded (ie, full information) and collapsed (ie, reduced information) in the display |
|
||||
|
@ -14,41 +14,41 @@ Displays and manages dialogs for selecting content to open, copy or upload.
|
||||
|
||||
- **close**()<br/>
|
||||
Closes the currently open dialog.
|
||||
- **getTitleTranslation**(action: `string` = `null`, name: `string` = `null`): `string`<br/>
|
||||
- **getTitleTranslation**(action: `string`, name: `string`): `string`<br/>
|
||||
Gets the translation of the dialog title.
|
||||
- _action:_ `string` - Name of the action to display in the dialog title
|
||||
- _name:_ `string` - Name of the item on which the action is being performed
|
||||
- **Returns** `string` - Translated version of the title
|
||||
- **openCopyMoveDialog**(action: `string` = `null`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`, permission?: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openCopyMoveDialog**(action: `string`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md), permission?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a dialog to copy or move an item to a new location.
|
||||
- _action:_ `string` - Name of the action (eg, "Copy" or "Move") to show in the title
|
||||
- _contentEntry:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - Item to be copied or moved
|
||||
- _permission:_ `string` - (Optional) Permission for the operation
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about files that were copied/moved
|
||||
- **openFileBrowseDialogByFolderId**(folderNodeId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openFileBrowseDialogByFolderId**(folderNodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a file browser at a chosen folder location.
|
||||
- _folderNodeId:_ `string` - ID of the folder to use
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about the selected file(s)
|
||||
- **openFileBrowseDialogBySite**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a file browser at a chosen site location.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about the selected file(s)
|
||||
- **openFolderBrowseDialogByFolderId**(folderNodeId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openFolderBrowseDialogByFolderId**(folderNodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a folder browser at a chosen folder location.
|
||||
- _folderNodeId:_ `string` - ID of the folder to use
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about the selected folder(s)
|
||||
- **openFolderBrowseDialogBySite**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a folder browser at a chosen site location.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about the selected folder(s)
|
||||
- **openLockNodeDialog**(contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`): [`Subject`](http://reactivex.io/documentation/subject.html)`<string>`<br/>
|
||||
- **openLockNodeDialog**(contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md)): [`Subject`](http://reactivex.io/documentation/subject.html)`<string>`<br/>
|
||||
Opens a lock node dialog.
|
||||
- _contentEntry:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - Node to lock
|
||||
- **Returns** [`Subject`](http://reactivex.io/documentation/subject.html)`<string>` - Error/status message (if any)
|
||||
- **openUploadFileDialog**(action: `string` = `null`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openUploadFileDialog**(action: `string`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a dialog to choose a file to upload.
|
||||
- _action:_ `string` - Name of the action to show in the title
|
||||
- _contentEntry:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - Item to upload
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` - Information about the chosen file(s)
|
||||
- **openUploadFolderDialog**(action: `string` = `null`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openUploadFolderDialog**(action: `string`, contentEntry: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a dialog to choose folders to upload.
|
||||
- _action:_ `string` - Name of the action to show in the title
|
||||
- _contentEntry:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - Item to upload
|
||||
|
@ -28,20 +28,20 @@ Opens a Content Node Selector in its own dialog window.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| breadcrumbTransform | `function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
| currentFolderId | `string` | null | Node ID of the folder currently listed. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| breadcrumbTransform | `Function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
| currentFolderId | `string` | null | Node ID of the folder currently listed. |
|
||||
| dropdownHideMyFiles | `boolean` | false | Hide the "My Files" option added to the site list by default. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | Custom site for site dropdown same as siteList. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| imageResolver | [`ImageResolver`](../../lib/content-services/document-list/data/image-resolver.model.ts) | null | Custom image resolver function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| isSelectionValid | [`ValidationFunction`](../../lib/content-services/content-node-selector/content-node-selector-panel.component.ts) | defaultValidation | Function used to decide if the selected node has permission to be selected. Default value is a function that always returns true. |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | Custom site for site dropdown same as siteList. See the [Sites Dropdown component](sites-dropdown.component.md) for more information. |
|
||||
| imageResolver | `ImageResolver` | null | Custom image resolver function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| isSelectionValid | `ValidationFunction` | defaultValidation | Function used to decide if the selected node has permission to be selected. Default value is a function that always returns true. |
|
||||
| pageSize | `number` | | Number of items shown per page in the list. |
|
||||
| rowFilter | [`RowFilter`](../../lib/content-services/document-list/data/row-filter.model.ts) | null | Custom row filter function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
| rowFilter | `RowFilter` | null | Custom row filter function. See the [Document List component](document-list.component.md#custom-row-filter) for more information. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| select | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`[]>` | Emitted when the user has chosen an item. |
|
||||
|
||||
## Details
|
||||
|
@ -13,16 +13,12 @@ Allows a user to select items from a Content Services repository.
|
||||
## Contents
|
||||
|
||||
- [Class members](#class-members)
|
||||
|
||||
- [Properties](#properties)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Showing the dialog](#showing-the-dialog)
|
||||
- [Usage example](#usage-example)
|
||||
- [RowFilter and ImageResolver](#rowfilter-and-imageresolver)
|
||||
- [Using the breadcrumbTransform function](#using-the-breadcrumbtransform-function)
|
||||
|
||||
- [See also](#see-also)
|
||||
|
||||
## Class members
|
||||
@ -30,14 +26,14 @@ Allows a user to select items from a Content Services repository.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| currentFolderId | `string` | null | (**Deprecated:** in 2.1.0) |
|
||||
| dropdownHideMyFiles | `boolean` | false | (**Deprecated:** in 2.1.0) |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | (**Deprecated:** in 2.1.0) |
|
||||
| imageResolver | [`ImageResolver`](../../lib/content-services/document-list/data/image-resolver.model.ts) | null | (**Deprecated:** in 2.1.0) |
|
||||
| pageSize | `number` | | (**Deprecated:** in 2.1.0) |
|
||||
| rowFilter | [`RowFilter`](../../lib/content-services/document-list/data/row-filter.model.ts) | null | (**Deprecated:** in 2.1.0) |
|
||||
| title | `string` | null | (**Deprecated:** in 2.1.0) |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| currentFolderId | `string` | null | (**Deprecated:** in 2.1.0) |
|
||||
| dropdownHideMyFiles | `boolean` | false | (**Deprecated:** in 2.1.0) |
|
||||
| dropdownSiteList | [`SitePaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitePaging.md) | null | (**Deprecated:** in 2.1.0) |
|
||||
| imageResolver | `ImageResolver` | null | (**Deprecated:** in 2.1.0) |
|
||||
| pageSize | `number` | | (**Deprecated:** in 2.1.0) |
|
||||
| rowFilter | `RowFilter` | null | (**Deprecated:** in 2.1.0) |
|
||||
| title | `string` | null | (**Deprecated:** in 2.1.0) |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -12,47 +12,47 @@ Manages Document List information that is specific to a user.
|
||||
|
||||
### Methods
|
||||
|
||||
- **getCorrespondingNodeIds**(nodeId: `string` = `null`, pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>`<br/>
|
||||
- **getCorrespondingNodeIds**(nodeId: `string`, pagination: [`PaginationModel`](lib/core/models/pagination.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>`<br/>
|
||||
Gets the contents of one of the well-known aliases in the form of node ID strings.
|
||||
- _nodeId:_ `string` - ID of the target folder node
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>` - List of node IDs
|
||||
- **getRecentFiles**(personId: `string` = `null`, pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **getRecentFiles**(personId: `string`, pagination: [`PaginationModel`](lib/core/models/pagination.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets files recently accessed by a user.
|
||||
- _personId:_ `string` - ID of the user
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of nodes for the recently used files
|
||||
- **isCustomSource**(folderId: `string` = `null`): `boolean`<br/>
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of nodes for the recently used files
|
||||
- **isCustomSource**(folderId: `string`): `boolean`<br/>
|
||||
Is the folder ID one of the well-known aliases?
|
||||
- _folderId:_ `string` - Folder ID name to check
|
||||
- **Returns** `boolean` - True if the ID is a well-known name, false otherwise
|
||||
- **loadFavorites**(pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **loadFavorites**(pagination: [`PaginationModel`](lib/core/models/pagination.model.ts), includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets favorite files for the current user.
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _includeFields:_ `string[]` - List of data field names to include in the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of favorite files
|
||||
- **loadFolderByNodeId**(nodeId: `string` = `null`, pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`, includeFields: `string[]` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of favorite files
|
||||
- **loadFolderByNodeId**(nodeId: `string`, pagination: [`PaginationModel`](lib/core/models/pagination.model.ts), includeFields: `string[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets a folder's contents.
|
||||
- _nodeId:_ `string` - ID of the target folder node
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _includeFields:_ `string[]` - List of data field names to include in the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of items contained in the folder
|
||||
- **loadMemberSites**(pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of items contained in the folder
|
||||
- **loadMemberSites**(pagination: [`PaginationModel`](lib/core/models/pagination.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets sites that the current user is a member of.
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of sites
|
||||
- **loadSharedLinks**(pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of sites
|
||||
- **loadSharedLinks**(pagination: [`PaginationModel`](lib/core/models/pagination.model.ts), includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets shared links for the current user.
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _includeFields:_ `string[]` - List of data field names to include in the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of shared links
|
||||
- **loadSites**(pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of shared links
|
||||
- **loadSites**(pagination: [`PaginationModel`](lib/core/models/pagination.model.ts)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets all sites in the respository.
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - List of sites
|
||||
- **loadTrashcan**(pagination: [`PaginationModel`](../../lib/core/models/pagination.model.ts) = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`DeletedNodesPaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/DeletedNodesPaging.md)`>`<br/>
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - List of sites
|
||||
- **loadTrashcan**(pagination: [`PaginationModel`](lib/core/models/pagination.model.ts), includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`DeletedNodesPaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/DeletedNodesPaging.md)`>`<br/>
|
||||
Gets all items currently in the trash.
|
||||
- _pagination:_ [`PaginationModel`](../../lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _pagination:_ [`PaginationModel`](lib/core/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _includeFields:_ `string[]` - List of data field names to include in the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`DeletedNodesPaging`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/DeletedNodesPaging.md)`>` - List of deleted items
|
||||
|
||||
|
@ -12,18 +12,18 @@ Implements the document menu actions for the [Document List component](../conten
|
||||
|
||||
### Methods
|
||||
|
||||
- **canExecuteAction**(obj: `any` = `null`): `boolean`<br/>
|
||||
- **canExecuteAction**(obj: `any`): `boolean`<br/>
|
||||
Checks if actions can be executed for an item.
|
||||
- _obj:_ `any` - Item to receive an action
|
||||
- **Returns** `boolean` - True if the action can be executed on this item, false otherwise
|
||||
- **getHandler**(key: `string` = `null`): [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts)<br/>
|
||||
- **getHandler**(key: `string`): `ContentActionHandler`<br/>
|
||||
Gets the handler for an action.
|
||||
- _key:_ `string` - Identifier of the action
|
||||
- **Returns** [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) - The handler for the action
|
||||
- **setHandler**(key: `string` = `null`, handler: [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) = `null`): `boolean`<br/>
|
||||
- **Returns** `ContentActionHandler` - The handler for the action
|
||||
- **setHandler**(key: `string`, handler: `ContentActionHandler`): `boolean`<br/>
|
||||
Sets a new handler for an action.
|
||||
- _key:_ `string` - Identifier of the action
|
||||
- _handler:_ [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) - Handler for the action
|
||||
- _handler:_ `ContentActionHandler` - Handler for the action
|
||||
- **Returns** `boolean` - False if the key was an empty/null string, true otherwise
|
||||
|
||||
## Details
|
||||
|
@ -13,14 +13,10 @@ Displays the documents from a repository.
|
||||
## Contents
|
||||
|
||||
- [Basic Usage](#basic-usage)
|
||||
|
||||
- [Class members](#class-members)
|
||||
|
||||
- [Properties](#properties)
|
||||
- [Events](#events)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [DOM Events](#dom-events)
|
||||
- [Conditional visibility](#conditional-visibility)
|
||||
- [Card view](#card-view)
|
||||
@ -34,14 +30,11 @@ Displays the documents from a repository.
|
||||
- [Location Column](#location-column)
|
||||
- [Actions](#actions)
|
||||
- [Navigation mode](#navigation-mode)
|
||||
|
||||
- [Advanced usage and customization](#advanced-usage-and-customization)
|
||||
|
||||
- [Custom row filter](#custom-row-filter)
|
||||
- [Custom image resolver](#custom-image-resolver)
|
||||
- [Custom 'empty folder' template](#custom-empty-folder-template)
|
||||
- [Custom 'permission denied' template](#custom-permission-denied-template)
|
||||
|
||||
- [Custom 'empty folder' template](#custom-'empty-folder'-template)
|
||||
- [Custom 'permission denied' template](#custom-'permission-denied'-template)
|
||||
- [See also](#see-also)
|
||||
|
||||
## Basic Usage
|
||||
@ -60,46 +53,46 @@ Displays the documents from a repository.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| allowDropFiles | `boolean` | false | Toggle file drop support for rows (see [Upload Directive](../core/upload.directive.md) for further details |
|
||||
| contentActions | `boolean` | false | Toggles content actions for each row |
|
||||
| contentActionsPosition | `string` | "right" | Position of the content actions dropdown menu. Can be set to "left" or "right". |
|
||||
| contextMenuActions | `boolean` | false | Toggles context menus for each row |
|
||||
| currentFolderId | `string` | null | The ID of the folder node to display or a reserved string alias for special sources |
|
||||
| display | `string` | [`DisplayMode`](../../lib/core/datatable/components/datatable/datatable.component.ts).List | Change the display mode of the table. Can be "list" or "gallery". |
|
||||
| emptyFolderImageUrl | `string` | "./assets/images/empty_doc_lib.svg" | Custom image for empty folder. Default value: './assets/images/empty_doc_lib.svg' |
|
||||
| currentFolderId | `string` | null | The ID of the folder node to display or a reserved string alias for special sources |
|
||||
| display | `string` | DisplayMode.List | Change the display mode of the table. Can be "list" or "gallery". |
|
||||
| emptyFolderImageUrl | `string` | | Custom image for empty folder. Default value: './assets/images/empty_doc_lib.svg' |
|
||||
| enableInfiniteScrolling | `boolean` | false | Set document list to work in infinite scrolling mode |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Currently displayed folder node |
|
||||
| imageResolver | `any \| null` | null | Custom image resolver |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Currently displayed folder node |
|
||||
| imageResolver | `any \| null` | null | Custom image resolver |
|
||||
| includeFields | `string[]` | | Include additional information about the node in the server request.for example: association, isLink, isLocked and others. |
|
||||
| loading | `boolean` | false | Toggles the loading state and animated spinners for the component. Used in combination with `navigate=false` to perform custom navigation and loading state indication. |
|
||||
| locationFormat | `string` | "/" | The default route for all the location-based columns (if declared). |
|
||||
| maxItems | `number` | | Default value is stored into user preference settings use it only if you are not using the pagination |
|
||||
| multiselect | `boolean` | false | Toggles multiselect mode |
|
||||
| navigate | `boolean` | true | Toggles navigation to folder content or file preview |
|
||||
| navigationMode | `string` | [`DocumentListComponent`](../content-services/document-list.component.md).DOUBLE_CLICK_NAVIGATION | User interaction for folder navigation or file preview. Valid values are "click" and "dblclick". Default value: "dblclick" |
|
||||
| node | [`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts) | null | The Document list will show all the nodes contained in the [`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts) entity |
|
||||
| permissionsStyle | [`PermissionStyleModel`](../../lib/content-services/document-list/models/permissions-style.model.ts)`[]` | \[] | Define a set of CSS styles styles to apply depending on the permission of the user on that node. See the [Permission Style model](../../lib/content-services/document-list/models/permissions-style.model.ts) page for further details and examples. |
|
||||
| rowFilter | `any \| null` | null | Custom row filter |
|
||||
| navigationMode | `string` | | User interaction for folder navigation or file preview. Valid values are "click" and "dblclick". Default value: "dblclick" |
|
||||
| node | [`NodePaging`](lib/content-services/document-list/models/document-library.model.ts) | null | The Document list will show all the nodes contained in the [NodePaging](lib/content-services/document-list/models/document-library.model.ts) entity |
|
||||
| permissionsStyle | [`PermissionStyleModel`](lib/content-services/document-list/models/permissions-style.model.ts)`[]` | \[] | Define a set of CSS styles styles to apply depending on the permission of the user on that node. See the [Permission Style model](lib/content-services/document-list/models/permissions-style.model.ts) page for further details and examples. |
|
||||
| rowFilter | `any \| null` | null | Custom row filter |
|
||||
| rowStyle | `string` | | The inline style to apply to every row. See the Angular NgStyle docs for more details and usage examples. |
|
||||
| rowStyleClass | `string` | | The CSS class to apply to every row |
|
||||
| selectionMode | `string` | "single" | Row selection mode. Can be null, `single` or `multiple`. For `multiple` mode, you can use Cmd (macOS) or Ctrl (Win) modifier key to toggle selection for multiple rows. |
|
||||
| showHeader | `boolean` | true | Toggles the header |
|
||||
| skipCount | `number` | 0 | Number of elements to skip over for pagination purposes |
|
||||
| sorting | `string[]` | ['name', 'asc'] | Defines default sorting. The format is an array of 2 strings `[key, direction]` i.e. `['name', 'desc']` or `['name', 'asc']`. Set this value only if you want to override the default sorting detected by the component based on columns. |
|
||||
| sorting | `string[]` | ['name', 'asc'] | Defines default sorting. The format is an array of 2 strings `[key, direction]` i.e. `['name', 'desc']` or `['name', 'asc']`. Set this value only if you want to override the default sorting detected by the component based on columns. |
|
||||
| sortingMode | `string` | "client" | Defines sorting mode. Can be either `client` or `server`. |
|
||||
| thumbnails | `boolean` | false | Show document thumbnails rather than icons |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the API fails to get the Document List data |
|
||||
| folderChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntryEvent`](../../lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the current display folder changes |
|
||||
| nodeClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntityEvent`](../../lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the user clicks a list node |
|
||||
| nodeDblClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntityEvent`](../../lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the user double-clicks a list node |
|
||||
| preview | `EventEmitter<NodeEntityEvent>` | Emitted when the user acts upon files with either single or double click (depends on `navigation-mode`). Useful for integration with the Viewer component. |
|
||||
| ready | `EventEmitter<NodePaging>` | Emitted when the Document List has loaded all items and is ready for use |
|
||||
| folderChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntryEvent`](lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the current display folder changes |
|
||||
| nodeClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntityEvent`](lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the user clicks a list node |
|
||||
| nodeDblClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntityEvent`](lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the user double-clicks a list node |
|
||||
| preview | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodeEntityEvent`](lib/content-services/document-list/components/node.event.ts)`>` | Emitted when the user acts upon files with either single or double click (depends on `navigation-mode`). Useful for integration with the [Viewer component](../core/viewer.component.md). |
|
||||
| ready | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` | Emitted when the Document List has loaded all items and is ready for use |
|
||||
|
||||
## Details
|
||||
|
||||
@ -660,7 +653,7 @@ The following example switches navigation to single clicks:
|
||||
|
||||
You can create a custom row filter function that returns `true` if the row should be
|
||||
displayed or `false` if it should be hidden.
|
||||
A typical row filter implementation receives a [`ShareDataRow`](../../lib/content-services/document-list/data/share-data-row.model.ts) object as a parameter:
|
||||
A typical row filter implementation receives a [`ShareDataRow`](lib/content-services/document-list/data/share-data-row.model.ts) object as a parameter:
|
||||
|
||||
```ts
|
||||
myFilter(row: ShareDataRow): boolean {
|
||||
|
@ -12,55 +12,53 @@ Implements node operations used by the [Document List component](../content-serv
|
||||
|
||||
### Methods
|
||||
|
||||
- **copyNode**(nodeId: `string` = `null`, targetParentId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
- **copyNode**(nodeId: `string`, targetParentId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Copy a node to destination node
|
||||
- _nodeId:_ `string` - The id of the node to be copied
|
||||
- _targetParentId:_ `string` - The id of the folder where the node will be copied
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - NodeEntry for the copied node
|
||||
- **createFolder**(name: `string` = `null`, parentId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **createFolder**(name: `string`, parentId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
Creates a new folder in the path.
|
||||
- _name:_ `string` - Folder name
|
||||
- _parentId:_ `string` - Parent folder ID
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`>` - Details of the created folder node
|
||||
- **deleteNode**(nodeId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
- **deleteNode**(nodeId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Deletes a node.
|
||||
- _nodeId:_ `string` - ID of the node to delete
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Empty response when the operation is complete
|
||||
- **getDefaultMimeTypeIcon**(): `string`<br/>
|
||||
Gets a default icon for MIME types with no specific icon.
|
||||
- **Returns** `string` - Path to the icon file
|
||||
- **getDocumentThumbnailUrl**(node: [`MinimalNodeEntity`](../content-services/document-library.model.md) = `null`): `string`<br/>
|
||||
- **getDocumentThumbnailUrl**(node: [`MinimalNodeEntity`](../content-services/document-library.model.md)): `string`<br/>
|
||||
Get thumbnail URL for the given document node.
|
||||
- _node:_ [`MinimalNodeEntity`](../content-services/document-library.model.md) - Node to get URL for.
|
||||
- **Returns** `string` - Thumbnail URL string
|
||||
- **getFolder**(folder: `string` = `null`, opts?: `any` = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
- **getFolder**(folder: `string`, opts?: `any`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>`<br/>
|
||||
Gets the folder node with the specified relative name path below the root node.
|
||||
- _folder:_ `string` - Path to folder.
|
||||
- _opts:_ `any` - (Optional) Options.
|
||||
- _includeFields:_ `string[]` - Extra information to include (available options are "aspectNames", "isLink" and "association")
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` - Details of the folder
|
||||
- **getFolderNode**(nodeId: `string` = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` - Details of the folder
|
||||
- **getFolderNode**(nodeId: `string`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
(**Deprecated:** 2.3.0 Gets a folder node via its node ID.)
|
||||
- _nodeId:_ `string` - ID of the folder node
|
||||
- _includeFields:_ `string[]` - Extra information to include (available options are "aspectNames", "isLink" and "association")
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` - Details of the folder
|
||||
|
||||
- **getMimeTypeIcon**(mimeType: `string` = `null`): `string`<br/>
|
||||
- **getMimeTypeIcon**(mimeType: `string`): `string`<br/>
|
||||
Gets the icon that represents a MIME type.
|
||||
- _mimeType:_ `string` - MIME type to get the icon for
|
||||
- **Returns** `string` - Path to the icon file
|
||||
- **getNode**(nodeId: `string` = `null`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`>`<br/>
|
||||
- **getNode**(nodeId: `string`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`>`<br/>
|
||||
Gets a node via its node ID.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _includeFields:_ `string[]` - Extra information to include (available options are "aspectNames", "isLink" and "association")
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`>` - Details of the folder
|
||||
- **hasPermission**(node: `any` = `null`, permission: [`PermissionsEnum`](../../lib/core/models/permissions.enum.ts)` | string` = `null`): `boolean`<br/>
|
||||
|
||||
- **hasPermission**(node: `any`, permission: [`PermissionsEnum`](lib/core/models/permissions.enum.ts)`|string`): `boolean`<br/>
|
||||
(**Deprecated:** 2.3.0 use the one in the content service Checks if a node has the specified permission.)
|
||||
- _node:_ `any` - Target node
|
||||
- _permission:_ [`PermissionsEnum`](../../lib/core/models/permissions.enum.ts)` | string` - Permission level to query
|
||||
- _permission:_ [`PermissionsEnum`](lib/core/models/permissions.enum.ts)`|string` - Permission level to query
|
||||
- **Returns** `boolean` - True if the node has the permission, false otherwise
|
||||
|
||||
- **moveNode**(nodeId: `string` = `null`, targetParentId: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
- **moveNode**(nodeId: `string`, targetParentId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Moves a node to destination node.
|
||||
- _nodeId:_ `string` - The id of the node to be moved
|
||||
- _targetParentId:_ `string` - The id of the folder where the node will be moved
|
||||
|
@ -24,24 +24,24 @@ Indicates the current position within a navigation hierarchy using a dropdown me
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Active node, builds UI based on folderNode.path.elements collection. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| folderNode | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | null | Active node, builds UI based on folderNode.path.elements collection. |
|
||||
| maxItems | `number` | | Maximum number of nodes to display before wrapping them with a dropdown element. |
|
||||
| root | `string` | null | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. You can use an i18n resource key for the property value. |
|
||||
| rootId | `string` | null | (optional) The id of the root element. You can use this property to set a custom element the breadcrumb should start with. |
|
||||
| root | `string` | null | (optional) Name of the root element of the breadcrumb. You can use this property to rename "Company Home" to "Personal Files" for example. You can use an i18n resource key for the property value. |
|
||||
| rootId | `string` | null | (optional) The id of the root element. You can use this property to set a custom element the breadcrumb should start with. |
|
||||
| target | [`DocumentListComponent`](../content-services/document-list.component.md) | | (optional) [Document List component](../content-services/document-list.component.md) to operate with. The list will update when the breadcrumb is clicked. |
|
||||
| transform | `function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
| transform | `Function` | | Transformation to be performed on the chosen/folder node before building the breadcrumb UI. Can be useful when custom formatting is needed for the breadcrumb. You can change the path elements from the node that are used to build the breadcrumb using this function. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| navigate | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PathElementEntity`](../../lib/content-services/document-list/models/document-library.model.ts)`>` | Emitted when the user clicks on a breadcrumb. |
|
||||
| ---- | ---- | ----------- |
|
||||
| navigate | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the user clicks on a breadcrumb. |
|
||||
|
||||
## Details
|
||||
|
||||
Although this component inherits the `maxItems` property from the [Breadcrumb component,](../content-services/breadcrumb.component.md) the
|
||||
"crumbs" are _always_ shown on a menu. By contrast, the Breadcrumb component only falls back
|
||||
"crumbs" are _always_ shown on a menu. By contrast, the [Breadcrumb component](../content-services/breadcrumb.component.md) only falls back
|
||||
to a menu when its maximum number of nodes is exceeded.
|
||||
|
||||
## See also
|
||||
|
@ -38,16 +38,16 @@ Some sample CSS to show the drag and drop area:
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| file-draggable | `boolean` | true | Enables/disables drag-and-drop functionality. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| enabled | `boolean` | true | Enables/disables drag-and-drop functionality. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| filesDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<File[]>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
||||
| filesEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | (**Deprecated:** in 2.4.0: use `filesDropped` instead. 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. |
|
||||
| filesEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | (**Deprecated:** in 2.4.0: use `filesDropped` instead. Emitted when one or more files are dragged and dropped onto the draggable element.) |
|
||||
| folderEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a directory is dragged and dropped onto the draggable element. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -19,13 +19,13 @@ Shows a dialog listing all the files uploaded with the Upload Button or Drag Are
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| position | `string` | "right" | Dialog position. Can be 'left' or 'right'. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a file in the list has an error. |
|
||||
|
||||
## Details
|
||||
|
@ -12,18 +12,18 @@ Implements the folder menu actions for the [Document List component](../content-
|
||||
|
||||
### Methods
|
||||
|
||||
- **canExecuteAction**(obj: `any` = `null`): `boolean`<br/>
|
||||
- **canExecuteAction**(obj: `any`): `boolean`<br/>
|
||||
Checks if an action is available for a particular item.
|
||||
- _obj:_ `any` - Item to check
|
||||
- **Returns** `boolean` - True if the action is available, false otherwise
|
||||
- **getHandler**(key: `string` = `null`): [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts)<br/>
|
||||
- **getHandler**(key: `string`): `ContentActionHandler`<br/>
|
||||
Gets the handler function for an action.
|
||||
- _key:_ `string` - Identifier for the action
|
||||
- **Returns** [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) - The handler function
|
||||
- **setHandler**(key: `string` = `null`, handler: [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) = `null`): `boolean`<br/>
|
||||
- **Returns** `ContentActionHandler` - The handler function
|
||||
- **setHandler**(key: `string`, handler: `ContentActionHandler`): `boolean`<br/>
|
||||
Sets a new handler function for an action.
|
||||
- _key:_ `string` - Identifier for the action
|
||||
- _handler:_ [`ContentActionHandler`](../../lib/content-services/document-list/models/content-action.model.ts) - The new handler function
|
||||
- _handler:_ `ContentActionHandler` - The new handler function
|
||||
- **Returns** `boolean` - True if the key was a valid action identifier, false otherwise
|
||||
|
||||
## Details
|
||||
|
@ -30,15 +30,15 @@ Creates folders.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeType | `string` | "cm:folder" | Type of node to create. |
|
||||
| adf-create-folder | `string` | DEFAULT_FOLDER_PARENT_ID | Parent folder where the new folder will be located after creation. |
|
||||
| title | `string` | null | Title of folder creation dialog. |
|
||||
| parentNodeId | `string` | | Parent folder where the new folder will be located after creation. |
|
||||
| title | `string` | null | Title of folder creation dialog. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when the folder is created successfully. |
|
||||
|
||||
|
@ -30,14 +30,14 @@ Allows folders to be edited.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| adf-edit-folder | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | Folder node to edit. |
|
||||
| title | `string` | null | Title of folder edit dialog. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| folder | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | Folder node to edit. |
|
||||
| title | `string` | null | Title of folder edit dialog. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when the folder has been edited successfully. |
|
||||
|
||||
|
@ -29,7 +29,8 @@ Update the current node by adding/removing the inherited permissions.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| updated | [`EventEmitter<MinimalNodeEntryEntity>`](../content-services/document-library.model.md) | Emitted when the node is updated |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | |
|
||||
| updated | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` | Emitted when the node is updated |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -20,13 +20,13 @@ Allows a user to add "likes" to an item.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | Identifier of a node to apply likes to. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| changeVote | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the "vote" gets changed. |
|
||||
|
||||
## See also
|
||||
|
@ -28,5 +28,5 @@ Allows folders and/or files to be downloaded, with multiple nodes packed as a '.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| adfNodeDownload | [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` | | Nodes to download. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodes | [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` | | Nodes to download. |
|
||||
|
@ -21,8 +21,8 @@ Locks a node.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| adf-node-lock | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | Node to lock/unlock. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| node | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | Node to lock/unlock. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -14,12 +14,12 @@ Displays dialogs to let the user set node permissions.
|
||||
|
||||
- **close**()<br/>
|
||||
Closes the currently-open dialog.
|
||||
- **openAddPermissionDialog**(nodeId: `string` = `null`, title?: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
- **openAddPermissionDialog**(node: `Node`, title?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`[]>`<br/>
|
||||
Opens a dialog to add permissions to a node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _node:_ `Node` -
|
||||
- _title:_ `string` - (Optional) Dialog title
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntity`](../content-services/document-library.model.md)`[]>` - Node with updated permissions
|
||||
- **updateNodePermissionByDialog**(nodeId?: `string` = `null`, title?: `string` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **updateNodePermissionByDialog**(nodeId?: `string`, title?: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
Opens a dialog to update permissions for a node.
|
||||
- _nodeId:_ `string` - (Optional) ID of the target node
|
||||
- _title:_ `string` - (Optional) Dialog title
|
||||
|
@ -12,35 +12,35 @@ Manages role permissions for content nodes.
|
||||
|
||||
### Methods
|
||||
|
||||
- **getGroupMemeberByGroupName**(groupName: `string` = `null`, opts?: `any` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<GroupMemberPaging>`<br/>
|
||||
- **getGroupMemeberByGroupName**(groupName: `string`, opts?: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<GroupMemberPaging>`<br/>
|
||||
Gets all members related to a group name.
|
||||
- _groupName:_ `string` - Name of group to look for members
|
||||
- _opts:_ `any` - (Optional) Extra options supported by JSAPI
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<GroupMemberPaging>` - List of members
|
||||
- **getNodeRoles**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>`<br/>
|
||||
- **getNodeRoles**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md)): [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>`<br/>
|
||||
Gets a list of roles for the current node.
|
||||
- _node:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - The target node
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<string[]>` - Array of strings representing the roles
|
||||
- **removePermission**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`, permissionToRemove: `PermissionElement` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **removePermission**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md), permissionToRemove: `PermissionElement`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
|
||||
- _node:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) -
|
||||
- _permissionToRemove:_ `PermissionElement` -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` -
|
||||
|
||||
- **updateLocallySetPermissions**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`, nodes: [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` = `null`, nodeRole: `string[]` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **updateLocallySetPermissions**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md), nodes: [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]`, nodeRole: `string[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
|
||||
- _node:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) -
|
||||
- _nodes:_ [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` -
|
||||
- _nodeRole:_ `string[]` -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` -
|
||||
|
||||
- **updateNodePermissions**(nodeId: `string` = `null`, permissionList: [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **updateNodePermissions**(nodeId: `string`, permissionList: [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
|
||||
- _nodeId:_ `string` -
|
||||
- _permissionList:_ [`MinimalNodeEntity`](../content-services/document-library.model.md)`[]` -
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>` -
|
||||
|
||||
- **updatePermissionRole**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) = `null`, updatedPermissionRole: `PermissionElement` = `null`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
- **updatePermissionRole**(node: [`MinimalNodeEntryEntity`](../content-services/document-library.model.md), updatedPermissionRole: `PermissionElement`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`MinimalNodeEntryEntity`](../content-services/document-library.model.md)`>`<br/>
|
||||
Updates the permission for a node.
|
||||
- _node:_ [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) - Target node
|
||||
- _updatedPermissionRole:_ `PermissionElement` - Permission role to update or add
|
||||
|
@ -32,8 +32,8 @@ Creates and manages public shared links for files.
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| node | [`MinimalNodeEntity`](../content-services/document-library.model.md) | | Nodes to share. |
|
||||
| baseShareUrl | `string` | | baseShareUrl to add as prefix to the generated link |
|
||||
| node | [`MinimalNodeEntity`](../content-services/document-library.model.md) | | Node to share. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -33,13 +33,13 @@ or custom template can be added:
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | "" | ID of the node whose permissions you want to show. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | |
|
||||
| update | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<PermissionElement>` | Emitted when the permission is updated. |
|
||||
|
||||
|
@ -22,13 +22,13 @@ Allows a user to add ratings to an item.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | Identifier of the node to apply the rating to. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| changeVote | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the "vote" gets changed. |
|
||||
|
||||
## See also
|
||||
|
@ -12,17 +12,17 @@ Manages ratings for items in Content Services.
|
||||
|
||||
### Methods
|
||||
|
||||
- **deleteRating**(nodeId: `string` = `null`, ratingType: `any` = `null`): `any`<br/>
|
||||
- **deleteRating**(nodeId: `string`, ratingType: `any`): `any`<br/>
|
||||
Removes the current user's rating for a node.
|
||||
- _nodeId:_ `string` - Target node
|
||||
- _ratingType:_ `any` - Type of rating to remove (can be "likes" or "fiveStar")
|
||||
- **Returns** `any` - Null response indicating that the operation is complete
|
||||
- **getRating**(nodeId: `string` = `null`, ratingType: `any` = `null`): `any`<br/>
|
||||
- **getRating**(nodeId: `string`, ratingType: `any`): `any`<br/>
|
||||
Gets the current user's rating for a node.
|
||||
- _nodeId:_ `string` - Node to get the rating from
|
||||
- _ratingType:_ `any` - Type of rating (can be "likes" or "fiveStar")
|
||||
- **Returns** `any` - The rating value
|
||||
- **postRating**(nodeId: `string` = `null`, ratingType: `any` = `null`, vote: `any` = `null`): `any`<br/>
|
||||
- **postRating**(nodeId: `string`, ratingType: `any`, vote: `any`): `any`<br/>
|
||||
Adds the current user's rating for a node.
|
||||
- _nodeId:_ `string` - Target node for the rating
|
||||
- _ratingType:_ `any` - Type of rating (can be "likes" or "fiveStar")
|
||||
|
@ -25,9 +25,9 @@ Displays a input text which shows find-as-you-type suggestions.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| autocomplete | `boolean` | false | Toggles auto-completion of the search input field. |
|
||||
| customQueryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
|
||||
| customQueryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
|
||||
| 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). |
|
||||
@ -37,10 +37,10 @@ Displays a input text which shows find-as-you-type suggestions.
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| optionClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a file item from the list of "find-as-you-type" results is selected. |
|
||||
| searchChange | [`EventEmitter`](https://angular.io/api/core/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. |
|
||||
| submit | `EventEmitter<any>` | Emitted when the search is submitted pressing ENTER button. The search term is provided as value of the event. |
|
||||
| submit | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when the search is submitted pressing ENTER button. The search term is provided as value of the event. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -11,16 +11,13 @@ Represents a main container component for custom search and faceted search setti
|
||||
## Contents
|
||||
|
||||
- [Basic usage](#basic-usage)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Configuration](#configuration)
|
||||
- [Extra fields and filter queries](#extra-fields-and-filter-queries)
|
||||
- [Sorting](#sorting)
|
||||
- [Categories and widgets](#categories-and-widgets)
|
||||
- [Facet Fields](#facet-fields)
|
||||
- [Facet Queries](#facet-queries)
|
||||
|
||||
- [See also](#see-also)
|
||||
|
||||
## Basic usage
|
||||
@ -178,7 +175,7 @@ for further details.
|
||||
|
||||
### Categories and widgets
|
||||
|
||||
The Search Settings component and Query Builder require a `categories` section in the
|
||||
The Search [Settings component](demo-shell/src/app/components/settings/settings.component.ts) and Query Builder require a `categories` section in the
|
||||
configuration.
|
||||
|
||||
Categories are used to configure the UI widgets that let the user edit the search query
|
||||
|
@ -12,40 +12,41 @@ Stores information from all the custom search and faceted search widgets, compil
|
||||
|
||||
### Methods
|
||||
|
||||
- **addFilterQuery**(query: `string` = `null`)<br/>
|
||||
Adds a new filter query.
|
||||
- _query:_ `string` - Text of the query to add
|
||||
- **addFilterQuery**(query: `string`)<br/>
|
||||
|
||||
- _query:_ `string` -
|
||||
|
||||
- **buildQuery**(): `QueryBody`<br/>
|
||||
Builds a new query using the added elements.
|
||||
- **Returns** `QueryBody` - The resulting query
|
||||
|
||||
- **Returns** `QueryBody` -
|
||||
|
||||
- **execute**(): [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>`<br/>
|
||||
Executes the query.
|
||||
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>` - Notification of query completion
|
||||
|
||||
- **getFacetField**(label: `string` = `null`): [`FacetField`](../../lib/content-services/search/facet-field.interface.ts)<br/>
|
||||
Gets the details of a facet field.
|
||||
- _label:_ `string` - Identifying label of the facet field
|
||||
- **Returns** [`FacetField`](../../lib/content-services/search/facet-field.interface.ts) - Facet field details
|
||||
- **Returns** [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)`<void>` -
|
||||
|
||||
- **getFacetQuery**(label: `string` = `null`): [`FacetQuery`](../../lib/content-services/search/facet-query.interface.ts)<br/>
|
||||
Gets the details of a facet query
|
||||
- _label:_ `string` - Identifying label of the facet query
|
||||
- **Returns** [`FacetQuery`](../../lib/content-services/search/facet-query.interface.ts) - Details of the facet query
|
||||
- **getFacetField**(label: `string`): `FacetField`<br/>
|
||||
|
||||
- **getPrimarySorting**(): [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts)<br/>
|
||||
- _label:_ `string` -
|
||||
- **Returns** `FacetField` -
|
||||
|
||||
- **getFacetQuery**(label: `string`): `FacetQuery`<br/>
|
||||
|
||||
- _label:_ `string` -
|
||||
- **Returns** `FacetQuery` -
|
||||
|
||||
- **getPrimarySorting**(): `SearchSortingDefinition`<br/>
|
||||
Returns primary sorting definition.
|
||||
- **Returns** [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts) - Sorting definition
|
||||
- **getSortingOptions**(): [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts)`[]`<br/>
|
||||
- **Returns** `SearchSortingDefinition` -
|
||||
- **getSortingOptions**(): `SearchSortingDefinition[]`<br/>
|
||||
Returns all pre-configured sorting options that users can choose from.
|
||||
- **Returns** [`SearchSortingDefinition`](../../lib/content-services/search/search-sorting-definition.interface.ts)`[]` - List of available sorting options
|
||||
- **removeFilterQuery**(query: `string` = `null`)<br/>
|
||||
Removes a previously added filter query.
|
||||
- _query:_ `string` - The query to remove
|
||||
- **Returns** `SearchSortingDefinition[]` -
|
||||
- **removeFilterQuery**(query: `string`)<br/>
|
||||
|
||||
- _query:_ `string` -
|
||||
|
||||
- **resetToDefaults**()<br/>
|
||||
|
||||
- **update**()<br/>
|
||||
Builds the query and notifies subscribers when complete.
|
||||
|
||||
## Details
|
||||
|
||||
@ -81,5 +82,5 @@ constructor(queryBuilder: SearchQueryBuilderService) {
|
||||
|
||||
## See also
|
||||
|
||||
- [Search filter component](search-filter.component.md)
|
||||
- [Search Widget interface](search-widget.interface.md)
|
||||
- [Search filter component](search-filter.component.md)
|
||||
- [Search Widget interface](search-widget.interface.md)
|
||||
|
@ -11,16 +11,12 @@ Specifies required properties for [Search filter component](../content-services/
|
||||
## Contents
|
||||
|
||||
- [Basic usage](#basic-usage)
|
||||
|
||||
- [Properties](#properties)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Implementing a custom widget](#implementing-a-custom-widget)
|
||||
- [Reading external settings](#reading-external-settings)
|
||||
- [Updating the final query](#updating-the-final-query)
|
||||
- [Registering a custom widget](#registering-a-custom-widget)
|
||||
|
||||
- [See also](#see-also)
|
||||
|
||||
## Basic usage
|
||||
@ -39,14 +35,14 @@ export interface SearchWidget {
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| id | `string` | | Unique identifying value for the widget |
|
||||
| settings | [`SearchWidgetSettings`](../../lib/content-services/search/search-widget-settings.interface.ts) | | Settings for component properties |
|
||||
| context | [`SearchQueryBuilderService`](../content-services/search-query-builder.service.md) | | Instance of the Search Query Builder service to process the query |
|
||||
| context | [`SearchQueryBuilderService`](../content-services/search-query-builder.service.md) | | Instance of the [Search Query Builder service](../content-services/search-query-builder.service.md) to process the query |
|
||||
|
||||
## Details
|
||||
|
||||
The [Search Filter component](../content-services/search-filter.component.md) uses widgets to provide the UI that lets the user customize the
|
||||
search. ADF provides a number of widgets out of the box (see the [See Also](#see-also) section
|
||||
for a full list) but you can also implement your own. Both built-in and custom widgets must
|
||||
implement the Search Widget interface to operate with the Search Filter component.
|
||||
implement the Search Widget interface to operate with the [Search Filter component](../content-services/search-filter.component.md).
|
||||
|
||||
### Implementing a custom widget
|
||||
|
||||
|
@ -11,18 +11,13 @@ Searches items for supplied search terms.
|
||||
## Contents
|
||||
|
||||
- [Basic usage](#basic-usage)
|
||||
|
||||
- [Class members](#class-members)
|
||||
|
||||
- [Properties](#properties)
|
||||
- [Events](#events)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Customise Search Results](#customise-search-results)
|
||||
- [Attach an input field to the search](#attach-an-input-field-to-the-search)
|
||||
- [Custom search configuration](#custom-search-configuration)
|
||||
|
||||
- [See Also](#see-also)
|
||||
|
||||
## Basic usage
|
||||
@ -39,20 +34,19 @@ Searches items for supplied search terms.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| displayWith | `function \| null` | null | Function that maps an option's value to its display value in the trigger. |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| displayWith | `Function \| null` | 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. |
|
||||
| queryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
|
||||
| queryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
|
||||
| searchTerm | `string` | "" | Search term to use when executing the search. Updating this value will run a new search and update the results. |
|
||||
| skipResults | `number` | 0 | Number of results to skip from the results pagination. |
|
||||
| class | | | CSS class for display. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
|
||||
| resultLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodePaging`](../../lib/content-services/document-list/models/document-library.model.ts)`>` | Emitted when search results have fully loaded. |
|
||||
| resultLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`NodePaging`](lib/content-services/document-list/models/document-library.model.ts)`>` | Emitted when search results have fully loaded. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -22,16 +22,16 @@ 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 |
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| hideMyFiles | `boolean` | false | Hide the "My Files" option. |
|
||||
| placeholder | `string` | | Text or a translation key to act as a placeholder. Default value is the key "DROPDOWN.PLACEHOLDER_LABEL". |
|
||||
| relations | `string` | | Filter for the results of the sites query. Possible values are "members" and "containers". When "members" is used, the site list will be restricted to the sites that the user is a member of. |
|
||||
| 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 |
|
||||
| value | string | null | Id of the select site |
|
||||
| relations | string | 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. |
|
||||
| value | `string` | null | Id of the selected site |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Returned Type | Description |
|
||||
| ---- | ------------- | ----------- |
|
||||
| change | [SiteModel](../core/site.model.md) | Emitted when user selects a site. When default option is selected an empty model is emitted |
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| change | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`SiteEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SiteEntry.md)`>` | Emitted when the user selects a site. When the default option is selected, an empty model is emitted. |
|
||||
|
@ -22,13 +22,13 @@ Shows available actions for tags.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | The identifier of a node. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
|
||||
| result | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an action is chosen. |
|
||||
| successAdd | `EventEmitter<any>` | Emitted when a tag is added successfully. |
|
||||
| successAdd | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a tag is added successfully. |
|
||||
|
@ -14,7 +14,7 @@ Shows tags for an item.
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| result | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a tag is selected. |
|
||||
|
||||
## See Also
|
||||
|
@ -22,11 +22,11 @@ Shows tags for a node.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | The identifier of a node. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| results | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a tag is selected. |
|
||||
|
@ -12,7 +12,7 @@ Manages tags in Content Services.
|
||||
|
||||
### Methods
|
||||
|
||||
- **addTag**(nodeId: `string` = `null`, tagName: `string` = `null`): `any`<br/>
|
||||
- **addTag**(nodeId: `string`, tagName: `string`): `any`<br/>
|
||||
Adds a tag to a node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _tagName:_ `string` - Name of the tag to add
|
||||
@ -20,11 +20,11 @@ Manages tags in Content Services.
|
||||
- **getAllTheTags**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Gets a list of all the tags already defined in the repository.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - TagPaging object (defined in JSAPI) containing the tags
|
||||
- **getTagsByNodeId**(nodeId: `string` = `null`): `any`<br/>
|
||||
- **getTagsByNodeId**(nodeId: `string`): `any`<br/>
|
||||
Gets a list of tags added to a node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- **Returns** `any` - TagPaging object (defined in JSAPI) containing the tags
|
||||
- **removeTag**(nodeId: `string` = `null`, tag: `string` = `null`): `any`<br/>
|
||||
- **removeTag**(nodeId: `string`, tag: `string`): `any`<br/>
|
||||
Removes a tag from a node.
|
||||
- _nodeId:_ `string` - ID of the target node
|
||||
- _tag:_ `string` - Name of the tag to remove
|
||||
|
@ -27,7 +27,7 @@ Activates a file upload.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| acceptedFilesType | `string` | "\*" | Filter for accepted file types. |
|
||||
| comment | `string` | | When you overwrite existing content, you can use the comment field to add a version comment that appears in the version history |
|
||||
| disabled | `boolean` | false | Toggles component disabled state (if there is no node permission checking). |
|
||||
@ -37,19 +37,19 @@ Activates a file upload.
|
||||
| nodeType | `string` | "cm:content" | Custom node type for uploaded file |
|
||||
| rootFolderId | `string` | "-root-" | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. |
|
||||
| staticTitle | `string` | | Defines the text of the upload button. |
|
||||
| tooltip | `string` | null | Custom tooltip text. |
|
||||
| tooltip | `string` | null | Custom tooltip text. |
|
||||
| uploadFolders | `boolean` | false | Allows/disallows upload folders (only for Chrome). |
|
||||
| versioning | `boolean` | false | Toggles versioning. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../lib/content-services/upload/components/upload-files.event.ts)`>` | |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](lib/content-services/upload/components/upload-files.event.ts)`>` | |
|
||||
| createFolder | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a folder is created. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs. |
|
||||
| permissionEvent | `EventEmitter<PermissionModel>` | Emitted when create permission is missing. |
|
||||
| success | `EventEmitter<Object>` | Emitted when the file is uploaded successfully. |
|
||||
| permissionEvent | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PermissionModel`](lib/content-services/document-list/models/permissions.model.ts)`>` | Emitted when create permission is missing. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the file is uploaded successfully. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -34,7 +34,7 @@ export class AppComponent {
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| acceptedFilesType | `string` | "\*" | Filter for accepted file types. |
|
||||
| comment | `string` | | When you overwrite existing content, you can use the comment field to add a version comment that appears in the version history |
|
||||
| disabled | `boolean` | false | Toggles component disabled state (if there is no node permission checking). |
|
||||
@ -43,22 +43,21 @@ export class AppComponent {
|
||||
| nodeType | `string` | "cm:content" | Custom node type for uploaded file |
|
||||
| rootFolderId | `string` | "-root-" | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. |
|
||||
| versioning | `boolean` | false | Toggles versioning. |
|
||||
| parentId | | | **Deprecated:** 2.4.0 use rootFolderId ID of parent folder node. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../lib/content-services/upload/components/upload-files.event.ts)`>` | Raised after files or folders dropped and before the upload process starts. |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](lib/content-services/upload/components/upload-files.event.ts)`>` | Raised after files or folders dropped and before the upload process starts. |
|
||||
| createFolder | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a folder is created. |
|
||||
| error | `EventEmitter<Object>` | Emitted when an error occurs. |
|
||||
| success | `EventEmitter<Object>` | Emitted when the file is uploaded successfully. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the file is uploaded successfully. |
|
||||
|
||||
## Intercepting uploads
|
||||
|
||||
You can intercept the upload process by utilizing the `beginUpload` event.
|
||||
|
||||
The event has a type of [`UploadFilesEvent`](../../lib/content-services/upload/components/upload-files.event.ts) and provides the following APIs:
|
||||
The event has a type of [`UploadFilesEvent`](lib/content-services/upload/components/upload-files.event.ts) and provides the following APIs:
|
||||
|
||||
- **files**: get access to the [`FileInfo`](../../lib/core/utils/file-utils.ts) objects that are prepared for the upload
|
||||
- **pauseUpload**: pause the upload and perform additional tasks, like showing the confirmation dialog
|
||||
|
@ -29,7 +29,7 @@ to enrich the features and decrease the restrictions currently applied to node v
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| acceptedFilesType | `string` | "\*" | Filter for accepted file types. |
|
||||
| comment | `string` | | When you overwrite existing content, you can use the comment field to add a version comment that appears in the version history |
|
||||
| disabled | `boolean` | false | Toggles component disabled state (if there is no node permission checking). |
|
||||
@ -40,19 +40,19 @@ to enrich the features and decrease the restrictions currently applied to node v
|
||||
| nodeType | `string` | "cm:content" | Custom node type for uploaded file |
|
||||
| rootFolderId | `string` | "-root-" | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. |
|
||||
| staticTitle | `string` | | Defines the text of the upload button. |
|
||||
| tooltip | `string` | null | Custom tooltip text. |
|
||||
| tooltip | `string` | null | Custom tooltip text. |
|
||||
| uploadFolders | `boolean` | false | Allows/disallows upload folders (only for Chrome). |
|
||||
| versioning | `boolean` | false | Toggles versioning. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../lib/content-services/upload/components/upload-files.event.ts)`>` | |
|
||||
| ---- | ---- | ----------- |
|
||||
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](lib/content-services/upload/components/upload-files.event.ts)`>` | |
|
||||
| createFolder | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a folder is created. |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs. |
|
||||
| permissionEvent | `EventEmitter<PermissionModel>` | Emitted when create permission is missing. |
|
||||
| success | `EventEmitter<Object>` | Emitted when the file is uploaded successfully. |
|
||||
| permissionEvent | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`PermissionModel`](lib/content-services/document-list/models/permissions.model.ts)`>` | Emitted when create permission is missing. |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the file is uploaded successfully. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@ -19,9 +19,9 @@ Displays the version history of a node in a [Version Manager component](../conte
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| allowDownload | `boolean` | true | Enable/disable downloading a version of the current node. |
|
||||
| id | `string` | | (**Deprecated:** in 2.3.0) |
|
||||
| id | `string` | | (**Deprecated:** in 2.3.0) |
|
||||
| node | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | The target node. |
|
||||
| showActions | `boolean` | true | Toggles showing/hiding of version actions |
|
||||
| showComments | `boolean` | true | Toggles showing/hiding of comments |
|
||||
|
@ -27,7 +27,7 @@ Displays the version history of a node with the ability to upload a new version.
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| allowDownload | `boolean` | true | Enable/disable downloading a version of the current node. |
|
||||
| node | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | Target node to manage version history. |
|
||||
| showComments | `boolean` | true | Toggles showing/hiding of comments. |
|
||||
@ -35,7 +35,7 @@ Displays the version history of a node with the ability to upload a new version.
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when an error occurs during upload. |
|
||||
| uploadSuccess | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when a file is uploaded successfully. |
|
||||
|
||||
|
@ -10,14 +10,10 @@ Provides access to Webscript features.
|
||||
## Contents
|
||||
|
||||
- [Basic usage](#basic-usage)
|
||||
|
||||
- [Class members](#class-members)
|
||||
|
||||
- [Properties](#properties)
|
||||
- [Events](#events)
|
||||
|
||||
- [Details](#details)
|
||||
|
||||
- [Webscript View HTML example](#webscript-view-html-example)
|
||||
- [Webscript View DATATABLE example](#webscript-view-datatable-example)
|
||||
- [Webscript View JSON example](#webscript-view-json-example)
|
||||
@ -38,7 +34,7 @@ Provides access to Webscript features.
|
||||
|
||||
Another example:
|
||||
|
||||
**app.component.html**
|
||||
**[app.component](demo-shell/src/app/app.component.ts).html**
|
||||
|
||||
```html
|
||||
<adf-webscript-get
|
||||
@ -50,7 +46,7 @@ Another example:
|
||||
</adf-webscript-get>
|
||||
```
|
||||
|
||||
**app.component.ts**
|
||||
**[app.component](demo-shell/src/app/app.component.ts).ts**
|
||||
|
||||
```ts
|
||||
export class AppComponent {
|
||||
@ -65,7 +61,7 @@ export class AppComponent {
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| -- | -- | -- | -- |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| contentType | `string` | "TEXT" | Content type to interpret the data received from the webscript. Can be "JSON" , "HTML" , "DATATABLE" or "TEXT" |
|
||||
| contextRoot | `string` | "alfresco" | Path where the application is deployed |
|
||||
| scriptArgs | `any` | | Arguments to pass to the webscript. |
|
||||
@ -76,7 +72,7 @@ export class AppComponent {
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| ---- | ---- | ----------- |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<Object>` | Emitted when the operation succeeds. You can get the plain data from the webscript through the **success** event parameter and use it as you need in your application. |
|
||||
|
||||
## Details
|
||||
|
@ -5,7 +5,7 @@
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
"docbuild": "node ./tools/doc/docProcessor.js",
|
||||
"docbuild": "node node_modules/typedoc/bin/typedoc --tsconfig tsconfig.json --json docs/docs.json --exclude '**/*.spec.ts' --ignoreCompilerErrors && node tools/doc/buildYamlSourceInfo.js docs/docs.json && node ./tools/doc/docProcessor.js",
|
||||
"prepublishOnly": "npm run build-lib",
|
||||
"markdownlint": "markdownlint ./docs",
|
||||
"build-lib": "./scripts/ng-packagr.sh",
|
||||
@ -134,6 +134,7 @@
|
||||
"jasmine-reporters": "^2.3.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"jasmine2-protractor-utils": "1.1.3",
|
||||
"js-yaml": "^3.12.0",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-cli": "~1.0.1",
|
||||
|
340
tools/doc/SourceInfoClasses.js
Normal file
340
tools/doc/SourceInfoClasses.js
Normal file
@ -0,0 +1,340 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var undocMethodNames = {
|
||||
"ngOnChanges": 1
|
||||
};
|
||||
var PropInfo = /** @class */ (function () {
|
||||
/*
|
||||
constructor(rawProp: DeclarationReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawProp.name;
|
||||
this.docText = rawProp.comment ? rawProp.comment.shortText : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.defaultValue = rawProp.defaultValue || "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = rawProp.type ? rawProp.type.toString().replace(/\s/g, "") : "";
|
||||
this.type = this.type.replace(/\|/, "\\|");
|
||||
|
||||
this.isDeprecated = rawProp.comment && rawProp.comment.hasTag("deprecated");
|
||||
|
||||
if (this.isDeprecated) {
|
||||
this.docText = "(**Deprecated:** " + rawProp.comment.getTag("deprecated").text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
|
||||
if (rawProp.decorators) {
|
||||
rawProp.decorators.forEach(dec => {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
this.isInput = true;
|
||||
|
||||
if (dec.arguments) {
|
||||
let bindingName = dec.arguments["bindingPropertyName"];
|
||||
|
||||
if (bindingName && (bindingName !== ""))
|
||||
this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Input "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec.name === "Output") {
|
||||
this.isOutput = true;
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Output "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
*/
|
||||
function PropInfo(sourceData) {
|
||||
var _this = this;
|
||||
this.errorMessages = [];
|
||||
this.name = sourceData.name;
|
||||
this.docText = sourceData.summary || "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
var tempDefaultVal = sourceData.syntax["return"].defaultValue;
|
||||
this.defaultValue = tempDefaultVal ? tempDefaultVal.toString() : "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = sourceData.syntax["return"].type || "";
|
||||
this.type = this.type.toString().replace(/\|/, "\\|");
|
||||
if (sourceData.tags) {
|
||||
var depTag = sourceData.tags.find(function (tag) { return tag.name === "deprecated"; });
|
||||
if (depTag) {
|
||||
this.isDeprecated = true;
|
||||
this.docText = "(**Deprecated:** " + depTag.text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
}
|
||||
this.isInput = false;
|
||||
this.isOutput = false;
|
||||
if (sourceData.decorators) {
|
||||
sourceData.decorators.forEach(function (dec) {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
_this.isInput = true;
|
||||
if (dec.arguments) {
|
||||
var bindingName = dec.arguments["bindingPropertyName"];
|
||||
if (bindingName && (bindingName !== ""))
|
||||
_this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
if (!_this.docText && !_this.isDeprecated) {
|
||||
_this.errorMessages.push("Warning: Input \"" + sourceData.name + "\" has no doc text.");
|
||||
}
|
||||
}
|
||||
if (dec.name === "Output") {
|
||||
_this.isOutput = true;
|
||||
if (!_this.docText && !_this.isDeprecated) {
|
||||
_this.errorMessages.push("Warning: Output \"" + sourceData.name + "\" has no doc text.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Object.defineProperty(PropInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
return this.errorMessages;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return PropInfo;
|
||||
}());
|
||||
exports.PropInfo = PropInfo;
|
||||
;
|
||||
var ParamInfo = /** @class */ (function () {
|
||||
/*
|
||||
constructor(rawParam: ParameterReflection) {
|
||||
this.name = rawParam.name;
|
||||
this.type = rawParam.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = rawParam.defaultValue;
|
||||
this.docText = rawParam.comment ? rawParam.comment.text : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.isOptional = rawParam.flags.isOptional;
|
||||
|
||||
this.combined = this.name;
|
||||
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
|
||||
this.combined += `: \`${this.type}\``;
|
||||
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += ` = \`${this.defaultValue}\``;
|
||||
}
|
||||
*/
|
||||
function ParamInfo(sourceData) {
|
||||
this.name = sourceData.id;
|
||||
this.type = sourceData.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = sourceData.defaultValue;
|
||||
this.docText = sourceData.description.replace(/[\n\r]+/g, " ").trim();
|
||||
this.isOptional = false;
|
||||
if (sourceData.flags) {
|
||||
var flag = sourceData.flags.find(function (flag) { return flag.name === "isOptional"; });
|
||||
if (flag) {
|
||||
this.isOptional = true;
|
||||
}
|
||||
}
|
||||
this.combined = this.name;
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
this.combined += ": `" + this.type + "`";
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += " = `" + this.defaultValue + "`";
|
||||
}
|
||||
return ParamInfo;
|
||||
}());
|
||||
exports.ParamInfo = ParamInfo;
|
||||
var MethodSigInfo = /** @class */ (function () {
|
||||
/*
|
||||
constructor(rawSig: SignatureReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawSig.name;
|
||||
this.returnType = rawSig.type ? rawSig.type.toString().replace(/\s/g, "") : "";
|
||||
this.returnsSomething = this.returnType != "void";
|
||||
|
||||
if (rawSig.hasComment()) {
|
||||
this.docText = rawSig.comment.shortText + rawSig.comment.text;
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push(`Warning: method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.returnDocText = rawSig.comment.returns;
|
||||
this.returnDocText = this.returnDocText ? this.returnDocText.replace(/[\n\r]+/g, " ").trim() : "";
|
||||
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push(`Warning: Return value of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.isDeprecated = rawSig.comment.hasTag("deprecated");
|
||||
}
|
||||
|
||||
this.params = [];
|
||||
let paramStrings = [];
|
||||
|
||||
if (rawSig.parameters) {
|
||||
rawSig.parameters.forEach(rawParam => {
|
||||
if (!rawParam.comment || !rawParam.comment.text) {
|
||||
this.errorMessages.push(`Warning: parameter "${rawParam.name}" of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
let param = new ParamInfo(rawParam);
|
||||
this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
*/
|
||||
function MethodSigInfo(sourceData) {
|
||||
var _this = this;
|
||||
this.errorMessages = [];
|
||||
this.name = sourceData.name;
|
||||
this.docText = sourceData.summary || "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push("Warning: method \"" + sourceData.name + "\" has no doc text.");
|
||||
}
|
||||
this.returnType = sourceData.syntax["return"].type || "";
|
||||
this.returnType = this.returnType.toString().replace(/\s/g, "");
|
||||
this.returnsSomething = this.returnType && (this.returnType !== "void");
|
||||
this.returnDocText = sourceData.syntax["return"].summary || "";
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push("Warning: Return value of method \"" + sourceData.name + "\" has no doc text.");
|
||||
}
|
||||
this.isDeprecated = false;
|
||||
if (sourceData.tags) {
|
||||
var depTag = sourceData.tags.find(function (tag) { return tag.name === "deprecated"; });
|
||||
if (depTag) {
|
||||
this.isDeprecated = true;
|
||||
this.docText = "(**Deprecated:** " + depTag.text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
}
|
||||
this.params = [];
|
||||
var paramStrings = [];
|
||||
if (sourceData.syntax.parameters) {
|
||||
sourceData.syntax.parameters.forEach(function (rawParam) {
|
||||
if (!rawParam.description) {
|
||||
_this.errorMessages.push("Warning: parameter \"" + rawParam.name + "\" of method \"" + sourceData.name + "\" has no doc text.");
|
||||
}
|
||||
var param = new ParamInfo(rawParam);
|
||||
_this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
Object.defineProperty(MethodSigInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
return this.errorMessages;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return MethodSigInfo;
|
||||
}());
|
||||
exports.MethodSigInfo = MethodSigInfo;
|
||||
var ComponentInfo = /** @class */ (function () {
|
||||
/*
|
||||
constructor(classRef: DeclarationReflection) {
|
||||
let props = classRef.getChildrenByKind(ReflectionKind.Property);
|
||||
let accessors = classRef.getChildrenByKind(ReflectionKind.Accessor);
|
||||
|
||||
this.properties = [...props, ...accessors].map(item => {
|
||||
return new PropInfo(item);
|
||||
});
|
||||
|
||||
let methods = classRef.getChildrenByKind(ReflectionKind.Method);
|
||||
|
||||
this.methods = [];
|
||||
|
||||
methods.forEach(method =>{
|
||||
if (!(method.flags.isPrivate || method.flags.isProtected || undocMethodNames[method.name])) {
|
||||
method.signatures.forEach(sig => {
|
||||
this.methods.push(new MethodSigInfo(sig));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
|
||||
this.properties.forEach(prop => {
|
||||
if (prop.isInput)
|
||||
this.hasInputs = true;
|
||||
|
||||
if (prop.isOutput)
|
||||
this.hasOutputs = true;
|
||||
});
|
||||
|
||||
this.hasMethods = methods.length > 0;
|
||||
}
|
||||
*/
|
||||
function ComponentInfo(sourceData) {
|
||||
var _this = this;
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
this.hasMethods = false;
|
||||
this.sourcePath = sourceData.items[0].source.path;
|
||||
this.sourceLine = sourceData.items[0].source.line;
|
||||
this.properties = [];
|
||||
this.methods = [];
|
||||
sourceData.items.forEach(function (item) {
|
||||
switch (item.type) {
|
||||
case "property":
|
||||
var prop = new PropInfo(item);
|
||||
_this.properties.push(prop);
|
||||
if (prop.isInput) {
|
||||
_this.hasInputs = true;
|
||||
}
|
||||
if (prop.isOutput) {
|
||||
_this.hasOutputs = true;
|
||||
}
|
||||
break;
|
||||
case "method":
|
||||
if (item.flags && (item.flags.length > 0) &&
|
||||
!item.flags.find(function (flag) { return flag.name === "isPrivate"; }) &&
|
||||
!item.flags.find(function (flag) { return flag.name === "isProtected"; }) &&
|
||||
!undocMethodNames[item.name]) {
|
||||
_this.methods.push(new MethodSigInfo(item));
|
||||
_this.hasMethods = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
Object.defineProperty(ComponentInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
var combinedErrors = [];
|
||||
this.methods.forEach(function (method) {
|
||||
method.errors.forEach(function (err) {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
this.properties.forEach(function (prop) {
|
||||
prop.errors.forEach(function (err) {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
return combinedErrors;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return ComponentInfo;
|
||||
}());
|
||||
exports.ComponentInfo = ComponentInfo;
|
420
tools/doc/SourceInfoClasses.ts
Normal file
420
tools/doc/SourceInfoClasses.ts
Normal file
@ -0,0 +1,420 @@
|
||||
import {
|
||||
DeclarationReflection,
|
||||
SignatureReflection,
|
||||
ParameterReflection,
|
||||
ReflectionKind,
|
||||
} from "typedoc";
|
||||
import { find } from "shelljs";
|
||||
import { isUndefined } from "util";
|
||||
|
||||
|
||||
let undocMethodNames = {
|
||||
"ngOnChanges": 1
|
||||
};
|
||||
|
||||
|
||||
export class PropInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
typeLink: string;
|
||||
defaultValue: string;
|
||||
docText: string;
|
||||
isInput: boolean;
|
||||
isOutput: boolean;
|
||||
isDeprecated: boolean;
|
||||
|
||||
errorMessages: string[];
|
||||
|
||||
/*
|
||||
constructor(rawProp: DeclarationReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawProp.name;
|
||||
this.docText = rawProp.comment ? rawProp.comment.shortText : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.defaultValue = rawProp.defaultValue || "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = rawProp.type ? rawProp.type.toString().replace(/\s/g, "") : "";
|
||||
this.type = this.type.replace(/\|/, "\\|");
|
||||
|
||||
this.isDeprecated = rawProp.comment && rawProp.comment.hasTag("deprecated");
|
||||
|
||||
if (this.isDeprecated) {
|
||||
this.docText = "(**Deprecated:** " + rawProp.comment.getTag("deprecated").text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
|
||||
if (rawProp.decorators) {
|
||||
rawProp.decorators.forEach(dec => {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
this.isInput = true;
|
||||
|
||||
if (dec.arguments) {
|
||||
let bindingName = dec.arguments["bindingPropertyName"];
|
||||
|
||||
if (bindingName && (bindingName !== ""))
|
||||
this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Input "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec.name === "Output") {
|
||||
this.isOutput = true;
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Output "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
constructor(sourceData) {
|
||||
this.errorMessages = [];
|
||||
|
||||
this.name = sourceData.name;
|
||||
this.docText = sourceData.summary || "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
let tempDefaultVal = sourceData.syntax["return"].defaultValue;
|
||||
this.defaultValue = tempDefaultVal ? tempDefaultVal.toString() : "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = sourceData.syntax["return"].type || "";
|
||||
this.type = this.type.toString().replace(/\|/, "\\|");
|
||||
|
||||
if (sourceData.tags) {
|
||||
let depTag = sourceData.tags.find(tag => tag.name === "deprecated");
|
||||
|
||||
if (depTag) {
|
||||
this.isDeprecated = true;
|
||||
this.docText = "(**Deprecated:** " + depTag.text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
}
|
||||
|
||||
this.isInput = false;
|
||||
this.isOutput = false;
|
||||
|
||||
if (sourceData.decorators) {
|
||||
sourceData.decorators.forEach(dec => {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
this.isInput = true;
|
||||
|
||||
if (dec.arguments) {
|
||||
let bindingName = dec.arguments["bindingPropertyName"];
|
||||
|
||||
if (bindingName && (bindingName !== ""))
|
||||
this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Input "${sourceData.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec.name === "Output") {
|
||||
this.isOutput = true;
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Output "${sourceData.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
get errors() {
|
||||
return this.errorMessages;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export class ParamInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
defaultValue: string;
|
||||
docText: string;
|
||||
combined: string;
|
||||
isOptional: boolean;
|
||||
|
||||
/*
|
||||
constructor(rawParam: ParameterReflection) {
|
||||
this.name = rawParam.name;
|
||||
this.type = rawParam.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = rawParam.defaultValue;
|
||||
this.docText = rawParam.comment ? rawParam.comment.text : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.isOptional = rawParam.flags.isOptional;
|
||||
|
||||
this.combined = this.name;
|
||||
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
|
||||
this.combined += `: \`${this.type}\``;
|
||||
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += ` = \`${this.defaultValue}\``;
|
||||
}
|
||||
*/
|
||||
|
||||
constructor(sourceData) {
|
||||
this.name = sourceData.id;
|
||||
this.type = sourceData.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = sourceData.defaultValue;
|
||||
this.docText = sourceData.description.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
this.isOptional = false;
|
||||
|
||||
if (sourceData.flags) {
|
||||
let flag = sourceData.flags.find(flag => flag.name === "isOptional");
|
||||
|
||||
if (flag) {
|
||||
this.isOptional = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.combined = this.name;
|
||||
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
|
||||
this.combined += `: \`${this.type}\``;
|
||||
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += ` = \`${this.defaultValue}\``;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class MethodSigInfo {
|
||||
name: string;
|
||||
docText: string;
|
||||
returnType: string;
|
||||
returnDocText: string;
|
||||
returnsSomething: boolean;
|
||||
signature: string;
|
||||
params: ParamInfo[];
|
||||
isDeprecated: boolean;
|
||||
|
||||
errorMessages: string[];
|
||||
|
||||
|
||||
/*
|
||||
constructor(rawSig: SignatureReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawSig.name;
|
||||
this.returnType = rawSig.type ? rawSig.type.toString().replace(/\s/g, "") : "";
|
||||
this.returnsSomething = this.returnType != "void";
|
||||
|
||||
if (rawSig.hasComment()) {
|
||||
this.docText = rawSig.comment.shortText + rawSig.comment.text;
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push(`Warning: method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.returnDocText = rawSig.comment.returns;
|
||||
this.returnDocText = this.returnDocText ? this.returnDocText.replace(/[\n\r]+/g, " ").trim() : "";
|
||||
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push(`Warning: Return value of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.isDeprecated = rawSig.comment.hasTag("deprecated");
|
||||
}
|
||||
|
||||
this.params = [];
|
||||
let paramStrings = [];
|
||||
|
||||
if (rawSig.parameters) {
|
||||
rawSig.parameters.forEach(rawParam => {
|
||||
if (!rawParam.comment || !rawParam.comment.text) {
|
||||
this.errorMessages.push(`Warning: parameter "${rawParam.name}" of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
let param = new ParamInfo(rawParam);
|
||||
this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
*/
|
||||
|
||||
constructor(sourceData) {
|
||||
this.errorMessages = [];
|
||||
|
||||
this.name = sourceData.name;
|
||||
|
||||
this.docText = sourceData.summary || "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push(`Warning: method "${sourceData.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.returnType = sourceData.syntax["return"].type || "";
|
||||
this.returnType = this.returnType.toString().replace(/\s/g, "");
|
||||
this.returnsSomething = this.returnType && (this.returnType !== "void");
|
||||
this.returnDocText = sourceData.syntax["return"].summary || "";
|
||||
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push(`Warning: Return value of method "${sourceData.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.isDeprecated = false;
|
||||
|
||||
if (sourceData.tags) {
|
||||
let depTag = sourceData.tags.find(tag => tag.name === "deprecated");
|
||||
|
||||
if (depTag) {
|
||||
this.isDeprecated = true;
|
||||
this.docText = "(**Deprecated:** " + depTag.text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
}
|
||||
|
||||
this.params = [];
|
||||
let paramStrings = [];
|
||||
|
||||
if (sourceData.syntax.parameters) {
|
||||
sourceData.syntax.parameters.forEach(rawParam => {
|
||||
if (!rawParam.description) {
|
||||
this.errorMessages.push(`Warning: parameter "${rawParam.name}" of method "${sourceData.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
let param = new ParamInfo(rawParam);
|
||||
this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
|
||||
get errors() {
|
||||
return this.errorMessages;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class ComponentInfo {
|
||||
properties: PropInfo[];
|
||||
methods: MethodSigInfo[];
|
||||
hasInputs: boolean;
|
||||
hasOutputs: boolean;
|
||||
hasMethods: boolean;
|
||||
sourcePath: string;
|
||||
sourceLine: number;
|
||||
|
||||
/*
|
||||
constructor(classRef: DeclarationReflection) {
|
||||
let props = classRef.getChildrenByKind(ReflectionKind.Property);
|
||||
let accessors = classRef.getChildrenByKind(ReflectionKind.Accessor);
|
||||
|
||||
this.properties = [...props, ...accessors].map(item => {
|
||||
return new PropInfo(item);
|
||||
});
|
||||
|
||||
let methods = classRef.getChildrenByKind(ReflectionKind.Method);
|
||||
|
||||
this.methods = [];
|
||||
|
||||
methods.forEach(method =>{
|
||||
if (!(method.flags.isPrivate || method.flags.isProtected || undocMethodNames[method.name])) {
|
||||
method.signatures.forEach(sig => {
|
||||
this.methods.push(new MethodSigInfo(sig));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
|
||||
this.properties.forEach(prop => {
|
||||
if (prop.isInput)
|
||||
this.hasInputs = true;
|
||||
|
||||
if (prop.isOutput)
|
||||
this.hasOutputs = true;
|
||||
});
|
||||
|
||||
this.hasMethods = methods.length > 0;
|
||||
}
|
||||
*/
|
||||
|
||||
constructor(sourceData) {
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
this.hasMethods = false;
|
||||
|
||||
this.sourcePath = sourceData.items[0].source.path;
|
||||
this.sourceLine = sourceData.items[0].source.line;
|
||||
|
||||
this.properties = [];
|
||||
this.methods = [];
|
||||
|
||||
sourceData.items.forEach(item => {
|
||||
switch(item.type) {
|
||||
case "property":
|
||||
var prop = new PropInfo(item);
|
||||
this.properties.push(prop);
|
||||
|
||||
if (prop.isInput) {
|
||||
this.hasInputs = true;
|
||||
}
|
||||
|
||||
if (prop.isOutput) {
|
||||
this.hasOutputs = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case "method":
|
||||
if (item.flags && (item.flags.length > 0) &&
|
||||
!item.flags.find(flag => flag.name === "isPrivate") &&
|
||||
!item.flags.find(flag => flag.name === "isProtected") &&
|
||||
!undocMethodNames[item.name]
|
||||
) {
|
||||
this.methods.push(new MethodSigInfo(item));
|
||||
this.hasMethods = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
get errors() {
|
||||
let combinedErrors = [];
|
||||
|
||||
this.methods.forEach(method => {
|
||||
method.errors.forEach(err => {
|
||||
combinedErrors.push(err);
|
||||
})
|
||||
});
|
||||
|
||||
this.properties.forEach(prop => {
|
||||
prop.errors.forEach(err => {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
|
||||
return combinedErrors;
|
||||
}
|
||||
}
|
54
tools/doc/buildYamlSourceInfo.js
Normal file
54
tools/doc/buildYamlSourceInfo.js
Normal file
@ -0,0 +1,54 @@
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var ejs = require("ejs");
|
||||
|
||||
|
||||
var templateFolder = path.resolve("tools", "doc", "yamlTemplates");
|
||||
var outputFolder = path.resolve("docs", "sourceinfo");
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
console.log("Error: Source filename required");
|
||||
process.exit();
|
||||
}
|
||||
|
||||
console.log(`Processing ${process.argv[2]}`);
|
||||
|
||||
if (!fs.existsSync(outputFolder)) {
|
||||
fs.mkdirSync(outputFolder);
|
||||
}
|
||||
|
||||
var docData = JSON.parse(fs.readFileSync(path.resolve(process.argv[2]), "utf8"));
|
||||
var tempFilename = path.resolve(templateFolder, "template.ejs");
|
||||
var tempSource = fs.readFileSync(tempFilename, "utf8");
|
||||
var template = ejs.compile(
|
||||
tempSource,
|
||||
{
|
||||
filename: tempFilename,
|
||||
cache: true
|
||||
}
|
||||
);
|
||||
|
||||
searchItemsRecursively(docData);
|
||||
|
||||
|
||||
function searchItemsRecursively(item) {
|
||||
if (interestedIn(item.kind)) {
|
||||
processItem(item);
|
||||
} else if (item.children) {
|
||||
item.children.forEach(child => {
|
||||
searchItemsRecursively(child);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function interestedIn(itemKind) {
|
||||
return itemKind === 128;
|
||||
}
|
||||
|
||||
|
||||
function processItem(item) {
|
||||
//console.log(`Generating ${item.name}`);
|
||||
var docText = template(item);
|
||||
fs.writeFileSync(path.resolve(outputFolder, item.name + ".yml"), docText);
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
var program = require("commander");
|
||||
var lodash = require("lodash");
|
||||
var jsyaml = require("js-yaml");
|
||||
|
||||
var remark = require("remark");
|
||||
var parse = require("remark-parse");
|
||||
@ -9,6 +11,10 @@ var stringify = require("remark-stringify");
|
||||
var frontMatter = require("remark-frontmatter");
|
||||
var mdCompact = require("mdast-util-compact");
|
||||
|
||||
var tdoc = require("typedoc");
|
||||
|
||||
var ngHelpers = require("./ngHelpers");
|
||||
var si = require("./SourceInfoClasses");
|
||||
|
||||
// "Aggregate" data collected over the whole file set.
|
||||
var aggData = {};
|
||||
@ -16,30 +22,15 @@ var aggData = {};
|
||||
var toolsFolderName = "tools";
|
||||
var configFileName = "doctool.config.json";
|
||||
var defaultFolder = path.resolve("docs");
|
||||
var sourceInfoFolder = path.resolve("docs", "sourceinfo");
|
||||
|
||||
var libFolders = ["core", "content-services", "process-services", "insights"];
|
||||
|
||||
/*
|
||||
function initPhase(aggData) {
|
||||
toolList.forEach(toolName => {
|
||||
toolModules[toolName].initPhase(aggData);
|
||||
});
|
||||
}
|
||||
var excludePatterns = [
|
||||
"**/*.spec.ts"
|
||||
];
|
||||
|
||||
|
||||
function readPhase(mdCache, aggData) {
|
||||
toolList.forEach(toolName => {
|
||||
toolModules[toolName].readPhase(mdCache, aggData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function aggPhase(aggData) {
|
||||
toolList.forEach(toolName => {
|
||||
toolModules[toolName].aggPhase(aggData);
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
function updatePhase(mdCache, aggData) {
|
||||
var errorMessages;
|
||||
|
||||
@ -149,6 +140,82 @@ function initMdCache(filenames) {
|
||||
}
|
||||
|
||||
|
||||
function getSourceInfo(infoFolder) {
|
||||
var sourceInfo = {};
|
||||
|
||||
var yamlFiles = fs.readdirSync(infoFolder);
|
||||
|
||||
yamlFiles.forEach(file => {
|
||||
var yamlText = fs.readFileSync(path.resolve(infoFolder, file), "utf8");
|
||||
var yaml = jsyaml.safeLoad(yamlText);
|
||||
sou
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function initSourceInfo(aggData, mdCache) {
|
||||
|
||||
var app = new tdoc.Application({
|
||||
exclude: excludePatterns,
|
||||
ignoreCompilerErrors: true,
|
||||
experimentalDecorators: true,
|
||||
tsconfig: "tsconfig.json"
|
||||
});
|
||||
|
||||
let sources = app.expandInputFiles(libFolders.map(folder => {
|
||||
return path.resolve("lib", folder);
|
||||
}));
|
||||
|
||||
aggData.projData = app.convert(sources);
|
||||
|
||||
|
||||
aggData.classInfo = {};
|
||||
|
||||
var mdFiles = Object.keys(mdCache);
|
||||
|
||||
mdFiles.forEach(mdFile => {
|
||||
/*
|
||||
var className = ngHelpers.ngNameToClassName(path.basename(mdFile, ".md"), aggData.config.typeNameExceptions);
|
||||
var classRef = aggData.projData.findReflectionByName(className);
|
||||
*/
|
||||
|
||||
var className = ngHelpers.ngNameToClassName(path.basename(mdFile, ".md"), aggData.config.typeNameExceptions);
|
||||
var yamlText = fs.readFileSync(path.resolve(sourceInfoFolder, className + ".yml"), "utf8");
|
||||
var yaml = jsyaml.safeLoad(yamlText);
|
||||
|
||||
if (yaml) {
|
||||
aggData.classInfo[className] = new si.ComponentInfo(yaml);
|
||||
}
|
||||
/*
|
||||
if (classRef) {
|
||||
aggData.classInfo[className] = new si.ComponentInfo(classRef);
|
||||
}
|
||||
*/
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function initClassInfo(aggData) {
|
||||
var yamlFilenames = fs.readdirSync(path.resolve(sourceInfoFolder));
|
||||
|
||||
aggData.classInfo = {};
|
||||
|
||||
yamlFilenames.forEach(yamlFilename => {
|
||||
var classYamlText = fs.readFileSync(path.resolve(sourceInfoFolder, yamlFilename), "utf8");
|
||||
var classYaml = jsyaml.safeLoad(classYamlText);
|
||||
|
||||
if (program.verbose) {
|
||||
console.log(classYaml.items[0].name);
|
||||
}
|
||||
|
||||
aggData.classInfo[classYaml.items[0].name] = new si.ComponentInfo(classYaml);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
program
|
||||
.usage("[options] <source>")
|
||||
.option("-p, --profile [profileName]", "Select named config profile", "default")
|
||||
@ -206,6 +273,11 @@ files = files.filter(filename =>
|
||||
|
||||
var mdCache = initMdCache(files);
|
||||
|
||||
console.log("Loading source data...");
|
||||
//initSourceInfo(aggData, mdCache);
|
||||
|
||||
initClassInfo(aggData);
|
||||
|
||||
/*
|
||||
console.log("Initialising...");
|
||||
initPhase(aggData);
|
||||
|
@ -51,7 +51,10 @@
|
||||
"text-mask.component": "InputMaskDirective",
|
||||
"card-item-types.service": "CardItemTypeService",
|
||||
"create-task-attachment.component": "AttachmentComponent",
|
||||
"process-list.component": "ProcessInstanceListComponent"
|
||||
"process-list.component": "ProcessInstanceListComponent",
|
||||
"inherited-button.directive": "InheritPermissionDirective",
|
||||
"node-share.directive": "NodeSharedDirective",
|
||||
"sites-dropdown.component": "DropdownSitesComponent"
|
||||
},
|
||||
"undocStoplist": [
|
||||
"model",
|
||||
|
@ -1,5 +1,6 @@
|
||||
module.exports = {
|
||||
"ngNameToDisplayName": ngNameToDisplayName,
|
||||
"ngNameToClassName": ngNameToClassName,
|
||||
"dekebabifyName": dekebabifyName,
|
||||
"kebabifyClassName": kebabifyClassName,
|
||||
"classTypes": ["component", "directive", "model", "pipe", "service", "widget"]
|
||||
@ -13,6 +14,37 @@ function ngNameToDisplayName(ngName) {
|
||||
}
|
||||
|
||||
|
||||
function initialCap(str) {
|
||||
return str[0].toUpperCase() + str.substr(1);
|
||||
}
|
||||
|
||||
|
||||
function ngNameToClassName(rawName, nameExceptions) {
|
||||
if (nameExceptions[rawName])
|
||||
return nameExceptions[rawName];
|
||||
|
||||
var name = rawName.replace(/\]|\(|\)/g, '');
|
||||
|
||||
var fileNameSections = name.split('.');
|
||||
var compNameSections = fileNameSections[0].split('-');
|
||||
|
||||
var outCompName = '';
|
||||
|
||||
for (var i = 0; i < compNameSections.length; i++) {
|
||||
outCompName = outCompName + initialCap(compNameSections[i]);
|
||||
}
|
||||
|
||||
var itemTypeIndicator = '';
|
||||
|
||||
if (fileNameSections.length > 1) {
|
||||
itemTypeIndicator = initialCap(fileNameSections[1]);
|
||||
}
|
||||
|
||||
var finalName = outCompName + itemTypeIndicator;
|
||||
|
||||
return finalName;
|
||||
}
|
||||
|
||||
function displayNameToNgName(name) {
|
||||
var noSpaceName = ngName.replace(/ ([a-zA-Z])/, "$1".toUpperCase());
|
||||
return noSpaceName.substr(0, 1).toUpperCase() + noSpaceName.substr(1);
|
||||
|
@ -9,17 +9,16 @@ var remark = require("remark");
|
||||
var ejs = require("ejs");
|
||||
var typedoc_1 = require("typedoc");
|
||||
var mdNav_1 = require("../mdNav");
|
||||
var ngHelpers_1 = require("../ngHelpers");
|
||||
var libFolders = ["core", "content-services", "process-services", "insights"];
|
||||
var templateFolder = path.resolve("tools", "doc", "templates");
|
||||
var excludePatterns = [
|
||||
"**/*.spec.ts"
|
||||
];
|
||||
var nameExceptions;
|
||||
var undocMethodNames = {
|
||||
"ngOnChanges": 1
|
||||
};
|
||||
function processDocs(mdCache, aggData, _errorMessages) {
|
||||
initPhase(aggData);
|
||||
//initPhase(aggData);
|
||||
nameExceptions = aggData.config.typeNameExceptions;
|
||||
var pathnames = Object.keys(mdCache);
|
||||
var internalErrors;
|
||||
pathnames.forEach(function (pathname) {
|
||||
@ -38,164 +37,6 @@ function showErrors(filename, errorMessages) {
|
||||
});
|
||||
console.log("");
|
||||
}
|
||||
var PropInfo = /** @class */ (function () {
|
||||
function PropInfo(rawProp) {
|
||||
var _this = this;
|
||||
this.errorMessages = [];
|
||||
this.name = rawProp.name;
|
||||
this.docText = rawProp.comment ? rawProp.comment.shortText : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.defaultValue = rawProp.defaultValue || "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = rawProp.type ? rawProp.type.toString().replace(/\s/g, "") : "";
|
||||
this.type = this.type.replace(/\|/, "\\|");
|
||||
this.isDeprecated = rawProp.comment && rawProp.comment.hasTag("deprecated");
|
||||
if (this.isDeprecated) {
|
||||
this.docText = "(**Deprecated:** " + rawProp.comment.getTag("deprecated").text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
if (rawProp.decorators) {
|
||||
rawProp.decorators.forEach(function (dec) {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
_this.isInput = true;
|
||||
if (dec.arguments) {
|
||||
var bindingName = dec.arguments["bindingPropertyName"];
|
||||
if (bindingName && (bindingName !== ""))
|
||||
_this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
if (!_this.docText && !_this.isDeprecated) {
|
||||
_this.errorMessages.push("Warning: Input \"" + rawProp.name + "\" has no doc text.");
|
||||
}
|
||||
}
|
||||
if (dec.name === "Output") {
|
||||
_this.isOutput = true;
|
||||
if (!_this.docText && !_this.isDeprecated) {
|
||||
_this.errorMessages.push("Warning: Output \"" + rawProp.name + "\" has no doc text.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Object.defineProperty(PropInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
return this.errorMessages;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return PropInfo;
|
||||
}());
|
||||
;
|
||||
var ParamInfo = /** @class */ (function () {
|
||||
function ParamInfo(rawParam) {
|
||||
this.name = rawParam.name;
|
||||
this.type = rawParam.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = rawParam.defaultValue;
|
||||
this.docText = rawParam.comment ? rawParam.comment.text : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.isOptional = rawParam.flags.isOptional;
|
||||
this.combined = this.name;
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
this.combined += ": `" + this.type + "`";
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += " = `" + this.defaultValue + "`";
|
||||
}
|
||||
return ParamInfo;
|
||||
}());
|
||||
var MethodSigInfo = /** @class */ (function () {
|
||||
function MethodSigInfo(rawSig) {
|
||||
var _this = this;
|
||||
this.errorMessages = [];
|
||||
this.name = rawSig.name;
|
||||
this.returnType = rawSig.type ? rawSig.type.toString().replace(/\s/g, "") : "";
|
||||
this.returnsSomething = this.returnType != "void";
|
||||
if (rawSig.hasComment()) {
|
||||
this.docText = rawSig.comment.shortText + rawSig.comment.text;
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push("Warning: method \"" + rawSig.name + "\" has no doc text.");
|
||||
}
|
||||
this.returnDocText = rawSig.comment.returns;
|
||||
this.returnDocText = this.returnDocText ? this.returnDocText.replace(/[\n\r]+/g, " ").trim() : "";
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push("Warning: Return value of method \"" + rawSig.name + "\" has no doc text.");
|
||||
}
|
||||
this.isDeprecated = rawSig.comment.hasTag("deprecated");
|
||||
}
|
||||
this.params = [];
|
||||
var paramStrings = [];
|
||||
if (rawSig.parameters) {
|
||||
rawSig.parameters.forEach(function (rawParam) {
|
||||
if (!rawParam.comment || !rawParam.comment.text) {
|
||||
_this.errorMessages.push("Warning: parameter \"" + rawParam.name + "\" of method \"" + rawSig.name + "\" has no doc text.");
|
||||
}
|
||||
var param = new ParamInfo(rawParam);
|
||||
_this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
Object.defineProperty(MethodSigInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
return this.errorMessages;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return MethodSigInfo;
|
||||
}());
|
||||
var ComponentInfo = /** @class */ (function () {
|
||||
function ComponentInfo(classRef) {
|
||||
var _this = this;
|
||||
var props = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Property);
|
||||
var accessors = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Accessor);
|
||||
this.properties = props.concat(accessors).map(function (item) {
|
||||
return new PropInfo(item);
|
||||
});
|
||||
var methods = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Method);
|
||||
this.methods = [];
|
||||
methods.forEach(function (method) {
|
||||
if (!(method.flags.isPrivate || method.flags.isProtected || undocMethodNames[method.name])) {
|
||||
method.signatures.forEach(function (sig) {
|
||||
_this.methods.push(new MethodSigInfo(sig));
|
||||
});
|
||||
}
|
||||
});
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
this.properties.forEach(function (prop) {
|
||||
if (prop.isInput)
|
||||
_this.hasInputs = true;
|
||||
if (prop.isOutput)
|
||||
_this.hasOutputs = true;
|
||||
});
|
||||
this.hasMethods = methods.length > 0;
|
||||
}
|
||||
Object.defineProperty(ComponentInfo.prototype, "errors", {
|
||||
get: function () {
|
||||
var combinedErrors = [];
|
||||
this.methods.forEach(function (method) {
|
||||
method.errors.forEach(function (err) {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
this.properties.forEach(function (prop) {
|
||||
prop.errors.forEach(function (err) {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
return combinedErrors;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return ComponentInfo;
|
||||
}());
|
||||
function initPhase(aggData) {
|
||||
nameExceptions = aggData.config.typeNameExceptions;
|
||||
var app = new typedoc_1.Application({
|
||||
@ -210,15 +51,21 @@ function initPhase(aggData) {
|
||||
aggData.projData = app.convert(sources);
|
||||
}
|
||||
function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
var compName = angNameToClassName(path.basename(pathname, ".md"));
|
||||
var classRef = aggData.projData.findReflectionByName(compName);
|
||||
/*
|
||||
let compName = angNameToClassName(path.basename(pathname, ".md"));
|
||||
let classRef = aggData.projData.findReflectionByName(compName);
|
||||
|
||||
if (!classRef) {
|
||||
// A doc file with no corresponding class (eg, Document Library Model).
|
||||
return false;
|
||||
}
|
||||
var compData = new ComponentInfo(classRef);
|
||||
var classTypeMatch = compName.match(/component|directive|service/i);
|
||||
if (classTypeMatch) {
|
||||
|
||||
let compData = new ComponentInfo(classRef);
|
||||
*/
|
||||
var className = ngHelpers_1.ngNameToClassName(path.basename(pathname, ".md"), nameExceptions);
|
||||
var classTypeMatch = className.match(/component|directive|service/i);
|
||||
var compData = aggData.classInfo[className];
|
||||
if (classTypeMatch && compData) {
|
||||
var classType = classTypeMatch[0].toLowerCase();
|
||||
// Copy docs back from the .md file when the JSDocs are empty.
|
||||
var inputMD = getPropDocsFromMD(tree, "Properties", 3);
|
||||
@ -245,26 +92,38 @@ function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function initialCap(str) {
|
||||
/*
|
||||
function initialCap(str: string) {
|
||||
return str[0].toUpperCase() + str.substr(1);
|
||||
}
|
||||
function angNameToClassName(rawName) {
|
||||
|
||||
|
||||
function angNameToClassName(rawName: string) {
|
||||
if (nameExceptions[rawName])
|
||||
return nameExceptions[rawName];
|
||||
|
||||
var name = rawName.replace(/\]|\(|\)/g, '');
|
||||
|
||||
var fileNameSections = name.split('.');
|
||||
var compNameSections = fileNameSections[0].split('-');
|
||||
|
||||
var outCompName = '';
|
||||
|
||||
for (var i = 0; i < compNameSections.length; i++) {
|
||||
outCompName = outCompName + initialCap(compNameSections[i]);
|
||||
}
|
||||
|
||||
var itemTypeIndicator = '';
|
||||
|
||||
if (fileNameSections.length > 1) {
|
||||
itemTypeIndicator = initialCap(fileNameSections[1]);
|
||||
}
|
||||
|
||||
var finalName = outCompName + itemTypeIndicator;
|
||||
|
||||
return finalName;
|
||||
}
|
||||
*/
|
||||
function getPropDocsFromMD(tree, sectionHeading, docsColumn) {
|
||||
var result = {};
|
||||
var nav = new mdNav_1.MDNav(tree);
|
||||
@ -358,7 +217,7 @@ function getMDMethodParams(methItem) {
|
||||
}
|
||||
var paramDoc = paramListItem.childNav
|
||||
.paragraph().childNav
|
||||
.text(function (t) { return true; }, 1).item.value;
|
||||
.text(function (t) { return true; }, 1).value; //item.value;
|
||||
result[paramName] = paramDoc.replace(/^[ -]+/, "");
|
||||
});
|
||||
return result;
|
||||
|
@ -10,19 +10,14 @@ import * as ejs from "ejs";
|
||||
|
||||
import {
|
||||
Application,
|
||||
ProjectReflection,
|
||||
Reflection,
|
||||
DeclarationReflection,
|
||||
SignatureReflection,
|
||||
ParameterReflection,
|
||||
ReflectionKind,
|
||||
TraverseProperty,
|
||||
Decorator
|
||||
} from "typedoc";
|
||||
import { CommentTag } from "typedoc/dist/lib/models";
|
||||
|
||||
import { MDNav } from "../mdNav";
|
||||
import * as unist from "../unistHelpers";
|
||||
import { ngNameToClassName } from "../ngHelpers";
|
||||
|
||||
import {
|
||||
ComponentInfo
|
||||
} from "../SourceInfoClasses"
|
||||
|
||||
|
||||
let libFolders = ["core", "content-services", "process-services", "insights"];
|
||||
@ -35,13 +30,11 @@ let excludePatterns = [
|
||||
|
||||
let nameExceptions;
|
||||
|
||||
let undocMethodNames = {
|
||||
"ngOnChanges": 1
|
||||
};
|
||||
|
||||
|
||||
export function processDocs(mdCache, aggData, _errorMessages) {
|
||||
initPhase(aggData);
|
||||
//initPhase(aggData);
|
||||
|
||||
nameExceptions = aggData.config.typeNameExceptions;
|
||||
|
||||
let pathnames = Object.keys(mdCache);
|
||||
let internalErrors;
|
||||
@ -67,222 +60,6 @@ function showErrors(filename, errorMessages) {
|
||||
console.log("");
|
||||
}
|
||||
|
||||
class PropInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
typeLink: string;
|
||||
defaultValue: string;
|
||||
docText: string;
|
||||
isInput: boolean;
|
||||
isOutput: boolean;
|
||||
isDeprecated: boolean;
|
||||
|
||||
errorMessages: string[];
|
||||
|
||||
constructor(rawProp: DeclarationReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawProp.name;
|
||||
this.docText = rawProp.comment ? rawProp.comment.shortText : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.defaultValue = rawProp.defaultValue || "";
|
||||
this.defaultValue = this.defaultValue.replace(/\|/, "\\|");
|
||||
this.type = rawProp.type ? rawProp.type.toString().replace(/\s/g, "") : "";
|
||||
this.type = this.type.replace(/\|/, "\\|");
|
||||
|
||||
this.isDeprecated = rawProp.comment && rawProp.comment.hasTag("deprecated");
|
||||
|
||||
if (this.isDeprecated) {
|
||||
this.docText = "(**Deprecated:** " + rawProp.comment.getTag("deprecated").text.replace(/[\n\r]+/g, " ").trim() + ") " + this.docText;
|
||||
}
|
||||
|
||||
if (rawProp.decorators) {
|
||||
rawProp.decorators.forEach(dec => {
|
||||
//console.log(dec);
|
||||
if (dec.name === "Input") {
|
||||
this.isInput = true;
|
||||
|
||||
if (dec.arguments) {
|
||||
let bindingName = dec.arguments["bindingPropertyName"];
|
||||
|
||||
if (bindingName && (bindingName !== ""))
|
||||
this.name = bindingName.replace(/['"]/g, "");
|
||||
}
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Input "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
|
||||
if (dec.name === "Output") {
|
||||
this.isOutput = true;
|
||||
|
||||
if (!this.docText && !this.isDeprecated) {
|
||||
this.errorMessages.push(`Warning: Output "${rawProp.name}" has no doc text.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
get errors() {
|
||||
return this.errorMessages;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class ParamInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
defaultValue: string;
|
||||
docText: string;
|
||||
combined: string;
|
||||
isOptional: boolean;
|
||||
|
||||
constructor(rawParam: ParameterReflection) {
|
||||
this.name = rawParam.name;
|
||||
this.type = rawParam.type.toString().replace(/\s/g, "");
|
||||
this.defaultValue = rawParam.defaultValue;
|
||||
this.docText = rawParam.comment ? rawParam.comment.text : "";
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
this.isOptional = rawParam.flags.isOptional;
|
||||
|
||||
this.combined = this.name;
|
||||
|
||||
if (this.isOptional)
|
||||
this.combined += "?";
|
||||
|
||||
this.combined += `: \`${this.type}\``;
|
||||
|
||||
if (this.defaultValue !== "")
|
||||
this.combined += ` = \`${this.defaultValue}\``;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MethodSigInfo {
|
||||
name: string;
|
||||
docText: string;
|
||||
returnType: string;
|
||||
returnDocText: string;
|
||||
returnsSomething: boolean;
|
||||
signature: string;
|
||||
params: ParamInfo[];
|
||||
isDeprecated: boolean;
|
||||
|
||||
errorMessages: string[];
|
||||
|
||||
|
||||
constructor(rawSig: SignatureReflection) {
|
||||
this.errorMessages = [];
|
||||
this.name = rawSig.name;
|
||||
this.returnType = rawSig.type ? rawSig.type.toString().replace(/\s/g, "") : "";
|
||||
this.returnsSomething = this.returnType != "void";
|
||||
|
||||
if (rawSig.hasComment()) {
|
||||
this.docText = rawSig.comment.shortText + rawSig.comment.text;
|
||||
this.docText = this.docText.replace(/[\n\r]+/g, " ").trim();
|
||||
|
||||
if (!this.docText) {
|
||||
this.errorMessages.push(`Warning: method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.returnDocText = rawSig.comment.returns;
|
||||
this.returnDocText = this.returnDocText ? this.returnDocText.replace(/[\n\r]+/g, " ").trim() : "";
|
||||
|
||||
if (this.returnDocText.toLowerCase() === "nothing") {
|
||||
this.returnsSomething = false;
|
||||
}
|
||||
|
||||
if (this.returnsSomething && !this.returnDocText) {
|
||||
this.errorMessages.push(`Warning: Return value of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
this.isDeprecated = rawSig.comment.hasTag("deprecated");
|
||||
}
|
||||
|
||||
this.params = [];
|
||||
let paramStrings = [];
|
||||
|
||||
if (rawSig.parameters) {
|
||||
rawSig.parameters.forEach(rawParam => {
|
||||
if (!rawParam.comment || !rawParam.comment.text) {
|
||||
this.errorMessages.push(`Warning: parameter "${rawParam.name}" of method "${rawSig.name}" has no doc text.`);
|
||||
}
|
||||
|
||||
let param = new ParamInfo(rawParam);
|
||||
this.params.push(param);
|
||||
paramStrings.push(param.combined);
|
||||
});
|
||||
}
|
||||
|
||||
this.signature = "(" + paramStrings.join(", ") + ")";
|
||||
}
|
||||
|
||||
get errors() {
|
||||
return this.errorMessages;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ComponentInfo {
|
||||
properties: PropInfo[];
|
||||
methods: MethodSigInfo[];
|
||||
hasInputs: boolean;
|
||||
hasOutputs: boolean;
|
||||
hasMethods: boolean;
|
||||
|
||||
constructor(classRef: DeclarationReflection) {
|
||||
let props = classRef.getChildrenByKind(ReflectionKind.Property);
|
||||
let accessors = classRef.getChildrenByKind(ReflectionKind.Accessor);
|
||||
|
||||
this.properties = [...props, ...accessors].map(item => {
|
||||
return new PropInfo(item);
|
||||
});
|
||||
|
||||
let methods = classRef.getChildrenByKind(ReflectionKind.Method);
|
||||
|
||||
this.methods = [];
|
||||
|
||||
methods.forEach(method =>{
|
||||
if (!(method.flags.isPrivate || method.flags.isProtected || undocMethodNames[method.name])) {
|
||||
method.signatures.forEach(sig => {
|
||||
this.methods.push(new MethodSigInfo(sig));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.hasInputs = false;
|
||||
this.hasOutputs = false;
|
||||
|
||||
this.properties.forEach(prop => {
|
||||
if (prop.isInput)
|
||||
this.hasInputs = true;
|
||||
|
||||
if (prop.isOutput)
|
||||
this.hasOutputs = true;
|
||||
});
|
||||
|
||||
this.hasMethods = methods.length > 0;
|
||||
}
|
||||
|
||||
get errors() {
|
||||
let combinedErrors = [];
|
||||
|
||||
this.methods.forEach(method => {
|
||||
method.errors.forEach(err => {
|
||||
combinedErrors.push(err);
|
||||
})
|
||||
});
|
||||
|
||||
this.properties.forEach(prop => {
|
||||
prop.errors.forEach(err => {
|
||||
combinedErrors.push(err);
|
||||
});
|
||||
});
|
||||
|
||||
return combinedErrors;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initPhase(aggData) {
|
||||
@ -306,6 +83,7 @@ function initPhase(aggData) {
|
||||
|
||||
|
||||
function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
/*
|
||||
let compName = angNameToClassName(path.basename(pathname, ".md"));
|
||||
let classRef = aggData.projData.findReflectionByName(compName);
|
||||
|
||||
@ -315,9 +93,13 @@ function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
}
|
||||
|
||||
let compData = new ComponentInfo(classRef);
|
||||
let classTypeMatch = compName.match(/component|directive|service/i);
|
||||
*/
|
||||
|
||||
if (classTypeMatch) {
|
||||
let className = ngNameToClassName(path.basename(pathname, ".md"), nameExceptions);
|
||||
let classTypeMatch = className.match(/component|directive|service/i);
|
||||
let compData = aggData.classInfo[className];
|
||||
|
||||
if (classTypeMatch && compData) {
|
||||
let classType = classTypeMatch[0].toLowerCase();
|
||||
|
||||
// Copy docs back from the .md file when the JSDocs are empty.
|
||||
@ -353,7 +135,7 @@ function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function initialCap(str: string) {
|
||||
return str[0].toUpperCase() + str.substr(1);
|
||||
}
|
||||
@ -384,7 +166,7 @@ function angNameToClassName(rawName: string) {
|
||||
|
||||
return finalName;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
function getPropDocsFromMD(tree, sectionHeading, docsColumn) {
|
||||
let result = {}
|
||||
@ -512,7 +294,7 @@ function getMDMethodParams(methItem: MDNav) {
|
||||
|
||||
let paramDoc = paramListItem.childNav
|
||||
.paragraph().childNav
|
||||
.text(t=>true, 1).item.value;
|
||||
.text(t=>true, 1).value; //item.value;
|
||||
|
||||
result[paramName] = paramDoc.replace(/^[ -]+/, "");
|
||||
});
|
||||
|
@ -2,7 +2,20 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var typedoc_1 = require("typedoc");
|
||||
/*
|
||||
import {
|
||||
Application,
|
||||
ProjectReflection,
|
||||
Reflection,
|
||||
DeclarationReflection,
|
||||
SignatureReflection,
|
||||
ParameterReflection,
|
||||
ReflectionKind,
|
||||
TraverseProperty,
|
||||
Decorator
|
||||
} from "typedoc";
|
||||
import { CommentTag } from "typedoc/dist/lib/models";
|
||||
*/
|
||||
var ProgressBar = require("progress");
|
||||
var unist = require("../unistHelpers");
|
||||
var ngHelpers = require("../ngHelpers");
|
||||
@ -44,15 +57,24 @@ function initPhase(aggData) {
|
||||
}
|
||||
});
|
||||
});
|
||||
var classes = aggData.projData.getReflectionsByKind(typedoc_1.ReflectionKind.Class);
|
||||
classes.forEach(function (currClass) {
|
||||
/*
|
||||
let classes = aggData.projData.getReflectionsByKind(ReflectionKind.Class);
|
||||
|
||||
classes.forEach(currClass => {
|
||||
if (currClass.name.match(/(Component|Directive|Interface|Model|Pipe|Service|Widget)$/)) {
|
||||
aggData.nameLookup.addName(currClass.name);
|
||||
}
|
||||
});
|
||||
*/
|
||||
var classNames = Object.keys(aggData.classInfo);
|
||||
classNames.forEach(function (currClassName) {
|
||||
if (currClassName.match(/(Component|Directive|Interface|Model|Pipe|Service|Widget)$/)) {
|
||||
aggData.nameLookup.addName(currClassName);
|
||||
}
|
||||
});
|
||||
//console.log(JSON.stringify(aggData.nameLookup));
|
||||
}
|
||||
function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
function updateFile(tree, pathname, aggData, _errorMessages) {
|
||||
traverseMDTree(tree);
|
||||
return true;
|
||||
function traverseMDTree(node) {
|
||||
@ -290,11 +312,16 @@ function resolveTypeLink(aggData, text) {
|
||||
if (possTypeName === 'constructor') {
|
||||
return "";
|
||||
}
|
||||
var ref = aggData.projData.findReflectionByName(possTypeName);
|
||||
if (ref && isLinkable(ref.kind)) {
|
||||
/*
|
||||
let ref: Reflection = aggData.projData.findReflectionByName(possTypeName);
|
||||
*/
|
||||
var classInfo = aggData.classInfo[possTypeName];
|
||||
//if (ref && isLinkable(ref.kind)) {
|
||||
if (classInfo) {
|
||||
var kebabName = ngHelpers.kebabifyClassName(possTypeName);
|
||||
var possDocFile = aggData.docFiles[kebabName];
|
||||
var url = "../../lib/" + ref.sources[0].fileName;
|
||||
//let url = "../../lib/" + ref.sources[0].fileName;
|
||||
var url = classInfo.sourcePath; //"../../lib/" + classInfo.items[0].source.path;
|
||||
if (possDocFile) {
|
||||
url = "../" + possDocFile;
|
||||
}
|
||||
@ -316,12 +343,14 @@ function cleanTypeName(text) {
|
||||
return text.replace(/\[\]$/, "");
|
||||
}
|
||||
}
|
||||
function isLinkable(kind) {
|
||||
return (kind === typedoc_1.ReflectionKind.Class) ||
|
||||
(kind === typedoc_1.ReflectionKind.Interface) ||
|
||||
(kind === typedoc_1.ReflectionKind.Enum) ||
|
||||
(kind === typedoc_1.ReflectionKind.TypeAlias);
|
||||
/*
|
||||
function isLinkable(kind: ReflectionKind) {
|
||||
return (kind === ReflectionKind.Class) ||
|
||||
(kind === ReflectionKind.Interface) ||
|
||||
(kind === ReflectionKind.Enum) ||
|
||||
(kind === ReflectionKind.TypeAlias);
|
||||
}
|
||||
*/
|
||||
function convertNodeToTypeLink(node, text, url, title) {
|
||||
if (title === void 0) { title = null; }
|
||||
var linkDisplayText = unist.makeInlineCode(text);
|
||||
|
@ -1,10 +1,12 @@
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
|
||||
|
||||
import * as remark from "remark";
|
||||
import * as stringify from "remark-stringify";
|
||||
import * as frontMatter from "remark-frontmatter";
|
||||
|
||||
/*
|
||||
import {
|
||||
Application,
|
||||
ProjectReflection,
|
||||
@ -17,6 +19,7 @@ import {
|
||||
Decorator
|
||||
} from "typedoc";
|
||||
import { CommentTag } from "typedoc/dist/lib/models";
|
||||
*/
|
||||
|
||||
import * as ProgressBar from "progress";
|
||||
|
||||
@ -74,6 +77,7 @@ function initPhase(aggData) {
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
let classes = aggData.projData.getReflectionsByKind(ReflectionKind.Class);
|
||||
|
||||
classes.forEach(currClass => {
|
||||
@ -81,14 +85,22 @@ function initPhase(aggData) {
|
||||
aggData.nameLookup.addName(currClass.name);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
let classNames = Object.keys(aggData.classInfo);
|
||||
|
||||
classNames.forEach(currClassName => {
|
||||
if (currClassName.match(/(Component|Directive|Interface|Model|Pipe|Service|Widget)$/)) {
|
||||
aggData.nameLookup.addName(currClassName);
|
||||
}
|
||||
});
|
||||
//console.log(JSON.stringify(aggData.nameLookup));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updateFile(tree, pathname, aggData, errorMessages) {
|
||||
function updateFile(tree, pathname, aggData, _errorMessages) {
|
||||
traverseMDTree(tree);
|
||||
return true;
|
||||
|
||||
@ -363,13 +375,19 @@ function resolveTypeLink(aggData, text): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
/*
|
||||
let ref: Reflection = aggData.projData.findReflectionByName(possTypeName);
|
||||
*/
|
||||
let classInfo = aggData.classInfo[possTypeName];
|
||||
|
||||
if (ref && isLinkable(ref.kind)) {
|
||||
//if (ref && isLinkable(ref.kind)) {
|
||||
if (classInfo) {
|
||||
let kebabName = ngHelpers.kebabifyClassName(possTypeName);
|
||||
let possDocFile = aggData.docFiles[kebabName];
|
||||
let url = "../../lib/" + ref.sources[0].fileName;
|
||||
|
||||
//let url = "../../lib/" + ref.sources[0].fileName;
|
||||
|
||||
let url = classInfo.sourcePath; //"../../lib/" + classInfo.items[0].source.path;
|
||||
|
||||
if (possDocFile) {
|
||||
url = "../" + possDocFile;
|
||||
}
|
||||
@ -393,13 +411,14 @@ function cleanTypeName(text) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function isLinkable(kind: ReflectionKind) {
|
||||
return (kind === ReflectionKind.Class) ||
|
||||
(kind === ReflectionKind.Interface) ||
|
||||
(kind === ReflectionKind.Enum) ||
|
||||
(kind === ReflectionKind.TypeAlias);
|
||||
}
|
||||
*/
|
||||
|
||||
function convertNodeToTypeLink(node, text, url, title = null) {
|
||||
let linkDisplayText = unist.makeInlineCode(text);
|
||||
|
35
tools/doc/yamlTemplates/methodSig.ejs
Normal file
35
tools/doc/yamlTemplates/methodSig.ejs
Normal file
@ -0,0 +1,35 @@
|
||||
summary: >-
|
||||
<%- ((typeof sig.comment !== "undefined") && (typeof sig.comment.shortText !== "undefined")) ? (sig.comment.shortText || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
tags:
|
||||
<% if ((typeof sig.comment !== "undefined") && (typeof sig.comment.tags !== "undefined")) { -%>
|
||||
<% sig.comment.tags.forEach(tag => { -%>
|
||||
- name: <%= tag.tag %>
|
||||
text: >-
|
||||
<%= (tag.text || "").replace(/[\n\r]+/g, " ").trim() %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
syntax:
|
||||
parameters:
|
||||
<% if ((typeof sig.parameters !== "undefined") && (sig.parameters.length > 0)) { -%>
|
||||
<% sig.parameters.forEach((param) => { -%>
|
||||
- id: <%= param.name %>
|
||||
type: >-
|
||||
<%- include("type", {type: param.type}).trim() %>
|
||||
description: >-
|
||||
<%- param.comment ? (param.comment.text || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
defaultValue: >-
|
||||
<%- (typeof param.defaultValue !== "undefined") ? param.defaultValue : "" %>
|
||||
flags:
|
||||
<%_ if (typeof param.flags !== "undefined") { -%>
|
||||
<%_ Object.keys(param.flags).forEach(flagName => { -%>
|
||||
- name: <%= flagName %>
|
||||
value: <%- param.flags[flagName] %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
return:
|
||||
type: >-
|
||||
<%- include("type", {type: sig.type}).trim() %>
|
||||
summary: >-
|
||||
<%- ((typeof sig.comment !== "undefined") && (typeof sig.comment.returns !== "undefined")) ? (sig.comment.returns || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
27
tools/doc/yamlTemplates/property.ejs
Normal file
27
tools/doc/yamlTemplates/property.ejs
Normal file
@ -0,0 +1,27 @@
|
||||
summary: >-
|
||||
<%- (typeof child.comment !== "undefined") ? (child.comment.shortText || "").replace(/[\n\r]+/g, " ").trim() : "" %>
|
||||
tags:
|
||||
<%_ if ((typeof child.comment !== "undefined") && (typeof child.comment.tags !== "undefined")) { -%>
|
||||
<% child.comment.tags.forEach(tag => { -%>
|
||||
- name: <%= tag.tag %>
|
||||
text: >-
|
||||
<%- (tag.text || "").replace(/[\n\r]+/g, " ").trim() %>
|
||||
<%_ }) -%>
|
||||
<% } -%>
|
||||
decorators:
|
||||
<%_ if (typeof child.decorators !== "undefined") { -%>
|
||||
<% child.decorators.forEach(dec => { -%>
|
||||
- name: <%= dec.name %>
|
||||
arguments:
|
||||
<% Object.keys(dec.arguments).forEach(argName => { -%>
|
||||
- id: <%= argName %>
|
||||
value: <%- dec.arguments[argName] %>
|
||||
<% }) %>
|
||||
<%_ }) -%>
|
||||
<% } -%>
|
||||
syntax:
|
||||
return:
|
||||
type: >-
|
||||
<%- include("type", {type: child.type}).trim() %>
|
||||
defaultValue: >-
|
||||
<%- (child.defaultValue || "").length < 20 ? child.defaultValue : "" %>
|
44
tools/doc/yamlTemplates/template.ejs
Normal file
44
tools/doc/yamlTemplates/template.ejs
Normal file
@ -0,0 +1,44 @@
|
||||
items:
|
||||
- uid: <%= name %>
|
||||
name: <%= name %>
|
||||
fullName: <%= name %>
|
||||
source:
|
||||
path: <%= sources[0].fileName %>
|
||||
startLine: <%= sources[0].line %>
|
||||
children:
|
||||
<%_ if (typeof children !== "undefined") { -%>
|
||||
<%_ children.forEach((child) => { -%>
|
||||
- <%= name %>.<%= child.name %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
langs: typeScript
|
||||
type: <%= kindString.toLowerCase() %>
|
||||
<%_ if (typeof children !== "undefined") { -%>
|
||||
<%_ children.forEach((child) => { -%>
|
||||
<%_ if ((child.kindString === "Constructor") || (child.kindString === "Method")) { -%>
|
||||
<%_ child.signatures.forEach((sig) => { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
flags:
|
||||
<%_ if (typeof child.flags !== "undefined") { -%>
|
||||
<%_ Object.keys(child.flags).forEach(flagName => { -%>
|
||||
- name: <%= flagName %>
|
||||
value: <%= child.flags[flagName] %>
|
||||
<% }) -%>
|
||||
<% } -%>
|
||||
<%- include("methodSig", {sig: sig}); -%>
|
||||
<% }); %>
|
||||
<% } else if (child.kindString === "Property") { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
<%- include("property", {child: child}); -%>
|
||||
<% } else if ((child.kindString === "Accessor") && (typeof child.getSignature !== "undefined")) { -%>
|
||||
- uid: <%= name %>.<%= child.name %>
|
||||
name: <%= child.name %>
|
||||
type: <%= child.kindString.toLowerCase() %>
|
||||
<%- include("property", {child: child.getSignature}); -%>
|
||||
<% } -%>
|
||||
<% }) -%>
|
||||
<% } -%>
|
20
tools/doc/yamlTemplates/type.ejs
Normal file
20
tools/doc/yamlTemplates/type.ejs
Normal file
@ -0,0 +1,20 @@
|
||||
<%_ if ((type.type === "intrinsic") || (type.type === "reference")) { _%>
|
||||
<%= type.name _%>
|
||||
<%_ if (typeof type.typeArguments !== "undefined") { _%>
|
||||
<<%_ type.typeArguments.forEach((arg, index) => { _%>
|
||||
<%= index === 0 ? "" : ", " _%>
|
||||
<%- include("type", {type: arg}).trim() _%>
|
||||
<%_ }) _%>>
|
||||
<%_ } _%>
|
||||
<%_ } else if (type.type === "stringLiteral") { _%>
|
||||
"<%= type.value _%>"
|
||||
<%_ } else if (type.type === "reflection") { _%>
|
||||
Function
|
||||
<%_ } else if (type.type === "array") { _%>
|
||||
<%- include("type", {type: type.elementType}).trim() _%>[]
|
||||
<%_ } else if (type.type === "union") { _%>
|
||||
<%_ type.types.forEach((unionItem, index) => { _%>
|
||||
<%= index === 0 ? "" : " | " _%>
|
||||
<%- include("type", {type: unionItem}).trim() _%>
|
||||
<%_ }) _%>
|
||||
<%_ } _%>
|
Loading…
x
Reference in New Issue
Block a user