@beacon-interactive-systems-llc/beacon-platform-ui 17.0.0 → 17.0.2

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 (33) hide show
  1. package/README.md +39 -31
  2. package/esm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs +5 -0
  3. package/esm2020/lib/device-detector.service.mjs +77 -0
  4. package/esm2020/lib/network-connection.service.mjs +32 -0
  5. package/esm2020/lib/platform-ui.component.mjs +22 -0
  6. package/esm2020/lib/platform-ui.module.mjs +21 -0
  7. package/esm2020/lib/platform-ui.service.mjs +14 -0
  8. package/esm2020/public-api.mjs +7 -0
  9. package/fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs +164 -0
  10. package/fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs.map +1 -0
  11. package/fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs +164 -0
  12. package/fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs.map +1 -0
  13. package/index.d.ts +5 -0
  14. package/lib/device-detector.service.d.ts +11 -0
  15. package/lib/network-connection.service.d.ts +12 -0
  16. package/lib/platform-ui.component.d.ts +8 -0
  17. package/lib/platform-ui.module.d.ts +7 -0
  18. package/lib/platform-ui.service.d.ts +6 -0
  19. package/package.json +44 -24
  20. package/{src/public-api.ts → public-api.d.ts} +0 -2
  21. package/karma.conf.js +0 -44
  22. package/ng-package.json +0 -8
  23. package/src/lib/device-detector.service.ts +0 -46
  24. package/src/lib/network-connection.service.ts +0 -31
  25. package/src/lib/platform-ui.component.spec.ts +0 -23
  26. package/src/lib/platform-ui.component.ts +0 -20
  27. package/src/lib/platform-ui.module.ts +0 -16
  28. package/src/lib/platform-ui.service.spec.ts +0 -16
  29. package/src/lib/platform-ui.service.ts +0 -9
  30. package/src/test.ts +0 -27
  31. package/tsconfig.lib.json +0 -15
  32. package/tsconfig.lib.prod.json +0 -10
  33. package/tsconfig.spec.json +0 -17
package/README.md CHANGED
@@ -1,49 +1,57 @@
1
- # PlatformUi
1
+ # Beacon Platform UI
2
2
 
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.0.
3
+ ### About
4
+ This library is intended to define styles for Beacon Platform projects and create useful components that can be shared across apps.
4
5
 
5
- ## Code scaffolding
6
+ It also contains style overrides for elements from commonly used dependencies like:
6
7
 
7
- Run `ng generate component component-name --project platform-ui` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project platform-ui`.
8
- > Note: Don't forget to add `--project platform-ui` or else it will be added to the default project in your `angular.json` file.
8
+ "@angular/material"
9
+ "ngx-bootstrap"
10
+ "ngx-infinite-scroll"
11
+ "@ng-select/ng-select"
12
+ "ngx-mask"
13
+ "ngx-quill"
14
+ "ngx-toastr"
9
15
 
10
- ## Establish connection with NPM
16
+ ### Using in a Beacon Platform application
11
17
 
12
- Run `npm adduser` -- this will launch npmjs.com and prompt a sign-in
18
+ First determine which version of Angular is or will be used in the frontend application.
19
+ The MAJOR version of Angular will match 1-to-1 with the Beacon Platform UI, so Angular 18 apps will use Beacon Platform UI version 18, Angular 16 will use Beacon Platform UI version 16, etc.
13
20
 
14
- ## Develop + Build
21
+ Example:
22
+ 1. The frontend application will use Angular 17.X.X
23
+ 2. The Beacon Platform UI version to use would be v17 and should include the latest minor and patch updates, which can be installed like this:
15
24
 
16
- Make necessary changes to the files in `projects/platform-ui`, run `npm version patch` to increment the version prior to committing and pushing.
17
-
18
- If you are finished testing your changes locally, be sure to commit and push your changes to GitHub prior to building.
19
-
20
- Run `ng build --project=platform-ui` to build the project. The build artifacts will be stored in the `dist/` directory.
21
-
22
- Confirm that the version is correct in `dist/platform-ui/package.json`
23
-
24
- ## Testing locally
25
-
26
- After building your library, go to the dist folder `cd dist/platform-ui` and run `npm pack` -- this will create a `.tgz` file in your `dist/platform-ui` folder. Consider moving the `.tgz` file to a location with a more simple path to avoid errors.
27
-
28
- In your platform application's `package.json`, point the beacon package to the path of your `.tgz` file
29
25
  ```
30
- "@beacon-interactive-systems-llc/beacon-platform-ui": "<FILE_PATH>",
26
+ $ npm install @beacon-interactive-systems-llc/beacon-platform-ui@^17,
31
27
  ```
28
+ Be sure that core dependencies of the Angular application match those of the Beacon Platform UI.
29
+
30
+ Then, add this line to the application `styles.scss`
31
+ `@import "@beacon-interactive-systems-llc/beacon-platform-ui/styles/styles.scss";`
32
32
 
33
- Run `npm install` and `ng serve`
33
+ That's it!
34
34
 
35
- After testing, be sure to discard the changes in `package.json` and `package-lock.json`
35
+ ### Documentation
36
36
 
37
- (For more information see https://dev.to/scooperdev/use-npm-pack-to-test-your-packages-locally-486e)
37
+ The library defines and exports several key dependencies: stylesheets, static assets and shared components
38
38
 
39
- ## Publishing
39
+ #### Stylesheets
40
40
 
41
- After building your library, go to the dist folder `cd dist/platform-ui` and run `npm publish --scope=@beacon-interactive-systems-llc`.
41
+ Defined in `node_modules\@beacon-interactive-systems-llc\beacon-platform-ui\styles`, these stylesheets are named after the components/dependency/library they affect:
42
42
 
43
- ## Running unit tests
43
+ `_material_drawer.scss` will contain style overrides for the Angular Material `DrawerModule`
44
+ `_forms.scss` will contain styling for form inputs, dropdowns
45
+ `_theming.scss` will contain important definitions for DEFAULT, DARK and HIGH_CONTRAST modes
46
+ etc.
44
47
 
45
- Run `ng test platform-ui` to execute the unit tests via [Karma](https://karma-runner.github.io).
48
+ Any further customization that is required should be done at the component level in the application itself, or, if a global change is warranted a request should be made to Platform UI developers (Nina P, Andy S, Nathan B) so a new patched version can be created and pushed for all apps to use.
46
49
 
47
- ## Further help
50
+ #### Static Assets
51
+ Beacon Platform apps will use variations of Roboto fonts, found in `/fonts`
52
+ Custom icons (as in, those not added using the Angular Material Icons library) will be added over time to `/icons`
48
53
 
49
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
54
+ #### Shared Components
55
+ Two useful support components are available in `/lib`
56
+ 1. `DeviceDetector` can be used to find important information and device resolution, operating system etc.
57
+ 2. `NetworkConnectionService` will track changes in the status of the network connection and provide interfaces for `isOnline` and `isOffline`
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhY29uLWludGVyYWN0aXZlLXN5c3RlbXMtbGxjLWJlYWNvbi1wbGF0Zm9ybS11aS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3BsYXRmb3JtLXVpL3NyYy9iZWFjb24taW50ZXJhY3RpdmUtc3lzdGVtcy1sbGMtYmVhY29uLXBsYXRmb3JtLXVpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
@@ -0,0 +1,77 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ const CUTOFFS = {
4
+ mobile: 767,
5
+ tablet: 1200
6
+ };
7
+ export class DeviceDetectorService {
8
+ get isMobile() { return window.screen.width <= CUTOFFS.mobile; }
9
+ get isTablet() {
10
+ return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;
11
+ }
12
+ // assume desktop is anything > 1200
13
+ get isDesktop() { return window.screen.width > CUTOFFS.tablet; }
14
+ getBrowser() {
15
+ if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) {
16
+ return "Chrome";
17
+ }
18
+ else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) {
19
+ return "Opera";
20
+ }
21
+ else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) {
22
+ return "Firefox";
23
+ }
24
+ else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) {
25
+ return "Safari";
26
+ }
27
+ else if (!!navigator.userAgent.match(/MSIE/)) {
28
+ return "IE";
29
+ }
30
+ else if (!!navigator.userAgent.match(/Edg/)) {
31
+ return "Microsoft Edge";
32
+ }
33
+ else {
34
+ return "Unknown";
35
+ }
36
+ }
37
+ getOperatingSystem() {
38
+ if (!!navigator.userAgent.match(/Win/)) {
39
+ return "Windows OS";
40
+ }
41
+ else if (!!navigator.userAgent.match(/Mac/)) {
42
+ return "MacOS";
43
+ }
44
+ else if (!!navigator.userAgent.match(/X11/)) {
45
+ return "UNIX OS";
46
+ }
47
+ else if (!!navigator.userAgent.match(/Linux/)) {
48
+ return "Linux OS";
49
+ }
50
+ else {
51
+ return "Unknown";
52
+ }
53
+ }
54
+ getDeviceType() {
55
+ if (this.isDesktop) {
56
+ return "Desktop";
57
+ }
58
+ else if (this.isMobile) {
59
+ return "Mobile";
60
+ }
61
+ else if (this.isTablet) {
62
+ return "Tablet";
63
+ }
64
+ else {
65
+ return "Unknown";
66
+ }
67
+ }
68
+ }
69
+ DeviceDetectorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
70
+ DeviceDetectorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, providedIn: 'root' });
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, decorators: [{
72
+ type: Injectable,
73
+ args: [{
74
+ providedIn: 'root'
75
+ }]
76
+ }] });
77
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlLWRldGVjdG9yLnNlc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,32 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export class NetworkConnectionService {
5
+ constructor() {
6
+ this.networkConnectionChange = new Subject();
7
+ this.connectionChanged$ = this.networkConnectionChange.asObservable();
8
+ this.lastOnlineAt = new Date();
9
+ window.addEventListener('online', () => this.updateOnlineStatus());
10
+ window.addEventListener('offline', () => this.updateOnlineStatus());
11
+ }
12
+ get isOnline() {
13
+ return !!window.navigator.onLine;
14
+ }
15
+ get isOffline() {
16
+ return !this.isOnline;
17
+ }
18
+ updateOnlineStatus() {
19
+ this.networkConnectionChange.next(window.navigator.onLine);
20
+ if (window.navigator.offLine)
21
+ this.lastOnlineAt = new Date();
22
+ }
23
+ }
24
+ NetworkConnectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
25
+ NetworkConnectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, providedIn: 'root' });
26
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, decorators: [{
27
+ type: Injectable,
28
+ args: [{
29
+ providedIn: 'root'
30
+ }]
31
+ }], ctorParameters: function () { return []; } });
32
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV0d29yay1jb25uZWN0aW9uLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9wbGF0Zm9ybS11aS9zcmMvbGliL25ldHdvcmstY29ubmVjdGlvbi5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7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KHdpbmRvdy5uYXZpZ2F0b3Iub25MaW5lKTtcclxuICAgIGlmICh3aW5kb3cubmF2aWdhdG9yLm9mZkxpbmUpIHRoaXMubGFzdE9ubGluZUF0ID0gbmV3IERhdGUoKTtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,22 @@
1
+ import { Component } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class PlatformUiComponent {
4
+ constructor() { }
5
+ ngOnInit() {
6
+ }
7
+ }
8
+ PlatformUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9
+ PlatformUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: PlatformUiComponent, selector: "lib-platform-ui", ngImport: i0, template: `
10
+ <p>
11
+ platform-ui works!
12
+ </p>
13
+ `, isInline: true });
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, decorators: [{
15
+ type: Component,
16
+ args: [{ selector: 'lib-platform-ui', template: `
17
+ <p>
18
+ platform-ui works!
19
+ </p>
20
+ ` }]
21
+ }], ctorParameters: function () { return []; } });
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0tdWkuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGxhdGZvcm0tdWkvc3JjL2xpYi9wbGF0Zm9ybS11aS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBVSxNQUFNLGVBQWUsQ0FBQzs7QUFZbEQsTUFBTSxPQUFPLG1CQUFtQjtJQUU5QixnQkFBZ0IsQ0FBQztJQUVqQixRQUFRO0lBQ1IsQ0FBQzs7aUhBTFUsbUJBQW1CO3FHQUFuQixtQkFBbUIsdURBUnBCOzs7O0dBSVQ7NEZBSVUsbUJBQW1CO2tCQVYvQixTQUFTOytCQUNFLGlCQUFpQixZQUNqQjs7OztHQUlUIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQ29tcG9uZW50LCBPbkluaXQgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuXHJcbkBDb21wb25lbnQoe1xyXG4gIHNlbGVjdG9yOiAnbGliLXBsYXRmb3JtLXVpJyxcclxuICB0ZW1wbGF0ZTogYFxyXG4gICAgPHA+XHJcbiAgICAgIHBsYXRmb3JtLXVpIHdvcmtzIVxyXG4gICAgPC9wPlxyXG4gIGAsXHJcbiAgc3R5bGVzOiBbXHJcbiAgXVxyXG59KVxyXG5leHBvcnQgY2xhc3MgUGxhdGZvcm1VaUNvbXBvbmVudCBpbXBsZW1lbnRzIE9uSW5pdCB7XHJcblxyXG4gIGNvbnN0cnVjdG9yKCkgeyB9XHJcblxyXG4gIG5nT25Jbml0KCk6IHZvaWQge1xyXG4gIH1cclxuXHJcbn1cclxuIl19
@@ -0,0 +1,21 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { PlatformUiComponent } from './platform-ui.component';
3
+ import * as i0 from "@angular/core";
4
+ export class PlatformUiModule {
5
+ }
6
+ PlatformUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
7
+ PlatformUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, declarations: [PlatformUiComponent], exports: [PlatformUiComponent] });
8
+ PlatformUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule });
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, decorators: [{
10
+ type: NgModule,
11
+ args: [{
12
+ declarations: [
13
+ PlatformUiComponent
14
+ ],
15
+ imports: [],
16
+ exports: [
17
+ PlatformUiComponent
18
+ ]
19
+ }]
20
+ }] });
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0tdWkubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvcGxhdGZvcm0tdWkvc3JjL2xpYi9wbGF0Zm9ybS11aS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQzs7QUFjOUQsTUFBTSxPQUFPLGdCQUFnQjs7OEdBQWhCLGdCQUFnQjsrR0FBaEIsZ0JBQWdCLGlCQVJ6QixtQkFBbUIsYUFLbkIsbUJBQW1COytHQUdWLGdCQUFnQjs0RkFBaEIsZ0JBQWdCO2tCQVY1QixRQUFRO21CQUFDO29CQUNSLFlBQVksRUFBRTt3QkFDWixtQkFBbUI7cUJBQ3BCO29CQUNELE9BQU8sRUFBRSxFQUNSO29CQUNELE9BQU8sRUFBRTt3QkFDUCxtQkFBbUI7cUJBQ3BCO2lCQUNGIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHsgUGxhdGZvcm1VaUNvbXBvbmVudCB9IGZyb20gJy4vcGxhdGZvcm0tdWkuY29tcG9uZW50JztcclxuXHJcblxyXG5cclxuQE5nTW9kdWxlKHtcclxuICBkZWNsYXJhdGlvbnM6IFtcclxuICAgIFBsYXRmb3JtVWlDb21wb25lbnRcclxuICBdLFxyXG4gIGltcG9ydHM6IFtcclxuICBdLFxyXG4gIGV4cG9ydHM6IFtcclxuICAgIFBsYXRmb3JtVWlDb21wb25lbnRcclxuICBdXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBQbGF0Zm9ybVVpTW9kdWxlIHsgfVxyXG4iXX0=
@@ -0,0 +1,14 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class PlatformUiService {
4
+ constructor() { }
5
+ }
6
+ PlatformUiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
7
+ PlatformUiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, providedIn: 'root' });
8
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, decorators: [{
9
+ type: Injectable,
10
+ args: [{
11
+ providedIn: 'root'
12
+ }]
13
+ }], ctorParameters: function () { return []; } });
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0tdWkuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3BsYXRmb3JtLXVpL3NyYy9saWIvcGxhdGZvcm0tdWkuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUszQyxNQUFNLE9BQU8saUJBQWlCO0lBRTVCLGdCQUFnQixDQUFDOzsrR0FGTixpQkFBaUI7bUhBQWpCLGlCQUFpQixjQUZoQixNQUFNOzRGQUVQLGlCQUFpQjtrQkFIN0IsVUFBVTttQkFBQztvQkFDVixVQUFVLEVBQUUsTUFBTTtpQkFDbkIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XHJcblxyXG5ASW5qZWN0YWJsZSh7XHJcbiAgcHJvdmlkZWRJbjogJ3Jvb3QnXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBQbGF0Zm9ybVVpU2VydmljZSB7XHJcblxyXG4gIGNvbnN0cnVjdG9yKCkgeyB9XHJcbn1cclxuIl19
@@ -0,0 +1,7 @@
1
+ export * from './lib/network-connection.service';
2
+ export * from './lib/device-detector.service';
3
+ // defaults
4
+ export * from './lib/platform-ui.service';
5
+ export * from './lib/platform-ui.component';
6
+ export * from './lib/platform-ui.module';
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3BsYXRmb3JtLXVpL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsa0NBQWtDLENBQUM7QUFDakQsY0FBYywrQkFBK0IsQ0FBQztBQUU5QyxXQUFXO0FBQ1gsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsMEJBQTBCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9uZXR3b3JrLWNvbm5lY3Rpb24uc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2RldmljZS1kZXRlY3Rvci5zZXJ2aWNlJztcclxuXHJcbi8vIGRlZmF1bHRzXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3BsYXRmb3JtLXVpLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9wbGF0Zm9ybS11aS5jb21wb25lbnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9wbGF0Zm9ybS11aS5tb2R1bGUnO1xyXG4iXX0=
@@ -0,0 +1,164 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import { Subject } from 'rxjs';
4
+
5
+ class NetworkConnectionService {
6
+ constructor() {
7
+ this.networkConnectionChange = new Subject();
8
+ this.connectionChanged$ = this.networkConnectionChange.asObservable();
9
+ this.lastOnlineAt = new Date();
10
+ window.addEventListener('online', () => this.updateOnlineStatus());
11
+ window.addEventListener('offline', () => this.updateOnlineStatus());
12
+ }
13
+ get isOnline() {
14
+ return !!window.navigator.onLine;
15
+ }
16
+ get isOffline() {
17
+ return !this.isOnline;
18
+ }
19
+ updateOnlineStatus() {
20
+ this.networkConnectionChange.next(window.navigator.onLine);
21
+ if (window.navigator.offLine)
22
+ this.lastOnlineAt = new Date();
23
+ }
24
+ }
25
+ NetworkConnectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
26
+ NetworkConnectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, providedIn: 'root' });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, decorators: [{
28
+ type: Injectable,
29
+ args: [{
30
+ providedIn: 'root'
31
+ }]
32
+ }], ctorParameters: function () { return []; } });
33
+
34
+ const CUTOFFS = {
35
+ mobile: 767,
36
+ tablet: 1200
37
+ };
38
+ class DeviceDetectorService {
39
+ get isMobile() { return window.screen.width <= CUTOFFS.mobile; }
40
+ get isTablet() {
41
+ return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;
42
+ }
43
+ // assume desktop is anything > 1200
44
+ get isDesktop() { return window.screen.width > CUTOFFS.tablet; }
45
+ getBrowser() {
46
+ if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) {
47
+ return "Chrome";
48
+ }
49
+ else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) {
50
+ return "Opera";
51
+ }
52
+ else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) {
53
+ return "Firefox";
54
+ }
55
+ else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) {
56
+ return "Safari";
57
+ }
58
+ else if (!!navigator.userAgent.match(/MSIE/)) {
59
+ return "IE";
60
+ }
61
+ else if (!!navigator.userAgent.match(/Edg/)) {
62
+ return "Microsoft Edge";
63
+ }
64
+ else {
65
+ return "Unknown";
66
+ }
67
+ }
68
+ getOperatingSystem() {
69
+ if (!!navigator.userAgent.match(/Win/)) {
70
+ return "Windows OS";
71
+ }
72
+ else if (!!navigator.userAgent.match(/Mac/)) {
73
+ return "MacOS";
74
+ }
75
+ else if (!!navigator.userAgent.match(/X11/)) {
76
+ return "UNIX OS";
77
+ }
78
+ else if (!!navigator.userAgent.match(/Linux/)) {
79
+ return "Linux OS";
80
+ }
81
+ else {
82
+ return "Unknown";
83
+ }
84
+ }
85
+ getDeviceType() {
86
+ if (this.isDesktop) {
87
+ return "Desktop";
88
+ }
89
+ else if (this.isMobile) {
90
+ return "Mobile";
91
+ }
92
+ else if (this.isTablet) {
93
+ return "Tablet";
94
+ }
95
+ else {
96
+ return "Unknown";
97
+ }
98
+ }
99
+ }
100
+ DeviceDetectorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
101
+ DeviceDetectorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, providedIn: 'root' });
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, decorators: [{
103
+ type: Injectable,
104
+ args: [{
105
+ providedIn: 'root'
106
+ }]
107
+ }] });
108
+
109
+ class PlatformUiService {
110
+ constructor() { }
111
+ }
112
+ PlatformUiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
113
+ PlatformUiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, providedIn: 'root' });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, decorators: [{
115
+ type: Injectable,
116
+ args: [{
117
+ providedIn: 'root'
118
+ }]
119
+ }], ctorParameters: function () { return []; } });
120
+
121
+ class PlatformUiComponent {
122
+ constructor() { }
123
+ ngOnInit() {
124
+ }
125
+ }
126
+ PlatformUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
127
+ PlatformUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: PlatformUiComponent, selector: "lib-platform-ui", ngImport: i0, template: `
128
+ <p>
129
+ platform-ui works!
130
+ </p>
131
+ `, isInline: true });
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, decorators: [{
133
+ type: Component,
134
+ args: [{ selector: 'lib-platform-ui', template: `
135
+ <p>
136
+ platform-ui works!
137
+ </p>
138
+ ` }]
139
+ }], ctorParameters: function () { return []; } });
140
+
141
+ class PlatformUiModule {
142
+ }
143
+ PlatformUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
144
+ PlatformUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, declarations: [PlatformUiComponent], exports: [PlatformUiComponent] });
145
+ PlatformUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule });
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, decorators: [{
147
+ type: NgModule,
148
+ args: [{
149
+ declarations: [
150
+ PlatformUiComponent
151
+ ],
152
+ imports: [],
153
+ exports: [
154
+ PlatformUiComponent
155
+ ]
156
+ }]
157
+ }] });
158
+
159
+ /**
160
+ * Generated bundle index. Do not edit.
161
+ */
162
+
163
+ export { DeviceDetectorService, NetworkConnectionService, PlatformUiComponent, PlatformUiModule, PlatformUiService };
164
+ //# sourceMappingURL=beacon-interactive-systems-llc-beacon-platform-ui.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beacon-interactive-systems-llc-beacon-platform-ui.mjs","sources":["../../../projects/platform-ui/src/lib/network-connection.service.ts","../../../projects/platform-ui/src/lib/device-detector.service.ts","../../../projects/platform-ui/src/lib/platform-ui.service.ts","../../../projects/platform-ui/src/lib/platform-ui.component.ts","../../../projects/platform-ui/src/lib/platform-ui.module.ts","../../../projects/platform-ui/src/beacon-interactive-systems-llc-beacon-platform-ui.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\n\r\ndeclare const window: any;\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NetworkConnectionService {\r\n constructor() {\r\n window.addEventListener('online', () => this.updateOnlineStatus());\r\n window.addEventListener('offline', () => this.updateOnlineStatus());\r\n }\r\n\r\n private networkConnectionChange = new Subject<boolean>();\r\n public connectionChanged$ = this.networkConnectionChange.asObservable();\r\n public lastOnlineAt: Date = new Date();\r\n\r\n get isOnline() {\r\n return !!window.navigator.onLine;\r\n }\r\n\r\n get isOffline() {\r\n return !this.isOnline;\r\n }\r\n\r\n private updateOnlineStatus() {\r\n this.networkConnectionChange.next(window.navigator.onLine);\r\n if (window.navigator.offLine) this.lastOnlineAt = new Date();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nconst CUTOFFS = {\r\n mobile: 767,\r\n tablet: 1200\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class DeviceDetectorService {\r\n get isMobile() { return window.screen.width <= CUTOFFS.mobile }\r\n\r\n get isTablet() {\r\n return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;\r\n }\r\n\r\n // assume desktop is anything > 1200\r\n get isDesktop() { return window.screen.width > CUTOFFS.tablet }\r\n\r\n\r\n getBrowser() {\r\n if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) { return \"Chrome\"; }\r\n else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) { return \"Opera\"; }\r\n else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) { return \"Firefox\"; }\r\n else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) { return \"Safari\"; }\r\n else if (!!navigator.userAgent.match(/MSIE/)) { return \"IE\"; }\r\n else if (!!navigator.userAgent.match(/Edg/)) { return \"Microsoft Edge\"; }\r\n else { return \"Unknown\" }\r\n }\r\n\r\n getOperatingSystem() {\r\n if (!!navigator.userAgent.match(/Win/)) { return \"Windows OS\"; }\r\n else if (!!navigator.userAgent.match(/Mac/)) { return \"MacOS\"; }\r\n else if (!!navigator.userAgent.match(/X11/)) { return \"UNIX OS\"; }\r\n else if (!!navigator.userAgent.match(/Linux/)) { return \"Linux OS\"; }\r\n else { return \"Unknown\"; }\r\n }\r\n\r\n getDeviceType() {\r\n if (this.isDesktop) { return \"Desktop\"; }\r\n else if (this.isMobile) { return \"Mobile\"; }\r\n else if (this.isTablet) { return \"Tablet\"; }\r\n else { return \"Unknown\"; }\r\n }\r\n}","import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class PlatformUiService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-platform-ui',\r\n template: `\r\n <p>\r\n platform-ui works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class PlatformUiComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { PlatformUiComponent } from './platform-ui.component';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n PlatformUiComponent\r\n ],\r\n imports: [\r\n ],\r\n exports: [\r\n PlatformUiComponent\r\n ]\r\n})\r\nexport class PlatformUiModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,wBAAwB,CAAA;AACnC,IAAA,WAAA,GAAA;AAKQ,QAAA,IAAA,CAAA,uBAAuB,GAAG,IAAI,OAAO,EAAW,CAAC;QAClD,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,CAAC;AACjE,QAAA,IAAA,CAAA,YAAY,GAAS,IAAI,IAAI,EAAE,CAAC;AANrC,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;AACnE,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;KACrE;AAMD,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,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CAAA,EAAA,CAAA,CAAA;+GAGV,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,mBAAmB;AACpB,qBAAA;AACD,oBAAA,OAAO,EAAE,EACR;AACD,oBAAA,OAAO,EAAE;wBACP,mBAAmB;AACpB,qBAAA;iBACF,CAAA;;;ACdD;;AAEG;;;;"}
@@ -0,0 +1,164 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, NgModule } from '@angular/core';
3
+ import { Subject } from 'rxjs';
4
+
5
+ class NetworkConnectionService {
6
+ constructor() {
7
+ this.networkConnectionChange = new Subject();
8
+ this.connectionChanged$ = this.networkConnectionChange.asObservable();
9
+ this.lastOnlineAt = new Date();
10
+ window.addEventListener('online', () => this.updateOnlineStatus());
11
+ window.addEventListener('offline', () => this.updateOnlineStatus());
12
+ }
13
+ get isOnline() {
14
+ return !!window.navigator.onLine;
15
+ }
16
+ get isOffline() {
17
+ return !this.isOnline;
18
+ }
19
+ updateOnlineStatus() {
20
+ this.networkConnectionChange.next(window.navigator.onLine);
21
+ if (window.navigator.offLine)
22
+ this.lastOnlineAt = new Date();
23
+ }
24
+ }
25
+ NetworkConnectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
26
+ NetworkConnectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, providedIn: 'root' });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NetworkConnectionService, decorators: [{
28
+ type: Injectable,
29
+ args: [{
30
+ providedIn: 'root'
31
+ }]
32
+ }], ctorParameters: function () { return []; } });
33
+
34
+ const CUTOFFS = {
35
+ mobile: 767,
36
+ tablet: 1200
37
+ };
38
+ class DeviceDetectorService {
39
+ get isMobile() { return window.screen.width <= CUTOFFS.mobile; }
40
+ get isTablet() {
41
+ return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;
42
+ }
43
+ // assume desktop is anything > 1200
44
+ get isDesktop() { return window.screen.width > CUTOFFS.tablet; }
45
+ getBrowser() {
46
+ if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) {
47
+ return "Chrome";
48
+ }
49
+ else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) {
50
+ return "Opera";
51
+ }
52
+ else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) {
53
+ return "Firefox";
54
+ }
55
+ else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) {
56
+ return "Safari";
57
+ }
58
+ else if (!!navigator.userAgent.match(/MSIE/)) {
59
+ return "IE";
60
+ }
61
+ else if (!!navigator.userAgent.match(/Edg/)) {
62
+ return "Microsoft Edge";
63
+ }
64
+ else {
65
+ return "Unknown";
66
+ }
67
+ }
68
+ getOperatingSystem() {
69
+ if (!!navigator.userAgent.match(/Win/)) {
70
+ return "Windows OS";
71
+ }
72
+ else if (!!navigator.userAgent.match(/Mac/)) {
73
+ return "MacOS";
74
+ }
75
+ else if (!!navigator.userAgent.match(/X11/)) {
76
+ return "UNIX OS";
77
+ }
78
+ else if (!!navigator.userAgent.match(/Linux/)) {
79
+ return "Linux OS";
80
+ }
81
+ else {
82
+ return "Unknown";
83
+ }
84
+ }
85
+ getDeviceType() {
86
+ if (this.isDesktop) {
87
+ return "Desktop";
88
+ }
89
+ else if (this.isMobile) {
90
+ return "Mobile";
91
+ }
92
+ else if (this.isTablet) {
93
+ return "Tablet";
94
+ }
95
+ else {
96
+ return "Unknown";
97
+ }
98
+ }
99
+ }
100
+ DeviceDetectorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
101
+ DeviceDetectorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, providedIn: 'root' });
102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DeviceDetectorService, decorators: [{
103
+ type: Injectable,
104
+ args: [{
105
+ providedIn: 'root'
106
+ }]
107
+ }] });
108
+
109
+ class PlatformUiService {
110
+ constructor() { }
111
+ }
112
+ PlatformUiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
113
+ PlatformUiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, providedIn: 'root' });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiService, decorators: [{
115
+ type: Injectable,
116
+ args: [{
117
+ providedIn: 'root'
118
+ }]
119
+ }], ctorParameters: function () { return []; } });
120
+
121
+ class PlatformUiComponent {
122
+ constructor() { }
123
+ ngOnInit() {
124
+ }
125
+ }
126
+ PlatformUiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
127
+ PlatformUiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: PlatformUiComponent, selector: "lib-platform-ui", ngImport: i0, template: `
128
+ <p>
129
+ platform-ui works!
130
+ </p>
131
+ `, isInline: true });
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiComponent, decorators: [{
133
+ type: Component,
134
+ args: [{ selector: 'lib-platform-ui', template: `
135
+ <p>
136
+ platform-ui works!
137
+ </p>
138
+ ` }]
139
+ }], ctorParameters: function () { return []; } });
140
+
141
+ class PlatformUiModule {
142
+ }
143
+ PlatformUiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
144
+ PlatformUiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, declarations: [PlatformUiComponent], exports: [PlatformUiComponent] });
145
+ PlatformUiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule });
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: PlatformUiModule, decorators: [{
147
+ type: NgModule,
148
+ args: [{
149
+ declarations: [
150
+ PlatformUiComponent
151
+ ],
152
+ imports: [],
153
+ exports: [
154
+ PlatformUiComponent
155
+ ]
156
+ }]
157
+ }] });
158
+
159
+ /**
160
+ * Generated bundle index. Do not edit.
161
+ */
162
+
163
+ export { DeviceDetectorService, NetworkConnectionService, PlatformUiComponent, PlatformUiModule, PlatformUiService };
164
+ //# sourceMappingURL=beacon-interactive-systems-llc-beacon-platform-ui.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beacon-interactive-systems-llc-beacon-platform-ui.mjs","sources":["../../../projects/platform-ui/src/lib/network-connection.service.ts","../../../projects/platform-ui/src/lib/device-detector.service.ts","../../../projects/platform-ui/src/lib/platform-ui.service.ts","../../../projects/platform-ui/src/lib/platform-ui.component.ts","../../../projects/platform-ui/src/lib/platform-ui.module.ts","../../../projects/platform-ui/src/beacon-interactive-systems-llc-beacon-platform-ui.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\n\r\ndeclare const window: any;\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NetworkConnectionService {\r\n constructor() {\r\n window.addEventListener('online', () => this.updateOnlineStatus());\r\n window.addEventListener('offline', () => this.updateOnlineStatus());\r\n }\r\n\r\n private networkConnectionChange = new Subject<boolean>();\r\n public connectionChanged$ = this.networkConnectionChange.asObservable();\r\n public lastOnlineAt: Date = new Date();\r\n\r\n get isOnline() {\r\n return !!window.navigator.onLine;\r\n }\r\n\r\n get isOffline() {\r\n return !this.isOnline;\r\n }\r\n\r\n private updateOnlineStatus() {\r\n this.networkConnectionChange.next(window.navigator.onLine);\r\n if (window.navigator.offLine) this.lastOnlineAt = new Date();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nconst CUTOFFS = {\r\n mobile: 767,\r\n tablet: 1200\r\n}\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class DeviceDetectorService {\r\n get isMobile() { return window.screen.width <= CUTOFFS.mobile }\r\n\r\n get isTablet() {\r\n return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;\r\n }\r\n\r\n // assume desktop is anything > 1200\r\n get isDesktop() { return window.screen.width > CUTOFFS.tablet }\r\n\r\n\r\n getBrowser() {\r\n if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) { return \"Chrome\"; }\r\n else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) { return \"Opera\"; }\r\n else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) { return \"Firefox\"; }\r\n else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) { return \"Safari\"; }\r\n else if (!!navigator.userAgent.match(/MSIE/)) { return \"IE\"; }\r\n else if (!!navigator.userAgent.match(/Edg/)) { return \"Microsoft Edge\"; }\r\n else { return \"Unknown\" }\r\n }\r\n\r\n getOperatingSystem() {\r\n if (!!navigator.userAgent.match(/Win/)) { return \"Windows OS\"; }\r\n else if (!!navigator.userAgent.match(/Mac/)) { return \"MacOS\"; }\r\n else if (!!navigator.userAgent.match(/X11/)) { return \"UNIX OS\"; }\r\n else if (!!navigator.userAgent.match(/Linux/)) { return \"Linux OS\"; }\r\n else { return \"Unknown\"; }\r\n }\r\n\r\n getDeviceType() {\r\n if (this.isDesktop) { return \"Desktop\"; }\r\n else if (this.isMobile) { return \"Mobile\"; }\r\n else if (this.isTablet) { return \"Tablet\"; }\r\n else { return \"Unknown\"; }\r\n }\r\n}","import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class PlatformUiService {\r\n\r\n constructor() { }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'lib-platform-ui',\r\n template: `\r\n <p>\r\n platform-ui works!\r\n </p>\r\n `,\r\n styles: [\r\n ]\r\n})\r\nexport class PlatformUiComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { PlatformUiComponent } from './platform-ui.component';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n PlatformUiComponent\r\n ],\r\n imports: [\r\n ],\r\n exports: [\r\n PlatformUiComponent\r\n ]\r\n})\r\nexport class PlatformUiModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,wBAAwB,CAAA;AACnC,IAAA,WAAA,GAAA;AAKQ,QAAA,IAAA,CAAA,uBAAuB,GAAG,IAAI,OAAO,EAAW,CAAC;AAClD,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,CAAC;AACjE,QAAA,IAAA,CAAA,YAAY,GAAS,IAAI,IAAI,EAAE,CAAC;AANrC,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,kBA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CAAA,EAAA,CAAA;;;MCOU,gBAAgB,CAAA;;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CARzB,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAKnB,mBAAmB,CAAA,EAAA,CAAA,CAAA;+GAGV,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAV5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,mBAAmB;AACpB,qBAAA;AACD,oBAAA,OAAO,EAAE,EACR;AACD,oBAAA,OAAO,EAAE;wBACP,mBAAmB;AACpB,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@beacon-interactive-systems-llc/beacon-platform-ui" />
5
+ export * from './public-api';
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DeviceDetectorService {
3
+ get isMobile(): boolean;
4
+ get isTablet(): boolean;
5
+ get isDesktop(): boolean;
6
+ getBrowser(): "Chrome" | "Opera" | "Firefox" | "Safari" | "IE" | "Microsoft Edge" | "Unknown";
7
+ getOperatingSystem(): "Unknown" | "Windows OS" | "MacOS" | "UNIX OS" | "Linux OS";
8
+ getDeviceType(): "Unknown" | "Desktop" | "Mobile" | "Tablet";
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeviceDetectorService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<DeviceDetectorService>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class NetworkConnectionService {
3
+ constructor();
4
+ private networkConnectionChange;
5
+ connectionChanged$: import("rxjs").Observable<boolean>;
6
+ lastOnlineAt: Date;
7
+ get isOnline(): boolean;
8
+ get isOffline(): boolean;
9
+ private updateOnlineStatus;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NetworkConnectionService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<NetworkConnectionService>;
12
+ }
@@ -0,0 +1,8 @@
1
+ import { OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PlatformUiComponent implements OnInit {
4
+ constructor();
5
+ ngOnInit(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlatformUiComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<PlatformUiComponent, "lib-platform-ui", never, {}, {}, never, never, false>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./platform-ui.component";
3
+ export declare class PlatformUiModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlatformUiModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PlatformUiModule, [typeof i1.PlatformUiComponent], never, [typeof i1.PlatformUiComponent]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<PlatformUiModule>;
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class PlatformUiService {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<PlatformUiService, never>;
5
+ static ɵprov: i0.ɵɵInjectableDeclaration<PlatformUiService>;
6
+ }
package/package.json CHANGED
@@ -1,24 +1,44 @@
1
- {
2
- "name": "@beacon-interactive-systems-llc/beacon-platform-ui",
3
- "version": "17.0.0",
4
- "peerDependencies": {
5
- "@angular/common": "^17.3.0",
6
- "@angular/core": "^17.3.0",
7
- "@angular/forms": "^17.3.0",
8
- "@angular/material": "^17.3.10",
9
- "bootstrap": "5.3.3",
10
- "ngx-autosize": "2.0.4",
11
- "ngx-bootstrap": "12.0.0",
12
- "ngx-infinite-scroll": "17.0.1",
13
- "@ng-select/ng-select": "12.0.7",
14
- "@ngx-pwa/local-storage": "17.0.0",
15
- "angular-mentions": "1.5.0",
16
- "ngx-mask": "17.1.8",
17
- "ngx-quill": "25.3.2",
18
- "ngx-toastr": "19.0.0",
19
- "quill": "2.0.0"
20
- },
21
- "dependencies": {
22
- "tslib": "2.3.0"
23
- }
24
- }
1
+ {
2
+ "name": "@beacon-interactive-systems-llc/beacon-platform-ui",
3
+ "version": "17.0.2",
4
+ "peerDependencies": {
5
+ "@angular/common": "^17.3.0",
6
+ "@angular/core": "^17.3.0",
7
+ "@angular/forms": "^17.3.0",
8
+ "@angular/material": "^17.3.10",
9
+ "bootstrap": "5.3.3",
10
+ "ngx-autosize": "2.0.4",
11
+ "ngx-bootstrap": "12.0.0",
12
+ "ngx-infinite-scroll": "17.0.1",
13
+ "@ng-select/ng-select": "12.0.7",
14
+ "@ngx-pwa/local-storage": "17.0.0",
15
+ "angular-mentions": "1.5.0",
16
+ "ngx-mask": "17.1.8",
17
+ "ngx-quill": "25.3.2",
18
+ "ngx-toastr": "19.0.0",
19
+ "quill": "2.0.0"
20
+ },
21
+ "dependencies": {
22
+ "tslib": "2.3.0"
23
+ },
24
+ "module": "fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
25
+ "es2020": "fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
26
+ "esm2020": "esm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
27
+ "fesm2020": "fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
28
+ "fesm2015": "fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
29
+ "typings": "index.d.ts",
30
+ "exports": {
31
+ "./package.json": {
32
+ "default": "./package.json"
33
+ },
34
+ ".": {
35
+ "types": "./index.d.ts",
36
+ "esm2020": "./esm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
37
+ "es2020": "./fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
38
+ "es2015": "./fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
39
+ "node": "./fesm2015/beacon-interactive-systems-llc-beacon-platform-ui.mjs",
40
+ "default": "./fesm2020/beacon-interactive-systems-llc-beacon-platform-ui.mjs"
41
+ }
42
+ },
43
+ "sideEffects": false
44
+ }
@@ -1,7 +1,5 @@
1
1
  export * from './lib/network-connection.service';
2
2
  export * from './lib/device-detector.service';
3
-
4
- // defaults
5
3
  export * from './lib/platform-ui.service';
6
4
  export * from './lib/platform-ui.component';
7
5
  export * from './lib/platform-ui.module';
package/karma.conf.js DELETED
@@ -1,44 +0,0 @@
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/platform-ui'),
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 DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/platform-ui",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- },
7
- "assets": ["./styles/*.*","./assets/**/*.*"]
8
- }
@@ -1,46 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- const CUTOFFS = {
4
- mobile: 767,
5
- tablet: 1200
6
- }
7
-
8
- @Injectable({
9
- providedIn: 'root'
10
- })
11
- export class DeviceDetectorService {
12
- get isMobile() { return window.screen.width <= CUTOFFS.mobile }
13
-
14
- get isTablet() {
15
- return window.screen.width >= CUTOFFS.mobile && window.screen.width <= CUTOFFS.tablet;
16
- }
17
-
18
- // assume desktop is anything > 1200
19
- get isDesktop() { return window.screen.width > CUTOFFS.tablet }
20
-
21
-
22
- getBrowser() {
23
- if (!!navigator.userAgent.match(/Chrome/) && !navigator.userAgent.match(/Edg/)) { return "Chrome"; }
24
- else if (!!navigator.userAgent.match(/Opera/) || !!navigator.userAgent.match(/OPR/)) { return "Opera"; }
25
- else if (!!navigator.userAgent.match(/Firefox/) && !navigator.userAgent.match(/Safari/)) { return "Firefox"; }
26
- else if (!!navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Edg/)) { return "Safari"; }
27
- else if (!!navigator.userAgent.match(/MSIE/)) { return "IE"; }
28
- else if (!!navigator.userAgent.match(/Edg/)) { return "Microsoft Edge"; }
29
- else { return "Unknown" }
30
- }
31
-
32
- getOperatingSystem() {
33
- if (!!navigator.userAgent.match(/Win/)) { return "Windows OS"; }
34
- else if (!!navigator.userAgent.match(/Mac/)) { return "MacOS"; }
35
- else if (!!navigator.userAgent.match(/X11/)) { return "UNIX OS"; }
36
- else if (!!navigator.userAgent.match(/Linux/)) { return "Linux OS"; }
37
- else { return "Unknown"; }
38
- }
39
-
40
- getDeviceType() {
41
- if (this.isDesktop) { return "Desktop"; }
42
- else if (this.isMobile) { return "Mobile"; }
43
- else if (this.isTablet) { return "Tablet"; }
44
- else { return "Unknown"; }
45
- }
46
- }
@@ -1,31 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { Subject } from 'rxjs';
3
-
4
- declare const window: any;
5
-
6
- @Injectable({
7
- providedIn: 'root'
8
- })
9
- export class NetworkConnectionService {
10
- constructor() {
11
- window.addEventListener('online', () => this.updateOnlineStatus());
12
- window.addEventListener('offline', () => this.updateOnlineStatus());
13
- }
14
-
15
- private networkConnectionChange = new Subject<boolean>();
16
- public connectionChanged$ = this.networkConnectionChange.asObservable();
17
- public lastOnlineAt: Date = new Date();
18
-
19
- get isOnline() {
20
- return !!window.navigator.onLine;
21
- }
22
-
23
- get isOffline() {
24
- return !this.isOnline;
25
- }
26
-
27
- private updateOnlineStatus() {
28
- this.networkConnectionChange.next(window.navigator.onLine);
29
- if (window.navigator.offLine) this.lastOnlineAt = new Date();
30
- }
31
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { PlatformUiComponent } from './platform-ui.component';
4
-
5
- describe('PlatformUiComponent', () => {
6
- let component: PlatformUiComponent;
7
- let fixture: ComponentFixture<PlatformUiComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ PlatformUiComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(PlatformUiComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,20 +0,0 @@
1
- import { Component, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-platform-ui',
5
- template: `
6
- <p>
7
- platform-ui works!
8
- </p>
9
- `,
10
- styles: [
11
- ]
12
- })
13
- export class PlatformUiComponent implements OnInit {
14
-
15
- constructor() { }
16
-
17
- ngOnInit(): void {
18
- }
19
-
20
- }
@@ -1,16 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { PlatformUiComponent } from './platform-ui.component';
3
-
4
-
5
-
6
- @NgModule({
7
- declarations: [
8
- PlatformUiComponent
9
- ],
10
- imports: [
11
- ],
12
- exports: [
13
- PlatformUiComponent
14
- ]
15
- })
16
- export class PlatformUiModule { }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { PlatformUiService } from './platform-ui.service';
4
-
5
- describe('PlatformUiService', () => {
6
- let service: PlatformUiService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(PlatformUiService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,9 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
- export class PlatformUiService {
7
-
8
- constructor() { }
9
- }
package/src/test.ts DELETED
@@ -1,27 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js';
4
- import 'zone.js/testing';
5
- import { getTestBed } from '@angular/core/testing';
6
- import {
7
- BrowserDynamicTestingModule,
8
- platformBrowserDynamicTesting
9
- } from '@angular/platform-browser-dynamic/testing';
10
-
11
- declare const require: {
12
- context(path: string, deep?: boolean, filter?: RegExp): {
13
- <T>(id: string): T;
14
- keys(): string[];
15
- };
16
- };
17
-
18
- // First, initialize the Angular testing environment.
19
- getTestBed().initTestEnvironment(
20
- BrowserDynamicTestingModule,
21
- platformBrowserDynamicTesting(),
22
- );
23
-
24
- // Then we find all the tests.
25
- const context = require.context('./', true, /\.spec\.ts$/);
26
- // And load the modules.
27
- context.keys().forEach(context);
package/tsconfig.lib.json DELETED
@@ -1,15 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.lib.json",
4
- "compilerOptions": {
5
- "declarationMap": false
6
- },
7
- "angularCompilerOptions": {
8
- "compilationMode": "partial"
9
- }
10
- }
@@ -1,17 +0,0 @@
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
- }