Skip to content

Commit 3de544f

Browse files
committed
Add dial component
1 parent 373996f commit 3de544f

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

src/lib/components/components-map.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { NgWindow } from './window';
55
import { NgText } from './text';
66
import { NgView } from './view';
77
import { NgCheckbox } from './checkbox';
8+
import { NgDial } from './dial';
89

910
export type Constructable<T> = new () => T;
1011
export type NgComponentClass = Constructable<NgComponent>;
@@ -22,5 +23,6 @@ export class ComponentsMap {
2223
this.map.set(NgText.nodeName, NgText);
2324
this.map.set(NgView.nodeName, NgView);
2425
this.map.set(NgCheckbox.nodeName, NgCheckbox);
26+
this.map.set(NgDial.nodeName, NgDial);
2527
}
2628
}

src/lib/components/dial.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { QDial } from '@nodegui/nodegui';
2+
import { NgComponent } from './component';
3+
import { RendererStyleFlags2 } from '@angular/core';
4+
5+
export class NgDial extends QDial implements NgComponent {
6+
public static nodeName = 'dial';
7+
public parent: any;
8+
9+
public appendChild(newChild: any): void {
10+
console.warn('dial 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: boolean | number): void {
22+
switch (name) {
23+
case 'enabled':
24+
this.setEnabled(value as boolean);
25+
break;
26+
case 'notchesVisible':
27+
this.setNotchesVisible(value as boolean);
28+
break;
29+
case 'wrapping':
30+
this.setWrapping(value as boolean);
31+
break;
32+
case 'notchTarget':
33+
this.setNotchTarget(value as number);
34+
break;
35+
default:
36+
break;
37+
}
38+
}
39+
40+
public setStyle(
41+
style: string,
42+
value: any,
43+
flags?: RendererStyleFlags2
44+
): void {
45+
this.setInlineStyle(`${style}:${value}`);
46+
}
47+
48+
public setValue(value: any): void {}
49+
50+
removeAttribute(name: string, namespace?: string): void {
51+
throw new Error('Method not implemented.');
52+
}
53+
removeChild(oldChild: any): void {
54+
throw new Error('Method not implemented.');
55+
}
56+
removeClass(name: string): void {
57+
throw new Error('Method not implemented.');
58+
}
59+
removeStyle(style: string, flags?: RendererStyleFlags2): void {
60+
throw new Error('Method not implemented.');
61+
}
62+
}

0 commit comments

Comments
 (0)