agvmap-react 0.1.37-16 → 0.1.38
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/LazyModalContent-Dx3sMuo5.js +197 -0
- package/dist/agvmap-react.js +1 -1
- package/dist/agvmap-react.umd.cjs +260 -289
- package/dist/{index-B4_Z5gOJ.js → index-D16caLkt.js} +36938 -37593
- package/package.json +5 -5
- package/dist/LazyModalContent-C61itXNr.js +0 -196
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agvmap-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"module": "dist/
|
|
5
|
+
"main": "dist/agvmap-react.umd.cjs",
|
|
6
|
+
"module": "dist/agvmap-react.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/
|
|
10
|
-
"require": "./dist/
|
|
9
|
+
"import": "./dist/agvmap-react.js",
|
|
10
|
+
"require": "./dist/agvmap-react.umd.cjs"
|
|
11
11
|
},
|
|
12
12
|
"./style.css": "./dist/style.css"
|
|
13
13
|
},
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { j as e, M as z, u as A, a as H, B as P, T as b, b as U, C as V, c as W, d as O, t as q, S as G, e as J, I as K, f as Q, g as S, h as X } from "./index-B4_Z5gOJ.js";
|
|
2
|
-
import { useState as m, useContext as Y, useCallback as o, useRef as Z, useMemo as N, useEffect as $ } from "react";
|
|
3
|
-
const D = (s) => /* @__PURE__ */ e.jsxs(
|
|
4
|
-
"svg",
|
|
5
|
-
{
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: 20,
|
|
8
|
-
height: 20,
|
|
9
|
-
viewBox: "0 0 20 20",
|
|
10
|
-
fill: "none",
|
|
11
|
-
...s,
|
|
12
|
-
children: [
|
|
13
|
-
/* @__PURE__ */ e.jsx(
|
|
14
|
-
"path",
|
|
15
|
-
{
|
|
16
|
-
stroke: "#373737",
|
|
17
|
-
strokeLinecap: "round",
|
|
18
|
-
strokeLinejoin: "round",
|
|
19
|
-
strokeWidth: 2,
|
|
20
|
-
d: "m5.833 14.167 8.334-8.334"
|
|
21
|
-
}
|
|
22
|
-
),
|
|
23
|
-
/* @__PURE__ */ e.jsx(
|
|
24
|
-
"path",
|
|
25
|
-
{
|
|
26
|
-
stroke: "#000",
|
|
27
|
-
strokeLinecap: "round",
|
|
28
|
-
strokeLinejoin: "round",
|
|
29
|
-
strokeWidth: 2,
|
|
30
|
-
d: "M5.833 5.833h8.334v8.334"
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
), ee = ({ marker: s, markerId: f, buttonClassName: g = "" }) => {
|
|
36
|
-
const [d, i] = m(!1), { handleMarkerUpdate: t } = Y(z), c = A(), p = o(() => {
|
|
37
|
-
i((u) => !u);
|
|
38
|
-
}, []), h = (u) => t(u);
|
|
39
|
-
return /* @__PURE__ */ e.jsx(
|
|
40
|
-
H,
|
|
41
|
-
{
|
|
42
|
-
trigger: /* @__PURE__ */ e.jsx(P, { variant: "outline", size: "icon", tabIndex: -1, children: /* @__PURE__ */ e.jsx(
|
|
43
|
-
b,
|
|
44
|
-
{
|
|
45
|
-
text: c.formatMessage({
|
|
46
|
-
id: "app.agviewer_map.edit_marker",
|
|
47
|
-
defaultMessage: "Edit Marker"
|
|
48
|
-
}),
|
|
49
|
-
children: /* @__PURE__ */ e.jsx(U, { className: "w-5 h-5 action-icon" })
|
|
50
|
-
}
|
|
51
|
-
) }),
|
|
52
|
-
title: c.formatMessage({
|
|
53
|
-
id: "app.agviewer_map.edit_marker",
|
|
54
|
-
defaultMessage: "Edit Marker"
|
|
55
|
-
}),
|
|
56
|
-
open: d,
|
|
57
|
-
setOpen: i,
|
|
58
|
-
headerClassName: "m-4",
|
|
59
|
-
onClose: p,
|
|
60
|
-
children: /* @__PURE__ */ e.jsx(V, { children: /* @__PURE__ */ e.jsx(
|
|
61
|
-
W,
|
|
62
|
-
{
|
|
63
|
-
marker: s,
|
|
64
|
-
onSubmit: h,
|
|
65
|
-
onCancel: p,
|
|
66
|
-
submitButtonText: c.formatMessage({
|
|
67
|
-
id: "app.agviewer_map.save_changes",
|
|
68
|
-
defaultMessage: "Save Changes"
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
) })
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}, se = ({ marker: s, onMarkerClick: f, onDeleteMarker: g, markersData: d, intl: i }) => /* @__PURE__ */ e.jsx("div", { className: "marker-item rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 p-2 mb-2", children: /* @__PURE__ */ e.jsx("div", { className: "marker-item-info", children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center gap-2", children: [
|
|
75
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
76
|
-
/* @__PURE__ */ e.jsx(Q, { className: "h-4 w-4 text-primary flex-shrink-0" }),
|
|
77
|
-
/* @__PURE__ */ e.jsx("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200 break-words leading-tight", children: s == null ? void 0 : s.title })
|
|
78
|
-
] }),
|
|
79
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
80
|
-
/* @__PURE__ */ e.jsx(b, { text: i.formatMessage({ id: "app.agviewer_map.focus_marker", defaultMessage: "Focus on the marker" }), children: /* @__PURE__ */ e.jsx(
|
|
81
|
-
S,
|
|
82
|
-
{
|
|
83
|
-
variant: "icon",
|
|
84
|
-
className: "rounded-full p-1 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
85
|
-
onClick: (t) => f(t, s),
|
|
86
|
-
"data-marker-id": s.id,
|
|
87
|
-
children: /* @__PURE__ */ e.jsx(D, { className: "w-4 h-4" })
|
|
88
|
-
}
|
|
89
|
-
) }),
|
|
90
|
-
/* @__PURE__ */ e.jsx(b, { text: i.formatMessage({ id: "app.agviewer_map.delete_marker", defaultMessage: "Delete Marker" }), children: /* @__PURE__ */ e.jsx(
|
|
91
|
-
S,
|
|
92
|
-
{
|
|
93
|
-
variant: "icon",
|
|
94
|
-
className: "rounded-full p-1 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
95
|
-
onClick: (t) => g(t, s),
|
|
96
|
-
"data-marker-id": s.id,
|
|
97
|
-
children: /* @__PURE__ */ e.jsx(X, { className: "w-4 h-4 text-red-500" })
|
|
98
|
-
}
|
|
99
|
-
) }),
|
|
100
|
-
/* @__PURE__ */ e.jsx(
|
|
101
|
-
ee,
|
|
102
|
-
{
|
|
103
|
-
marker: d.find((t) => t.id === s.id)
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
] })
|
|
107
|
-
] }) }) });
|
|
108
|
-
function ne({
|
|
109
|
-
markersData: s,
|
|
110
|
-
loading: f,
|
|
111
|
-
handleDeleteMarker: g,
|
|
112
|
-
onMarkerClick: d,
|
|
113
|
-
onClose: i,
|
|
114
|
-
intl: t
|
|
115
|
-
}) {
|
|
116
|
-
const [c, p] = m(""), [h, u] = m(""), [I, w] = m(!1), [l, y] = m(20), [x, k] = m(!1), L = Z(null), _ = o(
|
|
117
|
-
O((a) => {
|
|
118
|
-
u(a), w(!1);
|
|
119
|
-
}, 300),
|
|
120
|
-
[]
|
|
121
|
-
), T = o((a) => {
|
|
122
|
-
const r = a.target.value;
|
|
123
|
-
p(r), w(!0), _(r);
|
|
124
|
-
}, [_]), M = N(() => !s || s.length === 0 ? [] : s.map((a) => q(a)), [s]), n = N(() => {
|
|
125
|
-
if (!h) return M;
|
|
126
|
-
const a = h.toLowerCase();
|
|
127
|
-
return M.filter(
|
|
128
|
-
(r) => {
|
|
129
|
-
var j, v;
|
|
130
|
-
return (v = (j = r == null ? void 0 : r.title) == null ? void 0 : j.toLowerCase()) == null ? void 0 : v.includes(a);
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
}, [M, h]), B = N(() => n.slice(0, l), [n, l]);
|
|
134
|
-
$(() => {
|
|
135
|
-
y(20);
|
|
136
|
-
}, [h]);
|
|
137
|
-
const C = o(() => {
|
|
138
|
-
x || l >= n.length || (k(!0), setTimeout(() => {
|
|
139
|
-
y((a) => Math.min(a + 20, n.length)), k(!1);
|
|
140
|
-
}, 300));
|
|
141
|
-
}, [x, l, n.length]), E = o((a) => {
|
|
142
|
-
const { scrollTop: r, scrollHeight: j, clientHeight: v } = a.target;
|
|
143
|
-
r + v >= j - 100 && !x && l < n.length && C();
|
|
144
|
-
}, [C, x, l, n.length]), F = o((a, r) => {
|
|
145
|
-
d(a, r), i();
|
|
146
|
-
}, [d, i]), R = o((a, r) => {
|
|
147
|
-
g(a, r);
|
|
148
|
-
}, [g]);
|
|
149
|
-
return f ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center items-center h-40", children: /* @__PURE__ */ e.jsx(G, {}) }) : /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
|
|
150
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative mb-4", children: [
|
|
151
|
-
/* @__PURE__ */ e.jsx(J, { className: "w-4 h-4 text-gray-500 absolute left-3 top-1/2 transform -translate-y-1/2" }),
|
|
152
|
-
/* @__PURE__ */ e.jsx(
|
|
153
|
-
K,
|
|
154
|
-
{
|
|
155
|
-
className: "pl-9 w-full text-sm h-9",
|
|
156
|
-
placeholder: t.formatMessage({ id: "app.agviewer_map.search_station", defaultMessage: "Search Station" }),
|
|
157
|
-
value: c,
|
|
158
|
-
onChange: T
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
I && /* @__PURE__ */ e.jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" }) })
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ e.jsx(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
ref: L,
|
|
167
|
-
className: "overflow-y-auto h-[350px]",
|
|
168
|
-
onScroll: E,
|
|
169
|
-
children: n.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center h-20 p-4", children: /* @__PURE__ */ e.jsx("h5", { className: "text-sm text-gray-500 dark:text-gray-400", children: c ? t.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) : t.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
170
|
-
B.map((a) => /* @__PURE__ */ e.jsx(
|
|
171
|
-
se,
|
|
172
|
-
{
|
|
173
|
-
marker: a,
|
|
174
|
-
onMarkerClick: F,
|
|
175
|
-
onDeleteMarker: R,
|
|
176
|
-
markersData: s,
|
|
177
|
-
intl: t
|
|
178
|
-
},
|
|
179
|
-
a.id
|
|
180
|
-
)),
|
|
181
|
-
x && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
182
|
-
/* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" }),
|
|
183
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading more..." })
|
|
184
|
-
] }) }),
|
|
185
|
-
l >= n.length && n.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ e.jsx("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: t.formatMessage({
|
|
186
|
-
id: "app.agviewer_map.all_results_loaded",
|
|
187
|
-
defaultMessage: "All results loaded"
|
|
188
|
-
}) }) })
|
|
189
|
-
] })
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
] });
|
|
193
|
-
}
|
|
194
|
-
export {
|
|
195
|
-
ne as default
|
|
196
|
-
};
|