@eox/drawtools 0.10.0 → 0.10.1-dev.1729494244.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-drawtools.js +319 -207
- package/dist/eox-drawtools.umd.cjs +37 -33
- package/package.json +1 -1
- package/src/components/controller.js +7 -1
- package/src/components/list.js +2 -2
- package/src/enums/index.js +1 -0
- package/src/enums/stories.js +21 -0
- package/src/main.js +41 -7
- package/src/methods/draw/create-select-handler.js +50 -0
- package/src/methods/draw/discard-drawing.js +5 -1
- package/src/methods/draw/handle-layer-id.js +55 -0
- package/src/methods/draw/index.js +3 -0
- package/src/methods/draw/init-layer.js +12 -5
- package/src/methods/draw/init-selection.js +67 -0
- package/src/methods/draw/on-draw-end.js +1 -0
- package/src/methods/draw/start-drawing.js +2 -1
- package/src/methods/list/hover-feature.js +1 -1
- package/src/methods/list/select-deselect-feature.js +1 -1
- package/src/style.eox.js +3 -0
package/dist/eox-drawtools.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ht = Object.defineProperty;
|
|
2
|
+
var et = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var kt = (i, t, e) => t in i ? Ht(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
6
|
+
var b = (i, t, e) => kt(i, typeof t != "symbol" ? t + "" : t, e), it = (i, t, e) => t.has(i) || et("Cannot " + e);
|
|
7
|
+
var y = (i, t, e) => (it(i, t, "read from private field"), e ? e.call(i) : t.get(i)), $ = (i, t, e) => t.has(i) ? et("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), g = (i, t, e, r) => (it(i, t, "write to private field"), r ? r.call(i, e) : t.set(i, e), e);
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2019 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
let
|
|
13
|
+
const J = globalThis, Y = J.ShadowRoot && (J.ShadyCSS === void 0 || J.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, bt = Symbol(), rt = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
let Mt = class {
|
|
15
15
|
constructor(t, e, r) {
|
|
16
|
-
if (this._$cssResult$ = !0, r !==
|
|
16
|
+
if (this._$cssResult$ = !0, r !== bt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
17
17
|
this.cssText = t, this.t = e;
|
|
18
18
|
}
|
|
19
19
|
get styleSheet() {
|
|
20
20
|
let t = this.o;
|
|
21
21
|
const e = this.t;
|
|
22
|
-
if (
|
|
22
|
+
if (Y && t === void 0) {
|
|
23
23
|
const r = e !== void 0 && e.length === 1;
|
|
24
|
-
r && (t =
|
|
24
|
+
r && (t = rt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && rt.set(e, t));
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
27
|
}
|
|
@@ -29,26 +29,26 @@ let Et = class {
|
|
|
29
29
|
return this.cssText;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const Ft = (i) => new Mt(typeof i == "string" ? i : i + "", void 0, bt), It = (i, t) => {
|
|
33
|
+
if (Y) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
34
34
|
else for (const e of t) {
|
|
35
|
-
const r = document.createElement("style"), s =
|
|
35
|
+
const r = document.createElement("style"), s = J.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = e.cssText, i.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, st = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let e = "";
|
|
40
40
|
for (const r of t.cssRules) e += r.cssText;
|
|
41
|
-
return
|
|
41
|
+
return Ft(e);
|
|
42
42
|
})(i) : i;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is:
|
|
48
|
+
const { is: Lt, defineProperty: Ut, getOwnPropertyDescriptor: Ot, getOwnPropertyNames: Pt, getOwnPropertySymbols: Vt, getPrototypeOf: Nt } = Object, v = globalThis, nt = v.trustedTypes, Bt = nt ? nt.emptyScript : "", G = v.reactiveElementPolyfillSupport, L = (i, t) => i, Q = { toAttribute(i, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
|
-
i = i ?
|
|
51
|
+
i = i ? Bt : null;
|
|
52
52
|
break;
|
|
53
53
|
case Object:
|
|
54
54
|
case Array:
|
|
@@ -73,23 +73,23 @@ const { is: Ft, defineProperty: Ht, getOwnPropertyDescriptor: kt, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return e;
|
|
76
|
-
} },
|
|
77
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
78
|
-
class
|
|
76
|
+
} }, $t = (i, t) => !Lt(i, t), ot = { attribute: !0, type: String, converter: Q, reflect: !1, hasChanged: $t };
|
|
77
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
|
+
class C extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
80
80
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
81
81
|
}
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t, e =
|
|
85
|
+
static createProperty(t, e = ot) {
|
|
86
86
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
87
87
|
const r = Symbol(), s = this.getPropertyDescriptor(t, r, e);
|
|
88
|
-
s !== void 0 &&
|
|
88
|
+
s !== void 0 && Ut(this.prototype, t, s);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(t, e, r) {
|
|
92
|
-
const { get: s, set: n } =
|
|
92
|
+
const { get: s, set: n } = Ot(this.prototype, t) ?? { get() {
|
|
93
93
|
return this[e];
|
|
94
94
|
}, set(o) {
|
|
95
95
|
this[e] = o;
|
|
@@ -102,17 +102,17 @@ class E extends HTMLElement {
|
|
|
102
102
|
}, configurable: !0, enumerable: !0 };
|
|
103
103
|
}
|
|
104
104
|
static getPropertyOptions(t) {
|
|
105
|
-
return this.elementProperties.get(t) ??
|
|
105
|
+
return this.elementProperties.get(t) ?? ot;
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
|
-
if (this.hasOwnProperty(
|
|
109
|
-
const t =
|
|
108
|
+
if (this.hasOwnProperty(L("elementProperties"))) return;
|
|
109
|
+
const t = Nt(this);
|
|
110
110
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
111
111
|
}
|
|
112
112
|
static finalize() {
|
|
113
|
-
if (this.hasOwnProperty(
|
|
114
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
115
|
-
const e = this.properties, r = [...
|
|
113
|
+
if (this.hasOwnProperty(L("finalized"))) return;
|
|
114
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(L("properties"))) {
|
|
115
|
+
const e = this.properties, r = [...Pt(e), ...Vt(e)];
|
|
116
116
|
for (const s of r) this.createProperty(s, e[s]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
@@ -131,8 +131,8 @@ class E extends HTMLElement {
|
|
|
131
131
|
const e = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const r = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const s of r) e.unshift(
|
|
135
|
-
} else t !== void 0 && e.push(
|
|
134
|
+
for (const s of r) e.unshift(st(s));
|
|
135
|
+
} else t !== void 0 && e.push(st(t));
|
|
136
136
|
return e;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, e) {
|
|
@@ -161,7 +161,7 @@ class E extends HTMLElement {
|
|
|
161
161
|
}
|
|
162
162
|
createRenderRoot() {
|
|
163
163
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
164
|
-
return
|
|
164
|
+
return It(t, this.constructor.elementStyles), t;
|
|
165
165
|
}
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
var t;
|
|
@@ -186,7 +186,7 @@ class E extends HTMLElement {
|
|
|
186
186
|
var n;
|
|
187
187
|
const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
|
|
188
188
|
if (s !== void 0 && r.reflect === !0) {
|
|
189
|
-
const o = (((n = r.converter) == null ? void 0 : n.toAttribute) !== void 0 ? r.converter :
|
|
189
|
+
const o = (((n = r.converter) == null ? void 0 : n.toAttribute) !== void 0 ? r.converter : Q).toAttribute(e, r.type);
|
|
190
190
|
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -194,13 +194,13 @@ class E extends HTMLElement {
|
|
|
194
194
|
var n;
|
|
195
195
|
const r = this.constructor, s = r._$Eh.get(t);
|
|
196
196
|
if (s !== void 0 && this._$Em !== s) {
|
|
197
|
-
const o = r.getPropertyOptions(s), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter :
|
|
197
|
+
const o = r.getPropertyOptions(s), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : Q;
|
|
198
198
|
this._$Em = s, this[s] = l.fromAttribute(e, o.type), this._$Em = null;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
requestUpdate(t, e, r) {
|
|
202
202
|
if (t !== void 0) {
|
|
203
|
-
if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ??
|
|
203
|
+
if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? $t)(this[t], e)) return;
|
|
204
204
|
this.P(t, e, r);
|
|
205
205
|
}
|
|
206
206
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -273,76 +273,76 @@ class E extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
276
|
+
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[L("elementProperties")] = /* @__PURE__ */ new Map(), C[L("finalized")] = /* @__PURE__ */ new Map(), G == null || G({ ReactiveElement: C }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
280
280
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
281
|
*/
|
|
282
|
-
const
|
|
283
|
-
\f\r]`,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
return
|
|
282
|
+
const U = globalThis, q = U.trustedTypes, at = q ? q.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, wt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, _t = "?" + m, Rt = `<${_t}>`, S = document, O = () => S.createComment(""), P = (i) => i === null || typeof i != "object" && typeof i != "function", T = Array.isArray, zt = (i) => T(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", W = `[
|
|
283
|
+
\f\r]`, I = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, lt = /-->/g, ct = />/g, w = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ht = /'/g, dt = /"/g, xt = /^(?:script|style|textarea|title)$/i, jt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), x = jt(1), M = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), _ = S.createTreeWalker(S, 129);
|
|
285
|
+
function At(i, t) {
|
|
286
|
+
if (!T(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
|
+
return at !== void 0 ? at.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const Jt = (i, t) => {
|
|
290
290
|
const e = i.length - 1, r = [];
|
|
291
|
-
let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
291
|
+
let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = I;
|
|
292
292
|
for (let l = 0; l < e; l++) {
|
|
293
293
|
const a = i[l];
|
|
294
294
|
let h, p, c = -1, u = 0;
|
|
295
|
-
for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); ) u = o.lastIndex, o ===
|
|
296
|
-
const
|
|
297
|
-
n += o ===
|
|
295
|
+
for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); ) u = o.lastIndex, o === I ? p[1] === "!--" ? o = lt : p[1] !== void 0 ? o = ct : p[2] !== void 0 ? (xt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = w) : p[3] !== void 0 && (o = w) : o === w ? p[0] === ">" ? (o = s ?? I, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, h = p[1], o = p[3] === void 0 ? w : p[3] === '"' ? dt : ht) : o === dt || o === ht ? o = w : o === lt || o === ct ? o = I : (o = w, s = void 0);
|
|
296
|
+
const f = o === w && i[l + 1].startsWith("/>") ? " " : "";
|
|
297
|
+
n += o === I ? a + Rt : c >= 0 ? (r.push(h), a.slice(0, c) + wt + a.slice(c) + m + f) : a + m + (c === -2 ? l : f);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [At(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
301
|
-
class
|
|
301
|
+
class V {
|
|
302
302
|
constructor({ strings: t, _$litType$: e }, r) {
|
|
303
303
|
let s;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let n = 0, o = 0;
|
|
306
|
-
const l = t.length - 1, a = this.parts, [h, p] =
|
|
307
|
-
if (this.el =
|
|
306
|
+
const l = t.length - 1, a = this.parts, [h, p] = Jt(t, e);
|
|
307
|
+
if (this.el = V.createElement(h, r), _.currentNode = this.el.content, e === 2 || e === 3) {
|
|
308
308
|
const c = this.el.content.firstChild;
|
|
309
309
|
c.replaceWith(...c.childNodes);
|
|
310
310
|
}
|
|
311
|
-
for (; (s =
|
|
311
|
+
for (; (s = _.nextNode()) !== null && a.length < l; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
|
-
if (s.hasAttributes()) for (const c of s.getAttributeNames()) if (c.endsWith(
|
|
314
|
-
const u = p[o++],
|
|
315
|
-
a.push({ type: 1, index: n, name:
|
|
316
|
-
} else c.startsWith(
|
|
317
|
-
if (
|
|
318
|
-
const c = s.textContent.split(
|
|
313
|
+
if (s.hasAttributes()) for (const c of s.getAttributeNames()) if (c.endsWith(wt)) {
|
|
314
|
+
const u = p[o++], f = s.getAttribute(c).split(m), j = /([.?@])?(.*)/.exec(u);
|
|
315
|
+
a.push({ type: 1, index: n, name: j[2], strings: f, ctor: j[1] === "." ? Dt : j[1] === "?" ? Gt : j[1] === "@" ? Wt : D }), s.removeAttribute(c);
|
|
316
|
+
} else c.startsWith(m) && (a.push({ type: 6, index: n }), s.removeAttribute(c));
|
|
317
|
+
if (xt.test(s.tagName)) {
|
|
318
|
+
const c = s.textContent.split(m), u = c.length - 1;
|
|
319
319
|
if (u > 0) {
|
|
320
|
-
s.textContent =
|
|
321
|
-
for (let
|
|
322
|
-
s.append(c[u],
|
|
320
|
+
s.textContent = q ? q.emptyScript : "";
|
|
321
|
+
for (let f = 0; f < u; f++) s.append(c[f], O()), _.nextNode(), a.push({ type: 2, index: ++n });
|
|
322
|
+
s.append(c[u], O());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
325
|
+
} else if (s.nodeType === 8) if (s.data === _t) a.push({ type: 2, index: n });
|
|
326
326
|
else {
|
|
327
327
|
let c = -1;
|
|
328
|
-
for (; (c = s.data.indexOf(
|
|
328
|
+
for (; (c = s.data.indexOf(m, c + 1)) !== -1; ) a.push({ type: 7, index: n }), c += m.length - 1;
|
|
329
329
|
}
|
|
330
330
|
n++;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
static createElement(t, e) {
|
|
334
|
-
const r =
|
|
334
|
+
const r = S.createElement("template");
|
|
335
335
|
return r.innerHTML = t, r;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function F(i, t, e = i, r) {
|
|
339
339
|
var o, l;
|
|
340
|
-
if (t ===
|
|
340
|
+
if (t === M) return t;
|
|
341
341
|
let s = r !== void 0 ? (o = e._$Co) == null ? void 0 : o[r] : e._$Cl;
|
|
342
|
-
const n =
|
|
343
|
-
return (s == null ? void 0 : s.constructor) !== n && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), n === void 0 ? s = void 0 : (s = new n(i), s._$AT(i, e, r)), r !== void 0 ? (e._$Co ?? (e._$Co = []))[r] = s : e._$Cl = s), s !== void 0 && (t =
|
|
342
|
+
const n = P(t) ? void 0 : t._$litDirective$;
|
|
343
|
+
return (s == null ? void 0 : s.constructor) !== n && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), n === void 0 ? s = void 0 : (s = new n(i), s._$AT(i, e, r)), r !== void 0 ? (e._$Co ?? (e._$Co = []))[r] = s : e._$Cl = s), s !== void 0 && (t = F(i, s._$AS(i, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
class
|
|
345
|
+
class qt {
|
|
346
346
|
constructor(t, e) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
348
348
|
}
|
|
@@ -353,24 +353,24 @@ class Rt {
|
|
|
353
353
|
return this._$AM._$AU;
|
|
354
354
|
}
|
|
355
355
|
u(t) {
|
|
356
|
-
const { el: { content: e }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ??
|
|
357
|
-
|
|
358
|
-
let n =
|
|
356
|
+
const { el: { content: e }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0);
|
|
357
|
+
_.currentNode = s;
|
|
358
|
+
let n = _.nextNode(), o = 0, l = 0, a = r[0];
|
|
359
359
|
for (; a !== void 0; ) {
|
|
360
360
|
if (o === a.index) {
|
|
361
361
|
let h;
|
|
362
|
-
a.type === 2 ? h = new
|
|
362
|
+
a.type === 2 ? h = new z(n, n.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (h = new Zt(n, this, t)), this._$AV.push(h), a = r[++l];
|
|
363
363
|
}
|
|
364
|
-
o !== (a == null ? void 0 : a.index) && (n =
|
|
364
|
+
o !== (a == null ? void 0 : a.index) && (n = _.nextNode(), o++);
|
|
365
365
|
}
|
|
366
|
-
return
|
|
366
|
+
return _.currentNode = S, s;
|
|
367
367
|
}
|
|
368
368
|
p(t) {
|
|
369
369
|
let e = 0;
|
|
370
370
|
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(t, r, e), e += r.strings.length - 2) : r._$AI(t[e])), e++;
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
class
|
|
373
|
+
class z {
|
|
374
374
|
get _$AU() {
|
|
375
375
|
var t;
|
|
376
376
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
@@ -390,7 +390,7 @@ class R {
|
|
|
390
390
|
return this._$AB;
|
|
391
391
|
}
|
|
392
392
|
_$AI(t, e = this) {
|
|
393
|
-
t =
|
|
393
|
+
t = F(this, t, e), P(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== M && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : zt(t) ? this.k(t) : this._(t);
|
|
394
394
|
}
|
|
395
395
|
O(t) {
|
|
396
396
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -399,26 +399,26 @@ class R {
|
|
|
399
399
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
400
400
|
}
|
|
401
401
|
_(t) {
|
|
402
|
-
this._$AH !== d &&
|
|
402
|
+
this._$AH !== d && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
|
|
403
403
|
}
|
|
404
404
|
$(t) {
|
|
405
405
|
var n;
|
|
406
|
-
const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el =
|
|
406
|
+
const { values: e, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = V.createElement(At(r.h, r.h[0]), this.options)), r);
|
|
407
407
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === s) this._$AH.p(e);
|
|
408
408
|
else {
|
|
409
|
-
const o = new
|
|
409
|
+
const o = new qt(s, this), l = o.u(this.options);
|
|
410
410
|
o.p(e), this.T(l), this._$AH = o;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
_$AC(t) {
|
|
414
|
-
let e =
|
|
415
|
-
return e === void 0 &&
|
|
414
|
+
let e = pt.get(t.strings);
|
|
415
|
+
return e === void 0 && pt.set(t.strings, e = new V(t)), e;
|
|
416
416
|
}
|
|
417
417
|
k(t) {
|
|
418
|
-
|
|
418
|
+
T(this._$AH) || (this._$AH = [], this._$AR());
|
|
419
419
|
const e = this._$AH;
|
|
420
420
|
let r, s = 0;
|
|
421
|
-
for (const n of t) s === e.length ? e.push(r = new
|
|
421
|
+
for (const n of t) s === e.length ? e.push(r = new z(this.O(O()), this.O(O()), this, this.options)) : r = e[s], r._$AI(n), s++;
|
|
422
422
|
s < e.length && (this._$AR(r && r._$AB.nextSibling, s), e.length = s);
|
|
423
423
|
}
|
|
424
424
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -433,7 +433,7 @@ class R {
|
|
|
433
433
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class D {
|
|
437
437
|
get tagName() {
|
|
438
438
|
return this.element.tagName;
|
|
439
439
|
}
|
|
@@ -446,11 +446,11 @@ class J {
|
|
|
446
446
|
_$AI(t, e = this, r, s) {
|
|
447
447
|
const n = this.strings;
|
|
448
448
|
let o = !1;
|
|
449
|
-
if (n === void 0) t =
|
|
449
|
+
if (n === void 0) t = F(this, t, e, 0), o = !P(t) || t !== this._$AH && t !== M, o && (this._$AH = t);
|
|
450
450
|
else {
|
|
451
451
|
const l = t;
|
|
452
452
|
let a, h;
|
|
453
|
-
for (t = n[0], a = 0; a < n.length - 1; a++) h =
|
|
453
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) h = F(this, l[r + a], e, a), h === M && (h = this._$AH[a]), o || (o = !P(h) || h !== this._$AH[a]), h === d ? t = d : t !== d && (t += (h ?? "") + n[a + 1]), this._$AH[a] = h;
|
|
454
454
|
}
|
|
455
455
|
o && !s && this.j(t);
|
|
456
456
|
}
|
|
@@ -458,7 +458,7 @@ class J {
|
|
|
458
458
|
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
class
|
|
461
|
+
class Dt extends D {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
@@ -466,7 +466,7 @@ class zt extends J {
|
|
|
466
466
|
this.element[this.name] = t === d ? void 0 : t;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
class
|
|
469
|
+
class Gt extends D {
|
|
470
470
|
constructor() {
|
|
471
471
|
super(...arguments), this.type = 4;
|
|
472
472
|
}
|
|
@@ -474,12 +474,12 @@ class Dt extends J {
|
|
|
474
474
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
class
|
|
477
|
+
class Wt extends D {
|
|
478
478
|
constructor(t, e, r, s, n) {
|
|
479
479
|
super(t, e, r, s, n), this.type = 5;
|
|
480
480
|
}
|
|
481
481
|
_$AI(t, e = this) {
|
|
482
|
-
if ((t =
|
|
482
|
+
if ((t = F(this, t, e, 0) ?? d) === M) return;
|
|
483
483
|
const r = this._$AH, s = t === d && r !== d || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, n = t !== d && (r === d || s);
|
|
484
484
|
s && this.element.removeEventListener(this.name, this, r), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
485
485
|
}
|
|
@@ -488,7 +488,7 @@ class jt extends J {
|
|
|
488
488
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
class
|
|
491
|
+
class Zt {
|
|
492
492
|
constructor(t, e, r) {
|
|
493
493
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = r;
|
|
494
494
|
}
|
|
@@ -496,17 +496,17 @@ class Jt {
|
|
|
496
496
|
return this._$AM._$AU;
|
|
497
497
|
}
|
|
498
498
|
_$AI(t) {
|
|
499
|
-
|
|
499
|
+
F(this, t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
502
|
+
const Z = U.litHtmlPolyfillSupport;
|
|
503
|
+
Z == null || Z(V, z), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.2.1");
|
|
504
|
+
const Kt = (i, t, e) => {
|
|
505
505
|
const r = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
506
506
|
let s = r._$litPart$;
|
|
507
507
|
if (s === void 0) {
|
|
508
508
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
509
|
-
r._$litPart$ = s = new
|
|
509
|
+
r._$litPart$ = s = new z(t.insertBefore(O(), n), n, void 0, e ?? {});
|
|
510
510
|
}
|
|
511
511
|
return s._$AI(i), s;
|
|
512
512
|
};
|
|
@@ -515,7 +515,7 @@ const qt = (i, t, e) => {
|
|
|
515
515
|
* Copyright 2017 Google LLC
|
|
516
516
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
517
517
|
*/
|
|
518
|
-
class
|
|
518
|
+
class A extends C {
|
|
519
519
|
constructor() {
|
|
520
520
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
521
521
|
}
|
|
@@ -526,7 +526,7 @@ class _ extends E {
|
|
|
526
526
|
}
|
|
527
527
|
update(t) {
|
|
528
528
|
const e = this.render();
|
|
529
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
529
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Kt(e, this.renderRoot, this.renderOptions);
|
|
530
530
|
}
|
|
531
531
|
connectedCallback() {
|
|
532
532
|
var t;
|
|
@@ -537,21 +537,21 @@ class _ extends E {
|
|
|
537
537
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
538
538
|
}
|
|
539
539
|
render() {
|
|
540
|
-
return
|
|
540
|
+
return M;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
|
-
var
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
|
|
543
|
+
var vt;
|
|
544
|
+
A._$litElement$ = !0, A.finalized = !0, (vt = globalThis.litElementHydrateSupport) == null || vt.call(globalThis, { LitElement: A });
|
|
545
|
+
const K = globalThis.litElementPolyfillSupport;
|
|
546
|
+
K == null || K({ LitElement: A });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
550
550
|
* Copyright 2017 Google LLC
|
|
551
551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
552
552
|
*/
|
|
553
|
-
const
|
|
554
|
-
let
|
|
553
|
+
const Qt = (i) => (...t) => ({ _$litDirective$: i, values: t });
|
|
554
|
+
let Xt = class {
|
|
555
555
|
constructor(t) {
|
|
556
556
|
}
|
|
557
557
|
get _$AU() {
|
|
@@ -572,13 +572,13 @@ let Gt = class {
|
|
|
572
572
|
* Copyright 2020 Google LLC
|
|
573
573
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
574
574
|
*/
|
|
575
|
-
const
|
|
575
|
+
const Yt = {}, Tt = (i, t = Yt) => i._$AH = t;
|
|
576
576
|
/**
|
|
577
577
|
* @license
|
|
578
578
|
* Copyright 2021 Google LLC
|
|
579
579
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
580
580
|
*/
|
|
581
|
-
const
|
|
581
|
+
const te = Qt(class extends Xt {
|
|
582
582
|
constructor() {
|
|
583
583
|
super(...arguments), this.key = d;
|
|
584
584
|
}
|
|
@@ -586,9 +586,9 @@ const Kt = Tt(class extends Gt {
|
|
|
586
586
|
return this.key = i, t;
|
|
587
587
|
}
|
|
588
588
|
update(i, [t, e]) {
|
|
589
|
-
return t !== this.key && (
|
|
589
|
+
return t !== this.key && (Tt(i), this.key = t), e;
|
|
590
590
|
}
|
|
591
|
-
}),
|
|
591
|
+
}), ee = (i) => {
|
|
592
592
|
i.hoverInteraction = i.eoxMap.selectInteractions.selectHover, i.clickInteraction = i.eoxMap.selectInteractions.selectClick;
|
|
593
593
|
const t = () => {
|
|
594
594
|
i.requestUpdate();
|
|
@@ -600,47 +600,47 @@ const Kt = Tt(class extends Gt {
|
|
|
600
600
|
"change",
|
|
601
601
|
t
|
|
602
602
|
);
|
|
603
|
-
},
|
|
603
|
+
}, ie = (i, t, e) => {
|
|
604
604
|
if (i.clickId === t) return;
|
|
605
605
|
const r = e ? [] : [t];
|
|
606
606
|
i.hoverInteraction.highlightById(r);
|
|
607
|
-
},
|
|
607
|
+
}, re = (i, t) => {
|
|
608
608
|
i.stopPropagation();
|
|
609
609
|
const e = Number(i.target.getAttribute("index")), r = t.drawnFeatures[e];
|
|
610
610
|
t.drawLayer.getSource().removeFeature(r), t.drawnFeatures.splice(e, 1), t.requestUpdate();
|
|
611
|
-
},
|
|
611
|
+
}, ut = { duration: 750 }, yt = {
|
|
612
612
|
type: "FeatureCollection",
|
|
613
613
|
features: []
|
|
614
|
-
},
|
|
615
|
-
const e = i.
|
|
614
|
+
}, se = (i, t) => {
|
|
615
|
+
const e = i.getId(), { clickId: r, drawLayer: s, olMap: n, clickInteraction: o } = t, l = r === e, a = i.getGeometry();
|
|
616
616
|
if (l) {
|
|
617
617
|
const h = s.getSource().getExtent();
|
|
618
|
-
n.getView().fit(h,
|
|
618
|
+
n.getView().fit(h, ut), o.highlightById([]);
|
|
619
619
|
} else {
|
|
620
620
|
const h = a.getExtent();
|
|
621
|
-
o.highlightById([e]), n.getView().fit(h,
|
|
621
|
+
o.highlightById([e]), n.getView().fit(h, ut);
|
|
622
622
|
}
|
|
623
623
|
t.requestUpdate();
|
|
624
|
-
},
|
|
625
|
-
class
|
|
624
|
+
}, ne = "ul.list-wrap { padding: 0;}ul.list-wrap li:hover,ul.list-wrap li.selected { background: var(--secondary-bg-color-hover);}ul.list-wrap li { list-style: none; padding: 4px;}ul.list-wrap li { border-bottom: 1.2px solid var(--secondary-color);}ul.list-wrap li:first-child { border-top: 1.2px solid var(--secondary-color);}ul.list-wrap li .list { width: 100%; align-items: center; justify-content: space-between; display: flex; align-items: center; cursor: pointer; font-size: small; gap: 10px;}ul.list-wrap li .list span { display: flex; align-items: center; cursor: pointer; font-size: small; flex-grow: 1;}";
|
|
625
|
+
class St extends A {
|
|
626
626
|
constructor() {
|
|
627
627
|
super();
|
|
628
628
|
/**
|
|
629
629
|
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
630
630
|
*/
|
|
631
|
-
|
|
631
|
+
b(this, "hoverInteraction");
|
|
632
632
|
/**
|
|
633
633
|
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
634
634
|
*/
|
|
635
|
-
|
|
635
|
+
b(this, "clickInteraction");
|
|
636
636
|
/**
|
|
637
637
|
* @type string | number
|
|
638
638
|
*/
|
|
639
|
-
|
|
639
|
+
b(this, "hoverId");
|
|
640
640
|
/**
|
|
641
641
|
* @type string | number
|
|
642
642
|
*/
|
|
643
|
-
|
|
643
|
+
b(this, "clickId");
|
|
644
644
|
this.eoxMap = null, this.olMap = null, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
|
|
645
645
|
}
|
|
646
646
|
/**
|
|
@@ -649,7 +649,7 @@ class wt extends _ {
|
|
|
649
649
|
* @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
|
|
650
650
|
*/
|
|
651
651
|
_handleDelete(e) {
|
|
652
|
-
|
|
652
|
+
re(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
|
|
653
653
|
}
|
|
654
654
|
/**
|
|
655
655
|
* Handles the selection and deselection of a feature from the list.
|
|
@@ -657,21 +657,21 @@ class wt extends _ {
|
|
|
657
657
|
* @param {import("ol").Feature} feature - The selected feature.
|
|
658
658
|
*/
|
|
659
659
|
_handleFeatureSelectAndDeselect(e) {
|
|
660
|
-
|
|
660
|
+
se(e, this);
|
|
661
661
|
}
|
|
662
662
|
/**
|
|
663
663
|
*
|
|
664
|
-
* @param {
|
|
664
|
+
* @param {number | string | undefined} featureId - The ID of the feature to hover.
|
|
665
665
|
* @param {Boolean} mouseOut - Flag indicating mouse out event.
|
|
666
666
|
*/
|
|
667
667
|
_handleHoverFeature(e, r = !1) {
|
|
668
|
-
|
|
668
|
+
ie(this, e, r);
|
|
669
669
|
}
|
|
670
670
|
/**
|
|
671
671
|
* Initiates initial settings and event triggers upon the component's first update.
|
|
672
672
|
*/
|
|
673
673
|
firstUpdated() {
|
|
674
|
-
|
|
674
|
+
ee(this);
|
|
675
675
|
}
|
|
676
676
|
/**
|
|
677
677
|
* Overrides createRenderRoot to handle shadow DOM.
|
|
@@ -683,12 +683,12 @@ class wt extends _ {
|
|
|
683
683
|
var e, r;
|
|
684
684
|
return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (r = this.clickInteraction) == null ? void 0 : r.selectedFids[0], x`
|
|
685
685
|
<style>
|
|
686
|
-
${!this.unstyled &&
|
|
686
|
+
${!this.unstyled && ne}
|
|
687
687
|
</style>
|
|
688
688
|
<ul class="list-wrap">
|
|
689
689
|
${this.drawnFeatures.map((s, n) => {
|
|
690
|
-
const o = n + 1, l = s.
|
|
691
|
-
return
|
|
690
|
+
const o = n + 1, l = s.getId(), a = this.hoverId === l, h = this.clickId === l;
|
|
691
|
+
return te(
|
|
692
692
|
o,
|
|
693
693
|
x`
|
|
694
694
|
<li
|
|
@@ -717,7 +717,7 @@ class wt extends _ {
|
|
|
717
717
|
`;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
|
-
|
|
720
|
+
b(St, "properties", {
|
|
721
721
|
eoxMap: { attribute: !1, state: !0 },
|
|
722
722
|
olMap: { attribute: !1, state: !0 },
|
|
723
723
|
draw: { attribute: !1, state: !0 },
|
|
@@ -726,12 +726,12 @@ m(wt, "properties", {
|
|
|
726
726
|
modify: { attribute: !1, state: !0 },
|
|
727
727
|
unstyled: { type: Boolean }
|
|
728
728
|
});
|
|
729
|
-
customElements.define("eox-drawtools-list",
|
|
730
|
-
const
|
|
729
|
+
customElements.define("eox-drawtools-list", St);
|
|
730
|
+
const oe = (i) => {
|
|
731
731
|
const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: r } = i, s = !t && (e == null ? void 0 : e.length) > 0 || r, n = !(e != null && e.length) && !r;
|
|
732
732
|
return { drawDisabled: s, discardDisabled: n };
|
|
733
|
-
},
|
|
734
|
-
function
|
|
733
|
+
}, ae = 'button,.button { display: inline-flex; position: relative; align-items: center; color: #fff; border-width: 0; outline: none; border-radius: 4px; padding: 16px; height: 36px; cursor: pointer; font-family: inherit; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 1.25px; font-weight: 500; box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); transition-property: box-shadow, transform, opacity, background; transition-duration: 0.28s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);}button:hover:not([disabled]):not(.icon):not(.json-editor-btntype-*),.button:hover:not([disabled]):not(.icon) { box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12); background: var(--primary-btn-color-hover);}button,button:active,.button,.button:active { background: var(--primary-color);}button[disabled],.button[disabled] { opacity: 0.5; cursor: not-allowed;}button.block,.button.block { display: block;}button.outline,.button.outline { background: transparent; box-shadow: none; color: var(--primary-color); outline: 1px solid var(--primary-color);}button.outline:hover,.button.outline:hover { background: transparent;}button.icon,.button.icon,button[class*="json-editor-btntype-"] { background: transparent; border: none; box-shadow: none; padding: 0; border-radius: 50%; width: 24px; height: 24px; text-indent: -9999px;}button.icon-text,.button.icon-text { text-indent: 26px;}button.icon-text.block,.button.icon-text.block { text-indent: 20px;}button.icon:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon-text.block:before,.button.icon-text.block:before { text-indent: -54px;}button.icon:before,.button.icon:before,button[class*="json-editor-btntype-"]::before { width: 24px; height: 24px; margin-right: 0;}button.icon-text:before,.button.icon-text:before { width: 18px; height: 18px;}button.small,.button.small { height: 28px; padding: 12.4px; font-size: 0.75rem;}button.smallest.icon,button.smallest.icon::before { height: 16px; width: 16px; padding: 0;}', le = 'textarea { height: 90px; resize: none; border-radius: 4px; box-sizing: border-box !important; width: 100%; padding: 5px 7px; border: 1px solid var(--secondary-color); font-size: smaller; background: var(--background-color);}input[type="text"],input[type="url"],input[type="email"],input[type="password"],input[type="text"],input[type="number"],input[type="search"],input[type="tel"],select { box-sizing: border-box; width: 100%; margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 5px 7px; border-radius: 4px; border: 1px solid #0004;}';
|
|
734
|
+
function ce(i) {
|
|
735
735
|
navigator.clipboard.writeText(i).then(
|
|
736
736
|
function() {
|
|
737
737
|
},
|
|
@@ -745,29 +745,29 @@ function ne(i) {
|
|
|
745
745
|
* Copyright 2021 Google LLC
|
|
746
746
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
747
747
|
*/
|
|
748
|
-
function
|
|
748
|
+
function ft(i, t, e) {
|
|
749
749
|
return i ? t(i) : e == null ? void 0 : e(i);
|
|
750
750
|
}
|
|
751
|
-
var
|
|
752
|
-
class
|
|
751
|
+
var N, B;
|
|
752
|
+
class Ct extends A {
|
|
753
753
|
constructor() {
|
|
754
754
|
super();
|
|
755
755
|
/**
|
|
756
756
|
* @type boolean | import("lit").nothing
|
|
757
757
|
*/
|
|
758
|
-
|
|
758
|
+
$(this, N, !0);
|
|
759
759
|
/**
|
|
760
760
|
* @type boolean | import("lit").nothing
|
|
761
761
|
*/
|
|
762
|
-
|
|
763
|
-
this.multipleFeatures = !1, this.drawnFeatures = [], this.importFeatures = !1, this.showEditor = !1, this.currentlyDrawing = !1, this.drawFunc = null, this.geoJSON = "", this.unstyled = !1;
|
|
762
|
+
$(this, B, !0);
|
|
763
|
+
this.multipleFeatures = !1, this.drawnFeatures = [], this.importFeatures = !1, this.showEditor = !1, this.currentlyDrawing = !1, this.drawFunc = null, this.geoJSON = "", this.unstyled = !1, this.select = !1;
|
|
764
764
|
}
|
|
765
765
|
/**
|
|
766
766
|
* Updates button states based on conditions
|
|
767
767
|
*/
|
|
768
768
|
updateButtonStates() {
|
|
769
|
-
const { drawDisabled: e, discardDisabled: r } =
|
|
770
|
-
|
|
769
|
+
const { drawDisabled: e, discardDisabled: r } = oe(this);
|
|
770
|
+
g(this, N, e), g(this, B, r);
|
|
771
771
|
}
|
|
772
772
|
/**
|
|
773
773
|
* Overrides createRenderRoot to handle shadow DOM
|
|
@@ -780,8 +780,8 @@ class xt extends _ {
|
|
|
780
780
|
const e = this.currentlyDrawing ? "drawing" : "draw";
|
|
781
781
|
return x`
|
|
782
782
|
<style>
|
|
783
|
-
${!this.unstyled &&
|
|
784
|
-
${!this.unstyled &&
|
|
783
|
+
${!this.unstyled && ae}
|
|
784
|
+
${!this.unstyled && le}
|
|
785
785
|
</style>
|
|
786
786
|
<div class="wrap-btn">
|
|
787
787
|
<slot></slot>
|
|
@@ -789,8 +789,8 @@ class xt extends _ {
|
|
|
789
789
|
<!-- Draw Button -->
|
|
790
790
|
<button
|
|
791
791
|
data-cy="drawBtn"
|
|
792
|
-
class="polygon icon"
|
|
793
|
-
?disabled="${
|
|
792
|
+
class="${this.select ? "pointer" : "polygon"} icon"
|
|
793
|
+
?disabled="${y(this, N) || d}"
|
|
794
794
|
@click="${() => this.drawFunc.start()}"
|
|
795
795
|
>
|
|
796
796
|
${e}
|
|
@@ -800,7 +800,7 @@ class xt extends _ {
|
|
|
800
800
|
<button
|
|
801
801
|
data-cy="discardBtn"
|
|
802
802
|
class="discard icon"
|
|
803
|
-
?disabled="${
|
|
803
|
+
?disabled="${y(this, B) || d}"
|
|
804
804
|
@click="${() => this.drawFunc.discard()}"
|
|
805
805
|
>
|
|
806
806
|
discard
|
|
@@ -808,7 +808,7 @@ class xt extends _ {
|
|
|
808
808
|
</div>
|
|
809
809
|
|
|
810
810
|
<!-- Import Button -->
|
|
811
|
-
${
|
|
811
|
+
${ft(
|
|
812
812
|
this.importFeatures,
|
|
813
813
|
() => x`
|
|
814
814
|
<!-- Import Input Field : Hidden -->
|
|
@@ -832,7 +832,7 @@ class xt extends _ {
|
|
|
832
832
|
</div>
|
|
833
833
|
|
|
834
834
|
<!-- Geo JSON Wrapper -->
|
|
835
|
-
${
|
|
835
|
+
${ft(
|
|
836
836
|
this.showEditor,
|
|
837
837
|
() => x`
|
|
838
838
|
<div class="json-wrapper">
|
|
@@ -847,7 +847,7 @@ class xt extends _ {
|
|
|
847
847
|
<button
|
|
848
848
|
data-cy="copyBtn"
|
|
849
849
|
class="icon-copy"
|
|
850
|
-
@click=${() =>
|
|
850
|
+
@click=${() => ce(this.geoJSON)}
|
|
851
851
|
>
|
|
852
852
|
${this.unstyled ? "copy" : d}
|
|
853
853
|
</button>
|
|
@@ -857,22 +857,26 @@ class xt extends _ {
|
|
|
857
857
|
`;
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
|
|
861
|
-
|
|
860
|
+
N = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
|
|
861
|
+
b(Ct, "properties", {
|
|
862
862
|
multipleFeatures: { attribute: !1, type: Boolean },
|
|
863
863
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
864
864
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
865
865
|
drawFunc: { attribute: !1, type: Object },
|
|
866
|
+
select: { type: Boolean },
|
|
866
867
|
importFeatures: { attribute: "import-features", type: Boolean },
|
|
867
868
|
showEditor: { attribute: "show-editor", type: Boolean },
|
|
868
869
|
geoJSON: { attribute: "geo-json", type: String },
|
|
869
870
|
unstyled: { type: Boolean }
|
|
870
871
|
});
|
|
871
|
-
customElements.define("eox-drawtools-controller",
|
|
872
|
-
const
|
|
872
|
+
customElements.define("eox-drawtools-controller", Ct);
|
|
873
|
+
const he = `
|
|
873
874
|
button.discard:before {
|
|
874
875
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23FF5252' viewBox='0 0 24 24'%3E%3Ctitle%3Etrash-can-outline%3C/title%3E%3Cpath d='M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z' /%3E%3C/svg%3E")
|
|
875
876
|
}
|
|
877
|
+
button.pointer:before {
|
|
878
|
+
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Ecursor-default-click%3C/title%3E%3Cpath d='M10.76,8.69A0.76,0.76 0 0,0 10,9.45V20.9C10,21.32 10.34,21.66 10.76,21.66C10.95,21.66 11.11,21.6 11.24,21.5L13.15,19.95L14.81,23.57C14.94,23.84 15.21,24 15.5,24C15.61,24 15.72,24 15.83,23.92L18.59,22.64C18.97,22.46 19.15,22 18.95,21.63L17.28,18L19.69,17.55C19.85,17.5 20,17.43 20.12,17.29C20.39,16.97 20.35,16.5 20,16.21L11.26,8.86L11.25,8.87C11.12,8.76 10.95,8.69 10.76,8.69M15,10V8H20V10H15M13.83,4.76L16.66,1.93L18.07,3.34L15.24,6.17L13.83,4.76M10,0H12V5H10V0M3.93,14.66L6.76,11.83L8.17,13.24L5.34,16.07L3.93,14.66M3.93,3.34L5.34,1.93L8.17,4.76L6.76,6.17L3.93,3.34M7,10H2V8H7V10' /%3E%3C/svg%3E");
|
|
879
|
+
}
|
|
876
880
|
button.polygon:before {
|
|
877
881
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eshape-polygon-plus%3C/title%3E%3Cpath d='M17,15.7V13H19V17L10,21L3,14L7,5H11V7H8.3L5.4,13.6L10.4,18.6L17,15.7M22,5V7H19V10H17V7H14V5H17V2H19V5H22Z' /%3E%3C/svg%3E");
|
|
878
882
|
}
|
|
@@ -911,28 +915,40 @@ const oe = `
|
|
|
911
915
|
color: white;
|
|
912
916
|
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Econtent-copy%3C/title%3E%3Cpath d='M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z' fill='white' /%3E%3C/svg%3E")
|
|
913
917
|
}
|
|
914
|
-
`,
|
|
918
|
+
`, de = (i) => {
|
|
915
919
|
(() => {
|
|
916
|
-
i.emitDrawnFeatures(), i.multipleFeatures || (i.draw.setActive(!1), i.currentlyDrawing = !1);
|
|
920
|
+
i.emitDrawnFeatures(), i.multipleFeatures || (i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent(), i.currentlyDrawing = !1);
|
|
917
921
|
})(), i.requestUpdate();
|
|
918
|
-
},
|
|
922
|
+
}, pe = (i) => {
|
|
919
923
|
const t = () => {
|
|
920
|
-
i.drawLayer.set("isDrawingEnabled", !0), i.draw.setActive(!0);
|
|
924
|
+
i.drawLayer.set("isDrawingEnabled", !0), i.draw.setActive(!0), i.selectionEvents.addSelectionEvent();
|
|
921
925
|
}, e = () => {
|
|
922
926
|
i.currentlyDrawing = !0, i.requestUpdate();
|
|
923
927
|
};
|
|
924
928
|
t(), e();
|
|
925
|
-
},
|
|
929
|
+
}, ue = (i) => {
|
|
926
930
|
let t;
|
|
927
931
|
return typeof i == "string" ? t = /** @type {HTMLElement} */
|
|
928
932
|
document.querySelector(i) : t = i, t;
|
|
929
|
-
},
|
|
933
|
+
}, tt = (i, t) => {
|
|
934
|
+
for (const e of i) {
|
|
935
|
+
if (e.type === "Group") {
|
|
936
|
+
const r = tt(e.layers, t);
|
|
937
|
+
if (!r)
|
|
938
|
+
continue;
|
|
939
|
+
return r;
|
|
940
|
+
}
|
|
941
|
+
if (e.properties.id === t)
|
|
942
|
+
return e;
|
|
943
|
+
}
|
|
944
|
+
}, gt = (i, t) => {
|
|
930
945
|
var n;
|
|
931
|
-
const r =
|
|
946
|
+
const r = ue(i.for), s = r.map;
|
|
932
947
|
return i.drawLayer = r.addOrUpdateLayer({
|
|
933
948
|
type: "Vector",
|
|
934
949
|
properties: {
|
|
935
950
|
id: "drawLayer",
|
|
951
|
+
// @ts-expect-error TODO
|
|
936
952
|
layerControlHide: !0,
|
|
937
953
|
isDrawingEnabled: !1,
|
|
938
954
|
multipleFeatures: t
|
|
@@ -953,6 +969,7 @@ const oe = `
|
|
|
953
969
|
},
|
|
954
970
|
{
|
|
955
971
|
type: "select",
|
|
972
|
+
//@ts-expect-error TODO
|
|
956
973
|
options: {
|
|
957
974
|
id: "selectHover",
|
|
958
975
|
condition: "pointermove",
|
|
@@ -965,6 +982,7 @@ const oe = `
|
|
|
965
982
|
},
|
|
966
983
|
{
|
|
967
984
|
type: "select",
|
|
985
|
+
//@ts-expect-error TODO
|
|
968
986
|
options: {
|
|
969
987
|
id: "selectClick",
|
|
970
988
|
condition: "click",
|
|
@@ -981,20 +999,96 @@ const oe = `
|
|
|
981
999
|
/** @type {unknown} */
|
|
982
1000
|
r.interactions.drawInteraction, i.modify = /** @type {import("ol/interaction").Modify} */
|
|
983
1001
|
/** @type {unknown} */
|
|
984
|
-
r.interactions.drawInteractionmodify, (n = i.modify) == null || n.on("modifyend", () => i.onModifyEnd()), r.addEventListener("addfeatures", () =>
|
|
985
|
-
},
|
|
1002
|
+
r.interactions.drawInteractionmodify, X(i, r, i.layerId), (n = i.modify) == null || n.on("modifyend", () => i.onModifyEnd()), r.addEventListener("addfeatures", () => de(i)), { EoxMap: r, OlMap: s };
|
|
1003
|
+
}, ye = (i) => {
|
|
986
1004
|
const t = () => {
|
|
987
|
-
i.drawnFeatures = [],
|
|
1005
|
+
i.drawnFeatures = [], setTimeout(() => {
|
|
1006
|
+
i.draw.setActive(!1), i.selectionEvents.removeSelectionEvent();
|
|
1007
|
+
}, 200), i.drawLayer.getSource().clear(), i.geoJSON = null;
|
|
988
1008
|
}, e = () => {
|
|
989
1009
|
i.emitDrawnFeatures(), i.currentlyDrawing = !1, i.requestUpdate();
|
|
990
1010
|
};
|
|
991
1011
|
t(), e();
|
|
992
|
-
},
|
|
1012
|
+
}, fe = (i, t) => {
|
|
993
1013
|
setTimeout(() => {
|
|
994
1014
|
i.drawnFeatures = i.drawLayer.getSource().getFeatures(), i.updateGeoJSON(), i.requestUpdate(), t();
|
|
995
1015
|
}, 0);
|
|
996
|
-
},
|
|
997
|
-
|
|
1016
|
+
}, ge = (i) => {
|
|
1017
|
+
const t = (s) => {
|
|
1018
|
+
(s == null ? void 0 : s.detail.id) !== "SelectLayerClickInteraction" || !s.detail.feature || (i.drawLayer.getSource().addFeature(s.detail.feature), i.eoxMap.dispatchEvent(
|
|
1019
|
+
new CustomEvent("addfeatures", { detail: s.detail })
|
|
1020
|
+
));
|
|
1021
|
+
};
|
|
1022
|
+
return { addSelectionEvent: () => {
|
|
1023
|
+
i.layerId && (i.eoxMap.selectInteractions.SelectLayerHoverInteraction.setActive(!0), i.eoxMap.addEventListener("select", t));
|
|
1024
|
+
}, removeSelectionEvent: () => {
|
|
1025
|
+
var n;
|
|
1026
|
+
const s = (n = i.eoxMap.selectInteractions) == null ? void 0 : n.SelectLayerHoverInteraction;
|
|
1027
|
+
s && (s.selectedFids = [], s.setActive(!1)), i.eoxMap.removeEventListener("select", t);
|
|
1028
|
+
} };
|
|
1029
|
+
}, X = (i, t, e) => {
|
|
1030
|
+
if (!e || !t)
|
|
1031
|
+
return;
|
|
1032
|
+
const r = tt(t.layers, e) || null;
|
|
1033
|
+
if (!r) {
|
|
1034
|
+
console.error(`Layer with id ${e} not found`);
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
const s = {
|
|
1038
|
+
type: "select",
|
|
1039
|
+
active: !1,
|
|
1040
|
+
//@ts-expect-error TODO
|
|
1041
|
+
options: {
|
|
1042
|
+
id: "SelectLayerHoverInteraction",
|
|
1043
|
+
condition: "pointermove",
|
|
1044
|
+
active: !1,
|
|
1045
|
+
style: {
|
|
1046
|
+
"fill-color": "rgba(0, 0, 0,0.0)",
|
|
1047
|
+
"stroke-color": "#3399CC",
|
|
1048
|
+
"stroke-width": 2.5
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}, n = {
|
|
1052
|
+
type: "select",
|
|
1053
|
+
//@ts-expect-error TODO
|
|
1054
|
+
options: {
|
|
1055
|
+
id: "SelectLayerClickInteraction",
|
|
1056
|
+
condition: "click",
|
|
1057
|
+
multi: i.multipleFeatures,
|
|
1058
|
+
modify: i.allowModify,
|
|
1059
|
+
active: !1,
|
|
1060
|
+
style: {
|
|
1061
|
+
"fill-color": "rgba(0, 0, 0,0.0)",
|
|
1062
|
+
"stroke-color": "rgba(0, 0, 0,0.0)"
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
r.interactions = [s, n], t.addOrUpdateLayer(r);
|
|
1067
|
+
const o = i.draw;
|
|
1068
|
+
i.draw = t.selectInteractions.SelectLayerClickInteraction, setTimeout(() => {
|
|
1069
|
+
o.setActive(!1), t.selectInteractions.SelectLayerClickInteraction.setActive(!1), t.selectInteractions.SelectLayerHoverInteraction.setActive(!1);
|
|
1070
|
+
}, 200);
|
|
1071
|
+
}, me = (i, t, e, r) => {
|
|
1072
|
+
if (t) {
|
|
1073
|
+
if (e) {
|
|
1074
|
+
r && e !== r && mt(i, t, r), X(i, t, e);
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
if (!e && r) {
|
|
1078
|
+
mt(i, t, r);
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
function mt(i, t, e) {
|
|
1084
|
+
if (!t)
|
|
1085
|
+
return;
|
|
1086
|
+
const r = tt(t.layers, e) || null;
|
|
1087
|
+
i.draw = /** @type {import("ol/interaction").Draw} */
|
|
1088
|
+
t.interactions.drawInteraction, r && (delete r.interactions, t.addOrUpdateLayer(r));
|
|
1089
|
+
}
|
|
1090
|
+
const ve = ':root,:host { --spacing: 1rem; --block-spacing-vertical: calc(var(--spacing) * 2); --block-spacing-horizontal: var(--spacing); --background-color: var(--eox-background-color, white); --color: var(--eox-color, #2c3d49); --h-color: var(--eox-h-color, var(--color)); --hover-transparency: var(--eox-hover-transparency, 20%); --bg-hover-transparency: var(--eox-bg-hover-transparency, 40%); --btn-hover-transparency: var(--eox-btn-hover-transparency, 80%); --primary-color: var(--eox-primary-color, #004170); --primary-color-hover: color-mix( in srgb, var(--primary-color) var(--hover-transparency), transparent ); --primary-bg-color-hover: color-mix( in srgb, var(--primary-color) var(--bg-hover-transparency), transparent ); --primary-btn-color-hover: color-mix( in srgb, var(--primary-color) var(--btn-hover-transparency), transparent ); --secondary-color: var(--eox-secondary-color, #c6d4df); --secondary-color-hover: color-mix( in srgb, var(--secondary-color) var(--hover-transparency), transparent ); --secondary-bg-color-hover: color-mix( in srgb, var(--secondary-color) var(--bg-hover-transparency), transparent ); --secondary-btn-color-hover: color-mix( in srgb, var(--secondary-color) var(--btn-hover-transparency), transparent ); --success: var(--eox-success, #26cc0f); --warning: var(--eox-warning, #f18e32); --error: var(--eox-error, #ff5252); --header-font-family: var(--eox-header-font-family, "Roboto", sans-serif); --body-font-family: var(--eox-body-font-family, "Roboto", sans-serif);}* { font-size: normal; font-family: var(--body-font-family); color: var(--eox-color);}h1,h2,h3,h4,h5,h6 { font-family: var(--header-font-family);}span,p,div,main,label { font-family: var(--body-font-family);}@media (min-width: 576px) { .container { max-width: 510px; padding-right: 0; padding-left: 0; --block-spacing-vertical: calc(var(--spacing) * 2.5); }}@media (min-width: 768px) { .container { max-width: 700px; --block-spacing-vertical: calc(var(--spacing) * 3); }}@media (min-width: 992px) { .container { max-width: 920px; --block-spacing-vertical: calc(var(--spacing) * 3.5); }}@media (min-width: 1200px) { .container { max-width: 1130px; --block-spacing-vertical: calc(var(--spacing) * 4); }}.container { width: 100%; margin-right: auto; margin-left: auto; display: block; padding: var(--block-spacing-vertical) var(--block-spacing-horizontal);}h1,h2,h3 { line-height: 120%; margin-top: 0.8rem; margin-bottom: 0.8rem;}p { --font-size: 1rem; font-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem; font-size: var(--font-size);}body { padding: 0; margin: 0;}.sb-show-main.sb-main-padded { padding: 0;}h1,h2,h3,h4,h5,h6 { --font-weight: 700;}h1 { --font-size: 3rem; --typography-spacing-vertical: 0.5rem;}h2 { --font-size: 2rem; --typography-spacing-vertical: 0.5rem;}h3 { --font-size: 1.75rem; --typography-spacing-vertical: 0.5rem;}h4 { --font-size: 1.5rem; --typography-spacing-vertical: 0.5rem;}h5 { --font-size: 1.25rem; --typography-spacing-vertical: 0.5rem;}h1,h2,h3,h4,h5,h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--h-color); font-weight: var(--font-weight); font-size: var(--font-size); font-family: var(--header-font-family);}';
|
|
1091
|
+
function be(i, t) {
|
|
998
1092
|
function e(n) {
|
|
999
1093
|
n.preventDefault(), n.stopPropagation();
|
|
1000
1094
|
}
|
|
@@ -1006,39 +1100,43 @@ function ue(i, t) {
|
|
|
1006
1100
|
}
|
|
1007
1101
|
["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
|
|
1008
1102
|
t.addEventListener(n, e, !1), ["dragenter", "dragover"].includes(n) ? t.addEventListener(n, r, !1) : t.addEventListener(n, s, !1);
|
|
1009
|
-
}), t.addEventListener("drop", (n) =>
|
|
1103
|
+
}), t.addEventListener("drop", (n) => Et(n, i), !1);
|
|
1010
1104
|
}
|
|
1011
|
-
function
|
|
1105
|
+
function $e(i) {
|
|
1012
1106
|
i.preventDefault(), i.stopPropagation();
|
|
1013
1107
|
}
|
|
1014
|
-
function
|
|
1015
|
-
|
|
1108
|
+
function Et(i, t) {
|
|
1109
|
+
$e(i);
|
|
1016
1110
|
const e = i.dataTransfer ? i.dataTransfer.files : i.target.files;
|
|
1017
|
-
Array.from(e).forEach((r) =>
|
|
1111
|
+
Array.from(e).forEach((r) => we(r, t));
|
|
1018
1112
|
}
|
|
1019
|
-
function
|
|
1113
|
+
function we(i, t) {
|
|
1020
1114
|
const e = new FileReader();
|
|
1021
1115
|
e.readAsText(i), e.onloadend = function() {
|
|
1022
1116
|
typeof e.result == "string" && t.handleFeatureChange(e.result);
|
|
1023
1117
|
};
|
|
1024
1118
|
}
|
|
1025
|
-
var
|
|
1026
|
-
class
|
|
1119
|
+
var E, H, R, k;
|
|
1120
|
+
class _e extends A {
|
|
1027
1121
|
constructor() {
|
|
1028
1122
|
super();
|
|
1029
1123
|
/**
|
|
1030
|
-
* @type import("../../map/main").EOxMap
|
|
1124
|
+
* @type import("../../map/src/main").EOxMap
|
|
1031
1125
|
*/
|
|
1032
|
-
|
|
1126
|
+
$(this, E);
|
|
1033
1127
|
/**
|
|
1034
1128
|
* @type import("ol").Map
|
|
1035
1129
|
*/
|
|
1036
|
-
|
|
1130
|
+
$(this, H);
|
|
1131
|
+
/**
|
|
1132
|
+
* @type string
|
|
1133
|
+
*/
|
|
1134
|
+
$(this, R);
|
|
1037
1135
|
/**
|
|
1038
1136
|
* @type string
|
|
1039
1137
|
*/
|
|
1040
|
-
|
|
1041
|
-
this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.type = "Polygon", this.unstyled = !1, this.noShadow = !1;
|
|
1138
|
+
$(this, k);
|
|
1139
|
+
this.allowModify = !1, this.for = "eox-map", this.currentlyDrawing = !1, this.draw = null, this.drawLayer = null, this.layerId = "", this.drawnFeatures = [], this.modify = null, this.multipleFeatures = !1, this.importFeatures = !1, this.showEditor = !1, this.showList = !1, this.type = "Polygon", this.unstyled = !1, this.noShadow = !1, this.selectionEvents = null;
|
|
1042
1140
|
}
|
|
1043
1141
|
// Define properties with defaults and types
|
|
1044
1142
|
static get properties() {
|
|
@@ -1048,6 +1146,7 @@ class fe extends _ {
|
|
|
1048
1146
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
1049
1147
|
draw: { attribute: !1, state: !0 },
|
|
1050
1148
|
drawLayer: { attribute: !1, state: !0 },
|
|
1149
|
+
layerId: { attribute: "layer-id", type: String },
|
|
1051
1150
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
1052
1151
|
modify: { attribute: !1, state: !0 },
|
|
1053
1152
|
multipleFeatures: { attribute: "multiple-features", type: Boolean },
|
|
@@ -1059,18 +1158,29 @@ class fe extends _ {
|
|
|
1059
1158
|
unstyled: { type: Boolean }
|
|
1060
1159
|
};
|
|
1061
1160
|
}
|
|
1161
|
+
/**
|
|
1162
|
+
*
|
|
1163
|
+
*
|
|
1164
|
+
* @type {string}
|
|
1165
|
+
*/
|
|
1166
|
+
set layerId(e) {
|
|
1167
|
+
me(this, this.eoxMap, e, y(this, k)), g(this, k, e);
|
|
1168
|
+
}
|
|
1169
|
+
get layerId() {
|
|
1170
|
+
return y(this, k);
|
|
1171
|
+
}
|
|
1062
1172
|
/**
|
|
1063
1173
|
* @onClick Event handler triggered to start drawing on the map.
|
|
1064
1174
|
*/
|
|
1065
|
-
|
|
1066
|
-
|
|
1175
|
+
startDrawing() {
|
|
1176
|
+
pe(this);
|
|
1067
1177
|
}
|
|
1068
1178
|
/**
|
|
1069
1179
|
* @onClick Event handler triggered to discard/stop drawing
|
|
1070
1180
|
* on the map and delete the drawn shapes.
|
|
1071
1181
|
*/
|
|
1072
|
-
|
|
1073
|
-
|
|
1182
|
+
discardDrawing() {
|
|
1183
|
+
ye(this);
|
|
1074
1184
|
}
|
|
1075
1185
|
/**
|
|
1076
1186
|
* @param {string} text - The string representation of the features to be parsed.
|
|
@@ -1078,8 +1188,9 @@ class fe extends _ {
|
|
|
1078
1188
|
*/
|
|
1079
1189
|
handleFeatureChange(e, r = !1) {
|
|
1080
1190
|
this.eoxMap.parseTextToFeature(
|
|
1081
|
-
e || JSON.stringify(
|
|
1191
|
+
e || JSON.stringify(yt),
|
|
1082
1192
|
this.drawLayer,
|
|
1193
|
+
this.eoxMap,
|
|
1083
1194
|
r
|
|
1084
1195
|
);
|
|
1085
1196
|
}
|
|
@@ -1087,7 +1198,7 @@ class fe extends _ {
|
|
|
1087
1198
|
* @param {DragEvent | Event} evt - The event object from the file input interaction.
|
|
1088
1199
|
*/
|
|
1089
1200
|
handleFilesChange(e) {
|
|
1090
|
-
|
|
1201
|
+
Et(e, this);
|
|
1091
1202
|
}
|
|
1092
1203
|
/**
|
|
1093
1204
|
* @event onModifyEnd triggered when the modification of a shape is completed.
|
|
@@ -1099,8 +1210,8 @@ class fe extends _ {
|
|
|
1099
1210
|
* Update #geoJSON with stringify feature.
|
|
1100
1211
|
*/
|
|
1101
1212
|
updateGeoJSON() {
|
|
1102
|
-
|
|
1103
|
-
this.eoxMap.parseFeature(this.drawnFeatures) ||
|
|
1213
|
+
g(this, R, JSON.stringify(
|
|
1214
|
+
this.eoxMap.parseFeature(this.drawnFeatures) || yt,
|
|
1104
1215
|
void 0,
|
|
1105
1216
|
2
|
|
1106
1217
|
));
|
|
@@ -1109,7 +1220,7 @@ class fe extends _ {
|
|
|
1109
1220
|
* Triggers different events when the drawing of a shape is completed.
|
|
1110
1221
|
*/
|
|
1111
1222
|
emitDrawnFeatures() {
|
|
1112
|
-
|
|
1223
|
+
fe(this, () => {
|
|
1113
1224
|
this.dispatchEvent(
|
|
1114
1225
|
new CustomEvent("drawupdate", { detail: this.drawnFeatures })
|
|
1115
1226
|
);
|
|
@@ -1127,21 +1238,21 @@ class fe extends _ {
|
|
|
1127
1238
|
* It then calls requestUpdate to trigger a re-render.
|
|
1128
1239
|
*/
|
|
1129
1240
|
firstUpdated() {
|
|
1130
|
-
const { EoxMap: e, OlMap: r } =
|
|
1131
|
-
this.eoxMap = e,
|
|
1241
|
+
const { EoxMap: e, OlMap: r } = gt(this, this.multipleFeatures);
|
|
1242
|
+
this.eoxMap = e, g(this, H, r), this.selectionEvents = ge(this), this.importFeatures && be(this, this.eoxMap), this.updateGeoJSON(), this.requestUpdate();
|
|
1132
1243
|
}
|
|
1133
1244
|
updated(e) {
|
|
1134
1245
|
if (e.has("for")) {
|
|
1135
|
-
const { EoxMap: r, OlMap: s } =
|
|
1136
|
-
this.eoxMap = r,
|
|
1246
|
+
const { EoxMap: r, OlMap: s } = gt(this, this.multipleFeatures);
|
|
1247
|
+
this.eoxMap = r, g(this, H, s);
|
|
1137
1248
|
}
|
|
1138
1249
|
}
|
|
1139
1250
|
get eoxMap() {
|
|
1140
|
-
return
|
|
1251
|
+
return y(this, E);
|
|
1141
1252
|
}
|
|
1142
1253
|
set eoxMap(e) {
|
|
1143
|
-
const r =
|
|
1144
|
-
|
|
1254
|
+
const r = y(this, E);
|
|
1255
|
+
g(this, E, e), this.requestUpdate("eoxMap", r);
|
|
1145
1256
|
}
|
|
1146
1257
|
// Render method for UI display
|
|
1147
1258
|
render() {
|
|
@@ -1149,31 +1260,32 @@ class fe extends _ {
|
|
|
1149
1260
|
return x`
|
|
1150
1261
|
<style>
|
|
1151
1262
|
:host { display: block; }
|
|
1152
|
-
${!this.unstyled &&
|
|
1153
|
-
${!this.unstyled &&
|
|
1263
|
+
${!this.unstyled && ve}
|
|
1264
|
+
${!this.unstyled && he}
|
|
1154
1265
|
</style>
|
|
1155
1266
|
|
|
1156
1267
|
<!-- Controller Component -->
|
|
1157
1268
|
<eox-drawtools-controller
|
|
1158
1269
|
.drawFunc=${{
|
|
1159
|
-
start: () => this.
|
|
1160
|
-
discard: () => this.
|
|
1270
|
+
start: () => this.startDrawing(),
|
|
1271
|
+
discard: () => this.discardDrawing(),
|
|
1161
1272
|
editor: (r) => this.handleFeatureChange(r.target.value, !0),
|
|
1162
1273
|
import: (r) => this.handleFilesChange(r)
|
|
1163
1274
|
}}
|
|
1275
|
+
?select=${!!this.layerId}
|
|
1164
1276
|
.unstyled=${this.unstyled}
|
|
1165
1277
|
.drawnFeatures=${this.drawnFeatures}
|
|
1166
1278
|
.currentlyDrawing=${this.currentlyDrawing}
|
|
1167
1279
|
.multipleFeatures=${this.multipleFeatures}
|
|
1168
1280
|
.importFeatures=${this.importFeatures}
|
|
1169
1281
|
.showEditor=${this.showEditor}
|
|
1170
|
-
.geoJSON=${
|
|
1282
|
+
.geoJSON=${y(this, R)}
|
|
1171
1283
|
></eox-drawtools-controller>
|
|
1172
1284
|
|
|
1173
1285
|
<!-- List Component -->
|
|
1174
1286
|
${this.showList && ((e = this.drawnFeatures) != null && e.length) ? x`<eox-drawtools-list
|
|
1175
1287
|
.eoxMap=${this.eoxMap}
|
|
1176
|
-
.olMap=${
|
|
1288
|
+
.olMap=${y(this, H)}
|
|
1177
1289
|
.draw=${this.draw}
|
|
1178
1290
|
.drawLayer=${this.drawLayer}
|
|
1179
1291
|
.drawnFeatures=${this.drawnFeatures}
|
|
@@ -1186,8 +1298,8 @@ class fe extends _ {
|
|
|
1186
1298
|
`;
|
|
1187
1299
|
}
|
|
1188
1300
|
}
|
|
1189
|
-
|
|
1190
|
-
customElements.define("eox-drawtools",
|
|
1301
|
+
E = new WeakMap(), H = new WeakMap(), R = new WeakMap(), k = new WeakMap();
|
|
1302
|
+
customElements.define("eox-drawtools", _e);
|
|
1191
1303
|
export {
|
|
1192
|
-
|
|
1304
|
+
_e as EOxDrawTools
|
|
1193
1305
|
};
|