diff --git a/projects/common/components/compound-elements/cloze/cloze-child-elements/text-field-simple.component.ts b/projects/common/components/compound-elements/cloze/cloze-child-elements/text-field-simple.component.ts index 6a6185313416ae56e148e5c2de70bcaf92a8a028..8783a49eb176425915eab58489440c4970b643b5 100644 --- a/projects/common/components/compound-elements/cloze/cloze-child-elements/text-field-simple.component.ts +++ b/projects/common/components/compound-elements/cloze/cloze-child-elements/text-field-simple.component.ts @@ -27,8 +27,8 @@ import { [formControl]="elementFormControl" [value]="elementModel.value" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" - (focus)="textInputExpected.emit({ inputElement: input, focused: true })" - (blur)="textInputExpected.emit({ inputElement: input, focused: false })"> + (focus)="focusChanged.emit({ inputElement: input, focused: true })" + (blur)="focusChanged.emit({ inputElement: input, focused: false })"> `, styles: [ '.clozeChild {border: 1px solid rgba(0,0,0,.12); border-radius: 5px}', @@ -38,5 +38,5 @@ import { export class TextFieldSimpleComponent extends FormElementComponent { @Input() elementModel!: TextFieldSimpleElement; @Output() hardwareKeyDetected = new EventEmitter(); - @Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); + @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); } diff --git a/projects/common/components/input-elements/spell-correct.component.ts b/projects/common/components/input-elements/spell-correct.component.ts index d467c5b6a8baa0fca6050d4da40dc7dba0adbbf5..87301ec38d8532af2c92e591ba79216c3628b74d 100644 --- a/projects/common/components/input-elements/spell-correct.component.ts +++ b/projects/common/components/input-elements/spell-correct.component.ts @@ -32,8 +32,8 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell [style.text-decoration]="elementModel.styling.underline ? 'underline' : ''" [formControl]="elementFormControl" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" - (focus)="textInputExpected.emit({ inputElement: input, focused: true })" - (blur)="textInputExpected.emit({ inputElement: input, focused: false })"> + (focus)="focusChanged.emit({ inputElement: input, focused: true })" + (blur)="focusChanged.emit({ inputElement: input, focused: false })"> </mat-form-field> <button #buttonElement mat-button @@ -67,7 +67,7 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell }) export class SpellCorrectComponent extends FormElementComponent { @Input() elementModel!: SpellCorrectElement; - @Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); + @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() hardwareKeyDetected = new EventEmitter(); @ViewChild(MatInput) inputElement!: MatInput; } diff --git a/projects/common/components/input-elements/text-area.component.ts b/projects/common/components/input-elements/text-area.component.ts index 2f8c708bd864283ac42367b793e8b41293790f7a..257ae1c6655fdb113f2afba04f83ac5b6c0a0328 100644 --- a/projects/common/components/input-elements/text-area.component.ts +++ b/projects/common/components/input-elements/text-area.component.ts @@ -35,8 +35,8 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area [style.line-height.%]="elementModel.styling.lineHeight" [style.resize]="elementModel.resizeEnabled ? 'both' : 'none'" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" - (focus)="textInputExpected.emit({ inputElement: input, focused: true })" - (blur)="textInputExpected.emit({ inputElement: input, focused: false })"> + (focus)="focusChanged.emit({ inputElement: input, focused: true })" + (blur)="focusChanged.emit({ inputElement: input, focused: false })"> </textarea> <mat-error *ngIf="elementFormControl.errors"> {{elementFormControl.errors | errorTransform: elementModel}} @@ -50,6 +50,6 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area }) export class TextAreaComponent extends FormElementComponent { @Input() elementModel!: TextAreaElement; - @Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); + @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() hardwareKeyDetected = new EventEmitter(); } diff --git a/projects/common/components/input-elements/text-field.component.ts b/projects/common/components/input-elements/text-field.component.ts index 3374fb2405c8471bca6fd9290337407bfae17f51..27cc28db3db6d9c59d3f33addd6235ab4f32bea0 100644 --- a/projects/common/components/input-elements/text-field.component.ts +++ b/projects/common/components/input-elements/text-field.component.ts @@ -31,8 +31,8 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie [pattern]="$any(elementModel.pattern)" [readonly]="elementModel.readOnly" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" - (focus)="textInputExpected.emit({ inputElement: input, focused: true })" - (blur)="textInputExpected.emit({ inputElement: input, focused: false })"> + (focus)="focusChanged.emit({ inputElement: input, focused: true })" + (blur)="focusChanged.emit({ inputElement: input, focused: false })"> <button *ngIf="elementModel.clearable" type="button" matSuffix mat-icon-button aria-label="Clear" @@ -52,5 +52,5 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie export class TextFieldComponent extends FormElementComponent { @Input() elementModel!: TextFieldElement; @Output() hardwareKeyDetected = new EventEmitter(); - @Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); + @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); } diff --git a/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts b/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts index af4d9657d4eaa870e74b17b29ffb6cefafebada3..536880f5f0dc3a443cdf49f31881a217c752f4fd 100644 --- a/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts +++ b/projects/player/src/app/components/elements/compound-group-element/compound-group-element.component.ts @@ -74,7 +74,7 @@ export class CompoundGroupElementComponent extends ElementFormGroupDirective imp private manageKeyInputToggling(textFieldSimpleComponent: TextFieldSimpleComponent, elementModel: InputElement): void { (textFieldSimpleComponent) - .textInputExpected + .focusChanged .pipe(takeUntil(this.ngUnsubscribe)) .subscribe(focusedTextInput => { this.toggleKeyInput(focusedTextInput, textFieldSimpleComponent, elementModel); diff --git a/projects/player/src/app/components/elements/text-input-group-element/text-input-group-element.component.html b/projects/player/src/app/components/elements/text-input-group-element/text-input-group-element.component.html index fb75e4335bca43dac2ae06631c8335024c07cc40..4d4e116eab76ee7bde9aa50da601db7b82ff27d0 100644 --- a/projects/player/src/app/components/elements/text-input-group-element/text-input-group-element.component.html +++ b/projects/player/src/app/components/elements/text-input-group-element/text-input-group-element.component.html @@ -6,7 +6,7 @@ [parentForm]="form" [elementModel]="elementModel | cast: TextAreaElement" (hardwareKeyDetected)="detectHardwareKeyboard()" - (textInputExpected)="toggleKeyInput($event, elementComponent)"> + (focusChanged)="toggleKeyInput($event, elementComponent)"> </aspect-text-area> <aspect-text-field *ngIf="elementModel.type === 'text-field'" @@ -14,7 +14,7 @@ [parentForm]="form" [elementModel]="elementModel | cast: TextFieldElement" (hardwareKeyDetected)="detectHardwareKeyboard()" - (textInputExpected)="toggleKeyInput($event, elementComponent)"> + (focusChanged)="toggleKeyInput($event, elementComponent)"> </aspect-text-field> <aspect-spell-correct *ngIf="elementModel.type === 'spell-correct'" @@ -22,7 +22,7 @@ [parentForm]="form" [elementModel]="elementModel | cast: SpellCorrectElement" (hardwareKeyDetected)="detectHardwareKeyboard()" - (textInputExpected)="toggleKeyInput($event, elementComponent)"> + (focusChanged)="toggleKeyInput($event, elementComponent)"> </aspect-spell-correct> </form>