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