@paycargo/js-angular
Version:
First, run `npm i @paycargo/js-angular` in your Command Line Interface. Afterwards, the following dependency will be found in the `package.json`. The ellipses (...) represent the presence of other possible code.
184 lines (176 loc) • 9.74 kB
JavaScript
import { __decorate } from 'tslib';
import * as i0 from '@angular/core';
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { fromEvent } from 'rxjs';
import { defineCustomElement as defineCustomElement$1 } from '@paycargo/js/dist/components/paycargo-batch-dispute-widget.js';
import { defineCustomElement as defineCustomElement$2 } from '@paycargo/js/dist/components/paycargo-checkout.js';
import { defineCustomElement as defineCustomElement$3 } from '@paycargo/js/dist/components/paycargo-osra-widget.js';
import { defineCustomElements } from '@paycargo/js/loader';
/* eslint-disable */
/* tslint:disable */
const proxyInputs = (Cmp, inputs) => {
const Prototype = Cmp.prototype;
inputs.forEach((item) => {
Object.defineProperty(Prototype, item, {
get() {
return this.el[item];
},
set(val) {
this.z.runOutsideAngular(() => (this.el[item] = val));
},
/**
* In the event that proxyInputs is called
* multiple times re-defining these inputs
* will cause an error to be thrown. As a result
* we set configurable: true to indicate these
* properties can be changed.
*/
configurable: true,
});
});
};
const proxyMethods = (Cmp, methods) => {
const Prototype = Cmp.prototype;
methods.forEach((methodName) => {
Prototype[methodName] = function () {
const args = arguments;
return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
};
});
};
const proxyOutputs = (instance, el, events) => {
events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
};
const defineCustomElement = (tagName, customElement) => {
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
customElements.define(tagName, customElement);
}
};
// tslint:disable-next-line: only-arrow-functions
function ProxyCmp(opts) {
const decorator = function (cls) {
const { defineCustomElementFn, inputs, methods } = opts;
if (defineCustomElementFn !== undefined) {
defineCustomElementFn();
}
if (inputs) {
proxyInputs(cls, inputs);
}
if (methods) {
proxyMethods(cls, methods);
}
return cls;
};
return decorator;
}
let PaycargoBatchDisputeWidget = class PaycargoBatchDisputeWidget {
constructor(c, r, z) {
this.z = z;
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['disputeResponseModal']);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoBatchDisputeWidget, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PaycargoBatchDisputeWidget, isStandalone: true, selector: "paycargo-batch-dispute-widget", inputs: { authToken: "authToken", businessRules: "businessRules", env: "env", pcTransactions: "pcTransactions", visible: "visible" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
};
PaycargoBatchDisputeWidget = __decorate([
ProxyCmp({
defineCustomElementFn: defineCustomElement$1,
inputs: ['authToken', 'businessRules', 'env', 'pcTransactions', 'visible'],
methods: ['makeVisible']
})
], PaycargoBatchDisputeWidget);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoBatchDisputeWidget, decorators: [{
type: Component,
args: [{
selector: 'paycargo-batch-dispute-widget',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['authToken', 'businessRules', 'env', 'pcTransactions', 'visible'],
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
let PaycargoCheckout = class PaycargoCheckout {
constructor(c, r, z) {
this.z = z;
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['close', 'paymentResponse', 'disputeResponse']);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoCheckout, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PaycargoCheckout, isStandalone: true, selector: "paycargo-checkout", inputs: { onPcClose: "onPcClose", onPcDispute: "onPcDispute", onPcPayment: "onPcPayment", options: "options", pcTransactions: "pcTransactions" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
};
PaycargoCheckout = __decorate([
ProxyCmp({
defineCustomElementFn: defineCustomElement$2,
inputs: ['onPcClose', 'onPcDispute', 'onPcPayment', 'options', 'pcTransactions'],
methods: ['makeVisible']
})
], PaycargoCheckout);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoCheckout, decorators: [{
type: Component,
args: [{
selector: 'paycargo-checkout',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['onPcClose', 'onPcDispute', 'onPcPayment', 'options', 'pcTransactions'],
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
let PaycargoOsraWidget = class PaycargoOsraWidget {
constructor(c, r, z) {
this.z = z;
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ['osraReviewed', 'pcOsraWidgetClose']);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoOsraWidget, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PaycargoOsraWidget, isStandalone: true, selector: "paycargo-osra-widget", inputs: { businessRules: "businessRules", hideButton: "hideButton", loadMultiWidget: "loadMultiWidget", pcTransaction: "pcTransaction", visible: "visible" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
};
PaycargoOsraWidget = __decorate([
ProxyCmp({
defineCustomElementFn: defineCustomElement$3,
inputs: ['businessRules', 'hideButton', 'loadMultiWidget', 'pcTransaction', 'visible'],
methods: ['makeVisible']
})
], PaycargoOsraWidget);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaycargoOsraWidget, decorators: [{
type: Component,
args: [{
selector: 'paycargo-osra-widget',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['businessRules', 'hideButton', 'loadMultiWidget', 'pcTransaction', 'visible'],
standalone: true
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
const DIRECTIVES = [
PaycargoBatchDisputeWidget,
PaycargoCheckout,
PaycargoOsraWidget
];
class PayCargoCheckoutModule {
constructor() {
defineCustomElements(window);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PayCargoCheckoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PayCargoCheckoutModule, imports: [PaycargoBatchDisputeWidget, PaycargoCheckout, PaycargoOsraWidget] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PayCargoCheckoutModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PayCargoCheckoutModule, decorators: [{
type: NgModule,
args: [{
imports: [...DIRECTIVES]
}]
}], ctorParameters: function () { return []; } });
/*
* Public API Surface of js-angular
*/
/**
* Generated bundle index. Do not edit.
*/
export { DIRECTIVES, PayCargoCheckoutModule, PaycargoBatchDisputeWidget, PaycargoCheckout, PaycargoOsraWidget };
//# sourceMappingURL=paycargo-js-angular.mjs.map