Skip to content
Snippets Groups Projects
Commit 72f76ffc authored by jojohoch's avatar jojohoch
Browse files

[player] Rename event 'textInputExpected' to 'focusChanged'

parent fe335db9
No related branches found
No related tags found
No related merge requests found
Pipeline #38335 failed
...@@ -27,8 +27,8 @@ import { ...@@ -27,8 +27,8 @@ import {
[formControl]="elementFormControl" [formControl]="elementFormControl"
[value]="elementModel.value" [value]="elementModel.value"
(keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null"
(focus)="textInputExpected.emit({ inputElement: input, focused: true })" (focus)="focusChanged.emit({ inputElement: input, focused: true })"
(blur)="textInputExpected.emit({ inputElement: input, focused: false })"> (blur)="focusChanged.emit({ inputElement: input, focused: false })">
`, `,
styles: [ styles: [
'.clozeChild {border: 1px solid rgba(0,0,0,.12); border-radius: 5px}', '.clozeChild {border: 1px solid rgba(0,0,0,.12); border-radius: 5px}',
...@@ -38,5 +38,5 @@ import { ...@@ -38,5 +38,5 @@ import {
export class TextFieldSimpleComponent extends FormElementComponent { export class TextFieldSimpleComponent extends FormElementComponent {
@Input() elementModel!: TextFieldSimpleElement; @Input() elementModel!: TextFieldSimpleElement;
@Output() hardwareKeyDetected = new EventEmitter(); @Output() hardwareKeyDetected = new EventEmitter();
@Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>();
} }
...@@ -32,8 +32,8 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell ...@@ -32,8 +32,8 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell
[style.text-decoration]="elementModel.styling.underline ? 'underline' : ''" [style.text-decoration]="elementModel.styling.underline ? 'underline' : ''"
[formControl]="elementFormControl" [formControl]="elementFormControl"
(keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null"
(focus)="textInputExpected.emit({ inputElement: input, focused: true })" (focus)="focusChanged.emit({ inputElement: input, focused: true })"
(blur)="textInputExpected.emit({ inputElement: input, focused: false })"> (blur)="focusChanged.emit({ inputElement: input, focused: false })">
</mat-form-field> </mat-form-field>
<button #buttonElement <button #buttonElement
mat-button mat-button
...@@ -67,7 +67,7 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell ...@@ -67,7 +67,7 @@ import { SpellCorrectElement } from 'common/models/elements/input-elements/spell
}) })
export class SpellCorrectComponent extends FormElementComponent { export class SpellCorrectComponent extends FormElementComponent {
@Input() elementModel!: SpellCorrectElement; @Input() elementModel!: SpellCorrectElement;
@Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>();
@Output() hardwareKeyDetected = new EventEmitter(); @Output() hardwareKeyDetected = new EventEmitter();
@ViewChild(MatInput) inputElement!: MatInput; @ViewChild(MatInput) inputElement!: MatInput;
} }
...@@ -35,8 +35,8 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area ...@@ -35,8 +35,8 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area
[style.line-height.%]="elementModel.styling.lineHeight" [style.line-height.%]="elementModel.styling.lineHeight"
[style.resize]="elementModel.resizeEnabled ? 'both' : 'none'" [style.resize]="elementModel.resizeEnabled ? 'both' : 'none'"
(keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null"
(focus)="textInputExpected.emit({ inputElement: input, focused: true })" (focus)="focusChanged.emit({ inputElement: input, focused: true })"
(blur)="textInputExpected.emit({ inputElement: input, focused: false })"> (blur)="focusChanged.emit({ inputElement: input, focused: false })">
</textarea> </textarea>
<mat-error *ngIf="elementFormControl.errors"> <mat-error *ngIf="elementFormControl.errors">
{{elementFormControl.errors | errorTransform: elementModel}} {{elementFormControl.errors | errorTransform: elementModel}}
...@@ -50,6 +50,6 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area ...@@ -50,6 +50,6 @@ import { TextAreaElement } from 'common/models/elements/input-elements/text-area
}) })
export class TextAreaComponent extends FormElementComponent { export class TextAreaComponent extends FormElementComponent {
@Input() elementModel!: TextAreaElement; @Input() elementModel!: TextAreaElement;
@Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>();
@Output() hardwareKeyDetected = new EventEmitter(); @Output() hardwareKeyDetected = new EventEmitter();
} }
...@@ -31,8 +31,8 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie ...@@ -31,8 +31,8 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie
[pattern]="$any(elementModel.pattern)" [pattern]="$any(elementModel.pattern)"
[readonly]="elementModel.readOnly" [readonly]="elementModel.readOnly"
(keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null" (keydown)="elementModel.showSoftwareKeyboard ? hardwareKeyDetected.emit() : null"
(focus)="textInputExpected.emit({ inputElement: input, focused: true })" (focus)="focusChanged.emit({ inputElement: input, focused: true })"
(blur)="textInputExpected.emit({ inputElement: input, focused: false })"> (blur)="focusChanged.emit({ inputElement: input, focused: false })">
<button *ngIf="elementModel.clearable" <button *ngIf="elementModel.clearable"
type="button" type="button"
matSuffix mat-icon-button aria-label="Clear" matSuffix mat-icon-button aria-label="Clear"
...@@ -52,5 +52,5 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie ...@@ -52,5 +52,5 @@ import { TextFieldElement } from 'common/models/elements/input-elements/text-fie
export class TextFieldComponent extends FormElementComponent { export class TextFieldComponent extends FormElementComponent {
@Input() elementModel!: TextFieldElement; @Input() elementModel!: TextFieldElement;
@Output() hardwareKeyDetected = new EventEmitter(); @Output() hardwareKeyDetected = new EventEmitter();
@Output() textInputExpected = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>(); @Output() focusChanged = new EventEmitter<{ inputElement: HTMLElement; focused: boolean }>();
} }
...@@ -74,7 +74,7 @@ export class CompoundGroupElementComponent extends ElementFormGroupDirective imp ...@@ -74,7 +74,7 @@ export class CompoundGroupElementComponent extends ElementFormGroupDirective imp
private manageKeyInputToggling(textFieldSimpleComponent: TextFieldSimpleComponent, elementModel: InputElement): void { private manageKeyInputToggling(textFieldSimpleComponent: TextFieldSimpleComponent, elementModel: InputElement): void {
(textFieldSimpleComponent) (textFieldSimpleComponent)
.textInputExpected .focusChanged
.pipe(takeUntil(this.ngUnsubscribe)) .pipe(takeUntil(this.ngUnsubscribe))
.subscribe(focusedTextInput => { .subscribe(focusedTextInput => {
this.toggleKeyInput(focusedTextInput, textFieldSimpleComponent, elementModel); this.toggleKeyInput(focusedTextInput, textFieldSimpleComponent, elementModel);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: TextAreaElement" [elementModel]="elementModel | cast: TextAreaElement"
(hardwareKeyDetected)="detectHardwareKeyboard()" (hardwareKeyDetected)="detectHardwareKeyboard()"
(textInputExpected)="toggleKeyInput($event, elementComponent)"> (focusChanged)="toggleKeyInput($event, elementComponent)">
</aspect-text-area> </aspect-text-area>
<aspect-text-field <aspect-text-field
*ngIf="elementModel.type === 'text-field'" *ngIf="elementModel.type === 'text-field'"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: TextFieldElement" [elementModel]="elementModel | cast: TextFieldElement"
(hardwareKeyDetected)="detectHardwareKeyboard()" (hardwareKeyDetected)="detectHardwareKeyboard()"
(textInputExpected)="toggleKeyInput($event, elementComponent)"> (focusChanged)="toggleKeyInput($event, elementComponent)">
</aspect-text-field> </aspect-text-field>
<aspect-spell-correct <aspect-spell-correct
*ngIf="elementModel.type === 'spell-correct'" *ngIf="elementModel.type === 'spell-correct'"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
[parentForm]="form" [parentForm]="form"
[elementModel]="elementModel | cast: SpellCorrectElement" [elementModel]="elementModel | cast: SpellCorrectElement"
(hardwareKeyDetected)="detectHardwareKeyboard()" (hardwareKeyDetected)="detectHardwareKeyboard()"
(textInputExpected)="toggleKeyInput($event, elementComponent)"> (focusChanged)="toggleKeyInput($event, elementComponent)">
</aspect-spell-correct> </aspect-spell-correct>
</form> </form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment