@eox/drawtools 0.6.1 → 0.8.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 +574 -546
- package/dist/eox-drawtools.umd.cjs +142 -221
- package/package.json +3 -3
- package/test/_mockMap.js +3 -0
- package/test/cases/click-discard-btn.js +14 -18
- package/test/cases/click-draw-btn.js +12 -16
- package/test/cases/copy-geo-json-editor.js +37 -0
- package/test/cases/index.js +1 -0
- package/test/cases/load-drawtool.js +2 -4
- package/test/general.cy.js +8 -1
package/dist/eox-drawtools.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
if (!t.has(
|
|
1
|
+
var _t = Object.defineProperty;
|
|
2
|
+
var xt = (r, t, e) => t in r ? _t(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var b = (r, t, e) => (xt(r, typeof t != "symbol" ? t + "" : t, e), e), Q = (r, t, e) => {
|
|
4
|
+
if (!t.has(r))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
if (t.has(
|
|
7
|
+
var g = (r, t, e) => (Q(r, t, "read from private field"), e ? e.call(r) : t.get(r)), S = (r, t, e) => {
|
|
8
|
+
if (t.has(r))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
|
-
t instanceof WeakSet ? t.add(
|
|
11
|
-
},
|
|
10
|
+
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
|
11
|
+
}, E = (r, t, e, i) => (Q(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e);
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const D = globalThis, K = D.ShadowRoot && (D.ShadyCSS === void 0 || D.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, pt = Symbol(), X = /* @__PURE__ */ new WeakMap();
|
|
18
18
|
let At = class {
|
|
19
|
-
constructor(t, e,
|
|
20
|
-
if (this._$cssResult$ = !0,
|
|
19
|
+
constructor(t, e, i) {
|
|
20
|
+
if (this._$cssResult$ = !0, i !== pt)
|
|
21
21
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
22
22
|
this.cssText = t, this.t = e;
|
|
23
23
|
}
|
|
24
24
|
get styleSheet() {
|
|
25
25
|
let t = this.o;
|
|
26
26
|
const e = this.t;
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
if (K && t === void 0) {
|
|
28
|
+
const i = e !== void 0 && e.length === 1;
|
|
29
|
+
i && (t = X.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && X.set(e, t));
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
32
|
}
|
|
@@ -34,56 +34,56 @@ let At = class {
|
|
|
34
34
|
return this.cssText;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
37
|
+
const St = (r) => new At(typeof r == "string" ? r : r + "", void 0, pt), Et = (r, t) => {
|
|
38
|
+
if (K)
|
|
39
|
+
r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
40
40
|
else
|
|
41
41
|
for (const e of t) {
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const i = document.createElement("style"), s = D.litNonce;
|
|
43
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
|
44
44
|
}
|
|
45
|
-
}, Y =
|
|
45
|
+
}, Y = K ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
46
46
|
let e = "";
|
|
47
|
-
for (const
|
|
48
|
-
e +=
|
|
49
|
-
return
|
|
50
|
-
})(
|
|
47
|
+
for (const i of t.cssRules)
|
|
48
|
+
e += i.cssText;
|
|
49
|
+
return St(e);
|
|
50
|
+
})(r) : r;
|
|
51
51
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2017 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
55
|
*/
|
|
56
|
-
const { is:
|
|
56
|
+
const { is: Ct, defineProperty: Ft, getOwnPropertyDescriptor: Ht, getOwnPropertyNames: kt, getOwnPropertySymbols: Mt, getPrototypeOf: Ut } = Object, $ = globalThis, tt = $.trustedTypes, Pt = tt ? tt.emptyScript : "", q = $.reactiveElementPolyfillSupport, M = (r, t) => r, Z = { toAttribute(r, t) {
|
|
57
57
|
switch (t) {
|
|
58
58
|
case Boolean:
|
|
59
|
-
|
|
59
|
+
r = r ? Pt : null;
|
|
60
60
|
break;
|
|
61
61
|
case Object:
|
|
62
62
|
case Array:
|
|
63
|
-
|
|
63
|
+
r = r == null ? r : JSON.stringify(r);
|
|
64
64
|
}
|
|
65
|
-
return
|
|
66
|
-
}, fromAttribute(
|
|
67
|
-
let e =
|
|
65
|
+
return r;
|
|
66
|
+
}, fromAttribute(r, t) {
|
|
67
|
+
let e = r;
|
|
68
68
|
switch (t) {
|
|
69
69
|
case Boolean:
|
|
70
|
-
e =
|
|
70
|
+
e = r !== null;
|
|
71
71
|
break;
|
|
72
72
|
case Number:
|
|
73
|
-
e =
|
|
73
|
+
e = r === null ? null : Number(r);
|
|
74
74
|
break;
|
|
75
75
|
case Object:
|
|
76
76
|
case Array:
|
|
77
77
|
try {
|
|
78
|
-
e = JSON.parse(
|
|
78
|
+
e = JSON.parse(r);
|
|
79
79
|
} catch {
|
|
80
80
|
e = null;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
return e;
|
|
84
|
-
} },
|
|
85
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
86
|
-
class
|
|
84
|
+
} }, ut = (r, t) => !Ct(r, t), et = { attribute: !0, type: String, converter: Z, reflect: !1, hasChanged: ut };
|
|
85
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
86
|
+
class C extends HTMLElement {
|
|
87
87
|
static addInitializer(t) {
|
|
88
88
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
89
89
|
}
|
|
@@ -92,143 +92,143 @@ class v extends HTMLElement {
|
|
|
92
92
|
}
|
|
93
93
|
static createProperty(t, e = et) {
|
|
94
94
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
|
96
|
+
s !== void 0 && Ft(this.prototype, t, s);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
static getPropertyDescriptor(t, e,
|
|
100
|
-
const { get:
|
|
99
|
+
static getPropertyDescriptor(t, e, i) {
|
|
100
|
+
const { get: s, set: n } = Ht(this.prototype, t) ?? { get() {
|
|
101
101
|
return this[e];
|
|
102
102
|
}, set(o) {
|
|
103
103
|
this[e] = o;
|
|
104
104
|
} };
|
|
105
105
|
return { get() {
|
|
106
|
-
return
|
|
106
|
+
return s == null ? void 0 : s.call(this);
|
|
107
107
|
}, set(o) {
|
|
108
|
-
const l =
|
|
109
|
-
n.call(this, o), this.requestUpdate(t, l,
|
|
108
|
+
const l = s == null ? void 0 : s.call(this);
|
|
109
|
+
n.call(this, o), this.requestUpdate(t, l, i);
|
|
110
110
|
}, configurable: !0, enumerable: !0 };
|
|
111
111
|
}
|
|
112
112
|
static getPropertyOptions(t) {
|
|
113
113
|
return this.elementProperties.get(t) ?? et;
|
|
114
114
|
}
|
|
115
115
|
static _$Ei() {
|
|
116
|
-
if (this.hasOwnProperty(
|
|
116
|
+
if (this.hasOwnProperty(M("elementProperties")))
|
|
117
117
|
return;
|
|
118
|
-
const t =
|
|
118
|
+
const t = Ut(this);
|
|
119
119
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
120
120
|
}
|
|
121
121
|
static finalize() {
|
|
122
|
-
if (this.hasOwnProperty(
|
|
122
|
+
if (this.hasOwnProperty(M("finalized")))
|
|
123
123
|
return;
|
|
124
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
125
|
-
const e = this.properties,
|
|
126
|
-
for (const
|
|
127
|
-
this.createProperty(
|
|
124
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
125
|
+
const e = this.properties, i = [...kt(e), ...Mt(e)];
|
|
126
|
+
for (const s of i)
|
|
127
|
+
this.createProperty(s, e[s]);
|
|
128
128
|
}
|
|
129
129
|
const t = this[Symbol.metadata];
|
|
130
130
|
if (t !== null) {
|
|
131
131
|
const e = litPropertyMetadata.get(t);
|
|
132
132
|
if (e !== void 0)
|
|
133
|
-
for (const [
|
|
134
|
-
this.elementProperties.set(
|
|
133
|
+
for (const [i, s] of e)
|
|
134
|
+
this.elementProperties.set(i, s);
|
|
135
135
|
}
|
|
136
136
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
137
|
-
for (const [e,
|
|
138
|
-
const
|
|
139
|
-
|
|
137
|
+
for (const [e, i] of this.elementProperties) {
|
|
138
|
+
const s = this._$Eu(e, i);
|
|
139
|
+
s !== void 0 && this._$Eh.set(s, e);
|
|
140
140
|
}
|
|
141
141
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
142
142
|
}
|
|
143
143
|
static finalizeStyles(t) {
|
|
144
144
|
const e = [];
|
|
145
145
|
if (Array.isArray(t)) {
|
|
146
|
-
const
|
|
147
|
-
for (const
|
|
148
|
-
e.unshift(Y(
|
|
146
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
|
147
|
+
for (const s of i)
|
|
148
|
+
e.unshift(Y(s));
|
|
149
149
|
} else
|
|
150
150
|
t !== void 0 && e.push(Y(t));
|
|
151
151
|
return e;
|
|
152
152
|
}
|
|
153
153
|
static _$Eu(t, e) {
|
|
154
|
-
const
|
|
155
|
-
return
|
|
154
|
+
const i = e.attribute;
|
|
155
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
156
156
|
}
|
|
157
157
|
constructor() {
|
|
158
158
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
159
159
|
}
|
|
160
160
|
_$Ev() {
|
|
161
161
|
var t;
|
|
162
|
-
this._$
|
|
162
|
+
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
163
163
|
}
|
|
164
164
|
addController(t) {
|
|
165
165
|
var e;
|
|
166
|
-
(this._$
|
|
166
|
+
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
167
167
|
}
|
|
168
168
|
removeController(t) {
|
|
169
169
|
var e;
|
|
170
|
-
(e = this._$
|
|
170
|
+
(e = this._$EO) == null || e.delete(t);
|
|
171
171
|
}
|
|
172
172
|
_$E_() {
|
|
173
173
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
174
|
-
for (const
|
|
175
|
-
this.hasOwnProperty(
|
|
174
|
+
for (const i of e.keys())
|
|
175
|
+
this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
176
176
|
t.size > 0 && (this._$Ep = t);
|
|
177
177
|
}
|
|
178
178
|
createRenderRoot() {
|
|
179
179
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
180
|
-
return
|
|
180
|
+
return Et(t, this.constructor.elementStyles), t;
|
|
181
181
|
}
|
|
182
182
|
connectedCallback() {
|
|
183
183
|
var t;
|
|
184
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$
|
|
185
|
-
var
|
|
186
|
-
return (
|
|
184
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
185
|
+
var i;
|
|
186
|
+
return (i = e.hostConnected) == null ? void 0 : i.call(e);
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
enableUpdating(t) {
|
|
190
190
|
}
|
|
191
191
|
disconnectedCallback() {
|
|
192
192
|
var t;
|
|
193
|
-
(t = this._$
|
|
194
|
-
var
|
|
195
|
-
return (
|
|
193
|
+
(t = this._$EO) == null || t.forEach((e) => {
|
|
194
|
+
var i;
|
|
195
|
+
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
attributeChangedCallback(t, e,
|
|
199
|
-
this._$AK(t,
|
|
198
|
+
attributeChangedCallback(t, e, i) {
|
|
199
|
+
this._$AK(t, i);
|
|
200
200
|
}
|
|
201
|
-
_$
|
|
201
|
+
_$EC(t, e) {
|
|
202
202
|
var n;
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
const o = (((n =
|
|
206
|
-
this._$Em = t, o == null ? this.removeAttribute(
|
|
203
|
+
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
|
204
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
205
|
+
const o = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : Z).toAttribute(e, i.type);
|
|
206
|
+
this._$Em = t, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
_$AK(t, e) {
|
|
210
210
|
var n;
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
const o =
|
|
214
|
-
this._$Em =
|
|
211
|
+
const i = this.constructor, s = i._$Eh.get(t);
|
|
212
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
213
|
+
const o = i.getPropertyOptions(s), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((n = o.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? o.converter : Z;
|
|
214
|
+
this._$Em = s, this[s] = l.fromAttribute(e, o.type), this._$Em = null;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
requestUpdate(t, e,
|
|
217
|
+
requestUpdate(t, e, i) {
|
|
218
218
|
if (t !== void 0) {
|
|
219
|
-
if (
|
|
219
|
+
if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? ut)(this[t], e))
|
|
220
220
|
return;
|
|
221
|
-
this.
|
|
221
|
+
this.P(t, e, i);
|
|
222
222
|
}
|
|
223
|
-
this.isUpdatePending === !1 && (this._$
|
|
223
|
+
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
225
|
+
P(t, e, i) {
|
|
226
|
+
this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
227
227
|
}
|
|
228
|
-
async _$
|
|
228
|
+
async _$ET() {
|
|
229
229
|
this.isUpdatePending = !0;
|
|
230
230
|
try {
|
|
231
|
-
await this._$
|
|
231
|
+
await this._$ES;
|
|
232
232
|
} catch (e) {
|
|
233
233
|
Promise.reject(e);
|
|
234
234
|
}
|
|
@@ -239,29 +239,29 @@ class v extends HTMLElement {
|
|
|
239
239
|
return this.performUpdate();
|
|
240
240
|
}
|
|
241
241
|
performUpdate() {
|
|
242
|
-
var
|
|
242
|
+
var i;
|
|
243
243
|
if (!this.isUpdatePending)
|
|
244
244
|
return;
|
|
245
245
|
if (!this.hasUpdated) {
|
|
246
|
-
if (this._$Ep) {
|
|
246
|
+
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
247
247
|
for (const [n, o] of this._$Ep)
|
|
248
248
|
this[n] = o;
|
|
249
249
|
this._$Ep = void 0;
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
for (const [n, o] of
|
|
254
|
-
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.
|
|
251
|
+
const s = this.constructor.elementProperties;
|
|
252
|
+
if (s.size > 0)
|
|
253
|
+
for (const [n, o] of s)
|
|
254
|
+
o.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], o);
|
|
255
255
|
}
|
|
256
256
|
let t = !1;
|
|
257
257
|
const e = this._$AL;
|
|
258
258
|
try {
|
|
259
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (
|
|
259
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((s) => {
|
|
260
260
|
var n;
|
|
261
|
-
return (n =
|
|
262
|
-
}), this.update(e)) : this._$
|
|
263
|
-
} catch (
|
|
264
|
-
throw t = !1, this._$
|
|
261
|
+
return (n = s.hostUpdate) == null ? void 0 : n.call(s);
|
|
262
|
+
}), this.update(e)) : this._$EU();
|
|
263
|
+
} catch (s) {
|
|
264
|
+
throw t = !1, this._$EU(), s;
|
|
265
265
|
}
|
|
266
266
|
t && this._$AE(e);
|
|
267
267
|
}
|
|
@@ -269,109 +269,109 @@ class v extends HTMLElement {
|
|
|
269
269
|
}
|
|
270
270
|
_$AE(t) {
|
|
271
271
|
var e;
|
|
272
|
-
(e = this._$
|
|
273
|
-
var
|
|
274
|
-
return (
|
|
272
|
+
(e = this._$EO) == null || e.forEach((i) => {
|
|
273
|
+
var s;
|
|
274
|
+
return (s = i.hostUpdated) == null ? void 0 : s.call(i);
|
|
275
275
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
276
276
|
}
|
|
277
|
-
_$
|
|
277
|
+
_$EU() {
|
|
278
278
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
279
279
|
}
|
|
280
280
|
get updateComplete() {
|
|
281
281
|
return this.getUpdateComplete();
|
|
282
282
|
}
|
|
283
283
|
getUpdateComplete() {
|
|
284
|
-
return this._$
|
|
284
|
+
return this._$ES;
|
|
285
285
|
}
|
|
286
286
|
shouldUpdate(t) {
|
|
287
287
|
return !0;
|
|
288
288
|
}
|
|
289
289
|
update(t) {
|
|
290
|
-
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$
|
|
290
|
+
this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
|
|
291
291
|
}
|
|
292
292
|
updated(t) {
|
|
293
293
|
}
|
|
294
294
|
firstUpdated(t) {
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[M("elementProperties")] = /* @__PURE__ */ new Map(), C[M("finalized")] = /* @__PURE__ */ new Map(), q == null || q({ ReactiveElement: C }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
|
|
298
298
|
/**
|
|
299
299
|
* @license
|
|
300
300
|
* Copyright 2017 Google LLC
|
|
301
301
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
302
302
|
*/
|
|
303
|
-
const U = globalThis,
|
|
304
|
-
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g,
|
|
305
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g,
|
|
306
|
-
function
|
|
307
|
-
if (!Array.isArray(
|
|
303
|
+
const U = globalThis, j = U.trustedTypes, rt = j ? j.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, gt = "$lit$", f = `lit$${(Math.random() + "").slice(9)}$`, yt = "?" + f, Ot = `<${yt}>`, A = document, P = () => A.createComment(""), O = (r) => r === null || typeof r != "object" && typeof r != "function", ft = Array.isArray, Nt = (r) => ft(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", T = `[
|
|
304
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, st = />/g, v = RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^
|
|
305
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, mt = /^(?:script|style|textarea|title)$/i, It = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), _ = It(1), F = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), w = A.createTreeWalker(A, 129);
|
|
306
|
+
function $t(r, t) {
|
|
307
|
+
if (!Array.isArray(r) || !r.hasOwnProperty("raw"))
|
|
308
308
|
throw Error("invalid template strings array");
|
|
309
|
-
return
|
|
309
|
+
return rt !== void 0 ? rt.createHTML(t) : t;
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
const e =
|
|
313
|
-
let
|
|
311
|
+
const Bt = (r, t) => {
|
|
312
|
+
const e = r.length - 1, i = [];
|
|
313
|
+
let s, n = t === 2 ? "<svg>" : "", o = k;
|
|
314
314
|
for (let l = 0; l < e; l++) {
|
|
315
|
-
const a =
|
|
316
|
-
let
|
|
317
|
-
for (;
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
n += o === k ? a +
|
|
321
|
-
}
|
|
322
|
-
return [
|
|
315
|
+
const a = r[l];
|
|
316
|
+
let h, p, c = -1, u = 0;
|
|
317
|
+
for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); )
|
|
318
|
+
u = o.lastIndex, o === k ? p[1] === "!--" ? o = it : p[1] !== void 0 ? o = st : p[2] !== void 0 ? (mt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = v) : p[3] !== void 0 && (o = v) : o === v ? p[0] === ">" ? (o = s ?? k, c = -1) : p[1] === void 0 ? c = -2 : (c = o.lastIndex - p[2].length, h = p[1], o = p[3] === void 0 ? v : p[3] === '"' ? ot : nt) : o === ot || o === nt ? o = v : o === it || o === st ? o = k : (o = v, s = void 0);
|
|
319
|
+
const y = o === v && r[l + 1].startsWith("/>") ? " " : "";
|
|
320
|
+
n += o === k ? a + Ot : c >= 0 ? (i.push(h), a.slice(0, c) + gt + a.slice(c) + f + y) : a + f + (c === -2 ? l : y);
|
|
321
|
+
}
|
|
322
|
+
return [$t(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
|
323
323
|
};
|
|
324
|
-
class
|
|
325
|
-
constructor({ strings: t, _$litType$: e },
|
|
326
|
-
let
|
|
324
|
+
class N {
|
|
325
|
+
constructor({ strings: t, _$litType$: e }, i) {
|
|
326
|
+
let s;
|
|
327
327
|
this.parts = [];
|
|
328
328
|
let n = 0, o = 0;
|
|
329
|
-
const l = t.length - 1, a = this.parts, [
|
|
330
|
-
if (this.el =
|
|
331
|
-
const
|
|
332
|
-
|
|
329
|
+
const l = t.length - 1, a = this.parts, [h, p] = Bt(t, e);
|
|
330
|
+
if (this.el = N.createElement(h, i), w.currentNode = this.el.content, e === 2) {
|
|
331
|
+
const c = this.el.content.firstChild;
|
|
332
|
+
c.replaceWith(...c.childNodes);
|
|
333
333
|
}
|
|
334
|
-
for (; (
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
for (const
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
340
|
-
a.push({ type: 1, index: n, name:
|
|
334
|
+
for (; (s = w.nextNode()) !== null && a.length < l; ) {
|
|
335
|
+
if (s.nodeType === 1) {
|
|
336
|
+
if (s.hasAttributes())
|
|
337
|
+
for (const c of s.getAttributeNames())
|
|
338
|
+
if (c.endsWith(gt)) {
|
|
339
|
+
const u = p[o++], y = s.getAttribute(c).split(f), z = /([.?@])?(.*)/.exec(u);
|
|
340
|
+
a.push({ type: 1, index: n, name: z[2], strings: y, ctor: z[1] === "." ? Rt : z[1] === "?" ? Vt : z[1] === "@" ? zt : J }), s.removeAttribute(c);
|
|
341
341
|
} else
|
|
342
|
-
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
|
|
347
|
-
for (let
|
|
348
|
-
|
|
349
|
-
|
|
342
|
+
c.startsWith(f) && (a.push({ type: 6, index: n }), s.removeAttribute(c));
|
|
343
|
+
if (mt.test(s.tagName)) {
|
|
344
|
+
const c = s.textContent.split(f), u = c.length - 1;
|
|
345
|
+
if (u > 0) {
|
|
346
|
+
s.textContent = j ? j.emptyScript : "";
|
|
347
|
+
for (let y = 0; y < u; y++)
|
|
348
|
+
s.append(c[y], P()), w.nextNode(), a.push({ type: 2, index: ++n });
|
|
349
|
+
s.append(c[u], P());
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
} else if (
|
|
353
|
-
if (
|
|
352
|
+
} else if (s.nodeType === 8)
|
|
353
|
+
if (s.data === yt)
|
|
354
354
|
a.push({ type: 2, index: n });
|
|
355
355
|
else {
|
|
356
|
-
let
|
|
357
|
-
for (; (
|
|
358
|
-
a.push({ type: 7, index: n }),
|
|
356
|
+
let c = -1;
|
|
357
|
+
for (; (c = s.data.indexOf(f, c + 1)) !== -1; )
|
|
358
|
+
a.push({ type: 7, index: n }), c += f.length - 1;
|
|
359
359
|
}
|
|
360
360
|
n++;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
static createElement(t, e) {
|
|
364
|
-
const
|
|
365
|
-
return
|
|
364
|
+
const i = A.createElement("template");
|
|
365
|
+
return i.innerHTML = t, i;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function H(r, t, e = r, i) {
|
|
369
369
|
var o, l;
|
|
370
|
-
if (t ===
|
|
370
|
+
if (t === F)
|
|
371
371
|
return t;
|
|
372
|
-
let
|
|
373
|
-
const n =
|
|
374
|
-
return (
|
|
372
|
+
let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
|
373
|
+
const n = O(t) ? void 0 : t._$litDirective$;
|
|
374
|
+
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(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = H(r, s._$AS(r, t.values), s, i)), t;
|
|
375
375
|
}
|
|
376
376
|
class Lt {
|
|
377
377
|
constructor(t, e) {
|
|
@@ -384,22 +384,22 @@ class Lt {
|
|
|
384
384
|
return this._$AM._$AU;
|
|
385
385
|
}
|
|
386
386
|
u(t) {
|
|
387
|
-
const { el: { content: e }, parts:
|
|
388
|
-
|
|
389
|
-
let n =
|
|
387
|
+
const { el: { content: e }, parts: i } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
|
|
388
|
+
w.currentNode = s;
|
|
389
|
+
let n = w.nextNode(), o = 0, l = 0, a = i[0];
|
|
390
390
|
for (; a !== void 0; ) {
|
|
391
391
|
if (o === a.index) {
|
|
392
|
-
let
|
|
393
|
-
a.type === 2 ?
|
|
392
|
+
let h;
|
|
393
|
+
a.type === 2 ? h = new V(n, n.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (h = new Dt(n, this, t)), this._$AV.push(h), a = i[++l];
|
|
394
394
|
}
|
|
395
|
-
o !== (a == null ? void 0 : a.index) && (n =
|
|
395
|
+
o !== (a == null ? void 0 : a.index) && (n = w.nextNode(), o++);
|
|
396
396
|
}
|
|
397
|
-
return
|
|
397
|
+
return w.currentNode = A, s;
|
|
398
398
|
}
|
|
399
399
|
p(t) {
|
|
400
400
|
let e = 0;
|
|
401
|
-
for (const
|
|
402
|
-
|
|
401
|
+
for (const i of this._$AV)
|
|
402
|
+
i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
class V {
|
|
@@ -407,8 +407,8 @@ class V {
|
|
|
407
407
|
var t;
|
|
408
408
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
409
409
|
}
|
|
410
|
-
constructor(t, e,
|
|
411
|
-
this.type = 2, this._$AH =
|
|
410
|
+
constructor(t, e, i, s) {
|
|
411
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
412
412
|
}
|
|
413
413
|
get parentNode() {
|
|
414
414
|
let t = this._$AA.parentNode;
|
|
@@ -422,44 +422,44 @@ class V {
|
|
|
422
422
|
return this._$AB;
|
|
423
423
|
}
|
|
424
424
|
_$AI(t, e = this) {
|
|
425
|
-
t =
|
|
425
|
+
t = H(this, t, e), O(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== F && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Nt(t) ? this.k(t) : this._(t);
|
|
426
426
|
}
|
|
427
|
-
|
|
427
|
+
S(t) {
|
|
428
428
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
429
429
|
}
|
|
430
|
-
|
|
431
|
-
this._$AH !== t && (this._$AR(), this._$AH = this.
|
|
430
|
+
T(t) {
|
|
431
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
|
|
432
432
|
}
|
|
433
433
|
_(t) {
|
|
434
|
-
this._$AH !==
|
|
434
|
+
this._$AH !== d && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
$(t) {
|
|
437
437
|
var n;
|
|
438
|
-
const { values: e, _$litType$:
|
|
439
|
-
if (((n = this._$AH) == null ? void 0 : n._$AD) ===
|
|
438
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = N.createElement($t(i.h, i.h[0]), this.options)), i);
|
|
439
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === s)
|
|
440
440
|
this._$AH.p(e);
|
|
441
441
|
else {
|
|
442
|
-
const o = new Lt(
|
|
443
|
-
o.p(e), this
|
|
442
|
+
const o = new Lt(s, this), l = o.u(this.options);
|
|
443
|
+
o.p(e), this.T(l), this._$AH = o;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
_$AC(t) {
|
|
447
447
|
let e = at.get(t.strings);
|
|
448
|
-
return e === void 0 && at.set(t.strings, e = new
|
|
448
|
+
return e === void 0 && at.set(t.strings, e = new N(t)), e;
|
|
449
449
|
}
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
k(t) {
|
|
451
|
+
ft(this._$AH) || (this._$AH = [], this._$AR());
|
|
452
452
|
const e = this._$AH;
|
|
453
|
-
let
|
|
453
|
+
let i, s = 0;
|
|
454
454
|
for (const n of t)
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
s === e.length ? e.push(i = new V(this.S(P()), this.S(P()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
|
456
|
+
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
|
457
457
|
}
|
|
458
458
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
459
|
-
var
|
|
460
|
-
for ((
|
|
461
|
-
const
|
|
462
|
-
t.remove(), t =
|
|
459
|
+
var i;
|
|
460
|
+
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
461
|
+
const s = t.nextSibling;
|
|
462
|
+
t.remove(), t = s;
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
setConnected(t) {
|
|
@@ -467,58 +467,58 @@ class V {
|
|
|
467
467
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
class
|
|
470
|
+
class J {
|
|
471
471
|
get tagName() {
|
|
472
472
|
return this.element.tagName;
|
|
473
473
|
}
|
|
474
474
|
get _$AU() {
|
|
475
475
|
return this._$AM._$AU;
|
|
476
476
|
}
|
|
477
|
-
constructor(t, e,
|
|
478
|
-
this.type = 1, this._$AH =
|
|
477
|
+
constructor(t, e, i, s, n) {
|
|
478
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = d;
|
|
479
479
|
}
|
|
480
|
-
_$AI(t, e = this,
|
|
480
|
+
_$AI(t, e = this, i, s) {
|
|
481
481
|
const n = this.strings;
|
|
482
482
|
let o = !1;
|
|
483
483
|
if (n === void 0)
|
|
484
|
-
t =
|
|
484
|
+
t = H(this, t, e, 0), o = !O(t) || t !== this._$AH && t !== F, o && (this._$AH = t);
|
|
485
485
|
else {
|
|
486
486
|
const l = t;
|
|
487
|
-
let a,
|
|
487
|
+
let a, h;
|
|
488
488
|
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
489
|
-
|
|
489
|
+
h = H(this, l[i + a], e, a), h === F && (h = this._$AH[a]), o || (o = !O(h) || h !== this._$AH[a]), h === d ? t = d : t !== d && (t += (h ?? "") + n[a + 1]), this._$AH[a] = h;
|
|
490
490
|
}
|
|
491
|
-
o && !
|
|
491
|
+
o && !s && this.j(t);
|
|
492
492
|
}
|
|
493
|
-
|
|
494
|
-
t ===
|
|
493
|
+
j(t) {
|
|
494
|
+
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
class
|
|
497
|
+
class Rt extends J {
|
|
498
498
|
constructor() {
|
|
499
499
|
super(...arguments), this.type = 3;
|
|
500
500
|
}
|
|
501
|
-
|
|
502
|
-
this.element[this.name] = t ===
|
|
501
|
+
j(t) {
|
|
502
|
+
this.element[this.name] = t === d ? void 0 : t;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
class
|
|
505
|
+
class Vt extends J {
|
|
506
506
|
constructor() {
|
|
507
507
|
super(...arguments), this.type = 4;
|
|
508
508
|
}
|
|
509
|
-
|
|
510
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
509
|
+
j(t) {
|
|
510
|
+
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
class
|
|
514
|
-
constructor(t, e,
|
|
515
|
-
super(t, e,
|
|
513
|
+
class zt extends J {
|
|
514
|
+
constructor(t, e, i, s, n) {
|
|
515
|
+
super(t, e, i, s, n), this.type = 5;
|
|
516
516
|
}
|
|
517
517
|
_$AI(t, e = this) {
|
|
518
|
-
if ((t =
|
|
518
|
+
if ((t = H(this, t, e, 0) ?? d) === F)
|
|
519
519
|
return;
|
|
520
|
-
const
|
|
521
|
-
|
|
520
|
+
const i = this._$AH, s = t === d && i !== d || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== d && (i === d || s);
|
|
521
|
+
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
522
522
|
}
|
|
523
523
|
handleEvent(t) {
|
|
524
524
|
var e;
|
|
@@ -526,33 +526,33 @@ class Vt extends q {
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
class Dt {
|
|
529
|
-
constructor(t, e,
|
|
530
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
529
|
+
constructor(t, e, i) {
|
|
530
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
531
531
|
}
|
|
532
532
|
get _$AU() {
|
|
533
533
|
return this._$AM._$AU;
|
|
534
534
|
}
|
|
535
535
|
_$AI(t) {
|
|
536
|
-
|
|
536
|
+
H(this, t);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
let
|
|
544
|
-
if (
|
|
539
|
+
const G = U.litHtmlPolyfillSupport;
|
|
540
|
+
G == null || G(N, V), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.1.2");
|
|
541
|
+
const jt = (r, t, e) => {
|
|
542
|
+
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
543
|
+
let s = i._$litPart$;
|
|
544
|
+
if (s === void 0) {
|
|
545
545
|
const n = (e == null ? void 0 : e.renderBefore) ?? null;
|
|
546
|
-
|
|
546
|
+
i._$litPart$ = s = new V(t.insertBefore(P(), n), n, void 0, e ?? {});
|
|
547
547
|
}
|
|
548
|
-
return
|
|
548
|
+
return s._$AI(r), s;
|
|
549
549
|
};
|
|
550
550
|
/**
|
|
551
551
|
* @license
|
|
552
552
|
* Copyright 2017 Google LLC
|
|
553
553
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
554
554
|
*/
|
|
555
|
-
class
|
|
555
|
+
class x extends C {
|
|
556
556
|
constructor() {
|
|
557
557
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
558
558
|
}
|
|
@@ -563,7 +563,7 @@ class w extends v {
|
|
|
563
563
|
}
|
|
564
564
|
update(t) {
|
|
565
565
|
const e = this.render();
|
|
566
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
566
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = jt(e, this.renderRoot, this.renderOptions);
|
|
567
567
|
}
|
|
568
568
|
connectedCallback() {
|
|
569
569
|
var t;
|
|
@@ -574,28 +574,28 @@ class w extends v {
|
|
|
574
574
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
575
575
|
}
|
|
576
576
|
render() {
|
|
577
|
-
return
|
|
577
|
+
return F;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
var
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.
|
|
580
|
+
var dt;
|
|
581
|
+
x._$litElement$ = !0, x.finalized = !0, (dt = globalThis.litElementHydrateSupport) == null || dt.call(globalThis, { LitElement: x });
|
|
582
|
+
const W = globalThis.litElementPolyfillSupport;
|
|
583
|
+
W == null || W({ LitElement: x });
|
|
584
|
+
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
|
|
585
585
|
/**
|
|
586
586
|
* @license
|
|
587
587
|
* Copyright 2017 Google LLC
|
|
588
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
589
589
|
*/
|
|
590
|
-
const
|
|
590
|
+
const Jt = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
|
591
591
|
let qt = class {
|
|
592
592
|
constructor(t) {
|
|
593
593
|
}
|
|
594
594
|
get _$AU() {
|
|
595
595
|
return this._$AM._$AU;
|
|
596
596
|
}
|
|
597
|
-
_$AT(t, e,
|
|
598
|
-
this._$Ct = t, this._$AM = e, this._$Ci =
|
|
597
|
+
_$AT(t, e, i) {
|
|
598
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
599
599
|
}
|
|
600
600
|
_$AS(t, e) {
|
|
601
601
|
return this.update(t, e);
|
|
@@ -609,241 +609,76 @@ let qt = class {
|
|
|
609
609
|
* Copyright 2020 Google LLC
|
|
610
610
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
611
611
|
*/
|
|
612
|
-
const
|
|
612
|
+
const Tt = {}, Gt = (r, t = Tt) => r._$AH = t;
|
|
613
613
|
/**
|
|
614
614
|
* @license
|
|
615
615
|
* Copyright 2021 Google LLC
|
|
616
616
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
617
617
|
*/
|
|
618
|
-
const Wt =
|
|
618
|
+
const Wt = Jt(class extends qt {
|
|
619
619
|
constructor() {
|
|
620
|
-
super(...arguments), this.key =
|
|
621
|
-
}
|
|
622
|
-
render(i, t) {
|
|
623
|
-
return this.key = i, t;
|
|
624
|
-
}
|
|
625
|
-
update(i, [t, e]) {
|
|
626
|
-
return t !== this.key && (Tt(i), this.key = t), e;
|
|
627
|
-
}
|
|
628
|
-
}), Zt = `
|
|
629
|
-
button {
|
|
630
|
-
/* TODO: why does this only work here and not from :root? */
|
|
631
|
-
--primary-color: #004170;
|
|
632
|
-
--primary-color-hover: #004170CC;
|
|
633
|
-
--error-color: #FF5252;
|
|
634
|
-
|
|
635
|
-
display: inline-flex;
|
|
636
|
-
position: relative;
|
|
637
|
-
align-items: center;
|
|
638
|
-
color: #fff;
|
|
639
|
-
border-width: 0;
|
|
640
|
-
outline: none;
|
|
641
|
-
border-radius: 4px;
|
|
642
|
-
padding: 16px;
|
|
643
|
-
height: 36px;
|
|
644
|
-
cursor: pointer;
|
|
645
|
-
font-family: inherit;
|
|
646
|
-
font-size: 0.875rem;
|
|
647
|
-
text-transform: uppercase;
|
|
648
|
-
letter-spacing: 1.25px;
|
|
649
|
-
font-weight: 500;
|
|
650
|
-
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);
|
|
651
|
-
transition-property: box-shadow, transform, opacity, background;
|
|
652
|
-
transition-duration: 0.28s;
|
|
653
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
button:hover:not([disabled]):not(.icon) {
|
|
657
|
-
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);
|
|
658
|
-
background: var(--primary-color-hover);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
button, button:active {
|
|
662
|
-
background: var(--primary-color);
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
button[disabled] {
|
|
666
|
-
opacity: 0.5;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
button.outline {
|
|
670
|
-
background: transparent;
|
|
671
|
-
box-shadow: none;
|
|
672
|
-
color: var(--primary-color);
|
|
673
|
-
outline: 1px solid var(--primary-color);
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
button.outline:hover {
|
|
677
|
-
background: transparent;
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
button.icon {
|
|
681
|
-
background: transparent;
|
|
682
|
-
border: none;
|
|
683
|
-
box-shadow: none;
|
|
684
|
-
padding: 0;
|
|
685
|
-
border-radius: 50%;
|
|
686
|
-
width: 24px;
|
|
687
|
-
height: 24px;
|
|
688
|
-
text-indent: -9999px;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
button.icon-text {
|
|
692
|
-
text-indent: 26px;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
button.icon:before, button.icon-text:before {
|
|
696
|
-
position: absolute;
|
|
697
|
-
text-indent: 0;
|
|
698
|
-
line-height: initial;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
button.icon:before {
|
|
702
|
-
width: 24px;
|
|
703
|
-
height: 24px;
|
|
704
|
-
margin-right: 0;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
button.icon-text:before {
|
|
708
|
-
width: 18px;
|
|
709
|
-
height: 18px;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
button.small {
|
|
713
|
-
height: 28px;
|
|
714
|
-
padding: 12.4px;
|
|
715
|
-
font-size: .75rem;
|
|
716
|
-
}
|
|
717
|
-
`, K = `
|
|
718
|
-
* {
|
|
719
|
-
font-family: Roboto, sans-serif;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
${Zt}
|
|
723
|
-
|
|
724
|
-
button.discard:before {
|
|
725
|
-
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")
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
button.polygon:before {
|
|
729
|
-
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");
|
|
730
|
-
}
|
|
731
|
-
ul {
|
|
732
|
-
padding: 0;
|
|
733
|
-
}
|
|
734
|
-
ul ul {
|
|
735
|
-
padding-left: 48px;
|
|
736
|
-
}
|
|
737
|
-
li:hover {
|
|
738
|
-
background: #f0f5f9;
|
|
739
|
-
}
|
|
740
|
-
li.selected {
|
|
741
|
-
background: #f0f5f9;
|
|
742
|
-
}
|
|
743
|
-
li {
|
|
744
|
-
list-style: none;
|
|
745
|
-
padding: 4px;
|
|
746
|
-
}
|
|
747
|
-
li {
|
|
748
|
-
border-bottom: 1px solid #0041703a;
|
|
620
|
+
super(...arguments), this.key = d;
|
|
749
621
|
}
|
|
750
|
-
|
|
751
|
-
|
|
622
|
+
render(r, t) {
|
|
623
|
+
return this.key = r, t;
|
|
752
624
|
}
|
|
753
|
-
|
|
754
|
-
|
|
625
|
+
update(r, [t, e]) {
|
|
626
|
+
return t !== this.key && (Gt(r), this.key = t), e;
|
|
755
627
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
li.sortable-ghost {
|
|
760
|
-
}
|
|
761
|
-
button.small.icon, button.small.icon::before {
|
|
762
|
-
height: 16px;
|
|
763
|
-
width: 16px;
|
|
764
|
-
padding: 0px;
|
|
765
|
-
}
|
|
766
|
-
button.discard.icon {
|
|
767
|
-
opacity: .7;
|
|
768
|
-
}
|
|
769
|
-
button.discard.icon:hover {
|
|
770
|
-
opacity: 1;
|
|
771
|
-
}
|
|
772
|
-
eox-drawtools-list {
|
|
773
|
-
width: 100%;
|
|
774
|
-
}
|
|
775
|
-
.list {
|
|
776
|
-
width: 100%;
|
|
777
|
-
align-items: center;
|
|
778
|
-
justify-content: space-between;
|
|
779
|
-
display: flex;
|
|
780
|
-
align-items: center;
|
|
781
|
-
cursor: pointer;
|
|
782
|
-
font-size: small;
|
|
783
|
-
gap: 10px;
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
label {
|
|
787
|
-
gap: 10px;
|
|
788
|
-
}
|
|
789
|
-
label, span {
|
|
790
|
-
display: flex;
|
|
791
|
-
align-items: center;
|
|
792
|
-
cursor: pointer;
|
|
793
|
-
font-size: small;
|
|
794
|
-
flex-grow: 1;
|
|
795
|
-
}
|
|
796
|
-
`, Gt = (i) => {
|
|
797
|
-
i.hoverInteraction = i.eoxMap.selectInteractions.selectHover, i.clickInteraction = i.eoxMap.selectInteractions.selectClick;
|
|
628
|
+
}), Zt = (r) => {
|
|
629
|
+
r.hoverInteraction = r.eoxMap.selectInteractions.selectHover, r.clickInteraction = r.eoxMap.selectInteractions.selectClick;
|
|
798
630
|
const t = () => {
|
|
799
|
-
|
|
631
|
+
r.requestUpdate();
|
|
800
632
|
};
|
|
801
|
-
|
|
633
|
+
r.hoverInteraction.selectStyleLayer.on(
|
|
802
634
|
"change",
|
|
803
635
|
t
|
|
804
|
-
),
|
|
636
|
+
), r.clickInteraction.selectStyleLayer.on(
|
|
805
637
|
"change",
|
|
806
638
|
t
|
|
807
639
|
);
|
|
808
|
-
},
|
|
809
|
-
if (
|
|
640
|
+
}, Kt = (r, t, e) => {
|
|
641
|
+
if (r.clickId === t)
|
|
810
642
|
return;
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
},
|
|
814
|
-
|
|
815
|
-
const e = Number(
|
|
816
|
-
t.drawLayer.getSource().removeFeature(
|
|
817
|
-
}, lt = { duration: 750 },
|
|
818
|
-
|
|
643
|
+
const i = e ? [] : [t];
|
|
644
|
+
r.hoverInteraction.highlightById(i);
|
|
645
|
+
}, Qt = (r, t) => {
|
|
646
|
+
r.stopPropagation();
|
|
647
|
+
const e = Number(r.target.getAttribute("index")), i = t.drawnFeatures[e];
|
|
648
|
+
t.drawLayer.getSource().removeFeature(i), t.drawnFeatures.splice(e, 1), t.requestUpdate();
|
|
649
|
+
}, lt = { duration: 750 }, ct = {
|
|
650
|
+
type: "FeatureCollection",
|
|
651
|
+
features: []
|
|
652
|
+
}, Xt = (r, t) => {
|
|
653
|
+
const e = r.get("id"), { clickId: i, drawLayer: s, olMap: n, clickInteraction: o } = t, l = i === e, a = r.getGeometry();
|
|
819
654
|
if (l) {
|
|
820
|
-
const
|
|
821
|
-
n.getView().fit(
|
|
655
|
+
const h = s.getSource().getExtent();
|
|
656
|
+
n.getView().fit(h, lt), o.highlightById([]);
|
|
822
657
|
} else {
|
|
823
|
-
const
|
|
824
|
-
o.highlightById([e]), n.getView().fit(
|
|
658
|
+
const h = a.getExtent();
|
|
659
|
+
o.highlightById([e]), n.getView().fit(h, lt);
|
|
825
660
|
}
|
|
826
661
|
t.requestUpdate();
|
|
827
|
-
};
|
|
828
|
-
class
|
|
662
|
+
}, Yt = "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;}";
|
|
663
|
+
class bt extends x {
|
|
829
664
|
constructor() {
|
|
830
665
|
super();
|
|
831
666
|
/**
|
|
832
667
|
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
833
668
|
*/
|
|
834
|
-
|
|
669
|
+
b(this, "hoverInteraction");
|
|
835
670
|
/**
|
|
836
671
|
* @type import("../../../map/src/select").EOxSelectInteraction
|
|
837
672
|
*/
|
|
838
|
-
|
|
673
|
+
b(this, "clickInteraction");
|
|
839
674
|
/**
|
|
840
675
|
* @type string | number
|
|
841
676
|
*/
|
|
842
|
-
|
|
677
|
+
b(this, "hoverId");
|
|
843
678
|
/**
|
|
844
679
|
* @type string | number
|
|
845
680
|
*/
|
|
846
|
-
|
|
681
|
+
b(this, "clickId");
|
|
847
682
|
this.eoxMap = null, this.olMap = null, this.draw = null, this.drawLayer = null, this.drawnFeatures = [], this.modify = null, this.unstyled = !1;
|
|
848
683
|
}
|
|
849
684
|
/**
|
|
@@ -852,7 +687,7 @@ class gt extends w {
|
|
|
852
687
|
* @param {Event & { target: HTMLButtonElement }} evt - Event object containing button target.
|
|
853
688
|
*/
|
|
854
689
|
_handleDelete(e) {
|
|
855
|
-
|
|
690
|
+
Qt(e, this), this.dispatchEvent(new CustomEvent("changed", { bubbles: !0 }));
|
|
856
691
|
}
|
|
857
692
|
/**
|
|
858
693
|
* Handles the selection and deselection of a feature from the list.
|
|
@@ -860,47 +695,53 @@ class gt extends w {
|
|
|
860
695
|
* @param {import("ol").Feature} feature - The selected feature.
|
|
861
696
|
*/
|
|
862
697
|
_handleFeatureSelectAndDeselect(e) {
|
|
863
|
-
|
|
698
|
+
Xt(e, this);
|
|
864
699
|
}
|
|
865
700
|
/**
|
|
866
701
|
*
|
|
867
702
|
* @param {Number} featureId - The ID of the feature to hover.
|
|
868
703
|
* @param {Boolean} mouseOut - Flag indicating mouse out event.
|
|
869
704
|
*/
|
|
870
|
-
_handleHoverFeature(e,
|
|
871
|
-
|
|
705
|
+
_handleHoverFeature(e, i = !1) {
|
|
706
|
+
Kt(this, e, i);
|
|
872
707
|
}
|
|
873
708
|
/**
|
|
874
709
|
* Initiates initial settings and event triggers upon the component's first update.
|
|
875
710
|
*/
|
|
876
711
|
firstUpdated() {
|
|
877
|
-
|
|
712
|
+
Zt(this);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Overrides createRenderRoot to handle shadow DOM.
|
|
716
|
+
*/
|
|
717
|
+
createRenderRoot() {
|
|
718
|
+
return this;
|
|
878
719
|
}
|
|
879
720
|
render() {
|
|
880
|
-
var e,
|
|
881
|
-
return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (
|
|
721
|
+
var e, i;
|
|
722
|
+
return this.hoverId = (e = this.hoverInteraction) == null ? void 0 : e.selectedFids[0], this.clickId = (i = this.clickInteraction) == null ? void 0 : i.selectedFids[0], _`
|
|
882
723
|
<style>
|
|
883
|
-
${!this.unstyled &&
|
|
724
|
+
${!this.unstyled && Yt}
|
|
884
725
|
</style>
|
|
885
|
-
<ul>
|
|
886
|
-
${this.drawnFeatures.map((
|
|
887
|
-
const o = n + 1, l =
|
|
726
|
+
<ul class="list-wrap">
|
|
727
|
+
${this.drawnFeatures.map((s, n) => {
|
|
728
|
+
const o = n + 1, l = s.get("id"), a = this.hoverId === l, h = this.clickId === l;
|
|
888
729
|
return Wt(
|
|
889
730
|
o,
|
|
890
|
-
|
|
731
|
+
_`
|
|
891
732
|
<li
|
|
892
|
-
class="${a ||
|
|
733
|
+
class="${a || h ? "selected" : d}"
|
|
893
734
|
@mouseover=${() => this._handleHoverFeature(l)}
|
|
894
735
|
@mouseout=${() => this._handleHoverFeature(l, !0)}
|
|
895
736
|
>
|
|
896
737
|
<div
|
|
897
738
|
class="list"
|
|
898
|
-
@click="${() => this._handleFeatureSelectAndDeselect(
|
|
739
|
+
@click="${() => this._handleFeatureSelectAndDeselect(s)}"
|
|
899
740
|
>
|
|
900
741
|
<span class="title">Feature #${o}</span>
|
|
901
742
|
<button
|
|
902
743
|
index=${n}
|
|
903
|
-
class="icon
|
|
744
|
+
class="icon smallest discard"
|
|
904
745
|
@click="${this._handleDelete}"
|
|
905
746
|
>
|
|
906
747
|
x
|
|
@@ -914,7 +755,7 @@ class gt extends w {
|
|
|
914
755
|
`;
|
|
915
756
|
}
|
|
916
757
|
}
|
|
917
|
-
|
|
758
|
+
b(bt, "properties", {
|
|
918
759
|
eoxMap: { attribute: !1, state: !0 },
|
|
919
760
|
olMap: { attribute: !1, state: !0 },
|
|
920
761
|
draw: { attribute: !1, state: !0 },
|
|
@@ -923,97 +764,212 @@ g(gt, "properties", {
|
|
|
923
764
|
modify: { attribute: !1, state: !0 },
|
|
924
765
|
unstyled: { type: Boolean }
|
|
925
766
|
});
|
|
926
|
-
customElements.define("eox-drawtools-list",
|
|
927
|
-
const
|
|
928
|
-
const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing:
|
|
929
|
-
return { drawDisabled:
|
|
930
|
-
};
|
|
931
|
-
|
|
932
|
-
|
|
767
|
+
customElements.define("eox-drawtools-list", bt);
|
|
768
|
+
const te = (r) => {
|
|
769
|
+
const { multipleFeatures: t, drawnFeatures: e, currentlyDrawing: i } = r, s = !t && (e == null ? void 0 : e.length) > 0 || i, n = !(e != null && e.length) && !i;
|
|
770
|
+
return { drawDisabled: s, discardDisabled: n };
|
|
771
|
+
}, ee = "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),.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.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 { 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:before,button.icon-text:before,.button.icon:before,.button.icon-text:before { position: absolute; text-indent: 0; line-height: initial;}button.icon:before,.button.icon: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: 0px;}", re = "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);}";
|
|
772
|
+
function ie(r) {
|
|
773
|
+
navigator.clipboard.writeText(r).then(
|
|
774
|
+
function() {
|
|
775
|
+
},
|
|
776
|
+
function(t) {
|
|
777
|
+
console.error("Could not copy text: ", t);
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* @license
|
|
783
|
+
* Copyright 2021 Google LLC
|
|
784
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
785
|
+
*/
|
|
786
|
+
function ht(r, t, e) {
|
|
787
|
+
return r ? t(r) : e == null ? void 0 : e(r);
|
|
788
|
+
}
|
|
789
|
+
var I, B;
|
|
790
|
+
class vt extends x {
|
|
933
791
|
constructor() {
|
|
934
792
|
super();
|
|
935
793
|
/**
|
|
936
794
|
* @type boolean | import("lit").nothing
|
|
937
795
|
*/
|
|
938
|
-
|
|
796
|
+
S(this, I, !0);
|
|
939
797
|
/**
|
|
940
798
|
* @type boolean | import("lit").nothing
|
|
941
799
|
*/
|
|
942
|
-
|
|
943
|
-
this.multipleFeatures = !1, this.drawnFeatures = [], this.currentlyDrawing = !1, this.drawFunc = null, this.unstyled = !1;
|
|
800
|
+
S(this, B, !0);
|
|
801
|
+
this.multipleFeatures = !1, this.drawnFeatures = [], this.importFeatures = !1, this.showEditor = !1, this.currentlyDrawing = !1, this.drawFunc = null, this.geoJSON = "", this.unstyled = !1;
|
|
944
802
|
}
|
|
945
803
|
/**
|
|
946
804
|
* Updates button states based on conditions
|
|
947
805
|
*/
|
|
948
806
|
updateButtonStates() {
|
|
949
|
-
const { drawDisabled: e, discardDisabled:
|
|
950
|
-
|
|
807
|
+
const { drawDisabled: e, discardDisabled: i } = te(this);
|
|
808
|
+
E(this, I, e), E(this, B, i);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Overrides createRenderRoot to handle shadow DOM
|
|
812
|
+
*/
|
|
813
|
+
createRenderRoot() {
|
|
814
|
+
return this;
|
|
951
815
|
}
|
|
952
816
|
render() {
|
|
953
817
|
this.updateButtonStates();
|
|
954
818
|
const e = this.currentlyDrawing ? "drawing" : "draw";
|
|
955
|
-
return
|
|
819
|
+
return _`
|
|
956
820
|
<style>
|
|
957
|
-
${!this.unstyled &&
|
|
821
|
+
${!this.unstyled && ee}
|
|
822
|
+
${!this.unstyled && re}
|
|
958
823
|
</style>
|
|
959
|
-
<div>
|
|
824
|
+
<div class="wrap-btn">
|
|
960
825
|
<slot></slot>
|
|
826
|
+
<div>
|
|
827
|
+
<!-- Draw Button -->
|
|
828
|
+
<button
|
|
829
|
+
data-cy="drawBtn"
|
|
830
|
+
class="polygon icon"
|
|
831
|
+
?disabled="${g(this, I) || d}"
|
|
832
|
+
@click="${() => this.drawFunc.start()}"
|
|
833
|
+
>
|
|
834
|
+
${e}
|
|
835
|
+
</button>
|
|
836
|
+
|
|
837
|
+
<!-- Discard Button -->
|
|
838
|
+
<button
|
|
839
|
+
data-cy="discardBtn"
|
|
840
|
+
class="discard icon"
|
|
841
|
+
?disabled="${g(this, B) || d}"
|
|
842
|
+
@click="${() => this.drawFunc.discard()}"
|
|
843
|
+
>
|
|
844
|
+
discard
|
|
845
|
+
</button>
|
|
846
|
+
</div>
|
|
961
847
|
|
|
962
|
-
<!--
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
848
|
+
<!-- Import Button -->
|
|
849
|
+
${ht(
|
|
850
|
+
this.importFeatures,
|
|
851
|
+
() => _`
|
|
852
|
+
<!-- Import Input Field : Hidden -->
|
|
853
|
+
<input
|
|
854
|
+
type="file"
|
|
855
|
+
id="import-file"
|
|
856
|
+
style="display: none;"
|
|
857
|
+
@change=${this.drawFunc.import}
|
|
858
|
+
/>
|
|
971
859
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
860
|
+
<!-- Main Import Button -->
|
|
861
|
+
<button
|
|
862
|
+
data-cy="importBtn"
|
|
863
|
+
class="import icon"
|
|
864
|
+
@click=${() => this.querySelector("#import-file").click()}
|
|
865
|
+
>
|
|
866
|
+
import
|
|
867
|
+
</button>
|
|
868
|
+
`
|
|
869
|
+
)}
|
|
981
870
|
</div>
|
|
871
|
+
|
|
872
|
+
<!-- Geo JSON Wrapper -->
|
|
873
|
+
${ht(
|
|
874
|
+
this.showEditor,
|
|
875
|
+
() => _`
|
|
876
|
+
<div class="json-wrapper">
|
|
877
|
+
<!-- Geo JSON Editor -->
|
|
878
|
+
<textarea
|
|
879
|
+
@drop=${this.drawFunc.import}
|
|
880
|
+
@input=${this.drawFunc.editor}
|
|
881
|
+
.value=${this.geoJSON}
|
|
882
|
+
></textarea>
|
|
883
|
+
|
|
884
|
+
<!-- Geo JSON Copy Button -->
|
|
885
|
+
<button
|
|
886
|
+
data-cy="copyBtn"
|
|
887
|
+
class="icon-copy"
|
|
888
|
+
@click=${() => ie(this.geoJSON)}
|
|
889
|
+
>
|
|
890
|
+
${this.unstyled ? "copy" : d}
|
|
891
|
+
</button>
|
|
892
|
+
</div>
|
|
893
|
+
`
|
|
894
|
+
)}
|
|
982
895
|
`;
|
|
983
896
|
}
|
|
984
897
|
}
|
|
985
|
-
|
|
986
|
-
|
|
898
|
+
I = new WeakMap(), B = new WeakMap(), // Define properties with default values and types
|
|
899
|
+
b(vt, "properties", {
|
|
987
900
|
multipleFeatures: { attribute: !1, type: Boolean },
|
|
988
901
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
989
902
|
currentlyDrawing: { attribute: !1, state: !0, type: Boolean },
|
|
990
903
|
drawFunc: { attribute: !1, type: Object },
|
|
904
|
+
importFeatures: { attribute: "import-features", type: Boolean },
|
|
905
|
+
showEditor: { attribute: "show-editor", type: Boolean },
|
|
906
|
+
geoJSON: { attribute: "geo-json", type: String },
|
|
991
907
|
unstyled: { type: Boolean }
|
|
992
908
|
});
|
|
993
|
-
customElements.define("eox-drawtools-controller",
|
|
994
|
-
const
|
|
995
|
-
:
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
|
|
909
|
+
customElements.define("eox-drawtools-controller", vt);
|
|
910
|
+
const se = `
|
|
911
|
+
button.discard:before {
|
|
912
|
+
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")
|
|
913
|
+
}
|
|
914
|
+
button.polygon:before {
|
|
915
|
+
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");
|
|
916
|
+
}
|
|
917
|
+
button.import:before {
|
|
918
|
+
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ctitle%3Eupload%3C/title%3E%3Cpath fill='%23004170' d='M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z' /%3E%3C/svg%3E");
|
|
919
|
+
}
|
|
920
|
+
.wrap-btn {
|
|
921
|
+
display: flex;
|
|
922
|
+
justify-content: space-between;
|
|
923
|
+
}
|
|
924
|
+
eox-drawtools-list {
|
|
925
|
+
width: 100%;
|
|
926
|
+
}
|
|
927
|
+
.json-wrapper {
|
|
928
|
+
margin: 0.4rem 0rem;
|
|
929
|
+
padding: 0.75rem;
|
|
930
|
+
background: var(--secondary-color-hover);
|
|
931
|
+
position: relative;
|
|
932
|
+
}
|
|
933
|
+
.json-wrapper textarea {
|
|
934
|
+
height: 200px;
|
|
935
|
+
}
|
|
936
|
+
.icon-copy {
|
|
937
|
+
position: absolute;
|
|
938
|
+
bottom: 26px;
|
|
939
|
+
right: 26px;
|
|
940
|
+
border-radius: 4px;
|
|
941
|
+
height: 26px;
|
|
942
|
+
padding: 4px 6px;
|
|
943
|
+
}
|
|
944
|
+
.icon-copy:before {
|
|
945
|
+
width: 14px;
|
|
946
|
+
min-width: 14px;
|
|
947
|
+
height: 14px;
|
|
948
|
+
display: flex margin-right: 6px;
|
|
949
|
+
color: white;
|
|
950
|
+
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")
|
|
951
|
+
}
|
|
952
|
+
`, ne = (r) => {
|
|
999
953
|
(() => {
|
|
1000
|
-
|
|
1001
|
-
})(),
|
|
1002
|
-
},
|
|
954
|
+
r.emitDrawnFeatures(), r.multipleFeatures || (r.draw.setActive(!1), r.currentlyDrawing = !1);
|
|
955
|
+
})(), r.requestUpdate();
|
|
956
|
+
}, oe = (r) => {
|
|
1003
957
|
const t = () => {
|
|
1004
|
-
|
|
958
|
+
r.drawLayer.set("isDrawingEnabled", !0), r.draw.setActive(!0);
|
|
1005
959
|
}, e = () => {
|
|
1006
|
-
|
|
960
|
+
r.currentlyDrawing = !0, r.requestUpdate();
|
|
1007
961
|
};
|
|
1008
962
|
t(), e();
|
|
1009
|
-
},
|
|
1010
|
-
var
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
963
|
+
}, ae = (r, t) => {
|
|
964
|
+
var n;
|
|
965
|
+
const i = document.querySelector(r.for), s = i.map;
|
|
966
|
+
return r.drawLayer = i.addOrUpdateLayer({
|
|
1013
967
|
type: "Vector",
|
|
1014
968
|
properties: {
|
|
1015
969
|
id: "drawLayer",
|
|
1016
|
-
layerControlHide: !0
|
|
970
|
+
layerControlHide: !0,
|
|
971
|
+
isDrawingEnabled: !1,
|
|
972
|
+
multipleFeatures: t
|
|
1017
973
|
},
|
|
1018
974
|
source: {
|
|
1019
975
|
type: "Vector"
|
|
@@ -1024,8 +980,8 @@ const Yt = `
|
|
|
1024
980
|
options: {
|
|
1025
981
|
active: !1,
|
|
1026
982
|
id: "drawInteraction",
|
|
1027
|
-
type:
|
|
1028
|
-
modify:
|
|
983
|
+
type: r.type,
|
|
984
|
+
modify: r.allowModify,
|
|
1029
985
|
stopClick: !0
|
|
1030
986
|
}
|
|
1031
987
|
},
|
|
@@ -1055,36 +1011,68 @@ const Yt = `
|
|
|
1055
1011
|
}
|
|
1056
1012
|
}
|
|
1057
1013
|
]
|
|
1058
|
-
}),
|
|
1014
|
+
}), r.draw = /** @type {import("ol/interaction").Draw} */
|
|
1059
1015
|
/** @type {unknown} */
|
|
1060
|
-
|
|
1016
|
+
i.interactions.drawInteraction, r.modify = /** @type {import("ol/interaction").Modify} */
|
|
1061
1017
|
/** @type {unknown} */
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1066
|
-
},
|
|
1067
|
-
|
|
1018
|
+
i.interactions.drawInteractionmodify, (n = r.modify) == null || n.on("modifyend", () => r.onModifyEnd()), i.addEventListener("addfeatures", () => ne(r)), { EoxMap: i, OlMap: s };
|
|
1019
|
+
}, le = (r) => {
|
|
1020
|
+
const t = () => {
|
|
1021
|
+
r.drawnFeatures = [], r.draw.setActive(!1), r.drawLayer.getSource().clear(), r.geoJSON = null;
|
|
1022
|
+
}, e = () => {
|
|
1023
|
+
r.emitDrawnFeatures(), r.currentlyDrawing = !1, r.requestUpdate();
|
|
1068
1024
|
};
|
|
1069
|
-
|
|
1070
|
-
},
|
|
1025
|
+
t(), e();
|
|
1026
|
+
}, ce = (r, t) => {
|
|
1071
1027
|
setTimeout(() => {
|
|
1072
|
-
|
|
1028
|
+
r.drawnFeatures = r.drawLayer.getSource().getFeatures(), r.updateGeoJSON(), r.requestUpdate(), t();
|
|
1073
1029
|
}, 0);
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
|
|
1030
|
+
}, he = ':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-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-weight: 400; line-height: 170%; margin-top: 0.8rem; margin-bottom: 1.6rem;}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);}';
|
|
1031
|
+
function de(r, t) {
|
|
1032
|
+
function e(n) {
|
|
1033
|
+
n.preventDefault(), n.stopPropagation();
|
|
1034
|
+
}
|
|
1035
|
+
function i(n) {
|
|
1036
|
+
n.srcElement.style.opacity = "0.4";
|
|
1037
|
+
}
|
|
1038
|
+
function s(n) {
|
|
1039
|
+
n.srcElement.style.opacity = "1";
|
|
1040
|
+
}
|
|
1041
|
+
["dragenter", "dragover", "dragleave", "drop"].forEach((n) => {
|
|
1042
|
+
t.addEventListener(n, e, !1), ["dragenter", "dragover"].includes(n) ? t.addEventListener(n, i, !1) : t.addEventListener(n, s, !1);
|
|
1043
|
+
}), t.addEventListener("drop", (n) => wt(n, r), !1);
|
|
1044
|
+
}
|
|
1045
|
+
function pe(r) {
|
|
1046
|
+
r.preventDefault(), r.stopPropagation();
|
|
1047
|
+
}
|
|
1048
|
+
function wt(r, t) {
|
|
1049
|
+
pe(r);
|
|
1050
|
+
const e = r.dataTransfer ? r.dataTransfer.files : r.target.files;
|
|
1051
|
+
Array.from(e).forEach((i) => ue(i, t));
|
|
1052
|
+
}
|
|
1053
|
+
function ue(r, t) {
|
|
1054
|
+
const e = new FileReader();
|
|
1055
|
+
e.readAsText(r), e.onloadend = function() {
|
|
1056
|
+
typeof e.result == "string" && t.handleFeatureChange(e.result);
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
var m, L, R;
|
|
1060
|
+
class ge extends x {
|
|
1077
1061
|
constructor() {
|
|
1078
1062
|
super();
|
|
1079
1063
|
/**
|
|
1080
1064
|
* @type import("../../map/main").EOxMap
|
|
1081
1065
|
*/
|
|
1082
|
-
|
|
1066
|
+
S(this, m, void 0);
|
|
1083
1067
|
/**
|
|
1084
1068
|
* @type import("ol").Map
|
|
1085
1069
|
*/
|
|
1086
|
-
|
|
1087
|
-
|
|
1070
|
+
S(this, L, void 0);
|
|
1071
|
+
/**
|
|
1072
|
+
* @type string
|
|
1073
|
+
*/
|
|
1074
|
+
S(this, R, void 0);
|
|
1075
|
+
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;
|
|
1088
1076
|
}
|
|
1089
1077
|
// Define properties with defaults and types
|
|
1090
1078
|
static get properties() {
|
|
@@ -1097,36 +1085,43 @@ class re extends w {
|
|
|
1097
1085
|
drawnFeatures: { attribute: !1, state: !0, type: Array },
|
|
1098
1086
|
modify: { attribute: !1, state: !0 },
|
|
1099
1087
|
multipleFeatures: { attribute: "multiple-features", type: Boolean },
|
|
1088
|
+
importFeatures: { attribute: "import-features", type: Boolean },
|
|
1089
|
+
showEditor: { attribute: "show-editor", type: Boolean },
|
|
1100
1090
|
showList: { attribute: "show-list", type: Boolean },
|
|
1091
|
+
noShadow: { type: Boolean },
|
|
1101
1092
|
type: { type: String },
|
|
1102
1093
|
unstyled: { type: Boolean }
|
|
1103
1094
|
};
|
|
1104
1095
|
}
|
|
1105
|
-
/**
|
|
1106
|
-
* Initializes the drawing layer before starting to draw on the map.
|
|
1107
|
-
*/
|
|
1108
|
-
initDrawLayer() {
|
|
1109
|
-
const { EoxMap: e, OlMap: s } = ee(this);
|
|
1110
|
-
M(this, x, e), M(this, S, s);
|
|
1111
|
-
}
|
|
1112
1096
|
/**
|
|
1113
1097
|
* @onClick Event handler triggered to start drawing on the map.
|
|
1114
1098
|
*/
|
|
1115
1099
|
handleStartDrawing() {
|
|
1116
|
-
|
|
1100
|
+
oe(this);
|
|
1117
1101
|
}
|
|
1118
1102
|
/**
|
|
1119
1103
|
* @onClick Event handler triggered to discard/stop drawing
|
|
1120
1104
|
* on the map and delete the drawn shapes.
|
|
1121
1105
|
*/
|
|
1122
1106
|
handleDiscardDrawing() {
|
|
1123
|
-
|
|
1107
|
+
le(this);
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* @param {string} text - The string representation of the features to be parsed.
|
|
1111
|
+
* @param {boolean} replaceFeatures - A boolean flag indicating whether to replace the existing features.
|
|
1112
|
+
*/
|
|
1113
|
+
handleFeatureChange(e, i = !1) {
|
|
1114
|
+
g(this, m).parseTextToFeature(
|
|
1115
|
+
e || JSON.stringify(ct),
|
|
1116
|
+
this.drawLayer,
|
|
1117
|
+
i
|
|
1118
|
+
);
|
|
1124
1119
|
}
|
|
1125
1120
|
/**
|
|
1126
|
-
* @
|
|
1121
|
+
* @param {DragEvent | Event} evt - The event object from the file input interaction.
|
|
1127
1122
|
*/
|
|
1128
|
-
|
|
1129
|
-
|
|
1123
|
+
handleFilesChange(e) {
|
|
1124
|
+
wt(e, this);
|
|
1130
1125
|
}
|
|
1131
1126
|
/**
|
|
1132
1127
|
* @event onModifyEnd triggered when the modification of a shape is completed.
|
|
@@ -1134,53 +1129,86 @@ class re extends w {
|
|
|
1134
1129
|
onModifyEnd() {
|
|
1135
1130
|
this.emitDrawnFeatures();
|
|
1136
1131
|
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Update #geoJSON with stringify feature.
|
|
1134
|
+
*/
|
|
1135
|
+
updateGeoJSON() {
|
|
1136
|
+
E(this, R, JSON.stringify(
|
|
1137
|
+
g(this, m).parseFeature(this.drawnFeatures) || ct,
|
|
1138
|
+
void 0,
|
|
1139
|
+
2
|
|
1140
|
+
));
|
|
1141
|
+
}
|
|
1137
1142
|
/**
|
|
1138
1143
|
* Triggers different events when the drawing of a shape is completed.
|
|
1139
1144
|
*/
|
|
1140
1145
|
emitDrawnFeatures() {
|
|
1141
|
-
|
|
1146
|
+
ce(this, () => {
|
|
1142
1147
|
this.dispatchEvent(
|
|
1143
1148
|
new CustomEvent("drawupdate", { detail: this.drawnFeatures })
|
|
1144
1149
|
);
|
|
1145
1150
|
});
|
|
1146
1151
|
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Overrides createRenderRoot to handle shadow DOM creation based on the noShadow property.
|
|
1154
|
+
*/
|
|
1155
|
+
createRenderRoot() {
|
|
1156
|
+
return this.noShadow ? this : super.createRenderRoot();
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* initializes the EOxMap and OlMap instances
|
|
1160
|
+
* And stores them in the private properties #eoxMap and #olMap, respectively.
|
|
1161
|
+
* It then calls requestUpdate to trigger a re-render.
|
|
1162
|
+
*/
|
|
1163
|
+
firstUpdated() {
|
|
1164
|
+
const { EoxMap: e, OlMap: i } = ae(this, this.multipleFeatures);
|
|
1165
|
+
E(this, m, e), E(this, L, i), this.importFeatures && de(this, g(this, m)), this.updateGeoJSON(), this.requestUpdate();
|
|
1166
|
+
}
|
|
1147
1167
|
// Render method for UI display
|
|
1148
1168
|
render() {
|
|
1149
1169
|
var e;
|
|
1150
|
-
return
|
|
1170
|
+
return _`
|
|
1151
1171
|
<style>
|
|
1152
|
-
|
|
1153
|
-
${!this.unstyled &&
|
|
1172
|
+
:host { display: block; }
|
|
1173
|
+
${!this.unstyled && he}
|
|
1174
|
+
${!this.unstyled && se}
|
|
1154
1175
|
</style>
|
|
1155
1176
|
|
|
1156
1177
|
<!-- Controller Component -->
|
|
1157
1178
|
<eox-drawtools-controller
|
|
1158
1179
|
.drawFunc=${{
|
|
1159
1180
|
start: () => this.handleStartDrawing(),
|
|
1160
|
-
discard: () => this.handleDiscardDrawing()
|
|
1181
|
+
discard: () => this.handleDiscardDrawing(),
|
|
1182
|
+
editor: (i) => this.handleFeatureChange(i.target.value, !0),
|
|
1183
|
+
import: (i) => this.handleFilesChange(i)
|
|
1161
1184
|
}}
|
|
1162
1185
|
.unstyled=${this.unstyled}
|
|
1163
1186
|
.drawnFeatures=${this.drawnFeatures}
|
|
1164
1187
|
.currentlyDrawing=${this.currentlyDrawing}
|
|
1165
1188
|
.multipleFeatures=${this.multipleFeatures}
|
|
1189
|
+
.importFeatures=${this.importFeatures}
|
|
1190
|
+
.showEditor=${this.showEditor}
|
|
1191
|
+
.geoJSON=${g(this, R)}
|
|
1166
1192
|
></eox-drawtools-controller>
|
|
1167
1193
|
|
|
1168
1194
|
<!-- List Component -->
|
|
1169
|
-
${this.showList && ((e = this.drawnFeatures) != null && e.length) ?
|
|
1170
|
-
.eoxMap=${
|
|
1171
|
-
.olMap=${
|
|
1195
|
+
${this.showList && ((e = this.drawnFeatures) != null && e.length) ? _`<eox-drawtools-list
|
|
1196
|
+
.eoxMap=${g(this, m)}
|
|
1197
|
+
.olMap=${g(this, L)}
|
|
1172
1198
|
.draw=${this.draw}
|
|
1173
1199
|
.drawLayer=${this.drawLayer}
|
|
1174
1200
|
.drawnFeatures=${this.drawnFeatures}
|
|
1175
1201
|
.modify=${this.modify}
|
|
1176
1202
|
.unstyled=${this.unstyled}
|
|
1177
|
-
@changed=${() =>
|
|
1178
|
-
|
|
1203
|
+
@changed=${() => {
|
|
1204
|
+
this.updateGeoJSON(), this.requestUpdate();
|
|
1205
|
+
}}
|
|
1206
|
+
></eox-drawtools-list>` : d}
|
|
1179
1207
|
`;
|
|
1180
1208
|
}
|
|
1181
1209
|
}
|
|
1182
|
-
|
|
1183
|
-
customElements.define("eox-drawtools",
|
|
1210
|
+
m = new WeakMap(), L = new WeakMap(), R = new WeakMap();
|
|
1211
|
+
customElements.define("eox-drawtools", ge);
|
|
1184
1212
|
export {
|
|
1185
|
-
|
|
1213
|
+
ge as EOxDrawTools
|
|
1186
1214
|
};
|