agvmap-react 0.1.47 → 0.1.49
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-C5UKrWqt.js → LazyModalContent-DZDF6cHd.js} +34 -34
- package/dist/agvmap-react.js +13 -2
- package/dist/agvmap-react.umd.cjs +216 -248
- package/dist/{index-Df_WMhdb.js → index-6fJ6yDFf.js} +39461 -39924
- package/dist/style.css +1 -1
- package/package.json +15 -31
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { M as V, u as W, a as O, B as q, T as y, b as G, C as J, c as K, d as Q, t as X, S as Y, e as Z, I as $, f as D, g as L, h as ee } from "./index-
|
|
4
|
-
const ae = (a) => /* @__PURE__ */
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useContext as H, useCallback as d, useRef as P, useMemo as w, useEffect as U } from "react";
|
|
3
|
+
import { M as V, u as W, a as O, B as q, T as y, b as G, C as J, c as K, d as Q, t as X, S as Y, e as Z, I as $, f as D, g as L, h as ee } from "./index-6fJ6yDFf.js";
|
|
4
|
+
const ae = (a) => /* @__PURE__ */ o(
|
|
5
5
|
"svg",
|
|
6
6
|
{
|
|
7
7
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -33,10 +33,10 @@ const ae = (a) => /* @__PURE__ */ l(
|
|
|
33
33
|
)
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
|
-
), te = ({ marker: a, markerId: v, buttonClassName:
|
|
37
|
-
const [c, i] =
|
|
38
|
-
i((
|
|
39
|
-
}, []), m = (
|
|
36
|
+
), te = ({ marker: a, markerId: v, buttonClassName: f = "" }) => {
|
|
37
|
+
const [c, i] = u(!1), { handleMarkerUpdate: s } = H(V), h = W(), M = d(() => {
|
|
38
|
+
i((g) => !g);
|
|
39
|
+
}, []), m = (g) => (console.log("data after editing", g), console.log("data before editing", a), s(g));
|
|
40
40
|
return /* @__PURE__ */ e(
|
|
41
41
|
O,
|
|
42
42
|
{
|
|
@@ -72,12 +72,12 @@ const ae = (a) => /* @__PURE__ */ l(
|
|
|
72
72
|
) })
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
}, se = ({ marker: a, onMarkerClick: v, onDeleteMarker:
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ e(D, { className: "h-4 w-4 text-primary shrink-0" }),
|
|
78
|
-
/* @__PURE__ */ e("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200
|
|
75
|
+
}, se = ({ marker: a, onMarkerClick: v, onDeleteMarker: f, markersData: c, intl: i }) => /* @__PURE__ */ e("div", { className: "marker-item rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 p-2 mb-2", children: /* @__PURE__ */ e("div", { className: "marker-item-info", children: /* @__PURE__ */ o("div", { className: "flex justify-between items-center gap-2", children: [
|
|
76
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
77
|
+
/* @__PURE__ */ e(D, { className: "h-4 w-4 text-primary flex-shrink-0" }),
|
|
78
|
+
/* @__PURE__ */ e("h5", { className: "text-sm font-medium text-gray-800 dark:text-gray-200 break-words leading-tight", children: a == null ? void 0 : a.title })
|
|
79
79
|
] }),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
81
81
|
/* @__PURE__ */ e(y, { text: i.formatMessage({ id: "app.agviewer_map.focus_marker", defaultMessage: "Focus on the marker" }), children: /* @__PURE__ */ e(
|
|
82
82
|
L,
|
|
83
83
|
{
|
|
@@ -93,7 +93,7 @@ const ae = (a) => /* @__PURE__ */ l(
|
|
|
93
93
|
{
|
|
94
94
|
variant: "icon",
|
|
95
95
|
className: "rounded-full p-1 hover:bg-gray-100 dark:hover:bg-gray-600",
|
|
96
|
-
onClick: (s) =>
|
|
96
|
+
onClick: (s) => f(s, a),
|
|
97
97
|
"data-marker-id": a.id,
|
|
98
98
|
children: /* @__PURE__ */ e(ee, { className: "w-4 h-4 text-red-500" })
|
|
99
99
|
}
|
|
@@ -106,49 +106,49 @@ const ae = (a) => /* @__PURE__ */ l(
|
|
|
106
106
|
)
|
|
107
107
|
] })
|
|
108
108
|
] }) }) });
|
|
109
|
-
function
|
|
109
|
+
function le({
|
|
110
110
|
markersData: a,
|
|
111
111
|
loading: v,
|
|
112
|
-
handleDeleteMarker:
|
|
112
|
+
handleDeleteMarker: f,
|
|
113
113
|
onMarkerClick: c,
|
|
114
114
|
onClose: i,
|
|
115
115
|
intl: s
|
|
116
116
|
}) {
|
|
117
|
-
const [h, M] =
|
|
117
|
+
const [h, M] = u(""), [m, g] = u(""), [T, k] = u(!1), [l, _] = u(20), [p, C] = u(!1), j = P(null), S = d(
|
|
118
118
|
Q((t) => {
|
|
119
|
-
|
|
119
|
+
g(t), k(!1);
|
|
120
120
|
}, 300),
|
|
121
121
|
[]
|
|
122
122
|
), B = d((t) => {
|
|
123
123
|
const r = t.target.value;
|
|
124
124
|
M(r), k(!0), S(r);
|
|
125
|
-
}, [S]),
|
|
126
|
-
if (!m) return
|
|
125
|
+
}, [S]), b = w(() => !a || a.length === 0 ? [] : a.map((t) => X(t)), [a]), n = w(() => {
|
|
126
|
+
if (!m) return b;
|
|
127
127
|
const t = m.toLowerCase();
|
|
128
|
-
return
|
|
128
|
+
return b.filter(
|
|
129
129
|
(r) => {
|
|
130
130
|
var x, N;
|
|
131
131
|
return (N = (x = r == null ? void 0 : r.title) == null ? void 0 : x.toLowerCase()) == null ? void 0 : N.includes(t);
|
|
132
132
|
}
|
|
133
133
|
);
|
|
134
|
-
}, [
|
|
134
|
+
}, [b, m]), E = w(() => n.slice(0, l), [n, l]);
|
|
135
135
|
U(() => {
|
|
136
136
|
_(20);
|
|
137
137
|
}, [m]);
|
|
138
138
|
const I = d(() => {
|
|
139
|
-
p ||
|
|
139
|
+
p || l >= n.length || (C(!0), setTimeout(() => {
|
|
140
140
|
_((t) => Math.min(t + 20, n.length)), C(!1);
|
|
141
141
|
}, 300));
|
|
142
|
-
}, [p,
|
|
142
|
+
}, [p, l, n.length]), F = d((t) => {
|
|
143
143
|
const { scrollTop: r, scrollHeight: x, clientHeight: N } = t.target;
|
|
144
|
-
r + N >= x - 100 && !p &&
|
|
145
|
-
}, [I, p,
|
|
144
|
+
r + N >= x - 100 && !p && l < n.length && I();
|
|
145
|
+
}, [I, p, l, n.length]), R = d((t, r) => {
|
|
146
146
|
c(t, r), i();
|
|
147
147
|
}, [c, i]), z = d((t, r) => {
|
|
148
|
-
|
|
149
|
-
}, [
|
|
150
|
-
return v ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-40", children: /* @__PURE__ */ e(Y, {}) }) : /* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
148
|
+
f(t, r);
|
|
149
|
+
}, [f]);
|
|
150
|
+
return v ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-40", children: /* @__PURE__ */ e(Y, {}) }) : /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
151
|
+
/* @__PURE__ */ o("div", { className: "relative mb-4", children: [
|
|
152
152
|
/* @__PURE__ */ e(Z, { className: "w-4 h-4 text-gray-500 absolute left-3 top-1/2 transform -translate-y-1/2" }),
|
|
153
153
|
/* @__PURE__ */ e(
|
|
154
154
|
$,
|
|
@@ -167,7 +167,7 @@ function oe({
|
|
|
167
167
|
ref: j,
|
|
168
168
|
className: "overflow-y-auto h-[350px]",
|
|
169
169
|
onScroll: F,
|
|
170
|
-
children: n.length === 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-20 p-4", children: /* @__PURE__ */ e("h5", { className: "text-sm text-gray-500 dark:text-gray-400", children: h ? s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) : s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) }) }) : /* @__PURE__ */
|
|
170
|
+
children: n.length === 0 ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-20 p-4", children: /* @__PURE__ */ e("h5", { className: "text-sm text-gray-500 dark:text-gray-400", children: h ? s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) : s.formatMessage({ id: "app.agviewer_map.no_station_found", defaultMessage: "No Station Found" }) }) }) : /* @__PURE__ */ o(A, { children: [
|
|
171
171
|
E.map((t) => /* @__PURE__ */ e(
|
|
172
172
|
se,
|
|
173
173
|
{
|
|
@@ -179,11 +179,11 @@ function oe({
|
|
|
179
179
|
},
|
|
180
180
|
t.id
|
|
181
181
|
)),
|
|
182
|
-
p && /* @__PURE__ */ e("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */
|
|
182
|
+
p && /* @__PURE__ */ e("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
183
183
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" }),
|
|
184
184
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading more..." })
|
|
185
185
|
] }) }),
|
|
186
|
-
|
|
186
|
+
l >= n.length && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex justify-center items-center py-4", children: /* @__PURE__ */ e("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: s.formatMessage({
|
|
187
187
|
id: "app.agviewer_map.all_results_loaded",
|
|
188
188
|
defaultMessage: "All results loaded"
|
|
189
189
|
}) }) })
|
|
@@ -193,5 +193,5 @@ function oe({
|
|
|
193
193
|
] });
|
|
194
194
|
}
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
le as default
|
|
197
197
|
};
|
package/dist/agvmap-react.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { A as p } from "./index-
|
|
1
|
+
import { r as s, l as r, m as t, A, j as n, i as p, p as d, D as v, k as M, n as e, o as g, q as i } from "./index-6fJ6yDFf.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
s as AGV_MAP_WIDGET_TAG,
|
|
4
|
+
r as AddPlotControl,
|
|
5
|
+
t as AddStationControl,
|
|
6
|
+
A as AgvMap,
|
|
7
|
+
n as AgvMapCanvas,
|
|
8
|
+
p as AgvMapProvider,
|
|
9
|
+
d as AgvMapWidget,
|
|
10
|
+
v as DrawPolygonControl,
|
|
11
|
+
M as MapCanvas,
|
|
12
|
+
e as MapContext,
|
|
13
|
+
g as MapProvider,
|
|
14
|
+
i as defineAgvMapWidget
|
|
4
15
|
};
|