|
| 1 | +import { QProgressBar } from '@nodegui/nodegui'; |
| 2 | +import { NgComponent } from './component'; |
| 3 | +import { RendererStyleFlags2 } from '@angular/core'; |
| 4 | + |
| 5 | +export class NgProgressBar extends QProgressBar implements NgComponent { |
| 6 | + public static nodeName = 'progressbar'; |
| 7 | + public parent: any; |
| 8 | + |
| 9 | + public appendChild(newChild: any): void { |
| 10 | + console.warn('progressbar do not have append child'); |
| 11 | + } |
| 12 | + |
| 13 | + public insertBefore(newChild: any, refChild: any) {} |
| 14 | + |
| 15 | + public setNgAttribute( |
| 16 | + name: string, |
| 17 | + value: string, |
| 18 | + namespace?: string | null |
| 19 | + ): void {} |
| 20 | + |
| 21 | + public setProperty(name: string, value: any): void { |
| 22 | + switch (name) { |
| 23 | + case 'value': |
| 24 | + this.setValue(value); |
| 25 | + break; |
| 26 | + case 'minimum': |
| 27 | + this.setMinimum(value); |
| 28 | + break; |
| 29 | + case 'maximum': |
| 30 | + this.setMaximum(value); |
| 31 | + break; |
| 32 | + case 'orientation': |
| 33 | + this.setOrientation(value); |
| 34 | + break; |
| 35 | + case 'enabled': |
| 36 | + this.setEnabled(value); |
| 37 | + break; |
| 38 | + default: |
| 39 | + break; |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + public setStyle( |
| 44 | + style: string, |
| 45 | + value: any, |
| 46 | + flags?: RendererStyleFlags2 |
| 47 | + ): void { |
| 48 | + this.setInlineStyle(`${style}:${value}`); |
| 49 | + } |
| 50 | + |
| 51 | + public setValue(value: number): void { |
| 52 | + super.setValue(value); |
| 53 | + } |
| 54 | + |
| 55 | + removeAttribute(name: string, namespace?: string): void { |
| 56 | + throw new Error('Method not implemented.'); |
| 57 | + } |
| 58 | + removeChild(oldChild: any): void { |
| 59 | + throw new Error('Method not implemented.'); |
| 60 | + } |
| 61 | + removeClass(name: string): void { |
| 62 | + throw new Error('Method not implemented.'); |
| 63 | + } |
| 64 | + removeStyle(style: string, flags?: RendererStyleFlags2): void { |
| 65 | + throw new Error('Method not implemented.'); |
| 66 | + } |
| 67 | +} |
0 commit comments