@sjvair/monitor-map 3.0.0 → 3.0.1
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/lib/LoadScreen.js +73 -0
- package/dist/lib/actions.js +9 -0
- package/dist/lib/assets/icons/adjustment-horizontal.js +4 -0
- package/dist/lib/collocation-sites/CollocationTooltip.js +105 -0
- package/dist/lib/collocation-sites/collocations-icon-manager.svelte.js +21 -0
- package/dist/lib/collocation-sites/collocations-map-integration.svelte.js +84 -0
- package/dist/lib/collocation-sites/collocations.svelte.js +26 -0
- package/dist/lib/colors.js +25 -0
- package/dist/lib/components/DataBox.js +30 -0
- package/dist/lib/components/DisplayOption.js +10 -0
- package/dist/lib/components/MapLayersDisplayOptions.js +71 -0
- package/dist/lib/components/SegmentedControl.js +37 -0
- package/dist/lib/components/ToggleSwitch.js +17 -0
- package/dist/lib/components/ui/button/button.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-caption.js +79 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-cell.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-day.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-body.js +26 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-head.js +26 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-grid-row.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-grid.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-head-cell.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-header.js +34 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-month-select.js +61 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-month.js +25 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-months.js +25 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-nav.js +25 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-next-button.js +57 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-prev-button.js +57 -0
- package/dist/lib/components/ui/range-calendar/range-calendar-year-select.js +59 -0
- package/dist/lib/components/ui/range-calendar/range-calendar.js +272 -0
- package/dist/lib/data-chart/DataChart.js +142 -0
- package/dist/lib/data-chart/DateRange.js +15 -0
- package/dist/lib/data-chart/chart-utils.js +99 -0
- package/dist/lib/data-chart/data-chart.svelte.js +28 -0
- package/dist/lib/data-chart/requests.js +30 -0
- package/dist/lib/data-chart/tooltip.js +101 -0
- package/dist/lib/hms/hms-fire-icon-manager.js +39 -0
- package/dist/lib/hms/hms-fire-map-integration.svelte.js +97 -0
- package/dist/lib/hms/hms-smoke-map-integration.svelte.js +84 -0
- package/dist/lib/hms/hms.svelte.js +78 -0
- package/dist/lib/index.js +19 -0
- package/dist/lib/map/Map.js +14 -0
- package/dist/lib/map/MapStyleDisplayOptions.js +43 -0
- package/dist/lib/map/Menu.js +45 -0
- package/dist/lib/map/icons.js +31 -0
- package/dist/lib/map/integrations/base-layer-seperator.js +12 -0
- package/dist/lib/map/integrations/click-manager.js +33 -0
- package/dist/lib/map/integrations/integrations-manager.js +12 -0
- package/dist/lib/map/integrations/map-display-option.svelte.js +17 -0
- package/dist/lib/map/integrations/map-geojson-integration.svelte.js +17 -0
- package/dist/lib/map/integrations/map-icon-manager.js +43 -0
- package/dist/lib/map/integrations/map-integration.svelte.js +5 -0
- package/dist/lib/map/integrations/map-layer-integration.svelte.js +23 -0
- package/dist/lib/map/integrations/tooltip.svelte.js +81 -0
- package/dist/lib/map/map.svelte.js +51 -0
- package/dist/lib/map/utils.js +30 -0
- package/dist/lib/monitors/components/MonitorClusterTooltip.js +83 -0
- package/dist/lib/monitors/components/MonitorSubscriptionManager.js +104 -0
- package/dist/lib/monitors/components/MonitorTooltip.js +59 -0
- package/dist/lib/monitors/components/MonitorWidgetModal.js +40 -0
- package/dist/lib/monitors/components/MonitorsDisplayOptions.js +67 -0
- package/dist/lib/monitors/monitor-utils.js +26 -0
- package/dist/lib/monitors/monitors-cluster-renderer.js +212 -0
- package/dist/lib/monitors/monitors-icon-manager.svelte.js +64 -0
- package/dist/lib/monitors/monitors-map-integration.svelte.js +264 -0
- package/dist/lib/monitors/monitors.svelte.js +68 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/CalendarDate.js +122 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/DateFormatter.js +84 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +91 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/conversion.js +104 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/manipulation.js +159 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/queries.js +32 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/string.js +37 -0
- package/dist/lib/node_modules/@internationalized/date/dist/private/utils.js +6 -0
- package/dist/lib/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/lib/node_modules/tailwind-merge/dist/bundle-mjs.js +1723 -0
- package/dist/lib/node_modules/tailwind-variants/dist/chunk-LQJYWU4O.js +70 -0
- package/dist/lib/node_modules/tailwind-variants/dist/chunk-RZF76H2U.js +166 -0
- package/dist/lib/node_modules/tailwind-variants/dist/index.js +19 -0
- package/dist/lib/node_modules/uplot/dist/uPlot.esm.js +2147 -0
- package/dist/lib/sjvair-air.avif +0 -0
- package/dist/lib/sjvair-air.png +0 -0
- package/dist/lib/sjvair-air.webp +0 -0
- package/dist/lib/sjvair-air2.avif +0 -0
- package/dist/lib/sjvair-air2.png +0 -0
- package/dist/lib/sjvair-air2.webp +0 -0
- package/dist/lib/sjvair-icon.avif +0 -0
- package/dist/lib/sjvair-icon.png +0 -0
- package/dist/lib/sjvair-icon.webp +0 -0
- package/dist/lib/sjvair-icon2.avif +0 -0
- package/dist/lib/sjvair-icon2.png +0 -0
- package/dist/lib/sjvair-icon2.webp +0 -0
- package/dist/lib/sjvair-sjv.avif +0 -0
- package/dist/lib/sjvair-sjv.png +0 -0
- package/dist/lib/sjvair-sjv.webp +0 -0
- package/dist/lib/sjvair-sjv2.avif +0 -0
- package/dist/lib/sjvair-sjv2.png +0 -0
- package/dist/lib/sjvair-sjv2.webp +0 -0
- package/dist/lib/src/MapView.js +7 -0
- package/dist/lib/src/MonitorDetailPanel.js +169 -0
- package/dist/lib/src/router.js +9 -0
- package/dist/lib/utils.js +8 -0
- package/dist/lib/weather.js +8 -0
- package/dist/lib/wind/wind.svelte.js +21 -0
- package/dist/monitor-map/MonitorDetailPanel.css +1 -0
- package/dist/monitor-map/assets/MonitorDetailPanel-DmN3xPui.js +15 -0
- package/dist/monitor-map/assets/validate-routes-CgbRa8fT.js +1 -0
- package/dist/monitor-map/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-greek-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-latin-wght-normal.woff2 +0 -0
- package/dist/monitor-map/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/monitor-map/lungs.svg +99 -0
- package/dist/monitor-map/sjvair-air.avif +0 -0
- package/dist/monitor-map/sjvair-air.png +0 -0
- package/dist/monitor-map/sjvair-air.webp +0 -0
- package/dist/monitor-map/sjvair-air2.avif +0 -0
- package/dist/monitor-map/sjvair-air2.png +0 -0
- package/dist/monitor-map/sjvair-air2.webp +0 -0
- package/dist/monitor-map/sjvair-icon.avif +0 -0
- package/dist/monitor-map/sjvair-icon.png +0 -0
- package/dist/monitor-map/sjvair-icon.webp +0 -0
- package/dist/monitor-map/sjvair-icon2.avif +0 -0
- package/dist/monitor-map/sjvair-icon2.png +0 -0
- package/dist/monitor-map/sjvair-icon2.webp +0 -0
- package/dist/monitor-map/sjvair-sjv.avif +0 -0
- package/dist/monitor-map/sjvair-sjv.png +0 -0
- package/dist/monitor-map/sjvair-sjv.webp +0 -0
- package/dist/monitor-map/sjvair-sjv2.avif +0 -0
- package/dist/monitor-map/sjvair-sjv2.png +0 -0
- package/dist/monitor-map/sjvair-sjv2.webp +0 -0
- package/dist/monitor-map/sjvairMonitorMap.css +1 -0
- package/dist/monitor-map/sjvairMonitorMap.js +4042 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
//#region src/lib/LoadScreen.svelte
|
|
4
|
+
var t = e.proxy({
|
|
5
|
+
enabled: !0,
|
|
6
|
+
entered: !1
|
|
7
|
+
});
|
|
8
|
+
function n() {
|
|
9
|
+
t.enabled ||= !0;
|
|
10
|
+
}
|
|
11
|
+
function r() {
|
|
12
|
+
t.enabled &&= !1;
|
|
13
|
+
}
|
|
14
|
+
var i = e.from_html("<div class=\"absolute top-0 left-0 z-50 flex h-full w-full flex-col items-center justify-center gap-4 overflow-hidden bg-white\"><div><picture><source type=\"image/avif\"/><source type=\"image/webp\"/><source type=\"image/png\"/><img alt=\"SJVAir Icon\" width=\"458\" height=\"458\"/></picture> <picture><source type=\"image/avif\"/><source type=\"image/webp\"/><source type=\"image/png\"/><img alt=\"SJV\" width=\"755\" height=\"458\"/></picture> <picture><source type=\"image/avif\"/><source type=\"image/webp\"/><source type=\"image/png\"/><img alt=\"Air\" width=\"469\" height=\"458\"/></picture></div></div>");
|
|
15
|
+
function a(n) {
|
|
16
|
+
let r = () => {
|
|
17
|
+
t.entered = !0;
|
|
18
|
+
};
|
|
19
|
+
var a = e.comment(), o = e.first_child(a), s = (n) => {
|
|
20
|
+
var a = i(), o = e.child(a), s = e.child(o), c = e.child(s);
|
|
21
|
+
e.set_attribute(c, "srcset", "/sjvair-icon2.avif 229w, /sjvair-icon.avif 458w");
|
|
22
|
+
var l = e.sibling(c);
|
|
23
|
+
e.set_attribute(l, "srcset", "/sjvair-icon.webp 229w, /sjvair-icon2.webp 458w");
|
|
24
|
+
var u = e.sibling(l);
|
|
25
|
+
e.set_attribute(u, "srcset", "/sjvair-icon2.png 229w, /sjvair-icon.png 458w");
|
|
26
|
+
var d = e.sibling(u);
|
|
27
|
+
e.set_attribute(d, "src", "/sjvair-icon.png");
|
|
28
|
+
let f;
|
|
29
|
+
e.reset(s);
|
|
30
|
+
var p = e.sibling(s, 2), m = e.child(p);
|
|
31
|
+
e.set_attribute(m, "srcset", "/sjvair-sjv2.avif 378w, /sjvair-sjv.avif 755w");
|
|
32
|
+
var h = e.sibling(m);
|
|
33
|
+
e.set_attribute(h, "srcset", "/sjvair-sjv2.webp 378w, /sjvair-sjv.webp 755w");
|
|
34
|
+
var g = e.sibling(h);
|
|
35
|
+
e.set_attribute(g, "srcset", "/sjvair-sjv.png 378w, /sjvair-sjv2.png 755w");
|
|
36
|
+
var _ = e.sibling(g);
|
|
37
|
+
e.set_attribute(_, "src", "/sjvair-sjv2.png");
|
|
38
|
+
let v;
|
|
39
|
+
e.reset(p);
|
|
40
|
+
var y = e.sibling(p, 2), b = e.child(y);
|
|
41
|
+
e.set_attribute(b, "srcset", "/sjvair-air.avif 235w, /sjvair-air2.avif 469w");
|
|
42
|
+
var x = e.sibling(b);
|
|
43
|
+
e.set_attribute(x, "srcset", "/sjvair-air2.webp 235w, /sjvair-air.webp 469w");
|
|
44
|
+
var S = e.sibling(x);
|
|
45
|
+
e.set_attribute(S, "srcset", "/sjvair-air.png 235w, /sjvair-air2.png 469w");
|
|
46
|
+
var C = e.sibling(S);
|
|
47
|
+
e.set_attribute(C, "src", "/sjvair-air2.png");
|
|
48
|
+
let w;
|
|
49
|
+
e.reset(y), e.reset(o), e.reset(a), e.attach(a, () => r), e.template_effect(() => {
|
|
50
|
+
f = e.set_class(d, 1, "icon inline-block h-24! w-auto! transition-all duration-500 ease-out", null, f, {
|
|
51
|
+
"translate-x-0": t.entered,
|
|
52
|
+
"-translate-x-full": !t.entered,
|
|
53
|
+
"opacity-100": t.entered,
|
|
54
|
+
"opacity-0": !t.entered
|
|
55
|
+
}), v = e.set_class(_, 1, "sjv inline-block h-24! w-auto! transition-all duration-500 ease-out", null, v, {
|
|
56
|
+
"translate-y-0": t.entered,
|
|
57
|
+
"-translate-y-full": !t.entered,
|
|
58
|
+
"opacity-100": t.entered,
|
|
59
|
+
"opacity-0": !t.entered
|
|
60
|
+
}), w = e.set_class(C, 1, "air inline-block h-24! w-auto! transition-all duration-500 ease-out", null, w, {
|
|
61
|
+
"translate-y-0": t.entered,
|
|
62
|
+
"translate-y-full": !t.entered,
|
|
63
|
+
"opacity-100": t.entered,
|
|
64
|
+
"opacity-0": !t.entered
|
|
65
|
+
});
|
|
66
|
+
}), e.append(n, a);
|
|
67
|
+
};
|
|
68
|
+
e.if(o, (e) => {
|
|
69
|
+
t.enabled && e(s);
|
|
70
|
+
}), e.append(n, a);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { a as default, r as disable, n as enable, t as loadScreenState };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/lib/assets/icons/adjustment-horizontal.svg
|
|
2
|
+
var e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2024%2024'%20stroke-width='1.5'%20stroke='currentColor'%20class='size-6'%3e%3cpath%20stroke-linecap='round'%20stroke-linejoin='round'%20d='M10.5%206h9.75M10.5%206a1.5%201.5%200%201%201-3%200m3%200a1.5%201.5%200%201%200-3%200M3.75%206H7.5m3%2012h9.75m-9.75%200a1.5%201.5%200%200%201-3%200m3%200a1.5%201.5%200%200%200-3%200m-3.75%200H7.5m9-6h3.75m-3.75%200a1.5%201.5%200%200%201-3%200m3%200a1.5%201.5%200%200%200-3%200m-9.75%200h9.75'%20/%3e%3c/svg%3e";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { monitorsManager as e } from "../monitors/monitors.svelte.js";
|
|
2
|
+
import { getCurrentLevel as t } from "../monitors/monitor-utils.js";
|
|
3
|
+
import n from "../components/DataBox.js";
|
|
4
|
+
import * as r from "svelte/internal/client";
|
|
5
|
+
import "svelte/internal/disclose-version";
|
|
6
|
+
import { format as i, formatDistanceToNow as a } from "date-fns";
|
|
7
|
+
//#region src/lib/collocation-sites/CollocationTooltip.svelte
|
|
8
|
+
var o = r.from_html("<div class=\"flex gap-2\"><!> <div class=\"flex flex-col\"><p class=\"leading-none\"> </p> <h1 class=\"text-lg font-bold underline\"> </h1> <p class=\"leading-none\">Reference monitor</p> <div class=\"mt-auto\"><p class=\"text-base leading-none\">Last updated</p> <p class=\"text-base leading-none\"> </p></div></div></div>"), s = r.from_html("<h1>Reference monitor disabled</h1>"), c = r.from_html("<div class=\"flex flex-row-reverse gap-2\"><!> <div class=\"flex flex-col\"><p class=\"leading-none\"> </p> <h1 class=\"text-lg font-bold underline\"> </h1> <p class=\"leading-none\">Collocated monitor</p> <div class=\"mt-auto\"><p class=\"text-base leading-none\">Last updated</p> <p class=\"text-base leading-none\"> </p></div></div></div>"), l = r.from_html("<h1>Collocated monitor disabled</h1>"), u = r.from_html("<div class=\"flex flex-col gap-4\"><!> <!></div>");
|
|
9
|
+
function d(d, f) {
|
|
10
|
+
r.push(f, !0);
|
|
11
|
+
let p = r.derived(() => {
|
|
12
|
+
let t = e.latest?.get(f.feature.properties.colocated_id), n = e.latest?.get(f.feature.properties.reference_id);
|
|
13
|
+
return {
|
|
14
|
+
collocated: m(t),
|
|
15
|
+
reference: m(n)
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
function m(n) {
|
|
19
|
+
if (!n || !("value" in n.latest) || !e.meta) return;
|
|
20
|
+
let r = e.meta.entryType(n.latest.entry_type), o = t(n.latest.value, r.asIter.levels), s = e.meta.monitorType(n.type).expected_interval;
|
|
21
|
+
return {
|
|
22
|
+
color: o?.color ?? "",
|
|
23
|
+
header: r.label,
|
|
24
|
+
date: {
|
|
25
|
+
formatted: i(n.latest.timestamp, "h:mm:aaa EEEE MMM dd, yyyy"),
|
|
26
|
+
diference: a(n.latest.timestamp, {
|
|
27
|
+
addSuffix: !0,
|
|
28
|
+
includeSeconds: !0
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
monitorName: n.name,
|
|
32
|
+
subheading: `(${s} avg)`,
|
|
33
|
+
value: Math.round(parseInt(n.latest.value, 10)).toString()
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var h = r.comment(), g = r.first_child(h), _ = (e) => {
|
|
37
|
+
var t = u(), i = r.child(t), a = (e) => {
|
|
38
|
+
var t = o(), i = r.child(t);
|
|
39
|
+
n(i, {
|
|
40
|
+
get color() {
|
|
41
|
+
return r.get(p).reference.color;
|
|
42
|
+
},
|
|
43
|
+
get header() {
|
|
44
|
+
return r.get(p).reference.header;
|
|
45
|
+
},
|
|
46
|
+
get subheading() {
|
|
47
|
+
return r.get(p).reference.subheading;
|
|
48
|
+
},
|
|
49
|
+
get value() {
|
|
50
|
+
return r.get(p).reference.value;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var a = r.sibling(i, 2), s = r.child(a), c = r.child(s, !0);
|
|
54
|
+
r.reset(s);
|
|
55
|
+
var l = r.sibling(s, 2), u = r.child(l, !0);
|
|
56
|
+
r.reset(l);
|
|
57
|
+
var d = r.sibling(l, 4), f = r.sibling(r.child(d), 2), m = r.child(f, !0);
|
|
58
|
+
r.reset(f), r.reset(d), r.reset(a), r.reset(t), r.template_effect(() => {
|
|
59
|
+
r.set_text(c, r.get(p).reference.date.formatted), r.set_text(u, r.get(p).reference.monitorName), r.set_text(m, r.get(p).reference.date.diference);
|
|
60
|
+
}), r.append(e, t);
|
|
61
|
+
}, d = (e) => {
|
|
62
|
+
var t = s();
|
|
63
|
+
r.append(e, t);
|
|
64
|
+
};
|
|
65
|
+
r.if(i, (e) => {
|
|
66
|
+
r.get(p).reference ? e(a) : e(d, -1);
|
|
67
|
+
});
|
|
68
|
+
var f = r.sibling(i, 2), m = (e) => {
|
|
69
|
+
var t = c(), i = r.child(t);
|
|
70
|
+
n(i, {
|
|
71
|
+
get color() {
|
|
72
|
+
return r.get(p).collocated.color;
|
|
73
|
+
},
|
|
74
|
+
get header() {
|
|
75
|
+
return r.get(p).collocated.header;
|
|
76
|
+
},
|
|
77
|
+
get subheading() {
|
|
78
|
+
return r.get(p).collocated.subheading;
|
|
79
|
+
},
|
|
80
|
+
get value() {
|
|
81
|
+
return r.get(p).collocated.value;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var a = r.sibling(i, 2), o = r.child(a), s = r.child(o, !0);
|
|
85
|
+
r.reset(o);
|
|
86
|
+
var l = r.sibling(o, 2), u = r.child(l, !0);
|
|
87
|
+
r.reset(l);
|
|
88
|
+
var d = r.sibling(l, 4), f = r.sibling(r.child(d), 2), m = r.child(f, !0);
|
|
89
|
+
r.reset(f), r.reset(d), r.reset(a), r.reset(t), r.template_effect(() => {
|
|
90
|
+
r.set_text(s, r.get(p).collocated.date.formatted), r.set_text(u, r.get(p).collocated.monitorName), r.set_text(m, r.get(p).collocated.date.diference);
|
|
91
|
+
}), r.append(e, t);
|
|
92
|
+
}, h = (e) => {
|
|
93
|
+
var t = l();
|
|
94
|
+
r.append(e, t);
|
|
95
|
+
};
|
|
96
|
+
r.if(f, (e) => {
|
|
97
|
+
r.get(p).collocated ? e(m) : e(h, -1);
|
|
98
|
+
}), r.reset(t), r.append(e, t);
|
|
99
|
+
};
|
|
100
|
+
r.if(g, (e) => {
|
|
101
|
+
r.get(p) && e(_);
|
|
102
|
+
}), r.append(d, h), r.pop();
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { d as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { withCrosshair as e } from "../map/icons.js";
|
|
2
|
+
import { MonitorShapeIconManager as t } from "../monitors/monitors-icon-manager.svelte.js";
|
|
3
|
+
import "svelte/internal/client";
|
|
4
|
+
//#region src/lib/collocation-sites/collocations-icon-manager.svelte.ts
|
|
5
|
+
var n = "collocation", r = "#4A5FC6";
|
|
6
|
+
function i(e) {
|
|
7
|
+
return `${n}-${e}`;
|
|
8
|
+
}
|
|
9
|
+
var a = class extends t {
|
|
10
|
+
get idPrefix() {
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
get iconSize() {
|
|
14
|
+
return 56;
|
|
15
|
+
}
|
|
16
|
+
transformSvg(t) {
|
|
17
|
+
return e(t, r);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { a as CollocationIconManager, i as getCollocationIconId };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { monitorsManager as e } from "../monitors/monitors.svelte.js";
|
|
2
|
+
import { collocationSitesManager as t } from "./collocations.svelte.js";
|
|
3
|
+
import { mountPopup as n } from "../map/utils.js";
|
|
4
|
+
import { mapManager as r } from "../map/map.svelte.js";
|
|
5
|
+
import { MapIconLayerIntegration as i } from "../map/integrations/map-geojson-integration.svelte.js";
|
|
6
|
+
import { TooltipManager as a } from "../map/integrations/tooltip.svelte.js";
|
|
7
|
+
import { monitorsMapIntegration as o } from "../monitors/monitors-map-integration.svelte.js";
|
|
8
|
+
import { CollocationIconManager as s, getCollocationIconId as c } from "./collocations-icon-manager.svelte.js";
|
|
9
|
+
import l from "./CollocationTooltip.js";
|
|
10
|
+
import * as u from "svelte/internal/client";
|
|
11
|
+
import { untrack as d } from "svelte";
|
|
12
|
+
//#region src/lib/collocation-sites/collocations-map-integration.svelte.ts
|
|
13
|
+
function f(e) {
|
|
14
|
+
let t = e.features?.[0];
|
|
15
|
+
if (t) return n(l, { feature: t }, e.lngLat);
|
|
16
|
+
}
|
|
17
|
+
var p = new class extends i {
|
|
18
|
+
referenceId = "collocation-sites";
|
|
19
|
+
#e = u.state(!1);
|
|
20
|
+
get enabled() {
|
|
21
|
+
return u.get(this.#e);
|
|
22
|
+
}
|
|
23
|
+
set enabled(e) {
|
|
24
|
+
u.set(this.#e, e, !0);
|
|
25
|
+
}
|
|
26
|
+
icons = new s();
|
|
27
|
+
tooltipManager = new a();
|
|
28
|
+
#t = u.derived(() => !e.meta || !e.pollutant || !t.collocationSites || o.features.length === 0 ? [] : t.collocationSites.map((e) => {
|
|
29
|
+
let t = o.features.find((t) => t.properties.id === e.reference_id);
|
|
30
|
+
if (t) return {
|
|
31
|
+
type: "Feature",
|
|
32
|
+
properties: {
|
|
33
|
+
icon: c(t.properties.icon),
|
|
34
|
+
colocated_id: e.colocated_id,
|
|
35
|
+
reference_id: e.reference_id,
|
|
36
|
+
name: e.name
|
|
37
|
+
},
|
|
38
|
+
geometry: e.position
|
|
39
|
+
};
|
|
40
|
+
}).filter((e) => e !== void 0));
|
|
41
|
+
get features() {
|
|
42
|
+
return u.get(this.#t);
|
|
43
|
+
}
|
|
44
|
+
set features(e) {
|
|
45
|
+
u.set(this.#t, e);
|
|
46
|
+
}
|
|
47
|
+
mapLayer = {
|
|
48
|
+
id: this.referenceId,
|
|
49
|
+
type: "symbol",
|
|
50
|
+
source: this.referenceId,
|
|
51
|
+
layout: {
|
|
52
|
+
"icon-allow-overlap": !0,
|
|
53
|
+
"icon-ignore-placement": !0,
|
|
54
|
+
"icon-image": ["get", "icon"],
|
|
55
|
+
"icon-size": 1
|
|
56
|
+
},
|
|
57
|
+
paint: {}
|
|
58
|
+
};
|
|
59
|
+
get mapSource() {
|
|
60
|
+
return {
|
|
61
|
+
type: "geojson",
|
|
62
|
+
promoteId: "id",
|
|
63
|
+
data: {
|
|
64
|
+
type: "FeatureCollection",
|
|
65
|
+
features: this.features
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
constructor() {
|
|
70
|
+
super(), u.effect_root(() => {
|
|
71
|
+
u.user_effect(() => {
|
|
72
|
+
let e = this.features;
|
|
73
|
+
!r.map || !this.enabled || r.setDataSource(this.referenceId, e);
|
|
74
|
+
}), u.user_effect(() => {
|
|
75
|
+
e.pollutant === "o3" ? d(() => this.remove()) : d(() => this.enabled) && d(() => this.apply());
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
apply() {
|
|
80
|
+
r.map && (this.tooltipManager.has(this.referenceId) || this.tooltipManager.register(this.referenceId, f, 2 ** 53 - 1), this.tooltipManager.enable(), super.apply());
|
|
81
|
+
}
|
|
82
|
+
}();
|
|
83
|
+
//#endregion
|
|
84
|
+
export { p as collocationSitesMapIntegration };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import { getCollocationSites as t } from "@sjvair/sdk";
|
|
3
|
+
var n = new class {
|
|
4
|
+
#e = e.state(!1);
|
|
5
|
+
get initialized() {
|
|
6
|
+
return e.get(this.#e);
|
|
7
|
+
}
|
|
8
|
+
set initialized(t) {
|
|
9
|
+
e.set(this.#e, t, !0);
|
|
10
|
+
}
|
|
11
|
+
#t = e.state(null);
|
|
12
|
+
get collocationSites() {
|
|
13
|
+
return e.get(this.#t);
|
|
14
|
+
}
|
|
15
|
+
set collocationSites(t) {
|
|
16
|
+
e.set(this.#t, t, !0);
|
|
17
|
+
}
|
|
18
|
+
async init() {
|
|
19
|
+
this.initialized ||= (this.collocationSites = await t(), !0);
|
|
20
|
+
}
|
|
21
|
+
async update() {
|
|
22
|
+
this.initialized && (this.collocationSites = await t());
|
|
23
|
+
}
|
|
24
|
+
}();
|
|
25
|
+
//#endregion
|
|
26
|
+
export { n as collocationSitesManager };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { mix as e } from "color2k";
|
|
2
|
+
//#region src/lib/colors.ts
|
|
3
|
+
var t = {
|
|
4
|
+
white: "ffffff",
|
|
5
|
+
gray: "969696",
|
|
6
|
+
black: "000000",
|
|
7
|
+
blue: "0000FF",
|
|
8
|
+
green: "00e400",
|
|
9
|
+
yellow: "ffff00",
|
|
10
|
+
orange: "ff7e00",
|
|
11
|
+
red: "ff0000",
|
|
12
|
+
purple: "8f3f97",
|
|
13
|
+
maroon: "7e0023"
|
|
14
|
+
};
|
|
15
|
+
function n(t, n) {
|
|
16
|
+
if (t >= n[n.length - 1].min) return `#${n[n.length - 1].color}`;
|
|
17
|
+
if (t <= 0) return `#${n[0].color}`;
|
|
18
|
+
for (let r = 0; r < n.length - 1; r++) if (n[r + 1].min > t) {
|
|
19
|
+
let i = n[r], a = n[r + 1], o = i.min === -Infinity ? a.min : a.min - i.min, s = (o - (a.min - t)) / o;
|
|
20
|
+
return e(`#${i.color}`, `#${a.color}`, s);
|
|
21
|
+
}
|
|
22
|
+
return "#FFFFFF";
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { t as Colors, n as valueToColor };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import { darken as t, readableColor as n } from "color2k";
|
|
4
|
+
//#region src/lib/components/DataBox.svelte
|
|
5
|
+
var r = e.from_html("<p class=\"whitespace-nowrap\"> </p>"), i = e.from_html("<div class=\"flex flex-col rounded-sm border-4 p-1 text-center\"><p class=\"text-base whitespace-nowrap\"> </p> <div class=\"flex flex-1 flex-col items-center justify-center\"><p> </p> <!></div></div>");
|
|
6
|
+
function a(a, o) {
|
|
7
|
+
e.push(o, !0);
|
|
8
|
+
let s = e.derived(() => t(o.color, .1)), c = e.derived(() => n(o.color));
|
|
9
|
+
var l = i();
|
|
10
|
+
let u;
|
|
11
|
+
var d = e.child(l), f = e.child(d, !0);
|
|
12
|
+
e.reset(d);
|
|
13
|
+
var p = e.sibling(d, 2), m = e.child(p), h = e.child(m, !0);
|
|
14
|
+
e.reset(m);
|
|
15
|
+
var g = e.sibling(m, 2), _ = (t) => {
|
|
16
|
+
var n = r(), i = e.child(n, !0);
|
|
17
|
+
e.reset(n), e.template_effect(() => e.set_text(i, o.subheading)), e.append(t, n);
|
|
18
|
+
};
|
|
19
|
+
e.if(g, (e) => {
|
|
20
|
+
o.subheading && e(_);
|
|
21
|
+
}), e.reset(p), e.reset(l), e.template_effect(() => {
|
|
22
|
+
u = e.set_style(l, "", u, {
|
|
23
|
+
"background-color": o.color,
|
|
24
|
+
"border-color": e.get(s),
|
|
25
|
+
color: e.get(c)
|
|
26
|
+
}), e.set_text(f, o.header), e.set_class(m, 1, e.clsx(["font-bold whitespace-nowrap", o.subheading ? "text-3xl" : "text-4xl"])), e.set_text(h, o.value);
|
|
27
|
+
}), e.append(a, l), e.pop();
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
//#region src/lib/components/DisplayOption.svelte
|
|
4
|
+
var t = e.from_html("<div class=\"flex flex-col items-start justify-center rounded\"><!></div>");
|
|
5
|
+
function n(n, r) {
|
|
6
|
+
var i = t(), a = e.child(i);
|
|
7
|
+
e.snippet(a, () => r.children ?? e.noop), e.reset(i), e.append(n, i);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as default };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { monitorsManager as e } from "../monitors/monitors.svelte.js";
|
|
2
|
+
import { collocationSitesMapIntegration as t } from "../collocation-sites/collocations-map-integration.svelte.js";
|
|
3
|
+
import { windMapIntegration as n } from "../wind/wind.svelte.js";
|
|
4
|
+
import r from "./DisplayOption.js";
|
|
5
|
+
import i from "./ToggleSwitch.js";
|
|
6
|
+
import { hmsFireMapIntegration as a } from "../hms/hms-fire-map-integration.svelte.js";
|
|
7
|
+
import { hmsSmokeMapIntegration as o } from "../hms/hms-smoke-map-integration.svelte.js";
|
|
8
|
+
import * as s from "svelte/internal/client";
|
|
9
|
+
import "svelte/internal/disclose-version";
|
|
10
|
+
import "svelte/internal/flags/legacy";
|
|
11
|
+
//#region src/lib/components/MapLayersDisplayOptions.svelte
|
|
12
|
+
var c = s.reactive_import(() => n), l = s.reactive_import(() => t), u = s.reactive_import(() => a), d = s.reactive_import(() => o), f = s.from_html("<p class=\"text-lg font-bold whitespace-nowrap underline\">Map Layers</p> <!> <!> <!> <!>", 1);
|
|
13
|
+
function p(t, n) {
|
|
14
|
+
s.push(n, !1), s.init(), r(t, {
|
|
15
|
+
children: (t, n) => {
|
|
16
|
+
var r = f(), a = s.sibling(s.first_child(r), 2);
|
|
17
|
+
i(a, {
|
|
18
|
+
id: "wind",
|
|
19
|
+
label: "Wind",
|
|
20
|
+
get value() {
|
|
21
|
+
return c().enabled;
|
|
22
|
+
},
|
|
23
|
+
set value(e) {
|
|
24
|
+
c(c().enabled = e);
|
|
25
|
+
},
|
|
26
|
+
$$legacy: !0
|
|
27
|
+
});
|
|
28
|
+
var o = s.sibling(a, 2), p = (e) => {
|
|
29
|
+
i(e, {
|
|
30
|
+
id: "collocation-sites",
|
|
31
|
+
label: "Collocation Sites",
|
|
32
|
+
get value() {
|
|
33
|
+
return l().enabled;
|
|
34
|
+
},
|
|
35
|
+
set value(e) {
|
|
36
|
+
l(l().enabled = e);
|
|
37
|
+
},
|
|
38
|
+
$$legacy: !0
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
s.if(o, (t) => {
|
|
42
|
+
e.pollutant === "pm25" && t(p);
|
|
43
|
+
});
|
|
44
|
+
var m = s.sibling(o, 2);
|
|
45
|
+
i(m, {
|
|
46
|
+
id: "hms-fire",
|
|
47
|
+
label: "HMS Fire",
|
|
48
|
+
get value() {
|
|
49
|
+
return u().enabled;
|
|
50
|
+
},
|
|
51
|
+
set value(e) {
|
|
52
|
+
u(u().enabled = e);
|
|
53
|
+
},
|
|
54
|
+
$$legacy: !0
|
|
55
|
+
}), i(s.sibling(m, 2), {
|
|
56
|
+
id: "hms-smoke",
|
|
57
|
+
label: "HMS Smoke",
|
|
58
|
+
get value() {
|
|
59
|
+
return d().enabled;
|
|
60
|
+
},
|
|
61
|
+
set value(e) {
|
|
62
|
+
d(d().enabled = e);
|
|
63
|
+
},
|
|
64
|
+
$$legacy: !0
|
|
65
|
+
}), s.append(t, r);
|
|
66
|
+
},
|
|
67
|
+
$$slots: { default: !0 }
|
|
68
|
+
}), s.pop();
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { p as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import { searchParams as t } from "sv-router";
|
|
3
|
+
import "svelte/internal/disclose-version";
|
|
4
|
+
import { untrack as n } from "svelte";
|
|
5
|
+
//#region src/lib/components/SegmentedControl.svelte
|
|
6
|
+
var r = e.from_html("<p> </p>"), i = e.from_html("<label class=\"relative z-1 cursor-pointer text-center transition-all duration-750 active:scale-95 has-checked:text-white\"><input type=\"radio\" class=\"hidden\"/> </label>"), a = e.from_html("<div class=\"relative\"><!> <div class=\"relative flex gap-4 px-[.5em] before:absolute before:top-[0.125em] before:bottom-[0.125em] before:left-0 before:z-0 before:w-(--highlight-width) before:translate-x-(--highlight-x-pos) before:rounded-md before:bg-[#5465FF] before:transition-transform before:duration-500 before:content-['']\"></div></div>");
|
|
7
|
+
function o(o, s) {
|
|
8
|
+
e.push(s, !0);
|
|
9
|
+
let c = [], l = e.prop(s, "group", 15), u = e.state(void 0);
|
|
10
|
+
e.user_effect(() => {
|
|
11
|
+
if (l(), !e.get(u)) return;
|
|
12
|
+
let r = e.get(u).querySelector("input:checked");
|
|
13
|
+
if (!r) return;
|
|
14
|
+
n(() => t.get("pollutant")) !== r.value && n(() => t.set("pollutant", r.value));
|
|
15
|
+
let i = parseFloat(getComputedStyle(e.get(u)).fontSize), a = r.closest("label"), o = e.get(u).getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
16
|
+
e.get(u).style.setProperty("--highlight-width", `${s.width + i}px`), e.get(u).style.setProperty("--highlight-x-pos", `${s.left - o.left - i / 2}px`);
|
|
17
|
+
});
|
|
18
|
+
var d = a(), f = e.child(d), p = (t) => {
|
|
19
|
+
var n = r(), i = e.child(n, !0);
|
|
20
|
+
e.reset(n), e.template_effect(() => e.set_text(i, s.segmentLabel)), e.append(t, n);
|
|
21
|
+
};
|
|
22
|
+
e.if(f, (e) => {
|
|
23
|
+
s.segmentLabel && e(p);
|
|
24
|
+
});
|
|
25
|
+
var m = e.sibling(f, 2);
|
|
26
|
+
e.each(m, 21, () => s.options, ({ label: e, value: t }) => t, (t, n, r, a) => {
|
|
27
|
+
let o = () => e.get(n).label, s = () => e.get(n).value, u = e.derived(() => `${s()}-segmented-control-option`);
|
|
28
|
+
var d = i(), f = e.child(d);
|
|
29
|
+
e.remove_input_defaults(f);
|
|
30
|
+
var p, m = e.sibling(f);
|
|
31
|
+
e.reset(d), e.template_effect(() => {
|
|
32
|
+
e.set_attribute(d, "for", e.get(u)), e.set_attribute(f, "id", e.get(u)), e.set_attribute(f, "name", o()), p !== (p = s()) && (f.value = (f.__value = s()) ?? ""), e.set_text(m, ` ${o() ?? ""}`);
|
|
33
|
+
}), e.bind_group(c, [], f, () => (s(), l()), l), e.append(t, d);
|
|
34
|
+
}), e.reset(m), e.bind_this(m, (t) => e.set(u, t), () => e.get(u)), e.reset(d), e.append(o, d), e.pop();
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { o as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as e from "svelte/internal/client";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
//#region src/lib/components/ToggleSwitch.svelte
|
|
4
|
+
var t = e.from_html("<label> <div class=\"switch svelte-1inz2ds\"><input class=\"switch-input svelte-1inz2ds\" type=\"checkbox\"/> <span class=\"slider round svelte-1inz2ds\"></span></div></label>"), n = {
|
|
5
|
+
hash: "svelte-1inz2ds",
|
|
6
|
+
code: ".switch.svelte-1inz2ds {--animation-duration: 100ms;--switch-diameter: 1.625em;--switch-offset: 0.25em;--track-width: 3.75em;--track-height: 2.125em;font-size:0.5em;position:relative;display:inline-block;width:var(--track-width);height:var(--track-height);transform:scale(0.8);.switch-input:where(.svelte-1inz2ds) {opacity:0;width:0;height:0;&:checked + .slider:where(.svelte-1inz2ds) {background-color:#2196f3;}&:focus + .slider:where(.svelte-1inz2ds) {box-shadow:0 0 1px #2196f3;}&:checked + .slider:where(.svelte-1inz2ds):before {-webkit-transform:translateX(var(--switch-diameter));-ms-transform:translateX(var(--switch-diameter));transform:translateX(var(--switch-diameter));}}.slider:where(.svelte-1inz2ds) {position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:var(--animation-duration);transition:var(--animation-duration);&:before {position:absolute;content:\"\";height:var(--switch-diameter);width:var(--switch-diameter);left:var(--switch-offset);bottom:var(--switch-offset);background-color:white;-webkit-transition:var(--animation-duration);transition:var(--animation-duration);}\n /* Rounded sliders */&.round {border-radius:var(--track-height);}&.round:before {border-radius:50%;}}}"
|
|
7
|
+
};
|
|
8
|
+
function r(r, i) {
|
|
9
|
+
e.push(i, !0), e.append_styles(r, n);
|
|
10
|
+
let a = e.prop(i, "value", 15);
|
|
11
|
+
var o = t(), s = e.child(o), c = e.sibling(s), l = e.child(c);
|
|
12
|
+
e.remove_input_defaults(l), e.next(2), e.reset(c), e.reset(o), e.template_effect(() => {
|
|
13
|
+
e.set_attribute(o, "for", i.id), e.set_class(o, 1, e.clsx(["flex cursor-pointer items-center justify-center gap-x-[0.25em] whitespace-nowrap select-none", { "flex-row-reverse": i.reverse }])), e.set_text(s, `${i.label ?? ""} `), e.set_attribute(l, "id", i.id), e.set_attribute(l, "name", i.id);
|
|
14
|
+
}), e.bind_checked(l, a), e.append(r, o), e.pop();
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tv as e } from "../../../node_modules/tailwind-variants/dist/index.js";
|
|
2
|
+
import * as t from "svelte/internal/client";
|
|
3
|
+
import "svelte/internal/disclose-version";
|
|
4
|
+
//#region src/lib/components/ui/button/button.svelte
|
|
5
|
+
var n = e({
|
|
6
|
+
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
13
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
21
|
+
icon: "size-8",
|
|
22
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
24
|
+
"icon-lg": "size-9"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
t.from_html("<a><!></a>"), t.from_html("<button><!></button>");
|
|
33
|
+
//#endregion
|
|
34
|
+
export { n as buttonVariants };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { $ad063034c8620db8$export$aa8b41735afcabd2 as e } from "../../../node_modules/@internationalized/date/dist/private/queries.js";
|
|
2
|
+
import { $12a3c853105e5a70$export$ad991b66133851cf as t } from "../../../node_modules/@internationalized/date/dist/private/DateFormatter.js";
|
|
3
|
+
import n from "./range-calendar-month-select.js";
|
|
4
|
+
import r from "./range-calendar-year-select.js";
|
|
5
|
+
import * as i from "svelte/internal/client";
|
|
6
|
+
import "svelte/internal/disclose-version";
|
|
7
|
+
//#region src/lib/components/ui/range-calendar/range-calendar-caption.svelte
|
|
8
|
+
var a = i.from_html("<!> <!>", 1), o = i.from_html("<!> <!>", 1), s = i.from_html("<!> <!>", 1);
|
|
9
|
+
function c(c, l) {
|
|
10
|
+
i.push(l, !0);
|
|
11
|
+
let u = (e) => {
|
|
12
|
+
n(e, {
|
|
13
|
+
get months() {
|
|
14
|
+
return l.months;
|
|
15
|
+
},
|
|
16
|
+
get monthFormat() {
|
|
17
|
+
return l.monthFormat;
|
|
18
|
+
},
|
|
19
|
+
get value() {
|
|
20
|
+
return l.month.month;
|
|
21
|
+
},
|
|
22
|
+
onchange: (e) => {
|
|
23
|
+
if (!f()) return;
|
|
24
|
+
let t = Number.parseInt(e.currentTarget.value);
|
|
25
|
+
f(f().set({ month: t }).subtract({ months: p() }));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}, d = (e) => {
|
|
29
|
+
r(e, {
|
|
30
|
+
get years() {
|
|
31
|
+
return l.years;
|
|
32
|
+
},
|
|
33
|
+
get yearFormat() {
|
|
34
|
+
return l.yearFormat;
|
|
35
|
+
},
|
|
36
|
+
get value() {
|
|
37
|
+
return l.month.year;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}, f = i.prop(l, "placeholder", 15), p = i.prop(l, "monthIndex", 3, 0);
|
|
41
|
+
function m(n) {
|
|
42
|
+
let r = n.toDate(e());
|
|
43
|
+
return typeof l.yearFormat == "function" ? l.yearFormat(r.getFullYear()) : new t(l.locale, { year: l.yearFormat }).format(r);
|
|
44
|
+
}
|
|
45
|
+
function h(n) {
|
|
46
|
+
let r = n.toDate(e());
|
|
47
|
+
return typeof l.monthFormat == "function" ? l.monthFormat(r.getMonth() + 1) : new t(l.locale, { month: l.monthFormat }).format(r);
|
|
48
|
+
}
|
|
49
|
+
var g = i.comment(), _ = i.first_child(g), v = (e) => {
|
|
50
|
+
var t = a(), n = i.first_child(t);
|
|
51
|
+
u(n), d(i.sibling(n, 2)), i.append(e, t);
|
|
52
|
+
}, y = (e) => {
|
|
53
|
+
var t = o(), n = i.first_child(t);
|
|
54
|
+
u(n);
|
|
55
|
+
var r = i.sibling(n, 2), a = (e) => {
|
|
56
|
+
var t = i.text();
|
|
57
|
+
i.template_effect((e) => i.set_text(t, e), [() => m(f())]), i.append(e, t);
|
|
58
|
+
};
|
|
59
|
+
i.if(r, (e) => {
|
|
60
|
+
f() && e(a);
|
|
61
|
+
}), i.append(e, t);
|
|
62
|
+
}, b = (e) => {
|
|
63
|
+
var t = s(), n = i.first_child(t), r = (e) => {
|
|
64
|
+
var t = i.text();
|
|
65
|
+
i.template_effect((e) => i.set_text(t, e), [() => h(f())]), i.append(e, t);
|
|
66
|
+
};
|
|
67
|
+
i.if(n, (e) => {
|
|
68
|
+
f() && e(r);
|
|
69
|
+
}), d(i.sibling(n, 2)), i.append(e, t);
|
|
70
|
+
}, x = (e) => {
|
|
71
|
+
var t = i.text();
|
|
72
|
+
i.template_effect((e, n) => i.set_text(t, `${e ?? ""} ${n ?? ""}`), [() => h(l.month), () => m(l.month)]), i.append(e, t);
|
|
73
|
+
};
|
|
74
|
+
i.if(_, (e) => {
|
|
75
|
+
l.captionLayout === "dropdown" ? e(v) : l.captionLayout === "dropdown-months" ? e(y, 1) : l.captionLayout === "dropdown-years" ? e(b, 2) : e(x, -1);
|
|
76
|
+
}), i.append(c, g), i.pop();
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { c as default };
|