@opengis/gis 0.2.117 → 0.2.119

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.
Files changed (30) hide show
  1. package/dist/{CardIcon-FxpK90rl.js → CardIcon-ODZgA2Pb.js} +1 -1
  2. package/dist/EntityTablePage-UMttc2-F.js +281 -0
  3. package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-Bl5ZwNQX.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DLAIOHJh.js} +1 -1
  4. package/dist/{FileEdit-C7tteUeG.js → FileEdit-GikPLv1T.js} +1 -1
  5. package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-CKEep8BL.js → HeaderActions.vue_vue_type_script_setup_true_lang-CTKkmXWD.js} +1 -1
  6. package/dist/{MapSettings-CjJ7WWkn.js → MapSettings-CbW0TfZl.js} +2 -2
  7. package/dist/{MonacoEditor.vue_vue_type_script_setup_true_lang-Bs7gz6Lt.js → MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js} +92 -73
  8. package/dist/RastersTablePage-CXqscX0i.js +245 -0
  9. package/dist/{cartocss-C_O8qG3h.js → cartocss-306ZE1Ha.js} +6 -6
  10. package/dist/{import-utils-BbZ1gVp-.js → import-utils-CHIDSKHz.js} +1 -1
  11. package/dist/index-CbdZv1jy.js +10123 -0
  12. package/dist/index.css +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.umd.cjs +41 -41
  15. package/dist/{raster-Du8ZMtjf.js → raster-Cn6l0xfZ.js} +4 -4
  16. package/dist/{register-B2gF-GzA.js → register-4wblFcw2.js} +3 -3
  17. package/dist/{service-BnPCDVwm.js → service-2uWyAfnR.js} +6 -6
  18. package/dist/{vs-datatable-QKks38xL.js → vs-datatable-D_Xzh4qf.js} +1 -1
  19. package/module/test/cls/doc_status.json +31 -31
  20. package/module/test/select/core.user_uid.sql +1 -1
  21. package/package.json +1 -1
  22. package/server/plugins/mapnik/funcs/checkRasterFile.js +19 -18
  23. package/server/routes/mapnik/controllers/clearTiles.js +15 -7
  24. package/server/routes/mapnik/controllers/createXml.js +5 -4
  25. package/server/routes/mapnik/controllers/createXmlMulti.js +3 -2
  26. package/server/routes/mapnik/controllers/rasterInfo.js +5 -4
  27. package/server/routes/mapnik/controllers/rtile.js +2 -2
  28. package/dist/EntityTablePage-ii-Wz0YZ.js +0 -286
  29. package/dist/RastersTablePage-DpKkFOyo.js +0 -359
  30. package/dist/index-4aSsUBB8.js +0 -10020
@@ -1,286 +0,0 @@
1
- import { defineComponent as se, defineAsyncComponent as oe, computed as l, ref as i, onMounted as re, onBeforeUnmount as le, watch as A, openBlock as C, createElementBlock as k, createVNode as f, createSlots as ie, withCtx as _, createTextVNode as g, toDisplayString as y, unref as u, createCommentVNode as F, createElementVNode as o, withDirectives as ue, vModelText as ce, renderSlot as D } from "vue";
2
- import { RefreshCw as de, Plus as fe, Search as pe } from "lucide-vue-next";
3
- import { useRoute as me, useRouter as ge } from "vue-router";
4
- import { VsPagination as ve, notify as I } from "@opengis/core";
5
- import { Filter as he } from "@opengis/filter";
6
- import { F as ye } from "./FileEdit-C7tteUeG.js";
7
- import { _ as xe } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
8
- import { _ as be } from "./index-4aSsUBB8.js";
9
- const we = { class: "flex-1 flex flex-col bg-gray-50 h-screen overflow-hidden p-0 m-0" }, _e = {
10
- key: 0,
11
- href: "/api/gis-create-xml",
12
- target: "_blank",
13
- rel: "noreferrer",
14
- class: "flex h-[2rem] items-center gap-1.5 px-3 py-1.5 bg-slate-50 text-slate-700 rounded-md border border-slate-200 hover:bg-slate-100 transition-colors text-sm"
15
- }, $e = { class: "flex-1 px-4 sm:px-6 pb-4 overflow-y-auto overflow-x-visible" }, Se = { class: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-visible" }, Pe = { class: "p-3 border-b border-gray-200" }, Te = { class: "flex flex-col sm:flex-row gap-2" }, Ce = { class: "flex-1 relative" }, ke = ["placeholder"], Ee = { class: "entity-table-root" }, Re = { class: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800" }, ze = {
16
- key: 0,
17
- class: "gap-2 inline-flex"
18
- }, Fe = ["onClick"], Ne = {
19
- key: 0,
20
- class: "flex flex-col gap-3 border-t border-gray-200 px-4 py-3 sm:flex-row sm:items-center sm:justify-between bg-gray-50"
21
- }, je = { class: "text-sm text-gray-500" }, Be = { class: "font-medium text-gray-700" }, Ue = { class: "font-medium text-gray-700" }, Ve = { class: "font-medium text-gray-700" }, qe = { class: "flex items-center justify-end gap-3" }, Ae = /* @__PURE__ */ se({
22
- __name: "EntityTablePage",
23
- props: {
24
- entityKey: { default: "" },
25
- entityBasePath: { default: "" },
26
- columnsConfig: { default: () => [] }
27
- },
28
- setup(M) {
29
- const Q = oe(() => import("@opengis/table")), s = me(), $ = ge(), S = M, N = l(
30
- () => S.entityKey || String(s.name ?? "").split("-")[0]
31
- ), J = l(() => {
32
- var n;
33
- let e = (((n = s.matched[s.matched.length - 1]) == null ? void 0 : n.path) || s.path).replace(/\/:id\??\/:action\??$/, "").replace(/\/:id\??$/, "").replace(/\/:action\??$/, "");
34
- return e.startsWith("/") || (e = `/${e}`), e;
35
- }), E = l(() => S.entityBasePath || J.value), R = l(() => {
36
- var e;
37
- const t = ((e = s.matched[s.matched.length - 1]) == null ? void 0 : e.path) || "";
38
- return /:id\??/.test(t) && /:action\??/.test(t);
39
- }), P = l(() => {
40
- var e, n;
41
- return (e = s.meta) != null && e.title ? s.meta.title : s.name ? s.name : ((n = s.path) == null ? void 0 : n.replace(/^\//, "")) || "" || "GIS";
42
- }), j = l(() => {
43
- var t;
44
- return ((t = s.meta) == null ? void 0 : t.description) || "";
45
- }), K = l(() => {
46
- const t = String(P.value || "").trim();
47
- return t ? `Пошук ${t}...` : "Пошук...";
48
- }), x = i([]), b = i(!0), v = i([]), B = i([]), p = i({}), U = i([]), c = i(String(s.query.search ?? "")), r = i(Math.max(1, Number(s.query.page) || 1)), T = i(15), m = i(0);
49
- let w = null;
50
- const L = l(() => m.value > 0), O = l(() => m.value ? (r.value - 1) * T.value + 1 : 0), W = l(() => m.value ? Math.min(r.value * T.value, m.value) : 0);
51
- function G(t) {
52
- const e = new URLSearchParams();
53
- return Object.entries(t).forEach(([n, a]) => {
54
- if (!(a == null || a === "")) {
55
- if (Array.isArray(a)) {
56
- a.forEach((d) => {
57
- d != null && d !== "" && e.append(n, String(d));
58
- });
59
- return;
60
- }
61
- e.append(n, String(a));
62
- }
63
- }), e.toString();
64
- }
65
- function H() {
66
- return R.value ? `${E.value}/new` : s.name === "services" ? "/gis.datasets/new" : s.name === "group_list" ? "/gis.group/add" : `${s.path}/add`;
67
- }
68
- function X(t) {
69
- if (R.value)
70
- return `${E.value}/${t}/edit`;
71
- const e = String(s.name ?? "").split("_")[0];
72
- return e === "services" ? `/gis.datasets/${t}/edit` : `/gis.${e}/edit/${t}`;
73
- }
74
- const h = async () => {
75
- const t = `/api/data/gis.${N.value}.table`;
76
- if (!t) {
77
- x.value = [], b.value = !1;
78
- return;
79
- }
80
- try {
81
- b.value = !0;
82
- const e = G({
83
- ...p.value,
84
- page: r.value,
85
- limit: T.value
86
- }), n = await fetch(e ? `${t}?${e}` : t);
87
- if (!n.ok)
88
- throw new Error(`Rows fetch failed: ${n.status}`);
89
- const a = await n.json();
90
- x.value = a.rows || [], m.value = Number(a.filtered ?? a.total ?? a.count ?? x.value.length) || 0, v.value = S.columnsConfig.length ? S.columnsConfig : a.columns || [], B.value = a.filters || [], b.value = !1, U.value = a.actions, a.card !== !1 && v.value.length && (R.value ? v.value[0].link = `${E.value}/{id}` : v.value[0].link || (v.value[0].link = `/${s.name}/{id}`));
91
- } catch {
92
- x.value = [], b.value = !1;
93
- }
94
- };
95
- function Y(t) {
96
- p.value = t, r.value = 1, z(), h();
97
- }
98
- re(() => {
99
- h(), document.title = P.value;
100
- }), le(() => {
101
- w && clearTimeout(w);
102
- }), A(
103
- () => s.name,
104
- () => {
105
- r.value = 1, c.value = "", h(), document.title = P.value;
106
- }
107
- ), A(
108
- () => s.query,
109
- (t) => {
110
- const e = Math.max(1, Number(t.page) || 1), n = String(t.search ?? ""), a = e !== r.value, d = n !== c.value;
111
- !a && !d || (r.value = e, c.value = n, p.value = {
112
- ...p.value,
113
- search: n || void 0
114
- }, h());
115
- }
116
- );
117
- async function Z(t, e, n) {
118
- const a = await fetch(`/api/form/gis.${N.value}.table/${t.id}`);
119
- if (!a.ok) throw new Error(`Form fetch failed: ${a.status}`);
120
- const ae = (await a.json()).token, ne = { [e]: n }, q = await fetch(`/api/table/${ae}`, {
121
- method: "PUT",
122
- headers: { "Content-Type": "application/json" },
123
- body: JSON.stringify(ne)
124
- });
125
- if (!q.ok)
126
- throw I({
127
- type: "error",
128
- title: "Помилка збереження",
129
- message: `Поле "${e}" не оновлено`
130
- }), new Error(`Save failed: ${q.status}`);
131
- I({ title: "Збережено", message: `Поле "${e}" оновлено` });
132
- }
133
- function ee(t, e) {
134
- p.value = {
135
- ...p.value,
136
- [t]: e
137
- }, z(), h();
138
- }
139
- function te() {
140
- w && clearTimeout(w), w = setTimeout(() => {
141
- r.value = 1, ee("search", c.value);
142
- }, 250);
143
- }
144
- function V(t) {
145
- !t || t === r.value || (r.value = t, z(), h());
146
- }
147
- function z() {
148
- const t = {
149
- ...s.query,
150
- page: String(r.value),
151
- ...c.value ? { search: c.value } : {}
152
- };
153
- c.value || delete t.search, $.replace({ query: t });
154
- }
155
- return (t, e) => (C(), k("div", we, [
156
- f(xe, { variant: "table" }, ie({
157
- title: _(() => [
158
- g(y(P.value), 1)
159
- ]),
160
- actions: _(() => [
161
- u(s).name === "rasters" ? (C(), k("a", _e, [
162
- f(u(de), { size: 16 }),
163
- e[2] || (e[2] = g(" Оновити растри ", -1))
164
- ])) : F("", !0),
165
- o("a", {
166
- onClick: e[0] || (e[0] = (n) => u($).push(H())),
167
- class: "hover:cursor-pointer flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm"
168
- }, [
169
- f(u(fe), { size: 16 }),
170
- e[3] || (e[3] = g(" Додати ", -1))
171
- ])
172
- ]),
173
- _: 2
174
- }, [
175
- j.value ? {
176
- name: "description",
177
- fn: _(() => [
178
- g(y(j.value), 1)
179
- ]),
180
- key: "0"
181
- } : void 0
182
- ]), 1024),
183
- o("div", $e, [
184
- o("div", Se, [
185
- o("div", Pe, [
186
- o("div", Te, [
187
- o("div", Ce, [
188
- f(u(pe), {
189
- size: 16,
190
- class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
191
- }),
192
- ue(o("input", {
193
- "onUpdate:modelValue": e[1] || (e[1] = (n) => c.value = n),
194
- onInput: te,
195
- type: "text",
196
- placeholder: K.value,
197
- class: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
198
- }, null, 40, ke), [
199
- [ce, c.value]
200
- ])
201
- ]),
202
- f(u(he), {
203
- schema: B.value,
204
- value: p.value,
205
- onChange: Y,
206
- layout: "inline",
207
- mode: "soft",
208
- view: "popover",
209
- limit: 8,
210
- class: "flex-shrink-0"
211
- }, null, 8, ["schema", "value"])
212
- ])
213
- ]),
214
- o("div", Ee, [
215
- f(u(Q), {
216
- rows: x.value,
217
- columns: v.value,
218
- loading: b.value,
219
- router: u($),
220
- selectable: !1,
221
- onCellUpdate: Z,
222
- classWrapper: "overflow-x-auto overflow-y-visible",
223
- TableStyle: "w-full",
224
- classTable: "w-full min-w-[640px]",
225
- classThead: "bg-gray-50 border-b border-gray-200",
226
- classTh: "px-3 sm:px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
227
- classTbody: "bg-white divide-y divide-gray-200",
228
- classTr: "hover:bg-gray-50 transition-colors",
229
- classTd: "px-3 sm:px-4 py-2.5 whitespace-nowrap",
230
- classLink: "text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline text-left"
231
- }, {
232
- badge: _(({ row: n, value: a, column: d }) => [
233
- D(t.$slots, "badge", {
234
- row: n,
235
- value: a,
236
- column: d
237
- }, () => [
238
- o("span", Re, y((a == null ? void 0 : a.text) || a || "-"), 1)
239
- ], !0)
240
- ]),
241
- action: _(({ row: n }) => [
242
- D(t.$slots, "action", { row: n }, () => [
243
- U.value.includes("add") ? (C(), k("div", ze, [
244
- o("button", {
245
- onClick: (a) => u($).push(X(n.id)),
246
- class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
247
- }, [
248
- f(ye)
249
- ], 8, Fe)
250
- ])) : F("", !0)
251
- ], !0)
252
- ]),
253
- _: 3
254
- }, 8, ["rows", "columns", "loading", "router"])
255
- ]),
256
- L.value ? (C(), k("div", Ne, [
257
- o("div", je, [
258
- e[4] || (e[4] = g(" Показано ", -1)),
259
- o("span", Be, y(O.value), 1),
260
- e[5] || (e[5] = g(" - ", -1)),
261
- o("span", Ue, y(W.value), 1),
262
- e[6] || (e[6] = g(" з ", -1)),
263
- o("span", Ve, y(m.value), 1)
264
- ]),
265
- o("div", qe, [
266
- f(u(ve), {
267
- total: m.value,
268
- page: r.value,
269
- "page-size": T.value,
270
- showPageSizes: !1,
271
- pageRange: 5,
272
- view: "button",
273
- color: "gray",
274
- "onUpdate:page": V,
275
- onPageChange: V
276
- }, null, 8, ["total", "page", "page-size"])
277
- ])
278
- ])) : F("", !0)
279
- ])
280
- ])
281
- ]));
282
- }
283
- }), We = /* @__PURE__ */ be(Ae, [["__scopeId", "data-v-fe4caa80"]]);
284
- export {
285
- We as default
286
- };
@@ -1,359 +0,0 @@
1
- import { defineComponent as ie, defineAsyncComponent as re, computed as b, ref as d, onMounted as de, onBeforeUnmount as ce, watch as L, resolveComponent as ue, openBlock as o, createElementBlock as i, createVNode as c, createSlots as fe, withCtx as N, createTextVNode as v, toDisplayString as h, createElementVNode as a, unref as r, normalizeClass as q, withDirectives as ve, vModelText as ge, Fragment as A, renderList as I, createStaticVNode as pe, createCommentVNode as me } from "vue";
2
- import { useRoute as be, useRouter as he } from "vue-router";
3
- import { VsPagination as xe, notify as Q } from "@opengis/core";
4
- import { Filter as ye } from "@opengis/filter";
5
- import { RefreshCw as _e, LayoutGrid as we, List as ke, Plus as Ce, Search as $e, Image as Se } from "lucide-vue-next";
6
- import { _ as Te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
7
- import { _ as Pe } from "./index-4aSsUBB8.js";
8
- const ze = { class: "flex-1 flex flex-col bg-gray-50 h-screen overflow-hidden p-0 m-0" }, Re = {
9
- href: "/api/gis-create-xml",
10
- target: "_blank",
11
- rel: "noreferrer",
12
- class: "flex h-[2rem] items-center gap-1.5 px-3 py-1.5 bg-slate-50 text-slate-700 rounded-md border border-slate-200 hover:bg-slate-100 transition-colors text-sm"
13
- }, je = { class: "inline-flex items-center rounded-lg border border-gray-200 bg-white p-1 shadow-sm" }, Ne = { class: "flex-1 px-4 sm:px-6 pb-4 overflow-y-auto overflow-x-visible" }, Ee = { class: "bg-white rounded-lg shadow-sm border border-gray-200 overflow-visible" }, Fe = { class: "p-3 border-b border-gray-200" }, Ve = { class: "flex flex-col sm:flex-row gap-2" }, De = { class: "flex-1 relative" }, Me = ["placeholder"], Ue = {
14
- key: 0,
15
- class: "entity-table-root"
16
- }, Be = { class: "gap-2 inline-flex" }, Le = ["onClick"], qe = {
17
- key: 1,
18
- class: "p-4"
19
- }, Ae = {
20
- key: 0,
21
- class: "grid grid-cols-1 gap-5 md:grid-cols-3 xl:grid-cols-4"
22
- }, Ie = {
23
- key: 1,
24
- class: "grid grid-cols-1 gap-5 md:grid-cols-3 xl:grid-cols-4"
25
- }, Qe = ["href"], Je = { class: "p-0" }, Ke = { class: "overflow-hidden border border-[#dbe5f3] bg-[#eef4fb]" }, Oe = { class: "relative aspect-[1.58/1] w-full overflow-hidden" }, We = ["src", "alt"], Ge = {
26
- key: 1,
27
- class: "flex h-full w-full items-center justify-center bg-[radial-gradient(circle_at_top_left,_#f8fbff,_#e8eef8_55%,_#dce6f3)]"
28
- }, He = { class: "p-5" }, Xe = { class: "mb-5 flex items-start justify-between gap-3" }, Ye = { class: "line-clamp-2 max-w-[72%] text-[1.02rem] font-semibold leading-[1.28] tracking-[-0.01em] text-[#183153]" }, Ze = { class: "border-t border-[#e9eef6] pt-4" }, et = { class: "flex items-center justify-between gap-3 text-[0.92rem]" }, tt = { class: "font-medium text-[#b3c1da]" }, st = { class: "truncate text-right font-medium text-[#c0cadb]" }, at = {
29
- key: 2,
30
- class: "py-16 text-center text-sm text-gray-500"
31
- }, nt = {
32
- key: 2,
33
- class: "flex flex-col gap-3 border-t border-gray-200 px-4 py-3 sm:flex-row sm:items-center sm:justify-between bg-gray-50"
34
- }, lt = { class: "text-sm text-gray-500" }, ot = { class: "font-medium text-gray-700" }, it = { class: "font-medium text-gray-700" }, rt = { class: "font-medium text-gray-700" }, dt = { class: "flex items-center justify-end gap-3" }, ct = /* @__PURE__ */ ie({
35
- __name: "RastersTablePage",
36
- props: {
37
- entityKey: { default: "rasters" },
38
- entityBasePath: { default: "/gis.rasters" },
39
- columnsConfig: { default: () => [] }
40
- },
41
- setup(J) {
42
- const K = re(() => import("@opengis/table")), g = be(), $ = he(), S = J, T = b(() => {
43
- var e;
44
- return String(((e = g.meta) == null ? void 0 : e.title) || "Растри");
45
- }), F = b(() => {
46
- var e;
47
- return String(((e = g.meta) == null ? void 0 : e.description) || "");
48
- }), O = b(() => `Пошук ${String(T.value).trim()}...`), V = b(() => S.entityKey || "rasters"), k = b(() => S.entityBasePath || "/gis.rasters"), _ = d([]), P = d(!0), x = d([]), D = d([]), y = d({}), W = d([]), u = d(String(g.query.search ?? "")), l = d(Math.max(1, Number(g.query.page) || 1)), z = d(15), p = d(0), f = d(g.query.view === "table" ? "table" : "tiles");
49
- let C = null;
50
- const G = b(() => p.value > 0), H = b(() => p.value ? (l.value - 1) * z.value + 1 : 0), X = b(() => p.value ? Math.min(l.value * z.value, p.value) : 0);
51
- function Y(e) {
52
- const t = new URLSearchParams();
53
- return Object.entries(e).forEach(([n, s]) => {
54
- if (!(s == null || s === "")) {
55
- if (Array.isArray(s)) {
56
- s.forEach((m) => {
57
- m != null && m !== "" && t.append(n, String(m));
58
- });
59
- return;
60
- }
61
- t.append(n, String(s));
62
- }
63
- }), t.toString();
64
- }
65
- function Z() {
66
- return `${k.value}/new`;
67
- }
68
- function ee(e) {
69
- return `${k.value}/${e}/edit`;
70
- }
71
- async function w() {
72
- try {
73
- P.value = !0;
74
- const e = `/api/data/gis.${V.value}.table`, t = Y({
75
- ...y.value,
76
- page: l.value,
77
- limit: z.value
78
- }), n = await fetch(t ? `${e}?${t}` : e);
79
- if (!n.ok)
80
- throw new Error(`Rows fetch failed: ${n.status}`);
81
- const s = await n.json();
82
- _.value = s.rows || [], p.value = Number(s.filtered ?? s.total ?? s.count ?? _.value.length) || 0, x.value = S.columnsConfig.length ? S.columnsConfig : s.columns || [], D.value = s.filters || [], W.value = s.actions || [], x.value.length && !x.value[0].link ? x.value[0].link = `${k.value}/{id}` : x.value.length && (x.value[0].link = `${k.value}/{id}`);
83
- } catch {
84
- _.value = [], p.value = 0;
85
- } finally {
86
- P.value = !1;
87
- }
88
- }
89
- function M(e) {
90
- const t = typeof (e == null ? void 0 : e.url) == "string" ? e.url.trim() : "";
91
- return t ? (/^https?:\/\//i.test(t) ? t : `${location.origin}${t.startsWith("/") ? "" : "/"}${t}`).replace("{z}", "12").replace("{x}", "2422").replace("{y}", "1400") : "";
92
- }
93
- function te(e) {
94
- if (!e) return "—";
95
- const t = new Date(e);
96
- return Number.isNaN(t.getTime()) ? "—" : t.toLocaleDateString("uk-UA", {
97
- day: "2-digit",
98
- month: "2-digit",
99
- year: "numeric"
100
- });
101
- }
102
- function se(e) {
103
- return (e == null ? void 0 : e.holder) || (e == null ? void 0 : e.source_path) || (e == null ? void 0 : e.extension) || "—";
104
- }
105
- function ae(e) {
106
- y.value = e, l.value = 1, R(), w();
107
- }
108
- async function ne(e, t, n) {
109
- const s = await fetch(`/api/form/gis.${V.value}.table/${e.id}`);
110
- if (!s.ok) throw new Error(`Form fetch failed: ${s.status}`);
111
- const E = (await s.json()).token, j = await fetch(`/api/table/${E}`, {
112
- method: "PUT",
113
- headers: { "Content-Type": "application/json" },
114
- body: JSON.stringify({ [t]: n })
115
- });
116
- if (!j.ok)
117
- throw Q({
118
- type: "error",
119
- title: "Помилка збереження",
120
- message: `Поле "${t}" не оновлено`
121
- }), new Error(`Save failed: ${j.status}`);
122
- Q({ title: "Збережено", message: `Поле "${t}" оновлено` });
123
- }
124
- function le(e, t) {
125
- y.value = {
126
- ...y.value,
127
- [e]: t
128
- }, R(), w();
129
- }
130
- function oe() {
131
- C && clearTimeout(C), C = setTimeout(() => {
132
- l.value = 1, le("search", u.value);
133
- }, 250);
134
- }
135
- function U(e) {
136
- !e || e === l.value || (l.value = e, R(), w());
137
- }
138
- function B(e) {
139
- f.value !== e && (f.value = e, R());
140
- }
141
- function R() {
142
- const e = {
143
- ...g.query,
144
- page: String(l.value),
145
- view: f.value,
146
- ...u.value ? { search: u.value } : {}
147
- };
148
- u.value || delete e.search, $.replace({ query: e });
149
- }
150
- return de(() => {
151
- w(), document.title = T.value;
152
- }), ce(() => {
153
- C && clearTimeout(C);
154
- }), L(
155
- () => g.name,
156
- () => {
157
- l.value = 1, u.value = "", f.value = "tiles", w(), document.title = T.value;
158
- }
159
- ), L(
160
- () => g.query,
161
- (e) => {
162
- const t = Math.max(1, Number(e.page) || 1), n = String(e.search ?? ""), s = e.view === "table" ? "table" : "tiles", m = t !== l.value, E = n !== u.value, j = s !== f.value;
163
- !m && !E && !j || (l.value = t, u.value = n, f.value = s, y.value = {
164
- ...y.value,
165
- search: n || void 0
166
- }, w());
167
- }
168
- ), (e, t) => {
169
- const n = ue("FileEdit");
170
- return o(), i("div", ze, [
171
- c(Te, { variant: "table" }, fe({
172
- title: N(() => [
173
- v(h(T.value), 1)
174
- ]),
175
- actions: N(() => [
176
- a("a", Re, [
177
- c(r(_e), { size: 16 }),
178
- t[4] || (t[4] = v(" Оновити растри ", -1))
179
- ]),
180
- a("div", je, [
181
- a("button", {
182
- type: "button",
183
- class: q(["inline-flex items-center gap-1 rounded-md px-2.5 py-1.5 text-sm transition-colors", f.value === "tiles" ? "bg-blue-600 text-white" : "text-gray-600 hover:bg-gray-100"]),
184
- onClick: t[0] || (t[0] = (s) => B("tiles"))
185
- }, [
186
- c(r(we), { size: 16 }),
187
- t[5] || (t[5] = v(" Плитка ", -1))
188
- ], 2),
189
- a("button", {
190
- type: "button",
191
- class: q(["inline-flex items-center gap-1 rounded-md px-2.5 py-1.5 text-sm transition-colors", f.value === "table" ? "bg-blue-600 text-white" : "text-gray-600 hover:bg-gray-100"]),
192
- onClick: t[1] || (t[1] = (s) => B("table"))
193
- }, [
194
- c(r(ke), { size: 16 }),
195
- t[6] || (t[6] = v(" Таблиця ", -1))
196
- ], 2)
197
- ]),
198
- a("a", {
199
- onClick: t[2] || (t[2] = (s) => r($).push(Z())),
200
- class: "hover:cursor-pointer flex items-center gap-1.5 px-3 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm"
201
- }, [
202
- c(r(Ce), { size: 16 }),
203
- t[7] || (t[7] = v(" Додати ", -1))
204
- ])
205
- ]),
206
- _: 2
207
- }, [
208
- F.value ? {
209
- name: "description",
210
- fn: N(() => [
211
- v(h(F.value), 1)
212
- ]),
213
- key: "0"
214
- } : void 0
215
- ]), 1024),
216
- a("div", Ne, [
217
- a("div", Ee, [
218
- a("div", Fe, [
219
- a("div", Ve, [
220
- a("div", De, [
221
- c(r($e), {
222
- size: 16,
223
- class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
224
- }),
225
- ve(a("input", {
226
- "onUpdate:modelValue": t[3] || (t[3] = (s) => u.value = s),
227
- onInput: oe,
228
- type: "text",
229
- placeholder: O.value,
230
- class: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
231
- }, null, 40, Me), [
232
- [ge, u.value]
233
- ])
234
- ]),
235
- c(r(ye), {
236
- schema: D.value,
237
- value: y.value,
238
- onChange: ae,
239
- layout: "inline",
240
- mode: "soft",
241
- view: "popover",
242
- limit: 8,
243
- class: "flex-shrink-0"
244
- }, null, 8, ["schema", "value"])
245
- ])
246
- ]),
247
- f.value === "table" ? (o(), i("div", Ue, [
248
- c(r(K), {
249
- rows: _.value,
250
- columns: x.value,
251
- loading: P.value,
252
- router: r($),
253
- selectable: !1,
254
- onCellUpdate: ne,
255
- classWrapper: "overflow-x-auto overflow-y-visible",
256
- TableStyle: "w-full",
257
- classTable: "w-full min-w-[640px]",
258
- classThead: "bg-gray-50 border-b border-gray-200",
259
- classTh: "px-3 sm:px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
260
- classTbody: "bg-white divide-y divide-gray-200",
261
- classTr: "hover:bg-gray-50 transition-colors",
262
- classTd: "px-3 sm:px-4 py-2.5 whitespace-nowrap",
263
- classLink: "text-sm font-medium text-blue-600 hover:text-blue-800 hover:underline text-left"
264
- }, {
265
- action: N(({ row: s }) => [
266
- a("div", Be, [
267
- a("button", {
268
- onClick: (m) => r($).push(ee(s.id)),
269
- class: "inline-flex items-center justify-center bg-white border rounded-md size-7 gap-x-2 hover:bg-gray-100"
270
- }, [
271
- c(n)
272
- ], 8, Le)
273
- ])
274
- ]),
275
- _: 1
276
- }, 8, ["rows", "columns", "loading", "router"])
277
- ])) : (o(), i("div", qe, [
278
- P.value ? (o(), i("div", Ae, [
279
- (o(), i(A, null, I(6, (s) => a("div", {
280
- key: s,
281
- class: "overflow-hidden rounded-md border border-[#dde6f2] bg-white animate-pulse"
282
- }, [...t[8] || (t[8] = [
283
- pe('<div class="p-0" data-v-b310f540><div class="overflow-hidden border border-[#dbe5f3] bg-[#eef4fb]" data-v-b310f540><div class="aspect-[1.58/1] w-full bg-[radial-gradient(circle_at_top_left,_#f8fbff,_#edf2f9_55%,_#e2e9f4)]" data-v-b310f540></div></div></div><div class="p-5" data-v-b310f540><div class="mb-5 flex items-start justify-between gap-3" data-v-b310f540><div class="flex-1 space-y-2" data-v-b310f540><div class="h-4 w-[82%] rounded bg-[#e7edf6]" data-v-b310f540></div><div class="h-4 w-[58%] rounded bg-[#eef3fa]" data-v-b310f540></div></div><div class="h-8 w-20 shrink-0 rounded-[0.85rem] bg-[#e7efff]" data-v-b310f540></div></div><div class="border-t border-[#e9eef6] pt-4" data-v-b310f540><div class="flex items-center justify-between gap-3" data-v-b310f540><div class="h-4 w-20 rounded bg-[#eef3fa]" data-v-b310f540></div><div class="h-4 w-28 rounded bg-[#eef3fa]" data-v-b310f540></div></div></div></div>', 2)
284
- ])])), 64))
285
- ])) : _.value.length ? (o(), i("div", Ie, [
286
- (o(!0), i(A, null, I(_.value, (s) => (o(), i("article", {
287
- key: s.id,
288
- class: "group overflow-hidden rounded-md border border-[#dde6f2] bg-white transition-all hover:border-[#bfd0ee] hover:ring-2 hover:ring-[#edf3ff]"
289
- }, [
290
- a("a", {
291
- href: `${k.value}/${s.id}`,
292
- class: "block bg-white transition-colors group-hover:bg-[#fcfdff]"
293
- }, [
294
- a("div", Je, [
295
- a("div", Ke, [
296
- a("div", Oe, [
297
- M(s) ? (o(), i("img", {
298
- key: 0,
299
- src: M(s),
300
- alt: s.name || "Raster preview",
301
- class: "h-full w-full object-cover",
302
- loading: "lazy"
303
- }, null, 8, We)) : (o(), i("div", Ge, [
304
- c(r(Se), {
305
- size: 42,
306
- class: "text-slate-400"
307
- })
308
- ]))
309
- ])
310
- ])
311
- ]),
312
- a("div", He, [
313
- a("div", Xe, [
314
- a("h3", Ye, h(s.name || "Без назви"), 1),
315
- t[9] || (t[9] = a("span", { class: "inline-flex shrink-0 items-center rounded-[0.85rem] bg-[#e4edff] px-3 py-1.5 text-[0.78rem] font-semibold uppercase tracking-wide text-[#4f7cff]" }, " Raster ", -1))
316
- ]),
317
- a("div", Ze, [
318
- a("div", et, [
319
- a("span", tt, h(te(s.created_at || s.updated_at)), 1),
320
- a("span", st, h(se(s)), 1)
321
- ])
322
- ])
323
- ])
324
- ], 8, Qe)
325
- ]))), 128))
326
- ])) : (o(), i("div", at, " Нічого не знайдено "))
327
- ])),
328
- G.value ? (o(), i("div", nt, [
329
- a("div", lt, [
330
- t[10] || (t[10] = v(" Показано ", -1)),
331
- a("span", ot, h(H.value), 1),
332
- t[11] || (t[11] = v(" - ", -1)),
333
- a("span", it, h(X.value), 1),
334
- t[12] || (t[12] = v(" з ", -1)),
335
- a("span", rt, h(p.value), 1)
336
- ]),
337
- a("div", dt, [
338
- c(r(xe), {
339
- total: p.value,
340
- page: l.value,
341
- "page-size": z.value,
342
- showPageSizes: !1,
343
- pageRange: 5,
344
- view: "button",
345
- color: "gray",
346
- "onUpdate:page": U,
347
- onPageChange: U
348
- }, null, 8, ["total", "page", "page-size"])
349
- ])
350
- ])) : me("", !0)
351
- ])
352
- ])
353
- ]);
354
- };
355
- }
356
- }), ht = /* @__PURE__ */ Pe(ct, [["__scopeId", "data-v-b310f540"]]);
357
- export {
358
- ht as default
359
- };