@modelform/react-native 0.4.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-ATRMUHKJ.mjs → chunk-BW6HKFAB.mjs} +1079 -372
- package/dist/{chunk-WMRDOYPV.js → chunk-YUXA7I4J.js} +1179 -472
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +42 -2
- package/dist/core/index.mjs +41 -1
- package/dist/core/inputs.d.ts +71 -1
- package/dist/core/local.d.ts +4 -0
- package/dist/core/snippets.d.ts +4 -0
- package/dist/core/templates.d.ts +74 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +547 -314
- package/dist/index.mjs +508 -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
|
@@ -200,7 +200,27 @@
|
|
|
200
200
|
|
|
201
201
|
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
var _chunkYUXA7I4Jjs = require('./chunk-YUXA7I4J.js');
|
|
204
224
|
|
|
205
225
|
// src/ui/theme.tsx
|
|
206
226
|
var _react = require('react');
|
|
@@ -390,7 +410,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
390
410
|
if (!dashboard.refresh) return;
|
|
391
411
|
let ms;
|
|
392
412
|
try {
|
|
393
|
-
ms =
|
|
413
|
+
ms = _chunkYUXA7I4Jjs.parseDuration.call(void 0, dashboard.refresh);
|
|
394
414
|
} catch (e2) {
|
|
395
415
|
return;
|
|
396
416
|
}
|
|
@@ -398,7 +418,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
398
418
|
return () => clearInterval(id);
|
|
399
419
|
}, [dashboard.refresh, refresh]);
|
|
400
420
|
const refreshKey = tick + externalKey;
|
|
401
|
-
const range3 = _react.useMemo.call(void 0, () =>
|
|
421
|
+
const range3 = _react.useMemo.call(void 0, () => _chunkYUXA7I4Jjs.parseRange.call(void 0, rawRange), [rawRange, refreshKey]);
|
|
402
422
|
const shared = _react.useMemo.call(void 0, () => /* @__PURE__ */ new Map(), [range3, vars.variables, vars.variableInfo]);
|
|
403
423
|
const value = _react.useMemo.call(void 0,
|
|
404
424
|
() => ({
|
|
@@ -435,8 +455,8 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
435
455
|
] });
|
|
436
456
|
}
|
|
437
457
|
function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
438
|
-
const [state, setState] = _react.useState.call(void 0, () => ({ values:
|
|
439
|
-
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);
|
|
440
460
|
const [runKey, setRunKey] = _react.useState.call(void 0, 0);
|
|
441
461
|
const pending = _react.useRef.call(void 0, /* @__PURE__ */ new Set());
|
|
442
462
|
const stateRef = _react.useRef.call(void 0, state);
|
|
@@ -469,7 +489,7 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
469
489
|
setState(update);
|
|
470
490
|
setResolving(false);
|
|
471
491
|
};
|
|
472
|
-
|
|
492
|
+
_chunkYUXA7I4Jjs.resolveVariables.call(void 0, dashboard, { values, options, names, resolve: resolve2, range: _chunkYUXA7I4Jjs.parseRange.call(void 0, rawRange), signal: controller.signal }).then(
|
|
473
493
|
(res) => finish((s) => ({
|
|
474
494
|
// Only the re-run variables change, so a pick made while this ran isn't overwritten.
|
|
475
495
|
values: { ...s.values, ...Object.fromEntries([...names].filter((n) => n in res.values).map((n) => [n, res.values[n]])) },
|
|
@@ -483,11 +503,11 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
483
503
|
const [loadedDashboard, setLoadedDashboard] = _react.useState.call(void 0, dashboard);
|
|
484
504
|
if (dashboard !== loadedDashboard) {
|
|
485
505
|
setLoadedDashboard(dashboard);
|
|
486
|
-
setState((s) => ({ ...s, values: { ...
|
|
506
|
+
setState((s) => ({ ...s, values: { ..._chunkYUXA7I4Jjs.initialVariableValues.call(void 0, dashboard), ...s.values } }));
|
|
487
507
|
}
|
|
488
508
|
_react.useEffect.call(void 0, () => {
|
|
489
|
-
const roots =
|
|
490
|
-
schedule([...roots, ...
|
|
509
|
+
const roots = _chunkYUXA7I4Jjs.refreshedVariables.call(void 0, dashboard, "load");
|
|
510
|
+
schedule([...roots, ..._chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
491
511
|
}, [dashboard, schedule]);
|
|
492
512
|
const mounted = _react.useRef.call(void 0, false);
|
|
493
513
|
_react.useEffect.call(void 0, () => {
|
|
@@ -495,17 +515,17 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
495
515
|
mounted.current = true;
|
|
496
516
|
return;
|
|
497
517
|
}
|
|
498
|
-
const roots =
|
|
499
|
-
schedule([...roots, ...
|
|
518
|
+
const roots = _chunkYUXA7I4Jjs.refreshedVariables.call(void 0, dashboard, "range");
|
|
519
|
+
schedule([...roots, ..._chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
500
520
|
}, [rawRange]);
|
|
501
521
|
const setVariable = _react.useCallback.call(void 0,
|
|
502
522
|
(name, value) => {
|
|
503
523
|
setState((s) => ({ ...s, values: { ...s.values, [name]: value } }));
|
|
504
|
-
schedule(
|
|
524
|
+
schedule(_chunkYUXA7I4Jjs.variableDependents.call(void 0, dashboard, [name]));
|
|
505
525
|
},
|
|
506
526
|
[dashboard, schedule]
|
|
507
527
|
);
|
|
508
|
-
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]);
|
|
509
529
|
return _react.useMemo.call(void 0,
|
|
510
530
|
() => ({
|
|
511
531
|
variables: state.values,
|
|
@@ -535,7 +555,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
535
555
|
_react.useEffect.call(void 0, () => {
|
|
536
556
|
if (!enabled || !request || !variablesReady) return;
|
|
537
557
|
const controller = new AbortController();
|
|
538
|
-
|
|
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))) }));
|
|
539
559
|
return () => controller.abort();
|
|
540
560
|
}, [enabled, request, variablesReady]);
|
|
541
561
|
if (!enabled) return IDLE;
|
|
@@ -545,7 +565,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
545
565
|
function usePanelLinks(panel) {
|
|
546
566
|
const { dashboard, variables, variableInfo: variableInfo2, range: range3, openLinks } = useDashboard();
|
|
547
567
|
const resolve = _react.useCallback.call(void 0,
|
|
548
|
-
(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 }),
|
|
549
569
|
[dashboard, variables, variableInfo2, panel.scopedVars, range3]
|
|
550
570
|
);
|
|
551
571
|
return { resolve, openLinks };
|
|
@@ -586,6 +606,7 @@ var RenderBoundary = (_class = class extends _react.Component {constructor(...ar
|
|
|
586
606
|
|
|
587
607
|
// src/ui/inputs/formContext.ts
|
|
588
608
|
|
|
609
|
+
var groupKey = (g) => g.id != null ? `#${g.id}` : _chunkYUXA7I4Jjs.groupFields.call(void 0, g).map((f) => f.options.metric).join("|");
|
|
589
610
|
var InputFormContext = _react.createContext.call(void 0, null);
|
|
590
611
|
function useInputForm() {
|
|
591
612
|
const v = _react.useContext.call(void 0, InputFormContext);
|
|
@@ -593,6 +614,10 @@ function useInputForm() {
|
|
|
593
614
|
return v;
|
|
594
615
|
}
|
|
595
616
|
|
|
617
|
+
// src/ui/inputs/InputGroup.tsx
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
596
621
|
// src/ui/inputs/InputPanels.tsx
|
|
597
622
|
|
|
598
623
|
|
|
@@ -642,14 +667,14 @@ var ArrowIcon = ({ color, dir }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
|
642
667
|
function displayExpr(expr) {
|
|
643
668
|
if (expr.trim().startsWith("now")) return expr;
|
|
644
669
|
try {
|
|
645
|
-
return
|
|
670
|
+
return _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, _chunkYUXA7I4Jjs.parseTime.call(void 0, expr));
|
|
646
671
|
} catch (e3) {
|
|
647
672
|
return expr;
|
|
648
673
|
}
|
|
649
674
|
}
|
|
650
675
|
function tryParse(expr, roundUp, now = Date.now()) {
|
|
651
676
|
try {
|
|
652
|
-
return
|
|
677
|
+
return _chunkYUXA7I4Jjs.parseTime.call(void 0, expr, now, roundUp);
|
|
653
678
|
} catch (e4) {
|
|
654
679
|
return null;
|
|
655
680
|
}
|
|
@@ -663,7 +688,7 @@ function endOfDay(ms) {
|
|
|
663
688
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1).getTime() - 1e3;
|
|
664
689
|
}
|
|
665
690
|
function resolveTo(expr) {
|
|
666
|
-
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;
|
|
667
692
|
}
|
|
668
693
|
function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
669
694
|
const theme = useDashTheme();
|
|
@@ -674,12 +699,12 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
674
699
|
const [now] = _react.useState.call(void 0, () => Date.now());
|
|
675
700
|
const [month, setMonth] = _react.useState.call(void 0, () => new Date(_nullishCoalesce(tryParse(value.from, false), () => ( now))));
|
|
676
701
|
const fromMs = tryParse(from, false, now);
|
|
677
|
-
const toMs = tryParse(
|
|
678
|
-
const fromError =
|
|
679
|
-
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);
|
|
680
705
|
const orderError = fromMs != null && toMs != null && fromMs >= toMs ? "\u201CTo\u201D must be after \u201CFrom\u201D" : null;
|
|
681
706
|
const valid = !fromError && !toError && !orderError;
|
|
682
|
-
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));
|
|
683
708
|
const apply = () => {
|
|
684
709
|
if (!valid) return;
|
|
685
710
|
onApply({ from: normalize(from), to: normalize(resolveTo(to)) });
|
|
@@ -688,14 +713,14 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
688
713
|
const pickDay = (day) => {
|
|
689
714
|
const end = endOfDay(day);
|
|
690
715
|
if (active === "from") {
|
|
691
|
-
setFrom(
|
|
692
|
-
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));
|
|
693
718
|
setActive("to");
|
|
694
719
|
} else if (fromMs != null && day < startOfDay(fromMs)) {
|
|
695
|
-
setFrom(
|
|
696
|
-
setTo(
|
|
720
|
+
setFrom(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, day));
|
|
721
|
+
setTo(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, end));
|
|
697
722
|
} else {
|
|
698
|
-
setTo(
|
|
723
|
+
setTo(_chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, end));
|
|
699
724
|
}
|
|
700
725
|
};
|
|
701
726
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -731,7 +756,7 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
731
756
|
}
|
|
732
757
|
),
|
|
733
758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles3.sectionTitle, { color: theme.textSecondary }], children: "Relative ranges" }),
|
|
734
|
-
/* @__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,
|
|
735
760
|
Chip,
|
|
736
761
|
{
|
|
737
762
|
label: r.label,
|
|
@@ -875,17 +900,17 @@ var FilterIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _re
|
|
|
875
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" }) });
|
|
876
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" }) });
|
|
877
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" }) });
|
|
878
|
-
function DashboardToolbar({ presets =
|
|
903
|
+
function DashboardToolbar({ presets = _chunkYUXA7I4Jjs.TIME_PRESETS }) {
|
|
879
904
|
const theme = useDashTheme();
|
|
880
905
|
const { dashboard, rawRange, setRawRange, variables, variableErrors } = useDashboard();
|
|
881
906
|
const [filtersOpen, setFiltersOpen] = _react.useState.call(void 0, false);
|
|
882
907
|
const [rangeOpen, setRangeOpen] = _react.useState.call(void 0, false);
|
|
883
908
|
const [rangeKey, setRangeKey] = _react.useState.call(void 0, 0);
|
|
884
909
|
const custom = !presets.some((p) => rawRange.from === p.from && rawRange.to === p.to);
|
|
885
|
-
const vars =
|
|
910
|
+
const vars = _chunkYUXA7I4Jjs.visibleVariables.call(void 0, dashboard);
|
|
886
911
|
const active = vars.filter((v) => {
|
|
887
912
|
const cur = variables[v.name];
|
|
888
|
-
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);
|
|
889
914
|
}).length;
|
|
890
915
|
const hasError = vars.some((v) => variableErrors[v.name]);
|
|
891
916
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles4.toolbar, children: [
|
|
@@ -911,7 +936,7 @@ function DashboardToolbar({ presets = _chunkWMRDOYPVjs.TIME_PRESETS }) {
|
|
|
911
936
|
setRangeOpen(true);
|
|
912
937
|
},
|
|
913
938
|
accessibilityRole: "button",
|
|
914
|
-
accessibilityLabel: custom ? `Time range, ${
|
|
939
|
+
accessibilityLabel: custom ? `Time range, ${_chunkYUXA7I4Jjs.describeRange.call(void 0, rawRange)}` : "Custom time range",
|
|
915
940
|
style: ({ pressed }) => [
|
|
916
941
|
custom ? styles4.rangeButton : styles4.iconButton,
|
|
917
942
|
{ borderColor: custom ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
@@ -919,7 +944,7 @@ function DashboardToolbar({ presets = _chunkWMRDOYPVjs.TIME_PRESETS }) {
|
|
|
919
944
|
],
|
|
920
945
|
children: [
|
|
921
946
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CalendarIcon, { color: custom ? theme.accent : theme.textSecondary }),
|
|
922
|
-
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) })
|
|
923
948
|
]
|
|
924
949
|
}
|
|
925
950
|
),
|
|
@@ -975,14 +1000,14 @@ function FilterSection({ variable: v, open, onToggle }) {
|
|
|
975
1000
|
const theme = useDashTheme();
|
|
976
1001
|
const { variables, variableInfo: variableInfo2, variableErrors, variablesReady, setVariable } = useDashboard();
|
|
977
1002
|
const current = variables[v.name];
|
|
978
|
-
const summary =
|
|
979
|
-
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]), () => ( []))];
|
|
980
1005
|
const error = variableErrors[v.name];
|
|
981
1006
|
const choose = (value, selected) => {
|
|
982
|
-
if (v.multi && value !==
|
|
983
|
-
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);
|
|
984
1009
|
const next = selected ? cur.filter((c) => c !== value) : [...cur, value];
|
|
985
|
-
setVariable(v.name, next.length ? next : [
|
|
1010
|
+
setVariable(v.name, next.length ? next : [_chunkYUXA7I4Jjs.ALL]);
|
|
986
1011
|
} else {
|
|
987
1012
|
setVariable(v.name, v.multi ? [value] : value);
|
|
988
1013
|
if (!v.multi) onToggle();
|
|
@@ -1122,7 +1147,7 @@ function barCategory(panel, frame) {
|
|
|
1122
1147
|
}
|
|
1123
1148
|
function categoryLabels(field) {
|
|
1124
1149
|
if (field.type !== "time") return field.values.map((v) => v == null ? "" : String(v));
|
|
1125
|
-
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));
|
|
1126
1151
|
let step = Infinity;
|
|
1127
1152
|
times.forEach((t, i) => {
|
|
1128
1153
|
const prev = times[i - 1];
|
|
@@ -1168,19 +1193,19 @@ function formatTooltipTime(t) {
|
|
|
1168
1193
|
return new Date(t).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
1169
1194
|
}
|
|
1170
1195
|
function styledSeries(panel, frames, scheme) {
|
|
1171
|
-
return styleSeries(panel,
|
|
1196
|
+
return styleSeries(panel, _chunkYUXA7I4Jjs.toSeries.call(void 0, frames), frames, scheme);
|
|
1172
1197
|
}
|
|
1173
1198
|
function styledXYSeries(panel, frames, scheme) {
|
|
1174
|
-
const { series, x } =
|
|
1175
|
-
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) : {};
|
|
1176
1201
|
return { series: styleSeries(panel, series, frames, scheme), xConfig };
|
|
1177
1202
|
}
|
|
1178
1203
|
function styleSeries(panel, series, frames, scheme) {
|
|
1179
1204
|
const frameOf = /* @__PURE__ */ new Map();
|
|
1180
1205
|
frames.forEach((f) => f.fields.forEach((field) => frameOf.set(field, f)));
|
|
1181
1206
|
return series.map((s, i) => {
|
|
1182
|
-
const config =
|
|
1183
|
-
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) };
|
|
1184
1209
|
});
|
|
1185
1210
|
}
|
|
1186
1211
|
function reducedValues(panel, frames, scheme) {
|
|
@@ -1188,30 +1213,30 @@ function reducedValues(panel, frames, scheme) {
|
|
|
1188
1213
|
const out = [];
|
|
1189
1214
|
const multiple = frames.length > 1;
|
|
1190
1215
|
frames.forEach(
|
|
1191
|
-
(frame, fi) =>
|
|
1192
|
-
const raw =
|
|
1193
|
-
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);
|
|
1194
1219
|
const values = field.values.map((v) => v == null ? null : Number(v));
|
|
1195
|
-
const value =
|
|
1196
|
-
const color =
|
|
1197
|
-
const step =
|
|
1198
|
-
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);
|
|
1199
1224
|
out.push({
|
|
1200
1225
|
key: `${fi}/${field.name}/${JSON.stringify(_nullishCoalesce(field.labels, () => ( {})))}`,
|
|
1201
1226
|
name: _nullishCoalesce(config.displayName, () => ( raw)),
|
|
1202
1227
|
value,
|
|
1203
|
-
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) ||
|
|
1228
|
+
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) || _chunkYUXA7I4Jjs.formatValue.call(void 0, value, config),
|
|
1204
1229
|
mapped,
|
|
1205
1230
|
config,
|
|
1206
1231
|
color,
|
|
1207
|
-
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,
|
|
1208
1233
|
sparkline: values,
|
|
1209
1234
|
field,
|
|
1210
1235
|
frame
|
|
1211
1236
|
});
|
|
1212
1237
|
})
|
|
1213
1238
|
);
|
|
1214
|
-
return
|
|
1239
|
+
return _chunkYUXA7I4Jjs.uniqueNames.call(void 0, out, (v) => v.field, frames);
|
|
1215
1240
|
}
|
|
1216
1241
|
function yDomain(series, includeZero) {
|
|
1217
1242
|
let min = Infinity;
|
|
@@ -1272,22 +1297,22 @@ function NoData({ message = "No data" }) {
|
|
|
1272
1297
|
}
|
|
1273
1298
|
function rowTooltipItems(panel, frame, row, multiple) {
|
|
1274
1299
|
return frame.fields.flatMap((f) => {
|
|
1275
|
-
const name =
|
|
1276
|
-
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);
|
|
1277
1302
|
if (_optionalChain([config, 'access', _36 => _36.custom, 'optionalAccess', _37 => _37.hideFrom, 'optionalAccess', _38 => _38.tooltip])) return [];
|
|
1278
1303
|
const v = f.values[row];
|
|
1279
|
-
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);
|
|
1280
1305
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), value }];
|
|
1281
1306
|
});
|
|
1282
1307
|
}
|
|
1283
1308
|
function rowLinks(panel, frame, row, multiple, resolve) {
|
|
1284
1309
|
return mergeLinks(
|
|
1285
1310
|
frame.fields.flatMap((f) => {
|
|
1286
|
-
const name =
|
|
1287
|
-
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);
|
|
1288
1313
|
if (!_optionalChain([config, 'access', _39 => _39.links, 'optionalAccess', _40 => _40.length])) return [];
|
|
1289
1314
|
const v = f.values[row];
|
|
1290
|
-
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);
|
|
1291
1316
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), links: resolve(config.links, { frame, row, field: f, fieldName: _nullishCoalesce(config.displayName, () => ( name)), value: v, text }) }];
|
|
1292
1317
|
})
|
|
1293
1318
|
);
|
|
@@ -1300,7 +1325,7 @@ function valueLinks(panel, v, resolve) {
|
|
|
1300
1325
|
fieldName: v.name,
|
|
1301
1326
|
seriesName: v.name,
|
|
1302
1327
|
value: v.value,
|
|
1303
|
-
text:
|
|
1328
|
+
text: _chunkYUXA7I4Jjs.formatValue.call(void 0, v.value, v.config),
|
|
1304
1329
|
calc: _nullishCoalesce(_optionalChain([panel, 'access', _44 => _44.options, 'optionalAccess', _45 => _45.reduceOptions, 'optionalAccess', _46 => _46.calcs, 'optionalAccess', _47 => _47[0]]), () => ( "lastNotNull"))
|
|
1305
1330
|
});
|
|
1306
1331
|
}
|
|
@@ -1445,15 +1470,15 @@ function NumberInput({ panel, value, onChange }) {
|
|
|
1445
1470
|
}
|
|
1446
1471
|
function DurationInput({ panel, value, onChange }) {
|
|
1447
1472
|
const theme = useDashTheme();
|
|
1448
|
-
const toDigits = (v) => typeof v === "number" ?
|
|
1473
|
+
const toDigits = (v) => typeof v === "number" ? _chunkYUXA7I4Jjs.formatClock.call(void 0, v).replace(/\D/g, "").replace(/^0+/, "") : "";
|
|
1449
1474
|
const [digits, setDigits] = _react.useState.call(void 0, toDigits(value));
|
|
1450
1475
|
const [syncedValue, setSyncedValue] = _react.useState.call(void 0, value);
|
|
1451
1476
|
if (value !== syncedValue) {
|
|
1452
1477
|
setSyncedValue(value);
|
|
1453
|
-
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));
|
|
1454
1479
|
}
|
|
1455
1480
|
const masked = digits ? maskClock(digits) : "";
|
|
1456
|
-
const invalid = !!digits &&
|
|
1481
|
+
const invalid = !!digits && _chunkYUXA7I4Jjs.parseClockDigits.call(void 0, digits) == null;
|
|
1457
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,
|
|
1458
1483
|
_reactnative.TextInput,
|
|
1459
1484
|
{
|
|
@@ -1461,7 +1486,7 @@ function DurationInput({ panel, value, onChange }) {
|
|
|
1461
1486
|
onChangeText: (t) => {
|
|
1462
1487
|
const d = t.replace(/\D/g, "").replace(/^0+/, "").slice(0, 6);
|
|
1463
1488
|
setDigits(d);
|
|
1464
|
-
onChange(
|
|
1489
|
+
onChange(_chunkYUXA7I4Jjs.parseClockDigits.call(void 0, d));
|
|
1465
1490
|
},
|
|
1466
1491
|
keyboardType: "number-pad",
|
|
1467
1492
|
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "00:00.00")),
|
|
@@ -1647,10 +1672,10 @@ function SuggestTextInput({ panel, value, onChange }) {
|
|
|
1647
1672
|
}, [store, metric, suggestWith]);
|
|
1648
1673
|
const withText = suggestWith ? form.value(suggestWith) : null;
|
|
1649
1674
|
const own = entries.filter((e) => e.metric === metric);
|
|
1650
|
-
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) : [];
|
|
1651
1676
|
const query = typed ? text : "";
|
|
1652
|
-
const fromScoped =
|
|
1653
|
-
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());
|
|
1654
1679
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles6.suggest, children: [
|
|
1655
1680
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1656
1681
|
_reactnative.TextInput,
|
|
@@ -1689,7 +1714,7 @@ function CounterInput({ panel }) {
|
|
|
1689
1714
|
const { metric, increment = 1, unit } = panel.options;
|
|
1690
1715
|
const [today, setToday] = _react.useState.call(void 0, 0);
|
|
1691
1716
|
_react.useEffect.call(void 0, () => {
|
|
1692
|
-
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)));
|
|
1693
1718
|
load();
|
|
1694
1719
|
return store.subscribe(load);
|
|
1695
1720
|
}, [store, metric]);
|
|
@@ -1755,6 +1780,100 @@ var styles6 = _reactnative.StyleSheet.create({
|
|
|
1755
1780
|
counterBtnText: { color: "#fff", fontSize: 18, fontWeight: "700" }
|
|
1756
1781
|
});
|
|
1757
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
|
+
|
|
1758
1877
|
// src/ui/panels/GaugePanels.tsx
|
|
1759
1878
|
|
|
1760
1879
|
|
|
@@ -1769,17 +1888,17 @@ function StatPanel({ panel, frames }) {
|
|
|
1769
1888
|
const theme = useDashTheme();
|
|
1770
1889
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1771
1890
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1772
|
-
const horizontal = _optionalChain([panel, 'access',
|
|
1773
|
-
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)) });
|
|
1774
1893
|
}
|
|
1775
1894
|
function StatTile({ v, showName, panel }) {
|
|
1776
1895
|
const theme = useDashTheme();
|
|
1777
1896
|
const [size, onLayout] = useLayout();
|
|
1778
|
-
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
1779
|
-
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;
|
|
1780
1899
|
const fontSize = Math.max(18, Math.min(56, size.height * (graph ? 0.4 : 0.5), size.width / 4.5));
|
|
1781
1900
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1782
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
1901
|
+
const hasLinks = !!_optionalChain([v, 'access', _70 => _70.config, 'access', _71 => _71.links, 'optionalAccess', _72 => _72.length]);
|
|
1783
1902
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1784
1903
|
_reactnative.Pressable,
|
|
1785
1904
|
{
|
|
@@ -1788,17 +1907,17 @@ function StatTile({ v, showName, panel }) {
|
|
|
1788
1907
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
1789
1908
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
1790
1909
|
style: ({ pressed }) => [
|
|
1791
|
-
|
|
1910
|
+
styles8.tile,
|
|
1792
1911
|
// With a sparkline, the number sits in the top half so the line runs beneath it.
|
|
1793
1912
|
graph && { justifyContent: "flex-start", paddingTop: 4 },
|
|
1794
1913
|
colorMode === "background" && { backgroundColor: withAlpha(v.stateColor, 0.14) },
|
|
1795
1914
|
pressed && { opacity: 0.7 }
|
|
1796
1915
|
],
|
|
1797
1916
|
children: [
|
|
1798
|
-
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 }] }),
|
|
1799
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 }),
|
|
1800
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1801
|
-
/* @__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 })
|
|
1802
1921
|
]
|
|
1803
1922
|
}
|
|
1804
1923
|
);
|
|
@@ -1813,7 +1932,7 @@ function Sparkline({ values, width, height, color }) {
|
|
|
1813
1932
|
values.forEach((v, i) => {
|
|
1814
1933
|
if (v != null) line += `${line ? "L" : "M"}${x(i)},${y(v)}`;
|
|
1815
1934
|
});
|
|
1816
|
-
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: [
|
|
1817
1936
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${line}L${width},${height}L0,${height}Z`, fill: color, opacity: 0.1 }),
|
|
1818
1937
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: line, stroke: color, strokeWidth: 2, fill: "none", strokeLinejoin: "round" })
|
|
1819
1938
|
] });
|
|
@@ -1822,7 +1941,7 @@ function withAlpha(hex, alpha) {
|
|
|
1822
1941
|
if (!/^#[0-9a-f]{6}$/i.test(hex)) return hex;
|
|
1823
1942
|
return `${hex}${Math.round(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
1824
1943
|
}
|
|
1825
|
-
var
|
|
1944
|
+
var styles8 = _reactnative.StyleSheet.create({
|
|
1826
1945
|
grid: { flex: 1, gap: 8 },
|
|
1827
1946
|
tile: { flex: 1, justifyContent: "center", paddingLeft: 12, borderRadius: 6, overflow: "hidden" },
|
|
1828
1947
|
accent: { position: "absolute", left: 0, top: 6, bottom: 6, width: 3, borderRadius: 2 },
|
|
@@ -1838,13 +1957,13 @@ function GaugePanel({ panel, frames }) {
|
|
|
1838
1957
|
const theme = useDashTheme();
|
|
1839
1958
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1840
1959
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1841
|
-
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)) });
|
|
1842
1961
|
}
|
|
1843
1962
|
function Gauge({ v, showName, panel }) {
|
|
1844
1963
|
const theme = useDashTheme();
|
|
1845
1964
|
const [size, onLayout] = useLayout();
|
|
1846
1965
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1847
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
1966
|
+
const hasLinks = !!_optionalChain([v, 'access', _73 => _73.config, 'access', _74 => _74.links, 'optionalAccess', _75 => _75.length]);
|
|
1848
1967
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
1849
1968
|
const max = _nullishCoalesce(v.config.max, () => ( 100));
|
|
1850
1969
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
@@ -1856,7 +1975,7 @@ function Gauge({ v, showName, panel }) {
|
|
|
1856
1975
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1857
1976
|
_reactnative.Pressable,
|
|
1858
1977
|
{
|
|
1859
|
-
style: ({ pressed }) => [
|
|
1978
|
+
style: ({ pressed }) => [styles9.fill, pressed && { opacity: 0.7 }],
|
|
1860
1979
|
onLayout,
|
|
1861
1980
|
disabled: !hasLinks,
|
|
1862
1981
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
@@ -1866,9 +1985,9 @@ function Gauge({ v, showName, panel }) {
|
|
|
1866
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" }),
|
|
1867
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" })
|
|
1868
1987
|
] }),
|
|
1869
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill,
|
|
1870
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1871
|
-
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 })
|
|
1872
1991
|
] })
|
|
1873
1992
|
]
|
|
1874
1993
|
}
|
|
@@ -1887,32 +2006,32 @@ function BarGaugePanel({ panel, frames }) {
|
|
|
1887
2006
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
1888
2007
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
1889
2008
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
1890
|
-
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) => {
|
|
1891
2010
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
1892
2011
|
const max = _nullishCoalesce(v.config.max, () => ( Math.max(...values.map((o) => _nullishCoalesce(o.value, () => ( 0))), 1)));
|
|
1893
2012
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
1894
|
-
const color = v.config.thresholds || _optionalChain([v, 'access',
|
|
1895
|
-
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]);
|
|
1896
2015
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1897
2016
|
_reactnative.Pressable,
|
|
1898
2017
|
{
|
|
1899
|
-
style: ({ pressed }) => [
|
|
2018
|
+
style: ({ pressed }) => [styles9.barRow, pressed && { opacity: 0.7 }],
|
|
1900
2019
|
disabled: !hasLinks,
|
|
1901
2020
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
1902
2021
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
1903
2022
|
children: [
|
|
1904
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1905
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1906
|
-
/* @__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 })
|
|
1907
2026
|
] }),
|
|
1908
|
-
/* @__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 }] }) })
|
|
1909
2028
|
]
|
|
1910
2029
|
},
|
|
1911
2030
|
v.key
|
|
1912
2031
|
);
|
|
1913
2032
|
}) });
|
|
1914
2033
|
}
|
|
1915
|
-
var
|
|
2034
|
+
var styles9 = _reactnative.StyleSheet.create({
|
|
1916
2035
|
fill: { flex: 1 },
|
|
1917
2036
|
row: { flex: 1, flexDirection: "row", gap: 8 },
|
|
1918
2037
|
center: { alignItems: "center", justifyContent: "center" },
|
|
@@ -1955,8 +2074,8 @@ var TILE_LAYERS = /* @__PURE__ */ new Set(["default", "carto", "esri-xyz", "xyz"
|
|
|
1955
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));
|
|
1956
2075
|
var stripTags = (html) => html.replace(/<[^>]*>/g, "").replace(/©/g, "\xA9").trim();
|
|
1957
2076
|
function tileSource(layer, scheme, retina = false) {
|
|
1958
|
-
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess',
|
|
1959
|
-
switch (_optionalChain([layer, 'optionalAccess',
|
|
2077
|
+
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess', _84 => _84.config]), () => ( {}));
|
|
2078
|
+
switch (_optionalChain([layer, 'optionalAccess', _85 => _85.type])) {
|
|
1960
2079
|
case "osm-standard":
|
|
1961
2080
|
return { url: (z, x, y) => `https://tile.openstreetmap.org/${z}/${x}/${y}.png`, maxZoom: 19, attribution: "\xA9 OpenStreetMap contributors" };
|
|
1962
2081
|
case "esri-xyz": {
|
|
@@ -2017,11 +2136,11 @@ var REGIONS = {
|
|
|
2017
2136
|
oceania: { lat: -10, lon: -140, zoom: 3 }
|
|
2018
2137
|
};
|
|
2019
2138
|
function zoomLimits(panel) {
|
|
2020
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2139
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _86 => _86.options, 'optionalAccess', _87 => _87.view]), () => ( {}));
|
|
2021
2140
|
return [_nullishCoalesce(v.minZoom, () => ( 0)), _nullishCoalesce(v.maxZoom, () => ( MAX_ZOOM))];
|
|
2022
2141
|
}
|
|
2023
2142
|
function initialView(panel, layers, width, height) {
|
|
2024
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2143
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _88 => _88.options, 'optionalAccess', _89 => _89.view]), () => ( {}));
|
|
2025
2144
|
const [minZoom, maxZoom] = zoomLimits(panel);
|
|
2026
2145
|
const limit = (view) => ({ ...view, zoom: clamp(view.zoom, minZoom, maxZoom) });
|
|
2027
2146
|
if (v.id === "coords") return limit({ lat: _nullishCoalesce(v.lat, () => ( 0)), lon: _nullishCoalesce(v.lon, () => ( 0)), zoom: _nullishCoalesce(v.zoom, () => ( 1)) });
|
|
@@ -2054,7 +2173,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2054
2173
|
const o = _nullishCoalesce(panel.options, () => ( {}));
|
|
2055
2174
|
const out = [];
|
|
2056
2175
|
const basemap = o.basemap;
|
|
2057
|
-
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) });
|
|
2058
2177
|
const multiple = frames.length > 1;
|
|
2059
2178
|
(_nullishCoalesce(o.layers, () => ( DEFAULT_LAYERS))).forEach((layer, li) => {
|
|
2060
2179
|
const key = `${li}/${layer.type}`;
|
|
@@ -2067,12 +2186,12 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2067
2186
|
}
|
|
2068
2187
|
if (!isDataLayer(layer.type)) return;
|
|
2069
2188
|
const filter = layer.filterData;
|
|
2070
|
-
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;
|
|
2071
2190
|
const style = _nullishCoalesce(config.style, () => ( {}));
|
|
2072
2191
|
const color = _nullishCoalesce(style.color, () => ( {}));
|
|
2073
2192
|
const size = _nullishCoalesce(style.size, () => ( {}));
|
|
2074
2193
|
const text = style.text;
|
|
2075
|
-
const fixedColor =
|
|
2194
|
+
const fixedColor = _chunkYUXA7I4Jjs.resolveColor.call(void 0, _nullishCoalesce(color.fixed, () => ( "dark-green")), "#37872D");
|
|
2076
2195
|
const heat = layer.type === "heatmap";
|
|
2077
2196
|
const weight = _nullishCoalesce(config.weight, () => ( {}));
|
|
2078
2197
|
const legend = [];
|
|
@@ -2084,14 +2203,14 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2084
2203
|
let { xs, ys } = located;
|
|
2085
2204
|
if (layer.type === "lastPointTracker" && rows.length) [rows, xs, ys] = [rows.slice(-1), xs.slice(-1), ys.slice(-1)];
|
|
2086
2205
|
const find = (field) => field ? fieldByName(frame, field, multiple) : void 0;
|
|
2087
|
-
const configOf = (f) =>
|
|
2206
|
+
const configOf = (f) => _chunkYUXA7I4Jjs.resolveFieldConfig.call(void 0, panel, f, frame, _chunkYUXA7I4Jjs.fieldDisplayName.call(void 0, f, frame, multiple));
|
|
2088
2207
|
let colors = rows.map(() => fixedColor);
|
|
2089
2208
|
const colorField = !heat ? find(color.field) : void 0;
|
|
2090
2209
|
if (colorField) {
|
|
2091
2210
|
const cConfig = configOf(colorField);
|
|
2092
2211
|
const values = rows.map((i) => num(colorField.values[i]));
|
|
2093
2212
|
const extent = range(values);
|
|
2094
|
-
colors = values.map((v) =>
|
|
2213
|
+
colors = values.map((v) => _chunkYUXA7I4Jjs.valueColor.call(void 0, v, cConfig, fixedColor, extent));
|
|
2095
2214
|
if (showsLegend(layer) && legend.length === 0) legend.push(...thresholdLegend(`${key}/${frames.indexOf(frame)}`, cConfig, fixedColor));
|
|
2096
2215
|
}
|
|
2097
2216
|
const dim = heat ? weight : size;
|
|
@@ -2127,7 +2246,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2127
2246
|
name,
|
|
2128
2247
|
opacity,
|
|
2129
2248
|
points,
|
|
2130
|
-
symbol: markerSymbol(_optionalChain([style, 'access',
|
|
2249
|
+
symbol: markerSymbol(_optionalChain([style, 'access', _93 => _93.symbol, 'optionalAccess', _94 => _94.fixed])),
|
|
2131
2250
|
fillOpacity: _nullishCoalesce(style.opacity, () => ( 0.4)),
|
|
2132
2251
|
fontSize: _nullishCoalesce(textConfig.fontSize, () => ( 12)),
|
|
2133
2252
|
labelOffset: [_nullishCoalesce(textConfig.offsetX, () => ( 0)), _nullishCoalesce(textConfig.offsetY, () => ( 0))],
|
|
@@ -2138,37 +2257,37 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2138
2257
|
});
|
|
2139
2258
|
return out;
|
|
2140
2259
|
}
|
|
2141
|
-
var showsLegend = (layer) => _optionalChain([layer, 'access',
|
|
2260
|
+
var showsLegend = (layer) => _optionalChain([layer, 'access', _95 => _95.config, 'optionalAccess', _96 => _96.showLegend]) !== false;
|
|
2142
2261
|
function markerSymbol(path) {
|
|
2143
2262
|
const name = typeof path === "string" ? path.replace(/^.*\//, "").replace(/\.svg$/, "") : "";
|
|
2144
2263
|
return name === "square" || name === "triangle" || name === "star" || name === "cross" || name === "x" ? name : "circle";
|
|
2145
2264
|
}
|
|
2146
2265
|
function thresholdLegend(key, config, fallback) {
|
|
2147
|
-
if (_optionalChain([config, 'access',
|
|
2148
|
-
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]), () => ( []));
|
|
2149
2268
|
if (steps.length < 2) return [];
|
|
2150
2269
|
return steps.map((s, i) => ({
|
|
2151
2270
|
key: `${key}/${i}`,
|
|
2152
|
-
name: s.value == null ? `< ${
|
|
2153
|
-
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)
|
|
2154
2273
|
}));
|
|
2155
2274
|
}
|
|
2156
2275
|
var isDataLayer = (type) => type === "markers" || type === "heatmap" || type === "route" || type === "lastPointTracker";
|
|
2157
2276
|
var lookupField = (frame) => frame.fields.find((f) => f.name.toLowerCase() === "lookup");
|
|
2158
2277
|
function gazetteerPaths(panel, frames) {
|
|
2159
2278
|
const paths = /* @__PURE__ */ new Set();
|
|
2160
|
-
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))) {
|
|
2161
2280
|
if (!isDataLayer(layer.type)) continue;
|
|
2162
|
-
const mode = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
2163
|
-
if (mode === "lookup") paths.add(_optionalChain([layer, 'access',
|
|
2164
|
-
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);
|
|
2165
2284
|
}
|
|
2166
2285
|
return [...paths];
|
|
2167
2286
|
}
|
|
2168
2287
|
var LAT_NAMES = ["lat", "latitude"];
|
|
2169
2288
|
var LON_NAMES = ["lon", "lng", "long", "longitude"];
|
|
2170
2289
|
function fieldByName(frame, name, multiple) {
|
|
2171
|
-
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)));
|
|
2172
2291
|
}
|
|
2173
2292
|
function locate2(frame, location = {}, gazetteers = {}) {
|
|
2174
2293
|
const mode = _nullishCoalesce(location.mode, () => ( "auto"));
|
|
@@ -2187,10 +2306,10 @@ function locate2(frame, location = {}, gazetteers = {}) {
|
|
|
2187
2306
|
lat = named(LAT_NAMES);
|
|
2188
2307
|
lon = named(LON_NAMES);
|
|
2189
2308
|
if (!lat || !lon) hash = named(["geohash"]);
|
|
2190
|
-
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[
|
|
2309
|
+
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[_chunkYUXA7I4Jjs.DEFAULT_GAZETTEER]];
|
|
2191
2310
|
} else if (mode === "lookup") {
|
|
2192
2311
|
lookup = location.lookup ? fieldByName(frame, location.lookup, false) : lookupField(frame);
|
|
2193
|
-
gazetteer = gazetteers[location.gazetteer ||
|
|
2312
|
+
gazetteer = gazetteers[location.gazetteer || _chunkYUXA7I4Jjs.DEFAULT_GAZETTEER];
|
|
2194
2313
|
}
|
|
2195
2314
|
const rows = [];
|
|
2196
2315
|
const xs = [];
|
|
@@ -2239,8 +2358,8 @@ function decodeGeohash(hash) {
|
|
|
2239
2358
|
}
|
|
2240
2359
|
function cellText(field, v, config) {
|
|
2241
2360
|
if (v == null) return "";
|
|
2242
|
-
if (field.type === "number") return
|
|
2243
|
-
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();
|
|
2244
2363
|
return String(v);
|
|
2245
2364
|
}
|
|
2246
2365
|
function num(v) {
|
|
@@ -2380,13 +2499,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2380
2499
|
])
|
|
2381
2500
|
);
|
|
2382
2501
|
}, [layers, view, size.width, size.height]);
|
|
2383
|
-
const tooltips = _optionalChain([panel, 'access',
|
|
2502
|
+
const tooltips = _optionalChain([panel, 'access', _107 => _107.options, 'optionalAccess', _108 => _108.tooltip, 'optionalAccess', _109 => _109.mode]) !== "none";
|
|
2384
2503
|
const pick = (x, y) => {
|
|
2385
2504
|
let best = null;
|
|
2386
2505
|
let bestD = HIT_PX * HIT_PX;
|
|
2387
2506
|
for (const l of layers) {
|
|
2388
2507
|
if (l.type === "tiles" || l.type === "heatmap" || !l.tooltip) continue;
|
|
2389
|
-
_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) => {
|
|
2390
2509
|
for (let i = 0; i < px.length; i++) {
|
|
2391
2510
|
const d = (px[i] - x) ** 2 + (py[i] - y) ** 2;
|
|
2392
2511
|
if (d <= bestD) {
|
|
@@ -2436,12 +2555,12 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2436
2555
|
}
|
|
2437
2556
|
};
|
|
2438
2557
|
const shown = picked && resolvePicked(layers, screen, picked);
|
|
2439
|
-
const controls = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2558
|
+
const controls = _nullishCoalesce(_optionalChain([panel, 'access', _114 => _114.options, 'optionalAccess', _115 => _115.controls]), () => ( {}));
|
|
2440
2559
|
const attribution = [...new Set(layers.flatMap((l) => l.type === "tiles" && l.source.attribution ? [l.source.attribution] : []))].join(" ");
|
|
2441
2560
|
const legend = layers.flatMap((l) => l.type === "markers" || l.type === "route" ? l.legend : []);
|
|
2442
2561
|
const ready = size.width > 0 && size.height > 0;
|
|
2443
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2444
|
-
/* @__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: [
|
|
2445
2564
|
ready && // Nothing inside takes touches, so locationX/Y are always relative to the map.
|
|
2446
2565
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { pointerEvents: "none", style: _reactnative.StyleSheet.absoluteFill, children: [
|
|
2447
2566
|
layers.map(
|
|
@@ -2469,13 +2588,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2469
2588
|
onOpenLink: (l) => links.openLinks([l])
|
|
2470
2589
|
}
|
|
2471
2590
|
),
|
|
2472
|
-
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: [
|
|
2473
2592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "+", onPress: () => zoomTo(view, Math.round(view.zoom) + 1) }),
|
|
2474
2593
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u2212", onPress: () => zoomTo(view, Math.round(view.zoom) - 1) }),
|
|
2475
2594
|
moved && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u27F2", onPress: () => setMoved(null) })
|
|
2476
2595
|
] }),
|
|
2477
|
-
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2478
|
-
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
|
|
2479
2598
|
] }),
|
|
2480
2599
|
legend.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: legend })
|
|
2481
2600
|
] });
|
|
@@ -2490,17 +2609,17 @@ function useGazetteers(panel, frames) {
|
|
|
2490
2609
|
let live = true;
|
|
2491
2610
|
let ds;
|
|
2492
2611
|
try {
|
|
2493
|
-
ds = _optionalChain([resolve, 'optionalCall',
|
|
2612
|
+
ds = _optionalChain([resolve, 'optionalCall', _116 => _116(_chunkYUXA7I4Jjs.normalizeRef.call(void 0, panel.datasource))]);
|
|
2494
2613
|
} catch (e5) {
|
|
2495
2614
|
}
|
|
2496
2615
|
const paths = key.split("\n");
|
|
2497
|
-
Promise.allSettled(paths.map((p) =>
|
|
2616
|
+
Promise.allSettled(paths.map((p) => _chunkYUXA7I4Jjs.loadGazetteer.call(void 0, p, ds))).then((results) => {
|
|
2498
2617
|
if (!live) return;
|
|
2499
2618
|
const gazetteers = {};
|
|
2500
2619
|
const errors = [];
|
|
2501
2620
|
results.forEach((r, i) => {
|
|
2502
2621
|
if (r.status === "fulfilled") gazetteers[paths[i]] = r.value;
|
|
2503
|
-
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))}`);
|
|
2504
2623
|
});
|
|
2505
2624
|
setState({ key, gazetteers, error: errors.join("\n") || void 0 });
|
|
2506
2625
|
});
|
|
@@ -2512,7 +2631,7 @@ function useGazetteers(panel, frames) {
|
|
|
2512
2631
|
}
|
|
2513
2632
|
function MapButton({ label, onPress }) {
|
|
2514
2633
|
const theme = useDashTheme();
|
|
2515
|
-
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 }) });
|
|
2516
2635
|
}
|
|
2517
2636
|
function Tiles({ layer, view, width, height }) {
|
|
2518
2637
|
const tiles = visibleTiles(layer.source, view, width, height);
|
|
@@ -2552,7 +2671,7 @@ function markerPaths(layer, screen, width, height, textColor) {
|
|
|
2552
2671
|
if (px[i] < -r || px[i] > width + r || py[i] < -r || py[i] > height + r) continue;
|
|
2553
2672
|
const parts = _nullishCoalesce(byColor.get(p.colors[i]), () => ( byColor.set(p.colors[i], []).get(p.colors[i])));
|
|
2554
2673
|
parts.push(symbolPath(layer.symbol, px[i], py[i], r));
|
|
2555
|
-
const label = _optionalChain([p, 'access',
|
|
2674
|
+
const label = _optionalChain([p, 'access', _119 => _119.labels, 'optionalAccess', _120 => _120[i]]);
|
|
2556
2675
|
if (label && labels.length < MAX_LABELS)
|
|
2557
2676
|
labels.push(
|
|
2558
2677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2591,7 +2710,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2591
2710
|
const layer = layers.find((l) => l.key === picked.layer);
|
|
2592
2711
|
if (!layer || layer.type !== "markers" && layer.type !== "route") return null;
|
|
2593
2712
|
const p = layer.points[picked.group];
|
|
2594
|
-
const s = _optionalChain([screen, 'access',
|
|
2713
|
+
const s = _optionalChain([screen, 'access', _121 => _121.get, 'call', _122 => _122(layer.key), 'optionalAccess', _123 => _123[picked.group]]);
|
|
2595
2714
|
if (!p || !s || picked.index >= p.rows.length) return null;
|
|
2596
2715
|
return {
|
|
2597
2716
|
layer,
|
|
@@ -2603,7 +2722,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2603
2722
|
py: s.py[picked.index]
|
|
2604
2723
|
};
|
|
2605
2724
|
}
|
|
2606
|
-
var
|
|
2725
|
+
var styles10 = _reactnative.StyleSheet.create({
|
|
2607
2726
|
fill: { flex: 1 },
|
|
2608
2727
|
map: { overflow: "hidden", borderRadius: 4 },
|
|
2609
2728
|
zoom: { position: "absolute", top: 6, left: 6, gap: 4 },
|
|
@@ -2629,7 +2748,7 @@ var styles9 = _reactnative.StyleSheet.create({
|
|
|
2629
2748
|
var DEFAULT_WIDTH = 120;
|
|
2630
2749
|
function cellType(config) {
|
|
2631
2750
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2632
|
-
const type = _nullishCoalesce(_optionalChain([custom, 'access',
|
|
2751
|
+
const type = _nullishCoalesce(_optionalChain([custom, 'access', _124 => _124.cellOptions, 'optionalAccess', _125 => _125.type]), () => ( custom.displayMode));
|
|
2633
2752
|
if (type === "color-text" || type === "color-background" || type === "gauge") return type;
|
|
2634
2753
|
if (type === "color-background-solid") return "color-background";
|
|
2635
2754
|
if (type === "gradient-gauge" || type === "lcd-gauge" || type === "basic") return "gauge";
|
|
@@ -2637,10 +2756,10 @@ function cellType(config) {
|
|
|
2637
2756
|
}
|
|
2638
2757
|
function tableColumns(panel, frame, multipleFrames = false) {
|
|
2639
2758
|
return frame.fields.flatMap((field, i) => {
|
|
2640
|
-
const raw =
|
|
2641
|
-
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);
|
|
2642
2761
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2643
|
-
if (custom.hidden || _optionalChain([custom, 'access',
|
|
2762
|
+
if (custom.hidden || _optionalChain([custom, 'access', _126 => _126.hideFrom, 'optionalAccess', _127 => _127.viz])) return [];
|
|
2644
2763
|
const numeric = field.type === "number";
|
|
2645
2764
|
const align = custom.align === "left" || custom.align === "center" || custom.align === "right" ? custom.align : numeric ? "right" : "left";
|
|
2646
2765
|
const type = cellType(config);
|
|
@@ -2653,8 +2772,8 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2653
2772
|
width: Math.max(Number(custom.width) || DEFAULT_WIDTH, Number(custom.minWidth) || 0),
|
|
2654
2773
|
align,
|
|
2655
2774
|
cellType: type,
|
|
2656
|
-
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access',
|
|
2657
|
-
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]),
|
|
2658
2777
|
extent: numeric ? extentOf(field.values) : void 0,
|
|
2659
2778
|
reducers: footerReducers(panel, config, [field.name, _nullishCoalesce(config.displayName, () => ( raw))])
|
|
2660
2779
|
}
|
|
@@ -2662,11 +2781,11 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2662
2781
|
});
|
|
2663
2782
|
}
|
|
2664
2783
|
function footerReducers(panel, config, names) {
|
|
2665
|
-
const own = _optionalChain([config, 'access',
|
|
2666
|
-
if (_optionalChain([own, 'optionalAccess',
|
|
2667
|
-
const legacy = _optionalChain([panel, 'access',
|
|
2668
|
-
if (!_optionalChain([legacy, 'optionalAccess',
|
|
2669
|
-
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"];
|
|
2670
2789
|
if (legacy.countRows && reducer[0] === "count") return ["countAll"];
|
|
2671
2790
|
const fields = Array.isArray(legacy.fields) ? legacy.fields : legacy.fields ? [legacy.fields] : [];
|
|
2672
2791
|
return !fields.length || names.some((n) => fields.includes(n)) ? reducer : [];
|
|
@@ -2681,16 +2800,16 @@ function tableFooter(columns) {
|
|
|
2681
2800
|
counted = true;
|
|
2682
2801
|
return [{ label: "Count", text: String(c.field.values.length) }];
|
|
2683
2802
|
}
|
|
2684
|
-
if (!
|
|
2685
|
-
const label =
|
|
2803
|
+
if (!_chunkYUXA7I4Jjs.isReducer.call(void 0, r)) return [];
|
|
2804
|
+
const label = _chunkYUXA7I4Jjs.REDUCER_LABELS[r];
|
|
2686
2805
|
if (r === "count") return [{ label, text: String(c.field.values.length) }];
|
|
2687
2806
|
if (c.field.type !== "number") {
|
|
2688
2807
|
if (r === "distinctCount") return [{ label, text: String(new Set(c.field.values.filter((v) => v != null)).size) }];
|
|
2689
2808
|
return [];
|
|
2690
2809
|
}
|
|
2691
|
-
const value =
|
|
2810
|
+
const value = _chunkYUXA7I4Jjs.reduce.call(void 0, c.field.values.map((v) => v == null ? null : Number(v)), r);
|
|
2692
2811
|
const counts = r === "distinctCount" || r === "changeCount";
|
|
2693
|
-
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) }];
|
|
2694
2813
|
});
|
|
2695
2814
|
return lines.length === 1 && lines[0].label !== "Count" ? [{ text: lines[0].text }] : lines;
|
|
2696
2815
|
});
|
|
@@ -2709,17 +2828,17 @@ function extentOf(values) {
|
|
|
2709
2828
|
}
|
|
2710
2829
|
function cellDisplay(col, raw, fallbackColor) {
|
|
2711
2830
|
const { config, field } = col;
|
|
2712
|
-
const mapped =
|
|
2831
|
+
const mapped = _chunkYUXA7I4Jjs.mappedResult.call(void 0, raw, config);
|
|
2713
2832
|
const num4 = field.type === "number" && raw != null && Number.isFinite(Number(raw)) ? Number(raw) : null;
|
|
2714
|
-
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))));
|
|
2715
2834
|
if (col.cellType === "auto") return { text };
|
|
2716
|
-
const mode = _optionalChain([config, 'access',
|
|
2717
|
-
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
2718
|
-
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);
|
|
2719
2838
|
if (col.cellType === "color-text") return { text, color };
|
|
2720
2839
|
if (col.cellType === "color-background") return { text, background: color };
|
|
2721
|
-
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access',
|
|
2722
|
-
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));
|
|
2723
2842
|
const gauge = num4 == null ? void 0 : Math.min(1, Math.max(0, (num4 - min) / (max - min || 1)));
|
|
2724
2843
|
return { text, gauge, gaugeColor: color };
|
|
2725
2844
|
}
|
|
@@ -2732,12 +2851,12 @@ function contrastText(background, fallback) {
|
|
|
2732
2851
|
return lum > 0.55 ? "#111111" : "#ffffff";
|
|
2733
2852
|
}
|
|
2734
2853
|
function initialSort(panel, columns) {
|
|
2735
|
-
const first = _optionalChain([panel, 'access',
|
|
2736
|
-
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;
|
|
2737
2856
|
return col ? { key: col.key, desc: !!first.desc } : null;
|
|
2738
2857
|
}
|
|
2739
2858
|
function nextSort(current, key) {
|
|
2740
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
2859
|
+
if (_optionalChain([current, 'optionalAccess', _157 => _157.key]) !== key) return { key, desc: false };
|
|
2741
2860
|
return current.desc ? null : { key, desc: true };
|
|
2742
2861
|
}
|
|
2743
2862
|
function sortedRows(columns, length, sort) {
|
|
@@ -2746,7 +2865,7 @@ function sortedRows(columns, length, sort) {
|
|
|
2746
2865
|
if (!col) return rows;
|
|
2747
2866
|
const { field } = col;
|
|
2748
2867
|
const dir = sort.desc ? -1 : 1;
|
|
2749
|
-
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;
|
|
2750
2869
|
const empty = (v) => v == null || v === "" || typeof v === "number" && Number.isNaN(v);
|
|
2751
2870
|
return rows.sort((a, b) => {
|
|
2752
2871
|
const va = field.values[a];
|
|
@@ -2772,7 +2891,7 @@ function PieChartPanel({ panel, frames }) {
|
|
|
2772
2891
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2773
2892
|
const total = values.reduce((a, v) => a + (_nullishCoalesce(v.value, () => ( 0))), 0);
|
|
2774
2893
|
const r = Math.min(size.width, size.height) / 2 - 2;
|
|
2775
|
-
const inner = _optionalChain([panel, 'access',
|
|
2894
|
+
const inner = _optionalChain([panel, 'access', _158 => _158.options, 'optionalAccess', _159 => _159.pieType]) === "pie" ? 0 : r * 0.62;
|
|
2776
2895
|
const cx = size.width / 2;
|
|
2777
2896
|
const cy = size.height / 2;
|
|
2778
2897
|
const gap = values.length > 1 ? 0.02 : 0;
|
|
@@ -2783,8 +2902,8 @@ function PieChartPanel({ panel, frames }) {
|
|
|
2783
2902
|
slices.push({ key: v.key, d: donutSlice(cx, cy, r, inner, angle + gap / 2, angle + sweep - gap / 2), color: v.color });
|
|
2784
2903
|
angle += sweep;
|
|
2785
2904
|
}
|
|
2786
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2787
|
-
/* @__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)) }) }),
|
|
2788
2907
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2789
2908
|
Legend,
|
|
2790
2909
|
{
|
|
@@ -2812,15 +2931,15 @@ function TablePanel({ panel, frames }) {
|
|
|
2812
2931
|
const columns = _react.useMemo.call(void 0, () => frame ? tableColumns(panel, frame, frames.length > 1) : [], [panel, frame, frames.length]);
|
|
2813
2932
|
const [tapped, setSort] = _react.useState.call(void 0, );
|
|
2814
2933
|
const sort = tapped === void 0 ? initialSort(panel, columns) : tapped;
|
|
2815
|
-
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ?
|
|
2816
|
-
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, {});
|
|
2817
2936
|
const shown = order.slice(0, 500);
|
|
2818
2937
|
const rowColumn = columns.find((c) => c.applyToRow);
|
|
2819
2938
|
const footer = tableFooter(columns);
|
|
2820
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2821
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style:
|
|
2822
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2823
|
-
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;
|
|
2824
2943
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2825
2944
|
_reactnative.Pressable,
|
|
2826
2945
|
{
|
|
@@ -2829,7 +2948,7 @@ function TablePanel({ panel, frames }) {
|
|
|
2829
2948
|
accessibilityLabel: `Sort by ${c.name}`,
|
|
2830
2949
|
accessibilityState: { selected: active },
|
|
2831
2950
|
style: { width: c.width },
|
|
2832
|
-
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: [
|
|
2833
2952
|
c.name,
|
|
2834
2953
|
active ? sort.desc ? " \u2193" : " \u2191" : ""
|
|
2835
2954
|
] })
|
|
@@ -2839,12 +2958,12 @@ function TablePanel({ panel, frames }) {
|
|
|
2839
2958
|
}) }),
|
|
2840
2959
|
shown.map((i) => {
|
|
2841
2960
|
const rowBg = rowColumn ? cellDisplay(rowColumn, rowColumn.field.values[i], theme.accent).background : void 0;
|
|
2842
|
-
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) => {
|
|
2843
2962
|
const d = cellDisplay(c, c.field.values[i], theme.accent);
|
|
2844
2963
|
const bg = _nullishCoalesce(d.background, () => ( rowBg));
|
|
2845
|
-
const linked = !!_optionalChain([c, 'access',
|
|
2964
|
+
const linked = !!_optionalChain([c, 'access', _161 => _161.config, 'access', _162 => _162.links, 'optionalAccess', _163 => _163.length]);
|
|
2846
2965
|
const color = _nullishCoalesce(d.color, () => ( (bg ? contrastText(bg, theme.text) : linked ? theme.accent : theme.text)));
|
|
2847
|
-
const cellStyle = [
|
|
2966
|
+
const cellStyle = [styles11.td, { width: c.width }, d.background ? { backgroundColor: d.background } : null];
|
|
2848
2967
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2849
2968
|
_reactnative.Pressable,
|
|
2850
2969
|
{
|
|
@@ -2856,8 +2975,8 @@ function TablePanel({ panel, frames }) {
|
|
|
2856
2975
|
accessibilityRole: linked ? "link" : void 0,
|
|
2857
2976
|
style: ({ pressed }) => [cellStyle, pressed && { opacity: 0.6 }],
|
|
2858
2977
|
children: [
|
|
2859
|
-
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2860
|
-
/* @__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 })
|
|
2861
2980
|
]
|
|
2862
2981
|
},
|
|
2863
2982
|
c.key
|
|
@@ -2865,7 +2984,7 @@ function TablePanel({ panel, frames }) {
|
|
|
2865
2984
|
}) }, i);
|
|
2866
2985
|
})
|
|
2867
2986
|
] }),
|
|
2868
|
-
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: [
|
|
2869
2988
|
line.label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted, fontWeight: "400" }, children: `${line.label} ` }) : null,
|
|
2870
2989
|
line.text
|
|
2871
2990
|
] }, li)) }, c.key)) })
|
|
@@ -2873,12 +2992,12 @@ function TablePanel({ panel, frames }) {
|
|
|
2873
2992
|
}
|
|
2874
2993
|
function TextPanel({ panel }) {
|
|
2875
2994
|
const theme = useDashTheme();
|
|
2876
|
-
const raw = _optionalChain([panel, 'access',
|
|
2995
|
+
const raw = _optionalChain([panel, 'access', _164 => _164.options, 'optionalAccess', _165 => _165.content]);
|
|
2877
2996
|
const content = typeof raw === "string" ? raw : "";
|
|
2878
|
-
const text = _optionalChain([panel, 'access',
|
|
2997
|
+
const text = _optionalChain([panel, 'access', _166 => _166.options, 'optionalAccess', _167 => _167.mode]) === "html" ? content.replace(/<[^>]+>/g, "") : content;
|
|
2879
2998
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { children: text.split(/\n{2,}/).map((block, i) => {
|
|
2880
2999
|
const heading = /^#{1,6}\s+/.test(block);
|
|
2881
|
-
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);
|
|
2882
3001
|
}) });
|
|
2883
3002
|
}
|
|
2884
3003
|
function BarChartPanel({ panel, frames, width }) {
|
|
@@ -2888,13 +3007,13 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2888
3007
|
const frame = frames[0];
|
|
2889
3008
|
const category = frame && barCategory(panel, frame);
|
|
2890
3009
|
if (!frame || !values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2891
|
-
const xField = _optionalChain([panel, 'access',
|
|
3010
|
+
const xField = _optionalChain([panel, 'access', _168 => _168.options, 'optionalAccess', _169 => _169.xField]);
|
|
2892
3011
|
if (xField && !category) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No field named \u201C${String(xField)}\u201D` });
|
|
2893
3012
|
const allNumeric = frame.fields.filter((f) => f.type === "number");
|
|
2894
3013
|
const at = (f) => values[allNumeric.indexOf(f)];
|
|
2895
3014
|
const numeric = category ? allNumeric.filter((f) => f !== category) : [];
|
|
2896
3015
|
if (category && !numeric.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No number fields to draw besides \u201C${category.name}\u201D` });
|
|
2897
|
-
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) }];
|
|
2898
3017
|
const labels = category ? categoryLabels(category) : values.map((v) => v.name);
|
|
2899
3018
|
const colorAt = (fi, i) => category ? fields[fi].color : values[i].color;
|
|
2900
3019
|
const axes = barAxes(
|
|
@@ -2908,34 +3027,34 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2908
3027
|
const gridAxis = _nullishCoalesce(left, () => ( right));
|
|
2909
3028
|
const plotW = width - (left ? AXIS_W : 0) - (right ? AXIS_W : 0);
|
|
2910
3029
|
const every = Math.max(1, Math.ceil(labels.length / Math.max(1, Math.floor(plotW / 44))));
|
|
2911
|
-
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,
|
|
2912
3031
|
_reactnative.Text,
|
|
2913
3032
|
{
|
|
2914
|
-
style: [
|
|
3033
|
+
style: [styles11.tick, { color: theme.textMuted, top: plot.height * (1 - barFraction(axis, t)) - 7 }, axis.side === "left" ? styles11.tickLeft : styles11.tickRight],
|
|
2915
3034
|
numberOfLines: 1,
|
|
2916
|
-
children:
|
|
3035
|
+
children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...axis.config, decimals: tickDecimals(axis.ticks) })
|
|
2917
3036
|
},
|
|
2918
3037
|
t
|
|
2919
3038
|
)) });
|
|
2920
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2921
|
-
(_optionalChain([left, 'optionalAccess',
|
|
2922
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2923
|
-
/* @__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]), () => ( "")) })
|
|
2924
3043
|
] }),
|
|
2925
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3044
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.barRow, children: [
|
|
2926
3045
|
left && axisColumn(left),
|
|
2927
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2928
|
-
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2929
|
-
/* @__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) => {
|
|
2930
3049
|
const axis = axisOf(fi);
|
|
2931
3050
|
const base = barFraction(axis, Math.min(Math.max(0, axis.bottom), axis.top));
|
|
2932
3051
|
const end = barFraction(axis, _nullishCoalesce(f.values[i], () => ( 0)));
|
|
2933
|
-
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,
|
|
2934
3053
|
_reactnative.View,
|
|
2935
3054
|
{
|
|
2936
3055
|
style: [
|
|
2937
|
-
|
|
2938
|
-
end < base &&
|
|
3056
|
+
styles11.bar,
|
|
3057
|
+
end < base && styles11.barDown,
|
|
2939
3058
|
{ bottom: `${Math.min(base, end) * 100}%`, height: `${Math.abs(end - base) * 100}%`, backgroundColor: colorAt(fi, i) }
|
|
2940
3059
|
]
|
|
2941
3060
|
}
|
|
@@ -2944,7 +3063,7 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
2944
3063
|
] }),
|
|
2945
3064
|
right && axisColumn(right)
|
|
2946
3065
|
] }),
|
|
2947
|
-
/* @__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)) }),
|
|
2948
3067
|
category && fields.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: fields })
|
|
2949
3068
|
] });
|
|
2950
3069
|
}
|
|
@@ -2957,7 +3076,7 @@ function num2(v) {
|
|
|
2957
3076
|
function UnsupportedPanel({ panel }) {
|
|
2958
3077
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `"${panel.type}" panels aren't supported yet` });
|
|
2959
3078
|
}
|
|
2960
|
-
var
|
|
3079
|
+
var styles11 = _reactnative.StyleSheet.create({
|
|
2961
3080
|
fill: { flex: 1 },
|
|
2962
3081
|
tr: { flexDirection: "row", borderBottomWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
2963
3082
|
th: { paddingVertical: 6, paddingHorizontal: 6, fontSize: 12, fontWeight: "600" },
|
|
@@ -3016,9 +3135,9 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3016
3135
|
[numericX, panel, frames, theme.scheme]
|
|
3017
3136
|
);
|
|
3018
3137
|
if (!series.length || series.every((s) => s.values.every((v) => v == null))) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3019
|
-
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")));
|
|
3020
3139
|
const anyBars = series.some((s) => style(s) === "bars");
|
|
3021
|
-
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);
|
|
3022
3141
|
const yTitle = series.map((s) => axisTitle(s.config)).find(Boolean);
|
|
3023
3142
|
const xTitle = numericX ? axisTitle(xConfig) : void 0;
|
|
3024
3143
|
const PAD = {
|
|
@@ -3039,7 +3158,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3039
3158
|
const y = linearScale(yMin, yMax, PAD.top + plotH, PAD.top);
|
|
3040
3159
|
const span = xTo - xFrom;
|
|
3041
3160
|
const xTicks = numericX ? numberTicks(xFrom, xTo, plotW) : timeTicks(xFrom, xTo, plotW);
|
|
3042
|
-
const xLabel = (t) => numericX ?
|
|
3161
|
+
const xLabel = (t) => numericX ? _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...xConfig, decimals: tickDecimals(xTicks) }) : formatTimeTick(t, span);
|
|
3043
3162
|
const unitConfig = series[0].config;
|
|
3044
3163
|
const barSeries = series.filter((s) => style(s) === "bars");
|
|
3045
3164
|
const pointsCount = Math.max(...series.map((s) => s.times.length));
|
|
@@ -3047,7 +3166,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3047
3166
|
const groupW = Math.min(slot * 0.8, BAR_MAX * barSeries.length);
|
|
3048
3167
|
const barW = Math.max(2, groupW / Math.max(barSeries.length, 1) - (barSeries.length > 1 ? 2 : 0));
|
|
3049
3168
|
const canPinch = plotW > 0;
|
|
3050
|
-
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;
|
|
3051
3170
|
const onPinchMove = (e) => {
|
|
3052
3171
|
const touches = _nullishCoalesce(e.nativeEvent.touches, () => ( []));
|
|
3053
3172
|
if (touches.length < 2) return;
|
|
@@ -3057,11 +3176,11 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3057
3176
|
if (!pinch.current) pinch.current = { start: { from: xFrom, to: xTo }, dist, frac };
|
|
3058
3177
|
const p = pinch.current;
|
|
3059
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) };
|
|
3060
|
-
setPreview(
|
|
3179
|
+
setPreview(_chunkYUXA7I4Jjs.zoomRange.call(void 0, p.start, dist / p.dist, p.frac, frac, limits));
|
|
3061
3180
|
};
|
|
3062
3181
|
const onPinchEnd = (commit) => {
|
|
3063
3182
|
if (commit && pinch.current && preview) {
|
|
3064
|
-
if (!extent) setRawRange({ from:
|
|
3183
|
+
if (!extent) setRawRange({ from: _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, preview.from), to: _chunkYUXA7I4Jjs.formatLocalDateTime.call(void 0, preview.to) });
|
|
3065
3184
|
else setXZoom(preview.to - preview.from >= extent[1] - extent[0] ? null : preview);
|
|
3066
3185
|
}
|
|
3067
3186
|
pinch.current = null;
|
|
@@ -3070,15 +3189,15 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3070
3189
|
const hover = hoverX == null || !touching && pinned !== id ? null : nearest(series, xFrom + (hoverX - PAD.left) / (plotW || 1) * span);
|
|
3071
3190
|
const hoverLinks = hover ? mergeLinks(
|
|
3072
3191
|
hover.rows.flatMap(
|
|
3073
|
-
(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)) }]
|
|
3074
3193
|
)
|
|
3075
3194
|
) : [];
|
|
3076
3195
|
const isPinned = !!hover && pinned === id;
|
|
3077
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3196
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3078
3197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3079
3198
|
_reactnative.View,
|
|
3080
3199
|
{
|
|
3081
|
-
style:
|
|
3200
|
+
style: styles12.fill,
|
|
3082
3201
|
onStartShouldSetResponderCapture: twoFingers,
|
|
3083
3202
|
onMoveShouldSetResponderCapture: twoFingers,
|
|
3084
3203
|
onResponderTerminationRequest: () => false,
|
|
@@ -3093,7 +3212,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3093
3212
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3094
3213
|
_reactnative.View,
|
|
3095
3214
|
{
|
|
3096
|
-
style:
|
|
3215
|
+
style: styles12.fill,
|
|
3097
3216
|
onLayout,
|
|
3098
3217
|
onStartShouldSetResponder: () => true,
|
|
3099
3218
|
onResponderGrant: (e) => {
|
|
@@ -3116,7 +3235,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3116
3235
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3117
3236
|
ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3118
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 }),
|
|
3119
|
-
/* @__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) }) })
|
|
3120
3239
|
] }, t)),
|
|
3121
3240
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3122
3241
|
_reactnativesvg.Text,
|
|
@@ -3142,12 +3261,12 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3142
3261
|
})
|
|
3143
3262
|
),
|
|
3144
3263
|
series.filter((s) => style(s) !== "bars").map((s) => {
|
|
3145
|
-
const fill = (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3146
|
-
const showPoints = style(s) === "points" || _optionalChain([s, 'access',
|
|
3147
|
-
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");
|
|
3148
3267
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3149
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}`)),
|
|
3150
|
-
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}`)),
|
|
3151
3270
|
showPoints && s.times.map(
|
|
3152
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)
|
|
3153
3272
|
)
|
|
@@ -3167,8 +3286,8 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3167
3286
|
onPress: () => setXZoom(null),
|
|
3168
3287
|
accessibilityRole: "button",
|
|
3169
3288
|
hitSlop: 8,
|
|
3170
|
-
style: ({ pressed }) => [
|
|
3171
|
-
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" })
|
|
3172
3291
|
}
|
|
3173
3292
|
),
|
|
3174
3293
|
hover && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3177,16 +3296,16 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3177
3296
|
pointerEvents: isPinned ? "auto" : "none",
|
|
3178
3297
|
onStartShouldSetResponder: () => isPinned,
|
|
3179
3298
|
style: [
|
|
3180
|
-
|
|
3299
|
+
styles12.tooltip,
|
|
3181
3300
|
{ backgroundColor: theme.surface, borderColor: theme.border },
|
|
3182
3301
|
x(hover.time) > size.width / 2 ? { right: size.width - x(hover.time) + 8 } : { left: x(hover.time) + 8 }
|
|
3183
3302
|
],
|
|
3184
3303
|
children: [
|
|
3185
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3186
|
-
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3187
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3188
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3189
|
-
/* @__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) })
|
|
3190
3309
|
] }, r.key)),
|
|
3191
3310
|
isPinned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipLinks, { links: hoverLinks, onOpen: (l) => openLinks([l]) })
|
|
3192
3311
|
]
|
|
@@ -3271,8 +3390,8 @@ function linkData(r, frames, xField) {
|
|
|
3271
3390
|
if (frame && xField === void 0) {
|
|
3272
3391
|
row = r.index;
|
|
3273
3392
|
} else if (frame) {
|
|
3274
|
-
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => (
|
|
3275
|
-
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)]);
|
|
3276
3395
|
row = at != null && at >= 0 ? at : void 0;
|
|
3277
3396
|
}
|
|
3278
3397
|
return {
|
|
@@ -3282,11 +3401,11 @@ function linkData(r, frames, xField) {
|
|
|
3282
3401
|
fieldName: r.name,
|
|
3283
3402
|
seriesName: r.name,
|
|
3284
3403
|
value: r.value,
|
|
3285
|
-
text:
|
|
3404
|
+
text: _chunkYUXA7I4Jjs.formatValue.call(void 0, r.value, r.config),
|
|
3286
3405
|
time: xField === void 0 ? r.time : void 0
|
|
3287
3406
|
};
|
|
3288
3407
|
}
|
|
3289
|
-
var
|
|
3408
|
+
var styles12 = _reactnative.StyleSheet.create({
|
|
3290
3409
|
fill: { flex: 1 },
|
|
3291
3410
|
tooltip: {
|
|
3292
3411
|
position: "absolute",
|
|
@@ -3327,14 +3446,14 @@ function mappings(panel) {
|
|
|
3327
3446
|
frame: frame(s.frame),
|
|
3328
3447
|
x: byName(s.x),
|
|
3329
3448
|
y: byName(s.y),
|
|
3330
|
-
color: byName(_optionalChain([s, 'access',
|
|
3331
|
-
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])),
|
|
3332
3451
|
sizeRange: s.pointSize,
|
|
3333
3452
|
name: { fixed: s.name }
|
|
3334
3453
|
}));
|
|
3335
3454
|
return { manual: true, series, exclude: [] };
|
|
3336
3455
|
}
|
|
3337
|
-
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]), () => ( [])) };
|
|
3338
3457
|
}
|
|
3339
3458
|
return { manual: o.mapping === "manual", series: _nullishCoalesce(o.series, () => ( [])), exclude: [] };
|
|
3340
3459
|
}
|
|
@@ -3343,11 +3462,11 @@ function xySeries(panel, frames, scheme) {
|
|
|
3343
3462
|
const { manual, series: maps, exclude } = mappings(panel);
|
|
3344
3463
|
const multiple = frames.length > 1;
|
|
3345
3464
|
const out = [];
|
|
3346
|
-
const config = (field, frame) =>
|
|
3347
|
-
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))) : [];
|
|
3348
3467
|
for (const [mi, m] of (maps.length ? maps : [{}]).entries()) {
|
|
3349
|
-
const matcher = _optionalChain([m, 'access',
|
|
3350
|
-
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;
|
|
3351
3470
|
for (const frame of chosen) {
|
|
3352
3471
|
const numeric = frame.fields.filter(isNumeric);
|
|
3353
3472
|
const xField = _nullishCoalesce(find(m.x, frame, numeric)[0], () => ( numeric[0]));
|
|
@@ -3358,41 +3477,41 @@ function xySeries(panel, frames, scheme) {
|
|
|
3358
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));
|
|
3359
3478
|
for (const yField of yFields) {
|
|
3360
3479
|
const yConfig = config(yField, frame);
|
|
3361
|
-
if (_optionalChain([yConfig, 'access',
|
|
3480
|
+
if (_optionalChain([yConfig, 'access', _226 => _226.custom, 'optionalAccess', _227 => _227.hideFrom, 'optionalAccess', _228 => _228.viz]) && !manual) continue;
|
|
3362
3481
|
const xConfig = config(xField, frame);
|
|
3363
|
-
const color =
|
|
3364
|
-
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;
|
|
3365
3484
|
const rows = [];
|
|
3366
3485
|
const xs = [];
|
|
3367
3486
|
const ys = [];
|
|
3368
3487
|
yField.values.forEach((yv, i) => {
|
|
3369
3488
|
const xv = xField.values[i];
|
|
3370
3489
|
if (xv == null || yv == null) return;
|
|
3371
|
-
const xn = xField.type === "time" ?
|
|
3372
|
-
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);
|
|
3373
3492
|
if (!Number.isFinite(xn) || !Number.isFinite(yn)) return;
|
|
3374
3493
|
rows.push(i);
|
|
3375
3494
|
xs.push(xn);
|
|
3376
3495
|
ys.push(yn);
|
|
3377
3496
|
});
|
|
3378
|
-
const pointSize = _optionalChain([yConfig, 'access',
|
|
3379
|
-
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));
|
|
3380
3499
|
let colors = rows.map(() => base);
|
|
3381
3500
|
if (colorField) {
|
|
3382
3501
|
const cConfig = config(colorField, frame);
|
|
3383
3502
|
const values = rows.map((i) => num3(colorField.values[i]));
|
|
3384
3503
|
const extent = range2(values);
|
|
3385
|
-
colors = values.map((v) =>
|
|
3504
|
+
colors = values.map((v) => _chunkYUXA7I4Jjs.valueColor.call(void 0, v, cConfig, base, extent));
|
|
3386
3505
|
}
|
|
3387
3506
|
let sizes = rows.map(() => fixedSize);
|
|
3388
3507
|
if (sizeField) {
|
|
3389
3508
|
const values = rows.map((i) => num3(sizeField.values[i]));
|
|
3390
3509
|
const [lo, hi] = _nullishCoalesce(range2(values), () => ( [0, 1]));
|
|
3391
|
-
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))];
|
|
3392
3511
|
sizes = values.map((v) => v == null ? min : min + (v - lo) / (hi - lo || 1) * (max - min));
|
|
3393
3512
|
}
|
|
3394
|
-
const fixedName = _optionalChain([m, 'access',
|
|
3395
|
-
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)));
|
|
3396
3515
|
out.push({
|
|
3397
3516
|
key: `${mi}/${frames.indexOf(frame)}/${yField.name}`,
|
|
3398
3517
|
name: fixedName ? yFields.length > 1 ? `${fixedName} ${yName}` : fixedName : yName,
|
|
@@ -3407,8 +3526,8 @@ function xySeries(panel, frames, scheme) {
|
|
|
3407
3526
|
ys,
|
|
3408
3527
|
colors,
|
|
3409
3528
|
sizes,
|
|
3410
|
-
show: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3411
|
-
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))
|
|
3412
3531
|
});
|
|
3413
3532
|
}
|
|
3414
3533
|
}
|
|
@@ -3459,10 +3578,10 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3459
3578
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3460
3579
|
const series = _react.useMemo.call(void 0, () => xySeries(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
3461
3580
|
const first = series[0];
|
|
3462
|
-
const showX = _optionalChain([first, 'optionalAccess',
|
|
3463
|
-
const showY = _optionalChain([first, 'optionalAccess',
|
|
3464
|
-
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3465
|
-
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;
|
|
3466
3585
|
const pad = {
|
|
3467
3586
|
top: EDGE,
|
|
3468
3587
|
right: EDGE,
|
|
@@ -3483,17 +3602,17 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3483
3602
|
if (!first || !layout || series.every((s) => !s.rows.length)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3484
3603
|
const xTicks = showX ? axisTicks(layout.x0, layout.x1, plotW < 220 ? 2 : plotW < 400 ? 3 : 5) : [];
|
|
3485
3604
|
const yTicks = showY ? axisTicks(layout.y0, layout.y1, plotH < 100 ? 2 : 4) : [];
|
|
3486
|
-
const gridX = _optionalChain([first, 'access',
|
|
3487
|
-
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;
|
|
3488
3607
|
const hover = touch && (touching || pinned === id) ? nearestPoint(series, layout.points, touch) : null;
|
|
3489
3608
|
const hoverLinks = hover ? rowLinks(panel, hover.series.frame, hover.series.rows[hover.index], frames.length > 1, resolve) : [];
|
|
3490
3609
|
const isPinned = !!hover && pinned === id;
|
|
3491
|
-
const legendItems = series.filter((s) => !_optionalChain([s, 'access',
|
|
3492
|
-
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: [
|
|
3493
3612
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3494
3613
|
_reactnative.View,
|
|
3495
3614
|
{
|
|
3496
|
-
style:
|
|
3615
|
+
style: styles13.fill,
|
|
3497
3616
|
onLayout,
|
|
3498
3617
|
onStartShouldSetResponder: () => true,
|
|
3499
3618
|
onResponderGrant: (e) => {
|
|
@@ -3515,7 +3634,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3515
3634
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3516
3635
|
yTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3517
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 }),
|
|
3518
|
-
/* @__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))) }) })
|
|
3519
3638
|
] }, `y${t}`)),
|
|
3520
3639
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3521
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 }),
|
|
@@ -3527,7 +3646,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3527
3646
|
fontSize: 10,
|
|
3528
3647
|
fill: theme.textMuted,
|
|
3529
3648
|
textAnchor: layout.x(t) - pad.left < 20 ? "start" : pad.left + plotW - layout.x(t) < 20 ? "end" : "middle",
|
|
3530
|
-
children:
|
|
3649
|
+
children: _chunkYUXA7I4Jjs.formatValue.call(void 0, t, { ...first.xConfig, decimals: _nullishCoalesce(first.xConfig.decimals, () => ( tickDecimals(xTicks))) })
|
|
3531
3650
|
}
|
|
3532
3651
|
)
|
|
3533
3652
|
] }, `x${t}`)),
|
|
@@ -3597,7 +3716,7 @@ function nearestPoint(series, points, at) {
|
|
|
3597
3716
|
});
|
|
3598
3717
|
return best;
|
|
3599
3718
|
}
|
|
3600
|
-
var
|
|
3719
|
+
var styles13 = _reactnative.StyleSheet.create({
|
|
3601
3720
|
fill: { flex: 1 }
|
|
3602
3721
|
});
|
|
3603
3722
|
|
|
@@ -3640,15 +3759,15 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3640
3759
|
const width = (measured.width || window.width) - insets.left - insets.right;
|
|
3641
3760
|
const layoutMode = mode === "auto" ? width >= TABLET_WIDTH ? "grid" : "phone" : mode;
|
|
3642
3761
|
const sections = _react.useMemo.call(void 0,
|
|
3643
|
-
() =>
|
|
3762
|
+
() => _chunkYUXA7I4Jjs.layoutDashboard.call(void 0, dashboard, layoutMode, { values: variables, info: variableInfo2 }),
|
|
3644
3763
|
[dashboard, layoutMode, variables, variableInfo2]
|
|
3645
3764
|
);
|
|
3646
3765
|
const [toggled, setToggled] = _react.useState.call(void 0, {});
|
|
3647
3766
|
const { seen, viewportH, onScroll, onViewportLayout, onSectionLayout } = useSeenSections(window.height);
|
|
3648
3767
|
const maxPanelH = Math.max(MIN_PANEL_H, viewportH - SIDE * 2);
|
|
3649
3768
|
const contentW = width - SIDE * 2;
|
|
3650
|
-
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) =>
|
|
3651
|
-
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: [
|
|
3652
3771
|
width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3653
3772
|
_reactnative.ScrollView,
|
|
3654
3773
|
{
|
|
@@ -3656,31 +3775,31 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3656
3775
|
onScrollBeginDrag: () => setPinned(null),
|
|
3657
3776
|
onLayout: onViewportLayout,
|
|
3658
3777
|
scrollEventThrottle: 100,
|
|
3659
|
-
contentContainerStyle: [
|
|
3778
|
+
contentContainerStyle: [styles14.content, { paddingLeft: SIDE + insets.left, paddingRight: SIDE + insets.right }],
|
|
3660
3779
|
keyboardShouldPersistTaps: "handled",
|
|
3661
3780
|
refreshControl: canRefresh ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.RefreshControl, { refreshing: false, onRefresh: refresh }) : void 0,
|
|
3662
3781
|
children: [
|
|
3663
3782
|
header,
|
|
3664
3783
|
sections.map((section) => {
|
|
3665
3784
|
const collapsed = _nullishCoalesce(toggled[section.key], () => ( section.collapsed));
|
|
3666
|
-
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: [
|
|
3667
3786
|
section.row && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3668
3787
|
_reactnative.Pressable,
|
|
3669
3788
|
{
|
|
3670
3789
|
onPress: () => setToggled((t) => ({ ...t, [section.key]: !collapsed })),
|
|
3671
|
-
style:
|
|
3790
|
+
style: styles14.rowHeader,
|
|
3672
3791
|
accessibilityRole: "button",
|
|
3673
3792
|
accessibilityState: { expanded: !collapsed },
|
|
3674
3793
|
children: [
|
|
3675
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3676
|
-
/* @__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 }) })
|
|
3677
3796
|
]
|
|
3678
3797
|
}
|
|
3679
3798
|
),
|
|
3680
3799
|
!collapsed && layoutMode === "grid" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GridSection, { grid: section.grid, width: contentW, maxPanelH, deferred: !seen.has(section.key) }),
|
|
3681
|
-
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3682
|
-
const w = (contentW + GAP) * (cell.span /
|
|
3683
|
-
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);
|
|
3684
3803
|
}) }, ri))
|
|
3685
3804
|
] }, section.key);
|
|
3686
3805
|
})
|
|
@@ -3691,10 +3810,10 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3691
3810
|
] });
|
|
3692
3811
|
}
|
|
3693
3812
|
function GridSection({ grid, width, maxPanelH, deferred }) {
|
|
3694
|
-
const colW = (width + GAP) /
|
|
3695
|
-
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)));
|
|
3696
3815
|
const scale = tallest > maxPanelH ? maxPanelH / tallest : 1;
|
|
3697
|
-
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)) });
|
|
3698
3817
|
}
|
|
3699
3818
|
function useSeenSections(viewportHeight) {
|
|
3700
3819
|
const [seen, setSeen] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
@@ -3743,26 +3862,27 @@ function PanelCard(props) {
|
|
|
3743
3862
|
}
|
|
3744
3863
|
function PanelError({ panel, width, height, error }) {
|
|
3745
3864
|
const theme = useDashTheme();
|
|
3746
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3747
|
-
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3748
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3749
|
-
/* @__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 })
|
|
3750
3869
|
] });
|
|
3751
3870
|
}
|
|
3752
3871
|
function PanelCardContent({ panel, width, height, deferred }) {
|
|
3753
3872
|
const theme = useDashTheme();
|
|
3754
3873
|
const { dashboard, variables, variableInfo: variableInfo2 } = useDashboard();
|
|
3755
3874
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3756
|
-
const
|
|
3875
|
+
const group = _chunkYUXA7I4Jjs.isInputGroup.call(void 0, panel);
|
|
3876
|
+
const input = _chunkYUXA7I4Jjs.isInputPanel.call(void 0, panel) || group;
|
|
3757
3877
|
const form = _react.useContext.call(void 0, InputFormContext);
|
|
3758
|
-
const problem =
|
|
3759
|
-
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]);
|
|
3760
3880
|
const hasTitle = !!panel.title || hasLinks || !!problem;
|
|
3761
|
-
const title = panel.title ?
|
|
3762
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3763
|
-
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3764
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3765
|
-
!!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 }),
|
|
3766
3886
|
hasLinks && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3767
3887
|
_reactnative.Pressable,
|
|
3768
3888
|
{
|
|
@@ -3770,28 +3890,28 @@ function PanelCardContent({ panel, width, height, deferred }) {
|
|
|
3770
3890
|
accessibilityRole: "button",
|
|
3771
3891
|
accessibilityLabel: panel.links.length === 1 ? panel.links[0].title || "Open link" : "Panel links",
|
|
3772
3892
|
hitSlop: 10,
|
|
3773
|
-
style: ({ pressed }) => [
|
|
3893
|
+
style: ({ pressed }) => [styles14.titleLink, pressed && { opacity: 0.6 }],
|
|
3774
3894
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkIcon, { color: theme.textMuted })
|
|
3775
3895
|
}
|
|
3776
3896
|
)
|
|
3777
3897
|
] }),
|
|
3778
|
-
/* @__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 }) })
|
|
3779
3899
|
] });
|
|
3780
3900
|
}
|
|
3781
3901
|
function DataPanelBody({ panel, width, height }) {
|
|
3782
3902
|
const theme = useDashTheme();
|
|
3783
|
-
const needsData =
|
|
3903
|
+
const needsData = _chunkYUXA7I4Jjs.panelHasQueries.call(void 0, panel);
|
|
3784
3904
|
const data = usePanelData(panel, width, needsData);
|
|
3785
3905
|
const Component2 = panelComponent(panel.type);
|
|
3786
3906
|
if (needsData && data.error) {
|
|
3787
|
-
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 }) });
|
|
3788
3908
|
}
|
|
3789
3909
|
if (needsData && data.loading && !data.frames.length) {
|
|
3790
|
-
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 }) });
|
|
3791
3911
|
}
|
|
3792
3912
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { panel, frames: data.frames, width, height });
|
|
3793
3913
|
}
|
|
3794
|
-
var
|
|
3914
|
+
var styles14 = _reactnative.StyleSheet.create({
|
|
3795
3915
|
fill: { flex: 1 },
|
|
3796
3916
|
content: { padding: SIDE, paddingBottom: 32, gap: GAP },
|
|
3797
3917
|
section: { gap: GAP },
|
|
@@ -3822,16 +3942,40 @@ function savedValues(panels, entries) {
|
|
|
3822
3942
|
const values = {};
|
|
3823
3943
|
for (const p of panels) {
|
|
3824
3944
|
const mine = entries.filter((e) => e.metric === p.options.metric);
|
|
3825
|
-
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]);
|
|
3826
3946
|
}
|
|
3827
3947
|
return values;
|
|
3828
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;
|
|
3829
3970
|
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing }) {
|
|
3830
3971
|
const theme = useDashTheme();
|
|
3831
|
-
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]);
|
|
3832
3974
|
const saved = _react.useMemo.call(void 0, () => editing ? savedValues(panels, editing) : NO_DEFAULTS, [panels, editing]);
|
|
3833
3975
|
const [defaults, setDefaults] = _react.useState.call(void 0, {});
|
|
3834
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, {});
|
|
3835
3979
|
const [offsetMs, setOffsetMs] = _react.useState.call(void 0, 0);
|
|
3836
3980
|
const [status, setStatus] = _react.useState.call(void 0, null);
|
|
3837
3981
|
const [checked, setChecked] = _react.useState.call(void 0, false);
|
|
@@ -3842,10 +3986,18 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3842
3986
|
const next = {};
|
|
3843
3987
|
for (const p of panels) {
|
|
3844
3988
|
const d = p.options.default;
|
|
3845
|
-
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));
|
|
3846
3990
|
else if (d !== void 0) next[p.options.metric] = d;
|
|
3847
3991
|
}
|
|
3848
|
-
|
|
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
|
+
}
|
|
3849
4001
|
};
|
|
3850
4002
|
load();
|
|
3851
4003
|
const unsubscribe = store.subscribe(load);
|
|
@@ -3853,7 +4005,9 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3853
4005
|
run = -1;
|
|
3854
4006
|
unsubscribe();
|
|
3855
4007
|
};
|
|
3856
|
-
}, [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]);
|
|
3857
4011
|
const state = _react.useMemo.call(void 0, () => {
|
|
3858
4012
|
const value = (m) => m in edits ? edits[m] : m in saved ? saved[m] : m in given ? given[m] : _nullishCoalesce(defaults[m], () => ( null));
|
|
3859
4013
|
return {
|
|
@@ -3867,48 +4021,63 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3867
4021
|
choices,
|
|
3868
4022
|
problem: (m) => {
|
|
3869
4023
|
const p = panels.find((x) => x.options.metric === m);
|
|
3870
|
-
return p && (checked || m in edits) ?
|
|
3871
|
-
}
|
|
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
|
+
})
|
|
3872
4030
|
};
|
|
3873
|
-
}, [edits, saved, defaults, given, store, choices, panels, checked]);
|
|
3874
|
-
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
|
+
);
|
|
3875
4037
|
const save = _react.useCallback.call(void 0, async () => {
|
|
3876
4038
|
const problems = panels.flatMap((p) => {
|
|
3877
|
-
const problem =
|
|
4039
|
+
const problem = _chunkYUXA7I4Jjs.inputProblem.call(void 0, p, state.value(p.options.metric));
|
|
3878
4040
|
return problem ? [`${p.title || p.options.metric}: ${problem.toLowerCase()}`] : [];
|
|
3879
4041
|
});
|
|
4042
|
+
for (const g of recordedGroups()) problems.push(..._chunkYUXA7I4Jjs.groupProblems.call(void 0, g, itemsOf(g).map((i) => i.values)));
|
|
3880
4043
|
if (problems.length) {
|
|
3881
4044
|
setChecked(true);
|
|
3882
4045
|
setStatus(problems.length === 1 ? `Can\u2019t save. ${problems[0]}` : `Can\u2019t save: ${problems.length} fields need fixing`);
|
|
3883
4046
|
return;
|
|
3884
4047
|
}
|
|
3885
|
-
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
3886
|
-
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
|
+
];
|
|
3887
4054
|
if (!entries.length) return;
|
|
3888
4055
|
const extra = beforeSave ? await beforeSave(ts) : [];
|
|
3889
4056
|
if (!extra) return;
|
|
3890
4057
|
const added = editing ? await replace(store, editing.map((e) => e.id), [...entries, ...extra]) : await store.add([...entries, ...extra]);
|
|
3891
4058
|
setEdits({});
|
|
4059
|
+
setGroupEdits({});
|
|
3892
4060
|
setChecked(false);
|
|
3893
4061
|
setOffsetMs(0);
|
|
3894
4062
|
setStatus(`Saved ${added.length} ${added.length === 1 ? "value" : "values"}`);
|
|
3895
|
-
_optionalChain([onSaved, 'optionalCall',
|
|
3896
|
-
}, [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]);
|
|
3897
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,
|
|
3898
4066
|
DashboardView,
|
|
3899
4067
|
{
|
|
3900
4068
|
header: header !== void 0 ? header : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TimestampPicker, { offsetMs, onChange: setOffsetMs }),
|
|
3901
|
-
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
3902
|
-
/* @__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"))) }),
|
|
3903
4071
|
dirty > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3904
4072
|
_reactnative.Pressable,
|
|
3905
4073
|
{
|
|
3906
4074
|
onPress: () => {
|
|
3907
4075
|
setEdits({});
|
|
4076
|
+
setGroupEdits({});
|
|
3908
4077
|
setChecked(false);
|
|
3909
4078
|
setStatus(null);
|
|
3910
4079
|
},
|
|
3911
|
-
style:
|
|
4080
|
+
style: styles15.secondary,
|
|
3912
4081
|
accessibilityRole: "button",
|
|
3913
4082
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontWeight: "500" }, children: "Discard" })
|
|
3914
4083
|
}
|
|
@@ -3919,14 +4088,57 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
3919
4088
|
onPress: save,
|
|
3920
4089
|
disabled: !dirty,
|
|
3921
4090
|
accessibilityRole: "button",
|
|
3922
|
-
style: ({ pressed }) => [
|
|
3923
|
-
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" })
|
|
3924
4093
|
}
|
|
3925
4094
|
)
|
|
3926
4095
|
] })
|
|
3927
4096
|
}
|
|
3928
4097
|
) }) });
|
|
3929
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
|
+
}
|
|
3930
4142
|
async function replace(store, ids, entries) {
|
|
3931
4143
|
if (store.replace) return store.replace(ids, entries);
|
|
3932
4144
|
for (const id of ids) await store.remove(id);
|
|
@@ -3942,20 +4154,20 @@ function TimestampPicker({ offsetMs, onChange }) {
|
|
|
3942
4154
|
}, []);
|
|
3943
4155
|
const when = new Date(now + offsetMs);
|
|
3944
4156
|
const step = (ms) => () => onChange(Math.min(0, offsetMs + ms));
|
|
3945
|
-
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: [
|
|
3946
4158
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
3947
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3948
|
-
/* @__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" }) })
|
|
3949
4161
|
] }),
|
|
3950
4162
|
[
|
|
3951
4163
|
["\u22121d", -24 * HOUR],
|
|
3952
4164
|
["\u22121h", -HOUR],
|
|
3953
4165
|
["+1h", HOUR]
|
|
3954
|
-
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [
|
|
3955
|
-
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" }) })
|
|
3956
4168
|
] });
|
|
3957
4169
|
}
|
|
3958
|
-
var
|
|
4170
|
+
var styles15 = _reactnative.StyleSheet.create({
|
|
3959
4171
|
footer: { flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 16, paddingVertical: 10, borderTopWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
3960
4172
|
status: { flex: 1, fontSize: 13 },
|
|
3961
4173
|
secondary: { paddingHorizontal: 8, paddingVertical: 10 },
|
|
@@ -4187,4 +4399,25 @@ var styles14 = _reactnative.StyleSheet.create({
|
|
|
4187
4399
|
|
|
4188
4400
|
|
|
4189
4401
|
|
|
4190
|
-
exports.ALL = _chunkWMRDOYPVjs.ALL; exports.BUNDLE_ACCEPT = _chunkWMRDOYPVjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkWMRDOYPVjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkWMRDOYPVjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkWMRDOYPVjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkWMRDOYPVjs.ConfigLoader; exports.DASHBOARD_DS = _chunkWMRDOYPVjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkWMRDOYPVjs.DEFAULT_GAZETTEER; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkWMRDOYPVjs.EDITABLE_VARIABLE_TYPES; exports.GRID_COLUMNS = _chunkWMRDOYPVjs.GRID_COLUMNS; exports.GrafanaClient = _chunkWMRDOYPVjs.GrafanaClient; exports.GrafanaDataSource = _chunkWMRDOYPVjs.GrafanaDataSource; exports.GrafanaError = _chunkWMRDOYPVjs.GrafanaError; exports.HttpConfigFiles = _chunkWMRDOYPVjs.HttpConfigFiles; exports.INPUT_OPTION_KEYS = _chunkWMRDOYPVjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkWMRDOYPVjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkWMRDOYPVjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkWMRDOYPVjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkWMRDOYPVjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkWMRDOYPVjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkWMRDOYPVjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkWMRDOYPVjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkWMRDOYPVjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkWMRDOYPVjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkWMRDOYPVjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkWMRDOYPVjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkWMRDOYPVjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkWMRDOYPVjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkWMRDOYPVjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkWMRDOYPVjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkWMRDOYPVjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkWMRDOYPVjs.SaveConflictError; exports.TIME_PRESETS = _chunkWMRDOYPVjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkWMRDOYPVjs.UNIT_CHOICES; exports.addTime = _chunkWMRDOYPVjs.addTime; exports.appSchema = _chunkWMRDOYPVjs.appSchema; exports.applyDashboardLink = _chunkWMRDOYPVjs.applyDashboardLink; exports.applyJsonEdits = _chunkWMRDOYPVjs.applyJsonEdits; exports.applyTransformations = _chunkWMRDOYPVjs.applyTransformations; exports.assembleBundle = _chunkWMRDOYPVjs.assembleBundle; exports.assembleFromResponse = _chunkWMRDOYPVjs.assembleFromResponse; exports.buildFrames = _chunkWMRDOYPVjs.buildFrames; exports.bundleFromFiles = _chunkWMRDOYPVjs.bundleFromFiles; exports.bundleRoot = _chunkWMRDOYPVjs.bundleRoot; exports.calculateInterval = _chunkWMRDOYPVjs.calculateInterval; exports.checkFiles = _chunkWMRDOYPVjs.checkFiles; exports.cleanDashboard = _chunkWMRDOYPVjs.cleanDashboard; exports.cleanPanelOptions = _chunkWMRDOYPVjs.cleanPanelOptions; exports.collapseRow = _chunkWMRDOYPVjs.collapseRow; exports.compactGrid = _chunkWMRDOYPVjs.compactGrid; exports.copyPanels = _chunkWMRDOYPVjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkWMRDOYPVjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkWMRDOYPVjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkWMRDOYPVjs.dashboardSourceIds; exports.defaultFetchJson = _chunkWMRDOYPVjs.defaultFetchJson; exports.describeRange = _chunkWMRDOYPVjs.describeRange; exports.diffJson = _chunkWMRDOYPVjs.diffJson; exports.documentIdFor = _chunkWMRDOYPVjs.documentIdFor; exports.documentUses = _chunkWMRDOYPVjs.documentUses; exports.dropTarget = _chunkWMRDOYPVjs.dropTarget; exports.duplicatePanel = _chunkWMRDOYPVjs.duplicatePanel; exports.entriesSavedWith = _chunkWMRDOYPVjs.entriesSavedWith; exports.entryToInputValue = _chunkWMRDOYPVjs.entryToInputValue; exports.expandRow = _chunkWMRDOYPVjs.expandRow; exports.fetchBundle = _chunkWMRDOYPVjs.fetchBundle; exports.fetchJsonWithToken = _chunkWMRDOYPVjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkWMRDOYPVjs.fieldDisplayName; exports.fieldMatches = _chunkWMRDOYPVjs.fieldMatches; exports.formatClock = _chunkWMRDOYPVjs.formatClock; exports.formatDisplay = _chunkWMRDOYPVjs.formatDisplay; exports.formatDuration = _chunkWMRDOYPVjs.formatDuration; exports.formatJsonText = _chunkWMRDOYPVjs.formatJsonText; exports.formatLocalDateTime = _chunkWMRDOYPVjs.formatLocalDateTime; exports.formatValue = _chunkWMRDOYPVjs.formatValue; exports.frameLength = _chunkWMRDOYPVjs.frameLength; exports.framesToOptions = _chunkWMRDOYPVjs.framesToOptions; exports.fromWire = _chunkWMRDOYPVjs.fromWire; exports.getPath = _chunkWMRDOYPVjs.getPath; exports.gridOffsetPx = _chunkWMRDOYPVjs.gridOffsetPx; exports.gridUnitsToPx = _chunkWMRDOYPVjs.gridUnitsToPx; exports.httpFetchJson = _chunkWMRDOYPVjs.httpFetchJson; exports.initialVariableValues = _chunkWMRDOYPVjs.initialVariableValues; exports.inputPanels = _chunkWMRDOYPVjs.inputPanels; exports.inputProblem = _chunkWMRDOYPVjs.inputProblem; exports.insertPanel = _chunkWMRDOYPVjs.insertPanel; exports.interpolate = _chunkWMRDOYPVjs.interpolate; exports.interpolateDeep = _chunkWMRDOYPVjs.interpolateDeep; exports.isBundleResponse = _chunkWMRDOYPVjs.isBundleResponse; exports.isEditableVariableType = _chunkWMRDOYPVjs.isEditableVariableType; exports.isInputPanel = _chunkWMRDOYPVjs.isInputPanel; exports.isInputType = _chunkWMRDOYPVjs.isInputType; exports.isLocalDatasource = _chunkWMRDOYPVjs.isLocalDatasource; exports.isReducer = _chunkWMRDOYPVjs.isReducer; exports.isRow = _chunkWMRDOYPVjs.isRow; exports.isSqlDatasource = _chunkWMRDOYPVjs.isSqlDatasource; exports.layoutCanvas = _chunkWMRDOYPVjs.layoutCanvas; exports.layoutDashboard = _chunkWMRDOYPVjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkWMRDOYPVjs.lineColumn; exports.loadGazetteer = _chunkWMRDOYPVjs.loadGazetteer; exports.locate = _chunkWMRDOYPVjs.locate; exports.manifestSchemaIssues = _chunkWMRDOYPVjs.manifestSchemaIssues; exports.mappedResult = _chunkWMRDOYPVjs.mappedResult; exports.mappingProblem = _chunkWMRDOYPVjs.mappingProblem; exports.mappingRow = _chunkWMRDOYPVjs.mappingRow; exports.mappingRows = _chunkWMRDOYPVjs.mappingRows; exports.metricChanges = _chunkWMRDOYPVjs.metricChanges; exports.movePanel = _chunkWMRDOYPVjs.movePanel; exports.newDocument = _chunkWMRDOYPVjs.newDocument; exports.newPanel = _chunkWMRDOYPVjs.newPanel; exports.newVariable = _chunkWMRDOYPVjs.newVariable; exports.nextPanelId = _chunkWMRDOYPVjs.nextPanelId; exports.normalizeRef = _chunkWMRDOYPVjs.normalizeRef; exports.numberFields = _chunkWMRDOYPVjs.numberFields; exports.optionValue = _chunkWMRDOYPVjs.optionValue; exports.overrideProperties = _chunkWMRDOYPVjs.overrideProperties; exports.panelEdits = _chunkWMRDOYPVjs.panelEdits; exports.panelHasQueries = _chunkWMRDOYPVjs.panelHasQueries; exports.panelKey = _chunkWMRDOYPVjs.panelKey; exports.panelOptions = _chunkWMRDOYPVjs.panelOptions; exports.panelOverrides = _chunkWMRDOYPVjs.panelOverrides; exports.panelSize = _chunkWMRDOYPVjs.panelSize; exports.panelSpan = _chunkWMRDOYPVjs.panelSpan; exports.parseClockDigits = _chunkWMRDOYPVjs.parseClockDigits; exports.parseDashboardLink = _chunkWMRDOYPVjs.parseDashboardLink; exports.parseDuration = _chunkWMRDOYPVjs.parseDuration; exports.parseGazetteer = _chunkWMRDOYPVjs.parseGazetteer; exports.parseJsonText = _chunkWMRDOYPVjs.parseJsonText; exports.parseLocalDateTime = _chunkWMRDOYPVjs.parseLocalDateTime; exports.parseRange = _chunkWMRDOYPVjs.parseRange; exports.parseSnippet = _chunkWMRDOYPVjs.parseSnippet; exports.parseTime = _chunkWMRDOYPVjs.parseTime; exports.pasteSnippet = _chunkWMRDOYPVjs.pasteSnippet; exports.placePanel = _chunkWMRDOYPVjs.placePanel; exports.pointerToPath = _chunkWMRDOYPVjs.pointerToPath; exports.prepareDashboard = _chunkWMRDOYPVjs.prepareDashboard; exports.previewPaste = _chunkWMRDOYPVjs.previewPaste; exports.queryPanel = _chunkWMRDOYPVjs.queryPanel; exports.queryParam = _chunkWMRDOYPVjs.queryParam; exports.readConfigFiles = _chunkWMRDOYPVjs.readConfigFiles; exports.readingOrder = _chunkWMRDOYPVjs.readingOrder; exports.reduce = _chunkWMRDOYPVjs.reduce; exports.refineOptions = _chunkWMRDOYPVjs.refineOptions; exports.refreshedVariables = _chunkWMRDOYPVjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkWMRDOYPVjs.removeDocumentFromManifest; exports.removePanel = _chunkWMRDOYPVjs.removePanel; exports.renameDocumentInManifest = _chunkWMRDOYPVjs.renameDocumentInManifest; exports.renameVariableInPanels = _chunkWMRDOYPVjs.renameVariableInPanels; exports.repack = _chunkWMRDOYPVjs.repack; exports.repeatOptions = _chunkWMRDOYPVjs.repeatOptions; exports.resizePanel = _chunkWMRDOYPVjs.resizePanel; exports.resolveColor = _chunkWMRDOYPVjs.resolveColor; exports.resolveFieldConfig = _chunkWMRDOYPVjs.resolveFieldConfig; exports.resolveLinks = _chunkWMRDOYPVjs.resolveLinks; exports.resolveTimezone = _chunkWMRDOYPVjs.resolveTimezone; exports.resolveUrl = _chunkWMRDOYPVjs.resolveUrl; exports.resolveVariables = _chunkWMRDOYPVjs.resolveVariables; exports.revalidateBundle = _chunkWMRDOYPVjs.revalidateBundle; exports.rowsToMappings = _chunkWMRDOYPVjs.rowsToMappings; exports.sampleEntries = _chunkWMRDOYPVjs.sampleEntries; exports.screenDocuments = _chunkWMRDOYPVjs.screenDocuments; exports.screenOfType = _chunkWMRDOYPVjs.screenOfType; exports.selectValue = _chunkWMRDOYPVjs.selectValue; exports.seriesColor = _chunkWMRDOYPVjs.seriesColor; exports.setHiddenOnPhones = _chunkWMRDOYPVjs.setHiddenOnPhones; exports.setJsonValue = _chunkWMRDOYPVjs.setJsonValue; exports.setOption = _chunkWMRDOYPVjs.setOption; exports.setOptionValue = _chunkWMRDOYPVjs.setOptionValue; exports.setOverrides = _chunkWMRDOYPVjs.setOverrides; exports.settleLayout = _chunkWMRDOYPVjs.settleLayout; exports.snapToGrid = _chunkWMRDOYPVjs.snapToGrid; exports.splitPath = _chunkWMRDOYPVjs.splitPath; exports.startOf = _chunkWMRDOYPVjs.startOf; exports.stringifyCompact = _chunkWMRDOYPVjs.stringifyCompact; exports.tabIdFor = _chunkWMRDOYPVjs.tabIdFor; exports.textSuggestions = _chunkWMRDOYPVjs.textSuggestions; exports.thresholdStep = _chunkWMRDOYPVjs.thresholdStep; exports.timeExprError = _chunkWMRDOYPVjs.timeExprError; exports.timeField = _chunkWMRDOYPVjs.timeField; exports.toEntries = _chunkWMRDOYPVjs.toEntries; exports.toMillis = _chunkWMRDOYPVjs.toMillis; exports.toSeries = _chunkWMRDOYPVjs.toSeries; exports.toXYSeries = _chunkWMRDOYPVjs.toXYSeries; exports.uniqueNames = _chunkWMRDOYPVjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkWMRDOYPVjs.validateBundle; exports.validateDashboard = _chunkWMRDOYPVjs.validateDashboard; exports.validateManifest = _chunkWMRDOYPVjs.validateManifest; exports.valueColor = _chunkWMRDOYPVjs.valueColor; exports.valueText = _chunkWMRDOYPVjs.valueText; exports.variableDependents = _chunkWMRDOYPVjs.variableDependents; exports.variableInfo = _chunkWMRDOYPVjs.variableInfo; exports.variableNameError = _chunkWMRDOYPVjs.variableNameError; exports.variableOptions = _chunkWMRDOYPVjs.variableOptions; exports.variableOrder = _chunkWMRDOYPVjs.variableOrder; exports.variableReferences = _chunkWMRDOYPVjs.variableReferences; exports.variableUses = _chunkWMRDOYPVjs.variableUses; exports.variableWithCurrent = _chunkWMRDOYPVjs.variableWithCurrent; exports.variableWithFlags = _chunkWMRDOYPVjs.variableWithFlags; exports.variableWithQuery = _chunkWMRDOYPVjs.variableWithQuery; exports.variableWithType = _chunkWMRDOYPVjs.variableWithType; exports.visibleVariables = _chunkWMRDOYPVjs.visibleVariables; exports.zoomRange = _chunkWMRDOYPVjs.zoomRange;
|
|
4402
|
+
|
|
4403
|
+
|
|
4404
|
+
|
|
4405
|
+
|
|
4406
|
+
|
|
4407
|
+
|
|
4408
|
+
|
|
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;
|