@c8y/ngx-components 1021.75.8 → 1021.76.3
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/branding/shared/supports-branding.service.d.ts.map +1 -1
- package/core/dashboard/widgets-dashboard.component.d.ts +4 -2
- package/core/dashboard/widgets-dashboard.component.d.ts.map +1 -1
- package/core/navigator/navigator-bottom/navigator-bottom.service.d.ts +3 -1
- package/core/navigator/navigator-bottom/navigator-bottom.service.d.ts.map +1 -1
- package/esm2022/branding/shared/supports-branding.service.mjs +6 -3
- package/esm2022/core/dashboard/widgets-dashboard.component.mjs +9 -5
- package/esm2022/core/navigator/navigator-bottom/navigator-bottom.service.mjs +13 -6
- package/esm2022/device-map/device-map.component.mjs +2 -2
- package/esm2022/map/cluster-map.component.mjs +6 -3
- package/esm2022/map/map-status.component.mjs +23 -5
- package/esm2022/map/map.model.mjs +5 -2
- package/esm2022/map/map.service.mjs +17 -1
- package/esm2022/widgets/implementations/map/map-widget-config.component.mjs +25 -6
- package/esm2022/widgets/implementations/map/map-widget.component.mjs +40 -11
- package/fesm2022/c8y-ngx-components-branding-shared.mjs +5 -2
- package/fesm2022/c8y-ngx-components-branding-shared.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-device-map.mjs +1 -1
- package/fesm2022/c8y-ngx-components-device-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-map.mjs +47 -7
- package/fesm2022/c8y-ngx-components-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs +67 -19
- package/fesm2022/c8y-ngx-components-widgets-implementations-map.mjs.map +1 -1
- package/fesm2022/c8y-ngx-components.mjs +17 -8
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/locales.pot +3 -0
- package/map/cluster-map.component.d.ts +2 -1
- package/map/cluster-map.component.d.ts.map +1 -1
- package/map/map-status.component.d.ts +7 -2
- package/map/map-status.component.d.ts.map +1 -1
- package/map/map.model.d.ts +1 -0
- package/map/map.model.d.ts.map +1 -1
- package/map/map.service.d.ts +1 -0
- package/map/map.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/widgets/implementations/map/map-widget-config.component.d.ts +1 -0
- package/widgets/implementations/map/map-widget-config.component.d.ts.map +1 -1
- package/widgets/implementations/map/map-widget.component.d.ts +10 -4
- package/widgets/implementations/map/map-widget.component.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-branding-shared.mjs","sources":["../../branding/shared/supports-branding.service.ts","../../branding/shared/branding-tab.factory.ts","../../branding/shared/shared-branding.module.ts","../../branding/shared/c8y-ngx-components-branding-shared.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { CanActivate, UrlTree } from '@angular/router';\nimport { AppStateService, ExtensionFactory, NavigatorNode } from '@c8y/ngx-components';\nimport { Observable } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class SupportsBrandingService implements CanActivate, ExtensionFactory<NavigatorNode> {\n private supportsBranding$: Observable<boolean>;\n private node: NavigatorNode;\n constructor(private appState: AppStateService) {\n this.supportsBranding$ = this.appState.currentAppsOfUser.pipe(\n map(apps => {\n const brandingFeatureApp = apps.find(\n app => app.name === 'feature-branding' && app.owner?.tenant?.id === 'management'\n );\n return !!brandingFeatureApp;\n }),\n shareReplay(1)\n );\n this.node = new NavigatorNode({\n featureId: 'branding-editor',\n label: 'Branding',\n path: 'branding-editor',\n icon: 'palette',\n parent: 'Settings',\n routerLinkExact: false\n });\n }\n\n get(): Observable<NavigatorNode | NavigatorNode[]> {\n return this.supportsBranding$.pipe(\n map(supported => {\n if (supported) {\n return this.node;\n }\n return [];\n })\n );\n }\n\n canActivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {\n return this.supportsBranding$;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ExtensionFactory, Tab, gettext } from '@c8y/ngx-components';\nimport { Observable, merge, of } from 'rxjs';\nimport { distinctUntilChanged, map, filter, switchMap } from 'rxjs/operators';\n\nexport const lightThemeTabName = gettext('Light theme');\nexport const genericTabName = gettext('Generic');\n\n@Injectable({ providedIn: 'root' })\nexport class BrandingTabFactory implements ExtensionFactory<Tab> {\n get(activatedRoute?: ActivatedRoute): Observable<Tab | Tab[]> {\n const routes = activatedRoute.pathFromRoot.map(route => route.url);\n return this.shouldShowTab$().pipe(\n distinctUntilChanged(),\n switchMap(value => {\n if (!value) {\n return of([]);\n }\n return merge(...routes).pipe(\n filter(urlSegments =>\n urlSegments.some(urlSegment => urlSegment.path === 'branding-editor')\n ),\n switchMap(() => this.shouldShowTab$()),\n filter(shouldShow => !!shouldShow),\n switchMap(() =>\n activatedRoute.parent?.params.pipe(\n map(params => params.name),\n distinctUntilChanged(),\n filter(name => !!name),\n map(name => this.getTabsForVersion(name))\n )\n )\n );\n })\n );\n }\n\n protected shouldShowTab$(): Observable<boolean> {\n return of(true);\n }\n\n protected getPathForBranding<T extends string>(brandingName: string, subPath: T) {\n return `branding-editor/${brandingName}/edit/${subPath}` as const;\n }\n\n protected getTabsForVersion(name: string): Tab[] {\n return [\n {\n path: this.getPathForBranding(name, 'generic'),\n label: genericTabName,\n icon: 'palette',\n priority: 600\n },\n {\n path: this.getPathForBranding(name, 'light'),\n label: lightThemeTabName,\n icon: 'sun',\n priority: 500\n }\n ];\n }\n}\n","import { NgModule, inject } from '@angular/core';\nimport {\n RouterModule,\n Route,\n RouterStateSnapshot,\n ActivatedRouteSnapshot,\n ResolveFn,\n Routes\n} from '@angular/router';\nimport { SupportsBrandingService } from './supports-branding.service';\nimport { hookNavigator, HookProviderTypes, hookTab } from '@c8y/ngx-components';\nimport { BrandingTabFactory, lightThemeTabName, genericTabName } from './branding-tab.factory';\nimport {\n BrandingFileDetails,\n BrandingOptionsJson,\n StoreBrandingService\n} from '@c8y/ngx-components/branding/shared/data';\n\nexport const BRANDING_EDIT_CHILD_ROUTES: Route[] = [\n {\n path: '',\n pathMatch: 'full',\n redirectTo: 'generic'\n },\n {\n path: 'generic',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingFormComponent),\n data: {\n tabName: genericTabName\n }\n },\n {\n path: 'light',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingThemeFormComponent),\n data: {\n tabName: lightThemeTabName\n }\n }\n];\n\nexport const BRANDING_ROUTING: Routes = [\n {\n path: 'branding-editor',\n canActivate: [SupportsBrandingService],\n children: [\n {\n path: '',\n pathMatch: 'full',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingComponent)\n },\n {\n path: ':name',\n resolve: {\n branding: ((route: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => {\n return inject(StoreBrandingService).getBrandingOptionsForVersion(route.params.name);\n }) as ResolveFn<BrandingFileDetails[]>,\n tags: (async (route: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => {\n const store = inject(StoreBrandingService);\n const { variants } = await store.loadBrandingVariants();\n return variants.find(v => v?.tags?.includes(route.params.name))?.tags;\n }) as ResolveFn<string[]>,\n fallbackBranding: (async (\n _route: ActivatedRouteSnapshot,\n _state: RouterStateSnapshot\n ) => {\n try {\n const store = inject(StoreBrandingService);\n const fallbackBranding = await store.getBrandingOptionsForVersion('fallback');\n return fallbackBranding;\n } catch (e) {\n return {};\n }\n }) as ResolveFn<BrandingOptionsJson>\n },\n children: [\n {\n path: '',\n pathMatch: 'full',\n redirectTo: 'edit'\n },\n {\n path: 'edit',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(\n m => m.EditBrandingRouterOutletComponent\n ),\n children: BRANDING_EDIT_CHILD_ROUTES\n }\n ]\n }\n ]\n },\n // Redirects for legacy paths from old angularJS implementation\n // allows to keep old links working and to use the old branding manager (as long as we still ship it) when the new plugins are removed from admin app\n {\n path: 'enterprise/branding',\n pathMatch: 'full',\n redirectTo: 'branding-editor'\n },\n {\n path: 'branding',\n pathMatch: 'full',\n redirectTo: 'branding-editor'\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(BRANDING_ROUTING)],\n providers: [\n // providerType: HookProviderTypes.ExistingProvider is used to ensure that the hook is only applied once even if the module is imported multiple times\n hookNavigator(SupportsBrandingService, { providerType: HookProviderTypes.ExistingProvider }),\n hookTab(BrandingTabFactory)\n ]\n})\nexport class SharedBrandingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAOa,uBAAuB,CAAA;AAGlC,IAAA,WAAA,CAAoB,QAAyB,EAAA;QAAzB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAiB;AAC3C,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAC3D,GAAG,CAAC,IAAI,IAAG;YACT,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAClC,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,YAAY,CACjF,CAAC;YACF,OAAO,CAAC,CAAC,kBAAkB,CAAC;AAC9B,SAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf,CAAC;AACF,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC;AAC5B,YAAA,SAAS,EAAE,iBAAiB;AAC5B,YAAA,KAAK,EAAE,UAAU;AACjB,YAAA,IAAI,EAAE,iBAAiB;AACvB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,MAAM,EAAE,UAAU;AAClB,YAAA,eAAe,EAAE,KAAK;AACvB,SAAA,CAAC,CAAC;KACJ;IAED,GAAG,GAAA;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAChC,GAAG,CAAC,SAAS,IAAG;YACd,IAAI,SA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CAAC;AAC5B,qBAAA;AACF,iBAAA,CAAA;;;ACpHD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-branding-shared.mjs","sources":["../../branding/shared/supports-branding.service.ts","../../branding/shared/branding-tab.factory.ts","../../branding/shared/shared-branding.module.ts","../../branding/shared/c8y-ngx-components-branding-shared.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { CanActivate, UrlTree } from '@angular/router';\nimport { AppStateService, ExtensionFactory, NavigatorNode } from '@c8y/ngx-components';\nimport { Observable } from 'rxjs';\nimport { map, shareReplay } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class SupportsBrandingService implements CanActivate, ExtensionFactory<NavigatorNode> {\n private supportsBranding$: Observable<boolean>;\n private node: NavigatorNode;\n constructor(private appState: AppStateService) {\n this.supportsBranding$ = this.appState.currentAppsOfUser.pipe(\n map(apps => {\n const brandingFeatureApp = apps.find(\n app => app.name === 'feature-branding' && app.owner?.tenant?.id === 'management'\n );\n return !!brandingFeatureApp;\n }),\n shareReplay(1)\n );\n this.node = new NavigatorNode({\n featureId: 'branding-editor',\n label: 'Branding',\n // will be redirected to the branding-editor route\n // TODO: change back to branding-editor when angular JS implementation is removed (1022.0.0)\n path: 'branding',\n icon: 'palette',\n parent: 'Settings',\n routerLinkExact: false,\n preventDuplicates: true\n });\n }\n\n get(): Observable<NavigatorNode | NavigatorNode[]> {\n return this.supportsBranding$.pipe(\n map(supported => {\n if (supported) {\n return this.node;\n }\n return [];\n })\n );\n }\n\n canActivate(): boolean | UrlTree | Observable<boolean | UrlTree> | Promise<boolean | UrlTree> {\n return this.supportsBranding$;\n }\n}\n","import { Injectable } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { ExtensionFactory, Tab, gettext } from '@c8y/ngx-components';\nimport { Observable, merge, of } from 'rxjs';\nimport { distinctUntilChanged, map, filter, switchMap } from 'rxjs/operators';\n\nexport const lightThemeTabName = gettext('Light theme');\nexport const genericTabName = gettext('Generic');\n\n@Injectable({ providedIn: 'root' })\nexport class BrandingTabFactory implements ExtensionFactory<Tab> {\n get(activatedRoute?: ActivatedRoute): Observable<Tab | Tab[]> {\n const routes = activatedRoute.pathFromRoot.map(route => route.url);\n return this.shouldShowTab$().pipe(\n distinctUntilChanged(),\n switchMap(value => {\n if (!value) {\n return of([]);\n }\n return merge(...routes).pipe(\n filter(urlSegments =>\n urlSegments.some(urlSegment => urlSegment.path === 'branding-editor')\n ),\n switchMap(() => this.shouldShowTab$()),\n filter(shouldShow => !!shouldShow),\n switchMap(() =>\n activatedRoute.parent?.params.pipe(\n map(params => params.name),\n distinctUntilChanged(),\n filter(name => !!name),\n map(name => this.getTabsForVersion(name))\n )\n )\n );\n })\n );\n }\n\n protected shouldShowTab$(): Observable<boolean> {\n return of(true);\n }\n\n protected getPathForBranding<T extends string>(brandingName: string, subPath: T) {\n return `branding-editor/${brandingName}/edit/${subPath}` as const;\n }\n\n protected getTabsForVersion(name: string): Tab[] {\n return [\n {\n path: this.getPathForBranding(name, 'generic'),\n label: genericTabName,\n icon: 'palette',\n priority: 600\n },\n {\n path: this.getPathForBranding(name, 'light'),\n label: lightThemeTabName,\n icon: 'sun',\n priority: 500\n }\n ];\n }\n}\n","import { NgModule, inject } from '@angular/core';\nimport {\n RouterModule,\n Route,\n RouterStateSnapshot,\n ActivatedRouteSnapshot,\n ResolveFn,\n Routes\n} from '@angular/router';\nimport { SupportsBrandingService } from './supports-branding.service';\nimport { hookNavigator, HookProviderTypes, hookTab } from '@c8y/ngx-components';\nimport { BrandingTabFactory, lightThemeTabName, genericTabName } from './branding-tab.factory';\nimport {\n BrandingFileDetails,\n BrandingOptionsJson,\n StoreBrandingService\n} from '@c8y/ngx-components/branding/shared/data';\n\nexport const BRANDING_EDIT_CHILD_ROUTES: Route[] = [\n {\n path: '',\n pathMatch: 'full',\n redirectTo: 'generic'\n },\n {\n path: 'generic',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingFormComponent),\n data: {\n tabName: genericTabName\n }\n },\n {\n path: 'light',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingThemeFormComponent),\n data: {\n tabName: lightThemeTabName\n }\n }\n];\n\nexport const BRANDING_ROUTING: Routes = [\n {\n path: 'branding-editor',\n canActivate: [SupportsBrandingService],\n children: [\n {\n path: '',\n pathMatch: 'full',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(m => m.BrandingComponent)\n },\n {\n path: ':name',\n resolve: {\n branding: ((route: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => {\n return inject(StoreBrandingService).getBrandingOptionsForVersion(route.params.name);\n }) as ResolveFn<BrandingFileDetails[]>,\n tags: (async (route: ActivatedRouteSnapshot, _state: RouterStateSnapshot) => {\n const store = inject(StoreBrandingService);\n const { variants } = await store.loadBrandingVariants();\n return variants.find(v => v?.tags?.includes(route.params.name))?.tags;\n }) as ResolveFn<string[]>,\n fallbackBranding: (async (\n _route: ActivatedRouteSnapshot,\n _state: RouterStateSnapshot\n ) => {\n try {\n const store = inject(StoreBrandingService);\n const fallbackBranding = await store.getBrandingOptionsForVersion('fallback');\n return fallbackBranding;\n } catch (e) {\n return {};\n }\n }) as ResolveFn<BrandingOptionsJson>\n },\n children: [\n {\n path: '',\n pathMatch: 'full',\n redirectTo: 'edit'\n },\n {\n path: 'edit',\n loadComponent: () =>\n import('@c8y/ngx-components/branding/shared/lazy').then(\n m => m.EditBrandingRouterOutletComponent\n ),\n children: BRANDING_EDIT_CHILD_ROUTES\n }\n ]\n }\n ]\n },\n // Redirects for legacy paths from old angularJS implementation\n // allows to keep old links working and to use the old branding manager (as long as we still ship it) when the new plugins are removed from admin app\n {\n path: 'enterprise/branding',\n pathMatch: 'full',\n redirectTo: 'branding-editor'\n },\n {\n path: 'branding',\n pathMatch: 'full',\n redirectTo: 'branding-editor'\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(BRANDING_ROUTING)],\n providers: [\n // providerType: HookProviderTypes.ExistingProvider is used to ensure that the hook is only applied once even if the module is imported multiple times\n hookNavigator(SupportsBrandingService, { providerType: HookProviderTypes.ExistingProvider }),\n hookTab(BrandingTabFactory)\n ]\n})\nexport class SharedBrandingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAOa,uBAAuB,CAAA;AAGlC,IAAA,WAAA,CAAoB,QAAyB,EAAA;QAAzB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAiB;AAC3C,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAC3D,GAAG,CAAC,IAAI,IAAG;YACT,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAClC,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,YAAY,CACjF,CAAC;YACF,OAAO,CAAC,CAAC,kBAAkB,CAAC;AAC9B,SAAC,CAAC,EACF,WAAW,CAAC,CAAC,CAAC,CACf,CAAC;AACF,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC;AAC5B,YAAA,SAAS,EAAE,iBAAiB;AAC5B,YAAA,KAAK,EAAE,UAAU;;;AAGjB,YAAA,IAAI,EAAE,UAAU;AAChB,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,MAAM,EAAE,UAAU;AAClB,YAAA,eAAe,EAAE,KAAK;AACtB,YAAA,iBAAiB,EAAE,IAAI;AACxB,SAAA,CAAC,CAAC;KACJ;IAED,GAAG,GAAA;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAChC,GAAG,CAAC,SAAS,IAAG;YACd,IAAI,SAAS,EAAE;gBACb,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;AACD,YAAA,OAAO,EAAE,CAAC;SACX,CAAC,CACH,CAA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{
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DeviceMapComponent, deps: [{ token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
63
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DeviceMapComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<c8y-title>{{ 'Device map' | translate }}</c8y-title>\n\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n icon=\"exchange\"\n [label]=\"'Devices' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n icon=\"c8y-location\"\n [label]=\"'Map' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<div class=\"card card--grid content-fullpage\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map-status\n [clusterMap]=\"map\"\n [(config)]=\"config\"\n ></c8y-map-status>\n <c8y-cluster-map\n #map\n [config]=\"config\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup\n [showTrackingLink]=\"true\"\n [context]=\"context\"\n ></c8y-tracking-marker-popup>\n </div>\n </c8y-cluster-map>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: i2.BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "component", type: i2.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "ngmodule", type: MapModule }, { kind: "component", type: i3.MapStatusComponent, selector: "c8y-map-status", inputs: ["config", "clusterMap", "buttonsConfig"], outputs: ["configChange", "onUnfollow"] }, { kind: "component", type: i3.ClusterMapComponent, selector: "c8y-cluster-map", inputs: ["config", "rootNode", "asset", "showClusterColor"], outputs: ["mapChange"] }, { kind: "directive", type: i3.MapPopupDirective, selector: "[c8yMapPopup]" }, { kind: "component", type: TrackingMarkerPopupComponent, selector: "c8y-tracking-marker-popup", inputs: ["context", "showTrackingLink"] }] }); }
|
|
63
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DeviceMapComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<c8y-title>{{ 'Device map' | translate }}</c8y-title>\n\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n icon=\"exchange\"\n [label]=\"'Devices' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n icon=\"c8y-location\"\n [label]=\"'Map' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<div class=\"card card--grid content-fullpage\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map-status\n [clusterMap]=\"map\"\n [(config)]=\"config\"\n ></c8y-map-status>\n <c8y-cluster-map\n #map\n [config]=\"config\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup\n [showTrackingLink]=\"true\"\n [context]=\"context\"\n ></c8y-tracking-marker-popup>\n </div>\n </c8y-cluster-map>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "ngmodule", type: CoreModule }, { kind: "component", type: i2.BreadcrumbComponent, selector: "c8y-breadcrumb" }, { kind: "component", type: i2.BreadcrumbItemComponent, selector: "c8y-breadcrumb-item", inputs: ["icon", "translate", "label", "path", "injector"] }, { kind: "component", type: i2.TitleComponent, selector: "c8y-title", inputs: ["pageTitleUpdate"] }, { kind: "ngmodule", type: MapModule }, { kind: "component", type: i3.MapStatusComponent, selector: "c8y-map-status", inputs: ["config", "assets", "clusterMap", "buttonsConfig"], outputs: ["configChange", "onUnfollow", "fitAssetsToBounds"] }, { kind: "component", type: i3.ClusterMapComponent, selector: "c8y-cluster-map", inputs: ["config", "rootNode", "asset", "showClusterColor"], outputs: ["mapChange"] }, { kind: "directive", type: i3.MapPopupDirective, selector: "[c8yMapPopup]" }, { kind: "component", type: TrackingMarkerPopupComponent, selector: "c8y-tracking-marker-popup", inputs: ["context", "showTrackingLink"] }] }); }
|
|
64
64
|
}
|
|
65
65
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DeviceMapComponent, decorators: [{
|
|
66
66
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c8y-ngx-components-device-map.mjs","sources":["../../device-map/bounds-resolver.service.ts","../../device-map/device-map-navigation.factory.ts","../../device-map/device-map.component.ts","../../device-map/device-map.component.html","../../device-map/location-resolver.service.ts","../../device-map/device-map.feature.ts","../../device-map/c8y-ngx-components-device-map.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { MaybeAsync, Resolve } from '@angular/router';\nimport { MapService } from '@c8y/ngx-components/map';\nimport type * as L from 'leaflet';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BoundsResolverService implements Resolve<L.LatLngBounds> {\n constructor(private mapService: MapService) {}\n\n resolve(): MaybeAsync<L.LatLngBounds> {\n return this.mapService.getAllDevicesBounds();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { gettext, NavigatorNode, NavigatorNodeFactory } from '@c8y/ngx-components';\n\n@Injectable()\nexport class DeviceMapNavigationFactory implements NavigatorNodeFactory {\n nav = new NavigatorNode({\n label: gettext('Map'),\n path: 'devicemap',\n icon: 'c8y-location',\n parent: {\n label: gettext('Devices')\n },\n priority: 1900\n });\n\n async get() {\n return this.nav;\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { CommonModule, CoreModule } from '@c8y/ngx-components';\nimport { ClusterMapConfig, MapModule } from '@c8y/ngx-components/map';\nimport { TrackingMarkerPopupComponent } from '@c8y/ngx-components/tracking';\n\n@Component({\n standalone: true,\n templateUrl: './device-map.component.html',\n imports: [CommonModule, CoreModule, MapModule, TrackingMarkerPopupComponent]\n})\nexport class DeviceMapComponent {\n config: ClusterMapConfig;\n\n constructor(route: ActivatedRoute) {\n const { location, bounds } = route.snapshot.data;\n this.config = {\n center: bounds?.isValid() ? bounds.getCenter() : location,\n zoomLevel: 3,\n refreshInterval: 30000,\n bounds,\n fitBoundsOptions: {\n padding: [50, 50]\n }\n };\n }\n}\n","<c8y-title>{{ 'Device map' | translate }}</c8y-title>\n\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n icon=\"exchange\"\n [label]=\"'Devices' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n icon=\"c8y-location\"\n [label]=\"'Map' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<div class=\"card card--grid content-fullpage\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map-status\n [clusterMap]=\"map\"\n [(config)]=\"config\"\n ></c8y-map-status>\n <c8y-cluster-map\n #map\n [config]=\"config\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup\n [showTrackingLink]=\"true\"\n [context]=\"context\"\n ></c8y-tracking-marker-popup>\n </div>\n </c8y-cluster-map>\n </div>\n</div>\n","import { Injectable } from '@angular/core';\nimport { MaybeAsync, Resolve } from '@angular/router';\nimport { defaultMapConfig } from '@c8y/ngx-components/map';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationResolverService implements Resolve<[number, number]> {\n resolve(): MaybeAsync<[number, number]> {\n return new Promise((resolve, _) => {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n gp => {\n resolve([gp?.coords?.latitude, gp?.coords?.longitude]);\n },\n () => {\n resolve(defaultMapConfig.center);\n }\n );\n }\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { hookNavigator, hookRoute } from '@c8y/ngx-components';\nimport { BoundsResolverService } from './bounds-resolver.service';\nimport { DeviceMapNavigationFactory } from './device-map-navigation.factory';\nimport { DeviceMapComponent } from './device-map.component';\nimport { LocationResolverService } from './location-resolver.service';\n\nexport const deviceMapFeatureProvider: EnvironmentProviders = makeEnvironmentProviders([\n hookRoute({\n path: 'devicemap',\n component: DeviceMapComponent,\n resolve: { location: LocationResolverService, bounds: BoundsResolverService }\n }),\n hookNavigator(DeviceMapNavigationFactory)\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;MAQa,qBAAqB,CAAA;AAChC,IAAA,WAAA,CAAoB,UAAsB,EAAA;QAAtB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;KAAI;IAE9C,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC;KAC9C;+GALU,qBAAqB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCHY,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;QAEE,IAAG,CAAA,GAAA,GAAG,IAAI,aAAa,CAAC;AACtB,YAAA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QAAA,SAAS,EAAE,kBAAkB;QAC7B,OAAO,EAAE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,EAAE,qBAAqB,EAAE;KAC9E,CAAC;IACF,aAAa,CAAC,0BAA0B,CAAC;AAC1C,CAAA;;ACdD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"c8y-ngx-components-device-map.mjs","sources":["../../device-map/bounds-resolver.service.ts","../../device-map/device-map-navigation.factory.ts","../../device-map/device-map.component.ts","../../device-map/device-map.component.html","../../device-map/location-resolver.service.ts","../../device-map/device-map.feature.ts","../../device-map/c8y-ngx-components-device-map.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { MaybeAsync, Resolve } from '@angular/router';\nimport { MapService } from '@c8y/ngx-components/map';\nimport type * as L from 'leaflet';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class BoundsResolverService implements Resolve<L.LatLngBounds> {\n constructor(private mapService: MapService) {}\n\n resolve(): MaybeAsync<L.LatLngBounds> {\n return this.mapService.getAllDevicesBounds();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { gettext, NavigatorNode, NavigatorNodeFactory } from '@c8y/ngx-components';\n\n@Injectable()\nexport class DeviceMapNavigationFactory implements NavigatorNodeFactory {\n nav = new NavigatorNode({\n label: gettext('Map'),\n path: 'devicemap',\n icon: 'c8y-location',\n parent: {\n label: gettext('Devices')\n },\n priority: 1900\n });\n\n async get() {\n return this.nav;\n }\n}\n","import { Component } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { CommonModule, CoreModule } from '@c8y/ngx-components';\nimport { ClusterMapConfig, MapModule } from '@c8y/ngx-components/map';\nimport { TrackingMarkerPopupComponent } from '@c8y/ngx-components/tracking';\n\n@Component({\n standalone: true,\n templateUrl: './device-map.component.html',\n imports: [CommonModule, CoreModule, MapModule, TrackingMarkerPopupComponent]\n})\nexport class DeviceMapComponent {\n config: ClusterMapConfig;\n\n constructor(route: ActivatedRoute) {\n const { location, bounds } = route.snapshot.data;\n this.config = {\n center: bounds?.isValid() ? bounds.getCenter() : location,\n zoomLevel: 3,\n refreshInterval: 30000,\n bounds,\n fitBoundsOptions: {\n padding: [50, 50]\n }\n };\n }\n}\n","<c8y-title>{{ 'Device map' | translate }}</c8y-title>\n\n<c8y-breadcrumb>\n <c8y-breadcrumb-item\n icon=\"exchange\"\n [label]=\"'Devices' | translate\"\n ></c8y-breadcrumb-item>\n <c8y-breadcrumb-item\n icon=\"c8y-location\"\n [label]=\"'Map' | translate\"\n ></c8y-breadcrumb-item>\n</c8y-breadcrumb>\n\n<div class=\"card card--grid content-fullpage\">\n <div\n class=\"bg-white p-relative\"\n style=\"min-height: 30vh\"\n >\n <c8y-map-status\n [clusterMap]=\"map\"\n [(config)]=\"config\"\n ></c8y-map-status>\n <c8y-cluster-map\n #map\n [config]=\"config\"\n >\n <div *c8yMapPopup=\"let context\">\n <c8y-tracking-marker-popup\n [showTrackingLink]=\"true\"\n [context]=\"context\"\n ></c8y-tracking-marker-popup>\n </div>\n </c8y-cluster-map>\n </div>\n</div>\n","import { Injectable } from '@angular/core';\nimport { MaybeAsync, Resolve } from '@angular/router';\nimport { defaultMapConfig } from '@c8y/ngx-components/map';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationResolverService implements Resolve<[number, number]> {\n resolve(): MaybeAsync<[number, number]> {\n return new Promise((resolve, _) => {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n gp => {\n resolve([gp?.coords?.latitude, gp?.coords?.longitude]);\n },\n () => {\n resolve(defaultMapConfig.center);\n }\n );\n }\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { hookNavigator, hookRoute } from '@c8y/ngx-components';\nimport { BoundsResolverService } from './bounds-resolver.service';\nimport { DeviceMapNavigationFactory } from './device-map-navigation.factory';\nimport { DeviceMapComponent } from './device-map.component';\nimport { LocationResolverService } from './location-resolver.service';\n\nexport const deviceMapFeatureProvider: EnvironmentProviders = makeEnvironmentProviders([\n hookRoute({\n path: 'devicemap',\n component: DeviceMapComponent,\n resolve: { location: LocationResolverService, bounds: BoundsResolverService }\n }),\n hookNavigator(DeviceMapNavigationFactory)\n]);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;MAQa,qBAAqB,CAAA;AAChC,IAAA,WAAA,CAAoB,UAAsB,EAAA;QAAtB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;KAAI;IAE9C,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC;KAC9C;+GALU,qBAAqB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCHY,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;QAEE,IAAG,CAAA,GAAA,GAAG,IAAI,aAAa,CAAC;AACtB,YAAA,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC;AACrB,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,MAAM,EAAE;AACN,gBAAA,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC;AAC1B,aAAA;AACD,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA,CAAC,CAAC;AAK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Layer = {
|
|
|
40
40
|
priority: 1000,
|
|
41
41
|
options: {
|
|
42
42
|
maxZoom: 18,
|
|
43
|
-
minZoom:
|
|
43
|
+
minZoom: 0,
|
|
44
44
|
attribution: '©<a href="http://www.openstreetmap.org/copyright" rel="noreferrer nofollow">OpenStreetMap</a>',
|
|
45
45
|
noWrap: false
|
|
46
46
|
}
|
|
@@ -49,6 +49,9 @@ const defaultMapConfig = {
|
|
|
49
49
|
center: [51.23544, 6.79599], // Düsseldorf
|
|
50
50
|
zoomLevel: 2
|
|
51
51
|
};
|
|
52
|
+
const defaultFitBoundsOptions = {
|
|
53
|
+
padding: [50, 50]
|
|
54
|
+
};
|
|
52
55
|
|
|
53
56
|
class MapService {
|
|
54
57
|
/**
|
|
@@ -259,6 +262,22 @@ class MapService {
|
|
|
259
262
|
const shiftWorld = (lngRevMin?.lng ?? 0) - (lngRevMax?.lng ?? 0) > 180;
|
|
260
263
|
return latLngBounds(latLng(latMin?.lat, shiftWorld ? lngRevMin?.lng : lngMin?.lng), latLng(latMax?.lat, shiftWorld ? lngRevMax?.lng + 360 : lngMax?.lng));
|
|
261
264
|
}
|
|
265
|
+
async getAssetsBounds(assets) {
|
|
266
|
+
const leaflet = await this.getLeaflet();
|
|
267
|
+
const bounds = leaflet.latLngBounds([]);
|
|
268
|
+
let hasValidPositions = false;
|
|
269
|
+
assets.forEach(asset => {
|
|
270
|
+
const position = asset.c8y_Position;
|
|
271
|
+
if (position && typeof position.lat === 'number' && typeof position.lng === 'number') {
|
|
272
|
+
bounds.extend([position.lat, position.lng]);
|
|
273
|
+
hasValidPositions = true;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
if (!hasValidPositions || !bounds.isValid()) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
return bounds;
|
|
280
|
+
}
|
|
262
281
|
/**
|
|
263
282
|
* Returns the cluster size for clustered maps. Counting the position MOs in a bounding
|
|
264
283
|
* and if it reach a threshold, returning a [[ClusterSize]].
|
|
@@ -1089,7 +1108,7 @@ class ClusterMapComponent extends MapComponent {
|
|
|
1089
1108
|
});
|
|
1090
1109
|
}
|
|
1091
1110
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClusterMapComponent, deps: [{ token: i1$1.ManagedObjectRealtimeService }, { token: MapService }, { token: MAP_TILE_LAYER }, { token: MAP_DEFAULT_CONFIG }, { token: i3.TranslateService }, { token: i1$1.WidgetGlobalAutoRefreshService }, { token: i0.IterableDiffers }, { token: i1$1.ColorService }, { token: i1$1.GeoService }, { token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1092
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ClusterMapComponent, selector: "c8y-cluster-map", inputs: { config: "config", rootNode: "rootNode", assets: ["asset", "assets"], showClusterColor: "showClusterColor" }, outputs: { mapChange: "mapChange" }, providers: [ManagedObjectRealtimeService], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n" }); }
|
|
1111
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ClusterMapComponent, selector: "c8y-cluster-map", inputs: { config: "config", rootNode: "rootNode", assets: ["asset", "assets"], showClusterColor: "showClusterColor" }, outputs: { mapChange: "mapChange" }, providers: [ManagedObjectRealtimeService], viewQueries: [{ propertyName: "mapElement", first: true, predicate: ["map"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map\">\n <div #map></div>\n</div>\n<ng-content></ng-content>\n" }); }
|
|
1093
1112
|
}
|
|
1094
1113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClusterMapComponent, decorators: [{
|
|
1095
1114
|
type: Component,
|
|
@@ -1111,12 +1130,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1111
1130
|
type: Input
|
|
1112
1131
|
}], mapChange: [{
|
|
1113
1132
|
type: Output
|
|
1133
|
+
}], mapElement: [{
|
|
1134
|
+
type: ViewChild,
|
|
1135
|
+
args: ['map']
|
|
1114
1136
|
}] } });
|
|
1115
1137
|
|
|
1116
1138
|
class MapStatusComponent {
|
|
1117
1139
|
constructor() {
|
|
1118
1140
|
this.configChange = new EventEmitter();
|
|
1119
1141
|
this.onUnfollow = new EventEmitter();
|
|
1142
|
+
this.fitAssetsToBounds = new EventEmitter();
|
|
1120
1143
|
this.buttonsConfig = {};
|
|
1121
1144
|
this.centerMapButtonDisabled = true;
|
|
1122
1145
|
this.refreshPaused = false;
|
|
@@ -1139,6 +1162,10 @@ class MapStatusComponent {
|
|
|
1139
1162
|
center() {
|
|
1140
1163
|
this.clusterMap.center();
|
|
1141
1164
|
}
|
|
1165
|
+
fitToBounds() {
|
|
1166
|
+
this.fitToBoundsButtonDisabled = true;
|
|
1167
|
+
this.fitAssetsToBounds.emit();
|
|
1168
|
+
}
|
|
1142
1169
|
reload() {
|
|
1143
1170
|
this.clusterMap.reload();
|
|
1144
1171
|
}
|
|
@@ -1183,9 +1210,12 @@ class MapStatusComponent {
|
|
|
1183
1210
|
}
|
|
1184
1211
|
checkIfMapIsAlreadyCentered() {
|
|
1185
1212
|
this.clusterMap.mapChange.pipe(takeUntil(this.destroy$)).subscribe((event) => {
|
|
1186
|
-
if (
|
|
1213
|
+
if (event.sourceTarget?.getBounds) {
|
|
1187
1214
|
const bounds = event.sourceTarget.getBounds();
|
|
1188
|
-
this.
|
|
1215
|
+
this.fitToBoundsButtonDisabled = this.shouldDisableFitToBoundsButton(bounds);
|
|
1216
|
+
if (this.config?.center) {
|
|
1217
|
+
this.centerMapButtonDisabled = this.shouldDisableCenterButton(bounds);
|
|
1218
|
+
}
|
|
1189
1219
|
}
|
|
1190
1220
|
});
|
|
1191
1221
|
}
|
|
@@ -1203,23 +1233,33 @@ class MapStatusComponent {
|
|
|
1203
1233
|
const shrunkBounds = bounds.pad(-0.25);
|
|
1204
1234
|
return shrunkBounds.contains(this.config.center);
|
|
1205
1235
|
}
|
|
1236
|
+
shouldDisableFitToBoundsButton(bounds) {
|
|
1237
|
+
if (!this.assets) {
|
|
1238
|
+
return true;
|
|
1239
|
+
}
|
|
1240
|
+
return this.assets.every(({ c8y_Position }) => bounds.contains([c8y_Position.lat, c8y_Position.lng]));
|
|
1241
|
+
}
|
|
1206
1242
|
defaultButtonsConfig() {
|
|
1207
1243
|
return {
|
|
1208
1244
|
realtime: { show: this.config.realtime || this.clusterMap.config.follow, disabled: false }
|
|
1209
1245
|
};
|
|
1210
1246
|
}
|
|
1211
1247
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MapStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1212
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow" }, viewQueries: [{ propertyName: "countdownIntervalComp", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: i1$1.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval"], outputs: ["countdownEnded"] }, { kind: "directive", type: i3$1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] }); }
|
|
1248
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MapStatusComponent, selector: "c8y-map-status", inputs: { config: "config", assets: "assets", clusterMap: "clusterMap", buttonsConfig: "buttonsConfig" }, outputs: { configChange: "configChange", onUnfollow: "onUnfollow", fitAssetsToBounds: "fitAssetsToBounds" }, viewQueries: [{ propertyName: "countdownIntervalComp", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Fit to assets bounds' | translate }}\"\n type=\"button\"\n (click)=\"fitToBounds()\"\n [disabled]=\"fitToBoundsButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"waypoint-map\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "component", type: i1$1.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval"], outputs: ["countdownEnded"] }, { kind: "directive", type: i3$1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }] }); }
|
|
1213
1249
|
}
|
|
1214
1250
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MapStatusComponent, decorators: [{
|
|
1215
1251
|
type: Component,
|
|
1216
|
-
args: [{ selector: 'c8y-map-status', template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
1252
|
+
args: [{ selector: 'c8y-map-status', template: "<div class=\"c8y-map-status\">\n <div class=\"leaflet-touch\">\n <div\n class=\"leaflet-bar\"\n role=\"group\"\n >\n <button\n class=\"c8y-realtime\"\n title=\"{{ 'Realtime' | translate }}\"\n type=\"button\"\n *ngIf=\"buttonsConfig.realtime.show\"\n (click)=\"toggleRealtime()\"\n [disabled]=\"buttonsConfig.realtime.disabled\"\n >\n <span\n class=\"c8y-pulse\"\n [ngClass]=\"{\n active: clusterMap?.config.realtime,\n inactive: !clusterMap?.config.realtime\n }\"\n ></span>\n </button>\n\n <label\n class=\"toggle-countdown vertical\"\n [attr.aria-label]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n [tooltip]=\"\n refreshPaused ? ('Enable auto refresh' | translate) : ('Disable auto refresh' | translate)\n \"\n placement=\"left\"\n *ngIf=\"\n !config.widgetInstanceGlobalAutoRefreshContext &&\n clusterMap?.config.refreshInterval &&\n !clusterMap?.config.follow\n \"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"1000\"\n >\n <input\n type=\"checkbox\"\n (click)=\"toggleAutoRefresh($event)\"\n />\n <c8y-countdown-interval\n [hidden]=\"refreshPaused\"\n [countdownInterval]=\"clusterMap?.config.refreshInterval\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"refreshPaused\"\n ></i>\n </label>\n\n <button\n title=\"{{ 'Cancel reload' | translate }}\"\n type=\"button\"\n *ngIf=\"(clusterMap?.isLoading$ | async) && !config.widgetInstanceGlobalAutoRefreshContext\"\n (click)=\"cancelReload()\"\n >\n <i\n class=\"icon-spin\"\n c8yIcon=\"refresh\"\n ></i>\n </button>\n <button\n [title]=\"'Reload' | translate\"\n type=\"button\"\n *ngIf=\"\n !clusterMap?.config.realtime &&\n !clusterMap?.assets &&\n !(clusterMap?.isLoading$ | async) &&\n !config.widgetInstanceGlobalAutoRefreshContext\n \"\n (click)=\"reload()\"\n >\n <i c8yIcon=\"refresh\"></i>\n </button>\n <button\n title=\"{{ 'Center map' | translate }}\"\n type=\"button\"\n (click)=\"center()\"\n [disabled]=\"centerMapButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"target1\"></i>\n </button>\n <button\n title=\"{{ 'Fit to assets bounds' | translate }}\"\n type=\"button\"\n (click)=\"fitToBounds()\"\n [disabled]=\"fitToBoundsButtonDisabled || clusterMap?.config.follow\"\n >\n <i c8yIcon=\"waypoint-map\"></i>\n </button>\n <button\n title=\"{{ 'Unfollow' | translate }}\"\n type=\"button\"\n *ngIf=\"clusterMap?.config.follow\"\n (click)=\"unfollow()\"\n >\n <i c8yIcon=\"marker-off\"></i>\n </button>\n\n <button\n title=\"{{ 'Follow' | translate }}\"\n type=\"button\"\n *ngIf=\"initConfig.follow && !clusterMap?.config.follow\"\n (click)=\"follow()\"\n >\n <i c8yIcon=\"marker\"></i>\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
1217
1253
|
}], propDecorators: { config: [{
|
|
1218
1254
|
type: Input
|
|
1255
|
+
}], assets: [{
|
|
1256
|
+
type: Input
|
|
1219
1257
|
}], configChange: [{
|
|
1220
1258
|
type: Output
|
|
1221
1259
|
}], onUnfollow: [{
|
|
1222
1260
|
type: Output
|
|
1261
|
+
}], fitAssetsToBounds: [{
|
|
1262
|
+
type: Output
|
|
1223
1263
|
}], clusterMap: [{
|
|
1224
1264
|
type: Input
|
|
1225
1265
|
}], buttonsConfig: [{
|
|
@@ -1298,5 +1338,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
1298
1338
|
* Generated bundle index. Do not edit.
|
|
1299
1339
|
*/
|
|
1300
1340
|
|
|
1301
|
-
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1341
|
+
export { ClusterMap, ClusterMapComponent, ClusterSize, MAP_DEFAULT_CONFIG, MAP_TILE_LAYER, MapComponent, MapModule, MapPopupDirective, MapService, MapStatusComponent, MapTenantOptionKeys, defaultFitBoundsOptions, defaultLayer, defaultMapConfig, getC8yMarker };
|
|
1302
1342
|
//# sourceMappingURL=c8y-ngx-components-map.mjs.map
|