@modelform/react-native 0.5.0 → 0.6.0
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/README.md +21 -1
- package/dist/{chunk-5SGVTAFJ.mjs → chunk-BW6HKFAB.mjs} +932 -371
- package/dist/{chunk-5UE6Q6CQ.js → chunk-YUXA7I4J.js} +1036 -475
- package/dist/core/index.js +28 -2
- package/dist/core/index.mjs +27 -1
- package/dist/core/inputs.d.ts +71 -1
- package/dist/core/local.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +533 -314
- package/dist/index.mjs +494 -275
- package/dist/ui/inputs/InputGroup.d.ts +9 -0
- package/dist/ui/inputs/formContext.d.ts +22 -1
- package/package.json +1 -1
- package/schema/dashboard.schema.json +113 -2
package/dist/index.js
CHANGED
|
@@ -207,7 +207,20 @@
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
var _chunkYUXA7I4Jjs = require('./chunk-YUXA7I4J.js');
|
|
211
224
|
|
|
212
225
|
// src/ui/theme.tsx
|
|
213
226
|
var _react = require('react');
|
|
@@ -397,7 +410,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
397
410
|
if (!dashboard.refresh) return;
|
|
398
411
|
let ms;
|
|
399
412
|
try {
|
|
400
|
-
ms =
|
|
413
|
+
ms = _chunkYUXA7I4Jjs.parseDuration.call(void 0, dashboard.refresh);
|
|
401
414
|
} catch (e2) {
|
|
402
415
|
return;
|
|
403
416
|
}
|
|
@@ -405,7 +418,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
405
418
|
return () => clearInterval(id);
|
|
406
419
|
}, [dashboard.refresh, refresh]);
|
|
407
420
|
const refreshKey = tick + externalKey;
|
|
408
|
-
const range3 = _react.useMemo.call(void 0, () =>
|
|
421
|
+
const range3 = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.parseRange.call(void 0, rawRange), [rawRange, refreshKey]);
|
|
409
422
|
const shared = _react.useMemo.call(void 0, () => /* @__PURE__ */ new Map(), [range3, vars.variables, vars.variableInfo]);
|
|
410
423
|
const value = _react.useMemo.call(void 0,
|
|
411
424
|
() => ({
|
|
@@ -442,8 +455,8 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
442
455
|
] });
|
|
443
456
|
}
|
|
444
457
|
function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
445
|
-
const [state, setState] = _react.useState.call(void 0, () => ({ values:
|
|
446
|
-
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve &&
|
|
458
|
+
const [state, setState] = _react.useState.call(void 0, () => ({ values: _chunkYUXA7I4Jjs.initialVariableValues.call(void 0, dashboard), options: {}, errors: {} }));
|
|
459
|
+
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve && _chunkYUXA7I4Jjs.refreshedVariables.call(void 0, dashboard, "load").length > 0);
|
|
447
460
|
const [runKey, setRunKey] = _react.useState.call(void 0, 0);
|
|
448
461
|
const pending = _react.useRef.call(void 0, /* @__PURE__ */ new Set());
|
|
449
462
|
const stateRef = _react.useRef.call(void 0, state);
|
|
@@ -476,7 +489,7 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
476
489
|
setState(update);
|
|
477
490
|
setResolving(false);
|
|
478
491
|
};
|
|
479
|
-
|
|
492
|
+
_chunkYUXA7I4Jjs.resolveVariables.call(void 0, dashboard, { values, options, names, resolve: resolve2, range: _chunkYUXA7I4Jjs.parseRange.call(void 0, rawRange), signal: controller.signal }).then(
|
|
480
493
|
(res) => finish((s) => ({
|
|
481
494
|
// Only the re-run variables change, so a pick made while this ran isn't overwritten.
|
|
482
495
|
values: { ...s.values, ...Object.fromEntries([...names].filter((n) => n in res.values).map((n) => [n, res.values[n]])) },
|
|
@@ -490,11 +503,11 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
490
503
|
const [loadedDashboard, setLoadedDashboard] = _react.useState.call(void 0, dashboard);
|
|
491
504
|
if (dashboard !== loadedDashboard) {
|
|
492
505
|
setLoadedDashboard(dashboard);
|
|
493
|
-
setState((s) => ({ ...s, values: { ...
|
|
506
|
+
setState((s) => ({ ...s, values: { ..._chunkYUXA7I4Jjs.initialVariableValues.call(void 0, dashboard), ...s.values } }));
|
|
494
507
|
}
|
|
495
508
|
_react.useEffect.call(void 0, () => {
|
|
496
|
-
const roots =
|
|
497
|
-
schedule([...roots, ...
|
|
509
|
+
const roots = _chunkYUXA7I4Jjs.refreshedVariables.call(void 0, dashboard, "load");
|
|
510
|
+
schedule([...roots, ..._chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
498
511
|
}, [dashboard, schedule]);
|
|
499
512
|
const mounted = _react.useRef.call(void 0, false);
|
|
500
513
|
_react.useEffect.call(void 0, () => {
|
|
@@ -502,17 +515,17 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
502
515
|
mounted.current = true;
|
|
503
516
|
return;
|
|
504
517
|
}
|
|
505
|
-
const roots =
|
|
506
|
-
schedule([...roots, ...
|
|
518
|
+
const roots = _chunkYUXA7I4Jjs.refreshedVariables.call(void 0, dashboard, "range");
|
|
519
|
+
schedule([...roots, ..._chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
507
520
|
}, [rawRange]);
|
|
508
521
|
const setVariable = _react.useCallback.call(void 0,
|
|
509
522
|
(name, value) => {
|
|
510
523
|
setState((s) => ({ ...s, values: { ...s.values, [name]: value } }));
|
|
511
|
-
schedule(
|
|
524
|
+
schedule(_chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, [name]));
|
|
512
525
|
},
|
|
513
526
|
[dashboard, schedule]
|
|
514
527
|
);
|
|
515
|
-
const info = _react.useMemo.call(void 0, () =>
|
|
528
|
+
const info = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.variableInfo.call(void 0, dashboard, state.options), [dashboard, state.options]);
|
|
516
529
|
return _react.useMemo.call(void 0,
|
|
517
530
|
() => ({
|
|
518
531
|
variables: state.values,
|
|
@@ -542,7 +555,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
542
555
|
_react.useEffect.call(void 0, () => {
|
|
543
556
|
if (!enabled || !request || !variablesReady) return;
|
|
544
557
|
const controller = new AbortController();
|
|
545
|
-
|
|
558
|
+
_chunkYUXA7I4Jjs.queryPanel.call(void 0, request.panel, request.options, controller.signal).then((frames) => !controller.signal.aborted && setResult({ request, frames })).catch((e) => !controller.signal.aborted && setResult({ request, frames: [], error: String(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _5 => _5.message]), () => ( e))) }));
|
|
546
559
|
return () => controller.abort();
|
|
547
560
|
}, [enabled, request, variablesReady]);
|
|
548
561
|
if (!enabled) return IDLE;
|
|
@@ -552,7 +565,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
552
565
|
function usePanelLinks(panel) {
|
|
553
566
|
const { dashboard, variables, variableInfo: variableInfo2, range: range3, openLinks } = useDashboard();
|
|
554
567
|
const resolve = _react.useCallback.call(void 0,
|
|
555
|
-
(links, data) =>
|
|
568
|
+
(links, data) => _chunkYUXA7I4Jjs.resolveLinks.call(void 0, links, { dashboard, values: variables, info: variableInfo2, scoped: panel.scopedVars, range: range3, timezone: dashboard.timezone, data }),
|
|
556
569
|
[dashboard, variables, variableInfo2, panel.scopedVars, range3]
|
|
557
570
|
);
|
|
558
571
|
return { resolve, openLinks };
|
|
@@ -593,6 +606,7 @@ var RenderBoundary = (_class = class extends _react.Component {constructor(...ar
|
|
|
593
606
|
|
|
594
607
|
// src/ui/inputs/formContext.ts
|
|
595
608
|
|
|
609
|
+
var groupKey = (g) => g.id != null ? `#${g.id}` : _chunkYUXA7I4Jjs.groupFields.call(void 0, g).map((f) => f.options.metric).join("|");
|
|
596
610
|
var InputFormContext = _react.createContext.call(void 0, null);
|
|
597
611
|
function useInputForm() {
|
|
598
612
|
const v = _react.useContext.call(void 0, InputFormContext);
|
|
@@ -600,6 +614,10 @@ function useInputForm() {
|
|
|
600
614
|
return v;
|
|
601
615
|
}
|
|
602
616
|
|
|
617
|
+
// src/ui/inputs/InputGroup.tsx
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
603
621
|
// src/ui/inputs/InputPanels.tsx
|
|
604
622
|
|
|
605
623
|
|
|
@@ -649,14 +667,14 @@ var ArrowIcon = ({ color, dir }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
|
649
667
|
function displayExpr(expr) {
|
|
650
668
|
if (expr.trim().startsWith("now")) return expr;
|
|
651
669
|
try {
|
|
652
|
-
return
|
|
670
|
+
return _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, _chunkYUXA7I4Jjs.parseTime.call(void 0, expr));
|
|
653
671
|
} catch (e3) {
|
|
654
672
|
return expr;
|
|
655
673
|
}
|
|
656
674
|
}
|
|
657
675
|
function tryParse(expr, roundUp, now = Date.now()) {
|
|
658
676
|
try {
|
|
659
|
-
return
|
|
677
|
+
return _chunkYUXA7I4Jjs.parseTime.call(void 0, expr, now, roundUp);
|
|
660
678
|
} catch (e4) {
|
|
661
679
|
return null;
|
|
662
680
|
}
|
|
@@ -670,7 +688,7 @@ function endOfDay(ms) {
|
|
|
670
688
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1).getTime() - 1e3;
|
|
671
689
|
}
|
|
672
690
|
function resolveTo(expr) {
|
|
673
|
-
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ?
|
|
691
|
+
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ? _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, endOfDay(_chunkYUXA7I4Jjs.parseTime.call(void 0, expr))) : expr;
|
|
674
692
|
}
|
|
675
693
|
function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
676
694
|
const theme = useDashTheme();
|
|
@@ -681,12 +699,12 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
681
699
|
const [now] = _react.useState.call(void 0, () => Date.now());
|
|
682
700
|
const [month, setMonth] = _react.useState.call(void 0, () => new Date(_nullishCoalesce(tryParse(value.from, false), () => ( now))));
|
|
683
701
|
const fromMs = tryParse(from, false, now);
|
|
684
|
-
const toMs = tryParse(
|
|
685
|
-
const fromError =
|
|
686
|
-
const toError =
|
|
702
|
+
const toMs = tryParse(_chunkYUXA7I4Jjs.timeExprError.call(void 0, to) ? to : resolveTo(to), true, now);
|
|
703
|
+
const fromError = _chunkYUXA7I4Jjs.timeExprError.call(void 0, from);
|
|
704
|
+
const toError = _chunkYUXA7I4Jjs.timeExprError.call(void 0, to);
|
|
687
705
|
const orderError = fromMs != null && toMs != null && fromMs >= toMs ? "\u201CTo\u201D must be after \u201CFrom\u201D" : null;
|
|
688
706
|
const valid = !fromError && !toError && !orderError;
|
|
689
|
-
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() :
|
|
707
|
+
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() : _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, _chunkYUXA7I4Jjs.parseTime.call(void 0, expr));
|
|
690
708
|
const apply = () => {
|
|
691
709
|
if (!valid) return;
|
|
692
710
|
onApply({ from: normalize(from), to: normalize(resolveTo(to)) });
|
|
@@ -695,14 +713,14 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
695
713
|
const pickDay = (day) => {
|
|
696
714
|
const end = endOfDay(day);
|
|
697
715
|
if (active === "from") {
|
|
698
|
-
setFrom(
|
|
699
|
-
if (toMs == null || toMs <= day) setTo(
|
|
716
|
+
setFrom(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, day));
|
|
717
|
+
if (toMs == null || toMs <= day) setTo(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, end));
|
|
700
718
|
setActive("to");
|
|
701
719
|
} else if (fromMs != null && day < startOfDay(fromMs)) {
|
|
702
|
-
setFrom(
|
|
703
|
-
setTo(
|
|
720
|
+
setFrom(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, day));
|
|
721
|
+
setTo(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, end));
|
|
704
722
|
} else {
|
|
705
|
-
setTo(
|
|
723
|
+
setTo(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, end));
|
|
706
724
|
}
|
|
707
725
|
};
|
|
708
726
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -738,7 +756,7 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
738
756
|
}
|
|
739
757
|
),
|
|
740
758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles3.sectionTitle, { color: theme.textSecondary }], children: "Relative ranges" }),
|
|
741
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children:
|
|
759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children: _chunkYUXA7I4Jjs.RELATIVE_RANGES.map((r) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
742
760
|
Chip,
|
|
743
761
|
{
|
|
744
762
|
label: r.label,
|
|
@@ -882,17 +900,17 @@ var FilterIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _re
|
|
|
882
900
|
var CalendarIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM4 10h16M8 3v4M16 3v4" }) });
|
|
883
901
|
var ChevronIcon = ({ color, open }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: open ? "M6 15l6-6 6 6" : "M6 9l6 6 6-6" }) });
|
|
884
902
|
var CheckIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.4, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M5 12.5l4.5 4.5L19 7" }) });
|
|
885
|
-
function DashboardToolbar({ presets =
|
|
903
|
+
function DashboardToolbar({ presets = _chunkYUXA7I4Jjs.TIME_PRESETS }) {
|
|
886
904
|
const theme = useDashTheme();
|
|
887
905
|
const { dashboard, rawRange, setRawRange, variables, variableErrors } = useDashboard();
|
|
888
906
|
const [filtersOpen, setFiltersOpen] = _react.useState.call(void 0, false);
|
|
889
907
|
const [rangeOpen, setRangeOpen] = _react.useState.call(void 0, false);
|
|
890
908
|
const [rangeKey, setRangeKey] = _react.useState.call(void 0, 0);
|
|
891
909
|
const custom = !presets.some((p) => rawRange.from === p.from && rawRange.to === p.to);
|
|
892
|
-
const vars =
|
|
910
|
+
const vars = _chunkYUXA7I4Jjs.visibleVariables.call(void 0, dashboard);
|
|
893
911
|
const active = vars.filter((v) => {
|
|
894
912
|
const cur = variables[v.name];
|
|
895
|
-
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(
|
|
913
|
+
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(_chunkYUXA7I4Jjs.ALL) : cur === _chunkYUXA7I4Jjs.ALL);
|
|
896
914
|
}).length;
|
|
897
915
|
const hasError = vars.some((v) => variableErrors[v.name]);
|
|
898
916
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles4.toolbar, children: [
|
|
@@ -918,7 +936,7 @@ function DashboardToolbar({ presets = _chunk5UE6Q6CQjs.TIME_PRESETS }) {
|
|
|
918
936
|
setRangeOpen(true);
|
|
919
937
|
},
|
|
920
938
|
accessibilityRole: "button",
|
|
921
|
-
accessibilityLabel: custom ? `Time range, ${
|
|
939
|
+
accessibilityLabel: custom ? `Time range, ${_chunkYUXA7I4Jjs.describeRange.call(void 0, rawRange)}` : "Custom time range",
|
|
922
940
|
style: ({ pressed }) => [
|
|
923
941
|
custom ? styles4.rangeButton : styles4.iconButton,
|
|
924
942
|
{ borderColor: custom ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
@@ -926,7 +944,7 @@ function DashboardToolbar({ presets = _chunk5UE6Q6CQjs.TIME_PRESETS }) {
|
|
|
926
944
|
],
|
|
927
945
|
children: [
|
|
928
946
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CalendarIcon, { color: custom ? theme.accent : theme.textSecondary }),
|
|
929
|
-
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children:
|
|
947
|
+
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children: _chunkYUXA7I4Jjs.describeRange.call(void 0, rawRange) })
|
|
930
948
|
]
|
|
931
949
|
}
|
|
932
950
|
),
|
|
@@ -982,14 +1000,14 @@ function FilterSection({ variable: v, open, onToggle }) {
|
|
|
982
1000
|
const theme = useDashTheme();
|
|
983
1001
|
const { variables, variableInfo: variableInfo2, variableErrors, variablesReady, setVariable } = useDashboard();
|
|
984
1002
|
const current = variables[v.name];
|
|
985
|
-
const summary =
|
|
986
|
-
const options = [...v.includeAll ? [{ text: "All", value:
|
|
1003
|
+
const summary = _chunkYUXA7I4Jjs.valueText.call(void 0, current, variableInfo2[v.name]) || (variablesReady ? "None" : "\u2026");
|
|
1004
|
+
const options = [...v.includeAll ? [{ text: "All", value: _chunkYUXA7I4Jjs.ALL }] : [], ..._nullishCoalesce(_optionalChain([variableInfo2, 'access', _9 => _9[v.name], 'optionalAccess', _10 => _10.options]), () => ( []))];
|
|
987
1005
|
const error = variableErrors[v.name];
|
|
988
1006
|
const choose = (value, selected) => {
|
|
989
|
-
if (v.multi && value !==
|
|
990
|
-
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !==
|
|
1007
|
+
if (v.multi && value !== _chunkYUXA7I4Jjs.ALL) {
|
|
1008
|
+
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !== _chunkYUXA7I4Jjs.ALL);
|
|
991
1009
|
const next = selected ? cur.filter((c) => c !== value) : [...cur, value];
|
|
992
|
-
setVariable(v.name, next.length ? next : [
|
|
1010
|
+
setVariable(v.name, next.length ? next : [_chunkYUXA7I4Jjs.ALL]);
|
|
993
1011
|
} else {
|
|
994
1012
|
setVariable(v.name, v.multi ? [value] : value);
|
|
995
1013
|
if (!v.multi) onToggle();
|
|
@@ -1129,7 +1147,7 @@ function barCategory(panel, frame) {
|
|
|
1129
1147
|
}
|
|
1130
1148
|
function categoryLabels(field) {
|
|
1131
1149
|
if (field.type !== "time") return field.values.map((v) => v == null ? "" : String(v));
|
|
1132
|
-
const times = field.values.map((v) => v == null ? null :
|
|
1150
|
+
const times = field.values.map((v) => v == null ? null : _chunkYUXA7I4Jjs.toMillis.call(void 0, v));
|
|
1133
1151
|
let step = Infinity;
|
|
1134
1152
|
times.forEach((t, i) => {
|
|
1135
1153
|
const prev = times[i - 1];
|
|
@@ -1175,19 +1193,19 @@ function formatTooltipTime(t) {
|
|
|
1175
1193
|
return new Date(t).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
1176
1194
|
}
|
|
1177
1195
|
function styledSeries(panel, frames, scheme) {
|
|
1178
|
-
return styleSeries(panel,
|
|
1196
|
+
return styleSeries(panel, _chunkYUXA7I4Jjs.toSeries.call(void 0, frames), frames, scheme);
|
|
1179
1197
|
}
|
|
1180
1198
|
function styledXYSeries(panel, frames, scheme) {
|
|
1181
|
-
const { series, x } =
|
|
1182
|
-
const xConfig = x ?
|
|
1199
|
+
const { series, x } = _chunkYUXA7I4Jjs.toXYSeries.call(void 0, frames, _optionalChain([panel, 'access', _18 => _18.options, 'optionalAccess', _19 => _19.xField]) || void 0);
|
|
1200
|
+
const xConfig = x ? _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, x.field, x.frame, x.field.name) : {};
|
|
1183
1201
|
return { series: styleSeries(panel, series, frames, scheme), xConfig };
|
|
1184
1202
|
}
|
|
1185
1203
|
function styleSeries(panel, series, frames, scheme) {
|
|
1186
1204
|
const frameOf = /* @__PURE__ */ new Map();
|
|
1187
1205
|
frames.forEach((f) => f.fields.forEach((field) => frameOf.set(field, f)));
|
|
1188
1206
|
return series.map((s, i) => {
|
|
1189
|
-
const config =
|
|
1190
|
-
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color:
|
|
1207
|
+
const config = _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, s.field, frameOf.get(s.field), s.name);
|
|
1208
|
+
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color: _chunkYUXA7I4Jjs.seriesColor.call(void 0, i, scheme, config) };
|
|
1191
1209
|
});
|
|
1192
1210
|
}
|
|
1193
1211
|
function reducedValues(panel, frames, scheme) {
|
|
@@ -1195,30 +1213,30 @@ function reducedValues(panel, frames, scheme) {
|
|
|
1195
1213
|
const out = [];
|
|
1196
1214
|
const multiple = frames.length > 1;
|
|
1197
1215
|
frames.forEach(
|
|
1198
|
-
(frame, fi) =>
|
|
1199
|
-
const raw =
|
|
1200
|
-
const config =
|
|
1216
|
+
(frame, fi) => _chunkYUXA7I4Jjs.numberFields.call(void 0, frame).forEach((field) => {
|
|
1217
|
+
const raw = _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, field, frame, multiple);
|
|
1218
|
+
const config = _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
1201
1219
|
const values = field.values.map((v) => v == null ? null : Number(v));
|
|
1202
|
-
const value =
|
|
1203
|
-
const color =
|
|
1204
|
-
const step =
|
|
1205
|
-
const mapped =
|
|
1220
|
+
const value = _chunkYUXA7I4Jjs.reduce.call(void 0, values, calc);
|
|
1221
|
+
const color = _chunkYUXA7I4Jjs.seriesColor.call(void 0, out.length, scheme, config);
|
|
1222
|
+
const step = _chunkYUXA7I4Jjs.thresholdStep.call(void 0, value, config);
|
|
1223
|
+
const mapped = _chunkYUXA7I4Jjs.mappedResult.call(void 0, value, config);
|
|
1206
1224
|
out.push({
|
|
1207
1225
|
key: `${fi}/${field.name}/${JSON.stringify(_nullishCoalesce(field.labels, () => ( {})))}`,
|
|
1208
1226
|
name: _nullishCoalesce(config.displayName, () => ( raw)),
|
|
1209
1227
|
value,
|
|
1210
|
-
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) ||
|
|
1228
|
+
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) || _chunkYUXA7I4Jjs.formatValue.call(void 0, value, config),
|
|
1211
1229
|
mapped,
|
|
1212
1230
|
config,
|
|
1213
1231
|
color,
|
|
1214
|
-
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ?
|
|
1232
|
+
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ? _chunkYUXA7I4Jjs.resolveColor.call(void 0, mapped.color, color) : step ? _chunkYUXA7I4Jjs.resolveColor.call(void 0, step.color, color) : color,
|
|
1215
1233
|
sparkline: values,
|
|
1216
1234
|
field,
|
|
1217
1235
|
frame
|
|
1218
1236
|
});
|
|
1219
1237
|
})
|
|
1220
1238
|
);
|
|
1221
|
-
return
|
|
1239
|
+
return _chunkYUXA7I4Jjs.uniqueNames.call(void 0, out, (v) => v.field, frames);
|
|
1222
1240
|
}
|
|
1223
1241
|
function yDomain(series, includeZero) {
|
|
1224
1242
|
let min = Infinity;
|
|
@@ -1279,22 +1297,22 @@ function NoData({ message = "No data" }) {
|
|
|
1279
1297
|
}
|
|
1280
1298
|
function rowTooltipItems(panel, frame, row, multiple) {
|
|
1281
1299
|
return frame.fields.flatMap((f) => {
|
|
1282
|
-
const name =
|
|
1283
|
-
const config =
|
|
1300
|
+
const name = _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1301
|
+
const config = _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1284
1302
|
if (_optionalChain([config, 'access', _36 => _36.custom, 'optionalAccess', _37 => _37.hideFrom, 'optionalAccess', _38 => _38.tooltip])) return [];
|
|
1285
1303
|
const v = f.values[row];
|
|
1286
|
-
const value = v == null ? "\u2014" : f.type === "number" ?
|
|
1304
|
+
const value = v == null ? "\u2014" : f.type === "number" ? _chunkYUXA7I4Jjs.formatDisplay.call(void 0, Number(v), config) : f.type === "time" ? formatTooltipTime(_chunkYUXA7I4Jjs.toMillis.call(void 0, v)) : String(v);
|
|
1287
1305
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), value }];
|
|
1288
1306
|
});
|
|
1289
1307
|
}
|
|
1290
1308
|
function rowLinks(panel, frame, row, multiple, resolve) {
|
|
1291
1309
|
return mergeLinks(
|
|
1292
1310
|
frame.fields.flatMap((f) => {
|
|
1293
|
-
const name =
|
|
1294
|
-
const config =
|
|
1311
|
+
const name = _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1312
|
+
const config = _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1295
1313
|
if (!_optionalChain([config, 'access', _39 => _39.links, 'optionalAccess', _40 => _40.length])) return [];
|
|
1296
1314
|
const v = f.values[row];
|
|
1297
|
-
const text = v == null ? void 0 : f.type === "number" ?
|
|
1315
|
+
const text = v == null ? void 0 : f.type === "number" ? _chunkYUXA7I4Jjs.formatDisplay.call(void 0, Number(v), config) : String(v);
|
|
1298
1316
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), links: resolve(config.links, { frame, row, field: f, fieldName: _nullishCoalesce(config.displayName, () => ( name)), value: v, text }) }];
|
|
1299
1317
|
})
|
|
1300
1318
|
);
|
|
@@ -1307,7 +1325,7 @@ function valueLinks(panel, v, resolve) {
|
|
|
1307
1325
|
fieldName: v.name,
|
|
1308
1326
|
seriesName: v.name,
|
|
1309
1327
|
value: v.value,
|
|
1310
|
-
text:
|
|
1328
|
+
text: _chunkYUXA7I4Jjs.formatValue.call(void 0, v.value, v.config),
|
|
1311
1329
|
calc: _nullishCoalesce(_optionalChain([panel, 'access', _44 => _44.options, 'optionalAccess', _45 => _45.reduceOptions, 'optionalAccess', _46 => _46.calcs, 'optionalAccess', _47 => _47[0]]), () => ( "lastNotNull"))
|
|
1312
1330
|
});
|
|
1313
1331
|
}
|
|
@@ -1452,15 +1470,15 @@ function NumberInput({ panel, value, onChange }) {
|
|
|
1452
1470
|
}
|
|
1453
1471
|
function DurationInput({ panel, value, onChange }) {
|
|
1454
1472
|
const theme = useDashTheme();
|
|
1455
|
-
const toDigits = (v) => typeof v === "number" ?
|
|
1473
|
+
const toDigits = (v) => typeof v === "number" ? _chunkYUXA7I4Jjs.formatClock.call(void 0, v).replace(/\D/g, "").replace(/^0+/, "") : "";
|
|
1456
1474
|
const [digits, setDigits] = _react.useState.call(void 0, toDigits(value));
|
|
1457
1475
|
const [syncedValue, setSyncedValue] = _react.useState.call(void 0, value);
|
|
1458
1476
|
if (value !== syncedValue) {
|
|
1459
1477
|
setSyncedValue(value);
|
|
1460
|
-
setDigits((d) => value == null ?
|
|
1478
|
+
setDigits((d) => value == null ? _chunkYUXA7I4Jjs.parseClockDigits.call(void 0, d) == null ? d : "" : _chunkYUXA7I4Jjs.parseClockDigits.call(void 0, d) === value ? d : toDigits(value));
|
|
1461
1479
|
}
|
|
1462
1480
|
const masked = digits ? maskClock(digits) : "";
|
|
1463
|
-
const invalid = !!digits &&
|
|
1481
|
+
const invalid = !!digits && _chunkYUXA7I4Jjs.parseClockDigits.call(void 0, digits) == null;
|
|
1464
1482
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles6.numberField, { borderColor: invalid ? theme.danger : theme.border }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1465
1483
|
_reactnative.TextInput,
|
|
1466
1484
|
{
|
|
@@ -1468,7 +1486,7 @@ function DurationInput({ panel, value, onChange }) {
|
|
|
1468
1486
|
onChangeText: (t) => {
|
|
1469
1487
|
const d = t.replace(/\D/g, "").replace(/^0+/, "").slice(0, 6);
|
|
1470
1488
|
setDigits(d);
|
|
1471
|
-
onChange(
|
|
1489
|
+
onChange(_chunkYUXA7I4Jjs.parseClockDigits.call(void 0, d));
|
|
1472
1490
|
},
|
|
1473
1491
|
keyboardType: "number-pad",
|
|
1474
1492
|
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "00:00.00")),
|
|
@@ -1654,10 +1672,10 @@ function SuggestTextInput({ panel, value, onChange }) {
|
|
|
1654
1672
|
}, [store, metric, suggestWith]);
|
|
1655
1673
|
const withText = suggestWith ? form.value(suggestWith) : null;
|
|
1656
1674
|
const own = entries.filter((e) => e.metric === metric);
|
|
1657
|
-
const scoped = suggestWith && typeof withText === "string" && withText.trim() ?
|
|
1675
|
+
const scoped = suggestWith && typeof withText === "string" && withText.trim() ? _chunkYUXA7I4Jjs.entriesSavedWith.call(void 0, entries, metric, suggestWith, withText) : [];
|
|
1658
1676
|
const query = typed ? text : "";
|
|
1659
|
-
const fromScoped =
|
|
1660
|
-
const suggestions = (fromScoped.length ? fromScoped :
|
|
1677
|
+
const fromScoped = _chunkYUXA7I4Jjs.textSuggestions.call(void 0, scoped, query);
|
|
1678
|
+
const suggestions = (fromScoped.length ? fromScoped : _chunkYUXA7I4Jjs.textSuggestions.call(void 0, own, query)).filter((s) => s.toLowerCase() !== text.trim().toLowerCase());
|
|
1661
1679
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles6.suggest, children: [
|
|
1662
1680
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1663
1681
|
_reactnative.TextInput,
|
|
@@ -1696,7 +1714,7 @@ function CounterInput({ panel }) {
|
|
|
1696
1714
|
const { metric, increment = 1, unit } = panel.options;
|
|
1697
1715
|
const [today, setToday] = _react.useState.call(void 0, 0);
|
|
1698
1716
|
_react.useEffect.call(void 0, () => {
|
|
1699
|
-
const load = () => store.list({ metrics: [metric], from:
|
|
1717
|
+
const load = () => store.list({ metrics: [metric], from: _chunkYUXA7I4Jjs.startOf.call(void 0, /* @__PURE__ */ new Date(), "d").getTime() }).then((rows) => setToday(rows.reduce((a, e) => a + (_nullishCoalesce(e.value, () => ( 0))), 0)));
|
|
1700
1718
|
load();
|
|
1701
1719
|
return store.subscribe(load);
|
|
1702
1720
|
}, [store, metric]);
|
|
@@ -1762,6 +1780,100 @@ var styles6 = _reactnative.StyleSheet.create({
|
|
|
1762
1780
|
counterBtnText: { color: "#fff", fontSize: 18, fontWeight: "700" }
|
|
1763
1781
|
});
|
|
1764
1782
|
|
|
1783
|
+
// src/ui/inputs/InputGroup.tsx
|
|
1784
|
+
|
|
1785
|
+
function titleText(v) {
|
|
1786
|
+
if (v == null || v === "") return void 0;
|
|
1787
|
+
if (Array.isArray(v)) return v.length ? v.join(", ") : void 0;
|
|
1788
|
+
return typeof v === "boolean" ? void 0 : String(v);
|
|
1789
|
+
}
|
|
1790
|
+
function InputGroupBody({ panel }) {
|
|
1791
|
+
const theme = useDashTheme();
|
|
1792
|
+
const form = useInputForm();
|
|
1793
|
+
const group = _optionalChain([form, 'access', _60 => _60.group, 'optionalCall', _61 => _61(panel)]);
|
|
1794
|
+
if (!group) return null;
|
|
1795
|
+
const label = panel.options.itemTitle || "Item";
|
|
1796
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { style: styles7.fill, contentContainerStyle: styles7.list, nestedScrollEnabled: true, keyboardShouldPersistTaps: "handled", children: [
|
|
1797
|
+
group.items.map((item, i) => {
|
|
1798
|
+
const named = panel.options.titleFrom ? titleText(item.values[panel.options.titleFrom]) : void 0;
|
|
1799
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ItemCard, { panel, group, form, index: i, title: _nullishCoalesce(named, () => ( `${label} ${i + 1}`)), last: i === group.items.length - 1 }, item.key);
|
|
1800
|
+
}),
|
|
1801
|
+
group.canAdd && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1802
|
+
_reactnative.Pressable,
|
|
1803
|
+
{
|
|
1804
|
+
onPress: group.add,
|
|
1805
|
+
accessibilityRole: "button",
|
|
1806
|
+
style: ({ pressed }) => [styles7.add, { borderColor: theme.accent, opacity: pressed ? 0.7 : 1 }],
|
|
1807
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: { color: theme.accent, fontWeight: "600" }, children: [
|
|
1808
|
+
"+ ",
|
|
1809
|
+
panel.options.addLabel || `Add ${label.toLowerCase()}`
|
|
1810
|
+
] })
|
|
1811
|
+
}
|
|
1812
|
+
)
|
|
1813
|
+
] });
|
|
1814
|
+
}
|
|
1815
|
+
function ItemCard({ panel, group, form, index, title, last }) {
|
|
1816
|
+
const theme = useDashTheme();
|
|
1817
|
+
const fields = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.groupFields.call(void 0, panel), [panel]);
|
|
1818
|
+
const item = group.items[index];
|
|
1819
|
+
const scoped = _react.useMemo.call(void 0,
|
|
1820
|
+
() => ({
|
|
1821
|
+
...form,
|
|
1822
|
+
value: (m) => _nullishCoalesce(item.values[m], () => ( null)),
|
|
1823
|
+
setValue: (m, v) => group.setValue(index, m, v),
|
|
1824
|
+
isDirty: (m) => item.edited.includes(m),
|
|
1825
|
+
problem: (m) => group.fieldProblem(index, m)
|
|
1826
|
+
}),
|
|
1827
|
+
[form, group, index, item]
|
|
1828
|
+
);
|
|
1829
|
+
const button = (text, onPress, a11y, disabled = false) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1830
|
+
_reactnative.Pressable,
|
|
1831
|
+
{
|
|
1832
|
+
onPress,
|
|
1833
|
+
disabled,
|
|
1834
|
+
accessibilityRole: "button",
|
|
1835
|
+
accessibilityLabel: a11y,
|
|
1836
|
+
hitSlop: 6,
|
|
1837
|
+
style: ({ pressed }) => [styles7.iconBtn, { opacity: disabled ? 0.3 : pressed ? 0.6 : 1 }],
|
|
1838
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontSize: 15 }, children: text })
|
|
1839
|
+
}
|
|
1840
|
+
);
|
|
1841
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.item, { borderColor: theme.border }], children: [
|
|
1842
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.itemHeader, children: [
|
|
1843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.itemTitle, { color: theme.text }], numberOfLines: 1, children: title }),
|
|
1844
|
+
button("\u2191", () => group.move(index, -1), `Move ${title} up`, index === 0),
|
|
1845
|
+
button("\u2193", () => group.move(index, 1), `Move ${title} down`, last),
|
|
1846
|
+
button("\u29C9", () => group.duplicate(index), `Duplicate ${title}`, !group.canAdd),
|
|
1847
|
+
button("\u2715", () => group.remove(index), `Remove ${title}`)
|
|
1848
|
+
] }),
|
|
1849
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: scoped, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.fields, children: fields.map((f) => {
|
|
1850
|
+
const problem = _optionalChain([scoped, 'access', _62 => _62.problem, 'optionalCall', _63 => _63(f.options.metric)]);
|
|
1851
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.field, { width: `${Math.min(24, Math.max(1, f.gridPos.w)) / 24 * 100}%` }], children: [
|
|
1852
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.fieldHeader, children: [
|
|
1853
|
+
!!f.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.fieldTitle, { color: theme.textSecondary }], numberOfLines: 1, children: f.title }),
|
|
1854
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem })
|
|
1855
|
+
] }),
|
|
1856
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.fieldBody, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputPanelBody, { panel: f }) })
|
|
1857
|
+
] }, f.options.metric);
|
|
1858
|
+
}) }) })
|
|
1859
|
+
] });
|
|
1860
|
+
}
|
|
1861
|
+
var styles7 = _reactnative.StyleSheet.create({
|
|
1862
|
+
fill: { flex: 1 },
|
|
1863
|
+
list: { gap: 8, paddingBottom: 4 },
|
|
1864
|
+
item: { borderWidth: 1, borderRadius: 8, padding: 8, gap: 6 },
|
|
1865
|
+
itemHeader: { flexDirection: "row", alignItems: "center", gap: 4 },
|
|
1866
|
+
itemTitle: { flex: 1, fontSize: 14, fontWeight: "600" },
|
|
1867
|
+
iconBtn: { width: 28, height: 28, alignItems: "center", justifyContent: "center" },
|
|
1868
|
+
fields: { flexDirection: "row", flexWrap: "wrap", marginHorizontal: -4 },
|
|
1869
|
+
field: { paddingHorizontal: 4, paddingVertical: 4, gap: 4 },
|
|
1870
|
+
fieldHeader: { flexDirection: "row", gap: 6, alignItems: "baseline" },
|
|
1871
|
+
fieldTitle: { flex: 1, fontSize: 12, fontWeight: "600" },
|
|
1872
|
+
problem: { fontSize: 11, fontWeight: "600", flexShrink: 1 },
|
|
1873
|
+
fieldBody: { minHeight: 44 },
|
|
1874
|
+
add: { borderWidth: 1, borderStyle: "dashed", borderRadius: 8, paddingVertical: 10, alignItems: "center" }
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1765
1877
|
// src/ui/panels/GaugePanels.tsx
|
|
1766
1878
|
|
|
1767
1879
|
|
|
@@ -1776,17 +1888,17 @@ function StatPanel({ panel, frames }) {
|
|
|
1776
1888
|
const theme = useDashTheme();
|
|
1777
1889
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1778
1890
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1779
|
-
const horizontal = _optionalChain([panel, 'access',
|
|
1780
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
1891
|
+
const horizontal = _optionalChain([panel, 'access', _64 => _64.options, 'optionalAccess', _65 => _65.orientation]) === "horizontal";
|
|
1892
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles8.grid, { flexDirection: horizontal ? "column" : "row" }], children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatTile, { v, showName: values.length > 1, panel }, v.key)) });
|
|
1781
1893
|
}
|
|
1782
1894
|
function StatTile({ v, showName, panel }) {
|
|
1783
1895
|
const theme = useDashTheme();
|
|
1784
1896
|
const [size, onLayout] = useLayout();
|
|
1785
|
-
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
1786
|
-
const graph = (_nullishCoalesce(_optionalChain([panel, 'access',
|
|
1897
|
+
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access', _66 => _66.options, 'optionalAccess', _67 => _67.colorMode]), () => ( "value"));
|
|
1898
|
+
const graph = (_nullishCoalesce(_optionalChain([panel, 'access', _68 => _68.options, 'optionalAccess', _69 => _69.graphMode]), () => ( "area"))) === "area" && v.sparkline.filter((x) => x != null).length > 1;
|
|
1787
1899
|
const fontSize = Math.max(18, Math.min(56, size.height * (graph ? 0.4 : 0.5), size.width / 4.5));
|
|
1788
1900
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1789
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
1901
|
+
const hasLinks = !!_optionalChain([v, 'access', _70 => _70.config, 'access', _71 => _71.links, 'optionalAccess', _72 => _72.length]);
|
|
1790
1902
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1791
1903
|
_reactnative.Pressable,
|
|
1792
1904
|
{
|
|
@@ -1795,17 +1907,17 @@ function StatTile({ v, showName, panel }) {
|
|
|
1795
1907
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
1796
1908
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
1797
1909
|
style: ({ pressed }) => [
|
|
1798
|
-
|
|
1910
|
+
styles8.tile,
|
|
1799
1911
|
// With a sparkline, the number sits in the top half so the line runs beneath it.
|
|
1800
1912
|
graph && { justifyContent: "flex-start", paddingTop: 4 },
|
|
1801
1913
|
colorMode === "background" && { backgroundColor: withAlpha(v.stateColor, 0.14) },
|
|
1802
1914
|
pressed && { opacity: 0.7 }
|
|
1803
1915
|
],
|
|
1804
1916
|
children: [
|
|
1805
|
-
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
1917
|
+
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles8.accent, { backgroundColor: v.stateColor }] }),
|
|
1806
1918
|
graph && size.width > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Sparkline, { values: v.sparkline, width: size.width, height: size.height * 0.4, color: v.stateColor }),
|
|
1807
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1808
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1919
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
1920
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.value, { color: theme.text, fontSize }], numberOfLines: 1, adjustsFontSizeToFit: true, children: v.text })
|
|
1809
1921
|
]
|
|
1810
1922
|
}
|
|
1811
1923
|
);
|
|
@@ -1820,7 +1932,7 @@ function Sparkline({ values, width, height, color }) {
|
|
|
1820
1932
|
values.forEach((v, i) => {
|
|
1821
1933
|
if (v != null) line += `${line ? "L" : "M"}${x(i)},${y(v)}`;
|
|
1822
1934
|
});
|
|
1823
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style:
|
|
1935
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style: styles8.spark, children: [
|
|
1824
1936
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${line}L${width},${height}L0,${height}Z`, fill: color, opacity: 0.1 }),
|
|
1825
1937
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: line, stroke: color, strokeWidth: 2, fill: "none", strokeLinejoin: "round" })
|
|
1826
1938
|
] });
|
|
@@ -1829,7 +1941,7 @@ function withAlpha(hex, alpha) {
|
|
|
1829
1941
|
if (!/^#[0-9a-f]{6}$/i.test(hex)) return hex;
|
|
1830
1942
|
return `${hex}${Math.round(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
1831
1943
|
}
|
|
1832
|
-
var
|
|
1944
|
+
var styles8 = _reactnative.StyleSheet.create({
|
|
1833
1945
|
grid: { flex: 1, gap: 8 },
|
|
1834
1946
|
tile: { flex: 1, justifyContent: "center", paddingLeft: 12, borderRadius: 6, overflow: "hidden" },
|
|
1835
1947
|
accent: { position: "absolute", left: 0, top: 6, bottom: 6, width: 3, borderRadius: 2 },
|
|
@@ -1845,13 +1957,13 @@ function GaugePanel({ panel, frames }) {
|
|
|
1845
1957
|
const theme = useDashTheme();
|
|
1846
1958
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1847
1959
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1848
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
1960
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles9.row, children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Gauge, { v, showName: values.length > 1, panel }, v.key)) });
|
|
1849
1961
|
}
|
|
1850
1962
|
function Gauge({ v, showName, panel }) {
|
|
1851
1963
|
const theme = useDashTheme();
|
|
1852
1964
|
const [size, onLayout] = useLayout();
|
|
1853
1965
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1854
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
1966
|
+
const hasLinks = !!_optionalChain([v, 'access', _73 => _73.config, 'access', _74 => _74.links, 'optionalAccess', _75 => _75.length]);
|
|
1855
1967
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
1856
1968
|
const max = _nullishCoalesce(v.config.max, () => ( 100));
|
|
1857
1969
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
@@ -1863,7 +1975,7 @@ function Gauge({ v, showName, panel }) {
|
|
|
1863
1975
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1864
1976
|
_reactnative.Pressable,
|
|
1865
1977
|
{
|
|
1866
|
-
style: ({ pressed }) => [
|
|
1978
|
+
style: ({ pressed }) => [styles9.fill, pressed && { opacity: 0.7 }],
|
|
1867
1979
|
onLayout,
|
|
1868
1980
|
disabled: !hasLinks,
|
|
1869
1981
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
@@ -1873,9 +1985,9 @@ function Gauge({ v, showName, panel }) {
|
|
|
1873
1985
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: arc(cx, cy, r, 0, 1), stroke: withAlpha(v.stateColor, 0.18), strokeWidth: stroke, fill: "none", strokeLinecap: "round" }),
|
|
1874
1986
|
frac > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: arc(cx, cy, r, 0, frac), stroke: v.stateColor, strokeWidth: stroke, fill: "none", strokeLinecap: "round" })
|
|
1875
1987
|
] }),
|
|
1876
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill,
|
|
1877
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1878
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1988
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill, styles9.center, { top: d * 0.12 }], pointerEvents: "none", children: [
|
|
1989
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.value, { color: theme.text, fontSize: Math.max(14, d * 0.18) }], numberOfLines: 1, adjustsFontSizeToFit: true, children: v.text }),
|
|
1990
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name })
|
|
1879
1991
|
] })
|
|
1880
1992
|
]
|
|
1881
1993
|
}
|
|
@@ -1894,32 +2006,32 @@ function BarGaugePanel({ panel, frames }) {
|
|
|
1894
2006
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1895
2007
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1896
2008
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1897
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2009
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles9.bars, children: values.map((v) => {
|
|
1898
2010
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
1899
2011
|
const max = _nullishCoalesce(v.config.max, () => ( Math.max(...values.map((o) => _nullishCoalesce(o.value, () => ( 0))), 1)));
|
|
1900
2012
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
1901
|
-
const color = v.config.thresholds || _optionalChain([v, 'access',
|
|
1902
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2013
|
+
const color = v.config.thresholds || _optionalChain([v, 'access', _76 => _76.mapped, 'optionalAccess', _77 => _77.color]) ? v.stateColor : _chunkYUXA7I4Jjs.resolveColor.call(void 0, _optionalChain([v, 'access', _78 => _78.config, 'access', _79 => _79.color, 'optionalAccess', _80 => _80.fixedColor]), v.color);
|
|
2014
|
+
const hasLinks = !!_optionalChain([v, 'access', _81 => _81.config, 'access', _82 => _82.links, 'optionalAccess', _83 => _83.length]);
|
|
1903
2015
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1904
2016
|
_reactnative.Pressable,
|
|
1905
2017
|
{
|
|
1906
|
-
style: ({ pressed }) => [
|
|
2018
|
+
style: ({ pressed }) => [styles9.barRow, pressed && { opacity: 0.7 }],
|
|
1907
2019
|
disabled: !hasLinks,
|
|
1908
2020
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
1909
2021
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
1910
2022
|
children: [
|
|
1911
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1912
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2023
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles9.barLabels, children: [
|
|
2024
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
2025
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.barValue, { color: theme.text }], children: v.text })
|
|
1914
2026
|
] }),
|
|
1915
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2027
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.track, { backgroundColor: withAlpha(color, 0.18) }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.meter, { width: `${frac * 100}%`, backgroundColor: color }] }) })
|
|
1916
2028
|
]
|
|
1917
2029
|
},
|
|
1918
2030
|
v.key
|
|
1919
2031
|
);
|
|
1920
2032
|
}) });
|
|
1921
2033
|
}
|
|
1922
|
-
var
|
|
2034
|
+
var styles9 = _reactnative.StyleSheet.create({
|
|
1923
2035
|
fill: { flex: 1 },
|
|
1924
2036
|
row: { flex: 1, flexDirection: "row", gap: 8 },
|
|
1925
2037
|
center: { alignItems: "center", justifyContent: "center" },
|
|
@@ -1962,8 +2074,8 @@ var TILE_LAYERS = /* @__PURE__ */ new Set(["default", "carto", "esri-xyz", "xyz"
|
|
|
1962
2074
|
var fillTemplate = (template, z, x, y) => template.replace("{z}", String(z)).replace("{x}", String(x)).replace("{-y}", String(2 ** z - 1 - y)).replace("{y}", String(y));
|
|
1963
2075
|
var stripTags = (html) => html.replace(/<[^>]*>/g, "").replace(/©/g, "\xA9").trim();
|
|
1964
2076
|
function tileSource(layer, scheme, retina = false) {
|
|
1965
|
-
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess',
|
|
1966
|
-
switch (_optionalChain([layer, 'optionalAccess',
|
|
2077
|
+
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess', _84 => _84.config]), () => ( {}));
|
|
2078
|
+
switch (_optionalChain([layer, 'optionalAccess', _85 => _85.type])) {
|
|
1967
2079
|
case "osm-standard":
|
|
1968
2080
|
return { url: (z, x, y) => `https://tile.openstreetmap.org/${z}/${x}/${y}.png`, maxZoom: 19, attribution: "\xA9 OpenStreetMap contributors" };
|
|
1969
2081
|
case "esri-xyz": {
|
|
@@ -2024,11 +2136,11 @@ var REGIONS = {
|
|
|
2024
2136
|
oceania: { lat: -10, lon: -140, zoom: 3 }
|
|
2025
2137
|
};
|
|
2026
2138
|
function zoomLimits(panel) {
|
|
2027
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2139
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _86 => _86.options, 'optionalAccess', _87 => _87.view]), () => ( {}));
|
|
2028
2140
|
return [_nullishCoalesce(v.minZoom, () => ( 0)), _nullishCoalesce(v.maxZoom, () => ( MAX_ZOOM))];
|
|
2029
2141
|
}
|
|
2030
2142
|
function initialView(panel, layers, width, height) {
|
|
2031
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2143
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _88 => _88.options, 'optionalAccess', _89 => _89.view]), () => ( {}));
|
|
2032
2144
|
const [minZoom, maxZoom] = zoomLimits(panel);
|
|
2033
2145
|
const limit = (view) => ({ ...view, zoom: clamp(view.zoom, minZoom, maxZoom) });
|
|
2034
2146
|
if (v.id === "coords") return limit({ lat: _nullishCoalesce(v.lat, () => ( 0)), lon: _nullishCoalesce(v.lon, () => ( 0)), zoom: _nullishCoalesce(v.zoom, () => ( 1)) });
|
|
@@ -2061,7 +2173,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2061
2173
|
const o = _nullishCoalesce(panel.options, () => ( {}));
|
|
2062
2174
|
const out = [];
|
|
2063
2175
|
const basemap = o.basemap;
|
|
2064
|
-
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess',
|
|
2176
|
+
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _90 => _90.name]), () => ( "Basemap")), opacity: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _91 => _91.opacity]), () => ( 1)), source: tileSource(basemap, scheme, retina) });
|
|
2065
2177
|
const multiple = frames.length > 1;
|
|
2066
2178
|
(_nullishCoalesce(o.layers, () => ( DEFAULT_LAYERS))).forEach((layer, li) => {
|
|
2067
2179
|
const key = `${li}/${layer.type}`;
|
|
@@ -2074,12 +2186,12 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2074
2186
|
}
|
|
2075
2187
|
if (!isDataLayer(layer.type)) return;
|
|
2076
2188
|
const filter = layer.filterData;
|
|
2077
|
-
const chosen = _optionalChain([filter, 'optionalAccess',
|
|
2189
|
+
const chosen = _optionalChain([filter, 'optionalAccess', _92 => _92.id]) === "byRefId" && filter.options ? frames.filter((f) => f.refId === filter.options) : frames;
|
|
2078
2190
|
const style = _nullishCoalesce(config.style, () => ( {}));
|
|
2079
2191
|
const color = _nullishCoalesce(style.color, () => ( {}));
|
|
2080
2192
|
const size = _nullishCoalesce(style.size, () => ( {}));
|
|
2081
2193
|
const text = style.text;
|
|
2082
|
-
const fixedColor =
|
|
2194
|
+
const fixedColor = _chunkYUXA7I4Jjs.resolveColor.call(void 0, _nullishCoalesce(color.fixed, () => ( "dark-green")), "#37872D");
|
|
2083
2195
|
const heat = layer.type === "heatmap";
|
|
2084
2196
|
const weight = _nullishCoalesce(config.weight, () => ( {}));
|
|
2085
2197
|
const legend = [];
|
|
@@ -2091,14 +2203,14 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2091
2203
|
let { xs, ys } = located;
|
|
2092
2204
|
if (layer.type === "lastPointTracker" && rows.length) [rows, xs, ys] = [rows.slice(-1), xs.slice(-1), ys.slice(-1)];
|
|
2093
2205
|
const find = (field) => field ? fieldByName(frame, field, multiple) : void 0;
|
|
2094
|
-
const configOf = (f) =>
|
|
2206
|
+
const configOf = (f) => _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, f, frame, _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple));
|
|
2095
2207
|
let colors = rows.map(() => fixedColor);
|
|
2096
2208
|
const colorField = !heat ? find(color.field) : void 0;
|
|
2097
2209
|
if (colorField) {
|
|
2098
2210
|
const cConfig = configOf(colorField);
|
|
2099
2211
|
const values = rows.map((i) => num(colorField.values[i]));
|
|
2100
2212
|
const extent = range(values);
|
|
2101
|
-
colors = values.map((v) =>
|
|
2213
|
+
colors = values.map((v) => _chunkYUXA7I4Jjs.valueColor.call(void 0, v, cConfig, fixedColor, extent));
|
|
2102
2214
|
if (showsLegend(layer) && legend.length === 0) legend.push(...thresholdLegend(`${key}/${frames.indexOf(frame)}`, cConfig, fixedColor));
|
|
2103
2215
|
}
|
|
2104
2216
|
const dim = heat ? weight : size;
|
|
@@ -2134,7 +2246,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2134
2246
|
name,
|
|
2135
2247
|
opacity,
|
|
2136
2248
|
points,
|
|
2137
|
-
symbol: markerSymbol(_optionalChain([style, 'access',
|
|
2249
|
+
symbol: markerSymbol(_optionalChain([style, 'access', _93 => _93.symbol, 'optionalAccess', _94 => _94.fixed])),
|
|
2138
2250
|
fillOpacity: _nullishCoalesce(style.opacity, () => ( 0.4)),
|
|
2139
2251
|
fontSize: _nullishCoalesce(textConfig.fontSize, () => ( 12)),
|
|
2140
2252
|
labelOffset: [_nullishCoalesce(textConfig.offsetX, () => ( 0)), _nullishCoalesce(textConfig.offsetY, () => ( 0))],
|
|
@@ -2145,37 +2257,37 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2145
2257
|
});
|
|
2146
2258
|
return out;
|
|
2147
2259
|
}
|
|
2148
|
-
var showsLegend = (layer) => _optionalChain([layer, 'access',
|
|
2260
|
+
var showsLegend = (layer) => _optionalChain([layer, 'access', _95 => _95.config, 'optionalAccess', _96 => _96.showLegend]) !== false;
|
|
2149
2261
|
function markerSymbol(path) {
|
|
2150
2262
|
const name = typeof path === "string" ? path.replace(/^.*\//, "").replace(/\.svg$/, "") : "";
|
|
2151
2263
|
return name === "square" || name === "triangle" || name === "star" || name === "cross" || name === "x" ? name : "circle";
|
|
2152
2264
|
}
|
|
2153
2265
|
function thresholdLegend(key, config, fallback) {
|
|
2154
|
-
if (_optionalChain([config, 'access',
|
|
2155
|
-
const steps = _nullishCoalesce(_optionalChain([config, 'access',
|
|
2266
|
+
if (_optionalChain([config, 'access', _97 => _97.color, 'optionalAccess', _98 => _98.mode]) && config.color.mode !== "thresholds") return [];
|
|
2267
|
+
const steps = _nullishCoalesce(_optionalChain([config, 'access', _99 => _99.thresholds, 'optionalAccess', _100 => _100.steps]), () => ( []));
|
|
2156
2268
|
if (steps.length < 2) return [];
|
|
2157
2269
|
return steps.map((s, i) => ({
|
|
2158
2270
|
key: `${key}/${i}`,
|
|
2159
|
-
name: s.value == null ? `< ${
|
|
2160
|
-
color:
|
|
2271
|
+
name: s.value == null ? `< ${_chunkYUXA7I4Jjs.formatValue.call(void 0, steps[i + 1].value, config)}` : `${_chunkYUXA7I4Jjs.formatValue.call(void 0, s.value, config)}+`,
|
|
2272
|
+
color: _chunkYUXA7I4Jjs.resolveColor.call(void 0, s.color, fallback)
|
|
2161
2273
|
}));
|
|
2162
2274
|
}
|
|
2163
2275
|
var isDataLayer = (type) => type === "markers" || type === "heatmap" || type === "route" || type === "lastPointTracker";
|
|
2164
2276
|
var lookupField = (frame) => frame.fields.find((f) => f.name.toLowerCase() === "lookup");
|
|
2165
2277
|
function gazetteerPaths(panel, frames) {
|
|
2166
2278
|
const paths = /* @__PURE__ */ new Set();
|
|
2167
|
-
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2279
|
+
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access', _101 => _101.options, 'optionalAccess', _102 => _102.layers]), () => ( DEFAULT_LAYERS))) {
|
|
2168
2280
|
if (!isDataLayer(layer.type)) continue;
|
|
2169
|
-
const mode = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
2170
|
-
if (mode === "lookup") paths.add(_optionalChain([layer, 'access',
|
|
2171
|
-
else if (mode === "auto" && frames.some(lookupField)) paths.add(
|
|
2281
|
+
const mode = _nullishCoalesce(_optionalChain([layer, 'access', _103 => _103.location, 'optionalAccess', _104 => _104.mode]), () => ( "auto"));
|
|
2282
|
+
if (mode === "lookup") paths.add(_optionalChain([layer, 'access', _105 => _105.location, 'optionalAccess', _106 => _106.gazetteer]) || _chunkYUXA7I4Jjs.DEFAULT_GAZETTEER);
|
|
2283
|
+
else if (mode === "auto" && frames.some(lookupField)) paths.add(_chunkYUXA7I4Jjs.DEFAULT_GAZETTEER);
|
|
2172
2284
|
}
|
|
2173
2285
|
return [...paths];
|
|
2174
2286
|
}
|
|
2175
2287
|
var LAT_NAMES = ["lat", "latitude"];
|
|
2176
2288
|
var LON_NAMES = ["lon", "lng", "long", "longitude"];
|
|
2177
2289
|
function fieldByName(frame, name, multiple) {
|
|
2178
|
-
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) =>
|
|
2290
|
+
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) => _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple) === name)));
|
|
2179
2291
|
}
|
|
2180
2292
|
function locate2(frame, location = {}, gazetteers = {}) {
|
|
2181
2293
|
const mode = _nullishCoalesce(location.mode, () => ( "auto"));
|
|
@@ -2194,10 +2306,10 @@ function locate2(frame, location = {}, gazetteers = {}) {
|
|
|
2194
2306
|
lat = named(LAT_NAMES);
|
|
2195
2307
|
lon = named(LON_NAMES);
|
|
2196
2308
|
if (!lat || !lon) hash = named(["geohash"]);
|
|
2197
|
-
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[
|
|
2309
|
+
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[_chunkYUXA7I4Jjs.DEFAULT_GAZETTEER]];
|
|
2198
2310
|
} else if (mode === "lookup") {
|
|
2199
2311
|
lookup = location.lookup ? fieldByName(frame, location.lookup, false) : lookupField(frame);
|
|
2200
|
-
gazetteer = gazetteers[location.gazetteer ||
|
|
2312
|
+
gazetteer = gazetteers[location.gazetteer || _chunkYUXA7I4Jjs.DEFAULT_GAZETTEER];
|
|
2201
2313
|
}
|
|
2202
2314
|
const rows = [];
|
|
2203
2315
|
const xs = [];
|
|
@@ -2246,8 +2358,8 @@ function decodeGeohash(hash) {
|
|
|
2246
2358
|
}
|
|
2247
2359
|
function cellText(field, v, config) {
|
|
2248
2360
|
if (v == null) return "";
|
|
2249
|
-
if (field.type === "number") return
|
|
2250
|
-
if (field.type === "time") return new Date(
|
|
2361
|
+
if (field.type === "number") return _chunkYUXA7I4Jjs.formatDisplay.call(void 0, Number(v), config);
|
|
2362
|
+
if (field.type === "time") return new Date(_chunkYUXA7I4Jjs.toMillis.call(void 0, v)).toLocaleString();
|
|
2251
2363
|
return String(v);
|
|
2252
2364
|
}
|
|
2253
2365
|
function num(v) {
|
|
@@ -2387,13 +2499,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2387
2499
|
])
|
|
2388
2500
|
);
|
|
2389
2501
|
}, [layers, view, size.width, size.height]);
|
|
2390
|
-
const tooltips = _optionalChain([panel, 'access',
|
|
2502
|
+
const tooltips = _optionalChain([panel, 'access', _107 => _107.options, 'optionalAccess', _108 => _108.tooltip, 'optionalAccess', _109 => _109.mode]) !== "none";
|
|
2391
2503
|
const pick = (x, y) => {
|
|
2392
2504
|
let best = null;
|
|
2393
2505
|
let bestD = HIT_PX * HIT_PX;
|
|
2394
2506
|
for (const l of layers) {
|
|
2395
2507
|
if (l.type === "tiles" || l.type === "heatmap" || !l.tooltip) continue;
|
|
2396
|
-
_optionalChain([screen, 'access',
|
|
2508
|
+
_optionalChain([screen, 'access', _110 => _110.get, 'call', _111 => _111(l.key), 'optionalAccess', _112 => _112.forEach, 'call', _113 => _113(({ px, py }, group) => {
|
|
2397
2509
|
for (let i = 0; i < px.length; i++) {
|
|
2398
2510
|
const d = (px[i] - x) ** 2 + (py[i] - y) ** 2;
|
|
2399
2511
|
if (d <= bestD) {
|
|
@@ -2443,12 +2555,12 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2443
2555
|
}
|
|
2444
2556
|
};
|
|
2445
2557
|
const shown = picked && resolvePicked(layers, screen, picked);
|
|
2446
|
-
const controls = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2558
|
+
const controls = _nullishCoalesce(_optionalChain([panel, 'access', _114 => _114.options, 'optionalAccess', _115 => _115.controls]), () => ( {}));
|
|
2447
2559
|
const attribution = [...new Set(layers.flatMap((l) => l.type === "tiles" && l.source.attribution ? [l.source.attribution] : []))].join(" ");
|
|
2448
2560
|
const legend = layers.flatMap((l) => l.type === "markers" || l.type === "route" ? l.legend : []);
|
|
2449
2561
|
const ready = size.width > 0 && size.height > 0;
|
|
2450
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2451
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
2562
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles10.fill, children: [
|
|
2563
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles10.fill, styles10.map, { backgroundColor: theme.grid }], onLayout, ...responder, children: [
|
|
2452
2564
|
ready && // Nothing inside takes touches, so locationX/Y are always relative to the map.
|
|
2453
2565
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { pointerEvents: "none", style: _reactnative.StyleSheet.absoluteFill, children: [
|
|
2454
2566
|
layers.map(
|
|
@@ -2476,13 +2588,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2476
2588
|
onOpenLink: (l) => links.openLinks([l])
|
|
2477
2589
|
}
|
|
2478
2590
|
),
|
|
2479
|
-
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2591
|
+
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles10.zoom, children: [
|
|
2480
2592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "+", onPress: () => zoomTo(view, Math.round(view.zoom) + 1) }),
|
|
2481
2593
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u2212", onPress: () => zoomTo(view, Math.round(view.zoom) - 1) }),
|
|
2482
2594
|
moved && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u27F2", onPress: () => setMoved(null) })
|
|
2483
2595
|
] }),
|
|
2484
|
-
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2485
|
-
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2596
|
+
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [styles10.error, { color: theme.danger, backgroundColor: theme.surface }], numberOfLines: 2, children: error }) : null,
|
|
2597
|
+
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [styles10.attribution, { color: theme.textSecondary, backgroundColor: theme.surface }], numberOfLines: 1, children: attribution }) : null
|
|
2486
2598
|
] }),
|
|
2487
2599
|
legend.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: legend })
|
|
2488
2600
|
] });
|
|
@@ -2497,17 +2609,17 @@ function useGazetteers(panel, frames) {
|
|
|
2497
2609
|
let live = true;
|
|
2498
2610
|
let ds;
|
|
2499
2611
|
try {
|
|
2500
|
-
ds = _optionalChain([resolve, 'optionalCall',
|
|
2612
|
+
ds = _optionalChain([resolve, 'optionalCall', _116 => _116(_chunkYUXA7I4Jjs.normalizeRef.call(void 0, panel.datasource))]);
|
|
2501
2613
|
} catch (e5) {
|
|
2502
2614
|
}
|
|
2503
2615
|
const paths = key.split("\n");
|
|
2504
|
-
Promise.allSettled(paths.map((p) =>
|
|
2616
|
+
Promise.allSettled(paths.map((p) => _chunkYUXA7I4Jjs.loadGazetteer.call(void 0, p, ds))).then((results) => {
|
|
2505
2617
|
if (!live) return;
|
|
2506
2618
|
const gazetteers = {};
|
|
2507
2619
|
const errors = [];
|
|
2508
2620
|
results.forEach((r, i) => {
|
|
2509
2621
|
if (r.status === "fulfilled") gazetteers[paths[i]] = r.value;
|
|
2510
|
-
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access',
|
|
2622
|
+
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access', _117 => _117.reason, 'optionalAccess', _118 => _118.message]), () => ( r.reason))}`);
|
|
2511
2623
|
});
|
|
2512
2624
|
setState({ key, gazetteers, error: errors.join("\n") || void 0 });
|
|
2513
2625
|
});
|
|
@@ -2519,7 +2631,7 @@ function useGazetteers(panel, frames) {
|
|
|
2519
2631
|
}
|
|
2520
2632
|
function MapButton({ label, onPress }) {
|
|
2521
2633
|
const theme = useDashTheme();
|
|
2522
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [
|
|
2634
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [styles10.button, { backgroundColor: theme.surface, borderColor: theme.border }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.buttonText, { color: theme.text }], children: label }) });
|
|
2523
2635
|
}
|
|
2524
2636
|
function Tiles({ layer, view, width, height }) {
|
|
2525
2637
|
const tiles = visibleTiles(layer.source, view, width, height);
|
|
@@ -2559,7 +2671,7 @@ function markerPaths(layer, screen, width, height, textColor) {
|
|
|
2559
2671
|
if (px[i] < -r || px[i] > width + r || py[i] < -r || py[i] > height + r) continue;
|
|
2560
2672
|
const parts = _nullishCoalesce(byColor.get(p.colors[i]), () => ( byColor.set(p.colors[i], []).get(p.colors[i])));
|
|
2561
2673
|
parts.push(symbolPath(layer.symbol, px[i], py[i], r));
|
|
2562
|
-
const label = _optionalChain([p, 'access',
|
|
2674
|
+
const label = _optionalChain([p, 'access', _119 => _119.labels, 'optionalAccess', _120 => _120[i]]);
|
|
2563
2675
|
if (label && labels.length < MAX_LABELS)
|
|
2564
2676
|
labels.push(
|
|
2565
2677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2598,7 +2710,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2598
2710
|
const layer = layers.find((l) => l.key === picked.layer);
|
|
2599
2711
|
if (!layer || layer.type !== "markers" && layer.type !== "route") return null;
|
|
2600
2712
|
const p = layer.points[picked.group];
|
|
2601
|
-
const s = _optionalChain([screen, 'access',
|
|
2713
|
+
const s = _optionalChain([screen, 'access', _121 => _121.get, 'call', _122 => _122(layer.key), 'optionalAccess', _123 => _123[picked.group]]);
|
|
2602
2714
|
if (!p || !s || picked.index >= p.rows.length) return null;
|
|
2603
2715
|
return {
|
|
2604
2716
|
layer,
|
|
@@ -2610,7 +2722,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2610
2722
|
py: s.py[picked.index]
|
|
2611
2723
|
};
|
|
2612
2724
|
}
|
|
2613
|
-
var
|
|
2725
|
+
var styles10 = _reactnative.StyleSheet.create({
|
|
2614
2726
|
fill: { flex: 1 },
|
|
2615
2727
|
map: { overflow: "hidden", borderRadius: 4 },
|
|
2616
2728
|
zoom: { position: "absolute", top: 6, left: 6, gap: 4 },
|
|
@@ -2636,7 +2748,7 @@ var styles9 = _reactnative.StyleSheet.create({
|
|
|
2636
2748
|
var DEFAULT_WIDTH = 120;
|
|
2637
2749
|
function cellType(config) {
|
|
2638
2750
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2639
|
-
const type = _nullishCoalesce(_optionalChain([custom, 'access',
|
|
2751
|
+
const type = _nullishCoalesce(_optionalChain([custom, 'access', _124 => _124.cellOptions, 'optionalAccess', _125 => _125.type]), () => ( custom.displayMode));
|
|
2640
2752
|
if (type === "color-text" || type === "color-background" || type === "gauge") return type;
|
|
2641
2753
|
if (type === "color-background-solid") return "color-background";
|
|
2642
2754
|
if (type === "gradient-gauge" || type === "lcd-gauge" || type === "basic") return "gauge";
|
|
@@ -2644,10 +2756,10 @@ function cellType(config) {
|
|
|
2644
2756
|
}
|
|
2645
2757
|
function tableColumns(panel, frame, multipleFrames = false) {
|
|
2646
2758
|
return frame.fields.flatMap((field, i) => {
|
|
2647
|
-
const raw =
|
|
2648
|
-
const config =
|
|
2759
|
+
const raw = _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, field, frame, multipleFrames);
|
|
2760
|
+
const config = _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
2649
2761
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2650
|
-
if (custom.hidden || _optionalChain([custom, 'access',
|
|
2762
|
+
if (custom.hidden || _optionalChain([custom, 'access', _126 => _126.hideFrom, 'optionalAccess', _127 => _127.viz])) return [];
|
|
2651
2763
|
const numeric = field.type === "number";
|
|
2652
2764
|
const align = custom.align === "left" || custom.align === "center" || custom.align === "right" ? custom.align : numeric ? "right" : "left";
|
|
2653
2765
|
const type = cellType(config);
|
|
@@ -2660,8 +2772,8 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2660
2772
|
width: Math.max(Number(custom.width) || DEFAULT_WIDTH, Number(custom.minWidth) || 0),
|
|
2661
2773
|
align,
|
|
2662
2774
|
cellType: type,
|
|
2663
|
-
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access',
|
|
2664
|
-
wrap: !!_optionalChain([custom, 'access',
|
|
2775
|
+
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access', _128 => _128.cellOptions, 'optionalAccess', _129 => _129.applyToRow]),
|
|
2776
|
+
wrap: !!_optionalChain([custom, 'access', _130 => _130.cellOptions, 'optionalAccess', _131 => _131.wrapText]),
|
|
2665
2777
|
extent: numeric ? extentOf(field.values) : void 0,
|
|
2666
2778
|
reducers: footerReducers(panel, config, [field.name, _nullishCoalesce(config.displayName, () => ( raw))])
|
|
2667
2779
|
}
|
|
@@ -2669,11 +2781,11 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2669
2781
|
});
|
|
2670
2782
|
}
|
|
2671
2783
|
function footerReducers(panel, config, names) {
|
|
2672
|
-
const own = _optionalChain([config, 'access',
|
|
2673
|
-
if (_optionalChain([own, 'optionalAccess',
|
|
2674
|
-
const legacy = _optionalChain([panel, 'access',
|
|
2675
|
-
if (!_optionalChain([legacy, 'optionalAccess',
|
|
2676
|
-
const reducer = _optionalChain([legacy, 'access',
|
|
2784
|
+
const own = _optionalChain([config, 'access', _132 => _132.custom, 'optionalAccess', _133 => _133.footer, 'optionalAccess', _134 => _134.reducers]);
|
|
2785
|
+
if (_optionalChain([own, 'optionalAccess', _135 => _135.length])) return own;
|
|
2786
|
+
const legacy = _optionalChain([panel, 'access', _136 => _136.options, 'optionalAccess', _137 => _137.footer]);
|
|
2787
|
+
if (!_optionalChain([legacy, 'optionalAccess', _138 => _138.show])) return [];
|
|
2788
|
+
const reducer = _optionalChain([legacy, 'access', _139 => _139.reducer, 'optionalAccess', _140 => _140.length]) ? legacy.reducer : ["sum"];
|
|
2677
2789
|
if (legacy.countRows && reducer[0] === "count") return ["countAll"];
|
|
2678
2790
|
const fields = Array.isArray(legacy.fields) ? legacy.fields : legacy.fields ? [legacy.fields] : [];
|
|
2679
2791
|
return !fields.length || names.some((n) => fields.includes(n)) ? reducer : [];
|
|
@@ -2688,16 +2800,16 @@ function tableFooter(columns) {
|
|
|
2688
2800
|
counted = true;
|
|
2689
2801
|
return [{ label: "Count", text: String(c.field.values.length) }];
|
|
2690
2802
|
}
|
|
2691
|
-
if (!
|
|
2692
|
-
const label =
|
|
2803
|
+
if (!_chunkYUXA7I4Jjs.isReducer.call(void 0, r)) return [];
|
|
2804
|
+
const label = _chunkYUXA7I4Jjs.REDUCER_LABELS[r];
|
|
2693
2805
|
if (r === "count") return [{ label, text: String(c.field.values.length) }];
|
|
2694
2806
|
if (c.field.type !== "number") {
|
|
2695
2807
|
if (r === "distinctCount") return [{ label, text: String(new Set(c.field.values.filter((v) => v != null)).size) }];
|
|
2696
2808
|
return [];
|
|
2697
2809
|
}
|
|
2698
|
-
const value =
|
|
2810
|
+
const value = _chunkYUXA7I4Jjs.reduce.call(void 0, c.field.values.map((v) => v == null ? null : Number(v)), r);
|
|
2699
2811
|
const counts = r === "distinctCount" || r === "changeCount";
|
|
2700
|
-
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) :
|
|
2812
|
+
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) : _chunkYUXA7I4Jjs.formatValue.call(void 0, value, c.config) }];
|
|
2701
2813
|
});
|
|
2702
2814
|
return lines.length === 1 && lines[0].label !== "Count" ? [{ text: lines[0].text }] : lines;
|
|
2703
2815
|
});
|
|
@@ -2716,17 +2828,17 @@ function extentOf(values) {
|
|
|
2716
2828
|
}
|
|
2717
2829
|
function cellDisplay(col, raw, fallbackColor) {
|
|
2718
2830
|
const { config, field } = col;
|
|
2719
|
-
const mapped =
|
|
2831
|
+
const mapped = _chunkYUXA7I4Jjs.mappedResult.call(void 0, raw, config);
|
|
2720
2832
|
const num4 = field.type === "number" && raw != null && Number.isFinite(Number(raw)) ? Number(raw) : null;
|
|
2721
|
-
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
2833
|
+
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _141 => _141.text]), () => ( (raw == null ? _nullishCoalesce(config.noValue, () => ( "")) : field.type === "number" ? _chunkYUXA7I4Jjs.formatValue.call(void 0, num4, config) : field.type === "time" ? new Date(_chunkYUXA7I4Jjs.toMillis.call(void 0, raw)).toLocaleString() : String(raw))));
|
|
2722
2834
|
if (col.cellType === "auto") return { text };
|
|
2723
|
-
const mode = _optionalChain([config, 'access',
|
|
2724
|
-
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
2725
|
-
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess',
|
|
2835
|
+
const mode = _optionalChain([config, 'access', _142 => _142.color, 'optionalAccess', _143 => _143.mode]);
|
|
2836
|
+
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _144 => _144.color]), () => ( (mode === "fixed" ? _optionalChain([config, 'access', _145 => _145.color, 'optionalAccess', _146 => _146.fixedColor]) : (!mode || mode === "thresholds") && num4 != null ? _optionalChain([_chunkYUXA7I4Jjs.thresholdStep.call(void 0, num4, config), 'optionalAccess', _147 => _147.color]) : void 0)));
|
|
2837
|
+
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess', _148 => _148.color]) ? _chunkYUXA7I4Jjs.resolveColor.call(void 0, mapped.color, fallbackColor) : num4 == null ? void 0 : _chunkYUXA7I4Jjs.valueColor.call(void 0, num4, config, fallbackColor, col.extent);
|
|
2726
2838
|
if (col.cellType === "color-text") return { text, color };
|
|
2727
2839
|
if (col.cellType === "color-background") return { text, background: color };
|
|
2728
|
-
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access',
|
|
2729
|
-
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access',
|
|
2840
|
+
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access', _149 => _149.extent, 'optionalAccess', _150 => _150[0]]), () => ( 0)))));
|
|
2841
|
+
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access', _151 => _151.extent, 'optionalAccess', _152 => _152[1]]))), () => ( 1));
|
|
2730
2842
|
const gauge = num4 == null ? void 0 : Math.min(1, Math.max(0, (num4 - min) / (max - min || 1)));
|
|
2731
2843
|
return { text, gauge, gaugeColor: color };
|
|
2732
2844
|
}
|
|
@@ -2739,12 +2851,12 @@ function contrastText(background, fallback) {
|
|
|
2739
2851
|
return lum > 0.55 ? "#111111" : "#ffffff";
|
|
2740
2852
|
}
|
|
2741
2853
|
function initialSort(panel, columns) {
|
|
2742
|
-
const first = _optionalChain([panel, 'access',
|
|
2743
|
-
const col = _optionalChain([first, 'optionalAccess',
|
|
2854
|
+
const first = _optionalChain([panel, 'access', _153 => _153.options, 'optionalAccess', _154 => _154.sortBy, 'optionalAccess', _155 => _155[0]]);
|
|
2855
|
+
const col = _optionalChain([first, 'optionalAccess', _156 => _156.displayName]) != null ? columns.find((c) => c.name === first.displayName || c.field.name === first.displayName) : void 0;
|
|
2744
2856
|
return col ? { key: col.key, desc: !!first.desc } : null;
|
|
2745
2857
|
}
|
|
2746
2858
|
function nextSort(current, key) {
|
|
2747
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
2859
|
+
if (_optionalChain([current, 'optionalAccess', _157 => _157.key]) !== key) return { key, desc: false };
|
|
2748
2860
|
return current.desc ? null : { key, desc: true };
|
|
2749
2861
|
}
|
|
2750
2862
|
function sortedRows(columns, length, sort) {
|
|
@@ -2753,7 +2865,7 @@ function sortedRows(columns, length, sort) {
|
|
|
2753
2865
|
if (!col) return rows;
|
|
2754
2866
|
const { field } = col;
|
|
2755
2867
|
const dir = sort.desc ? -1 : 1;
|
|
2756
|
-
const key = (v) => field.type === "time" ?
|
|
2868
|
+
const key = (v) => field.type === "time" ? _chunkYUXA7I4Jjs.toMillis.call(void 0, v) : field.type === "number" || field.type === "boolean" ? Number(v) : v;
|
|
2757
2869
|
const empty = (v) => v == null || v === "" || typeof v === "number" && Number.isNaN(v);
|
|
2758
2870
|
return rows.sort((a, b) => {
|
|
2759
2871
|
const va = field.values[a];
|
|
@@ -2779,7 +2891,7 @@ function PieChartPanel({ panel, frames }) {
|
|
|
2779
2891
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2780
2892
|
const total = values.reduce((a, v) => a + (_nullishCoalesce(v.value, () => ( 0))), 0);
|
|
2781
2893
|
const r = Math.min(size.width, size.height) / 2 - 2;
|
|
2782
|
-
const inner = _optionalChain([panel, 'access',
|
|
2894
|
+
const inner = _optionalChain([panel, 'access', _158 => _158.options, 'optionalAccess', _159 => _159.pieType]) === "pie" ? 0 : r * 0.62;
|
|
2783
2895
|
const cx = size.width / 2;
|
|
2784
2896
|
const cy = size.height / 2;
|
|
2785
2897
|
const gap = values.length > 1 ? 0.02 : 0;
|
|
@@ -2790,8 +2902,8 @@ function PieChartPanel({ panel, frames }) {
|
|
|
2790
2902
|
slices.push({ key: v.key, d: donutSlice(cx, cy, r, inner, angle + gap / 2, angle + sweep - gap / 2), color: v.color });
|
|
2791
2903
|
angle += sweep;
|
|
2792
2904
|
}
|
|
2793
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2794
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2905
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, children: [
|
|
2906
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles11.fill, onLayout, children: r > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: slices.map((s) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: s.d, fill: s.color }, s.key)) }) }),
|
|
2795
2907
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2796
2908
|
Legend,
|
|
2797
2909
|
{
|
|
@@ -2819,15 +2931,15 @@ function TablePanel({ panel, frames }) {
|
|
|
2819
2931
|
const columns = _react.useMemo.call(void 0, () => frame ? tableColumns(panel, frame, frames.length > 1) : [], [panel, frame, frames.length]);
|
|
2820
2932
|
const [tapped, setSort] = _react.useState.call(void 0, );
|
|
2821
2933
|
const sort = tapped === void 0 ? initialSort(panel, columns) : tapped;
|
|
2822
|
-
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ?
|
|
2823
|
-
if (!frame || !
|
|
2934
|
+
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ? _chunkYUXA7I4Jjs.frameLength.call(void 0, frame) : 0, sort), [columns, frame, sort]);
|
|
2935
|
+
if (!frame || !_chunkYUXA7I4Jjs.frameLength.call(void 0, frame)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2824
2936
|
const shown = order.slice(0, 500);
|
|
2825
2937
|
const rowColumn = columns.find((c) => c.applyToRow);
|
|
2826
2938
|
const footer = tableFooter(columns);
|
|
2827
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2828
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style:
|
|
2829
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2830
|
-
const active = _optionalChain([sort, 'optionalAccess',
|
|
2939
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, children: [
|
|
2940
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style: styles11.fill, children: [
|
|
2941
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.tr, { borderBottomColor: theme.border }], children: columns.map((c) => {
|
|
2942
|
+
const active = _optionalChain([sort, 'optionalAccess', _160 => _160.key]) === c.key;
|
|
2831
2943
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2832
2944
|
_reactnative.Pressable,
|
|
2833
2945
|
{
|
|
@@ -2836,7 +2948,7 @@ function TablePanel({ panel, frames }) {
|
|
|
2836
2948
|
accessibilityLabel: `Sort by ${c.name}`,
|
|
2837
2949
|
accessibilityState: { selected: active },
|
|
2838
2950
|
style: { width: c.width },
|
|
2839
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
2951
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles11.th, { color: active ? theme.text : theme.textSecondary, textAlign: c.align }], numberOfLines: 2, children: [
|
|
2840
2952
|
c.name,
|
|
2841
2953
|
active ? sort.desc ? " \u2193" : " \u2191" : ""
|
|
2842
2954
|
] })
|
|
@@ -2846,12 +2958,12 @@ function TablePanel({ panel, frames }) {
|
|
|
2846
2958
|
}) }),
|
|
2847
2959
|
shown.map((i) => {
|
|
2848
2960
|
const rowBg = rowColumn ? cellDisplay(rowColumn, rowColumn.field.values[i], theme.accent).background : void 0;
|
|
2849
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2961
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.tr, { borderBottomColor: theme.grid }, rowBg ? { backgroundColor: rowBg } : null], children: columns.map((c) => {
|
|
2850
2962
|
const d = cellDisplay(c, c.field.values[i], theme.accent);
|
|
2851
2963
|
const bg = _nullishCoalesce(d.background, () => ( rowBg));
|
|
2852
|
-
const linked = !!_optionalChain([c, 'access',
|
|
2964
|
+
const linked = !!_optionalChain([c, 'access', _161 => _161.config, 'access', _162 => _162.links, 'optionalAccess', _163 => _163.length]);
|
|
2853
2965
|
const color = _nullishCoalesce(d.color, () => ( (bg ? contrastText(bg, theme.text) : linked ? theme.accent : theme.text)));
|
|
2854
|
-
const cellStyle = [
|
|
2966
|
+
const cellStyle = [styles11.td, { width: c.width }, d.background ? { backgroundColor: d.background } : null];
|
|
2855
2967
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2856
2968
|
_reactnative.Pressable,
|
|
2857
2969
|
{
|
|
@@ -2863,8 +2975,8 @@ function TablePanel({ panel, frames }) {
|
|
|
2863
2975
|
accessibilityRole: linked ? "link" : void 0,
|
|
2864
2976
|
style: ({ pressed }) => [cellStyle, pressed && { opacity: 0.6 }],
|
|
2865
2977
|
children: [
|
|
2866
|
-
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2867
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2978
|
+
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.gaugeTrack, { backgroundColor: theme.grid }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.gaugeFill, { width: `${d.gauge * 100}%`, backgroundColor: _nullishCoalesce(d.gaugeColor, () => ( theme.accent)) }] }) }),
|
|
2979
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.cellText, { color, textAlign: c.align }, c.field.type === "number" && styles11.num], numberOfLines: c.wrap ? void 0 : 1, children: d.text })
|
|
2868
2980
|
]
|
|
2869
2981
|
},
|
|
2870
2982
|
c.key
|
|
@@ -2872,7 +2984,7 @@ function TablePanel({ panel, frames }) {
|
|
|
2872
2984
|
}) }, i);
|
|
2873
2985
|
})
|
|
2874
2986
|
] }),
|
|
2875
|
-
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2987
|
+
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.tr, styles11.footer, { borderTopColor: theme.border }], children: columns.map((c, ci) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.td, { width: c.width }], children: footer[ci].map((line, li) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles11.cellText, styles11.footerText, { color: theme.text, textAlign: c.align }], numberOfLines: 1, children: [
|
|
2876
2988
|
line.label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted, fontWeight: "400" }, children: `${line.label} ` }) : null,
|
|
2877
2989
|
line.text
|
|
2878
2990
|
] }, li)) }, c.key)) })
|
|
@@ -2880,12 +2992,12 @@ function TablePanel({ panel, frames }) {
|
|
|
2880
2992
|
}
|
|
2881
2993
|
function TextPanel({ panel }) {
|
|
2882
2994
|
const theme = useDashTheme();
|
|
2883
|
-
const raw = _optionalChain([panel, 'access',
|
|
2995
|
+
const raw = _optionalChain([panel, 'access', _164 => _164.options, 'optionalAccess', _165 => _165.content]);
|
|
2884
2996
|
const content = typeof raw === "string" ? raw : "";
|
|
2885
|
-
const text = _optionalChain([panel, 'access',
|
|
2997
|
+
const text = _optionalChain([panel, 'access', _166 => _166.options, 'optionalAccess', _167 => _167.mode]) === "html" ? content.replace(/<[^>]+>/g, "") : content;
|
|
2886
2998
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { children: text.split(/\n{2,}/).map((block, i) => {
|
|
2887
2999
|
const heading = /^#{1,6}\s+/.test(block);
|
|
2888
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3000
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.para, { color: heading ? theme.text : theme.textSecondary }, heading && styles11.heading], children: block.replace(/^#{1,6}\s+/, "").replace(/\*\*(.+?)\*\*/g, "$1").replace(/\[(.+?)\]\(.+?\)/g, "$1") }, i);
|
|
2889
3001
|
}) });
|
|
2890
3002
|
}
|
|
2891
3003
|
function BarChartPanel({ panel, frames, width }) {
|
|
@@ -2895,13 +3007,13 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2895
3007
|
const frame = frames[0];
|
|
2896
3008
|
const category = frame && barCategory(panel, frame);
|
|
2897
3009
|
if (!frame || !values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2898
|
-
const xField = _optionalChain([panel, 'access',
|
|
3010
|
+
const xField = _optionalChain([panel, 'access', _168 => _168.options, 'optionalAccess', _169 => _169.xField]);
|
|
2899
3011
|
if (xField && !category) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No field named \u201C${String(xField)}\u201D` });
|
|
2900
3012
|
const allNumeric = frame.fields.filter((f) => f.type === "number");
|
|
2901
3013
|
const at = (f) => values[allNumeric.indexOf(f)];
|
|
2902
3014
|
const numeric = category ? allNumeric.filter((f) => f !== category) : [];
|
|
2903
3015
|
if (category && !numeric.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No number fields to draw besides \u201C${category.name}\u201D` });
|
|
2904
|
-
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call',
|
|
3016
|
+
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call', _170 => _170(f), 'optionalAccess', _171 => _171.name]), () => ( f.name)), color: _nullishCoalesce(_optionalChain([at, 'call', _172 => _172(f), 'optionalAccess', _173 => _173.color]), () => ( theme.accent)), config: _nullishCoalesce(_optionalChain([at, 'call', _174 => _174(f), 'optionalAccess', _175 => _175.config]), () => ( {})), values: f.values.map(num2) })) : [{ key: "reduced", name: "", color: theme.accent, config: values[0].config, values: values.map((v) => v.value) }];
|
|
2905
3017
|
const labels = category ? categoryLabels(category) : values.map((v) => v.name);
|
|
2906
3018
|
const colorAt = (fi, i) => category ? fields[fi].color : values[i].color;
|
|
2907
3019
|
const axes = barAxes(
|
|
@@ -2915,34 +3027,34 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2915
3027
|
const gridAxis = _nullishCoalesce(left, () => ( right));
|
|
2916
3028
|
const plotW = width - (left ? AXIS_W : 0) - (right ? AXIS_W : 0);
|
|
2917
3029
|
const every = Math.max(1, Math.ceil(labels.length / Math.max(1, Math.floor(plotW / 44))));
|
|
2918
|
-
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3030
|
+
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.axis, axis.side === "left" ? styles11.axisLeft : styles11.axisRight], children: plot.height > 0 && axis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2919
3031
|
_reactnative.Text,
|
|
2920
3032
|
{
|
|
2921
|
-
style: [
|
|
3033
|
+
style: [styles11.tick, { color: theme.textMuted, top: plot.height * (1 - barFraction(axis, t)) - 7 }, axis.side === "left" ? styles11.tickLeft : styles11.tickRight],
|
|
2922
3034
|
numberOfLines: 1,
|
|
2923
|
-
children:
|
|
3035
|
+
children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...axis.config, decimals: tickDecimals(axis.ticks) })
|
|
2924
3036
|
},
|
|
2925
3037
|
t
|
|
2926
3038
|
)) });
|
|
2927
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2928
|
-
(_optionalChain([left, 'optionalAccess',
|
|
2929
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3039
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, children: [
|
|
3040
|
+
(_optionalChain([left, 'optionalAccess', _176 => _176.label]) || _optionalChain([right, 'optionalAccess', _177 => _177.label])) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.axisLabels, children: [
|
|
3041
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([left, 'optionalAccess', _178 => _178.label]), () => ( "")) }),
|
|
3042
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([right, 'optionalAccess', _179 => _179.label]), () => ( "")) })
|
|
2931
3043
|
] }),
|
|
2932
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3044
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.barRow, children: [
|
|
2933
3045
|
left && axisColumn(left),
|
|
2934
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2935
|
-
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2936
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3046
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, onLayout: onPlotLayout, children: [
|
|
3047
|
+
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.gridLine, { backgroundColor: theme.grid, top: plot.height * (1 - barFraction(gridAxis, t)) }] }, t)),
|
|
3048
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles11.barchart, children: labels.map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles11.barStack, children: fields.map((f, fi) => {
|
|
2937
3049
|
const axis = axisOf(fi);
|
|
2938
3050
|
const base = barFraction(axis, Math.min(Math.max(0, axis.bottom), axis.top));
|
|
2939
3051
|
const end = barFraction(axis, _nullishCoalesce(f.values[i], () => ( 0)));
|
|
2940
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3052
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles11.barSlot, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2941
3053
|
_reactnative.View,
|
|
2942
3054
|
{
|
|
2943
3055
|
style: [
|
|
2944
|
-
|
|
2945
|
-
end < base &&
|
|
3056
|
+
styles11.bar,
|
|
3057
|
+
end < base && styles11.barDown,
|
|
2946
3058
|
{ bottom: `${Math.min(base, end) * 100}%`, height: `${Math.abs(end - base) * 100}%`, backgroundColor: colorAt(fi, i) }
|
|
2947
3059
|
]
|
|
2948
3060
|
}
|
|
@@ -2951,7 +3063,7 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2951
3063
|
] }),
|
|
2952
3064
|
right && axisColumn(right)
|
|
2953
3065
|
] }),
|
|
2954
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3066
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles11.barLabels, { marginLeft: left ? AXIS_W : 0, marginRight: right ? AXIS_W : 0 }], children: labels.map((label, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.barLabel, { color: theme.textMuted }], numberOfLines: 1, children: i % every === 0 ? label : " " }, i)) }),
|
|
2955
3067
|
category && fields.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: fields })
|
|
2956
3068
|
] });
|
|
2957
3069
|
}
|
|
@@ -2964,7 +3076,7 @@ function num2(v) {
|
|
|
2964
3076
|
function UnsupportedPanel({ panel }) {
|
|
2965
3077
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `"${panel.type}" panels aren't supported yet` });
|
|
2966
3078
|
}
|
|
2967
|
-
var
|
|
3079
|
+
var styles11 = _reactnative.StyleSheet.create({
|
|
2968
3080
|
fill: { flex: 1 },
|
|
2969
3081
|
tr: { flexDirection: "row", borderBottomWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
2970
3082
|
th: { paddingVertical: 6, paddingHorizontal: 6, fontSize: 12, fontWeight: "600" },
|
|
@@ -3023,9 +3135,9 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3023
3135
|
[numericX, panel, frames, theme.scheme]
|
|
3024
3136
|
);
|
|
3025
3137
|
if (!series.length || series.every((s) => s.values.every((v) => v == null))) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3026
|
-
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access',
|
|
3138
|
+
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access', _180 => _180.config, 'access', _181 => _181.custom, 'optionalAccess', _182 => _182.drawStyle]), () => ( (panel.type === "graph" && panel.bars ? "bars" : "line")));
|
|
3027
3139
|
const anyBars = series.some((s) => style(s) === "bars");
|
|
3028
|
-
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3140
|
+
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access', _183 => _183.config, 'access', _184 => _184.custom, 'optionalAccess', _185 => _185.fillOpacity]), () => ( 0))) > 0);
|
|
3029
3141
|
const yTitle = series.map((s) => axisTitle(s.config)).find(Boolean);
|
|
3030
3142
|
const xTitle = numericX ? axisTitle(xConfig) : void 0;
|
|
3031
3143
|
const PAD = {
|
|
@@ -3046,7 +3158,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3046
3158
|
const y = linearScale(yMin, yMax, PAD.top + plotH, PAD.top);
|
|
3047
3159
|
const span = xTo - xFrom;
|
|
3048
3160
|
const xTicks = numericX ? numberTicks(xFrom, xTo, plotW) : timeTicks(xFrom, xTo, plotW);
|
|
3049
|
-
const xLabel = (t) => numericX ?
|
|
3161
|
+
const xLabel = (t) => numericX ? _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...xConfig, decimals: tickDecimals(xTicks) }) : formatTimeTick(t, span);
|
|
3050
3162
|
const unitConfig = series[0].config;
|
|
3051
3163
|
const barSeries = series.filter((s) => style(s) === "bars");
|
|
3052
3164
|
const pointsCount = Math.max(...series.map((s) => s.times.length));
|
|
@@ -3054,7 +3166,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3054
3166
|
const groupW = Math.min(slot * 0.8, BAR_MAX * barSeries.length);
|
|
3055
3167
|
const barW = Math.max(2, groupW / Math.max(barSeries.length, 1) - (barSeries.length > 1 ? 2 : 0));
|
|
3056
3168
|
const canPinch = plotW > 0;
|
|
3057
|
-
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access',
|
|
3169
|
+
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access', _186 => _186.nativeEvent, 'access', _187 => _187.touches, 'optionalAccess', _188 => _188.length]), () => ( 0))) >= 2;
|
|
3058
3170
|
const onPinchMove = (e) => {
|
|
3059
3171
|
const touches = _nullishCoalesce(e.nativeEvent.touches, () => ( []));
|
|
3060
3172
|
if (touches.length < 2) return;
|
|
@@ -3064,11 +3176,11 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3064
3176
|
if (!pinch.current) pinch.current = { start: { from: xFrom, to: xTo }, dist, frac };
|
|
3065
3177
|
const p = pinch.current;
|
|
3066
3178
|
const limits = extent ? { minSpan: (extent[1] - extent[0]) / 1e3, maxSpan: extent[1] - extent[0], minFrom: extent[0], maxTo: extent[1] } : { maxTo: Math.max(Date.now(), p.start.to) };
|
|
3067
|
-
setPreview(
|
|
3179
|
+
setPreview(_chunkYUXA7I4Jjs.zoomRange.call(void 0, p.start, dist / p.dist, p.frac, frac, limits));
|
|
3068
3180
|
};
|
|
3069
3181
|
const onPinchEnd = (commit) => {
|
|
3070
3182
|
if (commit && pinch.current && preview) {
|
|
3071
|
-
if (!extent) setRawRange({ from:
|
|
3183
|
+
if (!extent) setRawRange({ from: _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, preview.from), to: _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, preview.to) });
|
|
3072
3184
|
else setXZoom(preview.to - preview.from >= extent[1] - extent[0] ? null : preview);
|
|
3073
3185
|
}
|
|
3074
3186
|
pinch.current = null;
|
|
@@ -3077,15 +3189,15 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3077
3189
|
const hover = hoverX == null || !touching && pinned !== id ? null : nearest(series, xFrom + (hoverX - PAD.left) / (plotW || 1) * span);
|
|
3078
3190
|
const hoverLinks = hover ? mergeLinks(
|
|
3079
3191
|
hover.rows.flatMap(
|
|
3080
|
-
(r) => r.value == null || !_optionalChain([r, 'access',
|
|
3192
|
+
(r) => r.value == null || !_optionalChain([r, 'access', _189 => _189.series, 'access', _190 => _190.config, 'access', _191 => _191.links, 'optionalAccess', _192 => _192.length]) ? [] : [{ name: r.name, links: resolve(r.series.config.links, linkData(r, frames, numericX ? String(_nullishCoalesce(_optionalChain([panel, 'access', _193 => _193.options, 'optionalAccess', _194 => _194.xField]), () => ( ""))) : void 0)) }]
|
|
3081
3193
|
)
|
|
3082
3194
|
) : [];
|
|
3083
3195
|
const isPinned = !!hover && pinned === id;
|
|
3084
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3196
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3085
3197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3086
3198
|
_reactnative.View,
|
|
3087
3199
|
{
|
|
3088
|
-
style:
|
|
3200
|
+
style: styles12.fill,
|
|
3089
3201
|
onStartShouldSetResponderCapture: twoFingers,
|
|
3090
3202
|
onMoveShouldSetResponderCapture: twoFingers,
|
|
3091
3203
|
onResponderTerminationRequest: () => false,
|
|
@@ -3100,7 +3212,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3100
3212
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3101
3213
|
_reactnative.View,
|
|
3102
3214
|
{
|
|
3103
|
-
style:
|
|
3215
|
+
style: styles12.fill,
|
|
3104
3216
|
onLayout,
|
|
3105
3217
|
onStartShouldSetResponder: () => true,
|
|
3106
3218
|
onResponderGrant: (e) => {
|
|
@@ -3123,7 +3235,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3123
3235
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3124
3236
|
ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3125
3237
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: PAD.left, x2: PAD.left + plotW, y1: y(t), y2: y(t), stroke: theme.grid, strokeWidth: 1 }),
|
|
3126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children:
|
|
3238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...unitConfig, decimals: tickDecimals(ticks) }) })
|
|
3127
3239
|
] }, t)),
|
|
3128
3240
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3129
3241
|
_reactnativesvg.Text,
|
|
@@ -3149,12 +3261,12 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3149
3261
|
})
|
|
3150
3262
|
),
|
|
3151
3263
|
series.filter((s) => style(s) !== "bars").map((s) => {
|
|
3152
|
-
const fill = (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3153
|
-
const showPoints = style(s) === "points" || _optionalChain([s, 'access',
|
|
3154
|
-
const segs = segments(s, x, y, _optionalChain([s, 'access',
|
|
3264
|
+
const fill = (_nullishCoalesce(_optionalChain([s, 'access', _195 => _195.config, 'access', _196 => _196.custom, 'optionalAccess', _197 => _197.fillOpacity]), () => ( 0))) / 100;
|
|
3265
|
+
const showPoints = style(s) === "points" || _optionalChain([s, 'access', _198 => _198.config, 'access', _199 => _199.custom, 'optionalAccess', _200 => _200.showPoints]) === "always" || _optionalChain([s, 'access', _201 => _201.config, 'access', _202 => _202.custom, 'optionalAccess', _203 => _203.showPoints]) !== "never" && s.times.length <= plotW / 14;
|
|
3266
|
+
const segs = segments(s, x, y, _optionalChain([s, 'access', _204 => _204.config, 'access', _205 => _205.custom, 'optionalAccess', _206 => _206.lineInterpolation]) === "stepAfter");
|
|
3155
3267
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3156
3268
|
fill > 0 && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${seg.d}L${seg.lastX},${y(Math.max(yMin, 0))}L${seg.firstX},${y(Math.max(yMin, 0))}Z`, fill: s.color, opacity: fill }, `f${i}`)),
|
|
3157
|
-
style(s) !== "points" && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: seg.d, stroke: s.color, strokeWidth: _nullishCoalesce(_optionalChain([s, 'access',
|
|
3269
|
+
style(s) !== "points" && segs.map((seg, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: seg.d, stroke: s.color, strokeWidth: _nullishCoalesce(_optionalChain([s, 'access', _207 => _207.config, 'access', _208 => _208.custom, 'optionalAccess', _209 => _209.lineWidth]), () => ( 2)), fill: "none", strokeLinejoin: "round", strokeLinecap: "round" }, `l${i}`)),
|
|
3158
3270
|
showPoints && s.times.map(
|
|
3159
3271
|
(t, i) => s.values[i] == null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Circle, { cx: x(t), cy: y(s.values[i]), r: 4, fill: s.color, stroke: theme.surface, strokeWidth: 2 }, i)
|
|
3160
3272
|
)
|
|
@@ -3174,8 +3286,8 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3174
3286
|
onPress: () => setXZoom(null),
|
|
3175
3287
|
accessibilityRole: "button",
|
|
3176
3288
|
hitSlop: 8,
|
|
3177
|
-
style: ({ pressed }) => [
|
|
3178
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3289
|
+
style: ({ pressed }) => [styles12.reset, { backgroundColor: theme.surface, borderColor: theme.border }, pressed && { opacity: 0.7 }],
|
|
3290
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.resetText, { color: theme.accent }], children: "Reset zoom" })
|
|
3179
3291
|
}
|
|
3180
3292
|
),
|
|
3181
3293
|
hover && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3184,16 +3296,16 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3184
3296
|
pointerEvents: isPinned ? "auto" : "none",
|
|
3185
3297
|
onStartShouldSetResponder: () => isPinned,
|
|
3186
3298
|
style: [
|
|
3187
|
-
|
|
3299
|
+
styles12.tooltip,
|
|
3188
3300
|
{ backgroundColor: theme.surface, borderColor: theme.border },
|
|
3189
3301
|
x(hover.time) > size.width / 2 ? { right: size.width - x(hover.time) + 8 } : { left: x(hover.time) + 8 }
|
|
3190
3302
|
],
|
|
3191
3303
|
children: [
|
|
3192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3193
|
-
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3194
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3304
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.tooltipTime, { color: theme.textMuted }], children: numericX ? _chunkYUXA7I4Jjs.formatValue.call(void 0, hover.time, xConfig) : formatTooltipTime(hover.time) }),
|
|
3305
|
+
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.tooltipRow, children: [
|
|
3306
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.swatch, { backgroundColor: r.color }] }),
|
|
3307
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.tooltipName, { color: theme.textSecondary }], numberOfLines: 1, children: r.name }),
|
|
3308
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.tooltipValue, { color: theme.text }], children: _chunkYUXA7I4Jjs.formatValue.call(void 0, r.value, r.config) })
|
|
3197
3309
|
] }, r.key)),
|
|
3198
3310
|
isPinned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipLinks, { links: hoverLinks, onOpen: (l) => openLinks([l]) })
|
|
3199
3311
|
]
|
|
@@ -3278,8 +3390,8 @@ function linkData(r, frames, xField) {
|
|
|
3278
3390
|
if (frame && xField === void 0) {
|
|
3279
3391
|
row = r.index;
|
|
3280
3392
|
} else if (frame) {
|
|
3281
|
-
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => (
|
|
3282
|
-
const at = _optionalChain([xf, 'optionalAccess',
|
|
3393
|
+
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => ( _chunkYUXA7I4Jjs.numberFields.call(void 0, frame)[0]));
|
|
3394
|
+
const at = _optionalChain([xf, 'optionalAccess', _210 => _210.values, 'access', _211 => _211.findIndex, 'call', _212 => _212((v, k) => Number(v) === r.time && Number(r.series.field.values[k]) === r.value)]);
|
|
3283
3395
|
row = at != null && at >= 0 ? at : void 0;
|
|
3284
3396
|
}
|
|
3285
3397
|
return {
|
|
@@ -3289,11 +3401,11 @@ function linkData(r, frames, xField) {
|
|
|
3289
3401
|
fieldName: r.name,
|
|
3290
3402
|
seriesName: r.name,
|
|
3291
3403
|
value: r.value,
|
|
3292
|
-
text:
|
|
3404
|
+
text: _chunkYUXA7I4Jjs.formatValue.call(void 0, r.value, r.config),
|
|
3293
3405
|
time: xField === void 0 ? r.time : void 0
|
|
3294
3406
|
};
|
|
3295
3407
|
}
|
|
3296
|
-
var
|
|
3408
|
+
var styles12 = _reactnative.StyleSheet.create({
|
|
3297
3409
|
fill: { flex: 1 },
|
|
3298
3410
|
tooltip: {
|
|
3299
3411
|
position: "absolute",
|
|
@@ -3334,14 +3446,14 @@ function mappings(panel) {
|
|
|
3334
3446
|
frame: frame(s.frame),
|
|
3335
3447
|
x: byName(s.x),
|
|
3336
3448
|
y: byName(s.y),
|
|
3337
|
-
color: byName(_optionalChain([s, 'access',
|
|
3338
|
-
size: byName(_optionalChain([s, 'access',
|
|
3449
|
+
color: byName(_optionalChain([s, 'access', _213 => _213.pointColor, 'optionalAccess', _214 => _214.field])),
|
|
3450
|
+
size: byName(_optionalChain([s, 'access', _215 => _215.pointSize, 'optionalAccess', _216 => _216.field])),
|
|
3339
3451
|
sizeRange: s.pointSize,
|
|
3340
3452
|
name: { fixed: s.name }
|
|
3341
3453
|
}));
|
|
3342
3454
|
return { manual: true, series, exclude: [] };
|
|
3343
3455
|
}
|
|
3344
|
-
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access',
|
|
3456
|
+
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access', _217 => _217.dims, 'optionalAccess', _218 => _218.frame])), x: byName(_optionalChain([o, 'access', _219 => _219.dims, 'optionalAccess', _220 => _220.x])) }], exclude: _nullishCoalesce(_optionalChain([o, 'access', _221 => _221.dims, 'optionalAccess', _222 => _222.exclude]), () => ( [])) };
|
|
3345
3457
|
}
|
|
3346
3458
|
return { manual: o.mapping === "manual", series: _nullishCoalesce(o.series, () => ( [])), exclude: [] };
|
|
3347
3459
|
}
|
|
@@ -3350,11 +3462,11 @@ function xySeries(panel, frames, scheme) {
|
|
|
3350
3462
|
const { manual, series: maps, exclude } = mappings(panel);
|
|
3351
3463
|
const multiple = frames.length > 1;
|
|
3352
3464
|
const out = [];
|
|
3353
|
-
const config = (field, frame) =>
|
|
3354
|
-
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) =>
|
|
3465
|
+
const config = (field, frame) => _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, field, frame, _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, field, frame, multiple));
|
|
3466
|
+
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) => _chunkYUXA7I4Jjs.fieldMatches.call(void 0, pick.matcher, f, frame, _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple))) : [];
|
|
3355
3467
|
for (const [mi, m] of (maps.length ? maps : [{}]).entries()) {
|
|
3356
|
-
const matcher = _optionalChain([m, 'access',
|
|
3357
|
-
const chosen = _optionalChain([matcher, 'optionalAccess',
|
|
3468
|
+
const matcher = _optionalChain([m, 'access', _223 => _223.frame, 'optionalAccess', _224 => _224.matcher]);
|
|
3469
|
+
const chosen = _optionalChain([matcher, 'optionalAccess', _225 => _225.id]) === "byIndex" ? frames.filter((_, i) => i === matcher.options) : frames;
|
|
3358
3470
|
for (const frame of chosen) {
|
|
3359
3471
|
const numeric = frame.fields.filter(isNumeric);
|
|
3360
3472
|
const xField = _nullishCoalesce(find(m.x, frame, numeric)[0], () => ( numeric[0]));
|
|
@@ -3365,41 +3477,41 @@ function xySeries(panel, frames, scheme) {
|
|
|
3365
3477
|
const yFields = m.y ? find(m.y, frame, numeric).filter((f) => f !== xField) : manual ? [] : numeric.filter((f) => !used.has(f) && !exclude.includes(f.name));
|
|
3366
3478
|
for (const yField of yFields) {
|
|
3367
3479
|
const yConfig = config(yField, frame);
|
|
3368
|
-
if (_optionalChain([yConfig, 'access',
|
|
3480
|
+
if (_optionalChain([yConfig, 'access', _226 => _226.custom, 'optionalAccess', _227 => _227.hideFrom, 'optionalAccess', _228 => _228.viz]) && !manual) continue;
|
|
3369
3481
|
const xConfig = config(xField, frame);
|
|
3370
|
-
const color =
|
|
3371
|
-
const base = _optionalChain([yConfig, 'access',
|
|
3482
|
+
const color = _chunkYUXA7I4Jjs.seriesColor.call(void 0, out.length, scheme, yConfig);
|
|
3483
|
+
const base = _optionalChain([yConfig, 'access', _229 => _229.color, 'optionalAccess', _230 => _230.mode]) === "thresholds" ? _chunkYUXA7I4Jjs.valueColor.call(void 0, null, yConfig, color) : color;
|
|
3372
3484
|
const rows = [];
|
|
3373
3485
|
const xs = [];
|
|
3374
3486
|
const ys = [];
|
|
3375
3487
|
yField.values.forEach((yv, i) => {
|
|
3376
3488
|
const xv = xField.values[i];
|
|
3377
3489
|
if (xv == null || yv == null) return;
|
|
3378
|
-
const xn = xField.type === "time" ?
|
|
3379
|
-
const yn = yField.type === "time" ?
|
|
3490
|
+
const xn = xField.type === "time" ? _chunkYUXA7I4Jjs.toMillis.call(void 0, xv) : Number(xv);
|
|
3491
|
+
const yn = yField.type === "time" ? _chunkYUXA7I4Jjs.toMillis.call(void 0, yv) : Number(yv);
|
|
3380
3492
|
if (!Number.isFinite(xn) || !Number.isFinite(yn)) return;
|
|
3381
3493
|
rows.push(i);
|
|
3382
3494
|
xs.push(xn);
|
|
3383
3495
|
ys.push(yn);
|
|
3384
3496
|
});
|
|
3385
|
-
const pointSize = _optionalChain([yConfig, 'access',
|
|
3386
|
-
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3497
|
+
const pointSize = _optionalChain([yConfig, 'access', _231 => _231.custom, 'optionalAccess', _232 => _232.pointSize]);
|
|
3498
|
+
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _233 => _233.sizeRange, 'optionalAccess', _234 => _234.fixed]), () => ( _optionalChain([pointSize, 'optionalAccess', _235 => _235.fixed]))), () => ( 5));
|
|
3387
3499
|
let colors = rows.map(() => base);
|
|
3388
3500
|
if (colorField) {
|
|
3389
3501
|
const cConfig = config(colorField, frame);
|
|
3390
3502
|
const values = rows.map((i) => num3(colorField.values[i]));
|
|
3391
3503
|
const extent = range2(values);
|
|
3392
|
-
colors = values.map((v) =>
|
|
3504
|
+
colors = values.map((v) => _chunkYUXA7I4Jjs.valueColor.call(void 0, v, cConfig, base, extent));
|
|
3393
3505
|
}
|
|
3394
3506
|
let sizes = rows.map(() => fixedSize);
|
|
3395
3507
|
if (sizeField) {
|
|
3396
3508
|
const values = rows.map((i) => num3(sizeField.values[i]));
|
|
3397
3509
|
const [lo, hi] = _nullishCoalesce(range2(values), () => ( [0, 1]));
|
|
3398
|
-
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3510
|
+
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _236 => _236.sizeRange, 'optionalAccess', _237 => _237.min]), () => ( _optionalChain([pointSize, 'optionalAccess', _238 => _238.min]))), () => ( 5)), _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _239 => _239.sizeRange, 'optionalAccess', _240 => _240.max]), () => ( _optionalChain([pointSize, 'optionalAccess', _241 => _241.max]))), () => ( 20))];
|
|
3399
3511
|
sizes = values.map((v) => v == null ? min : min + (v - lo) / (hi - lo || 1) * (max - min));
|
|
3400
3512
|
}
|
|
3401
|
-
const fixedName = _optionalChain([m, 'access',
|
|
3402
|
-
const yName = _nullishCoalesce(yConfig.displayName, () => (
|
|
3513
|
+
const fixedName = _optionalChain([m, 'access', _242 => _242.name, 'optionalAccess', _243 => _243.fixed]);
|
|
3514
|
+
const yName = _nullishCoalesce(yConfig.displayName, () => ( _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, yField, frame, multiple)));
|
|
3403
3515
|
out.push({
|
|
3404
3516
|
key: `${mi}/${frames.indexOf(frame)}/${yField.name}`,
|
|
3405
3517
|
name: fixedName ? yFields.length > 1 ? `${fixedName} ${yName}` : fixedName : yName,
|
|
@@ -3414,8 +3526,8 @@ function xySeries(panel, frames, scheme) {
|
|
|
3414
3526
|
ys,
|
|
3415
3527
|
colors,
|
|
3416
3528
|
sizes,
|
|
3417
|
-
show: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3418
|
-
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3529
|
+
show: _nullishCoalesce(_optionalChain([yConfig, 'access', _244 => _244.custom, 'optionalAccess', _245 => _245.show]), () => ( "points")),
|
|
3530
|
+
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access', _246 => _246.custom, 'optionalAccess', _247 => _247.lineWidth]), () => ( 1))
|
|
3419
3531
|
});
|
|
3420
3532
|
}
|
|
3421
3533
|
}
|
|
@@ -3466,10 +3578,10 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3466
3578
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3467
3579
|
const series = _react.useMemo.call(void 0, () => xySeries(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
3468
3580
|
const first = series[0];
|
|
3469
|
-
const showX = _optionalChain([first, 'optionalAccess',
|
|
3470
|
-
const showY = _optionalChain([first, 'optionalAccess',
|
|
3471
|
-
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3472
|
-
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3581
|
+
const showX = _optionalChain([first, 'optionalAccess', _248 => _248.xConfig, 'access', _249 => _249.custom, 'optionalAccess', _250 => _250.axisPlacement]) !== "hidden";
|
|
3582
|
+
const showY = _optionalChain([first, 'optionalAccess', _251 => _251.yConfig, 'access', _252 => _252.custom, 'optionalAccess', _253 => _253.axisPlacement]) !== "hidden";
|
|
3583
|
+
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess', _254 => _254.xConfig])) : void 0;
|
|
3584
|
+
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess', _255 => _255.yConfig])) : void 0;
|
|
3473
3585
|
const pad = {
|
|
3474
3586
|
top: EDGE,
|
|
3475
3587
|
right: EDGE,
|
|
@@ -3490,17 +3602,17 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3490
3602
|
if (!first || !layout || series.every((s) => !s.rows.length)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3491
3603
|
const xTicks = showX ? axisTicks(layout.x0, layout.x1, plotW < 220 ? 2 : plotW < 400 ? 3 : 5) : [];
|
|
3492
3604
|
const yTicks = showY ? axisTicks(layout.y0, layout.y1, plotH < 100 ? 2 : 4) : [];
|
|
3493
|
-
const gridX = _optionalChain([first, 'access',
|
|
3494
|
-
const gridY = _optionalChain([first, 'access',
|
|
3605
|
+
const gridX = _optionalChain([first, 'access', _256 => _256.xConfig, 'access', _257 => _257.custom, 'optionalAccess', _258 => _258.axisGridShow]) !== false;
|
|
3606
|
+
const gridY = _optionalChain([first, 'access', _259 => _259.yConfig, 'access', _260 => _260.custom, 'optionalAccess', _261 => _261.axisGridShow]) !== false;
|
|
3495
3607
|
const hover = touch && (touching || pinned === id) ? nearestPoint(series, layout.points, touch) : null;
|
|
3496
3608
|
const hoverLinks = hover ? rowLinks(panel, hover.series.frame, hover.series.rows[hover.index], frames.length > 1, resolve) : [];
|
|
3497
3609
|
const isPinned = !!hover && pinned === id;
|
|
3498
|
-
const legendItems = series.filter((s) => !_optionalChain([s, 'access',
|
|
3499
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3610
|
+
const legendItems = series.filter((s) => !_optionalChain([s, 'access', _262 => _262.yConfig, 'access', _263 => _263.custom, 'optionalAccess', _264 => _264.hideFrom, 'optionalAccess', _265 => _265.legend]));
|
|
3611
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles13.fill, children: [
|
|
3500
3612
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3501
3613
|
_reactnative.View,
|
|
3502
3614
|
{
|
|
3503
|
-
style:
|
|
3615
|
+
style: styles13.fill,
|
|
3504
3616
|
onLayout,
|
|
3505
3617
|
onStartShouldSetResponder: () => true,
|
|
3506
3618
|
onResponderGrant: (e) => {
|
|
@@ -3522,7 +3634,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3522
3634
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3523
3635
|
yTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3524
3636
|
gridY && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: pad.left, x2: pad.left + plotW, y1: layout.y(t), y2: layout.y(t), stroke: theme.grid, strokeWidth: 1 }),
|
|
3525
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: pad.left - 6, y: layout.y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children:
|
|
3637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: pad.left - 6, y: layout.y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...first.yConfig, decimals: _nullishCoalesce(first.yConfig.decimals, () => ( tickDecimals(yTicks))) }) })
|
|
3526
3638
|
] }, `y${t}`)),
|
|
3527
3639
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3528
3640
|
gridX && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Line, { x1: layout.x(t), x2: layout.x(t), y1: pad.top, y2: pad.top + plotH, stroke: theme.grid, strokeWidth: 1 }),
|
|
@@ -3534,7 +3646,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3534
3646
|
fontSize: 10,
|
|
3535
3647
|
fill: theme.textMuted,
|
|
3536
3648
|
textAnchor: layout.x(t) - pad.left < 20 ? "start" : pad.left + plotW - layout.x(t) < 20 ? "end" : "middle",
|
|
3537
|
-
children:
|
|
3649
|
+
children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...first.xConfig, decimals: _nullishCoalesce(first.xConfig.decimals, () => ( tickDecimals(xTicks))) })
|
|
3538
3650
|
}
|
|
3539
3651
|
)
|
|
3540
3652
|
] }, `x${t}`)),
|
|
@@ -3604,7 +3716,7 @@ function nearestPoint(series, points, at) {
|
|
|
3604
3716
|
});
|
|
3605
3717
|
return best;
|
|
3606
3718
|
}
|
|
3607
|
-
var
|
|
3719
|
+
var styles13 = _reactnative.StyleSheet.create({
|
|
3608
3720
|
fill: { flex: 1 }
|
|
3609
3721
|
});
|
|
3610
3722
|
|
|
@@ -3647,15 +3759,15 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3647
3759
|
const width = (measured.width || window.width) - insets.left - insets.right;
|
|
3648
3760
|
const layoutMode = mode === "auto" ? width >= TABLET_WIDTH ? "grid" : "phone" : mode;
|
|
3649
3761
|
const sections = _react.useMemo.call(void 0,
|
|
3650
|
-
() =>
|
|
3762
|
+
() => _chunkYUXA7I4Jjs.layoutDashboard.call(void 0, dashboard, layoutMode, { values: variables, info: variableInfo2 }),
|
|
3651
3763
|
[dashboard, layoutMode, variables, variableInfo2]
|
|
3652
3764
|
);
|
|
3653
3765
|
const [toggled, setToggled] = _react.useState.call(void 0, {});
|
|
3654
3766
|
const { seen, viewportH, onScroll, onViewportLayout, onSectionLayout } = useSeenSections(window.height);
|
|
3655
3767
|
const maxPanelH = Math.max(MIN_PANEL_H, viewportH - SIDE * 2);
|
|
3656
3768
|
const contentW = width - SIDE * 2;
|
|
3657
|
-
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) =>
|
|
3658
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3769
|
+
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) => _chunkYUXA7I4Jjs.panelHasQueries.call(void 0, p) || _optionalChain([p, 'access', _266 => _266.panels, 'optionalAccess', _267 => _267.some, 'call', _268 => _268(_chunkYUXA7I4Jjs.panelHasQueries)]))));
|
|
3770
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles14.fill, { backgroundColor: theme.background }], onLayout, children: [
|
|
3659
3771
|
width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3660
3772
|
_reactnative.ScrollView,
|
|
3661
3773
|
{
|
|
@@ -3663,31 +3775,31 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3663
3775
|
onScrollBeginDrag: () => setPinned(null),
|
|
3664
3776
|
onLayout: onViewportLayout,
|
|
3665
3777
|
scrollEventThrottle: 100,
|
|
3666
|
-
contentContainerStyle: [
|
|
3778
|
+
contentContainerStyle: [styles14.content, { paddingLeft: SIDE + insets.left, paddingRight: SIDE + insets.right }],
|
|
3667
3779
|
keyboardShouldPersistTaps: "handled",
|
|
3668
3780
|
refreshControl: canRefresh ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.RefreshControl, { refreshing: false, onRefresh: refresh }) : void 0,
|
|
3669
3781
|
children: [
|
|
3670
3782
|
header,
|
|
3671
3783
|
sections.map((section) => {
|
|
3672
3784
|
const collapsed = _nullishCoalesce(toggled[section.key], () => ( section.collapsed));
|
|
3673
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3785
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles14.section, onLayout: (e) => onSectionLayout(section.key, e), children: [
|
|
3674
3786
|
section.row && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3675
3787
|
_reactnative.Pressable,
|
|
3676
3788
|
{
|
|
3677
3789
|
onPress: () => setToggled((t) => ({ ...t, [section.key]: !collapsed })),
|
|
3678
|
-
style:
|
|
3790
|
+
style: styles14.rowHeader,
|
|
3679
3791
|
accessibilityRole: "button",
|
|
3680
3792
|
accessibilityState: { expanded: !collapsed },
|
|
3681
3793
|
children: [
|
|
3682
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3683
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3794
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.chevron, { color: theme.textMuted }], children: collapsed ? "\u25B8" : "\u25BE" }),
|
|
3795
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.rowTitle, { color: theme.text }], numberOfLines: 2, children: _chunkYUXA7I4Jjs.interpolate.call(void 0, _nullishCoalesce(section.row.title, () => ( "")), { values: variables, info: variableInfo2, scoped: section.row.scopedVars, timezone: dashboard.timezone }) })
|
|
3684
3796
|
]
|
|
3685
3797
|
}
|
|
3686
3798
|
),
|
|
3687
3799
|
!collapsed && layoutMode === "grid" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GridSection, { grid: section.grid, width: contentW, maxPanelH, deferred: !seen.has(section.key) }),
|
|
3688
|
-
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3689
|
-
const w = (contentW + GAP) * (cell.span /
|
|
3690
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(
|
|
3800
|
+
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles14.row, children: row.cells.map((cell) => {
|
|
3801
|
+
const w = (contentW + GAP) * (cell.span / _chunkYUXA7I4Jjs.GRID_COLUMNS) - GAP;
|
|
3802
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(_chunkYUXA7I4Jjs.gridUnitsToPx.call(void 0, row.h), maxPanelH), deferred: !seen.has(section.key) }, cell.key);
|
|
3691
3803
|
}) }, ri))
|
|
3692
3804
|
] }, section.key);
|
|
3693
3805
|
})
|
|
@@ -3698,10 +3810,10 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3698
3810
|
] });
|
|
3699
3811
|
}
|
|
3700
3812
|
function GridSection({ grid, width, maxPanelH, deferred }) {
|
|
3701
|
-
const colW = (width + GAP) /
|
|
3702
|
-
const tallest = Math.max(0, ...grid.cells.map((c) =>
|
|
3813
|
+
const colW = (width + GAP) / _chunkYUXA7I4Jjs.GRID_COLUMNS;
|
|
3814
|
+
const tallest = Math.max(0, ...grid.cells.map((c) => _chunkYUXA7I4Jjs.gridUnitsToPx.call(void 0, c.h)));
|
|
3703
3815
|
const scale = tallest > maxPanelH ? maxPanelH / tallest : 1;
|
|
3704
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height:
|
|
3816
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height: _chunkYUXA7I4Jjs.gridUnitsToPx.call(void 0, grid.h) * scale }, children: grid.cells.map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles14.gridCell, { left: cell.x * colW, top: _chunkYUXA7I4Jjs.gridOffsetPx.call(void 0, cell.y) * scale }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: cell.w * colW - GAP, height: _chunkYUXA7I4Jjs.gridUnitsToPx.call(void 0, cell.h) * scale, deferred }) }, cell.key)) });
|
|
3705
3817
|
}
|
|
3706
3818
|
function useSeenSections(viewportHeight) {
|
|
3707
3819
|
const [seen, setSeen] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
@@ -3750,26 +3862,27 @@ function PanelCard(props) {
|
|
|
3750
3862
|
}
|
|
3751
3863
|
function PanelError({ panel, width, height, error }) {
|
|
3752
3864
|
const theme = useDashTheme();
|
|
3753
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3754
|
-
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3756
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3865
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles14.card, { width, height, backgroundColor: theme.surface, borderColor: theme.danger }], accessibilityRole: "alert", children: [
|
|
3866
|
+
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.title, styles14.errorTitle, { color: theme.text }], numberOfLines: 1, children: panel.title }),
|
|
3867
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.errorText, { color: theme.danger }], children: "This panel couldn\u2019t be shown." }),
|
|
3868
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.errorText, { color: theme.textMuted }], numberOfLines: 3, children: error.message })
|
|
3757
3869
|
] });
|
|
3758
3870
|
}
|
|
3759
3871
|
function PanelCardContent({ panel, width, height, deferred }) {
|
|
3760
3872
|
const theme = useDashTheme();
|
|
3761
3873
|
const { dashboard, variables, variableInfo: variableInfo2 } = useDashboard();
|
|
3762
3874
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3763
|
-
const
|
|
3875
|
+
const group = _chunkYUXA7I4Jjs.isInputGroup.call(void 0, panel);
|
|
3876
|
+
const input = _chunkYUXA7I4Jjs.isInputPanel.call(void 0, panel) || group;
|
|
3764
3877
|
const form = _react.useContext.call(void 0, InputFormContext);
|
|
3765
|
-
const problem =
|
|
3766
|
-
const hasLinks = !!_optionalChain([panel, 'access',
|
|
3878
|
+
const problem = group ? _optionalChain([form, 'optionalAccess', _269 => _269.group, 'optionalCall', _270 => _270(panel), 'optionalAccess', _271 => _271.problem]) : _chunkYUXA7I4Jjs.isInputPanel.call(void 0, panel) ? _optionalChain([form, 'optionalAccess', _272 => _272.problem, 'optionalCall', _273 => _273(panel.options.metric)]) : void 0;
|
|
3879
|
+
const hasLinks = !!_optionalChain([panel, 'access', _274 => _274.links, 'optionalAccess', _275 => _275.length]);
|
|
3767
3880
|
const hasTitle = !!panel.title || hasLinks || !!problem;
|
|
3768
|
-
const title = panel.title ?
|
|
3769
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3770
|
-
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3772
|
-
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3881
|
+
const title = panel.title ? _chunkYUXA7I4Jjs.interpolate.call(void 0, panel.title, { values: variables, info: variableInfo2, scoped: panel.scopedVars, timezone: dashboard.timezone }) : "";
|
|
3882
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles14.card, { width, height, backgroundColor: theme.surface, borderColor: theme.border }], children: [
|
|
3883
|
+
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles14.titleRow, children: [
|
|
3884
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.title, { color: theme.text }], numberOfLines: 1, children: title }),
|
|
3885
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem }),
|
|
3773
3886
|
hasLinks && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3774
3887
|
_reactnative.Pressable,
|
|
3775
3888
|
{
|
|
@@ -3777,28 +3890,28 @@ function PanelCardContent({ panel, width, height, deferred }) {
|
|
|
3777
3890
|
accessibilityRole: "button",
|
|
3778
3891
|
accessibilityLabel: panel.links.length === 1 ? panel.links[0].title || "Open link" : "Panel links",
|
|
3779
3892
|
hitSlop: 10,
|
|
3780
|
-
style: ({ pressed }) => [
|
|
3893
|
+
style: ({ pressed }) => [styles14.titleLink, pressed && { opacity: 0.6 }],
|
|
3781
3894
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkIcon, { color: theme.textMuted })
|
|
3782
3895
|
}
|
|
3783
3896
|
)
|
|
3784
3897
|
] }),
|
|
3785
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles14.body, children: deferred && !input ? null : input ? group ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputGroupBody, { panel }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputPanelBody, { panel }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataPanelBody, { panel, width: width - 24, height: height - (hasTitle ? TITLE_H : 0) - 16 }) })
|
|
3786
3899
|
] });
|
|
3787
3900
|
}
|
|
3788
3901
|
function DataPanelBody({ panel, width, height }) {
|
|
3789
3902
|
const theme = useDashTheme();
|
|
3790
|
-
const needsData =
|
|
3903
|
+
const needsData = _chunkYUXA7I4Jjs.panelHasQueries.call(void 0, panel);
|
|
3791
3904
|
const data = usePanelData(panel, width, needsData);
|
|
3792
3905
|
const Component2 = panelComponent(panel.type);
|
|
3793
3906
|
if (needsData && data.error) {
|
|
3794
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3907
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles14.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles14.error, { color: theme.danger }], numberOfLines: 4, children: data.error }) });
|
|
3795
3908
|
}
|
|
3796
3909
|
if (needsData && data.loading && !data.frames.length) {
|
|
3797
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3910
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles14.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator, { color: theme.textMuted }) });
|
|
3798
3911
|
}
|
|
3799
3912
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { panel, frames: data.frames, width, height });
|
|
3800
3913
|
}
|
|
3801
|
-
var
|
|
3914
|
+
var styles14 = _reactnative.StyleSheet.create({
|
|
3802
3915
|
fill: { flex: 1 },
|
|
3803
3916
|
content: { padding: SIDE, paddingBottom: 32, gap: GAP },
|
|
3804
3917
|
section: { gap: GAP },
|
|
@@ -3829,16 +3942,40 @@ function savedValues(panels, entries) {
|
|
|
3829
3942
|
const values = {};
|
|
3830
3943
|
for (const p of panels) {
|
|
3831
3944
|
const mine = entries.filter((e) => e.metric === p.options.metric);
|
|
3832
|
-
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null :
|
|
3945
|
+
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null : _chunkYUXA7I4Jjs.entryToInputValue.call(void 0, p, mine[0]);
|
|
3833
3946
|
}
|
|
3834
3947
|
return values;
|
|
3835
3948
|
}
|
|
3949
|
+
async function lastItems(store, group) {
|
|
3950
|
+
const metrics = _chunkYUXA7I4Jjs.groupFields.call(void 0, group).map((f) => f.options.metric);
|
|
3951
|
+
const latest = (await Promise.all(metrics.map((m) => store.latest(m)))).filter((e) => !!e).sort((a, b) => b.ts - a.ts)[0];
|
|
3952
|
+
if (!latest) return [];
|
|
3953
|
+
return _chunkYUXA7I4Jjs.entriesToItems.call(void 0, group, _chunkYUXA7I4Jjs.sameSave.call(void 0, latest, await store.list({ metrics, from: latest.ts, to: latest.ts })));
|
|
3954
|
+
}
|
|
3955
|
+
function freshItem(group, position, last) {
|
|
3956
|
+
const item = {};
|
|
3957
|
+
for (const f of _chunkYUXA7I4Jjs.groupFields.call(void 0, group)) {
|
|
3958
|
+
const d = f.options.default;
|
|
3959
|
+
const v = d === "last" ? _optionalChain([last, 'optionalAccess', _276 => _276[position], 'optionalAccess', _277 => _277[f.options.metric]]) : d;
|
|
3960
|
+
if (v !== void 0 && v !== null) item[f.options.metric] = v;
|
|
3961
|
+
}
|
|
3962
|
+
return item;
|
|
3963
|
+
}
|
|
3964
|
+
function baseItems(group, editing, last) {
|
|
3965
|
+
const start = group.options.start;
|
|
3966
|
+
const values = editing ? _chunkYUXA7I4Jjs.entriesToItems.call(void 0, group, editing) : start === "last" && _optionalChain([last, 'optionalAccess', _278 => _278.length]) ? last : Array.from({ length: typeof start === "number" ? Math.max(0, start) : 1 }, (_, i) => freshItem(group, i, last));
|
|
3967
|
+
return values.map((v, i) => ({ key: `b${i}`, values: v, edited: [] }));
|
|
3968
|
+
}
|
|
3969
|
+
var nextItemKey = 1;
|
|
3836
3970
|
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing }) {
|
|
3837
3971
|
const theme = useDashTheme();
|
|
3838
|
-
const panels = _react.useMemo.call(void 0, () =>
|
|
3972
|
+
const panels = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.plainInputPanels.call(void 0, dashboard), [dashboard]);
|
|
3973
|
+
const groups = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.inputGroups.call(void 0, dashboard), [dashboard]);
|
|
3839
3974
|
const saved = _react.useMemo.call(void 0, () => editing ? savedValues(panels, editing) : NO_DEFAULTS, [panels, editing]);
|
|
3840
3975
|
const [defaults, setDefaults] = _react.useState.call(void 0, {});
|
|
3841
3976
|
const [edits, setEdits] = _react.useState.call(void 0, {});
|
|
3977
|
+
const [last, setLast] = _react.useState.call(void 0, {});
|
|
3978
|
+
const [groupEdits, setGroupEdits] = _react.useState.call(void 0, {});
|
|
3842
3979
|
const [offsetMs, setOffsetMs] = _react.useState.call(void 0, 0);
|
|
3843
3980
|
const [status, setStatus] = _react.useState.call(void 0, null);
|
|
3844
3981
|
const [checked, setChecked] = _react.useState.call(void 0, false);
|
|
@@ -3849,10 +3986,18 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3849
3986
|
const next = {};
|
|
3850
3987
|
for (const p of panels) {
|
|
3851
3988
|
const d = p.options.default;
|
|
3852
|
-
if (d === "last") next[p.options.metric] =
|
|
3989
|
+
if (d === "last") next[p.options.metric] = _chunkYUXA7I4Jjs.entryToInputValue.call(void 0, p, await store.latest(p.options.metric));
|
|
3853
3990
|
else if (d !== void 0) next[p.options.metric] = d;
|
|
3854
3991
|
}
|
|
3855
|
-
|
|
3992
|
+
const lastNext = {};
|
|
3993
|
+
for (const g of groups) {
|
|
3994
|
+
const wanted = g.options.start === "last" || _chunkYUXA7I4Jjs.groupFields.call(void 0, g).some((f) => f.options.default === "last");
|
|
3995
|
+
if (wanted) lastNext[groupKey(g)] = await lastItems(store, g);
|
|
3996
|
+
}
|
|
3997
|
+
if (mine === run) {
|
|
3998
|
+
setDefaults(next);
|
|
3999
|
+
setLast(lastNext);
|
|
4000
|
+
}
|
|
3856
4001
|
};
|
|
3857
4002
|
load();
|
|
3858
4003
|
const unsubscribe = store.subscribe(load);
|
|
@@ -3860,7 +4005,9 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3860
4005
|
run = -1;
|
|
3861
4006
|
unsubscribe();
|
|
3862
4007
|
};
|
|
3863
|
-
}, [panels, store]);
|
|
4008
|
+
}, [panels, groups, store]);
|
|
4009
|
+
const base = _react.useMemo.call(void 0, () => Object.fromEntries(groups.map((g) => [groupKey(g), baseItems(g, editing, last[groupKey(g)])])), [groups, editing, last]);
|
|
4010
|
+
const itemsOf = _react.useCallback.call(void 0, (g) => _nullishCoalesce(_nullishCoalesce(groupEdits[groupKey(g)], () => ( base[groupKey(g)])), () => ( [])), [groupEdits, base]);
|
|
3864
4011
|
const state = _react.useMemo.call(void 0, () => {
|
|
3865
4012
|
const value = (m) => m in edits ? edits[m] : m in saved ? saved[m] : m in given ? given[m] : _nullishCoalesce(defaults[m], () => ( null));
|
|
3866
4013
|
return {
|
|
@@ -3874,48 +4021,63 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3874
4021
|
choices,
|
|
3875
4022
|
problem: (m) => {
|
|
3876
4023
|
const p = panels.find((x) => x.options.metric === m);
|
|
3877
|
-
return p && (checked || m in edits) ?
|
|
3878
|
-
}
|
|
4024
|
+
return p && (checked || m in edits) ? _chunkYUXA7I4Jjs.inputProblem.call(void 0, p, value(m)) : void 0;
|
|
4025
|
+
},
|
|
4026
|
+
group: (g) => groupState(g, itemsOf(g), last[groupKey(g)], checked || groupKey(g) in groupEdits, (update) => {
|
|
4027
|
+
setStatus(null);
|
|
4028
|
+
setGroupEdits((all) => ({ ...all, [groupKey(g)]: update(_nullishCoalesce(_nullishCoalesce(all[groupKey(g)], () => ( base[groupKey(g)])), () => ( []))) }));
|
|
4029
|
+
})
|
|
3879
4030
|
};
|
|
3880
|
-
}, [edits, saved, defaults, given, store, choices, panels, checked]);
|
|
3881
|
-
const dirty = Object.keys(edits).length;
|
|
4031
|
+
}, [edits, saved, defaults, given, store, choices, panels, checked, itemsOf, last, groupEdits, base]);
|
|
4032
|
+
const dirty = Object.keys(edits).length + groups.reduce((n, g) => n + groupChanges(_nullishCoalesce(base[groupKey(g)], () => ( [])), groupEdits[groupKey(g)]), 0);
|
|
4033
|
+
const recordedGroups = _react.useCallback.call(void 0,
|
|
4034
|
+
() => groups.filter((g) => editing || groupKey(g) in groupEdits || _chunkYUXA7I4Jjs.groupFields.call(void 0, g).some((f) => f.options.record === "always")),
|
|
4035
|
+
[groups, editing, groupEdits]
|
|
4036
|
+
);
|
|
3882
4037
|
const save = _react.useCallback.call(void 0, async () => {
|
|
3883
4038
|
const problems = panels.flatMap((p) => {
|
|
3884
|
-
const problem =
|
|
4039
|
+
const problem = _chunkYUXA7I4Jjs.inputProblem.call(void 0, p, state.value(p.options.metric));
|
|
3885
4040
|
return problem ? [`${p.title || p.options.metric}: ${problem.toLowerCase()}`] : [];
|
|
3886
4041
|
});
|
|
4042
|
+
for (const g of recordedGroups()) problems.push(..._chunkYUXA7I4Jjs.groupProblems.call(void 0, g, itemsOf(g).map((i) => i.values)));
|
|
3887
4043
|
if (problems.length) {
|
|
3888
4044
|
setChecked(true);
|
|
3889
4045
|
setStatus(problems.length === 1 ? `Can\u2019t save. ${problems[0]}` : `Can\u2019t save: ${problems.length} fields need fixing`);
|
|
3890
4046
|
return;
|
|
3891
4047
|
}
|
|
3892
|
-
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
3893
|
-
const
|
|
4048
|
+
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _279 => _279[0], 'optionalAccess', _280 => _280.ts]), () => ( (header !== void 0 ? _nullishCoalesce(_optionalChain([timestamp, 'optionalCall', _281 => _281()]), () => ( Date.now())) : Date.now() + offsetMs)));
|
|
4049
|
+
const saveId = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _282 => _282.find, 'call', _283 => _283((e) => e.save), 'optionalAccess', _284 => _284.save]), () => ( _chunkYUXA7I4Jjs.newSaveId.call(void 0, )));
|
|
4050
|
+
const entries = [
|
|
4051
|
+
...panels.filter((p) => editing || p.options.metric in edits || p.options.record === "always").flatMap((p) => _chunkYUXA7I4Jjs.toEntries.call(void 0, p, state.value(p.options.metric), ts, { save: saveId })),
|
|
4052
|
+
...recordedGroups().flatMap((g) => _chunkYUXA7I4Jjs.groupToEntries.call(void 0, g, itemsOf(g).map((i) => i.values), ts, saveId))
|
|
4053
|
+
];
|
|
3894
4054
|
if (!entries.length) return;
|
|
3895
4055
|
const extra = beforeSave ? await beforeSave(ts) : [];
|
|
3896
4056
|
if (!extra) return;
|
|
3897
4057
|
const added = editing ? await replace(store, editing.map((e) => e.id), [...entries, ...extra]) : await store.add([...entries, ...extra]);
|
|
3898
4058
|
setEdits({});
|
|
4059
|
+
setGroupEdits({});
|
|
3899
4060
|
setChecked(false);
|
|
3900
4061
|
setOffsetMs(0);
|
|
3901
4062
|
setStatus(`Saved ${added.length} ${added.length === 1 ? "value" : "values"}`);
|
|
3902
|
-
_optionalChain([onSaved, 'optionalCall',
|
|
3903
|
-
}, [panels, edits, state, offsetMs, store, onSaved, header, timestamp, beforeSave, editing]);
|
|
4063
|
+
_optionalChain([onSaved, 'optionalCall', _285 => _285(added.length, added)]);
|
|
4064
|
+
}, [panels, edits, state, offsetMs, store, onSaved, header, timestamp, beforeSave, editing, recordedGroups, itemsOf]);
|
|
3904
4065
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: state, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DashboardProvider, { dashboard, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3905
4066
|
DashboardView,
|
|
3906
4067
|
{
|
|
3907
4068
|
header: header !== void 0 ? header : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TimestampPicker, { offsetMs, onChange: setOffsetMs }),
|
|
3908
|
-
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4069
|
+
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.footer, { backgroundColor: theme.surface, borderTopColor: theme.border }], children: [
|
|
4070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.status, { color: _optionalChain([status, 'optionalAccess', _286 => _286.startsWith, 'call', _287 => _287("Can\u2019t")]) ? theme.danger : theme.textSecondary }], children: _nullishCoalesce(status, () => ( (dirty ? `${dirty} unsaved ${dirty === 1 ? "change" : "changes"}` : "Nothing to save"))) }),
|
|
3910
4071
|
dirty > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3911
4072
|
_reactnative.Pressable,
|
|
3912
4073
|
{
|
|
3913
4074
|
onPress: () => {
|
|
3914
4075
|
setEdits({});
|
|
4076
|
+
setGroupEdits({});
|
|
3915
4077
|
setChecked(false);
|
|
3916
4078
|
setStatus(null);
|
|
3917
4079
|
},
|
|
3918
|
-
style:
|
|
4080
|
+
style: styles15.secondary,
|
|
3919
4081
|
accessibilityRole: "button",
|
|
3920
4082
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontWeight: "500" }, children: "Discard" })
|
|
3921
4083
|
}
|
|
@@ -3926,14 +4088,57 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3926
4088
|
onPress: save,
|
|
3927
4089
|
disabled: !dirty,
|
|
3928
4090
|
accessibilityRole: "button",
|
|
3929
|
-
style: ({ pressed }) => [
|
|
3930
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style:
|
|
4091
|
+
style: ({ pressed }) => [styles15.save, { backgroundColor: theme.accent, opacity: !dirty ? 0.4 : pressed ? 0.8 : 1 }],
|
|
4092
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: styles15.saveText, children: "Save" })
|
|
3931
4093
|
}
|
|
3932
4094
|
)
|
|
3933
4095
|
] })
|
|
3934
4096
|
}
|
|
3935
4097
|
) }) });
|
|
3936
4098
|
}
|
|
4099
|
+
function groupChanges(base, items) {
|
|
4100
|
+
if (!items) return 0;
|
|
4101
|
+
const baseKeys = new Set(base.map((i) => i.key));
|
|
4102
|
+
const keys = new Set(items.map((i) => i.key));
|
|
4103
|
+
const edited = items.reduce((n, i) => n + (baseKeys.has(i.key) ? i.edited.length : 0), 0);
|
|
4104
|
+
const added = items.filter((i) => !baseKeys.has(i.key)).length;
|
|
4105
|
+
const removed = base.filter((i) => !keys.has(i.key)).length;
|
|
4106
|
+
const moved = edited + added + removed === 0 && items.some((i, n) => _optionalChain([base, 'access', _288 => _288[n], 'optionalAccess', _289 => _289.key]) !== i.key) ? 1 : 0;
|
|
4107
|
+
return edited + added + removed + moved;
|
|
4108
|
+
}
|
|
4109
|
+
function groupState(group, items, last, showProblems, update) {
|
|
4110
|
+
const fields = _chunkYUXA7I4Jjs.groupFields.call(void 0, group);
|
|
4111
|
+
const { max } = group.options;
|
|
4112
|
+
const fresh = (position) => ({ key: `n${nextItemKey++}`, values: freshItem(group, position, last), edited: [] });
|
|
4113
|
+
const filled = items.filter((i) => !_chunkYUXA7I4Jjs.isEmptyItem.call(void 0, group, i.values)).length;
|
|
4114
|
+
const { min } = group.options;
|
|
4115
|
+
return {
|
|
4116
|
+
items: items.map((i) => ({ key: i.key, values: i.values, edited: i.edited })),
|
|
4117
|
+
canAdd: typeof max !== "number" || items.length < max,
|
|
4118
|
+
problem: showProblems && typeof min === "number" && filled < min ? `At least ${min}` : void 0,
|
|
4119
|
+
add: () => update((all) => typeof max === "number" && all.length >= max ? all : [...all, fresh(all.length)]),
|
|
4120
|
+
duplicate: (index) => update(
|
|
4121
|
+
(all) => typeof max === "number" && all.length >= max ? all : [...all.slice(0, index + 1), { key: `n${nextItemKey++}`, values: { ...all[index].values }, edited: Object.keys(all[index].values) }, ...all.slice(index + 1)]
|
|
4122
|
+
),
|
|
4123
|
+
remove: (index) => update((all) => all.filter((_, i) => i !== index)),
|
|
4124
|
+
move: (index, by) => update((all) => {
|
|
4125
|
+
const to = index + by;
|
|
4126
|
+
if (to < 0 || to >= all.length) return all;
|
|
4127
|
+
const next = [...all];
|
|
4128
|
+
[next[index], next[to]] = [next[to], next[index]];
|
|
4129
|
+
return next;
|
|
4130
|
+
}),
|
|
4131
|
+
setValue: (index, metric, v) => update(
|
|
4132
|
+
(all) => all.map((item, i) => i === index ? { ...item, values: { ...item.values, [metric]: v }, edited: item.edited.includes(metric) ? item.edited : [...item.edited, metric] } : item)
|
|
4133
|
+
),
|
|
4134
|
+
fieldProblem: (index, metric) => {
|
|
4135
|
+
const item = items[index];
|
|
4136
|
+
const field = fields.find((f) => f.options.metric === metric);
|
|
4137
|
+
if (!item || !field || _chunkYUXA7I4Jjs.isEmptyItem.call(void 0, group, item.values)) return void 0;
|
|
4138
|
+
return showProblems || item.edited.includes(metric) ? _chunkYUXA7I4Jjs.inputProblem.call(void 0, field, _nullishCoalesce(item.values[metric], () => ( null))) : void 0;
|
|
4139
|
+
}
|
|
4140
|
+
};
|
|
4141
|
+
}
|
|
3937
4142
|
async function replace(store, ids, entries) {
|
|
3938
4143
|
if (store.replace) return store.replace(ids, entries);
|
|
3939
4144
|
for (const id of ids) await store.remove(id);
|
|
@@ -3949,20 +4154,20 @@ function TimestampPicker({ offsetMs, onChange }) {
|
|
|
3949
4154
|
}, []);
|
|
3950
4155
|
const when = new Date(now + offsetMs);
|
|
3951
4156
|
const step = (ms) => () => onChange(Math.min(0, offsetMs + ms));
|
|
3952
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4157
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.when, { backgroundColor: theme.surface, borderColor: theme.border }], children: [
|
|
3953
4158
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
3954
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3955
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4159
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.whenLabel, { color: theme.textMuted }], children: "Recording for" }),
|
|
4160
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.whenValue, { color: theme.text }], children: offsetMs === 0 ? "Now" : when.toLocaleString(void 0, { weekday: "short", month: "short", day: "numeric", hour: "numeric", minute: "2-digit" }) })
|
|
3956
4161
|
] }),
|
|
3957
4162
|
[
|
|
3958
4163
|
["\u22121d", -24 * HOUR],
|
|
3959
4164
|
["\u22121h", -HOUR],
|
|
3960
4165
|
["+1h", HOUR]
|
|
3961
|
-
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [
|
|
3962
|
-
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [
|
|
4166
|
+
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [styles15.stepBtn, { borderColor: theme.border }], accessibilityRole: "button", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.text, fontSize: 13 }, children: label }) }, label)),
|
|
4167
|
+
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [styles15.stepBtn, { borderColor: theme.accent }], accessibilityRole: "button", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.accent, fontSize: 13, fontWeight: "600" }, children: "Now" }) })
|
|
3963
4168
|
] });
|
|
3964
4169
|
}
|
|
3965
|
-
var
|
|
4170
|
+
var styles15 = _reactnative.StyleSheet.create({
|
|
3966
4171
|
footer: { flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 16, paddingVertical: 10, borderTopWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
3967
4172
|
status: { flex: 1, fontSize: 13 },
|
|
3968
4173
|
secondary: { paddingHorizontal: 8, paddingVertical: 10 },
|
|
@@ -4201,4 +4406,18 @@ var styles14 = _reactnative.StyleSheet.create({
|
|
|
4201
4406
|
|
|
4202
4407
|
|
|
4203
4408
|
|
|
4204
|
-
exports.ALL = _chunk5UE6Q6CQjs.ALL; exports.BUNDLE_ACCEPT = _chunk5UE6Q6CQjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunk5UE6Q6CQjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunk5UE6Q6CQjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunk5UE6Q6CQjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunk5UE6Q6CQjs.ConfigLoader; exports.DASHBOARD_DS = _chunk5UE6Q6CQjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunk5UE6Q6CQjs.DEFAULT_GAZETTEER; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunk5UE6Q6CQjs.EDITABLE_VARIABLE_TYPES; exports.GRID_COLUMNS = _chunk5UE6Q6CQjs.GRID_COLUMNS; exports.GrafanaClient = _chunk5UE6Q6CQjs.GrafanaClient; exports.GrafanaDataSource = _chunk5UE6Q6CQjs.GrafanaDataSource; exports.GrafanaError = _chunk5UE6Q6CQjs.GrafanaError; exports.HttpConfigFiles = _chunk5UE6Q6CQjs.HttpConfigFiles; exports.INPUT_OPTION_KEYS = _chunk5UE6Q6CQjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunk5UE6Q6CQjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunk5UE6Q6CQjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunk5UE6Q6CQjs.LocalDataSource; exports.MANIFEST_VERSION = _chunk5UE6Q6CQjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunk5UE6Q6CQjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunk5UE6Q6CQjs.MemoryEntryStore; exports.NAMED_COLORS = _chunk5UE6Q6CQjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunk5UE6Q6CQjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunk5UE6Q6CQjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunk5UE6Q6CQjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunk5UE6Q6CQjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunk5UE6Q6CQjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunk5UE6Q6CQjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunk5UE6Q6CQjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunk5UE6Q6CQjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunk5UE6Q6CQjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunk5UE6Q6CQjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunk5UE6Q6CQjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunk5UE6Q6CQjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunk5UE6Q6CQjs.UNIT_CHOICES; exports.addTime = _chunk5UE6Q6CQjs.addTime; exports.appSchema = _chunk5UE6Q6CQjs.appSchema; exports.applyDashboardLink = _chunk5UE6Q6CQjs.applyDashboardLink; exports.applyJsonEdits = _chunk5UE6Q6CQjs.applyJsonEdits; exports.applyTemplate = _chunk5UE6Q6CQjs.applyTemplate; exports.applyTransformations = _chunk5UE6Q6CQjs.applyTransformations; exports.assembleBundle = _chunk5UE6Q6CQjs.assembleBundle; exports.assembleFromResponse = _chunk5UE6Q6CQjs.assembleFromResponse; exports.buildFrames = _chunk5UE6Q6CQjs.buildFrames; exports.bundleFromFiles = _chunk5UE6Q6CQjs.bundleFromFiles; exports.bundleRoot = _chunk5UE6Q6CQjs.bundleRoot; exports.calculateInterval = _chunk5UE6Q6CQjs.calculateInterval; exports.checkFiles = _chunk5UE6Q6CQjs.checkFiles; exports.cleanDashboard = _chunk5UE6Q6CQjs.cleanDashboard; exports.cleanPanelOptions = _chunk5UE6Q6CQjs.cleanPanelOptions; exports.collapseRow = _chunk5UE6Q6CQjs.collapseRow; exports.compactGrid = _chunk5UE6Q6CQjs.compactGrid; exports.copyPanels = _chunk5UE6Q6CQjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunk5UE6Q6CQjs.dashboardSchema; exports.dashboardSchemaIssues = _chunk5UE6Q6CQjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunk5UE6Q6CQjs.dashboardSourceIds; exports.defaultFetchJson = _chunk5UE6Q6CQjs.defaultFetchJson; exports.describeRange = _chunk5UE6Q6CQjs.describeRange; exports.diffJson = _chunk5UE6Q6CQjs.diffJson; exports.documentIdFor = _chunk5UE6Q6CQjs.documentIdFor; exports.documentUses = _chunk5UE6Q6CQjs.documentUses; exports.dropTarget = _chunk5UE6Q6CQjs.dropTarget; exports.duplicatePanel = _chunk5UE6Q6CQjs.duplicatePanel; exports.entriesSavedWith = _chunk5UE6Q6CQjs.entriesSavedWith; exports.entryToInputValue = _chunk5UE6Q6CQjs.entryToInputValue; exports.expandRow = _chunk5UE6Q6CQjs.expandRow; exports.fetchBundle = _chunk5UE6Q6CQjs.fetchBundle; exports.fetchJsonWithToken = _chunk5UE6Q6CQjs.fetchJsonWithToken; exports.fieldDisplayName = _chunk5UE6Q6CQjs.fieldDisplayName; exports.fieldMatches = _chunk5UE6Q6CQjs.fieldMatches; exports.formatClock = _chunk5UE6Q6CQjs.formatClock; exports.formatDisplay = _chunk5UE6Q6CQjs.formatDisplay; exports.formatDuration = _chunk5UE6Q6CQjs.formatDuration; exports.formatJsonText = _chunk5UE6Q6CQjs.formatJsonText; exports.formatLocalDateTime = _chunk5UE6Q6CQjs.formatLocalDateTime; exports.formatValue = _chunk5UE6Q6CQjs.formatValue; exports.frameLength = _chunk5UE6Q6CQjs.frameLength; exports.framesToOptions = _chunk5UE6Q6CQjs.framesToOptions; exports.fromWire = _chunk5UE6Q6CQjs.fromWire; exports.getPath = _chunk5UE6Q6CQjs.getPath; exports.gridOffsetPx = _chunk5UE6Q6CQjs.gridOffsetPx; exports.gridUnitsToPx = _chunk5UE6Q6CQjs.gridUnitsToPx; exports.httpFetchJson = _chunk5UE6Q6CQjs.httpFetchJson; exports.initialVariableValues = _chunk5UE6Q6CQjs.initialVariableValues; exports.inputPanels = _chunk5UE6Q6CQjs.inputPanels; exports.inputProblem = _chunk5UE6Q6CQjs.inputProblem; exports.insertPanel = _chunk5UE6Q6CQjs.insertPanel; exports.interpolate = _chunk5UE6Q6CQjs.interpolate; exports.interpolateDeep = _chunk5UE6Q6CQjs.interpolateDeep; exports.isBundleResponse = _chunk5UE6Q6CQjs.isBundleResponse; exports.isEditableVariableType = _chunk5UE6Q6CQjs.isEditableVariableType; exports.isInputPanel = _chunk5UE6Q6CQjs.isInputPanel; exports.isInputType = _chunk5UE6Q6CQjs.isInputType; exports.isLocalDatasource = _chunk5UE6Q6CQjs.isLocalDatasource; exports.isReducer = _chunk5UE6Q6CQjs.isReducer; exports.isRow = _chunk5UE6Q6CQjs.isRow; exports.isSqlDatasource = _chunk5UE6Q6CQjs.isSqlDatasource; exports.layoutCanvas = _chunk5UE6Q6CQjs.layoutCanvas; exports.layoutDashboard = _chunk5UE6Q6CQjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunk5UE6Q6CQjs.lineColumn; exports.loadGazetteer = _chunk5UE6Q6CQjs.loadGazetteer; exports.locate = _chunk5UE6Q6CQjs.locate; exports.makeTemplate = _chunk5UE6Q6CQjs.makeTemplate; exports.manifestSchemaIssues = _chunk5UE6Q6CQjs.manifestSchemaIssues; exports.mappedResult = _chunk5UE6Q6CQjs.mappedResult; exports.mappingProblem = _chunk5UE6Q6CQjs.mappingProblem; exports.mappingRow = _chunk5UE6Q6CQjs.mappingRow; exports.mappingRows = _chunk5UE6Q6CQjs.mappingRows; exports.metricChanges = _chunk5UE6Q6CQjs.metricChanges; exports.movePanel = _chunk5UE6Q6CQjs.movePanel; exports.newDocument = _chunk5UE6Q6CQjs.newDocument; exports.newPanel = _chunk5UE6Q6CQjs.newPanel; exports.newVariable = _chunk5UE6Q6CQjs.newVariable; exports.nextPanelId = _chunk5UE6Q6CQjs.nextPanelId; exports.normalizeRef = _chunk5UE6Q6CQjs.normalizeRef; exports.numberFields = _chunk5UE6Q6CQjs.numberFields; exports.optionValue = _chunk5UE6Q6CQjs.optionValue; exports.overrideProperties = _chunk5UE6Q6CQjs.overrideProperties; exports.panelEdits = _chunk5UE6Q6CQjs.panelEdits; exports.panelHasQueries = _chunk5UE6Q6CQjs.panelHasQueries; exports.panelKey = _chunk5UE6Q6CQjs.panelKey; exports.panelMetrics = _chunk5UE6Q6CQjs.panelMetrics; exports.panelOptions = _chunk5UE6Q6CQjs.panelOptions; exports.panelOverrides = _chunk5UE6Q6CQjs.panelOverrides; exports.panelSize = _chunk5UE6Q6CQjs.panelSize; exports.panelSpan = _chunk5UE6Q6CQjs.panelSpan; exports.parseClockDigits = _chunk5UE6Q6CQjs.parseClockDigits; exports.parseDashboardLink = _chunk5UE6Q6CQjs.parseDashboardLink; exports.parseDuration = _chunk5UE6Q6CQjs.parseDuration; exports.parseGazetteer = _chunk5UE6Q6CQjs.parseGazetteer; exports.parseJsonText = _chunk5UE6Q6CQjs.parseJsonText; exports.parseLocalDateTime = _chunk5UE6Q6CQjs.parseLocalDateTime; exports.parseRange = _chunk5UE6Q6CQjs.parseRange; exports.parseSnippet = _chunk5UE6Q6CQjs.parseSnippet; exports.parseTemplate = _chunk5UE6Q6CQjs.parseTemplate; exports.parseTime = _chunk5UE6Q6CQjs.parseTime; exports.pasteSnippet = _chunk5UE6Q6CQjs.pasteSnippet; exports.placePanel = _chunk5UE6Q6CQjs.placePanel; exports.pointerToPath = _chunk5UE6Q6CQjs.pointerToPath; exports.prepareDashboard = _chunk5UE6Q6CQjs.prepareDashboard; exports.previewPaste = _chunk5UE6Q6CQjs.previewPaste; exports.queryPanel = _chunk5UE6Q6CQjs.queryPanel; exports.queryParam = _chunk5UE6Q6CQjs.queryParam; exports.readConfigFiles = _chunk5UE6Q6CQjs.readConfigFiles; exports.readingOrder = _chunk5UE6Q6CQjs.readingOrder; exports.reduce = _chunk5UE6Q6CQjs.reduce; exports.refineOptions = _chunk5UE6Q6CQjs.refineOptions; exports.refreshedVariables = _chunk5UE6Q6CQjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunk5UE6Q6CQjs.removeDocumentFromManifest; exports.removePanel = _chunk5UE6Q6CQjs.removePanel; exports.renameDocumentInManifest = _chunk5UE6Q6CQjs.renameDocumentInManifest; exports.renameMetrics = _chunk5UE6Q6CQjs.renameMetrics; exports.renameVariableInPanels = _chunk5UE6Q6CQjs.renameVariableInPanels; exports.repack = _chunk5UE6Q6CQjs.repack; exports.repeatOptions = _chunk5UE6Q6CQjs.repeatOptions; exports.resizePanel = _chunk5UE6Q6CQjs.resizePanel; exports.resolveColor = _chunk5UE6Q6CQjs.resolveColor; exports.resolveFieldConfig = _chunk5UE6Q6CQjs.resolveFieldConfig; exports.resolveLinks = _chunk5UE6Q6CQjs.resolveLinks; exports.resolveTimezone = _chunk5UE6Q6CQjs.resolveTimezone; exports.resolveUrl = _chunk5UE6Q6CQjs.resolveUrl; exports.resolveVariables = _chunk5UE6Q6CQjs.resolveVariables; exports.revalidateBundle = _chunk5UE6Q6CQjs.revalidateBundle; exports.rowsToMappings = _chunk5UE6Q6CQjs.rowsToMappings; exports.sampleEntries = _chunk5UE6Q6CQjs.sampleEntries; exports.screenDocuments = _chunk5UE6Q6CQjs.screenDocuments; exports.screenOfType = _chunk5UE6Q6CQjs.screenOfType; exports.selectValue = _chunk5UE6Q6CQjs.selectValue; exports.seriesColor = _chunk5UE6Q6CQjs.seriesColor; exports.setHiddenOnPhones = _chunk5UE6Q6CQjs.setHiddenOnPhones; exports.setJsonValue = _chunk5UE6Q6CQjs.setJsonValue; exports.setOption = _chunk5UE6Q6CQjs.setOption; exports.setOptionValue = _chunk5UE6Q6CQjs.setOptionValue; exports.setOverrides = _chunk5UE6Q6CQjs.setOverrides; exports.settleLayout = _chunk5UE6Q6CQjs.settleLayout; exports.snapToGrid = _chunk5UE6Q6CQjs.snapToGrid; exports.splitPath = _chunk5UE6Q6CQjs.splitPath; exports.startOf = _chunk5UE6Q6CQjs.startOf; exports.stringifyCompact = _chunk5UE6Q6CQjs.stringifyCompact; exports.tabIdFor = _chunk5UE6Q6CQjs.tabIdFor; exports.templateNeeds = _chunk5UE6Q6CQjs.templateNeeds; exports.textSuggestions = _chunk5UE6Q6CQjs.textSuggestions; exports.thresholdStep = _chunk5UE6Q6CQjs.thresholdStep; exports.timeExprError = _chunk5UE6Q6CQjs.timeExprError; exports.timeField = _chunk5UE6Q6CQjs.timeField; exports.toEntries = _chunk5UE6Q6CQjs.toEntries; exports.toMillis = _chunk5UE6Q6CQjs.toMillis; exports.toSeries = _chunk5UE6Q6CQjs.toSeries; exports.toXYSeries = _chunk5UE6Q6CQjs.toXYSeries; exports.uniqueNames = _chunk5UE6Q6CQjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunk5UE6Q6CQjs.validateBundle; exports.validateDashboard = _chunk5UE6Q6CQjs.validateDashboard; exports.validateManifest = _chunk5UE6Q6CQjs.validateManifest; exports.valueColor = _chunk5UE6Q6CQjs.valueColor; exports.valueText = _chunk5UE6Q6CQjs.valueText; exports.variableDependents = _chunk5UE6Q6CQjs.variableDependents; exports.variableInfo = _chunk5UE6Q6CQjs.variableInfo; exports.variableNameError = _chunk5UE6Q6CQjs.variableNameError; exports.variableOptions = _chunk5UE6Q6CQjs.variableOptions; exports.variableOrder = _chunk5UE6Q6CQjs.variableOrder; exports.variableReferences = _chunk5UE6Q6CQjs.variableReferences; exports.variableUses = _chunk5UE6Q6CQjs.variableUses; exports.variableWithCurrent = _chunk5UE6Q6CQjs.variableWithCurrent; exports.variableWithFlags = _chunk5UE6Q6CQjs.variableWithFlags; exports.variableWithQuery = _chunk5UE6Q6CQjs.variableWithQuery; exports.variableWithType = _chunk5UE6Q6CQjs.variableWithType; exports.visibleVariables = _chunk5UE6Q6CQjs.visibleVariables; exports.zoomRange = _chunk5UE6Q6CQjs.zoomRange;
|
|
4409
|
+
|
|
4410
|
+
|
|
4411
|
+
|
|
4412
|
+
|
|
4413
|
+
|
|
4414
|
+
|
|
4415
|
+
|
|
4416
|
+
|
|
4417
|
+
|
|
4418
|
+
|
|
4419
|
+
|
|
4420
|
+
|
|
4421
|
+
|
|
4422
|
+
|
|
4423
|
+
exports.ALL = _chunkYUXA7I4Jjs.ALL; exports.BUNDLE_ACCEPT = _chunkYUXA7I4Jjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkYUXA7I4Jjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkYUXA7I4Jjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkYUXA7I4Jjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkYUXA7I4Jjs.ConfigLoader; exports.DASHBOARD_DS = _chunkYUXA7I4Jjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkYUXA7I4Jjs.DEFAULT_GAZETTEER; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkYUXA7I4Jjs.EDITABLE_VARIABLE_TYPES; exports.GRID_COLUMNS = _chunkYUXA7I4Jjs.GRID_COLUMNS; exports.GROUP_FIELD_TYPES = _chunkYUXA7I4Jjs.GROUP_FIELD_TYPES; exports.GrafanaClient = _chunkYUXA7I4Jjs.GrafanaClient; exports.GrafanaDataSource = _chunkYUXA7I4Jjs.GrafanaDataSource; exports.GrafanaError = _chunkYUXA7I4Jjs.GrafanaError; exports.HttpConfigFiles = _chunkYUXA7I4Jjs.HttpConfigFiles; exports.INPUT_GROUP = _chunkYUXA7I4Jjs.INPUT_GROUP; exports.INPUT_OPTION_KEYS = _chunkYUXA7I4Jjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkYUXA7I4Jjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkYUXA7I4Jjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkYUXA7I4Jjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkYUXA7I4Jjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkYUXA7I4Jjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkYUXA7I4Jjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkYUXA7I4Jjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkYUXA7I4Jjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkYUXA7I4Jjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkYUXA7I4Jjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkYUXA7I4Jjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkYUXA7I4Jjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkYUXA7I4Jjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkYUXA7I4Jjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkYUXA7I4Jjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkYUXA7I4Jjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkYUXA7I4Jjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunkYUXA7I4Jjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunkYUXA7I4Jjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkYUXA7I4Jjs.UNIT_CHOICES; exports.addTime = _chunkYUXA7I4Jjs.addTime; exports.appSchema = _chunkYUXA7I4Jjs.appSchema; exports.applyDashboardLink = _chunkYUXA7I4Jjs.applyDashboardLink; exports.applyJsonEdits = _chunkYUXA7I4Jjs.applyJsonEdits; exports.applyTemplate = _chunkYUXA7I4Jjs.applyTemplate; exports.applyTransformations = _chunkYUXA7I4Jjs.applyTransformations; exports.assembleBundle = _chunkYUXA7I4Jjs.assembleBundle; exports.assembleFromResponse = _chunkYUXA7I4Jjs.assembleFromResponse; exports.buildFrames = _chunkYUXA7I4Jjs.buildFrames; exports.bundleFromFiles = _chunkYUXA7I4Jjs.bundleFromFiles; exports.bundleRoot = _chunkYUXA7I4Jjs.bundleRoot; exports.calculateInterval = _chunkYUXA7I4Jjs.calculateInterval; exports.checkFiles = _chunkYUXA7I4Jjs.checkFiles; exports.cleanDashboard = _chunkYUXA7I4Jjs.cleanDashboard; exports.cleanPanelOptions = _chunkYUXA7I4Jjs.cleanPanelOptions; exports.collapseRow = _chunkYUXA7I4Jjs.collapseRow; exports.compactGrid = _chunkYUXA7I4Jjs.compactGrid; exports.copyPanels = _chunkYUXA7I4Jjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkYUXA7I4Jjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkYUXA7I4Jjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkYUXA7I4Jjs.dashboardSourceIds; exports.defaultFetchJson = _chunkYUXA7I4Jjs.defaultFetchJson; exports.describeRange = _chunkYUXA7I4Jjs.describeRange; exports.diffJson = _chunkYUXA7I4Jjs.diffJson; exports.documentIdFor = _chunkYUXA7I4Jjs.documentIdFor; exports.documentUses = _chunkYUXA7I4Jjs.documentUses; exports.dropTarget = _chunkYUXA7I4Jjs.dropTarget; exports.duplicatePanel = _chunkYUXA7I4Jjs.duplicatePanel; exports.entriesSavedWith = _chunkYUXA7I4Jjs.entriesSavedWith; exports.entriesToItems = _chunkYUXA7I4Jjs.entriesToItems; exports.entryToInputValue = _chunkYUXA7I4Jjs.entryToInputValue; exports.expandRow = _chunkYUXA7I4Jjs.expandRow; exports.fetchBundle = _chunkYUXA7I4Jjs.fetchBundle; exports.fetchJsonWithToken = _chunkYUXA7I4Jjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkYUXA7I4Jjs.fieldDisplayName; exports.fieldMatches = _chunkYUXA7I4Jjs.fieldMatches; exports.formatClock = _chunkYUXA7I4Jjs.formatClock; exports.formatDisplay = _chunkYUXA7I4Jjs.formatDisplay; exports.formatDuration = _chunkYUXA7I4Jjs.formatDuration; exports.formatJsonText = _chunkYUXA7I4Jjs.formatJsonText; exports.formatLocalDateTime = _chunkYUXA7I4Jjs.formatLocalDateTime; exports.formatValue = _chunkYUXA7I4Jjs.formatValue; exports.frameLength = _chunkYUXA7I4Jjs.frameLength; exports.framesToOptions = _chunkYUXA7I4Jjs.framesToOptions; exports.fromWire = _chunkYUXA7I4Jjs.fromWire; exports.getPath = _chunkYUXA7I4Jjs.getPath; exports.gridOffsetPx = _chunkYUXA7I4Jjs.gridOffsetPx; exports.gridUnitsToPx = _chunkYUXA7I4Jjs.gridUnitsToPx; exports.groupFields = _chunkYUXA7I4Jjs.groupFields; exports.groupKey = groupKey; exports.groupProblems = _chunkYUXA7I4Jjs.groupProblems; exports.groupToEntries = _chunkYUXA7I4Jjs.groupToEntries; exports.httpFetchJson = _chunkYUXA7I4Jjs.httpFetchJson; exports.initialVariableValues = _chunkYUXA7I4Jjs.initialVariableValues; exports.inputGroups = _chunkYUXA7I4Jjs.inputGroups; exports.inputPanels = _chunkYUXA7I4Jjs.inputPanels; exports.inputProblem = _chunkYUXA7I4Jjs.inputProblem; exports.insertPanel = _chunkYUXA7I4Jjs.insertPanel; exports.interpolate = _chunkYUXA7I4Jjs.interpolate; exports.interpolateDeep = _chunkYUXA7I4Jjs.interpolateDeep; exports.isBundleResponse = _chunkYUXA7I4Jjs.isBundleResponse; exports.isEditableVariableType = _chunkYUXA7I4Jjs.isEditableVariableType; exports.isEmptyItem = _chunkYUXA7I4Jjs.isEmptyItem; exports.isFormPanelType = _chunkYUXA7I4Jjs.isFormPanelType; exports.isInputGroup = _chunkYUXA7I4Jjs.isInputGroup; exports.isInputPanel = _chunkYUXA7I4Jjs.isInputPanel; exports.isInputType = _chunkYUXA7I4Jjs.isInputType; exports.isLocalDatasource = _chunkYUXA7I4Jjs.isLocalDatasource; exports.isReducer = _chunkYUXA7I4Jjs.isReducer; exports.isRow = _chunkYUXA7I4Jjs.isRow; exports.isSqlDatasource = _chunkYUXA7I4Jjs.isSqlDatasource; exports.layoutCanvas = _chunkYUXA7I4Jjs.layoutCanvas; exports.layoutDashboard = _chunkYUXA7I4Jjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkYUXA7I4Jjs.lineColumn; exports.loadGazetteer = _chunkYUXA7I4Jjs.loadGazetteer; exports.locate = _chunkYUXA7I4Jjs.locate; exports.makeTemplate = _chunkYUXA7I4Jjs.makeTemplate; exports.manifestSchemaIssues = _chunkYUXA7I4Jjs.manifestSchemaIssues; exports.mappedResult = _chunkYUXA7I4Jjs.mappedResult; exports.mappingProblem = _chunkYUXA7I4Jjs.mappingProblem; exports.mappingRow = _chunkYUXA7I4Jjs.mappingRow; exports.mappingRows = _chunkYUXA7I4Jjs.mappingRows; exports.metricChanges = _chunkYUXA7I4Jjs.metricChanges; exports.movePanel = _chunkYUXA7I4Jjs.movePanel; exports.newDocument = _chunkYUXA7I4Jjs.newDocument; exports.newPanel = _chunkYUXA7I4Jjs.newPanel; exports.newSaveId = _chunkYUXA7I4Jjs.newSaveId; exports.newVariable = _chunkYUXA7I4Jjs.newVariable; exports.nextPanelId = _chunkYUXA7I4Jjs.nextPanelId; exports.normalizeRef = _chunkYUXA7I4Jjs.normalizeRef; exports.numberFields = _chunkYUXA7I4Jjs.numberFields; exports.optionValue = _chunkYUXA7I4Jjs.optionValue; exports.overrideProperties = _chunkYUXA7I4Jjs.overrideProperties; exports.panelEdits = _chunkYUXA7I4Jjs.panelEdits; exports.panelHasQueries = _chunkYUXA7I4Jjs.panelHasQueries; exports.panelKey = _chunkYUXA7I4Jjs.panelKey; exports.panelMetrics = _chunkYUXA7I4Jjs.panelMetrics; exports.panelOptions = _chunkYUXA7I4Jjs.panelOptions; exports.panelOverrides = _chunkYUXA7I4Jjs.panelOverrides; exports.panelSize = _chunkYUXA7I4Jjs.panelSize; exports.panelSpan = _chunkYUXA7I4Jjs.panelSpan; exports.parseClockDigits = _chunkYUXA7I4Jjs.parseClockDigits; exports.parseDashboardLink = _chunkYUXA7I4Jjs.parseDashboardLink; exports.parseDuration = _chunkYUXA7I4Jjs.parseDuration; exports.parseGazetteer = _chunkYUXA7I4Jjs.parseGazetteer; exports.parseJsonText = _chunkYUXA7I4Jjs.parseJsonText; exports.parseLocalDateTime = _chunkYUXA7I4Jjs.parseLocalDateTime; exports.parseRange = _chunkYUXA7I4Jjs.parseRange; exports.parseSnippet = _chunkYUXA7I4Jjs.parseSnippet; exports.parseTemplate = _chunkYUXA7I4Jjs.parseTemplate; exports.parseTime = _chunkYUXA7I4Jjs.parseTime; exports.pasteSnippet = _chunkYUXA7I4Jjs.pasteSnippet; exports.placePanel = _chunkYUXA7I4Jjs.placePanel; exports.plainInputPanels = _chunkYUXA7I4Jjs.plainInputPanels; exports.pointerToPath = _chunkYUXA7I4Jjs.pointerToPath; exports.prepareDashboard = _chunkYUXA7I4Jjs.prepareDashboard; exports.previewPaste = _chunkYUXA7I4Jjs.previewPaste; exports.queryPanel = _chunkYUXA7I4Jjs.queryPanel; exports.queryParam = _chunkYUXA7I4Jjs.queryParam; exports.readConfigFiles = _chunkYUXA7I4Jjs.readConfigFiles; exports.readingOrder = _chunkYUXA7I4Jjs.readingOrder; exports.reduce = _chunkYUXA7I4Jjs.reduce; exports.refineOptions = _chunkYUXA7I4Jjs.refineOptions; exports.refreshedVariables = _chunkYUXA7I4Jjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkYUXA7I4Jjs.removeDocumentFromManifest; exports.removePanel = _chunkYUXA7I4Jjs.removePanel; exports.renameDocumentInManifest = _chunkYUXA7I4Jjs.renameDocumentInManifest; exports.renameMetrics = _chunkYUXA7I4Jjs.renameMetrics; exports.renameVariableInPanels = _chunkYUXA7I4Jjs.renameVariableInPanels; exports.repack = _chunkYUXA7I4Jjs.repack; exports.repeatOptions = _chunkYUXA7I4Jjs.repeatOptions; exports.resizePanel = _chunkYUXA7I4Jjs.resizePanel; exports.resolveColor = _chunkYUXA7I4Jjs.resolveColor; exports.resolveFieldConfig = _chunkYUXA7I4Jjs.resolveFieldConfig; exports.resolveLinks = _chunkYUXA7I4Jjs.resolveLinks; exports.resolveTimezone = _chunkYUXA7I4Jjs.resolveTimezone; exports.resolveUrl = _chunkYUXA7I4Jjs.resolveUrl; exports.resolveVariables = _chunkYUXA7I4Jjs.resolveVariables; exports.revalidateBundle = _chunkYUXA7I4Jjs.revalidateBundle; exports.rowsToMappings = _chunkYUXA7I4Jjs.rowsToMappings; exports.sameSave = _chunkYUXA7I4Jjs.sameSave; exports.sampleEntries = _chunkYUXA7I4Jjs.sampleEntries; exports.screenDocuments = _chunkYUXA7I4Jjs.screenDocuments; exports.screenOfType = _chunkYUXA7I4Jjs.screenOfType; exports.selectValue = _chunkYUXA7I4Jjs.selectValue; exports.seriesColor = _chunkYUXA7I4Jjs.seriesColor; exports.setHiddenOnPhones = _chunkYUXA7I4Jjs.setHiddenOnPhones; exports.setJsonValue = _chunkYUXA7I4Jjs.setJsonValue; exports.setOption = _chunkYUXA7I4Jjs.setOption; exports.setOptionValue = _chunkYUXA7I4Jjs.setOptionValue; exports.setOverrides = _chunkYUXA7I4Jjs.setOverrides; exports.settleLayout = _chunkYUXA7I4Jjs.settleLayout; exports.snapToGrid = _chunkYUXA7I4Jjs.snapToGrid; exports.splitPath = _chunkYUXA7I4Jjs.splitPath; exports.startOf = _chunkYUXA7I4Jjs.startOf; exports.stringifyCompact = _chunkYUXA7I4Jjs.stringifyCompact; exports.tabIdFor = _chunkYUXA7I4Jjs.tabIdFor; exports.templateNeeds = _chunkYUXA7I4Jjs.templateNeeds; exports.textSuggestions = _chunkYUXA7I4Jjs.textSuggestions; exports.thresholdStep = _chunkYUXA7I4Jjs.thresholdStep; exports.timeExprError = _chunkYUXA7I4Jjs.timeExprError; exports.timeField = _chunkYUXA7I4Jjs.timeField; exports.toEntries = _chunkYUXA7I4Jjs.toEntries; exports.toMillis = _chunkYUXA7I4Jjs.toMillis; exports.toSeries = _chunkYUXA7I4Jjs.toSeries; exports.toXYSeries = _chunkYUXA7I4Jjs.toXYSeries; exports.uniqueNames = _chunkYUXA7I4Jjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkYUXA7I4Jjs.validateBundle; exports.validateDashboard = _chunkYUXA7I4Jjs.validateDashboard; exports.validateManifest = _chunkYUXA7I4Jjs.validateManifest; exports.valueColor = _chunkYUXA7I4Jjs.valueColor; exports.valueText = _chunkYUXA7I4Jjs.valueText; exports.variableDependents = _chunkYUXA7I4Jjs.variableDependents; exports.variableInfo = _chunkYUXA7I4Jjs.variableInfo; exports.variableNameError = _chunkYUXA7I4Jjs.variableNameError; exports.variableOptions = _chunkYUXA7I4Jjs.variableOptions; exports.variableOrder = _chunkYUXA7I4Jjs.variableOrder; exports.variableReferences = _chunkYUXA7I4Jjs.variableReferences; exports.variableUses = _chunkYUXA7I4Jjs.variableUses; exports.variableWithCurrent = _chunkYUXA7I4Jjs.variableWithCurrent; exports.variableWithFlags = _chunkYUXA7I4Jjs.variableWithFlags; exports.variableWithQuery = _chunkYUXA7I4Jjs.variableWithQuery; exports.variableWithType = _chunkYUXA7I4Jjs.variableWithType; exports.visibleVariables = _chunkYUXA7I4Jjs.visibleVariables; exports.zoomRange = _chunkYUXA7I4Jjs.zoomRange;
|