@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 +4 -0
- package/ng-package.json +7 -0
- package/package.json +11 -0
- package/src/lib/components.module.ts +8 -0
- package/src/lib/stencil-generated/angular-component-lib/utils.ts +63 -0
- package/src/lib/stencil-generated/components.ts +67 -0
- package/src/lib/stencil-generated/index.ts +8 -0
- package/src/public-api.ts +5 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
package/README.md
ADDED
package/ng-package.json
ADDED
package/package.json
ADDED
|
@@ -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,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,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
|
+
}
|