Skip to content

Commit

Permalink
Fixed #15693 | TreeSelect: use Chip component
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed May 24, 2024
1 parent 9a944f7 commit f76316c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/components/treeselect/treeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
import { Nullable } from 'primeng/ts-helpers';
import { AutoFocusModule } from 'primeng/autofocus';
import { TreeSelectNodeCollapseEvent, TreeSelectNodeExpandEvent } from './treeselect.interface';
import { ChipModule } from 'primeng/chip';

export const TREESELECT_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand Down Expand Up @@ -76,8 +77,8 @@ export const TREESELECT_VALUE_ACCESSOR: any = {
{{ label || 'empty' }}
</ng-container>
<ng-template #chipsValueTemplate>
<div *ngFor="let node of value" class="p-treeselect-token">
<span class="p-treeselect-token-label">{{ node.label }}</span>
<div *ngFor="let node of value" class="p-treeselect-chip-item">
<p-chip [label]="node.label" styleClass="p-treeselect-chip" />
</div>
<ng-container *ngIf="emptyValue">{{ placeholder || 'empty' }}</ng-container>
</ng-template>
Expand Down Expand Up @@ -1006,7 +1007,7 @@ export class TreeSelect implements AfterContentInit {
}

@NgModule({
imports: [CommonModule, OverlayModule, RippleModule, SharedModule, TreeModule, AutoFocusModule, SearchIcon, TimesIcon, ChevronDownIcon],
imports: [CommonModule, OverlayModule, RippleModule, SharedModule, TreeModule, AutoFocusModule, SearchIcon, TimesIcon, ChevronDownIcon, ChipModule],
exports: [TreeSelect, OverlayModule, SharedModule, TreeModule],
declarations: [TreeSelect]
})
Expand Down

0 comments on commit f76316c

Please sign in to comment.