@edugis-org/webmapx 0.1.15 → 0.2.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-lib/{alert-C_G5X6J8.js → alert-CM5EIQzP.js} +28 -30
- package/dist-lib/{attribution-format-B4f05_u0.js → attribution-format-CZg2WjHO.js} +1 -1
- package/dist-lib/{button-BlZd3WPH.js → button-B_8TR-jN.js} +34 -38
- package/dist-lib/{checkbox-DB4oPyyw.js → checkbox-DOopjfpt.js} +25 -29
- package/dist-lib/{chunk.36O46B5H-km1dakSW.js → chunk.36O46B5H-EYkf8iaY.js} +8 -8
- package/dist-lib/{chunk.3RPBFEDE-Cxq6VVR6.js → chunk.3RPBFEDE-DC091CnT.js} +1 -1
- package/dist-lib/{chunk.5JY5FUCG-CYkzbQXS.js → chunk.5JY5FUCG-BmZ-LXEt.js} +324 -306
- package/dist-lib/{chunk.AJ3ENQ5C-DXVGX5Dn.js → chunk.AJ3ENQ5C-BhSO747I.js} +22 -25
- package/dist-lib/chunk.NYIIDP5N-DoNij0Gf.js +99 -0
- package/dist-lib/{chunk.SI4ACBFK-CLb9VfMG.js → chunk.SI4ACBFK-CdJVQctt.js} +1 -1
- package/dist-lib/{chunk.YHLNUJ7P-ByKy0MKm.js → chunk.YHLNUJ7P-DINaI4pI.js} +22 -24
- package/dist-lib/{decorate-CKr8yG1g.js → decorate-DNmmPsJp.js} +1 -1
- package/dist-lib/decorators-d8E4nZJy.js +624 -0
- package/dist-lib/{divider-BOFbR_Ny.js → divider-Ly2UhLd1.js} +6 -7
- package/dist-lib/{icon-CBNpO1lq.js → icon-DIjRqLFJ.js} +1 -1
- package/dist-lib/{icon-button-B5rXu3Gg.js → icon-button-C5K3NZWf.js} +39 -42
- package/dist-lib/{input-B212BH6L.js → input-DUaeAHt8.js} +63 -49
- package/dist-lib/{option-BQN9Zz_8.js → option-LnK7BxuV.js} +56 -59
- package/dist-lib/{spinner-DdcBaa3z.js → spinner-D_cltutw.js} +2 -2
- package/dist-lib/{toast-Bq2PmEpm.js → toast-DDqkINxT.js} +1 -1
- package/dist-lib/{tooltip-CBGOiZwJ.js → tooltip-C86FhPFx.js} +26 -27
- package/dist-lib/{webmapx-3d-tool-CKoLGMpk.js → webmapx-3d-tool-DXzN9Tha.js} +6 -7
- package/dist-lib/{webmapx-base-tool-Bc9Wz0yA.js → webmapx-base-tool-idjVnrFA.js} +8 -8
- package/dist-lib/{webmapx-config-edit-tool-7265_DNz.js → webmapx-config-edit-tool-B14KD1ak.js} +21 -22
- package/dist-lib/{webmapx-coordinates-tool-CSwh6fBU.js → webmapx-coordinates-tool-D57LfNy6.js} +25 -26
- package/dist-lib/{webmapx-core-bundle-Q6mWOib1.js → webmapx-core-bundle-C4M7AiLh.js} +726 -723
- package/dist-lib/{webmapx-draw-tool-6QRr5Gip.js → webmapx-draw-tool-utv2v3LN.js} +345 -325
- package/dist-lib/{webmapx-geolocation-tool-qxN5aaVB.js → webmapx-geolocation-tool-BIEqZkMX.js} +27 -28
- package/dist-lib/{webmapx-import-layer-tool-tJ374qHR.js → webmapx-import-layer-tool-DcFxtRJN.js} +18 -19
- package/dist-lib/{webmapx-info-tool-C3txgv3v.js → webmapx-info-tool-DDrllfth.js} +69 -70
- package/dist-lib/{webmapx-language-osmvector-jQzTOPU1.js → webmapx-language-osmvector-D_OP-fC3.js} +8 -9
- package/dist-lib/{webmapx-measure-tool-Cxxrzgdf.js → webmapx-measure-tool-D-6STy8v.js} +33 -34
- package/dist-lib/{webmapx-modal-tool-DQVHNXqX.js → webmapx-modal-tool-CftNio2w.js} +10 -10
- package/dist-lib/{webmapx-plugin-tool-BNZ61x6s.js → webmapx-plugin-tool-CGwliIUs.js} +5 -6
- package/dist-lib/{webmapx-print-tool-BDOTbS6u.js → webmapx-print-tool-DVL_0Hqz.js} +55 -56
- package/dist-lib/{webmapx-search-tool-CHlsE2Wx.js → webmapx-search-tool-D6y6WT8q.js} +13 -14
- package/dist-lib/{webmapx-settings-B0AT9Vjn.js → webmapx-settings--mFVPZsD.js} +41 -45
- package/dist-lib/{webmapx-truearea-tool-dxSgcbOj.js → webmapx-truearea-tool-nQzVCTAC.js} +31 -32
- package/dist-lib/{webmapx-view-mode-tool-DVSMakdh.js → webmapx-view-mode-tool-CQI54rFj.js} +11 -12
- package/dist-lib/webmapx.css +1 -1
- package/dist-lib/webmapx.js +22 -19
- package/package.json +1 -1
- package/dist-lib/chunk.NYIIDP5N-B4UCI-rQ.js +0 -34
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./chunk.YHLNUJ7P-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
17
|
-
import "./
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import { customElement as ge, eventOptions as _e, property as _, query as v, state as y } from "lit/decorators.js";
|
|
21
|
-
import { classMap as b } from "lit/directives/class-map.js";
|
|
22
|
-
import { ifDefined as x } from "lit/directives/if-defined.js";
|
|
23
|
-
import { styleMap as S } from "lit/directives/style-map.js";
|
|
1
|
+
import { a as e, i as t, o as n, s as r, t as i } from "./chunk.YHLNUJ7P-DINaI4pI.js";
|
|
2
|
+
import { a, h as o, i as s, l as c, n as l, o as u, p as d, r as f, s as p } from "./decorators-d8E4nZJy.js";
|
|
3
|
+
import { t as m } from "./decorate-DNmmPsJp.js";
|
|
4
|
+
import { a as ee, i as h, o as te, s as ne, t as re } from "./chunk.AJ3ENQ5C-BhSO747I.js";
|
|
5
|
+
import { a as g, c as ie, n as _, o as ae, s as oe, t as se } from "./chunk.NYIIDP5N-DoNij0Gf.js";
|
|
6
|
+
import { t as v } from "./chunk.6CTB5ZDJ-DjZrBd6Y.js";
|
|
7
|
+
import "./icon-DIjRqLFJ.js";
|
|
8
|
+
import "./chunk.36O46B5H-EYkf8iaY.js";
|
|
9
|
+
import { i as ce, n as le, r as ue, t as de } from "./chunk.3RPBFEDE-DC091CnT.js";
|
|
10
|
+
import { t as fe } from "./button-B_8TR-jN.js";
|
|
11
|
+
import { r as pe, t as me } from "./input-DUaeAHt8.js";
|
|
12
|
+
import { t as he } from "./chunk.SI4ACBFK-CdJVQctt.js";
|
|
13
|
+
import { t as y } from "./tooltip-C86FhPFx.js";
|
|
14
|
+
import { t as ge } from "./chunk.5JY5FUCG-BmZ-LXEt.js";
|
|
15
|
+
import { n as _e, t as ve } from "./icon-button-C5K3NZWf.js";
|
|
16
|
+
import { a as ye, i as be, t as xe } from "./zip.js-DVhmtjxZ.js";
|
|
17
|
+
import { t as Se } from "./webmapx-modal-tool-CftNio2w.js";
|
|
18
|
+
import "./option-LnK7BxuV.js";
|
|
19
|
+
import { r as Ce } from "./map-layer-registry-2cmkiRDK.js";
|
|
24
20
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B63YXDJO.js
|
|
25
|
-
var
|
|
21
|
+
var we = o`
|
|
26
22
|
:host {
|
|
27
23
|
display: block;
|
|
28
24
|
}
|
|
@@ -54,7 +50,7 @@ var ve = h`
|
|
|
54
50
|
white-space: nowrap;
|
|
55
51
|
border: 0;
|
|
56
52
|
}
|
|
57
|
-
`,
|
|
53
|
+
`, Te = o`
|
|
58
54
|
:host {
|
|
59
55
|
display: inline-block;
|
|
60
56
|
}
|
|
@@ -63,31 +59,31 @@ var ve = h`
|
|
|
63
59
|
display: flex;
|
|
64
60
|
flex-wrap: nowrap;
|
|
65
61
|
}
|
|
66
|
-
`,
|
|
62
|
+
`, b = class extends t {
|
|
67
63
|
constructor() {
|
|
68
64
|
super(...arguments), this.disableRole = !1, this.label = "";
|
|
69
65
|
}
|
|
70
66
|
handleFocus(e) {
|
|
71
|
-
|
|
67
|
+
x(e.target)?.toggleAttribute("data-sl-button-group__button--focus", !0);
|
|
72
68
|
}
|
|
73
69
|
handleBlur(e) {
|
|
74
|
-
|
|
70
|
+
x(e.target)?.toggleAttribute("data-sl-button-group__button--focus", !1);
|
|
75
71
|
}
|
|
76
72
|
handleMouseOver(e) {
|
|
77
|
-
|
|
73
|
+
x(e.target)?.toggleAttribute("data-sl-button-group__button--hover", !0);
|
|
78
74
|
}
|
|
79
75
|
handleMouseOut(e) {
|
|
80
|
-
|
|
76
|
+
x(e.target)?.toggleAttribute("data-sl-button-group__button--hover", !1);
|
|
81
77
|
}
|
|
82
78
|
handleSlotChange() {
|
|
83
79
|
let e = [...this.defaultSlot.assignedElements({ flatten: !0 })];
|
|
84
80
|
e.forEach((t) => {
|
|
85
|
-
let n = e.indexOf(t), r =
|
|
81
|
+
let n = e.indexOf(t), r = x(t);
|
|
86
82
|
r && (r.toggleAttribute("data-sl-button-group__button", !0), r.toggleAttribute("data-sl-button-group__button--first", n === 0), r.toggleAttribute("data-sl-button-group__button--inner", n > 0 && n < e.length - 1), r.toggleAttribute("data-sl-button-group__button--last", n === e.length - 1), r.toggleAttribute("data-sl-button-group__button--radio", r.tagName.toLowerCase() === "sl-radio-button"));
|
|
87
83
|
});
|
|
88
84
|
}
|
|
89
85
|
render() {
|
|
90
|
-
return
|
|
86
|
+
return d`
|
|
91
87
|
<div
|
|
92
88
|
part="base"
|
|
93
89
|
class="button-group"
|
|
@@ -103,20 +99,20 @@ var ve = h`
|
|
|
103
99
|
`;
|
|
104
100
|
}
|
|
105
101
|
};
|
|
106
|
-
|
|
107
|
-
function
|
|
102
|
+
b.styles = [e, Te], r([l("slot")], b.prototype, "defaultSlot", 2), r([s()], b.prototype, "disableRole", 2), r([a()], b.prototype, "label", 2);
|
|
103
|
+
function x(e) {
|
|
108
104
|
let t = "sl-button, sl-radio-button";
|
|
109
105
|
return e.closest(t) ?? e.querySelector(t);
|
|
110
106
|
}
|
|
111
107
|
//#endregion
|
|
112
108
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ZJNIZFRS.js
|
|
113
|
-
var
|
|
109
|
+
var S = class extends t {
|
|
114
110
|
constructor() {
|
|
115
|
-
super(...arguments), this.formControlController = new
|
|
111
|
+
super(...arguments), this.formControlController = new de(this), this.hasSlotController = new se(this, "help-text", "label"), this.customValidityMessage = "", this.hasButtonGroup = !1, this.errorMessage = "", this.defaultValue = "", this.label = "", this.helpText = "", this.name = "option", this.value = "", this.size = "medium", this.form = "", this.required = !1;
|
|
116
112
|
}
|
|
117
113
|
get validity() {
|
|
118
114
|
let e = this.required && !this.value;
|
|
119
|
-
return this.customValidityMessage === "" ? e ?
|
|
115
|
+
return this.customValidityMessage === "" ? e ? ce : ue : le;
|
|
120
116
|
}
|
|
121
117
|
get validationMessage() {
|
|
122
118
|
let e = this.required && !this.value;
|
|
@@ -202,13 +198,13 @@ var T = class extends n {
|
|
|
202
198
|
i && i.focus(e);
|
|
203
199
|
}
|
|
204
200
|
render() {
|
|
205
|
-
let e = this.hasSlotController.test("label"), t = this.hasSlotController.test("help-text"), n = this.label ? !0 : !!e, r = this.helpText ? !0 : !!t, i =
|
|
201
|
+
let e = this.hasSlotController.test("label"), t = this.hasSlotController.test("help-text"), n = this.label ? !0 : !!e, r = this.helpText ? !0 : !!t, i = d`
|
|
206
202
|
<slot @slotchange=${this.syncRadios} @click=${this.handleRadioClick} @keydown=${this.handleKeyDown}></slot>
|
|
207
203
|
`;
|
|
208
|
-
return
|
|
204
|
+
return d`
|
|
209
205
|
<fieldset
|
|
210
206
|
part="form-control"
|
|
211
|
-
class=${
|
|
207
|
+
class=${g({
|
|
212
208
|
"form-control": !0,
|
|
213
209
|
"form-control--small": this.size === "small",
|
|
214
210
|
"form-control--medium": this.size === "medium",
|
|
@@ -247,7 +243,7 @@ var T = class extends n {
|
|
|
247
243
|
</label>
|
|
248
244
|
</div>
|
|
249
245
|
|
|
250
|
-
${this.hasButtonGroup ?
|
|
246
|
+
${this.hasButtonGroup ? d`
|
|
251
247
|
<sl-button-group part="button-group" exportparts="base:button-group__base" role="presentation">
|
|
252
248
|
${i}
|
|
253
249
|
</sl-button-group>
|
|
@@ -268,17 +264,17 @@ var T = class extends n {
|
|
|
268
264
|
};
|
|
269
265
|
//#endregion
|
|
270
266
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.2PCBEMQZ.js
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
],
|
|
267
|
+
S.styles = [
|
|
268
|
+
e,
|
|
269
|
+
he,
|
|
270
|
+
we
|
|
271
|
+
], S.dependencies = { "sl-button-group": b }, r([l("slot:not([name])")], S.prototype, "defaultSlot", 2), r([l(".radio-group__validation-input")], S.prototype, "validationInput", 2), r([s()], S.prototype, "hasButtonGroup", 2), r([s()], S.prototype, "errorMessage", 2), r([s()], S.prototype, "defaultValue", 2), r([a()], S.prototype, "label", 2), r([a({ attribute: "help-text" })], S.prototype, "helpText", 2), r([a()], S.prototype, "name", 2), r([a({ reflect: !0 })], S.prototype, "value", 2), r([a({ reflect: !0 })], S.prototype, "size", 2), r([a({ reflect: !0 })], S.prototype, "form", 2), r([a({
|
|
276
272
|
type: Boolean,
|
|
277
273
|
reflect: !0
|
|
278
|
-
})],
|
|
274
|
+
})], S.prototype, "required", 2), r([n("size", { waitUntilFirstUpdate: !0 })], S.prototype, "handleSizeChange", 1), r([n("value")], S.prototype, "handleValueChange", 1), S.define("sl-radio-group");
|
|
279
275
|
//#endregion
|
|
280
276
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FKMWLPHV.js
|
|
281
|
-
var
|
|
277
|
+
var Ee = o`
|
|
282
278
|
:host {
|
|
283
279
|
display: block;
|
|
284
280
|
}
|
|
@@ -390,7 +386,7 @@ var be = h`
|
|
|
390
386
|
user-select: none;
|
|
391
387
|
-webkit-user-select: none;
|
|
392
388
|
}
|
|
393
|
-
`,
|
|
389
|
+
`, C = class extends t {
|
|
394
390
|
constructor() {
|
|
395
391
|
super(), this.checked = !1, this.hasFocus = !1, this.size = "medium", this.disabled = !1, this.handleBlur = () => {
|
|
396
392
|
this.hasFocus = !1, this.emit("sl-blur");
|
|
@@ -413,10 +409,10 @@ var be = h`
|
|
|
413
409
|
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
414
410
|
}
|
|
415
411
|
render() {
|
|
416
|
-
return
|
|
412
|
+
return d`
|
|
417
413
|
<span
|
|
418
414
|
part="base"
|
|
419
|
-
class=${
|
|
415
|
+
class=${g({
|
|
420
416
|
radio: !0,
|
|
421
417
|
"radio--checked": this.checked,
|
|
422
418
|
"radio--disabled": this.disabled,
|
|
@@ -427,7 +423,7 @@ var be = h`
|
|
|
427
423
|
})}
|
|
428
424
|
>
|
|
429
425
|
<span part="${`control${this.checked ? " control--checked" : ""}`}" class="radio__control">
|
|
430
|
-
${this.checked ?
|
|
426
|
+
${this.checked ? d` <sl-icon part="checked-icon" class="radio__checked-icon" library="system" name="radio"></sl-icon> ` : ""}
|
|
431
427
|
</span>
|
|
432
428
|
|
|
433
429
|
<slot part="label" class="radio__label"></slot>
|
|
@@ -437,13 +433,13 @@ var be = h`
|
|
|
437
433
|
};
|
|
438
434
|
//#endregion
|
|
439
435
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.MSKEYBDI.js
|
|
440
|
-
|
|
436
|
+
C.styles = [e, Ee], C.dependencies = { "sl-icon": i }, r([s()], C.prototype, "checked", 2), r([s()], C.prototype, "hasFocus", 2), r([a()], C.prototype, "value", 2), r([a({ reflect: !0 })], C.prototype, "size", 2), r([a({
|
|
441
437
|
type: Boolean,
|
|
442
438
|
reflect: !0
|
|
443
|
-
})],
|
|
439
|
+
})], C.prototype, "disabled", 2), r([n("checked")], C.prototype, "handleCheckedChange", 1), r([n("disabled", { waitUntilFirstUpdate: !0 })], C.prototype, "handleDisabledChange", 1), C.define("sl-radio");
|
|
444
440
|
//#endregion
|
|
445
441
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.YKKSQ2FG.js
|
|
446
|
-
var
|
|
442
|
+
var De = o`
|
|
447
443
|
:host(:not(:focus-within)) {
|
|
448
444
|
position: absolute !important;
|
|
449
445
|
width: 1px !important;
|
|
@@ -455,15 +451,15 @@ var xe = h`
|
|
|
455
451
|
white-space: nowrap !important;
|
|
456
452
|
padding: 0 !important;
|
|
457
453
|
}
|
|
458
|
-
`,
|
|
454
|
+
`, w = class extends t {
|
|
459
455
|
render() {
|
|
460
|
-
return
|
|
456
|
+
return d` <slot></slot> `;
|
|
461
457
|
}
|
|
462
458
|
};
|
|
463
|
-
|
|
459
|
+
w.styles = [e, De];
|
|
464
460
|
//#endregion
|
|
465
461
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.ESELY2US.js
|
|
466
|
-
function
|
|
462
|
+
function T(e, t) {
|
|
467
463
|
function n(n) {
|
|
468
464
|
let r = e.getBoundingClientRect(), i = e.ownerDocument.defaultView, a = r.left + i.scrollX, o = r.top + i.scrollY, s = n.pageX - a, c = n.pageY - o;
|
|
469
465
|
t?.onMove && t.onMove(s, c);
|
|
@@ -475,7 +471,7 @@ function D(e, t) {
|
|
|
475
471
|
}
|
|
476
472
|
//#endregion
|
|
477
473
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.LXP7GVU3.js
|
|
478
|
-
var
|
|
474
|
+
var Oe = o`
|
|
479
475
|
:host {
|
|
480
476
|
display: inline-block;
|
|
481
477
|
}
|
|
@@ -523,9 +519,9 @@ var Ce = h`
|
|
|
523
519
|
max-width: var(--auto-size-available-width) !important;
|
|
524
520
|
max-height: var(--auto-size-available-height) !important;
|
|
525
521
|
}
|
|
526
|
-
`,
|
|
522
|
+
`, E = class extends t {
|
|
527
523
|
constructor() {
|
|
528
|
-
super(...arguments), this.localize = new
|
|
524
|
+
super(...arguments), this.localize = new v(this), this.open = !1, this.placement = "bottom-start", this.disabled = !1, this.stayOpenOnSelect = !1, this.distance = 0, this.skidding = 0, this.hoist = !1, this.sync = void 0, this.handleKeyDown = (e) => {
|
|
529
525
|
this.open && e.key === "Escape" && (e.stopPropagation(), this.hide(), this.focusOnTrigger());
|
|
530
526
|
}, this.handleDocumentKeyDown = (e) => {
|
|
531
527
|
if (e.key === "Escape" && this.open && !this.closeWatcher) {
|
|
@@ -545,7 +541,7 @@ var Ce = h`
|
|
|
545
541
|
return i instanceof ShadowRoot ? t(i.host, n) : null;
|
|
546
542
|
};
|
|
547
543
|
setTimeout(() => {
|
|
548
|
-
let e = this.containingElement?.getRootNode() instanceof ShadowRoot ?
|
|
544
|
+
let e = this.containingElement?.getRootNode() instanceof ShadowRoot ? ve() : document.activeElement;
|
|
549
545
|
(!this.containingElement || t(e, this.containingElement.tagName.toLowerCase()) !== this.containingElement) && this.hide();
|
|
550
546
|
});
|
|
551
547
|
}
|
|
@@ -601,7 +597,7 @@ var Ce = h`
|
|
|
601
597
|
this.updateAccessibleTrigger();
|
|
602
598
|
}
|
|
603
599
|
updateAccessibleTrigger() {
|
|
604
|
-
let e = this.trigger.assignedElements({ flatten: !0 }).find((e) =>
|
|
600
|
+
let e = this.trigger.assignedElements({ flatten: !0 }).find((e) => _e(e).start), t;
|
|
605
601
|
if (e) {
|
|
606
602
|
switch (e.tagName.toLowerCase()) {
|
|
607
603
|
case "sl-button":
|
|
@@ -614,10 +610,10 @@ var Ce = h`
|
|
|
614
610
|
}
|
|
615
611
|
}
|
|
616
612
|
async show() {
|
|
617
|
-
if (!this.open) return this.open = !0,
|
|
613
|
+
if (!this.open) return this.open = !0, ee(this, "sl-after-show");
|
|
618
614
|
}
|
|
619
615
|
async hide() {
|
|
620
|
-
if (this.open) return this.open = !1,
|
|
616
|
+
if (this.open) return this.open = !1, ee(this, "sl-after-hide");
|
|
621
617
|
}
|
|
622
618
|
reposition() {
|
|
623
619
|
this.popup.reposition();
|
|
@@ -638,17 +634,17 @@ var Ce = h`
|
|
|
638
634
|
return;
|
|
639
635
|
}
|
|
640
636
|
if (this.updateAccessibleTrigger(), this.open) {
|
|
641
|
-
this.emit("sl-show"), this.addOpenListeners(), await
|
|
642
|
-
let { keyframes: e, options: t } =
|
|
643
|
-
await
|
|
637
|
+
this.emit("sl-show"), this.addOpenListeners(), await h(this), this.panel.hidden = !1, this.popup.active = !0;
|
|
638
|
+
let { keyframes: e, options: t } = te(this, "dropdown.show", { dir: this.localize.dir() });
|
|
639
|
+
await re(this.popup.popup, e, t), this.emit("sl-after-show");
|
|
644
640
|
} else {
|
|
645
|
-
this.emit("sl-hide"), this.removeOpenListeners(), await
|
|
646
|
-
let { keyframes: e, options: t } =
|
|
647
|
-
await
|
|
641
|
+
this.emit("sl-hide"), this.removeOpenListeners(), await h(this);
|
|
642
|
+
let { keyframes: e, options: t } = te(this, "dropdown.hide", { dir: this.localize.dir() });
|
|
643
|
+
await re(this.popup.popup, e, t), this.panel.hidden = !0, this.popup.active = !1, this.emit("sl-after-hide");
|
|
648
644
|
}
|
|
649
645
|
}
|
|
650
646
|
render() {
|
|
651
|
-
return
|
|
647
|
+
return d`
|
|
652
648
|
<sl-popup
|
|
653
649
|
part="base"
|
|
654
650
|
exportparts="popup:base__popup"
|
|
@@ -661,8 +657,8 @@ var Ce = h`
|
|
|
661
657
|
shift
|
|
662
658
|
auto-size="vertical"
|
|
663
659
|
auto-size-padding="10"
|
|
664
|
-
sync=${
|
|
665
|
-
class=${
|
|
660
|
+
sync=${_(this.sync ? this.sync : void 0)}
|
|
661
|
+
class=${g({
|
|
666
662
|
dropdown: !0,
|
|
667
663
|
"dropdown--open": this.open
|
|
668
664
|
})}
|
|
@@ -685,17 +681,17 @@ var Ce = h`
|
|
|
685
681
|
`;
|
|
686
682
|
}
|
|
687
683
|
};
|
|
688
|
-
|
|
684
|
+
E.styles = [e, Oe], E.dependencies = { "sl-popup": ge }, r([l(".dropdown")], E.prototype, "popup", 2), r([l(".dropdown__trigger")], E.prototype, "trigger", 2), r([l(".dropdown__panel")], E.prototype, "panel", 2), r([a({
|
|
689
685
|
type: Boolean,
|
|
690
686
|
reflect: !0
|
|
691
|
-
})],
|
|
687
|
+
})], E.prototype, "open", 2), r([a({ reflect: !0 })], E.prototype, "placement", 2), r([a({
|
|
692
688
|
type: Boolean,
|
|
693
689
|
reflect: !0
|
|
694
|
-
})],
|
|
690
|
+
})], E.prototype, "disabled", 2), r([a({
|
|
695
691
|
attribute: "stay-open-on-select",
|
|
696
692
|
type: Boolean,
|
|
697
693
|
reflect: !0
|
|
698
|
-
})],
|
|
694
|
+
})], E.prototype, "stayOpenOnSelect", 2), r([a({ attribute: !1 })], E.prototype, "containingElement", 2), r([a({ type: Number })], E.prototype, "distance", 2), r([a({ type: Number })], E.prototype, "skidding", 2), r([a({ type: Boolean })], E.prototype, "hoist", 2), r([a({ reflect: !0 })], E.prototype, "sync", 2), r([n("open", { waitUntilFirstUpdate: !0 })], E.prototype, "handleOpenChange", 1), ne("dropdown.show", {
|
|
699
695
|
keyframes: [{
|
|
700
696
|
opacity: 0,
|
|
701
697
|
scale: .9
|
|
@@ -707,7 +703,7 @@ O.styles = [r, Ce], O.dependencies = { "sl-popup": fe }, e([v(".dropdown")], O.p
|
|
|
707
703
|
duration: 100,
|
|
708
704
|
easing: "ease"
|
|
709
705
|
}
|
|
710
|
-
}),
|
|
706
|
+
}), ne("dropdown.hide", {
|
|
711
707
|
keyframes: [{
|
|
712
708
|
opacity: 1,
|
|
713
709
|
scale: 1
|
|
@@ -722,7 +718,7 @@ O.styles = [r, Ce], O.dependencies = { "sl-popup": fe }, e([v(".dropdown")], O.p
|
|
|
722
718
|
});
|
|
723
719
|
//#endregion
|
|
724
720
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.O6CEROC7.js
|
|
725
|
-
var
|
|
721
|
+
var ke = o`
|
|
726
722
|
:host {
|
|
727
723
|
--grid-width: 280px;
|
|
728
724
|
--grid-height: 200px;
|
|
@@ -1057,43 +1053,67 @@ var we = h`
|
|
|
1057
1053
|
opacity: 0.5;
|
|
1058
1054
|
cursor: not-allowed;
|
|
1059
1055
|
}
|
|
1060
|
-
|
|
1056
|
+
`, Ae = "important", je = " !important", D = ae(class extends oe {
|
|
1057
|
+
constructor(e) {
|
|
1058
|
+
if (super(e), e.type !== ie.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
1059
|
+
}
|
|
1060
|
+
render(e) {
|
|
1061
|
+
return Object.keys(e).reduce(((t, n) => {
|
|
1062
|
+
let r = e[n];
|
|
1063
|
+
return r == null ? t : t + `${n = n.includes("-") ? n : n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
|
|
1064
|
+
}), "");
|
|
1065
|
+
}
|
|
1066
|
+
update(e, [t]) {
|
|
1067
|
+
let { style: n } = e.element;
|
|
1068
|
+
if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
|
|
1069
|
+
for (let e of this.ft) t[e] ?? (this.ft.delete(e), e.includes("-") ? n.removeProperty(e) : n[e] = null);
|
|
1070
|
+
for (let e in t) {
|
|
1071
|
+
let r = t[e];
|
|
1072
|
+
if (r != null) {
|
|
1073
|
+
this.ft.add(e);
|
|
1074
|
+
let t = typeof r == "string" && r.endsWith(je);
|
|
1075
|
+
e.includes("-") || t ? n.setProperty(e, t ? r.slice(0, -11) : r, t ? Ae : "") : n[e] = r;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return c;
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1061
1081
|
//#endregion
|
|
1062
1082
|
//#region node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
1063
|
-
function
|
|
1064
|
-
|
|
1065
|
-
let n =
|
|
1083
|
+
function O(e, t) {
|
|
1084
|
+
Me(e) && (e = "100%");
|
|
1085
|
+
let n = Ne(e);
|
|
1066
1086
|
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = t === 360 ? (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e % t / parseFloat(String(t)), e);
|
|
1067
1087
|
}
|
|
1068
|
-
function
|
|
1088
|
+
function k(e) {
|
|
1069
1089
|
return Math.min(1, Math.max(0, e));
|
|
1070
1090
|
}
|
|
1071
|
-
function
|
|
1091
|
+
function Me(e) {
|
|
1072
1092
|
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
|
|
1073
1093
|
}
|
|
1074
|
-
function
|
|
1094
|
+
function Ne(e) {
|
|
1075
1095
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
1076
1096
|
}
|
|
1077
|
-
function
|
|
1097
|
+
function Pe(e) {
|
|
1078
1098
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1079
1099
|
}
|
|
1080
|
-
function
|
|
1100
|
+
function A(e) {
|
|
1081
1101
|
return Number(e) <= 1 ? `${Number(e) * 100}%` : e;
|
|
1082
1102
|
}
|
|
1083
|
-
function
|
|
1103
|
+
function j(e) {
|
|
1084
1104
|
return e.length === 1 ? "0" + e : String(e);
|
|
1085
1105
|
}
|
|
1086
1106
|
//#endregion
|
|
1087
1107
|
//#region node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
1088
|
-
function
|
|
1108
|
+
function Fe(e, t, n) {
|
|
1089
1109
|
return {
|
|
1090
|
-
r:
|
|
1091
|
-
g:
|
|
1092
|
-
b:
|
|
1110
|
+
r: O(e, 255) * 255,
|
|
1111
|
+
g: O(t, 255) * 255,
|
|
1112
|
+
b: O(n, 255) * 255
|
|
1093
1113
|
};
|
|
1094
1114
|
}
|
|
1095
|
-
function
|
|
1096
|
-
e =
|
|
1115
|
+
function Ie(e, t, n) {
|
|
1116
|
+
e = O(e, 255), t = O(t, 255), n = O(n, 255);
|
|
1097
1117
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = 0, s = (r + i) / 2;
|
|
1098
1118
|
if (r === i) o = 0, a = 0;
|
|
1099
1119
|
else {
|
|
@@ -1118,15 +1138,15 @@ function ke(e, t, n) {
|
|
|
1118
1138
|
l: s
|
|
1119
1139
|
};
|
|
1120
1140
|
}
|
|
1121
|
-
function
|
|
1141
|
+
function M(e, t, n) {
|
|
1122
1142
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
1123
1143
|
}
|
|
1124
|
-
function
|
|
1144
|
+
function Le(e, t, n) {
|
|
1125
1145
|
let r, i, a;
|
|
1126
|
-
if (e =
|
|
1146
|
+
if (e = O(e, 360), t = O(t, 100), n = O(n, 100), t === 0) i = n, a = n, r = n;
|
|
1127
1147
|
else {
|
|
1128
1148
|
let o = n < .5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o;
|
|
1129
|
-
r =
|
|
1149
|
+
r = M(s, o, e + 1 / 3), i = M(s, o, e), a = M(s, o, e - 1 / 3);
|
|
1130
1150
|
}
|
|
1131
1151
|
return {
|
|
1132
1152
|
r: r * 255,
|
|
@@ -1134,8 +1154,8 @@ function Ae(e, t, n) {
|
|
|
1134
1154
|
b: a * 255
|
|
1135
1155
|
};
|
|
1136
1156
|
}
|
|
1137
|
-
function
|
|
1138
|
-
e =
|
|
1157
|
+
function Re(e, t, n) {
|
|
1158
|
+
e = O(e, 255), t = O(t, 255), n = O(n, 255);
|
|
1139
1159
|
let r = Math.max(e, t, n), i = Math.min(e, t, n), a = 0, o = r, s = r - i, c = r === 0 ? 0 : s / r;
|
|
1140
1160
|
if (r === i) a = 0;
|
|
1141
1161
|
else {
|
|
@@ -1159,8 +1179,8 @@ function je(e, t, n) {
|
|
|
1159
1179
|
v: o
|
|
1160
1180
|
};
|
|
1161
1181
|
}
|
|
1162
|
-
function
|
|
1163
|
-
e =
|
|
1182
|
+
function ze(e, t, n) {
|
|
1183
|
+
e = O(e, 360) * 6, t = O(t, 100), n = O(n, 100);
|
|
1164
1184
|
let r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
1165
1185
|
n,
|
|
1166
1186
|
o,
|
|
@@ -1189,24 +1209,24 @@ function Me(e, t, n) {
|
|
|
1189
1209
|
b: d * 255
|
|
1190
1210
|
};
|
|
1191
1211
|
}
|
|
1192
|
-
function
|
|
1212
|
+
function Be(e, t, n, r) {
|
|
1193
1213
|
let i = [
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1214
|
+
j(Math.round(e).toString(16)),
|
|
1215
|
+
j(Math.round(t).toString(16)),
|
|
1216
|
+
j(Math.round(n).toString(16))
|
|
1197
1217
|
];
|
|
1198
1218
|
return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
|
|
1199
1219
|
}
|
|
1200
|
-
function
|
|
1220
|
+
function Ve(e, t, n, r, i) {
|
|
1201
1221
|
let a = [
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1222
|
+
j(Math.round(e).toString(16)),
|
|
1223
|
+
j(Math.round(t).toString(16)),
|
|
1224
|
+
j(Math.round(n).toString(16)),
|
|
1225
|
+
j(We(r))
|
|
1206
1226
|
];
|
|
1207
1227
|
return i && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
1208
1228
|
}
|
|
1209
|
-
function
|
|
1229
|
+
function He(e, t, n, r) {
|
|
1210
1230
|
let i = e / 100, a = t / 100, o = n / 100, s = r / 100;
|
|
1211
1231
|
return {
|
|
1212
1232
|
r: 255 * (1 - i) * (1 - s),
|
|
@@ -1214,7 +1234,7 @@ function Fe(e, t, n, r) {
|
|
|
1214
1234
|
b: 255 * (1 - o) * (1 - s)
|
|
1215
1235
|
};
|
|
1216
1236
|
}
|
|
1217
|
-
function
|
|
1237
|
+
function Ue(e, t, n) {
|
|
1218
1238
|
let r = 1 - e / 255, i = 1 - t / 255, a = 1 - n / 255, o = Math.min(r, i, a);
|
|
1219
1239
|
return o === 1 ? (r = 0, i = 0, a = 0) : (r = (r - o) / (1 - o) * 100, i = (i - o) / (1 - o) * 100, a = (a - o) / (1 - o) * 100), o *= 100, {
|
|
1220
1240
|
c: Math.round(r),
|
|
@@ -1223,16 +1243,16 @@ function Ie(e, t, n) {
|
|
|
1223
1243
|
k: Math.round(o)
|
|
1224
1244
|
};
|
|
1225
1245
|
}
|
|
1226
|
-
function
|
|
1246
|
+
function We(e) {
|
|
1227
1247
|
return Math.round(parseFloat(e) * 255).toString(16);
|
|
1228
1248
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return
|
|
1249
|
+
function Ge(e) {
|
|
1250
|
+
return N(e) / 255;
|
|
1231
1251
|
}
|
|
1232
|
-
function
|
|
1252
|
+
function N(e) {
|
|
1233
1253
|
return parseInt(e, 16);
|
|
1234
1254
|
}
|
|
1235
|
-
function
|
|
1255
|
+
function Ke(e) {
|
|
1236
1256
|
return {
|
|
1237
1257
|
r: e >> 16,
|
|
1238
1258
|
g: (e & 65280) >> 8,
|
|
@@ -1241,7 +1261,7 @@ function ze(e) {
|
|
|
1241
1261
|
}
|
|
1242
1262
|
//#endregion
|
|
1243
1263
|
//#region node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
|
|
1244
|
-
var
|
|
1264
|
+
var P = {
|
|
1245
1265
|
aliceblue: "#f0f8ff",
|
|
1246
1266
|
antiquewhite: "#faebd7",
|
|
1247
1267
|
aqua: "#00ffff",
|
|
@@ -1393,13 +1413,13 @@ var F = {
|
|
|
1393
1413
|
};
|
|
1394
1414
|
//#endregion
|
|
1395
1415
|
//#region node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
1396
|
-
function
|
|
1416
|
+
function qe(e) {
|
|
1397
1417
|
let t = {
|
|
1398
1418
|
r: 0,
|
|
1399
1419
|
g: 0,
|
|
1400
1420
|
b: 0
|
|
1401
1421
|
}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
|
|
1402
|
-
return typeof e == "string" && (e =
|
|
1422
|
+
return typeof e == "string" && (e = Je(e)), typeof e == "object" && (I(e.r) && I(e.g) && I(e.b) ? (t = Fe(e.r, e.g, e.b), o = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : I(e.h) && I(e.s) && I(e.v) ? (r = A(e.s), i = A(e.v), t = ze(e.h, r, i), o = !0, s = "hsv") : I(e.h) && I(e.s) && I(e.l) ? (r = A(e.s), a = A(e.l), t = Le(e.h, r, a), o = !0, s = "hsl") : I(e.c) && I(e.m) && I(e.y) && I(e.k) && (t = He(e.c, e.m, e.y, e.k), o = !0, s = "cmyk"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Pe(n), {
|
|
1403
1423
|
ok: o,
|
|
1404
1424
|
format: e.format || s,
|
|
1405
1425
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -1408,7 +1428,7 @@ function Be(e) {
|
|
|
1408
1428
|
a: n
|
|
1409
1429
|
};
|
|
1410
1430
|
}
|
|
1411
|
-
var
|
|
1431
|
+
var F = {
|
|
1412
1432
|
CSS_UNIT: /* @__PURE__ */ RegExp("(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)"),
|
|
1413
1433
|
rgb: /* @__PURE__ */ RegExp("rgb[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
1414
1434
|
rgba: /* @__PURE__ */ RegExp("rgba[\\s|\\(]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))[,|\\s]+((?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?))\\s*\\)?"),
|
|
@@ -1422,10 +1442,10 @@ var I = {
|
|
|
1422
1442
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1423
1443
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1424
1444
|
};
|
|
1425
|
-
function
|
|
1445
|
+
function Je(e) {
|
|
1426
1446
|
if (e = e.trim().toLowerCase(), e.length === 0) return !1;
|
|
1427
1447
|
let t = !1;
|
|
1428
|
-
if (
|
|
1448
|
+
if (P[e]) e = P[e], t = !0;
|
|
1429
1449
|
else if (e === "transparent") return {
|
|
1430
1450
|
r: 0,
|
|
1431
1451
|
g: 0,
|
|
@@ -1433,73 +1453,73 @@ function Ve(e) {
|
|
|
1433
1453
|
a: 0,
|
|
1434
1454
|
format: "name"
|
|
1435
1455
|
};
|
|
1436
|
-
let n =
|
|
1456
|
+
let n = F.rgb.exec(e);
|
|
1437
1457
|
return n ? {
|
|
1438
1458
|
r: n[1],
|
|
1439
1459
|
g: n[2],
|
|
1440
1460
|
b: n[3]
|
|
1441
|
-
} : (n =
|
|
1461
|
+
} : (n = F.rgba.exec(e), n ? {
|
|
1442
1462
|
r: n[1],
|
|
1443
1463
|
g: n[2],
|
|
1444
1464
|
b: n[3],
|
|
1445
1465
|
a: n[4]
|
|
1446
|
-
} : (n =
|
|
1466
|
+
} : (n = F.hsl.exec(e), n ? {
|
|
1447
1467
|
h: n[1],
|
|
1448
1468
|
s: n[2],
|
|
1449
1469
|
l: n[3]
|
|
1450
|
-
} : (n =
|
|
1470
|
+
} : (n = F.hsla.exec(e), n ? {
|
|
1451
1471
|
h: n[1],
|
|
1452
1472
|
s: n[2],
|
|
1453
1473
|
l: n[3],
|
|
1454
1474
|
a: n[4]
|
|
1455
|
-
} : (n =
|
|
1475
|
+
} : (n = F.hsv.exec(e), n ? {
|
|
1456
1476
|
h: n[1],
|
|
1457
1477
|
s: n[2],
|
|
1458
1478
|
v: n[3]
|
|
1459
|
-
} : (n =
|
|
1479
|
+
} : (n = F.hsva.exec(e), n ? {
|
|
1460
1480
|
h: n[1],
|
|
1461
1481
|
s: n[2],
|
|
1462
1482
|
v: n[3],
|
|
1463
1483
|
a: n[4]
|
|
1464
|
-
} : (n =
|
|
1484
|
+
} : (n = F.cmyk.exec(e), n ? {
|
|
1465
1485
|
c: n[1],
|
|
1466
1486
|
m: n[2],
|
|
1467
1487
|
y: n[3],
|
|
1468
1488
|
k: n[4]
|
|
1469
|
-
} : (n =
|
|
1470
|
-
r:
|
|
1471
|
-
g:
|
|
1472
|
-
b:
|
|
1473
|
-
a:
|
|
1489
|
+
} : (n = F.hex8.exec(e), n ? {
|
|
1490
|
+
r: N(n[1]),
|
|
1491
|
+
g: N(n[2]),
|
|
1492
|
+
b: N(n[3]),
|
|
1493
|
+
a: Ge(n[4]),
|
|
1474
1494
|
format: t ? "name" : "hex8"
|
|
1475
|
-
} : (n =
|
|
1476
|
-
r:
|
|
1477
|
-
g:
|
|
1478
|
-
b:
|
|
1495
|
+
} : (n = F.hex6.exec(e), n ? {
|
|
1496
|
+
r: N(n[1]),
|
|
1497
|
+
g: N(n[2]),
|
|
1498
|
+
b: N(n[3]),
|
|
1479
1499
|
format: t ? "name" : "hex"
|
|
1480
|
-
} : (n =
|
|
1481
|
-
r:
|
|
1482
|
-
g:
|
|
1483
|
-
b:
|
|
1484
|
-
a:
|
|
1500
|
+
} : (n = F.hex4.exec(e), n ? {
|
|
1501
|
+
r: N(n[1] + n[1]),
|
|
1502
|
+
g: N(n[2] + n[2]),
|
|
1503
|
+
b: N(n[3] + n[3]),
|
|
1504
|
+
a: Ge(n[4] + n[4]),
|
|
1485
1505
|
format: t ? "name" : "hex8"
|
|
1486
|
-
} : (n =
|
|
1487
|
-
r:
|
|
1488
|
-
g:
|
|
1489
|
-
b:
|
|
1506
|
+
} : (n = F.hex3.exec(e), n ? {
|
|
1507
|
+
r: N(n[1] + n[1]),
|
|
1508
|
+
g: N(n[2] + n[2]),
|
|
1509
|
+
b: N(n[3] + n[3]),
|
|
1490
1510
|
format: t ? "name" : "hex"
|
|
1491
1511
|
} : !1))))))))));
|
|
1492
1512
|
}
|
|
1493
|
-
function
|
|
1494
|
-
return typeof e == "number" ? !Number.isNaN(e) :
|
|
1513
|
+
function I(e) {
|
|
1514
|
+
return typeof e == "number" ? !Number.isNaN(e) : F.CSS_UNIT.test(e);
|
|
1495
1515
|
}
|
|
1496
1516
|
//#endregion
|
|
1497
1517
|
//#region node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
1498
|
-
var
|
|
1518
|
+
var Ye = class e {
|
|
1499
1519
|
constructor(t = "", n = {}) {
|
|
1500
1520
|
if (t instanceof e) return t;
|
|
1501
|
-
typeof t == "number" && (t =
|
|
1502
|
-
let r =
|
|
1521
|
+
typeof t == "number" && (t = Ke(t)), this.originalInput = t;
|
|
1522
|
+
let r = qe(t);
|
|
1503
1523
|
this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = n.format ?? r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
|
|
1504
1524
|
}
|
|
1505
1525
|
isDark() {
|
|
@@ -1520,14 +1540,14 @@ var He = class e {
|
|
|
1520
1540
|
return this.a;
|
|
1521
1541
|
}
|
|
1522
1542
|
setAlpha(e) {
|
|
1523
|
-
return this.a =
|
|
1543
|
+
return this.a = Pe(e), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
1524
1544
|
}
|
|
1525
1545
|
isMonochrome() {
|
|
1526
1546
|
let { s: e } = this.toHsl();
|
|
1527
1547
|
return e === 0;
|
|
1528
1548
|
}
|
|
1529
1549
|
toHsv() {
|
|
1530
|
-
let e =
|
|
1550
|
+
let e = Re(this.r, this.g, this.b);
|
|
1531
1551
|
return {
|
|
1532
1552
|
h: e.h * 360,
|
|
1533
1553
|
s: e.s,
|
|
@@ -1536,11 +1556,11 @@ var He = class e {
|
|
|
1536
1556
|
};
|
|
1537
1557
|
}
|
|
1538
1558
|
toHsvString() {
|
|
1539
|
-
let e =
|
|
1559
|
+
let e = Re(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
|
|
1540
1560
|
return this.a === 1 ? `hsv(${t}, ${n}%, ${r}%)` : `hsva(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
1541
1561
|
}
|
|
1542
1562
|
toHsl() {
|
|
1543
|
-
let e =
|
|
1563
|
+
let e = Ie(this.r, this.g, this.b);
|
|
1544
1564
|
return {
|
|
1545
1565
|
h: e.h * 360,
|
|
1546
1566
|
s: e.s,
|
|
@@ -1549,17 +1569,17 @@ var He = class e {
|
|
|
1549
1569
|
};
|
|
1550
1570
|
}
|
|
1551
1571
|
toHslString() {
|
|
1552
|
-
let e =
|
|
1572
|
+
let e = Ie(this.r, this.g, this.b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
|
|
1553
1573
|
return this.a === 1 ? `hsl(${t}, ${n}%, ${r}%)` : `hsla(${t}, ${n}%, ${r}%, ${this.roundA})`;
|
|
1554
1574
|
}
|
|
1555
1575
|
toHex(e = !1) {
|
|
1556
|
-
return
|
|
1576
|
+
return Be(this.r, this.g, this.b, e);
|
|
1557
1577
|
}
|
|
1558
1578
|
toHexString(e = !1) {
|
|
1559
1579
|
return "#" + this.toHex(e);
|
|
1560
1580
|
}
|
|
1561
1581
|
toHex8(e = !1) {
|
|
1562
|
-
return
|
|
1582
|
+
return Ve(this.r, this.g, this.b, this.a, e);
|
|
1563
1583
|
}
|
|
1564
1584
|
toHex8String(e = !1) {
|
|
1565
1585
|
return "#" + this.toHex8(e);
|
|
@@ -1580,7 +1600,7 @@ var He = class e {
|
|
|
1580
1600
|
return this.a === 1 ? `rgb(${e}, ${t}, ${n})` : `rgba(${e}, ${t}, ${n}, ${this.roundA})`;
|
|
1581
1601
|
}
|
|
1582
1602
|
toPercentageRgb() {
|
|
1583
|
-
let e = (e) => `${Math.round(
|
|
1603
|
+
let e = (e) => `${Math.round(O(e, 255) * 100)}%`;
|
|
1584
1604
|
return {
|
|
1585
1605
|
r: e(this.r),
|
|
1586
1606
|
g: e(this.g),
|
|
@@ -1589,21 +1609,21 @@ var He = class e {
|
|
|
1589
1609
|
};
|
|
1590
1610
|
}
|
|
1591
1611
|
toPercentageRgbString() {
|
|
1592
|
-
let e = (e) => Math.round(
|
|
1612
|
+
let e = (e) => Math.round(O(e, 255) * 100);
|
|
1593
1613
|
return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
|
|
1594
1614
|
}
|
|
1595
1615
|
toCmyk() {
|
|
1596
|
-
return { ...
|
|
1616
|
+
return { ...Ue(this.r, this.g, this.b) };
|
|
1597
1617
|
}
|
|
1598
1618
|
toCmykString() {
|
|
1599
|
-
let { c: e, m: t, y: n, k: r } =
|
|
1619
|
+
let { c: e, m: t, y: n, k: r } = Ue(this.r, this.g, this.b);
|
|
1600
1620
|
return `cmyk(${e}, ${t}, ${n}, ${r})`;
|
|
1601
1621
|
}
|
|
1602
1622
|
toName() {
|
|
1603
1623
|
if (this.a === 0) return "transparent";
|
|
1604
1624
|
if (this.a < 1) return !1;
|
|
1605
|
-
let e = "#" +
|
|
1606
|
-
for (let [t, n] of Object.entries(
|
|
1625
|
+
let e = "#" + Be(this.r, this.g, this.b, !1);
|
|
1626
|
+
for (let [t, n] of Object.entries(P)) if (e === n) return t;
|
|
1607
1627
|
return !1;
|
|
1608
1628
|
}
|
|
1609
1629
|
toString(e) {
|
|
@@ -1620,7 +1640,7 @@ var He = class e {
|
|
|
1620
1640
|
}
|
|
1621
1641
|
lighten(t = 10) {
|
|
1622
1642
|
let n = this.toHsl();
|
|
1623
|
-
return n.l += t / 100, n.l =
|
|
1643
|
+
return n.l += t / 100, n.l = k(n.l), new e(n);
|
|
1624
1644
|
}
|
|
1625
1645
|
brighten(t = 10) {
|
|
1626
1646
|
let n = this.toRgb();
|
|
@@ -1628,7 +1648,7 @@ var He = class e {
|
|
|
1628
1648
|
}
|
|
1629
1649
|
darken(t = 10) {
|
|
1630
1650
|
let n = this.toHsl();
|
|
1631
|
-
return n.l -= t / 100, n.l =
|
|
1651
|
+
return n.l -= t / 100, n.l = k(n.l), new e(n);
|
|
1632
1652
|
}
|
|
1633
1653
|
tint(e = 10) {
|
|
1634
1654
|
return this.mix("white", e);
|
|
@@ -1638,11 +1658,11 @@ var He = class e {
|
|
|
1638
1658
|
}
|
|
1639
1659
|
desaturate(t = 10) {
|
|
1640
1660
|
let n = this.toHsl();
|
|
1641
|
-
return n.s -= t / 100, n.s =
|
|
1661
|
+
return n.s -= t / 100, n.s = k(n.s), new e(n);
|
|
1642
1662
|
}
|
|
1643
1663
|
saturate(t = 10) {
|
|
1644
1664
|
let n = this.toHsl();
|
|
1645
|
-
return n.s += t / 100, n.s =
|
|
1665
|
+
return n.s += t / 100, n.s = k(n.s), new e(n);
|
|
1646
1666
|
}
|
|
1647
1667
|
greyscale() {
|
|
1648
1668
|
return this.desaturate(100);
|
|
@@ -1722,9 +1742,9 @@ var He = class e {
|
|
|
1722
1742
|
let n = new e(t);
|
|
1723
1743
|
return this.format === "cmyk" || n.format === "cmyk" ? this.toCmykString() === n.toCmykString() : this.toRgbString() === n.toRgbString();
|
|
1724
1744
|
}
|
|
1725
|
-
},
|
|
1745
|
+
}, Xe = "EyeDropper" in window, L = class extends t {
|
|
1726
1746
|
constructor() {
|
|
1727
|
-
super(), this.formControlController = new
|
|
1747
|
+
super(), this.formControlController = new de(this), this.isSafeValue = !1, this.localize = new v(this), this.hasFocus = !1, this.isDraggingGridHandle = !1, this.isEmpty = !1, this.inputValue = "", this.hue = 0, this.saturation = 100, this.brightness = 100, this.alpha = 100, this.value = "", this.defaultValue = "", this.label = "", this.format = "hex", this.inline = !1, this.size = "medium", this.noFormatToggle = !1, this.name = "", this.disabled = !1, this.hoist = !1, this.opacity = !1, this.uppercase = !1, this.swatches = "", this.form = "", this.required = !1, this.handleFocusIn = () => {
|
|
1728
1748
|
this.hasFocus = !0, this.emit("sl-focus");
|
|
1729
1749
|
}, this.handleFocusOut = () => {
|
|
1730
1750
|
this.hasFocus = !1, this.emit("sl-blur");
|
|
@@ -1757,9 +1777,9 @@ var He = class e {
|
|
|
1757
1777
|
}
|
|
1758
1778
|
handleAlphaDrag(e) {
|
|
1759
1779
|
let t = this.shadowRoot.querySelector(".color-picker__slider.color-picker__alpha"), n = t.querySelector(".color-picker__slider-handle"), { width: r } = t.getBoundingClientRect(), i = this.value, a = this.value;
|
|
1760
|
-
n.focus(), e.preventDefault(),
|
|
1780
|
+
n.focus(), e.preventDefault(), T(t, {
|
|
1761
1781
|
onMove: (e) => {
|
|
1762
|
-
this.alpha =
|
|
1782
|
+
this.alpha = y(e / r * 100, 0, 100), this.syncValues(), this.value !== a && (a = this.value, this.emit("sl-input"));
|
|
1763
1783
|
},
|
|
1764
1784
|
onStop: () => {
|
|
1765
1785
|
this.value !== i && (i = this.value, this.emit("sl-change"));
|
|
@@ -1769,9 +1789,9 @@ var He = class e {
|
|
|
1769
1789
|
}
|
|
1770
1790
|
handleHueDrag(e) {
|
|
1771
1791
|
let t = this.shadowRoot.querySelector(".color-picker__slider.color-picker__hue"), n = t.querySelector(".color-picker__slider-handle"), { width: r } = t.getBoundingClientRect(), i = this.value, a = this.value;
|
|
1772
|
-
n.focus(), e.preventDefault(),
|
|
1792
|
+
n.focus(), e.preventDefault(), T(t, {
|
|
1773
1793
|
onMove: (e) => {
|
|
1774
|
-
this.hue =
|
|
1794
|
+
this.hue = y(e / r * 360, 0, 360), this.syncValues(), this.value !== a && (a = this.value, this.emit("sl-input"));
|
|
1775
1795
|
},
|
|
1776
1796
|
onStop: () => {
|
|
1777
1797
|
this.value !== i && (i = this.value, this.emit("sl-change"));
|
|
@@ -1781,9 +1801,9 @@ var He = class e {
|
|
|
1781
1801
|
}
|
|
1782
1802
|
handleGridDrag(e) {
|
|
1783
1803
|
let t = this.shadowRoot.querySelector(".color-picker__grid"), n = t.querySelector(".color-picker__grid-handle"), { width: r, height: i } = t.getBoundingClientRect(), a = this.value, o = this.value;
|
|
1784
|
-
n.focus(), e.preventDefault(), this.isDraggingGridHandle = !0,
|
|
1804
|
+
n.focus(), e.preventDefault(), this.isDraggingGridHandle = !0, T(t, {
|
|
1785
1805
|
onMove: (e, t) => {
|
|
1786
|
-
this.saturation =
|
|
1806
|
+
this.saturation = y(e / r * 100, 0, 100), this.brightness = y(100 - t / i * 100, 0, 100), this.syncValues(), this.value !== o && (o = this.value, this.emit("sl-input"));
|
|
1787
1807
|
},
|
|
1788
1808
|
onStop: () => {
|
|
1789
1809
|
this.isDraggingGridHandle = !1, this.value !== a && (a = this.value, this.emit("sl-change"));
|
|
@@ -1793,15 +1813,15 @@ var He = class e {
|
|
|
1793
1813
|
}
|
|
1794
1814
|
handleAlphaKeyDown(e) {
|
|
1795
1815
|
let t = e.shiftKey ? 10 : 1, n = this.value;
|
|
1796
|
-
e.key === "ArrowLeft" && (e.preventDefault(), this.alpha =
|
|
1816
|
+
e.key === "ArrowLeft" && (e.preventDefault(), this.alpha = y(this.alpha - t, 0, 100), this.syncValues()), e.key === "ArrowRight" && (e.preventDefault(), this.alpha = y(this.alpha + t, 0, 100), this.syncValues()), e.key === "Home" && (e.preventDefault(), this.alpha = 0, this.syncValues()), e.key === "End" && (e.preventDefault(), this.alpha = 100, this.syncValues()), this.value !== n && (this.emit("sl-change"), this.emit("sl-input"));
|
|
1797
1817
|
}
|
|
1798
1818
|
handleHueKeyDown(e) {
|
|
1799
1819
|
let t = e.shiftKey ? 10 : 1, n = this.value;
|
|
1800
|
-
e.key === "ArrowLeft" && (e.preventDefault(), this.hue =
|
|
1820
|
+
e.key === "ArrowLeft" && (e.preventDefault(), this.hue = y(this.hue - t, 0, 360), this.syncValues()), e.key === "ArrowRight" && (e.preventDefault(), this.hue = y(this.hue + t, 0, 360), this.syncValues()), e.key === "Home" && (e.preventDefault(), this.hue = 0, this.syncValues()), e.key === "End" && (e.preventDefault(), this.hue = 360, this.syncValues()), this.value !== n && (this.emit("sl-change"), this.emit("sl-input"));
|
|
1801
1821
|
}
|
|
1802
1822
|
handleGridKeyDown(e) {
|
|
1803
1823
|
let t = e.shiftKey ? 10 : 1, n = this.value;
|
|
1804
|
-
e.key === "ArrowLeft" && (e.preventDefault(), this.saturation =
|
|
1824
|
+
e.key === "ArrowLeft" && (e.preventDefault(), this.saturation = y(this.saturation - t, 0, 100), this.syncValues()), e.key === "ArrowRight" && (e.preventDefault(), this.saturation = y(this.saturation + t, 0, 100), this.syncValues()), e.key === "ArrowUp" && (e.preventDefault(), this.brightness = y(this.brightness + t, 0, 100), this.syncValues()), e.key === "ArrowDown" && (e.preventDefault(), this.brightness = y(this.brightness - t, 0, 100), this.syncValues()), this.value !== n && (this.emit("sl-change"), this.emit("sl-input"));
|
|
1805
1825
|
}
|
|
1806
1826
|
handleInputChange(e) {
|
|
1807
1827
|
let t = e.target, n = this.value;
|
|
@@ -1823,7 +1843,7 @@ var He = class e {
|
|
|
1823
1843
|
e.preventDefault();
|
|
1824
1844
|
}
|
|
1825
1845
|
parseColor(e) {
|
|
1826
|
-
let t = new
|
|
1846
|
+
let t = new Ye(e);
|
|
1827
1847
|
if (!t.isValid) return null;
|
|
1828
1848
|
let n = t.toHsl(), r = {
|
|
1829
1849
|
h: n.h,
|
|
@@ -1895,7 +1915,7 @@ var He = class e {
|
|
|
1895
1915
|
this.previewButton.classList.remove("color-picker__preview-color--copied");
|
|
1896
1916
|
}
|
|
1897
1917
|
handleEyeDropper() {
|
|
1898
|
-
|
|
1918
|
+
Xe && new EyeDropper().open().then((e) => {
|
|
1899
1919
|
let t = this.value;
|
|
1900
1920
|
this.setColor(e.sRGBHex), this.value !== t && (this.emit("sl-change"), this.emit("sl-input"));
|
|
1901
1921
|
}).catch(() => {});
|
|
@@ -1905,7 +1925,7 @@ var He = class e {
|
|
|
1905
1925
|
this.disabled || (this.setColor(e), this.value !== t && (this.emit("sl-change"), this.emit("sl-input")));
|
|
1906
1926
|
}
|
|
1907
1927
|
getHexString(e, t, n, r = 100) {
|
|
1908
|
-
let i = new
|
|
1928
|
+
let i = new Ye(`hsva(${e}, ${t}%, ${n}%, ${r / 100})`);
|
|
1909
1929
|
return i.isValid ? i.toHex8String() : "";
|
|
1910
1930
|
}
|
|
1911
1931
|
stopNestedEventPropagation(e) {
|
|
@@ -1958,10 +1978,10 @@ var He = class e {
|
|
|
1958
1978
|
this.input.setCustomValidity(e), this.formControlController.updateValidity();
|
|
1959
1979
|
}
|
|
1960
1980
|
render() {
|
|
1961
|
-
let e = this.saturation, t = 100 - this.brightness, n = Array.isArray(this.swatches) ? this.swatches : this.swatches.split(";").filter((e) => e.trim() !== ""), r =
|
|
1981
|
+
let e = this.saturation, t = 100 - this.brightness, n = Array.isArray(this.swatches) ? this.swatches : this.swatches.split(";").filter((e) => e.trim() !== ""), r = d`
|
|
1962
1982
|
<div
|
|
1963
1983
|
part="base"
|
|
1964
|
-
class=${
|
|
1984
|
+
class=${g({
|
|
1965
1985
|
"color-picker": !0,
|
|
1966
1986
|
"color-picker--inline": this.inline,
|
|
1967
1987
|
"color-picker--disabled": this.disabled,
|
|
@@ -1971,7 +1991,7 @@ var He = class e {
|
|
|
1971
1991
|
aria-labelledby="label"
|
|
1972
1992
|
tabindex=${this.inline ? "0" : "-1"}
|
|
1973
1993
|
>
|
|
1974
|
-
${this.inline ?
|
|
1994
|
+
${this.inline ? d`
|
|
1975
1995
|
<sl-visually-hidden id="label">
|
|
1976
1996
|
<slot name="label">${this.label}</slot>
|
|
1977
1997
|
</sl-visually-hidden>
|
|
@@ -1980,24 +2000,24 @@ var He = class e {
|
|
|
1980
2000
|
<div
|
|
1981
2001
|
part="grid"
|
|
1982
2002
|
class="color-picker__grid"
|
|
1983
|
-
style=${
|
|
2003
|
+
style=${D({ backgroundColor: this.getHexString(this.hue, 100, 100) })}
|
|
1984
2004
|
@pointerdown=${this.handleGridDrag}
|
|
1985
2005
|
@touchmove=${this.handleTouchMove}
|
|
1986
2006
|
>
|
|
1987
2007
|
<span
|
|
1988
2008
|
part="grid-handle"
|
|
1989
|
-
class=${
|
|
2009
|
+
class=${g({
|
|
1990
2010
|
"color-picker__grid-handle": !0,
|
|
1991
2011
|
"color-picker__grid-handle--dragging": this.isDraggingGridHandle
|
|
1992
2012
|
})}
|
|
1993
|
-
style=${
|
|
2013
|
+
style=${D({
|
|
1994
2014
|
top: `${t}%`,
|
|
1995
2015
|
left: `${e}%`,
|
|
1996
2016
|
backgroundColor: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha)
|
|
1997
2017
|
})}
|
|
1998
2018
|
role="application"
|
|
1999
2019
|
aria-label="HSV"
|
|
2000
|
-
tabindex=${
|
|
2020
|
+
tabindex=${_(this.disabled ? void 0 : "0")}
|
|
2001
2021
|
@keydown=${this.handleGridKeyDown}
|
|
2002
2022
|
></span>
|
|
2003
2023
|
</div>
|
|
@@ -2013,19 +2033,19 @@ var He = class e {
|
|
|
2013
2033
|
<span
|
|
2014
2034
|
part="slider-handle hue-slider-handle"
|
|
2015
2035
|
class="color-picker__slider-handle"
|
|
2016
|
-
style=${
|
|
2036
|
+
style=${D({ left: `${this.hue === 0 ? 0 : 100 / (360 / this.hue)}%` })}
|
|
2017
2037
|
role="slider"
|
|
2018
2038
|
aria-label="hue"
|
|
2019
2039
|
aria-orientation="horizontal"
|
|
2020
2040
|
aria-valuemin="0"
|
|
2021
2041
|
aria-valuemax="360"
|
|
2022
2042
|
aria-valuenow=${`${Math.round(this.hue)}`}
|
|
2023
|
-
tabindex=${
|
|
2043
|
+
tabindex=${_(this.disabled ? void 0 : "0")}
|
|
2024
2044
|
@keydown=${this.handleHueKeyDown}
|
|
2025
2045
|
></span>
|
|
2026
2046
|
</div>
|
|
2027
2047
|
|
|
2028
|
-
${this.opacity ?
|
|
2048
|
+
${this.opacity ? d`
|
|
2029
2049
|
<div
|
|
2030
2050
|
part="slider opacity-slider"
|
|
2031
2051
|
class="color-picker__alpha color-picker__slider color-picker__transparent-bg"
|
|
@@ -2034,7 +2054,7 @@ var He = class e {
|
|
|
2034
2054
|
>
|
|
2035
2055
|
<div
|
|
2036
2056
|
class="color-picker__alpha-gradient"
|
|
2037
|
-
style=${
|
|
2057
|
+
style=${D({ backgroundImage: `linear-gradient(
|
|
2038
2058
|
to right,
|
|
2039
2059
|
${this.getHexString(this.hue, this.saturation, this.brightness, 0)} 0%,
|
|
2040
2060
|
${this.getHexString(this.hue, this.saturation, this.brightness, 100)} 100%
|
|
@@ -2043,14 +2063,14 @@ var He = class e {
|
|
|
2043
2063
|
<span
|
|
2044
2064
|
part="slider-handle opacity-slider-handle"
|
|
2045
2065
|
class="color-picker__slider-handle"
|
|
2046
|
-
style=${
|
|
2066
|
+
style=${D({ left: `${this.alpha}%` })}
|
|
2047
2067
|
role="slider"
|
|
2048
2068
|
aria-label="alpha"
|
|
2049
2069
|
aria-orientation="horizontal"
|
|
2050
2070
|
aria-valuemin="0"
|
|
2051
2071
|
aria-valuemax="100"
|
|
2052
2072
|
aria-valuenow=${Math.round(this.alpha)}
|
|
2053
|
-
tabindex=${
|
|
2073
|
+
tabindex=${_(this.disabled ? void 0 : "0")}
|
|
2054
2074
|
@keydown=${this.handleAlphaKeyDown}
|
|
2055
2075
|
></span>
|
|
2056
2076
|
</div>
|
|
@@ -2062,7 +2082,7 @@ var He = class e {
|
|
|
2062
2082
|
part="preview"
|
|
2063
2083
|
class="color-picker__preview color-picker__transparent-bg"
|
|
2064
2084
|
aria-label=${this.localize.term("copy")}
|
|
2065
|
-
style=${
|
|
2085
|
+
style=${D({ "--preview-color": this.getHexString(this.hue, this.saturation, this.brightness, this.alpha) })}
|
|
2066
2086
|
@click=${this.handleCopy}
|
|
2067
2087
|
></button>
|
|
2068
2088
|
</div>
|
|
@@ -2089,7 +2109,7 @@ var He = class e {
|
|
|
2089
2109
|
></sl-input>
|
|
2090
2110
|
|
|
2091
2111
|
<sl-button-group>
|
|
2092
|
-
${this.noFormatToggle ? "" :
|
|
2112
|
+
${this.noFormatToggle ? "" : d`
|
|
2093
2113
|
<sl-button
|
|
2094
2114
|
part="format-button"
|
|
2095
2115
|
aria-label=${this.localize.term("toggleColorFormat")}
|
|
@@ -2107,7 +2127,7 @@ var He = class e {
|
|
|
2107
2127
|
${this.setLetterCase(this.format)}
|
|
2108
2128
|
</sl-button>
|
|
2109
2129
|
`}
|
|
2110
|
-
${
|
|
2130
|
+
${Xe ? d`
|
|
2111
2131
|
<sl-button
|
|
2112
2132
|
part="eye-dropper-button"
|
|
2113
2133
|
exportparts="
|
|
@@ -2131,15 +2151,15 @@ var He = class e {
|
|
|
2131
2151
|
</sl-button-group>
|
|
2132
2152
|
</div>
|
|
2133
2153
|
|
|
2134
|
-
${n.length > 0 ?
|
|
2154
|
+
${n.length > 0 ? d`
|
|
2135
2155
|
<div part="swatches" class="color-picker__swatches">
|
|
2136
2156
|
${n.map((e) => {
|
|
2137
2157
|
let t = this.parseColor(e);
|
|
2138
|
-
return t ?
|
|
2158
|
+
return t ? d`
|
|
2139
2159
|
<div
|
|
2140
2160
|
part="swatch"
|
|
2141
2161
|
class="color-picker__swatch color-picker__transparent-bg"
|
|
2142
|
-
tabindex=${
|
|
2162
|
+
tabindex=${_(this.disabled ? void 0 : "0")}
|
|
2143
2163
|
role="button"
|
|
2144
2164
|
aria-label=${e}
|
|
2145
2165
|
@click=${() => this.selectSwatch(e)}
|
|
@@ -2147,7 +2167,7 @@ var He = class e {
|
|
|
2147
2167
|
>
|
|
2148
2168
|
<div
|
|
2149
2169
|
class="color-picker__swatch-color"
|
|
2150
|
-
style=${
|
|
2170
|
+
style=${D({ backgroundColor: t.hexa })}
|
|
2151
2171
|
></div>
|
|
2152
2172
|
</div>
|
|
2153
2173
|
` : (console.error(`Unable to parse swatch color: "${e}"`, this), "");
|
|
@@ -2156,7 +2176,7 @@ var He = class e {
|
|
|
2156
2176
|
` : ""}
|
|
2157
2177
|
</div>
|
|
2158
2178
|
`;
|
|
2159
|
-
return this.inline ? r :
|
|
2179
|
+
return this.inline ? r : d`
|
|
2160
2180
|
<sl-dropdown
|
|
2161
2181
|
class="color-dropdown"
|
|
2162
2182
|
aria-disabled=${this.disabled ? "true" : "false"}
|
|
@@ -2168,7 +2188,7 @@ var He = class e {
|
|
|
2168
2188
|
<button
|
|
2169
2189
|
part="trigger"
|
|
2170
2190
|
slot="trigger"
|
|
2171
|
-
class=${
|
|
2191
|
+
class=${g({
|
|
2172
2192
|
"color-dropdown__trigger": !0,
|
|
2173
2193
|
"color-dropdown__trigger--disabled": this.disabled,
|
|
2174
2194
|
"color-dropdown__trigger--small": this.size === "small",
|
|
@@ -2178,7 +2198,7 @@ var He = class e {
|
|
|
2178
2198
|
"color-dropdown__trigger--focused": this.hasFocus,
|
|
2179
2199
|
"color-picker__transparent-bg": !0
|
|
2180
2200
|
})}
|
|
2181
|
-
style=${
|
|
2201
|
+
style=${D({ color: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha) })}
|
|
2182
2202
|
type="button"
|
|
2183
2203
|
>
|
|
2184
2204
|
<sl-visually-hidden>
|
|
@@ -2192,29 +2212,29 @@ var He = class e {
|
|
|
2192
2212
|
};
|
|
2193
2213
|
//#endregion
|
|
2194
2214
|
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.BQVAQ53I.js
|
|
2195
|
-
|
|
2196
|
-
"sl-button-group":
|
|
2197
|
-
"sl-button":
|
|
2198
|
-
"sl-dropdown":
|
|
2215
|
+
L.styles = [e, ke], L.dependencies = {
|
|
2216
|
+
"sl-button-group": b,
|
|
2217
|
+
"sl-button": fe,
|
|
2218
|
+
"sl-dropdown": E,
|
|
2199
2219
|
"sl-icon": i,
|
|
2200
|
-
"sl-input":
|
|
2201
|
-
"sl-visually-hidden":
|
|
2202
|
-
},
|
|
2220
|
+
"sl-input": me,
|
|
2221
|
+
"sl-visually-hidden": w
|
|
2222
|
+
}, r([l("[part~=\"base\"]")], L.prototype, "base", 2), r([l("[part~=\"input\"]")], L.prototype, "input", 2), r([l(".color-dropdown")], L.prototype, "dropdown", 2), r([l("[part~=\"preview\"]")], L.prototype, "previewButton", 2), r([l("[part~=\"trigger\"]")], L.prototype, "trigger", 2), r([s()], L.prototype, "hasFocus", 2), r([s()], L.prototype, "isDraggingGridHandle", 2), r([s()], L.prototype, "isEmpty", 2), r([s()], L.prototype, "inputValue", 2), r([s()], L.prototype, "hue", 2), r([s()], L.prototype, "saturation", 2), r([s()], L.prototype, "brightness", 2), r([s()], L.prototype, "alpha", 2), r([a()], L.prototype, "value", 2), r([pe()], L.prototype, "defaultValue", 2), r([a()], L.prototype, "label", 2), r([a()], L.prototype, "format", 2), r([a({
|
|
2203
2223
|
type: Boolean,
|
|
2204
2224
|
reflect: !0
|
|
2205
|
-
})],
|
|
2225
|
+
})], L.prototype, "inline", 2), r([a({ reflect: !0 })], L.prototype, "size", 2), r([a({
|
|
2206
2226
|
attribute: "no-format-toggle",
|
|
2207
2227
|
type: Boolean
|
|
2208
|
-
})],
|
|
2228
|
+
})], L.prototype, "noFormatToggle", 2), r([a()], L.prototype, "name", 2), r([a({
|
|
2209
2229
|
type: Boolean,
|
|
2210
2230
|
reflect: !0
|
|
2211
|
-
})],
|
|
2231
|
+
})], L.prototype, "disabled", 2), r([a({ type: Boolean })], L.prototype, "hoist", 2), r([a({ type: Boolean })], L.prototype, "opacity", 2), r([a({ type: Boolean })], L.prototype, "uppercase", 2), r([a()], L.prototype, "swatches", 2), r([a({ reflect: !0 })], L.prototype, "form", 2), r([a({
|
|
2212
2232
|
type: Boolean,
|
|
2213
2233
|
reflect: !0
|
|
2214
|
-
})],
|
|
2234
|
+
})], L.prototype, "required", 2), r([f({ passive: !1 })], L.prototype, "handleTouchMove", 1), r([n("format", { waitUntilFirstUpdate: !0 })], L.prototype, "handleFormatChange", 1), r([n("opacity", { waitUntilFirstUpdate: !0 })], L.prototype, "handleOpacityChange", 1), r([n("value")], L.prototype, "handleValueChange", 1), L.define("sl-color-picker");
|
|
2215
2235
|
//#endregion
|
|
2216
2236
|
//#region src/components/webmapx-draw-layer-dialog.ts
|
|
2217
|
-
var
|
|
2237
|
+
var Ze = {
|
|
2218
2238
|
Point: [
|
|
2219
2239
|
"string",
|
|
2220
2240
|
"number",
|
|
@@ -2246,32 +2266,32 @@ var We = {
|
|
|
2246
2266
|
"create-time",
|
|
2247
2267
|
"update-time"
|
|
2248
2268
|
]
|
|
2249
|
-
},
|
|
2269
|
+
}, Qe = [{
|
|
2250
2270
|
name: "id",
|
|
2251
2271
|
type: "number"
|
|
2252
2272
|
}, {
|
|
2253
2273
|
name: "name",
|
|
2254
2274
|
type: "string"
|
|
2255
|
-
}],
|
|
2275
|
+
}], $e = {
|
|
2256
2276
|
Point: "#0f62fe",
|
|
2257
2277
|
LineString: "#0f62fe",
|
|
2258
2278
|
Polygon: "#0f62fe"
|
|
2259
2279
|
};
|
|
2260
|
-
function
|
|
2280
|
+
function R(e) {
|
|
2261
2281
|
return {
|
|
2262
2282
|
id: `layer-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
|
2263
2283
|
name: "",
|
|
2264
2284
|
type: e,
|
|
2265
|
-
color:
|
|
2266
|
-
properties:
|
|
2285
|
+
color: $e[e],
|
|
2286
|
+
properties: Qe.map((e) => ({ ...e }))
|
|
2267
2287
|
};
|
|
2268
2288
|
}
|
|
2269
|
-
var
|
|
2289
|
+
var z = class extends p {
|
|
2270
2290
|
constructor(...e) {
|
|
2271
|
-
super(...e), this.geometryType = "Point", this.existingLayers = [], this.mapLayers = [], this.step = "select", this.selectedId = "new", this.layer =
|
|
2291
|
+
super(...e), this.geometryType = "Point", this.existingLayers = [], this.mapLayers = [], this.step = "select", this.selectedId = "new", this.layer = R("Point"), this.nameError = !1, this.newPropName = "", this.newPropType = "string", this.allowedAttributes = null;
|
|
2272
2292
|
}
|
|
2273
2293
|
static {
|
|
2274
|
-
this.styles =
|
|
2294
|
+
this.styles = o`
|
|
2275
2295
|
:host { display: block; }
|
|
2276
2296
|
|
|
2277
2297
|
sl-dialog::part(panel) {
|
|
@@ -2374,7 +2394,7 @@ var B = class extends he {
|
|
|
2374
2394
|
`;
|
|
2375
2395
|
}
|
|
2376
2396
|
open() {
|
|
2377
|
-
this.step = "select", this.selectedId = this.existingLayers.length === 0 ? "new" : this.existingLayers[0].id, this.layer =
|
|
2397
|
+
this.step = "select", this.selectedId = this.existingLayers.length === 0 ? "new" : this.existingLayers[0].id, this.layer = R(this.geometryType), this.newPropName = "", this.newPropType = "string", this.nameError = !1, this.dialog?.show();
|
|
2378
2398
|
}
|
|
2379
2399
|
close() {
|
|
2380
2400
|
this.dialog?.hide();
|
|
@@ -2383,7 +2403,7 @@ var B = class extends he {
|
|
|
2383
2403
|
this.selectedId = e;
|
|
2384
2404
|
}
|
|
2385
2405
|
goToDetail() {
|
|
2386
|
-
if (this.selectedId === "new") this.layer =
|
|
2406
|
+
if (this.selectedId === "new") this.layer = R(this.geometryType), this.allowedAttributes = null;
|
|
2387
2407
|
else {
|
|
2388
2408
|
let e = this.existingLayers.find((e) => e.id === this.selectedId);
|
|
2389
2409
|
if (e) this.layer = {
|
|
@@ -2393,9 +2413,9 @@ var B = class extends he {
|
|
|
2393
2413
|
else {
|
|
2394
2414
|
let e = this.mapLayers.find((e) => e.layerId === this.selectedId);
|
|
2395
2415
|
this.layer = {
|
|
2396
|
-
...
|
|
2416
|
+
...R(this.geometryType),
|
|
2397
2417
|
name: e?.label ?? this.selectedId,
|
|
2398
|
-
properties: e?.properties?.map((e) => ({ ...e })) ??
|
|
2418
|
+
properties: e?.properties?.map((e) => ({ ...e })) ?? Qe.map((e) => ({ ...e })),
|
|
2399
2419
|
borrowedSourceId: e?.sourceId
|
|
2400
2420
|
}, this.allowedAttributes = e?.allowedAttributes ?? null;
|
|
2401
2421
|
}
|
|
@@ -2450,7 +2470,7 @@ var B = class extends he {
|
|
|
2450
2470
|
}
|
|
2451
2471
|
renderSelectStep() {
|
|
2452
2472
|
let e = this.geometryType === "LineString" ? "Line" : this.geometryType;
|
|
2453
|
-
return
|
|
2473
|
+
return d`
|
|
2454
2474
|
<div class="layer-list">
|
|
2455
2475
|
<div class="layer-option ${this.selectedId === "new" ? "selected" : ""}"
|
|
2456
2476
|
@click=${() => this.selectOption("new")}
|
|
@@ -2460,7 +2480,7 @@ var B = class extends he {
|
|
|
2460
2480
|
<span class="new-icon">+</span>
|
|
2461
2481
|
<span>New ${e} layer</span>
|
|
2462
2482
|
</div>
|
|
2463
|
-
${this.existingLayers.map((e) =>
|
|
2483
|
+
${this.existingLayers.map((e) => d`
|
|
2464
2484
|
<div class="layer-option ${this.selectedId === e.id ? "selected" : ""}"
|
|
2465
2485
|
@click=${() => this.selectOption(e.id)}
|
|
2466
2486
|
@dblclick=${() => {
|
|
@@ -2470,9 +2490,9 @@ var B = class extends he {
|
|
|
2470
2490
|
<span>${e.name}</span>
|
|
2471
2491
|
</div>
|
|
2472
2492
|
`)}
|
|
2473
|
-
${this.mapLayers.length > 0 ?
|
|
2493
|
+
${this.mapLayers.length > 0 ? d`
|
|
2474
2494
|
<div style="font-size:0.72rem;color:var(--sl-color-neutral-500);padding:0.4rem 0.2rem 0.1rem;text-transform:uppercase;letter-spacing:0.05em">Map layers</div>
|
|
2475
|
-
${this.mapLayers.map((e) =>
|
|
2495
|
+
${this.mapLayers.map((e) => d`
|
|
2476
2496
|
<div class="layer-option ${this.selectedId === e.layerId ? "selected" : ""}"
|
|
2477
2497
|
@click=${() => this.selectOption(e.layerId)}
|
|
2478
2498
|
@dblclick=${() => {
|
|
@@ -2492,7 +2512,7 @@ var B = class extends he {
|
|
|
2492
2512
|
`;
|
|
2493
2513
|
}
|
|
2494
2514
|
renderDetailStep() {
|
|
2495
|
-
let e =
|
|
2515
|
+
let e = Ze[this.geometryType], t = {
|
|
2496
2516
|
longitude: "longitude (auto)",
|
|
2497
2517
|
latitude: "latitude (auto)",
|
|
2498
2518
|
area: "area (auto)",
|
|
@@ -2503,7 +2523,7 @@ var B = class extends he {
|
|
|
2503
2523
|
"create-time": "create-time (auto)",
|
|
2504
2524
|
"update-time": "update-time (auto)"
|
|
2505
2525
|
};
|
|
2506
|
-
return
|
|
2526
|
+
return d`
|
|
2507
2527
|
<div class="name-input-row">
|
|
2508
2528
|
<sl-input name="layername"
|
|
2509
2529
|
style="flex:1"
|
|
@@ -2525,14 +2545,14 @@ var B = class extends he {
|
|
|
2525
2545
|
};
|
|
2526
2546
|
}}>
|
|
2527
2547
|
</div>
|
|
2528
|
-
${this.nameError ?
|
|
2548
|
+
${this.nameError ? d`<div class="error-msg">Enter a layer name.</div>` : ""}
|
|
2529
2549
|
|
|
2530
2550
|
<table class="prop-table">
|
|
2531
2551
|
<thead>
|
|
2532
2552
|
<tr><th>Property</th><th>Type</th><th style="width:2rem"></th></tr>
|
|
2533
2553
|
</thead>
|
|
2534
2554
|
<tbody>
|
|
2535
|
-
${this.layer.properties.map((e, t) =>
|
|
2555
|
+
${this.layer.properties.map((e, t) => d`
|
|
2536
2556
|
<tr class="${e.name === "id" ? "prop-row-auto" : ""}">
|
|
2537
2557
|
<td>${e.name}</td>
|
|
2538
2558
|
<td class="${[
|
|
@@ -2542,7 +2562,7 @@ var B = class extends he {
|
|
|
2542
2562
|
"imageURL"
|
|
2543
2563
|
].includes(e.type) ? "" : "type-computed"}">${e.type}${e.name === "id" ? " (auto)" : ""}</td>
|
|
2544
2564
|
<td>
|
|
2545
|
-
${t === 0 ? "" :
|
|
2565
|
+
${t === 0 ? "" : d`
|
|
2546
2566
|
<sl-icon-button name="x" @click=${() => this.removeProperty(t)}></sl-icon-button>
|
|
2547
2567
|
`}
|
|
2548
2568
|
</td>
|
|
@@ -2550,14 +2570,14 @@ var B = class extends he {
|
|
|
2550
2570
|
`)}
|
|
2551
2571
|
<tr class="add-row">
|
|
2552
2572
|
<td>
|
|
2553
|
-
${this.allowedAttributes ?
|
|
2573
|
+
${this.allowedAttributes ? d`
|
|
2554
2574
|
<sl-select id="new-prop-name" size="small" aria-label="Property name"
|
|
2555
2575
|
.value=${this.newPropName}
|
|
2556
2576
|
@sl-change=${(e) => this.newPropName = e.target.value}>
|
|
2557
2577
|
<sl-option value="">— select —</sl-option>
|
|
2558
|
-
${this.allowedAttributes.filter((e) => !this.layer.properties.find((t) => t.name === e)).map((e) =>
|
|
2578
|
+
${this.allowedAttributes.filter((e) => !this.layer.properties.find((t) => t.name === e)).map((e) => d`<sl-option value=${e}>${e}</sl-option>`)}
|
|
2559
2579
|
</sl-select>
|
|
2560
|
-
` :
|
|
2580
|
+
` : d`
|
|
2561
2581
|
<sl-input id="new-prop-name" size="small" placeholder="property name" aria-label="Property name"
|
|
2562
2582
|
.value=${this.newPropName}
|
|
2563
2583
|
@sl-input=${(e) => this.newPropName = e.target.value}
|
|
@@ -2568,7 +2588,7 @@ var B = class extends he {
|
|
|
2568
2588
|
<td>
|
|
2569
2589
|
<sl-select id="new-prop-type" size="small" .value=${this.newPropType}
|
|
2570
2590
|
@sl-change=${(e) => this.newPropType = e.target.value}>
|
|
2571
|
-
${e.map((e) =>
|
|
2591
|
+
${e.map((e) => d`<sl-option value=${e}>${t[e] ?? e}</sl-option>`)}
|
|
2572
2592
|
</sl-select>
|
|
2573
2593
|
</td>
|
|
2574
2594
|
<td>
|
|
@@ -2587,7 +2607,7 @@ var B = class extends he {
|
|
|
2587
2607
|
}
|
|
2588
2608
|
render() {
|
|
2589
2609
|
let e = this.geometryType === "LineString" ? "Line" : this.geometryType;
|
|
2590
|
-
return
|
|
2610
|
+
return d`
|
|
2591
2611
|
<sl-dialog label="${this.step === "select" ? `Select ${e} layer` : `Configure ${e} layer`}"
|
|
2592
2612
|
@sl-request-close=${(e) => {
|
|
2593
2613
|
e.detail?.source === "overlay" && this.cancel();
|
|
@@ -2597,26 +2617,26 @@ var B = class extends he {
|
|
|
2597
2617
|
`;
|
|
2598
2618
|
}
|
|
2599
2619
|
};
|
|
2600
|
-
|
|
2620
|
+
m([a({ type: String })], z.prototype, "geometryType", void 0), m([a({ attribute: !1 })], z.prototype, "existingLayers", void 0), m([a({ attribute: !1 })], z.prototype, "mapLayers", void 0), m([s()], z.prototype, "step", void 0), m([s()], z.prototype, "selectedId", void 0), m([s()], z.prototype, "layer", void 0), m([s()], z.prototype, "nameError", void 0), m([s()], z.prototype, "newPropName", void 0), m([s()], z.prototype, "newPropType", void 0), m([s()], z.prototype, "allowedAttributes", void 0), m([l("sl-dialog")], z.prototype, "dialog", void 0), z = m([u("webmapx-draw-layer-dialog")], z);
|
|
2601
2621
|
//#endregion
|
|
2602
2622
|
//#region src/utils/snap-utils.ts
|
|
2603
|
-
function
|
|
2623
|
+
function et(e) {
|
|
2604
2624
|
return e.type === "Point" ? [e.coordinates] : e.type === "MultiPoint" || e.type === "LineString" ? e.coordinates : e.type === "MultiLineString" || e.type === "Polygon" ? e.coordinates.flat() : e.type === "MultiPolygon" ? e.coordinates.flat(2) : [];
|
|
2605
2625
|
}
|
|
2606
|
-
function
|
|
2626
|
+
function tt(e) {
|
|
2607
2627
|
let t = [], n = (e) => {
|
|
2608
2628
|
for (let n = 0; n < e.length - 1; n++) t.push([e[n], e[n + 1]]);
|
|
2609
2629
|
};
|
|
2610
2630
|
return e.type === "LineString" ? n(e.coordinates) : e.type === "MultiLineString" ? e.coordinates.forEach((e) => n(e)) : e.type === "Polygon" ? e.coordinates.forEach((e) => n(e)) : e.type === "MultiPolygon" && e.coordinates.forEach((e) => e.forEach((e) => n(e))), t;
|
|
2611
2631
|
}
|
|
2612
|
-
function
|
|
2632
|
+
function nt(e, t, n, r = {}) {
|
|
2613
2633
|
let i = r.threshold ?? 16, a = r.edgePenalty ?? 8, o = null, s = i;
|
|
2614
2634
|
for (let r of t) {
|
|
2615
|
-
for (let t of
|
|
2635
|
+
for (let t of et(r)) {
|
|
2616
2636
|
let r = n(t), i = Math.hypot(r[0] - e[0], r[1] - e[1]);
|
|
2617
2637
|
i < s && (s = i, o = t);
|
|
2618
2638
|
}
|
|
2619
|
-
for (let [t, i] of
|
|
2639
|
+
for (let [t, i] of tt(r)) {
|
|
2620
2640
|
let r = n(t), c = n(i), l = c[0] - r[0], u = c[1] - r[1], d = l * l + u * u;
|
|
2621
2641
|
if (d === 0) continue;
|
|
2622
2642
|
let f = Math.max(0, Math.min(1, ((e[0] - r[0]) * l + (e[1] - r[1]) * u) / d)), p = Math.hypot(r[0] + f * l - e[0], r[1] + f * u - e[1]);
|
|
@@ -2627,14 +2647,14 @@ function Ye(e, t, n, r = {}) {
|
|
|
2627
2647
|
}
|
|
2628
2648
|
//#endregion
|
|
2629
2649
|
//#region src/components/webmapx-draw-tool.ts
|
|
2630
|
-
var
|
|
2631
|
-
function
|
|
2650
|
+
var B = "webmapx-draw-rubber-source", rt = "webmapx-draw-rubber-line", V = "webmapx-draw-vertex-source", it = "webmapx-draw-vertex-layer";
|
|
2651
|
+
function H(e) {
|
|
2632
2652
|
return `webmapx-draw-src-${e}`;
|
|
2633
2653
|
}
|
|
2634
|
-
function
|
|
2654
|
+
function at(e) {
|
|
2635
2655
|
return `${e}-map`;
|
|
2636
2656
|
}
|
|
2637
|
-
var
|
|
2657
|
+
var U = "#888888", ot = "#ff3b30", st = 10, W = "webmapx-draw-sel-source", ct = "webmapx-draw-sel-point", G = "webmapx-draw-draft-source", K = "webmapx-draw-draft-points", q = "webmapx-draw-edit-vert-source", lt = "webmapx-draw-edit-vert", J = "webmapx-draw-edit-mid-source", ut = "webmapx-draw-edit-mid", Y = "webmapx-draw-sel-vert-source", dt = "webmapx-draw-sel-vert", ft = 12, X = "webmapx-draw-snap-source", pt = "webmapx-draw-snap-layer", mt = 16, Z = class extends Se {
|
|
2638
2658
|
constructor(...e) {
|
|
2639
2659
|
super(...e), this.toolId = "draw", this.mode = "select", this.drawLayers = [], this.features = [], this.selectedFeatureId = null, this.helpText = "", this.pendingMode = null, this.uiVersion = 0, this.draftPoints = [], this.draftRedoStack = [], this.cursorPos = null, this.activeLayerIds = {}, this.history = [], this.historyIndex = -1, this.sharedLayersCreated = !1, this.createdDrawLayerIds = /* @__PURE__ */ new Set(), this.touchMQ = window.matchMedia("(pointer: coarse)"), this.isTouchDevice = this.touchMQ.matches, this.onTouchMQChange = (e) => {
|
|
2640
2660
|
this.isTouchDevice = e.matches;
|
|
@@ -2669,7 +2689,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2669
2689
|
return this.snapEnabled && !this.altActive;
|
|
2670
2690
|
}
|
|
2671
2691
|
static {
|
|
2672
|
-
this.styles =
|
|
2692
|
+
this.styles = o`
|
|
2673
2693
|
:host {
|
|
2674
2694
|
display: flex;
|
|
2675
2695
|
flex-direction: column;
|
|
@@ -2819,7 +2839,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2819
2839
|
createSharedLayers() {
|
|
2820
2840
|
if (!this.sharedLayersCreated) {
|
|
2821
2841
|
this.dispatch("webmapx-add-source", {
|
|
2822
|
-
id:
|
|
2842
|
+
id: B,
|
|
2823
2843
|
config: {
|
|
2824
2844
|
type: "geojson",
|
|
2825
2845
|
data: {
|
|
@@ -2828,7 +2848,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2828
2848
|
}
|
|
2829
2849
|
}
|
|
2830
2850
|
}), this.dispatch("webmapx-add-source", {
|
|
2831
|
-
id:
|
|
2851
|
+
id: V,
|
|
2832
2852
|
config: {
|
|
2833
2853
|
type: "geojson",
|
|
2834
2854
|
data: {
|
|
@@ -2837,9 +2857,9 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2837
2857
|
}
|
|
2838
2858
|
}
|
|
2839
2859
|
}), this.dispatch("webmapx-add-layer", {
|
|
2840
|
-
id:
|
|
2860
|
+
id: rt,
|
|
2841
2861
|
type: "line",
|
|
2842
|
-
source:
|
|
2862
|
+
source: B,
|
|
2843
2863
|
metadata: {
|
|
2844
2864
|
isToolLayer: !0,
|
|
2845
2865
|
hideFromLegend: !0
|
|
@@ -2850,9 +2870,9 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2850
2870
|
"line-dasharray": [4, 4]
|
|
2851
2871
|
}
|
|
2852
2872
|
}), this.dispatch("webmapx-add-layer", {
|
|
2853
|
-
id:
|
|
2873
|
+
id: it,
|
|
2854
2874
|
type: "circle",
|
|
2855
|
-
source:
|
|
2875
|
+
source: V,
|
|
2856
2876
|
metadata: {
|
|
2857
2877
|
isToolLayer: !0,
|
|
2858
2878
|
hideFromLegend: !0
|
|
@@ -2864,7 +2884,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2864
2884
|
"circle-stroke-color": "#ff6600"
|
|
2865
2885
|
}
|
|
2866
2886
|
}), this.dispatch("webmapx-add-source", {
|
|
2867
|
-
id:
|
|
2887
|
+
id: W,
|
|
2868
2888
|
config: {
|
|
2869
2889
|
type: "geojson",
|
|
2870
2890
|
data: {
|
|
@@ -2873,19 +2893,19 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2873
2893
|
}
|
|
2874
2894
|
}
|
|
2875
2895
|
}), this.dispatch("webmapx-add-layer", {
|
|
2876
|
-
id:
|
|
2896
|
+
id: ct,
|
|
2877
2897
|
type: "circle",
|
|
2878
|
-
source:
|
|
2898
|
+
source: W,
|
|
2879
2899
|
metadata: {
|
|
2880
2900
|
isToolLayer: !0,
|
|
2881
2901
|
hideFromLegend: !0
|
|
2882
2902
|
},
|
|
2883
2903
|
paint: {
|
|
2884
|
-
"circle-radius":
|
|
2885
|
-
"circle-color": this.cssVar("--webmapx-draw-selected-color",
|
|
2904
|
+
"circle-radius": st,
|
|
2905
|
+
"circle-color": this.cssVar("--webmapx-draw-selected-color", ot)
|
|
2886
2906
|
}
|
|
2887
2907
|
}), this.dispatch("webmapx-add-source", {
|
|
2888
|
-
id:
|
|
2908
|
+
id: G,
|
|
2889
2909
|
config: {
|
|
2890
2910
|
type: "geojson",
|
|
2891
2911
|
data: {
|
|
@@ -2894,9 +2914,9 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2894
2914
|
}
|
|
2895
2915
|
}
|
|
2896
2916
|
}), this.dispatch("webmapx-add-layer", {
|
|
2897
|
-
id:
|
|
2917
|
+
id: K,
|
|
2898
2918
|
type: "circle",
|
|
2899
|
-
source:
|
|
2919
|
+
source: G,
|
|
2900
2920
|
metadata: {
|
|
2901
2921
|
isToolLayer: !0,
|
|
2902
2922
|
hideFromLegend: !0
|
|
@@ -2917,7 +2937,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2917
2937
|
}
|
|
2918
2938
|
}
|
|
2919
2939
|
}), this.dispatch("webmapx-add-layer", {
|
|
2920
|
-
id:
|
|
2940
|
+
id: lt,
|
|
2921
2941
|
type: "circle",
|
|
2922
2942
|
source: q,
|
|
2923
2943
|
metadata: {
|
|
@@ -2940,7 +2960,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2940
2960
|
}
|
|
2941
2961
|
}
|
|
2942
2962
|
}), this.dispatch("webmapx-add-layer", {
|
|
2943
|
-
id:
|
|
2963
|
+
id: ut,
|
|
2944
2964
|
type: "circle",
|
|
2945
2965
|
source: J,
|
|
2946
2966
|
metadata: {
|
|
@@ -2964,7 +2984,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2964
2984
|
}
|
|
2965
2985
|
}
|
|
2966
2986
|
}), this.dispatch("webmapx-add-layer", {
|
|
2967
|
-
id:
|
|
2987
|
+
id: dt,
|
|
2968
2988
|
type: "circle",
|
|
2969
2989
|
source: Y,
|
|
2970
2990
|
metadata: {
|
|
@@ -2972,8 +2992,8 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2972
2992
|
hideFromLegend: !0
|
|
2973
2993
|
},
|
|
2974
2994
|
paint: {
|
|
2975
|
-
"circle-radius":
|
|
2976
|
-
"circle-color": this.cssVar("--webmapx-draw-selected-color",
|
|
2995
|
+
"circle-radius": st,
|
|
2996
|
+
"circle-color": this.cssVar("--webmapx-draw-selected-color", ot),
|
|
2977
2997
|
"circle-stroke-width": 2,
|
|
2978
2998
|
"circle-stroke-color": "#fff"
|
|
2979
2999
|
}
|
|
@@ -2987,7 +3007,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
2987
3007
|
}
|
|
2988
3008
|
}
|
|
2989
3009
|
}), this.dispatch("webmapx-add-layer", {
|
|
2990
|
-
id:
|
|
3010
|
+
id: pt,
|
|
2991
3011
|
type: "circle",
|
|
2992
3012
|
source: X,
|
|
2993
3013
|
metadata: {
|
|
@@ -3007,7 +3027,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3007
3027
|
}
|
|
3008
3028
|
addMapLayersForDrawLayer(e) {
|
|
3009
3029
|
if (this.createdDrawLayerIds.has(e.id)) return;
|
|
3010
|
-
let t =
|
|
3030
|
+
let t = H(e.id);
|
|
3011
3031
|
this.dispatch("webmapx-add-source", {
|
|
3012
3032
|
id: t,
|
|
3013
3033
|
config: {
|
|
@@ -3078,24 +3098,24 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3078
3098
|
}), this.createdDrawLayerIds.add(e.id), e.type === "Polygon" && this.createdDrawLayerIds.add(`${e.id}-outline`);
|
|
3079
3099
|
}
|
|
3080
3100
|
removeMapLayersForDrawLayer(e) {
|
|
3081
|
-
e.type === "Polygon" && this.dispatch("webmapx-remove-layer", `${e.id}-outline`), this.dispatch("webmapx-remove-layer", e.id), this.dispatch("webmapx-remove-source",
|
|
3101
|
+
e.type === "Polygon" && this.dispatch("webmapx-remove-layer", `${e.id}-outline`), this.dispatch("webmapx-remove-layer", e.id), this.dispatch("webmapx-remove-source", H(e.id)), this.adapter?.store && Ce(this.adapter.store, e.id), this.createdDrawLayerIds.delete(e.id), e.type === "Polygon" && this.createdDrawLayerIds.delete(`${e.id}-outline`);
|
|
3082
3102
|
}
|
|
3083
3103
|
removeSharedLayers() {
|
|
3084
3104
|
for (let e of [
|
|
3085
|
-
Xe,
|
|
3086
|
-
Ze,
|
|
3087
|
-
tt,
|
|
3088
|
-
nt,
|
|
3089
3105
|
rt,
|
|
3090
3106
|
it,
|
|
3091
|
-
|
|
3092
|
-
|
|
3107
|
+
ct,
|
|
3108
|
+
K,
|
|
3109
|
+
lt,
|
|
3110
|
+
ut,
|
|
3111
|
+
dt,
|
|
3112
|
+
pt
|
|
3093
3113
|
]) this.dispatch("webmapx-remove-layer", e);
|
|
3094
3114
|
for (let e of [
|
|
3115
|
+
B,
|
|
3095
3116
|
V,
|
|
3096
|
-
|
|
3117
|
+
W,
|
|
3097
3118
|
G,
|
|
3098
|
-
K,
|
|
3099
3119
|
q,
|
|
3100
3120
|
J,
|
|
3101
3121
|
Y,
|
|
@@ -3119,7 +3139,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3119
3139
|
properties: e.properties
|
|
3120
3140
|
}));
|
|
3121
3141
|
this.dispatch("webmapx-set-source-data", {
|
|
3122
|
-
id:
|
|
3142
|
+
id: H(e),
|
|
3123
3143
|
data: {
|
|
3124
3144
|
type: "FeatureCollection",
|
|
3125
3145
|
features: t
|
|
@@ -3260,7 +3280,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3260
3280
|
if (n) {
|
|
3261
3281
|
let e = [];
|
|
3262
3282
|
for (let r of n.features) {
|
|
3263
|
-
if (!r.geometry || !
|
|
3283
|
+
if (!r.geometry || !ht(r.geometry.type)) continue;
|
|
3264
3284
|
let n = { ...r.properties };
|
|
3265
3285
|
e.push({
|
|
3266
3286
|
id: this.newId(),
|
|
@@ -3284,7 +3304,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3284
3304
|
});
|
|
3285
3305
|
}
|
|
3286
3306
|
this.activeLayerIds[t.type] = t.id, this.refreshDrawLayerSource(t.id);
|
|
3287
|
-
let i =
|
|
3307
|
+
let i = at(t.id);
|
|
3288
3308
|
if (this.adapter?.store) {
|
|
3289
3309
|
let e = this.adapter.store.getState().mapLayers ?? {}, n = e[i];
|
|
3290
3310
|
n && this.adapter.store.dispatch({ mapLayers: {
|
|
@@ -3324,7 +3344,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3324
3344
|
}
|
|
3325
3345
|
}
|
|
3326
3346
|
});
|
|
3327
|
-
let n =
|
|
3347
|
+
let n = at(e.id);
|
|
3328
3348
|
return e.type === "Polygon" ? (this.dispatch("webmapx-add-layer", {
|
|
3329
3349
|
id: n,
|
|
3330
3350
|
type: "fill",
|
|
@@ -3336,7 +3356,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3336
3356
|
properties: e.properties
|
|
3337
3357
|
},
|
|
3338
3358
|
paint: {
|
|
3339
|
-
"fill-color":
|
|
3359
|
+
"fill-color": U,
|
|
3340
3360
|
"fill-opacity": .35
|
|
3341
3361
|
}
|
|
3342
3362
|
}), this.dispatch("webmapx-add-layer", {
|
|
@@ -3351,7 +3371,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3351
3371
|
properties: e.properties
|
|
3352
3372
|
},
|
|
3353
3373
|
paint: {
|
|
3354
|
-
"line-color":
|
|
3374
|
+
"line-color": U,
|
|
3355
3375
|
"line-width": 2
|
|
3356
3376
|
}
|
|
3357
3377
|
})) : e.type === "LineString" ? this.dispatch("webmapx-add-layer", {
|
|
@@ -3365,7 +3385,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3365
3385
|
properties: e.properties
|
|
3366
3386
|
},
|
|
3367
3387
|
paint: {
|
|
3368
|
-
"line-color":
|
|
3388
|
+
"line-color": U,
|
|
3369
3389
|
"line-width": 2
|
|
3370
3390
|
}
|
|
3371
3391
|
}) : this.dispatch("webmapx-add-layer", {
|
|
@@ -3380,7 +3400,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3380
3400
|
},
|
|
3381
3401
|
paint: {
|
|
3382
3402
|
"circle-radius": 5,
|
|
3383
|
-
"circle-color":
|
|
3403
|
+
"circle-color": U,
|
|
3384
3404
|
"circle-stroke-width": 1,
|
|
3385
3405
|
"circle-stroke-color": "#555"
|
|
3386
3406
|
}
|
|
@@ -3393,7 +3413,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3393
3413
|
}
|
|
3394
3414
|
}
|
|
3395
3415
|
suspendDrawLayerFromMap(e) {
|
|
3396
|
-
e.type === "Polygon" && this.dispatch("webmapx-remove-layer", `${e.id}-outline`), this.dispatch("webmapx-remove-layer", e.id), this.dispatch("webmapx-remove-source",
|
|
3416
|
+
e.type === "Polygon" && this.dispatch("webmapx-remove-layer", `${e.id}-outline`), this.dispatch("webmapx-remove-layer", e.id), this.dispatch("webmapx-remove-source", H(e.id)), this.adapter?.store && Ce(this.adapter.store, e.id), this.createdDrawLayerIds.delete(e.id), e.type === "Polygon" && this.createdDrawLayerIds.delete(`${e.id}-outline`);
|
|
3397
3417
|
}
|
|
3398
3418
|
releaseLayer(e) {
|
|
3399
3419
|
this.releaseBorrowedLayer(e);
|
|
@@ -3431,7 +3451,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3431
3451
|
}
|
|
3432
3452
|
if (this.mode === "select") {
|
|
3433
3453
|
let e = this.adapter.project(t), n = [e[0], e[1]], r = this.findFeatureAt(n, t);
|
|
3434
|
-
r && r.id === this.selectedFeatureId && this.editState === "selected" && (
|
|
3454
|
+
r && r.id === this.selectedFeatureId && this.editState === "selected" && (gt(r.type) || _t(r.type)) ? this.enterEditMode(r.id) : r && r.id === this.selectedFeatureId && this.editState === "editing" || (r ? (this.selectedFeatureId = r.id, this.editState = $(r.type) ? "editing" : "selected", this.editState === "selected" ? this.helpText = "Click again to edit vertices." : $(r.type) && (this.helpText = "Drag to move point."), this.updateSelectedSource(), this.updateEditHandles(), this.requestUpdate()) : this.editState === "editing" ? (this.editState = "selected", this.updateEditHandles(), this.requestUpdate()) : (this.selectedFeatureId = null, this.editState = "none", this.updateSelectedSource(), this.updateEditHandles(), this.requestUpdate()));
|
|
3435
3455
|
}
|
|
3436
3456
|
}
|
|
3437
3457
|
}
|
|
@@ -3577,11 +3597,11 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3577
3597
|
return this.computeSnapExcluding(e, null, this.mode === "draw-point");
|
|
3578
3598
|
}
|
|
3579
3599
|
computeSnapExcluding(e, t, n) {
|
|
3580
|
-
return this.adapter ?
|
|
3600
|
+
return this.adapter ? nt(e, this.features.filter((e) => e.id !== t && !(n && $(e.type))), (e) => {
|
|
3581
3601
|
let t = this.adapter.project(e);
|
|
3582
3602
|
return [t[0], t[1]];
|
|
3583
3603
|
}, {
|
|
3584
|
-
threshold:
|
|
3604
|
+
threshold: mt,
|
|
3585
3605
|
edgePenalty: 8
|
|
3586
3606
|
}) : null;
|
|
3587
3607
|
}
|
|
@@ -3626,13 +3646,13 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3626
3646
|
});
|
|
3627
3647
|
}
|
|
3628
3648
|
this.dispatch("webmapx-set-source-data", {
|
|
3629
|
-
id:
|
|
3649
|
+
id: B,
|
|
3630
3650
|
data: {
|
|
3631
3651
|
type: "FeatureCollection",
|
|
3632
3652
|
features: e
|
|
3633
3653
|
}
|
|
3634
3654
|
}), this.dispatch("webmapx-set-source-data", {
|
|
3635
|
-
id:
|
|
3655
|
+
id: G,
|
|
3636
3656
|
data: {
|
|
3637
3657
|
type: "FeatureCollection",
|
|
3638
3658
|
features: t
|
|
@@ -3666,7 +3686,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3666
3686
|
properties: {}
|
|
3667
3687
|
}] : [];
|
|
3668
3688
|
this.dispatch("webmapx-set-source-data", {
|
|
3669
|
-
id:
|
|
3689
|
+
id: W,
|
|
3670
3690
|
data: {
|
|
3671
3691
|
type: "FeatureCollection",
|
|
3672
3692
|
features: t
|
|
@@ -3772,7 +3792,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3772
3792
|
});
|
|
3773
3793
|
}
|
|
3774
3794
|
findHandleAt(e) {
|
|
3775
|
-
let t = null, n =
|
|
3795
|
+
let t = null, n = ft;
|
|
3776
3796
|
for (let r of this.editHandles) {
|
|
3777
3797
|
let i = this.adapter.project(r.coords), a = Math.hypot(e[0] - i[0], e[1] - i[1]);
|
|
3778
3798
|
a < n && (n = a, t = r);
|
|
@@ -3967,7 +3987,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3967
3987
|
};
|
|
3968
3988
|
this.downloadBlob(new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), `${e}.geojson`);
|
|
3969
3989
|
} else {
|
|
3970
|
-
let t = new
|
|
3990
|
+
let t = new xe(new be("application/zip"));
|
|
3971
3991
|
for (let e of this.drawLayers) {
|
|
3972
3992
|
let n = {
|
|
3973
3993
|
type: "FeatureCollection",
|
|
@@ -3981,7 +4001,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
3981
4001
|
properties: { ...e.properties }
|
|
3982
4002
|
}))
|
|
3983
4003
|
}, r = e.name.replace(/[/\\?%*:|"<>]/g, "_");
|
|
3984
|
-
await t.add(`${r}.geojson`, new
|
|
4004
|
+
await t.add(`${r}.geojson`, new ye(JSON.stringify(n, null, 2)));
|
|
3985
4005
|
}
|
|
3986
4006
|
this.downloadBlob(await t.close(), `${e}.zip`);
|
|
3987
4007
|
}
|
|
@@ -4114,7 +4134,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4114
4134
|
}
|
|
4115
4135
|
render() {
|
|
4116
4136
|
let e = this.features.find((e) => e.id === this.selectedFeatureId), t = e ? this.drawLayers.find((t) => t.id === e.layerId) : null;
|
|
4117
|
-
return
|
|
4137
|
+
return d`
|
|
4118
4138
|
<div class="toolbar">
|
|
4119
4139
|
<sl-tooltip content="Select">
|
|
4120
4140
|
<sl-icon-button name="cursor"
|
|
@@ -4186,7 +4206,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4186
4206
|
<div class="scroll-content">
|
|
4187
4207
|
<div class="help">${this.helpText}</div>
|
|
4188
4208
|
|
|
4189
|
-
${this.isTouchDevice && (this.mode === "draw-line" || this.mode === "draw-polygon") && this.draftPoints.length >= (this.mode === "draw-line" ? 2 : 3) ?
|
|
4209
|
+
${this.isTouchDevice && (this.mode === "draw-line" || this.mode === "draw-polygon") && this.draftPoints.length >= (this.mode === "draw-line" ? 2 : 3) ? d`
|
|
4190
4210
|
<sl-button size="small" variant="primary" style="margin-bottom:.4rem;width:100%"
|
|
4191
4211
|
@click=${() => {
|
|
4192
4212
|
let e = Q(this.mode), t = e ? this.activeLayerIds[e] : null;
|
|
@@ -4196,17 +4216,17 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4196
4216
|
</sl-button>
|
|
4197
4217
|
` : ""}
|
|
4198
4218
|
|
|
4199
|
-
${this.drawLayers.length > 0 ?
|
|
4219
|
+
${this.drawLayers.length > 0 ? d`
|
|
4200
4220
|
<div class="layers-section">
|
|
4201
4221
|
<div class="section-label">Editing</div>
|
|
4202
|
-
${this.drawLayers.map((e) =>
|
|
4222
|
+
${this.drawLayers.map((e) => d`
|
|
4203
4223
|
<div class="layer-row" title="Click to change layer"
|
|
4204
4224
|
@click=${() => this.openLayerDialog(e.type === "Point" ? "draw-point" : e.type === "LineString" ? "draw-line" : "draw-polygon")}>
|
|
4205
4225
|
<span class="color-dot" style="background:${e.color}"></span>
|
|
4206
4226
|
<span class="layer-name">${e.name}</span>
|
|
4207
4227
|
<span class="layer-type">${e.type === "LineString" ? "Line" : e.type}</span>
|
|
4208
4228
|
<small style="color:var(--sl-color-neutral-400);font-size:.7rem">${this.features.filter((t) => t.layerId === e.id).length}</small>
|
|
4209
|
-
${this.drawLayers.length > 1 ?
|
|
4229
|
+
${this.drawLayers.length > 1 ? d`
|
|
4210
4230
|
<sl-tooltip content="Stop editing">
|
|
4211
4231
|
<sl-icon-button name="x" class="remove-layer-btn"
|
|
4212
4232
|
@click=${(t) => {
|
|
@@ -4220,9 +4240,9 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4220
4240
|
</div>
|
|
4221
4241
|
` : ""}
|
|
4222
4242
|
|
|
4223
|
-
${e && t ?
|
|
4243
|
+
${e && t ? d`
|
|
4224
4244
|
<div class="section-label" style="margin-top:.5rem">Selected: ${t.name}</div>
|
|
4225
|
-
${t.properties.map((n) =>
|
|
4245
|
+
${t.properties.map((n) => d`
|
|
4226
4246
|
<div class="prop-row">
|
|
4227
4247
|
<span class="prop-label">${n.name}</span>
|
|
4228
4248
|
${n.name === "id" || [
|
|
@@ -4233,26 +4253,26 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4233
4253
|
"length",
|
|
4234
4254
|
"create-time",
|
|
4235
4255
|
"update-time"
|
|
4236
|
-
].includes(n.type) ?
|
|
4256
|
+
].includes(n.type) ? d`<span class="prop-value" style="color:var(--sl-color-neutral-400);font-style:italic;padding:0 0.3rem">${["create-time", "update-time"].includes(n.type) ? e.properties[n.name] ? new Date(e.properties[n.name]).toLocaleString() : "—" : e.properties[n.name] ?? "—"}</span>` : n.type === "imageURL" ? d`<div class="prop-url-wrap">
|
|
4237
4257
|
<sl-input size="small"
|
|
4238
4258
|
.value=${String(e.properties[n.name] ?? "")}
|
|
4239
4259
|
placeholder="image URL"
|
|
4240
4260
|
@sl-change=${(r) => {
|
|
4241
4261
|
e.properties[n.name] = r.target.value, t && this.computeSpecialProperties(e, t), this.features = [...this.features], this.refreshDrawLayerSource(e.layerId);
|
|
4242
4262
|
}}></sl-input>
|
|
4243
|
-
${e.properties[n.name] ?
|
|
4263
|
+
${e.properties[n.name] ? d`<img class="prop-img" src=${String(e.properties[n.name])} @error=${(e) => {
|
|
4244
4264
|
let t = e.target, n = document.createElement("span");
|
|
4245
4265
|
n.className = "prop-img-error", n.textContent = "⚠ invalid image", t.replaceWith(n);
|
|
4246
4266
|
}}>` : ""}
|
|
4247
|
-
</div>` : n.type === "linkURL" ?
|
|
4267
|
+
</div>` : n.type === "linkURL" ? d`<div class="prop-url-wrap">
|
|
4248
4268
|
<sl-input size="small"
|
|
4249
4269
|
.value=${String(e.properties[n.name] ?? "")}
|
|
4250
4270
|
placeholder="link URL"
|
|
4251
4271
|
@sl-change=${(r) => {
|
|
4252
4272
|
e.properties[n.name] = r.target.value, t && this.computeSpecialProperties(e, t), this.features = [...this.features], this.refreshDrawLayerSource(e.layerId);
|
|
4253
4273
|
}}></sl-input>
|
|
4254
|
-
${e.properties[n.name] ?
|
|
4255
|
-
</div>` :
|
|
4274
|
+
${e.properties[n.name] ? d`<a class="prop-link" href=${String(e.properties[n.name])} target="_blank" rel="noopener noreferrer">${e.properties[n.name]}</a>` : ""}
|
|
4275
|
+
</div>` : d`<sl-input size="small" class="prop-value"
|
|
4256
4276
|
.value=${String(e.properties[n.name] ?? "")}
|
|
4257
4277
|
@sl-change=${(r) => {
|
|
4258
4278
|
e.properties[n.name] = r.target.value, t && this.computeSpecialProperties(e, t), this.features = [...this.features], this.refreshDrawLayerSource(e.layerId);
|
|
@@ -4278,7 +4298,7 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4278
4298
|
<span slot="suffix">${this.exportMode === "separate" ? ".zip" : ".geojson"}</span>
|
|
4279
4299
|
</sl-input>
|
|
4280
4300
|
</div>
|
|
4281
|
-
${this.drawLayers.length > 1 ?
|
|
4301
|
+
${this.drawLayers.length > 1 ? d`
|
|
4282
4302
|
<div style="margin-top:.6rem">
|
|
4283
4303
|
<sl-radio-group label="Export as" .value=${this.exportMode}
|
|
4284
4304
|
@sl-change=${(e) => {
|
|
@@ -4295,20 +4315,20 @@ var W = "#888888", $e = "#ff3b30", et = 10, G = "webmapx-draw-sel-source", tt =
|
|
|
4295
4315
|
`;
|
|
4296
4316
|
}
|
|
4297
4317
|
};
|
|
4298
|
-
|
|
4318
|
+
m([s()], Z.prototype, "mode", void 0), m([s()], Z.prototype, "drawLayers", void 0), m([s()], Z.prototype, "features", void 0), m([s()], Z.prototype, "selectedFeatureId", void 0), m([s()], Z.prototype, "helpText", void 0), m([s()], Z.prototype, "pendingMode", void 0), m([s()], Z.prototype, "uiVersion", void 0), m([s()], Z.prototype, "isTouchDevice", void 0), m([s()], Z.prototype, "snapEnabled", void 0), m([s()], Z.prototype, "altActive", void 0), m([s()], Z.prototype, "editState", void 0), m([l("webmapx-draw-layer-dialog")], Z.prototype, "layerDialog", void 0), m([l("#export-dialog")], Z.prototype, "exportDialog", void 0), m([s()], Z.prototype, "exportFilename", void 0), m([s()], Z.prototype, "exportMode", void 0), Z = m([u("webmapx-draw-tool")], Z);
|
|
4299
4319
|
function Q(e) {
|
|
4300
4320
|
return e === "draw-point" ? "Point" : e === "draw-line" ? "LineString" : e === "draw-polygon" ? "Polygon" : null;
|
|
4301
4321
|
}
|
|
4302
|
-
function
|
|
4322
|
+
function ht(e) {
|
|
4303
4323
|
return e === "Point" || e === "MultiPoint" || e === "LineString" || e === "MultiLineString" || e === "Polygon" || e === "MultiPolygon";
|
|
4304
4324
|
}
|
|
4305
4325
|
function $(e) {
|
|
4306
4326
|
return e === "Point" || e === "MultiPoint";
|
|
4307
4327
|
}
|
|
4308
|
-
function
|
|
4328
|
+
function gt(e) {
|
|
4309
4329
|
return e === "LineString" || e === "MultiLineString";
|
|
4310
4330
|
}
|
|
4311
|
-
function
|
|
4331
|
+
function _t(e) {
|
|
4312
4332
|
return e === "Polygon" || e === "MultiPolygon";
|
|
4313
4333
|
}
|
|
4314
4334
|
//#endregion
|