@mattilsynet/design 2.2.29 → 2.2.31
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/mtds/alert/alert.js +8 -9
- package/mtds/alert/alert.js.map +1 -1
- package/mtds/analytics/analytics.js +104 -165
- package/mtds/analytics/analytics.js.map +1 -1
- package/mtds/app/app-observer.js +28 -74
- package/mtds/app/app-observer.js.map +1 -1
- package/mtds/app/app-toggle.js +10 -4
- package/mtds/app/app-toggle.js.map +1 -1
- package/mtds/app/app-toggle2.js +26 -16
- package/mtds/app/app-toggle2.js.map +1 -1
- package/mtds/app/app.js +32 -36
- package/mtds/app/app.js.map +1 -1
- package/mtds/atlas/atlas-element.d.ts +27 -0
- package/mtds/atlas/atlas-element.js +63 -84
- package/mtds/atlas/atlas-element.js.map +1 -1
- package/mtds/atlas/atlas-marker.js +28 -48
- package/mtds/atlas/atlas-marker.js.map +1 -1
- package/mtds/atlas/atlas-matgeo.d.ts +3 -8
- package/mtds/atlas/atlas-matgeo.js +36 -66
- package/mtds/atlas/atlas-matgeo.js.map +1 -1
- package/mtds/atlas/atlas-wms.js +11 -21
- package/mtds/atlas/atlas-wms.js.map +1 -1
- package/mtds/atlas/atlas.css.js +5 -4
- package/mtds/atlas/atlas.css.js.map +1 -1
- package/mtds/atlas/atlas.js +23 -23
- package/mtds/atlas/atlas.js.map +1 -1
- package/mtds/atlas/atlas.stories.d.ts +1 -0
- package/mtds/atlas/cluster.js +697 -1576
- package/mtds/atlas/cluster.js.map +1 -1
- package/mtds/atlas.iife.js +7 -6
- package/mtds/atlas.js +11 -10
- package/mtds/avatar/avatar.js +8 -8
- package/mtds/avatar/avatar.js.map +1 -1
- package/mtds/badge/badge.js +7 -7
- package/mtds/badge/badge.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs-observer.js +9 -10
- package/mtds/breadcrumbs/breadcrumbs-observer.js.map +1 -1
- package/mtds/breadcrumbs/breadcrumbs.js +13 -14
- package/mtds/breadcrumbs/breadcrumbs.js.map +1 -1
- package/mtds/button/button.js +14 -16
- package/mtds/button/button.js.map +1 -1
- package/mtds/card/card.js +12 -14
- package/mtds/card/card.js.map +1 -1
- package/mtds/chart/chart-axis.js +15 -27
- package/mtds/chart/chart-axis.js.map +1 -1
- package/mtds/chart/chart-bars.js +13 -15
- package/mtds/chart/chart-bars.js.map +1 -1
- package/mtds/chart/chart-element.js +48 -83
- package/mtds/chart/chart-element.js.map +1 -1
- package/mtds/chart/chart-lines.js +32 -54
- package/mtds/chart/chart-lines.js.map +1 -1
- package/mtds/chart/chart-pies.js +14 -34
- package/mtds/chart/chart-pies.js.map +1 -1
- package/mtds/chart/chart.css.js +2 -2
- package/mtds/chart/chart.css.js.map +1 -1
- package/mtds/chart/chart.js +12 -12
- package/mtds/chart/chart.js.map +1 -1
- package/mtds/chip/chip.js +8 -8
- package/mtds/chip/chip.js.map +1 -1
- package/mtds/details/details.js +12 -14
- package/mtds/details/details.js.map +1 -1
- package/mtds/dialog/dialog-observer.js +22 -35
- package/mtds/dialog/dialog-observer.js.map +1 -1
- package/mtds/dialog/dialog.js +12 -12
- package/mtds/dialog/dialog.js.map +1 -1
- package/mtds/divider/divider.js +10 -10
- package/mtds/divider/divider.js.map +1 -1
- package/mtds/errorsummary/errorsummary-observer.js +8 -11
- package/mtds/errorsummary/errorsummary-observer.js.map +1 -1
- package/mtds/errorsummary/errorsummary.js +11 -11
- package/mtds/errorsummary/errorsummary.js.map +1 -1
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js +19 -27
- package/mtds/external/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/helpers/dist/esm/index.js +16 -29
- package/mtds/external/@turf/helpers/dist/esm/index.js.map +1 -1
- package/mtds/external/@turf/invariant/dist/esm/index.js +13 -20
- package/mtds/external/@turf/invariant/dist/esm/index.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet-src.js +3099 -6007
- package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -1
- package/mtds/external/leaflet/dist/leaflet.css.js +2 -2
- package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -1
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js +16 -46
- package/mtds/external/point-in-polygon-hao/dist/esm/index.js.map +1 -1
- package/mtds/external/robust-predicates/esm/orient2d.js +19 -163
- package/mtds/external/robust-predicates/esm/orient2d.js.map +1 -1
- package/mtds/external/robust-predicates/esm/util.js +25 -85
- package/mtds/external/robust-predicates/esm/util.js.map +1 -1
- package/mtds/field/field-observer.js +53 -101
- package/mtds/field/field-observer.js.map +1 -1
- package/mtds/field/field.js +145 -177
- package/mtds/field/field.js.map +1 -1
- package/mtds/fieldset/fieldset-observer.js +14 -24
- package/mtds/fieldset/fieldset-observer.js.map +1 -1
- package/mtds/fieldset/fieldset.js +20 -23
- package/mtds/fieldset/fieldset.js.map +1 -1
- package/mtds/fileupload/fileupload.js +8 -9
- package/mtds/fileupload/fileupload.js.map +1 -1
- package/mtds/helptext/helptext.js +15 -15
- package/mtds/helptext/helptext.js.map +1 -1
- package/mtds/illustrations/index.json +2 -2
- package/mtds/index.d.ts +1 -0
- package/mtds/index.iife.js +165 -15
- package/mtds/index.js +29 -26
- package/mtds/index.js.map +1 -1
- package/mtds/input/input.js +28 -30
- package/mtds/input/input.js.map +1 -1
- package/mtds/law/law-helper.js +77 -143
- package/mtds/law/law-helper.js.map +1 -1
- package/mtds/law/law.js +6 -6
- package/mtds/law/law.js.map +1 -1
- package/mtds/layout/layout.js +10 -13
- package/mtds/layout/layout.js.map +1 -1
- package/mtds/link/link.js +7 -8
- package/mtds/link/link.js.map +1 -1
- package/mtds/logo/logo-observer.js +12 -18
- package/mtds/logo/logo-observer.js.map +1 -1
- package/mtds/logo/logo.js +8 -8
- package/mtds/logo/logo.js.map +1 -1
- package/mtds/package.json.js +2 -2
- package/mtds/pagination/pagination-helper.js +11 -17
- package/mtds/pagination/pagination-helper.js.map +1 -1
- package/mtds/pagination/pagination.js +30 -30
- package/mtds/pagination/pagination.js.map +1 -1
- package/mtds/popover/popover-observer.js +33 -45
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/popover/popover.js +12 -13
- package/mtds/popover/popover.js.map +1 -1
- package/mtds/print/print.css.js +155 -0
- package/mtds/print/print.css.js.map +1 -0
- package/mtds/print/print.stories.d.ts +15 -0
- package/mtds/progress/progress.js +8 -8
- package/mtds/progress/progress.js.map +1 -1
- package/mtds/react-atlas.js +13 -12
- package/mtds/react.js +80 -80
- package/mtds/skeleton/skeleton.js +8 -8
- package/mtds/skeleton/skeleton.js.map +1 -1
- package/mtds/spinner/spinner.js +8 -8
- package/mtds/spinner/spinner.js.map +1 -1
- package/mtds/steps/steps.js +7 -7
- package/mtds/steps/steps.js.map +1 -1
- package/mtds/styles.css +1 -4605
- package/mtds/styles.json +43 -43
- package/mtds/styles.module.css.js +112 -167
- package/mtds/styles.module.css.js.map +1 -1
- package/mtds/table/table-observer.js +19 -22
- package/mtds/table/table-observer.js.map +1 -1
- package/mtds/table/table.d.ts +7 -0
- package/mtds/table/table.js +43 -18
- package/mtds/table/table.js.map +1 -1
- package/mtds/tabs/tabs.js +21 -25
- package/mtds/tabs/tabs.js.map +1 -1
- package/mtds/tag/tag.js +8 -8
- package/mtds/tag/tag.js.map +1 -1
- package/mtds/tailwind.css +4 -24
- package/mtds/toast/toast-helper.js +20 -35
- package/mtds/toast/toast-helper.js.map +1 -1
- package/mtds/toast/toast-observer.js +15 -30
- package/mtds/toast/toast-observer.js.map +1 -1
- package/mtds/toast/toast.js +37 -45
- package/mtds/toast/toast.js.map +1 -1
- package/mtds/togglegroup/togglegroup-observer.js +10 -15
- package/mtds/togglegroup/togglegroup-observer.js.map +1 -1
- package/mtds/togglegroup/togglegroup.js +24 -21
- package/mtds/togglegroup/togglegroup.js.map +1 -1
- package/mtds/tooltip/tooltip-observer.js +32 -48
- package/mtds/tooltip/tooltip-observer.js.map +1 -1
- package/mtds/typography/typography.js +19 -28
- package/mtds/typography/typography.js.map +1 -1
- package/mtds/utils.js +89 -129
- package/mtds/utils.js.map +1 -1
- package/mtds/validation/validation-observer.js +25 -31
- package/mtds/validation/validation-observer.js.map +1 -1
- package/mtds/validation/validation.js +12 -12
- package/mtds/validation/validation.js.map +1 -1
- package/package.json +13 -12
package/mtds/dialog/dialog.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import { forwardRef as l } from "react";
|
|
4
|
+
import d from "../styles.module.css.js";
|
|
5
|
+
const g = l(
|
|
6
|
+
function({ className: a, modal: r = !0, ...o }, m) {
|
|
7
|
+
return /* @__PURE__ */ t(
|
|
8
8
|
"dialog",
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
"data-modal":
|
|
12
|
-
ref,
|
|
13
|
-
...
|
|
10
|
+
className: i(d.dialog, a),
|
|
11
|
+
"data-modal": o["data-modal"] ?? r,
|
|
12
|
+
ref: m,
|
|
13
|
+
...o
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
export {
|
|
19
|
-
Dialog
|
|
19
|
+
g as Dialog
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\tmodal?: boolean; // Ketp for backwards compatibility\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog"],"mappings":";;;;AAUO,
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../designsystem/dialog/dialog.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DialogProps = React.ComponentPropsWithoutRef<\"dialog\"> & {\n\t\"data-closedby\"?: \"any\" | \"closerequest\";\n\t\"data-modal\"?: boolean | \"true\" | \"false\";\n\tmodal?: boolean; // Ketp for backwards compatibility\n};\n\nexport const Dialog = forwardRef<HTMLDialogElement, DialogProps>(\n\tfunction Dialog({ className, modal = true, ...rest }, ref) {\n\t\treturn (\n\t\t\t<dialog\n\t\t\t\tclassName={clsx(styles.dialog, className)}\n\t\t\t\tdata-modal={rest[\"data-modal\"] ?? modal}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Dialog","forwardRef","className","modal","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAUO,MAAMA,IAASC;AAAA,EACrB,SAAgB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,IAAM,GAAGC,EAAA,GAAQC,GAAK;AAC1D,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,QAAQN,CAAS;AAAA,QACxC,cAAYE,EAAK,YAAY,KAAKD;AAAA,QAClC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
|
package/mtds/divider/divider.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import d from "../styles.module.css.js";
|
|
5
|
+
const c = m(function({ className: r, ...i }, o) {
|
|
6
6
|
return (
|
|
7
7
|
// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element
|
|
8
|
-
/* @__PURE__ */
|
|
8
|
+
/* @__PURE__ */ e(
|
|
9
9
|
"hr",
|
|
10
10
|
{
|
|
11
11
|
"aria-hidden": "true",
|
|
12
|
-
className:
|
|
13
|
-
ref,
|
|
14
|
-
...
|
|
12
|
+
className: t(d.divider, r),
|
|
13
|
+
ref: o,
|
|
14
|
+
...i
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
);
|
|
18
18
|
});
|
|
19
19
|
export {
|
|
20
|
-
Divider
|
|
20
|
+
c as Divider
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30\n\t\t// Backwards compatibility:\n\t\t| \"none\"\n\t\t| \"xs\"\n\t\t| \"sm\"\n\t\t| \"md\"\n\t\t| \"lg\"\n\t\t| \"xl\";\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"names":["Divider"],"mappings":";;;;AAuDO,
|
|
1
|
+
{"version":3,"file":"divider.js","sources":["../../designsystem/divider/divider.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type DividerProps = React.ComponentPropsWithoutRef<\"hr\"> & {\n\t\"data-gap\"?:\n\t\t| \"0\"\n\t\t| \"1\"\n\t\t| \"2\"\n\t\t| \"3\"\n\t\t| \"4\"\n\t\t| \"5\"\n\t\t| \"6\"\n\t\t| \"7\"\n\t\t| \"8\"\n\t\t| \"9\"\n\t\t| \"10\"\n\t\t| \"11\"\n\t\t| \"12\"\n\t\t| \"13\"\n\t\t| \"14\"\n\t\t| \"15\"\n\t\t| \"18\"\n\t\t| \"22\"\n\t\t| \"26\"\n\t\t| \"30\"\n\t\t| 0\n\t\t| 1\n\t\t| 2\n\t\t| 3\n\t\t| 4\n\t\t| 5\n\t\t| 6\n\t\t| 7\n\t\t| 8\n\t\t| 9\n\t\t| 10\n\t\t| 11\n\t\t| 12\n\t\t| 13\n\t\t| 14\n\t\t| 15\n\t\t| 18\n\t\t| 22\n\t\t| 26\n\t\t| 30\n\t\t// Backwards compatibility:\n\t\t| \"none\"\n\t\t| \"xs\"\n\t\t| \"sm\"\n\t\t| \"md\"\n\t\t| \"lg\"\n\t\t| \"xl\";\n};\n\nexport const Divider = forwardRef<HTMLHRElement, DividerProps>(function Divider(\n\t{ className, ...rest },\n\tref,\n) {\n\treturn (\n\t\t// biome-ignore lint/a11y/noAriaHiddenOnFocusable: This is a decorative element\n\t\t<hr\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={clsx(styles.divider, className)}\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n"],"names":["Divider","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAuDO,MAAMA,IAAUC,EAAwC,SAC9D,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAChBC,GACC;AACD;AAAA;AAAA,IAEC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,eAAY;AAAA,QACZ,WAAWC,EAAKC,EAAO,SAASL,CAAS;AAAA,QACzC,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA;AAGP,CAAC;"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { onLoaded, on, QUICK_EVENT, attr } from "../utils.js";
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
attr(first, "tabindex", "-1");
|
|
8
|
-
first.focus();
|
|
9
|
-
}
|
|
1
|
+
import r from "../styles.module.css.js";
|
|
2
|
+
import { onLoaded as o, on as e, QUICK_EVENT as i, attr as a } from "../utils.js";
|
|
3
|
+
function m(t) {
|
|
4
|
+
if (t.animationName !== r._errorsummary) return;
|
|
5
|
+
const n = t.target?.firstElementChild;
|
|
6
|
+
n instanceof HTMLHeadingElement && (a(n, "tabindex", "-1"), n.focus());
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
o(() => [
|
|
9
|
+
e(document, "animationend", m, i)
|
|
13
10
|
]);
|
|
14
11
|
//# sourceMappingURL=errorsummary-observer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorsummary-observer.js","sources":["../../designsystem/errorsummary/errorsummary-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nfunction handleErrosummaryInject(event: Event & { animationName?: string }) {\n\tif (event.animationName !== styles._errorsummary) return;\n\tconst first = (event.target as Element)?.firstElementChild;\n\n\tif (first instanceof HTMLHeadingElement) {\n\t\tattr(first, \"tabindex\", \"-1\");\n\t\tfirst.focus(); // Autofocus first heading\n\t}\n}\n\nonLoaded(() => [\n\ton(document, \"animationend\", handleErrosummaryInject, QUICK_EVENT),\n]);\n"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"errorsummary-observer.js","sources":["../../designsystem/errorsummary/errorsummary-observer.ts"],"sourcesContent":["import styles from \"../styles.module.css\";\nimport { attr, on, onLoaded, QUICK_EVENT } from \"../utils\";\n\nfunction handleErrosummaryInject(event: Event & { animationName?: string }) {\n\tif (event.animationName !== styles._errorsummary) return;\n\tconst first = (event.target as Element)?.firstElementChild;\n\n\tif (first instanceof HTMLHeadingElement) {\n\t\tattr(first, \"tabindex\", \"-1\");\n\t\tfirst.focus(); // Autofocus first heading\n\t}\n}\n\nonLoaded(() => [\n\ton(document, \"animationend\", handleErrosummaryInject, QUICK_EVENT),\n]);\n"],"names":["handleErrosummaryInject","event","styles","first","attr","onLoaded","on","QUICK_EVENT"],"mappings":";;AAGA,SAASA,EAAwBC,GAA2C;AAC3E,MAAIA,EAAM,kBAAkBC,EAAO,cAAe;AAClD,QAAMC,IAASF,EAAM,QAAoB;AAEzC,EAAIE,aAAiB,uBACpBC,EAAKD,GAAO,YAAY,IAAI,GAC5BA,EAAM,MAAA;AAER;AAEAE,EAAS,MAAM;AAAA,EACdC,EAAG,UAAU,gBAAgBN,GAAyBO,CAAW;AAClE,CAAC;"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { forwardRef as e } from "react";
|
|
4
|
+
import a from "../styles.module.css.js";
|
|
5
|
+
const c = e(
|
|
6
|
+
function({ className: r, ...o }, m) {
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
10
|
+
className: t(a.errorsummary, r),
|
|
11
11
|
role: "alert",
|
|
12
|
-
ref,
|
|
13
|
-
...
|
|
12
|
+
ref: m,
|
|
13
|
+
...o
|
|
14
14
|
}
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
18
|
export {
|
|
19
|
-
Errorsummary
|
|
19
|
+
c as Errorsummary
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=errorsummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorsummary.js","sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type ErrorsummaryProps = React.ComponentPropsWithoutRef<\"div\">;\n\nexport const Errorsummary = forwardRef<HTMLDivElement, ErrorsummaryProps>(\n\tfunction Errorsummary({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={clsx(styles.errorsummary, className)}\n\t\t\t\trole=\"alert\"\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Errorsummary"],"mappings":";;;;AAMO,
|
|
1
|
+
{"version":3,"file":"errorsummary.js","sources":["../../designsystem/errorsummary/errorsummary.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { forwardRef } from \"react\";\nimport styles from \"../styles.module.css\";\n\nexport type ErrorsummaryProps = React.ComponentPropsWithoutRef<\"div\">;\n\nexport const Errorsummary = forwardRef<HTMLDivElement, ErrorsummaryProps>(\n\tfunction Errorsummary({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclassName={clsx(styles.errorsummary, className)}\n\t\t\t\trole=\"alert\"\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"names":["Errorsummary","forwardRef","className","rest","ref","jsx","clsx","styles"],"mappings":";;;;AAMO,MAAMA,IAAeC;AAAA,EAC3B,SAAsB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAQC,GAAK;AAClD,WACC,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACA,WAAWC,EAAKC,EAAO,cAAcL,CAAS;AAAA,QAC9C,MAAK;AAAA,QACL,KAAAE;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD;"}
|
|
@@ -1,35 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getCoord, getGeom } from "../../../invariant/dist/esm/index.js";
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
1
|
+
import c from "../../../../point-in-polygon-hao/dist/esm/index.js";
|
|
2
|
+
import { getCoord as g, getGeom as y } from "../../../invariant/dist/esm/index.js";
|
|
3
|
+
function w(r, o, u = {}) {
|
|
4
|
+
if (!r)
|
|
5
5
|
throw new Error("point is required");
|
|
6
|
-
|
|
7
|
-
if (!polygon) {
|
|
6
|
+
if (!o)
|
|
8
7
|
throw new Error("polygon is required");
|
|
8
|
+
const n = g(r), i = y(o), a = i.type, s = o.bbox;
|
|
9
|
+
let e = i.coordinates;
|
|
10
|
+
if (s && m(n, s) === !1)
|
|
11
|
+
return !1;
|
|
12
|
+
a === "Polygon" && (e = [e]);
|
|
13
|
+
let f = !1;
|
|
14
|
+
for (var t = 0; t < e.length; ++t) {
|
|
15
|
+
const l = c(n, e[t]);
|
|
16
|
+
if (l === 0) return !u.ignoreBoundary;
|
|
17
|
+
l && (f = !0);
|
|
9
18
|
}
|
|
10
|
-
|
|
11
|
-
const geom = getGeom(polygon);
|
|
12
|
-
const type = geom.type;
|
|
13
|
-
const bbox = polygon.bbox;
|
|
14
|
-
let polys = geom.coordinates;
|
|
15
|
-
if (bbox && inBBox(pt, bbox) === false) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
if (type === "Polygon") {
|
|
19
|
-
polys = [polys];
|
|
20
|
-
}
|
|
21
|
-
let result = false;
|
|
22
|
-
for (var i = 0; i < polys.length; ++i) {
|
|
23
|
-
const polyResult = pointInPolygon(pt, polys[i]);
|
|
24
|
-
if (polyResult === 0) return options.ignoreBoundary ? false : true;
|
|
25
|
-
else if (polyResult) result = true;
|
|
26
|
-
}
|
|
27
|
-
return result;
|
|
19
|
+
return f;
|
|
28
20
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
21
|
+
function m(r, o) {
|
|
22
|
+
return o[0] <= r[0] && o[1] <= r[1] && o[2] >= r[0] && o[3] >= r[1];
|
|
31
23
|
}
|
|
32
24
|
export {
|
|
33
|
-
booleanPointInPolygon
|
|
25
|
+
w as booleanPointInPolygon
|
|
34
26
|
};
|
|
35
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport pip from \"point-in-polygon-hao\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nfunction booleanPointInPolygon(point, polygon, options = {}) {\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n const pt = getCoord(point);\n const geom = getGeom(polygon);\n const type = geom.type;\n const bbox = polygon.bbox;\n let polys = geom.coordinates;\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n if (type === \"Polygon\") {\n polys = [polys];\n }\n let result = false;\n for (var i = 0; i < polys.length; ++i) {\n const polyResult = pip(pt, polys[i]);\n if (polyResult === 0) return options.ignoreBoundary ? false : true;\n else if (polyResult) result = true;\n }\n return result;\n}\nfunction inBBox(pt, bbox) {\n return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];\n}\nvar index_default = booleanPointInPolygon;\nexport {\n booleanPointInPolygon,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"names":["pip"],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport pip from \"point-in-polygon-hao\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nfunction booleanPointInPolygon(point, polygon, options = {}) {\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n const pt = getCoord(point);\n const geom = getGeom(polygon);\n const type = geom.type;\n const bbox = polygon.bbox;\n let polys = geom.coordinates;\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n if (type === \"Polygon\") {\n polys = [polys];\n }\n let result = false;\n for (var i = 0; i < polys.length; ++i) {\n const polyResult = pip(pt, polys[i]);\n if (polyResult === 0) return options.ignoreBoundary ? false : true;\n else if (polyResult) result = true;\n }\n return result;\n}\nfunction inBBox(pt, bbox) {\n return bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1];\n}\nvar index_default = booleanPointInPolygon;\nexport {\n booleanPointInPolygon,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"names":["booleanPointInPolygon","point","polygon","options","pt","getCoord","geom","getGeom","type","bbox","polys","inBBox","result","i","polyResult","pip"],"mappings":";;AAGA,SAASA,EAAsBC,GAAOC,GAASC,IAAU,CAAA,GAAI;AAC3D,MAAI,CAACF;AACH,UAAM,IAAI,MAAM,mBAAmB;AAErC,MAAI,CAACC;AACH,UAAM,IAAI,MAAM,qBAAqB;AAEvC,QAAME,IAAKC,EAASJ,CAAK,GACnBK,IAAOC,EAAQL,CAAO,GACtBM,IAAOF,EAAK,MACZG,IAAOP,EAAQ;AACrB,MAAIQ,IAAQJ,EAAK;AACjB,MAAIG,KAAQE,EAAOP,GAAIK,CAAI,MAAM;AAC/B,WAAO;AAET,EAAID,MAAS,cACXE,IAAQ,CAACA,CAAK;AAEhB,MAAIE,IAAS;AACb,WAASC,IAAI,GAAGA,IAAIH,EAAM,QAAQ,EAAEG,GAAG;AACrC,UAAMC,IAAaC,EAAIX,GAAIM,EAAMG,CAAC,CAAC;AACnC,QAAIC,MAAe,EAAG,QAAO,CAAAX,EAAQ;AAChC,IAAIW,MAAYF,IAAS;AAAA,EAChC;AACA,SAAOA;AACT;AACA,SAASD,EAAOP,GAAIK,GAAM;AACxB,SAAOA,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC,KAAKK,EAAK,CAAC,KAAKL,EAAG,CAAC;AACpF;","x_google_ignoreList":[0]}
|
|
@@ -1,40 +1,27 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
feat.id = options.id;
|
|
5
|
-
}
|
|
6
|
-
if (options.bbox) {
|
|
7
|
-
feat.bbox = options.bbox;
|
|
8
|
-
}
|
|
9
|
-
feat.properties = {};
|
|
10
|
-
feat.geometry = geom;
|
|
11
|
-
return feat;
|
|
1
|
+
function o(r, i, e = {}) {
|
|
2
|
+
const t = { type: "Feature" };
|
|
3
|
+
return (e.id === 0 || e.id) && (t.id = e.id), e.bbox && (t.bbox = e.bbox), t.properties = {}, t.geometry = r, t;
|
|
12
4
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
5
|
+
function u(r, i, e = {}) {
|
|
6
|
+
if (!r)
|
|
15
7
|
throw new Error("coordinates is required");
|
|
16
|
-
|
|
17
|
-
if (!Array.isArray(coordinates)) {
|
|
8
|
+
if (!Array.isArray(r))
|
|
18
9
|
throw new Error("coordinates must be an Array");
|
|
19
|
-
|
|
20
|
-
if (coordinates.length < 2) {
|
|
10
|
+
if (r.length < 2)
|
|
21
11
|
throw new Error("coordinates must be at least 2 numbers long");
|
|
22
|
-
|
|
23
|
-
if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {
|
|
12
|
+
if (!n(r[0]) || !n(r[1]))
|
|
24
13
|
throw new Error("coordinates must contain numbers");
|
|
25
|
-
|
|
26
|
-
const geom = {
|
|
14
|
+
return o({
|
|
27
15
|
type: "Point",
|
|
28
|
-
coordinates
|
|
29
|
-
};
|
|
30
|
-
return feature(geom, properties, options);
|
|
16
|
+
coordinates: r
|
|
17
|
+
}, i, e);
|
|
31
18
|
}
|
|
32
|
-
function
|
|
33
|
-
return !isNaN(
|
|
19
|
+
function n(r) {
|
|
20
|
+
return !isNaN(r) && r !== null && !Array.isArray(r);
|
|
34
21
|
}
|
|
35
22
|
export {
|
|
36
|
-
feature,
|
|
37
|
-
isNumber,
|
|
38
|
-
point
|
|
23
|
+
o as feature,
|
|
24
|
+
n as isNumber,
|
|
25
|
+
u as point
|
|
39
26
|
};
|
|
40
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/helpers/dist/esm/index.js"],"sourcesContent":["// index.ts\nvar earthRadius = 63710088e-1;\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: 360 / (2 * Math.PI),\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1e3,\n kilometres: earthRadius / 1e3,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1e3,\n millimetres: earthRadius * 1e3,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius * 1.0936\n};\nvar areaFactors = {\n acres: 247105e-9,\n centimeters: 1e4,\n centimetres: 1e4,\n feet: 10.763910417,\n hectares: 1e-4,\n inches: 1550.003100006,\n kilometers: 1e-6,\n kilometres: 1e-6,\n meters: 1,\n metres: 1,\n miles: 386e-9,\n nauticalmiles: 29155334959812285e-23,\n millimeters: 1e6,\n millimetres: 1e6,\n yards: 1.195990046\n};\nfunction feature(geom, properties, options = {}) {\n const feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\nfunction geometry(type, coordinates, _options = {}) {\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\nfunction point(coordinates, properties, options = {}) {\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n const geom = {\n type: \"Point\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction points(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return point(coords, properties);\n }),\n options\n );\n}\nfunction polygon(coordinates, properties, options = {}) {\n for (const ring of coordinates) {\n if (ring.length < 4) {\n throw new Error(\n \"Each LinearRing of a Polygon must have 4 or more Positions.\"\n );\n }\n if (ring[ring.length - 1].length !== ring[0].length) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n for (let j = 0; j < ring[ring.length - 1].length; j++) {\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n const geom = {\n type: \"Polygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction polygons(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return polygon(coords, properties);\n }),\n options\n );\n}\nfunction lineString(coordinates, properties, options = {}) {\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n const geom = {\n type: \"LineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction lineStrings(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return lineString(coords, properties);\n }),\n options\n );\n}\nfunction featureCollection(features, options = {}) {\n const fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\nfunction multiLineString(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiLineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPoint(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPoint\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPolygon(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPolygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction geometryCollection(geometries, properties, options = {}) {\n const geom = {\n type: \"GeometryCollection\",\n geometries\n };\n return feature(geom, properties, options);\n}\nfunction round(num, precision = 0) {\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n const multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\nfunction radiansToLength(radians, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\nfunction lengthToRadians(distance, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\nfunction bearingToAzimuth(bearing) {\n let angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\nfunction azimuthToBearing(angle) {\n angle = angle % 360;\n if (angle > 180) {\n return angle - 360;\n } else if (angle < -180) {\n return angle + 360;\n }\n return angle;\n}\nfunction radiansToDegrees(radians) {\n const normalisedRadians = radians % (2 * Math.PI);\n return normalisedRadians * 180 / Math.PI;\n}\nfunction degreesToRadians(degrees) {\n const normalisedDegrees = degrees % 360;\n return normalisedDegrees * Math.PI / 180;\n}\nfunction convertLength(length, originalUnit = \"kilometers\", finalUnit = \"kilometers\") {\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\nfunction convertArea(area, originalUnit = \"meters\", finalUnit = \"kilometers\") {\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n const startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n const finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return area / startFactor * finalFactor;\n}\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\nfunction isObject(input) {\n return input !== null && typeof input === \"object\" && !Array.isArray(input);\n}\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach((num) => {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\nexport {\n areaFactors,\n azimuthToBearing,\n bearingToAzimuth,\n convertArea,\n convertLength,\n degreesToRadians,\n earthRadius,\n factors,\n feature,\n featureCollection,\n geometry,\n geometryCollection,\n isNumber,\n isObject,\n lengthToDegrees,\n lengthToRadians,\n lineString,\n lineStrings,\n multiLineString,\n multiPoint,\n multiPolygon,\n point,\n points,\n polygon,\n polygons,\n radiansToDegrees,\n radiansToLength,\n round,\n validateBBox,\n validateId\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAoCA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/helpers/dist/esm/index.js"],"sourcesContent":["// index.ts\nvar earthRadius = 63710088e-1;\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: 360 / (2 * Math.PI),\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1e3,\n kilometres: earthRadius / 1e3,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1e3,\n millimetres: earthRadius * 1e3,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius * 1.0936\n};\nvar areaFactors = {\n acres: 247105e-9,\n centimeters: 1e4,\n centimetres: 1e4,\n feet: 10.763910417,\n hectares: 1e-4,\n inches: 1550.003100006,\n kilometers: 1e-6,\n kilometres: 1e-6,\n meters: 1,\n metres: 1,\n miles: 386e-9,\n nauticalmiles: 29155334959812285e-23,\n millimeters: 1e6,\n millimetres: 1e6,\n yards: 1.195990046\n};\nfunction feature(geom, properties, options = {}) {\n const feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\nfunction geometry(type, coordinates, _options = {}) {\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\nfunction point(coordinates, properties, options = {}) {\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n const geom = {\n type: \"Point\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction points(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return point(coords, properties);\n }),\n options\n );\n}\nfunction polygon(coordinates, properties, options = {}) {\n for (const ring of coordinates) {\n if (ring.length < 4) {\n throw new Error(\n \"Each LinearRing of a Polygon must have 4 or more Positions.\"\n );\n }\n if (ring[ring.length - 1].length !== ring[0].length) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n for (let j = 0; j < ring[ring.length - 1].length; j++) {\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n const geom = {\n type: \"Polygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction polygons(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return polygon(coords, properties);\n }),\n options\n );\n}\nfunction lineString(coordinates, properties, options = {}) {\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n const geom = {\n type: \"LineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction lineStrings(coordinates, properties, options = {}) {\n return featureCollection(\n coordinates.map((coords) => {\n return lineString(coords, properties);\n }),\n options\n );\n}\nfunction featureCollection(features, options = {}) {\n const fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\nfunction multiLineString(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiLineString\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPoint(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPoint\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction multiPolygon(coordinates, properties, options = {}) {\n const geom = {\n type: \"MultiPolygon\",\n coordinates\n };\n return feature(geom, properties, options);\n}\nfunction geometryCollection(geometries, properties, options = {}) {\n const geom = {\n type: \"GeometryCollection\",\n geometries\n };\n return feature(geom, properties, options);\n}\nfunction round(num, precision = 0) {\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n const multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\nfunction radiansToLength(radians, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\nfunction lengthToRadians(distance, units = \"kilometers\") {\n const factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\nfunction bearingToAzimuth(bearing) {\n let angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\nfunction azimuthToBearing(angle) {\n angle = angle % 360;\n if (angle > 180) {\n return angle - 360;\n } else if (angle < -180) {\n return angle + 360;\n }\n return angle;\n}\nfunction radiansToDegrees(radians) {\n const normalisedRadians = radians % (2 * Math.PI);\n return normalisedRadians * 180 / Math.PI;\n}\nfunction degreesToRadians(degrees) {\n const normalisedDegrees = degrees % 360;\n return normalisedDegrees * Math.PI / 180;\n}\nfunction convertLength(length, originalUnit = \"kilometers\", finalUnit = \"kilometers\") {\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\nfunction convertArea(area, originalUnit = \"meters\", finalUnit = \"kilometers\") {\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n const startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n const finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return area / startFactor * finalFactor;\n}\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\nfunction isObject(input) {\n return input !== null && typeof input === \"object\" && !Array.isArray(input);\n}\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach((num) => {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\nexport {\n areaFactors,\n azimuthToBearing,\n bearingToAzimuth,\n convertArea,\n convertLength,\n degreesToRadians,\n earthRadius,\n factors,\n feature,\n featureCollection,\n geometry,\n geometryCollection,\n isNumber,\n isObject,\n lengthToDegrees,\n lengthToRadians,\n lineString,\n lineStrings,\n multiLineString,\n multiPoint,\n multiPolygon,\n point,\n points,\n polygon,\n polygons,\n radiansToDegrees,\n radiansToLength,\n round,\n validateBBox,\n validateId\n};\n//# sourceMappingURL=index.js.map"],"names":["feature","geom","properties","options","feat","point","coordinates","isNumber","num"],"mappings":"AAoCA,SAASA,EAAQC,GAAMC,GAAYC,IAAU,CAAA,GAAI;AAC/C,QAAMC,IAAO,EAAE,MAAM,UAAS;AAC9B,UAAID,EAAQ,OAAO,KAAKA,EAAQ,QAC9BC,EAAK,KAAKD,EAAQ,KAEhBA,EAAQ,SACVC,EAAK,OAAOD,EAAQ,OAEtBC,EAAK,aAA2B,CAAA,GAChCA,EAAK,WAAWH,GACTG;AACT;AAmBA,SAASC,EAAMC,GAAaJ,GAAYC,IAAU,CAAA,GAAI;AACpD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,yBAAyB;AAE3C,MAAI,CAAC,MAAM,QAAQA,CAAW;AAC5B,UAAM,IAAI,MAAM,8BAA8B;AAEhD,MAAIA,EAAY,SAAS;AACvB,UAAM,IAAI,MAAM,6CAA6C;AAE/D,MAAI,CAACC,EAASD,EAAY,CAAC,CAAC,KAAK,CAACC,EAASD,EAAY,CAAC,CAAC;AACvD,UAAM,IAAI,MAAM,kCAAkC;AAMpD,SAAON,EAJM;AAAA,IACX,MAAM;AAAA,IACN,aAAAM;AAAA,EACJ,GACuBJ,GAAYC,CAAO;AAC1C;AAoKA,SAASI,EAASC,GAAK;AACrB,SAAO,CAAC,MAAMA,CAAG,KAAKA,MAAQ,QAAQ,CAAC,MAAM,QAAQA,CAAG;AAC1D;","x_google_ignoreList":[0]}
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!
|
|
1
|
+
function e(r) {
|
|
2
|
+
if (!r)
|
|
3
3
|
throw new Error("coord is required");
|
|
4
|
+
if (!Array.isArray(r)) {
|
|
5
|
+
if (r.type === "Feature" && r.geometry !== null && r.geometry.type === "Point")
|
|
6
|
+
return [...r.geometry.coordinates];
|
|
7
|
+
if (r.type === "Point")
|
|
8
|
+
return [...r.coordinates];
|
|
4
9
|
}
|
|
5
|
-
if (!Array.isArray(
|
|
6
|
-
|
|
7
|
-
return [...coord.geometry.coordinates];
|
|
8
|
-
}
|
|
9
|
-
if (coord.type === "Point") {
|
|
10
|
-
return [...coord.coordinates];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
|
|
14
|
-
return [...coord];
|
|
15
|
-
}
|
|
10
|
+
if (Array.isArray(r) && r.length >= 2 && !Array.isArray(r[0]) && !Array.isArray(r[1]))
|
|
11
|
+
return [...r];
|
|
16
12
|
throw new Error("coord must be GeoJSON Point or an Array of numbers");
|
|
17
13
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
return geojson.geometry;
|
|
21
|
-
}
|
|
22
|
-
return geojson;
|
|
14
|
+
function t(r) {
|
|
15
|
+
return r.type === "Feature" ? r.geometry : r;
|
|
23
16
|
}
|
|
24
17
|
export {
|
|
25
|
-
getCoord,
|
|
26
|
-
getGeom
|
|
18
|
+
e as getCoord,
|
|
19
|
+
t as getGeom
|
|
27
20
|
};
|
|
28
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/invariant/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport { isNumber } from \"@turf/helpers\";\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" && coord.geometry !== null && coord.geometry.type === \"Point\") {\n return [...coord.geometry.coordinates];\n }\n if (coord.type === \"Point\") {\n return [...coord.coordinates];\n }\n }\n if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {\n return [...coord];\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n } else {\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\n \"coords must be GeoJSON Feature, Geometry Object or an Array\"\n );\n}\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 && isNumber(coordinates[0]) && isNumber(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + value.type\n );\n }\n}\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n}\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\n \"Invalid input to \" + name + \", FeatureCollection required\"\n );\n }\n for (const feature of featureCollection.features) {\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n }\n}\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\nexport {\n collectionOf,\n containsNumber,\n featureOf,\n geojsonType,\n getCoord,\n getCoords,\n getGeom,\n getType\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../node_modules/@turf/invariant/dist/esm/index.js"],"sourcesContent":["// index.ts\nimport { isNumber } from \"@turf/helpers\";\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" && coord.geometry !== null && coord.geometry.type === \"Point\") {\n return [...coord.geometry.coordinates];\n }\n if (coord.type === \"Point\") {\n return [...coord.coordinates];\n }\n }\n if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {\n return [...coord];\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n } else {\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\n \"coords must be GeoJSON Feature, Geometry Object or an Array\"\n );\n}\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 && isNumber(coordinates[0]) && isNumber(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + value.type\n );\n }\n}\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n}\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\n \"Invalid input to \" + name + \", FeatureCollection required\"\n );\n }\n for (const feature of featureCollection.features) {\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\n \"Invalid input to \" + name + \", Feature with geometry required\"\n );\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\n \"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type\n );\n }\n }\n}\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\nexport {\n collectionOf,\n containsNumber,\n featureOf,\n geojsonType,\n getCoord,\n getCoords,\n getGeom,\n getType\n};\n//# sourceMappingURL=index.js.map"],"names":["getCoord","coord","getGeom","geojson"],"mappings":"AAEA,SAASA,EAASC,GAAO;AACvB,MAAI,CAACA;AACH,UAAM,IAAI,MAAM,mBAAmB;AAErC,MAAI,CAAC,MAAM,QAAQA,CAAK,GAAG;AACzB,QAAIA,EAAM,SAAS,aAAaA,EAAM,aAAa,QAAQA,EAAM,SAAS,SAAS;AACjF,aAAO,CAAC,GAAGA,EAAM,SAAS,WAAW;AAEvC,QAAIA,EAAM,SAAS;AACjB,aAAO,CAAC,GAAGA,EAAM,WAAW;AAAA,EAEhC;AACA,MAAI,MAAM,QAAQA,CAAK,KAAKA,EAAM,UAAU,KAAK,CAAC,MAAM,QAAQA,EAAM,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQA,EAAM,CAAC,CAAC;AAClG,WAAO,CAAC,GAAGA,CAAK;AAElB,QAAM,IAAI,MAAM,oDAAoD;AACtE;AAgFA,SAASC,EAAQC,GAAS;AACxB,SAAIA,EAAQ,SAAS,YACZA,EAAQ,WAEVA;AACT;","x_google_ignoreList":[0]}
|