Browse Source

Merge branch 'master' into feature_permissions

pull/332/head
Sebastian Stehle 7 years ago
parent
commit
032cb3cd59
  1. 1
      .gitignore
  2. 2
      src/Squidex/app/features/schemas/pages/schema/field-wizard.component.ts
  3. 2
      src/Squidex/app/framework/angular/forms/iframe-editor.component.ts
  4. 4
      src/Squidex/app/framework/angular/forms/slider.component.ts
  5. 3
      src/Squidex/app/framework/angular/forms/tag-editor.component.html
  6. 49
      src/Squidex/app/framework/angular/forms/tag-editor.component.ts
  7. 4
      src/Squidex/app/framework/angular/modals/modal-dialog.component.ts
  8. 2
      src/Squidex/app/framework/angular/panel.component.ts

1
.gitignore

@ -7,6 +7,7 @@
.awCache .awCache
.vscode .vscode
.awcache
# Build results # Build results
bin/ bin/

2
src/Squidex/app/features/schemas/pages/schema/field-wizard.component.ts

@ -24,7 +24,7 @@ import {
}) })
export class FieldWizardComponent implements OnInit { export class FieldWizardComponent implements OnInit {
@ViewChild('nameInput') @ViewChild('nameInput')
public nameInput: ElementRef; public nameInput: ElementRef<HTMLElement>;
@Input() @Input()
public schema: SchemaDetailsDto; public schema: SchemaDetailsDto;

2
src/Squidex/app/framework/angular/forms/iframe-editor.component.ts

@ -32,7 +32,7 @@ export class IFrameEditorComponent implements ControlValueAccessor, AfterViewIni
private plugin: HTMLIFrameElement; private plugin: HTMLIFrameElement;
@ViewChild('iframe') @ViewChild('iframe')
public iframe: ElementRef; public iframe: ElementRef<HTMLIFrameElement>;
@Input() @Input()
public set url(value: string) { public set url(value: string) {

4
src/Squidex/app/framework/angular/forms/slider.component.ts

@ -32,10 +32,10 @@ export class SliderComponent implements ControlValueAccessor {
private isDragging = false; private isDragging = false;
@ViewChild('bar') @ViewChild('bar')
public bar: ElementRef; public bar: ElementRef<Element>;
@ViewChild('thumb') @ViewChild('thumb')
public thumb: ElementRef; public thumb: ElementRef<Element>;
@Input() @Input()
public min = 0; public min = 0;

3
src/Squidex/app/framework/angular/forms/tag-editor.component.html

@ -9,6 +9,9 @@
<input type="text" class="blank" #input <input type="text" class="blank" #input
(blur)="markTouched()" (blur)="markTouched()"
(cut)="onCut($event)"
(copy)="onCopy($event)"
(paste)="onPaste($event)"
(focus)="focus()" (focus)="focus()"
(keydown)="onKeyDown($event)" (keydown)="onKeyDown($event)"
[formControl]="addInput" [formControl]="addInput"

49
src/Squidex/app/framework/angular/forms/tag-editor.component.ts

@ -115,10 +115,10 @@ export class TagEditorComponent implements AfterViewInit, ControlValueAccessor,
public inputName = 'tag-editor'; public inputName = 'tag-editor';
@ViewChild('form') @ViewChild('form')
public formElement: ElementRef; public formElement: ElementRef<Element>;
@ViewChild('input') @ViewChild('input')
public inputElement: ElementRef; public inputElement: ElementRef<HTMLInputElement>;
public hasFocus = false; public hasFocus = false;
@ -340,6 +340,51 @@ export class TagEditorComponent implements AfterViewInit, ControlValueAccessor,
this.selectIndex(this.suggestedIndex + 1); this.selectIndex(this.suggestedIndex + 1);
} }
public onCut(event: ClipboardEvent) {
if (!this.hasSelection()) {
this.onCopy(event);
this.updateItems([]);
}
}
public onCopy(event: ClipboardEvent) {
if (!this.hasSelection()) {
event.clipboardData.setData('text/plain', this.items.filter(x => !!x).join(','));
event.preventDefault();
}
}
public onPaste(event: ClipboardEvent) {
const value = event.clipboardData.getData('text/plain');
if (value) {
this.resetForm();
const values = [...this.items];
for (let part of value.split(',')) {
const converted = this.converter.convert(part);
if (converted) {
values.push(converted);
}
}
this.updateItems(values);
}
event.preventDefault();
}
private hasSelection() {
const s = this.inputElement.nativeElement.selectionStart;
const e = this.inputElement.nativeElement.selectionEnd;
return s && e && (e - s) > 0;
}
private updateItems(items: any[]) { private updateItems(items: any[]) {
this.items = items; this.items = items;

4
src/Squidex/app/framework/angular/modals/modal-dialog.component.ts

@ -47,10 +47,10 @@ export class ModalDialogComponent implements AfterViewInit {
public closed = new EventEmitter(); public closed = new EventEmitter();
@ViewChild('tabsElement') @ViewChild('tabsElement')
public tabsElement: ElementRef; public tabsElement: ElementRef<ParentNode>;
@ViewChild('footerElement') @ViewChild('footerElement')
public footerElement: ElementRef; public footerElement: ElementRef<ParentNode>;
public hasTabs = false; public hasTabs = false;
public hasFooter = false; public hasFooter = false;

2
src/Squidex/app/framework/angular/panel.component.ts

@ -59,7 +59,7 @@ export class PanelComponent implements AfterViewInit, OnDestroy, OnInit {
public sidebarClass = ''; public sidebarClass = '';
@ViewChild('panel') @ViewChild('panel')
public panel: ElementRef; public panel: ElementRef<HTMLElement>;
constructor( constructor(
private readonly container: PanelContainerDirective, private readonly container: PanelContainerDirective,

Loading…
Cancel
Save