File

src/lib/presets/presets.component.ts

Implements

OnInit OnChanges

Metadata

Index

Properties
Methods
Inputs
Outputs

Inputs

presetGroups
Type : IPreset[]
Required :  true

The incoming presetGroups to find with the activePresetName the necessary preset.

Outputs

presetInteractions
Type : string

EventEmitter for the interactions with the preset.

Methods

accessDeletePreset
accessDeletePreset(bool: boolean, groupName: string, presetName: string, event: MouseEvent)

A button to confirm to delete of a preset is shown.

Parameters :
Name Type Optional Description
bool boolean No

Determines if the button is shown or not.

groupName string No

The name of the group.

presetName string No

The name of the preset.

event MouseEvent No

The mouse event.

Returns : void
changeEditState
changeEditState(event: MouseEvent, nextState: boolean)

Handling the change in the edit state if clicked on all elements except the text area.

Parameters :
Name Type Optional Description
event MouseEvent No

The mouse event.

nextState boolean No

The next state of the edit state.

Returns : void
changePresetVisibility
changePresetVisibility(bool: boolean, groupName: string, presetName: string, presetIdentifier: string)

Check and save the visibility of the preset.

Parameters :
Name Type Optional Description
bool boolean No

The visibility of the preset.

groupName string No

The name of the group.

presetName string No

The name of the preset.

presetIdentifier string No

The identifier of the preset.

Returns : void
checkAndRenamePreset
checkAndRenamePreset(event: Event, group: string, optionName: string, inputText: string, presetIdentifier: string)

Handling the enter press during the renaming of a preset.

Parameters :
Name Type Optional Description
event Event No

The keyboard event.

group string No

The group of the presets.

optionName string No

The name of the preset.

inputText string No

The text of the input.

presetIdentifier string No

The identifier of the preset.

Returns : void
clickTextAreaName
clickTextAreaName(event: MouseEvent, presetIndex: number, groupIndex: number)

Handling of a click on the text area of a preset name. Stops propagation if the preset is currently edited.

Parameters :
Name Type Optional Description
event MouseEvent No

The mouse event.

presetIndex number No

The index of the preset.

groupIndex number No

The index of the group.

Returns : void
deletePreset
deletePreset(groupName: string, presetName: string, presetIdentifier: string, event: MouseEvent)

Delete presets and emit it to the presets.

Parameters :
Name Type Optional Description
groupName string No

The name of the group that contains the preset.

presetName string No

The name of the preset that will be deleted.

presetIdentifier string No

The identifier of the preset.

event MouseEvent No

The mouse event.

Returns : void
getDisabledHiddenActions
getDisabledHiddenActions(groupIndex: number)

Returns the disabled and hidden actions for the group.

Parameters :
Name Type Optional Description
groupIndex number No

The index of the group.

onAccordionAction
onAccordionAction(action: TInboxAccordionActions, group: IPreset)

Handles the accordion action.

Parameters :
Name Type Optional Description
action TInboxAccordionActions No

The accordion action.

group IPreset No

The group.

Returns : void
renamingPreset
renamingPreset(groupName: string, oldPresetName: string, newPresetName: string, presetIdentifier: string)

To change the name of a preset and make only one preset editable.

Parameters :
Name Type Optional Description
groupName string No

The name of the group.

oldPresetName string No

The old name of the preset.

newPresetName string No

The new name of the preset.

presetIdentifier string No

The identifier of the preset.

Returns : void
setTextAreaAsEditable
setTextAreaAsEditable(groupIndex: number, presetIndex: number, event: Event)

Presets are readonly by default. Only if the preset is edited, the preset is editable.

Parameters :
Name Type Optional Description
groupIndex number No

The index of the group.

presetIndex number No

The index of the preset.

event Event No

The mouse event.

Returns : void
updatePresetGroupPosition
updatePresetGroupPosition(groupName: string, groupIdentifier: string, direction: "up" | "down")

To change the array place of presets.

Parameters :
Name Type Optional Description
groupName string No

The name of the group.

groupIdentifier string No

The identifier of the group.

direction "up" | "down" No

The direction of the movement.

Returns : void
updatePresetPosition
updatePresetPosition(groupName: string, preset: IPreset, direction: "up" | "down")

To change the array place of presets.

Parameters :
Name Type Optional Description
groupName string No

The name of the group.

preset IPreset No

The preset that will be moved.

direction "up" | "down" No

The direction of the movement.

Returns : void

Properties

activePresetName
Type : []
Default value : ['', '']

Name of the active preset.

dragAndDropDisabled
Type : unknown
Default value : false

Value if the drag and drop is disabled, if the preset is edited through name change and deletion process.

editState
Type : unknown
Default value : new BehaviorSubject(false)

BehaviorSubject for edit state if a preset is currently edited and the other should not be interactable.

indexOfPresetGroupInEditing
Type : number
Default value : 0

The index of the group that is currently edited corresponding with the order in the presetGroups.

indexOfPresetInEditing
Type : number
Default value : 0

The index of the preset that is currently edited corresponding with the order in the presetGroups.

originalPresetGroupNames
Type : literal type[]
Default value : []

This array will store the extracted values from the presetGroups.

showDeleteButton
Type : Map<string | boolean>
Default value : new Map<string, boolean>()

In many scenarios, the delete button int the preset menu should be hidden. This map stores the information if the delete button should be shown or not.

results matching ""

    No results matching ""