mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6150] Add category selector dialog (#9423)
* [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
This commit is contained in:
committed by
GitHub
parent
00404a3807
commit
c642d0e5c2
@@ -19,6 +19,7 @@ Component allows to both assign/unassign categories to content and create multip
|
||||
[parentId]="parentId"
|
||||
[managementMode]="categoriesManagementMode"
|
||||
[classifiableChanged]="classifiableChanged"
|
||||
[multiSelect]="multiSelect"
|
||||
(categoriesChange)="storeCategoriesToAssign($event)">
|
||||
</adf-categories-management>
|
||||
```
|
||||
@@ -35,6 +36,7 @@ Component allows to both assign/unassign categories to content and create multip
|
||||
| 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
|
||||
|
||||
|
58
docs/content-services/dialogs/category-selector.dialog.md
Normal file
58
docs/content-services/dialogs/category-selector.dialog.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
Title: Category selector dialog component
|
||||
Added: v6.8.0
|
||||
Status: Active
|
||||
Last reviewed: 2024-03-12
|
||||
---
|
||||
|
||||
# [Category selector dialog component](../../../lib/content-services/src/lib/dialogs/category-selector.dialog.ts "Defined in category-selector.dialog.ts")
|
||||
|
||||
Allows the user to select one or multiple categories.
|
||||
|
||||

|
||||
|
||||
## Dialog inputs
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- |-----------| ------------- | ----------- |
|
||||
| select | [`Subject<Category[]>`](https://github.com/Alfresco/alfresco-ng2-components/blob/develop/lib/js-api/src/api/content-rest-api/docs/CategoriesApi.md) | | Emits an array of selected categories when the dialog closes |
|
||||
| multiSelect | `boolean` | `true` | (optional) Toggles multiselect mode |
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```ts
|
||||
constructor(private dialog: MatDialog) {}
|
||||
|
||||
...
|
||||
|
||||
function openCatDialog() {
|
||||
const data: CategorySelectorDialogOptions = {
|
||||
select: new Subject<Category[]>(),
|
||||
multiSelect: false
|
||||
};
|
||||
|
||||
this.dialog.open(CategorySelectorDialogComponent, {
|
||||
data,
|
||||
width: '400px'
|
||||
});
|
||||
|
||||
data.select.subscribe(
|
||||
(selections: Category[]) => {
|
||||
...
|
||||
}
|
||||
);
|
||||
}
|
||||
```
|
||||
All the results will be streamed to the select [subject](http://reactivex.io/rxjs/manual/overview.html#subject) present in the `CategorySelectorDialogOptions` object passed to the dialog.
|
||||
When the category is selected by clicking the `Select` button, the `options.select` stream will be completed.
|
||||
|
||||
## Details
|
||||
|
||||
This component lets the user select categories. Use the
|
||||
Angular [`MatDialog`](https://material.angular.io/components/dialog/overview)
|
||||
service to open the dialog, as shown in the example, and pass a `options` object
|
||||
with properties.
|
||||
|
||||
## See also
|
||||
|
||||
- [Categories management component](../components/categories-management.component.md)
|
Reference in New Issue
Block a user