@maptiler/geocoding-control 0.0.78 → 0.0.81

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 (48) hide show
  1. package/ClearIcon.svelte.d.ts +23 -0
  2. package/GeocodingControl.svelte +685 -0
  3. package/GeocodingControl.svelte.d.ts +66 -0
  4. package/LoadingIcon.svelte.d.ts +23 -0
  5. package/{src/lib/MarkerIcon.svelte → MarkerIcon.svelte} +1 -2
  6. package/MarkerIcon.svelte.d.ts +16 -0
  7. package/ReverseGeocodingIcon.svelte.d.ts +23 -0
  8. package/SearchIcon.svelte.d.ts +23 -0
  9. package/leaflet-controller.js +1 -0
  10. package/leaflet-controller.js.map +1 -0
  11. package/leaflet-controller.umd.js +1 -0
  12. package/leaflet-controller.umd.js.map +1 -0
  13. package/leaflet.js +3998 -4021
  14. package/leaflet.js.map +1 -0
  15. package/leaflet.umd.js +6 -5
  16. package/leaflet.umd.js.map +1 -0
  17. package/maplibregl-controller.js +1 -0
  18. package/maplibregl-controller.js.map +1 -0
  19. package/maplibregl-controller.umd.js +1 -0
  20. package/maplibregl-controller.umd.js.map +1 -0
  21. package/maplibregl.js +4089 -4112
  22. package/maplibregl.js.map +1 -0
  23. package/maplibregl.umd.js +6 -5
  24. package/maplibregl.umd.js.map +1 -0
  25. package/package.json +23 -23
  26. package/react.js +571 -649
  27. package/react.js.map +1 -0
  28. package/react.umd.js +2 -1
  29. package/react.umd.js.map +1 -0
  30. package/style.css +1 -1
  31. package/src/AppLeaflet.svelte +0 -55
  32. package/src/AppMaplibregl.svelte +0 -45
  33. package/src/lib/GeocodingControl.svelte +0 -839
  34. package/src/lib/LeafletGeocodingControl.ts +0 -154
  35. package/src/lib/MaplibreglGeocodingControl.ts +0 -160
  36. package/src/lib/ReactGeocodingControl.ts +0 -158
  37. package/src/lib/leafletMapController.ts +0 -305
  38. package/src/lib/maplibreglMapController.ts +0 -366
  39. package/src/lib/mask.ts +0 -70
  40. package/src/lib/types.ts +0 -235
  41. package/src/main-copy.ts +0 -59
  42. package/src/main.ts +0 -65
  43. package/src/vite-env.d.ts +0 -2
  44. /package/{src/lib/ClearIcon.svelte → ClearIcon.svelte} +0 -0
  45. /package/{src/lib/LoadingIcon.svelte → LoadingIcon.svelte} +0 -0
  46. /package/{src/lib/ReverseGeocodingIcon.svelte → ReverseGeocodingIcon.svelte} +0 -0
  47. /package/{src/lib/SearchIcon.svelte → SearchIcon.svelte} +0 -0
  48. /package/{maplibre.d.ts → maplibregl.d.ts} +0 -0
@@ -1,839 +0,0 @@
1
- <script lang="ts">
2
- import { createEventDispatcher } from "svelte";
3
- import { onDestroy } from "svelte/internal";
4
- import ReverseGeocodingIcon from "./ReverseGeocodingIcon.svelte";
5
- import ClearIcon from "./ClearIcon.svelte";
6
- import LoadingIcon from "./LoadingIcon.svelte";
7
- import MarkerIcon from "./MarkerIcon.svelte";
8
- import SearchIcon from "./SearchIcon.svelte";
9
- import type {
10
- Feature,
11
- FeatureCollection,
12
- MapController,
13
- Proximity,
14
- } from "./types";
15
-
16
- let className: string | undefined = undefined;
17
-
18
- export { className as class };
19
-
20
- export let apiKey: string;
21
-
22
- export let bbox: [number, number, number, number] | undefined = undefined;
23
-
24
- export let clearButtonTitle = "clear";
25
-
26
- export let clearOnBlur = false;
27
-
28
- export let collapsed = false;
29
-
30
- export let country: string | string[] | undefined = undefined;
31
-
32
- export let debounceSearch = 200;
33
-
34
- export let enableReverse: boolean | "always" = false;
35
-
36
- export let errorMessage = "Searching failed";
37
-
38
- export let filter: (feature: Feature) => boolean = () => true;
39
-
40
- export let flyTo = true;
41
-
42
- export let fuzzyMatch = true;
43
-
44
- export let language: string | string[] | undefined = undefined;
45
-
46
- export let limit: number | undefined = undefined;
47
-
48
- export let mapController: MapController | undefined = undefined;
49
-
50
- export let minLength = 2;
51
-
52
- export let noResultsMessage = "No results found";
53
-
54
- export let placeholder = "Search";
55
-
56
- export let proximity: Proximity = undefined;
57
-
58
- export let reverseActive = enableReverse === "always";
59
-
60
- export let reverseButtonTitle = "toggle reverse geocoding";
61
-
62
- export let searchValue = "";
63
-
64
- export let showFullGeometry = true;
65
-
66
- export let showPlaceType = false;
67
-
68
- export let showResultsWhileTyping = true;
69
-
70
- export let trackProximity = true;
71
-
72
- export let types: string[] | undefined = undefined;
73
-
74
- export let zoom = 16;
75
-
76
- export let fetchParameters: RequestInit = {};
77
-
78
- export function focus() {
79
- input.focus();
80
- }
81
-
82
- export function blur() {
83
- input.blur();
84
- }
85
-
86
- export function setQuery(value: string, submit = true) {
87
- searchValue = value;
88
-
89
- if (submit) {
90
- selectedItemIndex = -1;
91
-
92
- handleOnSubmit();
93
- } else {
94
- handleInput();
95
-
96
- setTimeout(() => {
97
- input.focus();
98
- input.select();
99
- });
100
- }
101
- }
102
-
103
- let focused = false;
104
-
105
- let listFeatures: Feature[] | undefined;
106
-
107
- let markedFeatures: Feature[] | undefined;
108
-
109
- let picked: Feature | undefined;
110
-
111
- let lastSearchUrl = "";
112
-
113
- let input: HTMLInputElement;
114
-
115
- let selectedItemIndex = -1;
116
-
117
- let error: unknown;
118
-
119
- let cachedFeatures: Feature[] = [];
120
-
121
- let abortController: AbortController | undefined;
122
-
123
- let searchTimeoutRef: number | undefined;
124
-
125
- let focusedDelayed: boolean;
126
-
127
- const dispatch = createEventDispatcher<{
128
- select: Feature;
129
- pick: Feature;
130
- optionsVisibilityChange: boolean;
131
- featuresListed: Feature[];
132
- featuresMarked: Feature[];
133
- response: { url: string; featureCollection: FeatureCollection };
134
- reverseToggle: boolean;
135
- queryChange: string;
136
- }>();
137
-
138
- $: if (!trackProximity) {
139
- proximity = undefined;
140
- }
141
-
142
- $: if (
143
- showFullGeometry &&
144
- picked &&
145
- !picked.address &&
146
- picked.geometry.type === "Point"
147
- ) {
148
- search(picked.id, { byId: true }).catch((err) => (error = err));
149
- }
150
-
151
- $: if (mapController && picked && flyTo) {
152
- if (
153
- !picked.bbox ||
154
- (picked.bbox[0] === picked.bbox[2] && picked.bbox[1] === picked.bbox[3])
155
- ) {
156
- mapController.flyTo(picked.center, zoom);
157
- } else {
158
- mapController.fitBounds(picked.bbox, 50);
159
- }
160
-
161
- listFeatures = undefined;
162
- markedFeatures = undefined;
163
- selectedItemIndex = -1;
164
- }
165
-
166
- $: if (markedFeatures !== listFeatures) {
167
- markedFeatures = undefined;
168
- }
169
-
170
- $: if (mapController) {
171
- mapController.setMarkers(markedFeatures, picked);
172
- }
173
-
174
- $: if (!searchValue) {
175
- picked = undefined;
176
- listFeatures = undefined;
177
- error = undefined;
178
- markedFeatures = listFeatures;
179
- }
180
-
181
- // highlight selected marker
182
- $: mapController?.setSelectedMarker(selectedItemIndex);
183
-
184
- // close dropdown in the next cycle so that the selected item event has the chance to fire
185
- $: setTimeout(() => {
186
- focusedDelayed = focused;
187
-
188
- if (clearOnBlur && !focused) {
189
- searchValue = "";
190
- }
191
- });
192
-
193
- // clear selection on edit
194
- $: {
195
- searchValue;
196
-
197
- selectedItemIndex = -1;
198
- }
199
-
200
- $: selected = listFeatures?.[selectedItemIndex];
201
-
202
- $: {
203
- const m = /^(-?\d+(?:\.\d*)?),(-?\d+(?:\.\d*)?)$/.exec(searchValue);
204
-
205
- mapController?.setReverseMarker(
206
- m ? [Number(m[1]), Number(m[2])] : undefined
207
- );
208
- }
209
-
210
- $: dispatch("select", selected);
211
-
212
- $: dispatch("pick", picked);
213
-
214
- $: dispatch("optionsVisibilityChange", focusedDelayed && !!listFeatures);
215
-
216
- $: dispatch("featuresListed", listFeatures);
217
-
218
- $: dispatch("featuresMarked", markedFeatures);
219
-
220
- $: dispatch("reverseToggle", reverseActive);
221
-
222
- $: dispatch("queryChange", searchValue);
223
-
224
- $: if (mapController) {
225
- mapController.indicateReverse(reverseActive);
226
- }
227
-
228
- $: if (mapController) {
229
- mapController.setEventHandler((e) => {
230
- switch (e.type) {
231
- case "mapClick":
232
- if (reverseActive) {
233
- handleReverse(e.coordinates);
234
- }
235
-
236
- break;
237
- case "proximityChange":
238
- proximity = trackProximity ? e.proximity : undefined;
239
-
240
- break;
241
- case "markerClick":
242
- {
243
- const feature = listFeatures?.find(
244
- (feature) => feature.id === e.id
245
- );
246
-
247
- if (feature) {
248
- pick(feature);
249
- }
250
- }
251
-
252
- break;
253
- case "markerMouseEnter":
254
- selectedItemIndex = !focusedDelayed
255
- ? -1
256
- : listFeatures?.findIndex((feature) => feature.id === e.id) ?? -1;
257
-
258
- break;
259
- case "markerMouseLeave":
260
- selectedItemIndex = -1;
261
-
262
- break;
263
- }
264
- });
265
- }
266
-
267
- onDestroy(() => {
268
- if (mapController) {
269
- mapController.setEventHandler(undefined);
270
- mapController.indicateReverse(false);
271
- mapController.setSelectedMarker(-1);
272
- mapController.setMarkers(undefined, undefined);
273
- }
274
- });
275
-
276
- function handleOnSubmit(event?: unknown) {
277
- if (searchTimeoutRef) {
278
- clearTimeout(searchTimeoutRef);
279
-
280
- searchTimeoutRef = undefined;
281
- }
282
-
283
- if (selectedItemIndex > -1 && listFeatures) {
284
- picked = listFeatures[selectedItemIndex];
285
- searchValue = picked.place_name.replace(/,.*/, "");
286
- error = undefined;
287
- markedFeatures = undefined;
288
- selectedItemIndex = -1;
289
- } else if (searchValue) {
290
- const zoomTo = event || !isQuerReverse();
291
-
292
- search(searchValue, { exact: true })
293
- .then(() => {
294
- markedFeatures = listFeatures;
295
-
296
- picked = undefined;
297
-
298
- if (zoomTo) {
299
- zoomToResults();
300
- }
301
- })
302
- .catch((err) => (error = err));
303
- }
304
- }
305
-
306
- function isQuerReverse() {
307
- return /^-?\d+(\.\d+)?,-?\d+(\.\d+)?$/.test(searchValue);
308
- }
309
-
310
- async function search(
311
- searchValue: string,
312
- {
313
- byId = false,
314
- exact = false,
315
- }: undefined | { byId?: boolean; exact?: boolean } = {}
316
- ) {
317
- error = undefined;
318
-
319
- const isReverse = isQuerReverse();
320
-
321
- const sp = new URLSearchParams();
322
-
323
- if (language != undefined) {
324
- sp.set(
325
- "language",
326
- Array.isArray(language) ? language.join(",") : language
327
- );
328
- }
329
-
330
- if (types) {
331
- sp.set("types", types.join(","));
332
- }
333
-
334
- if (!isReverse) {
335
- if (bbox) {
336
- sp.set("bbox", bbox.map((c) => c.toFixed(6)).join(","));
337
- }
338
-
339
- if (country) {
340
- sp.set("country", Array.isArray(country) ? country.join(",") : country);
341
- }
342
- }
343
-
344
- if (!byId) {
345
- if (proximity) {
346
- sp.set("proximity", proximity.map((c) => c.toFixed(6)).join(","));
347
- }
348
-
349
- if (exact || !showResultsWhileTyping) {
350
- sp.set("autocomplete", "false");
351
- }
352
-
353
- sp.set("fuzzyMatch", String(fuzzyMatch));
354
- }
355
-
356
- if (limit !== undefined) {
357
- sp.set("limit", String(limit));
358
- }
359
-
360
- sp.set("key", apiKey);
361
-
362
- const url =
363
- import.meta.env.VITE_API_URL +
364
- "/" +
365
- encodeURIComponent(searchValue) +
366
- ".json?" +
367
- sp.toString();
368
-
369
- if (url === lastSearchUrl) {
370
- if (byId) {
371
- listFeatures = undefined;
372
-
373
- picked = cachedFeatures[0];
374
- } else {
375
- listFeatures = cachedFeatures;
376
- }
377
-
378
- return;
379
- }
380
-
381
- lastSearchUrl = url;
382
-
383
- abortController?.abort();
384
-
385
- const ac = new AbortController();
386
-
387
- abortController = ac;
388
-
389
- let res: Response;
390
-
391
- try {
392
- res = await fetch(url, {
393
- signal: ac.signal,
394
- ...fetchParameters,
395
- }).finally(() => {
396
- if (ac === abortController) {
397
- abortController = undefined;
398
- }
399
- });
400
- } catch (e) {
401
- if (e && typeof e === "object" && (e as any).name === "AbortError") {
402
- return;
403
- }
404
-
405
- throw new Error();
406
- }
407
-
408
- if (!res.ok) {
409
- throw new Error();
410
- }
411
-
412
- const featureCollection: FeatureCollection = await res.json();
413
-
414
- dispatch("response", { url, featureCollection });
415
-
416
- if (byId) {
417
- listFeatures = undefined;
418
-
419
- picked = featureCollection.features[0];
420
-
421
- cachedFeatures = [picked];
422
- } else {
423
- listFeatures = featureCollection.features.filter(filter);
424
-
425
- cachedFeatures = listFeatures;
426
-
427
- if (isReverse) {
428
- input.focus();
429
- }
430
- }
431
- }
432
-
433
- function zoomToResults() {
434
- if (!markedFeatures?.length || !flyTo) {
435
- return;
436
- }
437
-
438
- const bbox: [number, number, number, number] = [180, 90, -180, -90];
439
-
440
- const fuzzyOnly = !markedFeatures.some((feature) => !feature.matching_text);
441
-
442
- for (const feature of markedFeatures) {
443
- if (fuzzyOnly || !feature.matching_text) {
444
- bbox[0] = Math.min(bbox[0], feature.bbox?.[0] ?? feature.center[0]);
445
- bbox[1] = Math.min(bbox[1], feature.bbox?.[1] ?? feature.center[1]);
446
- bbox[2] = Math.max(bbox[2], feature.bbox?.[2] ?? feature.center[0]);
447
- bbox[3] = Math.max(bbox[3], feature.bbox?.[3] ?? feature.center[1]);
448
- }
449
- }
450
-
451
- if (mapController && markedFeatures.length > 0) {
452
- if (picked && bbox[0] === bbox[2] && bbox[1] === bbox[3]) {
453
- mapController.flyTo(picked.center, zoom);
454
- } else {
455
- mapController.fitBounds(bbox, 50);
456
- }
457
- }
458
- }
459
-
460
- // taken from Leaflet
461
- function wrapNum(x: number, range: [number, number], includeMax: boolean) {
462
- const max = range[1],
463
- min = range[0],
464
- d = max - min;
465
-
466
- return x === max && includeMax ? x : ((((x - min) % d) + d) % d) + min;
467
- }
468
-
469
- function handleReverse(coordinates: [lng: number, lat: number]) {
470
- reverseActive = enableReverse === "always";
471
-
472
- setQuery(
473
- wrapNum(coordinates[0], [-180, 180], true).toFixed(6) +
474
- "," +
475
- coordinates[1].toFixed(6)
476
- );
477
- }
478
-
479
- function handleKeyDown(e: KeyboardEvent) {
480
- if (!listFeatures) {
481
- return;
482
- }
483
-
484
- let dir = e.key === "ArrowDown" ? 1 : e.key === "ArrowUp" ? -1 : 0;
485
-
486
- if (dir) {
487
- if (selectedItemIndex === -1 && dir === -1) {
488
- selectedItemIndex = listFeatures.length;
489
- }
490
-
491
- selectedItemIndex += dir;
492
-
493
- if (selectedItemIndex >= listFeatures.length) {
494
- selectedItemIndex = -1;
495
- }
496
-
497
- e.preventDefault();
498
- } else if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) {
499
- selectedItemIndex = -1;
500
- }
501
- }
502
-
503
- function handleInput(debounce = true) {
504
- if (showResultsWhileTyping && searchValue.length > minLength) {
505
- if (searchTimeoutRef) {
506
- clearTimeout(searchTimeoutRef);
507
- }
508
-
509
- const sv = searchValue;
510
-
511
- searchTimeoutRef = window.setTimeout(
512
- () => {
513
- search(sv).catch((err) => (error = err));
514
- },
515
- debounce ? debounceSearch : 0
516
- );
517
- } else {
518
- listFeatures = undefined;
519
- error = undefined;
520
- }
521
- }
522
-
523
- function pick(feature: Feature) {
524
- picked = feature;
525
- searchValue = feature.place_name;
526
- selectedItemIndex = -1;
527
- }
528
- </script>
529
-
530
- <!-- svelte-ignore a11y-no-noninteractive-tabindex -->
531
- <form
532
- tabindex="0"
533
- on:submit|preventDefault={handleOnSubmit}
534
- class:can-collapse={collapsed && searchValue === ""}
535
- class={className}
536
- >
537
- <div class="input-group">
538
- <button type="button" on:click={() => input.focus()}>
539
- <SearchIcon />
540
- </button>
541
-
542
- <input
543
- bind:this={input}
544
- bind:value={searchValue}
545
- on:focus={() => (focused = true)}
546
- on:blur={() => (focused = false)}
547
- on:keydown={handleKeyDown}
548
- on:input={() => handleInput()}
549
- {placeholder}
550
- aria-label={placeholder}
551
- />
552
-
553
- <div class="clear-button-container">
554
- <button
555
- type="button"
556
- on:click={() => {
557
- searchValue = "";
558
- input.focus();
559
- }}
560
- class:displayable={searchValue !== ""}
561
- title={clearButtonTitle}
562
- >
563
- <ClearIcon />
564
- </button>
565
-
566
- {#if abortController}
567
- <LoadingIcon />
568
- {/if}
569
- </div>
570
-
571
- {#if enableReverse === true}
572
- <button
573
- type="button"
574
- class:active={reverseActive}
575
- title={reverseButtonTitle}
576
- on:click={() => (reverseActive = !reverseActive)}
577
- >
578
- <ReverseGeocodingIcon />
579
- </button>
580
- {/if}
581
-
582
- <slot />
583
- </div>
584
-
585
- {#if error}
586
- <div class="error">{errorMessage}</div>
587
- {:else if !focusedDelayed}
588
- {""}
589
- {:else if listFeatures?.length === 0}
590
- <div class="no-results">{noResultsMessage}</div>
591
- {:else if focusedDelayed && listFeatures?.length}
592
- <ul
593
- on:mouseleave={() => (selectedItemIndex = -1)}
594
- on:blur={() => undefined}
595
- >
596
- {#each listFeatures as feature, i}
597
- <!-- svelte-ignore a11y-no-noninteractive-tabindex -->
598
- <li
599
- tabindex="0"
600
- data-selected={selectedItemIndex === i}
601
- class:selected={selectedItemIndex === i}
602
- on:mouseenter={() => (selectedItemIndex = i)}
603
- on:focus={() => pick(feature)}
604
- >
605
- <MarkerIcon displayIn="list" />
606
- <span>
607
- <span>
608
- <span>{feature.place_name.replace(/,.*/, "")}</span>
609
- {#if showPlaceType}
610
- <span
611
- >{feature.properties?.place_type_name?.[0] ??
612
- feature.place_type[0]}</span
613
- >
614
- {/if}
615
- </span>
616
- </span>
617
- <span>
618
- <span>{feature.place_name.replace(/[^,]*,?\s*/, "")}</span>
619
- </span>
620
- </li>
621
- {/each}
622
- </ul>
623
- {/if}
624
- </form>
625
-
626
- <style>
627
- form,
628
- form *,
629
- form *:after,
630
- form *:before {
631
- box-sizing: border-box;
632
- }
633
-
634
- form {
635
- font-family: "Ubuntu", "Open Sans", "Helvetica Neue", Arial, Helvetica,
636
- sans-serif;
637
- position: relative;
638
- background-color: #fff;
639
- width: 100%;
640
- z-index: 10;
641
- border-radius: 4px;
642
- transition: max-width 0.25s;
643
- box-shadow: 0px 2px 8px rgba(51, 51, 89, 0.15);
644
- --color-text: #333359;
645
- --color-icon-button: #333359;
646
- }
647
-
648
- form.can-collapse {
649
- max-width: 35px;
650
- }
651
-
652
- form,
653
- form:focus-within,
654
- form:hover {
655
- max-width: 240px;
656
- }
657
-
658
- input {
659
- font: inherit;
660
- font-size: 14px;
661
- width: 100%;
662
- border: 0;
663
- background-color: transparent;
664
- margin: 0;
665
- height: 36px;
666
- color: rgba(0, 0, 0, 0.75);
667
- white-space: nowrap;
668
- overflow: hidden;
669
- padding: 0;
670
- }
671
-
672
- input:focus {
673
- color: rgba(0, 0, 0, 0.75);
674
- outline: 0;
675
- outline: none;
676
- box-shadow: none;
677
- }
678
-
679
- ul,
680
- div.error,
681
- div.no-results {
682
- background-color: #fff;
683
- border-radius: 4px;
684
- left: 0;
685
- list-style: none;
686
- margin: 0;
687
- padding: 0;
688
- position: absolute;
689
- width: 100%;
690
- top: calc(100% + 6px);
691
- font-size: 14px;
692
- box-shadow: 0px 2px 8px rgba(51, 51, 89, 0.15);
693
- line-height: 16px;
694
- overflow: hidden;
695
- }
696
-
697
- :global(.maplibregl-ctrl-bottom-left) ul,
698
- :global(.maplibregl-ctrl-bottom-right) ul {
699
- top: auto;
700
- bottom: 100%;
701
- }
702
-
703
- li {
704
- text-align: left;
705
- cursor: default;
706
- display: grid;
707
- grid-template-columns: auto 1fr;
708
- color: var(--color-text);
709
- padding: 4px 0px;
710
- }
711
-
712
- li:first-child {
713
- padding-top: 8px;
714
- }
715
-
716
- li:last-child {
717
- padding-bottom: 8px;
718
- }
719
-
720
- li > span {
721
- /* text-overflow: ellipsis; */
722
- overflow: hidden;
723
- padding-right: 8px;
724
- }
725
-
726
- li > span > span {
727
- white-space: nowrap;
728
- display: block;
729
- min-width: fit-content;
730
- }
731
-
732
- li.selected > span > span {
733
- animation: backAndForth 5s linear infinite;
734
- }
735
-
736
- li > span:nth-of-type(1) > span > span:nth-of-type(1) {
737
- font-weight: bold;
738
- }
739
-
740
- li > span:nth-of-type(1) > span > span:nth-of-type(2) {
741
- color: #aeb6c7;
742
- font-size: 12px;
743
- padding-left: 4px;
744
- }
745
-
746
- li.selected {
747
- background-color: #f3f3f3;
748
- }
749
-
750
- button:hover {
751
- background-color: transparent;
752
- }
753
-
754
- button:hover :global(svg),
755
- button.active :global(svg) {
756
- fill: #6b7c92;
757
- }
758
-
759
- button {
760
- padding: 0;
761
- margin: 0;
762
- border: 0;
763
- background-color: transparent;
764
- }
765
-
766
- .input-group {
767
- display: flex;
768
- align-items: stretch;
769
- gap: 7px;
770
- padding-inline: 8px;
771
- outline: #c1cfe4 solid 2px;
772
- border-radius: 4px;
773
- overflow: hidden;
774
- }
775
-
776
- .input-group:hover .displayable {
777
- visibility: visible;
778
- }
779
-
780
- .input-group:focus-within {
781
- outline: #3170fe solid 2px;
782
- }
783
-
784
- div.error,
785
- div.no-results {
786
- font: inherit;
787
- font-size: 14px;
788
- padding: 6px 10px;
789
- }
790
-
791
- div.error {
792
- color: #e25041;
793
- }
794
-
795
- div.no-results {
796
- color: var(--color-text);
797
- }
798
-
799
- .clear-button-container {
800
- position: relative;
801
- display: flex;
802
- align-items: stretch;
803
- }
804
-
805
- .clear-button-container button {
806
- visibility: hidden;
807
- }
808
-
809
- @keyframes backAndForth {
810
- 0% {
811
- transform: translateX(0);
812
- }
813
- 10% {
814
- transform: translateX(0);
815
- }
816
- 45% {
817
- transform: translateX(calc(-100% + 196px));
818
- }
819
- 55% {
820
- transform: translateX(calc(-100% + 196px));
821
- }
822
- 90% {
823
- transform: translateX(0);
824
- }
825
- 100% {
826
- transform: translateX(0);
827
- }
828
- }
829
-
830
- form.can-collapse button:not(:nth-of-type(1)) {
831
- opacity: 0;
832
- transition: opacity 0.25s;
833
- }
834
-
835
- form.can-collapse:focus-within :not(:nth-of-type(1)),
836
- form.can-collapse:hover :not(:nth-of-type(1)) {
837
- opacity: 1;
838
- }
839
- </style>