@conboai/storybook.components 0.3.16 → 0.3.17
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,11 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { CoordinatePoint, GeoType } from '../../types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface IPolyline {
|
|
5
5
|
zoom?: number;
|
|
6
6
|
showDirection?: boolean;
|
|
7
7
|
onChange?: (polygonPath: CoordinatePoint[]) => void;
|
|
8
8
|
data?: GeoType | null;
|
|
9
9
|
showNumbers?: boolean;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
declare const Polyline: ({ zoom: zoomFromProps, showDirection, onChange: onChangeFromProps, data, showNumbers }: IPolyline) => React.JSX.Element;
|
|
11
12
|
export default Polyline;
|
|
@@ -78215,66 +78215,65 @@ const _ne = ({
|
|
|
78215
78215
|
data: r,
|
|
78216
78216
|
showNumbers: i = !0
|
|
78217
78217
|
}) => {
|
|
78218
|
-
const [o, s] = je((r == null ? void 0 : r.coordinates) || []), l = Vr(null), c = Ys.isNumber(n) ? n : 0, u = (
|
|
78219
|
-
google.maps.event.clearListeners(
|
|
78218
|
+
const [o, s] = je((r == null ? void 0 : r.coordinates) || []), l = Vr(null), c = Ys.isNumber(n) ? n : 0, u = (b) => {
|
|
78219
|
+
google.maps.event.clearListeners(b.getPath(), "set_at"), google.maps.event.clearListeners(b.getPath(), "insert_at"), b.getPath().addListener("set_at", d), b.getPath().addListener("insert_at", d);
|
|
78220
78220
|
};
|
|
78221
78221
|
Le(() => {
|
|
78222
78222
|
l != null && l.current && u(l == null ? void 0 : l.current);
|
|
78223
78223
|
}, [o]);
|
|
78224
78224
|
const d = () => {
|
|
78225
78225
|
if (l.current) {
|
|
78226
|
-
const
|
|
78227
|
-
|
|
78226
|
+
const b = l.current.getPath().getArray().map((E) => new google.maps.LatLng(E.lat(), E.lng())), T = vc(b);
|
|
78227
|
+
T.length && (s(T), t == null || t(T));
|
|
78228
78228
|
}
|
|
78229
|
-
}, h = (
|
|
78230
|
-
const
|
|
78231
|
-
var
|
|
78232
|
-
return
|
|
78229
|
+
}, h = (b) => {
|
|
78230
|
+
const T = o.filter(({ lat: E, lng: C }) => {
|
|
78231
|
+
var w;
|
|
78232
|
+
return E !== ((w = b.latLng) == null ? void 0 : w.lat()) || C !== b.latLng.lng();
|
|
78233
78233
|
});
|
|
78234
|
-
s(
|
|
78235
|
-
}, v = (
|
|
78236
|
-
l.current =
|
|
78234
|
+
s(T), t == null || t(T);
|
|
78235
|
+
}, v = (b) => {
|
|
78236
|
+
l.current = b, u(b);
|
|
78237
78237
|
};
|
|
78238
78238
|
Le(() => {
|
|
78239
78239
|
s((r == null ? void 0 : r.coordinates) || []);
|
|
78240
78240
|
}, [r]);
|
|
78241
|
-
const y = (
|
|
78242
|
-
const
|
|
78243
|
-
return (Math.atan2(D
|
|
78241
|
+
const y = (b, T) => {
|
|
78242
|
+
const E = b.lat * Math.PI / 180, C = b.lng * Math.PI / 180, w = T.lat * Math.PI / 180, F = T.lng * Math.PI / 180 - C, $ = Math.sin(F) * Math.cos(w), D = Math.cos(E) * Math.sin(w) - Math.sin(E) * Math.cos(w) * Math.cos(F);
|
|
78243
|
+
return (Math.atan2($, D) * 180 / Math.PI + 360) % 360;
|
|
78244
78244
|
}, p = () => {
|
|
78245
|
-
|
|
78246
|
-
|
|
78247
|
-
|
|
78248
|
-
|
|
78249
|
-
|
|
78245
|
+
var w, R;
|
|
78246
|
+
const b = o.length - 1, T = Math.min(4, b);
|
|
78247
|
+
let E = 0;
|
|
78248
|
+
for (let F = b; F > b - T; F--)
|
|
78249
|
+
E += y(o[F - 1], o[F]);
|
|
78250
|
+
const C = E / T;
|
|
78250
78251
|
return {
|
|
78251
|
-
position: o[
|
|
78252
|
+
position: o[b],
|
|
78252
78253
|
icon: {
|
|
78253
|
-
path: google.maps.SymbolPath.BACKWARD_CLOSED_ARROW,
|
|
78254
|
+
path: (R = (w = google == null ? void 0 : google.maps) == null ? void 0 : w.SymbolPath) == null ? void 0 : R.BACKWARD_CLOSED_ARROW,
|
|
78254
78255
|
scale: m - 3,
|
|
78255
78256
|
strokeColor: "#2196F3",
|
|
78256
|
-
rotation:
|
|
78257
|
+
rotation: C
|
|
78257
78258
|
}
|
|
78258
78259
|
};
|
|
78259
|
-
}, f = c - 13, m = f < 0 ? 0 : f, x = {
|
|
78260
|
-
|
|
78261
|
-
}, b = (T) => {
|
|
78262
|
-
var E;
|
|
78260
|
+
}, f = c - 13 || -1, m = f < 0 ? 0 : f, x = (b) => {
|
|
78261
|
+
var T, E;
|
|
78263
78262
|
return {
|
|
78264
|
-
path: (E = google == null ? void 0 : google.maps) == null ? void 0 :
|
|
78263
|
+
path: (E = (T = google == null ? void 0 : google.maps) == null ? void 0 : T.SymbolPath) == null ? void 0 : E.CIRCLE,
|
|
78265
78264
|
fillColor: "#2196F3",
|
|
78266
78265
|
fillOpacity: 1,
|
|
78267
78266
|
strokeWeight: 0,
|
|
78268
|
-
scale:
|
|
78267
|
+
scale: b + 2
|
|
78269
78268
|
};
|
|
78270
78269
|
};
|
|
78271
78270
|
return /* @__PURE__ */ ee.jsxs(ee.Fragment, { children: [
|
|
78272
|
-
i && (o == null ? void 0 : o.map(({ lat:
|
|
78271
|
+
i && (o == null ? void 0 : o.map(({ lat: b, lng: T }, E) => /* @__PURE__ */ ee.jsx(ov, { coordinates: { lat: b, lng: T }, index: E + 1 }, b + T))),
|
|
78273
78272
|
/* @__PURE__ */ ee.jsx(
|
|
78274
78273
|
pm,
|
|
78275
78274
|
{
|
|
78276
78275
|
path: o,
|
|
78277
|
-
options:
|
|
78276
|
+
options: gm,
|
|
78278
78277
|
visible: !0,
|
|
78279
78278
|
editable: !0,
|
|
78280
78279
|
draggable: !0,
|
|
@@ -78286,7 +78285,7 @@ const _ne = ({
|
|
|
78286
78285
|
OC,
|
|
78287
78286
|
{
|
|
78288
78287
|
position: o[0],
|
|
78289
|
-
icon:
|
|
78288
|
+
icon: x(m)
|
|
78290
78289
|
}
|
|
78291
78290
|
),
|
|
78292
78291
|
e && o.length > 1 && /* @__PURE__ */ ee.jsx(OC, { ...p() })
|
|
@@ -78383,7 +78382,7 @@ const _ne = ({
|
|
|
78383
78382
|
_ne,
|
|
78384
78383
|
{
|
|
78385
78384
|
zoom: $,
|
|
78386
|
-
showDirection:
|
|
78385
|
+
showDirection: n,
|
|
78387
78386
|
showNumbers: u,
|
|
78388
78387
|
onChange: r,
|
|
78389
78388
|
data: A
|