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