@panneau/fields 5.0.0-alpha.1 → 5.0.0-alpha.11
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/README.md +101 -20
- package/dist/boolean/BooleanField.d.ts +1 -1
- package/dist/boolean/BooleanField.js +78 -17
- package/dist/boolean/BooleanField.js.map +1 -1
- package/dist/boolean/index.d.ts +1 -1
- package/dist/color/ColorField.css +5 -5
- package/dist/color/ColorField.d.ts +2 -2
- package/dist/color/ColorField.js.map +1 -1
- package/dist/color/ColorField.module.js +3 -3
- package/dist/color/index.d.ts +1 -1
- package/dist/date/DateField.d.ts +1 -1
- package/dist/date/DateField.js.map +1 -1
- package/dist/date/index.d.ts +1 -1
- package/dist/datetime/DateTimeField.d.ts +1 -1
- package/dist/datetime/DateTimeField.js +107 -20
- package/dist/datetime/DateTimeField.js.map +1 -1
- package/dist/datetime/index.d.ts +1 -1
- package/dist/duration/DurationField.css +11 -0
- package/dist/duration/DurationField.d.ts +26 -0
- package/dist/duration/DurationField.d.ts.map +1 -0
- package/dist/duration/DurationField.js +214 -0
- package/dist/duration/DurationField.js.map +1 -0
- package/dist/duration/DurationField.module.js +12 -0
- package/dist/duration/DurationField.module.js.map +1 -0
- package/dist/duration/index.d.ts +2 -0
- package/dist/duration/index.d.ts.map +1 -0
- package/dist/duration/index.js +1 -0
- package/dist/email/EmailField.d.ts +2 -2
- package/dist/email/EmailField.js.map +1 -1
- package/dist/email/index.d.ts +1 -1
- package/dist/embed/EmbedField.css +60 -0
- package/dist/embed/EmbedField.d.ts +20 -0
- package/dist/embed/EmbedField.d.ts.map +1 -0
- package/dist/embed/EmbedField.js +246 -0
- package/dist/embed/EmbedField.js.map +1 -0
- package/dist/embed/EmbedField.module.js +22 -0
- package/dist/embed/EmbedField.module.js.map +1 -0
- package/dist/embed/index.d.ts +3 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/index.js +3 -0
- package/dist/file/FileField.css +54 -0
- package/dist/file/FileField.d.ts +50 -0
- package/dist/file/FileField.d.ts.map +1 -0
- package/dist/file/FileField.js +288 -0
- package/dist/file/FileField.js.map +1 -0
- package/dist/file/FileField.module.js +22 -0
- package/dist/file/FileField.module.js.map +1 -0
- package/dist/file/index.d.ts +3 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +1 -0
- package/dist/group/GroupField.css +2 -2
- package/dist/group/GroupField.d.ts +1 -1
- package/dist/group/GroupField.js.map +1 -1
- package/dist/group/GroupField.module.js +1 -1
- package/dist/group/index.d.ts +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/json/JsonField.css +7 -0
- package/dist/json/JsonField.d.ts +22 -0
- package/dist/json/JsonField.d.ts.map +1 -0
- package/dist/json/JsonField.js +207 -0
- package/dist/json/JsonField.js.map +1 -0
- package/dist/json/JsonField.module.js +8 -0
- package/dist/json/JsonField.module.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +1 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/localized/LocalizedField.css +2 -2
- package/dist/localized/LocalizedField.d.ts +1 -1
- package/dist/localized/LocalizedField.d.ts.map +1 -1
- package/dist/localized/LocalizedField.js +1 -0
- package/dist/localized/LocalizedField.js.map +1 -1
- package/dist/localized/LocalizedField.module.js +2 -2
- package/dist/localized/index.d.ts +1 -1
- package/dist/location/LocationField.css +54 -0
- package/dist/location/LocationField.d.ts +31 -0
- package/dist/location/LocationField.d.ts.map +1 -0
- package/dist/location/LocationField.js +563 -0
- package/dist/location/LocationField.js.map +1 -0
- package/dist/location/LocationField.module.js +22 -0
- package/dist/location/LocationField.module.js.map +1 -0
- package/dist/location/LocationMap.d.ts +25 -0
- package/dist/location/LocationMap.d.ts.map +1 -0
- package/dist/location/LocationMap.js +205 -0
- package/dist/location/LocationMap.js.map +1 -0
- package/dist/location/index.d.ts +5 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +4 -0
- package/dist/location/leafletCss.d.ts +2 -0
- package/dist/location/leafletCss.d.ts.map +1 -0
- package/dist/location/leafletCss.js +6 -0
- package/dist/location/leafletCss.js.map +1 -0
- package/dist/location/nominatim.d.ts +17 -0
- package/dist/location/nominatim.d.ts.map +1 -0
- package/dist/location/nominatim.js +50 -0
- package/dist/location/nominatim.js.map +1 -0
- package/dist/location/types.d.ts +40 -0
- package/dist/location/types.d.ts.map +1 -0
- package/dist/missing/MissingField.css +4 -3
- package/dist/missing/MissingField.d.ts +4 -3
- package/dist/missing/MissingField.d.ts.map +1 -1
- package/dist/missing/MissingField.js +3 -2
- package/dist/missing/MissingField.js.map +1 -1
- package/dist/missing/MissingField.module.js +3 -3
- package/dist/missing/MissingField.module.js.map +1 -1
- package/dist/number/NumberField.d.ts +1 -1
- package/dist/number/NumberField.js.map +1 -1
- package/dist/number/index.d.ts +1 -1
- package/dist/range/RangeField.d.ts +22 -0
- package/dist/range/RangeField.d.ts.map +1 -0
- package/dist/range/RangeField.js +203 -0
- package/dist/range/RangeField.js.map +1 -0
- package/dist/range/index.d.ts +2 -0
- package/dist/range/index.d.ts.map +1 -0
- package/dist/range/index.js +1 -0
- package/dist/relation/RelationField.css +7 -7
- package/dist/relation/RelationField.d.ts +2 -2
- package/dist/relation/RelationField.d.ts.map +1 -1
- package/dist/relation/RelationField.js +509 -169
- package/dist/relation/RelationField.js.map +1 -1
- package/dist/relation/RelationField.module.js +6 -6
- package/dist/relation/index.d.ts +2 -2
- package/dist/repeater/RepeaterField.css +12 -11
- package/dist/repeater/RepeaterField.d.ts +1 -1
- package/dist/repeater/RepeaterField.js +118 -34
- package/dist/repeater/RepeaterField.js.map +1 -1
- package/dist/repeater/RepeaterField.module.js +9 -9
- package/dist/repeater/RepeaterField.module.js.map +1 -1
- package/dist/repeater/index.d.ts +1 -1
- package/dist/select/SelectField.css +1 -1
- package/dist/select/SelectField.d.ts +1 -1
- package/dist/select/SelectField.js.map +1 -1
- package/dist/select/SelectField.module.js +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/shared/DefinitionField.d.ts +4 -2
- package/dist/shared/DefinitionField.d.ts.map +1 -1
- package/dist/shared/DefinitionField.js +80 -72
- package/dist/shared/DefinitionField.js.map +1 -1
- package/dist/shared/builtIn.d.ts +5 -3
- package/dist/shared/builtIn.d.ts.map +1 -1
- package/dist/shared/builtIn.js +21 -3
- package/dist/shared/builtIn.js.map +1 -1
- package/dist/shared/check.d.ts +27 -0
- package/dist/shared/check.d.ts.map +1 -0
- package/dist/shared/check.js +18 -0
- package/dist/shared/check.js.map +1 -0
- package/dist/shared/context.d.ts +28 -5
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/context.js +35 -19
- package/dist/shared/context.js.map +1 -1
- package/dist/shared/cx.js.map +1 -1
- package/dist/shared/dates.js.map +1 -1
- package/dist/shared/embed.d.ts +19 -0
- package/dist/shared/embed.d.ts.map +1 -0
- package/dist/shared/embed.js +14 -0
- package/dist/shared/embed.js.map +1 -0
- package/dist/shared/entry.d.ts +11 -2
- package/dist/shared/entry.d.ts.map +1 -1
- package/dist/shared/entry.js +19 -3
- package/dist/shared/entry.js.map +1 -1
- package/dist/shared/relation.js.map +1 -1
- package/dist/shared/types.d.ts +2 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/slug/SlugField.css +18 -0
- package/dist/slug/SlugField.d.ts +33 -5
- package/dist/slug/SlugField.d.ts.map +1 -1
- package/dist/slug/SlugField.js +346 -126
- package/dist/slug/SlugField.js.map +1 -1
- package/dist/slug/SlugField.module.js +14 -0
- package/dist/slug/SlugField.module.js.map +1 -0
- package/dist/slug/index.d.ts +1 -1
- package/dist/slug/index.d.ts.map +1 -1
- package/dist/slug/index.js +1 -1
- package/dist/tags/TagsField.d.ts +17 -0
- package/dist/tags/TagsField.d.ts.map +1 -0
- package/dist/tags/TagsField.js +120 -0
- package/dist/tags/TagsField.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +1 -0
- package/dist/tel/TelField.d.ts +11 -0
- package/dist/tel/TelField.d.ts.map +1 -0
- package/dist/tel/TelField.js +87 -0
- package/dist/tel/TelField.js.map +1 -0
- package/dist/tel/index.d.ts +2 -0
- package/dist/tel/index.d.ts.map +1 -0
- package/dist/tel/index.js +1 -0
- package/dist/text/TextField.d.ts +12 -4
- package/dist/text/TextField.d.ts.map +1 -1
- package/dist/text/TextField.js +104 -60
- package/dist/text/TextField.js.map +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/textarea/TextAreaField.d.ts +1 -1
- package/dist/textarea/TextAreaField.js.map +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/time/TimeField.d.ts +1 -1
- package/dist/time/TimeField.js +64 -10
- package/dist/time/TimeField.js.map +1 -1
- package/dist/time/index.d.ts +1 -1
- package/dist/upload/FilePicker.css +24 -0
- package/dist/upload/FilePicker.d.ts +14 -0
- package/dist/upload/FilePicker.d.ts.map +1 -0
- package/dist/upload/FilePicker.js +130 -0
- package/dist/upload/FilePicker.js.map +1 -0
- package/dist/upload/FilePicker.module.js +12 -0
- package/dist/upload/FilePicker.module.js.map +1 -0
- package/dist/upload/UploadList.css +93 -0
- package/dist/upload/UploadList.d.ts +18 -0
- package/dist/upload/UploadList.d.ts.map +1 -0
- package/dist/upload/UploadList.js +144 -0
- package/dist/upload/UploadList.js.map +1 -0
- package/dist/upload/UploadList.module.js +32 -0
- package/dist/upload/UploadList.module.js.map +1 -0
- package/dist/upload/files.d.ts +5 -0
- package/dist/upload/files.d.ts.map +1 -0
- package/dist/upload/files.js +26 -0
- package/dist/upload/files.js.map +1 -0
- package/dist/upload/types.d.ts +58 -0
- package/dist/upload/types.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.d.ts +4 -0
- package/dist/upload/useRejectionMessage.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.js +25 -0
- package/dist/upload/useRejectionMessage.js.map +1 -0
- package/dist/upload/useUploads.d.ts +30 -0
- package/dist/upload/useUploads.d.ts.map +1 -0
- package/dist/upload/useUploads.js +115 -0
- package/dist/upload/useUploads.js.map +1 -0
- package/dist/uppy/index.d.ts +3 -0
- package/dist/uppy/index.d.ts.map +1 -0
- package/dist/uppy/index.js +1 -0
- package/dist/uppy/uploader.d.ts +44 -0
- package/dist/uppy/uploader.d.ts.map +1 -0
- package/dist/uppy/uploader.js +139 -0
- package/dist/uppy/uploader.js.map +1 -0
- package/dist/url/UrlField.css +2 -2
- package/dist/url/UrlField.d.ts +2 -2
- package/dist/url/UrlField.js +69 -14
- package/dist/url/UrlField.js.map +1 -1
- package/dist/url/UrlField.module.js +1 -1
- package/dist/url/index.d.ts +1 -1
- package/package.json +69 -7
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import LocationField_module_default from "./LocationField.module.js";
|
|
2
|
+
import { LEAFLET_CSS } from "./leafletCss.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useEffectEvent, useRef } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/location/LocationMap.tsx
|
|
7
|
+
var STYLE_ID = "panneau-leaflet-css";
|
|
8
|
+
/** Loads Leaflet, outside the component: the React Compiler doesn't handle `import()`. */
|
|
9
|
+
async function loadLeaflet() {
|
|
10
|
+
const module = await import("leaflet");
|
|
11
|
+
return module.default ?? module;
|
|
12
|
+
}
|
|
13
|
+
/** Adds Leaflet's stylesheet to the document of the map, once. */
|
|
14
|
+
function injectStyles(document) {
|
|
15
|
+
if (document.getElementById(STYLE_ID) === null) {
|
|
16
|
+
const style = document.createElement("style");
|
|
17
|
+
style.id = STYLE_ID;
|
|
18
|
+
style.textContent = LEAFLET_CSS;
|
|
19
|
+
document.head.append(style);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A Leaflet map with a marker on the point. Clicking the map or dragging the marker moves the
|
|
24
|
+
* point. Leaflet and its stylesheet load when the map first shows.
|
|
25
|
+
*/
|
|
26
|
+
function LocationMap(t0) {
|
|
27
|
+
const $ = c(34);
|
|
28
|
+
const { point, onChange, tiles, center, zoom, readOnly: t1, label, className } = t0;
|
|
29
|
+
const readOnly = t1 === void 0 ? false : t1;
|
|
30
|
+
const container = useRef(null);
|
|
31
|
+
const map = useRef(null);
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[0] !== onChange || $[1] !== readOnly) {
|
|
34
|
+
t2 = {
|
|
35
|
+
onChange,
|
|
36
|
+
readOnly
|
|
37
|
+
};
|
|
38
|
+
$[0] = onChange;
|
|
39
|
+
$[1] = readOnly;
|
|
40
|
+
$[2] = t2;
|
|
41
|
+
} else t2 = $[2];
|
|
42
|
+
const latest = useRef(t2);
|
|
43
|
+
let t3;
|
|
44
|
+
if ($[3] !== onChange || $[4] !== readOnly) {
|
|
45
|
+
t3 = () => {
|
|
46
|
+
latest.current = {
|
|
47
|
+
onChange,
|
|
48
|
+
readOnly
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
$[3] = onChange;
|
|
52
|
+
$[4] = readOnly;
|
|
53
|
+
$[5] = t3;
|
|
54
|
+
} else t3 = $[5];
|
|
55
|
+
useEffect(t3);
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[6] !== zoom) {
|
|
58
|
+
t4 = function sync(next, pan) {
|
|
59
|
+
const current = map.current;
|
|
60
|
+
if (current === null) return;
|
|
61
|
+
if (next === null) {
|
|
62
|
+
current.marker?.remove();
|
|
63
|
+
current.marker = null;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (current.marker === null) {
|
|
67
|
+
const marker = current.leaflet.marker(next, {
|
|
68
|
+
draggable: !latest.current.readOnly,
|
|
69
|
+
keyboard: false,
|
|
70
|
+
icon: current.leaflet.divIcon({
|
|
71
|
+
className: LocationField_module_default.marker,
|
|
72
|
+
html: `<span class="${LocationField_module_default.pin}"></span>`,
|
|
73
|
+
iconSize: [24, 24],
|
|
74
|
+
iconAnchor: [12, 29]
|
|
75
|
+
})
|
|
76
|
+
}).addTo(current.map);
|
|
77
|
+
marker.on("dragend", () => {
|
|
78
|
+
const position = marker.getLatLng();
|
|
79
|
+
latest.current.onChange?.({
|
|
80
|
+
lat: position.lat,
|
|
81
|
+
lng: position.lng
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
current.marker = marker;
|
|
85
|
+
} else current.marker.setLatLng(next);
|
|
86
|
+
if (pan && !current.map.getBounds().contains(next)) current.map.setView(next, Math.max(current.map.getZoom(), zoom));
|
|
87
|
+
};
|
|
88
|
+
$[6] = zoom;
|
|
89
|
+
$[7] = t4;
|
|
90
|
+
} else t4 = $[7];
|
|
91
|
+
const sync = t4;
|
|
92
|
+
let t5;
|
|
93
|
+
if ($[8] !== center || $[9] !== point || $[10] !== sync || $[11] !== tiles.attribution || $[12] !== tiles.maxZoom || $[13] !== zoom) {
|
|
94
|
+
t5 = (leaflet, element, url) => {
|
|
95
|
+
injectStyles(element.ownerDocument);
|
|
96
|
+
const instance = leaflet.map(element, { attributionControl: true });
|
|
97
|
+
leaflet.tileLayer(url, {
|
|
98
|
+
attribution: tiles.attribution,
|
|
99
|
+
maxZoom: tiles.maxZoom ?? 19
|
|
100
|
+
}).addTo(instance);
|
|
101
|
+
instance.on("click", (event) => {
|
|
102
|
+
if (!latest.current.readOnly) latest.current.onChange?.({
|
|
103
|
+
lat: event.latlng.lat,
|
|
104
|
+
lng: event.latlng.lng
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
map.current = {
|
|
108
|
+
leaflet,
|
|
109
|
+
map: instance,
|
|
110
|
+
marker: null
|
|
111
|
+
};
|
|
112
|
+
instance.setView(point ?? center, point !== null ? zoom : 2);
|
|
113
|
+
sync(point, false);
|
|
114
|
+
};
|
|
115
|
+
$[8] = center;
|
|
116
|
+
$[9] = point;
|
|
117
|
+
$[10] = sync;
|
|
118
|
+
$[11] = tiles.attribution;
|
|
119
|
+
$[12] = tiles.maxZoom;
|
|
120
|
+
$[13] = zoom;
|
|
121
|
+
$[14] = t5;
|
|
122
|
+
} else t5 = $[14];
|
|
123
|
+
const create = useEffectEvent(t5);
|
|
124
|
+
const url_0 = tiles.url;
|
|
125
|
+
let t6;
|
|
126
|
+
if ($[15] !== create || $[16] !== url_0) {
|
|
127
|
+
t6 = () => {
|
|
128
|
+
const element_0 = container.current;
|
|
129
|
+
if (element_0 === null) return;
|
|
130
|
+
let cancelled = false;
|
|
131
|
+
loadLeaflet().then((leaflet_0) => {
|
|
132
|
+
if (!cancelled) create(leaflet_0, element_0, url_0);
|
|
133
|
+
});
|
|
134
|
+
return () => {
|
|
135
|
+
cancelled = true;
|
|
136
|
+
map.current?.map.remove();
|
|
137
|
+
map.current = null;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
$[15] = create;
|
|
141
|
+
$[16] = url_0;
|
|
142
|
+
$[17] = t6;
|
|
143
|
+
} else t6 = $[17];
|
|
144
|
+
let t7;
|
|
145
|
+
if ($[18] !== url_0) {
|
|
146
|
+
t7 = [url_0];
|
|
147
|
+
$[18] = url_0;
|
|
148
|
+
$[19] = t7;
|
|
149
|
+
} else t7 = $[19];
|
|
150
|
+
useEffect(t6, t7);
|
|
151
|
+
const lat = point?.lat;
|
|
152
|
+
const lng = point?.lng;
|
|
153
|
+
let t8;
|
|
154
|
+
if ($[20] !== sync) {
|
|
155
|
+
t8 = (next_0) => sync(next_0, true);
|
|
156
|
+
$[20] = sync;
|
|
157
|
+
$[21] = t8;
|
|
158
|
+
} else t8 = $[21];
|
|
159
|
+
const show = useEffectEvent(t8);
|
|
160
|
+
let t9;
|
|
161
|
+
if ($[22] !== lat || $[23] !== lng || $[24] !== show) {
|
|
162
|
+
t9 = () => {
|
|
163
|
+
show(lat !== void 0 && lng !== void 0 ? {
|
|
164
|
+
lat,
|
|
165
|
+
lng
|
|
166
|
+
} : null);
|
|
167
|
+
};
|
|
168
|
+
$[22] = lat;
|
|
169
|
+
$[23] = lng;
|
|
170
|
+
$[24] = show;
|
|
171
|
+
$[25] = t9;
|
|
172
|
+
} else t9 = $[25];
|
|
173
|
+
let t10;
|
|
174
|
+
if ($[26] !== lat || $[27] !== lng) {
|
|
175
|
+
t10 = [lat, lng];
|
|
176
|
+
$[26] = lat;
|
|
177
|
+
$[27] = lng;
|
|
178
|
+
$[28] = t10;
|
|
179
|
+
} else t10 = $[28];
|
|
180
|
+
useEffect(t9, t10);
|
|
181
|
+
let t11;
|
|
182
|
+
if ($[29] !== className) {
|
|
183
|
+
t11 = [LocationField_module_default.map, className].filter(Boolean);
|
|
184
|
+
$[29] = className;
|
|
185
|
+
$[30] = t11;
|
|
186
|
+
} else t11 = $[30];
|
|
187
|
+
const t12 = t11.join(" ");
|
|
188
|
+
let t13;
|
|
189
|
+
if ($[31] !== label || $[32] !== t12) {
|
|
190
|
+
t13 = /* @__PURE__ */ jsx("div", {
|
|
191
|
+
ref: container,
|
|
192
|
+
className: t12,
|
|
193
|
+
role: "application",
|
|
194
|
+
"aria-label": label
|
|
195
|
+
});
|
|
196
|
+
$[31] = label;
|
|
197
|
+
$[32] = t12;
|
|
198
|
+
$[33] = t13;
|
|
199
|
+
} else t13 = $[33];
|
|
200
|
+
return t13;
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
export { LocationMap };
|
|
204
|
+
|
|
205
|
+
//# sourceMappingURL=LocationMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationMap.js","names":["LeafletModule","useEffect","useEffectEvent","useRef","styles","LEAFLET_CSS","MapTiles","Leaflet","LeafletMap","Map","LeafletMarker","Marker","STYLE_ID","loadLeaflet","Promise","module","default","injectStyles","document","Document","getElementById","style","createElement","id","textContent","head","append","Point","lat","lng","LocationMapProps","point","onChange","tiles","center","zoom","readOnly","label","className","LocationMap","t0","$","_c","t1","undefined","container","map","t2","latest","t3","current","t4","sync","next","pan","marker","remove","leaflet","draggable","keyboard","icon","divIcon","html","pin","iconSize","iconAnchor","addTo","on","position","getLatLng","setLatLng","getBounds","contains","setView","Math","max","getZoom","t5","attribution","maxZoom","element","url","ownerDocument","instance","attributionControl","tileLayer","event","latlng","create","url_0","t6","element_0","cancelled","then","leaflet_0","t7","t8","next_0","show","t9","t10","t11","filter","Boolean","t12","join","t13","_c","styles"],"sources":["../../src/location/LocationMap.tsx"],"sourcesContent":["import type * as LeafletModule from 'leaflet';\nimport { useEffect, useEffectEvent, useRef } from 'react';\n\nimport styles from './LocationField.module.css';\nimport { LEAFLET_CSS } from './leafletCss';\nimport type { MapTiles } from './types';\n\ntype Leaflet = typeof LeafletModule;\ntype LeafletMap = LeafletModule.Map;\ntype LeafletMarker = LeafletModule.Marker;\n\nconst STYLE_ID = 'panneau-leaflet-css';\n\n/** Loads Leaflet, outside the component: the React Compiler doesn't handle `import()`. */\nasync function loadLeaflet(): Promise<Leaflet> {\n const module = await import('leaflet');\n return ((module as { default?: Leaflet }).default ?? module) as Leaflet;\n}\n\n/** Adds Leaflet's stylesheet to the document of the map, once. */\nfunction injectStyles(document: Document) {\n if (document.getElementById(STYLE_ID) === null) {\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = LEAFLET_CSS;\n document.head.append(style);\n }\n}\n\nexport interface Point {\n lat: number;\n lng: number;\n}\n\nexport interface LocationMapProps {\n point: Point | null;\n /** Called with the point clicked, or where the marker was dropped. */\n onChange?: (point: Point) => void;\n tiles: MapTiles;\n /** Where the map opens without a point. */\n center: Point;\n /** Zoom of the map on a point; the map opens wider without one. */\n zoom: number;\n readOnly?: boolean;\n /** Accessible name of the map. */\n label: string;\n className?: string;\n}\n\n/**\n * A Leaflet map with a marker on the point. Clicking the map or dragging the marker moves the\n * point. Leaflet and its stylesheet load when the map first shows.\n */\nexport function LocationMap({\n point,\n onChange,\n tiles,\n center,\n zoom,\n readOnly = false,\n label,\n className,\n}: LocationMapProps) {\n const container = useRef<HTMLDivElement>(null);\n const map = useRef<{ leaflet: Leaflet; map: LeafletMap; marker: LeafletMarker | null } | null>(\n null,\n );\n // The latest values, for the handlers of the map\n const latest = useRef({ onChange, readOnly });\n useEffect(() => {\n latest.current = { onChange, readOnly };\n });\n\n /** Puts the marker on the point, and the point in view. */\n function sync(next: Point | null, pan: boolean) {\n const current = map.current;\n if (current === null) {\n return;\n }\n if (next === null) {\n current.marker?.remove();\n current.marker = null;\n return;\n }\n if (current.marker === null) {\n const marker = current.leaflet\n .marker(next, {\n draggable: !latest.current.readOnly,\n keyboard: false,\n icon: current.leaflet.divIcon({\n className: styles.marker,\n // Leaflet places the icon with `transform`: the pin turns inside it\n html: `<span class=\"${styles.pin}\"></span>`,\n iconSize: [24, 24],\n iconAnchor: [12, 29],\n }),\n })\n .addTo(current.map);\n marker.on('dragend', () => {\n const position = marker.getLatLng();\n latest.current.onChange?.({ lat: position.lat, lng: position.lng });\n });\n current.marker = marker;\n } else {\n current.marker.setLatLng(next);\n }\n if (pan && !current.map.getBounds().contains(next)) {\n current.map.setView(next, Math.max(current.map.getZoom(), zoom));\n }\n }\n\n // Creates the map once Leaflet is loaded, with the latest props. It is made again for other\n // tiles only: later points go through the effect below.\n const create = useEffectEvent((leaflet: Leaflet, element: HTMLDivElement, url: string) => {\n injectStyles(element.ownerDocument);\n const instance = leaflet.map(element, { attributionControl: true });\n leaflet\n .tileLayer(url, {\n attribution: tiles.attribution,\n maxZoom: tiles.maxZoom ?? 19,\n })\n .addTo(instance);\n instance.on('click', (event) => {\n if (!latest.current.readOnly) {\n latest.current.onChange?.({ lat: event.latlng.lat, lng: event.latlng.lng });\n }\n });\n map.current = { leaflet, map: instance, marker: null };\n instance.setView(point ?? center, point !== null ? zoom : 2);\n sync(point, false);\n });\n const url = tiles.url;\n useEffect(() => {\n const element = container.current;\n if (element === null) {\n return undefined;\n }\n let cancelled = false;\n void loadLeaflet().then((leaflet) => {\n if (!cancelled) {\n create(leaflet, element, url);\n }\n });\n return () => {\n cancelled = true;\n map.current?.map.remove();\n map.current = null;\n };\n }, [url]);\n\n const lat = point?.lat;\n const lng = point?.lng;\n const show = useEffectEvent((next: Point | null) => sync(next, true));\n useEffect(() => {\n show(lat !== undefined && lng !== undefined ? { lat, lng } : null);\n }, [lat, lng]);\n\n return (\n <div\n ref={container}\n className={[styles.map, className].filter(Boolean).join(' ')}\n role=\"application\"\n aria-label={label}\n />\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { LocationField, LocationFieldEntry, type LocationFieldProps, type LocationValue, OPEN_STREET_MAP_TILES, isLocation, } from './LocationField.js';
|
|
2
|
+
export { LocationMap, type LocationMapProps, type Point } from './LocationMap.js';
|
|
3
|
+
export { createNominatimSource, type NominatimSourceOptions } from './nominatim.js';
|
|
4
|
+
export type { GeocodingResult, GeocodingSource, MapTiles, MapsConfig } from './types.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/location/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,qBAAqB,EACrB,UAAU,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { LocationMap } from "./LocationMap.js";
|
|
2
|
+
import { LocationField, LocationFieldEntry, OPEN_STREET_MAP_TILES, isLocation } from "./LocationField.js";
|
|
3
|
+
import { createNominatimSource } from "./nominatim.js";
|
|
4
|
+
export { LocationField, LocationFieldEntry, LocationMap, OPEN_STREET_MAP_TILES, createNominatimSource, isLocation };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const LEAFLET_CSS = ".leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n\tposition: absolute;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\t}\r\n.leaflet-container {\r\n\toverflow: hidden;\r\n\t}\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\t-webkit-user-select: none;\r\n\t -moz-user-select: none;\r\n\t user-select: none;\r\n\t -webkit-user-drag: none;\r\n\t}\r\n.leaflet-tile::selection {\r\n\tbackground: transparent;\r\n}\r\n.leaflet-safari .leaflet-tile {\r\n\timage-rendering: -webkit-optimize-contrast;\r\n\t}\r\n.leaflet-safari .leaflet-tile-container {\r\n\twidth: 1600px;\r\n\theight: 1600px;\r\n\t-webkit-transform-origin: 0 0;\r\n\t}\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n\tdisplay: block;\r\n\t}\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\t}\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n\tmax-width: none !important;\r\n\tmax-height: none !important;\r\n\twidth: auto;\r\n\tpadding: 0;\r\n\t}\r\n.leaflet-container img.leaflet-tile {\r\n\tmix-blend-mode: plus-lighter;\r\n}\r\n.leaflet-container.leaflet-touch-zoom {\r\n\t-ms-touch-action: pan-x pan-y;\r\n\ttouch-action: pan-x pan-y;\r\n\t}\r\n.leaflet-container.leaflet-touch-drag {\r\n\t-ms-touch-action: pinch-zoom;\r\n\ttouch-action: none;\r\n\ttouch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n\t-ms-touch-action: none;\r\n\ttouch-action: none;\r\n}\r\n.leaflet-container {\r\n\t-webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n\tfilter: inherit;\r\n\tvisibility: hidden;\r\n\t}\r\n.leaflet-tile-loaded {\r\n\tvisibility: inherit;\r\n\t}\r\n.leaflet-zoom-box {\r\n\twidth: 0;\r\n\theight: 0;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tz-index: 800;\r\n\t}\r\n.leaflet-overlay-pane svg {\r\n\t-moz-user-select: none;\r\n\t}\r\n.leaflet-pane { z-index: 400; }\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n.leaflet-vml-shape {\r\n\twidth: 1px;\r\n\theight: 1px;\r\n\t}\r\n.lvml {\r\n\tbehavior: url(#default#VML);\r\n\tdisplay: inline-block;\r\n\tposition: absolute;\r\n\t}\r\n.leaflet-control {\r\n\tposition: relative;\r\n\tz-index: 800;\r\n\tpointer-events: visiblePainted; \r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n\tposition: absolute;\r\n\tz-index: 1000;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-top {\r\n\ttop: 0;\r\n\t}\r\n.leaflet-right {\r\n\tright: 0;\r\n\t}\r\n.leaflet-bottom {\r\n\tbottom: 0;\r\n\t}\r\n.leaflet-left {\r\n\tleft: 0;\r\n\t}\r\n.leaflet-control {\r\n\tfloat: left;\r\n\tclear: both;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tfloat: right;\r\n\t}\r\n.leaflet-top .leaflet-control {\r\n\tmargin-top: 10px;\r\n\t}\r\n.leaflet-bottom .leaflet-control {\r\n\tmargin-bottom: 10px;\r\n\t}\r\n.leaflet-left .leaflet-control {\r\n\tmargin-left: 10px;\r\n\t}\r\n.leaflet-right .leaflet-control {\r\n\tmargin-right: 10px;\r\n\t}\r\n.leaflet-fade-anim .leaflet-popup {\r\n\topacity: 0;\r\n\t-webkit-transition: opacity 0.2s linear;\r\n\t -moz-transition: opacity 0.2s linear;\r\n\t transition: opacity 0.2s linear;\r\n\t}\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n\topacity: 1;\r\n\t}\r\n.leaflet-zoom-animated {\r\n\t-webkit-transform-origin: 0 0;\r\n\t -ms-transform-origin: 0 0;\r\n\t transform-origin: 0 0;\r\n\t}\r\nsvg.leaflet-zoom-animated {\r\n\twill-change: transform;\r\n}\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n\t}\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n\t-webkit-transition: none;\r\n\t -moz-transition: none;\r\n\t transition: none;\r\n\t}\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n\tvisibility: hidden;\r\n\t}\r\n.leaflet-interactive {\r\n\tcursor: pointer;\r\n\t}\r\n.leaflet-grab {\r\n\tcursor: -webkit-grab;\r\n\tcursor: -moz-grab;\r\n\tcursor: grab;\r\n\t}\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n\tcursor: crosshair;\r\n\t}\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n\tcursor: auto;\r\n\t}\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n\tcursor: move;\r\n\tcursor: -webkit-grabbing;\r\n\tcursor: -moz-grabbing;\r\n\tcursor: grabbing;\r\n\t}\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n\tpointer-events: visiblePainted; \r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-container {\r\n\tbackground: #ddd;\r\n\toutline-offset: 1px;\r\n\t}\r\n.leaflet-container a {\r\n\tcolor: #0078A8;\r\n\t}\r\n.leaflet-zoom-box {\r\n\tborder: 2px dotted #38f;\r\n\tbackground: rgba(255,255,255,0.5);\r\n\t}\r\n.leaflet-container {\r\n\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n\tfont-size: 12px;\r\n\tfont-size: 0.75rem;\r\n\tline-height: 1.5;\r\n\t}\r\n.leaflet-bar {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n\tborder-radius: 4px;\r\n\t}\r\n.leaflet-bar a {\r\n\tbackground-color: #fff;\r\n\tborder-bottom: 1px solid #ccc;\r\n\twidth: 26px;\r\n\theight: 26px;\r\n\tline-height: 26px;\r\n\tdisplay: block;\r\n\ttext-align: center;\r\n\ttext-decoration: none;\r\n\tcolor: black;\r\n\t}\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n\tbackground-position: 50% 50%;\r\n\tbackground-repeat: no-repeat;\r\n\tdisplay: block;\r\n\t}\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n\tbackground-color: #f4f4f4;\r\n\t}\r\n.leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 4px;\r\n\tborder-top-right-radius: 4px;\r\n\t}\r\n.leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 4px;\r\n\tborder-bottom-right-radius: 4px;\r\n\tborder-bottom: none;\r\n\t}\r\n.leaflet-bar a.leaflet-disabled {\r\n\tcursor: default;\r\n\tbackground-color: #f4f4f4;\r\n\tcolor: #bbb;\r\n\t}\r\n.leaflet-touch .leaflet-bar a {\r\n\twidth: 30px;\r\n\theight: 30px;\r\n\tline-height: 30px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n\tborder-top-left-radius: 2px;\r\n\tborder-top-right-radius: 2px;\r\n\t}\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n\tborder-bottom-left-radius: 2px;\r\n\tborder-bottom-right-radius: 2px;\r\n\t}\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n\tfont: bold 18px 'Lucida Console', Monaco, monospace;\r\n\ttext-indent: 1px;\r\n\t}\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n\tfont-size: 22px;\r\n\t}\r\n.leaflet-control-layers {\r\n\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n\tbackground: #fff;\r\n\tborder-radius: 5px;\r\n\t}\r\n.leaflet-control-layers-toggle {\r\n\tbackground-image: url(images/layers.png);\r\n\twidth: 36px;\r\n\theight: 36px;\r\n\t}\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n\tbackground-image: url(images/layers-2x.png);\r\n\tbackground-size: 26px 26px;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n\twidth: 44px;\r\n\theight: 44px;\r\n\t}\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n\tdisplay: none;\r\n\t}\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n\tdisplay: block;\r\n\tposition: relative;\r\n\t}\r\n.leaflet-control-layers-expanded {\r\n\tpadding: 6px 10px 6px 6px;\r\n\tcolor: #333;\r\n\tbackground: #fff;\r\n\t}\r\n.leaflet-control-layers-scrollbar {\r\n\toverflow-y: scroll;\r\n\toverflow-x: hidden;\r\n\tpadding-right: 5px;\r\n\t}\r\n.leaflet-control-layers-selector {\r\n\tmargin-top: 2px;\r\n\tposition: relative;\r\n\ttop: 1px;\r\n\t}\r\n.leaflet-control-layers label {\r\n\tdisplay: block;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\t}\r\n.leaflet-control-layers-separator {\r\n\theight: 0;\r\n\tborder-top: 1px solid #ddd;\r\n\tmargin: 5px -10px 5px -6px;\r\n\t}\r\n.leaflet-default-icon-path { \r\n\tbackground-image: url(images/marker-icon.png);\r\n\t}\r\n.leaflet-container .leaflet-control-attribution {\r\n\tbackground: #fff;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\tmargin: 0;\r\n\t}\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n\tpadding: 0 5px;\r\n\tcolor: #333;\r\n\tline-height: 1.4;\r\n\t}\r\n.leaflet-control-attribution a {\r\n\ttext-decoration: none;\r\n\t}\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n\ttext-decoration: underline;\r\n\t}\r\n.leaflet-attribution-flag {\r\n\tdisplay: inline !important;\r\n\tvertical-align: baseline !important;\r\n\twidth: 1em;\r\n\theight: 0.6669em;\r\n\t}\r\n.leaflet-left .leaflet-control-scale {\r\n\tmargin-left: 5px;\r\n\t}\r\n.leaflet-bottom .leaflet-control-scale {\r\n\tmargin-bottom: 5px;\r\n\t}\r\n.leaflet-control-scale-line {\r\n\tborder: 2px solid #777;\r\n\tborder-top: none;\r\n\tline-height: 1.1;\r\n\tpadding: 2px 5px 1px;\r\n\twhite-space: nowrap;\r\n\t-moz-box-sizing: border-box;\r\n\t box-sizing: border-box;\r\n\tbackground: rgba(255, 255, 255, 0.8);\r\n\ttext-shadow: 1px 1px #fff;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child) {\r\n\tborder-top: 2px solid #777;\r\n\tborder-bottom: none;\r\n\tmargin-top: -2px;\r\n\t}\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n\tborder-bottom: 2px solid #777;\r\n\t}\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tbox-shadow: none;\r\n\t}\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n\tborder: 2px solid rgba(0,0,0,0.2);\r\n\tbackground-clip: padding-box;\r\n\t}\r\n.leaflet-popup {\r\n\tposition: absolute;\r\n\ttext-align: center;\r\n\tmargin-bottom: 20px;\r\n\t}\r\n.leaflet-popup-content-wrapper {\r\n\tpadding: 1px;\r\n\ttext-align: left;\r\n\tborder-radius: 12px;\r\n\t}\r\n.leaflet-popup-content {\r\n\tmargin: 13px 24px 13px 20px;\r\n\tline-height: 1.3;\r\n\tfont-size: 13px;\r\n\tfont-size: 1.08333em;\r\n\tmin-height: 1px;\r\n\t}\r\n.leaflet-popup-content p {\r\n\tmargin: 17px 0;\r\n\tmargin: 1.3em 0;\r\n\t}\r\n.leaflet-popup-tip-container {\r\n\twidth: 40px;\r\n\theight: 20px;\r\n\tposition: absolute;\r\n\tleft: 50%;\r\n\tmargin-top: -1px;\r\n\tmargin-left: -20px;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\t}\r\n.leaflet-popup-tip {\r\n\twidth: 17px;\r\n\theight: 17px;\r\n\tpadding: 1px;\r\n\tmargin: -10px auto 0;\r\n\tpointer-events: auto;\r\n\t-webkit-transform: rotate(45deg);\r\n\t -moz-transform: rotate(45deg);\r\n\t -ms-transform: rotate(45deg);\r\n\t transform: rotate(45deg);\r\n\t}\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n\tbackground: white;\r\n\tcolor: #333;\r\n\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tborder: none;\r\n\ttext-align: center;\r\n\twidth: 24px;\r\n\theight: 24px;\r\n\tfont: 16px/24px Tahoma, Verdana, sans-serif;\r\n\tcolor: #757575;\r\n\ttext-decoration: none;\r\n\tbackground: transparent;\r\n\t}\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n\tcolor: #585858;\r\n\t}\r\n.leaflet-popup-scrolled {\r\n\toverflow: auto;\r\n\t}\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n\t-ms-zoom: 1;\r\n\t}\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\twidth: 24px;\r\n\tmargin: 0 auto;\r\n\t-ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\r\n\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n\t}\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n\tborder: 1px solid #999;\r\n\t}\r\n.leaflet-div-icon {\r\n\tbackground: #fff;\r\n\tborder: 1px solid #666;\r\n\t}\r\n.leaflet-tooltip {\r\n\tposition: absolute;\r\n\tpadding: 6px;\r\n\tbackground-color: #fff;\r\n\tborder: 1px solid #fff;\r\n\tborder-radius: 3px;\r\n\tcolor: #222;\r\n\twhite-space: nowrap;\r\n\t-webkit-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none;\r\n\tpointer-events: none;\r\n\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n\t}\r\n.leaflet-tooltip.leaflet-interactive {\r\n\tcursor: pointer;\r\n\tpointer-events: auto;\r\n\t}\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\tposition: absolute;\r\n\tpointer-events: none;\r\n\tborder: 6px solid transparent;\r\n\tbackground: transparent;\r\n\tcontent: \"\";\r\n\t}\r\n.leaflet-tooltip-bottom {\r\n\tmargin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n\tmargin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n\tleft: 50%;\r\n\tmargin-left: -6px;\r\n\t}\r\n.leaflet-tooltip-top:before {\r\n\tbottom: 0;\r\n\tmargin-bottom: -12px;\r\n\tborder-top-color: #fff;\r\n\t}\r\n.leaflet-tooltip-bottom:before {\r\n\ttop: 0;\r\n\tmargin-top: -12px;\r\n\tmargin-left: -6px;\r\n\tborder-bottom-color: #fff;\r\n\t}\r\n.leaflet-tooltip-left {\r\n\tmargin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n\tmargin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n\ttop: 50%;\r\n\tmargin-top: -6px;\r\n\t}\r\n.leaflet-tooltip-left:before {\r\n\tright: 0;\r\n\tmargin-right: -12px;\r\n\tborder-left-color: #fff;\r\n\t}\r\n.leaflet-tooltip-right:before {\r\n\tleft: 0;\r\n\tmargin-left: -12px;\r\n\tborder-right-color: #fff;\r\n\t}\r\n@media print {\r\n\t.leaflet-control {\r\n\t\t-webkit-print-color-adjust: exact;\r\n\t\tprint-color-adjust: exact;\r\n\t\t}\r\n\t}";
|
|
2
|
+
//# sourceMappingURL=leafletCss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leafletCss.d.ts","sourceRoot":"","sources":["../../src/location/leafletCss.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,gqdACqod,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/location/leafletCss.ts
|
|
2
|
+
var LEAFLET_CSS = ".leaflet-pane,\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-tile-container,\r\n.leaflet-pane > svg,\r\n.leaflet-pane > canvas,\r\n.leaflet-zoom-box,\r\n.leaflet-image-layer,\r\n.leaflet-layer {\r\n position: absolute;\r\n left: 0;\r\n top: 0;\r\n }\r\n.leaflet-container {\r\n overflow: hidden;\r\n }\r\n.leaflet-tile,\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n user-select: none;\r\n -webkit-user-drag: none;\r\n }\r\n.leaflet-tile::selection {\r\n background: transparent;\r\n}\r\n.leaflet-safari .leaflet-tile {\r\n image-rendering: -webkit-optimize-contrast;\r\n }\r\n.leaflet-safari .leaflet-tile-container {\r\n width: 1600px;\r\n height: 1600px;\r\n -webkit-transform-origin: 0 0;\r\n }\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow {\r\n display: block;\r\n }\r\n.leaflet-container .leaflet-overlay-pane svg {\r\n max-width: none !important;\r\n max-height: none !important;\r\n }\r\n.leaflet-container .leaflet-marker-pane img,\r\n.leaflet-container .leaflet-shadow-pane img,\r\n.leaflet-container .leaflet-tile-pane img,\r\n.leaflet-container img.leaflet-image-layer,\r\n.leaflet-container .leaflet-tile {\r\n max-width: none !important;\r\n max-height: none !important;\r\n width: auto;\r\n padding: 0;\r\n }\r\n.leaflet-container img.leaflet-tile {\r\n mix-blend-mode: plus-lighter;\r\n}\r\n.leaflet-container.leaflet-touch-zoom {\r\n -ms-touch-action: pan-x pan-y;\r\n touch-action: pan-x pan-y;\r\n }\r\n.leaflet-container.leaflet-touch-drag {\r\n -ms-touch-action: pinch-zoom;\r\n touch-action: none;\r\n touch-action: pinch-zoom;\r\n}\r\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\r\n -ms-touch-action: none;\r\n touch-action: none;\r\n}\r\n.leaflet-container {\r\n -webkit-tap-highlight-color: transparent;\r\n}\r\n.leaflet-container a {\r\n -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\r\n}\r\n.leaflet-tile {\r\n filter: inherit;\r\n visibility: hidden;\r\n }\r\n.leaflet-tile-loaded {\r\n visibility: inherit;\r\n }\r\n.leaflet-zoom-box {\r\n width: 0;\r\n height: 0;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n z-index: 800;\r\n }\r\n.leaflet-overlay-pane svg {\r\n -moz-user-select: none;\r\n }\r\n.leaflet-pane { z-index: 400; }\r\n.leaflet-tile-pane { z-index: 200; }\r\n.leaflet-overlay-pane { z-index: 400; }\r\n.leaflet-shadow-pane { z-index: 500; }\r\n.leaflet-marker-pane { z-index: 600; }\r\n.leaflet-tooltip-pane { z-index: 650; }\r\n.leaflet-popup-pane { z-index: 700; }\r\n.leaflet-map-pane canvas { z-index: 100; }\r\n.leaflet-map-pane svg { z-index: 200; }\r\n.leaflet-vml-shape {\r\n width: 1px;\r\n height: 1px;\r\n }\r\n.lvml {\r\n behavior: url(#default#VML);\r\n display: inline-block;\r\n position: absolute;\r\n }\r\n.leaflet-control {\r\n position: relative;\r\n z-index: 800;\r\n pointer-events: visiblePainted; \r\n pointer-events: auto;\r\n }\r\n.leaflet-top,\r\n.leaflet-bottom {\r\n position: absolute;\r\n z-index: 1000;\r\n pointer-events: none;\r\n }\r\n.leaflet-top {\r\n top: 0;\r\n }\r\n.leaflet-right {\r\n right: 0;\r\n }\r\n.leaflet-bottom {\r\n bottom: 0;\r\n }\r\n.leaflet-left {\r\n left: 0;\r\n }\r\n.leaflet-control {\r\n float: left;\r\n clear: both;\r\n }\r\n.leaflet-right .leaflet-control {\r\n float: right;\r\n }\r\n.leaflet-top .leaflet-control {\r\n margin-top: 10px;\r\n }\r\n.leaflet-bottom .leaflet-control {\r\n margin-bottom: 10px;\r\n }\r\n.leaflet-left .leaflet-control {\r\n margin-left: 10px;\r\n }\r\n.leaflet-right .leaflet-control {\r\n margin-right: 10px;\r\n }\r\n.leaflet-fade-anim .leaflet-popup {\r\n opacity: 0;\r\n -webkit-transition: opacity 0.2s linear;\r\n -moz-transition: opacity 0.2s linear;\r\n transition: opacity 0.2s linear;\r\n }\r\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\r\n opacity: 1;\r\n }\r\n.leaflet-zoom-animated {\r\n -webkit-transform-origin: 0 0;\r\n -ms-transform-origin: 0 0;\r\n transform-origin: 0 0;\r\n }\r\nsvg.leaflet-zoom-animated {\r\n will-change: transform;\r\n}\r\n.leaflet-zoom-anim .leaflet-zoom-animated {\r\n -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\r\n transition: transform 0.25s cubic-bezier(0,0,0.25,1);\r\n }\r\n.leaflet-zoom-anim .leaflet-tile,\r\n.leaflet-pan-anim .leaflet-tile {\r\n -webkit-transition: none;\r\n -moz-transition: none;\r\n transition: none;\r\n }\r\n.leaflet-zoom-anim .leaflet-zoom-hide {\r\n visibility: hidden;\r\n }\r\n.leaflet-interactive {\r\n cursor: pointer;\r\n }\r\n.leaflet-grab {\r\n cursor: -webkit-grab;\r\n cursor: -moz-grab;\r\n cursor: grab;\r\n }\r\n.leaflet-crosshair,\r\n.leaflet-crosshair .leaflet-interactive {\r\n cursor: crosshair;\r\n }\r\n.leaflet-popup-pane,\r\n.leaflet-control {\r\n cursor: auto;\r\n }\r\n.leaflet-dragging .leaflet-grab,\r\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\r\n.leaflet-dragging .leaflet-marker-draggable {\r\n cursor: move;\r\n cursor: -webkit-grabbing;\r\n cursor: -moz-grabbing;\r\n cursor: grabbing;\r\n }\r\n.leaflet-marker-icon,\r\n.leaflet-marker-shadow,\r\n.leaflet-image-layer,\r\n.leaflet-pane > svg path,\r\n.leaflet-tile-container {\r\n pointer-events: none;\r\n }\r\n.leaflet-marker-icon.leaflet-interactive,\r\n.leaflet-image-layer.leaflet-interactive,\r\n.leaflet-pane > svg path.leaflet-interactive,\r\nsvg.leaflet-image-layer.leaflet-interactive path {\r\n pointer-events: visiblePainted; \r\n pointer-events: auto;\r\n }\r\n.leaflet-container {\r\n background: #ddd;\r\n outline-offset: 1px;\r\n }\r\n.leaflet-container a {\r\n color: #0078A8;\r\n }\r\n.leaflet-zoom-box {\r\n border: 2px dotted #38f;\r\n background: rgba(255,255,255,0.5);\r\n }\r\n.leaflet-container {\r\n font-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\r\n font-size: 12px;\r\n font-size: 0.75rem;\r\n line-height: 1.5;\r\n }\r\n.leaflet-bar {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.65);\r\n border-radius: 4px;\r\n }\r\n.leaflet-bar a {\r\n background-color: #fff;\r\n border-bottom: 1px solid #ccc;\r\n width: 26px;\r\n height: 26px;\r\n line-height: 26px;\r\n display: block;\r\n text-align: center;\r\n text-decoration: none;\r\n color: black;\r\n }\r\n.leaflet-bar a,\r\n.leaflet-control-layers-toggle {\r\n background-position: 50% 50%;\r\n background-repeat: no-repeat;\r\n display: block;\r\n }\r\n.leaflet-bar a:hover,\r\n.leaflet-bar a:focus {\r\n background-color: #f4f4f4;\r\n }\r\n.leaflet-bar a:first-child {\r\n border-top-left-radius: 4px;\r\n border-top-right-radius: 4px;\r\n }\r\n.leaflet-bar a:last-child {\r\n border-bottom-left-radius: 4px;\r\n border-bottom-right-radius: 4px;\r\n border-bottom: none;\r\n }\r\n.leaflet-bar a.leaflet-disabled {\r\n cursor: default;\r\n background-color: #f4f4f4;\r\n color: #bbb;\r\n }\r\n.leaflet-touch .leaflet-bar a {\r\n width: 30px;\r\n height: 30px;\r\n line-height: 30px;\r\n }\r\n.leaflet-touch .leaflet-bar a:first-child {\r\n border-top-left-radius: 2px;\r\n border-top-right-radius: 2px;\r\n }\r\n.leaflet-touch .leaflet-bar a:last-child {\r\n border-bottom-left-radius: 2px;\r\n border-bottom-right-radius: 2px;\r\n }\r\n.leaflet-control-zoom-in,\r\n.leaflet-control-zoom-out {\r\n font: bold 18px 'Lucida Console', Monaco, monospace;\r\n text-indent: 1px;\r\n }\r\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\r\n font-size: 22px;\r\n }\r\n.leaflet-control-layers {\r\n box-shadow: 0 1px 5px rgba(0,0,0,0.4);\r\n background: #fff;\r\n border-radius: 5px;\r\n }\r\n.leaflet-control-layers-toggle {\r\n background-image: url(images/layers.png);\r\n width: 36px;\r\n height: 36px;\r\n }\r\n.leaflet-retina .leaflet-control-layers-toggle {\r\n background-image: url(images/layers-2x.png);\r\n background-size: 26px 26px;\r\n }\r\n.leaflet-touch .leaflet-control-layers-toggle {\r\n width: 44px;\r\n height: 44px;\r\n }\r\n.leaflet-control-layers .leaflet-control-layers-list,\r\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\r\n display: none;\r\n }\r\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\r\n display: block;\r\n position: relative;\r\n }\r\n.leaflet-control-layers-expanded {\r\n padding: 6px 10px 6px 6px;\r\n color: #333;\r\n background: #fff;\r\n }\r\n.leaflet-control-layers-scrollbar {\r\n overflow-y: scroll;\r\n overflow-x: hidden;\r\n padding-right: 5px;\r\n }\r\n.leaflet-control-layers-selector {\r\n margin-top: 2px;\r\n position: relative;\r\n top: 1px;\r\n }\r\n.leaflet-control-layers label {\r\n display: block;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n }\r\n.leaflet-control-layers-separator {\r\n height: 0;\r\n border-top: 1px solid #ddd;\r\n margin: 5px -10px 5px -6px;\r\n }\r\n.leaflet-default-icon-path { \r\n background-image: url(images/marker-icon.png);\r\n }\r\n.leaflet-container .leaflet-control-attribution {\r\n background: #fff;\r\n background: rgba(255, 255, 255, 0.8);\r\n margin: 0;\r\n }\r\n.leaflet-control-attribution,\r\n.leaflet-control-scale-line {\r\n padding: 0 5px;\r\n color: #333;\r\n line-height: 1.4;\r\n }\r\n.leaflet-control-attribution a {\r\n text-decoration: none;\r\n }\r\n.leaflet-control-attribution a:hover,\r\n.leaflet-control-attribution a:focus {\r\n text-decoration: underline;\r\n }\r\n.leaflet-attribution-flag {\r\n display: inline !important;\r\n vertical-align: baseline !important;\r\n width: 1em;\r\n height: 0.6669em;\r\n }\r\n.leaflet-left .leaflet-control-scale {\r\n margin-left: 5px;\r\n }\r\n.leaflet-bottom .leaflet-control-scale {\r\n margin-bottom: 5px;\r\n }\r\n.leaflet-control-scale-line {\r\n border: 2px solid #777;\r\n border-top: none;\r\n line-height: 1.1;\r\n padding: 2px 5px 1px;\r\n white-space: nowrap;\r\n -moz-box-sizing: border-box;\r\n box-sizing: border-box;\r\n background: rgba(255, 255, 255, 0.8);\r\n text-shadow: 1px 1px #fff;\r\n }\r\n.leaflet-control-scale-line:not(:first-child) {\r\n border-top: 2px solid #777;\r\n border-bottom: none;\r\n margin-top: -2px;\r\n }\r\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\r\n border-bottom: 2px solid #777;\r\n }\r\n.leaflet-touch .leaflet-control-attribution,\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n box-shadow: none;\r\n }\r\n.leaflet-touch .leaflet-control-layers,\r\n.leaflet-touch .leaflet-bar {\r\n border: 2px solid rgba(0,0,0,0.2);\r\n background-clip: padding-box;\r\n }\r\n.leaflet-popup {\r\n position: absolute;\r\n text-align: center;\r\n margin-bottom: 20px;\r\n }\r\n.leaflet-popup-content-wrapper {\r\n padding: 1px;\r\n text-align: left;\r\n border-radius: 12px;\r\n }\r\n.leaflet-popup-content {\r\n margin: 13px 24px 13px 20px;\r\n line-height: 1.3;\r\n font-size: 13px;\r\n font-size: 1.08333em;\r\n min-height: 1px;\r\n }\r\n.leaflet-popup-content p {\r\n margin: 17px 0;\r\n margin: 1.3em 0;\r\n }\r\n.leaflet-popup-tip-container {\r\n width: 40px;\r\n height: 20px;\r\n position: absolute;\r\n left: 50%;\r\n margin-top: -1px;\r\n margin-left: -20px;\r\n overflow: hidden;\r\n pointer-events: none;\r\n }\r\n.leaflet-popup-tip {\r\n width: 17px;\r\n height: 17px;\r\n padding: 1px;\r\n margin: -10px auto 0;\r\n pointer-events: auto;\r\n -webkit-transform: rotate(45deg);\r\n -moz-transform: rotate(45deg);\r\n -ms-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n }\r\n.leaflet-popup-content-wrapper,\r\n.leaflet-popup-tip {\r\n background: white;\r\n color: #333;\r\n box-shadow: 0 3px 14px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-container a.leaflet-popup-close-button {\r\n position: absolute;\r\n top: 0;\r\n right: 0;\r\n border: none;\r\n text-align: center;\r\n width: 24px;\r\n height: 24px;\r\n font: 16px/24px Tahoma, Verdana, sans-serif;\r\n color: #757575;\r\n text-decoration: none;\r\n background: transparent;\r\n }\r\n.leaflet-container a.leaflet-popup-close-button:hover,\r\n.leaflet-container a.leaflet-popup-close-button:focus {\r\n color: #585858;\r\n }\r\n.leaflet-popup-scrolled {\r\n overflow: auto;\r\n }\r\n.leaflet-oldie .leaflet-popup-content-wrapper {\r\n -ms-zoom: 1;\r\n }\r\n.leaflet-oldie .leaflet-popup-tip {\r\n width: 24px;\r\n margin: 0 auto;\r\n -ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\r\n filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\r\n }\r\n.leaflet-oldie .leaflet-control-zoom,\r\n.leaflet-oldie .leaflet-control-layers,\r\n.leaflet-oldie .leaflet-popup-content-wrapper,\r\n.leaflet-oldie .leaflet-popup-tip {\r\n border: 1px solid #999;\r\n }\r\n.leaflet-div-icon {\r\n background: #fff;\r\n border: 1px solid #666;\r\n }\r\n.leaflet-tooltip {\r\n position: absolute;\r\n padding: 6px;\r\n background-color: #fff;\r\n border: 1px solid #fff;\r\n border-radius: 3px;\r\n color: #222;\r\n white-space: nowrap;\r\n -webkit-user-select: none;\r\n -moz-user-select: none;\r\n -ms-user-select: none;\r\n user-select: none;\r\n pointer-events: none;\r\n box-shadow: 0 1px 3px rgba(0,0,0,0.4);\r\n }\r\n.leaflet-tooltip.leaflet-interactive {\r\n cursor: pointer;\r\n pointer-events: auto;\r\n }\r\n.leaflet-tooltip-top:before,\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n position: absolute;\r\n pointer-events: none;\r\n border: 6px solid transparent;\r\n background: transparent;\r\n content: \"\";\r\n }\r\n.leaflet-tooltip-bottom {\r\n margin-top: 6px;\r\n}\r\n.leaflet-tooltip-top {\r\n margin-top: -6px;\r\n}\r\n.leaflet-tooltip-bottom:before,\r\n.leaflet-tooltip-top:before {\r\n left: 50%;\r\n margin-left: -6px;\r\n }\r\n.leaflet-tooltip-top:before {\r\n bottom: 0;\r\n margin-bottom: -12px;\r\n border-top-color: #fff;\r\n }\r\n.leaflet-tooltip-bottom:before {\r\n top: 0;\r\n margin-top: -12px;\r\n margin-left: -6px;\r\n border-bottom-color: #fff;\r\n }\r\n.leaflet-tooltip-left {\r\n margin-left: -6px;\r\n}\r\n.leaflet-tooltip-right {\r\n margin-left: 6px;\r\n}\r\n.leaflet-tooltip-left:before,\r\n.leaflet-tooltip-right:before {\r\n top: 50%;\r\n margin-top: -6px;\r\n }\r\n.leaflet-tooltip-left:before {\r\n right: 0;\r\n margin-right: -12px;\r\n border-left-color: #fff;\r\n }\r\n.leaflet-tooltip-right:before {\r\n left: 0;\r\n margin-left: -12px;\r\n border-right-color: #fff;\r\n }\r\n@media print {\r\n .leaflet-control {\r\n -webkit-print-color-adjust: exact;\r\n print-color-adjust: exact;\r\n }\r\n }";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { LEAFLET_CSS };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=leafletCss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leafletCss.js","names":["LEAFLET_CSS"],"sources":["../../src/location/leafletCss.ts"],"sourcesContent":["// The stylesheet of Leaflet 1.9.4 (BSD-2-Clause, (c) Volodymyr Agafonkin and CloudMade), without\n// its comments: Leaflet's own classes, injected once when a map first shows. Regenerate it from\n// leaflet/dist/leaflet.css when Leaflet is updated.\nexport const LEAFLET_CSS =\n '.leaflet-pane,\\r\\n.leaflet-tile,\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow,\\r\\n.leaflet-tile-container,\\r\\n.leaflet-pane > svg,\\r\\n.leaflet-pane > canvas,\\r\\n.leaflet-zoom-box,\\r\\n.leaflet-image-layer,\\r\\n.leaflet-layer {\\r\\n\\tposition: absolute;\\r\\n\\tleft: 0;\\r\\n\\ttop: 0;\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\toverflow: hidden;\\r\\n\\t}\\r\\n.leaflet-tile,\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow {\\r\\n\\t-webkit-user-select: none;\\r\\n\\t -moz-user-select: none;\\r\\n\\t user-select: none;\\r\\n\\t -webkit-user-drag: none;\\r\\n\\t}\\r\\n.leaflet-tile::selection {\\r\\n\\tbackground: transparent;\\r\\n}\\r\\n.leaflet-safari .leaflet-tile {\\r\\n\\timage-rendering: -webkit-optimize-contrast;\\r\\n\\t}\\r\\n.leaflet-safari .leaflet-tile-container {\\r\\n\\twidth: 1600px;\\r\\n\\theight: 1600px;\\r\\n\\t-webkit-transform-origin: 0 0;\\r\\n\\t}\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow {\\r\\n\\tdisplay: block;\\r\\n\\t}\\r\\n.leaflet-container .leaflet-overlay-pane svg {\\r\\n\\tmax-width: none !important;\\r\\n\\tmax-height: none !important;\\r\\n\\t}\\r\\n.leaflet-container .leaflet-marker-pane img,\\r\\n.leaflet-container .leaflet-shadow-pane img,\\r\\n.leaflet-container .leaflet-tile-pane img,\\r\\n.leaflet-container img.leaflet-image-layer,\\r\\n.leaflet-container .leaflet-tile {\\r\\n\\tmax-width: none !important;\\r\\n\\tmax-height: none !important;\\r\\n\\twidth: auto;\\r\\n\\tpadding: 0;\\r\\n\\t}\\r\\n.leaflet-container img.leaflet-tile {\\r\\n\\tmix-blend-mode: plus-lighter;\\r\\n}\\r\\n.leaflet-container.leaflet-touch-zoom {\\r\\n\\t-ms-touch-action: pan-x pan-y;\\r\\n\\ttouch-action: pan-x pan-y;\\r\\n\\t}\\r\\n.leaflet-container.leaflet-touch-drag {\\r\\n\\t-ms-touch-action: pinch-zoom;\\r\\n\\ttouch-action: none;\\r\\n\\ttouch-action: pinch-zoom;\\r\\n}\\r\\n.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {\\r\\n\\t-ms-touch-action: none;\\r\\n\\ttouch-action: none;\\r\\n}\\r\\n.leaflet-container {\\r\\n\\t-webkit-tap-highlight-color: transparent;\\r\\n}\\r\\n.leaflet-container a {\\r\\n\\t-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);\\r\\n}\\r\\n.leaflet-tile {\\r\\n\\tfilter: inherit;\\r\\n\\tvisibility: hidden;\\r\\n\\t}\\r\\n.leaflet-tile-loaded {\\r\\n\\tvisibility: inherit;\\r\\n\\t}\\r\\n.leaflet-zoom-box {\\r\\n\\twidth: 0;\\r\\n\\theight: 0;\\r\\n\\t-moz-box-sizing: border-box;\\r\\n\\t box-sizing: border-box;\\r\\n\\tz-index: 800;\\r\\n\\t}\\r\\n.leaflet-overlay-pane svg {\\r\\n\\t-moz-user-select: none;\\r\\n\\t}\\r\\n.leaflet-pane { z-index: 400; }\\r\\n.leaflet-tile-pane { z-index: 200; }\\r\\n.leaflet-overlay-pane { z-index: 400; }\\r\\n.leaflet-shadow-pane { z-index: 500; }\\r\\n.leaflet-marker-pane { z-index: 600; }\\r\\n.leaflet-tooltip-pane { z-index: 650; }\\r\\n.leaflet-popup-pane { z-index: 700; }\\r\\n.leaflet-map-pane canvas { z-index: 100; }\\r\\n.leaflet-map-pane svg { z-index: 200; }\\r\\n.leaflet-vml-shape {\\r\\n\\twidth: 1px;\\r\\n\\theight: 1px;\\r\\n\\t}\\r\\n.lvml {\\r\\n\\tbehavior: url(#default#VML);\\r\\n\\tdisplay: inline-block;\\r\\n\\tposition: absolute;\\r\\n\\t}\\r\\n.leaflet-control {\\r\\n\\tposition: relative;\\r\\n\\tz-index: 800;\\r\\n\\tpointer-events: visiblePainted; \\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-top,\\r\\n.leaflet-bottom {\\r\\n\\tposition: absolute;\\r\\n\\tz-index: 1000;\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-top {\\r\\n\\ttop: 0;\\r\\n\\t}\\r\\n.leaflet-right {\\r\\n\\tright: 0;\\r\\n\\t}\\r\\n.leaflet-bottom {\\r\\n\\tbottom: 0;\\r\\n\\t}\\r\\n.leaflet-left {\\r\\n\\tleft: 0;\\r\\n\\t}\\r\\n.leaflet-control {\\r\\n\\tfloat: left;\\r\\n\\tclear: both;\\r\\n\\t}\\r\\n.leaflet-right .leaflet-control {\\r\\n\\tfloat: right;\\r\\n\\t}\\r\\n.leaflet-top .leaflet-control {\\r\\n\\tmargin-top: 10px;\\r\\n\\t}\\r\\n.leaflet-bottom .leaflet-control {\\r\\n\\tmargin-bottom: 10px;\\r\\n\\t}\\r\\n.leaflet-left .leaflet-control {\\r\\n\\tmargin-left: 10px;\\r\\n\\t}\\r\\n.leaflet-right .leaflet-control {\\r\\n\\tmargin-right: 10px;\\r\\n\\t}\\r\\n.leaflet-fade-anim .leaflet-popup {\\r\\n\\topacity: 0;\\r\\n\\t-webkit-transition: opacity 0.2s linear;\\r\\n\\t -moz-transition: opacity 0.2s linear;\\r\\n\\t transition: opacity 0.2s linear;\\r\\n\\t}\\r\\n.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {\\r\\n\\topacity: 1;\\r\\n\\t}\\r\\n.leaflet-zoom-animated {\\r\\n\\t-webkit-transform-origin: 0 0;\\r\\n\\t -ms-transform-origin: 0 0;\\r\\n\\t transform-origin: 0 0;\\r\\n\\t}\\r\\nsvg.leaflet-zoom-animated {\\r\\n\\twill-change: transform;\\r\\n}\\r\\n.leaflet-zoom-anim .leaflet-zoom-animated {\\r\\n\\t-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t transition: transform 0.25s cubic-bezier(0,0,0.25,1);\\r\\n\\t}\\r\\n.leaflet-zoom-anim .leaflet-tile,\\r\\n.leaflet-pan-anim .leaflet-tile {\\r\\n\\t-webkit-transition: none;\\r\\n\\t -moz-transition: none;\\r\\n\\t transition: none;\\r\\n\\t}\\r\\n.leaflet-zoom-anim .leaflet-zoom-hide {\\r\\n\\tvisibility: hidden;\\r\\n\\t}\\r\\n.leaflet-interactive {\\r\\n\\tcursor: pointer;\\r\\n\\t}\\r\\n.leaflet-grab {\\r\\n\\tcursor: -webkit-grab;\\r\\n\\tcursor: -moz-grab;\\r\\n\\tcursor: grab;\\r\\n\\t}\\r\\n.leaflet-crosshair,\\r\\n.leaflet-crosshair .leaflet-interactive {\\r\\n\\tcursor: crosshair;\\r\\n\\t}\\r\\n.leaflet-popup-pane,\\r\\n.leaflet-control {\\r\\n\\tcursor: auto;\\r\\n\\t}\\r\\n.leaflet-dragging .leaflet-grab,\\r\\n.leaflet-dragging .leaflet-grab .leaflet-interactive,\\r\\n.leaflet-dragging .leaflet-marker-draggable {\\r\\n\\tcursor: move;\\r\\n\\tcursor: -webkit-grabbing;\\r\\n\\tcursor: -moz-grabbing;\\r\\n\\tcursor: grabbing;\\r\\n\\t}\\r\\n.leaflet-marker-icon,\\r\\n.leaflet-marker-shadow,\\r\\n.leaflet-image-layer,\\r\\n.leaflet-pane > svg path,\\r\\n.leaflet-tile-container {\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-marker-icon.leaflet-interactive,\\r\\n.leaflet-image-layer.leaflet-interactive,\\r\\n.leaflet-pane > svg path.leaflet-interactive,\\r\\nsvg.leaflet-image-layer.leaflet-interactive path {\\r\\n\\tpointer-events: visiblePainted; \\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\tbackground: #ddd;\\r\\n\\toutline-offset: 1px;\\r\\n\\t}\\r\\n.leaflet-container a {\\r\\n\\tcolor: #0078A8;\\r\\n\\t}\\r\\n.leaflet-zoom-box {\\r\\n\\tborder: 2px dotted #38f;\\r\\n\\tbackground: rgba(255,255,255,0.5);\\r\\n\\t}\\r\\n.leaflet-container {\\r\\n\\tfont-family: \"Helvetica Neue\", Arial, Helvetica, sans-serif;\\r\\n\\tfont-size: 12px;\\r\\n\\tfont-size: 0.75rem;\\r\\n\\tline-height: 1.5;\\r\\n\\t}\\r\\n.leaflet-bar {\\r\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.65);\\r\\n\\tborder-radius: 4px;\\r\\n\\t}\\r\\n.leaflet-bar a {\\r\\n\\tbackground-color: #fff;\\r\\n\\tborder-bottom: 1px solid #ccc;\\r\\n\\twidth: 26px;\\r\\n\\theight: 26px;\\r\\n\\tline-height: 26px;\\r\\n\\tdisplay: block;\\r\\n\\ttext-align: center;\\r\\n\\ttext-decoration: none;\\r\\n\\tcolor: black;\\r\\n\\t}\\r\\n.leaflet-bar a,\\r\\n.leaflet-control-layers-toggle {\\r\\n\\tbackground-position: 50% 50%;\\r\\n\\tbackground-repeat: no-repeat;\\r\\n\\tdisplay: block;\\r\\n\\t}\\r\\n.leaflet-bar a:hover,\\r\\n.leaflet-bar a:focus {\\r\\n\\tbackground-color: #f4f4f4;\\r\\n\\t}\\r\\n.leaflet-bar a:first-child {\\r\\n\\tborder-top-left-radius: 4px;\\r\\n\\tborder-top-right-radius: 4px;\\r\\n\\t}\\r\\n.leaflet-bar a:last-child {\\r\\n\\tborder-bottom-left-radius: 4px;\\r\\n\\tborder-bottom-right-radius: 4px;\\r\\n\\tborder-bottom: none;\\r\\n\\t}\\r\\n.leaflet-bar a.leaflet-disabled {\\r\\n\\tcursor: default;\\r\\n\\tbackground-color: #f4f4f4;\\r\\n\\tcolor: #bbb;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a {\\r\\n\\twidth: 30px;\\r\\n\\theight: 30px;\\r\\n\\tline-height: 30px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a:first-child {\\r\\n\\tborder-top-left-radius: 2px;\\r\\n\\tborder-top-right-radius: 2px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-bar a:last-child {\\r\\n\\tborder-bottom-left-radius: 2px;\\r\\n\\tborder-bottom-right-radius: 2px;\\r\\n\\t}\\r\\n.leaflet-control-zoom-in,\\r\\n.leaflet-control-zoom-out {\\r\\n\\tfont: bold 18px \\'Lucida Console\\', Monaco, monospace;\\r\\n\\ttext-indent: 1px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {\\r\\n\\tfont-size: 22px;\\r\\n\\t}\\r\\n.leaflet-control-layers {\\r\\n\\tbox-shadow: 0 1px 5px rgba(0,0,0,0.4);\\r\\n\\tbackground: #fff;\\r\\n\\tborder-radius: 5px;\\r\\n\\t}\\r\\n.leaflet-control-layers-toggle {\\r\\n\\tbackground-image: url(images/layers.png);\\r\\n\\twidth: 36px;\\r\\n\\theight: 36px;\\r\\n\\t}\\r\\n.leaflet-retina .leaflet-control-layers-toggle {\\r\\n\\tbackground-image: url(images/layers-2x.png);\\r\\n\\tbackground-size: 26px 26px;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-layers-toggle {\\r\\n\\twidth: 44px;\\r\\n\\theight: 44px;\\r\\n\\t}\\r\\n.leaflet-control-layers .leaflet-control-layers-list,\\r\\n.leaflet-control-layers-expanded .leaflet-control-layers-toggle {\\r\\n\\tdisplay: none;\\r\\n\\t}\\r\\n.leaflet-control-layers-expanded .leaflet-control-layers-list {\\r\\n\\tdisplay: block;\\r\\n\\tposition: relative;\\r\\n\\t}\\r\\n.leaflet-control-layers-expanded {\\r\\n\\tpadding: 6px 10px 6px 6px;\\r\\n\\tcolor: #333;\\r\\n\\tbackground: #fff;\\r\\n\\t}\\r\\n.leaflet-control-layers-scrollbar {\\r\\n\\toverflow-y: scroll;\\r\\n\\toverflow-x: hidden;\\r\\n\\tpadding-right: 5px;\\r\\n\\t}\\r\\n.leaflet-control-layers-selector {\\r\\n\\tmargin-top: 2px;\\r\\n\\tposition: relative;\\r\\n\\ttop: 1px;\\r\\n\\t}\\r\\n.leaflet-control-layers label {\\r\\n\\tdisplay: block;\\r\\n\\tfont-size: 13px;\\r\\n\\tfont-size: 1.08333em;\\r\\n\\t}\\r\\n.leaflet-control-layers-separator {\\r\\n\\theight: 0;\\r\\n\\tborder-top: 1px solid #ddd;\\r\\n\\tmargin: 5px -10px 5px -6px;\\r\\n\\t}\\r\\n.leaflet-default-icon-path { \\r\\n\\tbackground-image: url(images/marker-icon.png);\\r\\n\\t}\\r\\n.leaflet-container .leaflet-control-attribution {\\r\\n\\tbackground: #fff;\\r\\n\\tbackground: rgba(255, 255, 255, 0.8);\\r\\n\\tmargin: 0;\\r\\n\\t}\\r\\n.leaflet-control-attribution,\\r\\n.leaflet-control-scale-line {\\r\\n\\tpadding: 0 5px;\\r\\n\\tcolor: #333;\\r\\n\\tline-height: 1.4;\\r\\n\\t}\\r\\n.leaflet-control-attribution a {\\r\\n\\ttext-decoration: none;\\r\\n\\t}\\r\\n.leaflet-control-attribution a:hover,\\r\\n.leaflet-control-attribution a:focus {\\r\\n\\ttext-decoration: underline;\\r\\n\\t}\\r\\n.leaflet-attribution-flag {\\r\\n\\tdisplay: inline !important;\\r\\n\\tvertical-align: baseline !important;\\r\\n\\twidth: 1em;\\r\\n\\theight: 0.6669em;\\r\\n\\t}\\r\\n.leaflet-left .leaflet-control-scale {\\r\\n\\tmargin-left: 5px;\\r\\n\\t}\\r\\n.leaflet-bottom .leaflet-control-scale {\\r\\n\\tmargin-bottom: 5px;\\r\\n\\t}\\r\\n.leaflet-control-scale-line {\\r\\n\\tborder: 2px solid #777;\\r\\n\\tborder-top: none;\\r\\n\\tline-height: 1.1;\\r\\n\\tpadding: 2px 5px 1px;\\r\\n\\twhite-space: nowrap;\\r\\n\\t-moz-box-sizing: border-box;\\r\\n\\t box-sizing: border-box;\\r\\n\\tbackground: rgba(255, 255, 255, 0.8);\\r\\n\\ttext-shadow: 1px 1px #fff;\\r\\n\\t}\\r\\n.leaflet-control-scale-line:not(:first-child) {\\r\\n\\tborder-top: 2px solid #777;\\r\\n\\tborder-bottom: none;\\r\\n\\tmargin-top: -2px;\\r\\n\\t}\\r\\n.leaflet-control-scale-line:not(:first-child):not(:last-child) {\\r\\n\\tborder-bottom: 2px solid #777;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-attribution,\\r\\n.leaflet-touch .leaflet-control-layers,\\r\\n.leaflet-touch .leaflet-bar {\\r\\n\\tbox-shadow: none;\\r\\n\\t}\\r\\n.leaflet-touch .leaflet-control-layers,\\r\\n.leaflet-touch .leaflet-bar {\\r\\n\\tborder: 2px solid rgba(0,0,0,0.2);\\r\\n\\tbackground-clip: padding-box;\\r\\n\\t}\\r\\n.leaflet-popup {\\r\\n\\tposition: absolute;\\r\\n\\ttext-align: center;\\r\\n\\tmargin-bottom: 20px;\\r\\n\\t}\\r\\n.leaflet-popup-content-wrapper {\\r\\n\\tpadding: 1px;\\r\\n\\ttext-align: left;\\r\\n\\tborder-radius: 12px;\\r\\n\\t}\\r\\n.leaflet-popup-content {\\r\\n\\tmargin: 13px 24px 13px 20px;\\r\\n\\tline-height: 1.3;\\r\\n\\tfont-size: 13px;\\r\\n\\tfont-size: 1.08333em;\\r\\n\\tmin-height: 1px;\\r\\n\\t}\\r\\n.leaflet-popup-content p {\\r\\n\\tmargin: 17px 0;\\r\\n\\tmargin: 1.3em 0;\\r\\n\\t}\\r\\n.leaflet-popup-tip-container {\\r\\n\\twidth: 40px;\\r\\n\\theight: 20px;\\r\\n\\tposition: absolute;\\r\\n\\tleft: 50%;\\r\\n\\tmargin-top: -1px;\\r\\n\\tmargin-left: -20px;\\r\\n\\toverflow: hidden;\\r\\n\\tpointer-events: none;\\r\\n\\t}\\r\\n.leaflet-popup-tip {\\r\\n\\twidth: 17px;\\r\\n\\theight: 17px;\\r\\n\\tpadding: 1px;\\r\\n\\tmargin: -10px auto 0;\\r\\n\\tpointer-events: auto;\\r\\n\\t-webkit-transform: rotate(45deg);\\r\\n\\t -moz-transform: rotate(45deg);\\r\\n\\t -ms-transform: rotate(45deg);\\r\\n\\t transform: rotate(45deg);\\r\\n\\t}\\r\\n.leaflet-popup-content-wrapper,\\r\\n.leaflet-popup-tip {\\r\\n\\tbackground: white;\\r\\n\\tcolor: #333;\\r\\n\\tbox-shadow: 0 3px 14px rgba(0,0,0,0.4);\\r\\n\\t}\\r\\n.leaflet-container a.leaflet-popup-close-button {\\r\\n\\tposition: absolute;\\r\\n\\ttop: 0;\\r\\n\\tright: 0;\\r\\n\\tborder: none;\\r\\n\\ttext-align: center;\\r\\n\\twidth: 24px;\\r\\n\\theight: 24px;\\r\\n\\tfont: 16px/24px Tahoma, Verdana, sans-serif;\\r\\n\\tcolor: #757575;\\r\\n\\ttext-decoration: none;\\r\\n\\tbackground: transparent;\\r\\n\\t}\\r\\n.leaflet-container a.leaflet-popup-close-button:hover,\\r\\n.leaflet-container a.leaflet-popup-close-button:focus {\\r\\n\\tcolor: #585858;\\r\\n\\t}\\r\\n.leaflet-popup-scrolled {\\r\\n\\toverflow: auto;\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-popup-content-wrapper {\\r\\n\\t-ms-zoom: 1;\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-popup-tip {\\r\\n\\twidth: 24px;\\r\\n\\tmargin: 0 auto;\\r\\n\\t-ms-filter: \"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";\\r\\n\\tfilter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);\\r\\n\\t}\\r\\n.leaflet-oldie .leaflet-control-zoom,\\r\\n.leaflet-oldie .leaflet-control-layers,\\r\\n.leaflet-oldie .leaflet-popup-content-wrapper,\\r\\n.leaflet-oldie .leaflet-popup-tip {\\r\\n\\tborder: 1px solid #999;\\r\\n\\t}\\r\\n.leaflet-div-icon {\\r\\n\\tbackground: #fff;\\r\\n\\tborder: 1px solid #666;\\r\\n\\t}\\r\\n.leaflet-tooltip {\\r\\n\\tposition: absolute;\\r\\n\\tpadding: 6px;\\r\\n\\tbackground-color: #fff;\\r\\n\\tborder: 1px solid #fff;\\r\\n\\tborder-radius: 3px;\\r\\n\\tcolor: #222;\\r\\n\\twhite-space: nowrap;\\r\\n\\t-webkit-user-select: none;\\r\\n\\t-moz-user-select: none;\\r\\n\\t-ms-user-select: none;\\r\\n\\tuser-select: none;\\r\\n\\tpointer-events: none;\\r\\n\\tbox-shadow: 0 1px 3px rgba(0,0,0,0.4);\\r\\n\\t}\\r\\n.leaflet-tooltip.leaflet-interactive {\\r\\n\\tcursor: pointer;\\r\\n\\tpointer-events: auto;\\r\\n\\t}\\r\\n.leaflet-tooltip-top:before,\\r\\n.leaflet-tooltip-bottom:before,\\r\\n.leaflet-tooltip-left:before,\\r\\n.leaflet-tooltip-right:before {\\r\\n\\tposition: absolute;\\r\\n\\tpointer-events: none;\\r\\n\\tborder: 6px solid transparent;\\r\\n\\tbackground: transparent;\\r\\n\\tcontent: \"\";\\r\\n\\t}\\r\\n.leaflet-tooltip-bottom {\\r\\n\\tmargin-top: 6px;\\r\\n}\\r\\n.leaflet-tooltip-top {\\r\\n\\tmargin-top: -6px;\\r\\n}\\r\\n.leaflet-tooltip-bottom:before,\\r\\n.leaflet-tooltip-top:before {\\r\\n\\tleft: 50%;\\r\\n\\tmargin-left: -6px;\\r\\n\\t}\\r\\n.leaflet-tooltip-top:before {\\r\\n\\tbottom: 0;\\r\\n\\tmargin-bottom: -12px;\\r\\n\\tborder-top-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-bottom:before {\\r\\n\\ttop: 0;\\r\\n\\tmargin-top: -12px;\\r\\n\\tmargin-left: -6px;\\r\\n\\tborder-bottom-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-left {\\r\\n\\tmargin-left: -6px;\\r\\n}\\r\\n.leaflet-tooltip-right {\\r\\n\\tmargin-left: 6px;\\r\\n}\\r\\n.leaflet-tooltip-left:before,\\r\\n.leaflet-tooltip-right:before {\\r\\n\\ttop: 50%;\\r\\n\\tmargin-top: -6px;\\r\\n\\t}\\r\\n.leaflet-tooltip-left:before {\\r\\n\\tright: 0;\\r\\n\\tmargin-right: -12px;\\r\\n\\tborder-left-color: #fff;\\r\\n\\t}\\r\\n.leaflet-tooltip-right:before {\\r\\n\\tleft: 0;\\r\\n\\tmargin-left: -12px;\\r\\n\\tborder-right-color: #fff;\\r\\n\\t}\\r\\n@media print {\\r\\n\\t.leaflet-control {\\r\\n\\t\\t-webkit-print-color-adjust: exact;\\r\\n\\t\\tprint-color-adjust: exact;\\r\\n\\t\\t}\\r\\n\\t}';\n"],"mappings":";AAGA,IAAaA,cACT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GeocodingSource } from './types.js';
|
|
2
|
+
export interface NominatimSourceOptions {
|
|
3
|
+
/** The Nominatim server. Defaults to OpenStreetMap's, whose policy allows one request a second. */
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
/** An email, which OpenStreetMap's server asks of apps that send many requests. */
|
|
6
|
+
email?: string;
|
|
7
|
+
/** Limits the search to these countries (`['ca']`). */
|
|
8
|
+
countryCodes?: readonly string[];
|
|
9
|
+
/** Most results of a search. Defaults to 5. */
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public
|
|
14
|
+
* server allows one request a second and no heavy use. For more, run a server or use a service.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createNominatimSource({ endpoint, email, countryCodes, limit, }?: NominatimSourceOptions): GeocodingSource;
|
|
17
|
+
//# sourceMappingURL=nominatim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nominatim.d.ts","sourceRoot":"","sources":["../../src/location/nominatim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,SAAS,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACnC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAiBD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,QAAgD,EAChD,KAAK,EACL,YAAY,EACZ,KAAS,GACZ,GAAE,sBAA2B,GAAG,eAAe,CAgD/C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/location/nominatim.ts
|
|
2
|
+
function toResult(place) {
|
|
3
|
+
const lat = Number(place.lat);
|
|
4
|
+
const lng = Number(place.lon);
|
|
5
|
+
if (typeof place.display_name !== "string" || Number.isNaN(lat) || Number.isNaN(lng)) return null;
|
|
6
|
+
return {
|
|
7
|
+
label: place.display_name,
|
|
8
|
+
lat,
|
|
9
|
+
lng
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public
|
|
14
|
+
* server allows one request a second and no heavy use. For more, run a server or use a service.
|
|
15
|
+
*/
|
|
16
|
+
function createNominatimSource({ endpoint = "https://nominatim.openstreetmap.org", email, countryCodes, limit = 5 } = {}) {
|
|
17
|
+
const base = endpoint.replace(/\/$/, "");
|
|
18
|
+
const request = async (path, params, { signal, locale }) => {
|
|
19
|
+
const query = new URLSearchParams({
|
|
20
|
+
format: "jsonv2",
|
|
21
|
+
...params
|
|
22
|
+
});
|
|
23
|
+
if (email !== void 0) query.set("email", email);
|
|
24
|
+
if (locale !== void 0) query.set("accept-language", locale);
|
|
25
|
+
const response = await fetch(`${base}${path}?${query}`, { signal });
|
|
26
|
+
if (!response.ok) throw new Error(`Nominatim answered ${response.status}.`);
|
|
27
|
+
return response.json();
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
async search(text, options) {
|
|
31
|
+
const places = await request("/search", {
|
|
32
|
+
q: text,
|
|
33
|
+
limit: String(limit),
|
|
34
|
+
...countryCodes !== void 0 && countryCodes.length > 0 ? { countrycodes: countryCodes.join(",") } : {}
|
|
35
|
+
}, options);
|
|
36
|
+
return Array.isArray(places) ? places.flatMap((place) => toResult(place) ?? []) : [];
|
|
37
|
+
},
|
|
38
|
+
async reverse({ lat, lng }, options) {
|
|
39
|
+
const place = await request("/reverse", {
|
|
40
|
+
lat: String(lat),
|
|
41
|
+
lon: String(lng)
|
|
42
|
+
}, options);
|
|
43
|
+
return place !== null && typeof place === "object" ? toResult(place) : null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { createNominatimSource };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=nominatim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nominatim.js","names":["GeocodingResult","GeocodingSource","NominatimSourceOptions","endpoint","email","countryCodes","limit","NominatimPlace","display_name","lat","lon","toResult","place","Number","lng","isNaN","label","createNominatimSource","base","replace","request","path","params","Record","signal","locale","AbortSignal","Promise","query","URLSearchParams","format","undefined","set","response","fetch","ok","Error","status","json","search","text","options","places","q","String","length","countrycodes","join","Array","isArray","flatMap","reverse"],"sources":["../../src/location/nominatim.ts"],"sourcesContent":["import type { GeocodingResult, GeocodingSource } from './types';\n\nexport interface NominatimSourceOptions {\n /** The Nominatim server. Defaults to OpenStreetMap's, whose policy allows one request a second. */\n endpoint?: string;\n /** An email, which OpenStreetMap's server asks of apps that send many requests. */\n email?: string;\n /** Limits the search to these countries (`['ca']`). */\n countryCodes?: readonly string[];\n /** Most results of a search. Defaults to 5. */\n limit?: number;\n}\n\ninterface NominatimPlace {\n display_name?: unknown;\n lat?: unknown;\n lon?: unknown;\n}\n\nfunction toResult(place: NominatimPlace): GeocodingResult | null {\n const lat = Number(place.lat);\n const lng = Number(place.lon);\n if (typeof place.display_name !== 'string' || Number.isNaN(lat) || Number.isNaN(lng)) {\n return null;\n }\n return { label: place.display_name, lat, lng };\n}\n\n/**\n * An address search on Nominatim, OpenStreetMap's geocoder. Fine for an admin panel: its public\n * server allows one request a second and no heavy use. For more, run a server or use a service.\n */\nexport function createNominatimSource({\n endpoint = 'https://nominatim.openstreetmap.org',\n email,\n countryCodes,\n limit = 5,\n}: NominatimSourceOptions = {}): GeocodingSource {\n const base = endpoint.replace(/\\/$/, '');\n const request = async (\n path: string,\n params: Record<string, string>,\n { signal, locale }: { signal: AbortSignal; locale?: string },\n ): Promise<unknown> => {\n const query = new URLSearchParams({ format: 'jsonv2', ...params });\n if (email !== undefined) {\n query.set('email', email);\n }\n if (locale !== undefined) {\n query.set('accept-language', locale);\n }\n const response = await fetch(`${base}${path}?${query}`, { signal });\n if (!response.ok) {\n throw new Error(`Nominatim answered ${response.status}.`);\n }\n return response.json();\n };\n return {\n async search(text, options) {\n const places = await request(\n '/search',\n {\n q: text,\n limit: String(limit),\n ...(countryCodes !== undefined && countryCodes.length > 0\n ? { countrycodes: countryCodes.join(',') }\n : {}),\n },\n options,\n );\n return Array.isArray(places)\n ? places.flatMap((place: NominatimPlace) => toResult(place) ?? [])\n : [];\n },\n async reverse({ lat, lng }, options) {\n const place = await request(\n '/reverse',\n { lat: String(lat), lon: String(lng) },\n options,\n );\n return place !== null && typeof place === 'object'\n ? toResult(place as NominatimPlace)\n : null;\n },\n };\n}\n"],"mappings":";AAmBA,SAASW,SAASC,OAA+C;CAC7D,MAAMH,MAAMI,OAAOD,MAAMH,GAAG;CAC5B,MAAMK,MAAMD,OAAOD,MAAMF,GAAG;CAC5B,IAAI,OAAOE,MAAMJ,iBAAiB,YAAYK,OAAOE,MAAMN,GAAG,KAAKI,OAAOE,MAAMD,GAAG,GAC/E,OAAO;CAEX,OAAO;EAAEE,OAAOJ,MAAMJ;EAAcC;EAAKK;CAAI;AACjD;;;;;AAMA,SAAgBG,sBAAsB,EAClCd,WAAW,uCACXC,OACAC,cACAC,QAAQ,MACgB,CAAC,GAAoB;CAC7C,MAAMY,OAAOf,SAASgB,QAAQ,OAAO,EAAE;CACvC,MAAMC,UAAU,OACZC,MACAC,QACA,EAAEE,QAAQC,aACS;EACnB,MAAMG,QAAQ,IAAIC,gBAAgB;GAAEC,QAAQ;GAAU,GAAGR;EAAO,CAAC;EACjE,IAAIlB,UAAU2B,KAAAA,GACVH,MAAMI,IAAI,SAAS5B,KAAK;EAE5B,IAAIqB,WAAWM,KAAAA,GACXH,MAAMI,IAAI,mBAAmBP,MAAM;EAEvC,MAAMQ,WAAW,MAAMC,MAAM,GAAGhB,OAAOG,KAAI,GAAIO,SAAS,EAAEJ,OAAO,CAAC;EAClE,IAAI,CAACS,SAASE,IACV,MAAM,IAAIC,MAAM,sBAAsBH,SAASI,OAAM,EAAG;EAE5D,OAAOJ,SAASK,KAAK;CACzB;CACA,OAAO;EACH,MAAMC,OAAOC,MAAMC,SAAS;GACxB,MAAMC,SAAS,MAAMtB,QACjB,WACA;IACIuB,GAAGH;IACHlC,OAAOsC,OAAOtC,KAAK;IACnB,GAAID,iBAAiB0B,KAAAA,KAAa1B,aAAawC,SAAS,IAClD,EAAEC,cAAczC,aAAa0C,KAAK,GAAG,EAAE,IACvC,CAAC;GACX,GACAN,OACJ;GACA,OAAOO,MAAMC,QAAQP,MAAM,IACrBA,OAAOQ,SAAStC,UAA0BD,SAASC,KAAK,KAAK,CAAA,CAAE,IAC/D,CAAA;EACV;EACA,MAAMuC,QAAQ,EAAE1C,KAAKK,OAAO2B,SAAS;GACjC,MAAM7B,QAAQ,MAAMQ,QAChB,YACA;IAAEX,KAAKmC,OAAOnC,GAAG;IAAGC,KAAKkC,OAAO9B,GAAG;GAAE,GACrC2B,OACJ;GACA,OAAO7B,UAAU,QAAQ,OAAOA,UAAU,WACpCD,SAASC,KAAuB,IAChC;EACV;CACJ;AACJ"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** A place an address search found: what it shows, and its point. */
|
|
2
|
+
export interface GeocodingResult {
|
|
3
|
+
label: string;
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Where `location` fields search addresses (decision 0033). Projects bring their own: a service
|
|
9
|
+
* with a key, their backend, or `createNominatimSource()` for small volumes.
|
|
10
|
+
*/
|
|
11
|
+
export interface GeocodingSource {
|
|
12
|
+
/** The places that match an address or a name, best first. */
|
|
13
|
+
search(query: string, options: {
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
locale?: string;
|
|
16
|
+
}): Promise<GeocodingResult[]>;
|
|
17
|
+
/** The address of a point, to fill it in when the point is placed on the map. Optional. */
|
|
18
|
+
reverse?(point: {
|
|
19
|
+
lat: number;
|
|
20
|
+
lng: number;
|
|
21
|
+
}, options: {
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
locale?: string;
|
|
24
|
+
}): Promise<GeocodingResult | null>;
|
|
25
|
+
}
|
|
26
|
+
/** Raster tiles of the maps of `location` fields. */
|
|
27
|
+
export interface MapTiles {
|
|
28
|
+
/** URL template of the tiles: `https://tile.openstreetmap.org/{z}/{x}/{y}.png`. */
|
|
29
|
+
url: string;
|
|
30
|
+
/** The credit the tiles ask for, as HTML. */
|
|
31
|
+
attribution: string;
|
|
32
|
+
/** Highest zoom of the tiles. Defaults to 19. */
|
|
33
|
+
maxZoom?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The tiles and the address search of the maps of `location` fields. */
|
|
36
|
+
export interface MapsConfig {
|
|
37
|
+
tiles?: MapTiles;
|
|
38
|
+
geocoding?: GeocodingSource;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/location/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,8DAA8D;IAC9D,MAAM,CACF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9B,2FAA2F;IAC3F,OAAO,CAAC,CACJ,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EACnC,OAAO,EAAE;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CACtC;AAED,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACrB,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACvB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
.panneau-missing-
|
|
1
|
+
.panneau-missing-field-missing {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: var(--panneau-space-1);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.panneau-notice
|
|
7
|
+
.panneau-missing-field-notice {
|
|
8
8
|
padding: var(--panneau-space-2) var(--panneau-space-3);
|
|
9
9
|
font-size: var(--panneau-font-size-sm);
|
|
10
10
|
color: var(--panneau-color-text-muted);
|
|
11
11
|
background-color: var(--panneau-color-surface-sunken);
|
|
12
12
|
border: var(--panneau-border-width) dashed var(--panneau-color-border-control);
|
|
13
13
|
border-radius: var(--panneau-radius-md);
|
|
14
|
+
margin: 0;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
.panneau-label
|
|
17
|
+
.panneau-missing-field-label {
|
|
17
18
|
font-weight: var(--panneau-font-weight-medium);
|
|
18
19
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
2
|
/**
|
|
3
|
-
* The slot of a field type that no plugin provides, such as `richtext` and `media`
|
|
4
|
-
* it keeps the field's place in the form and names the
|
|
3
|
+
* The slot of a field type that no plugin provides, such as `richtext` and `media` without
|
|
4
|
+
* `@panneau/editor` and `@panneau/media`: it keeps the field's place in the form and names the
|
|
5
|
+
* missing type. The value is left as is.
|
|
5
6
|
*/
|
|
6
7
|
export declare function MissingFieldEntry({ field, className }: FieldEntryProps): import("react").JSX.Element;
|
|
7
8
|
//# sourceMappingURL=MissingField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingField.d.ts","sourceRoot":"","sources":["../../src/missing/MissingField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD
|
|
1
|
+
{"version":3,"file":"MissingField.d.ts","sourceRoot":"","sources":["../../src/missing/MissingField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,eAAe,+BAUtE"}
|
|
@@ -6,8 +6,9 @@ import { usePanneauIntl } from "@panneau/ui";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/missing/MissingField.tsx
|
|
8
8
|
/**
|
|
9
|
-
* The slot of a field type that no plugin provides, such as `richtext` and `media`
|
|
10
|
-
* it keeps the field's place in the form and names the
|
|
9
|
+
* The slot of a field type that no plugin provides, such as `richtext` and `media` without
|
|
10
|
+
* `@panneau/editor` and `@panneau/media`: it keeps the field's place in the form and names the
|
|
11
|
+
* missing type. The value is left as is.
|
|
11
12
|
*/
|
|
12
13
|
function MissingFieldEntry(t0) {
|
|
13
14
|
const $ = c(14);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingField.js","names":["_c","styles"],"sources":["../../src/missing/MissingField.tsx"],"sourcesContent":["import { usePanneauIntl } from '@panneau/ui';\n\nimport { cx } from '../shared/cx';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps } from '../shared/types';\nimport styles from './MissingField.module.css';\n\n/**\n * The slot of a field type that no plugin provides, such as `richtext` and `media`
|
|
1
|
+
{"version":3,"file":"MissingField.js","names":["usePanneauIntl","cx","messages","FieldEntryProps","styles","MissingFieldEntry","t0","$","_c","field","className","intl","t1","missing","t2","type","t3","label","name","t4","t5","formatMessage","missingPlugin","t6","notice","t7","_c","styles"],"sources":["../../src/missing/MissingField.tsx"],"sourcesContent":["import { usePanneauIntl } from '@panneau/ui';\n\nimport { cx } from '../shared/cx';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps } from '../shared/types';\nimport styles from './MissingField.module.css';\n\n/**\n * The slot of a field type that no plugin provides, such as `richtext` and `media` without\n * `@panneau/editor` and `@panneau/media`: it keeps the field's place in the form and names the\n * missing type. The value is left as is.\n */\nexport function MissingFieldEntry({ field, className }: FieldEntryProps) {\n const intl = usePanneauIntl();\n return (\n <div className={cx(styles.missing, className)} data-field-type={field.type}>\n <span className={styles.label}>{field.label ?? field.name}</span>\n <p className={styles.notice} role=\"note\">\n {intl.formatMessage(messages.missingPlugin, { type: field.type })}\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAOK,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA2B,MAAA,EAAAC,OAAAC,cAAAJ;CAC9B,MAAAK,OAAaX,eAAe;CAAE,IAAAY;CAAA,IAAAL,EAAA,OAAAG,WAAA;EAEVE,KAAAX,GAAGG,4BAAMS,SAAUH,SAAS;EAACH,EAAA,KAAAG;EAAAH,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAmB,MAAAO,KAAAL,MAAKM;CACjC,MAAAC,KAAAP,MAAKQ,SAAUR,MAAKS;CAAK,IAAAC;CAAA,IAAAZ,EAAA,OAAAS,IAAA;EAAzDG,KAAA,oBAAA,QAAA;GAAiB,WAAAf,4BAAMa;GAASD,UAAAA;EAAiC,CAAA;EAAAT,EAAA,KAAAS;EAAAT,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAE,MAAAM,QAAAR,EAAA,OAAAI,MAAA;EAE5DS,KAAAT,KAAIU,cAAenB,SAAQoB,eAAgB,EAAAP,MAAQN,MAAKM,KAAM,CAAC;EAACR,EAAA,KAAAE,MAAAM;EAAAR,EAAA,KAAAI;EAAAJ,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,OAAAa,IAAA;EADrEG,KAAA,oBAAA,KAAA;GAAc,WAAAnB,4BAAMoB;GAAc,MAAA;GAC7BJ,UAAAA;EACD,CAAA;EAAAb,EAAA,KAAAa;EAAAb,EAAA,KAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,OAAAE,MAAAM,QAAAR,EAAA,QAAAK,MAAAL,EAAA,QAAAY,MAAAZ,EAAA,QAAAgB,IAAA;EAJRE,KAAA,qBAAA,OAAA;GAAgB,WAAAb;GAAgD,mBAAAE;GAAhE,UAAA,CACIK,IACAI,EAGE;;EAAAhB,EAAA,KAAAE,MAAAM;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAY;EAAAZ,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,OALNkB;AAKM"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./MissingField.css";
|
|
2
2
|
//#region src/missing/MissingField.module.css
|
|
3
|
-
var missing = "panneau-missing-
|
|
4
|
-
var notice = "panneau-notice
|
|
5
|
-
var label = "panneau-label
|
|
3
|
+
var missing = "panneau-missing-field-missing";
|
|
4
|
+
var notice = "panneau-missing-field-notice";
|
|
5
|
+
var label = "panneau-missing-field-label";
|
|
6
6
|
var MissingField_module_default = {
|
|
7
7
|
missing,
|
|
8
8
|
notice,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingField.module.js","names":[],"sources":["../../src/missing/MissingField.module.css"],"sourcesContent":[".missing {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n}\n\n.notice {\n padding: var(--panneau-space-2) var(--panneau-space-3);\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n background-color: var(--panneau-color-surface-sunken);\n border: var(--panneau-border-width) dashed var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-md);\n}\n\n.label {\n font-weight: var(--panneau-font-weight-medium);\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"MissingField.module.js","names":[],"sources":["../../src/missing/MissingField.module.css"],"sourcesContent":[".missing {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n}\n\n.notice {\n padding: var(--panneau-space-2) var(--panneau-space-3);\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n background-color: var(--panneau-color-surface-sunken);\n border: var(--panneau-border-width) dashed var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-md);\n margin: 0;\n}\n\n.label {\n font-weight: var(--panneau-font-weight-medium);\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { FieldEntryProps, FieldProps } from '../shared/types';
|
|
2
|
+
import type { FieldEntryProps, FieldProps } from '../shared/types.js';
|
|
3
3
|
export interface NumberFieldProps extends FieldProps<number> {
|
|
4
4
|
placeholder?: string;
|
|
5
5
|
min?: number;
|