@heartlandone/vega-angular 1.3.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.
Files changed (39) hide show
  1. package/.browserslistrc +16 -0
  2. package/.prettierrc.js +13 -0
  3. package/LICENSE +21 -0
  4. package/README.md +132 -0
  5. package/dist/LICENSE +21 -0
  6. package/dist/README.md +132 -0
  7. package/dist/esm2020/heartlandone-vega-angular.mjs +5 -0
  8. package/dist/esm2020/lib/components-module.mjs +24 -0
  9. package/dist/esm2020/lib/stencil-generated/angular-component-lib/utils.mjs +62 -0
  10. package/dist/esm2020/lib/stencil-generated/components.mjs +953 -0
  11. package/dist/esm2020/lib/stencil-generated/text-value-accessor.mjs +35 -0
  12. package/dist/esm2020/lib/stencil-generated/value-accessor.mjs +44 -0
  13. package/dist/esm2020/public-api.mjs +8 -0
  14. package/dist/fesm2015/heartlandone-vega-angular.mjs +1079 -0
  15. package/dist/fesm2015/heartlandone-vega-angular.mjs.map +1 -0
  16. package/dist/fesm2020/heartlandone-vega-angular.mjs +1079 -0
  17. package/dist/fesm2020/heartlandone-vega-angular.mjs.map +1 -0
  18. package/dist/heartlandone-vega-angular.d.ts +5 -0
  19. package/dist/lib/components-module.d.ts +10 -0
  20. package/dist/lib/stencil-generated/angular-component-lib/utils.d.ts +9 -0
  21. package/dist/lib/stencil-generated/components.d.ts +467 -0
  22. package/dist/lib/stencil-generated/text-value-accessor.d.ts +8 -0
  23. package/dist/lib/stencil-generated/value-accessor.d.ts +18 -0
  24. package/dist/package.json +40 -0
  25. package/dist/public-api.d.ts +4 -0
  26. package/karma.conf.js +44 -0
  27. package/ng-package.json +10 -0
  28. package/package.json +36 -0
  29. package/src/lib/components-module.ts +16 -0
  30. package/src/lib/stencil-generated/angular-component-lib/utils.ts +71 -0
  31. package/src/lib/stencil-generated/components.ts +1007 -0
  32. package/src/lib/stencil-generated/text-value-accessor.ts +24 -0
  33. package/src/lib/stencil-generated/value-accessor.ts +42 -0
  34. package/src/public-api.ts +7 -0
  35. package/src/scripts/stencil-post-build-script.js +59 -0
  36. package/src/test.ts +27 -0
  37. package/tsconfig.lib.json +15 -0
  38. package/tsconfig.lib.prod.json +10 -0
  39. package/tsconfig.spec.json +17 -0
@@ -0,0 +1,16 @@
1
+ # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+
5
+ # For the full list of supported browsers by the Angular framework, please see:
6
+ # https://angular.io/guide/browser-support
7
+
8
+ # You can see what browsers were selected by your queries by running:
9
+ # npx browserslist
10
+
11
+ last 1 Chrome version
12
+ last 1 Firefox version
13
+ last 2 Edge major versions
14
+ last 2 Safari major versions
15
+ last 2 iOS major versions
16
+ Firefox ESR
package/.prettierrc.js ADDED
@@ -0,0 +1,13 @@
1
+ // JetBrains cannot pick up .prettierrc.json correctly, hence we use js config file format here instead
2
+ module.exports = {
3
+ arrowParens: 'avoid',
4
+ bracketSpacing: true,
5
+ jsxBracketSameLine: false,
6
+ jsxSingleQuote: false,
7
+ quoteProps: 'consistent',
8
+ printWidth: 110,
9
+ semi: true,
10
+ singleQuote: true,
11
+ tabWidth: 2,
12
+ trailingComma: 'all',
13
+ };
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # VegaAngular
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ This is the Angular specific wrapper for [@heartlandone/vega](https://gitlab.com/heartland1/vega/tiger/-/tree/main/vega-stencil) with the following file structure (we only list some important file path):
6
+ ```text
7
+ ...
8
+ ├── src
9
+ │   ├── lib
10
+ │   │   ├── components-module.ts
11
+ │   │   └── stencil-generated
12
+ │   │   ├── angular-component-lib
13
+ │   │   │   └── utils.ts
14
+ │   │   └── components.ts =>
15
+ │   ...
16
+ ...
17
+ ```
18
+ * `./src/lib/components-module.ts`: angular module used to export auto-generated angular directive proxies
19
+ * `./src/lib/stencil-generated/components.ts`: stencil auto-generated angular directive proxies which can be used as angular components after import
20
+ * `./src/lib/stencil-generated/angular-component-lib/utils.ts`: utility class including proxy related functions used by `components.ts`
21
+
22
+ ## How to use
23
+
24
+ Before installing the packages under `@heartland` namespace, make sure you have the right npm registry setup by running
25
+
26
+ ```bash
27
+ > npm config set @heartlandone:registry https://gitlab.com/api/v4/projects/27998157/packages/npm/
28
+ > npm config set -- '//gitlab.example.com/api/v4/projects/27998157/packages/npm/:_authToken' "<your_access_token>"
29
+ ```
30
+
31
+ and verified the `~/.npmrc` is updated correctly as below:
32
+
33
+ ```text
34
+ @heartlandone:registry=https://gitlab.com/api/v4/projects/27998157/packages/npm/
35
+ //gitlab.com/api/v4/projects/27998157/packages/npm/:_authToken=<your_access_token>
36
+ ```
37
+
38
+ Install the lib to your angular package by running:
39
+ ```bash
40
+ > npm install @heartlandone/vega-angular
41
+ ```
42
+
43
+
44
+ Add the Vega CSS file (`vega.css` or `vega_min.css`) into `angular.json`
45
+
46
+ ```json
47
+ "styles": [
48
+ ... ...
49
+ "node_modules/@heartlandone/vega/style/vega.css"
50
+ ]
51
+ ```
52
+
53
+ Import the `VegaComponentModule` to your app module for introducing the vega components, e.g.:
54
+ ```ts
55
+ /** app.module.ts */
56
+
57
+ import { NgModule } from '@angular/core';
58
+ import { AppComponent } from './app.component';
59
+ import { VegaComponentModule } from '@heartlandone/vega-angular';
60
+
61
+ @NgModule({
62
+ declarations: [AppComponent],
63
+ imports: [VegaComponentModule],
64
+ providers: [],
65
+ bootstrap: [AppComponent],
66
+ })
67
+ export class AppModule {}
68
+ ```
69
+ Then introduce the vega component into your template:
70
+ ```html
71
+ <!-- app.component.html -->
72
+ <vega-button variant='primary' label='checkout'></vega-button>
73
+ ```
74
+
75
+ ## For development
76
+
77
+ ### Pre-requisite
78
+ Make sure all the dependencies has been installed by running
79
+ ```bash
80
+ > npm run install
81
+ ```
82
+
83
+ ### Consuming change in `vega-stencil`
84
+ Once you build `vega-stencil` with command `npm run build`, stencil will auto populate corresponding component classes into
85
+ `./src/lib/stencil-generated/components.ts`
86
+
87
+ **keeping in mind, if there is a new component created, you need to modify `./src/lib/components-module.ts` to import the new component**
88
+
89
+ ### Get started
90
+ To generate the compiled lib version for `vega-angular` please run
91
+ ```bash
92
+ > ng build vega-angular
93
+ ```
94
+ And the built lib can be found in `./dist/vega-angular`
95
+
96
+ In order to use the unpublished lib `vega-angular` directly for your angular app package, you can choose one of the following options:
97
+ 1. Directly install the local package into your angular app package by running:
98
+ ```bash
99
+ > npm install file:<relative path to "./dist/vega-angular">
100
+ ```
101
+ 2. Use [npm symlink](https://docs.npmjs.com/cli/v8/commands/npm-link) by running
102
+ ```bash
103
+ > npm link
104
+ ```
105
+ **Note:** you might also want to setup the symlink for vega-stencil as it is a direct dependency of vega-angular, so you can consume the local change in both package for your angular app
106
+
107
+ ### Troubleshoot
108
+ If you encounter the following error
109
+ ```bash
110
+ ✖ Compiling with Angular sources in Ivy partial compilation mode.
111
+ ../../projects/vega-angular/src/lib/stencil-generated/value-accessor.ts:4:1 - error NG2004: Directive ValueAccessor has no selector, please add it!
112
+
113
+ 4 @Directive({})
114
+ ~~~~~~~~~~~~~~
115
+ 5 export class ValueAccessor implements ControlValueAccessor {
116
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
+ ...
118
+ 38 }
119
+ ~~~
120
+ 39 }
121
+ ~
122
+ ```
123
+ this is a known issue in stencil https://github.com/ionic-team/stencil-ds-output-targets/issues/174, please add the selector `vega-value-accessor` like below to fix this issue:
124
+ ```ts
125
+ @Directive({ selector: 'vega-value-accessor' })
126
+ export class ValueAccessor implements ControlValueAccessor {
127
+ ...
128
+ }
129
+ ```
130
+
131
+ ### Publish the package
132
+ Please check [our general wiki](https://gitlab.com/heartland1/vega/tiger/-/blob/main/readme.md#publish-package)
package/dist/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # VegaAngular
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
4
+
5
+ This is the Angular specific wrapper for [@heartlandone/vega](https://gitlab.com/heartland1/vega/tiger/-/tree/main/vega-stencil) with the following file structure (we only list some important file path):
6
+ ```text
7
+ ...
8
+ ├── src
9
+ │   ├── lib
10
+ │   │   ├── components-module.ts
11
+ │   │   └── stencil-generated
12
+ │   │   ├── angular-component-lib
13
+ │   │   │   └── utils.ts
14
+ │   │   └── components.ts =>
15
+ │   ...
16
+ ...
17
+ ```
18
+ * `./src/lib/components-module.ts`: angular module used to export auto-generated angular directive proxies
19
+ * `./src/lib/stencil-generated/components.ts`: stencil auto-generated angular directive proxies which can be used as angular components after import
20
+ * `./src/lib/stencil-generated/angular-component-lib/utils.ts`: utility class including proxy related functions used by `components.ts`
21
+
22
+ ## How to use
23
+
24
+ Before installing the packages under `@heartland` namespace, make sure you have the right npm registry setup by running
25
+
26
+ ```bash
27
+ > npm config set @heartlandone:registry https://gitlab.com/api/v4/projects/27998157/packages/npm/
28
+ > npm config set -- '//gitlab.example.com/api/v4/projects/27998157/packages/npm/:_authToken' "<your_access_token>"
29
+ ```
30
+
31
+ and verified the `~/.npmrc` is updated correctly as below:
32
+
33
+ ```text
34
+ @heartlandone:registry=https://gitlab.com/api/v4/projects/27998157/packages/npm/
35
+ //gitlab.com/api/v4/projects/27998157/packages/npm/:_authToken=<your_access_token>
36
+ ```
37
+
38
+ Install the lib to your angular package by running:
39
+ ```bash
40
+ > npm install @heartlandone/vega-angular
41
+ ```
42
+
43
+
44
+ Add the Vega CSS file (`vega.css` or `vega_min.css`) into `angular.json`
45
+
46
+ ```json
47
+ "styles": [
48
+ ... ...
49
+ "node_modules/@heartlandone/vega/style/vega.css"
50
+ ]
51
+ ```
52
+
53
+ Import the `VegaComponentModule` to your app module for introducing the vega components, e.g.:
54
+ ```ts
55
+ /** app.module.ts */
56
+
57
+ import { NgModule } from '@angular/core';
58
+ import { AppComponent } from './app.component';
59
+ import { VegaComponentModule } from '@heartlandone/vega-angular';
60
+
61
+ @NgModule({
62
+ declarations: [AppComponent],
63
+ imports: [VegaComponentModule],
64
+ providers: [],
65
+ bootstrap: [AppComponent],
66
+ })
67
+ export class AppModule {}
68
+ ```
69
+ Then introduce the vega component into your template:
70
+ ```html
71
+ <!-- app.component.html -->
72
+ <vega-button variant='primary' label='checkout'></vega-button>
73
+ ```
74
+
75
+ ## For development
76
+
77
+ ### Pre-requisite
78
+ Make sure all the dependencies has been installed by running
79
+ ```bash
80
+ > npm run install
81
+ ```
82
+
83
+ ### Consuming change in `vega-stencil`
84
+ Once you build `vega-stencil` with command `npm run build`, stencil will auto populate corresponding component classes into
85
+ `./src/lib/stencil-generated/components.ts`
86
+
87
+ **keeping in mind, if there is a new component created, you need to modify `./src/lib/components-module.ts` to import the new component**
88
+
89
+ ### Get started
90
+ To generate the compiled lib version for `vega-angular` please run
91
+ ```bash
92
+ > ng build vega-angular
93
+ ```
94
+ And the built lib can be found in `./dist/vega-angular`
95
+
96
+ In order to use the unpublished lib `vega-angular` directly for your angular app package, you can choose one of the following options:
97
+ 1. Directly install the local package into your angular app package by running:
98
+ ```bash
99
+ > npm install file:<relative path to "./dist/vega-angular">
100
+ ```
101
+ 2. Use [npm symlink](https://docs.npmjs.com/cli/v8/commands/npm-link) by running
102
+ ```bash
103
+ > npm link
104
+ ```
105
+ **Note:** you might also want to setup the symlink for vega-stencil as it is a direct dependency of vega-angular, so you can consume the local change in both package for your angular app
106
+
107
+ ### Troubleshoot
108
+ If you encounter the following error
109
+ ```bash
110
+ ✖ Compiling with Angular sources in Ivy partial compilation mode.
111
+ ../../projects/vega-angular/src/lib/stencil-generated/value-accessor.ts:4:1 - error NG2004: Directive ValueAccessor has no selector, please add it!
112
+
113
+ 4 @Directive({})
114
+ ~~~~~~~~~~~~~~
115
+ 5 export class ValueAccessor implements ControlValueAccessor {
116
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117
+ ...
118
+ 38 }
119
+ ~~~
120
+ 39 }
121
+ ~
122
+ ```
123
+ this is a known issue in stencil https://github.com/ionic-team/stencil-ds-output-targets/issues/174, please add the selector `vega-value-accessor` like below to fix this issue:
124
+ ```ts
125
+ @Directive({ selector: 'vega-value-accessor' })
126
+ export class ValueAccessor implements ControlValueAccessor {
127
+ ...
128
+ }
129
+ ```
130
+
131
+ ### Publish the package
132
+ Please check [our general wiki](https://gitlab.com/heartland1/vega/tiger/-/blob/main/readme.md#publish-package)
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVhcnRsYW5kb25lLXZlZ2EtYW5ndWxhci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9oZWFydGxhbmRvbmUtdmVnYS1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
@@ -0,0 +1,24 @@
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 * as i0 from "@angular/core";
7
+ import * as i1 from "./stencil-generated/components";
8
+ export class VegaComponentModule {
9
+ constructor() {
10
+ defineCustomElements(window).then();
11
+ }
12
+ }
13
+ VegaComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: VegaComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
14
+ VegaComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: VegaComponentModule, declarations: [i1.VegaAccordion, i1.VegaAppFooter, i1.VegaBadge, i1.VegaButton, i1.VegaButtonCircle, i1.VegaButtonLink, i1.VegaCard, i1.VegaCarousel, i1.VegaCheckbox, i1.VegaCheckboxGroup, i1.VegaDatePicker, i1.VegaDropdown, i1.VegaFlex, i1.VegaFooter, i1.VegaForm, i1.VegaGrid, i1.VegaHeader, i1.VegaIcon, i1.VegaInput, i1.VegaInputSelect, i1.VegaItemToggle, i1.VegaModal, i1.VegaOption, i1.VegaPagination, i1.VegaProgressTracker, i1.VegaRadio, i1.VegaRadioGroup, i1.VegaSidenav, i1.VegaSidenavGroup, i1.VegaSidenavLink, i1.VegaStepper, i1.VegaTabGroup, i1.VegaTable, i1.VegaToggleSwitch, i1.VegaTooltip, TextValueAccessor, ValueAccessor], exports: [i1.VegaAccordion, i1.VegaAppFooter, i1.VegaBadge, i1.VegaButton, i1.VegaButtonCircle, i1.VegaButtonLink, i1.VegaCard, i1.VegaCarousel, i1.VegaCheckbox, i1.VegaCheckboxGroup, i1.VegaDatePicker, i1.VegaDropdown, i1.VegaFlex, i1.VegaFooter, i1.VegaForm, i1.VegaGrid, i1.VegaHeader, i1.VegaIcon, i1.VegaInput, i1.VegaInputSelect, i1.VegaItemToggle, i1.VegaModal, i1.VegaOption, i1.VegaPagination, i1.VegaProgressTracker, i1.VegaRadio, i1.VegaRadioGroup, i1.VegaSidenav, i1.VegaSidenavGroup, i1.VegaSidenavLink, i1.VegaStepper, i1.VegaTabGroup, i1.VegaTable, i1.VegaToggleSwitch, i1.VegaTooltip, TextValueAccessor, ValueAccessor] });
15
+ VegaComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: VegaComponentModule, imports: [[]] });
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: VegaComponentModule, decorators: [{
17
+ type: NgModule,
18
+ args: [{
19
+ declarations: [...VegaComponents, TextValueAccessor, ValueAccessor],
20
+ imports: [],
21
+ exports: [...VegaComponents, TextValueAccessor, ValueAccessor],
22
+ }]
23
+ }], ctorParameters: function () { return []; } });
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50cy1tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2NvbXBvbmVudHMtbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDakUsT0FBTyxjQUFjLE1BQU0sZ0NBQWdDLENBQUM7QUFDNUQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0seUNBQXlDLENBQUM7QUFDNUUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG9DQUFvQyxDQUFDOzs7QUFPbkUsTUFBTSxPQUFPLG1CQUFtQjtJQUM5QjtRQUNFLG9CQUFvQixDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksRUFBRSxDQUFDO0lBQ3RDLENBQUM7O2dIQUhVLG1CQUFtQjtpSEFBbkIsbUJBQW1CLGdtQkFK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E1vZHVsZSB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIGRlZmluZUN1c3RvbUVsZW1lbnRzKHdpbmRvdykudGhlbigpO1xuICB9XG59XG4iXX0=
@@ -0,0 +1,62 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ import { fromEvent } from 'rxjs';
4
+ export const proxyInputs = (Cmp, inputs) => {
5
+ const Prototype = Cmp.prototype;
6
+ inputs.forEach(item => {
7
+ Object.defineProperty(Prototype, item, {
8
+ get() {
9
+ return this.el[item];
10
+ },
11
+ set(val) {
12
+ // Link issues: https://gethired.atlassian.net/browse/GHUI-331
13
+ // add a beforehand checking to make sure value is only set when component is loaded
14
+ if (this.el.classList.contains('hydrated')) {
15
+ this.z.runOutsideAngular(() => (this.el[item] = val));
16
+ }
17
+ else {
18
+ this.el.componentOnReady().then(() => {
19
+ this.z.runOutsideAngular(() => (this.el[item] = val));
20
+ });
21
+ }
22
+ }
23
+ });
24
+ });
25
+ };
26
+ export const proxyMethods = (Cmp, methods) => {
27
+ const Prototype = Cmp.prototype;
28
+ methods.forEach(methodName => {
29
+ Prototype[methodName] = function () {
30
+ const args = arguments;
31
+ return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
32
+ };
33
+ });
34
+ };
35
+ export const proxyOutputs = (instance, el, events) => {
36
+ events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
37
+ };
38
+ export const defineCustomElement = (tagName, customElement) => {
39
+ if (customElement !== undefined &&
40
+ typeof customElements !== 'undefined' &&
41
+ !customElements.get(tagName)) {
42
+ customElements.define(tagName, customElement);
43
+ }
44
+ };
45
+ // tslint:disable-next-line: only-arrow-functions
46
+ export function ProxyCmp(opts) {
47
+ const decorator = function (cls) {
48
+ const { defineCustomElementFn, inputs, methods } = opts;
49
+ if (defineCustomElementFn !== undefined) {
50
+ defineCustomElementFn();
51
+ }
52
+ if (inputs) {
53
+ proxyInputs(cls, inputs);
54
+ }
55
+ if (methods) {
56
+ proxyMethods(cls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