@geodienst/dashkit 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/fesm2022/geodienst-dashkit-testing.mjs +373 -0
- package/fesm2022/geodienst-dashkit-testing.mjs.map +1 -0
- package/fesm2022/geodienst-dashkit.mjs +2574 -0
- package/fesm2022/geodienst-dashkit.mjs.map +1 -0
- package/locale/messages.bg.xlf +39 -0
- package/locale/messages.de.xlf +39 -0
- package/locale/messages.el.xlf +39 -0
- package/locale/messages.es.xlf +39 -0
- package/locale/messages.fr.xlf +39 -0
- package/locale/messages.tr.xlf +39 -0
- package/locale/messages.xlf +31 -0
- package/package.json +43 -4
- package/types/geodienst-dashkit-testing.d.ts +89 -0
- package/types/geodienst-dashkit.d.ts +444 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Geodienst
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @geodienst/dashkit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular components for map dashboards: a MapLibre map, filters, legend, lists, tables and dialogs, based on Angular Material.
|
|
4
|
+
All components use the `gd-` selector prefix. [`src/public-api.ts`](https://github.com/geodienst/dashkit/blob/master/projects/geodienst/dashkit/src/public-api.ts) lists everything the package exports.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Requires Angular 22.3 or newer with Angular Material.
|
|
9
|
+
|
|
10
|
+
```powershell
|
|
11
|
+
npm install @geodienst/dashkit
|
|
12
|
+
npm install @angular/material @angular/localize maplibre-gl
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
npm installs the other peer dependencies automatically. The second line adds the ones the app uses directly (see *Setup*) to its own `package.json`.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
`angular.json`, in the app's `build` options:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
"assets": [
|
|
23
|
+
{ "glob": "maplibre-gl-{worker,shared}.mjs", "input": "node_modules/maplibre-gl/dist", "output": "maplibre" },
|
|
24
|
+
{ "glob": "messages.*.xlf", "input": "node_modules/@geodienst/dashkit/locale", "output": "locale/components" }
|
|
25
|
+
],
|
|
26
|
+
"styles": ["node_modules/maplibre-gl/dist/maplibre-gl.css", "src/theme.scss"],
|
|
27
|
+
"polyfills": ["@angular/localize/init"]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- `src/theme.scss` is the app's Angular Material theme. The components take all colors and fonts from it.
|
|
31
|
+
- `main.ts` tells MapLibre where its worker is: `setWorkerUrl('maplibre/maplibre-gl-worker.mjs')` (from `maplibre-gl`).
|
|
32
|
+
|
|
33
|
+
## Translations
|
|
34
|
+
|
|
35
|
+
The component texts are translated into de, fr, es, tr, bg and el. The package ships them as `locale/messages.<lang>.xlf`.
|
|
36
|
+
|
|
37
|
+
- With runtime translations, the app fetches `locale/components/messages.<lang>.xlf` and passes them to `loadTranslations` before it bootstraps.
|
|
38
|
+
Load the app's own files afterwards: a text with the same id then overrides the component text.
|
|
39
|
+
- With build-time translations, add the package file first in `i18n.locales`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
"de": ["node_modules/@geodienst/dashkit/locale/messages.de.xlf", "src/locale/messages.de.xlf"]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Tests in the app
|
|
46
|
+
|
|
47
|
+
jsdom has no WebGL, so app tests replace the MapLibre components with stubs:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { stubMapLibre } from '@geodienst/dashkit/testing';
|
|
51
|
+
```
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, Directive, input, output } from "@angular/core";
|
|
3
|
+
import { ControlComponent, GeolocateControlDirective, MapComponent, MarkerComponent, NavigationControlDirective, ScaleControlDirective } from "@maplibre/ngx-maplibre-gl";
|
|
4
|
+
import { TestBed } from "@angular/core/testing";
|
|
5
|
+
import { MapView } from "@geodienst/dashkit";
|
|
6
|
+
var MapStub = class MapStub {
|
|
7
|
+
mapStyle = input(...ngDevMode ? [void 0, { debugName: "mapStyle" }] : /* istanbul ignore next */ []);
|
|
8
|
+
center = input(...ngDevMode ? [void 0, { debugName: "center" }] : /* istanbul ignore next */ []);
|
|
9
|
+
zoom = input(...ngDevMode ? [void 0, { debugName: "zoom" }] : /* istanbul ignore next */ []);
|
|
10
|
+
locale = input(...ngDevMode ? [void 0, { debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
11
|
+
fitBounds = input(...ngDevMode ? [void 0, { debugName: "fitBounds" }] : /* istanbul ignore next */ []);
|
|
12
|
+
fitBoundsOptions = input(...ngDevMode ? [void 0, { debugName: "fitBoundsOptions" }] : /* istanbul ignore next */ []);
|
|
13
|
+
mapLoad = output();
|
|
14
|
+
moveStart = output();
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
16
|
+
minVersion: "12.0.0",
|
|
17
|
+
version: "22.3.0",
|
|
18
|
+
ngImport: i0,
|
|
19
|
+
type: MapStub,
|
|
20
|
+
deps: [],
|
|
21
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
22
|
+
});
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
24
|
+
minVersion: "17.1.0",
|
|
25
|
+
version: "22.3.0",
|
|
26
|
+
type: MapStub,
|
|
27
|
+
isStandalone: true,
|
|
28
|
+
selector: "mgl-map",
|
|
29
|
+
inputs: {
|
|
30
|
+
mapStyle: {
|
|
31
|
+
classPropertyName: "mapStyle",
|
|
32
|
+
publicName: "mapStyle",
|
|
33
|
+
isSignal: true,
|
|
34
|
+
isRequired: false,
|
|
35
|
+
transformFunction: null
|
|
36
|
+
},
|
|
37
|
+
center: {
|
|
38
|
+
classPropertyName: "center",
|
|
39
|
+
publicName: "center",
|
|
40
|
+
isSignal: true,
|
|
41
|
+
isRequired: false,
|
|
42
|
+
transformFunction: null
|
|
43
|
+
},
|
|
44
|
+
zoom: {
|
|
45
|
+
classPropertyName: "zoom",
|
|
46
|
+
publicName: "zoom",
|
|
47
|
+
isSignal: true,
|
|
48
|
+
isRequired: false,
|
|
49
|
+
transformFunction: null
|
|
50
|
+
},
|
|
51
|
+
locale: {
|
|
52
|
+
classPropertyName: "locale",
|
|
53
|
+
publicName: "locale",
|
|
54
|
+
isSignal: true,
|
|
55
|
+
isRequired: false,
|
|
56
|
+
transformFunction: null
|
|
57
|
+
},
|
|
58
|
+
fitBounds: {
|
|
59
|
+
classPropertyName: "fitBounds",
|
|
60
|
+
publicName: "fitBounds",
|
|
61
|
+
isSignal: true,
|
|
62
|
+
isRequired: false,
|
|
63
|
+
transformFunction: null
|
|
64
|
+
},
|
|
65
|
+
fitBoundsOptions: {
|
|
66
|
+
classPropertyName: "fitBoundsOptions",
|
|
67
|
+
publicName: "fitBoundsOptions",
|
|
68
|
+
isSignal: true,
|
|
69
|
+
isRequired: false,
|
|
70
|
+
transformFunction: null
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
outputs: {
|
|
74
|
+
mapLoad: "mapLoad",
|
|
75
|
+
moveStart: "moveStart"
|
|
76
|
+
},
|
|
77
|
+
ngImport: i0,
|
|
78
|
+
template: "<ng-content />",
|
|
79
|
+
isInline: true
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
83
|
+
minVersion: "12.0.0",
|
|
84
|
+
version: "22.3.0",
|
|
85
|
+
ngImport: i0,
|
|
86
|
+
type: MapStub,
|
|
87
|
+
decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{
|
|
90
|
+
selector: "mgl-map",
|
|
91
|
+
template: "<ng-content />"
|
|
92
|
+
}]
|
|
93
|
+
}],
|
|
94
|
+
propDecorators: {
|
|
95
|
+
mapStyle: [{
|
|
96
|
+
type: i0.Input,
|
|
97
|
+
args: [{
|
|
98
|
+
isSignal: true,
|
|
99
|
+
alias: "mapStyle",
|
|
100
|
+
required: false
|
|
101
|
+
}]
|
|
102
|
+
}],
|
|
103
|
+
center: [{
|
|
104
|
+
type: i0.Input,
|
|
105
|
+
args: [{
|
|
106
|
+
isSignal: true,
|
|
107
|
+
alias: "center",
|
|
108
|
+
required: false
|
|
109
|
+
}]
|
|
110
|
+
}],
|
|
111
|
+
zoom: [{
|
|
112
|
+
type: i0.Input,
|
|
113
|
+
args: [{
|
|
114
|
+
isSignal: true,
|
|
115
|
+
alias: "zoom",
|
|
116
|
+
required: false
|
|
117
|
+
}]
|
|
118
|
+
}],
|
|
119
|
+
locale: [{
|
|
120
|
+
type: i0.Input,
|
|
121
|
+
args: [{
|
|
122
|
+
isSignal: true,
|
|
123
|
+
alias: "locale",
|
|
124
|
+
required: false
|
|
125
|
+
}]
|
|
126
|
+
}],
|
|
127
|
+
fitBounds: [{
|
|
128
|
+
type: i0.Input,
|
|
129
|
+
args: [{
|
|
130
|
+
isSignal: true,
|
|
131
|
+
alias: "fitBounds",
|
|
132
|
+
required: false
|
|
133
|
+
}]
|
|
134
|
+
}],
|
|
135
|
+
fitBoundsOptions: [{
|
|
136
|
+
type: i0.Input,
|
|
137
|
+
args: [{
|
|
138
|
+
isSignal: true,
|
|
139
|
+
alias: "fitBoundsOptions",
|
|
140
|
+
required: false
|
|
141
|
+
}]
|
|
142
|
+
}],
|
|
143
|
+
mapLoad: [{
|
|
144
|
+
type: i0.Output,
|
|
145
|
+
args: ["mapLoad"]
|
|
146
|
+
}],
|
|
147
|
+
moveStart: [{
|
|
148
|
+
type: i0.Output,
|
|
149
|
+
args: ["moveStart"]
|
|
150
|
+
}]
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
var MarkerStub = class MarkerStub {
|
|
154
|
+
lngLat = input(...ngDevMode ? [void 0, { debugName: "lngLat" }] : /* istanbul ignore next */ []);
|
|
155
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
156
|
+
minVersion: "12.0.0",
|
|
157
|
+
version: "22.3.0",
|
|
158
|
+
ngImport: i0,
|
|
159
|
+
type: MarkerStub,
|
|
160
|
+
deps: [],
|
|
161
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
162
|
+
});
|
|
163
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
164
|
+
minVersion: "17.1.0",
|
|
165
|
+
version: "22.3.0",
|
|
166
|
+
type: MarkerStub,
|
|
167
|
+
isStandalone: true,
|
|
168
|
+
selector: "mgl-marker",
|
|
169
|
+
inputs: { lngLat: {
|
|
170
|
+
classPropertyName: "lngLat",
|
|
171
|
+
publicName: "lngLat",
|
|
172
|
+
isSignal: true,
|
|
173
|
+
isRequired: false,
|
|
174
|
+
transformFunction: null
|
|
175
|
+
} },
|
|
176
|
+
ngImport: i0,
|
|
177
|
+
template: "<ng-content />",
|
|
178
|
+
isInline: true
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
182
|
+
minVersion: "12.0.0",
|
|
183
|
+
version: "22.3.0",
|
|
184
|
+
ngImport: i0,
|
|
185
|
+
type: MarkerStub,
|
|
186
|
+
decorators: [{
|
|
187
|
+
type: Component,
|
|
188
|
+
args: [{
|
|
189
|
+
selector: "mgl-marker",
|
|
190
|
+
template: "<ng-content />"
|
|
191
|
+
}]
|
|
192
|
+
}],
|
|
193
|
+
propDecorators: { lngLat: [{
|
|
194
|
+
type: i0.Input,
|
|
195
|
+
args: [{
|
|
196
|
+
isSignal: true,
|
|
197
|
+
alias: "lngLat",
|
|
198
|
+
required: false
|
|
199
|
+
}]
|
|
200
|
+
}] }
|
|
201
|
+
});
|
|
202
|
+
var ControlStub = class ControlStub {
|
|
203
|
+
position = input(...ngDevMode ? [void 0, { debugName: "position" }] : /* istanbul ignore next */ []);
|
|
204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
205
|
+
minVersion: "12.0.0",
|
|
206
|
+
version: "22.3.0",
|
|
207
|
+
ngImport: i0,
|
|
208
|
+
type: ControlStub,
|
|
209
|
+
deps: [],
|
|
210
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
211
|
+
});
|
|
212
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
213
|
+
minVersion: "17.1.0",
|
|
214
|
+
version: "22.3.0",
|
|
215
|
+
type: ControlStub,
|
|
216
|
+
isStandalone: true,
|
|
217
|
+
selector: "mgl-control",
|
|
218
|
+
inputs: { position: {
|
|
219
|
+
classPropertyName: "position",
|
|
220
|
+
publicName: "position",
|
|
221
|
+
isSignal: true,
|
|
222
|
+
isRequired: false,
|
|
223
|
+
transformFunction: null
|
|
224
|
+
} },
|
|
225
|
+
ngImport: i0,
|
|
226
|
+
template: "<ng-content />",
|
|
227
|
+
isInline: true
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
231
|
+
minVersion: "12.0.0",
|
|
232
|
+
version: "22.3.0",
|
|
233
|
+
ngImport: i0,
|
|
234
|
+
type: ControlStub,
|
|
235
|
+
decorators: [{
|
|
236
|
+
type: Component,
|
|
237
|
+
args: [{
|
|
238
|
+
selector: "mgl-control",
|
|
239
|
+
template: "<ng-content />"
|
|
240
|
+
}]
|
|
241
|
+
}],
|
|
242
|
+
propDecorators: { position: [{
|
|
243
|
+
type: i0.Input,
|
|
244
|
+
args: [{
|
|
245
|
+
isSignal: true,
|
|
246
|
+
alias: "position",
|
|
247
|
+
required: false
|
|
248
|
+
}]
|
|
249
|
+
}] }
|
|
250
|
+
});
|
|
251
|
+
var NavigationStub = class NavigationStub {
|
|
252
|
+
showCompass = input(...ngDevMode ? [void 0, { debugName: "showCompass" }] : /* istanbul ignore next */ []);
|
|
253
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
254
|
+
minVersion: "12.0.0",
|
|
255
|
+
version: "22.3.0",
|
|
256
|
+
ngImport: i0,
|
|
257
|
+
type: NavigationStub,
|
|
258
|
+
deps: [],
|
|
259
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
260
|
+
});
|
|
261
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
262
|
+
minVersion: "17.1.0",
|
|
263
|
+
version: "22.3.0",
|
|
264
|
+
type: NavigationStub,
|
|
265
|
+
isStandalone: true,
|
|
266
|
+
selector: "[mglNavigation]",
|
|
267
|
+
inputs: { showCompass: {
|
|
268
|
+
classPropertyName: "showCompass",
|
|
269
|
+
publicName: "showCompass",
|
|
270
|
+
isSignal: true,
|
|
271
|
+
isRequired: false,
|
|
272
|
+
transformFunction: null
|
|
273
|
+
} },
|
|
274
|
+
ngImport: i0
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
278
|
+
minVersion: "12.0.0",
|
|
279
|
+
version: "22.3.0",
|
|
280
|
+
ngImport: i0,
|
|
281
|
+
type: NavigationStub,
|
|
282
|
+
decorators: [{
|
|
283
|
+
type: Directive,
|
|
284
|
+
args: [{ selector: "[mglNavigation]" }]
|
|
285
|
+
}],
|
|
286
|
+
propDecorators: { showCompass: [{
|
|
287
|
+
type: i0.Input,
|
|
288
|
+
args: [{
|
|
289
|
+
isSignal: true,
|
|
290
|
+
alias: "showCompass",
|
|
291
|
+
required: false
|
|
292
|
+
}]
|
|
293
|
+
}] }
|
|
294
|
+
});
|
|
295
|
+
var ScaleStub = class ScaleStub {
|
|
296
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
297
|
+
minVersion: "12.0.0",
|
|
298
|
+
version: "22.3.0",
|
|
299
|
+
ngImport: i0,
|
|
300
|
+
type: ScaleStub,
|
|
301
|
+
deps: [],
|
|
302
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
303
|
+
});
|
|
304
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
305
|
+
minVersion: "14.0.0",
|
|
306
|
+
version: "22.3.0",
|
|
307
|
+
type: ScaleStub,
|
|
308
|
+
isStandalone: true,
|
|
309
|
+
selector: "[mglScale]",
|
|
310
|
+
ngImport: i0
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
314
|
+
minVersion: "12.0.0",
|
|
315
|
+
version: "22.3.0",
|
|
316
|
+
ngImport: i0,
|
|
317
|
+
type: ScaleStub,
|
|
318
|
+
decorators: [{
|
|
319
|
+
type: Directive,
|
|
320
|
+
args: [{ selector: "[mglScale]" }]
|
|
321
|
+
}]
|
|
322
|
+
});
|
|
323
|
+
var GeolocateStub = class GeolocateStub {
|
|
324
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
325
|
+
minVersion: "12.0.0",
|
|
326
|
+
version: "22.3.0",
|
|
327
|
+
ngImport: i0,
|
|
328
|
+
type: GeolocateStub,
|
|
329
|
+
deps: [],
|
|
330
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
331
|
+
});
|
|
332
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
333
|
+
minVersion: "14.0.0",
|
|
334
|
+
version: "22.3.0",
|
|
335
|
+
type: GeolocateStub,
|
|
336
|
+
isStandalone: true,
|
|
337
|
+
selector: "[mglGeolocate]",
|
|
338
|
+
ngImport: i0
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
342
|
+
minVersion: "12.0.0",
|
|
343
|
+
version: "22.3.0",
|
|
344
|
+
ngImport: i0,
|
|
345
|
+
type: GeolocateStub,
|
|
346
|
+
decorators: [{
|
|
347
|
+
type: Directive,
|
|
348
|
+
args: [{ selector: "[mglGeolocate]" }]
|
|
349
|
+
}]
|
|
350
|
+
});
|
|
351
|
+
function stubMapLibre() {
|
|
352
|
+
TestBed.overrideComponent(MapView, {
|
|
353
|
+
remove: { imports: [
|
|
354
|
+
MapComponent,
|
|
355
|
+
MarkerComponent,
|
|
356
|
+
ControlComponent,
|
|
357
|
+
NavigationControlDirective,
|
|
358
|
+
ScaleControlDirective,
|
|
359
|
+
GeolocateControlDirective
|
|
360
|
+
] },
|
|
361
|
+
add: { imports: [
|
|
362
|
+
MapStub,
|
|
363
|
+
MarkerStub,
|
|
364
|
+
ControlStub,
|
|
365
|
+
NavigationStub,
|
|
366
|
+
ScaleStub,
|
|
367
|
+
GeolocateStub
|
|
368
|
+
] }
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
export { ControlStub, GeolocateStub, MapStub, MarkerStub, NavigationStub, ScaleStub, stubMapLibre };
|
|
372
|
+
|
|
373
|
+
//# sourceMappingURL=geodienst-dashkit-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geodienst-dashkit-testing.mjs","names":[],"sources":["../../../../projects/geodienst/dashkit/testing/src/map-view.stubs.ts"],"sourcesContent":["import { Component, Directive, input, output } from '@angular/core';\nimport { TestBed } from '@angular/core/testing';\nimport {\n ControlComponent,\n GeolocateControlDirective,\n MapComponent,\n MarkerComponent,\n NavigationControlDirective,\n ScaleControlDirective,\n} from '@maplibre/ngx-maplibre-gl';\nimport { MapView } from '@geodienst/dashkit';\n\n// MapLibre needs WebGL, which the test DOM does not have, so the map, marker and controls are replaced by plain stand-ins.\n@Component({ selector: 'mgl-map', template: '<ng-content />' })\nexport class MapStub {\n readonly mapStyle = input();\n readonly center = input();\n readonly zoom = input();\n readonly locale = input();\n readonly fitBounds = input();\n readonly fitBoundsOptions = input();\n readonly mapLoad = output<unknown>();\n readonly moveStart = output<unknown>();\n}\n\n@Component({ selector: 'mgl-marker', template: '<ng-content />' })\nexport class MarkerStub {\n readonly lngLat = input();\n}\n\n@Component({ selector: 'mgl-control', template: '<ng-content />' })\nexport class ControlStub {\n readonly position = input();\n}\n\n@Directive({ selector: '[mglNavigation]' })\nexport class NavigationStub {\n readonly showCompass = input();\n}\n\n@Directive({ selector: '[mglScale]' })\nexport class ScaleStub {}\n\n@Directive({ selector: '[mglGeolocate]' })\nexport class GeolocateStub {}\n\n// Swaps only MapLibre's components for the stubs; all other imports of MapView stay real,\n// so a new import in MapView doesn't break the tests.\nexport function stubMapLibre() {\n TestBed.overrideComponent(MapView, {\n remove: {\n imports: [MapComponent, MarkerComponent, ControlComponent, NavigationControlDirective, ScaleControlDirective, GeolocateControlDirective],\n },\n add: { imports: [MapStub, MarkerStub, ControlStub, NavigationStub, ScaleStub, GeolocateStub] },\n });\n}\n"],"mappings":";;;;;AAcA,IAAa,UAAb,MAAa,QAAO;CACT,WAAW,MAAO,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,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