@g-ui-core/angular 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { EventEmitter, ElementRef, AfterViewInit } from '@angular/core';
|
|
2
|
-
import { GButton } from '@g-ui-core/core';
|
|
3
|
-
import { type
|
|
2
|
+
import { GButton, type ButtonType } from '@g-ui-core/core';
|
|
3
|
+
import { type Size } from '@g-ui-core/shared';
|
|
4
4
|
export declare class ButtonComponent implements AfterViewInit {
|
|
5
5
|
private el;
|
|
6
|
-
|
|
6
|
+
type: ButtonType;
|
|
7
7
|
size: Size;
|
|
8
|
-
|
|
8
|
+
plain: boolean;
|
|
9
|
+
round: boolean;
|
|
10
|
+
circle: boolean;
|
|
9
11
|
loading: boolean;
|
|
10
|
-
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
icon: string;
|
|
14
|
+
nativeType: 'button' | 'submit' | 'reset';
|
|
15
|
+
autofocus: boolean;
|
|
11
16
|
clickEvent: EventEmitter<Event>;
|
|
12
|
-
myClick: EventEmitter<Event>;
|
|
13
17
|
constructor(el: ElementRef<GButton>);
|
|
14
18
|
ngAfterViewInit(): void;
|
|
15
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../src/button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACZ,UAAU,EAGV,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../src/button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EACZ,UAAU,EAGV,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI5D,qBAIa,eAAgB,YAAW,aAAa;IAavC,OAAO,CAAC,EAAE;IAZb,IAAI,EAAE,UAAU,CAAa;IAC7B,IAAI,EAAE,IAAI,CAAa;IACvB,KAAK,UAAS;IACd,KAAK,UAAS;IACd,MAAM,UAAS;IACf,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjB,IAAI,SAAM;IACV,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IACrD,SAAS,UAAS;IACjB,UAAU,sBAA6B;gBAE7B,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC;IAE3C,eAAe;CAkBhB;AAED,qBAKa,SAAS;CAAG"}
|
package/dist/button.component.js
CHANGED
|
@@ -13,33 +13,39 @@ const tag = `${getNamespace()}-button`;
|
|
|
13
13
|
let ButtonComponent = class ButtonComponent {
|
|
14
14
|
constructor(el) {
|
|
15
15
|
this.el = el;
|
|
16
|
-
this.
|
|
17
|
-
this.size = '
|
|
18
|
-
this.
|
|
16
|
+
this.type = 'primary';
|
|
17
|
+
this.size = 'default';
|
|
18
|
+
this.plain = false;
|
|
19
|
+
this.round = false;
|
|
20
|
+
this.circle = false;
|
|
19
21
|
this.loading = false;
|
|
20
|
-
this.
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
this.icon = '';
|
|
24
|
+
this.nativeType = 'button';
|
|
25
|
+
this.autofocus = false;
|
|
21
26
|
this.clickEvent = new EventEmitter();
|
|
22
|
-
this.myClick = new EventEmitter();
|
|
23
27
|
}
|
|
24
28
|
ngAfterViewInit() {
|
|
25
29
|
const native = this.el.nativeElement;
|
|
26
|
-
//
|
|
27
|
-
native.
|
|
30
|
+
// 同步属性到 Web Component
|
|
31
|
+
native.type = this.type;
|
|
28
32
|
native.size = this.size;
|
|
29
|
-
native.
|
|
33
|
+
native.plain = this.plain;
|
|
34
|
+
native.round = this.round;
|
|
35
|
+
native.circle = this.circle;
|
|
30
36
|
native.loading = this.loading;
|
|
31
|
-
native.
|
|
32
|
-
|
|
33
|
-
native.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
native.disabled = this.disabled;
|
|
38
|
+
native.icon = this.icon;
|
|
39
|
+
native.nativeType = this.nativeType;
|
|
40
|
+
native.autofocus = this.autofocus;
|
|
41
|
+
// 转发 click 事件
|
|
42
|
+
native.addEventListener('click', (e) => this.clickEvent.emit(e));
|
|
37
43
|
}
|
|
38
44
|
};
|
|
39
45
|
__decorate([
|
|
40
46
|
Input(),
|
|
41
47
|
__metadata("design:type", String)
|
|
42
|
-
], ButtonComponent.prototype, "
|
|
48
|
+
], ButtonComponent.prototype, "type", void 0);
|
|
43
49
|
__decorate([
|
|
44
50
|
Input(),
|
|
45
51
|
__metadata("design:type", String)
|
|
@@ -47,7 +53,15 @@ __decorate([
|
|
|
47
53
|
__decorate([
|
|
48
54
|
Input(),
|
|
49
55
|
__metadata("design:type", Object)
|
|
50
|
-
], ButtonComponent.prototype, "
|
|
56
|
+
], ButtonComponent.prototype, "plain", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
Input(),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], ButtonComponent.prototype, "round", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
Input(),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], ButtonComponent.prototype, "circle", void 0);
|
|
51
65
|
__decorate([
|
|
52
66
|
Input(),
|
|
53
67
|
__metadata("design:type", Object)
|
|
@@ -55,15 +69,23 @@ __decorate([
|
|
|
55
69
|
__decorate([
|
|
56
70
|
Input(),
|
|
57
71
|
__metadata("design:type", Object)
|
|
58
|
-
], ButtonComponent.prototype, "
|
|
72
|
+
], ButtonComponent.prototype, "disabled", void 0);
|
|
59
73
|
__decorate([
|
|
60
|
-
|
|
74
|
+
Input(),
|
|
61
75
|
__metadata("design:type", Object)
|
|
62
|
-
], ButtonComponent.prototype, "
|
|
76
|
+
], ButtonComponent.prototype, "icon", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
Input(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], ButtonComponent.prototype, "nativeType", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
Input(),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], ButtonComponent.prototype, "autofocus", void 0);
|
|
63
85
|
__decorate([
|
|
64
86
|
Output(),
|
|
65
87
|
__metadata("design:type", Object)
|
|
66
|
-
], ButtonComponent.prototype, "
|
|
88
|
+
], ButtonComponent.prototype, "clickEvent", void 0);
|
|
67
89
|
ButtonComponent = __decorate([
|
|
68
90
|
Component({
|
|
69
91
|
selector: tag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.component.js","sourceRoot":"","sources":["../src/button.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,sBAAsB,GAEvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"button.component.js","sourceRoot":"","sources":["../src/button.component.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,sBAAsB,GAEvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AAE5D,MAAM,GAAG,GAAG,GAAG,YAAY,EAAE,SAAS,CAAC;AAMhC,IAAM,eAAe,GAArB,MAAM,eAAe;IAa1B,YAAoB,EAAuB;QAAvB,OAAE,GAAF,EAAE,CAAqB;QAZlC,SAAI,GAAe,SAAS,CAAC;QAC7B,SAAI,GAAS,SAAS,CAAC;QACvB,UAAK,GAAG,KAAK,CAAC;QACd,UAAK,GAAG,KAAK,CAAC;QACd,WAAM,GAAG,KAAK,C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