mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-2596] Fixed inputs with incorrect names (#3166)
* [ADF-2596] Updated prop script to handle names from input decorators * [ADF-2596] Fixed inputs with accessors * [ADF-2596] Fixed remaining inputs with wrong names * [ADF-2596] Updated prop script to handle names from input decorators * [ADF-2596] Fixed inputs with accessors * [ADF-2596] Fixed remaining inputs with wrong names
This commit is contained in:
parent
a32b1b7359
commit
2a5fe7ad28
@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Folder Create directive
|
# Folder Create directive
|
||||||
|
|
||||||
Allows folders to be created.
|
Creates folders.
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
@ -21,19 +23,23 @@ Allows folders to be created.
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| parentNodeId | `string` | `DEFAULT_FOLDER_PARENT_ID` | Parent folder where the new folder will be located after creation. |
|
| adf-create-folder | `string` | DEFAULT_FOLDER_PARENT_ID | Parent folder where the new folder will be located after creation. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
| error | `EventEmitter<any>` | Emitted when an error occurs (for example a folder with same name already exists) |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
'FolderCreateDirective' directive needs the id of the parent folder where we want the new folder node to be created. If no value is provided, the '-my-' alias is used.
|
Pass this directive the id of the parent folder where you want the new folder node to be created.
|
||||||
It opens the FolderDialogComponent to receive data for the new folder. If data is valid, on dialog close, it emits folderCreate event.
|
If no value is provided, the '-my-' alias is used.
|
||||||
|
This will open a Folder Dialog component to receive data for the new folder. If the data is valid
|
||||||
|
then the dialog will emit a `folderCreate` event when it closes.
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Folder Edit directive
|
# Folder Edit directive
|
||||||
|
|
||||||
Allows folders to be edited.
|
Allows folders to be edited.
|
||||||
@ -21,19 +23,21 @@ Allows folders to be edited.
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| folder | `MinimalNodeEntryEntity` | | Folder node to edit. |
|
| adf-edit-folder | `MinimalNodeEntryEntity` | | Folder node to edit. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
| error | `EventEmitter<any>` | Emitted when an error occurs (for example a folder with same name already exists) |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
'FolderEditDirective' directive needs a selection folder entry of #documentList to open the folder dialog component to edit the name and description properties of that selected folder.
|
Pass this directive a folder to edit its name and description using a Folder Dialog component.
|
||||||
If data is valid, on dialog close, it emits folderEdit event.
|
If the data is valid then the dialog emits a `folderEdit` event when it closes.
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
Added: v2.2.0
|
Added: v2.2.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Download directive
|
# Node Download directive
|
||||||
|
|
||||||
Allows folders and/or files to be downloaded. Multiple nodes are packed as a '.ZIP' archive.
|
Allows folders and/or files to be downloaded, with multiple nodes packed as a '.ZIP' archive.
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
@ -21,8 +23,10 @@ Allows folders and/or files to be downloaded. Multiple nodes are packed as a '.Z
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| nodes | `MinimalNodeEntity[]` | | Nodes to download. |
|
| adfNodeDownload | `MinimalNodeEntity[]` | | Nodes to download. |
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
Added: v2.2.0
|
Added: v2.2.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Lock directive
|
# Node Lock directive
|
||||||
|
|
||||||
Call [`ContentNodeDialogService.openLockNodeDialog(nodeEntry)`](./content-node-dialog.service.md) method on click event,
|
Locks a node.
|
||||||
and disable target button if provided node is not a file or user don't have permissions.
|
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
@ -19,4 +20,11 @@ and disable target button if provided node is not a file or user don't have perm
|
|||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| ---- | ---- | ------------- | ----------- |
|
||||||
| node | `MinimalNodeEntryEntity` | | Node to lock. |
|
| adf-node-lock | `MinimalNodeEntryEntity` | | Node to lock. |
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
This calls the `openLockNodeDialog` method from the
|
||||||
|
[Content Node Dialog service](content-node-dialog.service.md) method when clicked,
|
||||||
|
and disables the target button if the provided node is not a file or the user doesn't
|
||||||
|
have permissions.
|
@ -1,28 +1,15 @@
|
|||||||
---
|
---
|
||||||
Added: v2.3.0
|
Added: v2.3.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Public file Share Directive
|
# Node Public file Share Directive
|
||||||
|
|
||||||
Create and manage public shared links for files
|
Creates and manages public shared links for files.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
This dialog will generate a link that will be formed as "baseShareUrl + sharedId".
|
|
||||||
For example if you set the input parameter [baseShareUrl]="http://localhos:8080/myrouteForShareFile/",
|
|
||||||
the directive will ask to the Content service to generate a sharedId for the file. This will end up with a url link like :
|
|
||||||
|
|
||||||
http://localhos:8080/myrouteForShareFile/NEW_GENERATED_SHAREID
|
|
||||||
|
|
||||||
After you will need to implement in your app a logic that throught the router get the NEW_GENERATED_SHAREID and pass it to the ***adf-viewer***
|
|
||||||
|
|
||||||
```html
|
|
||||||
<adf-viewer
|
|
||||||
[sharedLinkId]="NEW_GENERATED_SHAREID"
|
|
||||||
[allowGoBack]="false">
|
|
||||||
</adf-viewer>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@ -47,3 +34,28 @@ After you will need to implement in your app a logic that throught the router ge
|
|||||||
| baseShareUrl | `string` | | baseShareUrl to add as prefix to the generated link |
|
| baseShareUrl | `string` | | baseShareUrl to add as prefix to the generated link |
|
||||||
|
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
This dialog will generate a link with the form "baseShareUrl + sharedId".
|
||||||
|
For example, if you set the input parameter as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
[baseShareUrl]="http://localhost:8080/myrouteForShareFile/"
|
||||||
|
```
|
||||||
|
|
||||||
|
...then the directive will ask the [Content service](../core/content.service.md) to generate
|
||||||
|
a `sharedId` for the file. This will create a URL like the following:
|
||||||
|
|
||||||
|
```
|
||||||
|
http://localhost:8080/myrouteForShareFile/NEW_GENERATED_SHAREID
|
||||||
|
```
|
||||||
|
|
||||||
|
To use this,ou will need to implement some code that gets the `NEW_GENERATED_SHAREID` with the router
|
||||||
|
and passes it to a [Viewer component](../core/viewer.component.md):
|
||||||
|
|
||||||
|
```html
|
||||||
|
<adf-viewer
|
||||||
|
[sharedLinkId]="NEW_GENERATED_SHAREID"
|
||||||
|
[allowGoBack]="false">
|
||||||
|
</adf-viewer>
|
||||||
|
```
|
@ -21,17 +21,18 @@ Searches items for supplied search terms.
|
|||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| 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. |
|
| 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. |
|
| 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. |
|
| skipResults | `number` | 0 | Number of results to skip from the results pagination. |
|
||||||
|
| class | `` | | CSS class for display. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
||||||
| resultLoaded | `EventEmitter<NodePaging>` | Emitted when search results have fully loaded. |
|
| resultLoaded | `EventEmitter<NodePaging>` | Emitted when search results have fully loaded. |
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Context Menu directive
|
# Context Menu directive
|
||||||
|
|
||||||
Adds a context menu to a component.
|
Adds a context menu to a component.
|
||||||
@ -40,11 +42,14 @@ export class MyComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| showIcons | boolean | false | Render defined icons |
|
| context-menu-enabled | `boolean` | false | |
|
||||||
|
| context-menu | `any[]` | | |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
---
|
---
|
||||||
# DataColumn Component
|
|
||||||
|
# Data Column Component
|
||||||
|
|
||||||
Defines column properties for DataTable, Tasklist, Document List and other components.
|
Defines column properties for DataTable, Tasklist, Document List and other components.
|
||||||
|
|
||||||
@ -10,6 +11,8 @@ Defines column properties for DataTable, Tasklist, Document List and other compo
|
|||||||
|
|
||||||
- [Basic Usage](#basic-usage)
|
- [Basic Usage](#basic-usage)
|
||||||
|
|
||||||
|
- [Class members](#class-members)
|
||||||
|
|
||||||
- [Properties](#properties)
|
- [Properties](#properties)
|
||||||
|
|
||||||
- [Details](#details)
|
- [Details](#details)
|
||||||
@ -35,18 +38,20 @@ Defines column properties for DataTable, Tasklist, Document List and other compo
|
|||||||
</adf-datatable>
|
</adf-datatable>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| key | `string` | | Data source key. Can be either a column/property key like `title` or a property path like `createdBy.name`. |
|
| class | `string` | | Additional CSS class to be applied to column (header and cells). |
|
||||||
| type | `string` | `'text'` | Value type for the column. Possible settings are 'text', 'image', 'date', 'fileSize' and 'location'. |
|
| format | `string` | | Value format (if supported by the parent component), for example format of the date. |
|
||||||
| format | `string` | | Value format (if supported by the parent component), for example format of the date. |
|
| formatTooltip | `Function` | | Custom tooltip formatter function. |
|
||||||
| sortable | `boolean` | `true` | Toggles ability to sort by this column, for example by clicking the column header. |
|
| key | `string` | | Data source key. Can be either a column/property key like `title` or a property path like `createdBy.name`. |
|
||||||
| title | `string` | `''` | Display title of the column, typically used for column headers. You can use the i18n resource key to get it translated automatically. |
|
| sortable | `boolean` | true | Toggles ability to sort by this column, for example by clicking the column header. |
|
||||||
| formatTooltip | `Function` | | Custom tooltip formatter function. |
|
| sr-title | `string` | | Title to be used for screen readers. |
|
||||||
| srTitle | `string` | | Title to be used for screen readers. |
|
| title | `string` | "" | Display title of the column, typically used for column headers. You can use the i18n resource key to get it translated automatically. |
|
||||||
| cssClass | `string` | | Additional CSS class to be applied to column (header and cells). |
|
| type | `string` | "text" | Value type for the column. Possible settings are 'text', 'image', 'date', 'fileSize' and 'location'. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# File Draggable directive
|
# File Draggable directive
|
||||||
|
|
||||||
Provide drag-and-drop features for an element such as a `div`.
|
Provides drag-and-drop features for an element such as a `div`.
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
@ -32,19 +34,21 @@ Some sample CSS to show the drag and drop area:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| enabled | `boolean` | `true` | Enables/disables drag-and-drop functionality. |
|
| file-draggable | `boolean` | true | Enables/disables drag-and-drop functionality. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| filesDropped | `EventEmitter<File[]>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
| filesDropped | `EventEmitter<File[]>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
||||||
| filesEntityDropped | `EventEmitter<any>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
| filesEntityDropped | `EventEmitter<any>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
||||||
| folderEntityDropped | `EventEmitter<any>` | Emitted when a directory is dragged and dropped onto the draggable element. |
|
| folderEntityDropped | `EventEmitter<any>` | Emitted when a directory is dragged and dropped onto the draggable element. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Highlight directive
|
# Highlight directive
|
||||||
|
|
||||||
Adds highlighting to selected sections of an HTML element's content.
|
Adds highlighting to selected sections of an HTML element's content.
|
||||||
@ -18,13 +20,15 @@ Adds highlighting to selected sections of an HTML element's content.
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| selector | `string` | `''` | Class selector for highlightable elements. |
|
| adf-highlight-class | `string` | "adf-highlight" | CSS class used to apply highlighting. |
|
||||||
| search | `string` | `''` | Text to highlight. |
|
| adf-highlight | `string` | "" | Text to highlight. |
|
||||||
| classToApply | `string` | `'adf-highlight'` | CSS class used to apply highlighting. |
|
| adf-highlight-selector | `string` | "" | Class selector for highlightable elements. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-06
|
||||||
---
|
---
|
||||||
|
|
||||||
# Infinite Pagination component
|
# Infinite Pagination component
|
||||||
|
|
||||||
Adds "infinite" pagination to the component it is used with.
|
Adds "infinite" pagination to the component it is used with.
|
||||||
@ -18,24 +20,27 @@ Adds "infinite" pagination to the component it is used with.
|
|||||||
</adf-infinite-pagination>
|
</adf-infinite-pagination>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Integrating with Document List
|
### Integrating with Document List
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<adf-document-list #documentList ...></adf-document-list>
|
<adf-document-list #documentList ...></adf-document-list>
|
||||||
|
|
||||||
<adf-infinite-pagination
|
<adf-infinite-pagination
|
||||||
[target]="documentList">
|
[target]="documentList"
|
||||||
|
[loading="documentList.infiniteLoading">
|
||||||
</adf-infinite-pagination>
|
</adf-infinite-pagination>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| ---- | ---- | ------------- | ----------- |
|
||||||
| pagination | `Pagination` | | Pagination object. |
|
| loading | `boolean` | false | Is a new page loading? |
|
||||||
| target | `PaginatedComponent` | | Component that provides custom pagination support. |
|
| pageSize | `number` | InfinitePaginationComponent.DEFAULT_PAGE_SIZE | Number of items that are added with each "load more" event. |
|
||||||
| pageSize | `number` | `InfinitePaginationComponent.DEFAULT_PAGE_SIZE` | Number of items that are added with each "load more" event. |
|
| pagination | `Pagination` | | Pagination object. |
|
||||||
| loading | `boolean` | `false` | Is a new page loading? |
|
| target | `PaginatedComponent` | | Component that provides custom pagination support. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
# InfoDrawer component
|
|
||||||
|
# Info Drawer component
|
||||||
|
|
||||||
Displays a sidebar-style information panel with tabs.
|
Displays a sidebar-style information panel with tabs.
|
||||||
|
|
||||||
@ -28,17 +30,19 @@ Displays a sidebar-style information panel with tabs.
|
|||||||
</adf-info-drawer>
|
</adf-info-drawer>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| title | `string` | `null` | The title of the info drawer. |
|
| selectedIndex | `number` | 0 | The selected index tab. |
|
||||||
| selectedIndex | `number` | `0` | The selected index tab. |
|
| title | `string | null` | null | The title of the info drawer. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| currentTab | `EventEmitter<number>` | Emitted when the currently active tab changes. |
|
| currentTab | `EventEmitter<number>` | Emitted when the currently active tab changes. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
Last reviewed: 2018-03-21
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Delete directive
|
# Node Delete directive
|
||||||
@ -23,18 +23,20 @@ Deletes multiple files and folders.
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| selection | `MinimalNodeEntity[] | DeletedNodeEntity[]` | | Array of nodes to delete. |
|
| permanent | `boolean` | false | If true then the nodes are deleted immediately rather than being put in the trash |
|
||||||
| permanent | `boolean` | `false` | If true then the nodes are deleted immediately rather than being put in the trash. |
|
| adf-delete | `MinimalNodeEntity[] | DeletedNodeEntity[]` | | Array of nodes to delete. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| delete | `EventEmitter<any>` | Emitted when the nodes have been deleted. |
|
| delete | `EventEmitter<any>` | Emitted when the nodes have been deleted. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Favorite directive
|
# Node Favorite directive
|
||||||
|
|
||||||
Selectively toggles nodes as favorite
|
Selectively toggles nodes as favorites.
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
@ -34,22 +36,24 @@ export class MyComponent {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| selection | `MinimalNodeEntity[]` | `[]` | Array of nodes to toggle as favorites. |
|
| adf-node-favorite | `MinimalNodeEntity[]` | \[] | Array of nodes to toggle as favorites. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| toggle | `EventEmitter<any>` | Emitted when the favorite setting is complete. |
|
| toggle | `EventEmitter<any>` | Emitted when the favorite setting is complete. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
The `NodeFavoriteDirective` instance can be bound to a template variable through **adfFavorite** reference,
|
You can bind the directive instance to a template variable through the **adfFavorite** reference,
|
||||||
which provides a method to help further style the element.
|
which also lets you add extra styling to the element:
|
||||||
|
|
||||||
<!-- {% raw %} -->
|
<!-- {% raw %} -->
|
||||||
|
|
||||||
@ -67,11 +71,11 @@ which provides a method to help further style the element.
|
|||||||
|
|
||||||
<!-- {% endraw %} -->
|
<!-- {% endraw %} -->
|
||||||
|
|
||||||
The directive performs as follows:
|
The directive behaves as follows:
|
||||||
|
|
||||||
- if there are no favorite nodes in the selection, then all are marked as favorites
|
- If there are no favorite nodes in the selection, then all are marked as favorites
|
||||||
- if there is at least one favorite node in the selection, then only those who are not
|
- If there are one or more favorite node in the selection, then only those that are not
|
||||||
are being marked
|
favorites are marked
|
||||||
- if all nodes in the selection are favorites, then they are removed from favorites
|
- If all nodes in the selection are favorites, then they all have their favorite status removed
|
||||||
|
|
||||||
See **Demo Shell**
|
See the **Demo Shell** for examples of usage.
|
||||||
|
@ -1,36 +1,15 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Permission directive
|
# Node Permission directive
|
||||||
|
|
||||||
Selectively disables an HTML element or Angular component
|
Selectively disables an HTML element or Angular component
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
### Properties
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| ---- | ---- | ------------- | ----------- |
|
|
||||||
| permission | `string` | `null` | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions). |
|
|
||||||
| nodes | `MinimalNodeEntity[]` | `[]` | Nodes to check permission for. |
|
|
||||||
|
|
||||||
## Details
|
|
||||||
|
|
||||||
The `NodePermissionDirective` allows you to disable an HTML element or Angular component
|
|
||||||
by taking a collection of the `MinimalNodeEntity` instances and checking the particular permission.
|
|
||||||
|
|
||||||
The decorated element will be disabled if:
|
|
||||||
|
|
||||||
- there are no nodes in the collection
|
|
||||||
- at least one of the nodes has no expected permission
|
|
||||||
|
|
||||||
### HTML element example
|
|
||||||
|
|
||||||
The best example to show `NodePermissionDirective` in action is by binding DocumentList selection property to a toolbar button.
|
|
||||||
|
|
||||||
For example the "Delete" button should be disabled if no selection is present or if user has no rights to delete at least one node in the selection.
|
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<adf-toolbar title="toolbar example">
|
<adf-toolbar title="toolbar example">
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
@ -45,11 +24,54 @@ For example the "Delete" button should be disabled if no selection is present or
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
The button will become disabled by default, and is going to change its state once user selects/unselects one or multiple documents that current user has permission to delete.
|
## Class members
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Name | Type | Default value | Description |
|
||||||
|
| -- | -- | -- | -- |
|
||||||
|
| adf-nodes | `MinimalNodeEntity[]` | \[] | Nodes to check permission for. |
|
||||||
|
| adf-node-permission | `string` | null | Node permission to check (create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions). |
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
The Node Permission directive lets you disable an HTML element or Angular component
|
||||||
|
by taking a collection of `MinimalNodeEntity` instances and checking their permissions.
|
||||||
|
|
||||||
|
The decorated element will be disabled if:
|
||||||
|
|
||||||
|
- there are no nodes in the collection
|
||||||
|
- at least one of the nodes does not have the required permission
|
||||||
|
|
||||||
|
### HTML element example
|
||||||
|
|
||||||
|
A typical use case is to bind a [Document List](../content-services/document-list.component.md)
|
||||||
|
selection property to a toolbar button. In the following example, the "Delete" button should
|
||||||
|
be disabled if no selection is present or if user does not have permission to delete at least one
|
||||||
|
node in the selection:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<adf-toolbar title="toolbar example">
|
||||||
|
<button mat-icon-button
|
||||||
|
adf-node-permission="delete"
|
||||||
|
[adf-nodes]="documentList.selection">
|
||||||
|
<mat-icon>delete</mat-icon>
|
||||||
|
</button>
|
||||||
|
</adf-toolbar>
|
||||||
|
|
||||||
|
<adf-document-list #documentList ...>
|
||||||
|
...
|
||||||
|
</adf-document-list>
|
||||||
|
```
|
||||||
|
|
||||||
|
The button will be disabled by default and will change state when the user selects or deselects
|
||||||
|
one or more documents that they have permission to delete.
|
||||||
|
|
||||||
### Angular component example
|
### Angular component example
|
||||||
|
|
||||||
You can apply the directive on any angular component which implements the NodePermissionSubject interface. The upload drag area component can be a good candidate, since this one implements that interface. Applying the directive on an angular component is pretty much the same as applying it on an html element.
|
You can add the directive to any Angular component that implements the `NodePermissionSubject`
|
||||||
|
interface (the [Upload Drag Area component](../content-services/upload-drag-area.component.md),
|
||||||
|
for example). You can also use it in much the same way as you would with an HTML element:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<alfresco-upload-drag-area
|
<alfresco-upload-drag-area
|
||||||
@ -61,11 +83,14 @@ You can apply the directive on any angular component which implements the NodePe
|
|||||||
</alfresco-upload-drag-area>
|
</alfresco-upload-drag-area>
|
||||||
```
|
```
|
||||||
|
|
||||||
When designing a component you want to work this directive with, you have two important things to care about.
|
To enable your own component to work with this directive, you need to implement the
|
||||||
|
`NodePermissionSubject` interface and also define it as an EXTENDIBLE_COMPONENT parent component,
|
||||||
|
as described in the following sections.
|
||||||
|
|
||||||
### Implementing the NodePermissionSubject interface
|
### Implementing the NodePermissionSubject interface
|
||||||
|
|
||||||
The component has to implement the NodePermissionSubject interface which basically means it has to have a boolean **disabled** property. This is the property which will be set by the directive.
|
The component must implement the `NodePermissionSubject` interface which means it must have a
|
||||||
|
boolean `disabled` property. This is the property that will be set by the directive:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { NodePermissionSubject } from '@alfresco/adf-core';
|
import { NodePermissionSubject } from '@alfresco/adf-core';
|
||||||
@ -76,14 +101,13 @@ export class UploadDragAreaComponent implements NodePermissionSubject {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Defining your components as an EXTENDIBLE_COMPONENT parent component
|
### Defining your component as an EXTENDIBLE_COMPONENT parent component
|
||||||
|
|
||||||
The directive will look up the component in the dependency injection tree, up to the @Host() component.
|
The directive will look up the component in the dependency injection tree,
|
||||||
|
up to the `@Host()` component. The host component is typically the component that requests
|
||||||
> "The host component is typically the component requesting the dependency. **But when this component is projected into a parent component, that parent component becomes the host.**"
|
the dependency. However, when this component is projected into a parent component, the
|
||||||
|
parent becomes the host. This means you must provide your component with forward referencing
|
||||||
- because of this, you have to provide your component with forward referencing as the EXTENDIBLE_COMPONENT.
|
as the `EXTENDIBLE_COMPONENT` and also provide your component as a `viewProvider`:
|
||||||
- because of the emphasized second sentence you have to provide your component as a viewProvider.
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
import { EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
||||||
@ -97,4 +121,5 @@ import { EXTENDIBLE_COMPONENT } from '@alfresco/adf-core';
|
|||||||
export class UploadDragAreaComponent implements NodePermissionSubject { ... }
|
export class UploadDragAreaComponent implements NodePermissionSubject { ... }
|
||||||
```
|
```
|
||||||
|
|
||||||
**Notice the usage of viewProviders (instead of providers)! This part is very important, especially if you want to use this directive on a transcluded component!**
|
**Note:** the usage of **viewProviders** (instead of **providers**) is very important, especially
|
||||||
|
if you want to use this directive on a transcluded component.
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Node Restore directive
|
# Node Restore directive
|
||||||
|
|
||||||
Restores deleted nodes to their original location.
|
Restores deleted nodes to their original location.
|
||||||
@ -24,25 +26,29 @@ Restores deleted nodes to their original location.
|
|||||||
</adf-document-list>
|
</adf-document-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| selection | `DeletedNodeEntry[]` | | Array of deleted nodes to restore. |
|
| location | `string` | "" | Path to restored node. |
|
||||||
| location | `string` | `''` | Path to restored node. |
|
| adf-restore | `DeletedNodeEntry[]` | | Array of deleted nodes to restore. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| restore | `EventEmitter<any>` | Emitted when restoration is complete. |
|
| restore | `EventEmitter<any>` | Emitted when restoration is complete. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
'NodeRestoreDirective' directive takes a selection of `DeletedNodeEntry[]` and restores them in their original location.
|
The directive takes a selection of `DeletedNodeEntry` instances and restores them to
|
||||||
If the original location doesn't exist anymore, then they remain in the trash list.
|
their original locations. If the original location doesn't exist anymore then they remain
|
||||||
|
in the trash list.
|
||||||
|
|
||||||
For single node restore, there is action to jump to the location where the node has been restored and for this `location` is used to specify the route path where the list of nodes are rendered
|
When you restore a single node, you can use the `location` property to show where the node has
|
||||||
|
been restored. The property specifies the route path where the list of nodes are rendered.
|
||||||
|
|
||||||
## See Also
|
## See Also
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Text Mask directive
|
# Text Mask directive
|
||||||
|
|
||||||
Implements text field input masks.
|
Implements text field input masks.
|
||||||
|
@ -1,15 +1,47 @@
|
|||||||
---
|
---
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
|
Last reviewed: 2018-04-10
|
||||||
---
|
---
|
||||||
|
|
||||||
# Upload Directive
|
# Upload Directive
|
||||||
|
|
||||||
Allows your components or common HTML elements reacting on File drag and drop in order to upload content.
|
Uploads content in response to file drag and drop.
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
The directive itself does not do any file management process,
|
```html
|
||||||
but collects information on dropped files and raises corresponding events instead.
|
<button [adf-upload]="true" [multiple]="true" [accept]="'image/*'">
|
||||||
|
Upload photos
|
||||||
|
</button>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Name | Type | Default value | Description |
|
||||||
|
| -- | -- | -- | -- |
|
||||||
|
| accept | `string` | | (Click mode only) MIME type filter for files to accept. |
|
||||||
|
| adf-upload-data | `any` | | Data to upload. |
|
||||||
|
| directory | `boolean` | | (Click mode only) Toggles uploading of directories. |
|
||||||
|
| adf-upload | `boolean` | true | Enables/disables uploading. |
|
||||||
|
| mode | `string[]` | ['drop'] | Upload mode. Can be "drop" (receives dropped files) or "click" (clicking opens a file dialog). Both modes can be active at once. |
|
||||||
|
| multiple | `boolean` | | Toggles multiple file uploads. |
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
Add the directive to a component or HTML element to enable it to upload files.
|
||||||
|
You can decorate any element including buttons:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<button [adf-upload]="true" [multiple]="true" [accept]="'image/*'">
|
||||||
|
Upload photos
|
||||||
|
</button>
|
||||||
|
```
|
||||||
|
|
||||||
|
The directive itself does not do any file management, but it collects information about
|
||||||
|
dropped files and emits events in response.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div style="width:100px; height:100px"
|
<div style="width:100px; height:100px"
|
||||||
@ -19,7 +51,8 @@ but collects information on dropped files and raises corresponding events instea
|
|||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
It is possible controlling when upload behaviour is enabled/disabled by binding directive to a `boolean` value or expression:
|
You can enable or disable upload functionality by binding the directive to a boolean
|
||||||
|
value or expression:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div [adf-upload]="true">...</div>
|
<div [adf-upload]="true">...</div>
|
||||||
@ -27,37 +60,14 @@ It is possible controlling when upload behaviour is enabled/disabled by binding
|
|||||||
<div [adf-upload]="isUploadEnabled()">...</div>
|
<div [adf-upload]="isUploadEnabled()">...</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can decorate any element including buttons, for example:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<button [adf-upload]="true" [multiple]="true" [accept]="'image/*'">
|
|
||||||
Upload photos
|
|
||||||
</button>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Properties
|
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
|
||||||
| ---- | ---- | ------------- | ----------- |
|
|
||||||
| enabled | `boolean` | `true` | Enables/disables uploading. |
|
|
||||||
| data | `any` | | Data to upload. |
|
|
||||||
| mode | `string[]` | `['drop']` | Upload mode. Can be "drop" (receives dropped files) or "click" (clicking opens a file dialog). Both modes can be active at once. |
|
|
||||||
| multiple | `boolean` | | Toggles multiple file uploads. |
|
|
||||||
| accept | `string` | | (Click mode only) MIME type filter for files to accept. |
|
|
||||||
| directory | `boolean` | | (Click mode only) Toggles uploading of directories. |
|
|
||||||
|
|
||||||
## Details
|
|
||||||
|
|
||||||
Used by attaching to an element or component.
|
|
||||||
|
|
||||||
### Modes
|
### Modes
|
||||||
|
|
||||||
Directive supports several modes:
|
The Upload directive supports two modes:
|
||||||
|
|
||||||
- **drop** mode, where decorated element acts like a drop zone for files (**default** mode)
|
- **drop** mode, where the decorated element acts like a drop zone for files (enabled by default)
|
||||||
- **click** mode, where decorated element invokes File Dialog to select files or folders.
|
- **click** mode, where the decorated element invokes a file dialog to select files or folders.
|
||||||
|
|
||||||
It is also possible combining modes together.
|
You can also use both modes together:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div [adf-upload]="true" mode="['click']">...</div>
|
<div [adf-upload]="true" mode="['click']">...</div>
|
||||||
@ -67,7 +77,7 @@ It is also possible combining modes together.
|
|||||||
|
|
||||||
#### Click mode
|
#### Click mode
|
||||||
|
|
||||||
For the click mode you can provide additional attributes for the File Dialog:
|
In click mode you can provide extra attributes for the file dialog:
|
||||||
|
|
||||||
- **directory**, enables directory selection
|
- **directory**, enables directory selection
|
||||||
- **multiple**, enables multiple file/folder selection
|
- **multiple**, enables multiple file/folder selection
|
||||||
@ -89,12 +99,14 @@ For the click mode you can provide additional attributes for the File Dialog:
|
|||||||
|
|
||||||
#### Drop mode
|
#### Drop mode
|
||||||
|
|
||||||
For the moment upload directive supports only Files (single or multiple).
|
Currently, the upload directive supports only file drops (single or multiple).
|
||||||
Support for Folders and `accept` filters is subject to implement.
|
Support for folders and `accept` filters will probably be implemented in a
|
||||||
|
future version.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
Once a single or multiple files are dropped on the decorated element the `upload-files` [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) is raised.
|
The `upload-files` [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)
|
||||||
|
is emitted when single or multiple files are dropped on the decorated element.
|
||||||
The DOM event is configured to have `bubbling` enabled, so any component up the component tree can handle, process or prevent it:
|
The DOM event is configured to have `bubbling` enabled, so any component up the component tree can handle, process or prevent it:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@ -111,9 +123,12 @@ onUploadFiles(e: CustomEvent) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Please note that event will be raised only if valid [Files](https://developer.mozilla.org/en-US/docs/Web/API/File) were dropped onto the decorated element.
|
Note that the event will be emitted only if valid
|
||||||
|
[files](https://developer.mozilla.org/en-US/docs/Web/API/File)
|
||||||
|
are dropped onto the decorated element.
|
||||||
|
|
||||||
The `upload-files` event is cancellable, so you can stop propagation of the drop event to upper levels in case it has been already handled by your code:
|
The `upload-files` event is cancellable, so you can stop propagation of the drop event upwards
|
||||||
|
when it has been handled by your code:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
onUploadFiles(e: CustomEvent) {
|
onUploadFiles(e: CustomEvent) {
|
||||||
@ -124,10 +139,10 @@ onUploadFiles(e: CustomEvent) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible attaching arbitrary data to each event in order to access it from within external event handlers.
|
You can also attach arbitrary data to each event which you can then access from external event handlers. A typical scenario is with data tables where you may want to make use of the data row
|
||||||
A typical scenario is data tables where you may want to handle also the data row and/or underlying data to be accessible upon files drop.
|
or make underlying data accessible when files are dropped.
|
||||||
|
|
||||||
You may be using `adf-upload-data` to bind custom values or objects for every event raised:
|
You can use `adf-upload-data` to bind custom values or objects for every event raised:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div [adf-upload]="true" [adf-upload-data]="dataRow"></div>
|
<div [adf-upload]="true" [adf-upload-data]="dataRow"></div>
|
||||||
@ -136,7 +151,8 @@ You may be using `adf-upload-data` to bind custom values or objects for every ev
|
|||||||
<div [adf-upload]="true" [adf-upload-data]="getUploadData()"></div>
|
<div [adf-upload]="true" [adf-upload-data]="getUploadData()"></div>
|
||||||
```
|
```
|
||||||
|
|
||||||
As part of the `details` property of the [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) you can get access to the following:
|
You can access the following items of the `details` property from the
|
||||||
|
[CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent):
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
detail: {
|
detail: {
|
||||||
@ -148,9 +164,10 @@ detail: {
|
|||||||
|
|
||||||
### Styling
|
### Styling
|
||||||
|
|
||||||
The decorated element gets `adf-upload__dragging` CSS class name in the class list every time files are dragged over it.
|
The decorated element is styled with the `adf-upload__dragging` CSS class whenever a file is dragged
|
||||||
This allows changing look and feel of your components in case additional visual indication is required,
|
over it. This lets you change the look and feel of your components when you need different visual
|
||||||
for example you may want drawing a dashed border around the table row on drag:
|
indication. For example, you could draw a dashed border around a table row when an item is dragged
|
||||||
|
onto it:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<table>
|
<table>
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
---
|
---
|
||||||
|
|
||||||
# Process Audit Directive
|
# Process Audit Directive
|
||||||
|
|
||||||
Fetches the Process Audit information in the pdf or json format.
|
Fetches the Process Audit information the PDF or JSON format.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -21,18 +22,20 @@ Fetches the Process Audit information in the pdf or json format.
|
|||||||
</button>
|
</button>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| processId | `string` | | ID of the process. |
|
| download | `boolean` | true | Enables downloading of the audit file on clicking. |
|
||||||
| fileName | `string` | `'Audit'` | Name of the file to download (for PDF downloads). |
|
| fileName | `string` | "Audit" | Name of the file to download (for PDF downloads). |
|
||||||
| format | `string` | `'pdf'` | Format for the audit information (can be "pdf" or "json"). |
|
| format | `string` | "pdf" | Format for the audit information (can be "pdf" or "json"). |
|
||||||
| download | `boolean` | `true` | Enables downloading of the audit file on clicking. |
|
| process-id | `string` | | ID of the process. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
|
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
|
||||||
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
---
|
---
|
||||||
|
|
||||||
# Task Audit Directive
|
# Task Audit Directive
|
||||||
|
|
||||||
Fetches the Task Audit information in the pdf or json format.
|
Fetches the Task Audit information in PDF or JSON format.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -20,18 +21,20 @@ Fetches the Task Audit information in the pdf or json format.
|
|||||||
</button>
|
</button>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Class members
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| -- | -- | -- | -- |
|
||||||
| taskId | `string` | | (**required**) The id of the task. |
|
| download | `boolean` | true | Enables downloading of the audit when the decorated element is clicked. |
|
||||||
| fileName | `string` | `'Audit'` | Name of the downloaded file (for PDF downloads). |
|
| fileName | `string` | "Audit" | Name of the downloaded file (for PDF downloads). |
|
||||||
| format | `string` | `'pdf'` | Format of the audit information. Can be "pdf" or "json". |
|
| format | `string` | "pdf" | Format of the audit information. Can be "pdf" or "json". |
|
||||||
| download | `boolean` | `true` | Enables downloading of the audit when the decorated element is clicked. |
|
| task-id | `string` | | (**required**) The id of the task. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ----------- |
|
| -- | -- | -- |
|
||||||
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
|
| clicked | `EventEmitter<any>` | Emitted when the decorated element is clicked. |
|
||||||
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
| error | `EventEmitter<any>` | Emitted when an error occurs. |
|
||||||
|
@ -60,7 +60,7 @@ function updatePhase(filenames, aggData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
fs.writeFileSync(filenames[i], remark().use(frontMatter, {type: 'yaml', fence: '---'}).data("settings", {paddedTable: false}).stringify(tree));
|
fs.writeFileSync(filenames[i], remark().use(frontMatter, {type: 'yaml', fence: '---'}).data("settings", {paddedTable: false, gfm: false}).stringify(tree));
|
||||||
|
|
||||||
//console.log(JSON.stringify(tree));
|
//console.log(JSON.stringify(tree));
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
| -- | -- | -- | -- |
|
| -- | -- | -- | -- |
|
||||||
{% each properties as prop %}
|
{% each properties as prop %}
|
||||||
{% if prop.isInput %}
|
{% if prop.isInput %}
|
||||||
| {{prop.name}} | `{{{prop.type}}}` | {{{prop.defaultValue}}} | {{{prop.docText}}} |
|
| {{{prop.name}}} | `{{{prop.type}}}` | {{{prop.defaultValue}}} | {{{prop.docText}}} |
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endeach %}
|
{% endeach %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1 +1,23 @@
|
|||||||
{% include 'component' %}
|
{% if hasInputs %}
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Name | Type | Default value | Description |
|
||||||
|
| -- | -- | -- | -- |
|
||||||
|
{% each properties as prop %}
|
||||||
|
{% if prop.isInput %}
|
||||||
|
| {{{prop.name}}} | `{{{prop.type}}}` | {{{prop.defaultValue}}} | {{{prop.docText}}} |
|
||||||
|
{% endif %}
|
||||||
|
{% endeach %}
|
||||||
|
{% endif %}
|
||||||
|
{% if hasOutputs%}
|
||||||
|
|
||||||
|
### Events
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
| -- | -- | -- |
|
||||||
|
{% each properties as prop %}
|
||||||
|
{% if prop.isOutput %}
|
||||||
|
| {{prop.name}} | `{{{prop.type}}}` | {{{prop.docText}}} |
|
||||||
|
{% endif %}
|
||||||
|
{% endeach %}
|
||||||
|
{% endif %}
|
@ -13,7 +13,8 @@ var excludePatterns = [
|
|||||||
];
|
];
|
||||||
var nameExceptions = {
|
var nameExceptions = {
|
||||||
"datatable.component": "DataTableComponent",
|
"datatable.component": "DataTableComponent",
|
||||||
"tasklist.service": "TaskListService"
|
"tasklist.service": "TaskListService",
|
||||||
|
"text-mask.component": "InputMaskDirective"
|
||||||
};
|
};
|
||||||
var PropInfo = /** @class */ (function () {
|
var PropInfo = /** @class */ (function () {
|
||||||
function PropInfo(rawProp) {
|
function PropInfo(rawProp) {
|
||||||
@ -30,12 +31,14 @@ var PropInfo = /** @class */ (function () {
|
|||||||
}
|
}
|
||||||
if (rawProp.decorators) {
|
if (rawProp.decorators) {
|
||||||
rawProp.decorators.forEach(function (dec) {
|
rawProp.decorators.forEach(function (dec) {
|
||||||
|
//console.log(dec);
|
||||||
if (dec.name === "Input") {
|
if (dec.name === "Input") {
|
||||||
_this.isInput = true;
|
_this.isInput = true;
|
||||||
if (dec.arguments) {
|
if (dec.arguments) {
|
||||||
var bindingName = dec["bindingPropertyName"];
|
var bindingName = dec.arguments["bindingPropertyName"];
|
||||||
|
//console.log(JSON.stringify(dec.arguments));
|
||||||
if (bindingName && (bindingName !== ""))
|
if (bindingName && (bindingName !== ""))
|
||||||
_this.name = bindingName;
|
_this.name = bindingName.replace(/['"]/g, "");
|
||||||
}
|
}
|
||||||
if (!_this.docText && !_this.isDeprecated)
|
if (!_this.docText && !_this.isDeprecated)
|
||||||
console.log("Warning: Input \"" + rawProp.getFullName() + "\" has no doc text.");
|
console.log("Warning: Input \"" + rawProp.getFullName() + "\" has no doc text.");
|
||||||
@ -106,7 +109,8 @@ var ComponentInfo = /** @class */ (function () {
|
|||||||
function ComponentInfo(classRef) {
|
function ComponentInfo(classRef) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var props = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Property);
|
var props = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Property);
|
||||||
this.properties = props.map(function (item) {
|
var accessors = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Accessor);
|
||||||
|
this.properties = props.concat(accessors).map(function (item) {
|
||||||
return new PropInfo(item);
|
return new PropInfo(item);
|
||||||
});
|
});
|
||||||
var methods = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Method);
|
var methods = classRef.getChildrenByKind(typedoc_1.ReflectionKind.Method);
|
||||||
@ -131,7 +135,9 @@ var ComponentInfo = /** @class */ (function () {
|
|||||||
function initPhase(aggData) {
|
function initPhase(aggData) {
|
||||||
var app = new typedoc_1.Application({
|
var app = new typedoc_1.Application({
|
||||||
exclude: excludePatterns,
|
exclude: excludePatterns,
|
||||||
ignoreCompilerErrors: true
|
ignoreCompilerErrors: true,
|
||||||
|
experimentalDecorators: true,
|
||||||
|
tsconfig: "tsconfig.json"
|
||||||
});
|
});
|
||||||
var sources = app.expandInputFiles(libFolders);
|
var sources = app.expandInputFiles(libFolders);
|
||||||
aggData.projData = app.convert(sources);
|
aggData.projData = app.convert(sources);
|
||||||
@ -158,7 +164,8 @@ function updatePhase(tree, pathname, aggData) {
|
|||||||
var templateSource = fs.readFileSync(templateName, "utf8");
|
var templateSource = fs.readFileSync(templateName, "utf8");
|
||||||
var template = combyne(templateSource);
|
var template = combyne(templateSource);
|
||||||
var mdText = template.render(compData);
|
var mdText = template.render(compData);
|
||||||
var newSection_1 = remark().parse(mdText.trim()).children;
|
mdText = mdText.replace(/^ +\|/mg, "|");
|
||||||
|
var newSection_1 = remark().data("settings", { paddedTable: false, gfm: false }).parse(mdText.trim()).children;
|
||||||
replaceSection(tree, "Class members", function (before, section, after) {
|
replaceSection(tree, "Class members", function (before, section, after) {
|
||||||
newSection_1.unshift(before);
|
newSection_1.unshift(before);
|
||||||
newSection_1.push(after);
|
newSection_1.push(after);
|
||||||
@ -185,13 +192,17 @@ function updatePhase(tree, pathname, aggData) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
exports.updatePhase = updatePhase;
|
exports.updatePhase = updatePhase;
|
||||||
function renderInputs(comp) {
|
/*
|
||||||
|
function renderInputs(comp: ComponentInfo): string {
|
||||||
var result = "";
|
var result = "";
|
||||||
comp.properties.forEach(function (prop) {
|
|
||||||
result += "| " + prop.name + " | `" + prop.type + "` | " + prop.defaultValue + " | " + prop.docText + " |\n";
|
comp.properties.forEach(prop => {
|
||||||
|
result += `| ${prop.name} | \`${prop.type}\` | ${prop.defaultValue} | ${prop.docText} |\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
function initialCap(str) {
|
function initialCap(str) {
|
||||||
return str[0].toUpperCase() + str.substr(1);
|
return str[0].toUpperCase() + str.substr(1);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import * as path from "path";
|
|||||||
|
|
||||||
import * as replaceSection from "mdast-util-heading-range";
|
import * as replaceSection from "mdast-util-heading-range";
|
||||||
import * as remark from "remark";
|
import * as remark from "remark";
|
||||||
|
import * as stringify from "remark-stringify";
|
||||||
import * as frontMatter from "remark-frontmatter";
|
import * as frontMatter from "remark-frontmatter";
|
||||||
|
|
||||||
import * as combyne from "combyne";
|
import * as combyne from "combyne";
|
||||||
@ -31,7 +32,8 @@ let excludePatterns = [
|
|||||||
|
|
||||||
let nameExceptions = {
|
let nameExceptions = {
|
||||||
"datatable.component": "DataTableComponent",
|
"datatable.component": "DataTableComponent",
|
||||||
"tasklist.service": "TaskListService"
|
"tasklist.service": "TaskListService",
|
||||||
|
"text-mask.component": "InputMaskDirective"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -61,20 +63,18 @@ class PropInfo {
|
|||||||
|
|
||||||
if (rawProp.decorators) {
|
if (rawProp.decorators) {
|
||||||
rawProp.decorators.forEach(dec => {
|
rawProp.decorators.forEach(dec => {
|
||||||
|
//console.log(dec);
|
||||||
if (dec.name === "Input") {
|
if (dec.name === "Input") {
|
||||||
this.isInput = true;
|
this.isInput = true;
|
||||||
|
|
||||||
/*
|
|
||||||
if (dec.arguments) {
|
if (dec.arguments) {
|
||||||
let bindingName = dec.arguments["bindingPropertyName"];
|
let bindingName = dec.arguments["bindingPropertyName"];
|
||||||
console.log(JSON.stringify(dec.arguments));
|
//console.log(JSON.stringify(dec.arguments));
|
||||||
|
|
||||||
if (bindingName && (bindingName !== ""))
|
if (bindingName && (bindingName !== ""))
|
||||||
this.name = bindingName;
|
this.name = bindingName.replace(/['"]/g, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (!this.docText && !this.isDeprecated)
|
if (!this.docText && !this.isDeprecated)
|
||||||
console.log(`Warning: Input "${rawProp.getFullName()}" has no doc text.`);
|
console.log(`Warning: Input "${rawProp.getFullName()}" has no doc text.`);
|
||||||
}
|
}
|
||||||
@ -181,8 +181,9 @@ class ComponentInfo {
|
|||||||
|
|
||||||
constructor(classRef: DeclarationReflection) {
|
constructor(classRef: DeclarationReflection) {
|
||||||
let props = classRef.getChildrenByKind(ReflectionKind.Property);
|
let props = classRef.getChildrenByKind(ReflectionKind.Property);
|
||||||
|
let accessors = classRef.getChildrenByKind(ReflectionKind.Accessor);
|
||||||
this.properties = props.map(item => {
|
|
||||||
|
this.properties = [...props, ...accessors].map(item => {
|
||||||
return new PropInfo(item);
|
return new PropInfo(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -214,11 +215,14 @@ class ComponentInfo {
|
|||||||
export function initPhase(aggData) {
|
export function initPhase(aggData) {
|
||||||
let app = new Application({
|
let app = new Application({
|
||||||
exclude: excludePatterns,
|
exclude: excludePatterns,
|
||||||
ignoreCompilerErrors: true
|
ignoreCompilerErrors: true,
|
||||||
|
experimentalDecorators: true,
|
||||||
|
tsconfig: "tsconfig.json"
|
||||||
});
|
});
|
||||||
|
|
||||||
let sources = app.expandInputFiles(libFolders);
|
let sources = app.expandInputFiles(libFolders);
|
||||||
aggData.projData = app.convert(sources);
|
aggData.projData = app.convert(sources);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
aggData.liq = liquid({
|
aggData.liq = liquid({
|
||||||
root: templateFolder
|
root: templateFolder
|
||||||
@ -247,7 +251,9 @@ export function updatePhase(tree, pathname, aggData) {
|
|||||||
let template = combyne(templateSource);
|
let template = combyne(templateSource);
|
||||||
|
|
||||||
let mdText = template.render(compData);
|
let mdText = template.render(compData);
|
||||||
let newSection = remark().parse(mdText.trim()).children;
|
mdText = mdText.replace(/^ +\|/mg, "|");
|
||||||
|
|
||||||
|
let newSection = remark().data("settings", {paddedTable: false, gfm: false}).parse(mdText.trim()).children;
|
||||||
|
|
||||||
replaceSection(tree, "Class members", (before, section, after) => {
|
replaceSection(tree, "Class members", (before, section, after) => {
|
||||||
newSection.unshift(before);
|
newSection.unshift(before);
|
||||||
@ -276,7 +282,7 @@ export function updatePhase(tree, pathname, aggData) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
function renderInputs(comp: ComponentInfo): string {
|
function renderInputs(comp: ComponentInfo): string {
|
||||||
var result = "";
|
var result = "";
|
||||||
|
|
||||||
@ -286,6 +292,7 @@ function renderInputs(comp: ComponentInfo): string {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
function initialCap(str: string) {
|
function initialCap(str: string) {
|
||||||
return str[0].toUpperCase() + str.substr(1);
|
return str[0].toUpperCase() + str.substr(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user