@modelform/react-native 0.12.0 → 0.13.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 +39 -0
- package/dist/{chunk-G67L7TFK.js → chunk-CU4TMSZE.js} +338 -90
- package/dist/{chunk-YUSXYDXG.mjs → chunk-OFXIKI2L.mjs} +248 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +18 -2
- package/dist/core/index.mjs +17 -1
- package/dist/core/speech.d.ts +36 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +696 -465
- package/dist/index.mjs +685 -454
- package/dist/ui/inputs/Dictation.d.ts +24 -0
- package/dist/ui/inputs/InputForm.d.ts +10 -1
- package/dist/ui/inputs/formContext.d.ts +5 -0
- package/dist/ui/speech.d.ts +29 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,7 +234,15 @@
|
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
var _chunkCU4TMSZEjs = require('./chunk-CU4TMSZE.js');
|
|
238
246
|
|
|
239
247
|
// src/ui/theme.tsx
|
|
240
248
|
var _react = require('react');
|
|
@@ -424,7 +432,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
424
432
|
if (!dashboard.refresh) return;
|
|
425
433
|
let ms;
|
|
426
434
|
try {
|
|
427
|
-
ms =
|
|
435
|
+
ms = _chunkCU4TMSZEjs.parseDuration.call(void 0, dashboard.refresh);
|
|
428
436
|
} catch (e2) {
|
|
429
437
|
return;
|
|
430
438
|
}
|
|
@@ -432,7 +440,7 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
432
440
|
return () => clearInterval(id);
|
|
433
441
|
}, [dashboard.refresh, refresh]);
|
|
434
442
|
const refreshKey = tick + externalKey;
|
|
435
|
-
const range3 = _react.useMemo.call(void 0, () =>
|
|
443
|
+
const range3 = _react.useMemo.call(void 0, () => _chunkCU4TMSZEjs.parseRange.call(void 0, rawRange), [rawRange, refreshKey]);
|
|
436
444
|
const shared = _react.useMemo.call(void 0, () => /* @__PURE__ */ new Map(), [range3, vars.variables, vars.variableInfo]);
|
|
437
445
|
const value = _react.useMemo.call(void 0,
|
|
438
446
|
() => ({
|
|
@@ -469,8 +477,8 @@ function DashboardProvider({ dashboard, resolve, refreshKey: externalKey = 0, on
|
|
|
469
477
|
] });
|
|
470
478
|
}
|
|
471
479
|
function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
472
|
-
const [state, setState] = _react.useState.call(void 0, () => ({ values:
|
|
473
|
-
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve &&
|
|
480
|
+
const [state, setState] = _react.useState.call(void 0, () => ({ values: _chunkCU4TMSZEjs.initialVariableValues.call(void 0, dashboard), options: {}, errors: {} }));
|
|
481
|
+
const [resolving, setResolving] = _react.useState.call(void 0, () => !!resolve && _chunkCU4TMSZEjs.refreshedVariables.call(void 0, dashboard, "load").length > 0);
|
|
474
482
|
const [runKey, setRunKey] = _react.useState.call(void 0, 0);
|
|
475
483
|
const pending = _react.useRef.call(void 0, /* @__PURE__ */ new Set());
|
|
476
484
|
const stateRef = _react.useRef.call(void 0, state);
|
|
@@ -503,7 +511,7 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
503
511
|
setState(update);
|
|
504
512
|
setResolving(false);
|
|
505
513
|
};
|
|
506
|
-
|
|
514
|
+
_chunkCU4TMSZEjs.resolveVariables.call(void 0, dashboard, { values, options, names, resolve: resolve2, range: _chunkCU4TMSZEjs.parseRange.call(void 0, rawRange), signal: controller.signal }).then(
|
|
507
515
|
(res) => finish((s) => ({
|
|
508
516
|
// Only the re-run variables change, so a pick made while this ran isn't overwritten.
|
|
509
517
|
values: { ...s.values, ...Object.fromEntries([...names].filter((n) => n in res.values).map((n) => [n, res.values[n]])) },
|
|
@@ -517,11 +525,11 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
517
525
|
const [loadedDashboard, setLoadedDashboard] = _react.useState.call(void 0, dashboard);
|
|
518
526
|
if (dashboard !== loadedDashboard) {
|
|
519
527
|
setLoadedDashboard(dashboard);
|
|
520
|
-
setState((s) => ({ ...s, values: { ...
|
|
528
|
+
setState((s) => ({ ...s, values: { ..._chunkCU4TMSZEjs.initialVariableValues.call(void 0, dashboard), ...s.values } }));
|
|
521
529
|
}
|
|
522
530
|
_react.useEffect.call(void 0, () => {
|
|
523
|
-
const roots =
|
|
524
|
-
schedule([...roots, ...
|
|
531
|
+
const roots = _chunkCU4TMSZEjs.refreshedVariables.call(void 0, dashboard, "load");
|
|
532
|
+
schedule([...roots, ..._chunkCU4TMSZEjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
525
533
|
}, [dashboard, schedule]);
|
|
526
534
|
const mounted = _react.useRef.call(void 0, false);
|
|
527
535
|
_react.useEffect.call(void 0, () => {
|
|
@@ -529,17 +537,17 @@ function useDashboardVariables(dashboard, resolve, rawRange) {
|
|
|
529
537
|
mounted.current = true;
|
|
530
538
|
return;
|
|
531
539
|
}
|
|
532
|
-
const roots =
|
|
533
|
-
schedule([...roots, ...
|
|
540
|
+
const roots = _chunkCU4TMSZEjs.refreshedVariables.call(void 0, dashboard, "range");
|
|
541
|
+
schedule([...roots, ..._chunkCU4TMSZEjs.variableDependents.call(void 0, dashboard, roots)]);
|
|
534
542
|
}, [rawRange]);
|
|
535
543
|
const setVariable = _react.useCallback.call(void 0,
|
|
536
544
|
(name, value) => {
|
|
537
545
|
setState((s) => ({ ...s, values: { ...s.values, [name]: value } }));
|
|
538
|
-
schedule(
|
|
546
|
+
schedule(_chunkCU4TMSZEjs.variableDependents.call(void 0, dashboard, [name]));
|
|
539
547
|
},
|
|
540
548
|
[dashboard, schedule]
|
|
541
549
|
);
|
|
542
|
-
const info = _react.useMemo.call(void 0, () =>
|
|
550
|
+
const info = _react.useMemo.call(void 0, () => _chunkCU4TMSZEjs.variableInfo.call(void 0, dashboard, state.options), [dashboard, state.options]);
|
|
543
551
|
return _react.useMemo.call(void 0,
|
|
544
552
|
() => ({
|
|
545
553
|
variables: state.values,
|
|
@@ -569,7 +577,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
569
577
|
_react.useEffect.call(void 0, () => {
|
|
570
578
|
if (!enabled || !request || !variablesReady) return;
|
|
571
579
|
const controller = new AbortController();
|
|
572
|
-
|
|
580
|
+
_chunkCU4TMSZEjs.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))) }));
|
|
573
581
|
return () => controller.abort();
|
|
574
582
|
}, [enabled, request, variablesReady]);
|
|
575
583
|
if (!enabled) return IDLE;
|
|
@@ -579,7 +587,7 @@ function usePanelData(panel, widthPx, enabled = true) {
|
|
|
579
587
|
function usePanelLinks(panel) {
|
|
580
588
|
const { dashboard, variables, variableInfo: variableInfo2, range: range3, openLinks } = useDashboard();
|
|
581
589
|
const resolve = _react.useCallback.call(void 0,
|
|
582
|
-
(links, data) =>
|
|
590
|
+
(links, data) => _chunkCU4TMSZEjs.resolveLinks.call(void 0, links, { dashboard, values: variables, info: variableInfo2, scoped: panel.scopedVars, range: range3, timezone: dashboard.timezone, data }),
|
|
583
591
|
[dashboard, variables, variableInfo2, panel.scopedVars, range3]
|
|
584
592
|
);
|
|
585
593
|
return { resolve, openLinks };
|
|
@@ -620,7 +628,7 @@ var RenderBoundary = (_class = class extends _react.Component {constructor(...ar
|
|
|
620
628
|
|
|
621
629
|
// src/ui/inputs/formContext.ts
|
|
622
630
|
|
|
623
|
-
var groupKey = (g) => g.id != null ? `#${g.id}` :
|
|
631
|
+
var groupKey = (g) => g.id != null ? `#${g.id}` : _chunkCU4TMSZEjs.groupFields.call(void 0, g).map((f) => f.options.metric).join("|");
|
|
624
632
|
var InputFormContext = _react.createContext.call(void 0, null);
|
|
625
633
|
function useInputForm() {
|
|
626
634
|
const v = _react.useContext.call(void 0, InputFormContext);
|
|
@@ -681,14 +689,14 @@ var ArrowIcon = ({ color, dir }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
|
681
689
|
function displayExpr(expr) {
|
|
682
690
|
if (expr.trim().startsWith("now")) return expr;
|
|
683
691
|
try {
|
|
684
|
-
return
|
|
692
|
+
return _chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, _chunkCU4TMSZEjs.parseTime.call(void 0, expr));
|
|
685
693
|
} catch (e3) {
|
|
686
694
|
return expr;
|
|
687
695
|
}
|
|
688
696
|
}
|
|
689
697
|
function tryParse(expr, roundUp, now = Date.now()) {
|
|
690
698
|
try {
|
|
691
|
-
return
|
|
699
|
+
return _chunkCU4TMSZEjs.parseTime.call(void 0, expr, now, roundUp);
|
|
692
700
|
} catch (e4) {
|
|
693
701
|
return null;
|
|
694
702
|
}
|
|
@@ -702,7 +710,7 @@ function endOfDay(ms) {
|
|
|
702
710
|
return new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1).getTime() - 1e3;
|
|
703
711
|
}
|
|
704
712
|
function resolveTo(expr) {
|
|
705
|
-
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ?
|
|
713
|
+
return /^\s*\d{4}-\d{1,2}-\d{1,2}\s*$/.test(expr) ? _chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, endOfDay(_chunkCU4TMSZEjs.parseTime.call(void 0, expr))) : expr;
|
|
706
714
|
}
|
|
707
715
|
function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
708
716
|
const theme = useDashTheme();
|
|
@@ -713,12 +721,12 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
713
721
|
const [now] = _react.useState.call(void 0, () => Date.now());
|
|
714
722
|
const [month, setMonth] = _react.useState.call(void 0, () => new Date(_nullishCoalesce(tryParse(value.from, false), () => ( now))));
|
|
715
723
|
const fromMs = tryParse(from, false, now);
|
|
716
|
-
const toMs = tryParse(
|
|
717
|
-
const fromError =
|
|
718
|
-
const toError =
|
|
724
|
+
const toMs = tryParse(_chunkCU4TMSZEjs.timeExprError.call(void 0, to) ? to : resolveTo(to), true, now);
|
|
725
|
+
const fromError = _chunkCU4TMSZEjs.timeExprError.call(void 0, from);
|
|
726
|
+
const toError = _chunkCU4TMSZEjs.timeExprError.call(void 0, to);
|
|
719
727
|
const orderError = fromMs != null && toMs != null && fromMs >= toMs ? "\u201CTo\u201D must be after \u201CFrom\u201D" : null;
|
|
720
728
|
const valid = !fromError && !toError && !orderError;
|
|
721
|
-
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() :
|
|
729
|
+
const normalize = (expr) => expr.trim().startsWith("now") ? expr.trim() : _chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, _chunkCU4TMSZEjs.parseTime.call(void 0, expr));
|
|
722
730
|
const apply = () => {
|
|
723
731
|
if (!valid) return;
|
|
724
732
|
onApply({ from: normalize(from), to: normalize(resolveTo(to)) });
|
|
@@ -727,14 +735,14 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
727
735
|
const pickDay = (day) => {
|
|
728
736
|
const end = endOfDay(day);
|
|
729
737
|
if (active === "from") {
|
|
730
|
-
setFrom(
|
|
731
|
-
if (toMs == null || toMs <= day) setTo(
|
|
738
|
+
setFrom(_chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, day));
|
|
739
|
+
if (toMs == null || toMs <= day) setTo(_chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, end));
|
|
732
740
|
setActive("to");
|
|
733
741
|
} else if (fromMs != null && day < startOfDay(fromMs)) {
|
|
734
|
-
setFrom(
|
|
735
|
-
setTo(
|
|
742
|
+
setFrom(_chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, day));
|
|
743
|
+
setTo(_chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, end));
|
|
736
744
|
} else {
|
|
737
|
-
setTo(
|
|
745
|
+
setTo(_chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, end));
|
|
738
746
|
}
|
|
739
747
|
};
|
|
740
748
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -770,7 +778,7 @@ function TimeRangeSheet({ visible, value, onApply, onClose }) {
|
|
|
770
778
|
}
|
|
771
779
|
),
|
|
772
780
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles3.sectionTitle, { color: theme.textSecondary }], children: "Relative ranges" }),
|
|
773
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children:
|
|
781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles3.chips, children: _chunkCU4TMSZEjs.RELATIVE_RANGES.map((r) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
774
782
|
Chip,
|
|
775
783
|
{
|
|
776
784
|
label: r.label,
|
|
@@ -914,17 +922,17 @@ var FilterIcon = ({ color }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _re
|
|
|
914
922
|
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" }) });
|
|
915
923
|
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" }) });
|
|
916
924
|
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" }) });
|
|
917
|
-
function DashboardToolbar({ presets =
|
|
925
|
+
function DashboardToolbar({ presets = _chunkCU4TMSZEjs.TIME_PRESETS }) {
|
|
918
926
|
const theme = useDashTheme();
|
|
919
927
|
const { dashboard, rawRange, setRawRange, variables, variableErrors } = useDashboard();
|
|
920
928
|
const [filtersOpen, setFiltersOpen] = _react.useState.call(void 0, false);
|
|
921
929
|
const [rangeOpen, setRangeOpen] = _react.useState.call(void 0, false);
|
|
922
930
|
const [rangeKey, setRangeKey] = _react.useState.call(void 0, 0);
|
|
923
931
|
const custom = !presets.some((p) => rawRange.from === p.from && rawRange.to === p.to);
|
|
924
|
-
const vars =
|
|
932
|
+
const vars = _chunkCU4TMSZEjs.visibleVariables.call(void 0, dashboard);
|
|
925
933
|
const active = vars.filter((v) => {
|
|
926
934
|
const cur = variables[v.name];
|
|
927
|
-
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(
|
|
935
|
+
return v.includeAll && cur != null && !(Array.isArray(cur) ? cur.includes(_chunkCU4TMSZEjs.ALL) : cur === _chunkCU4TMSZEjs.ALL);
|
|
928
936
|
}).length;
|
|
929
937
|
const hasError = vars.some((v) => variableErrors[v.name]);
|
|
930
938
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles4.toolbar, children: [
|
|
@@ -950,7 +958,7 @@ function DashboardToolbar({ presets = _chunkG67L7TFKjs.TIME_PRESETS }) {
|
|
|
950
958
|
setRangeOpen(true);
|
|
951
959
|
},
|
|
952
960
|
accessibilityRole: "button",
|
|
953
|
-
accessibilityLabel: custom ? `Time range, ${
|
|
961
|
+
accessibilityLabel: custom ? `Time range, ${_chunkCU4TMSZEjs.describeRange.call(void 0, rawRange)}` : "Custom time range",
|
|
954
962
|
style: ({ pressed }) => [
|
|
955
963
|
custom ? styles4.rangeButton : styles4.iconButton,
|
|
956
964
|
{ borderColor: custom ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
@@ -958,7 +966,7 @@ function DashboardToolbar({ presets = _chunkG67L7TFKjs.TIME_PRESETS }) {
|
|
|
958
966
|
],
|
|
959
967
|
children: [
|
|
960
968
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CalendarIcon, { color: custom ? theme.accent : theme.textSecondary }),
|
|
961
|
-
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children:
|
|
969
|
+
custom && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles4.rangeLabel, { color: theme.accent }], numberOfLines: 1, children: _chunkCU4TMSZEjs.describeRange.call(void 0, rawRange) })
|
|
962
970
|
]
|
|
963
971
|
}
|
|
964
972
|
),
|
|
@@ -1014,14 +1022,14 @@ function FilterSection({ variable: v, open, onToggle }) {
|
|
|
1014
1022
|
const theme = useDashTheme();
|
|
1015
1023
|
const { variables, variableInfo: variableInfo2, variableErrors, variablesReady, setVariable } = useDashboard();
|
|
1016
1024
|
const current = variables[v.name];
|
|
1017
|
-
const summary =
|
|
1018
|
-
const options = [...v.includeAll ? [{ text: "All", value:
|
|
1025
|
+
const summary = _chunkCU4TMSZEjs.valueText.call(void 0, current, variableInfo2[v.name]) || (variablesReady ? "None" : "\u2026");
|
|
1026
|
+
const options = [...v.includeAll ? [{ text: "All", value: _chunkCU4TMSZEjs.ALL }] : [], ..._nullishCoalesce(_optionalChain([variableInfo2, 'access', _9 => _9[v.name], 'optionalAccess', _10 => _10.options]), () => ( []))];
|
|
1019
1027
|
const error = variableErrors[v.name];
|
|
1020
1028
|
const choose = (value, selected) => {
|
|
1021
|
-
if (v.multi && value !==
|
|
1022
|
-
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !==
|
|
1029
|
+
if (v.multi && value !== _chunkCU4TMSZEjs.ALL) {
|
|
1030
|
+
const cur = (Array.isArray(current) ? current : [current]).filter((c) => c && c !== _chunkCU4TMSZEjs.ALL);
|
|
1023
1031
|
const next = selected ? cur.filter((c) => c !== value) : [...cur, value];
|
|
1024
|
-
setVariable(v.name, next.length ? next : [
|
|
1032
|
+
setVariable(v.name, next.length ? next : [_chunkCU4TMSZEjs.ALL]);
|
|
1025
1033
|
} else {
|
|
1026
1034
|
setVariable(v.name, v.multi ? [value] : value);
|
|
1027
1035
|
if (!v.multi) onToggle();
|
|
@@ -1161,7 +1169,7 @@ function barCategory(panel, frame) {
|
|
|
1161
1169
|
}
|
|
1162
1170
|
function categoryLabels(field) {
|
|
1163
1171
|
if (field.type !== "time") return field.values.map((v) => v == null ? "" : String(v));
|
|
1164
|
-
const times = field.values.map((v) => v == null ? null :
|
|
1172
|
+
const times = field.values.map((v) => v == null ? null : _chunkCU4TMSZEjs.toMillis.call(void 0, v));
|
|
1165
1173
|
let step = Infinity;
|
|
1166
1174
|
times.forEach((t, i) => {
|
|
1167
1175
|
const prev = times[i - 1];
|
|
@@ -1207,19 +1215,19 @@ function formatTooltipTime(t) {
|
|
|
1207
1215
|
return new Date(t).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
1208
1216
|
}
|
|
1209
1217
|
function styledSeries(panel, frames, scheme) {
|
|
1210
|
-
return styleSeries(panel,
|
|
1218
|
+
return styleSeries(panel, _chunkCU4TMSZEjs.toSeries.call(void 0, frames), frames, scheme);
|
|
1211
1219
|
}
|
|
1212
1220
|
function styledXYSeries(panel, frames, scheme) {
|
|
1213
|
-
const { series, x } =
|
|
1214
|
-
const xConfig = x ?
|
|
1221
|
+
const { series, x } = _chunkCU4TMSZEjs.toXYSeries.call(void 0, frames, _optionalChain([panel, 'access', _18 => _18.options, 'optionalAccess', _19 => _19.xField]) || void 0);
|
|
1222
|
+
const xConfig = x ? _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, x.field, x.frame, x.field.name) : {};
|
|
1215
1223
|
return { series: styleSeries(panel, series, frames, scheme), xConfig };
|
|
1216
1224
|
}
|
|
1217
1225
|
function styleSeries(panel, series, frames, scheme) {
|
|
1218
1226
|
const frameOf = /* @__PURE__ */ new Map();
|
|
1219
1227
|
frames.forEach((f) => f.fields.forEach((field) => frameOf.set(field, f)));
|
|
1220
1228
|
return series.map((s, i) => {
|
|
1221
|
-
const config =
|
|
1222
|
-
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color:
|
|
1229
|
+
const config = _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, s.field, frameOf.get(s.field), s.name);
|
|
1230
|
+
return { ...s, name: _nullishCoalesce(config.displayName, () => ( s.name)), config, color: _chunkCU4TMSZEjs.seriesColor.call(void 0, i, scheme, config) };
|
|
1223
1231
|
});
|
|
1224
1232
|
}
|
|
1225
1233
|
function reducedValues(panel, frames, scheme) {
|
|
@@ -1227,30 +1235,30 @@ function reducedValues(panel, frames, scheme) {
|
|
|
1227
1235
|
const out = [];
|
|
1228
1236
|
const multiple = frames.length > 1;
|
|
1229
1237
|
frames.forEach(
|
|
1230
|
-
(frame, fi) =>
|
|
1231
|
-
const raw =
|
|
1232
|
-
const config =
|
|
1238
|
+
(frame, fi) => _chunkCU4TMSZEjs.numberFields.call(void 0, frame).forEach((field) => {
|
|
1239
|
+
const raw = _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, field, frame, multiple);
|
|
1240
|
+
const config = _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
1233
1241
|
const values = field.values.map((v) => v == null ? null : Number(v));
|
|
1234
|
-
const value =
|
|
1235
|
-
const color =
|
|
1236
|
-
const step =
|
|
1237
|
-
const mapped =
|
|
1242
|
+
const value = _chunkCU4TMSZEjs.reduce.call(void 0, values, calc);
|
|
1243
|
+
const color = _chunkCU4TMSZEjs.seriesColor.call(void 0, out.length, scheme, config);
|
|
1244
|
+
const step = _chunkCU4TMSZEjs.thresholdStep.call(void 0, value, config);
|
|
1245
|
+
const mapped = _chunkCU4TMSZEjs.mappedResult.call(void 0, value, config);
|
|
1238
1246
|
out.push({
|
|
1239
1247
|
key: `${fi}/${field.name}/${JSON.stringify(_nullishCoalesce(field.labels, () => ( {})))}`,
|
|
1240
1248
|
name: _nullishCoalesce(config.displayName, () => ( raw)),
|
|
1241
1249
|
value,
|
|
1242
|
-
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) ||
|
|
1250
|
+
text: _optionalChain([mapped, 'optionalAccess', _24 => _24.text]) || _chunkCU4TMSZEjs.formatValue.call(void 0, value, config),
|
|
1243
1251
|
mapped,
|
|
1244
1252
|
config,
|
|
1245
1253
|
color,
|
|
1246
|
-
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ?
|
|
1254
|
+
stateColor: _optionalChain([mapped, 'optionalAccess', _25 => _25.color]) ? _chunkCU4TMSZEjs.resolveColor.call(void 0, mapped.color, color) : step ? _chunkCU4TMSZEjs.resolveColor.call(void 0, step.color, color) : color,
|
|
1247
1255
|
sparkline: values,
|
|
1248
1256
|
field,
|
|
1249
1257
|
frame
|
|
1250
1258
|
});
|
|
1251
1259
|
})
|
|
1252
1260
|
);
|
|
1253
|
-
return
|
|
1261
|
+
return _chunkCU4TMSZEjs.uniqueNames.call(void 0, out, (v) => v.field, frames);
|
|
1254
1262
|
}
|
|
1255
1263
|
function yDomain(series, includeZero) {
|
|
1256
1264
|
let min = Infinity;
|
|
@@ -1311,22 +1319,22 @@ function NoData({ message = "No data" }) {
|
|
|
1311
1319
|
}
|
|
1312
1320
|
function rowTooltipItems(panel, frame, row, multiple) {
|
|
1313
1321
|
return frame.fields.flatMap((f) => {
|
|
1314
|
-
const name =
|
|
1315
|
-
const config =
|
|
1322
|
+
const name = _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1323
|
+
const config = _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1316
1324
|
if (_optionalChain([config, 'access', _36 => _36.custom, 'optionalAccess', _37 => _37.hideFrom, 'optionalAccess', _38 => _38.tooltip])) return [];
|
|
1317
1325
|
const v = f.values[row];
|
|
1318
|
-
const value = v == null ? "\u2014" : f.type === "number" ?
|
|
1326
|
+
const value = v == null ? "\u2014" : f.type === "number" ? _chunkCU4TMSZEjs.formatDisplay.call(void 0, Number(v), config) : f.type === "time" ? formatTooltipTime(_chunkCU4TMSZEjs.toMillis.call(void 0, v)) : String(v);
|
|
1319
1327
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), value }];
|
|
1320
1328
|
});
|
|
1321
1329
|
}
|
|
1322
1330
|
function rowLinks(panel, frame, row, multiple, resolve) {
|
|
1323
1331
|
return mergeLinks(
|
|
1324
1332
|
frame.fields.flatMap((f) => {
|
|
1325
|
-
const name =
|
|
1326
|
-
const config =
|
|
1333
|
+
const name = _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, f, frame, multiple);
|
|
1334
|
+
const config = _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, f, frame, name);
|
|
1327
1335
|
if (!_optionalChain([config, 'access', _39 => _39.links, 'optionalAccess', _40 => _40.length])) return [];
|
|
1328
1336
|
const v = f.values[row];
|
|
1329
|
-
const text = v == null ? void 0 : f.type === "number" ?
|
|
1337
|
+
const text = v == null ? void 0 : f.type === "number" ? _chunkCU4TMSZEjs.formatDisplay.call(void 0, Number(v), config) : String(v);
|
|
1330
1338
|
return [{ name: _nullishCoalesce(config.displayName, () => ( name)), links: resolve(config.links, { frame, row, field: f, fieldName: _nullishCoalesce(config.displayName, () => ( name)), value: v, text }) }];
|
|
1331
1339
|
})
|
|
1332
1340
|
);
|
|
@@ -1339,7 +1347,7 @@ function valueLinks(panel, v, resolve) {
|
|
|
1339
1347
|
fieldName: v.name,
|
|
1340
1348
|
seriesName: v.name,
|
|
1341
1349
|
value: v.value,
|
|
1342
|
-
text:
|
|
1350
|
+
text: _chunkCU4TMSZEjs.formatValue.call(void 0, v.value, v.config),
|
|
1343
1351
|
calc: _nullishCoalesce(_optionalChain([panel, 'access', _44 => _44.options, 'optionalAccess', _45 => _45.reduceOptions, 'optionalAccess', _46 => _46.calcs, 'optionalAccess', _47 => _47[0]]), () => ( "lastNotNull"))
|
|
1344
1352
|
});
|
|
1345
1353
|
}
|
|
@@ -1408,6 +1416,111 @@ var styles5 = _reactnative.StyleSheet.create({
|
|
|
1408
1416
|
tooltipValue: { fontSize: 12, fontWeight: "600", marginLeft: "auto", paddingLeft: 8 }
|
|
1409
1417
|
});
|
|
1410
1418
|
|
|
1419
|
+
// src/ui/inputs/Dictation.tsx
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
var listening = null;
|
|
1425
|
+
var HINT_MS = 4e3;
|
|
1426
|
+
function useDictation(panel, value, onChange, choices) {
|
|
1427
|
+
const form = useInputForm();
|
|
1428
|
+
const speech = form.speech;
|
|
1429
|
+
const [on, setOn] = _react.useState.call(void 0, false);
|
|
1430
|
+
const [hint, setHint] = _react.useState.call(void 0, null);
|
|
1431
|
+
const session = _react.useRef.call(void 0, null);
|
|
1432
|
+
const latest = _react.useRef.call(void 0, { value, onChange, choices });
|
|
1433
|
+
_react.useEffect.call(void 0, () => {
|
|
1434
|
+
latest.current = { value, onChange, choices };
|
|
1435
|
+
});
|
|
1436
|
+
_react.useEffect.call(void 0,
|
|
1437
|
+
() => () => {
|
|
1438
|
+
_optionalChain([session, 'access', _55 => _55.current, 'optionalAccess', _56 => _56.abort, 'call', _57 => _57()]);
|
|
1439
|
+
},
|
|
1440
|
+
[]
|
|
1441
|
+
);
|
|
1442
|
+
_react.useEffect.call(void 0, () => {
|
|
1443
|
+
if (on || !hint) return;
|
|
1444
|
+
const t = setTimeout(() => setHint(null), HINT_MS);
|
|
1445
|
+
return () => clearTimeout(t);
|
|
1446
|
+
}, [on, hint]);
|
|
1447
|
+
const toggle = () => {
|
|
1448
|
+
if (!speech) return;
|
|
1449
|
+
if (session.current) {
|
|
1450
|
+
session.current.stop();
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
_optionalChain([listening, 'optionalAccess', _58 => _58.abort, 'call', _59 => _59()]);
|
|
1454
|
+
setHint(null);
|
|
1455
|
+
let mine = null;
|
|
1456
|
+
let ended = false;
|
|
1457
|
+
const end = () => {
|
|
1458
|
+
ended = true;
|
|
1459
|
+
if (session.current === mine) session.current = null;
|
|
1460
|
+
if (listening === mine) listening = null;
|
|
1461
|
+
setOn(false);
|
|
1462
|
+
};
|
|
1463
|
+
try {
|
|
1464
|
+
mine = speech.start({
|
|
1465
|
+
lang: form.speechLang,
|
|
1466
|
+
hints: _chunkCU4TMSZEjs.dictationHints.call(void 0, panel, choices),
|
|
1467
|
+
onText(text, final) {
|
|
1468
|
+
if (!final) return setHint(text ? `\u201C${text}\u201D` : null);
|
|
1469
|
+
const result = _chunkCU4TMSZEjs.spokenValue.call(void 0, panel, text, latest.current.value, latest.current.choices);
|
|
1470
|
+
if ("value" in result) {
|
|
1471
|
+
latest.current.onChange(result.value);
|
|
1472
|
+
setHint(null);
|
|
1473
|
+
} else setHint(result.problem);
|
|
1474
|
+
},
|
|
1475
|
+
onError: (message) => setHint(message),
|
|
1476
|
+
onEnd: end
|
|
1477
|
+
});
|
|
1478
|
+
} catch (e5) {
|
|
1479
|
+
setHint("Dictation couldn\u2019t start");
|
|
1480
|
+
return;
|
|
1481
|
+
}
|
|
1482
|
+
if (!ended) {
|
|
1483
|
+
session.current = mine;
|
|
1484
|
+
listening = mine;
|
|
1485
|
+
setOn(true);
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
return { available: !!speech && _chunkCU4TMSZEjs.takesDictation.call(void 0, panel), listening: on, hint, toggle };
|
|
1489
|
+
}
|
|
1490
|
+
function MicButton({ dictation, title, size = 32 }) {
|
|
1491
|
+
const theme = useDashTheme();
|
|
1492
|
+
if (!dictation.available) return null;
|
|
1493
|
+
const on = dictation.listening;
|
|
1494
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1495
|
+
_reactnative.Pressable,
|
|
1496
|
+
{
|
|
1497
|
+
onPress: dictation.toggle,
|
|
1498
|
+
accessibilityRole: "button",
|
|
1499
|
+
accessibilityLabel: on ? "Stop dictating" : title ? `Dictate ${title}` : "Dictate",
|
|
1500
|
+
accessibilityState: { selected: on },
|
|
1501
|
+
hitSlop: 6,
|
|
1502
|
+
style: ({ pressed }) => [
|
|
1503
|
+
styles6.mic,
|
|
1504
|
+
{ width: size, height: size, borderRadius: size / 2, borderColor: on ? theme.accent : theme.border },
|
|
1505
|
+
{ backgroundColor: on ? theme.accent : pressed ? theme.grid : theme.surface }
|
|
1506
|
+
],
|
|
1507
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size * 0.55, height: size * 0.55, viewBox: "0 0 24 24", fill: "none", stroke: on ? "#fff" : theme.textSecondary, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1508
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3z" }),
|
|
1509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: "M19 11a7 7 0 0 1-14 0M12 18v3" })
|
|
1510
|
+
] })
|
|
1511
|
+
}
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
function DictationHint({ dictation }) {
|
|
1515
|
+
const theme = useDashTheme();
|
|
1516
|
+
if (!dictation.hint) return null;
|
|
1517
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles6.hint, { color: dictation.listening ? theme.textSecondary : theme.textMuted }], numberOfLines: 1, accessibilityLiveRegion: "polite", children: dictation.hint });
|
|
1518
|
+
}
|
|
1519
|
+
var styles6 = _reactnative.StyleSheet.create({
|
|
1520
|
+
mic: { borderWidth: 1, alignItems: "center", justifyContent: "center" },
|
|
1521
|
+
hint: { fontSize: 12, fontStyle: "italic" }
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1411
1524
|
// src/ui/inputs/InputPanels.tsx
|
|
1412
1525
|
|
|
1413
1526
|
function InputPanelBody({ panel }) {
|
|
@@ -1456,61 +1569,73 @@ function NumberInput({ panel, value, onChange }) {
|
|
|
1456
1569
|
const base = typeof value === "number" ? value : Number(text) || 0;
|
|
1457
1570
|
onChange(Number(clamp2(base + dir * step).toFixed(decimalsOf(step))));
|
|
1458
1571
|
};
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
1462
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1572
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1573
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1574
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberRow, compact && styles7.numberRowCompact], onLayout, children: [
|
|
1575
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepButton, { label: "\u2212", onPress: () => bump(-1), compact }),
|
|
1576
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberField, compact && styles7.numberFieldCompact, { borderColor: theme.border }], children: [
|
|
1577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1578
|
+
_reactnative.TextInput,
|
|
1579
|
+
{
|
|
1580
|
+
value: text,
|
|
1581
|
+
onChangeText: (t) => {
|
|
1582
|
+
setText(t);
|
|
1583
|
+
const n = Number(t.replace(",", "."));
|
|
1584
|
+
if (t.trim() && !Number.isNaN(n)) onChange(clamp2(integer ? Math.round(n) : n));
|
|
1585
|
+
else if (!t.trim()) onChange(null);
|
|
1586
|
+
},
|
|
1587
|
+
keyboardType,
|
|
1588
|
+
placeholder: _nullishCoalesce(placeholder, () => ( "\u2014")),
|
|
1589
|
+
placeholderTextColor: theme.textMuted,
|
|
1590
|
+
style: [styles7.numberText, compact && styles7.numberTextCompact, { color: theme.text }],
|
|
1591
|
+
accessibilityLabel: unit ? `${panel.title} (${unit})` : panel.title,
|
|
1592
|
+
selectTextOnFocus: true
|
|
1593
|
+
}
|
|
1594
|
+
),
|
|
1595
|
+
unit && !compact ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.unit, { color: theme.textMuted }], children: unit }) : null,
|
|
1596
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title, size: compact ? 24 : 28 })
|
|
1597
|
+
] }),
|
|
1598
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepButton, { label: "+", onPress: () => bump(1), compact })
|
|
1481
1599
|
] }),
|
|
1482
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1600
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1483
1601
|
] });
|
|
1484
1602
|
}
|
|
1485
1603
|
function DurationInput({ panel, value, onChange }) {
|
|
1486
1604
|
const theme = useDashTheme();
|
|
1487
|
-
const toDigits = (v) => typeof v === "number" ?
|
|
1605
|
+
const toDigits = (v) => typeof v === "number" ? _chunkCU4TMSZEjs.formatClock.call(void 0, v).replace(/\D/g, "").replace(/^0+/, "") : "";
|
|
1488
1606
|
const [digits, setDigits] = _react.useState.call(void 0, toDigits(value));
|
|
1489
1607
|
const [syncedValue, setSyncedValue] = _react.useState.call(void 0, value);
|
|
1490
1608
|
if (value !== syncedValue) {
|
|
1491
1609
|
setSyncedValue(value);
|
|
1492
|
-
setDigits((d) => value == null ?
|
|
1610
|
+
setDigits((d) => value == null ? _chunkCU4TMSZEjs.parseClockDigits.call(void 0, d) == null ? d : "" : _chunkCU4TMSZEjs.parseClockDigits.call(void 0, d) === value ? d : toDigits(value));
|
|
1493
1611
|
}
|
|
1494
1612
|
const masked = digits ? maskClock(digits) : "";
|
|
1495
|
-
const invalid = !!digits &&
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
{
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1613
|
+
const invalid = !!digits && _chunkCU4TMSZEjs.parseClockDigits.call(void 0, digits) == null;
|
|
1614
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1615
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1616
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles7.numberField, { borderColor: invalid ? theme.danger : theme.border }], children: [
|
|
1617
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1618
|
+
_reactnative.TextInput,
|
|
1619
|
+
{
|
|
1620
|
+
value: masked,
|
|
1621
|
+
onChangeText: (t) => {
|
|
1622
|
+
const d = t.replace(/\D/g, "").replace(/^0+/, "").slice(0, 6);
|
|
1623
|
+
setDigits(d);
|
|
1624
|
+
onChange(_chunkCU4TMSZEjs.parseClockDigits.call(void 0, d));
|
|
1625
|
+
},
|
|
1626
|
+
keyboardType: "number-pad",
|
|
1627
|
+
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "00:00.00")),
|
|
1628
|
+
placeholderTextColor: theme.textMuted,
|
|
1629
|
+
style: [styles7.numberText, { color: invalid ? theme.danger : theme.text }],
|
|
1630
|
+
accessibilityLabel: panel.title,
|
|
1631
|
+
accessibilityHint: "Type the digits only, for example 13245 for 1 minute 32.45 seconds",
|
|
1632
|
+
selection: { start: masked.length, end: masked.length }
|
|
1633
|
+
}
|
|
1634
|
+
),
|
|
1635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title, size: 28 })
|
|
1636
|
+
] }),
|
|
1637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1638
|
+
] });
|
|
1514
1639
|
}
|
|
1515
1640
|
function maskClock(digits) {
|
|
1516
1641
|
const p = digits.slice(-6).padStart(6, "0");
|
|
@@ -1524,8 +1649,8 @@ function StepButton({ label, onPress, compact }) {
|
|
|
1524
1649
|
onPress,
|
|
1525
1650
|
accessibilityRole: "button",
|
|
1526
1651
|
accessibilityLabel: label === "+" ? "Increase" : "Decrease",
|
|
1527
|
-
style: ({ pressed }) => [
|
|
1528
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1652
|
+
style: ({ pressed }) => [styles7.stepBtn, compact && styles7.stepBtnCompact, { borderColor: theme.border, backgroundColor: pressed ? theme.grid : theme.surface }],
|
|
1653
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.stepText, { color: theme.text }], children: label })
|
|
1529
1654
|
}
|
|
1530
1655
|
);
|
|
1531
1656
|
}
|
|
@@ -1539,7 +1664,7 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1539
1664
|
const origin = min < 0 && max > 0 ? toFrac(0) : 0;
|
|
1540
1665
|
const fillStart = Math.min(origin, frac);
|
|
1541
1666
|
const labelAt = (x) => {
|
|
1542
|
-
if (!_optionalChain([labels, 'optionalAccess',
|
|
1667
|
+
if (!_optionalChain([labels, 'optionalAccess', _60 => _60.length])) return void 0;
|
|
1543
1668
|
const i = labels.length === 1 ? 0 : toFrac(x) * (labels.length - 1);
|
|
1544
1669
|
return Number.isInteger(Math.round(i * 1e6) / 1e6) ? labels[Math.round(i)] : void 0;
|
|
1545
1670
|
};
|
|
@@ -1549,17 +1674,17 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1549
1674
|
const raw = min + Math.min(1, Math.max(0, x / size.width)) * (max - min);
|
|
1550
1675
|
onChange(Number((Math.round((raw - min) / step) * step + min).toFixed(decimalsOf(step))));
|
|
1551
1676
|
};
|
|
1552
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1553
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1554
|
-
!_optionalChain([labels, 'optionalAccess',
|
|
1555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1556
|
-
!_optionalChain([labels, 'optionalAccess',
|
|
1677
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.sliderWrap, children: [
|
|
1678
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.sliderLabels, children: [
|
|
1679
|
+
!_optionalChain([labels, 'optionalAccess', _61 => _61.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, { color: theme.textMuted }], children: min }),
|
|
1680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.sliderValue, { color: theme.text }, !!_optionalChain([labels, 'optionalAccess', _62 => _62.length]) && styles7.sliderValueCentered], children: display }),
|
|
1681
|
+
!_optionalChain([labels, 'optionalAccess', _63 => _63.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, { color: theme.textMuted }], children: max })
|
|
1557
1682
|
] }),
|
|
1558
1683
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1559
1684
|
_reactnative.View,
|
|
1560
1685
|
{
|
|
1561
1686
|
onLayout,
|
|
1562
|
-
style:
|
|
1687
|
+
style: styles7.sliderHit,
|
|
1563
1688
|
onStartShouldSetResponder: () => true,
|
|
1564
1689
|
onMoveShouldSetResponder: () => true,
|
|
1565
1690
|
onResponderTerminationRequest: () => false,
|
|
@@ -1570,11 +1695,11 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1570
1695
|
accessibilityActions: [{ name: "increment" }, { name: "decrement" }],
|
|
1571
1696
|
onAccessibilityAction: (e) => onChange(Math.min(max, Math.max(min, (_nullishCoalesce(v, () => ( min))) + (e.nativeEvent.actionName === "increment" ? step : -step)))),
|
|
1572
1697
|
children: [
|
|
1573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { pointerEvents: "none", style: [
|
|
1698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { pointerEvents: "none", style: [styles7.track, { backgroundColor: theme.grid }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1574
1699
|
_reactnative.View,
|
|
1575
1700
|
{
|
|
1576
1701
|
style: [
|
|
1577
|
-
|
|
1702
|
+
styles7.trackFill,
|
|
1578
1703
|
{ left: `${fillStart * 100}%`, width: `${v == null ? 0 : Math.abs(frac - origin) * 100}%`, backgroundColor: theme.accent }
|
|
1579
1704
|
]
|
|
1580
1705
|
}
|
|
@@ -1583,16 +1708,16 @@ function SliderInput({ panel, value, onChange }) {
|
|
|
1583
1708
|
_reactnative.View,
|
|
1584
1709
|
{
|
|
1585
1710
|
pointerEvents: "none",
|
|
1586
|
-
style: [
|
|
1711
|
+
style: [styles7.thumb, { left: frac * size.width - 11, backgroundColor: theme.accent, borderColor: theme.surface }]
|
|
1587
1712
|
}
|
|
1588
1713
|
)
|
|
1589
1714
|
]
|
|
1590
1715
|
}
|
|
1591
1716
|
),
|
|
1592
|
-
!!_optionalChain([labels, 'optionalAccess',
|
|
1717
|
+
!!_optionalChain([labels, 'optionalAccess', _64 => _64.length]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.tickRow, children: labels.map((l, i) => {
|
|
1593
1718
|
const last = labels.length - 1;
|
|
1594
|
-
const edge = i === 0 ?
|
|
1595
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1719
|
+
const edge = i === 0 ? styles7.tickStart : i === last ? styles7.tickEnd : { left: `${i / last * 100}%` };
|
|
1720
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles7.minmax, styles7.tick, edge, { color: theme.textMuted }], numberOfLines: 1, children: l }, i);
|
|
1596
1721
|
}) })
|
|
1597
1722
|
] });
|
|
1598
1723
|
}
|
|
@@ -1602,27 +1727,34 @@ function SelectInput({ panel, value, onChange }) {
|
|
|
1602
1727
|
const { choicesFrom, multi, placeholder } = panel.options;
|
|
1603
1728
|
const choices = _nullishCoalesce((choicesFrom ? form.choices[choicesFrom] : panel.options.choices), () => ( []));
|
|
1604
1729
|
const selected = Array.isArray(value) ? value : value == null ? [] : [value];
|
|
1730
|
+
const dictation = useDictation(panel, value, onChange, choices);
|
|
1605
1731
|
if (!choices.length && placeholder) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted }, children: placeholder });
|
|
1606
|
-
return /* @__PURE__ */ _jsxruntime.
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1732
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.selectWrap, children: [
|
|
1733
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.wrap, children: [
|
|
1734
|
+
choices.map((c) => {
|
|
1735
|
+
const on = selected.includes(c.value);
|
|
1736
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1737
|
+
Chip,
|
|
1738
|
+
{
|
|
1739
|
+
label: c.label,
|
|
1740
|
+
selected: on,
|
|
1741
|
+
onPress: () => {
|
|
1742
|
+
if (!multi) return onChange(on ? null : c.value);
|
|
1743
|
+
const next = on ? selected.filter((s) => s !== c.value) : [...selected, c.value];
|
|
1744
|
+
onChange(next.length ? next : null);
|
|
1745
|
+
}
|
|
1746
|
+
},
|
|
1747
|
+
String(c.value)
|
|
1748
|
+
);
|
|
1749
|
+
}),
|
|
1750
|
+
choices.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title })
|
|
1751
|
+
] }),
|
|
1752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1753
|
+
] });
|
|
1622
1754
|
}
|
|
1623
1755
|
function ToggleInput({ panel, value, onChange }) {
|
|
1624
1756
|
const theme = useDashTheme();
|
|
1625
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1757
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.toggleRow, children: [
|
|
1626
1758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, flex: 1 }, children: value == null ? "Not set" : value ? "Yes" : "No" }),
|
|
1627
1759
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Switch, { value: !!value, onValueChange: (v) => onChange(v), trackColor: { true: theme.accent }, accessibilityLabel: panel.title })
|
|
1628
1760
|
] });
|
|
@@ -1633,7 +1765,7 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1633
1765
|
const min = Math.round(_nullishCoalesce(panel.options.min, () => ( 1)));
|
|
1634
1766
|
const max = Math.round(_nullishCoalesce(panel.options.max, () => ( 5)));
|
|
1635
1767
|
const levels = Array.from({ length: Math.min(Math.max(0, max - min + 1), MAX_RATING_LEVELS) }, (_, i) => min + i);
|
|
1636
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
1768
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.rating, children: levels.map((n) => {
|
|
1637
1769
|
const on = typeof value === "number" && n <= value;
|
|
1638
1770
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1639
1771
|
_reactnative.Pressable,
|
|
@@ -1642,7 +1774,7 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1642
1774
|
accessibilityRole: "button",
|
|
1643
1775
|
accessibilityLabel: `${n} of ${max}`,
|
|
1644
1776
|
accessibilityState: { selected: value === n },
|
|
1645
|
-
style: [
|
|
1777
|
+
style: [styles7.ratingDot, { borderColor: on ? theme.accent : theme.border, backgroundColor: on ? theme.accent : theme.surface }],
|
|
1646
1778
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: on ? "#fff" : theme.textSecondary, fontWeight: "600" }, children: n })
|
|
1647
1779
|
},
|
|
1648
1780
|
n
|
|
@@ -1651,17 +1783,25 @@ function RatingInput({ panel, value, onChange }) {
|
|
|
1651
1783
|
}
|
|
1652
1784
|
function FreeTextInput({ panel, value, onChange }) {
|
|
1653
1785
|
const theme = useDashTheme();
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
{
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1786
|
+
const dictation = useDictation(panel, value, onChange);
|
|
1787
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.dictated, children: [
|
|
1788
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.fill, children: [
|
|
1789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1790
|
+
_reactnative.TextInput,
|
|
1791
|
+
{
|
|
1792
|
+
value: typeof value === "string" ? value : "",
|
|
1793
|
+
onChangeText: (t) => onChange(t || null),
|
|
1794
|
+
placeholder: _nullishCoalesce(panel.options.placeholder, () => ( "Type here")),
|
|
1795
|
+
placeholderTextColor: theme.textMuted,
|
|
1796
|
+
multiline: true,
|
|
1797
|
+
accessibilityLabel: panel.title,
|
|
1798
|
+
style: [styles7.textArea, dictation.available && styles7.textAreaWithMic, { color: theme.text, borderColor: theme.border }]
|
|
1799
|
+
}
|
|
1800
|
+
),
|
|
1801
|
+
dictation.available && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles7.textAreaMic, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title, size: 28 }) })
|
|
1802
|
+
] }),
|
|
1803
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation })
|
|
1804
|
+
] });
|
|
1665
1805
|
}
|
|
1666
1806
|
function SuggestTextInput({ panel, value, onChange }) {
|
|
1667
1807
|
const theme = useDashTheme();
|
|
@@ -1686,30 +1826,38 @@ function SuggestTextInput({ panel, value, onChange }) {
|
|
|
1686
1826
|
}, [store, metric, suggestWith]);
|
|
1687
1827
|
const withText = suggestWith ? form.value(suggestWith) : null;
|
|
1688
1828
|
const own = entries.filter((e) => e.metric === metric);
|
|
1689
|
-
const scoped = suggestWith && typeof withText === "string" && withText.trim() ?
|
|
1829
|
+
const scoped = suggestWith && typeof withText === "string" && withText.trim() ? _chunkCU4TMSZEjs.entriesSavedWith.call(void 0, entries, metric, suggestWith, withText) : [];
|
|
1690
1830
|
const query = typed ? text : "";
|
|
1691
|
-
const fromScoped =
|
|
1692
|
-
const suggestions = (fromScoped.length ? fromScoped :
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1831
|
+
const fromScoped = _chunkCU4TMSZEjs.textSuggestions.call(void 0, scoped, query);
|
|
1832
|
+
const suggestions = (fromScoped.length ? fromScoped : _chunkCU4TMSZEjs.textSuggestions.call(void 0, own, query)).filter((s) => s.toLowerCase() !== text.trim().toLowerCase());
|
|
1833
|
+
const dictation = useDictation(panel, value, (v) => {
|
|
1834
|
+
setTyped(false);
|
|
1835
|
+
onChange(v);
|
|
1836
|
+
});
|
|
1837
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.suggest, children: [
|
|
1838
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.lineRow, children: [
|
|
1839
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1840
|
+
_reactnative.TextInput,
|
|
1841
|
+
{
|
|
1842
|
+
value: text,
|
|
1843
|
+
onChangeText: (t) => {
|
|
1844
|
+
setTyped(!!t);
|
|
1845
|
+
onChange(t || null);
|
|
1846
|
+
},
|
|
1847
|
+
placeholder: _nullishCoalesce(placeholder, () => ( "Type here")),
|
|
1848
|
+
placeholderTextColor: theme.textMuted,
|
|
1849
|
+
style: [styles7.textLine, { color: theme.text, borderColor: theme.border }],
|
|
1850
|
+
accessibilityLabel: panel.title,
|
|
1851
|
+
autoCorrect: false,
|
|
1852
|
+
autoCapitalize: "words",
|
|
1853
|
+
returnKeyType: "done",
|
|
1854
|
+
selectTextOnFocus: true
|
|
1855
|
+
}
|
|
1856
|
+
),
|
|
1857
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MicButton, { dictation, title: panel.title })
|
|
1858
|
+
] }),
|
|
1859
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DictationHint, { dictation }),
|
|
1860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, contentContainerStyle: styles7.wrap, children: suggestions.map((s) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1713
1861
|
Chip,
|
|
1714
1862
|
{
|
|
1715
1863
|
label: s,
|
|
@@ -1728,13 +1876,13 @@ function CounterInput({ panel }) {
|
|
|
1728
1876
|
const { metric, increment = 1, unit } = panel.options;
|
|
1729
1877
|
const [today, setToday] = _react.useState.call(void 0, 0);
|
|
1730
1878
|
_react.useEffect.call(void 0, () => {
|
|
1731
|
-
const load = () => store.list({ metrics: [metric], from:
|
|
1879
|
+
const load = () => store.list({ metrics: [metric], from: _chunkCU4TMSZEjs.startOf.call(void 0, /* @__PURE__ */ new Date(), "d").getTime() }).then((rows) => setToday(rows.reduce((a, e) => a + (_nullishCoalesce(e.value, () => ( 0))), 0)));
|
|
1732
1880
|
load();
|
|
1733
1881
|
return store.subscribe(load);
|
|
1734
1882
|
}, [store, metric]);
|
|
1735
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1883
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles7.counter, children: [
|
|
1736
1884
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
1737
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
1885
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles7.counterValue, { color: theme.text }], children: [
|
|
1738
1886
|
today,
|
|
1739
1887
|
unit ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { fontSize: 14, color: theme.textMuted }, children: ` ${unit}` }) : null
|
|
1740
1888
|
] }),
|
|
@@ -1746,8 +1894,8 @@ function CounterInput({ panel }) {
|
|
|
1746
1894
|
onPress: () => store.add([{ metric, ts: Date.now(), value: increment, text: null }]),
|
|
1747
1895
|
accessibilityRole: "button",
|
|
1748
1896
|
accessibilityLabel: `Add ${increment}`,
|
|
1749
|
-
style: ({ pressed }) => [
|
|
1750
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style:
|
|
1897
|
+
style: ({ pressed }) => [styles7.counterBtn, { backgroundColor: theme.accent, opacity: pressed ? 0.8 : 1 }],
|
|
1898
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: styles7.counterBtnText, children: [
|
|
1751
1899
|
"+",
|
|
1752
1900
|
increment
|
|
1753
1901
|
] })
|
|
@@ -1755,7 +1903,13 @@ function CounterInput({ panel }) {
|
|
|
1755
1903
|
)
|
|
1756
1904
|
] });
|
|
1757
1905
|
}
|
|
1758
|
-
var
|
|
1906
|
+
var styles7 = _reactnative.StyleSheet.create({
|
|
1907
|
+
fill: { flex: 1 },
|
|
1908
|
+
dictated: { flex: 1, gap: 4 },
|
|
1909
|
+
selectWrap: { gap: 4 },
|
|
1910
|
+
lineRow: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1911
|
+
textAreaWithMic: { paddingRight: 44 },
|
|
1912
|
+
textAreaMic: { position: "absolute", top: 8, right: 8 },
|
|
1759
1913
|
numberRow: { flex: 1, flexDirection: "row", alignItems: "center", gap: 8 },
|
|
1760
1914
|
numberField: { flex: 1, flexDirection: "row", alignItems: "center", borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, height: 44 },
|
|
1761
1915
|
// Android gives TextInput default padding that eats into narrow fields.
|
|
@@ -1786,7 +1940,7 @@ var styles6 = _reactnative.StyleSheet.create({
|
|
|
1786
1940
|
rating: { flex: 1, flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 6 },
|
|
1787
1941
|
ratingDot: { flex: 1, maxWidth: 52, aspectRatio: 1, borderRadius: 26, borderWidth: 1, alignItems: "center", justifyContent: "center" },
|
|
1788
1942
|
suggest: { flex: 1, gap: 8 },
|
|
1789
|
-
textLine: { height: 44, borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, paddingVertical: 0, fontSize: 16 },
|
|
1943
|
+
textLine: { flex: 1, height: 44, borderWidth: 1, borderRadius: 8, paddingHorizontal: 10, paddingVertical: 0, fontSize: 16 },
|
|
1790
1944
|
textArea: { flex: 1, borderWidth: 1, borderRadius: 8, padding: 10, fontSize: 15, textAlignVertical: "top" },
|
|
1791
1945
|
counter: { flex: 1, flexDirection: "row", alignItems: "center", gap: 12 },
|
|
1792
1946
|
counterValue: { fontSize: 28, fontWeight: "600", fontVariant: ["tabular-nums"] },
|
|
@@ -1804,9 +1958,9 @@ function titleText(v) {
|
|
|
1804
1958
|
function summaryText(f, v) {
|
|
1805
1959
|
if (v == null || v === "" || Array.isArray(v) && !v.length) return void 0;
|
|
1806
1960
|
if (f.type === "input-toggle") return v ? f.title || "Yes" : void 0;
|
|
1807
|
-
if (f.type === "input-duration" && typeof v === "number") return
|
|
1961
|
+
if (f.type === "input-duration" && typeof v === "number") return _chunkCU4TMSZEjs.formatClock.call(void 0, v);
|
|
1808
1962
|
if (f.type === "input-select" && f.options.choices) {
|
|
1809
|
-
const label = (x) => _nullishCoalesce(_optionalChain([f, 'access',
|
|
1963
|
+
const label = (x) => _nullishCoalesce(_optionalChain([f, 'access', _65 => _65.options, 'access', _66 => _66.choices, 'access', _67 => _67.find, 'call', _68 => _68((c) => c.value === x), 'optionalAccess', _69 => _69.label]), () => ( String(x)));
|
|
1810
1964
|
return Array.isArray(v) ? v.map(label).join(", ") : label(v);
|
|
1811
1965
|
}
|
|
1812
1966
|
const text = Array.isArray(v) ? v.join(", ") : String(v);
|
|
@@ -1823,19 +1977,19 @@ function dropIndex(from, dy, keys, span) {
|
|
|
1823
1977
|
function InputGroupBody({ panel }) {
|
|
1824
1978
|
const theme = useDashTheme();
|
|
1825
1979
|
const form = useInputForm();
|
|
1826
|
-
const group = _optionalChain([form, 'access',
|
|
1980
|
+
const group = _optionalChain([form, 'access', _70 => _70.group, 'optionalCall', _71 => _71(panel)]);
|
|
1827
1981
|
const [collapsed, setCollapsed] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
1828
1982
|
const [drag, setDrag] = _react.useState.call(void 0, null);
|
|
1829
1983
|
const [heights, setHeights] = _react.useState.call(void 0, {});
|
|
1830
1984
|
const dragging = _react.useRef.call(void 0, null);
|
|
1831
|
-
const [wasEdited, setWasEdited] = _react.useState.call(void 0, _optionalChain([group, 'optionalAccess',
|
|
1985
|
+
const [wasEdited, setWasEdited] = _react.useState.call(void 0, _optionalChain([group, 'optionalAccess', _72 => _72.edited]));
|
|
1832
1986
|
if (group && group.edited !== wasEdited) {
|
|
1833
1987
|
setWasEdited(group.edited);
|
|
1834
1988
|
if (!group.edited) setCollapsed(/* @__PURE__ */ new Set());
|
|
1835
1989
|
}
|
|
1836
1990
|
if (!group) return null;
|
|
1837
1991
|
const label = panel.options.itemTitle || "Item";
|
|
1838
|
-
const collapseFilled = (except) => setCollapsed(new Set(group.items.filter((i) => i.key !== except && !
|
|
1992
|
+
const collapseFilled = (except) => setCollapsed(new Set(group.items.filter((i) => i.key !== except && !_chunkCU4TMSZEjs.isEmptyItem.call(void 0, panel, i.values)).map((i) => i.key)));
|
|
1839
1993
|
const toggle = (key) => setCollapsed((c) => {
|
|
1840
1994
|
const next = new Set(c);
|
|
1841
1995
|
if (!next.delete(key)) next.add(key);
|
|
@@ -1869,11 +2023,11 @@ function InputGroupBody({ panel }) {
|
|
|
1869
2023
|
if (to <= i && i < drag.from) return room;
|
|
1870
2024
|
return 0;
|
|
1871
2025
|
};
|
|
1872
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { style:
|
|
2026
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { style: styles8.fill, contentContainerStyle: styles8.list, nestedScrollEnabled: true, keyboardShouldPersistTaps: "handled", scrollEnabled: !drag, children: [
|
|
1873
2027
|
group.items.map((item, i) => {
|
|
1874
2028
|
const named = panel.options.titleFrom ? titleText(item.values[panel.options.titleFrom]) : void 0;
|
|
1875
2029
|
const title = _nullishCoalesce(named, () => ( `${label} ${i + 1}`));
|
|
1876
|
-
const troubled =
|
|
2030
|
+
const troubled = _chunkCU4TMSZEjs.groupFields.call(void 0, panel).some((f) => group.fieldProblem(i, f.options.metric));
|
|
1877
2031
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1878
2032
|
ItemCard,
|
|
1879
2033
|
{
|
|
@@ -1890,7 +2044,7 @@ function InputGroupBody({ panel }) {
|
|
|
1890
2044
|
group.duplicate(i);
|
|
1891
2045
|
},
|
|
1892
2046
|
dragOffset: shift(i, item.key),
|
|
1893
|
-
lifted: _optionalChain([drag, 'optionalAccess',
|
|
2047
|
+
lifted: _optionalChain([drag, 'optionalAccess', _73 => _73.key]) === item.key,
|
|
1894
2048
|
onLayout: (h) => setHeights((all) => all[item.key] === h ? all : { ...all, [item.key]: h }),
|
|
1895
2049
|
handle: {
|
|
1896
2050
|
onStartShouldSetResponder: () => true,
|
|
@@ -1913,7 +2067,7 @@ function InputGroupBody({ panel }) {
|
|
|
1913
2067
|
group.add();
|
|
1914
2068
|
},
|
|
1915
2069
|
accessibilityRole: "button",
|
|
1916
|
-
style: ({ pressed }) => [
|
|
2070
|
+
style: ({ pressed }) => [styles8.add, { borderColor: theme.accent, opacity: pressed ? 0.7 : 1 }],
|
|
1917
2071
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: { color: theme.accent, fontWeight: "600" }, children: [
|
|
1918
2072
|
"+ ",
|
|
1919
2073
|
panel.options.addLabel || `Add ${label.toLowerCase()}`
|
|
@@ -1924,7 +2078,7 @@ function InputGroupBody({ panel }) {
|
|
|
1924
2078
|
}
|
|
1925
2079
|
function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle, onDuplicate, dragOffset, lifted, onLayout, handle }) {
|
|
1926
2080
|
const theme = useDashTheme();
|
|
1927
|
-
const fields = _react.useMemo.call(void 0, () =>
|
|
2081
|
+
const fields = _react.useMemo.call(void 0, () => _chunkCU4TMSZEjs.groupFields.call(void 0, panel), [panel]);
|
|
1928
2082
|
const item = group.items[index];
|
|
1929
2083
|
const scoped = _react.useMemo.call(void 0,
|
|
1930
2084
|
() => ({
|
|
@@ -1944,7 +2098,7 @@ function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle,
|
|
|
1944
2098
|
accessibilityRole: "button",
|
|
1945
2099
|
accessibilityLabel: a11y,
|
|
1946
2100
|
hitSlop: 6,
|
|
1947
|
-
style: ({ pressed }) => [
|
|
2101
|
+
style: ({ pressed }) => [styles8.iconBtn, { opacity: disabled ? 0.3 : pressed ? 0.6 : 1 }],
|
|
1948
2102
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontSize: 15 }, children: text })
|
|
1949
2103
|
}
|
|
1950
2104
|
);
|
|
@@ -1954,41 +2108,41 @@ function ItemCard({ panel, group, form, index, title, last, collapsed, onToggle,
|
|
|
1954
2108
|
{
|
|
1955
2109
|
onLayout: (e) => onLayout(e.nativeEvent.layout.height),
|
|
1956
2110
|
style: [
|
|
1957
|
-
|
|
2111
|
+
styles8.item,
|
|
1958
2112
|
{ borderColor: lifted ? theme.accent : theme.border, backgroundColor: theme.surface },
|
|
1959
2113
|
!!dragOffset && { transform: [{ translateY: dragOffset }] },
|
|
1960
2114
|
lifted && { zIndex: 1, opacity: 0.95 }
|
|
1961
2115
|
],
|
|
1962
2116
|
children: [
|
|
1963
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1964
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ...handle, style:
|
|
1965
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Pressable, { onPress: onToggle, style:
|
|
1966
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
2117
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles8.itemHeader, children: [
|
|
2118
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ...handle, style: styles8.handle, accessibilityLabel: `Drag ${title} to reorder`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted, fontSize: 16 }, children: "\u2261" }) }),
|
|
2119
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Pressable, { onPress: onToggle, style: styles8.titleArea, accessibilityRole: "button", accessibilityLabel: `${collapsed ? "Expand" : "Collapse"} ${title}`, accessibilityState: { expanded: !collapsed }, children: [
|
|
2120
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles8.itemTitle, { color: theme.text }], numberOfLines: 1, children: [
|
|
1967
2121
|
collapsed ? "\u25B8 " : "\u25BE ",
|
|
1968
2122
|
title
|
|
1969
2123
|
] }),
|
|
1970
|
-
!!summary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2124
|
+
!!summary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.summary, { color: theme.textSecondary }], numberOfLines: 1, children: summary })
|
|
1971
2125
|
] }),
|
|
1972
2126
|
button("\u2191", () => group.move(index, -1), `Move ${title} up`, index === 0),
|
|
1973
2127
|
button("\u2193", () => group.move(index, 1), `Move ${title} down`, last),
|
|
1974
2128
|
button("\u29C9", onDuplicate, `Duplicate ${title}`, !group.canAdd),
|
|
1975
2129
|
button("\u2715", () => group.remove(index), `Remove ${title}`)
|
|
1976
2130
|
] }),
|
|
1977
|
-
!collapsed && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: scoped, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
1978
|
-
const problem = _optionalChain([scoped, 'access',
|
|
1979
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
1980
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
1981
|
-
!!f.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
1982
|
-
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2131
|
+
!collapsed && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputFormContext.Provider, { value: scoped, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles8.fields, children: fields.map((f) => {
|
|
2132
|
+
const problem = _optionalChain([scoped, 'access', _74 => _74.problem, 'optionalCall', _75 => _75(f.options.metric)]);
|
|
2133
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles8.field, { width: `${Math.min(24, Math.max(1, f.gridPos.w)) / 24 * 100}%` }], children: [
|
|
2134
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles8.fieldHeader, children: [
|
|
2135
|
+
!!f.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.fieldTitle, { color: theme.textSecondary }], numberOfLines: 1, children: f.title }),
|
|
2136
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles8.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem })
|
|
1983
2137
|
] }),
|
|
1984
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles8.fieldBody, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputPanelBody, { panel: f }) })
|
|
1985
2139
|
] }, f.options.metric);
|
|
1986
2140
|
}) }) })
|
|
1987
2141
|
]
|
|
1988
2142
|
}
|
|
1989
2143
|
);
|
|
1990
2144
|
}
|
|
1991
|
-
var
|
|
2145
|
+
var styles8 = _reactnative.StyleSheet.create({
|
|
1992
2146
|
fill: { flex: 1 },
|
|
1993
2147
|
list: { gap: 8, paddingBottom: 4 },
|
|
1994
2148
|
item: { borderWidth: 1, borderRadius: 8, padding: 8, gap: 6 },
|
|
@@ -2022,17 +2176,17 @@ function StatPanel({ panel, frames }) {
|
|
|
2022
2176
|
const theme = useDashTheme();
|
|
2023
2177
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2024
2178
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2025
|
-
const horizontal = _optionalChain([panel, 'access',
|
|
2026
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2179
|
+
const horizontal = _optionalChain([panel, 'access', _76 => _76.options, 'optionalAccess', _77 => _77.orientation]) === "horizontal";
|
|
2180
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.grid, { flexDirection: horizontal ? "column" : "row" }], children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatTile, { v, showName: values.length > 1, panel }, v.key)) });
|
|
2027
2181
|
}
|
|
2028
2182
|
function StatTile({ v, showName, panel }) {
|
|
2029
2183
|
const theme = useDashTheme();
|
|
2030
2184
|
const [size, onLayout] = useLayout();
|
|
2031
|
-
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2032
|
-
const graph = (_nullishCoalesce(_optionalChain([panel, 'access',
|
|
2185
|
+
const colorMode = _nullishCoalesce(_optionalChain([panel, 'access', _78 => _78.options, 'optionalAccess', _79 => _79.colorMode]), () => ( "value"));
|
|
2186
|
+
const graph = (_nullishCoalesce(_optionalChain([panel, 'access', _80 => _80.options, 'optionalAccess', _81 => _81.graphMode]), () => ( "area"))) === "area" && v.sparkline.filter((x) => x != null).length > 1;
|
|
2033
2187
|
const fontSize = Math.max(18, Math.min(56, size.height * (graph ? 0.4 : 0.5), size.width / 4.5));
|
|
2034
2188
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2035
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2189
|
+
const hasLinks = !!_optionalChain([v, 'access', _82 => _82.config, 'access', _83 => _83.links, 'optionalAccess', _84 => _84.length]);
|
|
2036
2190
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2037
2191
|
_reactnative.Pressable,
|
|
2038
2192
|
{
|
|
@@ -2041,17 +2195,17 @@ function StatTile({ v, showName, panel }) {
|
|
|
2041
2195
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
2042
2196
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
2043
2197
|
style: ({ pressed }) => [
|
|
2044
|
-
|
|
2198
|
+
styles9.tile,
|
|
2045
2199
|
// With a sparkline, the number sits in the top half so the line runs beneath it.
|
|
2046
2200
|
graph && { justifyContent: "flex-start", paddingTop: 4 },
|
|
2047
2201
|
colorMode === "background" && { backgroundColor: withAlpha(v.stateColor, 0.14) },
|
|
2048
2202
|
pressed && { opacity: 0.7 }
|
|
2049
2203
|
],
|
|
2050
2204
|
children: [
|
|
2051
|
-
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2205
|
+
colorMode !== "none" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles9.accent, { backgroundColor: v.stateColor }] }),
|
|
2052
2206
|
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 }),
|
|
2053
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2207
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
2208
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles9.value, { color: theme.text, fontSize }], numberOfLines: 1, adjustsFontSizeToFit: true, children: v.text })
|
|
2055
2209
|
]
|
|
2056
2210
|
}
|
|
2057
2211
|
);
|
|
@@ -2066,7 +2220,7 @@ function Sparkline({ values, width, height, color }) {
|
|
|
2066
2220
|
values.forEach((v, i) => {
|
|
2067
2221
|
if (v != null) line += `${line ? "L" : "M"}${x(i)},${y(v)}`;
|
|
2068
2222
|
});
|
|
2069
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style:
|
|
2223
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width, height, style: styles9.spark, children: [
|
|
2070
2224
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: `${line}L${width},${height}L0,${height}Z`, fill: color, opacity: 0.1 }),
|
|
2071
2225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Path, { d: line, stroke: color, strokeWidth: 2, fill: "none", strokeLinejoin: "round" })
|
|
2072
2226
|
] });
|
|
@@ -2075,7 +2229,7 @@ function withAlpha(hex, alpha) {
|
|
|
2075
2229
|
if (!/^#[0-9a-f]{6}$/i.test(hex)) return hex;
|
|
2076
2230
|
return `${hex}${Math.round(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
2077
2231
|
}
|
|
2078
|
-
var
|
|
2232
|
+
var styles9 = _reactnative.StyleSheet.create({
|
|
2079
2233
|
grid: { flex: 1, gap: 8 },
|
|
2080
2234
|
tile: { flex: 1, justifyContent: "center", paddingLeft: 12, borderRadius: 6, overflow: "hidden" },
|
|
2081
2235
|
accent: { position: "absolute", left: 0, top: 6, bottom: 6, width: 3, borderRadius: 2 },
|
|
@@ -2091,13 +2245,13 @@ function GaugePanel({ panel, frames }) {
|
|
|
2091
2245
|
const theme = useDashTheme();
|
|
2092
2246
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2093
2247
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2094
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2248
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles10.row, children: values.map((v) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Gauge, { v, showName: values.length > 1, panel }, v.key)) });
|
|
2095
2249
|
}
|
|
2096
2250
|
function Gauge({ v, showName, panel }) {
|
|
2097
2251
|
const theme = useDashTheme();
|
|
2098
2252
|
const [size, onLayout] = useLayout();
|
|
2099
2253
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2100
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2254
|
+
const hasLinks = !!_optionalChain([v, 'access', _85 => _85.config, 'access', _86 => _86.links, 'optionalAccess', _87 => _87.length]);
|
|
2101
2255
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
2102
2256
|
const max = _nullishCoalesce(v.config.max, () => ( 100));
|
|
2103
2257
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
@@ -2109,7 +2263,7 @@ function Gauge({ v, showName, panel }) {
|
|
|
2109
2263
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2110
2264
|
_reactnative.Pressable,
|
|
2111
2265
|
{
|
|
2112
|
-
style: ({ pressed }) => [
|
|
2266
|
+
style: ({ pressed }) => [styles10.fill, pressed && { opacity: 0.7 }],
|
|
2113
2267
|
onLayout,
|
|
2114
2268
|
disabled: !hasLinks,
|
|
2115
2269
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
@@ -2119,9 +2273,9 @@ function Gauge({ v, showName, panel }) {
|
|
|
2119
2273
|
/* @__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" }),
|
|
2120
2274
|
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" })
|
|
2121
2275
|
] }),
|
|
2122
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill,
|
|
2123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2124
|
-
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2276
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [_reactnative.StyleSheet.absoluteFill, styles10.center, { top: d * 0.12 }], pointerEvents: "none", children: [
|
|
2277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.value, { color: theme.text, fontSize: Math.max(14, d * 0.18) }], numberOfLines: 1, adjustsFontSizeToFit: true, children: v.text }),
|
|
2278
|
+
showName && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name })
|
|
2125
2279
|
] })
|
|
2126
2280
|
]
|
|
2127
2281
|
}
|
|
@@ -2140,32 +2294,32 @@ function BarGaugePanel({ panel, frames }) {
|
|
|
2140
2294
|
const values = _react.useMemo.call(void 0, () => reducedValues(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
2141
2295
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
2142
2296
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
2143
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
2297
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles10.bars, children: values.map((v) => {
|
|
2144
2298
|
const min = _nullishCoalesce(v.config.min, () => ( 0));
|
|
2145
2299
|
const max = _nullishCoalesce(v.config.max, () => ( Math.max(...values.map((o) => _nullishCoalesce(o.value, () => ( 0))), 1)));
|
|
2146
2300
|
const frac = v.value == null ? 0 : Math.min(1, Math.max(0, (v.value - min) / (max - min || 1)));
|
|
2147
|
-
const color = v.config.thresholds || _optionalChain([v, 'access',
|
|
2148
|
-
const hasLinks = !!_optionalChain([v, 'access',
|
|
2301
|
+
const color = v.config.thresholds || _optionalChain([v, 'access', _88 => _88.mapped, 'optionalAccess', _89 => _89.color]) ? v.stateColor : _chunkCU4TMSZEjs.resolveColor.call(void 0, _optionalChain([v, 'access', _90 => _90.config, 'access', _91 => _91.color, 'optionalAccess', _92 => _92.fixedColor]), v.color);
|
|
2302
|
+
const hasLinks = !!_optionalChain([v, 'access', _93 => _93.config, 'access', _94 => _94.links, 'optionalAccess', _95 => _95.length]);
|
|
2149
2303
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2150
2304
|
_reactnative.Pressable,
|
|
2151
2305
|
{
|
|
2152
|
-
style: ({ pressed }) => [
|
|
2306
|
+
style: ({ pressed }) => [styles10.barRow, pressed && { opacity: 0.7 }],
|
|
2153
2307
|
disabled: !hasLinks,
|
|
2154
2308
|
onPress: () => openLinks(valueLinks(panel, v, resolve), v.name),
|
|
2155
2309
|
accessibilityRole: hasLinks ? "link" : void 0,
|
|
2156
2310
|
children: [
|
|
2157
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2159
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
2311
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles10.barLabels, children: [
|
|
2312
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.name, { color: theme.textSecondary }], numberOfLines: 1, children: v.name }),
|
|
2313
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles10.barValue, { color: theme.text }], children: v.text })
|
|
2160
2314
|
] }),
|
|
2161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
2315
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles10.track, { backgroundColor: withAlpha(color, 0.18) }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles10.meter, { width: `${frac * 100}%`, backgroundColor: color }] }) })
|
|
2162
2316
|
]
|
|
2163
2317
|
},
|
|
2164
2318
|
v.key
|
|
2165
2319
|
);
|
|
2166
2320
|
}) });
|
|
2167
2321
|
}
|
|
2168
|
-
var
|
|
2322
|
+
var styles10 = _reactnative.StyleSheet.create({
|
|
2169
2323
|
fill: { flex: 1 },
|
|
2170
2324
|
row: { flex: 1, flexDirection: "row", gap: 8 },
|
|
2171
2325
|
center: { alignItems: "center", justifyContent: "center" },
|
|
@@ -2208,8 +2362,8 @@ var TILE_LAYERS = /* @__PURE__ */ new Set(["default", "carto", "esri-xyz", "xyz"
|
|
|
2208
2362
|
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));
|
|
2209
2363
|
var stripTags = (html) => html.replace(/<[^>]*>/g, "").replace(/©/g, "\xA9").trim();
|
|
2210
2364
|
function tileSource(layer, scheme, retina = false) {
|
|
2211
|
-
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess',
|
|
2212
|
-
switch (_optionalChain([layer, 'optionalAccess',
|
|
2365
|
+
const config = _nullishCoalesce(_optionalChain([layer, 'optionalAccess', _96 => _96.config]), () => ( {}));
|
|
2366
|
+
switch (_optionalChain([layer, 'optionalAccess', _97 => _97.type])) {
|
|
2213
2367
|
case "osm-standard":
|
|
2214
2368
|
return { url: (z, x, y) => `https://tile.openstreetmap.org/${z}/${x}/${y}.png`, maxZoom: 19, attribution: "\xA9 OpenStreetMap contributors" };
|
|
2215
2369
|
case "esri-xyz": {
|
|
@@ -2270,11 +2424,11 @@ var REGIONS = {
|
|
|
2270
2424
|
oceania: { lat: -10, lon: -140, zoom: 3 }
|
|
2271
2425
|
};
|
|
2272
2426
|
function zoomLimits(panel) {
|
|
2273
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2427
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _98 => _98.options, 'optionalAccess', _99 => _99.view]), () => ( {}));
|
|
2274
2428
|
return [_nullishCoalesce(v.minZoom, () => ( 0)), _nullishCoalesce(v.maxZoom, () => ( MAX_ZOOM))];
|
|
2275
2429
|
}
|
|
2276
2430
|
function initialView(panel, layers, width, height) {
|
|
2277
|
-
const v = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2431
|
+
const v = _nullishCoalesce(_optionalChain([panel, 'access', _100 => _100.options, 'optionalAccess', _101 => _101.view]), () => ( {}));
|
|
2278
2432
|
const [minZoom, maxZoom] = zoomLimits(panel);
|
|
2279
2433
|
const limit = (view) => ({ ...view, zoom: clamp(view.zoom, minZoom, maxZoom) });
|
|
2280
2434
|
if (v.id === "coords") return limit({ lat: _nullishCoalesce(v.lat, () => ( 0)), lon: _nullishCoalesce(v.lon, () => ( 0)), zoom: _nullishCoalesce(v.zoom, () => ( 1)) });
|
|
@@ -2307,7 +2461,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2307
2461
|
const o = _nullishCoalesce(panel.options, () => ( {}));
|
|
2308
2462
|
const out = [];
|
|
2309
2463
|
const basemap = o.basemap;
|
|
2310
|
-
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess',
|
|
2464
|
+
out.push({ type: "tiles", key: "basemap", name: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _102 => _102.name]), () => ( "Basemap")), opacity: _nullishCoalesce(_optionalChain([basemap, 'optionalAccess', _103 => _103.opacity]), () => ( 1)), source: tileSource(basemap, scheme, retina) });
|
|
2311
2465
|
const multiple = frames.length > 1;
|
|
2312
2466
|
(_nullishCoalesce(o.layers, () => ( DEFAULT_LAYERS))).forEach((layer, li) => {
|
|
2313
2467
|
const key = `${li}/${layer.type}`;
|
|
@@ -2320,12 +2474,12 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2320
2474
|
}
|
|
2321
2475
|
if (!isDataLayer(layer.type)) return;
|
|
2322
2476
|
const filter = layer.filterData;
|
|
2323
|
-
const chosen = _optionalChain([filter, 'optionalAccess',
|
|
2477
|
+
const chosen = _optionalChain([filter, 'optionalAccess', _104 => _104.id]) === "byRefId" && filter.options ? frames.filter((f) => f.refId === filter.options) : frames;
|
|
2324
2478
|
const style = _nullishCoalesce(config.style, () => ( {}));
|
|
2325
2479
|
const color = _nullishCoalesce(style.color, () => ( {}));
|
|
2326
2480
|
const size = _nullishCoalesce(style.size, () => ( {}));
|
|
2327
2481
|
const text = style.text;
|
|
2328
|
-
const fixedColor =
|
|
2482
|
+
const fixedColor = _chunkCU4TMSZEjs.resolveColor.call(void 0, _nullishCoalesce(color.fixed, () => ( "dark-green")), "#37872D");
|
|
2329
2483
|
const heat = layer.type === "heatmap";
|
|
2330
2484
|
const weight = _nullishCoalesce(config.weight, () => ( {}));
|
|
2331
2485
|
const legend = [];
|
|
@@ -2337,14 +2491,14 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2337
2491
|
let { xs, ys } = located;
|
|
2338
2492
|
if (layer.type === "lastPointTracker" && rows.length) [rows, xs, ys] = [rows.slice(-1), xs.slice(-1), ys.slice(-1)];
|
|
2339
2493
|
const find = (field) => field ? fieldByName(frame, field, multiple) : void 0;
|
|
2340
|
-
const configOf = (f) =>
|
|
2494
|
+
const configOf = (f) => _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, f, frame, _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, f, frame, multiple));
|
|
2341
2495
|
let colors = rows.map(() => fixedColor);
|
|
2342
2496
|
const colorField = !heat ? find(color.field) : void 0;
|
|
2343
2497
|
if (colorField) {
|
|
2344
2498
|
const cConfig = configOf(colorField);
|
|
2345
2499
|
const values = rows.map((i) => num(colorField.values[i]));
|
|
2346
2500
|
const extent = range(values);
|
|
2347
|
-
colors = values.map((v) =>
|
|
2501
|
+
colors = values.map((v) => _chunkCU4TMSZEjs.valueColor.call(void 0, v, cConfig, fixedColor, extent));
|
|
2348
2502
|
if (showsLegend(layer) && legend.length === 0) legend.push(...thresholdLegend(`${key}/${frames.indexOf(frame)}`, cConfig, fixedColor));
|
|
2349
2503
|
}
|
|
2350
2504
|
const dim = heat ? weight : size;
|
|
@@ -2380,7 +2534,7 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2380
2534
|
name,
|
|
2381
2535
|
opacity,
|
|
2382
2536
|
points,
|
|
2383
|
-
symbol: markerSymbol(_optionalChain([style, 'access',
|
|
2537
|
+
symbol: markerSymbol(_optionalChain([style, 'access', _105 => _105.symbol, 'optionalAccess', _106 => _106.fixed])),
|
|
2384
2538
|
fillOpacity: _nullishCoalesce(style.opacity, () => ( 0.4)),
|
|
2385
2539
|
fontSize: _nullishCoalesce(textConfig.fontSize, () => ( 12)),
|
|
2386
2540
|
labelOffset: [_nullishCoalesce(textConfig.offsetX, () => ( 0)), _nullishCoalesce(textConfig.offsetY, () => ( 0))],
|
|
@@ -2391,37 +2545,37 @@ function geomapLayers(panel, frames, scheme, retina = false, gazetteers = {}) {
|
|
|
2391
2545
|
});
|
|
2392
2546
|
return out;
|
|
2393
2547
|
}
|
|
2394
|
-
var showsLegend = (layer) => _optionalChain([layer, 'access',
|
|
2548
|
+
var showsLegend = (layer) => _optionalChain([layer, 'access', _107 => _107.config, 'optionalAccess', _108 => _108.showLegend]) !== false;
|
|
2395
2549
|
function markerSymbol(path) {
|
|
2396
2550
|
const name = typeof path === "string" ? path.replace(/^.*\//, "").replace(/\.svg$/, "") : "";
|
|
2397
2551
|
return name === "square" || name === "triangle" || name === "star" || name === "cross" || name === "x" ? name : "circle";
|
|
2398
2552
|
}
|
|
2399
2553
|
function thresholdLegend(key, config, fallback) {
|
|
2400
|
-
if (_optionalChain([config, 'access',
|
|
2401
|
-
const steps = _nullishCoalesce(_optionalChain([config, 'access',
|
|
2554
|
+
if (_optionalChain([config, 'access', _109 => _109.color, 'optionalAccess', _110 => _110.mode]) && config.color.mode !== "thresholds") return [];
|
|
2555
|
+
const steps = _nullishCoalesce(_optionalChain([config, 'access', _111 => _111.thresholds, 'optionalAccess', _112 => _112.steps]), () => ( []));
|
|
2402
2556
|
if (steps.length < 2) return [];
|
|
2403
2557
|
return steps.map((s, i) => ({
|
|
2404
2558
|
key: `${key}/${i}`,
|
|
2405
|
-
name: s.value == null ? `< ${
|
|
2406
|
-
color:
|
|
2559
|
+
name: s.value == null ? `< ${_chunkCU4TMSZEjs.formatValue.call(void 0, steps[i + 1].value, config)}` : `${_chunkCU4TMSZEjs.formatValue.call(void 0, s.value, config)}+`,
|
|
2560
|
+
color: _chunkCU4TMSZEjs.resolveColor.call(void 0, s.color, fallback)
|
|
2407
2561
|
}));
|
|
2408
2562
|
}
|
|
2409
2563
|
var isDataLayer = (type) => type === "markers" || type === "heatmap" || type === "route" || type === "lastPointTracker";
|
|
2410
2564
|
var lookupField = (frame) => frame.fields.find((f) => f.name.toLowerCase() === "lookup");
|
|
2411
2565
|
function gazetteerPaths(panel, frames) {
|
|
2412
2566
|
const paths = /* @__PURE__ */ new Set();
|
|
2413
|
-
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2567
|
+
for (const layer of _nullishCoalesce(_optionalChain([panel, 'access', _113 => _113.options, 'optionalAccess', _114 => _114.layers]), () => ( DEFAULT_LAYERS))) {
|
|
2414
2568
|
if (!isDataLayer(layer.type)) continue;
|
|
2415
|
-
const mode = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
2416
|
-
if (mode === "lookup") paths.add(_optionalChain([layer, 'access',
|
|
2417
|
-
else if (mode === "auto" && frames.some(lookupField)) paths.add(
|
|
2569
|
+
const mode = _nullishCoalesce(_optionalChain([layer, 'access', _115 => _115.location, 'optionalAccess', _116 => _116.mode]), () => ( "auto"));
|
|
2570
|
+
if (mode === "lookup") paths.add(_optionalChain([layer, 'access', _117 => _117.location, 'optionalAccess', _118 => _118.gazetteer]) || _chunkCU4TMSZEjs.DEFAULT_GAZETTEER);
|
|
2571
|
+
else if (mode === "auto" && frames.some(lookupField)) paths.add(_chunkCU4TMSZEjs.DEFAULT_GAZETTEER);
|
|
2418
2572
|
}
|
|
2419
2573
|
return [...paths];
|
|
2420
2574
|
}
|
|
2421
2575
|
var LAT_NAMES = ["lat", "latitude"];
|
|
2422
2576
|
var LON_NAMES = ["lon", "lng", "long", "longitude"];
|
|
2423
2577
|
function fieldByName(frame, name, multiple) {
|
|
2424
|
-
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) =>
|
|
2578
|
+
return _nullishCoalesce(frame.fields.find((f) => f.name === name), () => ( frame.fields.find((f) => _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, f, frame, multiple) === name)));
|
|
2425
2579
|
}
|
|
2426
2580
|
function locate2(frame, location = {}, gazetteers = {}) {
|
|
2427
2581
|
const mode = _nullishCoalesce(location.mode, () => ( "auto"));
|
|
@@ -2440,10 +2594,10 @@ function locate2(frame, location = {}, gazetteers = {}) {
|
|
|
2440
2594
|
lat = named(LAT_NAMES);
|
|
2441
2595
|
lon = named(LON_NAMES);
|
|
2442
2596
|
if (!lat || !lon) hash = named(["geohash"]);
|
|
2443
|
-
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[
|
|
2597
|
+
if ((!lat || !lon) && !hash) [lookup, gazetteer] = [lookupField(frame), gazetteers[_chunkCU4TMSZEjs.DEFAULT_GAZETTEER]];
|
|
2444
2598
|
} else if (mode === "lookup") {
|
|
2445
2599
|
lookup = location.lookup ? fieldByName(frame, location.lookup, false) : lookupField(frame);
|
|
2446
|
-
gazetteer = gazetteers[location.gazetteer ||
|
|
2600
|
+
gazetteer = gazetteers[location.gazetteer || _chunkCU4TMSZEjs.DEFAULT_GAZETTEER];
|
|
2447
2601
|
}
|
|
2448
2602
|
const rows = [];
|
|
2449
2603
|
const xs = [];
|
|
@@ -2492,8 +2646,8 @@ function decodeGeohash(hash) {
|
|
|
2492
2646
|
}
|
|
2493
2647
|
function cellText(field, v, config) {
|
|
2494
2648
|
if (v == null) return "";
|
|
2495
|
-
if (field.type === "number") return
|
|
2496
|
-
if (field.type === "time") return new Date(
|
|
2649
|
+
if (field.type === "number") return _chunkCU4TMSZEjs.formatDisplay.call(void 0, Number(v), config);
|
|
2650
|
+
if (field.type === "time") return new Date(_chunkCU4TMSZEjs.toMillis.call(void 0, v)).toLocaleString();
|
|
2497
2651
|
return String(v);
|
|
2498
2652
|
}
|
|
2499
2653
|
function num(v) {
|
|
@@ -2633,13 +2787,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2633
2787
|
])
|
|
2634
2788
|
);
|
|
2635
2789
|
}, [layers, view, size.width, size.height]);
|
|
2636
|
-
const tooltips = _optionalChain([panel, 'access',
|
|
2790
|
+
const tooltips = _optionalChain([panel, 'access', _119 => _119.options, 'optionalAccess', _120 => _120.tooltip, 'optionalAccess', _121 => _121.mode]) !== "none";
|
|
2637
2791
|
const pick = (x, y) => {
|
|
2638
2792
|
let best = null;
|
|
2639
2793
|
let bestD = HIT_PX * HIT_PX;
|
|
2640
2794
|
for (const l of layers) {
|
|
2641
2795
|
if (l.type === "tiles" || l.type === "heatmap" || !l.tooltip) continue;
|
|
2642
|
-
_optionalChain([screen, 'access',
|
|
2796
|
+
_optionalChain([screen, 'access', _122 => _122.get, 'call', _123 => _123(l.key), 'optionalAccess', _124 => _124.forEach, 'call', _125 => _125(({ px, py }, group) => {
|
|
2643
2797
|
for (let i = 0; i < px.length; i++) {
|
|
2644
2798
|
const d = (px[i] - x) ** 2 + (py[i] - y) ** 2;
|
|
2645
2799
|
if (d <= bestD) {
|
|
@@ -2689,12 +2843,12 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2689
2843
|
}
|
|
2690
2844
|
};
|
|
2691
2845
|
const shown = picked && resolvePicked(layers, screen, picked);
|
|
2692
|
-
const controls = _nullishCoalesce(_optionalChain([panel, 'access',
|
|
2846
|
+
const controls = _nullishCoalesce(_optionalChain([panel, 'access', _126 => _126.options, 'optionalAccess', _127 => _127.controls]), () => ( {}));
|
|
2693
2847
|
const attribution = [...new Set(layers.flatMap((l) => l.type === "tiles" && l.source.attribution ? [l.source.attribution] : []))].join(" ");
|
|
2694
2848
|
const legend = layers.flatMap((l) => l.type === "markers" || l.type === "route" ? l.legend : []);
|
|
2695
2849
|
const ready = size.width > 0 && size.height > 0;
|
|
2696
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2697
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
2850
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.fill, children: [
|
|
2851
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles11.fill, styles11.map, { backgroundColor: theme.grid }], onLayout, ...responder, children: [
|
|
2698
2852
|
ready && // Nothing inside takes touches, so locationX/Y are always relative to the map.
|
|
2699
2853
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { pointerEvents: "none", style: _reactnative.StyleSheet.absoluteFill, children: [
|
|
2700
2854
|
layers.map(
|
|
@@ -2722,13 +2876,13 @@ function GeomapPanel({ panel, frames }) {
|
|
|
2722
2876
|
onOpenLink: (l) => links.openLinks([l])
|
|
2723
2877
|
}
|
|
2724
2878
|
),
|
|
2725
|
-
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
2879
|
+
controls.showZoom !== false && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles11.zoom, children: [
|
|
2726
2880
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "+", onPress: () => zoomTo(view, Math.round(view.zoom) + 1) }),
|
|
2727
2881
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u2212", onPress: () => zoomTo(view, Math.round(view.zoom) - 1) }),
|
|
2728
2882
|
moved && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MapButton, { label: "\u27F2", onPress: () => setMoved(null) })
|
|
2729
2883
|
] }),
|
|
2730
|
-
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2731
|
-
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [
|
|
2884
|
+
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [styles11.error, { color: theme.danger, backgroundColor: theme.surface }], numberOfLines: 2, children: error }) : null,
|
|
2885
|
+
controls.showAttribution !== false && attribution ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { pointerEvents: "none", style: [styles11.attribution, { color: theme.textSecondary, backgroundColor: theme.surface }], numberOfLines: 1, children: attribution }) : null
|
|
2732
2886
|
] }),
|
|
2733
2887
|
legend.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: legend })
|
|
2734
2888
|
] });
|
|
@@ -2743,17 +2897,17 @@ function useGazetteers(panel, frames) {
|
|
|
2743
2897
|
let live = true;
|
|
2744
2898
|
let ds;
|
|
2745
2899
|
try {
|
|
2746
|
-
ds = _optionalChain([resolve, 'optionalCall',
|
|
2747
|
-
} catch (
|
|
2900
|
+
ds = _optionalChain([resolve, 'optionalCall', _128 => _128(_chunkCU4TMSZEjs.normalizeRef.call(void 0, panel.datasource))]);
|
|
2901
|
+
} catch (e6) {
|
|
2748
2902
|
}
|
|
2749
2903
|
const paths = key.split("\n");
|
|
2750
|
-
Promise.allSettled(paths.map((p) =>
|
|
2904
|
+
Promise.allSettled(paths.map((p) => _chunkCU4TMSZEjs.loadGazetteer.call(void 0, p, ds))).then((results) => {
|
|
2751
2905
|
if (!live) return;
|
|
2752
2906
|
const gazetteers = {};
|
|
2753
2907
|
const errors = [];
|
|
2754
2908
|
results.forEach((r, i) => {
|
|
2755
2909
|
if (r.status === "fulfilled") gazetteers[paths[i]] = r.value;
|
|
2756
|
-
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access',
|
|
2910
|
+
else errors.push(`Couldn't load ${paths[i]}: ${_nullishCoalesce(_optionalChain([r, 'access', _129 => _129.reason, 'optionalAccess', _130 => _130.message]), () => ( r.reason))}`);
|
|
2757
2911
|
});
|
|
2758
2912
|
setState({ key, gazetteers, error: errors.join("\n") || void 0 });
|
|
2759
2913
|
});
|
|
@@ -2765,7 +2919,7 @@ function useGazetteers(panel, frames) {
|
|
|
2765
2919
|
}
|
|
2766
2920
|
function MapButton({ label, onPress }) {
|
|
2767
2921
|
const theme = useDashTheme();
|
|
2768
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [
|
|
2922
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress, hitSlop: 4, style: [styles11.button, { backgroundColor: theme.surface, borderColor: theme.border }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles11.buttonText, { color: theme.text }], children: label }) });
|
|
2769
2923
|
}
|
|
2770
2924
|
function Tiles({ layer, view, width, height }) {
|
|
2771
2925
|
const tiles = visibleTiles(layer.source, view, width, height);
|
|
@@ -2805,7 +2959,7 @@ function markerPaths(layer, screen, width, height, textColor) {
|
|
|
2805
2959
|
if (px[i] < -r || px[i] > width + r || py[i] < -r || py[i] > height + r) continue;
|
|
2806
2960
|
const parts = _nullishCoalesce(byColor.get(p.colors[i]), () => ( byColor.set(p.colors[i], []).get(p.colors[i])));
|
|
2807
2961
|
parts.push(symbolPath(layer.symbol, px[i], py[i], r));
|
|
2808
|
-
const label = _optionalChain([p, 'access',
|
|
2962
|
+
const label = _optionalChain([p, 'access', _131 => _131.labels, 'optionalAccess', _132 => _132[i]]);
|
|
2809
2963
|
if (label && labels.length < MAX_LABELS)
|
|
2810
2964
|
labels.push(
|
|
2811
2965
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2844,7 +2998,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2844
2998
|
const layer = layers.find((l) => l.key === picked.layer);
|
|
2845
2999
|
if (!layer || layer.type !== "markers" && layer.type !== "route") return null;
|
|
2846
3000
|
const p = layer.points[picked.group];
|
|
2847
|
-
const s = _optionalChain([screen, 'access',
|
|
3001
|
+
const s = _optionalChain([screen, 'access', _133 => _133.get, 'call', _134 => _134(layer.key), 'optionalAccess', _135 => _135[picked.group]]);
|
|
2848
3002
|
if (!p || !s || picked.index >= p.rows.length) return null;
|
|
2849
3003
|
return {
|
|
2850
3004
|
layer,
|
|
@@ -2856,7 +3010,7 @@ function resolvePicked(layers, screen, picked) {
|
|
|
2856
3010
|
py: s.py[picked.index]
|
|
2857
3011
|
};
|
|
2858
3012
|
}
|
|
2859
|
-
var
|
|
3013
|
+
var styles11 = _reactnative.StyleSheet.create({
|
|
2860
3014
|
fill: { flex: 1 },
|
|
2861
3015
|
map: { overflow: "hidden", borderRadius: 4 },
|
|
2862
3016
|
zoom: { position: "absolute", top: 6, left: 6, gap: 4 },
|
|
@@ -2882,7 +3036,7 @@ var styles10 = _reactnative.StyleSheet.create({
|
|
|
2882
3036
|
var DEFAULT_WIDTH = 120;
|
|
2883
3037
|
function cellType(config) {
|
|
2884
3038
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2885
|
-
const type = _nullishCoalesce(_optionalChain([custom, 'access',
|
|
3039
|
+
const type = _nullishCoalesce(_optionalChain([custom, 'access', _136 => _136.cellOptions, 'optionalAccess', _137 => _137.type]), () => ( custom.displayMode));
|
|
2886
3040
|
if (type === "color-text" || type === "color-background" || type === "gauge") return type;
|
|
2887
3041
|
if (type === "color-background-solid") return "color-background";
|
|
2888
3042
|
if (type === "gradient-gauge" || type === "lcd-gauge" || type === "basic") return "gauge";
|
|
@@ -2890,10 +3044,10 @@ function cellType(config) {
|
|
|
2890
3044
|
}
|
|
2891
3045
|
function tableColumns(panel, frame, multipleFrames = false) {
|
|
2892
3046
|
return frame.fields.flatMap((field, i) => {
|
|
2893
|
-
const raw =
|
|
2894
|
-
const config =
|
|
3047
|
+
const raw = _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, field, frame, multipleFrames);
|
|
3048
|
+
const config = _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, field, frame, raw);
|
|
2895
3049
|
const custom = _nullishCoalesce(config.custom, () => ( {}));
|
|
2896
|
-
if (custom.hidden || _optionalChain([custom, 'access',
|
|
3050
|
+
if (custom.hidden || _optionalChain([custom, 'access', _138 => _138.hideFrom, 'optionalAccess', _139 => _139.viz])) return [];
|
|
2897
3051
|
const numeric = field.type === "number";
|
|
2898
3052
|
const align = custom.align === "left" || custom.align === "center" || custom.align === "right" ? custom.align : numeric ? "right" : "left";
|
|
2899
3053
|
const type = cellType(config);
|
|
@@ -2906,8 +3060,8 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2906
3060
|
width: Math.max(Number(custom.width) || DEFAULT_WIDTH, Number(custom.minWidth) || 0),
|
|
2907
3061
|
align,
|
|
2908
3062
|
cellType: type,
|
|
2909
|
-
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access',
|
|
2910
|
-
wrap: !!_optionalChain([custom, 'access',
|
|
3063
|
+
applyToRow: type === "color-background" && !!_optionalChain([custom, 'access', _140 => _140.cellOptions, 'optionalAccess', _141 => _141.applyToRow]),
|
|
3064
|
+
wrap: !!_optionalChain([custom, 'access', _142 => _142.cellOptions, 'optionalAccess', _143 => _143.wrapText]),
|
|
2911
3065
|
extent: numeric ? extentOf(field.values) : void 0,
|
|
2912
3066
|
reducers: footerReducers(panel, config, [field.name, _nullishCoalesce(config.displayName, () => ( raw))])
|
|
2913
3067
|
}
|
|
@@ -2915,11 +3069,11 @@ function tableColumns(panel, frame, multipleFrames = false) {
|
|
|
2915
3069
|
});
|
|
2916
3070
|
}
|
|
2917
3071
|
function footerReducers(panel, config, names) {
|
|
2918
|
-
const own = _optionalChain([config, 'access',
|
|
2919
|
-
if (_optionalChain([own, 'optionalAccess',
|
|
2920
|
-
const legacy = _optionalChain([panel, 'access',
|
|
2921
|
-
if (!_optionalChain([legacy, 'optionalAccess',
|
|
2922
|
-
const reducer = _optionalChain([legacy, 'access',
|
|
3072
|
+
const own = _optionalChain([config, 'access', _144 => _144.custom, 'optionalAccess', _145 => _145.footer, 'optionalAccess', _146 => _146.reducers]);
|
|
3073
|
+
if (_optionalChain([own, 'optionalAccess', _147 => _147.length])) return own;
|
|
3074
|
+
const legacy = _optionalChain([panel, 'access', _148 => _148.options, 'optionalAccess', _149 => _149.footer]);
|
|
3075
|
+
if (!_optionalChain([legacy, 'optionalAccess', _150 => _150.show])) return [];
|
|
3076
|
+
const reducer = _optionalChain([legacy, 'access', _151 => _151.reducer, 'optionalAccess', _152 => _152.length]) ? legacy.reducer : ["sum"];
|
|
2923
3077
|
if (legacy.countRows && reducer[0] === "count") return ["countAll"];
|
|
2924
3078
|
const fields = Array.isArray(legacy.fields) ? legacy.fields : legacy.fields ? [legacy.fields] : [];
|
|
2925
3079
|
return !fields.length || names.some((n) => fields.includes(n)) ? reducer : [];
|
|
@@ -2934,16 +3088,16 @@ function tableFooter(columns) {
|
|
|
2934
3088
|
counted = true;
|
|
2935
3089
|
return [{ label: "Count", text: String(c.field.values.length) }];
|
|
2936
3090
|
}
|
|
2937
|
-
if (!
|
|
2938
|
-
const label =
|
|
3091
|
+
if (!_chunkCU4TMSZEjs.isReducer.call(void 0, r)) return [];
|
|
3092
|
+
const label = _chunkCU4TMSZEjs.REDUCER_LABELS[r];
|
|
2939
3093
|
if (r === "count") return [{ label, text: String(c.field.values.length) }];
|
|
2940
3094
|
if (c.field.type !== "number") {
|
|
2941
3095
|
if (r === "distinctCount") return [{ label, text: String(new Set(c.field.values.filter((v) => v != null)).size) }];
|
|
2942
3096
|
return [];
|
|
2943
3097
|
}
|
|
2944
|
-
const value =
|
|
3098
|
+
const value = _chunkCU4TMSZEjs.reduce.call(void 0, c.field.values.map((v) => v == null ? null : Number(v)), r);
|
|
2945
3099
|
const counts = r === "distinctCount" || r === "changeCount";
|
|
2946
|
-
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) :
|
|
3100
|
+
return [{ label, text: counts ? String(_nullishCoalesce(value, () => ( 0))) : _chunkCU4TMSZEjs.formatValue.call(void 0, value, c.config) }];
|
|
2947
3101
|
});
|
|
2948
3102
|
return lines.length === 1 && lines[0].label !== "Count" ? [{ text: lines[0].text }] : lines;
|
|
2949
3103
|
});
|
|
@@ -2962,17 +3116,17 @@ function extentOf(values) {
|
|
|
2962
3116
|
}
|
|
2963
3117
|
function cellDisplay(col, raw, fallbackColor) {
|
|
2964
3118
|
const { config, field } = col;
|
|
2965
|
-
const mapped =
|
|
3119
|
+
const mapped = _chunkCU4TMSZEjs.mappedResult.call(void 0, raw, config);
|
|
2966
3120
|
const num4 = field.type === "number" && raw != null && Number.isFinite(Number(raw)) ? Number(raw) : null;
|
|
2967
|
-
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
3121
|
+
const text = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _153 => _153.text]), () => ( (raw == null ? _nullishCoalesce(config.noValue, () => ( "")) : field.type === "number" ? _chunkCU4TMSZEjs.formatValue.call(void 0, num4, config) : field.type === "time" ? new Date(_chunkCU4TMSZEjs.toMillis.call(void 0, raw)).toLocaleString() : String(raw))));
|
|
2968
3122
|
if (col.cellType === "auto") return { text };
|
|
2969
|
-
const mode = _optionalChain([config, 'access',
|
|
2970
|
-
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
2971
|
-
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess',
|
|
3123
|
+
const mode = _optionalChain([config, 'access', _154 => _154.color, 'optionalAccess', _155 => _155.mode]);
|
|
3124
|
+
const named = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _156 => _156.color]), () => ( (mode === "fixed" ? _optionalChain([config, 'access', _157 => _157.color, 'optionalAccess', _158 => _158.fixedColor]) : (!mode || mode === "thresholds") && num4 != null ? _optionalChain([_chunkCU4TMSZEjs.thresholdStep.call(void 0, num4, config), 'optionalAccess', _159 => _159.color]) : void 0)));
|
|
3125
|
+
const color = named === "text" ? void 0 : _optionalChain([mapped, 'optionalAccess', _160 => _160.color]) ? _chunkCU4TMSZEjs.resolveColor.call(void 0, mapped.color, fallbackColor) : num4 == null ? void 0 : _chunkCU4TMSZEjs.valueColor.call(void 0, num4, config, fallbackColor, col.extent);
|
|
2972
3126
|
if (col.cellType === "color-text") return { text, color };
|
|
2973
3127
|
if (col.cellType === "color-background") return { text, background: color };
|
|
2974
|
-
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access',
|
|
2975
|
-
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access',
|
|
3128
|
+
const min = _nullishCoalesce(config.min, () => ( Math.min(0, _nullishCoalesce(_optionalChain([col, 'access', _161 => _161.extent, 'optionalAccess', _162 => _162[0]]), () => ( 0)))));
|
|
3129
|
+
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([col, 'access', _163 => _163.extent, 'optionalAccess', _164 => _164[1]]))), () => ( 1));
|
|
2976
3130
|
const gauge = num4 == null ? void 0 : Math.min(1, Math.max(0, (num4 - min) / (max - min || 1)));
|
|
2977
3131
|
return { text, gauge, gaugeColor: color };
|
|
2978
3132
|
}
|
|
@@ -2985,12 +3139,12 @@ function contrastText(background, fallback) {
|
|
|
2985
3139
|
return lum > 0.55 ? "#111111" : "#ffffff";
|
|
2986
3140
|
}
|
|
2987
3141
|
function initialSort(panel, columns) {
|
|
2988
|
-
const first = _optionalChain([panel, 'access',
|
|
2989
|
-
const col = _optionalChain([first, 'optionalAccess',
|
|
3142
|
+
const first = _optionalChain([panel, 'access', _165 => _165.options, 'optionalAccess', _166 => _166.sortBy, 'optionalAccess', _167 => _167[0]]);
|
|
3143
|
+
const col = _optionalChain([first, 'optionalAccess', _168 => _168.displayName]) != null ? columns.find((c) => c.name === first.displayName || c.field.name === first.displayName) : void 0;
|
|
2990
3144
|
return col ? { key: col.key, desc: !!first.desc } : null;
|
|
2991
3145
|
}
|
|
2992
3146
|
function nextSort(current, key) {
|
|
2993
|
-
if (_optionalChain([current, 'optionalAccess',
|
|
3147
|
+
if (_optionalChain([current, 'optionalAccess', _169 => _169.key]) !== key) return { key, desc: false };
|
|
2994
3148
|
return current.desc ? null : { key, desc: true };
|
|
2995
3149
|
}
|
|
2996
3150
|
function sortedRows(columns, length, sort) {
|
|
@@ -2999,7 +3153,7 @@ function sortedRows(columns, length, sort) {
|
|
|
2999
3153
|
if (!col) return rows;
|
|
3000
3154
|
const { field } = col;
|
|
3001
3155
|
const dir = sort.desc ? -1 : 1;
|
|
3002
|
-
const key = (v) => field.type === "time" ?
|
|
3156
|
+
const key = (v) => field.type === "time" ? _chunkCU4TMSZEjs.toMillis.call(void 0, v) : field.type === "number" || field.type === "boolean" ? Number(v) : v;
|
|
3003
3157
|
const empty = (v) => v == null || v === "" || typeof v === "number" && Number.isNaN(v);
|
|
3004
3158
|
return rows.sort((a, b) => {
|
|
3005
3159
|
const va = field.values[a];
|
|
@@ -3025,7 +3179,7 @@ function PieChartPanel({ panel, frames }) {
|
|
|
3025
3179
|
if (!values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3026
3180
|
const total = values.reduce((a, v) => a + (_nullishCoalesce(v.value, () => ( 0))), 0);
|
|
3027
3181
|
const r = Math.min(size.width, size.height) / 2 - 2;
|
|
3028
|
-
const inner = _optionalChain([panel, 'access',
|
|
3182
|
+
const inner = _optionalChain([panel, 'access', _170 => _170.options, 'optionalAccess', _171 => _171.pieType]) === "pie" ? 0 : r * 0.62;
|
|
3029
3183
|
const cx = size.width / 2;
|
|
3030
3184
|
const cy = size.height / 2;
|
|
3031
3185
|
const gap = values.length > 1 ? 0.02 : 0;
|
|
@@ -3036,8 +3190,8 @@ function PieChartPanel({ panel, frames }) {
|
|
|
3036
3190
|
slices.push({ key: v.key, d: donutSlice(cx, cy, r, inner, angle + gap / 2, angle + sweep - gap / 2), color: v.color });
|
|
3037
3191
|
angle += sweep;
|
|
3038
3192
|
}
|
|
3039
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3040
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3193
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3194
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.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)) }) }),
|
|
3041
3195
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3042
3196
|
Legend,
|
|
3043
3197
|
{
|
|
@@ -3065,15 +3219,15 @@ function TablePanel({ panel, frames }) {
|
|
|
3065
3219
|
const columns = _react.useMemo.call(void 0, () => frame ? tableColumns(panel, frame, frames.length > 1) : [], [panel, frame, frames.length]);
|
|
3066
3220
|
const [tapped, setSort] = _react.useState.call(void 0, );
|
|
3067
3221
|
const sort = tapped === void 0 ? initialSort(panel, columns) : tapped;
|
|
3068
|
-
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ?
|
|
3069
|
-
if (!frame || !
|
|
3222
|
+
const order = _react.useMemo.call(void 0, () => sortedRows(columns, frame ? _chunkCU4TMSZEjs.frameLength.call(void 0, frame) : 0, sort), [columns, frame, sort]);
|
|
3223
|
+
if (!frame || !_chunkCU4TMSZEjs.frameLength.call(void 0, frame)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3070
3224
|
const shown = order.slice(0, 500);
|
|
3071
3225
|
const rowColumn = columns.find((c) => c.applyToRow);
|
|
3072
3226
|
const footer = tableFooter(columns);
|
|
3073
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3074
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style:
|
|
3075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3076
|
-
const active = _optionalChain([sort, 'optionalAccess',
|
|
3227
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { horizontal: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3228
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.ScrollView, { nestedScrollEnabled: true, style: styles12.fill, children: [
|
|
3229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, { borderBottomColor: theme.border }], children: columns.map((c) => {
|
|
3230
|
+
const active = _optionalChain([sort, 'optionalAccess', _172 => _172.key]) === c.key;
|
|
3077
3231
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3078
3232
|
_reactnative.Pressable,
|
|
3079
3233
|
{
|
|
@@ -3082,7 +3236,7 @@ function TablePanel({ panel, frames }) {
|
|
|
3082
3236
|
accessibilityLabel: `Sort by ${c.name}`,
|
|
3083
3237
|
accessibilityState: { selected: active },
|
|
3084
3238
|
style: { width: c.width },
|
|
3085
|
-
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [
|
|
3239
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles12.th, { color: active ? theme.text : theme.textSecondary, textAlign: c.align }], numberOfLines: 2, children: [
|
|
3086
3240
|
c.name,
|
|
3087
3241
|
active ? sort.desc ? " \u2193" : " \u2191" : ""
|
|
3088
3242
|
] })
|
|
@@ -3092,12 +3246,12 @@ function TablePanel({ panel, frames }) {
|
|
|
3092
3246
|
}) }),
|
|
3093
3247
|
shown.map((i) => {
|
|
3094
3248
|
const rowBg = rowColumn ? cellDisplay(rowColumn, rowColumn.field.values[i], theme.accent).background : void 0;
|
|
3095
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3249
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, { borderBottomColor: theme.grid }, rowBg ? { backgroundColor: rowBg } : null], children: columns.map((c) => {
|
|
3096
3250
|
const d = cellDisplay(c, c.field.values[i], theme.accent);
|
|
3097
3251
|
const bg = _nullishCoalesce(d.background, () => ( rowBg));
|
|
3098
|
-
const linked = !!_optionalChain([c, 'access',
|
|
3252
|
+
const linked = !!_optionalChain([c, 'access', _173 => _173.config, 'access', _174 => _174.links, 'optionalAccess', _175 => _175.length]);
|
|
3099
3253
|
const color = _nullishCoalesce(d.color, () => ( (bg ? contrastText(bg, theme.text) : linked ? theme.accent : theme.text)));
|
|
3100
|
-
const cellStyle = [
|
|
3254
|
+
const cellStyle = [styles12.td, { width: c.width }, d.background ? { backgroundColor: d.background } : null];
|
|
3101
3255
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3102
3256
|
_reactnative.Pressable,
|
|
3103
3257
|
{
|
|
@@ -3109,8 +3263,8 @@ function TablePanel({ panel, frames }) {
|
|
|
3109
3263
|
accessibilityRole: linked ? "link" : void 0,
|
|
3110
3264
|
style: ({ pressed }) => [cellStyle, pressed && { opacity: 0.6 }],
|
|
3111
3265
|
children: [
|
|
3112
|
-
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3113
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3266
|
+
d.gauge != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.gaugeTrack, { backgroundColor: theme.grid }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.gaugeFill, { width: `${d.gauge * 100}%`, backgroundColor: _nullishCoalesce(d.gaugeColor, () => ( theme.accent)) }] }) }),
|
|
3267
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.cellText, { color, textAlign: c.align }, c.field.type === "number" && styles12.num], numberOfLines: c.wrap ? void 0 : 1, children: d.text })
|
|
3114
3268
|
]
|
|
3115
3269
|
},
|
|
3116
3270
|
c.key
|
|
@@ -3118,7 +3272,7 @@ function TablePanel({ panel, frames }) {
|
|
|
3118
3272
|
}) }, i);
|
|
3119
3273
|
})
|
|
3120
3274
|
] }),
|
|
3121
|
-
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3275
|
+
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.tr, styles12.footer, { borderTopColor: theme.border }], children: columns.map((c, ci) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.td, { width: c.width }], children: footer[ci].map((line, li) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.Text, { style: [styles12.cellText, styles12.footerText, { color: theme.text, textAlign: c.align }], numberOfLines: 1, children: [
|
|
3122
3276
|
line.label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textMuted, fontWeight: "400" }, children: `${line.label} ` }) : null,
|
|
3123
3277
|
line.text
|
|
3124
3278
|
] }, li)) }, c.key)) })
|
|
@@ -3126,12 +3280,12 @@ function TablePanel({ panel, frames }) {
|
|
|
3126
3280
|
}
|
|
3127
3281
|
function TextPanel({ panel }) {
|
|
3128
3282
|
const theme = useDashTheme();
|
|
3129
|
-
const raw = _optionalChain([panel, 'access',
|
|
3283
|
+
const raw = _optionalChain([panel, 'access', _176 => _176.options, 'optionalAccess', _177 => _177.content]);
|
|
3130
3284
|
const content = typeof raw === "string" ? raw : "";
|
|
3131
|
-
const text = _optionalChain([panel, 'access',
|
|
3285
|
+
const text = _optionalChain([panel, 'access', _178 => _178.options, 'optionalAccess', _179 => _179.mode]) === "html" ? content.replace(/<[^>]+>/g, "") : content;
|
|
3132
3286
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ScrollView, { children: text.split(/\n{2,}/).map((block, i) => {
|
|
3133
3287
|
const heading = /^#{1,6}\s+/.test(block);
|
|
3134
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3288
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.para, { color: heading ? theme.text : theme.textSecondary }, heading && styles12.heading], children: block.replace(/^#{1,6}\s+/, "").replace(/\*\*(.+?)\*\*/g, "$1").replace(/\[(.+?)\]\(.+?\)/g, "$1") }, i);
|
|
3135
3289
|
}) });
|
|
3136
3290
|
}
|
|
3137
3291
|
function BarChartPanel({ panel, frames, width }) {
|
|
@@ -3141,13 +3295,13 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3141
3295
|
const frame = frames[0];
|
|
3142
3296
|
const category = frame && barCategory(panel, frame);
|
|
3143
3297
|
if (!frame || !values.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3144
|
-
const xField = _optionalChain([panel, 'access',
|
|
3298
|
+
const xField = _optionalChain([panel, 'access', _180 => _180.options, 'optionalAccess', _181 => _181.xField]);
|
|
3145
3299
|
if (xField && !category) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No field named \u201C${String(xField)}\u201D` });
|
|
3146
3300
|
const allNumeric = frame.fields.filter((f) => f.type === "number");
|
|
3147
3301
|
const at = (f) => values[allNumeric.indexOf(f)];
|
|
3148
3302
|
const numeric = category ? allNumeric.filter((f) => f !== category) : [];
|
|
3149
3303
|
if (category && !numeric.length) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `No number fields to draw besides \u201C${category.name}\u201D` });
|
|
3150
|
-
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call',
|
|
3304
|
+
const fields = category ? numeric.map((f) => ({ key: f.name, name: _nullishCoalesce(_optionalChain([at, 'call', _182 => _182(f), 'optionalAccess', _183 => _183.name]), () => ( f.name)), color: _nullishCoalesce(_optionalChain([at, 'call', _184 => _184(f), 'optionalAccess', _185 => _185.color]), () => ( theme.accent)), config: _nullishCoalesce(_optionalChain([at, 'call', _186 => _186(f), 'optionalAccess', _187 => _187.config]), () => ( {})), values: f.values.map(num2) })) : [{ key: "reduced", name: "", color: theme.accent, config: values[0].config, values: values.map((v) => v.value) }];
|
|
3151
3305
|
const labels = category ? categoryLabels(category) : values.map((v) => v.name);
|
|
3152
3306
|
const colorAt = (fi, i) => category ? fields[fi].color : values[i].color;
|
|
3153
3307
|
const axes = barAxes(
|
|
@@ -3161,34 +3315,34 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3161
3315
|
const gridAxis = _nullishCoalesce(left, () => ( right));
|
|
3162
3316
|
const plotW = width - (left ? AXIS_W : 0) - (right ? AXIS_W : 0);
|
|
3163
3317
|
const every = Math.max(1, Math.ceil(labels.length / Math.max(1, Math.floor(plotW / 44))));
|
|
3164
|
-
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3318
|
+
const axisColumn = (axis) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.axis, axis.side === "left" ? styles12.axisLeft : styles12.axisRight], children: plot.height > 0 && axis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3165
3319
|
_reactnative.Text,
|
|
3166
3320
|
{
|
|
3167
|
-
style: [
|
|
3321
|
+
style: [styles12.tick, { color: theme.textMuted, top: plot.height * (1 - barFraction(axis, t)) - 7 }, axis.side === "left" ? styles12.tickLeft : styles12.tickRight],
|
|
3168
3322
|
numberOfLines: 1,
|
|
3169
|
-
children:
|
|
3323
|
+
children: _chunkCU4TMSZEjs.formatValue.call(void 0, t, { ...axis.config, decimals: tickDecimals(axis.ticks) })
|
|
3170
3324
|
},
|
|
3171
3325
|
t
|
|
3172
3326
|
)) });
|
|
3173
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3174
|
-
(_optionalChain([left, 'optionalAccess',
|
|
3175
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3176
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3327
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, children: [
|
|
3328
|
+
(_optionalChain([left, 'optionalAccess', _188 => _188.label]) || _optionalChain([right, 'optionalAccess', _189 => _189.label])) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.axisLabels, children: [
|
|
3329
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([left, 'optionalAccess', _190 => _190.label]), () => ( "")) }),
|
|
3330
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles12.axisLabel, { color: theme.textMuted }], children: _nullishCoalesce(_optionalChain([right, 'optionalAccess', _191 => _191.label]), () => ( "")) })
|
|
3177
3331
|
] }),
|
|
3178
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3332
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.barRow, children: [
|
|
3179
3333
|
left && axisColumn(left),
|
|
3180
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3181
|
-
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3182
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3334
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles12.fill, onLayout: onPlotLayout, children: [
|
|
3335
|
+
gridAxis && plot.height > 0 && gridAxis.ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.gridLine, { backgroundColor: theme.grid, top: plot.height * (1 - barFraction(gridAxis, t)) }] }, t)),
|
|
3336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barchart, children: labels.map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barStack, children: fields.map((f, fi) => {
|
|
3183
3337
|
const axis = axisOf(fi);
|
|
3184
3338
|
const base = barFraction(axis, Math.min(Math.max(0, axis.bottom), axis.top));
|
|
3185
3339
|
const end = barFraction(axis, _nullishCoalesce(f.values[i], () => ( 0)));
|
|
3186
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3340
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles12.barSlot, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3187
3341
|
_reactnative.View,
|
|
3188
3342
|
{
|
|
3189
3343
|
style: [
|
|
3190
|
-
|
|
3191
|
-
end < base &&
|
|
3344
|
+
styles12.bar,
|
|
3345
|
+
end < base && styles12.barDown,
|
|
3192
3346
|
{ bottom: `${Math.min(base, end) * 100}%`, height: `${Math.abs(end - base) * 100}%`, backgroundColor: colorAt(fi, i) }
|
|
3193
3347
|
]
|
|
3194
3348
|
}
|
|
@@ -3197,7 +3351,7 @@ function BarChartPanel({ panel, frames, width }) {
|
|
|
3197
3351
|
] }),
|
|
3198
3352
|
right && axisColumn(right)
|
|
3199
3353
|
] }),
|
|
3200
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles12.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: [styles12.barLabel, { color: theme.textMuted }], numberOfLines: 1, children: i % every === 0 ? label : " " }, i)) }),
|
|
3201
3355
|
category && fields.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Legend, { items: fields })
|
|
3202
3356
|
] });
|
|
3203
3357
|
}
|
|
@@ -3210,7 +3364,7 @@ function num2(v) {
|
|
|
3210
3364
|
function UnsupportedPanel({ panel }) {
|
|
3211
3365
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, { message: `"${panel.type}" panels aren't supported yet` });
|
|
3212
3366
|
}
|
|
3213
|
-
var
|
|
3367
|
+
var styles12 = _reactnative.StyleSheet.create({
|
|
3214
3368
|
fill: { flex: 1 },
|
|
3215
3369
|
tr: { flexDirection: "row", borderBottomWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
3216
3370
|
th: { paddingVertical: 6, paddingHorizontal: 6, fontSize: 12, fontWeight: "600" },
|
|
@@ -3269,9 +3423,9 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3269
3423
|
[numericX, panel, frames, theme.scheme]
|
|
3270
3424
|
);
|
|
3271
3425
|
if (!series.length || series.every((s) => s.values.every((v) => v == null))) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3272
|
-
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access',
|
|
3426
|
+
const style = (s) => _nullishCoalesce(_optionalChain([s, 'access', _192 => _192.config, 'access', _193 => _193.custom, 'optionalAccess', _194 => _194.drawStyle]), () => ( (panel.type === "graph" && panel.bars ? "bars" : "line")));
|
|
3273
3427
|
const anyBars = series.some((s) => style(s) === "bars");
|
|
3274
|
-
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3428
|
+
const anyFill = series.some((s) => (_nullishCoalesce(_optionalChain([s, 'access', _195 => _195.config, 'access', _196 => _196.custom, 'optionalAccess', _197 => _197.fillOpacity]), () => ( 0))) > 0);
|
|
3275
3429
|
const yTitle = series.map((s) => axisTitle(s.config)).find(Boolean);
|
|
3276
3430
|
const xTitle = numericX ? axisTitle(xConfig) : void 0;
|
|
3277
3431
|
const PAD = {
|
|
@@ -3292,7 +3446,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3292
3446
|
const y = linearScale(yMin, yMax, PAD.top + plotH, PAD.top);
|
|
3293
3447
|
const span = xTo - xFrom;
|
|
3294
3448
|
const xTicks = numericX ? numberTicks(xFrom, xTo, plotW) : timeTicks(xFrom, xTo, plotW);
|
|
3295
|
-
const xLabel = (t) => numericX ?
|
|
3449
|
+
const xLabel = (t) => numericX ? _chunkCU4TMSZEjs.formatValue.call(void 0, t, { ...xConfig, decimals: tickDecimals(xTicks) }) : formatTimeTick(t, span);
|
|
3296
3450
|
const unitConfig = series[0].config;
|
|
3297
3451
|
const barSeries = series.filter((s) => style(s) === "bars");
|
|
3298
3452
|
const pointsCount = Math.max(...series.map((s) => s.times.length));
|
|
@@ -3300,7 +3454,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3300
3454
|
const groupW = Math.min(slot * 0.8, BAR_MAX * barSeries.length);
|
|
3301
3455
|
const barW = Math.max(2, groupW / Math.max(barSeries.length, 1) - (barSeries.length > 1 ? 2 : 0));
|
|
3302
3456
|
const canPinch = plotW > 0;
|
|
3303
|
-
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access',
|
|
3457
|
+
const twoFingers = (e) => canPinch && (_nullishCoalesce(_optionalChain([e, 'access', _198 => _198.nativeEvent, 'access', _199 => _199.touches, 'optionalAccess', _200 => _200.length]), () => ( 0))) >= 2;
|
|
3304
3458
|
const onPinchMove = (e) => {
|
|
3305
3459
|
const touches = _nullishCoalesce(e.nativeEvent.touches, () => ( []));
|
|
3306
3460
|
if (touches.length < 2) return;
|
|
@@ -3310,11 +3464,11 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3310
3464
|
if (!pinch.current) pinch.current = { start: { from: xFrom, to: xTo }, dist, frac };
|
|
3311
3465
|
const p = pinch.current;
|
|
3312
3466
|
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) };
|
|
3313
|
-
setPreview(
|
|
3467
|
+
setPreview(_chunkCU4TMSZEjs.zoomRange.call(void 0, p.start, dist / p.dist, p.frac, frac, limits));
|
|
3314
3468
|
};
|
|
3315
3469
|
const onPinchEnd = (commit) => {
|
|
3316
3470
|
if (commit && pinch.current && preview) {
|
|
3317
|
-
if (!extent) setRawRange({ from:
|
|
3471
|
+
if (!extent) setRawRange({ from: _chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, preview.from), to: _chunkCU4TMSZEjs.formatLocalDateTime.call(void 0, preview.to) });
|
|
3318
3472
|
else setXZoom(preview.to - preview.from >= extent[1] - extent[0] ? null : preview);
|
|
3319
3473
|
}
|
|
3320
3474
|
pinch.current = null;
|
|
@@ -3323,15 +3477,15 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3323
3477
|
const hover = hoverX == null || !touching && pinned !== id ? null : nearest(series, xFrom + (hoverX - PAD.left) / (plotW || 1) * span);
|
|
3324
3478
|
const hoverLinks = hover ? mergeLinks(
|
|
3325
3479
|
hover.rows.flatMap(
|
|
3326
|
-
(r) => r.value == null || !_optionalChain([r, 'access',
|
|
3480
|
+
(r) => r.value == null || !_optionalChain([r, 'access', _201 => _201.series, 'access', _202 => _202.config, 'access', _203 => _203.links, 'optionalAccess', _204 => _204.length]) ? [] : [{ name: r.name, links: resolve(r.series.config.links, linkData(r, frames, numericX ? String(_nullishCoalesce(_optionalChain([panel, 'access', _205 => _205.options, 'optionalAccess', _206 => _206.xField]), () => ( ""))) : void 0)) }]
|
|
3327
3481
|
)
|
|
3328
3482
|
) : [];
|
|
3329
3483
|
const isPinned = !!hover && pinned === id;
|
|
3330
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3484
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles13.fill, children: [
|
|
3331
3485
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3332
3486
|
_reactnative.View,
|
|
3333
3487
|
{
|
|
3334
|
-
style:
|
|
3488
|
+
style: styles13.fill,
|
|
3335
3489
|
onStartShouldSetResponderCapture: twoFingers,
|
|
3336
3490
|
onMoveShouldSetResponderCapture: twoFingers,
|
|
3337
3491
|
onResponderTerminationRequest: () => false,
|
|
@@ -3346,7 +3500,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3346
3500
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3347
3501
|
_reactnative.View,
|
|
3348
3502
|
{
|
|
3349
|
-
style:
|
|
3503
|
+
style: styles13.fill,
|
|
3350
3504
|
onLayout,
|
|
3351
3505
|
onStartShouldSetResponder: () => true,
|
|
3352
3506
|
onResponderGrant: (e) => {
|
|
@@ -3369,7 +3523,7 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3369
3523
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3370
3524
|
ticks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3371
3525
|
/* @__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 }),
|
|
3372
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children:
|
|
3526
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativesvg.Text, { x: PAD.left - 6, y: y(t) + 3, fontSize: 10, fill: theme.textMuted, textAnchor: "end", children: _chunkCU4TMSZEjs.formatValue.call(void 0, t, { ...unitConfig, decimals: tickDecimals(ticks) }) })
|
|
3373
3527
|
] }, t)),
|
|
3374
3528
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3375
3529
|
_reactnativesvg.Text,
|
|
@@ -3395,12 +3549,12 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3395
3549
|
})
|
|
3396
3550
|
),
|
|
3397
3551
|
series.filter((s) => style(s) !== "bars").map((s) => {
|
|
3398
|
-
const fill = (_nullishCoalesce(_optionalChain([s, 'access',
|
|
3399
|
-
const showPoints = style(s) === "points" || _optionalChain([s, 'access',
|
|
3400
|
-
const segs = segments(s, x, y, _optionalChain([s, 'access',
|
|
3552
|
+
const fill = (_nullishCoalesce(_optionalChain([s, 'access', _207 => _207.config, 'access', _208 => _208.custom, 'optionalAccess', _209 => _209.fillOpacity]), () => ( 0))) / 100;
|
|
3553
|
+
const showPoints = style(s) === "points" || _optionalChain([s, 'access', _210 => _210.config, 'access', _211 => _211.custom, 'optionalAccess', _212 => _212.showPoints]) === "always" || _optionalChain([s, 'access', _213 => _213.config, 'access', _214 => _214.custom, 'optionalAccess', _215 => _215.showPoints]) !== "never" && s.times.length <= plotW / 14;
|
|
3554
|
+
const segs = segments(s, x, y, _optionalChain([s, 'access', _216 => _216.config, 'access', _217 => _217.custom, 'optionalAccess', _218 => _218.lineInterpolation]) === "stepAfter");
|
|
3401
3555
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3402
3556
|
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}`)),
|
|
3403
|
-
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',
|
|
3557
|
+
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', _219 => _219.config, 'access', _220 => _220.custom, 'optionalAccess', _221 => _221.lineWidth]), () => ( 2)), fill: "none", strokeLinejoin: "round", strokeLinecap: "round" }, `l${i}`)),
|
|
3404
3558
|
showPoints && s.times.map(
|
|
3405
3559
|
(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)
|
|
3406
3560
|
)
|
|
@@ -3420,8 +3574,8 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3420
3574
|
onPress: () => setXZoom(null),
|
|
3421
3575
|
accessibilityRole: "button",
|
|
3422
3576
|
hitSlop: 8,
|
|
3423
|
-
style: ({ pressed }) => [
|
|
3424
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3577
|
+
style: ({ pressed }) => [styles13.reset, { backgroundColor: theme.surface, borderColor: theme.border }, pressed && { opacity: 0.7 }],
|
|
3578
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.resetText, { color: theme.accent }], children: "Reset zoom" })
|
|
3425
3579
|
}
|
|
3426
3580
|
),
|
|
3427
3581
|
hover && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3430,16 +3584,16 @@ function TimeSeriesPanel({ panel, frames }) {
|
|
|
3430
3584
|
pointerEvents: isPinned ? "auto" : "none",
|
|
3431
3585
|
onStartShouldSetResponder: () => isPinned,
|
|
3432
3586
|
style: [
|
|
3433
|
-
|
|
3587
|
+
styles13.tooltip,
|
|
3434
3588
|
{ backgroundColor: theme.surface, borderColor: theme.border },
|
|
3435
3589
|
x(hover.time) > size.width / 2 ? { right: size.width - x(hover.time) + 8 } : { left: x(hover.time) + 8 }
|
|
3436
3590
|
],
|
|
3437
3591
|
children: [
|
|
3438
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3439
|
-
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [
|
|
3441
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3442
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipTime, { color: theme.textMuted }], children: numericX ? _chunkCU4TMSZEjs.formatValue.call(void 0, hover.time, xConfig) : formatTooltipTime(hover.time) }),
|
|
3593
|
+
hover.rows.map((r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles13.tooltipRow, children: [
|
|
3594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles13.swatch, { backgroundColor: r.color }] }),
|
|
3595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipName, { color: theme.textSecondary }], numberOfLines: 1, children: r.name }),
|
|
3596
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles13.tooltipValue, { color: theme.text }], children: _chunkCU4TMSZEjs.formatValue.call(void 0, r.value, r.config) })
|
|
3443
3597
|
] }, r.key)),
|
|
3444
3598
|
isPinned && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TooltipLinks, { links: hoverLinks, onOpen: (l) => openLinks([l]) })
|
|
3445
3599
|
]
|
|
@@ -3524,8 +3678,8 @@ function linkData(r, frames, xField) {
|
|
|
3524
3678
|
if (frame && xField === void 0) {
|
|
3525
3679
|
row = r.index;
|
|
3526
3680
|
} else if (frame) {
|
|
3527
|
-
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => (
|
|
3528
|
-
const at = _optionalChain([xf, 'optionalAccess',
|
|
3681
|
+
const xf = _nullishCoalesce(frame.fields.find((f) => f.name === xField), () => ( _chunkCU4TMSZEjs.numberFields.call(void 0, frame)[0]));
|
|
3682
|
+
const at = _optionalChain([xf, 'optionalAccess', _222 => _222.values, 'access', _223 => _223.findIndex, 'call', _224 => _224((v, k) => Number(v) === r.time && Number(r.series.field.values[k]) === r.value)]);
|
|
3529
3683
|
row = at != null && at >= 0 ? at : void 0;
|
|
3530
3684
|
}
|
|
3531
3685
|
return {
|
|
@@ -3535,11 +3689,11 @@ function linkData(r, frames, xField) {
|
|
|
3535
3689
|
fieldName: r.name,
|
|
3536
3690
|
seriesName: r.name,
|
|
3537
3691
|
value: r.value,
|
|
3538
|
-
text:
|
|
3692
|
+
text: _chunkCU4TMSZEjs.formatValue.call(void 0, r.value, r.config),
|
|
3539
3693
|
time: xField === void 0 ? r.time : void 0
|
|
3540
3694
|
};
|
|
3541
3695
|
}
|
|
3542
|
-
var
|
|
3696
|
+
var styles13 = _reactnative.StyleSheet.create({
|
|
3543
3697
|
fill: { flex: 1 },
|
|
3544
3698
|
tooltip: {
|
|
3545
3699
|
position: "absolute",
|
|
@@ -3580,14 +3734,14 @@ function mappings(panel) {
|
|
|
3580
3734
|
frame: frame(s.frame),
|
|
3581
3735
|
x: byName(s.x),
|
|
3582
3736
|
y: byName(s.y),
|
|
3583
|
-
color: byName(_optionalChain([s, 'access',
|
|
3584
|
-
size: byName(_optionalChain([s, 'access',
|
|
3737
|
+
color: byName(_optionalChain([s, 'access', _225 => _225.pointColor, 'optionalAccess', _226 => _226.field])),
|
|
3738
|
+
size: byName(_optionalChain([s, 'access', _227 => _227.pointSize, 'optionalAccess', _228 => _228.field])),
|
|
3585
3739
|
sizeRange: s.pointSize,
|
|
3586
3740
|
name: { fixed: s.name }
|
|
3587
3741
|
}));
|
|
3588
3742
|
return { manual: true, series, exclude: [] };
|
|
3589
3743
|
}
|
|
3590
|
-
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access',
|
|
3744
|
+
return { manual: false, series: [{ frame: frame(_optionalChain([o, 'access', _229 => _229.dims, 'optionalAccess', _230 => _230.frame])), x: byName(_optionalChain([o, 'access', _231 => _231.dims, 'optionalAccess', _232 => _232.x])) }], exclude: _nullishCoalesce(_optionalChain([o, 'access', _233 => _233.dims, 'optionalAccess', _234 => _234.exclude]), () => ( [])) };
|
|
3591
3745
|
}
|
|
3592
3746
|
return { manual: o.mapping === "manual", series: _nullishCoalesce(o.series, () => ( [])), exclude: [] };
|
|
3593
3747
|
}
|
|
@@ -3596,11 +3750,11 @@ function xySeries(panel, frames, scheme) {
|
|
|
3596
3750
|
const { manual, series: maps, exclude } = mappings(panel);
|
|
3597
3751
|
const multiple = frames.length > 1;
|
|
3598
3752
|
const out = [];
|
|
3599
|
-
const config = (field, frame) =>
|
|
3600
|
-
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) =>
|
|
3753
|
+
const config = (field, frame) => _chunkCU4TMSZEjs.resolveFieldConfig.call(void 0, panel, field, frame, _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, field, frame, multiple));
|
|
3754
|
+
const find = (pick, frame, fields = frame.fields) => pick ? fields.filter((f) => _chunkCU4TMSZEjs.fieldMatches.call(void 0, pick.matcher, f, frame, _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, f, frame, multiple))) : [];
|
|
3601
3755
|
for (const [mi, m] of (maps.length ? maps : [{}]).entries()) {
|
|
3602
|
-
const matcher = _optionalChain([m, 'access',
|
|
3603
|
-
const chosen = _optionalChain([matcher, 'optionalAccess',
|
|
3756
|
+
const matcher = _optionalChain([m, 'access', _235 => _235.frame, 'optionalAccess', _236 => _236.matcher]);
|
|
3757
|
+
const chosen = _optionalChain([matcher, 'optionalAccess', _237 => _237.id]) === "byIndex" ? frames.filter((_, i) => i === matcher.options) : frames;
|
|
3604
3758
|
for (const frame of chosen) {
|
|
3605
3759
|
const numeric = frame.fields.filter(isNumeric);
|
|
3606
3760
|
const xField = _nullishCoalesce(find(m.x, frame, numeric)[0], () => ( numeric[0]));
|
|
@@ -3611,41 +3765,41 @@ function xySeries(panel, frames, scheme) {
|
|
|
3611
3765
|
const yFields = m.y ? find(m.y, frame, numeric).filter((f) => f !== xField) : manual ? [] : numeric.filter((f) => !used.has(f) && !exclude.includes(f.name));
|
|
3612
3766
|
for (const yField of yFields) {
|
|
3613
3767
|
const yConfig = config(yField, frame);
|
|
3614
|
-
if (_optionalChain([yConfig, 'access',
|
|
3768
|
+
if (_optionalChain([yConfig, 'access', _238 => _238.custom, 'optionalAccess', _239 => _239.hideFrom, 'optionalAccess', _240 => _240.viz]) && !manual) continue;
|
|
3615
3769
|
const xConfig = config(xField, frame);
|
|
3616
|
-
const color =
|
|
3617
|
-
const base = _optionalChain([yConfig, 'access',
|
|
3770
|
+
const color = _chunkCU4TMSZEjs.seriesColor.call(void 0, out.length, scheme, yConfig);
|
|
3771
|
+
const base = _optionalChain([yConfig, 'access', _241 => _241.color, 'optionalAccess', _242 => _242.mode]) === "thresholds" ? _chunkCU4TMSZEjs.valueColor.call(void 0, null, yConfig, color) : color;
|
|
3618
3772
|
const rows = [];
|
|
3619
3773
|
const xs = [];
|
|
3620
3774
|
const ys = [];
|
|
3621
3775
|
yField.values.forEach((yv, i) => {
|
|
3622
3776
|
const xv = xField.values[i];
|
|
3623
3777
|
if (xv == null || yv == null) return;
|
|
3624
|
-
const xn = xField.type === "time" ?
|
|
3625
|
-
const yn = yField.type === "time" ?
|
|
3778
|
+
const xn = xField.type === "time" ? _chunkCU4TMSZEjs.toMillis.call(void 0, xv) : Number(xv);
|
|
3779
|
+
const yn = yField.type === "time" ? _chunkCU4TMSZEjs.toMillis.call(void 0, yv) : Number(yv);
|
|
3626
3780
|
if (!Number.isFinite(xn) || !Number.isFinite(yn)) return;
|
|
3627
3781
|
rows.push(i);
|
|
3628
3782
|
xs.push(xn);
|
|
3629
3783
|
ys.push(yn);
|
|
3630
3784
|
});
|
|
3631
|
-
const pointSize = _optionalChain([yConfig, 'access',
|
|
3632
|
-
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3785
|
+
const pointSize = _optionalChain([yConfig, 'access', _243 => _243.custom, 'optionalAccess', _244 => _244.pointSize]);
|
|
3786
|
+
const fixedSize = _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _245 => _245.sizeRange, 'optionalAccess', _246 => _246.fixed]), () => ( _optionalChain([pointSize, 'optionalAccess', _247 => _247.fixed]))), () => ( 5));
|
|
3633
3787
|
let colors = rows.map(() => base);
|
|
3634
3788
|
if (colorField) {
|
|
3635
3789
|
const cConfig = config(colorField, frame);
|
|
3636
3790
|
const values = rows.map((i) => num3(colorField.values[i]));
|
|
3637
3791
|
const extent = range2(values);
|
|
3638
|
-
colors = values.map((v) =>
|
|
3792
|
+
colors = values.map((v) => _chunkCU4TMSZEjs.valueColor.call(void 0, v, cConfig, base, extent));
|
|
3639
3793
|
}
|
|
3640
3794
|
let sizes = rows.map(() => fixedSize);
|
|
3641
3795
|
if (sizeField) {
|
|
3642
3796
|
const values = rows.map((i) => num3(sizeField.values[i]));
|
|
3643
3797
|
const [lo, hi] = _nullishCoalesce(range2(values), () => ( [0, 1]));
|
|
3644
|
-
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access',
|
|
3798
|
+
const [min, max] = [_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _248 => _248.sizeRange, 'optionalAccess', _249 => _249.min]), () => ( _optionalChain([pointSize, 'optionalAccess', _250 => _250.min]))), () => ( 5)), _nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'access', _251 => _251.sizeRange, 'optionalAccess', _252 => _252.max]), () => ( _optionalChain([pointSize, 'optionalAccess', _253 => _253.max]))), () => ( 20))];
|
|
3645
3799
|
sizes = values.map((v) => v == null ? min : min + (v - lo) / (hi - lo || 1) * (max - min));
|
|
3646
3800
|
}
|
|
3647
|
-
const fixedName = _optionalChain([m, 'access',
|
|
3648
|
-
const yName = _nullishCoalesce(yConfig.displayName, () => (
|
|
3801
|
+
const fixedName = _optionalChain([m, 'access', _254 => _254.name, 'optionalAccess', _255 => _255.fixed]);
|
|
3802
|
+
const yName = _nullishCoalesce(yConfig.displayName, () => ( _chunkCU4TMSZEjs.fieldDisplayName.call(void 0, yField, frame, multiple)));
|
|
3649
3803
|
out.push({
|
|
3650
3804
|
key: `${mi}/${frames.indexOf(frame)}/${yField.name}`,
|
|
3651
3805
|
name: fixedName ? yFields.length > 1 ? `${fixedName} ${yName}` : fixedName : yName,
|
|
@@ -3660,8 +3814,8 @@ function xySeries(panel, frames, scheme) {
|
|
|
3660
3814
|
ys,
|
|
3661
3815
|
colors,
|
|
3662
3816
|
sizes,
|
|
3663
|
-
show: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3664
|
-
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access',
|
|
3817
|
+
show: _nullishCoalesce(_optionalChain([yConfig, 'access', _256 => _256.custom, 'optionalAccess', _257 => _257.show]), () => ( "points")),
|
|
3818
|
+
lineWidth: _nullishCoalesce(_optionalChain([yConfig, 'access', _258 => _258.custom, 'optionalAccess', _259 => _259.lineWidth]), () => ( 1))
|
|
3665
3819
|
});
|
|
3666
3820
|
}
|
|
3667
3821
|
}
|
|
@@ -3712,10 +3866,10 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3712
3866
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
3713
3867
|
const series = _react.useMemo.call(void 0, () => xySeries(panel, frames, theme.scheme), [panel, frames, theme.scheme]);
|
|
3714
3868
|
const first = series[0];
|
|
3715
|
-
const showX = _optionalChain([first, 'optionalAccess',
|
|
3716
|
-
const showY = _optionalChain([first, 'optionalAccess',
|
|
3717
|
-
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3718
|
-
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess',
|
|
3869
|
+
const showX = _optionalChain([first, 'optionalAccess', _260 => _260.xConfig, 'access', _261 => _261.custom, 'optionalAccess', _262 => _262.axisPlacement]) !== "hidden";
|
|
3870
|
+
const showY = _optionalChain([first, 'optionalAccess', _263 => _263.yConfig, 'access', _264 => _264.custom, 'optionalAccess', _265 => _265.axisPlacement]) !== "hidden";
|
|
3871
|
+
const xTitle = showX ? axisTitle(_optionalChain([first, 'optionalAccess', _266 => _266.xConfig])) : void 0;
|
|
3872
|
+
const yTitle = showY ? axisTitle(_optionalChain([first, 'optionalAccess', _267 => _267.yConfig])) : void 0;
|
|
3719
3873
|
const pad = {
|
|
3720
3874
|
top: EDGE,
|
|
3721
3875
|
right: EDGE,
|
|
@@ -3736,17 +3890,17 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3736
3890
|
if (!first || !layout || series.every((s) => !s.rows.length)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NoData, {});
|
|
3737
3891
|
const xTicks = showX ? axisTicks(layout.x0, layout.x1, plotW < 220 ? 2 : plotW < 400 ? 3 : 5) : [];
|
|
3738
3892
|
const yTicks = showY ? axisTicks(layout.y0, layout.y1, plotH < 100 ? 2 : 4) : [];
|
|
3739
|
-
const gridX = _optionalChain([first, 'access',
|
|
3740
|
-
const gridY = _optionalChain([first, 'access',
|
|
3893
|
+
const gridX = _optionalChain([first, 'access', _268 => _268.xConfig, 'access', _269 => _269.custom, 'optionalAccess', _270 => _270.axisGridShow]) !== false;
|
|
3894
|
+
const gridY = _optionalChain([first, 'access', _271 => _271.yConfig, 'access', _272 => _272.custom, 'optionalAccess', _273 => _273.axisGridShow]) !== false;
|
|
3741
3895
|
const hover = touch && (touching || pinned === id) ? nearestPoint(series, layout.points, touch) : null;
|
|
3742
3896
|
const hoverLinks = hover ? rowLinks(panel, hover.series.frame, hover.series.rows[hover.index], frames.length > 1, resolve) : [];
|
|
3743
3897
|
const isPinned = !!hover && pinned === id;
|
|
3744
|
-
const legendItems = series.filter((s) => !_optionalChain([s, 'access',
|
|
3745
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
3898
|
+
const legendItems = series.filter((s) => !_optionalChain([s, 'access', _274 => _274.yConfig, 'access', _275 => _275.custom, 'optionalAccess', _276 => _276.hideFrom, 'optionalAccess', _277 => _277.legend]));
|
|
3899
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles14.fill, children: [
|
|
3746
3900
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3747
3901
|
_reactnative.View,
|
|
3748
3902
|
{
|
|
3749
|
-
style:
|
|
3903
|
+
style: styles14.fill,
|
|
3750
3904
|
onLayout,
|
|
3751
3905
|
onStartShouldSetResponder: () => true,
|
|
3752
3906
|
onResponderGrant: (e) => {
|
|
@@ -3768,7 +3922,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3768
3922
|
size.width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg2.default, { width: size.width, height: size.height, children: [
|
|
3769
3923
|
yTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3770
3924
|
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 }),
|
|
3771
|
-
/* @__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:
|
|
3925
|
+
/* @__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: _chunkCU4TMSZEjs.formatValue.call(void 0, t, { ...first.yConfig, decimals: _nullishCoalesce(first.yConfig.decimals, () => ( tickDecimals(yTicks))) }) })
|
|
3772
3926
|
] }, `y${t}`)),
|
|
3773
3927
|
xTicks.map((t) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnativesvg.G, { children: [
|
|
3774
3928
|
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 }),
|
|
@@ -3780,7 +3934,7 @@ function XYChartPanel({ panel, frames }) {
|
|
|
3780
3934
|
fontSize: 10,
|
|
3781
3935
|
fill: theme.textMuted,
|
|
3782
3936
|
textAnchor: layout.x(t) - pad.left < 20 ? "start" : pad.left + plotW - layout.x(t) < 20 ? "end" : "middle",
|
|
3783
|
-
children:
|
|
3937
|
+
children: _chunkCU4TMSZEjs.formatValue.call(void 0, t, { ...first.xConfig, decimals: _nullishCoalesce(first.xConfig.decimals, () => ( tickDecimals(xTicks))) })
|
|
3784
3938
|
}
|
|
3785
3939
|
)
|
|
3786
3940
|
] }, `x${t}`)),
|
|
@@ -3850,7 +4004,7 @@ function nearestPoint(series, points, at) {
|
|
|
3850
4004
|
});
|
|
3851
4005
|
return best;
|
|
3852
4006
|
}
|
|
3853
|
-
var
|
|
4007
|
+
var styles14 = _reactnative.StyleSheet.create({
|
|
3854
4008
|
fill: { flex: 1 }
|
|
3855
4009
|
});
|
|
3856
4010
|
|
|
@@ -3893,15 +4047,15 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3893
4047
|
const width = (measured.width || window.width) - insets.left - insets.right;
|
|
3894
4048
|
const layoutMode = mode === "auto" ? width >= TABLET_WIDTH ? "grid" : "phone" : mode;
|
|
3895
4049
|
const sections = _react.useMemo.call(void 0,
|
|
3896
|
-
() =>
|
|
4050
|
+
() => _chunkCU4TMSZEjs.layoutDashboard.call(void 0, dashboard, layoutMode, { values: variables, info: variableInfo2 }),
|
|
3897
4051
|
[dashboard, layoutMode, variables, variableInfo2]
|
|
3898
4052
|
);
|
|
3899
4053
|
const [toggled, setToggled] = _react.useState.call(void 0, {});
|
|
3900
4054
|
const { seen, viewportH, onScroll, onViewportLayout, onSectionLayout } = useSeenSections(window.height);
|
|
3901
4055
|
const maxPanelH = Math.max(MIN_PANEL_H, viewportH - SIDE * 2);
|
|
3902
4056
|
const contentW = width - SIDE * 2;
|
|
3903
|
-
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) =>
|
|
3904
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4057
|
+
const canRefresh = _nullishCoalesce(refreshable, () => ( dashboard.panels.some((p) => _chunkCU4TMSZEjs.panelHasQueries.call(void 0, p) || _optionalChain([p, 'access', _278 => _278.panels, 'optionalAccess', _279 => _279.some, 'call', _280 => _280(_chunkCU4TMSZEjs.panelHasQueries)]))));
|
|
4058
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.fill, { backgroundColor: theme.background }], onLayout, children: [
|
|
3905
4059
|
width > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3906
4060
|
_reactnative.ScrollView,
|
|
3907
4061
|
{
|
|
@@ -3909,31 +4063,31 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3909
4063
|
onScrollBeginDrag: () => setPinned(null),
|
|
3910
4064
|
onLayout: onViewportLayout,
|
|
3911
4065
|
scrollEventThrottle: 100,
|
|
3912
|
-
contentContainerStyle: [
|
|
4066
|
+
contentContainerStyle: [styles15.content, { paddingLeft: SIDE + insets.left, paddingRight: SIDE + insets.right }],
|
|
3913
4067
|
keyboardShouldPersistTaps: "handled",
|
|
3914
4068
|
refreshControl: canRefresh ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.RefreshControl, { refreshing: false, onRefresh: refresh }) : void 0,
|
|
3915
4069
|
children: [
|
|
3916
4070
|
header,
|
|
3917
4071
|
sections.map((section) => {
|
|
3918
4072
|
const collapsed = _nullishCoalesce(toggled[section.key], () => ( section.collapsed));
|
|
3919
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
4073
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles15.section, onLayout: (e) => onSectionLayout(section.key, e), children: [
|
|
3920
4074
|
section.row && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3921
4075
|
_reactnative.Pressable,
|
|
3922
4076
|
{
|
|
3923
4077
|
onPress: () => setToggled((t) => ({ ...t, [section.key]: !collapsed })),
|
|
3924
|
-
style:
|
|
4078
|
+
style: styles15.rowHeader,
|
|
3925
4079
|
accessibilityRole: "button",
|
|
3926
4080
|
accessibilityState: { expanded: !collapsed },
|
|
3927
4081
|
children: [
|
|
3928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
3929
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.chevron, { color: theme.textMuted }], children: collapsed ? "\u25B8" : "\u25BE" }),
|
|
4083
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.rowTitle, { color: theme.text }], numberOfLines: 2, children: _chunkCU4TMSZEjs.interpolate.call(void 0, _nullishCoalesce(section.row.title, () => ( "")), { values: variables, info: variableInfo2, scoped: section.row.scopedVars, timezone: dashboard.timezone }) })
|
|
3930
4084
|
]
|
|
3931
4085
|
}
|
|
3932
4086
|
),
|
|
3933
4087
|
!collapsed && layoutMode === "grid" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GridSection, { grid: section.grid, width: contentW, maxPanelH, deferred: !seen.has(section.key) }),
|
|
3934
|
-
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
3935
|
-
const w = (contentW + GAP2) * (cell.span /
|
|
3936
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(
|
|
4088
|
+
!collapsed && layoutMode === "phone" && section.rows.map((row, ri) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.row, children: row.cells.map((cell) => {
|
|
4089
|
+
const w = (contentW + GAP2) * (cell.span / _chunkCU4TMSZEjs.GRID_COLUMNS) - GAP2;
|
|
4090
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: w, height: Math.min(_chunkCU4TMSZEjs.gridUnitsToPx.call(void 0, row.h), maxPanelH), deferred: !seen.has(section.key) }, cell.key);
|
|
3937
4091
|
}) }, ri))
|
|
3938
4092
|
] }, section.key);
|
|
3939
4093
|
})
|
|
@@ -3944,10 +4098,10 @@ function DashboardView({ mode = "auto", header, footer, refreshable }) {
|
|
|
3944
4098
|
] });
|
|
3945
4099
|
}
|
|
3946
4100
|
function GridSection({ grid, width, maxPanelH, deferred }) {
|
|
3947
|
-
const colW = (width + GAP2) /
|
|
3948
|
-
const tallest = Math.max(0, ...grid.cells.map((c) =>
|
|
4101
|
+
const colW = (width + GAP2) / _chunkCU4TMSZEjs.GRID_COLUMNS;
|
|
4102
|
+
const tallest = Math.max(0, ...grid.cells.map((c) => _chunkCU4TMSZEjs.gridUnitsToPx.call(void 0, c.h)));
|
|
3949
4103
|
const scale = tallest > maxPanelH ? maxPanelH / tallest : 1;
|
|
3950
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height:
|
|
4104
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: { height: _chunkCU4TMSZEjs.gridUnitsToPx.call(void 0, grid.h) * scale }, children: grid.cells.map((cell) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: [styles15.gridCell, { left: cell.x * colW, top: _chunkCU4TMSZEjs.gridOffsetPx.call(void 0, cell.y) * scale }], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PanelCard, { panel: cell.panel, width: cell.w * colW - GAP2, height: _chunkCU4TMSZEjs.gridUnitsToPx.call(void 0, cell.h) * scale, deferred }) }, cell.key)) });
|
|
3951
4105
|
}
|
|
3952
4106
|
function useSeenSections(viewportHeight) {
|
|
3953
4107
|
const [seen, setSeen] = _react.useState.call(void 0, /* @__PURE__ */ new Set());
|
|
@@ -3996,27 +4150,27 @@ function PanelCard(props) {
|
|
|
3996
4150
|
}
|
|
3997
4151
|
function PanelError({ panel, width, height, error }) {
|
|
3998
4152
|
const theme = useDashTheme();
|
|
3999
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4000
|
-
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4153
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.card, { width, height, backgroundColor: theme.surface, borderColor: theme.danger }], accessibilityRole: "alert", children: [
|
|
4154
|
+
!!panel.title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.title, styles15.errorTitle, { color: theme.text }], numberOfLines: 1, children: panel.title }),
|
|
4155
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.errorText, { color: theme.danger }], children: "This panel couldn\u2019t be shown." }),
|
|
4156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.errorText, { color: theme.textMuted }], numberOfLines: 3, children: error.message })
|
|
4003
4157
|
] });
|
|
4004
4158
|
}
|
|
4005
4159
|
function PanelCardContent({ panel, width, height, deferred }) {
|
|
4006
4160
|
const theme = useDashTheme();
|
|
4007
4161
|
const { dashboard, variables, variableInfo: variableInfo2 } = useDashboard();
|
|
4008
4162
|
const { resolve, openLinks } = usePanelLinks(panel);
|
|
4009
|
-
const group =
|
|
4010
|
-
const input =
|
|
4163
|
+
const group = _chunkCU4TMSZEjs.isInputGroup.call(void 0, panel);
|
|
4164
|
+
const input = _chunkCU4TMSZEjs.isInputPanel.call(void 0, panel) || group;
|
|
4011
4165
|
const form = _react.useContext.call(void 0, InputFormContext);
|
|
4012
|
-
const problem = group ? _optionalChain([form, 'optionalAccess',
|
|
4013
|
-
const hasLinks = !!_optionalChain([panel, 'access',
|
|
4166
|
+
const problem = group ? _optionalChain([form, 'optionalAccess', _281 => _281.group, 'optionalCall', _282 => _282(panel), 'optionalAccess', _283 => _283.problem]) : _chunkCU4TMSZEjs.isInputPanel.call(void 0, panel) ? _optionalChain([form, 'optionalAccess', _284 => _284.problem, 'optionalCall', _285 => _285(panel.options.metric)]) : void 0;
|
|
4167
|
+
const hasLinks = !!_optionalChain([panel, 'access', _286 => _286.links, 'optionalAccess', _287 => _287.length]);
|
|
4014
4168
|
const hasTitle = !!panel.title || hasLinks || !!problem;
|
|
4015
|
-
const title = panel.title ?
|
|
4016
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4017
|
-
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style:
|
|
4018
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4019
|
-
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4169
|
+
const title = panel.title ? _chunkCU4TMSZEjs.interpolate.call(void 0, panel.title, { values: variables, info: variableInfo2, scoped: panel.scopedVars, timezone: dashboard.timezone }) : "";
|
|
4170
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles15.card, { width, height, backgroundColor: theme.surface, borderColor: theme.border }], children: [
|
|
4171
|
+
hasTitle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: styles15.titleRow, children: [
|
|
4172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.title, { color: theme.text }], numberOfLines: 1, children: title }),
|
|
4173
|
+
!!problem && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.problem, { color: theme.danger }], numberOfLines: 1, accessibilityRole: "alert", children: problem }),
|
|
4020
4174
|
hasLinks && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4021
4175
|
_reactnative.Pressable,
|
|
4022
4176
|
{
|
|
@@ -4024,28 +4178,28 @@ function PanelCardContent({ panel, width, height, deferred }) {
|
|
|
4024
4178
|
accessibilityRole: "button",
|
|
4025
4179
|
accessibilityLabel: panel.links.length === 1 ? panel.links[0].title || "Open link" : "Panel links",
|
|
4026
4180
|
hitSlop: 10,
|
|
4027
|
-
style: ({ pressed }) => [
|
|
4181
|
+
style: ({ pressed }) => [styles15.titleLink, pressed && { opacity: 0.6 }],
|
|
4028
4182
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkIcon, { color: theme.textMuted })
|
|
4029
4183
|
}
|
|
4030
4184
|
)
|
|
4031
4185
|
] }),
|
|
4032
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4186
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.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 }) })
|
|
4033
4187
|
] });
|
|
4034
4188
|
}
|
|
4035
4189
|
function DataPanelBody({ panel, width, height }) {
|
|
4036
4190
|
const theme = useDashTheme();
|
|
4037
|
-
const needsData =
|
|
4191
|
+
const needsData = _chunkCU4TMSZEjs.panelHasQueries.call(void 0, panel);
|
|
4038
4192
|
const data = usePanelData(panel, width, needsData);
|
|
4039
4193
|
const Component2 = panelComponent(panel.type);
|
|
4040
4194
|
if (needsData && data.error) {
|
|
4041
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4195
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles15.error, { color: theme.danger }], numberOfLines: 4, children: data.error }) });
|
|
4042
4196
|
}
|
|
4043
4197
|
if (needsData && data.loading && !data.frames.length) {
|
|
4044
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style:
|
|
4198
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: styles15.center, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.ActivityIndicator, { color: theme.textMuted }) });
|
|
4045
4199
|
}
|
|
4046
4200
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component2, { panel, frames: data.frames, width, height });
|
|
4047
4201
|
}
|
|
4048
|
-
var
|
|
4202
|
+
var styles15 = _reactnative.StyleSheet.create({
|
|
4049
4203
|
fill: { flex: 1 },
|
|
4050
4204
|
content: { padding: SIDE, paddingBottom: 32, gap: GAP2 },
|
|
4051
4205
|
section: { gap: GAP2 },
|
|
@@ -4070,41 +4224,107 @@ var styles14 = _reactnative.StyleSheet.create({
|
|
|
4070
4224
|
|
|
4071
4225
|
|
|
4072
4226
|
|
|
4227
|
+
// src/ui/speech.ts
|
|
4228
|
+
var WEB_ERRORS = {
|
|
4229
|
+
"not-allowed": "Microphone access is blocked for this site",
|
|
4230
|
+
"service-not-allowed": "Speech recognition isn\u2019t allowed in this browser",
|
|
4231
|
+
"audio-capture": "No microphone found",
|
|
4232
|
+
network: "Speech recognition needs an internet connection",
|
|
4233
|
+
"no-speech": "Didn\u2019t hear anything",
|
|
4234
|
+
"language-not-supported": "Speech recognition doesn\u2019t support this language"
|
|
4235
|
+
};
|
|
4236
|
+
function webSpeechRecognizer() {
|
|
4237
|
+
const g = globalThis;
|
|
4238
|
+
const Recognition = _nullishCoalesce(g.SpeechRecognition, () => ( g.webkitSpeechRecognition));
|
|
4239
|
+
if (!Recognition) return null;
|
|
4240
|
+
return {
|
|
4241
|
+
start(o) {
|
|
4242
|
+
const r = new Recognition();
|
|
4243
|
+
if (o.lang) r.lang = o.lang;
|
|
4244
|
+
r.interimResults = true;
|
|
4245
|
+
r.continuous = false;
|
|
4246
|
+
r.maxAlternatives = 1;
|
|
4247
|
+
let delivered = false;
|
|
4248
|
+
let aborted = false;
|
|
4249
|
+
let lastText = "";
|
|
4250
|
+
r.onresult = (e) => {
|
|
4251
|
+
let text = "";
|
|
4252
|
+
let final = true;
|
|
4253
|
+
for (let i = 0; i < e.results.length; i++) {
|
|
4254
|
+
text += e.results[i][0].transcript;
|
|
4255
|
+
if (!e.results[i].isFinal) final = false;
|
|
4256
|
+
}
|
|
4257
|
+
lastText = text.trim();
|
|
4258
|
+
if (final) delivered = true;
|
|
4259
|
+
o.onText(lastText, final);
|
|
4260
|
+
};
|
|
4261
|
+
r.onerror = (e) => {
|
|
4262
|
+
if (e.error === "aborted") return;
|
|
4263
|
+
o.onError(_nullishCoalesce(WEB_ERRORS[e.error], () => ( "Speech recognition stopped")));
|
|
4264
|
+
};
|
|
4265
|
+
r.onend = () => {
|
|
4266
|
+
if (!delivered && !aborted && lastText) o.onText(lastText, true);
|
|
4267
|
+
o.onEnd();
|
|
4268
|
+
};
|
|
4269
|
+
try {
|
|
4270
|
+
r.start();
|
|
4271
|
+
} catch (e7) {
|
|
4272
|
+
queueMicrotask(() => {
|
|
4273
|
+
o.onError("Speech recognition couldn\u2019t start");
|
|
4274
|
+
o.onEnd();
|
|
4275
|
+
});
|
|
4276
|
+
}
|
|
4277
|
+
return {
|
|
4278
|
+
stop: () => r.stop(),
|
|
4279
|
+
abort: () => {
|
|
4280
|
+
aborted = true;
|
|
4281
|
+
r.abort();
|
|
4282
|
+
}
|
|
4283
|
+
};
|
|
4284
|
+
}
|
|
4285
|
+
};
|
|
4286
|
+
}
|
|
4287
|
+
|
|
4288
|
+
// src/ui/inputs/InputForm.tsx
|
|
4289
|
+
|
|
4073
4290
|
var NO_CHOICES = {};
|
|
4074
4291
|
var NO_DEFAULTS = {};
|
|
4292
|
+
var webSpeech;
|
|
4293
|
+
var defaultSpeech = () => _reactnative.Platform.OS === "web" ? webSpeech ??= webSpeechRecognizer() : null;
|
|
4075
4294
|
function savedValues(panels, entries) {
|
|
4076
4295
|
const values = {};
|
|
4077
4296
|
for (const p of panels) {
|
|
4078
4297
|
const mine = entries.filter((e) => e.metric === p.options.metric);
|
|
4079
|
-
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null :
|
|
4298
|
+
values[p.options.metric] = p.options.multi ? mine.length ? mine.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : null : _chunkCU4TMSZEjs.entryToInputValue.call(void 0, p, mine[0]);
|
|
4080
4299
|
}
|
|
4081
4300
|
return values;
|
|
4082
4301
|
}
|
|
4083
4302
|
async function lastItems(store, group) {
|
|
4084
|
-
const metrics =
|
|
4303
|
+
const metrics = _chunkCU4TMSZEjs.groupFields.call(void 0, group).map((f) => f.options.metric);
|
|
4085
4304
|
const latest = (await Promise.all(metrics.map((m) => store.latest(m)))).filter((e) => !!e).sort((a, b) => b.ts - a.ts)[0];
|
|
4086
4305
|
if (!latest) return [];
|
|
4087
|
-
return
|
|
4306
|
+
return _chunkCU4TMSZEjs.entriesToItems.call(void 0, group, _chunkCU4TMSZEjs.sameSave.call(void 0, latest, await store.list({ metrics, from: latest.ts, to: latest.ts })));
|
|
4088
4307
|
}
|
|
4089
4308
|
function freshItem(group, position, last) {
|
|
4090
4309
|
const item = {};
|
|
4091
|
-
for (const f of
|
|
4310
|
+
for (const f of _chunkCU4TMSZEjs.groupFields.call(void 0, group)) {
|
|
4092
4311
|
const d = f.options.default;
|
|
4093
|
-
const v = d === "last" ? _optionalChain([last, 'optionalAccess',
|
|
4312
|
+
const v = d === "last" ? _optionalChain([last, 'optionalAccess', _288 => _288[position], 'optionalAccess', _289 => _289[f.options.metric]]) : d;
|
|
4094
4313
|
if (v !== void 0 && v !== null) item[f.options.metric] = v;
|
|
4095
4314
|
}
|
|
4096
4315
|
return item;
|
|
4097
4316
|
}
|
|
4098
4317
|
function baseItems(group, editing, last) {
|
|
4099
4318
|
const start = group.options.start;
|
|
4100
|
-
const values = editing ?
|
|
4319
|
+
const values = editing ? _chunkCU4TMSZEjs.entriesToItems.call(void 0, group, editing) : start === "last" && _optionalChain([last, 'optionalAccess', _290 => _290.length]) ? last : Array.from({ length: typeof start === "number" ? Math.max(0, start) : 1 }, (_, i) => freshItem(group, i, last));
|
|
4101
4320
|
return values.map((v, i) => ({ key: `b${i}`, values: v, edited: [] }));
|
|
4102
4321
|
}
|
|
4103
4322
|
var nextItemKey = 1;
|
|
4104
|
-
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing }) {
|
|
4323
|
+
function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, timestamp, defaults: given = NO_DEFAULTS, beforeSave, editing, speech: givenSpeech, speechLang }) {
|
|
4324
|
+
const speech = givenSpeech === void 0 ? defaultSpeech() : givenSpeech;
|
|
4105
4325
|
const theme = useDashTheme();
|
|
4106
|
-
const panels = _react.useMemo.call(void 0, () =>
|
|
4107
|
-
const groups = _react.useMemo.call(void 0, () =>
|
|
4326
|
+
const panels = _react.useMemo.call(void 0, () => _chunkCU4TMSZEjs.plainInputPanels.call(void 0, dashboard), [dashboard]);
|
|
4327
|
+
const groups = _react.useMemo.call(void 0, () => _chunkCU4TMSZEjs.inputGroups.call(void 0, dashboard), [dashboard]);
|
|
4108
4328
|
const saved = _react.useMemo.call(void 0, () => editing ? savedValues(panels, editing) : NO_DEFAULTS, [panels, editing]);
|
|
4109
4329
|
const [defaults, setDefaults] = _react.useState.call(void 0, {});
|
|
4110
4330
|
const [edits, setEdits] = _react.useState.call(void 0, {});
|
|
@@ -4120,12 +4340,12 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4120
4340
|
const next = {};
|
|
4121
4341
|
for (const p of panels) {
|
|
4122
4342
|
const d = p.options.default;
|
|
4123
|
-
if (d === "last") next[p.options.metric] =
|
|
4343
|
+
if (d === "last") next[p.options.metric] = _chunkCU4TMSZEjs.entryToInputValue.call(void 0, p, await store.latest(p.options.metric));
|
|
4124
4344
|
else if (d !== void 0) next[p.options.metric] = d;
|
|
4125
4345
|
}
|
|
4126
4346
|
const lastNext = {};
|
|
4127
4347
|
for (const g of groups) {
|
|
4128
|
-
const wanted = g.options.start === "last" ||
|
|
4348
|
+
const wanted = g.options.start === "last" || _chunkCU4TMSZEjs.groupFields.call(void 0, g).some((f) => f.options.default === "last");
|
|
4129
4349
|
if (wanted) lastNext[groupKey(g)] = await lastItems(store, g);
|
|
4130
4350
|
}
|
|
4131
4351
|
if (mine === run) {
|
|
@@ -4153,37 +4373,39 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4153
4373
|
isDirty: (m) => m in edits,
|
|
4154
4374
|
store,
|
|
4155
4375
|
choices,
|
|
4376
|
+
speech,
|
|
4377
|
+
speechLang,
|
|
4156
4378
|
problem: (m) => {
|
|
4157
4379
|
const p = panels.find((x) => x.options.metric === m);
|
|
4158
|
-
return p && (checked || m in edits) ?
|
|
4380
|
+
return p && (checked || m in edits) ? _chunkCU4TMSZEjs.inputProblem.call(void 0, p, value(m)) : void 0;
|
|
4159
4381
|
},
|
|
4160
4382
|
group: (g) => groupState(g, itemsOf(g), last[groupKey(g)], groupKey(g) in groupEdits, checked, (update) => {
|
|
4161
4383
|
setStatus(null);
|
|
4162
4384
|
setGroupEdits((all) => ({ ...all, [groupKey(g)]: update(_nullishCoalesce(_nullishCoalesce(all[groupKey(g)], () => ( base[groupKey(g)])), () => ( []))) }));
|
|
4163
4385
|
})
|
|
4164
4386
|
};
|
|
4165
|
-
}, [edits, saved, defaults, given, store, choices, panels, checked, itemsOf, last, groupEdits, base]);
|
|
4387
|
+
}, [edits, saved, defaults, given, store, choices, speech, speechLang, panels, checked, itemsOf, last, groupEdits, base]);
|
|
4166
4388
|
const dirty = Object.keys(edits).length + groups.reduce((n, g) => n + groupChanges(_nullishCoalesce(base[groupKey(g)], () => ( [])), groupEdits[groupKey(g)]), 0);
|
|
4167
4389
|
const recordedGroups = _react.useCallback.call(void 0,
|
|
4168
|
-
() => groups.filter((g) => editing || groupKey(g) in groupEdits ||
|
|
4390
|
+
() => groups.filter((g) => editing || groupKey(g) in groupEdits || _chunkCU4TMSZEjs.groupFields.call(void 0, g).some((f) => f.options.record === "always")),
|
|
4169
4391
|
[groups, editing, groupEdits]
|
|
4170
4392
|
);
|
|
4171
4393
|
const save = _react.useCallback.call(void 0, async () => {
|
|
4172
4394
|
const problems = panels.flatMap((p) => {
|
|
4173
|
-
const problem =
|
|
4395
|
+
const problem = _chunkCU4TMSZEjs.inputProblem.call(void 0, p, state.value(p.options.metric));
|
|
4174
4396
|
return problem ? [`${p.title || p.options.metric}: ${problem.toLowerCase()}`] : [];
|
|
4175
4397
|
});
|
|
4176
|
-
for (const g of recordedGroups()) problems.push(...
|
|
4398
|
+
for (const g of recordedGroups()) problems.push(..._chunkCU4TMSZEjs.groupProblems.call(void 0, g, itemsOf(g).map((i) => i.values)));
|
|
4177
4399
|
if (problems.length) {
|
|
4178
4400
|
setChecked(true);
|
|
4179
4401
|
setStatus(problems.length === 1 ? `Can\u2019t save. ${problems[0]}` : `Can\u2019t save: ${problems.length} fields need fixing`);
|
|
4180
4402
|
return;
|
|
4181
4403
|
}
|
|
4182
|
-
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
4183
|
-
const saveId = _nullishCoalesce(_optionalChain([editing, 'optionalAccess',
|
|
4404
|
+
const ts = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _291 => _291[0], 'optionalAccess', _292 => _292.ts]), () => ( (header !== void 0 ? _nullishCoalesce(_optionalChain([timestamp, 'optionalCall', _293 => _293()]), () => ( Date.now())) : Date.now() + offsetMs)));
|
|
4405
|
+
const saveId = _nullishCoalesce(_optionalChain([editing, 'optionalAccess', _294 => _294.find, 'call', _295 => _295((e) => e.save), 'optionalAccess', _296 => _296.save]), () => ( _chunkCU4TMSZEjs.newSaveId.call(void 0, )));
|
|
4184
4406
|
const entries = [
|
|
4185
|
-
...panels.filter((p) => editing || p.options.metric in edits || p.options.record === "always").flatMap((p) =>
|
|
4186
|
-
...recordedGroups().flatMap((g) =>
|
|
4407
|
+
...panels.filter((p) => editing || p.options.metric in edits || p.options.record === "always").flatMap((p) => _chunkCU4TMSZEjs.toEntries.call(void 0, p, state.value(p.options.metric), ts, { save: saveId })),
|
|
4408
|
+
...recordedGroups().flatMap((g) => _chunkCU4TMSZEjs.groupToEntries.call(void 0, g, itemsOf(g).map((i) => i.values), ts, saveId))
|
|
4187
4409
|
];
|
|
4188
4410
|
if (!entries.length) return;
|
|
4189
4411
|
const extra = beforeSave ? await beforeSave(ts) : [];
|
|
@@ -4194,14 +4416,14 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4194
4416
|
setChecked(false);
|
|
4195
4417
|
setOffsetMs(0);
|
|
4196
4418
|
setStatus(`Saved ${added.length} ${added.length === 1 ? "value" : "values"}`);
|
|
4197
|
-
_optionalChain([onSaved, 'optionalCall',
|
|
4419
|
+
_optionalChain([onSaved, 'optionalCall', _297 => _297(added.length, added)]);
|
|
4198
4420
|
}, [panels, edits, state, offsetMs, store, onSaved, header, timestamp, beforeSave, editing, recordedGroups, itemsOf]);
|
|
4199
4421
|
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,
|
|
4200
4422
|
DashboardView,
|
|
4201
4423
|
{
|
|
4202
4424
|
header: header !== void 0 ? header : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TimestampPicker, { offsetMs, onChange: setOffsetMs }),
|
|
4203
|
-
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4204
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4425
|
+
footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles16.footer, { backgroundColor: theme.surface, borderTopColor: theme.border }], children: [
|
|
4426
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles16.status, { color: _optionalChain([status, 'optionalAccess', _298 => _298.startsWith, 'call', _299 => _299("Can\u2019t")]) ? theme.danger : theme.textSecondary }], children: _nullishCoalesce(status, () => ( (dirty ? `${dirty} unsaved ${dirty === 1 ? "change" : "changes"}` : "Nothing to save"))) }),
|
|
4205
4427
|
dirty > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4206
4428
|
_reactnative.Pressable,
|
|
4207
4429
|
{
|
|
@@ -4211,7 +4433,7 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4211
4433
|
setChecked(false);
|
|
4212
4434
|
setStatus(null);
|
|
4213
4435
|
},
|
|
4214
|
-
style:
|
|
4436
|
+
style: styles16.secondary,
|
|
4215
4437
|
accessibilityRole: "button",
|
|
4216
4438
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.textSecondary, fontWeight: "500" }, children: "Discard" })
|
|
4217
4439
|
}
|
|
@@ -4222,8 +4444,8 @@ function InputForm({ dashboard, store, onSaved, choices = NO_CHOICES, header, ti
|
|
|
4222
4444
|
onPress: save,
|
|
4223
4445
|
disabled: !dirty,
|
|
4224
4446
|
accessibilityRole: "button",
|
|
4225
|
-
style: ({ pressed }) => [
|
|
4226
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style:
|
|
4447
|
+
style: ({ pressed }) => [styles16.save, { backgroundColor: theme.accent, opacity: !dirty ? 0.4 : pressed ? 0.8 : 1 }],
|
|
4448
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: styles16.saveText, children: "Save" })
|
|
4227
4449
|
}
|
|
4228
4450
|
)
|
|
4229
4451
|
] })
|
|
@@ -4237,14 +4459,14 @@ function groupChanges(base, items) {
|
|
|
4237
4459
|
const edited = items.reduce((n, i) => n + (baseKeys.has(i.key) ? i.edited.length : 0), 0);
|
|
4238
4460
|
const added = items.filter((i) => !baseKeys.has(i.key)).length;
|
|
4239
4461
|
const removed = base.filter((i) => !keys.has(i.key)).length;
|
|
4240
|
-
const moved = edited + added + removed === 0 && items.some((i, n) => _optionalChain([base, 'access',
|
|
4462
|
+
const moved = edited + added + removed === 0 && items.some((i, n) => _optionalChain([base, 'access', _300 => _300[n], 'optionalAccess', _301 => _301.key]) !== i.key) ? 1 : 0;
|
|
4241
4463
|
return edited + added + removed + moved;
|
|
4242
4464
|
}
|
|
4243
4465
|
function groupState(group, items, last, edited, showProblems, update) {
|
|
4244
|
-
const fields =
|
|
4466
|
+
const fields = _chunkCU4TMSZEjs.groupFields.call(void 0, group);
|
|
4245
4467
|
const { max } = group.options;
|
|
4246
4468
|
const fresh = (position) => ({ key: `n${nextItemKey++}`, values: freshItem(group, position, last), edited: [] });
|
|
4247
|
-
const filled = items.filter((i) => !
|
|
4469
|
+
const filled = items.filter((i) => !_chunkCU4TMSZEjs.isEmptyItem.call(void 0, group, i.values)).length;
|
|
4248
4470
|
const { min } = group.options;
|
|
4249
4471
|
return {
|
|
4250
4472
|
items: items.map((i) => ({ key: i.key, values: i.values, edited: i.edited })),
|
|
@@ -4269,8 +4491,8 @@ function groupState(group, items, last, edited, showProblems, update) {
|
|
|
4269
4491
|
fieldProblem: (index, metric) => {
|
|
4270
4492
|
const item = items[index];
|
|
4271
4493
|
const field = fields.find((f) => f.options.metric === metric);
|
|
4272
|
-
if (!item || !field ||
|
|
4273
|
-
return showProblems || item.edited.includes(metric) ?
|
|
4494
|
+
if (!item || !field || _chunkCU4TMSZEjs.isEmptyItem.call(void 0, group, item.values)) return void 0;
|
|
4495
|
+
return showProblems || item.edited.includes(metric) ? _chunkCU4TMSZEjs.inputProblem.call(void 0, field, _nullishCoalesce(item.values[metric], () => ( null))) : void 0;
|
|
4274
4496
|
}
|
|
4275
4497
|
};
|
|
4276
4498
|
}
|
|
@@ -4289,20 +4511,20 @@ function TimestampPicker({ offsetMs, onChange }) {
|
|
|
4289
4511
|
}, []);
|
|
4290
4512
|
const when = new Date(now + offsetMs);
|
|
4291
4513
|
const step = (ms) => () => onChange(Math.min(0, offsetMs + ms));
|
|
4292
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [
|
|
4514
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles16.when, { backgroundColor: theme.surface, borderColor: theme.border }], children: [
|
|
4293
4515
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: { flex: 1 }, children: [
|
|
4294
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [
|
|
4516
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles16.whenLabel, { color: theme.textMuted }], children: "Recording for" }),
|
|
4517
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: [styles16.whenValue, { color: theme.text }], children: offsetMs === 0 ? "Now" : when.toLocaleString(void 0, { weekday: "short", month: "short", day: "numeric", hour: "numeric", minute: "2-digit" }) })
|
|
4296
4518
|
] }),
|
|
4297
4519
|
[
|
|
4298
4520
|
["\u22121d", -24 * HOUR],
|
|
4299
4521
|
["\u22121h", -HOUR],
|
|
4300
4522
|
["+1h", HOUR]
|
|
4301
|
-
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [
|
|
4302
|
-
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [
|
|
4523
|
+
].map(([label, ms]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: step(ms), style: [styles16.stepBtn, { borderColor: theme.border }], accessibilityRole: "button", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style: { color: theme.text, fontSize: 13 }, children: label }) }, label)),
|
|
4524
|
+
offsetMs !== 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Pressable, { onPress: () => onChange(0), style: [styles16.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" }) })
|
|
4303
4525
|
] });
|
|
4304
4526
|
}
|
|
4305
|
-
var
|
|
4527
|
+
var styles16 = _reactnative.StyleSheet.create({
|
|
4306
4528
|
footer: { flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 16, paddingVertical: 10, borderTopWidth: _reactnative.StyleSheet.hairlineWidth },
|
|
4307
4529
|
status: { flex: 1, fontSize: 13 },
|
|
4308
4530
|
secondary: { paddingHorizontal: 8, paddingVertical: 10 },
|
|
@@ -4569,4 +4791,13 @@ var styles15 = _reactnative.StyleSheet.create({
|
|
|
4569
4791
|
|
|
4570
4792
|
|
|
4571
4793
|
|
|
4572
|
-
exports.ALL = _chunkG67L7TFKjs.ALL; exports.AUTHORING_GUIDE = _chunkG67L7TFKjs.AUTHORING_GUIDE; exports.BUNDLE_ACCEPT = _chunkG67L7TFKjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkG67L7TFKjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkG67L7TFKjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkG67L7TFKjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkG67L7TFKjs.ConfigLoader; exports.DASHBOARD_DS = _chunkG67L7TFKjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkG67L7TFKjs.DEFAULT_GAZETTEER; exports.DOCUMENT_GUIDE = _chunkG67L7TFKjs.DOCUMENT_GUIDE; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkG67L7TFKjs.EDITABLE_VARIABLE_TYPES; exports.EXAMPLE_TEMPLATE = _chunkG67L7TFKjs.EXAMPLE_TEMPLATE; exports.GRID_COLUMNS = _chunkG67L7TFKjs.GRID_COLUMNS; exports.GROUP_FIELD_TYPES = _chunkG67L7TFKjs.GROUP_FIELD_TYPES; exports.GrafanaClient = _chunkG67L7TFKjs.GrafanaClient; exports.GrafanaDataSource = _chunkG67L7TFKjs.GrafanaDataSource; exports.GrafanaError = _chunkG67L7TFKjs.GrafanaError; exports.HttpConfigFiles = _chunkG67L7TFKjs.HttpConfigFiles; exports.INPUT_GROUP = _chunkG67L7TFKjs.INPUT_GROUP; exports.INPUT_OPTION_KEYS = _chunkG67L7TFKjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkG67L7TFKjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkG67L7TFKjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkG67L7TFKjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkG67L7TFKjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkG67L7TFKjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkG67L7TFKjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkG67L7TFKjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkG67L7TFKjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkG67L7TFKjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkG67L7TFKjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkG67L7TFKjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkG67L7TFKjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkG67L7TFKjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkG67L7TFKjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkG67L7TFKjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkG67L7TFKjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkG67L7TFKjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunkG67L7TFKjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunkG67L7TFKjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkG67L7TFKjs.UNIT_CHOICES; exports.addTime = _chunkG67L7TFKjs.addTime; exports.appSchema = _chunkG67L7TFKjs.appSchema; exports.applyDashboardLink = _chunkG67L7TFKjs.applyDashboardLink; exports.applyJsonEdits = _chunkG67L7TFKjs.applyJsonEdits; exports.applyTemplate = _chunkG67L7TFKjs.applyTemplate; exports.applyTransformations = _chunkG67L7TFKjs.applyTransformations; exports.assembleBundle = _chunkG67L7TFKjs.assembleBundle; exports.assembleFromResponse = _chunkG67L7TFKjs.assembleFromResponse; exports.buildFrames = _chunkG67L7TFKjs.buildFrames; exports.bundleFromFiles = _chunkG67L7TFKjs.bundleFromFiles; exports.bundleRoot = _chunkG67L7TFKjs.bundleRoot; exports.calculateInterval = _chunkG67L7TFKjs.calculateInterval; exports.checkFiles = _chunkG67L7TFKjs.checkFiles; exports.cleanDashboard = _chunkG67L7TFKjs.cleanDashboard; exports.cleanPanelOptions = _chunkG67L7TFKjs.cleanPanelOptions; exports.collapseRow = _chunkG67L7TFKjs.collapseRow; exports.compactGrid = _chunkG67L7TFKjs.compactGrid; exports.copyPanels = _chunkG67L7TFKjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkG67L7TFKjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkG67L7TFKjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkG67L7TFKjs.dashboardSourceIds; exports.defaultFetchJson = _chunkG67L7TFKjs.defaultFetchJson; exports.describeRange = _chunkG67L7TFKjs.describeRange; exports.diffJson = _chunkG67L7TFKjs.diffJson; exports.documentChanges = _chunkG67L7TFKjs.documentChanges; exports.documentIdFor = _chunkG67L7TFKjs.documentIdFor; exports.documentKind = _chunkG67L7TFKjs.documentKind; exports.documentPrompt = _chunkG67L7TFKjs.documentPrompt; exports.documentUses = _chunkG67L7TFKjs.documentUses; exports.dropTarget = _chunkG67L7TFKjs.dropTarget; exports.duplicatePanel = _chunkG67L7TFKjs.duplicatePanel; exports.entriesSavedWith = _chunkG67L7TFKjs.entriesSavedWith; exports.entriesToItems = _chunkG67L7TFKjs.entriesToItems; exports.entryToInputValue = _chunkG67L7TFKjs.entryToInputValue; exports.expandRow = _chunkG67L7TFKjs.expandRow; exports.fetchBundle = _chunkG67L7TFKjs.fetchBundle; exports.fetchJsonWithToken = _chunkG67L7TFKjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkG67L7TFKjs.fieldDisplayName; exports.fieldMatches = _chunkG67L7TFKjs.fieldMatches; exports.fixDocumentPrompt = _chunkG67L7TFKjs.fixDocumentPrompt; exports.fixTemplatePrompt = _chunkG67L7TFKjs.fixTemplatePrompt; exports.formatClock = _chunkG67L7TFKjs.formatClock; exports.formatDisplay = _chunkG67L7TFKjs.formatDisplay; exports.formatDuration = _chunkG67L7TFKjs.formatDuration; exports.formatJsonText = _chunkG67L7TFKjs.formatJsonText; exports.formatLocalDateTime = _chunkG67L7TFKjs.formatLocalDateTime; exports.formatValue = _chunkG67L7TFKjs.formatValue; exports.frameLength = _chunkG67L7TFKjs.frameLength; exports.framesToOptions = _chunkG67L7TFKjs.framesToOptions; exports.fromWire = _chunkG67L7TFKjs.fromWire; exports.getPath = _chunkG67L7TFKjs.getPath; exports.gridOffsetPx = _chunkG67L7TFKjs.gridOffsetPx; exports.gridUnitsToPx = _chunkG67L7TFKjs.gridUnitsToPx; exports.groupField = _chunkG67L7TFKjs.groupField; exports.groupFields = _chunkG67L7TFKjs.groupFields; exports.groupKey = groupKey; exports.groupProblems = _chunkG67L7TFKjs.groupProblems; exports.groupToEntries = _chunkG67L7TFKjs.groupToEntries; exports.httpFetchJson = _chunkG67L7TFKjs.httpFetchJson; exports.initialVariableValues = _chunkG67L7TFKjs.initialVariableValues; exports.inputGroups = _chunkG67L7TFKjs.inputGroups; exports.inputPanels = _chunkG67L7TFKjs.inputPanels; exports.inputProblem = _chunkG67L7TFKjs.inputProblem; exports.insertPanel = _chunkG67L7TFKjs.insertPanel; exports.interpolate = _chunkG67L7TFKjs.interpolate; exports.interpolateDeep = _chunkG67L7TFKjs.interpolateDeep; exports.isBundleResponse = _chunkG67L7TFKjs.isBundleResponse; exports.isEditableVariableType = _chunkG67L7TFKjs.isEditableVariableType; exports.isEmptyItem = _chunkG67L7TFKjs.isEmptyItem; exports.isFormPanelType = _chunkG67L7TFKjs.isFormPanelType; exports.isInputGroup = _chunkG67L7TFKjs.isInputGroup; exports.isInputPanel = _chunkG67L7TFKjs.isInputPanel; exports.isInputType = _chunkG67L7TFKjs.isInputType; exports.isLocalDatasource = _chunkG67L7TFKjs.isLocalDatasource; exports.isReducer = _chunkG67L7TFKjs.isReducer; exports.isRow = _chunkG67L7TFKjs.isRow; exports.isSqlDatasource = _chunkG67L7TFKjs.isSqlDatasource; exports.jsonFromAnswer = _chunkG67L7TFKjs.jsonFromAnswer; exports.layoutCanvas = _chunkG67L7TFKjs.layoutCanvas; exports.layoutDashboard = _chunkG67L7TFKjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkG67L7TFKjs.lineColumn; exports.loadGazetteer = _chunkG67L7TFKjs.loadGazetteer; exports.locate = _chunkG67L7TFKjs.locate; exports.makeTemplate = _chunkG67L7TFKjs.makeTemplate; exports.manifestSchemaIssues = _chunkG67L7TFKjs.manifestSchemaIssues; exports.mappedResult = _chunkG67L7TFKjs.mappedResult; exports.mappingProblem = _chunkG67L7TFKjs.mappingProblem; exports.mappingRow = _chunkG67L7TFKjs.mappingRow; exports.mappingRows = _chunkG67L7TFKjs.mappingRows; exports.metricChanges = _chunkG67L7TFKjs.metricChanges; exports.movePanel = _chunkG67L7TFKjs.movePanel; exports.newDocument = _chunkG67L7TFKjs.newDocument; exports.newPanel = _chunkG67L7TFKjs.newPanel; exports.newSaveId = _chunkG67L7TFKjs.newSaveId; exports.newVariable = _chunkG67L7TFKjs.newVariable; exports.nextPanelId = _chunkG67L7TFKjs.nextPanelId; exports.normalizeRef = _chunkG67L7TFKjs.normalizeRef; exports.numberFields = _chunkG67L7TFKjs.numberFields; exports.optionValue = _chunkG67L7TFKjs.optionValue; exports.overrideProperties = _chunkG67L7TFKjs.overrideProperties; exports.panelEdits = _chunkG67L7TFKjs.panelEdits; exports.panelHasQueries = _chunkG67L7TFKjs.panelHasQueries; exports.panelKey = _chunkG67L7TFKjs.panelKey; exports.panelMetrics = _chunkG67L7TFKjs.panelMetrics; exports.panelOptions = _chunkG67L7TFKjs.panelOptions; exports.panelOverrides = _chunkG67L7TFKjs.panelOverrides; exports.panelSize = _chunkG67L7TFKjs.panelSize; exports.panelSpan = _chunkG67L7TFKjs.panelSpan; exports.parseClockDigits = _chunkG67L7TFKjs.parseClockDigits; exports.parseDashboardLink = _chunkG67L7TFKjs.parseDashboardLink; exports.parseDuration = _chunkG67L7TFKjs.parseDuration; exports.parseGazetteer = _chunkG67L7TFKjs.parseGazetteer; exports.parseJsonText = _chunkG67L7TFKjs.parseJsonText; exports.parseLocalDateTime = _chunkG67L7TFKjs.parseLocalDateTime; exports.parseRange = _chunkG67L7TFKjs.parseRange; exports.parseSnippet = _chunkG67L7TFKjs.parseSnippet; exports.parseTemplate = _chunkG67L7TFKjs.parseTemplate; exports.parseTime = _chunkG67L7TFKjs.parseTime; exports.pasteSnippet = _chunkG67L7TFKjs.pasteSnippet; exports.placePanel = _chunkG67L7TFKjs.placePanel; exports.plainInputPanels = _chunkG67L7TFKjs.plainInputPanels; exports.pointerToPath = _chunkG67L7TFKjs.pointerToPath; exports.prepareDashboard = _chunkG67L7TFKjs.prepareDashboard; exports.previewPaste = _chunkG67L7TFKjs.previewPaste; exports.queryPanel = _chunkG67L7TFKjs.queryPanel; exports.queryParam = _chunkG67L7TFKjs.queryParam; exports.readConfigFiles = _chunkG67L7TFKjs.readConfigFiles; exports.readDocumentAnswer = _chunkG67L7TFKjs.readDocumentAnswer; exports.readTemplateAnswer = _chunkG67L7TFKjs.readTemplateAnswer; exports.readingOrder = _chunkG67L7TFKjs.readingOrder; exports.reduce = _chunkG67L7TFKjs.reduce; exports.refineOptions = _chunkG67L7TFKjs.refineOptions; exports.refreshedVariables = _chunkG67L7TFKjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkG67L7TFKjs.removeDocumentFromManifest; exports.removePanel = _chunkG67L7TFKjs.removePanel; exports.renameDocumentInManifest = _chunkG67L7TFKjs.renameDocumentInManifest; exports.renameMetrics = _chunkG67L7TFKjs.renameMetrics; exports.renameVariableInPanels = _chunkG67L7TFKjs.renameVariableInPanels; exports.repack = _chunkG67L7TFKjs.repack; exports.repeatOptions = _chunkG67L7TFKjs.repeatOptions; exports.requiredManifestVersion = _chunkG67L7TFKjs.requiredManifestVersion; exports.resizePanel = _chunkG67L7TFKjs.resizePanel; exports.resolveColor = _chunkG67L7TFKjs.resolveColor; exports.resolveFieldConfig = _chunkG67L7TFKjs.resolveFieldConfig; exports.resolveLinks = _chunkG67L7TFKjs.resolveLinks; exports.resolveTimezone = _chunkG67L7TFKjs.resolveTimezone; exports.resolveUrl = _chunkG67L7TFKjs.resolveUrl; exports.resolveVariables = _chunkG67L7TFKjs.resolveVariables; exports.revalidateBundle = _chunkG67L7TFKjs.revalidateBundle; exports.rowsToMappings = _chunkG67L7TFKjs.rowsToMappings; exports.sameSave = _chunkG67L7TFKjs.sameSave; exports.sampleEntries = _chunkG67L7TFKjs.sampleEntries; exports.screenDocuments = _chunkG67L7TFKjs.screenDocuments; exports.screenOfType = _chunkG67L7TFKjs.screenOfType; exports.selectValue = _chunkG67L7TFKjs.selectValue; exports.seriesColor = _chunkG67L7TFKjs.seriesColor; exports.setHiddenOnPhones = _chunkG67L7TFKjs.setHiddenOnPhones; exports.setJsonValue = _chunkG67L7TFKjs.setJsonValue; exports.setOption = _chunkG67L7TFKjs.setOption; exports.setOptionValue = _chunkG67L7TFKjs.setOptionValue; exports.setOverrides = _chunkG67L7TFKjs.setOverrides; exports.settleLayout = _chunkG67L7TFKjs.settleLayout; exports.snapToGrid = _chunkG67L7TFKjs.snapToGrid; exports.splitPath = _chunkG67L7TFKjs.splitPath; exports.startOf = _chunkG67L7TFKjs.startOf; exports.stringifyCompact = _chunkG67L7TFKjs.stringifyCompact; exports.tabIdFor = _chunkG67L7TFKjs.tabIdFor; exports.templateNeeds = _chunkG67L7TFKjs.templateNeeds; exports.templatePrompt = _chunkG67L7TFKjs.templatePrompt; exports.textSuggestions = _chunkG67L7TFKjs.textSuggestions; exports.thresholdStep = _chunkG67L7TFKjs.thresholdStep; exports.timeExprError = _chunkG67L7TFKjs.timeExprError; exports.timeField = _chunkG67L7TFKjs.timeField; exports.toEntries = _chunkG67L7TFKjs.toEntries; exports.toMillis = _chunkG67L7TFKjs.toMillis; exports.toSeries = _chunkG67L7TFKjs.toSeries; exports.toXYSeries = _chunkG67L7TFKjs.toXYSeries; exports.uniqueNames = _chunkG67L7TFKjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkG67L7TFKjs.validateBundle; exports.validateDashboard = _chunkG67L7TFKjs.validateDashboard; exports.validateManifest = _chunkG67L7TFKjs.validateManifest; exports.valueColor = _chunkG67L7TFKjs.valueColor; exports.valueText = _chunkG67L7TFKjs.valueText; exports.variableDependents = _chunkG67L7TFKjs.variableDependents; exports.variableInfo = _chunkG67L7TFKjs.variableInfo; exports.variableNameError = _chunkG67L7TFKjs.variableNameError; exports.variableOptions = _chunkG67L7TFKjs.variableOptions; exports.variableOrder = _chunkG67L7TFKjs.variableOrder; exports.variableReferences = _chunkG67L7TFKjs.variableReferences; exports.variableUses = _chunkG67L7TFKjs.variableUses; exports.variableWithCurrent = _chunkG67L7TFKjs.variableWithCurrent; exports.variableWithFlags = _chunkG67L7TFKjs.variableWithFlags; exports.variableWithQuery = _chunkG67L7TFKjs.variableWithQuery; exports.variableWithType = _chunkG67L7TFKjs.variableWithType; exports.visibleVariables = _chunkG67L7TFKjs.visibleVariables; exports.zoomRange = _chunkG67L7TFKjs.zoomRange;
|
|
4794
|
+
|
|
4795
|
+
|
|
4796
|
+
|
|
4797
|
+
|
|
4798
|
+
|
|
4799
|
+
|
|
4800
|
+
|
|
4801
|
+
|
|
4802
|
+
|
|
4803
|
+
exports.ALL = _chunkCU4TMSZEjs.ALL; exports.AUTHORING_GUIDE = _chunkCU4TMSZEjs.AUTHORING_GUIDE; exports.BUNDLE_ACCEPT = _chunkCU4TMSZEjs.BUNDLE_ACCEPT; exports.BUNDLE_TYPE = _chunkCU4TMSZEjs.BUNDLE_TYPE; exports.CANVAS_GAP = _chunkCU4TMSZEjs.CANVAS_GAP; exports.CANVAS_ROW_HEADER = _chunkCU4TMSZEjs.CANVAS_ROW_HEADER; exports.Calendar = Calendar; exports.Chip = Chip; exports.ConfigLoader = _chunkCU4TMSZEjs.ConfigLoader; exports.DASHBOARD_DS = _chunkCU4TMSZEjs.DASHBOARD_DS; exports.DEFAULT_GAZETTEER = _chunkCU4TMSZEjs.DEFAULT_GAZETTEER; exports.DICTATION_TYPES = _chunkCU4TMSZEjs.DICTATION_TYPES; exports.DOCUMENT_GUIDE = _chunkCU4TMSZEjs.DOCUMENT_GUIDE; exports.DashThemeProvider = DashThemeProvider; exports.DashboardProvider = DashboardProvider; exports.DashboardToolbar = DashboardToolbar; exports.DashboardView = DashboardView; exports.EDITABLE_VARIABLE_TYPES = _chunkCU4TMSZEjs.EDITABLE_VARIABLE_TYPES; exports.EXAMPLE_TEMPLATE = _chunkCU4TMSZEjs.EXAMPLE_TEMPLATE; exports.GRID_COLUMNS = _chunkCU4TMSZEjs.GRID_COLUMNS; exports.GROUP_FIELD_TYPES = _chunkCU4TMSZEjs.GROUP_FIELD_TYPES; exports.GrafanaClient = _chunkCU4TMSZEjs.GrafanaClient; exports.GrafanaDataSource = _chunkCU4TMSZEjs.GrafanaDataSource; exports.GrafanaError = _chunkCU4TMSZEjs.GrafanaError; exports.HttpConfigFiles = _chunkCU4TMSZEjs.HttpConfigFiles; exports.INPUT_GROUP = _chunkCU4TMSZEjs.INPUT_GROUP; exports.INPUT_OPTION_KEYS = _chunkCU4TMSZEjs.INPUT_OPTION_KEYS; exports.INPUT_TYPES = _chunkCU4TMSZEjs.INPUT_TYPES; exports.InputForm = InputForm; exports.InputFormContext = InputFormContext; exports.LOCAL_DATASOURCE_TYPE = _chunkCU4TMSZEjs.LOCAL_DATASOURCE_TYPE; exports.Legend = Legend; exports.LocalDataSource = _chunkCU4TMSZEjs.LocalDataSource; exports.MANIFEST_VERSION = _chunkCU4TMSZEjs.MANIFEST_VERSION; exports.MAPPING_TYPES = _chunkCU4TMSZEjs.MAPPING_TYPES; exports.MemoryEntryStore = _chunkCU4TMSZEjs.MemoryEntryStore; exports.NAMED_COLORS = _chunkCU4TMSZEjs.NAMED_COLORS; exports.NoData = NoData; exports.OPTION_CATEGORIES = _chunkCU4TMSZEjs.OPTION_CATEGORIES; exports.OVERRIDE_MATCHERS = _chunkCU4TMSZEjs.OVERRIDE_MATCHERS; exports.PANEL_TYPES = _chunkCU4TMSZEjs.PANEL_TYPES; exports.PanelCard = PanelCard; exports.REDUCER_LABELS = _chunkCU4TMSZEjs.REDUCER_LABELS; exports.REFRESH_CHOICES = _chunkCU4TMSZEjs.REFRESH_CHOICES; exports.RELATIVE_RANGES = _chunkCU4TMSZEjs.RELATIVE_RANGES; exports.RenderBoundary = RenderBoundary; exports.SERIES_PALETTE = _chunkCU4TMSZEjs.SERIES_PALETTE; exports.SNIPPET_VERSION = _chunkCU4TMSZEjs.SNIPPET_VERSION; exports.SPECIAL_MATCHES = _chunkCU4TMSZEjs.SPECIAL_MATCHES; exports.SaveConflictError = _chunkCU4TMSZEjs.SaveConflictError; exports.TEMPLATE_VERSION = _chunkCU4TMSZEjs.TEMPLATE_VERSION; exports.TIME_PRESETS = _chunkCU4TMSZEjs.TIME_PRESETS; exports.UNIT_CHOICES = _chunkCU4TMSZEjs.UNIT_CHOICES; exports.addTime = _chunkCU4TMSZEjs.addTime; exports.appSchema = _chunkCU4TMSZEjs.appSchema; exports.applyDashboardLink = _chunkCU4TMSZEjs.applyDashboardLink; exports.applyJsonEdits = _chunkCU4TMSZEjs.applyJsonEdits; exports.applyTemplate = _chunkCU4TMSZEjs.applyTemplate; exports.applyTransformations = _chunkCU4TMSZEjs.applyTransformations; exports.assembleBundle = _chunkCU4TMSZEjs.assembleBundle; exports.assembleFromResponse = _chunkCU4TMSZEjs.assembleFromResponse; exports.buildFrames = _chunkCU4TMSZEjs.buildFrames; exports.bundleFromFiles = _chunkCU4TMSZEjs.bundleFromFiles; exports.bundleRoot = _chunkCU4TMSZEjs.bundleRoot; exports.calculateInterval = _chunkCU4TMSZEjs.calculateInterval; exports.checkFiles = _chunkCU4TMSZEjs.checkFiles; exports.cleanDashboard = _chunkCU4TMSZEjs.cleanDashboard; exports.cleanPanelOptions = _chunkCU4TMSZEjs.cleanPanelOptions; exports.collapseRow = _chunkCU4TMSZEjs.collapseRow; exports.compactGrid = _chunkCU4TMSZEjs.compactGrid; exports.copyPanels = _chunkCU4TMSZEjs.copyPanels; exports.darkTheme = darkTheme; exports.dashboardSchema = _chunkCU4TMSZEjs.dashboardSchema; exports.dashboardSchemaIssues = _chunkCU4TMSZEjs.dashboardSchemaIssues; exports.dashboardSourceIds = _chunkCU4TMSZEjs.dashboardSourceIds; exports.defaultFetchJson = _chunkCU4TMSZEjs.defaultFetchJson; exports.describeRange = _chunkCU4TMSZEjs.describeRange; exports.dictationHints = _chunkCU4TMSZEjs.dictationHints; exports.diffJson = _chunkCU4TMSZEjs.diffJson; exports.documentChanges = _chunkCU4TMSZEjs.documentChanges; exports.documentIdFor = _chunkCU4TMSZEjs.documentIdFor; exports.documentKind = _chunkCU4TMSZEjs.documentKind; exports.documentPrompt = _chunkCU4TMSZEjs.documentPrompt; exports.documentUses = _chunkCU4TMSZEjs.documentUses; exports.dropTarget = _chunkCU4TMSZEjs.dropTarget; exports.duplicatePanel = _chunkCU4TMSZEjs.duplicatePanel; exports.entriesSavedWith = _chunkCU4TMSZEjs.entriesSavedWith; exports.entriesToItems = _chunkCU4TMSZEjs.entriesToItems; exports.entryToInputValue = _chunkCU4TMSZEjs.entryToInputValue; exports.expandRow = _chunkCU4TMSZEjs.expandRow; exports.fetchBundle = _chunkCU4TMSZEjs.fetchBundle; exports.fetchJsonWithToken = _chunkCU4TMSZEjs.fetchJsonWithToken; exports.fieldDisplayName = _chunkCU4TMSZEjs.fieldDisplayName; exports.fieldMatches = _chunkCU4TMSZEjs.fieldMatches; exports.fixDocumentPrompt = _chunkCU4TMSZEjs.fixDocumentPrompt; exports.fixTemplatePrompt = _chunkCU4TMSZEjs.fixTemplatePrompt; exports.formatClock = _chunkCU4TMSZEjs.formatClock; exports.formatDisplay = _chunkCU4TMSZEjs.formatDisplay; exports.formatDuration = _chunkCU4TMSZEjs.formatDuration; exports.formatJsonText = _chunkCU4TMSZEjs.formatJsonText; exports.formatLocalDateTime = _chunkCU4TMSZEjs.formatLocalDateTime; exports.formatValue = _chunkCU4TMSZEjs.formatValue; exports.frameLength = _chunkCU4TMSZEjs.frameLength; exports.framesToOptions = _chunkCU4TMSZEjs.framesToOptions; exports.fromWire = _chunkCU4TMSZEjs.fromWire; exports.getPath = _chunkCU4TMSZEjs.getPath; exports.gridOffsetPx = _chunkCU4TMSZEjs.gridOffsetPx; exports.gridUnitsToPx = _chunkCU4TMSZEjs.gridUnitsToPx; exports.groupField = _chunkCU4TMSZEjs.groupField; exports.groupFields = _chunkCU4TMSZEjs.groupFields; exports.groupKey = groupKey; exports.groupProblems = _chunkCU4TMSZEjs.groupProblems; exports.groupToEntries = _chunkCU4TMSZEjs.groupToEntries; exports.httpFetchJson = _chunkCU4TMSZEjs.httpFetchJson; exports.initialVariableValues = _chunkCU4TMSZEjs.initialVariableValues; exports.inputGroups = _chunkCU4TMSZEjs.inputGroups; exports.inputPanels = _chunkCU4TMSZEjs.inputPanels; exports.inputProblem = _chunkCU4TMSZEjs.inputProblem; exports.insertPanel = _chunkCU4TMSZEjs.insertPanel; exports.interpolate = _chunkCU4TMSZEjs.interpolate; exports.interpolateDeep = _chunkCU4TMSZEjs.interpolateDeep; exports.isBundleResponse = _chunkCU4TMSZEjs.isBundleResponse; exports.isEditableVariableType = _chunkCU4TMSZEjs.isEditableVariableType; exports.isEmptyItem = _chunkCU4TMSZEjs.isEmptyItem; exports.isFormPanelType = _chunkCU4TMSZEjs.isFormPanelType; exports.isInputGroup = _chunkCU4TMSZEjs.isInputGroup; exports.isInputPanel = _chunkCU4TMSZEjs.isInputPanel; exports.isInputType = _chunkCU4TMSZEjs.isInputType; exports.isLocalDatasource = _chunkCU4TMSZEjs.isLocalDatasource; exports.isReducer = _chunkCU4TMSZEjs.isReducer; exports.isRow = _chunkCU4TMSZEjs.isRow; exports.isSqlDatasource = _chunkCU4TMSZEjs.isSqlDatasource; exports.jsonFromAnswer = _chunkCU4TMSZEjs.jsonFromAnswer; exports.layoutCanvas = _chunkCU4TMSZEjs.layoutCanvas; exports.layoutDashboard = _chunkCU4TMSZEjs.layoutDashboard; exports.lightTheme = lightTheme; exports.lineColumn = _chunkCU4TMSZEjs.lineColumn; exports.loadGazetteer = _chunkCU4TMSZEjs.loadGazetteer; exports.locate = _chunkCU4TMSZEjs.locate; exports.makeTemplate = _chunkCU4TMSZEjs.makeTemplate; exports.manifestSchemaIssues = _chunkCU4TMSZEjs.manifestSchemaIssues; exports.mappedResult = _chunkCU4TMSZEjs.mappedResult; exports.mappingProblem = _chunkCU4TMSZEjs.mappingProblem; exports.mappingRow = _chunkCU4TMSZEjs.mappingRow; exports.mappingRows = _chunkCU4TMSZEjs.mappingRows; exports.matchChoices = _chunkCU4TMSZEjs.matchChoices; exports.metricChanges = _chunkCU4TMSZEjs.metricChanges; exports.movePanel = _chunkCU4TMSZEjs.movePanel; exports.newDocument = _chunkCU4TMSZEjs.newDocument; exports.newPanel = _chunkCU4TMSZEjs.newPanel; exports.newSaveId = _chunkCU4TMSZEjs.newSaveId; exports.newVariable = _chunkCU4TMSZEjs.newVariable; exports.nextPanelId = _chunkCU4TMSZEjs.nextPanelId; exports.normalizeRef = _chunkCU4TMSZEjs.normalizeRef; exports.numberFields = _chunkCU4TMSZEjs.numberFields; exports.optionValue = _chunkCU4TMSZEjs.optionValue; exports.overrideProperties = _chunkCU4TMSZEjs.overrideProperties; exports.panelEdits = _chunkCU4TMSZEjs.panelEdits; exports.panelHasQueries = _chunkCU4TMSZEjs.panelHasQueries; exports.panelKey = _chunkCU4TMSZEjs.panelKey; exports.panelMetrics = _chunkCU4TMSZEjs.panelMetrics; exports.panelOptions = _chunkCU4TMSZEjs.panelOptions; exports.panelOverrides = _chunkCU4TMSZEjs.panelOverrides; exports.panelSize = _chunkCU4TMSZEjs.panelSize; exports.panelSpan = _chunkCU4TMSZEjs.panelSpan; exports.parseClockDigits = _chunkCU4TMSZEjs.parseClockDigits; exports.parseDashboardLink = _chunkCU4TMSZEjs.parseDashboardLink; exports.parseDuration = _chunkCU4TMSZEjs.parseDuration; exports.parseGazetteer = _chunkCU4TMSZEjs.parseGazetteer; exports.parseJsonText = _chunkCU4TMSZEjs.parseJsonText; exports.parseLocalDateTime = _chunkCU4TMSZEjs.parseLocalDateTime; exports.parseRange = _chunkCU4TMSZEjs.parseRange; exports.parseSnippet = _chunkCU4TMSZEjs.parseSnippet; exports.parseSpokenDuration = _chunkCU4TMSZEjs.parseSpokenDuration; exports.parseSpokenNumber = _chunkCU4TMSZEjs.parseSpokenNumber; exports.parseSpokenYesNo = _chunkCU4TMSZEjs.parseSpokenYesNo; exports.parseTemplate = _chunkCU4TMSZEjs.parseTemplate; exports.parseTime = _chunkCU4TMSZEjs.parseTime; exports.pasteSnippet = _chunkCU4TMSZEjs.pasteSnippet; exports.placePanel = _chunkCU4TMSZEjs.placePanel; exports.plainInputPanels = _chunkCU4TMSZEjs.plainInputPanels; exports.pointerToPath = _chunkCU4TMSZEjs.pointerToPath; exports.prepareDashboard = _chunkCU4TMSZEjs.prepareDashboard; exports.previewPaste = _chunkCU4TMSZEjs.previewPaste; exports.queryPanel = _chunkCU4TMSZEjs.queryPanel; exports.queryParam = _chunkCU4TMSZEjs.queryParam; exports.readConfigFiles = _chunkCU4TMSZEjs.readConfigFiles; exports.readDocumentAnswer = _chunkCU4TMSZEjs.readDocumentAnswer; exports.readTemplateAnswer = _chunkCU4TMSZEjs.readTemplateAnswer; exports.readingOrder = _chunkCU4TMSZEjs.readingOrder; exports.reduce = _chunkCU4TMSZEjs.reduce; exports.refineOptions = _chunkCU4TMSZEjs.refineOptions; exports.refreshedVariables = _chunkCU4TMSZEjs.refreshedVariables; exports.registerPanel = registerPanel; exports.removeDocumentFromManifest = _chunkCU4TMSZEjs.removeDocumentFromManifest; exports.removePanel = _chunkCU4TMSZEjs.removePanel; exports.renameDocumentInManifest = _chunkCU4TMSZEjs.renameDocumentInManifest; exports.renameMetrics = _chunkCU4TMSZEjs.renameMetrics; exports.renameVariableInPanels = _chunkCU4TMSZEjs.renameVariableInPanels; exports.repack = _chunkCU4TMSZEjs.repack; exports.repeatOptions = _chunkCU4TMSZEjs.repeatOptions; exports.requiredManifestVersion = _chunkCU4TMSZEjs.requiredManifestVersion; exports.resizePanel = _chunkCU4TMSZEjs.resizePanel; exports.resolveColor = _chunkCU4TMSZEjs.resolveColor; exports.resolveFieldConfig = _chunkCU4TMSZEjs.resolveFieldConfig; exports.resolveLinks = _chunkCU4TMSZEjs.resolveLinks; exports.resolveTimezone = _chunkCU4TMSZEjs.resolveTimezone; exports.resolveUrl = _chunkCU4TMSZEjs.resolveUrl; exports.resolveVariables = _chunkCU4TMSZEjs.resolveVariables; exports.revalidateBundle = _chunkCU4TMSZEjs.revalidateBundle; exports.rowsToMappings = _chunkCU4TMSZEjs.rowsToMappings; exports.sameSave = _chunkCU4TMSZEjs.sameSave; exports.sampleEntries = _chunkCU4TMSZEjs.sampleEntries; exports.screenDocuments = _chunkCU4TMSZEjs.screenDocuments; exports.screenOfType = _chunkCU4TMSZEjs.screenOfType; exports.selectValue = _chunkCU4TMSZEjs.selectValue; exports.seriesColor = _chunkCU4TMSZEjs.seriesColor; exports.setHiddenOnPhones = _chunkCU4TMSZEjs.setHiddenOnPhones; exports.setJsonValue = _chunkCU4TMSZEjs.setJsonValue; exports.setOption = _chunkCU4TMSZEjs.setOption; exports.setOptionValue = _chunkCU4TMSZEjs.setOptionValue; exports.setOverrides = _chunkCU4TMSZEjs.setOverrides; exports.settleLayout = _chunkCU4TMSZEjs.settleLayout; exports.snapToGrid = _chunkCU4TMSZEjs.snapToGrid; exports.splitPath = _chunkCU4TMSZEjs.splitPath; exports.spokenValue = _chunkCU4TMSZEjs.spokenValue; exports.startOf = _chunkCU4TMSZEjs.startOf; exports.stringifyCompact = _chunkCU4TMSZEjs.stringifyCompact; exports.tabIdFor = _chunkCU4TMSZEjs.tabIdFor; exports.takesDictation = _chunkCU4TMSZEjs.takesDictation; exports.templateNeeds = _chunkCU4TMSZEjs.templateNeeds; exports.templatePrompt = _chunkCU4TMSZEjs.templatePrompt; exports.textSuggestions = _chunkCU4TMSZEjs.textSuggestions; exports.thresholdStep = _chunkCU4TMSZEjs.thresholdStep; exports.timeExprError = _chunkCU4TMSZEjs.timeExprError; exports.timeField = _chunkCU4TMSZEjs.timeField; exports.toEntries = _chunkCU4TMSZEjs.toEntries; exports.toMillis = _chunkCU4TMSZEjs.toMillis; exports.toSeries = _chunkCU4TMSZEjs.toSeries; exports.toXYSeries = _chunkCU4TMSZEjs.toXYSeries; exports.uniqueNames = _chunkCU4TMSZEjs.uniqueNames; exports.useDashTheme = useDashTheme; exports.useDashboard = useDashboard; exports.useInputForm = useInputForm; exports.usePanelData = usePanelData; exports.validateBundle = _chunkCU4TMSZEjs.validateBundle; exports.validateDashboard = _chunkCU4TMSZEjs.validateDashboard; exports.validateManifest = _chunkCU4TMSZEjs.validateManifest; exports.valueColor = _chunkCU4TMSZEjs.valueColor; exports.valueText = _chunkCU4TMSZEjs.valueText; exports.variableDependents = _chunkCU4TMSZEjs.variableDependents; exports.variableInfo = _chunkCU4TMSZEjs.variableInfo; exports.variableNameError = _chunkCU4TMSZEjs.variableNameError; exports.variableOptions = _chunkCU4TMSZEjs.variableOptions; exports.variableOrder = _chunkCU4TMSZEjs.variableOrder; exports.variableReferences = _chunkCU4TMSZEjs.variableReferences; exports.variableUses = _chunkCU4TMSZEjs.variableUses; exports.variableWithCurrent = _chunkCU4TMSZEjs.variableWithCurrent; exports.variableWithFlags = _chunkCU4TMSZEjs.variableWithFlags; exports.variableWithQuery = _chunkCU4TMSZEjs.variableWithQuery; exports.variableWithType = _chunkCU4TMSZEjs.variableWithType; exports.visibleVariables = _chunkCU4TMSZEjs.visibleVariables; exports.webSpeechRecognizer = webSpeechRecognizer; exports.zoomRange = _chunkCU4TMSZEjs.zoomRange;
|