@g-ui-core/angular 0.1.2 → 0.2.1

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 Variant, type Size } from '@g-ui-core/shared';
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
- variant: Variant;
6
+ type: ButtonType;
7
7
  size: Size;
8
- disabled: boolean;
8
+ plain: boolean;
9
+ round: boolean;
10
+ circle: boolean;
9
11
  loading: boolean;
10
- label: string;
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;AAC1C,OAAO,EAAgB,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI1E,qBAIa,eAAgB,YAAW,aAAa;IASvC,OAAO,CAAC,EAAE;IARb,OAAO,EAAE,OAAO,CAAa;IAC7B,IAAI,EAAE,IAAI,CAAY;IACtB,QAAQ,UAAS;IACjB,OAAO,UAAS;IAChB,KAAK,SAAM;IACV,UAAU,sBAA6B;IACvC,OAAO,sBAA6B;gBAE1B,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC;IAE3C,eAAe;CAgBhB;AAED,qBAKa,SAAS;CAAG"}
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"}
@@ -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.variant = 'primary';
17
- this.size = 'medium';
18
- this.disabled = false;
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.label = '';
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
- // Angular 的 Input 同步到 Web Component 的属性
27
- native.variant = this.variant;
30
+ // 同步属性到 Web Component
31
+ native.type = this.type;
28
32
  native.size = this.size;
29
- native.disabled = this.disabled;
33
+ native.plain = this.plain;
34
+ native.round = this.round;
35
+ native.circle = this.circle;
30
36
  native.loading = this.loading;
31
- native.label = this.label;
32
- // 监听原生 click 事件并转发
33
- native.addEventListener('click', (e) => {
34
- this.clickEvent.emit(e);
35
- this.myClick.emit(e);
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, "variant", void 0);
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, "disabled", void 0);
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, "label", void 0);
72
+ ], ButtonComponent.prototype, "disabled", void 0);
59
73
  __decorate([
60
- Output(),
74
+ Input(),
61
75
  __metadata("design:type", Object)
62
- ], ButtonComponent.prototype, "clickEvent", void 0);
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, "myClick", void 0);
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,EAA2B,MAAM,mBAAmB,CAAC;AAE1E,MAAM,GAAG,GAAG,GAAG,YAAY,EAAE,SAAS,CAAC;AAMhC,IAAM,eAAe,GAArB,MAAM,eAAe;IAS1B,YAAoB,EAAuB;QAAvB,OAAE,GAAF,EAAE,CAAqB;QARlC,YAAO,GAAY,SAAS,CAAC;QAC7B,SAAI,GAAS,QAAQ,CAAC;QACtB,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QAChB,UAAK,GAAG,EAAE,CAAC;QACV,eAAU,GAAG,IAAI,YAAY,EAAS,CAAC;QACvC,YAAO,GAAG,IAAI,YAAY,EAAS,CAAC;IAEA,CAAC;IAE/C,eAAe;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;QAErC,0CAA0C;QAC1C,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAc,CAAC;QACrC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAW,CAAC;QAC/B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAChC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9B,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAE1B,mBAAmB;QACnB,MAAM,CAAC,gBAAgB,CAAC,OAAO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AAK,EAAE;;8CAAe;AACd;IAAR,KAAK,EAAE;;+CAAgB;AACf;IAAR,KAAK,EAAE;;gDAAiB;AAChB;IAAR,KAAK,EAAE;;iDAAkB;AACjB;IAAR,KAAK,EAAE;;6CAAW;AACV;IAAR,KAAK,EAAE;;mDAAsD;AACrD;IAAR,KAAK,EAAE;;kDAAmB;AACjB;IAAT,MAAM,EAAE;;mDAAwC;AAXtC,eAAe;IAJ3B,SAAS,CAAC;QACT,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,2BAA2B;KACtC,CAAC;qCAcwB,UAAU;GAbvB,eAAe,CAiC3B;;AAOM,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IALrB,QAAQ,CAAC;QACR,YAAY,EAAE,CAAC,eAAe,CAAC;QAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;QAC1B,OAAO,EAAE,CAAC,sBAAsB,CAAC;KAClC,CAAC;GACW,SAAS,CAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g-ui-core/angular",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Angular wrappers for g-ui-core components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@g-ui-core/core": "^0.1.0",
12
- "@g-ui-core/shared": "^0.1.0",
11
+ "@g-ui-core/core": "^0.2.0",
12
+ "@g-ui-core/shared": "^0.2.0",
13
13
  "tslib": "^2.6.0"
14
14
  },
15
15
  "peerDependencies": {