@smarterplan/ngx-smarterplan-locations 0.2.44 → 0.2.45

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 (152) hide show
  1. package/esm2020/lib/components/carousel/carousel.component.mjs +28 -0
  2. package/esm2020/lib/components/chevron/chevron.component.mjs +18 -0
  3. package/esm2020/lib/components/detail-location/detail-location.component.mjs +168 -0
  4. package/esm2020/lib/components/form-location/form-location.component.mjs +237 -0
  5. package/esm2020/lib/components/images/images.component.mjs +107 -0
  6. package/esm2020/lib/components/locations/locations.component.mjs +145 -0
  7. package/esm2020/lib/components/locations/map/map-popup/map-popup.component.mjs +66 -0
  8. package/esm2020/lib/components/locations/map/map.component.mjs +91 -0
  9. package/esm2020/lib/components/plan-legend/plan-legend.component.mjs +47 -0
  10. package/esm2020/lib/components/plans/calibration/calibration.component.mjs +468 -0
  11. package/esm2020/lib/components/plans/edit-plan/edit-plan.component.mjs +324 -0
  12. package/esm2020/lib/components/plans/plans.component.mjs +225 -0
  13. package/esm2020/lib/components/tab-navigation/tab-navigation.component.mjs +41 -0
  14. package/esm2020/lib/components/visits/visits.component.mjs +283 -0
  15. package/esm2020/lib/components/zones/add-audio-zone/add-audio-zone.component.mjs +230 -0
  16. package/esm2020/lib/components/zones/add-zone/add-zone.component.mjs +315 -0
  17. package/esm2020/lib/components/zones/add-zone/selection/selection.component.mjs +77 -0
  18. package/esm2020/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.mjs +502 -0
  19. package/esm2020/lib/components/zones/zones.component.mjs +268 -0
  20. package/esm2020/lib/helper.service.mjs +134 -0
  21. package/esm2020/lib/ngx-smarterplan-location-routing.module.mjs +49 -0
  22. package/esm2020/lib/ngx-smarterplan-locations.module.mjs +125 -0
  23. package/esm2020/lib/ngx-smarterplan-locations.service.mjs +14 -0
  24. package/esm2020/lib/pipes/count-audio-sweeps.pipe.mjs +27 -0
  25. package/esm2020/lib/radio-button/radio-button.component.mjs +26 -0
  26. package/esm2020/public-api.mjs +9 -0
  27. package/esm2020/smarterplan-ngx-smarterplan-locations.mjs +5 -0
  28. package/fesm2015/smarterplan-ngx-smarterplan-locations.mjs +3991 -0
  29. package/fesm2015/smarterplan-ngx-smarterplan-locations.mjs.map +1 -0
  30. package/fesm2020/smarterplan-ngx-smarterplan-locations.mjs +3828 -0
  31. package/fesm2020/smarterplan-ngx-smarterplan-locations.mjs.map +1 -0
  32. package/lib/components/carousel/carousel.component.d.ts +12 -0
  33. package/lib/components/chevron/chevron.component.d.ts +9 -0
  34. package/lib/components/detail-location/detail-location.component.d.ts +55 -0
  35. package/lib/components/form-location/form-location.component.d.ts +45 -0
  36. package/lib/components/images/images.component.d.ts +33 -0
  37. package/lib/components/locations/locations.component.d.ts +51 -0
  38. package/lib/components/locations/map/map-popup/map-popup.component.d.ts +22 -0
  39. package/lib/components/locations/map/map.component.d.ts +22 -0
  40. package/lib/components/plan-legend/plan-legend.component.d.ts +14 -0
  41. package/lib/components/plans/calibration/calibration.component.d.ts +140 -0
  42. package/lib/components/plans/edit-plan/edit-plan.component.d.ts +55 -0
  43. package/lib/components/plans/plans.component.d.ts +63 -0
  44. package/lib/components/tab-navigation/tab-navigation.component.d.ts +13 -0
  45. package/lib/components/visits/visits.component.d.ts +62 -0
  46. package/lib/components/zones/add-audio-zone/add-audio-zone.component.d.ts +63 -0
  47. package/lib/components/zones/add-zone/add-zone.component.d.ts +69 -0
  48. package/lib/components/zones/add-zone/selection/selection.component.d.ts +44 -0
  49. package/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.d.ts +107 -0
  50. package/lib/components/zones/zones.component.d.ts +73 -0
  51. package/lib/helper.service.d.ts +53 -0
  52. package/lib/ngx-smarterplan-location-routing.module.d.ts +7 -0
  53. package/lib/ngx-smarterplan-locations.module.d.ts +36 -0
  54. package/lib/ngx-smarterplan-locations.service.d.ts +6 -0
  55. package/lib/pipes/count-audio-sweeps.pipe.d.ts +10 -0
  56. package/lib/radio-button/radio-button.component.d.ts +12 -0
  57. package/package.json +22 -5
  58. package/{src/public-api.ts → public-api.d.ts} +4 -11
  59. package/smarterplan-ngx-smarterplan-locations.d.ts +5 -0
  60. package/.browserslistrc +0 -16
  61. package/karma.conf.js +0 -44
  62. package/ng-package.json +0 -7
  63. package/src/lib/components/carousel/carousel.component.html +0 -13
  64. package/src/lib/components/carousel/carousel.component.scss +0 -0
  65. package/src/lib/components/carousel/carousel.component.spec.ts +0 -25
  66. package/src/lib/components/carousel/carousel.component.ts +0 -31
  67. package/src/lib/components/chevron/chevron.component.html +0 -5
  68. package/src/lib/components/chevron/chevron.component.scss +0 -16
  69. package/src/lib/components/chevron/chevron.component.spec.ts +0 -25
  70. package/src/lib/components/chevron/chevron.component.ts +0 -17
  71. package/src/lib/components/detail-location/detail-location.component.html +0 -108
  72. package/src/lib/components/detail-location/detail-location.component.scss +0 -0
  73. package/src/lib/components/detail-location/detail-location.component.spec.ts +0 -25
  74. package/src/lib/components/detail-location/detail-location.component.ts +0 -215
  75. package/src/lib/components/form-location/form-location.component.html +0 -160
  76. package/src/lib/components/form-location/form-location.component.scss +0 -62
  77. package/src/lib/components/form-location/form-location.component.spec.ts +0 -25
  78. package/src/lib/components/form-location/form-location.component.ts +0 -274
  79. package/src/lib/components/images/images.component.html +0 -27
  80. package/src/lib/components/images/images.component.scss +0 -0
  81. package/src/lib/components/images/images.component.spec.ts +0 -25
  82. package/src/lib/components/images/images.component.ts +0 -133
  83. package/src/lib/components/locations/locations.component.html +0 -63
  84. package/src/lib/components/locations/locations.component.scss +0 -121
  85. package/src/lib/components/locations/locations.component.spec.ts +0 -25
  86. package/src/lib/components/locations/locations.component.ts +0 -186
  87. package/src/lib/components/locations/map/map-popup/map-popup.component.html +0 -11
  88. package/src/lib/components/locations/map/map-popup/map-popup.component.scss +0 -51
  89. package/src/lib/components/locations/map/map-popup/map-popup.component.spec.ts +0 -25
  90. package/src/lib/components/locations/map/map-popup/map-popup.component.ts +0 -79
  91. package/src/lib/components/locations/map/map.component.html +0 -2
  92. package/src/lib/components/locations/map/map.component.scss +0 -0
  93. package/src/lib/components/locations/map/map.component.spec.ts +0 -25
  94. package/src/lib/components/locations/map/map.component.ts +0 -111
  95. package/src/lib/components/plan-legend/plan-legend.component.html +0 -9
  96. package/src/lib/components/plan-legend/plan-legend.component.scss +0 -38
  97. package/src/lib/components/plan-legend/plan-legend.component.spec.ts +0 -25
  98. package/src/lib/components/plan-legend/plan-legend.component.ts +0 -50
  99. package/src/lib/components/plans/calibration/calibration.component.html +0 -98
  100. package/src/lib/components/plans/calibration/calibration.component.scss +0 -136
  101. package/src/lib/components/plans/calibration/calibration.component.spec.ts +0 -25
  102. package/src/lib/components/plans/calibration/calibration.component.ts +0 -603
  103. package/src/lib/components/plans/edit-plan/edit-plan.component.html +0 -77
  104. package/src/lib/components/plans/edit-plan/edit-plan.component.scss +0 -9
  105. package/src/lib/components/plans/edit-plan/edit-plan.component.spec.ts +0 -25
  106. package/src/lib/components/plans/edit-plan/edit-plan.component.ts +0 -421
  107. package/src/lib/components/plans/plans.component.html +0 -102
  108. package/src/lib/components/plans/plans.component.scss +0 -24
  109. package/src/lib/components/plans/plans.component.spec.ts +0 -25
  110. package/src/lib/components/plans/plans.component.ts +0 -305
  111. package/src/lib/components/tab-navigation/tab-navigation.component.html +0 -7
  112. package/src/lib/components/tab-navigation/tab-navigation.component.scss +0 -27
  113. package/src/lib/components/tab-navigation/tab-navigation.component.spec.ts +0 -25
  114. package/src/lib/components/tab-navigation/tab-navigation.component.ts +0 -35
  115. package/src/lib/components/visits/visits.component.html +0 -134
  116. package/src/lib/components/visits/visits.component.scss +0 -24
  117. package/src/lib/components/visits/visits.component.spec.ts +0 -25
  118. package/src/lib/components/visits/visits.component.ts +0 -357
  119. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.html +0 -73
  120. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.scss +0 -14
  121. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.spec.ts +0 -25
  122. package/src/lib/components/zones/add-audio-zone/add-audio-zone.component.ts +0 -269
  123. package/src/lib/components/zones/add-zone/add-zone.component.html +0 -153
  124. package/src/lib/components/zones/add-zone/add-zone.component.scss +0 -44
  125. package/src/lib/components/zones/add-zone/add-zone.component.spec.ts +0 -25
  126. package/src/lib/components/zones/add-zone/add-zone.component.ts +0 -377
  127. package/src/lib/components/zones/add-zone/selection/selection.component.html +0 -3
  128. package/src/lib/components/zones/add-zone/selection/selection.component.scss +0 -16
  129. package/src/lib/components/zones/add-zone/selection/selection.component.spec.ts +0 -25
  130. package/src/lib/components/zones/add-zone/selection/selection.component.ts +0 -95
  131. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.html +0 -73
  132. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.scss +0 -23
  133. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.spec.ts +0 -25
  134. package/src/lib/components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component.ts +0 -595
  135. package/src/lib/components/zones/zones.component.html +0 -181
  136. package/src/lib/components/zones/zones.component.scss +0 -36
  137. package/src/lib/components/zones/zones.component.spec.ts +0 -25
  138. package/src/lib/components/zones/zones.component.ts +0 -339
  139. package/src/lib/helper.service.ts +0 -161
  140. package/src/lib/ngx-smarterplan-location-routing.module.ts +0 -41
  141. package/src/lib/ngx-smarterplan-locations.module.ts +0 -74
  142. package/src/lib/ngx-smarterplan-locations.service.spec.ts +0 -16
  143. package/src/lib/ngx-smarterplan-locations.service.ts +0 -9
  144. package/src/lib/pipes/count-audio-sweeps.pipe.ts +0 -21
  145. package/src/lib/radio-button/radio-button.component.html +0 -9
  146. package/src/lib/radio-button/radio-button.component.scss +0 -152
  147. package/src/lib/radio-button/radio-button.component.spec.ts +0 -25
  148. package/src/lib/radio-button/radio-button.component.ts +0 -26
  149. package/src/test.ts +0 -27
  150. package/tsconfig.lib.json +0 -15
  151. package/tsconfig.lib.prod.json +0 -10
  152. package/tsconfig.spec.json +0 -17
@@ -1,161 +0,0 @@
1
- export type Rectangle = {
2
- top: number;
3
- left: number;
4
- width: number;
5
- height: number;
6
- };
7
-
8
- export enum SweepState {
9
- ADDED,
10
- REMOVED,
11
- DISABLED,
12
- OCCUPIED,
13
- STARTPOINT
14
- }
15
-
16
- export function isInPolygon(p: { x: any; y: any; }, polygon: string | any[]): boolean {
17
-
18
- let isInside = false;
19
- let minX = polygon[0].x;
20
- let maxX = polygon[0].x;
21
- let minY = polygon[0].y;
22
- let maxY = polygon[0].y;
23
- for (let n = 1; n < polygon.length; n++) {
24
- const q = polygon[n];
25
- minX = Math.min(q.x, minX);
26
- maxX = Math.max(q.x, maxX);
27
- minY = Math.min(q.y, minY);
28
- maxY = Math.max(q.y, maxY);
29
- }
30
-
31
- if (p.x < minX || p.x > maxX || p.y < minY || p.y > maxY) {
32
- return false;
33
- }
34
-
35
- for (
36
- let index = 0, index_ = polygon.length - 1;
37
- index < polygon.length;
38
- index_ = index++
39
- ) {
40
- if (
41
- polygon[index].y > p.y !== polygon[index_].y > p.y &&
42
- p.x <
43
- ((polygon[index_].x - polygon[index].x) *
44
- (p.y - polygon[index].y)) /
45
- (polygon[index_].y - polygon[index].y) +
46
- polygon[index].x
47
- ) {
48
- isInside = !isInside;
49
- }
50
- }
51
- return isInside;
52
- }
53
-
54
- export function rotate(point: { x: any; y: any; }, center: { x: any; y: any; }, angle: number) {
55
- let xM;
56
- let yM;
57
- let x;
58
- let y;
59
- angle *= Math.PI / 180;
60
- xM = point.x - center.x;
61
- yM = point.y - center.y;
62
- x = xM * Math.cos(angle) + yM * Math.sin(angle) + center.x;
63
- y = -xM * Math.sin(angle) + yM * Math.cos(angle) + center.y;
64
- return { x: Math.round(x), y: Math.round(y) };
65
- }
66
-
67
- /**
68
- * Check if an HtmlElement is inside a selection
69
- * @param button HTMLElement
70
- * @param selection
71
- * @returns true if the element is inside the selection, false otherwise
72
- */
73
- export function buttonIsInSelection(
74
- button: HTMLButtonElement,
75
- selection: Rectangle,
76
- ): boolean {
77
- const bounds = button.getBoundingClientRect();
78
- return (
79
- bounds.bottom > selection.top &&
80
- bounds.top < selection.top + selection.height &&
81
- bounds.right > selection.left &&
82
- bounds.left < selection.left + selection.width
83
- );
84
- }
85
-
86
- /**
87
- * Styles the button that represents a sweep on the plan: green-added to zone, red -not added, gray - disabled, orange - occupied
88
- * @param button HTMLButtonElement, button on the plan,
89
- * @param isAdded boolean, if the sweep added to the zone
90
- * @param isOccupied boolean, if the sweep added to any other zone (but not current)
91
- */
92
- export function styleButton(button: HTMLButtonElement, state: SweepState) {
93
- switch (state) {
94
- case SweepState.ADDED:
95
- button.style.backgroundImage = `url("https://api.iconify.design/mdi:adjust.svg?color=green&height=17&width=17")`;
96
- break;
97
- case SweepState.DISABLED:
98
- button.style.backgroundImage = `url("https://api.iconify.design/mdi:close-circle-outline.svg?color=black&height=17&width=17")`;
99
- button.style.cursor = "auto";
100
- break;
101
- case SweepState.OCCUPIED:
102
- button.style.backgroundImage = `url("https://api.iconify.design/mdi:adjust.svg?color=orange&height=17&width=17")`;
103
- break;
104
- case SweepState.STARTPOINT:
105
- button.style.backgroundImage = `url('https://api.iconify.design/ic/baseline-flag-circle.svg?color=white&width=17&height=17')`;
106
- break;
107
- case SweepState.REMOVED:
108
- button.style.backgroundImage = `url("https://api.iconify.design/mdi:close-circle-outline.svg?color=red&height=17&width=17")`;
109
- break;
110
- default:
111
- button.style.backgroundImage = `url("https://api.iconify.design/mdi:close-circle-outline.svg?color=red&height=17&width=17")`;
112
- break;
113
- }
114
- // if (disabled) {
115
- // button.style.backgroundImage = `url("https://api.iconify.design/mdi:close-circle-outline.svg?color=#636363&height=17&width=17")`;
116
- // button.style.cursor = "auto";
117
- // } else if (isOccupied) {
118
- // button.style.backgroundImage = `url("https://api.iconify.design/mdi:adjust.svg?color=orange&height=17&width=17")`;
119
- // } else {
120
- // button.style.backgroundImage = isAdded
121
- // ? `url("https://api.iconify.design/mdi:adjust.svg?color=green&height=17&width=17")`
122
- // : `url("https://api.iconify.design/mdi:close-circle-outline.svg?color=red&height=17&width=17")`;
123
- // }
124
- button.style.backgroundColor = "transparent";
125
- button.style.position = "absolute";
126
- button.style.border = "none";
127
- button.style.width = "17px";
128
- button.style.height = "17px";
129
- button.disabled = false;
130
- button.type = "button";
131
- }
132
-
133
- /**
134
- * Check if sweep (button) is chosen; it is reprsented by image style "mdi:adjust"
135
- * @param button HTMLElement
136
- * @returns boolean, if button was selected
137
- */
138
- export function buttonIsChosen(button: HTMLElement): boolean {
139
- return button.style.backgroundImage.includes("adjust");
140
- }
141
-
142
- /**
143
- * Visually change the state of a scan button, a selected button is blue
144
- * @param button HTMLElement
145
- * @param selected if true the button will be blue, otherwise it will red or green
146
- */
147
- export function setVisuallySelected(button: HTMLElement, selected: boolean) {
148
- if (selected) {
149
- /** Color in blue */
150
- button.style.backgroundImage = button.style.backgroundImage
151
- .replace("red", "blue")
152
- .replace("green", "blue");
153
- } else {
154
- /** Get back in red or green */
155
- const color = buttonIsChosen(button) ? "green" : "red";
156
- button.style.backgroundImage = button.style.backgroundImage.replace(
157
- "blue",
158
- color,
159
- );
160
- }
161
- }
@@ -1,41 +0,0 @@
1
- import { NgModule } from "@angular/core";
2
- import { Routes, RouterModule } from "@angular/router";
3
- import { CalibrationComponent } from "./components/plans/calibration/calibration.component";
4
- import { DetailLocationComponent } from "./components/detail-location/detail-location.component";
5
- import { EditPlanComponent } from "./components/plans/edit-plan/edit-plan.component";
6
- import { ImagesComponent } from "./components/images/images.component";
7
- import { LocationsComponent } from "./components/locations/locations.component";
8
- import { PlansComponent } from "./components/plans/plans.component";
9
- import { VisitsComponent } from "./components/visits/visits.component";
10
- import { ZonesComponent } from "./components/zones/zones.component";
11
-
12
- const routes: Routes = [
13
- {
14
- path: "",
15
- component: LocationsComponent,
16
- },
17
- {
18
- path: ":id",
19
- children: [
20
- { path: "", component: DetailLocationComponent },
21
- { path: "zones", component: ZonesComponent },
22
- { path: "visits", component: VisitsComponent },
23
- { path: "plans", component: PlansComponent },
24
- {
25
- path: "plan-calibration",
26
- component: CalibrationComponent,
27
- },
28
- {
29
- path: "plan-edit",
30
- component: EditPlanComponent,
31
- },
32
- { path: "images", component: ImagesComponent },
33
- ],
34
- },
35
- ];
36
-
37
- @NgModule({
38
- imports: [RouterModule.forChild(routes)],
39
- exports: [RouterModule],
40
- })
41
- export class LocationsRoutingModule { }
@@ -1,74 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { LocationsComponent } from './components/locations/locations.component';
3
- import { DetailLocationComponent } from './components/detail-location/detail-location.component';
4
- import { CalibrationComponent } from './components/plans/calibration/calibration.component';
5
- import { PlansComponent } from './components/plans/plans.component';
6
- import { VisitsComponent } from './components/visits/visits.component';
7
- import { ZonesComponent } from './components/zones/zones.component';
8
- import { ImagesComponent } from './components/images/images.component';
9
- import { EditPlanComponent } from './components/plans/edit-plan/edit-plan.component';
10
- import { LocationsRoutingModule } from './ngx-smarterplan-location-routing.module';
11
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
12
- import { TabNavigationComponent } from './components/tab-navigation/tab-navigation.component';
13
- import { MapComponent } from './components/locations/map/map.component';
14
- import { LeafletModule } from '@asymmetrik/ngx-leaflet';
15
- import { TranslateModule } from '@ngx-translate/core';
16
- import { MapPopupComponent } from './components/locations/map/map-popup/map-popup.component';
17
- import { CommonModule } from '@angular/common';
18
- import { FormLocationComponent } from './components/form-location/form-location.component';
19
- import { NgbAlertModule, NgbModule } from "@ng-bootstrap/ng-bootstrap";
20
- import { ClipboardModule } from "ngx-clipboard";
21
- import { ChevronComponent } from './components/chevron/chevron.component';
22
- import { AddZoneComponent } from './components/zones/add-zone/add-zone.component';
23
- import { SelectionComponent } from './components/zones/add-zone/selection/selection.component';
24
- import { CarouselComponent } from './components/carousel/carousel.component';
25
- import { NgxSmarterplanCoreModule } from '@smarterplan/ngx-smarterplan-core';
26
- import { PdfViewerModule } from 'ng2-pdf-viewer';
27
- import { SweepPlanSelectionComponent } from './components/zones/add-zone/sweep-plan-selection/sweep-plan-selection.component';
28
- import { AddAudioZoneComponent } from './components/zones/add-audio-zone/add-audio-zone.component';
29
- import { RadioButtonComponent } from './radio-button/radio-button.component';
30
- import { PlanLegendComponent } from './components/plan-legend/plan-legend.component';
31
- import { CountAudioSweepsPipe } from './pipes/count-audio-sweeps.pipe';
32
-
33
- @NgModule({
34
- declarations: [
35
- LocationsComponent,
36
- DetailLocationComponent,
37
- CalibrationComponent,
38
- PlansComponent,
39
- VisitsComponent,
40
- ZonesComponent,
41
- ImagesComponent,
42
- EditPlanComponent,
43
- TabNavigationComponent,
44
- MapComponent,
45
- MapPopupComponent,
46
- FormLocationComponent,
47
- ChevronComponent,
48
- AddZoneComponent,
49
- SelectionComponent,
50
- CarouselComponent,
51
- SweepPlanSelectionComponent,
52
- AddAudioZoneComponent,
53
- RadioButtonComponent,
54
- PlanLegendComponent,
55
- CountAudioSweepsPipe,
56
- ],
57
- imports: [
58
- PdfViewerModule,
59
- ClipboardModule,
60
- NgbModule,
61
- NgbAlertModule,
62
- CommonModule,
63
- TranslateModule.forChild({
64
- extend: true
65
- }),
66
- LeafletModule,
67
- FormsModule,
68
- ReactiveFormsModule,
69
- NgxSmarterplanCoreModule,
70
- LocationsRoutingModule,
71
- ],
72
- exports: [MapComponent, TabNavigationComponent]
73
- })
74
- export class NgxSmarterplanLocationsModule { }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { NgxSmarterplanLocationsService } from './ngx-smarterplan-locations.service';
4
-
5
- describe('NgxSmarterplanLocationsService', () => {
6
- let service: NgxSmarterplanLocationsService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(NgxSmarterplanLocationsService);
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 NgxSmarterplanLocationsService {
7
-
8
- constructor() { }
9
- }
@@ -1,21 +0,0 @@
1
- import { Pipe, PipeTransform } from '@angular/core';
2
- import { Zone, ZoneService } from '@smarterplan/ngx-smarterplan-core';
3
-
4
- @Pipe({
5
- name: 'countAudioSweeps'
6
- })
7
- export class CountAudioSweepsPipe implements PipeTransform {
8
- constructor(private zoneService: ZoneService) { }
9
-
10
- async transform(zone: Zone): Promise<number> {
11
- let childrenAudioZones = await this.zoneService.getZonesByParentZone(zone.id);
12
- if (childrenAudioZones.length > 0) {
13
- childrenAudioZones = childrenAudioZones.filter((zone) => zone.audioID);
14
- if (childrenAudioZones.length > 0) {
15
- return childrenAudioZones.flatMap((z) => z.sweepIDs).length;
16
- }
17
- }
18
- return 0;
19
- }
20
-
21
- }
@@ -1,9 +0,0 @@
1
- <div class="checkboxContainer">
2
- <div class="switchContainer">
3
- <label class="switch switch-success">
4
- <input type="checkbox"[(ngModel)]="isChecked" (change)="onChecked()">
5
- <span class="slider round"></span>
6
- </label>
7
- </div>
8
- <span class="label right">{{label | translate}}</span>
9
- </div>
@@ -1,152 +0,0 @@
1
- $gray0: #F6F8FF;
2
- $width: 60px;
3
- $height: 34px;
4
- $widthContainer: 150px;
5
-
6
- $primary0: #404660;
7
- $shadowPrimary0: 4px 4px 10px 0px #40466080;
8
-
9
- $success0: var(--smarterplan-primary);
10
- $shadowSuccess0: 2px 2px 10px 0px var(--smarterplan-primary);
11
-
12
- $default0: #636983;
13
- $shadowDefault0: 2px 2px 10px 0px #636983;
14
-
15
- $warning1: #973c3c;
16
- $shadowWarning0: 2px 2px 10px 0px #ff9898;
17
-
18
- $dark0: #505050;
19
- $shadowDark0: 2px 2px 10px 0px #9d9d9d;
20
-
21
- .checkboxContainer {
22
- display: flex;
23
- flex-direction: row;
24
- align-items: center;
25
- width: calc(20vw + 1rem);
26
- .label {
27
- margin-left: 1rem;
28
- }
29
- .switch {
30
- position: relative;
31
- display: inline-block;
32
- cursor: pointer;
33
- width: $width;
34
- height: $height;
35
- border-radius: $height;
36
-
37
- input{
38
- opacity: 0;
39
- width: 0;
40
- height: 0;
41
-
42
-
43
- &:checked + .slider{
44
- background-color: $primary0;
45
- box-shadow: $shadowPrimary0;
46
-
47
- &:before{
48
- background: white;
49
- transform: translateX($height - 8);
50
- }
51
- }
52
- }
53
-
54
- .label{
55
- position: absolute;
56
- top: 7px;
57
- &.right{
58
- left: $width;
59
- margin-left: 10px;
60
- }
61
- }
62
-
63
- .slider {
64
- position: absolute;
65
- cursor: pointer;
66
- top: 0;
67
- left: 0;
68
- right: 0;
69
- bottom: 0;
70
- border: 1px solid $primary0;
71
- -webkit-transition: .3s;
72
- transition: .3s;
73
- border-radius: $height;
74
- &:before:hover{
75
- background-color: white;
76
- }
77
- &:before{
78
- position: absolute;
79
- content: "";
80
- height: $height - 8;
81
- width: $height - 8;
82
- left: 4px;
83
- bottom: 3px;
84
- background-color: $primary0;
85
- transition: .3s;
86
- border-radius: 50%;
87
- }
88
- }
89
-
90
- &.switch-success{
91
- input:checked + .slider{
92
- background-color: $success0;
93
- box-shadow: $shadowSuccess0;
94
- }
95
-
96
- .slider{
97
- border: 1px solid $success0;
98
- &:before{
99
- background-color: $success0;
100
- box-shadow: $shadowSuccess0;
101
- }
102
- }
103
- }
104
-
105
- &.switch-default{
106
- input:checked + .slider{
107
- background-color: $default0;
108
- box-shadow: $shadowDefault0;
109
- }
110
-
111
- .slider{
112
- border: 1px solid $default0;
113
- &:before{
114
- background-color: $default0;
115
- box-shadow: $shadowDefault0;
116
- }
117
- }
118
- }
119
-
120
- &.switch-warning{
121
- input:checked + .slider{
122
- background-color: $warning1;
123
- box-shadow: $shadowWarning0;
124
- }
125
-
126
- .slider{
127
- border: 1px solid $warning1;
128
- &:before{
129
- background-color: $warning1;
130
- box-shadow: $shadowWarning0;
131
- }
132
- }
133
- }
134
-
135
- &.switch-dark{
136
- input:checked + .slider{
137
- background-color: $dark0;
138
- box-shadow: $shadowDark0;
139
- }
140
-
141
- .slider{
142
- border: 1px solid $dark0;
143
- &:before{
144
- background-color: $dark0;
145
- box-shadow: $shadowDark0;
146
- }
147
- }
148
- }
149
- }
150
-
151
-
152
- }
@@ -1,25 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { RadioButtonComponent } from './radio-button.component';
4
-
5
- describe('RadioButtonComponent', () => {
6
- let component: RadioButtonComponent;
7
- let fixture: ComponentFixture<RadioButtonComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ RadioButtonComponent ]
12
- })
13
- .compileComponents();
14
- });
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(RadioButtonComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,26 +0,0 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-radio-button',
5
- templateUrl: './radio-button.component.html',
6
- styleUrls: ['./radio-button.component.scss']
7
- })
8
- export class RadioButtonComponent implements OnInit {
9
-
10
- @Input() label: string;
11
-
12
- @Output() isCheckedEvent = new EventEmitter<boolean>();
13
-
14
- isChecked: boolean;
15
-
16
- constructor() { }
17
-
18
- ngOnInit(): void {
19
- this.isChecked = false;
20
- }
21
-
22
- onChecked() {
23
- this.isCheckedEvent.emit(this.isChecked);
24
- }
25
-
26
- }
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().map(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
- }