@heartlandone/vega-angular-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1 2.61.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/.browserslistrc +16 -0
- package/.prettierrc.js +13 -0
- package/LICENSE +13 -0
- package/README.md +86 -0
- package/dist/LICENSE +13 -0
- package/dist/README.md +86 -0
- package/dist/esm2020/heartlandone-vega-angular.mjs +5 -0
- package/dist/esm2020/lib/components-module.mjs +35 -0
- package/dist/esm2020/lib/stencil-generated/angular-component-lib/utils.mjs +89 -0
- package/dist/esm2020/lib/stencil-generated/components.mjs +2908 -0
- package/dist/esm2020/lib/stencil-generated/text-value-accessor.mjs +36 -0
- package/dist/esm2020/lib/stencil-generated/value-accessor.mjs +47 -0
- package/dist/esm2020/public-api.mjs +8 -0
- package/dist/esm2020/testing/heartlandone-vega-angular-testing.mjs +5 -0
- package/dist/esm2020/testing/index.mjs +84 -0
- package/dist/esm2020/testing/public-api.mjs +5 -0
- package/dist/fesm2015/heartlandone-vega-angular-testing.mjs +97 -0
- package/dist/fesm2015/heartlandone-vega-angular-testing.mjs.map +1 -0
- package/dist/fesm2015/heartlandone-vega-angular.mjs +3000 -0
- package/dist/fesm2015/heartlandone-vega-angular.mjs.map +1 -0
- package/dist/fesm2020/heartlandone-vega-angular-testing.mjs +94 -0
- package/dist/fesm2020/heartlandone-vega-angular-testing.mjs.map +1 -0
- package/dist/fesm2020/heartlandone-vega-angular.mjs +3000 -0
- package/dist/fesm2020/heartlandone-vega-angular.mjs.map +1 -0
- package/dist/heartlandone-vega-angular.d.ts +5 -0
- package/dist/lib/components-module.d.ts +11 -0
- package/dist/lib/stencil-generated/angular-component-lib/utils.d.ts +9 -0
- package/dist/lib/stencil-generated/components.d.ts +1990 -0
- package/dist/lib/stencil-generated/text-value-accessor.d.ts +8 -0
- package/dist/lib/stencil-generated/value-accessor.d.ts +18 -0
- package/dist/package.json +50 -0
- package/dist/public-api.d.ts +4 -0
- package/dist/testing/heartlandone-vega-angular-testing.d.ts +5 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/package.json +10 -0
- package/dist/testing/public-api.d.ts +1 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +11 -0
- package/package.json +38 -0
- package/src/lib/components-module.ts +27 -0
- package/src/lib/stencil-generated/angular-component-lib/utils.ts +101 -0
- package/src/lib/stencil-generated/components.ts +3582 -0
- package/src/lib/stencil-generated/text-value-accessor.ts +25 -0
- package/src/lib/stencil-generated/value-accessor.ts +45 -0
- package/src/public-api.ts +7 -0
- package/src/scripts/stencil-post-build-script.js +132 -0
- package/src/test.ts +27 -0
- package/testing/index.ts +115 -0
- package/testing/ng-package.json +8 -0
- package/testing/public-api.ts +4 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
2
|
+
import { ValueAccessor } from './value-accessor';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class TextValueAccessor extends ValueAccessor {
|
5
|
+
constructor(el: ElementRef);
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextValueAccessor, never>;
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TextValueAccessor, "vega-checkbox, vega-checkbox-group, vega-color-picker, vega-combo-box, vega-date-picker, vega-file-uploader, vega-image-uploader, vega-input, vega-input-credit-card, vega-input-numeric, vega-input-phone-number, vega-input-range, vega-input-select, vega-radio-group, vega-rich-text-editor, vega-selection-chip-group, vega-selection-tile-group, vega-signature-capture, vega-stepper, vega-textarea, vega-time-picker, vega-toggle-switch", never, {}, {}, never>;
|
8
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class ValueAccessor implements ControlValueAccessor {
|
5
|
+
protected el: ElementRef;
|
6
|
+
private onChange;
|
7
|
+
private onTouched;
|
8
|
+
protected lastValue: any;
|
9
|
+
constructor(el: ElementRef);
|
10
|
+
writeValue(value: any): void;
|
11
|
+
handleChangeEvent(value: any, semantics: 'native' | 'vega'): void;
|
12
|
+
_handleBlurEvent(): void;
|
13
|
+
registerOnChange(fn: (value: any) => void): void;
|
14
|
+
registerOnTouched(fn: () => void): void;
|
15
|
+
setDisabledState(isDisabled: boolean): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessor, never>;
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueAccessor, "vega-value-accessor", never, {}, {}, never>;
|
18
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"name": "@heartlandone/vega-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1-angular",
|
3
|
+
"sideEffects": false,
|
4
|
+
"version": "2.61.0",
|
5
|
+
"description": "Angular specific wrapper for @heartlandone/vega-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1",
|
6
|
+
"license": "UNLICENSED",
|
7
|
+
"peerDependencies": {
|
8
|
+
"@angular/common": ">=12.0.0",
|
9
|
+
"@angular/core": ">=12.0.0"
|
10
|
+
},
|
11
|
+
"module": "fesm2015/heartlandone-vega-angular.mjs",
|
12
|
+
"es2020": "fesm2020/heartlandone-vega-angular.mjs",
|
13
|
+
"esm2020": "esm2020/heartlandone-vega-angular.mjs",
|
14
|
+
"fesm2020": "fesm2020/heartlandone-vega-angular.mjs",
|
15
|
+
"fesm2015": "fesm2015/heartlandone-vega-angular.mjs",
|
16
|
+
"typings": "heartlandone-vega-angular.d.ts",
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "https://github.com/heartlandpayments/Vega/tree/main/vega-angular-workspace/projects/vega-angular"
|
20
|
+
},
|
21
|
+
"dependencies": {
|
22
|
+
"@heartlandone/vega-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1": "2.61.0",
|
23
|
+
"tslib": "^2.3.0",
|
24
|
+
"@juggle/resize-observer": "^3.4.0"
|
25
|
+
},
|
26
|
+
"publishConfig": {
|
27
|
+
"directory": "dist"
|
28
|
+
},
|
29
|
+
"exports": {
|
30
|
+
"./package.json": {
|
31
|
+
"default": "./package.json"
|
32
|
+
},
|
33
|
+
".": {
|
34
|
+
"types": "./heartlandone-vega-angular.d.ts",
|
35
|
+
"esm2020": "./esm2020/heartlandone-vega-angular.mjs",
|
36
|
+
"es2020": "./fesm2020/heartlandone-vega-angular.mjs",
|
37
|
+
"es2015": "./fesm2015/heartlandone-vega-angular.mjs",
|
38
|
+
"node": "./fesm2015/heartlandone-vega-angular.mjs",
|
39
|
+
"default": "./fesm2020/heartlandone-vega-angular.mjs"
|
40
|
+
},
|
41
|
+
"./testing": {
|
42
|
+
"types": "./testing/heartlandone-vega-angular-testing.d.ts",
|
43
|
+
"esm2020": "./esm2020/testing/heartlandone-vega-angular-testing.mjs",
|
44
|
+
"es2020": "./fesm2020/heartlandone-vega-angular-testing.mjs",
|
45
|
+
"es2015": "./fesm2015/heartlandone-vega-angular-testing.mjs",
|
46
|
+
"node": "./fesm2015/heartlandone-vega-angular-testing.mjs",
|
47
|
+
"default": "./fesm2020/heartlandone-vega-angular-testing.mjs"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { RenderResult } from '@testing-library/angular';
|
2
|
+
export declare function waitForVegaReady(renderResult: RenderResult<unknown, unknown>, delay?: number): Promise<RenderResult<unknown, unknown>>;
|
3
|
+
export declare type MockedResizeObserverController = {
|
4
|
+
hide: (selector: string, container?: HTMLElement) => void;
|
5
|
+
show: (selector: string, container?: HTMLElement) => void;
|
6
|
+
};
|
7
|
+
export declare function mockResizeObserver(): MockedResizeObserverController;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"module": "../fesm2015/heartlandone-vega-angular-testing.mjs",
|
3
|
+
"es2020": "../fesm2020/heartlandone-vega-angular-testing.mjs",
|
4
|
+
"esm2020": "../esm2020/testing/heartlandone-vega-angular-testing.mjs",
|
5
|
+
"fesm2020": "../fesm2020/heartlandone-vega-angular-testing.mjs",
|
6
|
+
"fesm2015": "../fesm2015/heartlandone-vega-angular-testing.mjs",
|
7
|
+
"typings": "heartlandone-vega-angular-testing.d.ts",
|
8
|
+
"sideEffects": false,
|
9
|
+
"name": "@heartlandone/vega-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1-angular/testing"
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './index';
|
package/karma.conf.js
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
// Karma configuration file, see link for more information
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
3
|
+
|
4
|
+
module.exports = function (config) {
|
5
|
+
config.set({
|
6
|
+
basePath: '',
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
8
|
+
plugins: [
|
9
|
+
require('karma-jasmine'),
|
10
|
+
require('karma-chrome-launcher'),
|
11
|
+
require('karma-jasmine-html-reporter'),
|
12
|
+
require('karma-coverage'),
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
14
|
+
],
|
15
|
+
client: {
|
16
|
+
jasmine: {
|
17
|
+
// you can add configuration options for Jasmine here
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
20
|
+
// or set a specific seed with `seed: 4321`
|
21
|
+
},
|
22
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
23
|
+
},
|
24
|
+
jasmineHtmlReporter: {
|
25
|
+
suppressAll: true // removes the duplicated traces
|
26
|
+
},
|
27
|
+
coverageReporter: {
|
28
|
+
dir: require('path').join(__dirname, '../../coverage/vega-angular'),
|
29
|
+
subdir: '.',
|
30
|
+
reporters: [
|
31
|
+
{ type: 'html' },
|
32
|
+
{ type: 'text-summary' }
|
33
|
+
]
|
34
|
+
},
|
35
|
+
reporters: ['progress', 'kjhtml'],
|
36
|
+
port: 9876,
|
37
|
+
colors: true,
|
38
|
+
logLevel: config.LOG_INFO,
|
39
|
+
autoWatch: true,
|
40
|
+
browsers: ['Chrome'],
|
41
|
+
singleRun: false,
|
42
|
+
restartOnFileChange: true
|
43
|
+
});
|
44
|
+
};
|
package/ng-package.json
ADDED
package/package.json
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"name": "@heartlandone/vega-angular-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1",
|
3
|
+
"sideEffects": false,
|
4
|
+
"version": "2.61.0",
|
5
|
+
"description": "Angular specific wrapper for @heartlandone/vega",
|
6
|
+
"license": "UNLICENSED",
|
7
|
+
"peerDependencies": {
|
8
|
+
"@angular/common": ">=12.0.0",
|
9
|
+
"@angular/core": ">=12.0.0"
|
10
|
+
},
|
11
|
+
"module": "./dist/fesm2015/heartlandone-vega-angular.mjs",
|
12
|
+
"es2020": "./dist/fesm2020/heartlandone-vega-angular.mjs",
|
13
|
+
"esm2020": "./dist/esm2020/heartlandone-vega-angular.mjs",
|
14
|
+
"fesm2020": "./dist/fesm2020/heartlandone-vega-angular.mjs",
|
15
|
+
"fesm2015": "./dist/fesm2015/heartlandone-vega-angular.mjs",
|
16
|
+
"typings": "./dist/heartlandone-vega-angular.d.ts",
|
17
|
+
"scripts": {
|
18
|
+
"stencil-postbuild": "node ./src/scripts/stencil-post-build-script.js",
|
19
|
+
"release": "../../node_modules/@angular/cli/bin/ng.js build vega-angular",
|
20
|
+
"publish:patch": "node ../../../scripts/publish-version.js patch",
|
21
|
+
"publish:minor": "node ../../../scripts/publish-version.js minor",
|
22
|
+
"publish:major": "node ../../../scripts/publish-version.js major",
|
23
|
+
"pr-codesandbox-auto": "node ../../../scripts/pr-codesandbox-auto/change-package-name.js"
|
24
|
+
},
|
25
|
+
"repository": {
|
26
|
+
"type": "git",
|
27
|
+
"url": "https://github.com/heartlandpayments/Vega/tree/main/vega-angular-workspace/projects/vega-angular"
|
28
|
+
},
|
29
|
+
"dependencies": {
|
30
|
+
"tslib": "^2.3.0",
|
31
|
+
"@juggle/resize-observer": "^3.4.0",
|
32
|
+
"@heartlandone/vega-sandbox-pr-2327-5b91658d7c54c195ad59a3ecd2b440a347320dd1": "latest"
|
33
|
+
},
|
34
|
+
"publishConfig": {
|
35
|
+
"directory": "dist"
|
36
|
+
},
|
37
|
+
"devDependencies": {}
|
38
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { defineCustomElements } from '@heartlandone/vega/loader';
|
3
|
+
import VegaComponents from './stencil-generated/components';
|
4
|
+
import { TextValueAccessor } from './stencil-generated/text-value-accessor';
|
5
|
+
import { ValueAccessor } from './stencil-generated/value-accessor';
|
6
|
+
import { ResizeObserver as VegaResizeObserver } from '@juggle/resize-observer';
|
7
|
+
import { FeatureFlag, VegaEnvManager, FrameworkEnum } from '@heartlandone/vega';
|
8
|
+
@NgModule({
|
9
|
+
declarations: [...VegaComponents, TextValueAccessor, ValueAccessor],
|
10
|
+
imports: [],
|
11
|
+
exports: [...VegaComponents, TextValueAccessor, ValueAccessor],
|
12
|
+
})
|
13
|
+
export class VegaComponentModule {
|
14
|
+
constructor() {
|
15
|
+
this.useJuggleResizeObserver();
|
16
|
+
VegaEnvManager.setVegaFramework(FrameworkEnum.Angular);
|
17
|
+
defineCustomElements(window).then();
|
18
|
+
}
|
19
|
+
|
20
|
+
useJuggleResizeObserver(){
|
21
|
+
if(FeatureFlag.isEnabled('VEGA_ANGULAR.USE_JUGGLE_RESIZE_OBSERVER')){
|
22
|
+
Object.assign(window, {
|
23
|
+
'VegaResizeObserver': VegaResizeObserver
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
/* tslint:disable */
|
3
|
+
import { FeatureFlag } from '@heartlandone/vega';
|
4
|
+
import { fromEvent } from 'rxjs';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* ALL: all properties should skip the componentOnReady check
|
8
|
+
* Set<string>: only properties in the Set should skip the componentOnReady check
|
9
|
+
*/
|
10
|
+
const COMPONENT_ON_READY_IGNORE_MAP = new Map<string, Set<string> | 'ALL'>([
|
11
|
+
['VEGA-TABLE', 'ALL'],
|
12
|
+
['VEGA-TABLE-HEAD', 'ALL'],
|
13
|
+
['VEGA-TABLE-HEAD-ROW', 'ALL'],
|
14
|
+
['VEGA-TABLE-HEAD-CELL', 'ALL'],
|
15
|
+
['VEGA-TABLE-BODY', 'ALL'],
|
16
|
+
['VEGA-TABLE-ROW', 'ALL'],
|
17
|
+
['VEGA-TABLE-CELL', 'ALL'],
|
18
|
+
['VEGA-TABLE-EXPAND-ROW', 'ALL'],
|
19
|
+
]);
|
20
|
+
|
21
|
+
const shouldSkipComponentOnReady = (componentName: string, propName: string): boolean => {
|
22
|
+
const props: Set<string> | 'ALL' | undefined = COMPONENT_ON_READY_IGNORE_MAP.get(componentName);
|
23
|
+
|
24
|
+
if (!props) return false;
|
25
|
+
|
26
|
+
return props === 'ALL' || props.has(propName);
|
27
|
+
};
|
28
|
+
|
29
|
+
export const proxyInputs = (Cmp: any, inputs: string[]) => {
|
30
|
+
const Prototype = Cmp.prototype;
|
31
|
+
inputs.forEach(item => {
|
32
|
+
Object.defineProperty(Prototype, item, {
|
33
|
+
get() {
|
34
|
+
return this.el[item];
|
35
|
+
},
|
36
|
+
set(val: any) {
|
37
|
+
// Link issues: https://gethired.atlassian.net/browse/GHUI-331
|
38
|
+
// add a beforehand checking to make sure value is only set when component is loaded
|
39
|
+
/*
|
40
|
+
* Update(2023/10/28): The value should be set directly, so that the initial value can be get in componentWillLoad.
|
41
|
+
* Link issue https://gethired.atlassian.net/browse/VD-1810
|
42
|
+
* We need to consider remove the componentOnReady
|
43
|
+
* https://github.com/ionic-team/stencil-ds-output-targets/blob/main/packages/angular-output-target/angular-component-lib/utils.ts#L13
|
44
|
+
*/
|
45
|
+
if (FeatureFlag.isEnabled('VEGA_FRAMEWORK.PREVENT_CALL_WATCH_METHOD_BEFORE_COMPONENT_LOAD') || this.el.classList.contains('hydrated') || shouldSkipComponentOnReady(this.el.tagName, item)) {
|
46
|
+
this.z.runOutsideAngular(() => (this.el[item] = val));
|
47
|
+
} else {
|
48
|
+
this.el.componentOnReady().then(() => {
|
49
|
+
this.z.runOutsideAngular(() => (this.el[item] = val))
|
50
|
+
})
|
51
|
+
}
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
};
|
56
|
+
|
57
|
+
export const proxyMethods = (Cmp: any, methods: string[]) => {
|
58
|
+
const Prototype = Cmp.prototype;
|
59
|
+
methods.forEach(methodName => {
|
60
|
+
Prototype[methodName] = function () {
|
61
|
+
const args = arguments;
|
62
|
+
return this.z.runOutsideAngular(() =>
|
63
|
+
this.el[methodName].apply(this.el, args)
|
64
|
+
);
|
65
|
+
};
|
66
|
+
});
|
67
|
+
};
|
68
|
+
|
69
|
+
export const proxyOutputs = (instance: any, el: any, events: string[]) => {
|
70
|
+
events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
|
71
|
+
}
|
72
|
+
|
73
|
+
export const defineCustomElement = (tagName: string, customElement: any) => {
|
74
|
+
if (
|
75
|
+
customElement !== undefined &&
|
76
|
+
typeof customElements !== 'undefined' &&
|
77
|
+
!customElements.get(tagName)
|
78
|
+
) {
|
79
|
+
customElements.define(tagName, customElement);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
// tslint:disable-next-line: only-arrow-functions
|
84
|
+
export function ProxyCmp(opts: { defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
|
85
|
+
const decorator = function (cls: any) {
|
86
|
+
const { defineCustomElementFn, inputs, methods } = opts;
|
87
|
+
|
88
|
+
if (defineCustomElementFn !== undefined) {
|
89
|
+
defineCustomElementFn();
|
90
|
+
}
|
91
|
+
|
92
|
+
if (inputs) {
|
93
|
+
proxyInputs(cls, inputs);
|
94
|
+
}
|
95
|
+
if (methods) {
|
96
|
+
proxyMethods(cls, methods);
|
97
|
+
}
|
98
|
+
return cls;
|
99
|
+
};
|
100
|
+
return decorator;
|
101
|
+
}
|