@biggive/components-angular 0.0.14

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/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Angular library
2
+
3
+ This directory is an Angular library purely for containing Stencil's Angular target
4
+ outputs. See [https://stenciljs.com/docs/angular#creating-an-angular-component-library](the Stencil docs).
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/components",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@biggive/components-angular",
3
+ "version": "0.0.14",
4
+ "peerDependencies": {
5
+ "@angular/common": "^14.1.0",
6
+ "@angular/core": "^14.1.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { DIRECTIVES } from './stencil-generated';
3
+
4
+ @NgModule({
5
+ declarations: [...DIRECTIVES],
6
+ exports: [...DIRECTIVES],
7
+ })
8
+ export class ComponentsModule { }
@@ -0,0 +1,63 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ import { fromEvent } from 'rxjs';
4
+
5
+ export const proxyInputs = (Cmp: any, inputs: string[]) => {
6
+ const Prototype = Cmp.prototype;
7
+ inputs.forEach(item => {
8
+ Object.defineProperty(Prototype, item, {
9
+ get() {
10
+ return this.el[item];
11
+ },
12
+ set(val: any) {
13
+ this.z.runOutsideAngular(() => (this.el[item] = val));
14
+ }
15
+ });
16
+ });
17
+ };
18
+
19
+ export const proxyMethods = (Cmp: any, methods: string[]) => {
20
+ const Prototype = Cmp.prototype;
21
+ methods.forEach(methodName => {
22
+ Prototype[methodName] = function () {
23
+ const args = arguments;
24
+ return this.z.runOutsideAngular(() =>
25
+ this.el[methodName].apply(this.el, args)
26
+ );
27
+ };
28
+ });
29
+ };
30
+
31
+ export const proxyOutputs = (instance: any, el: any, events: string[]) => {
32
+ events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
33
+ }
34
+
35
+ export const defineCustomElement = (tagName: string, customElement: any) => {
36
+ if (
37
+ customElement !== undefined &&
38
+ typeof customElements !== 'undefined' &&
39
+ !customElements.get(tagName)
40
+ ) {
41
+ customElements.define(tagName, customElement);
42
+ }
43
+ }
44
+
45
+ // tslint:disable-next-line: only-arrow-functions
46
+ export function ProxyCmp(opts: { defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
47
+ const decorator = function (cls: any) {
48
+ const { defineCustomElementFn, inputs, methods } = opts;
49
+
50
+ if (defineCustomElementFn !== undefined) {
51
+ defineCustomElementFn();
52
+ }
53
+
54
+ if (inputs) {
55
+ proxyInputs(cls, inputs);
56
+ }
57
+ if (methods) {
58
+ proxyMethods(cls, methods);
59
+ }
60
+ return cls;
61
+ };
62
+ return decorator;
63
+ }
@@ -0,0 +1,67 @@
1
+ /* tslint:disable */
2
+ /* auto-generated angular directive proxies */
3
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone } from '@angular/core';
4
+ import { ProxyCmp, proxyOutputs } from './angular-component-lib/utils';
5
+
6
+ import { Components } from '@biggive/components';
7
+
8
+
9
+
10
+
11
+ export declare interface BiggiveCampaignCard extends Components.BiggiveCampaignCard {}
12
+
13
+ @ProxyCmp({
14
+ defineCustomElementFn: undefined,
15
+ inputs: ['banner', 'beneficiaries', 'callToActionLabel', 'callToActionUrl', 'campaignTitle', 'campaignType', 'categories', 'currencyCode', 'daysRemaining', 'matchFundsRemaining', 'organisationName', 'target', 'totalFundsRaised']
16
+ })
17
+ @Component({
18
+ selector: 'biggive-campaign-card',
19
+ changeDetection: ChangeDetectionStrategy.OnPush,
20
+ template: '<ng-content></ng-content>',
21
+ inputs: ['banner', 'beneficiaries', 'callToActionLabel', 'callToActionUrl', 'campaignTitle', 'campaignType', 'categories', 'currencyCode', 'daysRemaining', 'matchFundsRemaining', 'organisationName', 'target', 'totalFundsRaised']
22
+ })
23
+ export class BiggiveCampaignCard {
24
+ protected el: HTMLElement;
25
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
26
+ c.detach();
27
+ this.el = r.nativeElement;
28
+ }
29
+ }
30
+
31
+
32
+ export declare interface BiggiveGrid extends Components.BiggiveGrid {}
33
+
34
+ @ProxyCmp({
35
+ defineCustomElementFn: undefined
36
+ })
37
+ @Component({
38
+ selector: 'biggive-grid',
39
+ changeDetection: ChangeDetectionStrategy.OnPush,
40
+ template: '<ng-content></ng-content>'
41
+ })
42
+ export class BiggiveGrid {
43
+ protected el: HTMLElement;
44
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
45
+ c.detach();
46
+ this.el = r.nativeElement;
47
+ }
48
+ }
49
+
50
+
51
+ export declare interface DemoCampaignCards extends Components.DemoCampaignCards {}
52
+
53
+ @ProxyCmp({
54
+ defineCustomElementFn: undefined
55
+ })
56
+ @Component({
57
+ selector: 'demo-campaign-cards',
58
+ changeDetection: ChangeDetectionStrategy.OnPush,
59
+ template: '<ng-content></ng-content>'
60
+ })
61
+ export class DemoCampaignCards {
62
+ protected el: HTMLElement;
63
+ constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
64
+ c.detach();
65
+ this.el = r.nativeElement;
66
+ }
67
+ }
@@ -0,0 +1,8 @@
1
+
2
+ import * as d from './components';
3
+
4
+ export const DIRECTIVES = [
5
+ d.BiggiveCampaignCard,
6
+ d.BiggiveGrid,
7
+ d.DemoCampaignCards
8
+ ];
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Public API Surface of components
3
+ */
4
+
5
+ export { DIRECTIVES } from './lib/stencil-generated';
@@ -0,0 +1,15 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "src/test.ts",
13
+ "**/*.spec.ts"
14
+ ]
15
+ }
@@ -0,0 +1,10 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }