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.
@@ -1,7 +1,7 @@
1
- import { jsxs as l, jsx as e, Fragment as A } from "react/jsx-runtime";
2
- import { useState as g, useContext as H, useCallback as d, useRef as P, useMemo as b, 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-Df_WMhdb.js";
4
- const ae = (a) => /* @__PURE__ */ l(
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: u = "" }) => {
37
- const [c, i] = g(!1), { handleMarkerUpdate: s } = H(V), h = W(), M = d(() => {
38
- i((f) => !f);
39
- }, []), m = (f) => s(f);
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: u, 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__ */ l("div", { className: "flex justify-between items-center gap-2", children: [
76
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
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 wrap-break-word leading-tight", children: a == null ? void 0 : a.title })
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__ */ l("div", { className: "flex items-center gap-1 shrink-0", children: [
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) => u(s, a),
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 oe({
109
+ function le({
110
110
  markersData: a,
111
111
  loading: v,
112
- handleDeleteMarker: u,
112
+ handleDeleteMarker: f,
113
113
  onMarkerClick: c,
114
114
  onClose: i,
115
115
  intl: s
116
116
  }) {
117
- const [h, M] = g(""), [m, f] = g(""), [T, k] = g(!1), [o, _] = g(20), [p, C] = g(!1), j = P(null), S = d(
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
- f(t), k(!1);
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]), w = b(() => !a || a.length === 0 ? [] : a.map((t) => X(t)), [a]), n = b(() => {
126
- if (!m) return w;
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 w.filter(
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
- }, [w, m]), E = b(() => n.slice(0, o), [n, o]);
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 || o >= n.length || (C(!0), setTimeout(() => {
139
+ p || l >= n.length || (C(!0), setTimeout(() => {
140
140
  _((t) => Math.min(t + 20, n.length)), C(!1);
141
141
  }, 300));
142
- }, [p, o, n.length]), F = d((t) => {
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 && o < n.length && I();
145
- }, [I, p, o, n.length]), R = d((t, r) => {
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
- u(t, r);
149
- }, [u]);
150
- return v ? /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-40", children: /* @__PURE__ */ e(Y, {}) }) : /* @__PURE__ */ l("div", { className: "w-full", children: [
151
- /* @__PURE__ */ l("div", { className: "relative mb-4", children: [
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__ */ l(A, { children: [
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__ */ l("div", { className: "flex items-center gap-2", children: [
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
- o >= 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({
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
- oe as default
196
+ le as default
197
197
  };
@@ -1,4 +1,15 @@
1
- import { A as p } from "./index-Df_WMhdb.js";
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
- p as AgvMap
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
  };