@conduction/nextcloud-vue 2.181.1 → 2.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
  2. package/dist/esm/components/CnMapWidget/CnMapWidget2.vue.js +43 -11
  3. package/dist/esm/components/CnMapWidget/CnMapWidget2.vue.js.map +1 -1
  4. package/dist/esm/components/CnMapWidget/CnMapWidget3.vue.js.map +1 -1
  5. package/dist/esm/components/CnMapWidget/basemapPresets.js +81 -0
  6. package/dist/esm/components/CnMapWidget/basemapPresets.js.map +1 -0
  7. package/dist/esm/components/CnMapWidget/spatialFilter.js +136 -0
  8. package/dist/esm/components/CnMapWidget/spatialFilter.js.map +1 -0
  9. package/dist/esm/components/CnMapWidgetForm/CnMapWidgetForm.vue.js +1 -1
  10. package/dist/esm/components/CnMapWidgetForm/CnMapWidgetForm2.vue.js +37 -12
  11. package/dist/esm/components/CnMapWidgetForm/CnMapWidgetForm2.vue.js.map +1 -1
  12. package/dist/esm/components/CnMapWidgetForm/CnMapWidgetForm3.vue.js +27 -9
  13. package/dist/esm/components/CnMapWidgetForm/CnMapWidgetForm3.vue.js.map +1 -1
  14. package/dist/esm/l10n/nl.json.js +5 -1
  15. package/dist/esm/l10n/nl.json.js.map +1 -1
  16. package/dist/esm/library-style.js +1 -1
  17. package/dist/esm/nextcloud-vue.css +23 -23
  18. package/dist/esm/utils/geo.js +49 -10
  19. package/dist/esm/utils/geo.js.map +1 -1
  20. package/dist/nextcloud-vue.cjs.js +369 -43
  21. package/dist/nextcloud-vue.cjs.js.map +2 -2
  22. package/dist/nextcloud-vue.css +23 -23
  23. package/l10n/nl.json +5 -1
  24. package/package.json +1 -1
  25. package/src/components/CnMapWidget/CnMapWidget.vue +48 -11
  26. package/src/components/CnMapWidget/basemapPresets.js +78 -0
  27. package/src/components/CnMapWidget/spatialFilter.js +132 -0
  28. package/src/components/CnMapWidgetForm/CnMapWidgetForm.vue +53 -13
  29. package/src/utils/geo.js +48 -9
@@ -0,0 +1,136 @@
1
+ import { prefixUrl } from '../../utils/headers.js';
2
+ import { safeHref } from '../../utils/safeHref.js';
3
+
4
+ /**
5
+ * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
6
+ * SPDX-License-Identifier: EUPL-1.2
7
+ *
8
+ * Spatial filters and detail links for a map that plots OpenRegister objects.
9
+ *
10
+ * `markers.dataSource.spatialFilter` narrows the objects to an area, through
11
+ * OpenRegister's geo filters:
12
+ * - `{ bbox: [west, south, east, north] }` → `GET ?geo.bbox=w,s,e,n`
13
+ * - `{ near: [lon, lat], radius: meters }` → `GET ?geo.near=lon,lat&geo.radius=m`
14
+ * - `{ within: <GeoJSON Polygon|MultiPolygon> }` → `POST …/geo-search`
15
+ * The map's `markers.geoProperty`, when set, is sent as `geo.property` so the
16
+ * filter reads the same property the map draws.
17
+ *
18
+ * `markers.detailLink` is the address a clicked feature opens in a new tab: a
19
+ * template whose `{id}`, `{register}`, `{schema}` and `{<property>}` tokens are
20
+ * filled from the object. Without a template, a `url` the object carries (the
21
+ * address OpenRegister's deep-link registry stamps) is opened instead. An
22
+ * app-absolute path gets the instance's webroot.
23
+ */
24
+
25
+
26
+ const POLYGON_TYPES = ['Polygon', 'MultiPolygon'];
27
+
28
+ /**
29
+ * Whether every entry is a finite number and there are `length` of them.
30
+ *
31
+ * @param {unknown} list The value.
32
+ * @param {number} length The expected length.
33
+ * @return {boolean}
34
+ */
35
+ function isNumberTuple(list, length) {
36
+ return Array.isArray(list) && list.length === length && list.every((n) => Number.isFinite(Number(n)) && n !== '' && n !== null)
37
+ }
38
+
39
+ /**
40
+ * The OpenRegister request a spatial filter makes, or null when there is no
41
+ * usable filter. A malformed filter is ignored rather than sent, so a typo in
42
+ * a widget's config never empties the map with a 422.
43
+ *
44
+ * @param {object|null|undefined} spatialFilter The `dataSource.spatialFilter` block.
45
+ * @param {string} [geoProperty] The property the map draws, sent as `geo.property`.
46
+ * @return {{params: object}|{body: object}|null} Query params for the listing, or a geo-search body.
47
+ * @spec openspec/changes/map-spatial-filter-and-detail-link/specs/map-spatial-filter-and-detail-link/spec.md#requirement-a-map-can-narrow-its-objects-to-an-area
48
+ */
49
+ function spatialFilterRequest(spatialFilter, geoProperty) {
50
+ if (!spatialFilter || typeof spatialFilter !== 'object') {
51
+ return null
52
+ }
53
+ const property = typeof geoProperty === 'string' && geoProperty !== '' ? { 'geo.property': geoProperty } : {};
54
+
55
+ const within = spatialFilter.within;
56
+ if (within && typeof within === 'object' && POLYGON_TYPES.includes(within.type) && Array.isArray(within.coordinates)) {
57
+ const body = { geometry: { within } };
58
+ if (property['geo.property']) {
59
+ body.property = property['geo.property'];
60
+ }
61
+ return { body }
62
+ }
63
+ if (isNumberTuple(spatialFilter.bbox, 4)) {
64
+ return { params: { 'geo.bbox': spatialFilter.bbox.map(Number).join(','), ...property } }
65
+ }
66
+ if (isNumberTuple(spatialFilter.near, 2) && Number(spatialFilter.radius) > 0) {
67
+ return {
68
+ params: {
69
+ 'geo.near': spatialFilter.near.map(Number).join(','),
70
+ 'geo.radius': String(Number(spatialFilter.radius)),
71
+ ...property,
72
+ },
73
+ }
74
+ }
75
+ return null
76
+ }
77
+
78
+ /**
79
+ * The value a detail-link token reads from an object.
80
+ *
81
+ * @param {object} object The feature's properties (the OpenRegister object).
82
+ * @param {string} token The token name.
83
+ * @return {unknown}
84
+ */
85
+ function tokenValue(object, token) {
86
+ const self = object['@self'] && typeof object['@self'] === 'object' ? object['@self'] : {};
87
+ if (token === 'id') {
88
+ return self.id ?? object.id ?? object.uuid
89
+ }
90
+ if (token === 'register' || token === 'schema') {
91
+ return self[token] ?? object[token]
92
+ }
93
+ return object[token]
94
+ }
95
+
96
+ /**
97
+ * The address a clicked feature opens, or null when it has none. A template
98
+ * with a token the object cannot fill gives null, so a click never opens a
99
+ * half-built address.
100
+ *
101
+ * @param {object|null} feature The clicked GeoJSON feature.
102
+ * @param {string} [template] The `markers.detailLink` template.
103
+ * @return {string|null} A safe href, or null.
104
+ * @spec openspec/changes/map-spatial-filter-and-detail-link/specs/map-spatial-filter-and-detail-link/spec.md#requirement-a-clicked-object-opens-its-detail-page
105
+ */
106
+ function featureDetailUrl(feature, template) {
107
+ const object = feature && feature.properties && typeof feature.properties === 'object' ? feature.properties : null;
108
+ if (object === null) {
109
+ return null
110
+ }
111
+ let href = null;
112
+ if (typeof template === 'string' && template !== '') {
113
+ let missing = false;
114
+ href = template.replace(/\{([\w@.-]+)\}/g, (_match, token) => {
115
+ const value = tokenValue(object, token);
116
+ if (value === undefined || value === null || value === '' || typeof value === 'object') {
117
+ missing = true;
118
+ return ''
119
+ }
120
+ return encodeURIComponent(String(value))
121
+ });
122
+ if (missing) {
123
+ return null
124
+ }
125
+ } else if (typeof object.url === 'string' && object.url !== '') {
126
+ href = object.url;
127
+ }
128
+ if (href === null) {
129
+ return null
130
+ }
131
+ const safe = safeHref(href);
132
+ return safe === '#' ? null : prefixUrl(safe)
133
+ }
134
+
135
+ export { featureDetailUrl, spatialFilterRequest };
136
+ //# sourceMappingURL=spatialFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatialFilter.js","sources":["../../../../src/components/CnMapWidget/spatialFilter.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Spatial filters and detail links for a map that plots OpenRegister objects.\n *\n * `markers.dataSource.spatialFilter` narrows the objects to an area, through\n * OpenRegister's geo filters:\n * - `{ bbox: [west, south, east, north] }` → `GET ?geo.bbox=w,s,e,n`\n * - `{ near: [lon, lat], radius: meters }` → `GET ?geo.near=lon,lat&geo.radius=m`\n * - `{ within: <GeoJSON Polygon|MultiPolygon> }` → `POST …/geo-search`\n * The map's `markers.geoProperty`, when set, is sent as `geo.property` so the\n * filter reads the same property the map draws.\n *\n * `markers.detailLink` is the address a clicked feature opens in a new tab: a\n * template whose `{id}`, `{register}`, `{schema}` and `{<property>}` tokens are\n * filled from the object. Without a template, a `url` the object carries (the\n * address OpenRegister's deep-link registry stamps) is opened instead. An\n * app-absolute path gets the instance's webroot.\n */\n\nimport { prefixUrl } from '../../utils/headers.js'\nimport { safeHref } from '../../utils/safeHref.js'\n\nconst POLYGON_TYPES = ['Polygon', 'MultiPolygon']\n\n/**\n * Whether every entry is a finite number and there are `length` of them.\n *\n * @param {unknown} list The value.\n * @param {number} length The expected length.\n * @return {boolean}\n */\nfunction isNumberTuple(list, length) {\n\treturn Array.isArray(list) && list.length === length && list.every((n) => Number.isFinite(Number(n)) && n !== '' && n !== null)\n}\n\n/**\n * The OpenRegister request a spatial filter makes, or null when there is no\n * usable filter. A malformed filter is ignored rather than sent, so a typo in\n * a widget's config never empties the map with a 422.\n *\n * @param {object|null|undefined} spatialFilter The `dataSource.spatialFilter` block.\n * @param {string} [geoProperty] The property the map draws, sent as `geo.property`.\n * @return {{params: object}|{body: object}|null} Query params for the listing, or a geo-search body.\n * @spec openspec/changes/map-spatial-filter-and-detail-link/specs/map-spatial-filter-and-detail-link/spec.md#requirement-a-map-can-narrow-its-objects-to-an-area\n */\nexport function spatialFilterRequest(spatialFilter, geoProperty) {\n\tif (!spatialFilter || typeof spatialFilter !== 'object') {\n\t\treturn null\n\t}\n\tconst property = typeof geoProperty === 'string' && geoProperty !== '' ? { 'geo.property': geoProperty } : {}\n\n\tconst within = spatialFilter.within\n\tif (within && typeof within === 'object' && POLYGON_TYPES.includes(within.type) && Array.isArray(within.coordinates)) {\n\t\tconst body = { geometry: { within } }\n\t\tif (property['geo.property']) {\n\t\t\tbody.property = property['geo.property']\n\t\t}\n\t\treturn { body }\n\t}\n\tif (isNumberTuple(spatialFilter.bbox, 4)) {\n\t\treturn { params: { 'geo.bbox': spatialFilter.bbox.map(Number).join(','), ...property } }\n\t}\n\tif (isNumberTuple(spatialFilter.near, 2) && Number(spatialFilter.radius) > 0) {\n\t\treturn {\n\t\t\tparams: {\n\t\t\t\t'geo.near': spatialFilter.near.map(Number).join(','),\n\t\t\t\t'geo.radius': String(Number(spatialFilter.radius)),\n\t\t\t\t...property,\n\t\t\t},\n\t\t}\n\t}\n\treturn null\n}\n\n/**\n * The value a detail-link token reads from an object.\n *\n * @param {object} object The feature's properties (the OpenRegister object).\n * @param {string} token The token name.\n * @return {unknown}\n */\nfunction tokenValue(object, token) {\n\tconst self = object['@self'] && typeof object['@self'] === 'object' ? object['@self'] : {}\n\tif (token === 'id') {\n\t\treturn self.id ?? object.id ?? object.uuid\n\t}\n\tif (token === 'register' || token === 'schema') {\n\t\treturn self[token] ?? object[token]\n\t}\n\treturn object[token]\n}\n\n/**\n * The address a clicked feature opens, or null when it has none. A template\n * with a token the object cannot fill gives null, so a click never opens a\n * half-built address.\n *\n * @param {object|null} feature The clicked GeoJSON feature.\n * @param {string} [template] The `markers.detailLink` template.\n * @return {string|null} A safe href, or null.\n * @spec openspec/changes/map-spatial-filter-and-detail-link/specs/map-spatial-filter-and-detail-link/spec.md#requirement-a-clicked-object-opens-its-detail-page\n */\nexport function featureDetailUrl(feature, template) {\n\tconst object = feature && feature.properties && typeof feature.properties === 'object' ? feature.properties : null\n\tif (object === null) {\n\t\treturn null\n\t}\n\tlet href = null\n\tif (typeof template === 'string' && template !== '') {\n\t\tlet missing = false\n\t\thref = template.replace(/\\{([\\w@.-]+)\\}/g, (_match, token) => {\n\t\t\tconst value = tokenValue(object, token)\n\t\t\tif (value === undefined || value === null || value === '' || typeof value === 'object') {\n\t\t\t\tmissing = true\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn encodeURIComponent(String(value))\n\t\t})\n\t\tif (missing) {\n\t\t\treturn null\n\t\t}\n\t} else if (typeof object.url === 'string' && object.url !== '') {\n\t\thref = object.url\n\t}\n\tif (href === null) {\n\t\treturn null\n\t}\n\tconst safe = safeHref(href)\n\treturn safe === '#' ? null : prefixUrl(safe)\n}\n"],"names":[],"mappings":";;;AAAA;AACA;AACA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-2,7 +2,7 @@ import script from './CnMapWidgetForm2.vue.js';
2
2
  import { render } from './CnMapWidgetForm3.vue.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-ab71a77e";
5
+ script.__scopeId = "data-v-5ee2234a";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,7 +1,8 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
- import { NcCheckboxRadioSwitch, NcTextField } from '@nextcloud/vue';
2
+ import { NcSelect, NcCheckboxRadioSwitch, NcTextField } from '@nextcloud/vue';
3
3
  import __sfc_main from '../CnFieldPicker/CnFieldPicker.vue.js';
4
4
  import __sfc_main$1 from '../CnRegisterSchemaSelect/CnRegisterSchemaSelect.vue.js';
5
+ import { basemapFromPreset, presetOf, BASEMAP_PRESETS } from '../CnMapWidget/basemapPresets.js';
5
6
 
6
7
  // The Netherlands, roughly — a sane default centre for a Dutch-government library.
7
8
  // autoFit is on by default, so this only shows before any object is plotted.
@@ -9,14 +10,7 @@ const DEFAULT_CENTRE = [52.13, 5.29];
9
10
 
10
11
  // Without a basemap the widget renders a grey box: CnMapWidget's `basemaps` prop is
11
12
  // opt-in and empty by default. The Nextcloud CSP already allows *.tile.openstreetmap.org.
12
- const DEFAULT_BASEMAPS = [
13
- {
14
- name: 'OpenStreetMap',
15
- url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
16
- attribution: '© OpenStreetMap contributors',
17
- options: { maxZoom: 19 },
18
- },
19
- ];
13
+ const DEFAULT_BASEMAPS = [basemapFromPreset('osm')];
20
14
 
21
15
  const DEFAULT_CONTENT = {
22
16
  register: '',
@@ -42,7 +36,7 @@ const DEFAULT_CONTENT = {
42
36
  var script = {
43
37
  name: 'CnMapWidgetForm',
44
38
 
45
- components: { NcTextField, NcCheckboxRadioSwitch, CnRegisterSchemaSelect: __sfc_main$1, CnFieldPicker: __sfc_main },
39
+ components: { NcTextField, NcCheckboxRadioSwitch, NcSelect, CnRegisterSchemaSelect: __sfc_main$1, CnFieldPicker: __sfc_main },
46
40
 
47
41
  props: {
48
42
  /**
@@ -92,11 +86,12 @@ var script = {
92
86
  zoom: Number.isFinite(initial.zoom) ? initial.zoom : 7,
93
87
  height: initial.height || '400px',
94
88
  popupField: initial.popupField ?? '',
89
+ geoProperty: initial.markers?.geoProperty ?? '',
95
90
  clustering: initial.clustering === true,
96
91
  autoFit: initial.autoFit !== false,
97
92
  centerMarker: initial.markers?.centerMarker === true,
98
- // Preserved verbatim: the form does not expose a basemap picker, and dropping
99
- // it on save would turn the user's map into a grey box.
93
+ // Preserved verbatim unless a preset is chosen: dropping it on save would
94
+ // turn the user's map into a grey box, and a custom base map has no preset.
100
95
  basemaps: Array.isArray(initial.basemaps) && initial.basemaps.length
101
96
  ? initial.basemaps
102
97
  : DEFAULT_BASEMAPS,
@@ -104,6 +99,21 @@ var script = {
104
99
  },
105
100
 
106
101
  computed: {
102
+ /** The base map choices: the presets, plus the stored one when it is custom. */
103
+ basemapOptions() {
104
+ const presets = BASEMAP_PRESETS.map((preset) => ({ id: preset.id, label: preset.name }));
105
+ if (presetOf(this.basemaps[0]) === null) {
106
+ return [{ id: 'custom', label: this.basemaps[0]?.name || translate('nextcloud-vue', 'Custom base map') }, ...presets]
107
+ }
108
+ return presets
109
+ },
110
+
111
+ /** The option of the first stored base map. */
112
+ basemapOption() {
113
+ const id = presetOf(this.basemaps[0]) ?? 'custom';
114
+ return this.basemapOptions.find((option) => option.id === id) ?? null
115
+ },
116
+
107
117
  /** The assembled content blob from the current field values. */
108
118
  assembledContent() {
109
119
  return {
@@ -121,6 +131,7 @@ var script = {
121
131
  markers: {
122
132
  dataSource: { register: this.source.register, schema: this.source.schema },
123
133
  popupField: this.popupField,
134
+ ...(this.geoProperty ? { geoProperty: this.geoProperty } : {}),
124
135
  clustering: this.clustering,
125
136
  centerMarker: this.centerMarker,
126
137
  },
@@ -154,6 +165,20 @@ var script = {
154
165
  if (key === 'register') {
155
166
  this.source.schema = '';
156
167
  this.popupField = '';
168
+ this.geoProperty = '';
169
+ }
170
+ },
171
+
172
+ /**
173
+ * Store the chosen preset as the base map. Choosing the custom entry keeps
174
+ * the stored base maps as they are.
175
+ *
176
+ * @param {{id: string}|null} option The chosen option.
177
+ */
178
+ onBasemap(option) {
179
+ const basemap = option && basemapFromPreset(option.id);
180
+ if (basemap) {
181
+ this.basemaps = [basemap];
157
182
  }
158
183
  },
159
184
 
@@ -1 +1 @@
1
- {"version":3,"file":"CnMapWidgetForm2.vue.js","sources":["../../../../src/components/CnMapWidgetForm/CnMapWidgetForm.vue"],"sourcesContent":["<!--\n CnMapWidgetForm — configuration form for the `map` dashboard widget.\n\n Picks an OpenRegister register/schema and plots its objects on a Leaflet map,\n reading each object's location from `@self.geo` (what CnObjectGeoWidget writes).\n Everything else — centre, zoom, height, popup field, clustering — is presentation.\n\n Used by both `CnAddWidgetModal` and the cog `CnWidgetStyleEditorModal`.\n-->\n<template>\n\t<div class=\"cn-map-widget-form\">\n\t\t<CnRegisterSchemaSelect\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t@update:register=\"updateSource('register', $event)\"\n\t\t\t@update:schema=\"updateSource('schema', $event)\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"popupField\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Popup field')\"\n\t\t\t@input=\"popupField = $event\" />\n\n\t\t<p v-if=\"source.register && source.schema\" class=\"cn-map-widget-form__hint\">\n\t\t\t{{ t('nextcloud-vue', 'Objects are plotted from their location (@self.geo). Objects without one are skipped.') }}\n\t\t</p>\n\n\t\t<label class=\"cn-map-widget-form__field\">\n\t\t\t<span class=\"cn-map-widget-form__label\">\n\t\t\t\t{{ t('nextcloud-vue', 'Zoom') }} ({{ zoom }})\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\ttype=\"range\"\n\t\t\t\tmin=\"1\"\n\t\t\t\tmax=\"19\"\n\t\t\t\tstep=\"1\"\n\t\t\t\t:value=\"zoom\"\n\t\t\t\tclass=\"cn-map-widget-form__range\"\n\t\t\t\t@input=\"onZoom($event.target.value)\">\n\t\t</label>\n\n\t\t<NcTextField\n\t\t\t:modelValue=\"height\"\n\t\t\t:label=\"t('nextcloud-vue', 'Height')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\tplaceholder=\"400px\"\n\t\t\t@update:modelValue=\"height = $event\" />\n\n\t\t<div class=\"cn-map-widget-form__row\">\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[0])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre latitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(0, $event)\" />\n\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[1])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre longitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(1, $event)\" />\n\t\t</div>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"centerMarker\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Show a marker at the centre') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"autoFit\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Zoom to fit the plotted objects') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"clustering\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Group nearby objects into clusters') }}\n\t\t</NcCheckboxRadioSwitch>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcCheckboxRadioSwitch, NcTextField } from '@nextcloud/vue'\nimport CnFieldPicker from '../CnFieldPicker/CnFieldPicker.vue'\nimport CnRegisterSchemaSelect from '../CnRegisterSchemaSelect/CnRegisterSchemaSelect.vue'\n\n// The Netherlands, roughly — a sane default centre for a Dutch-government library.\n// autoFit is on by default, so this only shows before any object is plotted.\nconst DEFAULT_CENTRE = [52.13, 5.29]\n\n// Without a basemap the widget renders a grey box: CnMapWidget's `basemaps` prop is\n// opt-in and empty by default. The Nextcloud CSP already allows *.tile.openstreetmap.org.\nconst DEFAULT_BASEMAPS = [\n\t{\n\t\tname: 'OpenStreetMap',\n\t\turl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n\t\tattribution: '© OpenStreetMap contributors',\n\t\toptions: { maxZoom: 19 },\n\t},\n]\n\nconst DEFAULT_CONTENT = {\n\tregister: '',\n\tschema: '',\n\tcenter: DEFAULT_CENTRE,\n\tzoom: 7,\n\theight: '400px',\n\tpopupField: '',\n\tclustering: false,\n\tautoFit: true,\n\tbasemaps: DEFAULT_BASEMAPS,\n}\n\n/**\n * CnMapWidgetForm — configures the `map` dashboard widget.\n *\n * Emits `update:content` with the assembled content blob on every change.\n * `validate()` requires a register + schema: a map with no data source would render\n * an empty basemap, which looks broken rather than empty.\n *\n * @slot default No slots — the form is fully declarative.\n */\nexport default {\n\tname: 'CnMapWidgetForm',\n\n\tcomponents: { NcTextField, NcCheckboxRadioSwitch, CnRegisterSchemaSelect, CnFieldPicker },\n\n\tprops: {\n\t\t/**\n\t\t * The placement being edited (pre-fills every control from\n\t\t * `editingWidget.content`), or `null` in create mode.\n\t\t *\n\t\t * @type {{content: object}|null}\n\t\t */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Initial content values when not editing (registry defaults).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every field change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst centre = Array.isArray(initial.center) && initial.center.length === 2\n\t\t\t? initial.center\n\t\t\t: DEFAULT_CENTRE\n\t\treturn {\n\t\t\tsource: {\n\t\t\t\tregister: initial.register ?? '',\n\t\t\t\tschema: initial.schema ?? '',\n\t\t\t},\n\n\t\t\tcenter: [Number(centre[0]), Number(centre[1])],\n\t\t\tzoom: Number.isFinite(initial.zoom) ? initial.zoom : 7,\n\t\t\theight: initial.height || '400px',\n\t\t\tpopupField: initial.popupField ?? '',\n\t\t\tclustering: initial.clustering === true,\n\t\t\tautoFit: initial.autoFit !== false,\n\t\t\tcenterMarker: initial.markers?.centerMarker === true,\n\t\t\t// Preserved verbatim: the form does not expose a basemap picker, and dropping\n\t\t\t// it on save would turn the user's map into a grey box.\n\t\t\tbasemaps: Array.isArray(initial.basemaps) && initial.basemaps.length\n\t\t\t\t? initial.basemaps\n\t\t\t\t: DEFAULT_BASEMAPS,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The assembled content blob from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tregister: this.source.register,\n\t\t\t\tschema: this.source.schema,\n\t\t\t\tcenter: this.center,\n\t\t\t\tzoom: this.zoom,\n\t\t\t\theight: this.height,\n\t\t\t\tpopupField: this.popupField,\n\t\t\t\tclustering: this.clustering,\n\t\t\t\tautoFit: this.autoFit,\n\t\t\t\tbasemaps: this.basemaps,\n\t\t\t\t// CnMapWidget reads its markers from here; `dataSource.{register, schema}`\n\t\t\t\t// is the shape its resolver understands.\n\t\t\t\tmarkers: {\n\t\t\t\t\tdataSource: { register: this.source.register, schema: this.source.schema },\n\t\t\t\t\tpopupField: this.popupField,\n\t\t\t\t\tclustering: this.clustering,\n\t\t\t\t\tcenterMarker: this.centerMarker,\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tassembledContent: {\n\t\t\thandler(content) {\n\t\t\t\tthis.$emit('update:content', content)\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Update one half of the data source. Changing the register invalidates the\n\t\t * schema and the popup field, which belonged to the old schema.\n\t\t *\n\t\t * @param {'register'|'schema'} key Which half changed.\n\t\t * @param {string} value The new value.\n\t\t */\n\t\tupdateSource(key, value) {\n\t\t\tthis.source[key] = value\n\t\t\tif (key === 'register') {\n\t\t\t\tthis.source.schema = ''\n\t\t\t\tthis.popupField = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Zoom is an integer clamped to the slider range; guards against a\n\t\t * non-numeric value or one outside the slider's `[1, 19]` range.\n\t\t *\n\t\t * @param {string} value The raw slider value.\n\t\t */\n\t\tonZoom(value) {\n\t\t\tconst n = Math.round(Number(value))\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\tthis.zoom = 7\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.zoom = Math.min(19, Math.max(1, n))\n\t\t},\n\n\t\t/**\n\t\t * Update one coordinate of the centre, ignoring non-numeric input.\n\t\t *\n\t\t * @param {number} index 0 for latitude, 1 for longitude.\n\t\t * @param {string} value The raw input value.\n\t\t */\n\t\tonCentre(index, value) {\n\t\t\tconst n = Number(value)\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.center[index] = n\n\t\t},\n\n\t\t/**\n\t\t * A map with no data source renders an empty basemap, which reads as broken\n\t\t * rather than empty — so require one.\n\t\t *\n\t\t * @return {boolean} Whether the form is valid.\n\t\t */\n\t\tvalidate() {\n\t\t\treturn Boolean(this.source.register && this.source.schema)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-map-widget-form__row {\n\tdisplay: flex;\n\tgap: 8px;\n}\n\n.cn-map-widget-form__row > * {\n\tflex: 1;\n\tmin-width: 0;\n}\n\n.cn-map-widget-form__hint {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 90%;\n\tmargin: 0;\n}\n\n.cn-map-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-map-widget-form__range {\n\twidth: 100%;\n\t/* Native range inputs ship a default 2px margin on ALL sides. The left/right\n\t 2px pushes the width:100% track past the form and shows a phantom\n\t horizontal scrollbar; zeroing it also drops the top/bottom 2px, which was\n\t padding the form's height. */\n\tmargin: 0;\n}\n</style>\n"],"names":["CnRegisterSchemaSelect","CnFieldPicker","t"],"mappings":";;;;;AAsFA;AACA;AACA,MAAM,cAAa,GAAI,CAAC,KAAK,EAAE,IAAI;;AAEnC;AACA;AACA,MAAM,mBAAmB;AACxB,CAAA;AACC,EAAA,IAAI,EAAE,eAAe;EACrB,GAAG,EAAE,oDAAoD;AACzD,EAAA,WAAW,EAAE,8BAA8B;AAC3C,EAAA,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI;EACxB;AACF;;AAEA,MAAM,kBAAkB;CACvB,QAAQ,EAAE,EAAE;AACZ,CAAA,MAAM,EAAE,EAAE;AACV,CAAA,MAAM,EAAE,cAAc;AACtB,CAAA,IAAI,EAAE,CAAC;AACP,CAAA,MAAM,EAAE,OAAO;CACf,UAAU,EAAE,EAAE;AACd,CAAA,UAAU,EAAE,KAAK;CACjB,OAAO,EAAE,IAAI;CACb,QAAQ,EAAE,gBAAgB;AAC3B;;AAEA;;AAEC;AACA;AACA;;AAEA;;;AAGD,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,WAAW,EAAE,qBAAqB,0BAAEA,YAAsB,iBAAEC,YAAe;;AAEzF,CAAA,KAAK,EAAE;AACN;;;AAGC;;;AAGD,EAAA,aAAa,EAAE;GACd,IAAI,EA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;AACnB,GAAA,IAAI,GAAE,KAAM,UAAU,EAAE;AACvB,IAAA,IAAI,CAAC,MAAM,CAAC,MAAK,GAAI;AACrB,IAAA,IAAI,CAAC,UAAS,GAAI;AACnB,GAAA;EACD,CAAC;;AAED;;;AAGC;AACA;;EAED,MAAM,CAAC,KAAK,EAAE;AACb,GAAA,MAAM,CAAA,GAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;GAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;IACxB,IAAI,CAAC,OAAO;IACZ;AACD,GAAA;AACA,GAAA,IAAI,CAAC,IAAG,GAAI,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;EACxC,CAAC;;AAED;;AAEC;;AAEA;;AAED,EAAA,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE;AACtB,GAAA,MAAM,CAAA,GAAI,MAAM,CAAC,KAAK;GACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;IACxB;AACD,GAAA;AACA,GAAA,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI;EACtB,CAAC;;AAED;;;AAGC;AACA;;EAED,QAAQ,GAAG;GACV,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAO,IAAK,IAAI,CAAC,MAAM,CAAC,MAAM;EAC1D,CAAC;EACD;AACF;;"}
1
+ {"version":3,"file":"CnMapWidgetForm2.vue.js","sources":["../../../../src/components/CnMapWidgetForm/CnMapWidgetForm.vue"],"sourcesContent":["<!--\n CnMapWidgetForm — configuration form for the `map` dashboard widget.\n\n Picks an OpenRegister register/schema and plots its objects on a Leaflet map,\n reading each object's location from `@self.geo` (what CnObjectGeoWidget writes).\n Everything else — centre, zoom, height, popup field, clustering — is presentation.\n\n Used by both `CnAddWidgetModal` and the cog `CnWidgetStyleEditorModal`.\n-->\n<template>\n\t<div class=\"cn-map-widget-form\">\n\t\t<CnRegisterSchemaSelect\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t@update:register=\"updateSource('register', $event)\"\n\t\t\t@update:schema=\"updateSource('schema', $event)\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"popupField\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Popup field')\"\n\t\t\t@input=\"popupField = $event\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"geoProperty\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Location field')\"\n\t\t\t@input=\"geoProperty = $event\" />\n\n\t\t<p v-if=\"source.register && source.schema\" class=\"cn-map-widget-form__hint\">\n\t\t\t{{ t('nextcloud-vue', 'Objects are plotted from the location field: a point, line or area. Without one, from their location (@self.geo). Objects without a location are skipped.') }}\n\t\t</p>\n\n\t\t<NcSelect\n\t\t\t:modelValue=\"basemapOption\"\n\t\t\t:options=\"basemapOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Base map')\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"onBasemap($event)\" />\n\n\t\t<label class=\"cn-map-widget-form__field\">\n\t\t\t<span class=\"cn-map-widget-form__label\">\n\t\t\t\t{{ t('nextcloud-vue', 'Zoom') }} ({{ zoom }})\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\ttype=\"range\"\n\t\t\t\tmin=\"1\"\n\t\t\t\tmax=\"19\"\n\t\t\t\tstep=\"1\"\n\t\t\t\t:value=\"zoom\"\n\t\t\t\tclass=\"cn-map-widget-form__range\"\n\t\t\t\t@input=\"onZoom($event.target.value)\">\n\t\t</label>\n\n\t\t<NcTextField\n\t\t\t:modelValue=\"height\"\n\t\t\t:label=\"t('nextcloud-vue', 'Height')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\tplaceholder=\"400px\"\n\t\t\t@update:modelValue=\"height = $event\" />\n\n\t\t<div class=\"cn-map-widget-form__row\">\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[0])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre latitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(0, $event)\" />\n\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[1])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre longitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(1, $event)\" />\n\t\t</div>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"centerMarker\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Show a marker at the centre') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"autoFit\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Zoom to fit the plotted objects') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"clustering\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Group nearby objects into clusters') }}\n\t\t</NcCheckboxRadioSwitch>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcCheckboxRadioSwitch, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CnFieldPicker from '../CnFieldPicker/CnFieldPicker.vue'\nimport CnRegisterSchemaSelect from '../CnRegisterSchemaSelect/CnRegisterSchemaSelect.vue'\nimport { BASEMAP_PRESETS, basemapFromPreset, presetOf } from '../CnMapWidget/basemapPresets.js'\n\n// The Netherlands, roughly — a sane default centre for a Dutch-government library.\n// autoFit is on by default, so this only shows before any object is plotted.\nconst DEFAULT_CENTRE = [52.13, 5.29]\n\n// Without a basemap the widget renders a grey box: CnMapWidget's `basemaps` prop is\n// opt-in and empty by default. The Nextcloud CSP already allows *.tile.openstreetmap.org.\nconst DEFAULT_BASEMAPS = [basemapFromPreset('osm')]\n\nconst DEFAULT_CONTENT = {\n\tregister: '',\n\tschema: '',\n\tcenter: DEFAULT_CENTRE,\n\tzoom: 7,\n\theight: '400px',\n\tpopupField: '',\n\tclustering: false,\n\tautoFit: true,\n\tbasemaps: DEFAULT_BASEMAPS,\n}\n\n/**\n * CnMapWidgetForm — configures the `map` dashboard widget.\n *\n * Emits `update:content` with the assembled content blob on every change.\n * `validate()` requires a register + schema: a map with no data source would render\n * an empty basemap, which looks broken rather than empty.\n *\n * @slot default No slots — the form is fully declarative.\n */\nexport default {\n\tname: 'CnMapWidgetForm',\n\n\tcomponents: { NcTextField, NcCheckboxRadioSwitch, NcSelect, CnRegisterSchemaSelect, CnFieldPicker },\n\n\tprops: {\n\t\t/**\n\t\t * The placement being edited (pre-fills every control from\n\t\t * `editingWidget.content`), or `null` in create mode.\n\t\t *\n\t\t * @type {{content: object}|null}\n\t\t */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Initial content values when not editing (registry defaults).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every field change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst centre = Array.isArray(initial.center) && initial.center.length === 2\n\t\t\t? initial.center\n\t\t\t: DEFAULT_CENTRE\n\t\treturn {\n\t\t\tsource: {\n\t\t\t\tregister: initial.register ?? '',\n\t\t\t\tschema: initial.schema ?? '',\n\t\t\t},\n\n\t\t\tcenter: [Number(centre[0]), Number(centre[1])],\n\t\t\tzoom: Number.isFinite(initial.zoom) ? initial.zoom : 7,\n\t\t\theight: initial.height || '400px',\n\t\t\tpopupField: initial.popupField ?? '',\n\t\t\tgeoProperty: initial.markers?.geoProperty ?? '',\n\t\t\tclustering: initial.clustering === true,\n\t\t\tautoFit: initial.autoFit !== false,\n\t\t\tcenterMarker: initial.markers?.centerMarker === true,\n\t\t\t// Preserved verbatim unless a preset is chosen: dropping it on save would\n\t\t\t// turn the user's map into a grey box, and a custom base map has no preset.\n\t\t\tbasemaps: Array.isArray(initial.basemaps) && initial.basemaps.length\n\t\t\t\t? initial.basemaps\n\t\t\t\t: DEFAULT_BASEMAPS,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The base map choices: the presets, plus the stored one when it is custom. */\n\t\tbasemapOptions() {\n\t\t\tconst presets = BASEMAP_PRESETS.map((preset) => ({ id: preset.id, label: preset.name }))\n\t\t\tif (presetOf(this.basemaps[0]) === null) {\n\t\t\t\treturn [{ id: 'custom', label: this.basemaps[0]?.name || t('nextcloud-vue', 'Custom base map') }, ...presets]\n\t\t\t}\n\t\t\treturn presets\n\t\t},\n\n\t\t/** The option of the first stored base map. */\n\t\tbasemapOption() {\n\t\t\tconst id = presetOf(this.basemaps[0]) ?? 'custom'\n\t\t\treturn this.basemapOptions.find((option) => option.id === id) ?? null\n\t\t},\n\n\t\t/** The assembled content blob from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tregister: this.source.register,\n\t\t\t\tschema: this.source.schema,\n\t\t\t\tcenter: this.center,\n\t\t\t\tzoom: this.zoom,\n\t\t\t\theight: this.height,\n\t\t\t\tpopupField: this.popupField,\n\t\t\t\tclustering: this.clustering,\n\t\t\t\tautoFit: this.autoFit,\n\t\t\t\tbasemaps: this.basemaps,\n\t\t\t\t// CnMapWidget reads its markers from here; `dataSource.{register, schema}`\n\t\t\t\t// is the shape its resolver understands.\n\t\t\t\tmarkers: {\n\t\t\t\t\tdataSource: { register: this.source.register, schema: this.source.schema },\n\t\t\t\t\tpopupField: this.popupField,\n\t\t\t\t\t...(this.geoProperty ? { geoProperty: this.geoProperty } : {}),\n\t\t\t\t\tclustering: this.clustering,\n\t\t\t\t\tcenterMarker: this.centerMarker,\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tassembledContent: {\n\t\t\thandler(content) {\n\t\t\t\tthis.$emit('update:content', content)\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Update one half of the data source. Changing the register invalidates the\n\t\t * schema and the popup field, which belonged to the old schema.\n\t\t *\n\t\t * @param {'register'|'schema'} key Which half changed.\n\t\t * @param {string} value The new value.\n\t\t */\n\t\tupdateSource(key, value) {\n\t\t\tthis.source[key] = value\n\t\t\tif (key === 'register') {\n\t\t\t\tthis.source.schema = ''\n\t\t\t\tthis.popupField = ''\n\t\t\t\tthis.geoProperty = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Store the chosen preset as the base map. Choosing the custom entry keeps\n\t\t * the stored base maps as they are.\n\t\t *\n\t\t * @param {{id: string}|null} option The chosen option.\n\t\t */\n\t\tonBasemap(option) {\n\t\t\tconst basemap = option && basemapFromPreset(option.id)\n\t\t\tif (basemap) {\n\t\t\t\tthis.basemaps = [basemap]\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Zoom is an integer clamped to the slider range; guards against a\n\t\t * non-numeric value or one outside the slider's `[1, 19]` range.\n\t\t *\n\t\t * @param {string} value The raw slider value.\n\t\t */\n\t\tonZoom(value) {\n\t\t\tconst n = Math.round(Number(value))\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\tthis.zoom = 7\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.zoom = Math.min(19, Math.max(1, n))\n\t\t},\n\n\t\t/**\n\t\t * Update one coordinate of the centre, ignoring non-numeric input.\n\t\t *\n\t\t * @param {number} index 0 for latitude, 1 for longitude.\n\t\t * @param {string} value The raw input value.\n\t\t */\n\t\tonCentre(index, value) {\n\t\t\tconst n = Number(value)\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.center[index] = n\n\t\t},\n\n\t\t/**\n\t\t * A map with no data source renders an empty basemap, which reads as broken\n\t\t * rather than empty — so require one.\n\t\t *\n\t\t * @return {boolean} Whether the form is valid.\n\t\t */\n\t\tvalidate() {\n\t\t\treturn Boolean(this.source.register && this.source.schema)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-map-widget-form__row {\n\tdisplay: flex;\n\tgap: 8px;\n}\n\n.cn-map-widget-form__row > * {\n\tflex: 1;\n\tmin-width: 0;\n}\n\n.cn-map-widget-form__hint {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 90%;\n\tmargin: 0;\n}\n\n.cn-map-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-map-widget-form__range {\n\twidth: 100%;\n\t/* Native range inputs ship a default 2px margin on ALL sides. The left/right\n\t 2px pushes the width:100% track past the form and shows a phantom\n\t horizontal scrollbar; zeroing it also drops the top/bottom 2px, which was\n\t padding the form's height. */\n\tmargin: 0;\n}\n</style>\n"],"names":["CnRegisterSchemaSelect","CnFieldPicker","t"],"mappings":";;;;;;AAsGA;AACA;AACA,MAAM,cAAa,GAAI,CAAC,KAAK,EAAE,IAAI;;AAEnC;AACA;AACA,MAAM,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC;;AAElD,MAAM,kBAAkB;CACvB,QAAQ,EAAE,EAAE;AACZ,CAAA,MAAM,EAAE,EAAE;AACV,CAAA,MAAM,EAAE,cAAc;AACtB,CAAA,IAAI,EAAE,CAAC;AACP,CAAA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Block, createVNode, createBlo
2
2
 
3
3
  const _hoisted_1 = { class: "cn-map-widget-form" };
4
4
  const _hoisted_2 = {
5
- key: 1,
5
+ key: 2,
6
6
  class: "cn-map-widget-form__hint"
7
7
  };
8
8
  const _hoisted_3 = { class: "cn-map-widget-form__field" };
@@ -13,6 +13,7 @@ const _hoisted_6 = { class: "cn-map-widget-form__row" };
13
13
  function render(_ctx, _cache, $props, $setup, $data, $options) {
14
14
  const _component_CnRegisterSchemaSelect = resolveComponent("CnRegisterSchemaSelect");
15
15
  const _component_CnFieldPicker = resolveComponent("CnFieldPicker");
16
+ const _component_NcSelect = resolveComponent("NcSelect");
16
17
  const _component_NcTextField = resolveComponent("NcTextField");
17
18
  const _component_NcCheckboxRadioSwitch = resolveComponent("NcCheckboxRadioSwitch");
18
19
 
@@ -34,8 +35,25 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
34
35
  }, null, 8 /* PROPS */, ["value", "register", "schema", "label"]))
35
36
  : createCommentVNode("v-if", true),
36
37
  ($data.source.register && $data.source.schema)
37
- ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString($options.t('nextcloud-vue', 'Objects are plotted from their location (@self.geo). Objects without one are skipped.')), 1 /* TEXT */))
38
+ ? (openBlock(), createBlock(_component_CnFieldPicker, {
39
+ key: 1,
40
+ value: $data.geoProperty,
41
+ register: $data.source.register,
42
+ schema: $data.source.schema,
43
+ label: $options.t('nextcloud-vue', 'Location field'),
44
+ onInput: _cache[3] || (_cache[3] = $event => ($data.geoProperty = $event))
45
+ }, null, 8 /* PROPS */, ["value", "register", "schema", "label"]))
46
+ : createCommentVNode("v-if", true),
47
+ ($data.source.register && $data.source.schema)
48
+ ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString($options.t('nextcloud-vue', 'Objects are plotted from the location field: a point, line or area. Without one, from their location (@self.geo). Objects without a location are skipped.')), 1 /* TEXT */))
38
49
  : createCommentVNode("v-if", true),
50
+ createVNode(_component_NcSelect, {
51
+ modelValue: $options.basemapOption,
52
+ options: $options.basemapOptions,
53
+ inputLabel: $options.t('nextcloud-vue', 'Base map'),
54
+ clearable: false,
55
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ($options.onBasemap($event)))
56
+ }, null, 8 /* PROPS */, ["modelValue", "options", "inputLabel"]),
39
57
  createElementVNode("label", _hoisted_3, [
40
58
  createElementVNode("span", _hoisted_4, toDisplayString($options.t('nextcloud-vue', 'Zoom')) + " (" + toDisplayString($data.zoom) + ") ", 1 /* TEXT */),
41
59
  createElementVNode("input", {
@@ -45,7 +63,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
45
63
  step: "1",
46
64
  value: $data.zoom,
47
65
  class: "cn-map-widget-form__range",
48
- onInput: _cache[3] || (_cache[3] = $event => ($options.onZoom($event.target.value)))
66
+ onInput: _cache[5] || (_cache[5] = $event => ($options.onZoom($event.target.value)))
49
67
  }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_5)
50
68
  ]),
51
69
  createVNode(_component_NcTextField, {
@@ -53,7 +71,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
53
71
  label: $options.t('nextcloud-vue', 'Height'),
54
72
  labelVisible: true,
55
73
  placeholder: "400px",
56
- "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ($data.height = $event))
74
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ($data.height = $event))
57
75
  }, null, 8 /* PROPS */, ["modelValue", "label"]),
58
76
  createElementVNode("div", _hoisted_6, [
59
77
  createVNode(_component_NcTextField, {
@@ -61,19 +79,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
61
79
  type: "number",
62
80
  label: $options.t('nextcloud-vue', 'Centre latitude'),
63
81
  labelVisible: true,
64
- "onUpdate:modelValue": _cache[5] || (_cache[5] = $event => ($options.onCentre(0, $event)))
82
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => ($options.onCentre(0, $event)))
65
83
  }, null, 8 /* PROPS */, ["modelValue", "label"]),
66
84
  createVNode(_component_NcTextField, {
67
85
  modelValue: String($data.center[1]),
68
86
  type: "number",
69
87
  label: $options.t('nextcloud-vue', 'Centre longitude'),
70
88
  labelVisible: true,
71
- "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ($options.onCentre(1, $event)))
89
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => ($options.onCentre(1, $event)))
72
90
  }, null, 8 /* PROPS */, ["modelValue", "label"])
73
91
  ]),
74
92
  createVNode(_component_NcCheckboxRadioSwitch, {
75
93
  modelValue: $data.centerMarker,
76
- "onUpdate:modelValue": _cache[7] || (_cache[7] = $event => (($data.centerMarker) = $event)),
94
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = $event => (($data.centerMarker) = $event)),
77
95
  type: "switch"
78
96
  }, {
79
97
  default: withCtx(() => [
@@ -83,7 +101,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
83
101
  }, 8 /* PROPS */, ["modelValue"]),
84
102
  createVNode(_component_NcCheckboxRadioSwitch, {
85
103
  modelValue: $data.autoFit,
86
- "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => (($data.autoFit) = $event)),
104
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = $event => (($data.autoFit) = $event)),
87
105
  type: "switch"
88
106
  }, {
89
107
  default: withCtx(() => [
@@ -93,7 +111,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
93
111
  }, 8 /* PROPS */, ["modelValue"]),
94
112
  createVNode(_component_NcCheckboxRadioSwitch, {
95
113
  modelValue: $data.clustering,
96
- "onUpdate:modelValue": _cache[9] || (_cache[9] = $event => (($data.clustering) = $event)),
114
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = $event => (($data.clustering) = $event)),
97
115
  type: "switch"
98
116
  }, {
99
117
  default: withCtx(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"CnMapWidgetForm3.vue.js","sources":["../../../../src/components/CnMapWidgetForm/CnMapWidgetForm.vue?vue&type=template&id=ab71a77e&lang.js"],"sourcesContent":["<!--\n CnMapWidgetForm — configuration form for the `map` dashboard widget.\n\n Picks an OpenRegister register/schema and plots its objects on a Leaflet map,\n reading each object's location from `@self.geo` (what CnObjectGeoWidget writes).\n Everything else — centre, zoom, height, popup field, clustering — is presentation.\n\n Used by both `CnAddWidgetModal` and the cog `CnWidgetStyleEditorModal`.\n-->\n<template>\n\t<div class=\"cn-map-widget-form\">\n\t\t<CnRegisterSchemaSelect\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t@update:register=\"updateSource('register', $event)\"\n\t\t\t@update:schema=\"updateSource('schema', $event)\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"popupField\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Popup field')\"\n\t\t\t@input=\"popupField = $event\" />\n\n\t\t<p v-if=\"source.register && source.schema\" class=\"cn-map-widget-form__hint\">\n\t\t\t{{ t('nextcloud-vue', 'Objects are plotted from their location (@self.geo). Objects without one are skipped.') }}\n\t\t</p>\n\n\t\t<label class=\"cn-map-widget-form__field\">\n\t\t\t<span class=\"cn-map-widget-form__label\">\n\t\t\t\t{{ t('nextcloud-vue', 'Zoom') }} ({{ zoom }})\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\ttype=\"range\"\n\t\t\t\tmin=\"1\"\n\t\t\t\tmax=\"19\"\n\t\t\t\tstep=\"1\"\n\t\t\t\t:value=\"zoom\"\n\t\t\t\tclass=\"cn-map-widget-form__range\"\n\t\t\t\t@input=\"onZoom($event.target.value)\">\n\t\t</label>\n\n\t\t<NcTextField\n\t\t\t:modelValue=\"height\"\n\t\t\t:label=\"t('nextcloud-vue', 'Height')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\tplaceholder=\"400px\"\n\t\t\t@update:modelValue=\"height = $event\" />\n\n\t\t<div class=\"cn-map-widget-form__row\">\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[0])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre latitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(0, $event)\" />\n\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[1])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre longitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(1, $event)\" />\n\t\t</div>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"centerMarker\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Show a marker at the centre') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"autoFit\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Zoom to fit the plotted objects') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"clustering\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Group nearby objects into clusters') }}\n\t\t</NcCheckboxRadioSwitch>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcCheckboxRadioSwitch, NcTextField } from '@nextcloud/vue'\nimport CnFieldPicker from '../CnFieldPicker/CnFieldPicker.vue'\nimport CnRegisterSchemaSelect from '../CnRegisterSchemaSelect/CnRegisterSchemaSelect.vue'\n\n// The Netherlands, roughly — a sane default centre for a Dutch-government library.\n// autoFit is on by default, so this only shows before any object is plotted.\nconst DEFAULT_CENTRE = [52.13, 5.29]\n\n// Without a basemap the widget renders a grey box: CnMapWidget's `basemaps` prop is\n// opt-in and empty by default. The Nextcloud CSP already allows *.tile.openstreetmap.org.\nconst DEFAULT_BASEMAPS = [\n\t{\n\t\tname: 'OpenStreetMap',\n\t\turl: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n\t\tattribution: '© OpenStreetMap contributors',\n\t\toptions: { maxZoom: 19 },\n\t},\n]\n\nconst DEFAULT_CONTENT = {\n\tregister: '',\n\tschema: '',\n\tcenter: DEFAULT_CENTRE,\n\tzoom: 7,\n\theight: '400px',\n\tpopupField: '',\n\tclustering: false,\n\tautoFit: true,\n\tbasemaps: DEFAULT_BASEMAPS,\n}\n\n/**\n * CnMapWidgetForm — configures the `map` dashboard widget.\n *\n * Emits `update:content` with the assembled content blob on every change.\n * `validate()` requires a register + schema: a map with no data source would render\n * an empty basemap, which looks broken rather than empty.\n *\n * @slot default No slots — the form is fully declarative.\n */\nexport default {\n\tname: 'CnMapWidgetForm',\n\n\tcomponents: { NcTextField, NcCheckboxRadioSwitch, CnRegisterSchemaSelect, CnFieldPicker },\n\n\tprops: {\n\t\t/**\n\t\t * The placement being edited (pre-fills every control from\n\t\t * `editingWidget.content`), or `null` in create mode.\n\t\t *\n\t\t * @type {{content: object}|null}\n\t\t */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Initial content values when not editing (registry defaults).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every field change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst centre = Array.isArray(initial.center) && initial.center.length === 2\n\t\t\t? initial.center\n\t\t\t: DEFAULT_CENTRE\n\t\treturn {\n\t\t\tsource: {\n\t\t\t\tregister: initial.register ?? '',\n\t\t\t\tschema: initial.schema ?? '',\n\t\t\t},\n\n\t\t\tcenter: [Number(centre[0]), Number(centre[1])],\n\t\t\tzoom: Number.isFinite(initial.zoom) ? initial.zoom : 7,\n\t\t\theight: initial.height || '400px',\n\t\t\tpopupField: initial.popupField ?? '',\n\t\t\tclustering: initial.clustering === true,\n\t\t\tautoFit: initial.autoFit !== false,\n\t\t\tcenterMarker: initial.markers?.centerMarker === true,\n\t\t\t// Preserved verbatim: the form does not expose a basemap picker, and dropping\n\t\t\t// it on save would turn the user's map into a grey box.\n\t\t\tbasemaps: Array.isArray(initial.basemaps) && initial.basemaps.length\n\t\t\t\t? initial.basemaps\n\t\t\t\t: DEFAULT_BASEMAPS,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The assembled content blob from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tregister: this.source.register,\n\t\t\t\tschema: this.source.schema,\n\t\t\t\tcenter: this.center,\n\t\t\t\tzoom: this.zoom,\n\t\t\t\theight: this.height,\n\t\t\t\tpopupField: this.popupField,\n\t\t\t\tclustering: this.clustering,\n\t\t\t\tautoFit: this.autoFit,\n\t\t\t\tbasemaps: this.basemaps,\n\t\t\t\t// CnMapWidget reads its markers from here; `dataSource.{register, schema}`\n\t\t\t\t// is the shape its resolver understands.\n\t\t\t\tmarkers: {\n\t\t\t\t\tdataSource: { register: this.source.register, schema: this.source.schema },\n\t\t\t\t\tpopupField: this.popupField,\n\t\t\t\t\tclustering: this.clustering,\n\t\t\t\t\tcenterMarker: this.centerMarker,\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tassembledContent: {\n\t\t\thandler(content) {\n\t\t\t\tthis.$emit('update:content', content)\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Update one half of the data source. Changing the register invalidates the\n\t\t * schema and the popup field, which belonged to the old schema.\n\t\t *\n\t\t * @param {'register'|'schema'} key Which half changed.\n\t\t * @param {string} value The new value.\n\t\t */\n\t\tupdateSource(key, value) {\n\t\t\tthis.source[key] = value\n\t\t\tif (key === 'register') {\n\t\t\t\tthis.source.schema = ''\n\t\t\t\tthis.popupField = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Zoom is an integer clamped to the slider range; guards against a\n\t\t * non-numeric value or one outside the slider's `[1, 19]` range.\n\t\t *\n\t\t * @param {string} value The raw slider value.\n\t\t */\n\t\tonZoom(value) {\n\t\t\tconst n = Math.round(Number(value))\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\tthis.zoom = 7\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.zoom = Math.min(19, Math.max(1, n))\n\t\t},\n\n\t\t/**\n\t\t * Update one coordinate of the centre, ignoring non-numeric input.\n\t\t *\n\t\t * @param {number} index 0 for latitude, 1 for longitude.\n\t\t * @param {string} value The raw input value.\n\t\t */\n\t\tonCentre(index, value) {\n\t\t\tconst n = Number(value)\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.center[index] = n\n\t\t},\n\n\t\t/**\n\t\t * A map with no data source renders an empty basemap, which reads as broken\n\t\t * rather than empty — so require one.\n\t\t *\n\t\t * @return {boolean} Whether the form is valid.\n\t\t */\n\t\tvalidate() {\n\t\t\treturn Boolean(this.source.register && this.source.schema)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-map-widget-form__row {\n\tdisplay: flex;\n\tgap: 8px;\n}\n\n.cn-map-widget-form__row > * {\n\tflex: 1;\n\tmin-width: 0;\n}\n\n.cn-map-widget-form__hint {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 90%;\n\tmargin: 0;\n}\n\n.cn-map-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-map-widget-form__range {\n\twidth: 100%;\n\t/* Native range inputs ship a default 2px margin on ALL sides. The left/right\n\t 2px pushes the width:100% track past the form and shows a phantom\n\t horizontal scrollbar; zeroing it also drops the top/bottom 2px, which was\n\t padding the form's height. */\n\tmargin: 0;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_createVNode"],"mappings":";;AAmBM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,oBAAS;;;AAeN,EAAA,KAAA,EAAA;;AAIN,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAAC;AACP,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAAqB;;AAoB7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAqB;;;;;;;;AAxC/B,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;;MAEC,QAAQ,EAAE,KAAA,CAAA,MAAM,CAAC,QAAI;MACrB,MAAM,EAAE,KAAA,CAAA,MAAM,CAAC,MAAM;MACrB,mBAAe,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAC,QAAA,CAAA,YAAa,CAAA,UAAA,EAAA,MAAA,CAAA,CAAA,CAAA;;;AAI5B,IAAA,CAAA,KAAA,CAAA,MAAA,CAAA,QAAA,IAAA,KAAA,CAAA,MAAA,CAAA,MAAA;kCAKI,wBAAA,EAAA;;;UAHL,QAAQ,EAAE,KAAA,CAAA,MAAM,CAAC,QAAQ;UACzB,MAAM,EAAE,KAAA,CAAA,MAAM,CAAC,MAAM;AACrB,UAAA,KAAK,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,aAAA,CAAA;UACR,OAAK,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAA,KAAA,CAAA,UAAA,GAAA,MAAA,CAAA;;;AAEE,IAAA,CAAA,KAAA,CAAA,MAAI,CAAA,QAAA,IAAA,KAAA,CAAA,MAAA,CAAA,MAAA;yCAET,GAAA,YAAA,EAAAC,eAAA,CADA,QAAA,CAAA,CAAC,CAAA,eAAA,EAA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4B,KAAA,CAAA,YAAW;mEAAX,KAAA,CAAA,YAAW,IAAA,MAAA,CAAA,CAAA;AAAG,MAAA,IAAI,EAAC;;uBAClD,MAAsB;wCAAnB,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,6BAAA,CAAA,CAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnMapWidgetForm3.vue.js","sources":["../../../../src/components/CnMapWidgetForm/CnMapWidgetForm.vue?vue&type=template&id=5ee2234a&lang.js"],"sourcesContent":["<!--\n CnMapWidgetForm — configuration form for the `map` dashboard widget.\n\n Picks an OpenRegister register/schema and plots its objects on a Leaflet map,\n reading each object's location from `@self.geo` (what CnObjectGeoWidget writes).\n Everything else — centre, zoom, height, popup field, clustering — is presentation.\n\n Used by both `CnAddWidgetModal` and the cog `CnWidgetStyleEditorModal`.\n-->\n<template>\n\t<div class=\"cn-map-widget-form\">\n\t\t<CnRegisterSchemaSelect\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t@update:register=\"updateSource('register', $event)\"\n\t\t\t@update:schema=\"updateSource('schema', $event)\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"popupField\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Popup field')\"\n\t\t\t@input=\"popupField = $event\" />\n\n\t\t<CnFieldPicker\n\t\t\tv-if=\"source.register && source.schema\"\n\t\t\t:value=\"geoProperty\"\n\t\t\t:register=\"source.register\"\n\t\t\t:schema=\"source.schema\"\n\t\t\t:label=\"t('nextcloud-vue', 'Location field')\"\n\t\t\t@input=\"geoProperty = $event\" />\n\n\t\t<p v-if=\"source.register && source.schema\" class=\"cn-map-widget-form__hint\">\n\t\t\t{{ t('nextcloud-vue', 'Objects are plotted from the location field: a point, line or area. Without one, from their location (@self.geo). Objects without a location are skipped.') }}\n\t\t</p>\n\n\t\t<NcSelect\n\t\t\t:modelValue=\"basemapOption\"\n\t\t\t:options=\"basemapOptions\"\n\t\t\t:inputLabel=\"t('nextcloud-vue', 'Base map')\"\n\t\t\t:clearable=\"false\"\n\t\t\t@update:modelValue=\"onBasemap($event)\" />\n\n\t\t<label class=\"cn-map-widget-form__field\">\n\t\t\t<span class=\"cn-map-widget-form__label\">\n\t\t\t\t{{ t('nextcloud-vue', 'Zoom') }} ({{ zoom }})\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\ttype=\"range\"\n\t\t\t\tmin=\"1\"\n\t\t\t\tmax=\"19\"\n\t\t\t\tstep=\"1\"\n\t\t\t\t:value=\"zoom\"\n\t\t\t\tclass=\"cn-map-widget-form__range\"\n\t\t\t\t@input=\"onZoom($event.target.value)\">\n\t\t</label>\n\n\t\t<NcTextField\n\t\t\t:modelValue=\"height\"\n\t\t\t:label=\"t('nextcloud-vue', 'Height')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\tplaceholder=\"400px\"\n\t\t\t@update:modelValue=\"height = $event\" />\n\n\t\t<div class=\"cn-map-widget-form__row\">\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[0])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre latitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(0, $event)\" />\n\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"String(center[1])\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Centre longitude')\"\n\t\t\t\t:labelVisible=\"true\"\n\t\t\t\t@update:modelValue=\"onCentre(1, $event)\" />\n\t\t</div>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"centerMarker\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Show a marker at the centre') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"autoFit\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Zoom to fit the plotted objects') }}\n\t\t</NcCheckboxRadioSwitch>\n\n\t\t<NcCheckboxRadioSwitch v-model=\"clustering\" type=\"switch\">\n\t\t\t{{ t('nextcloud-vue', 'Group nearby objects into clusters') }}\n\t\t</NcCheckboxRadioSwitch>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcCheckboxRadioSwitch, NcSelect, NcTextField } from '@nextcloud/vue'\nimport CnFieldPicker from '../CnFieldPicker/CnFieldPicker.vue'\nimport CnRegisterSchemaSelect from '../CnRegisterSchemaSelect/CnRegisterSchemaSelect.vue'\nimport { BASEMAP_PRESETS, basemapFromPreset, presetOf } from '../CnMapWidget/basemapPresets.js'\n\n// The Netherlands, roughly — a sane default centre for a Dutch-government library.\n// autoFit is on by default, so this only shows before any object is plotted.\nconst DEFAULT_CENTRE = [52.13, 5.29]\n\n// Without a basemap the widget renders a grey box: CnMapWidget's `basemaps` prop is\n// opt-in and empty by default. The Nextcloud CSP already allows *.tile.openstreetmap.org.\nconst DEFAULT_BASEMAPS = [basemapFromPreset('osm')]\n\nconst DEFAULT_CONTENT = {\n\tregister: '',\n\tschema: '',\n\tcenter: DEFAULT_CENTRE,\n\tzoom: 7,\n\theight: '400px',\n\tpopupField: '',\n\tclustering: false,\n\tautoFit: true,\n\tbasemaps: DEFAULT_BASEMAPS,\n}\n\n/**\n * CnMapWidgetForm — configures the `map` dashboard widget.\n *\n * Emits `update:content` with the assembled content blob on every change.\n * `validate()` requires a register + schema: a map with no data source would render\n * an empty basemap, which looks broken rather than empty.\n *\n * @slot default No slots — the form is fully declarative.\n */\nexport default {\n\tname: 'CnMapWidgetForm',\n\n\tcomponents: { NcTextField, NcCheckboxRadioSwitch, NcSelect, CnRegisterSchemaSelect, CnFieldPicker },\n\n\tprops: {\n\t\t/**\n\t\t * The placement being edited (pre-fills every control from\n\t\t * `editingWidget.content`), or `null` in create mode.\n\t\t *\n\t\t * @type {{content: object}|null}\n\t\t */\n\t\teditingWidget: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Initial content values when not editing (registry defaults).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ ...DEFAULT_CONTENT }),\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Emitted with the assembled content blob on every field change.\n\t\t *\n\t\t * @event update:content\n\t\t * @type {object}\n\t\t */\n\t\t'update:content',\n\t],\n\n\tdata() {\n\t\tconst initial = this.editingWidget?.content || this.value || {}\n\t\tconst centre = Array.isArray(initial.center) && initial.center.length === 2\n\t\t\t? initial.center\n\t\t\t: DEFAULT_CENTRE\n\t\treturn {\n\t\t\tsource: {\n\t\t\t\tregister: initial.register ?? '',\n\t\t\t\tschema: initial.schema ?? '',\n\t\t\t},\n\n\t\t\tcenter: [Number(centre[0]), Number(centre[1])],\n\t\t\tzoom: Number.isFinite(initial.zoom) ? initial.zoom : 7,\n\t\t\theight: initial.height || '400px',\n\t\t\tpopupField: initial.popupField ?? '',\n\t\t\tgeoProperty: initial.markers?.geoProperty ?? '',\n\t\t\tclustering: initial.clustering === true,\n\t\t\tautoFit: initial.autoFit !== false,\n\t\t\tcenterMarker: initial.markers?.centerMarker === true,\n\t\t\t// Preserved verbatim unless a preset is chosen: dropping it on save would\n\t\t\t// turn the user's map into a grey box, and a custom base map has no preset.\n\t\t\tbasemaps: Array.isArray(initial.basemaps) && initial.basemaps.length\n\t\t\t\t? initial.basemaps\n\t\t\t\t: DEFAULT_BASEMAPS,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The base map choices: the presets, plus the stored one when it is custom. */\n\t\tbasemapOptions() {\n\t\t\tconst presets = BASEMAP_PRESETS.map((preset) => ({ id: preset.id, label: preset.name }))\n\t\t\tif (presetOf(this.basemaps[0]) === null) {\n\t\t\t\treturn [{ id: 'custom', label: this.basemaps[0]?.name || t('nextcloud-vue', 'Custom base map') }, ...presets]\n\t\t\t}\n\t\t\treturn presets\n\t\t},\n\n\t\t/** The option of the first stored base map. */\n\t\tbasemapOption() {\n\t\t\tconst id = presetOf(this.basemaps[0]) ?? 'custom'\n\t\t\treturn this.basemapOptions.find((option) => option.id === id) ?? null\n\t\t},\n\n\t\t/** The assembled content blob from the current field values. */\n\t\tassembledContent() {\n\t\t\treturn {\n\t\t\t\tregister: this.source.register,\n\t\t\t\tschema: this.source.schema,\n\t\t\t\tcenter: this.center,\n\t\t\t\tzoom: this.zoom,\n\t\t\t\theight: this.height,\n\t\t\t\tpopupField: this.popupField,\n\t\t\t\tclustering: this.clustering,\n\t\t\t\tautoFit: this.autoFit,\n\t\t\t\tbasemaps: this.basemaps,\n\t\t\t\t// CnMapWidget reads its markers from here; `dataSource.{register, schema}`\n\t\t\t\t// is the shape its resolver understands.\n\t\t\t\tmarkers: {\n\t\t\t\t\tdataSource: { register: this.source.register, schema: this.source.schema },\n\t\t\t\t\tpopupField: this.popupField,\n\t\t\t\t\t...(this.geoProperty ? { geoProperty: this.geoProperty } : {}),\n\t\t\t\t\tclustering: this.clustering,\n\t\t\t\t\tcenterMarker: this.centerMarker,\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tassembledContent: {\n\t\t\thandler(content) {\n\t\t\t\tthis.$emit('update:content', content)\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Update one half of the data source. Changing the register invalidates the\n\t\t * schema and the popup field, which belonged to the old schema.\n\t\t *\n\t\t * @param {'register'|'schema'} key Which half changed.\n\t\t * @param {string} value The new value.\n\t\t */\n\t\tupdateSource(key, value) {\n\t\t\tthis.source[key] = value\n\t\t\tif (key === 'register') {\n\t\t\t\tthis.source.schema = ''\n\t\t\t\tthis.popupField = ''\n\t\t\t\tthis.geoProperty = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Store the chosen preset as the base map. Choosing the custom entry keeps\n\t\t * the stored base maps as they are.\n\t\t *\n\t\t * @param {{id: string}|null} option The chosen option.\n\t\t */\n\t\tonBasemap(option) {\n\t\t\tconst basemap = option && basemapFromPreset(option.id)\n\t\t\tif (basemap) {\n\t\t\t\tthis.basemaps = [basemap]\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Zoom is an integer clamped to the slider range; guards against a\n\t\t * non-numeric value or one outside the slider's `[1, 19]` range.\n\t\t *\n\t\t * @param {string} value The raw slider value.\n\t\t */\n\t\tonZoom(value) {\n\t\t\tconst n = Math.round(Number(value))\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\tthis.zoom = 7\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.zoom = Math.min(19, Math.max(1, n))\n\t\t},\n\n\t\t/**\n\t\t * Update one coordinate of the centre, ignoring non-numeric input.\n\t\t *\n\t\t * @param {number} index 0 for latitude, 1 for longitude.\n\t\t * @param {string} value The raw input value.\n\t\t */\n\t\tonCentre(index, value) {\n\t\t\tconst n = Number(value)\n\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.center[index] = n\n\t\t},\n\n\t\t/**\n\t\t * A map with no data source renders an empty basemap, which reads as broken\n\t\t * rather than empty — so require one.\n\t\t *\n\t\t * @return {boolean} Whether the form is valid.\n\t\t */\n\t\tvalidate() {\n\t\t\treturn Boolean(this.source.register && this.source.schema)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-map-widget-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-map-widget-form__row {\n\tdisplay: flex;\n\tgap: 8px;\n}\n\n.cn-map-widget-form__row > * {\n\tflex: 1;\n\tmin-width: 0;\n}\n\n.cn-map-widget-form__hint {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 90%;\n\tmargin: 0;\n}\n\n.cn-map-widget-form__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-map-widget-form__range {\n\twidth: 100%;\n\t/* Native range inputs ship a default 2px margin on ALL sides. The left/right\n\t 2px pushes the width:100% track past the form and shows a phantom\n\t horizontal scrollbar; zeroing it also drops the top/bottom 2px, which was\n\t padding the form's height. */\n\tmargin: 0;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createBlock","_toDisplayString","_createVNode","_createElementVNode"],"mappings":";;AAmBM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,oBAAS;;;AAuBsB,EAAA,KAAA,EAAA;;AAWlC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAAC;AACP,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAAqB;;AAoB7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAqB;;;;;;;;;AAvD/B,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;;MAEC,QAAQ,EAAE,KAAA,CAAA,MAAM,CAAC,QAAI;MACrB,MAAM,EAAE,KAAA,CAAA,MAAM,CAAC,MAAM;MACrB,mBAAe,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAC,QAAA,CAAA,YAAa,CAAA,UAAA,EAAA,MAAA,CAAA,CAAA,CAAA;;;AAIxB,IAAA,CAAA,KAAA,CAAA,MAAM,CAAC,QAAM,IAAA,KAAA,CAAA,MAAA,CAAA,MAAA;sBADnBC,WAAA;;AAEC,UAAA,KAAK,EAAE,KAAA,CAAA,UAAU;UACjB,QAAQ,EAAE,KAAA,CAAA,MAAM,CAAC,QAAI;UACrB,MAAM,EAAE,KAAA,CAAA,MAAM,CAAC,MAAM;AACrB,UAAA,KAAK,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,aAAA,CAAA;;;;AAIP,IAAA,CAAA,KAAA,CAAA,MAAA,CAAA,QAAA,IAAA,KAAA,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CC,WAAA;AACA,MAAA,UAAU,EAAE,KAAA,CAAA,MAAA;AACZ,MAAA,KAAK,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,QAAA,CAAA;AACR,MAAA,YAAY,EAAE,IAAI;AAClB,MAAA,WAAU,EAAC,OAAO;;;AAGlB,IAAAC,kBAAA,QAAA;;QAEC,UAAU,EAAE,MAAM,CAAC,KAAA,CAAA,MAAK,CAAA,CAAA,CAAA,CAAA;AACzB,QAAA,IAAI,EAAC,QAAQ;AACZ,QAAA,KAAK,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,iBAAA,CAAA;AACR,QAAA,YAAE,EAAA,IAAA;;;MAGJD,WAAA,CAKsB,sBAAA,EAAA;QAJpB,UAAU,EAAE,MAAM,CAAC,KAAA,CAAA,MAAC,CAAA,CAAA,CAAA,CAAA;;AAEpB,QAAA,KAAK,EAAE,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,kBAAA,CAAA;AACT,QAAA,YAAa,EAAE,IAAI;QAClB,qBAAiB,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,QAAA,CAAA,QAAC,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA;;;gBAKnB,gCAAA,EAAA;kBAF4B,KAAA,CAAA,YAAW;mEAAX,KAAA,CAAA,YAAW,IAAA,MAAA,CAAA,CAAA;AAAG,MAAA,IAAI,EAAC;;uBAClD,MAAsB;wCAAnB,QAAA,CAAA,CAAC,CAAA,eAAA,EAAA,6BAAA,CAAA,CAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3071,7 +3071,11 @@ var translations = {
3071
3071
  "An EAN-13 code takes twelve or thirteen digits with a valid check digit.": "Een EAN-13-code neemt twaalf of dertien cijfers met een geldig controlecijfer.",
3072
3072
  "A Code 128 code takes letters, digits and plain punctuation only.": "Een Code 128-code neemt alleen letters, cijfers en gewone leestekens.",
3073
3073
  "Started. It finishes in the background.": "Gestart. Het wordt op de achtergrond afgerond.",
3074
- "At most {max} rows.": "Hoogstens {max} rijen."
3074
+ "At most {max} rows.": "Hoogstens {max} rijen.",
3075
+ "Location field": "Locatieveld",
3076
+ "Objects are plotted from the location field: a point, line or area. Without one, from their location (@self.geo). Objects without a location are skipped.": "Objecten worden getekend vanuit het locatieveld: een punt, lijn of vlak. Zonder locatieveld vanuit hun locatie (@self.geo). Objecten zonder locatie worden overgeslagen.",
3077
+ "Custom base map": "Eigen achtergrondkaart",
3078
+ "Base map": "Achtergrondkaart"
3075
3079
  };
3076
3080
  var plurals = {
3077
3081
  "{count} member": [
@@ -1 +1 @@
1
- {"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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