@g-ui-core/angular 0.1.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.
- package/dist/button.component.d.ts +17 -0
- package/dist/button.component.d.ts.map +1 -0
- package/dist/button.component.js +85 -0
- package/dist/button.component.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { GButton } from '@g-ui-core/core';
|
|
3
|
+
export declare class ButtonComponent implements AfterViewInit {
|
|
4
|
+
private el;
|
|
5
|
+
variant: string;
|
|
6
|
+
size: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
label: string;
|
|
10
|
+
clickEvent: EventEmitter<Event>;
|
|
11
|
+
myClick: EventEmitter<Event>;
|
|
12
|
+
constructor(el: ElementRef<GButton>);
|
|
13
|
+
ngAfterViewInit(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class GUIModule {
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=button.component.d.ts.map
|
|
@@ -0,0 +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;AAK1C,qBAIa,eAAgB,YAAW,aAAa;IASvC,OAAO,CAAC,EAAE;IARb,OAAO,SAAa;IACpB,IAAI,SAAY;IAChB,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"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Component, Input, Output, EventEmitter, ElementRef, NgModule, CUSTOM_ELEMENTS_SCHEMA, } from '@angular/core';
|
|
11
|
+
import { getNamespace } from '@g-ui-core/shared';
|
|
12
|
+
const tag = `${getNamespace()}-button`;
|
|
13
|
+
let ButtonComponent = class ButtonComponent {
|
|
14
|
+
constructor(el) {
|
|
15
|
+
this.el = el;
|
|
16
|
+
this.variant = 'primary';
|
|
17
|
+
this.size = 'medium';
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.loading = false;
|
|
20
|
+
this.label = '';
|
|
21
|
+
this.clickEvent = new EventEmitter();
|
|
22
|
+
this.myClick = new EventEmitter();
|
|
23
|
+
}
|
|
24
|
+
ngAfterViewInit() {
|
|
25
|
+
const native = this.el.nativeElement;
|
|
26
|
+
// 将 Angular 的 Input 同步到 Web Component 的属性
|
|
27
|
+
native.variant = this.variant;
|
|
28
|
+
native.size = this.size;
|
|
29
|
+
native.disabled = this.disabled;
|
|
30
|
+
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
|
+
}
|
|
38
|
+
};
|
|
39
|
+
__decorate([
|
|
40
|
+
Input(),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], ButtonComponent.prototype, "variant", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Input(),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], ButtonComponent.prototype, "size", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Input(),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], ButtonComponent.prototype, "disabled", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Input(),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], ButtonComponent.prototype, "loading", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Input(),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], ButtonComponent.prototype, "label", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
Output(),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], ButtonComponent.prototype, "clickEvent", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
Output(),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], ButtonComponent.prototype, "myClick", void 0);
|
|
67
|
+
ButtonComponent = __decorate([
|
|
68
|
+
Component({
|
|
69
|
+
selector: tag,
|
|
70
|
+
template: `<ng-content></ng-content>`,
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:paramtypes", [ElementRef])
|
|
73
|
+
], ButtonComponent);
|
|
74
|
+
export { ButtonComponent };
|
|
75
|
+
let GUIModule = class GUIModule {
|
|
76
|
+
};
|
|
77
|
+
GUIModule = __decorate([
|
|
78
|
+
NgModule({
|
|
79
|
+
declarations: [ButtonComponent],
|
|
80
|
+
exports: [ButtonComponent],
|
|
81
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
82
|
+
})
|
|
83
|
+
], GUIModule);
|
|
84
|
+
export { GUIModule };
|
|
85
|
+
//# sourceMappingURL=button.component.js.map
|
|
@@ -0,0 +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,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,GAAG,GAAG,GAAG,YAAY,EAAE,SAAS,CAAC;AAMhC,IAAM,eAAe,GAArB,MAAM,eAAe;IAS1B,YAAoB,EAAuB;QAAvB,OAAE,GAAF,EAAE,CAAqB;QARlC,YAAO,GAAG,SAAS,CAAC;QACpB,SAAI,GAAG,QAAQ,CAAC;QAChB,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,EAAE,CAAC,CAAQ,EAAE,EAAE;YAC5C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1BU;IAAR,KAAK,EAAE;;gDAAqB;AACpB;IAAR,KAAK,EAAE;;6CAAiB;AAChB;IAAR,KAAK,EAAE;;iDAAkB;AACjB;IAAR,KAAK,EAAE;;gDAAiB;AAChB;IAAR,KAAK,EAAE;;8CAAY;AACV;IAAT,MAAM,EAAE;;mDAAwC;AACvC;IAAT,MAAM,EAAE;;gDAAqC;AAPnC,eAAe;IAJ3B,SAAS,CAAC;QACT,QAAQ,EAAE,GAAG;QACb,QAAQ,EAAE,2BAA2B;KACtC,CAAC;qCAUwB,UAAU;GATvB,eAAe,CA2B3B;;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/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@g-ui-core/angular",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Angular wrappers for g-ui-core components",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"clean": "rm -rf dist"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@g-ui-core/core": "workspace:*",
|
|
14
|
+
"@g-ui-core/shared": "workspace:*",
|
|
15
|
+
"tslib": "^2.6.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@angular/core": ">=17",
|
|
19
|
+
"@angular/common": ">=17"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@angular/core": "^17.3.0",
|
|
23
|
+
"@angular/common": "^17.3.0",
|
|
24
|
+
"typescript": "^5.4.0"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|