Class: UpdateAnnotationState
@ghentcdh/vue-component-annotated-text / UpdateAnnotationState
Class: UpdateAnnotationState
Defined in: state/states/UpdateAnnotationState.ts:12
Hold a state of an annotation currently being edited, not yet confirmed by the parent component
Annotation
deep copy of the being edited annotation
Constructors
Constructor
new UpdateAnnotationState(
userState
):UpdateAnnotationState
Defined in: state/states/UpdateAnnotationState.ts:24
Parameters
userState
Returns
UpdateAnnotationState
Properties
action
action:
ActionType
Defined in: state/states/UpdateAnnotationState.ts:13
annotation
annotation:
AnnotationInternal
Defined in: state/states/UpdateAnnotationState.ts:15
handlePosition
handlePosition:
number
Defined in: state/states/UpdateAnnotationState.ts:14
newEnd
newEnd:
number
Defined in: state/states/UpdateAnnotationState.ts:19
newStart
newStart:
number
Defined in: state/states/UpdateAnnotationState.ts:20
origAnnotation
origAnnotation:
AnnotationInternal
Defined in: state/states/UpdateAnnotationState.ts:16
origEnd?
optional
origEnd:number
Defined in: state/states/UpdateAnnotationState.ts:17
origStart?
optional
origStart:number
Defined in: state/states/UpdateAnnotationState.ts:18
updating
updating:
boolean
=false
Defined in: state/states/UpdateAnnotationState.ts:21
userState
userState:
UserState
Defined in: state/states/UpdateAnnotationState.ts:22
Methods
confirmStartUpdating()
confirmStartUpdating():
void
Defined in: state/states/UpdateAnnotationState.ts:79
Should get called in order to confirm the initial state of the update.
Returns
void
confirmUpdate()
confirmUpdate():
void
Defined in: state/states/UpdateAnnotationState.ts:91
Needs to be called by the parent component every time annotation-edit-moved is emitted in order to confirm that edit. newStart and newEnd can be edited before calling this in order to manipulate on what annotations have to wrap.
Returns
void
resetUpdate()
resetUpdate():
void
Defined in: state/states/UpdateAnnotationState.ts:32
has to get called after an edit has been confirmed or denied.
Returns
void
startUpdating()
startUpdating(
action
,handlePosition
,annotation
,origEnd
,origStart
,newEnd
,newStart
):void
Defined in: state/states/UpdateAnnotationState.ts:57
Gets called by the component when an edit it started. Should generally not be called by the parent component.
Parameters
action
handlePosition
number
annotation
AnnotationInternal
origEnd
number
= null
origStart
number
= null
newEnd
number
newStart
number
Returns
void