mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
* [ACS-6150] add category selector dialog * [ACS-6150] fix import * [ACS-6150] cr fix * [ACS-6150] cr fix * [ACS-6150] change describe name * [ACS-6150] linting * [ACS-6150] style fix * [ACS-6150] align styles
47 lines
2.8 KiB
Markdown
47 lines
2.8 KiB
Markdown
---
|
|
Title: Categories management component
|
|
Added: v6.0.0-A.3
|
|
Status: Active
|
|
Last reviewed: 2023-04-07
|
|
---
|
|
|
|
# [Categories management component](../../../lib/content-services/src/lib/category/categories-management/categories-management.component.ts "Defined in categories-management.component.ts")
|
|
|
|
Component allows to both assign/unassign categories to content and create multiple categories depending on selected mode. In assign mode component is composed of: list of categories that will be assigned to a file, input to search for existing categories that user can select and second list under the input containing existing categories that node can be assigned to. In crud mode component is composed of: list of categories that will be created, input to type a name of category that will be created and a list of categories existing under a given parent, in this mode existing categories are not selectable.
|
|
|
|
## Basic Usage
|
|
|
|
```html
|
|
<adf-categories-management
|
|
[(categoryNameControlVisible)]="categoryControlVisible"
|
|
[disableRemoval]="saving"
|
|
[categories]="categories"
|
|
[parentId]="parentId"
|
|
[managementMode]="categoriesManagementMode"
|
|
[classifiableChanged]="classifiableChanged"
|
|
[multiSelect]="multiSelect"
|
|
(categoriesChange)="storeCategoriesToAssign($event)">
|
|
</adf-categories-management>
|
|
```
|
|
|
|
## Class members
|
|
|
|
### Properties
|
|
|
|
| Name | Type | Default value | Description |
|
|
| ---- | ---- | ------------- | ----------- |
|
|
| categories | [`Category`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Category.md)[] | [] | List of categories to assign/create. |
|
|
| categoryNameControlVisible | `boolean` | false | Determines if category name control is visible. |
|
|
| classifiableChanged | [`Observable<void>`](https://rxjs.dev/guide/observable) | | (optional) Observable emitting when `classifiable` aspect changes for a given node. |
|
|
| disableRemoval | `boolean` | false | Determines if categories assigned/created can be unassigned/removed from the list. |
|
|
| managementMode | `CategoriesManagementMode` | | Management mode determines if component works in assign/unassign mode or create mode. |
|
|
| parentId | `string` | | (optional) ID of a parent category that new categories will be created under. |
|
|
| multiSelect | `boolean` | true | (optional) Toggles multiselect mode. |
|
|
|
|
### Events
|
|
|
|
| Name | Type | Description |
|
|
| ---- | ---- | ----------- |
|
|
| categoriesChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Category`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Category.md)`>` | Emitted when categories list changes. |
|
|
| categoryNameControlVisibleChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<boolean>` | Emitted when category name control visibility changes. |
|