Skip to content

Commit 2c3af25

Browse files
authored
chore(tags): added prefix for drag data type (#1113)
1 parent c96462b commit 2c3af25

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/components/tags/tag-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { KbqCleaner, KbqFormFieldControl } from '@koobiq/components/form-field';
3535
import { merge, Observable, Subject, Subscription } from 'rxjs';
3636
import { filter, startWith } from 'rxjs/operators';
3737
import { KbqTagTextControl } from './tag-text-control';
38-
import { KbqDragData, KbqTag, KbqTagEditChange, KbqTagEvent, KbqTagSelectionChange } from './tag.component';
38+
import { KbqTag, KbqTagDragData, KbqTagEditChange, KbqTagEvent, KbqTagSelectionChange } from './tag.component';
3939

4040
// Increasing integer for generating unique ids for tag-list components.
4141
let nextUniqueId = 0;
@@ -876,7 +876,7 @@ export class KbqTagList
876876
this.dropList.dropped
877877
.pipe(takeUntilDestroyed(this.destroyRef))
878878
.subscribe(({ currentIndex, previousIndex, event, item }) => {
879-
const { tag }: KbqDragData = item.data;
879+
const { tag }: KbqTagDragData = item.data;
880880

881881
this.dropped.emit({ currentIndex, previousIndex, event, tag });
882882
});

packages/components/tags/tag.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ const getTagEditInputMissingError = (): Error => {
7171
return Error('Editable kbq-tag must contain a KbqTagEditInput.');
7272
};
7373

74-
/** @docs-private */
75-
export type KbqDragData = {
76-
tag: KbqTag;
77-
};
74+
/**
75+
* Object passed to the drag data event when a tag is being dragged.
76+
*
77+
* @docs-private
78+
*/
79+
export type KbqTagDragData = KbqTagEvent;
7880

7981
/**
8082
* Dummy directive to add CSS class to tag avatar.
@@ -214,7 +216,7 @@ export class KbqTag
214216
{
215217
private readonly focusMonitor = inject(FocusMonitor);
216218
private readonly tagList = inject(KbqTagList, { optional: true });
217-
private readonly drag: CdkDrag<KbqDragData> = inject(CdkDrag, { host: true });
219+
private readonly drag: CdkDrag<KbqTagDragData> = inject(CdkDrag, { host: true });
218220
private readonly destroyRef = inject(DestroyRef);
219221

220222
/** @docs-private */

tools/public_api_guard/components/tags.api.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ import { WritableSignal } from '@angular/core';
4444
// @public
4545
export const KBQ_TAGS_DEFAULT_OPTIONS: InjectionToken<KbqTagsDefaultOptions>;
4646

47-
// @public
48-
export type KbqDragData = {
49-
tag: KbqTag;
50-
};
51-
5247
// @public (undocumented)
5348
export class KbqTag extends KbqColorDirective implements IFocusableOption, OnDestroy, KbqTitleTextRef, AfterContentInit, AfterViewInit {
5449
constructor(changeDetectorRef: ChangeDetectorRef);
@@ -137,6 +132,9 @@ export class KbqTagAvatar {
137132
static ɵfac: i0.ɵɵFactoryDeclaration<KbqTagAvatar, never>;
138133
}
139134

135+
// @public
136+
export type KbqTagDragData = KbqTagEvent;
137+
140138
// @public
141139
export class KbqTagEditChange {
142140
constructor(tag: KbqTag, type: 'start' | 'submit' | 'cancel', reason: string);

0 commit comments

Comments
 (0)