mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 03:22:37 +02:00
chore: apply Biome check
This commit is contained in:
parent
64c7fe1ec9
commit
82208d618a
32 changed files with 129 additions and 127 deletions
14
biome.json
14
biome.json
|
@ -1,11 +1,7 @@
|
||||||
{
|
{
|
||||||
"files": {
|
"files": {
|
||||||
"include": [
|
"include": ["umap/static/umap/js/**"],
|
||||||
"umap/static/umap/js/**"
|
"ignore": ["umap/static/umap/vendors/**"]
|
||||||
],
|
|
||||||
"ignore": [
|
|
||||||
"umap/static/umap/vendors/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
@ -22,7 +18,11 @@
|
||||||
"rules": {
|
"rules": {
|
||||||
"style": {
|
"style": {
|
||||||
"useBlockStatements": "off",
|
"useBlockStatements": "off",
|
||||||
"noShoutyConstants": "warn"
|
"noShoutyConstants": "warn",
|
||||||
|
"noParameterAssign": "off"
|
||||||
|
},
|
||||||
|
"complexity": {
|
||||||
|
"noForEach": "off"
|
||||||
},
|
},
|
||||||
"performance": {
|
"performance": {
|
||||||
"noDelete": "off"
|
"noDelete": "off"
|
||||||
|
|
|
@ -140,7 +140,6 @@ class uMapAlertConflict extends uMapAlert {
|
||||||
}
|
}
|
||||||
|
|
||||||
onAlertConflict(event) {
|
onAlertConflict(event) {
|
||||||
// biome-ignore lint/style/useNumberNamespace: Number.Infinity returns undefined by default
|
|
||||||
const {
|
const {
|
||||||
level = 'info',
|
level = 'info',
|
||||||
duration = Number.POSITIVE_INFINITY,
|
duration = Number.POSITIVE_INFINITY,
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { Form } from './form/builder.js'
|
||||||
|
import { EXPORT_FORMATS } from './formatter.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Icon from './rendering/icon.js'
|
import * as Icon from './rendering/icon.js'
|
||||||
import * as Utils from './utils.js'
|
|
||||||
import { EXPORT_FORMATS } from './formatter.js'
|
|
||||||
import ContextMenu from './ui/contextmenu.js'
|
import ContextMenu from './ui/contextmenu.js'
|
||||||
import { Form } from './form/builder.js'
|
import * as Utils from './utils.js'
|
||||||
|
|
||||||
export default class Browser {
|
export default class Browser {
|
||||||
constructor(umap, leafletMap) {
|
constructor(umap, leafletMap) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
|
||||||
|
|
||||||
const TEMPLATE = `
|
const TEMPLATE = `
|
||||||
<div class="umap-caption">
|
<div class="umap-caption">
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
import {
|
import {
|
||||||
DomUtil,
|
|
||||||
DomEvent,
|
DomEvent,
|
||||||
stamp,
|
DomUtil,
|
||||||
GeoJSON,
|
GeoJSON,
|
||||||
LineUtil,
|
LineUtil,
|
||||||
|
stamp,
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import * as Utils from '../utils.js'
|
|
||||||
import { SCHEMA } from '../schema.js'
|
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
|
import { MutatingForm } from '../form/builder.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
|
import loadPopup from '../rendering/popup.js'
|
||||||
import {
|
import {
|
||||||
LeafletMarker,
|
LeafletMarker,
|
||||||
LeafletPolyline,
|
|
||||||
LeafletPolygon,
|
LeafletPolygon,
|
||||||
|
LeafletPolyline,
|
||||||
MaskPolygon,
|
MaskPolygon,
|
||||||
} from '../rendering/ui.js'
|
} from '../rendering/ui.js'
|
||||||
import loadPopup from '../rendering/popup.js'
|
import { SCHEMA } from '../schema.js'
|
||||||
import { MutatingForm } from '../form/builder.js'
|
import * as Utils from '../utils.js'
|
||||||
|
|
||||||
class Feature {
|
class Feature {
|
||||||
constructor(umap, datalayer, geojson = {}, id = null) {
|
constructor(umap, datalayer, geojson = {}, id = null) {
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
// FIXME: this module should not depend on Leaflet
|
// FIXME: this module should not depend on Leaflet
|
||||||
import {
|
import {
|
||||||
DomUtil,
|
|
||||||
DomEvent,
|
DomEvent,
|
||||||
stamp,
|
DomUtil,
|
||||||
GeoJSON,
|
GeoJSON,
|
||||||
|
stamp,
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import * as Utils from '../utils.js'
|
|
||||||
import { Default as DefaultLayer } from '../rendering/layers/base.js'
|
|
||||||
import { Cluster } from '../rendering/layers/cluster.js'
|
|
||||||
import { Heat } from '../rendering/layers/heat.js'
|
|
||||||
import { Categorized, Choropleth, Circles } from '../rendering/layers/classified.js'
|
|
||||||
import {
|
import {
|
||||||
uMapAlert as Alert,
|
uMapAlert as Alert,
|
||||||
uMapAlertConflict as AlertConflict,
|
uMapAlertConflict as AlertConflict,
|
||||||
} from '../../components/alerts/alert.js'
|
} from '../../components/alerts/alert.js'
|
||||||
|
import { MutatingForm } from '../form/builder.js'
|
||||||
import { translate } from '../i18n.js'
|
import { translate } from '../i18n.js'
|
||||||
import { DataLayerPermissions } from '../permissions.js'
|
import { DataLayerPermissions } from '../permissions.js'
|
||||||
import { Point, LineString, Polygon } from './features.js'
|
import { Default as DefaultLayer } from '../rendering/layers/base.js'
|
||||||
import TableEditor from '../tableeditor.js'
|
import { Categorized, Choropleth, Circles } from '../rendering/layers/classified.js'
|
||||||
|
import { Cluster } from '../rendering/layers/cluster.js'
|
||||||
|
import { Heat } from '../rendering/layers/heat.js'
|
||||||
import { ServerStored } from '../saving.js'
|
import { ServerStored } from '../saving.js'
|
||||||
import * as Schema from '../schema.js'
|
import * as Schema from '../schema.js'
|
||||||
import { MutatingForm } from '../form/builder.js'
|
import TableEditor from '../tableeditor.js'
|
||||||
|
import * as Utils from '../utils.js'
|
||||||
|
import { LineString, Point, Polygon } from './features.js'
|
||||||
|
|
||||||
export const LAYER_TYPES = [
|
export const LAYER_TYPES = [
|
||||||
DefaultLayer,
|
DefaultLayer,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import getClass from './fields.js'
|
|
||||||
import * as Utils from '../utils.js'
|
|
||||||
import { SCHEMA } from '../schema.js'
|
|
||||||
import { translate } from '../i18n.js'
|
import { translate } from '../i18n.js'
|
||||||
|
import { SCHEMA } from '../schema.js'
|
||||||
|
import * as Utils from '../utils.js'
|
||||||
|
import getClass from './fields.js'
|
||||||
|
|
||||||
export class Form extends Utils.WithEvents {
|
export class Form extends Utils.WithEvents {
|
||||||
constructor(obj, fields, properties) {
|
constructor(obj, fields, properties) {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import * as Utils from '../utils.js'
|
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import {
|
import {
|
||||||
AjaxAutocomplete,
|
AjaxAutocomplete,
|
||||||
AjaxAutocompleteMultiple,
|
AjaxAutocompleteMultiple,
|
||||||
AutocompleteDatalist,
|
AutocompleteDatalist,
|
||||||
} from '../autocomplete.js'
|
} from '../autocomplete.js'
|
||||||
import { SCHEMA } from '../schema.js'
|
import { translate } from '../i18n.js'
|
||||||
import * as Icon from '../rendering/icon.js'
|
import * as Icon from '../rendering/icon.js'
|
||||||
|
import { SCHEMA } from '../schema.js'
|
||||||
|
import * as Utils from '../utils.js'
|
||||||
|
|
||||||
const Fields = {}
|
const Fields = {}
|
||||||
|
|
||||||
|
@ -254,8 +254,8 @@ Fields.BlurInput = class extends Fields.Input {
|
||||||
const IntegerMixin = (Base) =>
|
const IntegerMixin = (Base) =>
|
||||||
class extends Base {
|
class extends Base {
|
||||||
value() {
|
value() {
|
||||||
return !isNaN(this.input.value) && this.input.value !== ''
|
return !Number.isNaN(this.input.value) && this.input.value !== ''
|
||||||
? parseInt(this.input.value, 10)
|
? Number.parseInt(this.input.value, 10)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,8 +270,8 @@ Fields.BlurIntInput = class extends IntegerMixin(Fields.BlurInput) {}
|
||||||
const FloatMixin = (Base) =>
|
const FloatMixin = (Base) =>
|
||||||
class extends Base {
|
class extends Base {
|
||||||
value() {
|
value() {
|
||||||
return !isNaN(this.input.value) && this.input.value !== ''
|
return !Number.isNaN(this.input.value) && this.input.value !== ''
|
||||||
? parseFloat(this.input.value)
|
? Number.parseFloat(this.input.value)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ Fields.Select = class extends BaseElement {
|
||||||
|
|
||||||
Fields.IntSelect = class extends Fields.Select {
|
Fields.IntSelect = class extends Fields.Select {
|
||||||
value() {
|
value() {
|
||||||
return parseInt(super.value(), 10)
|
return Number.parseInt(super.value(), 10)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
||||||
/* Uses globals for: csv2geojson, osmtogeojson (not available as ESM) */
|
/* Uses globals for: csv2geojson, osmtogeojson (not available as ESM) */
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
|
||||||
|
|
||||||
export const EXPORT_FORMATS = {
|
export const EXPORT_FORMATS = {
|
||||||
geojson: {
|
geojson: {
|
||||||
|
|
|
@ -4,14 +4,14 @@ import {
|
||||||
AjaxAutocompleteMultiple,
|
AjaxAutocompleteMultiple,
|
||||||
AutocompleteDatalist,
|
AutocompleteDatalist,
|
||||||
} from './autocomplete.js'
|
} from './autocomplete.js'
|
||||||
|
import { LineString, Point, Polygon } from './data/features.js'
|
||||||
|
import { LAYER_TYPES } from './data/layer.js'
|
||||||
import Help from './help.js'
|
import Help from './help.js'
|
||||||
|
import * as Icon from './rendering/icon.js'
|
||||||
|
import { LeafletMarker, LeafletPolygon, LeafletPolyline } from './rendering/ui.js'
|
||||||
import { ServerRequest } from './request.js'
|
import { ServerRequest } from './request.js'
|
||||||
import { SCHEMA } from './schema.js'
|
import { SCHEMA } from './schema.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import * as Icon from './rendering/icon.js'
|
|
||||||
import { LAYER_TYPES } from './data/layer.js'
|
|
||||||
import { Point, LineString, Polygon } from './data/features.js'
|
|
||||||
import { LeafletMarker, LeafletPolyline, LeafletPolygon } from './rendering/ui.js'
|
|
||||||
|
|
||||||
// Import modules and export them to the global scope.
|
// Import modules and export them to the global scope.
|
||||||
// For the not yet module-compatible JS out there.
|
// For the not yet module-compatible JS out there.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Utils from './utils.js'
|
|
||||||
import Dialog from './ui/dialog.js'
|
import Dialog from './ui/dialog.js'
|
||||||
|
import * as Utils from './utils.js'
|
||||||
|
|
||||||
const SHORTCUTS = {
|
const SHORTCUTS = {
|
||||||
DRAW_MARKER: {
|
DRAW_MARKER: {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import { AutocompleteCommunes } from './communesfr.js'
|
import { AutocompleteCommunes } from './communesfr.js'
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
|
||||||
|
|
||||||
const TEMPLATE = `
|
const TEMPLATE = `
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
import { BaseAjax, SingleMixin } from '../autocomplete.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
import * as Util from '../utils.js'
|
import * as Util from '../utils.js'
|
||||||
import { AutocompleteCommunes } from './communesfr.js'
|
import { AutocompleteCommunes } from './communesfr.js'
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
|
||||||
|
|
||||||
const TEMPLATE = `
|
const TEMPLATE = `
|
||||||
<h3>Cadastre</h3>
|
<h3>Cadastre</h3>
|
||||||
|
|
|
@ -15,7 +15,7 @@ export class AutocompleteCommunes extends SingleMixin(BaseAjax) {
|
||||||
let options = { q: encodeURIComponent(value) }
|
let options = { q: encodeURIComponent(value) }
|
||||||
const re = /^(0[1-9]|[1-9][ABab\d])\d{3}$/gm
|
const re = /^(0[1-9]|[1-9][ABab\d])\d{3}$/gm
|
||||||
if (re.test(value)) {
|
if (re.test(value)) {
|
||||||
url = "https://geo.api.gouv.fr/communes?code={code}&limit=5"
|
url = 'https://geo.api.gouv.fr/communes?code={code}&limit=5'
|
||||||
options = { code: encodeURIComponent(value) }
|
options = { code: encodeURIComponent(value) }
|
||||||
}
|
}
|
||||||
return Util.template(url, options)
|
return Util.template(url, options)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from './i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
import { uMapAlert as Alert } from '../components/alerts/alert.js'
|
||||||
|
import { MutatingForm } from './form/builder.js'
|
||||||
|
import { translate } from './i18n.js'
|
||||||
import { ServerStored } from './saving.js'
|
import { ServerStored } from './saving.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import { MutatingForm } from './form/builder.js'
|
|
||||||
|
|
||||||
// Dedicated object so we can deal with a separate dirty status, and thus
|
// Dedicated object so we can deal with a separate dirty status, and thus
|
||||||
// call the endpoint only when needed, saving one call at each save.
|
// call the endpoint only when needed, saving one call at each save.
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import {
|
import {
|
||||||
|
DivIcon,
|
||||||
DomEvent,
|
DomEvent,
|
||||||
DomUtil,
|
DomUtil,
|
||||||
DivIcon,
|
|
||||||
Icon,
|
Icon,
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import * as Utils from '../utils.js'
|
|
||||||
import { SCHEMA } from '../schema.js'
|
import { SCHEMA } from '../schema.js'
|
||||||
|
import * as Utils from '../utils.js'
|
||||||
|
|
||||||
export function getClass(name) {
|
export function getClass(name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { FeatureGroup, DomUtil } from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
import colorbrewer from '../../../../vendors/colorbrewer/colorbrewer.js'
|
||||||
|
import { DomUtil, FeatureGroup } from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from '../../i18n.js'
|
import { translate } from '../../i18n.js'
|
||||||
import { LayerMixin } from './base.js'
|
|
||||||
import * as Utils from '../../utils.js'
|
import * as Utils from '../../utils.js'
|
||||||
import { CircleMarker } from '../ui.js'
|
import { CircleMarker } from '../ui.js'
|
||||||
import colorbrewer from '../../../../vendors/colorbrewer/colorbrewer.js'
|
import { LayerMixin } from './base.js'
|
||||||
|
|
||||||
// Layer where each feature color is relative to the others,
|
// Layer where each feature color is relative to the others,
|
||||||
// so we need all features before behing able to set one
|
// so we need all features before behing able to set one
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
import { Evented } from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
// WARNING must be loaded dynamically, or at least after leaflet.markercluster
|
// WARNING must be loaded dynamically, or at least after leaflet.markercluster
|
||||||
// Uses global L.MarkerCluster and L.MarkerClusterGroup, not exposed as ESM
|
// Uses global L.MarkerCluster and L.MarkerClusterGroup, not exposed as ESM
|
||||||
import { translate } from '../../i18n.js'
|
import { translate } from '../../i18n.js'
|
||||||
import { LayerMixin } from './base.js'
|
|
||||||
import * as Utils from '../../utils.js'
|
import * as Utils from '../../utils.js'
|
||||||
import { Evented } from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
|
||||||
import { Cluster as ClusterIcon } from '../icon.js'
|
import { Cluster as ClusterIcon } from '../icon.js'
|
||||||
|
import { LayerMixin } from './base.js'
|
||||||
|
|
||||||
const MarkerCluster = L.MarkerCluster.extend({
|
const MarkerCluster = L.MarkerCluster.extend({
|
||||||
// Custom class so we can call computeTextColor
|
// Custom class so we can call computeTextColor
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Uses global L.HeatLayer, not exposed as ESM
|
// Uses global L.HeatLayer, not exposed as ESM
|
||||||
import {
|
import {
|
||||||
Marker,
|
|
||||||
LatLng,
|
|
||||||
latLngBounds,
|
|
||||||
Bounds,
|
Bounds,
|
||||||
|
LatLng,
|
||||||
|
Marker,
|
||||||
|
latLngBounds,
|
||||||
point,
|
point,
|
||||||
} from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { LayerMixin } from './base.js'
|
|
||||||
import * as Utils from '../../utils.js'
|
|
||||||
import { translate } from '../../i18n.js'
|
import { translate } from '../../i18n.js'
|
||||||
|
import * as Utils from '../../utils.js'
|
||||||
|
import { LayerMixin } from './base.js'
|
||||||
|
|
||||||
export const Heat = L.HeatLayer.extend({
|
export const Heat = L.HeatLayer.extend({
|
||||||
statics: {
|
statics: {
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
// Goes here all code related to Leaflet, DOM and user interactions.
|
// Goes here all code related to Leaflet, DOM and user interactions.
|
||||||
import {
|
import {
|
||||||
Map as BaseMap,
|
Map as BaseMap,
|
||||||
DomUtil,
|
|
||||||
DomEvent,
|
|
||||||
latLngBounds,
|
|
||||||
latLng,
|
|
||||||
Control,
|
Control,
|
||||||
|
DomEvent,
|
||||||
|
DomUtil,
|
||||||
|
latLng,
|
||||||
|
latLngBounds,
|
||||||
setOptions,
|
setOptions,
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
|
import DropControl from '../drop.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import * as Icon from './icon.js'
|
import * as Icon from './icon.js'
|
||||||
import DropControl from '../drop.js'
|
|
||||||
|
|
||||||
// Those options are not saved on the server, so they can live here
|
// Those options are not saved on the server, so they can live here
|
||||||
// instead of in umap.properties
|
// instead of in umap.properties
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import {
|
import {
|
||||||
|
Popup as BasePopup,
|
||||||
DomEvent,
|
DomEvent,
|
||||||
DomUtil,
|
DomUtil,
|
||||||
Path,
|
Path,
|
||||||
Popup as BasePopup,
|
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import loadTemplate from './template.js'
|
|
||||||
import Browser from '../browser.js'
|
import Browser from '../browser.js'
|
||||||
|
import loadTemplate from './template.js'
|
||||||
|
|
||||||
export default function loadPopup(name) {
|
export default function loadPopup(name) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { DomUtil, DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate, getLocale } from '../i18n.js'
|
import { getLocale, translate } from '../i18n.js'
|
||||||
|
import { Request } from '../request.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import * as Icon from './icon.js'
|
import * as Icon from './icon.js'
|
||||||
import { Request } from '../request.js'
|
|
||||||
|
|
||||||
export default async function loadTemplate(name, feature, container) {
|
export default async function loadTemplate(name, feature, container) {
|
||||||
let klass = PopupTemplate
|
let klass = PopupTemplate
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
// Goes here all code related to Leaflet, DOM and user interactions.
|
// Goes here all code related to Leaflet, DOM and user interactions.
|
||||||
import {
|
import {
|
||||||
Marker,
|
|
||||||
Polyline,
|
|
||||||
Polygon,
|
|
||||||
CircleMarker as BaseCircleMarker,
|
CircleMarker as BaseCircleMarker,
|
||||||
|
DomEvent,
|
||||||
DomUtil,
|
DomUtil,
|
||||||
LineUtil,
|
|
||||||
latLng,
|
|
||||||
LatLng,
|
LatLng,
|
||||||
LatLngBounds,
|
LatLngBounds,
|
||||||
DomEvent,
|
LineUtil,
|
||||||
|
Marker,
|
||||||
|
Polygon,
|
||||||
|
Polyline,
|
||||||
|
latLng,
|
||||||
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from '../i18n.js'
|
|
||||||
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
import { uMapAlert as Alert } from '../../components/alerts/alert.js'
|
||||||
|
import { translate } from '../i18n.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import * as Icon from './icon.js'
|
import * as Icon from './icon.js'
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from './i18n.js'
|
|
||||||
import * as Utils from './utils.js'
|
|
||||||
import { AutocompleteDatalist } from './autocomplete.js'
|
import { AutocompleteDatalist } from './autocomplete.js'
|
||||||
import Orderable from './orderable.js'
|
|
||||||
import { MutatingForm } from './form/builder.js'
|
import { MutatingForm } from './form/builder.js'
|
||||||
|
import { translate } from './i18n.js'
|
||||||
|
import Orderable from './orderable.js'
|
||||||
|
import * as Utils from './utils.js'
|
||||||
|
|
||||||
const EMPTY_VALUES = ['', undefined, null]
|
const EMPTY_VALUES = ['', undefined, null]
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { MutatingForm } from './form/builder.js'
|
||||||
import { EXPORT_FORMATS } from './formatter.js'
|
import { EXPORT_FORMATS } from './formatter.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import * as Utils from './utils.js'
|
import * as Utils from './utils.js'
|
||||||
import { MutatingForm } from './form/builder.js'
|
|
||||||
|
|
||||||
export default class Share {
|
export default class Share {
|
||||||
constructor(umap) {
|
constructor(umap) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
import * as SaveManager from '../saving.js'
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import { HybridLogicalClock } from './hlc.js'
|
import { HybridLogicalClock } from './hlc.js'
|
||||||
import { DataLayerUpdater, FeatureUpdater, MapUpdater } from './updaters.js'
|
import { DataLayerUpdater, FeatureUpdater, MapUpdater } from './updaters.js'
|
||||||
import { WebSocketTransport } from './websocket.js'
|
import { WebSocketTransport } from './websocket.js'
|
||||||
import * as SaveManager from '../saving.js'
|
|
||||||
|
|
||||||
// Start reconnecting after 2 seconds, then double the delay each time
|
// Start reconnecting after 2 seconds, then double the delay each time
|
||||||
// maxing out at 32 seconds.
|
// maxing out at 32 seconds.
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class HybridLogicalClock {
|
||||||
|
|
||||||
if (now > local.walltime && now > remote.walltime) {
|
if (now > local.walltime && now > remote.walltime) {
|
||||||
nextValue = { ...local, walltime: now }
|
nextValue = { ...local, walltime: now }
|
||||||
} else if (local.walltime == remote.walltime) {
|
} else if (local.walltime === remote.walltime) {
|
||||||
const nn = Math.max(local.nn, remote.nn) + 1
|
const nn = Math.max(local.nn, remote.nn) + 1
|
||||||
nextValue = { ...local, nn: nn }
|
nextValue = { ...local, nn: nn }
|
||||||
} else if (remote.walltime > local.walltime) {
|
} else if (remote.walltime > local.walltime) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { MutatingForm } from './form/builder.js'
|
||||||
import { translate } from './i18n.js'
|
import { translate } from './i18n.js'
|
||||||
import ContextMenu from './ui/contextmenu.js'
|
import ContextMenu from './ui/contextmenu.js'
|
||||||
import { WithTemplate, loadTemplate } from './utils.js'
|
import { WithTemplate, loadTemplate } from './utils.js'
|
||||||
import { MutatingForm } from './form/builder.js'
|
|
||||||
|
|
||||||
const TEMPLATE = `
|
const TEMPLATE = `
|
||||||
<table>
|
<table>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
|
import { LineString, Point, Polygon } from '../data/features.js'
|
||||||
import { translate } from '../i18n.js'
|
import { translate } from '../i18n.js'
|
||||||
import { WithTemplate } from '../utils.js'
|
import { WithTemplate } from '../utils.js'
|
||||||
import ContextMenu from './contextmenu.js'
|
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
import { Point, LineString, Polygon } from '../data/features.js'
|
import ContextMenu from './contextmenu.js'
|
||||||
|
|
||||||
const TOP_BAR_TEMPLATE = `
|
const TOP_BAR_TEMPLATE = `
|
||||||
<div class="umap-main-edit-toolbox with-transition dark">
|
<div class="umap-main-edit-toolbox with-transition dark">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate } from '../i18n.js'
|
import { translate } from '../i18n.js'
|
||||||
import { Positioned } from './base.js'
|
|
||||||
import * as Utils from '../utils.js'
|
import * as Utils from '../utils.js'
|
||||||
|
import { Positioned } from './base.js'
|
||||||
|
|
||||||
export default class Tooltip extends Positioned {
|
export default class Tooltip extends Positioned {
|
||||||
constructor(parent) {
|
constructor(parent) {
|
||||||
|
|
|
@ -1,40 +1,40 @@
|
||||||
import {
|
import {
|
||||||
DomUtil,
|
DomUtil,
|
||||||
Util as LeafletUtil,
|
Util as LeafletUtil,
|
||||||
stamp,
|
|
||||||
latLngBounds,
|
latLngBounds,
|
||||||
|
stamp,
|
||||||
} from '../../vendors/leaflet/leaflet-src.esm.js'
|
} from '../../vendors/leaflet/leaflet-src.esm.js'
|
||||||
import { translate, setLocale, getLocale } from './i18n.js'
|
import {
|
||||||
import * as Utils from './utils.js'
|
uMapAlert as Alert,
|
||||||
import { ServerStored } from './saving.js'
|
uMapAlertCreation as AlertCreation,
|
||||||
import * as SAVEMANAGER from './saving.js'
|
} from '../components/alerts/alert.js'
|
||||||
import { SyncEngine } from './sync/engine.js'
|
|
||||||
import { LeafletMap } from './rendering/map.js'
|
|
||||||
import URLs from './urls.js'
|
|
||||||
import { Panel, EditPanel, FullPanel } from './ui/panel.js'
|
|
||||||
import Dialog from './ui/dialog.js'
|
|
||||||
import { BottomBar, TopBar, EditBar } from './ui/bar.js'
|
|
||||||
import Tooltip from './ui/tooltip.js'
|
|
||||||
import ContextMenu from './ui/contextmenu.js'
|
|
||||||
import { Request, ServerRequest } from './request.js'
|
|
||||||
import Help from './help.js'
|
|
||||||
import { Formatter } from './formatter.js'
|
|
||||||
import Slideshow from './slideshow.js'
|
|
||||||
import { MapPermissions } from './permissions.js'
|
|
||||||
import { SCHEMA } from './schema.js'
|
|
||||||
import { DataLayer } from './data/layer.js'
|
|
||||||
import Facets from './facets.js'
|
|
||||||
import Browser from './browser.js'
|
import Browser from './browser.js'
|
||||||
import Caption from './caption.js'
|
import Caption from './caption.js'
|
||||||
import Importer from './importer.js'
|
import { DataLayer } from './data/layer.js'
|
||||||
import Rules from './rules.js'
|
import Facets from './facets.js'
|
||||||
import Share from './share.js'
|
|
||||||
import {
|
|
||||||
uMapAlertCreation as AlertCreation,
|
|
||||||
uMapAlert as Alert,
|
|
||||||
} from '../components/alerts/alert.js'
|
|
||||||
import Orderable from './orderable.js'
|
|
||||||
import { MutatingForm } from './form/builder.js'
|
import { MutatingForm } from './form/builder.js'
|
||||||
|
import { Formatter } from './formatter.js'
|
||||||
|
import Help from './help.js'
|
||||||
|
import { getLocale, setLocale, translate } from './i18n.js'
|
||||||
|
import Importer from './importer.js'
|
||||||
|
import Orderable from './orderable.js'
|
||||||
|
import { MapPermissions } from './permissions.js'
|
||||||
|
import { LeafletMap } from './rendering/map.js'
|
||||||
|
import { Request, ServerRequest } from './request.js'
|
||||||
|
import Rules from './rules.js'
|
||||||
|
import { ServerStored } from './saving.js'
|
||||||
|
import * as SAVEMANAGER from './saving.js'
|
||||||
|
import { SCHEMA } from './schema.js'
|
||||||
|
import Share from './share.js'
|
||||||
|
import Slideshow from './slideshow.js'
|
||||||
|
import { SyncEngine } from './sync/engine.js'
|
||||||
|
import { BottomBar, EditBar, TopBar } from './ui/bar.js'
|
||||||
|
import ContextMenu from './ui/contextmenu.js'
|
||||||
|
import Dialog from './ui/dialog.js'
|
||||||
|
import { EditPanel, FullPanel, Panel } from './ui/panel.js'
|
||||||
|
import Tooltip from './ui/tooltip.js'
|
||||||
|
import URLs from './urls.js'
|
||||||
|
import * as Utils from './utils.js'
|
||||||
|
|
||||||
export default class Umap extends ServerStored {
|
export default class Umap extends ServerStored {
|
||||||
constructor(element, geojson) {
|
constructor(element, geojson) {
|
||||||
|
|
|
@ -368,10 +368,13 @@ export function isDataImage(value) {
|
||||||
* characters and no diacritics.
|
* characters and no diacritics.
|
||||||
*/
|
*/
|
||||||
export function normalize(s) {
|
export function normalize(s) {
|
||||||
return (s || '')
|
return (
|
||||||
.toLowerCase()
|
(s || '')
|
||||||
.normalize('NFD')
|
.toLowerCase()
|
||||||
.replace(/[\u0300-\u036f]/g, '')
|
.normalize('NFD')
|
||||||
|
// biome-ignore lint/suspicious/noMisleadingCharacterClass: <explanation>
|
||||||
|
.replace(/[\u0300-\u036f]/g, '')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vendorized from leaflet.utils
|
// Vendorized from leaflet.utils
|
||||||
|
|
Loading…
Reference in a new issue