@globalpayments/vega-angular 2.87.0-beta.0 → 2.87.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/dist/LICENSE +13 -0
- package/dist/README.md +86 -0
- package/{esm2020 → dist/esm2020}/lib/stencil-generated/components.mjs +8 -8
- package/{esm2020 → dist/esm2020}/testing/index.mjs +2 -2
- package/{fesm2015 → dist/fesm2015}/globalpayments-vega-angular-testing.mjs +1 -1
- package/dist/fesm2015/globalpayments-vega-angular-testing.mjs.map +1 -0
- package/{fesm2015 → dist/fesm2015}/globalpayments-vega-angular.mjs +7 -7
- package/dist/fesm2015/globalpayments-vega-angular.mjs.map +1 -0
- package/{fesm2020 → dist/fesm2020}/globalpayments-vega-angular-testing.mjs +1 -1
- package/dist/fesm2020/globalpayments-vega-angular-testing.mjs.map +1 -0
- package/{fesm2020 → dist/fesm2020}/globalpayments-vega-angular.mjs +7 -7
- package/dist/fesm2020/globalpayments-vega-angular.mjs.map +1 -0
- package/{lib → dist/lib}/stencil-generated/components.d.ts +11 -2
- package/dist/package.json +50 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +11 -0
- package/package.json +18 -30
- 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 +4085 -0
- package/src/lib/stencil-generated/text-value-accessor.ts +25 -0
- package/src/lib/stencil-generated/value-accessor.ts +46 -0
- package/src/public-api.ts +7 -0
- package/src/scripts/stencil-post-build-script.js +138 -0
- package/src/test.ts +27 -0
- package/testing/index.ts +128 -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
- package/fesm2015/globalpayments-vega-angular-testing.mjs.map +0 -1
- package/fesm2015/globalpayments-vega-angular.mjs.map +0 -1
- package/fesm2020/globalpayments-vega-angular-testing.mjs.map +0 -1
- package/fesm2020/globalpayments-vega-angular.mjs.map +0 -1
- /package/{esm2020 → dist/esm2020}/globalpayments-vega-angular.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/lib/components-module.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/lib/stencil-generated/angular-component-lib/utils.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/lib/stencil-generated/text-value-accessor.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/lib/stencil-generated/value-accessor.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/public-api.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/testing/globalpayments-vega-angular-testing.mjs +0 -0
- /package/{esm2020 → dist/esm2020}/testing/public-api.mjs +0 -0
- /package/{globalpayments-vega-angular.d.ts → dist/globalpayments-vega-angular.d.ts} +0 -0
- /package/{lib → dist/lib}/components-module.d.ts +0 -0
- /package/{lib → dist/lib}/stencil-generated/angular-component-lib/utils.d.ts +0 -0
- /package/{lib → dist/lib}/stencil-generated/text-value-accessor.d.ts +0 -0
- /package/{lib → dist/lib}/stencil-generated/value-accessor.d.ts +0 -0
- /package/{public-api.d.ts → dist/public-api.d.ts} +0 -0
- /package/{testing → dist/testing}/globalpayments-vega-angular-testing.d.ts +0 -0
- /package/{testing → dist/testing}/index.d.ts +0 -0
- /package/{testing → dist/testing}/package.json +0 -0
- /package/{testing → dist/testing}/public-api.d.ts +0 -0
|
@@ -4,6 +4,7 @@ import type { VegaBannerActionButtonType as IVegaBannerVegaBannerActionButtonTyp
|
|
|
4
4
|
import type { VegaBreadcrumbItemType as IVegaBreadcrumbVegaBreadcrumbItemType } from '@globalpayments/vega/dist/types/components/vega-breadcrumb/types';
|
|
5
5
|
import type { VegaCalendarChangeEventType as IVegaCalendarVegaCalendarChangeEventType } from '@globalpayments/vega/dist/types/components/vega-calendar/types';
|
|
6
6
|
import type { VegaCalendarEventClickInfo as IVegaCalendarVegaCalendarEventClickInfo } from '@globalpayments/vega/dist/types/components/vega-calendar/types';
|
|
7
|
+
import type { VegaCalendarEventEditInfo as IVegaCalendarVegaCalendarEventEditInfo } from '@globalpayments/vega/dist/types/components/vega-calendar/types';
|
|
7
8
|
import type { VegaCalendarDateClickInfo as IVegaCalendarVegaCalendarDateClickInfo } from '@globalpayments/vega/dist/types/components/vega-calendar/types';
|
|
8
9
|
import type { VegaCodeBlockValue as IVegaCodeBlockVegaCodeBlockValue } from '@globalpayments/vega/dist/types/components/vega-code-block/types';
|
|
9
10
|
import type { DatePickerMonthYearTypes as IVegaDatePickerDatePickerMonthYearTypes } from '@globalpayments/vega/dist/types/components/vega-date-picker/types';
|
|
@@ -285,6 +286,14 @@ export declare interface VegaCalendar extends Components.VegaCalendar {
|
|
|
285
286
|
* An event emitter notifying that a component event item is clicked. @eventSemantics namespace:native,@vegaVersion 2.14.0
|
|
286
287
|
*/
|
|
287
288
|
eventClick: EventEmitter<CustomEvent<IVegaCalendarVegaCalendarEventClickInfo>>;
|
|
289
|
+
/**
|
|
290
|
+
* An event emitter notifying that a calendar event edit action is triggered from the event preview popover. @vegaVersion 2.87.0
|
|
291
|
+
*/
|
|
292
|
+
vegaEventEdit: EventEmitter<CustomEvent<IVegaCalendarVegaCalendarEventEditInfo>>;
|
|
293
|
+
/**
|
|
294
|
+
* An event emitter notifying that a calendar event edit action is triggered from the event preview popover. @eventSemantics namespace:native,@vegaVersion 2.87.0
|
|
295
|
+
*/
|
|
296
|
+
eventEdit: EventEmitter<CustomEvent<IVegaCalendarVegaCalendarEventEditInfo>>;
|
|
288
297
|
/**
|
|
289
298
|
* An event emitter notifying that a calendar date item has been double-clicked. The event will not be triggered if `enableDataClick` is set to true to prevent conflicts. @vegaVersion 2.17.0
|
|
290
299
|
*/
|
|
@@ -315,7 +324,7 @@ export declare class VegaCalendar {
|
|
|
315
324
|
protected el: HTMLElement;
|
|
316
325
|
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
317
326
|
static ɵfac: i0.ɵɵFactoryDeclaration<VegaCalendar, never>;
|
|
318
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VegaCalendar, "vega-calendar", never, { "enableDateClick": "enableDateClick"; "enabledEventPreview": "enabledEventPreview"; "events": "events"; "isDateDisabled": "isDateDisabled"; "moreActionDropdownProps": "moreActionDropdownProps"; "showEventColorBar": "showEventColorBar"; "showSwitchView": "showSwitchView"; "showWeekends": "showWeekends"; "timeFormat": "timeFormat"; "timezone": "timezone"; "viewMode": "viewMode"; }, {}, never, ["*"]>;
|
|
327
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VegaCalendar, "vega-calendar", never, { "enableDateClick": "enableDateClick"; "enabledEventPreview": "enabledEventPreview"; "eventEditable": "eventEditable"; "events": "events"; "getEventPreviewActions": "getEventPreviewActions"; "isDateDisabled": "isDateDisabled"; "moreActionDropdownProps": "moreActionDropdownProps"; "showEventColorBar": "showEventColorBar"; "showSwitchView": "showSwitchView"; "showWeekends": "showWeekends"; "timeFormat": "timeFormat"; "timezone": "timezone"; "viewMode": "viewMode"; }, {}, never, ["*"]>;
|
|
319
328
|
}
|
|
320
329
|
export declare interface VegaCalendarEvent extends Components.VegaCalendarEvent {
|
|
321
330
|
}
|
|
@@ -2095,7 +2104,7 @@ export declare class VegaTable {
|
|
|
2095
2104
|
protected el: HTMLElement;
|
|
2096
2105
|
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
2097
2106
|
static ɵfac: i0.ɵɵFactoryDeclaration<VegaTable, never>;
|
|
2098
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VegaTable, "vega-table", never, { "columnDivider": "columnDivider"; "columns": "columns"; "dataSource": "dataSource"; "density": "density"; "emptyDescription": "emptyDescription"; "groupColumns": "groupColumns"; "paddingX": "paddingX"; "pagination": "pagination"; "rowClickable": "rowClickable"; "rowDivider": "rowDivider"; "rowDraggable": "rowDraggable"; "rowExpandable": "rowExpandable"; "rowKey": "rowKey"; "rowSelection": "rowSelection"; "scrollConfig": "scrollConfig"; "showHeader": "showHeader"; "sortConfig": "sortConfig"; "striped": "striped"; }, {}, never, ["*"]>;
|
|
2107
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VegaTable, "vega-table", never, { "columnDivider": "columnDivider"; "columns": "columns"; "dataSource": "dataSource"; "density": "density"; "emptyDescription": "emptyDescription"; "groupColumns": "groupColumns"; "paddingX": "paddingX"; "pagination": "pagination"; "rowClickable": "rowClickable"; "rowDivider": "rowDivider"; "rowDraggable": "rowDraggable"; "rowExpandable": "rowExpandable"; "rowKey": "rowKey"; "rowSelection": "rowSelection"; "scrollConfig": "scrollConfig"; "showEditError": "showEditError"; "showHeader": "showHeader"; "sortConfig": "sortConfig"; "striped": "striped"; }, {}, never, ["*"]>;
|
|
2099
2108
|
}
|
|
2100
2109
|
export declare interface VegaTableBody extends Components.VegaTableBody {
|
|
2101
2110
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@globalpayments/vega-angular",
|
|
3
|
+
"sideEffects": false,
|
|
4
|
+
"version": "2.86.0",
|
|
5
|
+
"description": "Angular specific wrapper for @globalpayments/vega",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@angular/common": ">=12.0.0",
|
|
9
|
+
"@angular/core": ">=12.0.0"
|
|
10
|
+
},
|
|
11
|
+
"module": "fesm2015/globalpayments-vega-angular.mjs",
|
|
12
|
+
"es2020": "fesm2020/globalpayments-vega-angular.mjs",
|
|
13
|
+
"esm2020": "esm2020/globalpayments-vega-angular.mjs",
|
|
14
|
+
"fesm2020": "fesm2020/globalpayments-vega-angular.mjs",
|
|
15
|
+
"fesm2015": "fesm2015/globalpayments-vega-angular.mjs",
|
|
16
|
+
"typings": "globalpayments-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
|
+
"@globalpayments/vega": "2.86.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": "./globalpayments-vega-angular.d.ts",
|
|
35
|
+
"esm2020": "./esm2020/globalpayments-vega-angular.mjs",
|
|
36
|
+
"es2020": "./fesm2020/globalpayments-vega-angular.mjs",
|
|
37
|
+
"es2015": "./fesm2015/globalpayments-vega-angular.mjs",
|
|
38
|
+
"node": "./fesm2015/globalpayments-vega-angular.mjs",
|
|
39
|
+
"default": "./fesm2020/globalpayments-vega-angular.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./testing": {
|
|
42
|
+
"types": "./testing/globalpayments-vega-angular-testing.d.ts",
|
|
43
|
+
"esm2020": "./esm2020/testing/globalpayments-vega-angular-testing.mjs",
|
|
44
|
+
"es2020": "./fesm2020/globalpayments-vega-angular-testing.mjs",
|
|
45
|
+
"es2015": "./fesm2015/globalpayments-vega-angular-testing.mjs",
|
|
46
|
+
"node": "./fesm2015/globalpayments-vega-angular-testing.mjs",
|
|
47
|
+
"default": "./fesm2020/globalpayments-vega-angular-testing.mjs"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
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
CHANGED
|
@@ -1,50 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@globalpayments/vega-angular",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "2.87.0
|
|
4
|
+
"version": "2.87.0",
|
|
5
5
|
"description": "Angular specific wrapper for @globalpayments/vega",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@angular/common": ">=12.0.0",
|
|
9
9
|
"@angular/core": ">=12.0.0"
|
|
10
10
|
},
|
|
11
|
-
"module": "fesm2015/globalpayments-vega-angular.mjs",
|
|
12
|
-
"es2020": "fesm2020/globalpayments-vega-angular.mjs",
|
|
13
|
-
"esm2020": "esm2020/globalpayments-vega-angular.mjs",
|
|
14
|
-
"fesm2020": "fesm2020/globalpayments-vega-angular.mjs",
|
|
15
|
-
"fesm2015": "fesm2015/globalpayments-vega-angular.mjs",
|
|
16
|
-
"typings": "globalpayments-vega-angular.d.ts",
|
|
11
|
+
"module": "./dist/fesm2015/globalpayments-vega-angular.mjs",
|
|
12
|
+
"es2020": "./dist/fesm2020/globalpayments-vega-angular.mjs",
|
|
13
|
+
"esm2020": "./dist/esm2020/globalpayments-vega-angular.mjs",
|
|
14
|
+
"fesm2020": "./dist/fesm2020/globalpayments-vega-angular.mjs",
|
|
15
|
+
"fesm2015": "./dist/fesm2015/globalpayments-vega-angular.mjs",
|
|
16
|
+
"typings": "./dist/globalpayments-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
|
+
},
|
|
17
25
|
"repository": {
|
|
18
26
|
"type": "git",
|
|
19
27
|
"url": "https://github.com/heartlandpayments/Vega/tree/main/vega-angular-workspace/projects/vega-angular"
|
|
20
28
|
},
|
|
21
29
|
"dependencies": {
|
|
22
|
-
"@globalpayments/vega": "2.87.0
|
|
30
|
+
"@globalpayments/vega": "2.87.0",
|
|
23
31
|
"tslib": "^2.3.0",
|
|
24
32
|
"@juggle/resize-observer": "^3.4.0"
|
|
25
33
|
},
|
|
26
34
|
"publishConfig": {
|
|
27
35
|
"directory": "dist"
|
|
28
36
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"default": "./package.json"
|
|
32
|
-
},
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./globalpayments-vega-angular.d.ts",
|
|
35
|
-
"esm2020": "./esm2020/globalpayments-vega-angular.mjs",
|
|
36
|
-
"es2020": "./fesm2020/globalpayments-vega-angular.mjs",
|
|
37
|
-
"es2015": "./fesm2015/globalpayments-vega-angular.mjs",
|
|
38
|
-
"node": "./fesm2015/globalpayments-vega-angular.mjs",
|
|
39
|
-
"default": "./fesm2020/globalpayments-vega-angular.mjs"
|
|
40
|
-
},
|
|
41
|
-
"./testing": {
|
|
42
|
-
"types": "./testing/globalpayments-vega-angular-testing.d.ts",
|
|
43
|
-
"esm2020": "./esm2020/testing/globalpayments-vega-angular-testing.mjs",
|
|
44
|
-
"es2020": "./fesm2020/globalpayments-vega-angular-testing.mjs",
|
|
45
|
-
"es2015": "./fesm2015/globalpayments-vega-angular-testing.mjs",
|
|
46
|
-
"node": "./fesm2015/globalpayments-vega-angular-testing.mjs",
|
|
47
|
-
"default": "./fesm2020/globalpayments-vega-angular-testing.mjs"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
37
|
+
"devDependencies": {}
|
|
38
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { defineCustomElements } from '@globalpayments/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 '@globalpayments/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 '@globalpayments/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
|
+
}
|