@opengis/gis 0.2.178 → 0.2.180
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/{CardIcon-CMRD1LLh.js → CardIcon-g4POnzwa.js} +1 -1
- package/dist/{EntityTablePage-XNNCltAN.js → EntityTablePage-B7K_hSYY.js} +1 -1
- package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-BqUjKTDY.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-BcSv7m_s.js} +1 -1
- package/dist/{MapSettings-P3h-vHn3.js → MapSettings-C3hn2A7K.js} +1 -1
- package/dist/MapToolbarRight.vue_vue_type_script_setup_true_lang-Diu4LI2Z.js +1230 -0
- package/dist/{RastersTablePage-DnhGZLiH.js → RastersTablePage-6Emo2MXj.js} +1 -1
- package/dist/cartocss-COLdNfzh.js +1460 -0
- package/dist/{import-utils-BCATsbB5.js → import-utils-DTDbjorg.js} +1 -1
- package/dist/{index-cUagVqgA.js → index-Czv-aLH-.js} +11 -11
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +29 -29
- package/dist/{raster-CP0tUp3j.js → raster-CB8C1210.js} +225 -219
- package/dist/{register-Cr-uQcby.js → register-DkQ3WyMI.js} +3 -3
- package/dist/{service-DwJaKrOd.js → service-BTKNJ8d_.js} +603 -597
- package/dist/{vs-datatable-B9WoVk-b.js → vs-datatable-C4NSnPIQ.js} +1 -1
- package/package.json +1 -1
- package/server/routes/registers/functions/getFilterSQLParametrized/formatValue.js +1 -1
- package/server/routes/registers/functions/gis.suggest.js +1 -1
- package/server/routes/registers/functions/handleRegistryRequest.js +4 -2
- package/dist/HeaderActions.vue_vue_type_script_setup_true_lang-BXQ3hKwa.js +0 -1099
- package/dist/cartocss-BkrOeQg4.js +0 -1586
|
@@ -0,0 +1,1230 @@
|
|
|
1
|
+
import { openBlock as s, createElementBlock as b, createElementVNode as a, defineComponent as I, normalizeClass as ee, createVNode as j, createBlock as J, unref as U, ref as h, computed as k, watch as ce, withDirectives as Me, vModelText as Ee, createCommentVNode as G, Fragment as X, renderList as K, createStaticVNode as Be, toDisplayString as $, defineAsyncComponent as re, createTextVNode as ye, withCtx as Q, nextTick as Te, onMounted as ne, onUnmounted as Le, withModifiers as we, Teleport as Ue, normalizeStyle as ke, renderSlot as Ce, onBeforeUnmount as je } from "vue";
|
|
2
|
+
import { _ as Ne, f as de } from "./index-Czv-aLH-.js";
|
|
3
|
+
import { Settings as Ae, BrushCleaning as he, SquareCode as xe, Pencil as Re, ZoomIn as Fe, ZoomOut as Oe, Compass as Ie } from "lucide-vue-next";
|
|
4
|
+
import { notify as W } from "@opengis/core";
|
|
5
|
+
const De = {}, Pe = {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "24",
|
|
8
|
+
height: "24",
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"stroke-width": "2",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round",
|
|
15
|
+
class: "inline-block shrink-0"
|
|
16
|
+
};
|
|
17
|
+
function He(l, f) {
|
|
18
|
+
return s(), b("svg", Pe, [...f[0] || (f[0] = [
|
|
19
|
+
a("path", { d: "M8 3 4 7l4 4" }, null, -1),
|
|
20
|
+
a("path", { d: "M4 7h16" }, null, -1),
|
|
21
|
+
a("path", { d: "m16 21 4-4-4-4" }, null, -1),
|
|
22
|
+
a("path", { d: "M20 17H4" }, null, -1)
|
|
23
|
+
])]);
|
|
24
|
+
}
|
|
25
|
+
const Ge = /* @__PURE__ */ Ne(De, [["render", He]]), Qe = ["aria-label"], Ht = /* @__PURE__ */ I({
|
|
26
|
+
__name: "PanelToggleButton",
|
|
27
|
+
props: {
|
|
28
|
+
open: { type: Boolean },
|
|
29
|
+
topClass: { default: "top-5" }
|
|
30
|
+
},
|
|
31
|
+
emits: ["toggle"],
|
|
32
|
+
setup(l) {
|
|
33
|
+
return (f, n) => (s(), b("button", {
|
|
34
|
+
type: "button",
|
|
35
|
+
onClick: n[0] || (n[0] = (x) => f.$emit("toggle")),
|
|
36
|
+
class: ee([
|
|
37
|
+
"absolute right-0 w-5 h-9 shrink-0 rounded-l-lg inline-flex items-center justify-center",
|
|
38
|
+
"text-gray-600 hover:bg-gray-100 hover:text-gray-800 transition border border-gray-100 shadow-md bg-white z-[21]",
|
|
39
|
+
l.topClass
|
|
40
|
+
]),
|
|
41
|
+
"aria-label": l.open ? "Закрити панель" : "Відкрити панель"
|
|
42
|
+
}, [
|
|
43
|
+
j(Ge, { class: "h-3 w-3" })
|
|
44
|
+
], 10, Qe));
|
|
45
|
+
}
|
|
46
|
+
}), Gt = /* @__PURE__ */ I({
|
|
47
|
+
__name: "SettingsIcon",
|
|
48
|
+
setup(l) {
|
|
49
|
+
return (f, n) => (s(), J(U(Ae), {
|
|
50
|
+
size: 16,
|
|
51
|
+
class: "lucide lucide-settings"
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}), Ze = { class: "flex flex-col gap-2" }, qe = { class: "relative flex items-center" }, Xe = {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "flex flex-col gap-1.5"
|
|
57
|
+
}, We = {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: "flex flex-col items-center gap-1.5 py-5 text-gray-400"
|
|
60
|
+
}, Je = { class: "text-xs" }, Ye = {
|
|
61
|
+
key: 2,
|
|
62
|
+
class: "flex flex-col gap-1 p-0"
|
|
63
|
+
}, Ke = { class: "flex size-[30px] shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-indigo-500 text-xs font-semibold text-white" }, et = { class: "flex min-w-0 flex-1 flex-col gap-0.5" }, tt = { class: "truncate text-xs font-medium text-gray-900" }, lt = { class: "flex flex-wrap gap-1" }, at = {
|
|
64
|
+
key: 3,
|
|
65
|
+
class: "flex items-center justify-end gap-1.5 pt-1"
|
|
66
|
+
}, ot = ["disabled"], rt = { class: "min-w-[36px] text-center text-[11px] text-gray-500" }, nt = ["disabled"], st = { class: "ml-1 text-[11px] text-gray-400" }, it = /* @__PURE__ */ I({
|
|
67
|
+
__name: "ServiceUsers",
|
|
68
|
+
props: {
|
|
69
|
+
serviceId: {},
|
|
70
|
+
limit: {}
|
|
71
|
+
},
|
|
72
|
+
setup(l) {
|
|
73
|
+
const f = l, n = f.limit ?? 10, x = h([]), i = h(0), y = h(!1), m = h(1), _ = h("");
|
|
74
|
+
let M = null;
|
|
75
|
+
const o = k(() => Math.max(1, Math.ceil(i.value / n))), C = k(() => {
|
|
76
|
+
const v = i.value % 100, u = i.value % 10;
|
|
77
|
+
return v >= 11 && v <= 19 ? "ів" : u === 1 ? "" : u >= 2 && u <= 4 ? "и" : "ів";
|
|
78
|
+
});
|
|
79
|
+
function e(v) {
|
|
80
|
+
return (v || "?").trim().charAt(0).toUpperCase();
|
|
81
|
+
}
|
|
82
|
+
function z(v) {
|
|
83
|
+
if (!v) return [];
|
|
84
|
+
if (Array.isArray(v)) return v;
|
|
85
|
+
if (typeof v == "string") {
|
|
86
|
+
try {
|
|
87
|
+
const u = JSON.parse(v);
|
|
88
|
+
if (Array.isArray(u)) return u;
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
return v.replace(/[{}"]/g, "").split(",").filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const L = {
|
|
96
|
+
view: "Перегляд",
|
|
97
|
+
edit: "Редагування",
|
|
98
|
+
del: "Видалення",
|
|
99
|
+
add: "Додавання"
|
|
100
|
+
};
|
|
101
|
+
function R(v) {
|
|
102
|
+
return L[v] ?? v;
|
|
103
|
+
}
|
|
104
|
+
const A = {
|
|
105
|
+
view: "bg-blue-50 text-blue-700 border-blue-200",
|
|
106
|
+
edit: "bg-green-50 text-green-700 border-green-200",
|
|
107
|
+
del: "bg-red-50 text-red-600 border-red-200",
|
|
108
|
+
add: "bg-emerald-50 text-emerald-700 border-emerald-200",
|
|
109
|
+
admin: "bg-purple-50 text-purple-700 border-purple-200",
|
|
110
|
+
export: "bg-amber-50 text-amber-700 border-amber-200",
|
|
111
|
+
import: "bg-teal-50 text-teal-700 border-teal-200"
|
|
112
|
+
};
|
|
113
|
+
function D(v) {
|
|
114
|
+
return A[v] ?? "bg-gray-50 text-gray-600 border-gray-200";
|
|
115
|
+
}
|
|
116
|
+
async function F() {
|
|
117
|
+
if (!f.serviceId) {
|
|
118
|
+
x.value = [], i.value = 0;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
y.value = !0;
|
|
122
|
+
try {
|
|
123
|
+
const v = (m.value - 1) * n, u = new URLSearchParams({
|
|
124
|
+
limit: String(n),
|
|
125
|
+
offset: String(v)
|
|
126
|
+
});
|
|
127
|
+
_.value.trim() && u.set("search", _.value.trim());
|
|
128
|
+
const V = await fetch(`/api/gis-service-users/${encodeURIComponent(String(f.serviceId))}?${u}`);
|
|
129
|
+
if (!V.ok) throw new Error(`HTTP ${V.status}`);
|
|
130
|
+
const T = await V.json();
|
|
131
|
+
x.value = (T == null ? void 0 : T.rows) ?? [], i.value = (T == null ? void 0 : T.count) ?? 0;
|
|
132
|
+
} catch (v) {
|
|
133
|
+
console.error("[ServiceUsers] fetch error", v), x.value = [], i.value = 0;
|
|
134
|
+
} finally {
|
|
135
|
+
y.value = !1;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function B(v) {
|
|
139
|
+
m.value = v, F();
|
|
140
|
+
}
|
|
141
|
+
function N() {
|
|
142
|
+
M && clearTimeout(M), M = setTimeout(() => {
|
|
143
|
+
m.value = 1, F();
|
|
144
|
+
}, 350);
|
|
145
|
+
}
|
|
146
|
+
function S() {
|
|
147
|
+
_.value = "", m.value = 1, F();
|
|
148
|
+
}
|
|
149
|
+
return ce(
|
|
150
|
+
() => f.serviceId,
|
|
151
|
+
() => {
|
|
152
|
+
m.value = 1, _.value = "", F();
|
|
153
|
+
},
|
|
154
|
+
{ immediate: !0 }
|
|
155
|
+
), (v, u) => (s(), b("div", Ze, [
|
|
156
|
+
a("div", qe, [
|
|
157
|
+
u[4] || (u[4] = a("div", { class: "pointer-events-none absolute left-2.5 flex text-gray-400" }, [
|
|
158
|
+
a("svg", {
|
|
159
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
160
|
+
width: "14",
|
|
161
|
+
height: "14",
|
|
162
|
+
viewBox: "0 0 24 24",
|
|
163
|
+
fill: "none",
|
|
164
|
+
stroke: "currentColor",
|
|
165
|
+
"stroke-width": "2",
|
|
166
|
+
"stroke-linecap": "round",
|
|
167
|
+
"stroke-linejoin": "round"
|
|
168
|
+
}, [
|
|
169
|
+
a("circle", {
|
|
170
|
+
cx: "11",
|
|
171
|
+
cy: "11",
|
|
172
|
+
r: "8"
|
|
173
|
+
}),
|
|
174
|
+
a("line", {
|
|
175
|
+
x1: "21",
|
|
176
|
+
y1: "21",
|
|
177
|
+
x2: "16.65",
|
|
178
|
+
y2: "16.65"
|
|
179
|
+
})
|
|
180
|
+
])
|
|
181
|
+
], -1)),
|
|
182
|
+
Me(a("input", {
|
|
183
|
+
"onUpdate:modelValue": u[0] || (u[0] = (V) => _.value = V),
|
|
184
|
+
type: "text",
|
|
185
|
+
class: "w-full rounded-md border border-gray-200 bg-gray-50 py-1.5 pl-8 pr-7 text-xs text-gray-900 outline-none transition focus:border-blue-400 focus:bg-white focus:ring-2 focus:ring-blue-400/20",
|
|
186
|
+
placeholder: "Пошук за іменем або логіном…",
|
|
187
|
+
onInput: N
|
|
188
|
+
}, null, 544), [
|
|
189
|
+
[Ee, _.value]
|
|
190
|
+
]),
|
|
191
|
+
_.value ? (s(), b("button", {
|
|
192
|
+
key: 0,
|
|
193
|
+
class: "absolute right-2 flex items-center justify-center rounded p-0.5 text-gray-400 transition hover:text-gray-700",
|
|
194
|
+
onClick: S
|
|
195
|
+
}, [...u[3] || (u[3] = [
|
|
196
|
+
a("svg", {
|
|
197
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
198
|
+
width: "12",
|
|
199
|
+
height: "12",
|
|
200
|
+
viewBox: "0 0 24 24",
|
|
201
|
+
fill: "none",
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
"stroke-width": "2.5",
|
|
204
|
+
"stroke-linecap": "round",
|
|
205
|
+
"stroke-linejoin": "round"
|
|
206
|
+
}, [
|
|
207
|
+
a("line", {
|
|
208
|
+
x1: "18",
|
|
209
|
+
y1: "6",
|
|
210
|
+
x2: "6",
|
|
211
|
+
y2: "18"
|
|
212
|
+
}),
|
|
213
|
+
a("line", {
|
|
214
|
+
x1: "6",
|
|
215
|
+
y1: "6",
|
|
216
|
+
x2: "18",
|
|
217
|
+
y2: "18"
|
|
218
|
+
})
|
|
219
|
+
], -1)
|
|
220
|
+
])])) : G("", !0)
|
|
221
|
+
]),
|
|
222
|
+
y.value ? (s(), b("div", Xe, [
|
|
223
|
+
(s(), b(X, null, K(3, (V) => a("div", {
|
|
224
|
+
key: V,
|
|
225
|
+
class: "flex animate-pulse items-center gap-2 rounded-lg bg-gray-50 px-2 py-1.5"
|
|
226
|
+
}, [...u[5] || (u[5] = [
|
|
227
|
+
a("div", { class: "size-[30px] shrink-0 rounded-full bg-gray-200" }, null, -1),
|
|
228
|
+
a("div", { class: "flex flex-1 flex-col gap-1.5" }, [
|
|
229
|
+
a("div", { class: "h-2 w-2/3 rounded bg-gray-200" }),
|
|
230
|
+
a("div", { class: "h-2 w-1/3 rounded bg-gray-200" })
|
|
231
|
+
], -1)
|
|
232
|
+
])])), 64))
|
|
233
|
+
])) : x.value.length ? (s(), b("ul", Ye, [
|
|
234
|
+
(s(!0), b(X, null, K(x.value, (V) => (s(), b("li", {
|
|
235
|
+
key: V.user_id,
|
|
236
|
+
class: "flex items-center gap-2 rounded-lg border border-gray-100 bg-gray-50 px-2 py-1.5 transition hover:border-sky-200 hover:bg-sky-50"
|
|
237
|
+
}, [
|
|
238
|
+
a("div", Ke, $(e(V.user_full_name)), 1),
|
|
239
|
+
a("div", et, [
|
|
240
|
+
a("span", tt, $(V.user_full_name), 1),
|
|
241
|
+
a("div", lt, [
|
|
242
|
+
(s(!0), b(X, null, K(z(V.actions), (T) => (s(), b("span", {
|
|
243
|
+
key: T,
|
|
244
|
+
class: ee(["rounded-full border px-1.5 py-px text-[10px] font-medium", D(T)])
|
|
245
|
+
}, $(R(T)), 3))), 128))
|
|
246
|
+
])
|
|
247
|
+
])
|
|
248
|
+
]))), 128))
|
|
249
|
+
])) : (s(), b("div", We, [
|
|
250
|
+
u[6] || (u[6] = Be('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="opacity-50"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>', 1)),
|
|
251
|
+
a("span", Je, $(_.value ? "Нічого не знайдено" : "Немає користувачів з доступом"), 1)
|
|
252
|
+
])),
|
|
253
|
+
o.value > 1 ? (s(), b("div", at, [
|
|
254
|
+
a("button", {
|
|
255
|
+
class: "flex size-[26px] items-center justify-center rounded-md border border-gray-200 bg-white text-gray-600 transition enabled:hover:border-blue-400 enabled:hover:bg-sky-50 enabled:hover:text-blue-600 disabled:cursor-not-allowed disabled:opacity-40",
|
|
256
|
+
disabled: m.value === 1,
|
|
257
|
+
onClick: u[1] || (u[1] = (V) => B(m.value - 1))
|
|
258
|
+
}, [...u[7] || (u[7] = [
|
|
259
|
+
a("svg", {
|
|
260
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
261
|
+
width: "14",
|
|
262
|
+
height: "14",
|
|
263
|
+
viewBox: "0 0 24 24",
|
|
264
|
+
fill: "none",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
"stroke-width": "2",
|
|
267
|
+
"stroke-linecap": "round",
|
|
268
|
+
"stroke-linejoin": "round"
|
|
269
|
+
}, [
|
|
270
|
+
a("polyline", { points: "15 18 9 12 15 6" })
|
|
271
|
+
], -1)
|
|
272
|
+
])], 8, ot),
|
|
273
|
+
a("span", rt, $(m.value) + " / " + $(o.value), 1),
|
|
274
|
+
a("button", {
|
|
275
|
+
class: "flex size-[26px] items-center justify-center rounded-md border border-gray-200 bg-white text-gray-600 transition enabled:hover:border-blue-400 enabled:hover:bg-sky-50 enabled:hover:text-blue-600 disabled:cursor-not-allowed disabled:opacity-40",
|
|
276
|
+
disabled: m.value === o.value,
|
|
277
|
+
onClick: u[2] || (u[2] = (V) => B(m.value + 1))
|
|
278
|
+
}, [...u[8] || (u[8] = [
|
|
279
|
+
a("svg", {
|
|
280
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
281
|
+
width: "14",
|
|
282
|
+
height: "14",
|
|
283
|
+
viewBox: "0 0 24 24",
|
|
284
|
+
fill: "none",
|
|
285
|
+
stroke: "currentColor",
|
|
286
|
+
"stroke-width": "2",
|
|
287
|
+
"stroke-linecap": "round",
|
|
288
|
+
"stroke-linejoin": "round"
|
|
289
|
+
}, [
|
|
290
|
+
a("polyline", { points: "9 18 15 12 9 6" })
|
|
291
|
+
], -1)
|
|
292
|
+
])], 8, nt),
|
|
293
|
+
a("span", st, $(i.value) + " запис" + $(C.value), 1)
|
|
294
|
+
])) : G("", !0)
|
|
295
|
+
]));
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
function ut(l) {
|
|
299
|
+
const n = (e) => typeof e != "number" || Number.isNaN(e) ? "" : Number(e.toFixed(5)).toFixed(5), x = [
|
|
300
|
+
{
|
|
301
|
+
name: "description",
|
|
302
|
+
type: "textarea",
|
|
303
|
+
label: "Опис",
|
|
304
|
+
col: 12
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: "group_id",
|
|
308
|
+
type: "Autocomplete",
|
|
309
|
+
label: "Група",
|
|
310
|
+
data: "gis.group_list",
|
|
311
|
+
col: 6
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "keywords",
|
|
315
|
+
type: "Tags",
|
|
316
|
+
label: "Ключові слова",
|
|
317
|
+
placeholder: "Введіть тег та натисніть Enter",
|
|
318
|
+
col: 12
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "is_public",
|
|
322
|
+
type: "switcher",
|
|
323
|
+
label: "Публічність",
|
|
324
|
+
col: 6,
|
|
325
|
+
data: "yes_no"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: "is_active",
|
|
329
|
+
type: "switcher",
|
|
330
|
+
label: "Активність",
|
|
331
|
+
col: 6,
|
|
332
|
+
data: "yes_no"
|
|
333
|
+
}
|
|
334
|
+
], i = (e, z) => {
|
|
335
|
+
const L = Array.isArray(e == null ? void 0 : e.config) ? e.config[0] : null;
|
|
336
|
+
return l.normalizeValue(L == null ? void 0 : L[z]);
|
|
337
|
+
}, y = (e) => !Array.isArray(e == null ? void 0 : e.bounds) || e.bounds.length < 4 ? "" : e.bounds.map((z) => n(z)).filter(Boolean).join(", "), m = (e) => !Array.isArray(e == null ? void 0 : e.extent) || e.extent.length < 4 ? "" : e.extent.map((z) => n(z)).filter(Boolean).join(", "), _ = (e) => !Array.isArray(e == null ? void 0 : e.bands) || !e.bands.length ? "" : e.bands.join(", "), M = (e) => typeof e != "boolean" ? "" : e ? "Так" : "Ні", o = [
|
|
338
|
+
{ label: "Група", value: (e) => l.normalizeValue((e == null ? void 0 : e.group_name) ?? l.resolvedGroupName ?? (e == null ? void 0 : e.group_id)) },
|
|
339
|
+
{ label: "Статус", value: (e) => l.normalizeValue(l.statusLabel(e)) },
|
|
340
|
+
{ label: "Видимість", value: (e) => l.normalizeValue(l.visibilityLabel(e)) },
|
|
341
|
+
{ label: "Тип сервісу", value: (e) => l.normalizeValue(e == null ? void 0 : e.service_type) },
|
|
342
|
+
{ label: "Тип джерела", value: (e) => l.normalizeValue(e == null ? void 0 : e.source_type) },
|
|
343
|
+
{ label: "Шлях до джерела", value: (e) => l.normalizeValue(e == null ? void 0 : e.source_path) },
|
|
344
|
+
{ label: "Тип геометрії", value: (e) => l.normalizeValue(e == null ? void 0 : e.geom_type) },
|
|
345
|
+
{ label: "Геометрична колонка", value: (e) => l.normalizeValue(e == null ? void 0 : e.geometry_column) },
|
|
346
|
+
{ label: "SRID", value: (e) => l.normalizeValue(e == null ? void 0 : e.srid) },
|
|
347
|
+
{ label: "Кількість обʼєктів", value: (e) => l.normalizeValue(e == null ? void 0 : e.count) },
|
|
348
|
+
{ label: "Створено", value: (e) => e != null && e.created_at ? l.formatDate(e.created_at) : "" },
|
|
349
|
+
{ label: "Оновлено", value: (e) => e != null && e.updated_at ? l.formatDate(e.updated_at) : "" }
|
|
350
|
+
], C = [
|
|
351
|
+
{ label: "Ключ сервісу", value: (e) => l.normalizeValue(e == null ? void 0 : e.service_key) },
|
|
352
|
+
{ label: "Виробник", value: (e) => l.normalizeValue((e == null ? void 0 : e.holder) ?? (e == null ? void 0 : e.producer)) },
|
|
353
|
+
{ label: "Категорія", value: (e) => l.normalizeValue(e == null ? void 0 : e.category) },
|
|
354
|
+
{ label: "Ліцензія", value: (e) => l.normalizeValue(e == null ? void 0 : e.license) },
|
|
355
|
+
{ label: "Рік", value: (e) => l.normalizeValue(e == null ? void 0 : e.year) },
|
|
356
|
+
{ label: "Ключові слова", value: (e) => l.normalizeValue(e == null ? void 0 : e.keywords) },
|
|
357
|
+
{ label: "URL сервісу", value: (e) => l.normalizeValue(e == null ? void 0 : e.service_url) },
|
|
358
|
+
{ label: "Metadata URL", value: (e) => l.normalizeValue(e == null ? void 0 : e.metadata_url) },
|
|
359
|
+
{ label: "Thumbnail URL", value: (e) => l.normalizeValue(e == null ? void 0 : e.thumbnail_url) },
|
|
360
|
+
{ label: "SQL / Query", value: (e) => l.normalizeValue(e == null ? void 0 : e.query) }
|
|
361
|
+
];
|
|
362
|
+
return {
|
|
363
|
+
service: {
|
|
364
|
+
general: o,
|
|
365
|
+
meta: C,
|
|
366
|
+
edit: [
|
|
367
|
+
...x,
|
|
368
|
+
{ name: "service_key", type: "text", label: "Ключ сервісу", col: 6 },
|
|
369
|
+
{ name: "producer", type: "text", label: "Виробник", col: 6 },
|
|
370
|
+
{ name: "category", type: "text", label: "Категорія", col: 6 },
|
|
371
|
+
{ name: "license", type: "text", label: "Ліцензія", col: 6 },
|
|
372
|
+
{ name: "year", type: "number", label: "Рік", col: 6 },
|
|
373
|
+
{ name: "service_url", type: "text", label: "URL сервісу", col: 12 },
|
|
374
|
+
{ name: "metadata_url", type: "text", label: "Metadata URL", col: 12 },
|
|
375
|
+
{ name: "thumbnail_url", type: "text", label: "Thumbnail URL", col: 12 },
|
|
376
|
+
{ name: "query", type: "textarea", label: "SQL / Query", col: 12 }
|
|
377
|
+
]
|
|
378
|
+
},
|
|
379
|
+
dataset: {
|
|
380
|
+
general: o,
|
|
381
|
+
meta: C,
|
|
382
|
+
edit: [
|
|
383
|
+
...x,
|
|
384
|
+
{ name: "service_key", type: "text", label: "Ключ сервісу", col: 6 },
|
|
385
|
+
{ name: "producer", type: "text", label: "Виробник", col: 6 },
|
|
386
|
+
{ name: "category", type: "text", label: "Категорія", col: 6 },
|
|
387
|
+
{ name: "license", type: "text", label: "Ліцензія", col: 6 },
|
|
388
|
+
{ name: "year", type: "number", label: "Рік", col: 6 },
|
|
389
|
+
{ name: "service_url", type: "text", label: "URL сервісу", col: 12 },
|
|
390
|
+
{ name: "metadata_url", type: "text", label: "Metadata URL", col: 12 },
|
|
391
|
+
{ name: "thumbnail_url", type: "text", label: "Thumbnail URL", col: 12 },
|
|
392
|
+
{ name: "query", type: "textarea", label: "SQL / Query", col: 12 }
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
raster: {
|
|
396
|
+
general: [
|
|
397
|
+
{ label: "Статус", value: (e) => l.normalizeValue(l.statusLabel(e)) },
|
|
398
|
+
{ label: "Видимість", value: (e) => l.normalizeValue(l.visibilityLabel(e)) },
|
|
399
|
+
{ label: "Формат", value: (e) => l.normalizeValue(e == null ? void 0 : e.extension) },
|
|
400
|
+
{ label: "SRID", value: (e) => l.normalizeValue(e == null ? void 0 : e.srid) },
|
|
401
|
+
{ label: "Файл джерела", value: (e) => l.normalizeValue(e == null ? void 0 : e.source_path) },
|
|
402
|
+
{ label: "Кеш", value: (e) => M(e == null ? void 0 : e.cache) },
|
|
403
|
+
{ label: "XML", value: (e) => M(e == null ? void 0 : e.xml) }
|
|
404
|
+
],
|
|
405
|
+
meta: [
|
|
406
|
+
{ label: "Bounds", value: (e) => m(e) },
|
|
407
|
+
{ label: "Розмір", value: (e) => l.normalizeValue(e == null ? void 0 : e.total_size) },
|
|
408
|
+
{ label: "Ширина", value: (e) => l.normalizeValue(e == null ? void 0 : e.width) },
|
|
409
|
+
{ label: "Висота", value: (e) => l.normalizeValue(e == null ? void 0 : e.height) },
|
|
410
|
+
{ label: "Кількість каналів", value: (e) => l.normalizeValue(e == null ? void 0 : e.bands_count) },
|
|
411
|
+
{ label: "Канали", value: (e) => _(e) },
|
|
412
|
+
{ label: "Роздільна здатність", value: (e) => l.normalizeValue(e == null ? void 0 : e.resolution) },
|
|
413
|
+
{ label: "Глибина кольору", value: (e) => l.normalizeValue(e == null ? void 0 : e.color_depth) },
|
|
414
|
+
{ label: "Стиснення", value: (e) => l.normalizeValue(e == null ? void 0 : e.compression) },
|
|
415
|
+
{ label: "Proj4", value: (e) => l.normalizeValue(e == null ? void 0 : e.proj4) }
|
|
416
|
+
],
|
|
417
|
+
edit: [
|
|
418
|
+
{
|
|
419
|
+
name: "description",
|
|
420
|
+
type: "textarea",
|
|
421
|
+
label: "Опис",
|
|
422
|
+
col: 12
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: "group_id",
|
|
426
|
+
type: "Autocomplete",
|
|
427
|
+
label: "Група",
|
|
428
|
+
data: "gis.group_list",
|
|
429
|
+
col: 6
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "is_public",
|
|
433
|
+
type: "switcher",
|
|
434
|
+
label: "Публічність",
|
|
435
|
+
col: 6,
|
|
436
|
+
data: "yes_no"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: "is_active",
|
|
440
|
+
type: "switcher",
|
|
441
|
+
label: "Активність",
|
|
442
|
+
col: 6,
|
|
443
|
+
data: "yes_no"
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
css: {
|
|
448
|
+
general: [
|
|
449
|
+
{ label: "Група", value: (e) => l.normalizeValue((e == null ? void 0 : e.group_name) ?? l.resolvedGroupName ?? (e == null ? void 0 : e.group_id)) },
|
|
450
|
+
{ label: "Статус", value: (e) => l.normalizeValue(l.statusLabel(e)) },
|
|
451
|
+
{ label: "Видимість", value: (e) => l.normalizeValue(l.visibilityLabel(e)) },
|
|
452
|
+
{ label: "Ключ CartoCSS", value: (e) => l.normalizeValue(e == null ? void 0 : e.cartocss_key) },
|
|
453
|
+
{ label: "Таблиця джерела", value: (e) => i(e, "table") || l.normalizeValue(e == null ? void 0 : e.source_path) },
|
|
454
|
+
{ label: "Ключ набору", value: (e) => i(e, "key") },
|
|
455
|
+
{ label: "Авто-картка", value: (e) => M(e == null ? void 0 : e.card_auto) },
|
|
456
|
+
{ label: "Інфо по кліку", value: (e) => M(e == null ? void 0 : e.info) },
|
|
457
|
+
{ label: "Статичний", value: (e) => M(e == null ? void 0 : e.is_static) }
|
|
458
|
+
],
|
|
459
|
+
meta: [
|
|
460
|
+
{ label: "Bounds", value: (e) => y(e) }
|
|
461
|
+
],
|
|
462
|
+
edit: [
|
|
463
|
+
{
|
|
464
|
+
name: "description",
|
|
465
|
+
type: "textarea",
|
|
466
|
+
label: "Опис",
|
|
467
|
+
col: 12
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "group_id",
|
|
471
|
+
type: "Autocomplete",
|
|
472
|
+
label: "Група",
|
|
473
|
+
data: "gis.group_list",
|
|
474
|
+
col: 6
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "is_public",
|
|
478
|
+
type: "switcher",
|
|
479
|
+
label: "Публічність",
|
|
480
|
+
col: 6,
|
|
481
|
+
data: "yes_no"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: "enabled",
|
|
485
|
+
type: "switcher",
|
|
486
|
+
label: "Активність",
|
|
487
|
+
col: 6,
|
|
488
|
+
data: "yes_no"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: "is_static",
|
|
492
|
+
type: "switcher",
|
|
493
|
+
label: "Статичний",
|
|
494
|
+
col: 6,
|
|
495
|
+
data: "yes_no"
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
const ct = { class: "flex-1 overflow-y-auto p-4" }, dt = { class: "space-y-4" }, vt = { class: "border border-gray-200 rounded-lg p-4" }, pt = {
|
|
502
|
+
key: 0,
|
|
503
|
+
class: "grid grid-cols-2 gap-2"
|
|
504
|
+
}, bt = { class: "text-xs text-gray-500 mb-1" }, ft = { class: "text-sm font-semibold text-gray-900" }, mt = {
|
|
505
|
+
key: 1,
|
|
506
|
+
class: "text-sm text-gray-700 leading-relaxed"
|
|
507
|
+
}, gt = { class: "border border-gray-200 rounded-lg p-4" }, yt = { class: "text-sm text-gray-700 leading-relaxed" }, ht = { class: "border border-gray-200 rounded-lg p-4" }, xt = { class: "flex items-center justify-between mb-3" }, _t = { class: "text-xs text-gray-500 mb-1" }, wt = { class: "text-sm font-semibold text-gray-900" }, kt = {
|
|
508
|
+
key: 1,
|
|
509
|
+
class: "text-sm text-gray-700 leading-relaxed"
|
|
510
|
+
}, Ct = { class: "border border-gray-200 rounded-lg p-4" }, zt = { class: "flex justify-end gap-2 px-4 py-3 border-t border-gray-100 w-full" }, $t = ["disabled"], Vt = ["disabled"], H = "-", Qt = /* @__PURE__ */ I({
|
|
511
|
+
__name: "MetaDataTab",
|
|
512
|
+
props: {
|
|
513
|
+
data: {},
|
|
514
|
+
entityId: {},
|
|
515
|
+
entityType: {}
|
|
516
|
+
},
|
|
517
|
+
emits: ["saved", "editCssBounds"],
|
|
518
|
+
setup(l, { emit: f }) {
|
|
519
|
+
const n = re(() => import("@opengis/core").then((t) => t.VsModal)), x = re(() => import("@opengis/form")), i = l, y = f, m = h(null);
|
|
520
|
+
async function _(t) {
|
|
521
|
+
var r;
|
|
522
|
+
try {
|
|
523
|
+
const c = await fetch("/api/suggest/gis.group_list");
|
|
524
|
+
if (!c.ok) return null;
|
|
525
|
+
const O = (r = (await c.json()).data) == null ? void 0 : r.find((q) => String(q.id) === String(t));
|
|
526
|
+
return (O == null ? void 0 : O.text) ?? null;
|
|
527
|
+
} catch {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
ce(
|
|
532
|
+
() => i.data,
|
|
533
|
+
async (t) => {
|
|
534
|
+
if (m.value = null, (t == null ? void 0 : t.group_id) != null) {
|
|
535
|
+
const r = await _(String(t.group_id));
|
|
536
|
+
m.value = r;
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
{ immediate: !0 }
|
|
540
|
+
);
|
|
541
|
+
function M(t) {
|
|
542
|
+
if (!t || typeof t != "string") return H;
|
|
543
|
+
try {
|
|
544
|
+
const r = new Date(t);
|
|
545
|
+
return Number.isNaN(r.getTime()) ? H : r.toLocaleDateString("uk-UA", {
|
|
546
|
+
day: "numeric",
|
|
547
|
+
month: "long",
|
|
548
|
+
year: "numeric"
|
|
549
|
+
});
|
|
550
|
+
} catch {
|
|
551
|
+
return H;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
function o(t) {
|
|
555
|
+
return typeof (t == null ? void 0 : t.is_active) == "boolean" ? t.is_active ? "Активний" : "Неактивний" : typeof (t == null ? void 0 : t.enabled) == "boolean" ? t.enabled ? "Активний" : "Неактивний" : H;
|
|
556
|
+
}
|
|
557
|
+
function C(t) {
|
|
558
|
+
return typeof (t == null ? void 0 : t.is_public) != "boolean" ? H : t.is_public ? "Публічний" : "Приватний";
|
|
559
|
+
}
|
|
560
|
+
function e(t) {
|
|
561
|
+
if (t == null) return "";
|
|
562
|
+
if (Array.isArray(t)) return t.filter(Boolean).join(", ");
|
|
563
|
+
if (typeof t == "boolean") return t ? "Так" : "Ні";
|
|
564
|
+
if (typeof t == "object") return "";
|
|
565
|
+
const r = String(t).trim();
|
|
566
|
+
return r === "" ? "" : r;
|
|
567
|
+
}
|
|
568
|
+
function z(t, r) {
|
|
569
|
+
return r.map((c) => ({ label: c.label, value: c.value(t) })).filter((c) => c.value && c.value !== H);
|
|
570
|
+
}
|
|
571
|
+
const L = k(() => z(i.data, u().general)), R = k(() => {
|
|
572
|
+
var r;
|
|
573
|
+
const t = (r = i.data) == null ? void 0 : r.description;
|
|
574
|
+
return t != null && t !== "" ? t : H;
|
|
575
|
+
}), A = k(() => z(i.data, u().meta)), D = k(() => A.value.length === 1 ? "grid-cols-1" : "grid-cols-2"), F = k(() => i.entityType === "css" || i.entityType === "raster"), B = h(!1), N = h({}), S = h(null), v = h(!1);
|
|
576
|
+
function u() {
|
|
577
|
+
const t = ut({
|
|
578
|
+
resolvedGroupName: m.value,
|
|
579
|
+
normalizeValue: e,
|
|
580
|
+
statusLabel: o,
|
|
581
|
+
visibilityLabel: C,
|
|
582
|
+
formatDate: M
|
|
583
|
+
});
|
|
584
|
+
return t[i.entityType || "service"] || t.service;
|
|
585
|
+
}
|
|
586
|
+
const V = k(() => u().edit);
|
|
587
|
+
function T() {
|
|
588
|
+
const t = i.data, r = {};
|
|
589
|
+
u().edit.forEach((c) => {
|
|
590
|
+
switch (c.name) {
|
|
591
|
+
case "group_id":
|
|
592
|
+
r.group_id = (t == null ? void 0 : t.group_id) != null ? String(t.group_id) : "";
|
|
593
|
+
break;
|
|
594
|
+
case "producer":
|
|
595
|
+
r.producer = (t == null ? void 0 : t.holder) ?? (t == null ? void 0 : t.producer) ?? "";
|
|
596
|
+
break;
|
|
597
|
+
case "keywords":
|
|
598
|
+
r.keywords = Array.isArray(t == null ? void 0 : t.keywords) ? [...t.keywords] : [];
|
|
599
|
+
break;
|
|
600
|
+
case "is_public":
|
|
601
|
+
r.is_public = (t == null ? void 0 : t.is_public) ?? !1;
|
|
602
|
+
break;
|
|
603
|
+
case "is_active":
|
|
604
|
+
r.is_active = typeof (t == null ? void 0 : t.is_active) == "boolean" ? t.is_active : (t == null ? void 0 : t.enabled) ?? !1;
|
|
605
|
+
break;
|
|
606
|
+
case "enabled":
|
|
607
|
+
r.enabled = (t == null ? void 0 : t.enabled) ?? (t == null ? void 0 : t.is_active) ?? !1;
|
|
608
|
+
break;
|
|
609
|
+
case "info":
|
|
610
|
+
r.info = (t == null ? void 0 : t.info) ?? !1;
|
|
611
|
+
break;
|
|
612
|
+
case "is_static":
|
|
613
|
+
r.is_static = (t == null ? void 0 : t.is_static) ?? !1;
|
|
614
|
+
break;
|
|
615
|
+
case "card_auto":
|
|
616
|
+
r.card_auto = (t == null ? void 0 : t.card_auto) ?? !1;
|
|
617
|
+
break;
|
|
618
|
+
default:
|
|
619
|
+
r[c.name] = (t == null ? void 0 : t[c.name]) ?? "";
|
|
620
|
+
break;
|
|
621
|
+
}
|
|
622
|
+
}), N.value = r, S.value = null, B.value = !0;
|
|
623
|
+
}
|
|
624
|
+
function te() {
|
|
625
|
+
y("editCssBounds");
|
|
626
|
+
}
|
|
627
|
+
function le(t) {
|
|
628
|
+
return i.entityType === "raster" && t === "Bounds";
|
|
629
|
+
}
|
|
630
|
+
async function ae() {
|
|
631
|
+
var t, r;
|
|
632
|
+
if (!(!i.entityId || !i.entityType)) {
|
|
633
|
+
if (S.value) {
|
|
634
|
+
const c = (r = (t = S.value).validate) == null ? void 0 : r.call(t);
|
|
635
|
+
if (c) {
|
|
636
|
+
W({
|
|
637
|
+
type: "warning",
|
|
638
|
+
title: "Валідація",
|
|
639
|
+
message: Object.entries(c).map(([Z, O]) => `${Z}: ${O}`).join(`
|
|
640
|
+
`)
|
|
641
|
+
});
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
v.value = !0;
|
|
646
|
+
try {
|
|
647
|
+
const c = new Set(V.value.map((P) => P.name)), Z = Object.fromEntries(
|
|
648
|
+
Object.entries(N.value).filter(([P]) => c.has(P))
|
|
649
|
+
), O = i.entityType === "css" ? {
|
|
650
|
+
url: `/api/gis-css/${encodeURIComponent(i.entityId)}`,
|
|
651
|
+
method: "POST"
|
|
652
|
+
} : {
|
|
653
|
+
url: `/api/gis-metadata/${encodeURIComponent(i.entityType)}/${encodeURIComponent(i.entityId)}`,
|
|
654
|
+
method: "POST"
|
|
655
|
+
}, q = await fetch(O.url, {
|
|
656
|
+
method: O.method,
|
|
657
|
+
headers: { "Content-Type": "application/json" },
|
|
658
|
+
body: JSON.stringify(Z)
|
|
659
|
+
});
|
|
660
|
+
if (!q.ok) throw new Error(`Failed to save metadata: ${q.status}`);
|
|
661
|
+
W({ type: "success", title: "Збережено", message: "Метадані оновлено" }), B.value = !1, y("saved");
|
|
662
|
+
} catch (c) {
|
|
663
|
+
console.error("Failed to save metadata", c), W({ type: "error", title: "Помилка", message: "Не вдалося зберегти метадані" });
|
|
664
|
+
} finally {
|
|
665
|
+
v.value = !1;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
return (t, r) => (s(), b("div", ct, [
|
|
670
|
+
a("div", dt, [
|
|
671
|
+
a("div", vt, [
|
|
672
|
+
a("div", { class: "flex items-center justify-between mb-3" }, [
|
|
673
|
+
r[5] || (r[5] = a("h2", { class: "text-xs font-semibold text-gray-500 uppercase tracking-wider" }, " Загальна інформація ", -1)),
|
|
674
|
+
a("button", {
|
|
675
|
+
type: "button",
|
|
676
|
+
onClick: T,
|
|
677
|
+
class: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors bg-sky-50 text-sky-600 hover:bg-sky-100"
|
|
678
|
+
}, [...r[4] || (r[4] = [
|
|
679
|
+
a("svg", {
|
|
680
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
681
|
+
class: "h-3.5 w-3.5",
|
|
682
|
+
fill: "none",
|
|
683
|
+
viewBox: "0 0 24 24",
|
|
684
|
+
stroke: "currentColor",
|
|
685
|
+
"stroke-width": "2"
|
|
686
|
+
}, [
|
|
687
|
+
a("path", {
|
|
688
|
+
"stroke-linecap": "round",
|
|
689
|
+
"stroke-linejoin": "round",
|
|
690
|
+
d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"
|
|
691
|
+
})
|
|
692
|
+
], -1),
|
|
693
|
+
ye(" Редагувати ", -1)
|
|
694
|
+
])])
|
|
695
|
+
]),
|
|
696
|
+
L.value.length ? (s(), b("div", pt, [
|
|
697
|
+
(s(!0), b(X, null, K(L.value, (c) => (s(), b("div", {
|
|
698
|
+
key: c.label,
|
|
699
|
+
class: "bg-gray-50 rounded-md p-2 border border-gray-100"
|
|
700
|
+
}, [
|
|
701
|
+
a("p", bt, $(c.label), 1),
|
|
702
|
+
a("p", ft, $(c.value), 1)
|
|
703
|
+
]))), 128))
|
|
704
|
+
])) : (s(), b("p", mt, $(H)))
|
|
705
|
+
]),
|
|
706
|
+
a("div", gt, [
|
|
707
|
+
r[6] || (r[6] = a("h2", { class: "text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3" }, " Повний опис ", -1)),
|
|
708
|
+
a("p", yt, $(R.value), 1)
|
|
709
|
+
]),
|
|
710
|
+
a("div", ht, [
|
|
711
|
+
a("div", xt, [
|
|
712
|
+
r[8] || (r[8] = a("h2", { class: "text-xs font-semibold text-gray-500 uppercase tracking-wider" }, " Метадані ", -1)),
|
|
713
|
+
F.value ? (s(), b("button", {
|
|
714
|
+
key: 0,
|
|
715
|
+
type: "button",
|
|
716
|
+
class: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium transition-colors bg-sky-50 text-sky-600 hover:bg-sky-100",
|
|
717
|
+
onClick: te
|
|
718
|
+
}, [...r[7] || (r[7] = [
|
|
719
|
+
a("svg", {
|
|
720
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
721
|
+
class: "h-3.5 w-3.5",
|
|
722
|
+
fill: "none",
|
|
723
|
+
viewBox: "0 0 24 24",
|
|
724
|
+
stroke: "currentColor",
|
|
725
|
+
"stroke-width": "2"
|
|
726
|
+
}, [
|
|
727
|
+
a("path", {
|
|
728
|
+
"stroke-linecap": "round",
|
|
729
|
+
"stroke-linejoin": "round",
|
|
730
|
+
d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"
|
|
731
|
+
})
|
|
732
|
+
], -1),
|
|
733
|
+
ye(" Редагувати ", -1)
|
|
734
|
+
])])) : G("", !0)
|
|
735
|
+
]),
|
|
736
|
+
A.value.length ? (s(), b("div", {
|
|
737
|
+
key: 0,
|
|
738
|
+
class: ee([D.value, "grid gap-2"])
|
|
739
|
+
}, [
|
|
740
|
+
(s(!0), b(X, null, K(A.value, (c) => (s(), b("div", {
|
|
741
|
+
key: c.label,
|
|
742
|
+
class: ee(["bg-gray-50 rounded-md p-2 border border-gray-100", { "col-span-2": le(c.label) }])
|
|
743
|
+
}, [
|
|
744
|
+
a("p", _t, $(c.label), 1),
|
|
745
|
+
a("p", wt, $(c.value), 1)
|
|
746
|
+
], 2))), 128))
|
|
747
|
+
], 2)) : (s(), b("p", kt, $(H)))
|
|
748
|
+
]),
|
|
749
|
+
a("div", Ct, [
|
|
750
|
+
r[9] || (r[9] = a("div", { class: "flex items-center justify-between mb-3" }, [
|
|
751
|
+
a("h2", { class: "text-xs font-semibold text-gray-500 uppercase tracking-wider" }, " Доступи ")
|
|
752
|
+
], -1)),
|
|
753
|
+
j(it, {
|
|
754
|
+
"service-id": l.entityId,
|
|
755
|
+
limit: 8
|
|
756
|
+
}, null, 8, ["service-id"])
|
|
757
|
+
])
|
|
758
|
+
]),
|
|
759
|
+
j(U(n), {
|
|
760
|
+
teleport: "#modal",
|
|
761
|
+
visible: B.value,
|
|
762
|
+
"onUpdate:visible": r[3] || (r[3] = (c) => B.value = c),
|
|
763
|
+
title: "Редагування метаданих",
|
|
764
|
+
size: "lg"
|
|
765
|
+
}, {
|
|
766
|
+
footer: Q(() => [
|
|
767
|
+
a("div", zt, [
|
|
768
|
+
a("button", {
|
|
769
|
+
type: "button",
|
|
770
|
+
class: "px-4 py-2 rounded bg-gray-100 text-gray-700 text-sm",
|
|
771
|
+
disabled: v.value,
|
|
772
|
+
onClick: r[2] || (r[2] = (c) => B.value = !1)
|
|
773
|
+
}, " Скасувати ", 8, $t),
|
|
774
|
+
a("button", {
|
|
775
|
+
type: "button",
|
|
776
|
+
class: "px-4 py-2 rounded bg-blue-600 text-white text-sm",
|
|
777
|
+
disabled: v.value,
|
|
778
|
+
onClick: ae
|
|
779
|
+
}, $(v.value ? "Збереження…" : "Зберегти"), 9, Vt)
|
|
780
|
+
])
|
|
781
|
+
]),
|
|
782
|
+
default: Q(() => [
|
|
783
|
+
j(U(x), {
|
|
784
|
+
values: N.value,
|
|
785
|
+
"onUpdate:values": r[0] || (r[0] = (c) => N.value = c),
|
|
786
|
+
form: S.value,
|
|
787
|
+
"onUpdate:form": r[1] || (r[1] = (c) => S.value = c),
|
|
788
|
+
schema: V.value
|
|
789
|
+
}, null, 8, ["values", "form", "schema"])
|
|
790
|
+
]),
|
|
791
|
+
_: 1
|
|
792
|
+
}, 8, ["visible"])
|
|
793
|
+
]));
|
|
794
|
+
}
|
|
795
|
+
}), St = ["href"], Mt = ["href"], Et = ["href"], Bt = {
|
|
796
|
+
key: 0,
|
|
797
|
+
class: "py-6 px-4 text-sm text-gray-500"
|
|
798
|
+
}, Tt = {
|
|
799
|
+
key: 1,
|
|
800
|
+
class: "py-6 px-4 text-sm text-red-600"
|
|
801
|
+
}, Lt = { class: "flex justify-end gap-2 px-4 py-3 border-t border-gray-100 w-full" }, Ut = ["disabled"], jt = ["disabled"], Nt = 192, _e = 8, Y = 8, Zt = /* @__PURE__ */ I({
|
|
802
|
+
__name: "HeaderActions",
|
|
803
|
+
props: {
|
|
804
|
+
entityId: {},
|
|
805
|
+
entityInfo: {},
|
|
806
|
+
table: {},
|
|
807
|
+
formEndpoint: {},
|
|
808
|
+
saveEndpoint: {},
|
|
809
|
+
entityLabel: {},
|
|
810
|
+
editButtonText: {},
|
|
811
|
+
saveMethod: {},
|
|
812
|
+
showXmlItem: { type: Boolean, default: !0 },
|
|
813
|
+
clearTilesHandler: {}
|
|
814
|
+
},
|
|
815
|
+
emits: ["saved"],
|
|
816
|
+
setup(l, { emit: f }) {
|
|
817
|
+
const n = l, x = f, i = re(
|
|
818
|
+
() => import("@opengis/core").then((d) => d.VsModal)
|
|
819
|
+
), y = re(() => import("@opengis/form")), m = h(!1), _ = h(null), M = h(null), o = h(null), C = h(null), e = k(() => C.value ? {
|
|
820
|
+
position: "fixed",
|
|
821
|
+
top: `${C.value.top}px`,
|
|
822
|
+
left: `${C.value.left}px`
|
|
823
|
+
} : {});
|
|
824
|
+
ce(m, (d) => {
|
|
825
|
+
d && Te(se);
|
|
826
|
+
});
|
|
827
|
+
const z = h(!1), L = h(null), R = h({}), A = h(null), D = h(""), F = h(!1), B = h(!1), N = h(null), S = k(() => n.entityId || ""), v = (d, p) => d ? typeof d == "function" ? d(p) : typeof d != "string" ? "" : d.includes(":id") ? p ? d.replace(":id", encodeURIComponent(p)) : "" : d : "", u = k(() => {
|
|
828
|
+
var d;
|
|
829
|
+
return (d = n.table) == null ? void 0 : d.trim();
|
|
830
|
+
}), V = k(() => {
|
|
831
|
+
if (n.formEndpoint) return n.formEndpoint;
|
|
832
|
+
if (u.value)
|
|
833
|
+
return (d) => `/api/form/${u.value}/${d}`;
|
|
834
|
+
}), T = k(() => {
|
|
835
|
+
if (n.saveEndpoint) return n.saveEndpoint;
|
|
836
|
+
if (u.value)
|
|
837
|
+
return (d) => `/api/table/${d}`;
|
|
838
|
+
}), te = k(
|
|
839
|
+
() => v(V.value, S.value)
|
|
840
|
+
), le = k(() => n.saveEndpoint ? v(n.saveEndpoint, S.value) : N.value ? `/api/table/${encodeURIComponent(N.value)}` : v(T.value, S.value)), ae = k(
|
|
841
|
+
() => v("/api/gis-clear-rtile/:id", S.value)
|
|
842
|
+
), t = k(
|
|
843
|
+
() => v("/api/gis-xml/:id", S.value)
|
|
844
|
+
), r = k(
|
|
845
|
+
() => v("/api/gis-pretile/:id?zoom=10&max=12", S.value)
|
|
846
|
+
), c = k(() => {
|
|
847
|
+
var w, E, g;
|
|
848
|
+
const d = (E = (w = n.entityInfo) == null ? void 0 : w.name) == null ? void 0 : E.trim();
|
|
849
|
+
if (d) return `Редагування ${d}`;
|
|
850
|
+
const p = (g = n.entityLabel) == null ? void 0 : g.trim();
|
|
851
|
+
return p ? `Редагування ${p}` : "Редагування";
|
|
852
|
+
}), Z = k(() => n.editButtonText || "Редагувати"), O = k(() => (n.saveMethod || "POST").toUpperCase());
|
|
853
|
+
function q() {
|
|
854
|
+
m.value || se(), m.value = !m.value;
|
|
855
|
+
}
|
|
856
|
+
function P() {
|
|
857
|
+
m.value = !1;
|
|
858
|
+
}
|
|
859
|
+
async function ze() {
|
|
860
|
+
const d = n.clearTilesHandler;
|
|
861
|
+
!d || !S.value || (P(), await d(S.value));
|
|
862
|
+
}
|
|
863
|
+
function se() {
|
|
864
|
+
var ge;
|
|
865
|
+
if (typeof window > "u" || !M.value) return;
|
|
866
|
+
const d = M.value.getBoundingClientRect(), p = window.innerWidth, w = window.innerHeight, E = d.left, g = Math.max(
|
|
867
|
+
p - Nt - Y,
|
|
868
|
+
Y
|
|
869
|
+
), ie = Math.min(Math.max(E, Y), g), ue = ((ge = o.value) == null ? void 0 : ge.offsetHeight) ?? 0, fe = d.bottom + _e;
|
|
870
|
+
let me = fe;
|
|
871
|
+
if (ue && fe + ue > w - Y) {
|
|
872
|
+
const Se = d.top - _e - ue;
|
|
873
|
+
me = Math.max(Se, Y);
|
|
874
|
+
}
|
|
875
|
+
C.value = { top: me, left: ie };
|
|
876
|
+
}
|
|
877
|
+
function pe(d) {
|
|
878
|
+
var w, E;
|
|
879
|
+
if (!_.value && !o.value) return;
|
|
880
|
+
const p = d.target;
|
|
881
|
+
p && ((w = _.value) != null && w.contains(p) || (E = o.value) != null && E.contains(p)) || (m.value = !1);
|
|
882
|
+
}
|
|
883
|
+
function oe() {
|
|
884
|
+
m.value && se();
|
|
885
|
+
}
|
|
886
|
+
ne(() => {
|
|
887
|
+
window.addEventListener("click", pe), window.addEventListener("resize", oe), window.addEventListener("scroll", oe, !0);
|
|
888
|
+
}), Le(() => {
|
|
889
|
+
window.removeEventListener("click", pe), window.removeEventListener("resize", oe), window.removeEventListener("scroll", oe, !0);
|
|
890
|
+
});
|
|
891
|
+
async function $e() {
|
|
892
|
+
var d, p, w;
|
|
893
|
+
if (!(!S.value || !te.value)) {
|
|
894
|
+
P(), z.value = !0, F.value = !0, D.value = "", L.value = null, R.value = {}, N.value = null;
|
|
895
|
+
try {
|
|
896
|
+
const E = await fetch(te.value);
|
|
897
|
+
if (!E.ok)
|
|
898
|
+
throw new Error(`Failed to load form: ${E.status}`);
|
|
899
|
+
const g = await E.json();
|
|
900
|
+
R.value = (g == null ? void 0 : g.data) || {}, L.value = (g == null ? void 0 : g.schema) || null;
|
|
901
|
+
const ie = typeof (g == null ? void 0 : g.token) == "string" && g.token || typeof ((d = g == null ? void 0 : g.tokens) == null ? void 0 : d.edit) == "string" && g.tokens.edit || typeof ((p = g == null ? void 0 : g.tokens) == null ? void 0 : p.edit_token) == "string" && g.tokens.edit_token || typeof ((w = g == null ? void 0 : g.data) == null ? void 0 : w.token) == "string" && g.data.token || null;
|
|
902
|
+
N.value = ie, A.value = null;
|
|
903
|
+
} catch (E) {
|
|
904
|
+
console.error("Failed to load edit form", E), D.value = "Не вдалося завантажити форму редагування";
|
|
905
|
+
} finally {
|
|
906
|
+
F.value = !1;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
function be() {
|
|
911
|
+
z.value = !1, L.value = null, D.value = "", N.value = null;
|
|
912
|
+
}
|
|
913
|
+
async function Ve() {
|
|
914
|
+
var d, p;
|
|
915
|
+
if (!(!S.value || !le.value)) {
|
|
916
|
+
if (A.value) {
|
|
917
|
+
const w = (p = (d = A.value).validate) == null ? void 0 : p.call(d);
|
|
918
|
+
if (w) {
|
|
919
|
+
W({
|
|
920
|
+
type: "warning",
|
|
921
|
+
title: "Validation",
|
|
922
|
+
message: Object.entries(w).map(([E, g]) => `${E}: ${g}`).join(`
|
|
923
|
+
`)
|
|
924
|
+
});
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
B.value = !0;
|
|
929
|
+
try {
|
|
930
|
+
const w = await fetch(le.value, {
|
|
931
|
+
method: O.value,
|
|
932
|
+
headers: { "Content-Type": "application/json" },
|
|
933
|
+
body: JSON.stringify(R.value)
|
|
934
|
+
});
|
|
935
|
+
if (!w.ok) throw new Error(`Failed to save: ${w.status}`);
|
|
936
|
+
W({
|
|
937
|
+
type: "success",
|
|
938
|
+
title: "Збережено",
|
|
939
|
+
message: "Зміни збережено"
|
|
940
|
+
}), x("saved", R.value), be();
|
|
941
|
+
} catch (w) {
|
|
942
|
+
console.error("Failed to save edit form", w), W({
|
|
943
|
+
type: "error",
|
|
944
|
+
title: "Помилка",
|
|
945
|
+
message: "Не вдалося зберегти зміни"
|
|
946
|
+
});
|
|
947
|
+
} finally {
|
|
948
|
+
B.value = !1;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return (d, p) => (s(), b("div", {
|
|
953
|
+
ref_key: "root",
|
|
954
|
+
ref: _,
|
|
955
|
+
class: "relative flex items-center"
|
|
956
|
+
}, [
|
|
957
|
+
a("button", {
|
|
958
|
+
ref_key: "triggerButton",
|
|
959
|
+
ref: M,
|
|
960
|
+
type: "button",
|
|
961
|
+
onClick: we(q, ["stop"]),
|
|
962
|
+
class: "flex items-center justify-center w-9 h-9 hover:rounded-md hover:border hover:border-gray-200 bg-white text-gray-600 hover:bg-gray-50 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500",
|
|
963
|
+
"aria-label": "Дії"
|
|
964
|
+
}, [...p[3] || (p[3] = [
|
|
965
|
+
a("svg", {
|
|
966
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
967
|
+
class: "h-5 w-5",
|
|
968
|
+
fill: "none",
|
|
969
|
+
viewBox: "0 0 24 24",
|
|
970
|
+
stroke: "currentColor"
|
|
971
|
+
}, [
|
|
972
|
+
a("path", {
|
|
973
|
+
"stroke-linecap": "round",
|
|
974
|
+
"stroke-linejoin": "round",
|
|
975
|
+
"stroke-width": "2",
|
|
976
|
+
d: "M12 5.5v.01M12 12v.01M12 18.5v.01"
|
|
977
|
+
})
|
|
978
|
+
], -1)
|
|
979
|
+
])], 512),
|
|
980
|
+
(s(), J(Ue, { to: "body" }, [
|
|
981
|
+
m.value ? (s(), b("div", {
|
|
982
|
+
key: 0,
|
|
983
|
+
ref_key: "menuContainer",
|
|
984
|
+
ref: o,
|
|
985
|
+
style: ke(e.value),
|
|
986
|
+
class: "absolute top-0 left-0 mt-2 w-48 rounded-xl border border-gray-200 bg-white shadow-lg text-sm z-[1000]"
|
|
987
|
+
}, [
|
|
988
|
+
ae.value || l.clearTilesHandler ? (s(), b(X, { key: 0 }, [
|
|
989
|
+
l.clearTilesHandler ? (s(), b("button", {
|
|
990
|
+
key: 0,
|
|
991
|
+
type: "button",
|
|
992
|
+
class: "flex items-center gap-2 w-full px-4 py-2 text-left text-gray-700 hover:bg-slate-50 hover:rounded-t-xl",
|
|
993
|
+
onClick: ze
|
|
994
|
+
}, [
|
|
995
|
+
j(U(he), {
|
|
996
|
+
size: 16,
|
|
997
|
+
class: "lucide lucide-brush-cleaning text-gray-500"
|
|
998
|
+
}),
|
|
999
|
+
p[4] || (p[4] = a("span", null, "Очистити тайли", -1))
|
|
1000
|
+
])) : (s(), b("a", {
|
|
1001
|
+
key: 1,
|
|
1002
|
+
href: ae.value,
|
|
1003
|
+
target: "_blank",
|
|
1004
|
+
rel: "noreferrer",
|
|
1005
|
+
class: "flex items-center gap-2 px-4 py-2 text-left text-gray-700 hover:bg-slate-50 hover:rounded-t-xl",
|
|
1006
|
+
onClick: P
|
|
1007
|
+
}, [
|
|
1008
|
+
j(U(he), {
|
|
1009
|
+
size: 16,
|
|
1010
|
+
class: "lucide lucide-brush-cleaning text-gray-500"
|
|
1011
|
+
}),
|
|
1012
|
+
p[5] || (p[5] = a("span", null, "Очистити тайли", -1))
|
|
1013
|
+
], 8, St))
|
|
1014
|
+
], 64)) : G("", !0),
|
|
1015
|
+
l.showXmlItem ? (s(), b("a", {
|
|
1016
|
+
key: 1,
|
|
1017
|
+
href: t.value,
|
|
1018
|
+
target: "_blank",
|
|
1019
|
+
rel: "noreferrer",
|
|
1020
|
+
class: "flex items-center gap-2 px-4 py-2 text-left text-gray-700 hover:bg-slate-50 hover:rounded-t-xl",
|
|
1021
|
+
onClick: P
|
|
1022
|
+
}, [
|
|
1023
|
+
j(U(xe), {
|
|
1024
|
+
size: 16,
|
|
1025
|
+
class: "lucide lucide-square-code text-gray-500"
|
|
1026
|
+
}),
|
|
1027
|
+
p[6] || (p[6] = a("span", null, "Створити XML", -1))
|
|
1028
|
+
], 8, Mt)) : G("", !0),
|
|
1029
|
+
l.showXmlItem ? (s(), b("a", {
|
|
1030
|
+
key: 2,
|
|
1031
|
+
href: r.value,
|
|
1032
|
+
target: "_blank",
|
|
1033
|
+
rel: "noreferrer",
|
|
1034
|
+
class: "flex items-center gap-2 px-4 py-2 text-left text-gray-700 hover:bg-slate-50 hover:rounded-t-xl",
|
|
1035
|
+
onClick: P
|
|
1036
|
+
}, [
|
|
1037
|
+
j(U(xe), {
|
|
1038
|
+
size: 16,
|
|
1039
|
+
class: "lucide lucide-square-code text-gray-500"
|
|
1040
|
+
}),
|
|
1041
|
+
p[7] || (p[7] = a("span", null, "Pretile", -1))
|
|
1042
|
+
], 8, Et)) : G("", !0),
|
|
1043
|
+
a("button", {
|
|
1044
|
+
type: "button",
|
|
1045
|
+
class: "flex items-center gap-2 w-full px-4 py-2 text-left text-gray-700 hover:bg-slate-50 hover:rounded-b-xl",
|
|
1046
|
+
onClick: $e
|
|
1047
|
+
}, [
|
|
1048
|
+
j(U(Re), {
|
|
1049
|
+
size: 16,
|
|
1050
|
+
class: "lucide lucide-pencil text-gray-500"
|
|
1051
|
+
}),
|
|
1052
|
+
a("span", null, $(Z.value), 1)
|
|
1053
|
+
])
|
|
1054
|
+
], 4)) : G("", !0)
|
|
1055
|
+
])),
|
|
1056
|
+
j(U(i), {
|
|
1057
|
+
teleport: "#modal",
|
|
1058
|
+
visible: z.value,
|
|
1059
|
+
"onUpdate:visible": p[2] || (p[2] = (w) => z.value = w),
|
|
1060
|
+
title: c.value,
|
|
1061
|
+
size: "lg"
|
|
1062
|
+
}, {
|
|
1063
|
+
footer: Q(() => [
|
|
1064
|
+
a("div", Lt, [
|
|
1065
|
+
a("button", {
|
|
1066
|
+
type: "button",
|
|
1067
|
+
class: "px-4 py-2 rounded bg-gray-100 text-gray-700",
|
|
1068
|
+
onClick: be,
|
|
1069
|
+
disabled: B.value
|
|
1070
|
+
}, " Скасувати ", 8, Ut),
|
|
1071
|
+
a("button", {
|
|
1072
|
+
type: "button",
|
|
1073
|
+
class: "px-4 py-2 rounded bg-blue-600 text-white",
|
|
1074
|
+
onClick: Ve,
|
|
1075
|
+
disabled: B.value
|
|
1076
|
+
}, $(B.value ? "Зберігається…" : "Зберегти"), 9, jt)
|
|
1077
|
+
])
|
|
1078
|
+
]),
|
|
1079
|
+
default: Q(() => [
|
|
1080
|
+
F.value ? (s(), b("div", Bt, " Завантаження форми редагування… ")) : D.value ? (s(), b("div", Tt, $(D.value), 1)) : (s(), J(U(y), {
|
|
1081
|
+
key: 2,
|
|
1082
|
+
values: R.value,
|
|
1083
|
+
"onUpdate:values": p[0] || (p[0] = (w) => R.value = w),
|
|
1084
|
+
form: A.value,
|
|
1085
|
+
"onUpdate:form": p[1] || (p[1] = (w) => A.value = w),
|
|
1086
|
+
schema: L.value
|
|
1087
|
+
}, null, 8, ["values", "form", "schema"]))
|
|
1088
|
+
]),
|
|
1089
|
+
_: 1
|
|
1090
|
+
}, 8, ["visible", "title"])
|
|
1091
|
+
], 512));
|
|
1092
|
+
}
|
|
1093
|
+
}), At = ["title", "aria-label", "disabled"], Rt = {
|
|
1094
|
+
key: 0,
|
|
1095
|
+
class: "absolute right-full mr-3 px-1.5 py-0.5 bg-gray-700 text-white text-[0.75rem] font-medium rounded-md opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 pointer-events-none transition-opacity duration-200 whitespace-nowrap",
|
|
1096
|
+
"aria-hidden": "true"
|
|
1097
|
+
}, ve = /* @__PURE__ */ I({
|
|
1098
|
+
__name: "MapIconButton",
|
|
1099
|
+
props: {
|
|
1100
|
+
title: {},
|
|
1101
|
+
ariaLabel: { default: "" },
|
|
1102
|
+
tooltip: { default: "" },
|
|
1103
|
+
active: { type: Boolean, default: !1 },
|
|
1104
|
+
disabled: { type: Boolean, default: !1 }
|
|
1105
|
+
},
|
|
1106
|
+
emits: ["click"],
|
|
1107
|
+
setup(l) {
|
|
1108
|
+
const f = l, n = k(() => [
|
|
1109
|
+
"group relative flex items-center justify-center w-9 h-9 rounded-xl shadow-lg transition-transform transition-shadow duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400/60 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100",
|
|
1110
|
+
f.active ? "bg-blue-50 text-blue-700 ring-1 ring-blue-300" : "bg-white text-gray-700 hover:bg-gray-50"
|
|
1111
|
+
].join(" "));
|
|
1112
|
+
return (x, i) => (s(), b("button", {
|
|
1113
|
+
type: "button",
|
|
1114
|
+
class: ee(n.value),
|
|
1115
|
+
title: l.title,
|
|
1116
|
+
"aria-label": l.ariaLabel || l.title,
|
|
1117
|
+
disabled: l.disabled,
|
|
1118
|
+
onClick: i[0] || (i[0] = we((y) => x.$emit("click", y), ["stop"]))
|
|
1119
|
+
}, [
|
|
1120
|
+
l.tooltip ? (s(), b("span", Rt, $(l.tooltip), 1)) : G("", !0),
|
|
1121
|
+
Ce(x.$slots, "default")
|
|
1122
|
+
], 10, At));
|
|
1123
|
+
}
|
|
1124
|
+
}), qt = /* @__PURE__ */ I({
|
|
1125
|
+
__name: "MapZoomInButton",
|
|
1126
|
+
setup(l) {
|
|
1127
|
+
const { map: f, ready: n } = de(), x = h(!1);
|
|
1128
|
+
ne(async () => {
|
|
1129
|
+
await (n == null ? void 0 : n()), x.value = !!f.value;
|
|
1130
|
+
});
|
|
1131
|
+
function i() {
|
|
1132
|
+
const y = f.value;
|
|
1133
|
+
y != null && y.zoomIn && y.zoomIn();
|
|
1134
|
+
}
|
|
1135
|
+
return (y, m) => (s(), J(ve, {
|
|
1136
|
+
title: "Збільшити",
|
|
1137
|
+
tooltip: "Плюс зум",
|
|
1138
|
+
disabled: !x.value,
|
|
1139
|
+
onClick: i
|
|
1140
|
+
}, {
|
|
1141
|
+
default: Q(() => [
|
|
1142
|
+
j(U(Fe), { class: "w-4 h-4" })
|
|
1143
|
+
]),
|
|
1144
|
+
_: 1
|
|
1145
|
+
}, 8, ["disabled"]));
|
|
1146
|
+
}
|
|
1147
|
+
}), Xt = /* @__PURE__ */ I({
|
|
1148
|
+
__name: "MapZoomOutButton",
|
|
1149
|
+
setup(l) {
|
|
1150
|
+
const { map: f, ready: n } = de(), x = h(!1);
|
|
1151
|
+
ne(async () => {
|
|
1152
|
+
await (n == null ? void 0 : n()), x.value = !!f.value;
|
|
1153
|
+
});
|
|
1154
|
+
function i() {
|
|
1155
|
+
const y = f.value;
|
|
1156
|
+
y != null && y.zoomOut && y.zoomOut();
|
|
1157
|
+
}
|
|
1158
|
+
return (y, m) => (s(), J(ve, {
|
|
1159
|
+
title: "Зменшити",
|
|
1160
|
+
tooltip: "Мінус зум",
|
|
1161
|
+
disabled: !x.value,
|
|
1162
|
+
onClick: i
|
|
1163
|
+
}, {
|
|
1164
|
+
default: Q(() => [
|
|
1165
|
+
j(U(Oe), { class: "w-4 h-4" })
|
|
1166
|
+
]),
|
|
1167
|
+
_: 1
|
|
1168
|
+
}, 8, ["disabled"]));
|
|
1169
|
+
}
|
|
1170
|
+
}), Wt = /* @__PURE__ */ I({
|
|
1171
|
+
__name: "MapCompassButton",
|
|
1172
|
+
setup(l) {
|
|
1173
|
+
const { map: f, ready: n } = de(), x = h(!1), i = h(0), y = h(0), m = k(() => ({
|
|
1174
|
+
transform: `scale(${(1 + y.value / 70).toFixed(5)}) rotateZ(0deg) rotateX(${y.value}deg) rotateZ(${i.value}deg)`
|
|
1175
|
+
}));
|
|
1176
|
+
function _() {
|
|
1177
|
+
var C, e;
|
|
1178
|
+
const o = f.value;
|
|
1179
|
+
o && (i.value = Number(((C = o.getBearing) == null ? void 0 : C.call(o)) ?? 0), y.value = Number(((e = o.getPitch) == null ? void 0 : e.call(o)) ?? 0));
|
|
1180
|
+
}
|
|
1181
|
+
ne(async () => {
|
|
1182
|
+
var C, e, z;
|
|
1183
|
+
await (n == null ? void 0 : n());
|
|
1184
|
+
const o = f.value;
|
|
1185
|
+
x.value = !!o, _(), (C = o == null ? void 0 : o.on) == null || C.call(o, "rotate", _), (e = o == null ? void 0 : o.on) == null || e.call(o, "pitch", _), (z = o == null ? void 0 : o.on) == null || z.call(o, "load", _);
|
|
1186
|
+
}), je(() => {
|
|
1187
|
+
var C, e, z;
|
|
1188
|
+
const o = f.value;
|
|
1189
|
+
(C = o == null ? void 0 : o.off) == null || C.call(o, "rotate", _), (e = o == null ? void 0 : o.off) == null || e.call(o, "pitch", _), (z = o == null ? void 0 : o.off) == null || z.call(o, "load", _);
|
|
1190
|
+
});
|
|
1191
|
+
function M() {
|
|
1192
|
+
const o = f.value;
|
|
1193
|
+
o != null && o.easeTo && o.easeTo({ bearing: 0, pitch: 0 });
|
|
1194
|
+
}
|
|
1195
|
+
return (o, C) => (s(), J(ve, {
|
|
1196
|
+
title: "Повернути орієнтацію",
|
|
1197
|
+
tooltip: "Компас",
|
|
1198
|
+
disabled: !x.value,
|
|
1199
|
+
onClick: M
|
|
1200
|
+
}, {
|
|
1201
|
+
default: Q(() => [
|
|
1202
|
+
j(U(Ie), {
|
|
1203
|
+
class: "w-4 h-4",
|
|
1204
|
+
"aria-hidden": "true",
|
|
1205
|
+
style: ke(m.value)
|
|
1206
|
+
}, null, 8, ["style"])
|
|
1207
|
+
]),
|
|
1208
|
+
_: 1
|
|
1209
|
+
}, 8, ["disabled"]));
|
|
1210
|
+
}
|
|
1211
|
+
}), Ft = { class: "absolute right-3 top-3 z-[450] flex flex-col gap-1 pointer-events-auto" }, Jt = /* @__PURE__ */ I({
|
|
1212
|
+
name: "MapToolbarRight",
|
|
1213
|
+
__name: "MapToolbarRight",
|
|
1214
|
+
setup(l) {
|
|
1215
|
+
return (f, n) => (s(), b("div", Ft, [
|
|
1216
|
+
Ce(f.$slots, "default")
|
|
1217
|
+
]));
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
export {
|
|
1221
|
+
Zt as _,
|
|
1222
|
+
Jt as a,
|
|
1223
|
+
qt as b,
|
|
1224
|
+
Xt as c,
|
|
1225
|
+
Wt as d,
|
|
1226
|
+
Ht as e,
|
|
1227
|
+
Qt as f,
|
|
1228
|
+
Gt as g,
|
|
1229
|
+
ve as h
|
|
1230
|
+
};
|