Skip to content

CustomTagInputComponent

reference
1 min readUpdated

Kind: Class

Source: Frontend/src/app/components/shared/dropdown/custom-tag-input/custom-tag-input.component.ts (line 10)

Part of: Frontend

CustomTagInputComponent manages tag selection through a dropdown interface, including selecting, unselecting, and checking available selections. It also handles Enter-key actions, contact creation, popup opening, and dropdown visibility within the shared dropdown UI.

Implements: OnInit

Methods

MethodSignatureReturns
closeDropdowncloseDropdown(e: undefined)void
toggoleDropdowntoggoleDropdown()void
enterPressedenterPressed(value: undefined)void
selectingselecting(dataRow: undefined)void
unSelectingunSelecting(dataRow: undefined)void
ngOnInitngOnInit()void
isAvailableSelectionisAvailableSelection()void
IsSelectedIsSelected(dataRow: undefined)void
createNewContactcreateNewContact(dataRow: SelectedTags)void
openPopupopenPopup(n: string, t: string, i: string)void
OnOpenedPopupOnOpenedPopup()void
closePOpUpclosePOpUp()void
saveFromPopupsaveFromPopup()void
finalizeContactSavingfinalizeContactSaving(e: ContactPersons)void

Properties

PropertyType
dataSourceany[]
_valuestring
accountIdnumber
readOnlyboolean
selectedSelectedTags[]
customTagInputElementRef
tagInputHolderElementRef
sharedPopupSharedPopupComponent
contactComponentContactViewEditComponent
tagInputElementRef
customTagInputDropdownboolean
ItemAddedany
ItemRemovedany
validatedEmailany
popupany
tempEmailSelectedTags
tempContactPersonContactPersons

Where it refuses work

  • CustomTagInputComponent stops the work with an early return when n == this.dataSource.length.
  • CustomTagInputComponent stops the work with an early return when this.selected[i].display == dataRow.display.

Diagram

mermaid
graph LR
  User[User interaction] --> Component[CustomTagInputComponent]
  Component --> Toggle[toggoleDropdown]
  Component --> Close[closeDropdown]
  Component --> Select[selecting]
  Component --> Unselect[unSelecting]
  Component --> Check[isAvailableSelection]
  Component --> Selected[IsSelected]
  Component --> Enter[enterPressed]
  Enter --> Create[createNewContact]
  Component --> Popup[openPopup]

Usage

ts
import { CustomTagInputComponent } from './custom-tag-input.component';

function handleTagInput(component: CustomTagInputComponent): void {
  component.toggoleDropdown();

  if (component.isAvailableSelection()) {
    component.selecting();
  }

  component.enterPressed();
  component.closeDropdown();
}

AI Coding Instructions

  • Preserve the existing toggoleDropdown() method name when calling or modifying it, even though its spelling differs from toggle.
  • Keep selection changes inside selecting() and unSelecting() so dropdown and tag state remain coordinated.
  • Check isAvailableSelection() and IsSelected() before adding or removing selections.
  • Route Enter-key behavior through enterPressed() rather than duplicating contact-creation logic in event handlers.
  • Use openPopup() for contact-related popup interactions and keep createNewContact() focused on creating the contact.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • TranslateHandlerFrontend/src/app/components/shared/shared.module.ts:1

Was this page helpful?

Download as PDF